diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..f5e6ea2dc6eaa4752cd9093677ddf95f2996e0a7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,3 +33,17 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +mm_avh_working_space/bin/balabolka/balcon.exe filter=lfs diff=lfs merge=lfs -text +mm_avh_working_space/bin/esrgan/realesrgan-ncnn-vulkan.exe filter=lfs diff=lfs merge=lfs -text +mm_avh_working_space/bin/ffmpeg/bin/ffmpeg.exe filter=lfs diff=lfs merge=lfs -text +mm_avh_working_space/bin/ffmpeg/bin/ffplay.exe filter=lfs diff=lfs merge=lfs -text +mm_avh_working_space/bin/ffmpeg/bin/ffprobe.exe filter=lfs diff=lfs merge=lfs -text +mm_avh_working_space/bin/mkvtoolnix/mkvextract.exe filter=lfs diff=lfs merge=lfs -text +mm_avh_working_space/bin/mkvtoolnix/mkvinfo.exe filter=lfs diff=lfs merge=lfs -text +mm_avh_working_space/bin/mkvtoolnix/mkvmerge.exe filter=lfs diff=lfs merge=lfs -text +mm_avh_working_space/bin/mkvtoolnix/mkvpropedit.exe filter=lfs diff=lfs merge=lfs -text +mm_avh_working_space/bin/mkvtoolnix/mkvtoolnix-gui.exe filter=lfs diff=lfs merge=lfs -text +mm_avh_working_space/bin/mkvtoolnix/tools/bluray_dump.exe filter=lfs diff=lfs merge=lfs -text +mm_avh_working_space/bin/mkvtoolnix/tools/ebml_validator.exe filter=lfs diff=lfs merge=lfs -text +mm_avh_working_space/bin/mkvtoolnix/tools/hevcc_dump.exe filter=lfs diff=lfs merge=lfs -text +mm_avh_working_space/bin/mkvtoolnix/tools/xvc_dump.exe filter=lfs diff=lfs merge=lfs -text diff --git a/mm_avh_working_space/.gitattributes b/mm_avh_working_space/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..eba1110b5794582b53554bb1e4224b860d4e173f --- /dev/null +++ b/mm_avh_working_space/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto \ No newline at end of file diff --git a/mm_avh_working_space/.gitignore b/mm_avh_working_space/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..ac978403600def8823e34d090bd24e0b0b4428e2 --- /dev/null +++ b/mm_avh_working_space/.gitignore @@ -0,0 +1,7 @@ +*.exe +*.mkv +*.srt +*.aas +*.mp4 +*.mp3 +*.eac3 \ No newline at end of file diff --git a/mm_avh_working_space/LICENSE b/mm_avh_working_space/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9a671b9756200e2588fc98450d33edc233698e6a --- /dev/null +++ b/mm_avh_working_space/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Mateusz Mróz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/mm_avh_working_space/README.md b/mm_avh_working_space/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b77f1b45d365c4510a7f819c80218413fc4fa1af --- /dev/null +++ b/mm_avh_working_space/README.md @@ -0,0 +1,149 @@ +#

✨MM_AVH✨
✨WORKING SPACE✨

+ +## Spis Treści + +- [📝 Krótki Opis](#-krótki-opis) +- [📦 Zawartość](#-zawartość) +- [🔗 Linki](#-linki) +- [🔍 Wymagania](#-wymagania) +- [⚡ Instalacja](#-instalacja-windows) +- [📢 Aktualizacje](#-aktualizacje) +- [⚙️ Instrukcja](#-sposób-korzystania) +- [📝 Opis](#-opis-programów) +- [📸 Demonstracja](#-demonstracja) +- [📌 Uwagi](#-uwagi) +- [🙏 Podziękowania](#-podziękowania) +- [📄 Licencja](#-licencja) +- [📧 Kontakt](#-kontakt) + +## 📝 Krótki Opis + +**Multimedia Magic – Audio Visual Heaven (MM_AVH)** to zestaw narzędzi do przetwarzania i ulepszania multimediów. Repozytorium **_MM_AVH Working Space_** służy jako przestrzeń robocza do ciągłego pobierania, ulepszania i generowania multimediów. + +**MM_AVH** składa się z wielu programów, które są stosowane sekwencyjnie, umożliwiając wielowarstwowe przetwarzanie multimediów. Narzędzia obejmują m.in: + +- playery, readery, konwertery, edytory, wizualizatory, analizatory, generatory, itp. +- skalowanie +- interpolację +- zarządzanie napisami +- lektorowanie wideo (dubbingowanie w przyszłości) +- tworzenie audiobooków +- automatyczne tłumaczenie tekstów + i wiele innych. + +Celem **MM_AVH** jest udostępnienie zaawansowanych, łatwych w użyciu narzędzi do manipulacji multimediów. **_MM_AVH Working Space_** jest częścią większego projektu, który ma na celu udostępnienie darmowego dostępu do multimediów i ułatwienie ich ulepszania i modyfikacji. Praca nad ulepszaniem **MM_AVH** jest ciągła, a repozytorium jest miejscem, gdzie te ulepszenia są opracowywane i testowane. Projekt **MM_AVH** skupia się również na odkrywaniu i dzieleniu się programami, które mogą poprawić jakość i wygodę odbioru multimediów. + +## 📦 Zawartość + +Projekt **MM_AVH Working Space** składa się z następujących głównych plików i folderów: + +- `assets`: Folder zawierający prezentacje i zrzuty ekranu. Ten folder nie jest niezbędny do działania projektu i może być usunięty. +- `bin`: W tym folderze znajdują się wszystkie pliki wykonywalne (exe) oraz modele używane w projekcie. Podfoldery obejmują: + - `balabolka` + - `esrgan` + - `ffmpeg` + - `mkvtoolnix` + - `models` +- `data`: Folder zawierający proste ustawienia programu terminalowego. +- `modules`: Moduły stworzone specjalnie dla tego projektu. +- `tests`: Folder zawierający testy nowych rozwiązań. Ten folder nie jest niezbędny do działania projektu i może być usunięty. +- `utils`: Moduły, które mogą być używane w innych projektach. +- `working_space`: Folder roboczy, do którego przekazujemy pliki do przetworzenia. Zawiera podfoldery `output` i `temp`, które zawierają odpowiednio wyniki przetwarzania i pliki tymczasowe. +- `constants.py`: Plik zawierający stałe ustawienia programu, takie jak ścieżki do folderów i kolorystyka. +- `LICENSE`: Plik zawierający informacje o licencji projektu. +- `README.md`: Plik zawierający wszystkie informacje, które powinieneś wiedzieć o projekcie. +- `start.py`: Plik, który uruchamia proces przetwarzania. +- `requirements.txt`: Plik zawierający listę bibliotek wymaganych do działania projektu. + +Struktura folderów projektu wygląda następująco: + +``` +mm_avh_working_space +├───assets ... ❌ +├───bin +│ ├───balabolka +│ ├───esrgan +│ ├───ffmpeg ... +│ │ ├───bin +│ ├───mkvtoolnix ... +│ └───models +├───data +├───modules +├───tests ❌ +├───utils +└───working_space ❗ + ├───output + └───temp + ├───alt_subs + └───main_subs +``` + +Pliki na poziomie głównym to: + +- `constants.py` +- `LICENSE` +- `README.md` +- `start.py` ❗ +- `requirements.txt` ❗ + +❌ - zbędne po zapoznaiu się z urzwyaniem + +❗ - ważne + +## 🔗 Linki + +- [Strona Główna - do zrobienia❗❗❗](https://mattymroz.github.io/mm_avh/) +- [Media Players](https://github.com/MattyMroz/mm_avh_media_players) +- [Web Players](https://github.com/MattyMroz/mm_avh_web_players) +- [Working Space **TU**](https://github.com/MattyMroz/mm_avh_working_space) + +## 🔍 Wymagania + +Tutaj powinieneś wymienić wszystko, co użytkownik musi zainstalować lub wiedzieć, zanim zacznie korzystać z Twojego projektu. Może to obejmować wymagania dotyczące oprogramowania, sprzętu, wiedzy lub zasobów. + +Windows +FFmpeg zapisany w zmiennej środowiskowej PATH +Python >=10 + +## ⚡ Instalacja + +W tej sekcji powinieneś opisać, jak zainstalować i skonfigurować Twój projekt. Krok po kroku instrukcje są tutaj bardzo pomocne. + + + +## 📢 Aktualizacje + +Tutaj możesz informować użytkowników o najnowszych aktualizacjach Twojego projektu. + +## ⚙️ Sposób Korzystania + +W tej sekcji powinieneś opisać, jak korzystać z Twojego projektu. Możesz tutaj umieścić przykłady użycia, wskazówki i triki. + +## 📝 Opis Programów + +Tutaj możesz opisać, jakie programy są używane w Twoim projekcie i do czego służą. + +## 📸 Demonstracja + +W tej sekcji możesz pokazać, jak działa Twój projekt. Możesz tutaj umieścić zrzuty ekranu, filmy lub gify. + +## 📌 Uwagi + +Tutaj możesz umieścić wszelkie dodatkowe uwagi, które mogą być ważne dla użytkowników Twojego projektu. + +## 🙏 Podziękowania + +Tutaj możesz podziękować osobom, które pomogły Ci w projekcie. Możesz podać ich imiona, role, jak pomogli. + +## 📄 Licencja + +W tej sekcji powinieneś podać, jaka licencja obowiązuje dla Twojego projektu. Możesz podać typ licencji i link do pełnego tekstu licencji. + +## 📧 Kontakt + +W tej sekcji powinieneś podać informacje kontaktowe, takie jak adres e-mail, profil na LinkedIn, strona internetowa itp. + + diff --git a/mm_avh_working_space/bin/balabolka/balcon.exe b/mm_avh_working_space/bin/balabolka/balcon.exe new file mode 100644 index 0000000000000000000000000000000000000000..be5b423fbc987d44a2627eac9a4b3761cae3560d --- /dev/null +++ b/mm_avh_working_space/bin/balabolka/balcon.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2809d6a8dc5807dd631c8d053ef869bfe45e5cf6087667fa6216cf4ba4750d7a +size 1218048 diff --git a/mm_avh_working_space/bin/balabolka/readme.pol.txt b/mm_avh_working_space/bin/balabolka/readme.pol.txt new file mode 100644 index 0000000000000000000000000000000000000000..282b7fca9131df1753506cece092977867fe4e0d --- /dev/null +++ b/mm_avh_working_space/bin/balabolka/readme.pol.txt @@ -0,0 +1,383 @@ +Balabolka aplikacja konsolowa, wersja 1.79 +Copyright c 2013-2022 Ilya Morozov +Wszystkie prawa zastrzeżone + +WWW: http://balabolka.site/pl/bconsole.htm +E-mail: crossa@list.ru + +Licenzja: Freeware +System operacyjny: Microsoft Windows XP/Vista/7/8/10/11 +Microsoft Speech API: 4.0/5.0 +Microsoft Speech Platform: 11.0 + + + +Wiersz poleceń + +balcon parametry + + +Parametry wiersza poleceń + +-l +Pokazać listę głosów zainstalowanych na komputerze. + +-g +Pokazać listę dostępnych urządzeń audio. + +-f nazwa_pliku +Otworzyć plik tekstowy.Wiersz poleceń może zawierać kilka parametrów -f. + +-fl nazwa_pliku +Sets the name of the text file with the list of input files one file name per line.Wiersz poleceń może zawierać kilka parametrów -fl. + +-w nazwa_pliku +Zapisać plik dźwiękowy w formacie WAV.Jeśli parametr jest ustawiony, plik dźwiękowy zostanie utworzony.Jeśli parametr nie jest ustawiony, tekst zostanie przeczytany na głos. + +-n nazwa_głosu +Wybrać głos wystarczy podać część jego nazwy.Jeśli parametr nie jest ustawiony, będzie używany głos wybrany w Panelu sterowania systemu Windows. + +-id liczba +Wybrać głos komputerowy za pomocą identyfikatora języka Locale ID.Takie identyfikatory są przypisane wszystkim językom przez programistów Microsoft +np.1045 lub 0x0415 - język polski, 1058 lub 0x0422 - język ukraiński. +Program wybierze z listy pierwszy głos, identyfikator którego odpowiada określonej wartości. +Jeśli ten parametr nie zostanie określony, będzie używany głos określony przez parametr -n lub wybrany w Panelu sterowania systemu Windows. +Lista identyfikatorów: https://msdn.microsoft.com/en-us/library/cc233982.aspx + +-m +Pokazać parametry wybranego głosu. + +-b liczba +Wybrać urządzenie audio przez jego numer na liście dostępnych urządzeń do odtwarzania dźwięku.Numer urządzenia domyślnego dorówna 0. + +-r tekst +Sets the audio output device by its name. + +-c +Użyć tekstu ze schowka. + +-t tekst +Użyć tekstu z wiersza poleceń.Wiersz poleceń może zawierać kilka parametrów -t. + +-i +Użyć tekstu z standarowego strumienia wejścia STDIN. + +-o +SAPI 4: parametr nie jest używany. +SAPI 5 i Microsoft Speech Platform: zapisać dżwięk do standarowego strumienia wyjścia STDOUT; jeśli parametr jest ustawiony, parametr -w jest ignorowany. + +-s liczba +SAPI 4: ustawić prędkość mowy w zakresie od 0 do 100 brak wartości domyślnych. +SAPI 5 i Microsoft Speech Platform: ustawić prędkość mowy w zakresie od -10 do 10 wartość domyślna dorówna 0. + +-p liczba +SAPI 4: ustawić ton mowy w zakresie od 0 do 100 brak wartości domyślnych. +SAPI 5 i Microsoft Speech Platform: ustawić ton mowy w zakresie od -10 do 10 wartość domyślna dorówna 0. + +-v liczba +SAPI 4: parametr nie jest używany. +SAPI 5 i Microsoft Speech Platform: ustawić głosność mowy w zakresie od 0 do 100 wartość domyślna dorówna 100. + +-e liczba +Ustawić długość pauzy między zdaniami milisekundy.Wartość domyślna dorówna 0. + +-a liczba +Ustawić długość pauzy między akapitami milisekundy.Wartość domyślna dorówna 0. + +-d nazwa_pliku +Użyć słownika do korekty wymowy plik z rozszerzeniem.BXD,.DIC lub.REX.Wiersz poleceń może zawierać kilka parametrów -d. + +-k +Zatrzymać prace innych egzemplarzy aplikacji konsolowej uruchomionych na komputerze. + +-ka +Kills the active copy of the console application in the computers memory. + +-pr +Make pause or resume reading aloud by the active copy of the application.The action is the same as for the context menu item Pause/Resume. + +-q +Dodać aplikację do kolejki.Aplikacja konsolowa będzie czekać, aż inne egzemplarzy programu skończą pracę. + +-lrc +SAPI 4: parametr nie jest używany. +SAPI 5 i Microsoft Speech Platform: utworzyć plik LRC, jeśli ustawione parametry -w lub -o. + +-srt +SAPI 4: parametr nie jest używany. +SAPI 5 i Microsoft Speech Platform: utworzyć plik SRT, jeśli ustawione parametry -w lub -o. + +-vs nazwa_pliku +SAPI 4: parametr nie jest używany. +SAPI 5 i Microsoft Speech Platform: sets the name of output text file with visemes, if the option -w is specified. +A viseme is the mouth shape that corresponds to a particular speech sound.SAPI supports the list of 21 visemes. +This list is based on the original Disney visemes.The application will create the audio file and then read it aloud to get visemes and their timecodes. +The list of visemes supported by SAPI 5: https://msdn.microsoft.com/en-us/library/ms720881v=vs.85.aspx + +-sub +Tekst wygląda jak napisy do plików i musi być przekształcony w plik dźwiękowy z wrachowaniem określonych odstępów czasu. + +-tray +Pokazać ikonę programu w obszarze powiadomień systemu operacyjnego. +To pozwoli użytkownikowi monitorować postęp operacji, oraz przerwać proces klikając Stop w menu kontekstowym. + +-ln liczba +Selects a line from the text file by using of a line number.The line numbering starts at 1. +The interval of numbers can be used for selecting of more than one line for example, 26-34. +Wiersz poleceń może zawierać kilka parametrów -ln. + +-fr liczba +SAPI 4: parametr nie jest używany. +SAPI 5 i Microsoft Speech Platform: sets the output audio sampling frequency in kHz 8, 11, 12, 16, 22, 24, 32, 44, 48. +If the option is not specified, the default value of the selected voice will be used. + +-bt liczba +SAPI 4: parametr nie jest używany. +SAPI 5 i Microsoft Speech Platform: sets the output audio bit depth 8 lub 16. +If the option is not specified, the default value of the selected voice will be used. + +-ch liczba +SAPI 4: parametr nie jest używany. +SAPI 5 i Microsoft Speech Platform: sets the output audio channel mode 1 lub 2. +If the option is not specified, the default value of the selected voice will be used. + +-h +Pokazać opis parametrów wiersza poleceń. + +--encoding kodowanie lub -enc kodowanie +Kodowanie tekstu ze standardowego strumiena wejściowego ansi, utf8 lub unicode.Wartość domyślna dorówna ansi. + +--silence-begin liczba lub -sb liczba +Ustawić długość pauzy na początku pliku dźwiękowego w milisekundach.Wartość domyślna dorówna 0. + +--silence-end liczba lub -se liczba +Ustawić długość pauzy na końcu pliku dźwiękowego w milisekundach.Wartość domyślna dorówna 0. + +--lrc-length liczba +Ustawić maksymalną długość wierszy plika LRC symboli. + +--lrc-fname nazwa_pliku +Nazwa pliku LRC.Parametr może być przydatny gdy w wierszu poleceń ustawiony parametr -o. + +--lrc-enc kodowanie +Kodowanie pliku LRC ansi, utf8 lub unicode.Wartość domyślna dorówna ansi. + +--lrc-offset liczba +Ustawić przesunięcie czasu dla pliku LRC milisekundy. + +--lrc-artist tekst +Znacznik dla pliku LRC: wykonawca utworu. + +--lrc-album tekst +Znacznik dla pliku LRC: album. + +--lrc-title tekst +Znacznik dla pliku LRC: nazwa utworu. + +--lrc-author tekst +Znacznik dla pliku LRC: autor. + +--lrc-creator tekst +Znacznik dla pliku LRC: twórcą pliku. + +--lrc-sent +Inserts blank lines after sentences in the LRC file. + +--lrc-para +Inserts blank lines after paragraphs in the LRC file. + +--srt-length liczba +Ustawić maksymalną długość wierszy plika SRT symboli. + +--srt-fname nazwa_pliku +Nazwa pliku SRT.Parametr może być przydatny gdy w wierszu poleceń ustawiony parametr -o. + +--srt-enc kodowanie +Kodowanie pliku SRT ansi, utf8 lub unicode.Wartość domyślna dorówna ansi. + +--raw +SAPI 4: parametr nie jest używany. +SAPI 5 i Microsoft Speech Platform: zapisać dżwiek w formacie RAW PCM; dane nie zawierają tytułu formatu WAV. +Parametr wykorzystuję się razem z parametrem -o. + +--ignore-length lub -il +SAPI 4: parametr nie jest używany. +SAPI 5 i Microsoft Speech Platform: nie zapisywać rozmiar audio do tytułu formatu WAV.Parametr wykorzystuję się razem z parametrem -o. + +--sub-format tekst +Format napisów filmowych srt, lrc, ssa, ass, smi lub vtt.Jeśli parametr nie określony format zostanie wybrany przez rozszerzenie nazwy pliku napisów. + +--sub-fit lub -sf +SAPI 4: parametr nie jest używany. +SAPI 5 i Microsoft Speech Platform: automatycznie zwiększać prędkość mowy aby zmieścić się w odstępy czasu określone w napisach. + +--sub-max liczba lub -sm liczba +SAPI 4: parametr nie jest używany. +SAPI 5 i Microsoft Speech Platform: ustawić maksymalną prędkość mowy w zakresie od -10 do 10 do konwersji napisów w pliki dźwiękowe. + +--delete-file lub -df +Usunąć plik tekstowy po zakończeniu czytania na głos lub zapisywania pliku dźwiękowego. + +--ignore-square-brackets lub -isb +Ignore text in square brackets. + +--ignore-curly-brackets lub -icb +Ignore text in curly brackets. + +--ignore-angle-brackets lub -iab +Ignore text in angle brackets. + +--ignore-round-brackets lub -irb +Ignore text in round brackets. + +--ignore-url lub -iu +Ignore URLs. + +--ignore-comments lub -ic +Ignore comments in text.Single-line comments start with // and continue until the end of the line.Multiline comments start with / and end with /. + +--voice1-name nazwa_głosu +SAPI 4: parametr nie jest używany. +SAPI 5 i Microsoft Speech Platform: sets the additional voice name to read foreign words in text the part of the name will be enough. +The option is used together with the option --voice1-langid.Other voices can be set by options --voice2-name, --voice3-name, etc. + +--voice1-langid identyfikator_języka +Sets the language ID for foreign words in text.The option is used together with the option --voice1-name.The command line may contain more than one option --voice1-langid.Also an option may contain a comma-separated list of IDs. +The list of supported language IDs is based on ISO 639-1 codes: am, ar, az, ba, bg, be, ca, cs, cu, cv, da, de, el, en, es, et, eu, fi, fil, fr, ja, he, hi, hr, hu, hy, it, gn, gu, ka, kk-Cyr, kk-Lat, kn, ko, ky, lo, lt, lv, mk, no, pl, pt, ro, ru, sk, sl, sr-Cyr, sr-Lat, sv, tg, th, tr, tt, uk, zh. + +--voice1-rate liczba +Sets the rate for the additional voice in a range of -10 to 10 the default is 0. + +--voice1-pitch liczba +Sets the pitch for the additional voice in a range of -10 to 10 the default is 0. + +--voice1-volume liczba +Sets the volume for the additional voice in a range of 0 to 100 the default is 100. + +--voice1-roman +Use the default voice to read Roman numerals in text.If text with non-Latin characters contains Roman numerals, the application will not change a voice to read them. + +--voice1-digit +Use the default voice to read numbers in text. + +--voice1-length liczba +Set the minimal length of foreign text parts that will be read by the additional voice in characters. + + +Przykłady + +balcon -l + +balcon -n Microsoft Anna -m + +balcon -f d:\Text\book.txt -w d:\Sound\book.wav -n Emma + +balcon -n Callie -c -d d:\rex\rules.rex -d d:\dic\rules.dic + +balcon -n Ewa -t Tekst będzie czytany wolno.-s -5 -v 70 + +balcon -k + +balcon -f d:\Text\book.txt -w d:\Sound\book.wav -lrc --lrc-length 80 --lrc-title The Lord of the Rings + +balcon -f d:\Text\film.srt -w d:\Sound\film.wav -n Laura --sub-fit --sub-max 2 + +balcon -f d:\Text\book.txt -n Kimberly --voice1-name Tatyana --voice1-langid ru + + +Przykład wykorzystania aplikacji razem z oprogramowaniem narzędziowym LAME.EXE: + +balcon -f d:\book.txt -n Heather -o --raw | lame -r -s 22.05 -m m -h - d:\book.mp3 + + +Przykład wykorzystania aplikacji razem z oprogramowaniem narzędziowym OGGENC2.EXE: + +balcon -f d:\book.txt -n Heather -o -il | oggenc2 --ignorelength - -o d:\book.ogg + + +Przykład wykorzystania aplikacji razem z oprogramowaniem narzędziowym WMAENCODE.EXE: + +balcon -f d:\book.txt -n Heather -o -il | wmaencode - d:\book.wma --ignorelength + + +Plik konfiguracyjny + +Parametry można zachować jak plik konfiguracyjny balcon.cfg w tym samym folderze co aplikacja konsolowa. + +Przykład zawartości pliku: +=============== +-f d:\Text\book.txt +-w d:\Sound\book.wav +-n Microsoft Anna +-s 2 +-p -1 +-v 95 +-e 300 +-d d:\Dict\rules.bxd +-lrc +--lrc-length 75 +--lrc-enc utf8 +--lrc-offset 300 +=============== + +Program może kombinować parametry z pliku konfiguracyjnego i wiersza poleceń. + + +Audio Clips + +The application allows to insert links to external WAV files audio clips into text.Audio clip tag will look like: + +Audio=C:\Sounds\ring.wav + +When speaking text aloud, the program will pause when the audio clip tag is reached, play the audio clip and resume speaking. +When converting to audio files, the audio clip will be embedded in the audio file created by the application. + + +Voice Tag + +If it is necessary to change a voice or its properties during reading aloud, a special tag can be used for SAPI 5 and Microsoft Speech Platform SAPI 4 voices will ignore this tag. + +The tag format: + +Voice=Name;Rate;Pitch;Volume + +- Name: the name of a voice one word or the part of a word is enough; +- Rate: the rate of a voice values range from -10 to 10; +- Pitch: the pitch of a voice values range from -10 to 10; +- Volume: the volume values range from 0 to 100. + +A tag applies to all subsequent text.The values are separated by semicolons.For example: + +This text will be spoken by the default voice of Balabolka.Voice=Kimberly;0;0;100 The voice Kimberly will read the other text. + +The tags content is case insensitive.Values for some properties can be omitted: + +voice=eric;;;50 + +Voice=Hans;-1 + +Voice=Rachel + +To return to the default voice, use this tag: + +Voice= + +Warning! It is impossible to switch between SAPI 5 voices and voices of the Microsoft Speech Platform. + + +Pause Tag + +A specified number of milliseconds of silence can be inserted into the output audio file.For example: + +One hundred twenty milliseconds of silence Pause=120 just occurred. + + +Licencja + +Prawo do użytku niekomercyjnego: +- dla osób fizycznych - bez ograniczeń; +- dla osób prawnych - z zastrzeżeniem ograniczeń, co określa Umowa licencyjna programu Balabolka. + +Użytek komercyjny dozwolony jedynie za wcześniejszą zgodą posiadacza praw autorskich. + +### diff --git a/mm_avh_working_space/bin/esrgan/realesrgan-ncnn-vulkan.exe b/mm_avh_working_space/bin/esrgan/realesrgan-ncnn-vulkan.exe new file mode 100644 index 0000000000000000000000000000000000000000..5cb9db8ccfa9d544ddaa13eccd0504224dd827dc --- /dev/null +++ b/mm_avh_working_space/bin/esrgan/realesrgan-ncnn-vulkan.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07e49f7cbb4ede01ae4dd4c399d3a7e5846e3d2085c3128eff881e55cb7b1a0c +size 6161408 diff --git a/mm_avh_working_space/bin/esrgan/vcomp140.dll b/mm_avh_working_space/bin/esrgan/vcomp140.dll new file mode 100644 index 0000000000000000000000000000000000000000..9568cee5de7f3b38b95d9db9d048c0c2e9576c52 Binary files /dev/null and b/mm_avh_working_space/bin/esrgan/vcomp140.dll differ diff --git a/mm_avh_working_space/bin/esrgan/vcomp140d.dll b/mm_avh_working_space/bin/esrgan/vcomp140d.dll new file mode 100644 index 0000000000000000000000000000000000000000..69ef20010d90a5fe9ab3521b5acbfe2638efd3aa Binary files /dev/null and b/mm_avh_working_space/bin/esrgan/vcomp140d.dll differ diff --git a/mm_avh_working_space/bin/ffmpeg/FFmpeg.url b/mm_avh_working_space/bin/ffmpeg/FFmpeg.url new file mode 100644 index 0000000000000000000000000000000000000000..8a2dbf85126cc3fa2fb46ab924c1cdc0d71aaab3 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/FFmpeg.url @@ -0,0 +1,2 @@ +[InternetShortcut] +URL=https://www.gyan.dev/ffmpeg/builds/ diff --git a/mm_avh_working_space/bin/ffmpeg/LICENSE b/mm_avh_working_space/bin/ffmpeg/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..94a9ed024d3859793618152ea559a168bbcbb5e2 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/mm_avh_working_space/bin/ffmpeg/README.txt b/mm_avh_working_space/bin/ffmpeg/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..b3cb25334acc84cb4d32c18e82257b4ac7090df3 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/README.txt @@ -0,0 +1,782 @@ +FFmpeg 64-bit static Windows build from www.gyan.dev + +Version: 2023-05-22-git-877ccaf776-full_build-www.gyan.dev + +License: GPL v3 + +Source Code: https://github.com/FFmpeg/FFmpeg/commit/877ccaf776 + +External Assets +frei0r plugins: https://www.gyan.dev/ffmpeg/builds/ffmpeg-frei0r-plugins +lensfun database: https://www.gyan.dev/ffmpeg/builds/ffmpeg-lensfun-db + +git-full build configuration: + +ARCH x86 (generic) +big-endian no +runtime cpu detection yes +standalone assembly yes +x86 assembler nasm +MMX enabled yes +MMXEXT enabled yes +3DNow! enabled yes +3DNow! extended enabled yes +SSE enabled yes +SSSE3 enabled yes +AESNI enabled yes +AVX enabled yes +AVX2 enabled yes +AVX-512 enabled yes +AVX-512ICL enabled yes +XOP enabled yes +FMA3 enabled yes +FMA4 enabled yes +i686 features enabled yes +CMOV is fast yes +EBX available yes +EBP available yes +debug symbols yes +strip symbols yes +optimize for size no +optimizations yes +static yes +shared no +postprocessing support yes +network support yes +threading support pthreads +safe bitstream reader yes +texi2html enabled no +perl enabled yes +pod2man enabled yes +makeinfo enabled yes +makeinfo supports HTML yes +xmllint enabled yes + +External libraries: +avisynth libgme libssh +bzlib libgsm libsvtav1 +chromaprint libilbc libtheora +frei0r libjxl libtwolame +gmp liblensfun libuavs3d +gnutls libmodplug libvidstab +iconv libmp3lame libvmaf +ladspa libmysofa libvo_amrwbenc +libaom libopencore_amrnb libvorbis +libaribb24 libopencore_amrwb libvpx +libaribcaption libopenjpeg libwebp +libass libopenmpt libx264 +libbluray libopus libx265 +libbs2b libplacebo libxavs2 +libcaca librav1e libxml2 +libcdio librist libxvid +libcodec2 librubberband libzimg +libdav1d libshaderc libzmq +libdavs2 libshine libzvbi +libflite libsnappy lzma +libfontconfig libsoxr mediafoundation +libfreetype libspeex sdl2 +libfribidi libsrt zlib + +External libraries providing hardware acceleration: +amf dxva2 nvenc +cuda ffnvcodec opencl +cuda_llvm libmfx vulkan +cuvid libvpl +d3d11va nvdec + +Libraries: +avcodec avformat swresample +avdevice avutil swscale +avfilter postproc + +Programs: +ffmpeg ffplay ffprobe + +Enabled decoders: +aac fraps pcm_u32le +aac_fixed frwu pcm_u8 +aac_latm ftr pcm_vidc +aasc g2m pcx +ac3 g723_1 pdv +ac3_fixed g729 pfm +acelp_kelvin gdv pgm +adpcm_4xm gem pgmyuv +adpcm_adx gif pgssub +adpcm_afc gremlin_dpcm pgx +adpcm_agm gsm phm +adpcm_aica gsm_ms photocd +adpcm_argo h261 pictor +adpcm_ct h263 pixlet +adpcm_dtk h263i pjs +adpcm_ea h263p png +adpcm_ea_maxis_xa h264 ppm +adpcm_ea_r1 h264_cuvid prores +adpcm_ea_r2 h264_qsv prosumer +adpcm_ea_r3 hap psd +adpcm_ea_xas hca ptx +adpcm_g722 hcom qcelp +adpcm_g726 hdr qdm2 +adpcm_g726le hevc qdmc +adpcm_ima_acorn hevc_cuvid qdraw +adpcm_ima_alp hevc_qsv qoi +adpcm_ima_amv hnm4_video qpeg +adpcm_ima_apc hq_hqa qtrle +adpcm_ima_apm hqx r10k +adpcm_ima_cunning huffyuv r210 +adpcm_ima_dat4 hymt ra_144 +adpcm_ima_dk3 iac ra_288 +adpcm_ima_dk4 idcin ralf +adpcm_ima_ea_eacs idf rasc +adpcm_ima_ea_sead iff_ilbm rawvideo +adpcm_ima_iss ilbc realtext +adpcm_ima_moflex imc rka +adpcm_ima_mtf imm4 rl2 +adpcm_ima_oki imm5 roq +adpcm_ima_qt indeo2 roq_dpcm +adpcm_ima_rad indeo3 rpza +adpcm_ima_smjpeg indeo4 rscc +adpcm_ima_ssi indeo5 rv10 +adpcm_ima_wav interplay_acm rv20 +adpcm_ima_ws interplay_dpcm rv30 +adpcm_ms interplay_video rv40 +adpcm_mtaf ipu s302m +adpcm_psx jacosub sami +adpcm_sbpro_2 jpeg2000 sanm +adpcm_sbpro_3 jpegls sbc +adpcm_sbpro_4 jv scpr +adpcm_swf kgv1 screenpresso +adpcm_thp kmvc sdx2_dpcm +adpcm_thp_le lagarith sga +adpcm_vima libaom_av1 sgi +adpcm_xa libaribb24 sgirle +adpcm_xmd libaribcaption sheervideo +adpcm_yamaha libcodec2 shorten +adpcm_zork libdav1d simbiosis_imx +agm libdavs2 sipr +aic libgsm siren +alac libgsm_ms smackaud +alias_pix libilbc smacker +als libjxl smc +amrnb libopencore_amrnb smvjpeg +amrwb libopencore_amrwb snow +amv libopus sol_dpcm +anm libspeex sonic +ansi libuavs3d sp5x +anull libvorbis speedhq +apac libvpx_vp8 speex +ape libvpx_vp9 srgc +apng libzvbi_teletext srt +aptx loco ssa +aptx_hd lscr stl +arbc m101 subrip +argo mace3 subviewer +ass mace6 subviewer1 +asv1 magicyuv sunrast +asv2 mdec svq1 +atrac1 media100 svq3 +atrac3 metasound tak +atrac3al microdvd targa +atrac3p mimic targa_y216 +atrac3pal misc4 tdsc +atrac9 mjpeg text +aura mjpeg_cuvid theora +aura2 mjpeg_qsv thp +av1 mjpegb tiertexseqvideo +av1_cuvid mlp tiff +av1_qsv mmvideo tmv +avrn mobiclip truehd +avrp motionpixels truemotion1 +avs movtext truemotion2 +avui mp1 truemotion2rt +ayuv mp1float truespeech +bethsoftvid mp2 tscc +bfi mp2float tscc2 +bink mp3 tta +binkaudio_dct mp3adu twinvq +binkaudio_rdft mp3adufloat txd +bintext mp3float ulti +bitpacked mp3on4 utvideo +bmp mp3on4float v210 +bmv_audio mpc7 v210x +bmv_video mpc8 v308 +bonk mpeg1_cuvid v408 +brender_pix mpeg1video v410 +c93 mpeg2_cuvid vb +cavs mpeg2_qsv vble +cbd2_dpcm mpeg2video vbn +ccaption mpeg4 vc1 +cdgraphics mpeg4_cuvid vc1_cuvid +cdtoons mpegvideo vc1_qsv +cdxl mpl2 vc1image +cfhd msa1 vcr1 +cinepak mscc vmdaudio +clearvideo msmpeg4v1 vmdvideo +cljr msmpeg4v2 vmnc +cllc msmpeg4v3 vnull +comfortnoise msnsiren vorbis +cook msp2 vp3 +cpia msrle vp4 +cri mss1 vp5 +cscd mss2 vp6 +cyuv msvideo1 vp6a +dca mszh vp6f +dds mts2 vp7 +derf_dpcm mv30 vp8 +dfa mvc1 vp8_cuvid +dfpwm mvc2 vp8_qsv +dirac mvdv vp9 +dnxhd mvha vp9_cuvid +dolby_e mwsc vp9_qsv +dpx mxpeg vplayer +dsd_lsbf nellymoser vqa +dsd_lsbf_planar notchlc vqc +dsd_msbf nuv wady_dpcm +dsd_msbf_planar on2avc wavarc +dsicinaudio opus wavpack +dsicinvideo paf_audio wbmp +dss_sp paf_video wcmv +dst pam webp +dvaudio pbm webvtt +dvbsub pcm_alaw wmalossless +dvdsub pcm_bluray wmapro +dvvideo pcm_dvd wmav1 +dxa pcm_f16le wmav2 +dxtory pcm_f24le wmavoice +dxv pcm_f32be wmv1 +eac3 pcm_f32le wmv2 +eacmv pcm_f64be wmv3 +eamad pcm_f64le wmv3image +eatgq pcm_lxf wnv1 +eatgv pcm_mulaw wrapped_avframe +eatqi pcm_s16be ws_snd1 +eightbps pcm_s16be_planar xan_dpcm +eightsvx_exp pcm_s16le xan_wc3 +eightsvx_fib pcm_s16le_planar xan_wc4 +escape124 pcm_s24be xbin +escape130 pcm_s24daud xbm +evrc pcm_s24le xface +exr pcm_s24le_planar xl +fastaudio pcm_s32be xma1 +ffv1 pcm_s32le xma2 +ffvhuff pcm_s32le_planar xpm +ffwavesynth pcm_s64be xsub +fic pcm_s64le xwd +fits pcm_s8 y41p +flac pcm_s8_planar ylc +flashsv pcm_sga yop +flashsv2 pcm_u16be yuv4 +flic pcm_u16le zero12v +flv pcm_u24be zerocodec +fmvc pcm_u24le zlib +fourxm pcm_u32be zmbv + +Enabled encoders: +a64multi hevc_qsv pcm_u16be +a64multi5 huffyuv pcm_u16le +aac jpeg2000 pcm_u24be +aac_mf jpegls pcm_u24le +ac3 libaom_av1 pcm_u32be +ac3_fixed libcodec2 pcm_u32le +ac3_mf libgsm pcm_u8 +adpcm_adx libgsm_ms pcm_vidc +adpcm_argo libilbc pcx +adpcm_g722 libjxl pfm +adpcm_g726 libmp3lame pgm +adpcm_g726le libopencore_amrnb pgmyuv +adpcm_ima_alp libopenjpeg phm +adpcm_ima_amv libopus png +adpcm_ima_apm librav1e ppm +adpcm_ima_qt libshine prores +adpcm_ima_ssi libspeex prores_aw +adpcm_ima_wav libsvtav1 prores_ks +adpcm_ima_ws libtheora qoi +adpcm_ms libtwolame qtrle +adpcm_swf libvo_amrwbenc r10k +adpcm_yamaha libvorbis r210 +alac libvpx_vp8 ra_144 +alias_pix libvpx_vp9 rawvideo +amv libwebp roq +anull libwebp_anim roq_dpcm +apng libx264 rpza +aptx libx264rgb rv10 +aptx_hd libx265 rv20 +ass libxavs2 s302m +asv1 libxvid sbc +asv2 ljpeg sgi +av1_amf magicyuv smc +av1_nvenc mjpeg snow +av1_qsv mjpeg_qsv sonic +avrp mlp sonic_ls +avui movtext speedhq +ayuv mp2 srt +bitpacked mp2fixed ssa +bmp mp3_mf subrip +cfhd mpeg1video sunrast +cinepak mpeg2_qsv svq1 +cljr mpeg2video targa +comfortnoise mpeg4 text +dca msmpeg4v2 tiff +dfpwm msmpeg4v3 truehd +dnxhd msvideo1 tta +dpx nellymoser ttml +dvbsub opus utvideo +dvdsub pam v210 +dvvideo pbm v308 +eac3 pcm_alaw v408 +exr pcm_bluray v410 +ffv1 pcm_dvd vbn +ffvhuff pcm_f32be vc2 +fits pcm_f32le vnull +flac pcm_f64be vorbis +flashsv pcm_f64le vp9_qsv +flashsv2 pcm_mulaw wavpack +flv pcm_s16be wbmp +g723_1 pcm_s16be_planar webvtt +gif pcm_s16le wmav1 +h261 pcm_s16le_planar wmav2 +h263 pcm_s24be wmv1 +h263p pcm_s24daud wmv2 +h264_amf pcm_s24le wrapped_avframe +h264_mf pcm_s24le_planar xbm +h264_nvenc pcm_s32be xface +h264_qsv pcm_s32le xsub +hap pcm_s32le_planar xwd +hdr pcm_s64be y41p +hevc_amf pcm_s64le yuv4 +hevc_mf pcm_s8 zlib +hevc_nvenc pcm_s8_planar zmbv + +Enabled hwaccels: +av1_d3d11va hevc_nvdec vc1_nvdec +av1_d3d11va2 mjpeg_nvdec vp8_nvdec +av1_dxva2 mpeg1_nvdec vp9_d3d11va +av1_nvdec mpeg2_d3d11va vp9_d3d11va2 +h264_d3d11va mpeg2_d3d11va2 vp9_dxva2 +h264_d3d11va2 mpeg2_dxva2 vp9_nvdec +h264_dxva2 mpeg2_nvdec wmv3_d3d11va +h264_nvdec mpeg4_nvdec wmv3_d3d11va2 +hevc_d3d11va vc1_d3d11va wmv3_dxva2 +hevc_d3d11va2 vc1_d3d11va2 wmv3_nvdec +hevc_dxva2 vc1_dxva2 + +Enabled parsers: +aac dvdsub opus +aac_latm flac png +ac3 ftr pnm +adx g723_1 qoi +amr g729 rv30 +av1 gif rv40 +avs2 gsm sbc +avs3 h261 sipr +bmp h263 tak +cavsvideo h264 vc1 +cook hdr vorbis +cri hevc vp3 +dca ipu vp8 +dirac jpeg2000 vp9 +dnxhd misc4 webp +dolby_e mjpeg xbm +dpx mlp xma +dvaudio mpeg4video xwd +dvbsub mpegaudio +dvd_nav mpegvideo + +Enabled demuxers: +aa idf pcm_f64le +aac iff pcm_mulaw +aax ifv pcm_s16be +ac3 ilbc pcm_s16le +ace image2 pcm_s24be +acm image2_alias_pix pcm_s24le +act image2_brender_pix pcm_s32be +adf image2pipe pcm_s32le +adp image_bmp_pipe pcm_s8 +ads image_cri_pipe pcm_u16be +adx image_dds_pipe pcm_u16le +aea image_dpx_pipe pcm_u24be +afc image_exr_pipe pcm_u24le +aiff image_gem_pipe pcm_u32be +aix image_gif_pipe pcm_u32le +alp image_hdr_pipe pcm_u8 +amr image_j2k_pipe pcm_vidc +amrnb image_jpeg_pipe pdv +amrwb image_jpegls_pipe pjs +anm image_jpegxl_pipe pmp +apac image_pam_pipe pp_bnk +apc image_pbm_pipe pva +ape image_pcx_pipe pvf +apm image_pfm_pipe qcp +apng image_pgm_pipe r3d +aptx image_pgmyuv_pipe rawvideo +aptx_hd image_pgx_pipe realtext +aqtitle image_phm_pipe redspark +argo_asf image_photocd_pipe rka +argo_brp image_pictor_pipe rl2 +argo_cvg image_png_pipe rm +asf image_ppm_pipe roq +asf_o image_psd_pipe rpl +ass image_qdraw_pipe rsd +ast image_qoi_pipe rso +au image_sgi_pipe rtp +av1 image_sunrast_pipe rtsp +avi image_svg_pipe s337m +avisynth image_tiff_pipe sami +avr image_vbn_pipe sap +avs image_webp_pipe sbc +avs2 image_xbm_pipe sbg +avs3 image_xpm_pipe scc +bethsoftvid image_xwd_pipe scd +bfi imf sdns +bfstm ingenient sdp +bink ipmovie sdr2 +binka ipu sds +bintext ircam sdx +bit iss segafilm +bitpacked iv8 ser +bmv ivf sga +boa ivr shorten +bonk jacosub siff +brstm jv simbiosis_imx +c93 kux sln +caf kvag smacker +cavsvideo laf smjpeg +cdg libgme smush +cdxl libmodplug sol +cine libopenmpt sox +codec2 live_flv spdif +codec2raw lmlm4 srt +concat loas stl +dash lrc str +data luodat subviewer +daud lvf subviewer1 +dcstr lxf sup +derf m4v svag +dfa matroska svs +dfpwm mca swf +dhav mcc tak +dirac mgsts tedcaptions +dnxhd microdvd thp +dsf mjpeg threedostr +dsicin mjpeg_2000 tiertexseq +dss mlp tmv +dts mlv truehd +dtshd mm tta +dv mmf tty +dvbsub mods txd +dvbtxt moflex ty +dxa mov v210 +ea mp3 v210x +ea_cdata mpc vag +eac3 mpc8 vc1 +epaf mpegps vc1t +ffmetadata mpegts vividas +filmstrip mpegtsraw vivo +fits mpegvideo vmd +flac mpjpeg vobsub +flic mpl2 voc +flv mpsub vpk +fourxm msf vplayer +frm msnwc_tcp vqf +fsb msp w64 +fwse mtaf wady +g722 mtv wav +g723_1 musx wavarc +g726 mv wc3 +g726le mvi webm_dash_manifest +g729 mxf webvtt +gdv mxg wsaud +genh nc wsd +gif nistsphere wsvqa +gsm nsp wtv +gxf nsv wv +h261 nut wve +h263 nuv xa +h264 obu xbin +hca ogg xmd +hcom oma xmv +hevc paf xvag +hls pcm_alaw xwma +hnm pcm_f32be yop +ico pcm_f32le yuv4mpegpipe +idcin pcm_f64be + +Enabled muxers: +a64 h263 pcm_s24be +ac3 h264 pcm_s24le +adts hash pcm_s32be +adx hds pcm_s32le +aiff hevc pcm_s8 +alp hls pcm_u16be +amr ico pcm_u16le +amv ilbc pcm_u24be +apm image2 pcm_u24le +apng image2pipe pcm_u32be +aptx ipod pcm_u32le +aptx_hd ircam pcm_u8 +argo_asf ismv pcm_vidc +argo_cvg ivf psp +asf jacosub rawvideo +asf_stream kvag rm +ass latm roq +ast lrc rso +au m4v rtp +avi matroska rtp_mpegts +avif matroska_audio rtsp +avm2 md5 sap +avs2 microdvd sbc +avs3 mjpeg scc +bit mkvtimestamp_v2 segafilm +caf mlp segment +cavsvideo mmf smjpeg +chromaprint mov smoothstreaming +codec2 mp2 sox +codec2raw mp3 spdif +crc mp4 spx +dash mpeg1system srt +data mpeg1vcd stream_segment +daud mpeg1video streamhash +dfpwm mpeg2dvd sup +dirac mpeg2svcd swf +dnxhd mpeg2video tee +dts mpeg2vob tg2 +dv mpegts tgp +eac3 mpjpeg truehd +f4v mxf tta +ffmetadata mxf_d10 ttml +fifo mxf_opatom uncodedframecrc +fifo_test null vc1 +filmstrip nut vc1t +fits obu voc +flac oga w64 +flv ogg wav +framecrc ogv webm +framehash oma webm_chunk +framemd5 opus webm_dash_manifest +g722 pcm_alaw webp +g723_1 pcm_f32be webvtt +g726 pcm_f32le wsaud +g726le pcm_f64be wtv +gif pcm_f64le wv +gsm pcm_mulaw yuv4mpegpipe +gxf pcm_s16be +h261 pcm_s16le + +Enabled protocols: +async http rtmp +bluray httpproxy rtmpe +cache https rtmps +concat icecast rtmpt +concatf ipfs_gateway rtmpte +crypto ipns_gateway rtmpts +data librist rtp +fd libsrt srtp +ffrtmpcrypt libssh subfile +ffrtmphttp libzmq tcp +file md5 tee +ftp mmsh tls +gopher mmst udp +gophers pipe udplite +hls prompeg + +Enabled filters: +a3dscope dcshift pad +abench dctdnoiz pad_opencl +abitscope ddagrab pal100bars +acompressor deband pal75bars +acontrast deblock palettegen +acopy decimate paletteuse +acrossfade deconvolve pan +acrossover dedot perms +acrusher deesser perspective +acue deflate phase +addroi deflicker photosensitivity +adeclick deinterlace_qsv pixdesctest +adeclip dejudder pixelize +adecorrelate delogo pixscope +adelay derain pp +adenorm deshake pp7 +aderivative deshake_opencl premultiply +adrawgraph despill prewitt +adrc detelecine prewitt_opencl +adynamicequalizer dialoguenhance program_opencl +adynamicsmooth dilation pseudocolor +aecho dilation_opencl psnr +aemphasis displace pullup +aeval dnn_classify qp +aevalsrc dnn_detect random +aexciter dnn_processing readeia608 +afade doubleweave readvitc +afdelaysrc drawbox realtime +afftdn drawgraph remap +afftfilt drawgrid remap_opencl +afifo drawtext removegrain +afir drmeter removelogo +afireqsrc dynaudnorm repeatfields +afirsrc earwax replaygain +aformat ebur128 reverse +afreqshift edgedetect rgbashift +afwtdn elbg rgbtestsrc +agate entropy roberts +agraphmonitor epx roberts_opencl +ahistogram eq rotate +aiir equalizer rubberband +aintegral erosion sab +ainterleave erosion_opencl scale +alatency estdif scale2ref +alimiter exposure scale_cuda +allpass extractplanes scale_qsv +allrgb extrastereo scale_vulkan +allyuv fade scdet +aloop feedback scharr +alphaextract fftdnoiz scroll +alphamerge fftfilt segment +amerge field select +ametadata fieldhint selectivecolor +amix fieldmatch sendcmd +amovie fieldorder separatefields +amplify fifo setdar +amultiply fillborders setfield +anequalizer find_rect setparams +anlmdn firequalizer setpts +anlmf flanger setrange +anlms flip_vulkan setsar +anoisesrc flite settb +anull floodfill shear +anullsink format showcqt +anullsrc fps showcwt +apad framepack showfreqs +aperms framerate showinfo +aphasemeter framestep showpalette +aphaser freezedetect showspatial +aphaseshift freezeframes showspectrum +apsyclip frei0r showspectrumpic +apulsator frei0r_src showvolume +arealtime fspp showwaves +aresample gblur showwavespic +areverse gblur_vulkan shuffleframes +arls geq shufflepixels +arnndn gradfun shuffleplanes +asdr gradients sidechaincompress +asegment graphmonitor sidechaingate +aselect grayworld sidedata +asendcmd greyedge sierpinski +asetnsamples guided signalstats +asetpts haas signature +asetrate haldclut silencedetect +asettb haldclutsrc silenceremove +ashowinfo hdcd sinc +asidedata headphone sine +asoftclip hflip siti +aspectralstats hflip_vulkan smartblur +asplit highpass smptebars +ass highshelf smptehdbars +astats hilbert sobel +astreamselect histeq sobel_opencl +asubboost histogram sofalizer +asubcut hqdn3d spectrumsynth +asupercut hqx speechnorm +asuperpass hstack split +asuperstop hstack_qsv spp +atadenoise hsvhold sr +atempo hsvkey ssim +atilt hue ssim360 +atrim huesaturation stereo3d +avectorscope hwdownload stereotools +avgblur hwmap stereowiden +avgblur_opencl hwupload streamselect +avgblur_vulkan hwupload_cuda subtitles +avsynctest hysteresis super2xsai +axcorrelate identity superequalizer +azmq idet surround +backgroundkey il swaprect +bandpass inflate swapuv +bandreject interlace tblend +bass interleave telecine +bbox join testsrc +bench kerndeint testsrc2 +bilateral kirsch thistogram +bilateral_cuda ladspa threshold +biquad lagfun thumbnail +bitplanenoise latency thumbnail_cuda +blackdetect lenscorrection tile +blackframe lensfun tiltshelf +blend libplacebo tinterlace +blend_vulkan libvmaf tlut2 +blockdetect life tmedian +blurdetect limitdiff tmidequalizer +bm3d limiter tmix +boxblur loop tonemap +boxblur_opencl loudnorm tonemap_opencl +bs2b lowpass tpad +bwdif lowshelf transpose +cas lumakey transpose_opencl +ccrepack lut transpose_vulkan +cellauto lut1d treble +channelmap lut2 tremolo +channelsplit lut3d trim +chorus lutrgb unpremultiply +chromaber_vulkan lutyuv unsharp +chromahold mandelbrot unsharp_opencl +chromakey maskedclamp untile +chromakey_cuda maskedmax uspp +chromanr maskedmerge v360 +chromashift maskedmin vaguedenoiser +ciescope maskedthreshold varblur +codecview maskfun vectorscope +color mcdeint vflip +colorbalance mcompand vflip_vulkan +colorchannelmixer median vfrdet +colorchart mergeplanes vibrance +colorcontrast mestimate vibrato +colorcorrect metadata vidstabdetect +colorhold midequalizer vidstabtransform +colorize minterpolate vif +colorkey mix vignette +colorkey_opencl monochrome virtualbass +colorlevels morpho vmafmotion +colormap movie volume +colormatrix mpdecimate volumedetect +colorspace mptestsrc vpp_qsv +colorspace_cuda msad vstack +colorspectrum multiply vstack_qsv +colortemperature negate w3fdif +compand nlmeans waveform +compensationdelay nlmeans_opencl weave +concat nnedi xbr +convolution noformat xcorrelate +convolution_opencl noise xfade +convolve normalize xfade_opencl +copy null xmedian +corr nullsink xstack +cover_rect nullsrc xstack_qsv +crop openclsrc yadif +cropdetect oscilloscope yadif_cuda +crossfeed overlay yaepblur +crystalizer overlay_cuda yuvtestsrc +cue overlay_opencl zmq +curves overlay_qsv zoneplate +datascope overlay_vulkan zoompan +dblur owdenoise zscale + +Enabled bsfs: +aac_adtstoasc h264_redundant_pps opus_metadata +av1_frame_merge hapqa_extract pcm_rechunk +av1_frame_split hevc_metadata pgs_frame_merge +av1_metadata hevc_mp4toannexb prores_metadata +chomp imx_dump_header remove_extradata +dca_core media100_to_mjpegb setts +dts2pts mjpeg2jpeg text2movsub +dump_extradata mjpega_dump_header trace_headers +dv_error_marker mov2textsub truehd_core +eac3_core mp3_header_decompress vp9_metadata +extract_extradata mpeg2_metadata vp9_raw_reorder +filter_units mpeg4_unpack_bframes vp9_superframe +h264_metadata noise vp9_superframe_split +h264_mp4toannexb null + +Enabled indevs: +dshow lavfi vfwcap +gdigrab libcdio + +Enabled outdevs: +caca sdl2 diff --git a/mm_avh_working_space/bin/ffmpeg/bin/ffmpeg.exe b/mm_avh_working_space/bin/ffmpeg/bin/ffmpeg.exe new file mode 100644 index 0000000000000000000000000000000000000000..ca5f5de2468d0ecdf7ec338b8ae8376b493e68bc --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/bin/ffmpeg.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37ab214146d148bcb29555353adce5853155bc802caf5c0169865d242a5aaadc +size 133299200 diff --git a/mm_avh_working_space/bin/ffmpeg/bin/ffplay.exe b/mm_avh_working_space/bin/ffmpeg/bin/ffplay.exe new file mode 100644 index 0000000000000000000000000000000000000000..9cb8b3f3e20a626352b15206856c2803ff389194 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/bin/ffplay.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad1af2274601982fb475e15ca4dfbc3e3f921ed01f57cabddeee0cb0ac067854 +size 133134336 diff --git a/mm_avh_working_space/bin/ffmpeg/bin/ffprobe.exe b/mm_avh_working_space/bin/ffmpeg/bin/ffprobe.exe new file mode 100644 index 0000000000000000000000000000000000000000..09af84cde9603c7a6f0a3fe8e3d3821c91043706 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/bin/ffprobe.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d038ab3d48ea6a4f1da1cb2d229bd049b207caf3ae9a27652be59e493c1d4d8 +size 133175296 diff --git a/mm_avh_working_space/bin/ffmpeg/doc/bootstrap.min.css b/mm_avh_working_space/bin/ffmpeg/doc/bootstrap.min.css new file mode 100644 index 0000000000000000000000000000000000000000..6f68017d58463c625e861e4700a6af0a7ad6c42d --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/bootstrap.min.css @@ -0,0 +1,5 @@ +/*! + * Bootstrap v3.2.0 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + *//*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;width:100% \9;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;width:100% \9;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:400;line-height:1;color:#777}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}cite{font-style:normal}mark,.mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=radio],input[type=checkbox]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#777;opacity:1}.form-control:-ms-input-placeholder{color:#777}.form-control::-webkit-input-placeholder{color:#777}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:34px;line-height:1.42857143 \0}input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;min-height:20px;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.radio input[type=radio],.radio-inline input[type=radio],.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox]{position:absolute;margin-top:4px \9;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type=radio][disabled],input[type=checkbox][disabled],input[type=radio].disabled,input[type=checkbox].disabled,fieldset[disabled] input[type=radio],fieldset[disabled] input[type=checkbox]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm,.form-horizontal .form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.input-lg,.form-horizontal .form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg{height:46px;line-height:46px}textarea.input-lg,select[multiple].input-lg{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:25px;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center}.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type=radio],.form-inline .checkbox input[type=checkbox]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{top:0;right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.3px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn:focus,.btn:active:focus,.btn.active:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#3071a9;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-primary .badge{color:#428bca;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#428bca;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#428bca;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px solid}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn>input[type=radio],[data-toggle=buttons]>.btn>input[type=checkbox]{position:absolute;z-index:-1;filter:alpha(opacity=0);opacity:0}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=radio],.input-group-addon input[type=checkbox]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type=radio],.navbar-form .checkbox input[type=checkbox]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#333}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#777}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#777}.navbar-inverse .navbar-nav>li>a{color:#777}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#777}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#777}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#fff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#428bca;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#2a6496;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;cursor:default;background-color:#428bca;border-color:#428bca}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:hover,.label-default[href]:focus{background-color:#5e5e5e}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-right:auto;margin-left:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#428bca}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar[aria-valuenow="1"],.progress-bar[aria-valuenow="2"]{min-width:30px}.progress-bar[aria-valuenow="0"]{min-width:30px;color:#777;background-color:transparent;background-image:none;-webkit-box-shadow:none;box-shadow:none}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{color:#555;text-decoration:none;background-color:#f5f5f5}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{color:#777;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#428bca}.panel-primary>.panel-heading .badge{color:#428bca;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate3d(0,-25%,0);-o-transform:translate3d(0,-25%,0);transform:translate3d(0,-25%,0)}.modal.in .modal-dialog{-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-size:12px;line-height:1.4;visibility:visible;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{right:5px;bottom:0;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;text-align:left;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-footer:before,.modal-footer:after{display:table;content:" "}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important;visibility:hidden!important}.affix{position:fixed;-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none!important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} diff --git a/mm_avh_working_space/bin/ffmpeg/doc/community.html b/mm_avh_working_space/bin/ffmpeg/doc/community.html new file mode 100644 index 0000000000000000000000000000000000000000..8d1025c0af0c337080f683bba6c5981094c81800 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/community.html @@ -0,0 +1,250 @@ + + + + + +Community + + + + + + + + + + + + + + + + + +
+ + + +
+

1 Organisation

+ +

The FFmpeg project is organized through a community working on global consensus. +

+

Decisions are taken by the ensemble of active members, through voting and are aided by two committees. +

+
+
+

2 General Assembly

+ +

The ensemble of active members is called the General Assembly (GA). +

+

The General Assembly is sovereign and legitimate for all its decisions regarding the FFmpeg project. +

+

The General Assembly is made up of active contributors. +

+

Contributors are considered "active contributors" if they have pushed more than 20 patches in the last 36 months in the main FFmpeg repository, or if they have been voted in by the GA. +

+

Additional members are added to the General Assembly through a vote after proposal by a member of the General Assembly. They are part of the GA for two years, after which they need a confirmation by the GA. +

+

A script to generate the current members of the general assembly (minus members voted in) can be found in ‘tools/general_assembly.pl‘. +

+
+
+

3 Voting

+ +

Voting is done using a ranked voting system, currently running on https://vote.ffmpeg.org/ . +

+

Majority vote means more than 50% of the expressed ballots. +

+
+
+

4 Technical Committee

+ +

The Technical Committee (TC) is here to arbitrate and make decisions when technical conflicts occur in the project. They will consider the merits of all the positions, judge them and make a decision. +

+

The TC resolves technical conflicts but is not a technical steering committee. +

+

Decisions by the TC are binding for all the contributors. +

+

Decisions made by the TC can be re-opened after 1 year or by a majority vote of the General Assembly, requested by one of the member of the GA. +

+

The TC is elected by the General Assembly for a duration of 1 year, and is composed of 5 members. Members can be re-elected if they wish. A majority vote in the General Assembly can trigger a new election of the TC. +

+

The members of the TC can be elected from outside of the GA. Candidates for election can either be suggested or self-nominated. +

+

The conflict resolution process is detailed in the resolution process document. +

+

The TC can be contacted at <tc@ffmpeg>. +

+ +
+

4.1 Resolution Process

+ +

The Technical Committee (TC) is here to arbitrate and make decisions when technical conflicts occur in the project. +

+

The TC main role is to resolve technical conflicts. It is therefore not a technical steering committee, but it is understood that some decisions might impact the future of the project. +

+ +
+

4.1.1 Seizing

+ +

The TC can take possession of any technical matter that it sees fit. +

+

To involve the TC in a matter, email tc or CC them on an ongoing discussion. +

+

As members of TC are developers, they also can email tc to raise an issue. +

+
+

4.1.2 Announcement

+ +

The TC, once seized, must announce itself on the main mailing list, with a [TC] tag. +

+

The TC has 2 modes of operation: a RFC one and an internal one. +

+

If the TC thinks it needs the input from the larger community, the TC can call for a RFC. Else, it can decide by itself. +

+

If the disagreement involves a member of the TC, that member should recuse themselves from the decision. +

+

The decision to use a RFC process or an internal discussion is a discretionary decision of the TC. +

+

The TC can also reject a seizure for a few reasons such as: the matter was not discussed enough previously; it lacks expertise to reach a beneficial decision on the matter; or the matter is too trivial. +

+
+

4.1.3 RFC call

+ +

In the RFC mode, one person from the TC posts on the mailing list the technical question and will request input from the community. +

+

The mail will have the following specification: +

+

a precise title + a specific tag [TC RFC] + a top-level email + contain a precise question that does not exceed 100 words and that is answerable by developers + may have an extra description, or a link to a previous discussion, if deemed necessary, + contain a precise end date for the answers. +

+

The answers from the community must be on the main mailing list and must have the following specification: +

+

keep the tag and the title unchanged + limited to 400 words + a first-level, answering directly to the main email + answering to the question. +

+

Further replies to answers are permitted, as long as they conform to the community standards of politeness, they are limited to 100 words, and are not nested more than once. (max-depth=2) +

+

After the end-date, mails on the thread will be ignored. +

+

Violations of those rules will be escalated through the Community Committee. +

+

After all the emails are in, the TC has 96 hours to give its final decision. Exceptionally, the TC can request an extra delay, that will be notified on the mailing list. +

+
+

4.1.4 Within TC

+ +

In the internal case, the TC has 96 hours to give its final decision. Exceptionally, the TC can request an extra delay. +

+
+

4.1.5 Decisions

+ +

The decisions from the TC will be sent on the mailing list, with the [TC] tag. +

+

Internally, the TC should take decisions with a majority, or using ranked-choice voting. +

+

The decision from the TC should be published with a summary of the reasons that lead to this decision. +

+

The decisions from the TC are final, until the matters are reopened after no less than one year. +

+
+
+
+
+

5 Community Committee

+ +

The Community Committee (CC) is here to arbitrage and make decisions when inter-personal conflicts occur in the project. It will decide quickly and take actions, for the sake of the project. +

+

The CC can remove privileges of offending members, including removal of commit access and temporary ban from the community. +

+

Decisions made by the CC can be re-opened after 1 year or by a majority vote of the General Assembly. Indefinite bans from the community must be confirmed by the General Assembly, in a majority vote. +

+

The CC is elected by the General Assembly for a duration of 1 year, and is composed of 5 members. Members can be re-elected if they wish. A majority vote in the General Assembly can trigger a new election of the CC. +

+

The members of the CC can be elected from outside of the GA. Candidates for election can either be suggested or self-nominated. +

+

The CC is governed by and responsible for enforcing the Code of Conduct. +

+

The CC can be contacted at <cc@ffmpeg>. +

+
+
+

6 Code of Conduct

+ +

Be friendly and respectful towards others and third parties. +Treat others the way you yourself want to be treated. +

+

Be considerate. Not everyone shares the same viewpoint and priorities as you do. +Different opinions and interpretations help the project. +Looking at issues from a different perspective assists development. +

+

Do not assume malice for things that can be attributed to incompetence. Even if +it is malice, it’s rarely good to start with that as initial assumption. +

+

Stay friendly even if someone acts contrarily. Everyone has a bad day +once in a while. +If you yourself have a bad day or are angry then try to take a break and reply +once you are calm and without anger if you have to. +

+

Try to help other team members and cooperate if you can. +

+

The goal of software development is to create technical excellence, not for any +individual to be better and "win" against the others. Large software projects +are only possible and successful through teamwork. +

+

If someone struggles do not put them down. Give them a helping hand +instead and point them in the right direction. +

+

Finally, keep in mind the immortal words of Bill and Ted, +"Be excellent to each other." +

+
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/default.css b/mm_avh_working_space/bin/ffmpeg/doc/default.css new file mode 100644 index 0000000000000000000000000000000000000000..bf50200c287563ad8c8c3644d8beda12c97db27d --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/default.css @@ -0,0 +1,165 @@ +a.summary-letter { + text-decoration: none; +} + +a { + color: #2D6198; +} + +a:visited { + color: #884488; +} + +#banner { + background-color: white; + position: relative; + text-align: center; +} + +#banner img { + margin-bottom: 1px; + margin-top: 5px; +} + +#body { + margin-left: 1em; + margin-right: 1em; +} + +body { + background-color: #313131; + margin: 0; + text-align: justify; +} + +.center { + margin-left: auto; + margin-right: auto; + text-align: center; +} + +#container { + background-color: white; + color: #202020; + margin-left: 1em; + margin-right: 1em; +} + +#footer { + text-align: center; +} + +h1 a, h2 a, h3 a, h4 a { + text-decoration: inherit; + color: inherit; +} + +h1, h2, h3, h4 { + padding-left: 0.4em; + border-radius: 4px; + padding-bottom: 0.25em; + padding-top: 0.25em; + border: 1px solid #6A996A; +} + +h1 { + background-color: #7BB37B; + color: #151515; + font-size: 1.2em; + padding-bottom: 0.3em; + padding-top: 0.3em; +} + +h2 { + color: #313131; + font-size: 1.0em; + background-color: #ABE3AB; +} + +h3 { + color: #313131; + font-size: 0.9em; + margin-bottom: -6px; + background-color: #BBF3BB; +} + +h4 { + color: #313131; + font-size: 0.8em; + margin-bottom: -8px; + background-color: #D1FDD1; +} + +img { + border: 0; +} + +#navbar { + background-color: #738073; + border-bottom: 1px solid #5C665C; + border-top: 1px solid #5C665C; + margin-top: 12px; + padding: 0.3em; + position: relative; + text-align: center; +} + +#navbar a, #navbar_secondary a { + color: white; + padding: 0.3em; + text-decoration: none; +} + +#navbar a:hover, #navbar_secondary a:hover { + background-color: #313131; + color: white; + text-decoration: none; +} + +#navbar_secondary { + background-color: #738073; + border-bottom: 1px solid #5C665C; + border-left: 1px solid #5C665C; + border-right: 1px solid #5C665C; + padding: 0.3em; + position: relative; + text-align: center; +} + +p { + margin-left: 1em; + margin-right: 1em; +} + +pre { + margin-left: 3em; + margin-right: 3em; + padding: 0.3em; + border: 1px solid #bbb; + background-color: #f7f7f7; +} + +dl dt { + font-weight: bold; +} + +#proj_desc { + font-size: 1.2em; +} + +#repos { + margin-left: 1em; + margin-right: 1em; + border-collapse: collapse; + border: solid 1px #6A996A; +} + +#repos th { + background-color: #7BB37B; + border: solid 1px #6A996A; +} + +#repos td { + padding: 0.2em; + border: solid 1px #6A996A; +} diff --git a/mm_avh_working_space/bin/ffmpeg/doc/developer.html b/mm_avh_working_space/bin/ffmpeg/doc/developer.html new file mode 100644 index 0000000000000000000000000000000000000000..c4ef393bb1a901822ca03adfbac2a12bee35550b --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/developer.html @@ -0,0 +1,1099 @@ + + + + + +Developer Documentation + + + + + + + + + + + + + + + + + +
+ + + +
+

1 Introduction

+ +

This text is concerned with the development of FFmpeg itself. Information +on using the FFmpeg libraries in other programs can be found elsewhere, e.g. in: +

+ +

If you modify FFmpeg code for your own use case, you are highly encouraged to +submit your changes back to us, using this document as a guide. There are +both pragmatic and ideological reasons to do so: +

    +
  • Maintaining external changes to keep up with upstream development is +time-consuming and error-prone. With your code in the main tree, it will be +maintained by FFmpeg developers. +
  • FFmpeg developers include leading experts in the field who can find bugs or +design flaws in your code. +
  • By supporting the project you find useful you ensure it continues to be +maintained and developed. +
+ +

For more detailed legal information about the use of FFmpeg in +external programs read the LICENSE file in the source tree and +consult https://ffmpeg.org/legal.html. +

+ +
+

1.1 Contributing code

+ +

All proposed code changes should be submitted for review to +the development mailing list, as +described in more detail in the Submitting patches chapter. The code +should comply with the Development Policy and follow the Coding Rules. +The developer making the commit and the author are responsible for their changes +and should try to fix issues their commit causes. +

+
+
+
+

2 Coding Rules

+ + +
+

2.1 Language

+ +

FFmpeg is mainly programmed in the ISO C99 language, extended with: +

    +
  • Atomic operations from C11 stdatomic.h. They are emulated on +architectures/compilers that do not support them, so all FFmpeg-internal code +may use atomics without any extra checks. However, stdatomic.h must not +be included in public headers, so they stay C99-compatible. +
+ +

Compiler-specific extensions may be used with good reason, but must not be +depended on, i.e. the code must still compile and work with compilers lacking +the extension. +

+

The following C99 features must not be used anywhere in the codebase: +

    +
  • variable-length arrays; + +
  • complex numbers; + +
  • mixed statements and declarations. +
+ + +
+

2.1.1 SIMD/DSP

+ +

As modern compilers are unable to generate efficient SIMD or other +performance-critical DSP code from plain C, handwritten assembly is used. +Usually such code is isolated in a separate function. Then the standard approach +is writing multiple versions of this function – a plain C one that works +everywhere and may also be useful for debugging, and potentially multiple +architecture-specific optimized implementations. Initialization code then +chooses the best available version at runtime and loads it into a function +pointer; the function in question is then always called through this pointer. +

+

The specific syntax used for writing assembly is: +

    +
  • NASM on x86; + +
  • GAS on ARM. +
+ +

A unit testing framework for assembly called checkasm lives under +tests/checkasm. All new assembly should come with checkasm tests; +adding tests for existing assembly that lacks them is also strongly encouraged. +

+
+
+

2.1.2 Other languages

+ +

Other languages than C may be used in special cases: +

    +
  • Compiler intrinsics or inline assembly when the code in question cannot be +written in the standard way described in the SIMD/DSP section. This +typically applies to code that needs to be inlined. + +
  • Objective-C where required for interacting with macOS-specific interfaces. +
+ +
+
+
+

2.2 Code formatting conventions

+ +

There are the following guidelines regarding the indentation in files: +

+
    +
  • Indent size is 4. + +
  • The TAB character is forbidden outside of Makefiles as is any +form of trailing whitespace. Commits containing either will be +rejected by the git repository. + +
  • You should try to limit your code lines to 80 characters; however, do so if +and only if this improves readability. + +
  • K&R coding style is used. +
+

The presentation is one inspired by ’indent -i4 -kr -nut’. +

+ +
+

2.2.1 Vim configuration

+

In order to configure Vim to follow FFmpeg formatting conventions, paste +the following snippet into your .vimrc: +

+
" indentation rules for FFmpeg: 4 spaces, no tabs
+set expandtab
+set shiftwidth=4
+set softtabstop=4
+set cindent
+set cinoptions=(0
+" Allow tabs in Makefiles.
+autocmd FileType make,automake set noexpandtab shiftwidth=8 softtabstop=8
+" Trailing whitespace and tabs are forbidden, so highlight them.
+highlight ForbiddenWhitespace ctermbg=red guibg=red
+match ForbiddenWhitespace /\s\+$\|\t/
+" Do not highlight spaces at the end of line while typing on that line.
+autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@<!$/
+
+ +
+
+

2.2.2 Emacs configuration

+

For Emacs, add these roughly equivalent lines to your .emacs.d/init.el: +

+
(c-add-style "ffmpeg"
+             '("k&r"
+               (c-basic-offset . 4)
+               (indent-tabs-mode . nil)
+               (show-trailing-whitespace . t)
+               (c-offsets-alist
+                (statement-cont . (c-lineup-assignments +)))
+               )
+             )
+(setq c-default-style "ffmpeg")
+
+ +
+
+
+

2.3 Comments

+

Use the JavaDoc/Doxygen format (see examples below) so that code documentation +can be generated automatically. All nontrivial functions should have a comment +above them explaining what the function does, even if it is just one sentence. +All structures and their member variables should be documented, too. +

+

Avoid Qt-style and similar Doxygen syntax with ! in it, i.e. replace +//! with /// and similar. Also @ syntax should be employed +for markup commands, i.e. use @param and not \param. +

+
+
/**
+ * @file
+ * MPEG codec.
+ * @author ...
+ */
+
+/**
+ * Summary sentence.
+ * more text ...
+ * ...
+ */
+typedef struct Foobar {
+    int var1; /**< var1 description */
+    int var2; ///< var2 description
+    /** var3 description */
+    int var3;
+} Foobar;
+
+/**
+ * Summary sentence.
+ * more text ...
+ * ...
+ * @param my_parameter description of my_parameter
+ * @return return value description
+ */
+int myfunc(int my_parameter)
+...
+
+ +
+
+

2.4 Naming conventions

+ +

Names of functions, variables, and struct members must be lowercase, using +underscores (_) to separate words. For example, ‘avfilter_get_video_buffer’ +is an acceptable function name and ‘AVFilterGetVideo’ is not. +

+

Struct, union, enum, and typedeffed type names must use CamelCase. All structs +and unions should be typedeffed to the same name as the struct/union tag, e.g. +typedef struct AVFoo { ... } AVFoo;. Enums are typically not +typedeffed. +

+

Enumeration constants and macros must be UPPERCASE, except for macros +masquerading as functions, which should use the function naming convention. +

+

All identifiers in the libraries should be namespaced as follows: +

    +
  • No namespacing for identifiers with file and lower scope (e.g. local variables, +static functions), and struct and union members, + +
  • The ff_ prefix must be used for variables and functions visible outside +of file scope, but only used internally within a single library, e.g. +‘ff_w64_demuxer’. This prevents name collisions when FFmpeg is statically +linked. + +
  • For variables and functions visible outside of file scope, used internally +across multiple libraries, use avpriv_ as prefix, for example, +‘avpriv_report_missing_feature’. + +
  • All other internal identifiers, like private type or macro names, should be +namespaced only to avoid possible internal conflicts. E.g. H264_NAL_SPS +vs. HEVC_NAL_SPS. + +
  • Each library has its own prefix for public symbols, in addition to the +commonly used av_ (avformat_ for libavformat, +avcodec_ for libavcodec, swr_ for libswresample, etc). +Check the existing code and choose names accordingly. + +
  • Other public identifiers (struct, union, enum, macro, type names) must use their +library’s public prefix (AV, Sws, or Swr). +
+ +

Furthermore, name space reserved for the system should not be invaded. +Identifiers ending in _t are reserved by +POSIX. +Also avoid names starting with __ or _ followed by an uppercase +letter as they are reserved by the C standard. Names starting with _ +are reserved at the file level and may not be used for externally visible +symbols. If in doubt, just avoid names starting with _ altogether. +

+
+
+

2.5 Miscellaneous conventions

+ +
    +
  • fprintf and printf are forbidden in libavformat and libavcodec, +please use av_log() instead. + +
  • Casts should be used only when necessary. Unneeded parentheses +should also be avoided if they don’t make the code easier to understand. +
+ +
+
+
+

3 Development Policy

+ + +
+

3.1 Patches/Committing

+

Licenses for patches must be compatible with FFmpeg.

+

Contributions should be licensed under the +LGPL 2.1, +including an "or any later version" clause, or, if you prefer +a gift-style license, the +ISC or +MIT license. +GPL 2 including +an "or any later version" clause is also acceptable, but LGPL is +preferred. +If you add a new file, give it a proper license header. Do not copy and +paste it from a random place, use an existing file as template. +

+

You must not commit code which breaks FFmpeg!

+

This means unfinished code which is enabled and breaks compilation, +or compiles but does not work/breaks the regression tests. Code which +is unfinished but disabled may be permitted under-circumstances, like +missing samples or an implementation with a small subset of features. +Always check the mailing list for any reviewers with issues and test +FATE before you push. +

+

Keep the main commit message short with an extended description below.

+

The commit message should have a short first line in the form of +a ‘topic: short description’ as a header, separated by a newline +from the body consisting of an explanation of why the change is necessary. +If the commit fixes a known bug on the bug tracker, the commit message +should include its bug ID. Referring to the issue on the bug tracker does +not exempt you from writing an excerpt of the bug in the commit message. +

+

Testing must be adequate but not excessive.

+

If it works for you, others, and passes FATE then it should be OK to commit +it, provided it fits the other committing criteria. You should not worry about +over-testing things. If your code has problems (portability, triggers +compiler bugs, unusual environment etc) they will be reported and eventually +fixed. +

+

Do not commit unrelated changes together.

+

They should be split them into self-contained pieces. Also do not forget +that if part B depends on part A, but A does not depend on B, then A can +and should be committed first and separate from B. Keeping changes well +split into self-contained parts makes reviewing and understanding them on +the commit log mailing list easier. This also helps in case of debugging +later on. +Also if you have doubts about splitting or not splitting, do not hesitate to +ask/discuss it on the developer mailing list. +

+

Ask before you change the build system (configure, etc).

+

Do not commit changes to the build system (Makefiles, configure script) +which change behavior, defaults etc, without asking first. The same +applies to compiler warning fixes, trivial looking fixes and to code +maintained by other developers. We usually have a reason for doing things +the way we do. Send your changes as patches to the ffmpeg-devel mailing +list, and if the code maintainers say OK, you may commit. This does not +apply to files you wrote and/or maintain. +

+

Cosmetic changes should be kept in separate patches.

+

We refuse source indentation and other cosmetic changes if they are mixed +with functional changes, such commits will be rejected and removed. Every +developer has his own indentation style, you should not change it. Of course +if you (re)write something, you can use your own style, even though we would +prefer if the indentation throughout FFmpeg was consistent (Many projects +force a given indentation style - we do not.). If you really need to make +indentation changes (try to avoid this), separate them strictly from real +changes. +

+

NOTE: If you had to put if(){ .. } over a large (> 5 lines) chunk of code, +then either do NOT change the indentation of the inner part within (do not +move it to the right)! or do so in a separate commit +

+

Commit messages should always be filled out properly.

+

Always fill out the commit log message. Describe in a few lines what you +changed and why. You can refer to mailing list postings if you fix a +particular bug. Comments such as "fixed!" or "Changed it." are unacceptable. +Recommended format: +

+
+
area changed: Short 1 line description
+
+details describing what and why and giving references.
+
+ +

Credit the author of the patch.

+

Make sure the author of the commit is set correctly. (see git commit –author) +If you apply a patch, send an +answer to ffmpeg-devel (or wherever you got the patch from) saying that +you applied the patch. +

+

Complex patches should refer to discussion surrounding them.

+

When applying patches that have been discussed (at length) on the mailing +list, reference the thread in the log message. +

+

Always wait long enough before pushing changes

+

Do NOT commit to code actively maintained by others without permission. +Send a patch to ffmpeg-devel. If no one answers within a reasonable +time-frame (12h for build failures and security fixes, 3 days small changes, +1 week for big patches) then commit your patch if you think it is OK. +Also note, the maintainer can simply ask for more time to review! +

+
+
+

3.2 Code

+

Warnings for correct code may be disabled if there is no other option.

+

Compiler warnings indicate potential bugs or code with bad style. If a type of +warning always points to correct and clean code, that warning should +be disabled, not the code changed. +Thus the remaining warnings can either be bugs or correct code. +If it is a bug, the bug has to be fixed. If it is not, the code should +be changed to not generate a warning unless that causes a slowdown +or obfuscates the code. +

+

Check untrusted input properly.

+

Never write to unallocated memory, never write over the end of arrays, +always check values read from some untrusted source before using them +as array index or other risky things. +

+
+
+

3.3 Library public interfaces

+

Every library in FFmpeg provides a set of public APIs in its installed headers, +which are those listed in the variable HEADERS in that library’s +Makefile. All identifiers defined in those headers (except for those +explicitly documented otherwise), and corresponding symbols exported from +compiled shared or static libraries are considered public interfaces and must +comply with the API and ABI compatibility rules described in this section. +

+

Public APIs must be backward compatible within a given major version. I.e. any +valid user code that compiles and works with a given library version must still +compile and work with any later version, as long as the major version number is +unchanged. "Valid user code" here means code that is calling our APIs in a +documented and/or intended manner and is not relying on any undefined behavior. +Incrementing the major version may break backward compatibility, but only to the +extent described in Major version bumps. +

+

We also guarantee backward ABI compatibility for shared and static libraries. +I.e. it should be possible to replace a shared or static build of our library +with a build of any later version (re-linking the user binary in the static +case) without breaking any valid user binaries, as long as the major version +number remains unchanged. +

+ +
+

3.3.1 Adding new interfaces

+

Any new public identifiers in installed headers are considered new API - this +includes new functions, structs, macros, enum values, typedefs, new fields in +existing functions, new installed headers, etc. Consider the following +guidelines when adding new APIs. +

+

Motivation

+

While new APIs can be added relatively easily, changing or removing them is much +harder due to abovementioned compatibility requirements. You should then +consider carefully whether the functionality you are adding really needs to be +exposed to our callers as new public API. +

+

Your new API should have at least one well-established use case outside of the +library that cannot be easily achieved with existing APIs. Every library in +FFmpeg also has a defined scope - your new API must fit within it. +

+

Replacing existing APIs

+

If your new API is replacing an existing one, it should be strictly superior to +it, so that the advantages of using the new API outweight the cost to the +callers of changing their code. After adding the new API you should then +deprecate the old one and schedule it for removal, as described in +Removing interfaces. +

+

If you deem an existing API deficient and want to fix it, the preferred approach +in most cases is to add a differently-named replacement and deprecate the +existing API rather than modify it. It is important to make the changes visible +to our callers (e.g. through compile- or run-time deprecation warnings) and make +it clear how to transition to the new API (e.g. in the Doxygen documentation or +on the wiki). +

+

API design

+

The FFmpeg libraries are used by a variety of callers to perform a wide range of +multimedia-related processing tasks. You should therefore - within reason - try +to design your new API for the broadest feasible set of use cases and avoid +unnecessarily limiting it to a specific type of callers (e.g. just media +playback or just transcoding). +

+

Consistency

+

Check whether similar APIs already exist in FFmpeg. If they do, try to model +your new addition on them to achieve better overall consistency. +

+

The naming of your new identifiers should follow the Naming conventions +and be aligned with other similar APIs, if applicable. +

+

Extensibility

+

You should also consider how your API might be extended in the future in a +backward-compatible way. If you are adding a new struct AVFoo, the +standard approach is requiring the caller to always allocate it through a +constructor function, typically named av_foo_alloc(). This way new fields +may be added to the end of the struct without breaking ABI compatibility. +Typically you will also want a destructor - av_foo_free(AVFoo**) that +frees the indirectly supplied object (and its contents, if applicable) and +writes NULL to the supplied pointer, thus eliminating the potential +dangling pointer in the caller’s memory. +

+

If you are adding new functions, consider whether it might be desirable to tweak +their behavior in the future - you may want to add a flags argument, even though +it would be unused initially. +

+

Documentation

+

All new APIs must be documented as Doxygen-formatted comments above the +identifiers you add to the public headers. You should also briefly mention the +change in doc/APIchanges. +

+

Bump the version

+

Backward-incompatible API or ABI changes require incrementing (bumping) the +major version number, as described in Major version bumps. Major +bumps are significant events that happen on a schedule - so if your change +strictly requires one you should add it under #if preprocesor guards that +disable it until the next major bump happens. +

+

New APIs that can be added without breaking API or ABI compatibility require +bumping the minor version number. +

+

Incrementing the third (micro) version component means a noteworthy binary +compatible change (e.g. encoder bug fix that matters for the decoder). The third +component always starts at 100 to distinguish FFmpeg from Libav. +

+
+
+

3.3.2 Removing interfaces

+

Due to abovementioned compatibility guarantees, removing APIs is an involved +process that should only be undertaken with good reason. Typically a deficient, +restrictive, or otherwise inadequate API is replaced by a superior one, though +it does at times happen that we remove an API without any replacement (e.g. when +the feature it provides is deemed not worth the maintenance effort, out of scope +of the project, fundamentally flawed, etc.). +

+

The removal has two steps - first the API is deprecated and scheduled for +removal, but remains present and functional. The second step is actually +removing the API - this is described in Major version bumps. +

+

To deprecate an API you should signal to our users that they should stop using +it. E.g. if you intend to remove struct members or functions, you should mark +them with attribute_deprecated. When this cannot be done, it may be +possible to detect the use of the deprecated API at runtime and print a warning +(though take care not to print it too often). You should also document the +deprecation (and the replacement, if applicable) in the relevant Doxygen +documentation block. +

+

Finally, you should define a deprecation guard along the lines of +#define FF_API_<FOO> (LIBAVBAR_VERSION_MAJOR < XX) (where XX is the major +version in which the API will be removed) in libavbar/version_major.h +(version.h in case of libavutil). Then wrap all uses of the +deprecated API in #if FF_API_<FOO> .... #endif, so that the code will +automatically get disabled once the major version reaches XX. You can also use +FF_DISABLE_DEPRECATION_WARNINGS and FF_ENABLE_DEPRECATION_WARNINGS +to suppress compiler deprecation warnings inside these guards. You should test +that the code compiles and works with the guard macro evaluating to both true +and false. +

+
+
+

3.3.3 Major version bumps

+

A major version bump signifies an API and/or ABI compatibility break. To reduce +the negative effects on our callers, who are required to adapt their code, +backward-incompatible changes during a major bump should be limited to: +

    +
  • Removing previously deprecated APIs. + +
  • Performing ABI- but not API-breaking changes, like reordering struct contents. +
+ +
+
+
+

3.4 Documentation/Other

+

Subscribe to the ffmpeg-devel mailing list.

+

It is important to be subscribed to the +ffmpeg-devel +mailing list. Almost any non-trivial patch is to be sent there for review. +Other developers may have comments about your contribution. We expect you see +those comments, and to improve it if requested. (N.B. Experienced committers +have other channels, and may sometimes skip review for trivial fixes.) Also, +discussion here about bug fixes and FFmpeg improvements by other developers may +be helpful information for you. Finally, by being a list subscriber, your +contribution will be posted immediately to the list, without the moderation +hold which messages from non-subscribers experience. +

+

However, it is more important to the project that we receive your patch than +that you be subscribed to the ffmpeg-devel list. If you have a patch, and don’t +want to subscribe and discuss the patch, then please do send it to the list +anyway. +

+

Subscribe to the ffmpeg-cvslog mailing list.

+

Diffs of all commits are sent to the +ffmpeg-cvslog +mailing list. Some developers read this list to review all code base changes +from all sources. Subscribing to this list is not mandatory. +

+

Keep the documentation up to date.

+

Update the documentation if you change behavior or add features. If you are +unsure how best to do this, send a patch to ffmpeg-devel, the documentation +maintainer(s) will review and commit your stuff. +

+

Important discussions should be accessible to all.

+

Try to keep important discussions and requests (also) on the public +developer mailing list, so that all developers can benefit from them. +

+

Check your entries in MAINTAINERS.

+

Make sure that no parts of the codebase that you maintain are missing from the +MAINTAINERS file. If something that you want to maintain is missing add it with +your name after it. +If at some point you no longer want to maintain some code, then please help in +finding a new maintainer and also don’t forget to update the MAINTAINERS file. +

+

We think our rules are not too hard. If you have comments, contact us. +

+
+
+
+

4 Submitting patches

+ +

First, read the Coding Rules above if you did not yet, in particular +the rules regarding patch submission. +

+

When you submit your patch, please use git format-patch or +git send-email. We cannot read other diffs :-). +

+

Also please do not submit a patch which contains several unrelated changes. +Split it into separate, self-contained pieces. This does not mean splitting +file by file. Instead, make the patch as small as possible while still +keeping it as a logical unit that contains an individual change, even +if it spans multiple files. This makes reviewing your patches much easier +for us and greatly increases your chances of getting your patch applied. +

+

Use the patcheck tool of FFmpeg to check your patch. +The tool is located in the tools directory. +

+

Run the Regression tests before submitting a patch in order to verify +it does not cause unexpected problems. +

+

It also helps quite a bit if you tell us what the patch does (for example +’replaces lrint by lrintf’), and why (for example ’*BSD isn’t C99 compliant +and has no lrint()’) +

+

Also please if you send several patches, send each patch as a separate mail, +do not attach several unrelated patches to the same mail. +

+

Patches should be posted to the +ffmpeg-devel +mailing list. Use git send-email when possible since it will properly +send patches without requiring extra care. If you cannot, then send patches +as base64-encoded attachments, so your patch is not trashed during +transmission. Also ensure the correct mime type is used +(text/x-diff or text/x-patch or at least text/plain) and that only one +patch is inline or attached per mail. +You can check https://patchwork.ffmpeg.org, if your patch does not show up, its mime type +likely was wrong. +

+

Sending patches from email clients

+

Using git send-email might not be desirable for everyone. The +following trick allows to send patches via email clients in a safe +way. It has been tested with Outlook and Thunderbird (with X-Unsent +extension) and might work with other applications. +

+

Create your patch like this: +

+
git format-patch -s -o "outputfolder" --add-header "X-Unsent: 1" --suffix .eml --to ffmpeg-devel@ffmpeg.org -1 1a2b3c4d
+
+

Now you’ll just need to open the eml file with the email application +and execute ’Send’. +

+

Reviews

+

Your patch will be reviewed on the mailing list. You will likely be asked +to make some changes and are expected to send in an improved version that +incorporates the requests from the review. This process may go through +several iterations. Once your patch is deemed good enough, some developer +will pick it up and commit it to the official FFmpeg tree. +

+

Give us a few days to react. But if some time passes without reaction, +send a reminder by email. Your patch should eventually be dealt with. +

+ +
+
+

5 New codecs or formats checklist

+ +
    +
  1. Did you use av_cold for codec initialization and close functions? + +
  2. Did you add a long_name under NULL_IF_CONFIG_SMALL to the AVCodec or +AVInputFormat/AVOutputFormat struct? + +
  3. Did you bump the minor version number (and reset the micro version +number) in libavcodec/version.h or libavformat/version.h? + +
  4. Did you register it in allcodecs.c or allformats.c? + +
  5. Did you add the AVCodecID to avcodec.h? +When adding new codec IDs, also add an entry to the codec descriptor +list in libavcodec/codec_desc.c. + +
  6. If it has a FourCC, did you add it to libavformat/riff.c, +even if it is only a decoder? + +
  7. Did you add a rule to compile the appropriate files in the Makefile? +Remember to do this even if you’re just adding a format to a file that is +already being compiled by some other rule, like a raw demuxer. + +
  8. Did you add an entry to the table of supported formats or codecs in +doc/general.texi? + +
  9. Did you add an entry in the Changelog? + +
  10. If it depends on a parser or a library, did you add that dependency in +configure? + +
  11. Did you git add the appropriate files before committing? + +
  12. Did you make sure it compiles standalone, i.e. with +configure --disable-everything --enable-decoder=foo +(or --enable-demuxer or whatever your component is)? +
+ + +
+
+

6 Patch submission checklist

+ +
    +
  1. Does make fate pass with the patch applied? + +
  2. Was the patch generated with git format-patch or send-email? + +
  3. Did you sign-off your patch? (git commit -s) +See Sign your work for the meaning +of sign-off. + +
  4. Did you provide a clear git commit log message? + +
  5. Is the patch against latest FFmpeg git master branch? + +
  6. Are you subscribed to ffmpeg-devel? +(the list is subscribers only due to spam) + +
  7. Have you checked that the changes are minimal, so that the same cannot be +achieved with a smaller patch and/or simpler final code? + +
  8. If the change is to speed critical code, did you benchmark it? + +
  9. If you did any benchmarks, did you provide them in the mail? + +
  10. Have you checked that the patch does not introduce buffer overflows or +other security issues? + +
  11. Did you test your decoder or demuxer against damaged data? If no, see +tools/trasher, the noise bitstream filter, and +zzuf. Your decoder or demuxer +should not crash, end in a (near) infinite loop, or allocate ridiculous +amounts of memory when fed damaged data. + +
  12. Did you test your decoder or demuxer against sample files? +Samples may be obtained at https://samples.ffmpeg.org. + +
  13. Does the patch not mix functional and cosmetic changes? + +
  14. Did you add tabs or trailing whitespace to the code? Both are forbidden. + +
  15. Is the patch attached to the email you send? + +
  16. Is the mime type of the patch correct? It should be text/x-diff or +text/x-patch or at least text/plain and not application/octet-stream. + +
  17. If the patch fixes a bug, did you provide a verbose analysis of the bug? + +
  18. If the patch fixes a bug, did you provide enough information, including +a sample, so the bug can be reproduced and the fix can be verified? +Note please do not attach samples >100k to mails but rather provide a +URL, you can upload to https://streams.videolan.org/upload/. + +
  19. Did you provide a verbose summary about what the patch does change? + +
  20. Did you provide a verbose explanation why it changes things like it does? + +
  21. Did you provide a verbose summary of the user visible advantages and +disadvantages if the patch is applied? + +
  22. Did you provide an example so we can verify the new feature added by the +patch easily? + +
  23. If you added a new file, did you insert a license header? It should be +taken from FFmpeg, not randomly copied and pasted from somewhere else. + +
  24. You should maintain alphabetical order in alphabetically ordered lists as +long as doing so does not break API/ABI compatibility. + +
  25. Lines with similar content should be aligned vertically when doing so +improves readability. + +
  26. Consider adding a regression test for your code. + +
  27. If you added YASM code please check that things still work with –disable-yasm. + +
  28. Make sure you check the return values of function and return appropriate +error codes. Especially memory allocation functions like av_malloc() +are notoriously left unchecked, which is a serious problem. + +
  29. Test your code with valgrind and or Address Sanitizer to ensure it’s free +of leaks, out of array accesses, etc. +
+ +
+
+

7 Patch review process

+ +

All patches posted to ffmpeg-devel will be reviewed, unless they contain a +clear note that the patch is not for the git master branch. +Reviews and comments will be posted as replies to the patch on the +mailing list. The patch submitter then has to take care of every comment, +that can be by resubmitting a changed patch or by discussion. Resubmitted +patches will themselves be reviewed like any other patch. If at some point +a patch passes review with no comments then it is approved, that can for +simple and small patches happen immediately while large patches will generally +have to be changed and reviewed many times before they are approved. +After a patch is approved it will be committed to the repository. +

+

We will review all submitted patches, but sometimes we are quite busy so +especially for large patches this can take several weeks. +

+

If you feel that the review process is too slow and you are willing to try to +take over maintainership of the area of code you change then just clone +git master and maintain the area of code there. We will merge each area from +where its best maintained. +

+

When resubmitting patches, please do not make any significant changes +not related to the comments received during review. Such patches will +be rejected. Instead, submit significant changes or new features as +separate patches. +

+

Everyone is welcome to review patches. Also if you are waiting for your patch +to be reviewed, please consider helping to review other patches, that is a great +way to get everyone’s patches reviewed sooner. +

+
+
+

8 Regression tests

+ +

Before submitting a patch (or committing to the repository), you should at least +test that you did not break anything. +

+

Running ’make fate’ accomplishes this, please see fate.html for details. +

+

[Of course, some patches may change the results of the regression tests. In +this case, the reference results of the regression tests shall be modified +accordingly]. +

+ +
+

8.1 Adding files to the fate-suite dataset

+ +

If you need a sample uploaded send a mail to samples-request. +

+

When there is no muxer or encoder available to generate test media for a +specific test then the media has to be included in the fate-suite. +First please make sure that the sample file is as small as possible to test the +respective decoder or demuxer sufficiently. Large files increase network +bandwidth and disk space requirements. +Once you have a working fate test and fate sample, provide in the commit +message or introductory message for the patch series that you post to +the ffmpeg-devel mailing list, a direct link to download the sample media. +

+
+
+

8.2 Visualizing Test Coverage

+ +

The FFmpeg build system allows visualizing the test coverage in an easy +manner with the coverage tools gcov/lcov. This involves +the following steps: +

+
    +
  1. Configure to compile with instrumentation enabled: + configure --toolchain=gcov. + +
  2. Run your test case, either manually or via FATE. This can be either + the full FATE regression suite, or any arbitrary invocation of any + front-end tool provided by FFmpeg, in any combination. + +
  3. Run make lcov to generate coverage data in HTML format. + +
  4. View lcov/index.html in your preferred HTML viewer. +
+ +

You can use the command make lcov-reset to reset the coverage +measurements. You will need to rerun make lcov after running a +new test. +

+
+
+

8.3 Using Valgrind

+ +

The configure script provides a shortcut for using valgrind to spot bugs +related to memory handling. Just add the option +--toolchain=valgrind-memcheck or --toolchain=valgrind-massif +to your configure line, and reasonable defaults will be set for running +FATE under the supervision of either the memcheck or the +massif tool of the valgrind suite. +

+

In case you need finer control over how valgrind is invoked, use the +--target-exec='valgrind <your_custom_valgrind_options> option in +your configure line instead. +

+
+
+
+

9 Release process

+ +

FFmpeg maintains a set of release branches, which are the +recommended deliverable for system integrators and distributors (such as +Linux distributions, etc.). At regular times, a release +manager prepares, tests and publishes tarballs on the +https://ffmpeg.org website. +

+

There are two kinds of releases: +

+
    +
  1. Major releases always include the latest and greatest +features and functionality. + +
  2. Point releases are cut from release branches, +which are named release/X, with X being the release +version number. +
+ +

Note that we promise to our users that shared libraries from any FFmpeg +release never break programs that have been compiled against +previous versions of the same release series in any case! +

+

However, from time to time, we do make API changes that require adaptations +in applications. Such changes are only allowed in (new) major releases and +require further steps such as bumping library version numbers and/or +adjustments to the symbol versioning file. Please discuss such changes +on the ffmpeg-devel mailing list in time to allow forward planning. +

+ +
+

9.1 Criteria for Point Releases

+ +

Changes that match the following criteria are valid candidates for +inclusion into a point release: +

+
    +
  1. Fixes a security issue, preferably identified by a CVE +number issued by http://cve.mitre.org/. + +
  2. Fixes a documented bug in https://trac.ffmpeg.org. + +
  3. Improves the included documentation. + +
  4. Retains both source code and binary compatibility with previous +point releases of the same release branch. +
+ +

The order for checking the rules is (1 OR 2 OR 3) AND 4. +

+ +
+
+

9.2 Release Checklist

+ +

The release process involves the following steps: +

+
    +
  1. Ensure that the RELEASE file contains the version number for +the upcoming release. + +
  2. Add the release at https://trac.ffmpeg.org/admin/ticket/versions. + +
  3. Announce the intent to do a release to the mailing list. + +
  4. Make sure all relevant security fixes have been backported. See +https://ffmpeg.org/security.html. + +
  5. Ensure that the FATE regression suite still passes in the release +branch on at least i386 and amd64 +(cf. Regression tests). + +
  6. Prepare the release tarballs in bz2 and gz formats, and +supplementing files that contain gpg signatures + +
  7. Publish the tarballs at https://ffmpeg.org/releases. Create and +push an annotated tag in the form nX, with X +containing the version number. + +
  8. Propose and send a patch to the ffmpeg-devel mailing list +with a news entry for the website. + +
  9. Publish the news entry. + +
  10. Send an announcement to the mailing list. +
+ +
+
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/faq.html b/mm_avh_working_space/bin/ffmpeg/doc/faq.html new file mode 100644 index 0000000000000000000000000000000000000000..57c284c03f6d5fc38f30a7900b0df094d4e6cf98 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/faq.html @@ -0,0 +1,941 @@ + + + + + +FFmpeg FAQ + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ +
+ + +
+
+
+

1 General Questions

+ + +
+

1.1 Why doesn’t FFmpeg support feature [xyz]?

+ +

Because no one has taken on that task yet. FFmpeg development is +driven by the tasks that are important to the individual developers. +If there is a feature that is important to you, the best way to get +it implemented is to undertake the task yourself or sponsor a developer. +

+
+
+

1.2 FFmpeg does not support codec XXX. Can you include a Windows DLL loader to support it?

+ +

No. Windows DLLs are not portable, bloated and often slow. +Moreover FFmpeg strives to support all codecs natively. +A DLL loader is not conducive to that goal. +

+
+
+

1.3 I cannot read this file although this format seems to be supported by ffmpeg.

+ +

Even if ffmpeg can read the container format, it may not support all its +codecs. Please consult the supported codec list in the ffmpeg +documentation. +

+
+
+

1.4 Which codecs are supported by Windows?

+ +

Windows does not support standard formats like MPEG very well, unless you +install some additional codecs. +

+

The following list of video codecs should work on most Windows systems: +

+
msmpeg4v2
+

.avi/.asf +

+
msmpeg4
+

.asf only +

+
wmv1
+

.asf only +

+
wmv2
+

.asf only +

+
mpeg4
+

Only if you have some MPEG-4 codec like ffdshow or Xvid installed. +

+
mpeg1video
+

.mpg only +

+
+

Note, ASF files often have .wmv or .wma extensions in Windows. It should also +be mentioned that Microsoft claims a patent on the ASF format, and may sue +or threaten users who create ASF files with non-Microsoft software. It is +strongly advised to avoid ASF where possible. +

+

The following list of audio codecs should work on most Windows systems: +

+
adpcm_ima_wav
+
adpcm_ms
+
pcm_s16le
+

always +

+
libmp3lame
+

If some MP3 codec like LAME is installed. +

+
+ + +
+
+
+

2 Compilation

+ + +
+

2.1 error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'

+ +

This is a bug in gcc. Do not report it to us. Instead, please report it to +the gcc developers. Note that we will not add workarounds for gcc bugs. +

+

Also note that (some of) the gcc developers believe this is not a bug or +not a bug they should fix: +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203. +Then again, some of them do not know the difference between an undecidable +problem and an NP-hard problem... +

+
+
+

2.2 I have installed this library with my distro’s package manager. Why does configure not see it?

+ +

Distributions usually split libraries in several packages. The main package +contains the files necessary to run programs using the library. The +development package contains the files necessary to build programs using the +library. Sometimes, docs and/or data are in a separate package too. +

+

To build FFmpeg, you need to install the development package. It is usually +called libfoo-dev or libfoo-devel. You can remove it after the +build is finished, but be sure to keep the main package. +

+
+
+

2.3 How do I make pkg-config find my libraries?

+ +

Somewhere along with your libraries, there is a .pc file (or several) +in a pkgconfig directory. You need to set environment variables to +point pkg-config to these files. +

+

If you need to add directories to pkg-config’s search list +(typical use case: library installed separately), add it to +$PKG_CONFIG_PATH: +

+
+
export PKG_CONFIG_PATH=/opt/x264/lib/pkgconfig:/opt/opus/lib/pkgconfig
+
+ +

If you need to replace pkg-config’s search list +(typical use case: cross-compiling), set it in +$PKG_CONFIG_LIBDIR: +

+
+
export PKG_CONFIG_LIBDIR=/home/me/cross/usr/lib/pkgconfig:/home/me/cross/usr/local/lib/pkgconfig
+
+ +

If you need to know the library’s internal dependencies (typical use: static +linking), add the --static option to pkg-config: +

+
+
./configure --pkg-config-flags=--static
+
+ +
+
+

2.4 How do I use pkg-config when cross-compiling?

+ +

The best way is to install pkg-config in your cross-compilation +environment. It will automatically use the cross-compilation libraries. +

+

You can also use pkg-config from the host environment by +specifying explicitly --pkg-config=pkg-config to configure. +In that case, you must point pkg-config to the correct directories +using the PKG_CONFIG_LIBDIR, as explained in the previous entry. +

+

As an intermediate solution, you can place in your cross-compilation +environment a script that calls the host pkg-config with +PKG_CONFIG_LIBDIR set. That script can look like that: +

+
+
#!/bin/sh
+PKG_CONFIG_LIBDIR=/path/to/cross/lib/pkgconfig
+export PKG_CONFIG_LIBDIR
+exec /usr/bin/pkg-config "$@"
+
+ +
+
+
+

3 Usage

+ + +
+

3.1 ffmpeg does not work; what is wrong?

+ +

Try a make distclean in the ffmpeg source directory before the build. +If this does not help see +(https://ffmpeg.org/bugreports.html). +

+
+
+

3.2 How do I encode single pictures into movies?

+ +

First, rename your pictures to follow a numerical sequence. +For example, img1.jpg, img2.jpg, img3.jpg,... +Then you may run: +

+
+
ffmpeg -f image2 -i img%d.jpg /tmp/a.mpg
+
+ +

Notice that ‘%d’ is replaced by the image number. +

+

img%03d.jpg means the sequence img001.jpg, img002.jpg, etc. +

+

Use the -start_number option to declare a starting number for +the sequence. This is useful if your sequence does not start with +img001.jpg but is still in a numerical order. The following +example will start with img100.jpg: +

+
+
ffmpeg -f image2 -start_number 100 -i img%d.jpg /tmp/a.mpg
+
+ +

If you have large number of pictures to rename, you can use the +following command to ease the burden. The command, using the bourne +shell syntax, symbolically links all files in the current directory +that match *jpg to the /tmp directory in the sequence of +img001.jpg, img002.jpg and so on. +

+
+
x=1; for i in *jpg; do counter=$(printf %03d $x); ln -s "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done
+
+ +

If you want to sequence them by oldest modified first, substitute +$(ls -r -t *jpg) in place of *jpg. +

+

Then run: +

+
+
ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg
+
+ +

The same logic is used for any image format that ffmpeg reads. +

+

You can also use cat to pipe images to ffmpeg: +

+
+
cat *.jpg | ffmpeg -f image2pipe -c:v mjpeg -i - output.mpg
+
+ +
+
+

3.3 How do I encode movie to single pictures?

+ +

Use: +

+
+
ffmpeg -i movie.mpg movie%d.jpg
+
+ +

The movie.mpg used as input will be converted to +movie1.jpg, movie2.jpg, etc... +

+

Instead of relying on file format self-recognition, you may also use +

+
-c:v ppm
+
-c:v png
+
-c:v mjpeg
+
+

to force the encoding. +

+

Applying that to the previous example: +

+
ffmpeg -i movie.mpg -f image2 -c:v mjpeg menu%d.jpg
+
+ +

Beware that there is no "jpeg" codec. Use "mjpeg" instead. +

+
+
+

3.4 Why do I see a slight quality degradation with multithreaded MPEG* encoding?

+ +

For multithreaded MPEG* encoding, the encoded slices must be independent, +otherwise thread n would practically have to wait for n-1 to finish, so it’s +quite logical that there is a small reduction of quality. This is not a bug. +

+
+
+

3.5 How can I read from the standard input or write to the standard output?

+ +

Use - as file name. +

+
+
+

3.6 -f jpeg doesn’t work.

+ +

Try ’-f image2 test%d.jpg’. +

+
+
+

3.7 Why can I not change the frame rate?

+ +

Some codecs, like MPEG-1/2, only allow a small number of fixed frame rates. +Choose a different codec with the -c:v command line option. +

+
+
+

3.8 How do I encode Xvid or DivX video with ffmpeg?

+ +

Both Xvid and DivX (version 4+) are implementations of the ISO MPEG-4 +standard (note that there are many other coding formats that use this +same standard). Thus, use ’-c:v mpeg4’ to encode in these formats. The +default fourcc stored in an MPEG-4-coded file will be ’FMP4’. If you want +a different fourcc, use the ’-vtag’ option. E.g., ’-vtag xvid’ will +force the fourcc ’xvid’ to be stored as the video fourcc rather than the +default. +

+
+
+

3.9 Which are good parameters for encoding high quality MPEG-4?

+ +

’-mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2’, +things to try: ’-bf 2’, ’-mpv_flags qp_rd’, ’-mpv_flags mv0’, ’-mpv_flags skip_rd’. +

+
+
+

3.10 Which are good parameters for encoding high quality MPEG-1/MPEG-2?

+ +

’-mbd rd -trellis 2 -cmp 2 -subcmp 2 -g 100 -pass 1/2’ +but beware the ’-g 100’ might cause problems with some decoders. +Things to try: ’-bf 2’, ’-mpv_flags qp_rd’, ’-mpv_flags mv0’, ’-mpv_flags skip_rd’. +

+
+
+

3.11 Interlaced video looks very bad when encoded with ffmpeg, what is wrong?

+ +

You should use ’-flags +ilme+ildct’ and maybe ’-flags +alt’ for interlaced +material, and try ’-top 0/1’ if the result looks really messed-up. +

+
+
+

3.12 How can I read DirectShow files?

+ +

If you have built FFmpeg with ./configure --enable-avisynth +(only possible on MinGW/Cygwin platforms), +then you may use any file that DirectShow can read as input. +

+

Just create an "input.avs" text file with this single line ... +

+
DirectShowSource("C:\path to your file\yourfile.asf")
+
+

... and then feed that text file to ffmpeg: +

+
ffmpeg -i input.avs
+
+ +

For ANY other help on AviSynth, please visit the +AviSynth homepage. +

+
+
+

3.13 How can I join video files?

+ +

To "join" video files is quite ambiguous. The following list explains the +different kinds of "joining" and points out how those are addressed in +FFmpeg. To join video files may mean: +

+
    +
  • To put them one after the other: this is called to concatenate them +(in short: concat) and is addressed +in this very faq. + +
  • To put them together in the same file, to let the user choose between the +different versions (example: different audio languages): this is called to +multiplex them together (in short: mux), and is done by simply +invoking ffmpeg with several -i options. + +
  • For audio, to put all channels together in a single stream (example: two +mono streams into one stereo stream): this is sometimes called to +merge them, and can be done using the +amerge filter. + +
  • For audio, to play one on top of the other: this is called to mix +them, and can be done by first merging them into a single stream and then +using the pan filter to mix +the channels at will. + +
  • For video, to display both together, side by side or one on top of a part of +the other; it can be done using the +overlay video filter. + +
+ +
+
+

3.14 How can I concatenate video files?

+ +

There are several solutions, depending on the exact circumstances. +

+ +
+

3.14.1 Concatenating using the concat filter

+ +

FFmpeg has a concat filter designed specifically for that, with examples in the +documentation. This operation is recommended if you need to re-encode. +

+
+
+

3.14.2 Concatenating using the concat demuxer

+ +

FFmpeg has a concat demuxer which you can use when you want to avoid a re-encode and +your format doesn’t support file level concatenation. +

+
+
+

3.14.3 Concatenating using the concat protocol (file level)

+ +

FFmpeg has a concat protocol designed specifically for that, with examples in the +documentation. +

+

A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow one to concatenate +video by merely concatenating the files containing them. +

+

Hence you may concatenate your multimedia files by first transcoding them to +these privileged formats, then using the humble cat command (or the +equally humble copy under Windows), and finally transcoding back to your +format of choice. +

+
+
ffmpeg -i input1.avi -qscale:v 1 intermediate1.mpg
+ffmpeg -i input2.avi -qscale:v 1 intermediate2.mpg
+cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
+ffmpeg -i intermediate_all.mpg -qscale:v 2 output.avi
+
+ +

Additionally, you can use the concat protocol instead of cat or +copy which will avoid creation of a potentially huge intermediate file. +

+
+
ffmpeg -i input1.avi -qscale:v 1 intermediate1.mpg
+ffmpeg -i input2.avi -qscale:v 1 intermediate2.mpg
+ffmpeg -i concat:"intermediate1.mpg|intermediate2.mpg" -c copy intermediate_all.mpg
+ffmpeg -i intermediate_all.mpg -qscale:v 2 output.avi
+
+ +

Note that you may need to escape the character "|" which is special for many +shells. +

+

Another option is usage of named pipes, should your platform support it: +

+
+
mkfifo intermediate1.mpg
+mkfifo intermediate2.mpg
+ffmpeg -i input1.avi -qscale:v 1 -y intermediate1.mpg < /dev/null &
+ffmpeg -i input2.avi -qscale:v 1 -y intermediate2.mpg < /dev/null &
+cat intermediate1.mpg intermediate2.mpg |\
+ffmpeg -f mpeg -i - -c:v mpeg4 -c:a libmp3lame output.avi
+
+ +
+
+

3.14.4 Concatenating using raw audio and video

+ +

Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also +allow concatenation, and the transcoding step is almost lossless. +When using multiple yuv4mpegpipe(s), the first line needs to be discarded +from all but the first stream. This can be accomplished by piping through +tail as seen below. Note that when piping through tail you +must use command grouping, { ;}, to background properly. +

+

For example, let’s say we want to concatenate two FLV files into an +output.flv file: +

+
+
mkfifo temp1.a
+mkfifo temp1.v
+mkfifo temp2.a
+mkfifo temp2.v
+mkfifo all.a
+mkfifo all.v
+ffmpeg -i input1.flv -vn -f u16le -c:a pcm_s16le -ac 2 -ar 44100 - > temp1.a < /dev/null &
+ffmpeg -i input2.flv -vn -f u16le -c:a pcm_s16le -ac 2 -ar 44100 - > temp2.a < /dev/null &
+ffmpeg -i input1.flv -an -f yuv4mpegpipe - > temp1.v < /dev/null &
+{ ffmpeg -i input2.flv -an -f yuv4mpegpipe - < /dev/null | tail -n +2 > temp2.v ; } &
+cat temp1.a temp2.a > all.a &
+cat temp1.v temp2.v > all.v &
+ffmpeg -f u16le -c:a pcm_s16le -ac 2 -ar 44100 -i all.a \
+       -f yuv4mpegpipe -i all.v \
+       -y output.flv
+rm temp[12].[av] all.[av]
+
+ +
+
+
+

3.15 Using -f lavfi, audio becomes mono for no apparent reason.

+ +

Use -dumpgraph - to find out exactly where the channel layout is +lost. +

+

Most likely, it is through auto-inserted aresample. Try to understand +why the converting filter was needed at that place. +

+

Just before the output is a likely place, as -f lavfi currently +only support packed S16. +

+

Then insert the correct aformat explicitly in the filtergraph, +specifying the exact format. +

+
+
aformat=sample_fmts=s16:channel_layouts=stereo
+
+ +
+
+

3.16 Why does FFmpeg not see the subtitles in my VOB file?

+ +

VOB and a few other formats do not have a global header that describes +everything present in the file. Instead, applications are supposed to scan +the file to see what it contains. Since VOB files are frequently large, only +the beginning is scanned. If the subtitles happen only later in the file, +they will not be initially detected. +

+

Some applications, including the ffmpeg command-line tool, can only +work with streams that were detected during the initial scan; streams that +are detected later are ignored. +

+

The size of the initial scan is controlled by two options: probesize +(default ~5 Mo) and analyzeduration (default 5,000,000 µs = 5 s). For +the subtitle stream to be detected, both values must be large enough. +

+
+
+

3.17 Why was the ffmpeg -sameq option removed? What to use instead?

+ +

The -sameq option meant "same quantizer", and made sense only in a +very limited set of cases. Unfortunately, a lot of people mistook it for +"same quality" and used it in places where it did not make sense: it had +roughly the expected visible effect, but achieved it in a very inefficient +way. +

+

Each encoder has its own set of options to set the quality-vs-size balance, +use the options for the encoder you are using to set the quality level to a +point acceptable for your tastes. The most common options to do that are +-qscale and -qmax, but you should peruse the documentation +of the encoder you chose. +

+
+
+

3.18 I have a stretched video, why does scaling does not fix it?

+ +

A lot of video codecs and formats can store the aspect ratio of the +video: this is the ratio between the width and the height of either the full +image (DAR, display aspect ratio) or individual pixels (SAR, sample aspect +ratio). For example, EGA screens at resolution 640×350 had 4:3 DAR and 35:48 +SAR. +

+

Most still image processing work with square pixels, i.e. 1:1 SAR, but a lot +of video standards, especially from the analogic-numeric transition era, use +non-square pixels. +

+

Most processing filters in FFmpeg handle the aspect ratio to avoid +stretching the image: cropping adjusts the DAR to keep the SAR constant, +scaling adjusts the SAR to keep the DAR constant. +

+

If you want to stretch, or “unstretch”, the image, you need to override the +information with the +setdar or setsar filters. +

+

Do not forget to examine carefully the original video to check whether the +stretching comes from the image or from the aspect ratio information. +

+

For example, to fix a badly encoded EGA capture, use the following commands, +either the first one to upscale to square pixels or the second one to set +the correct aspect ratio or the third one to avoid transcoding (may not work +depending on the format / codec / player / phase of the moon): +

+
+
ffmpeg -i ega_screen.nut -vf scale=640:480,setsar=1 ega_screen_scaled.nut
+ffmpeg -i ega_screen.nut -vf setdar=4/3 ega_screen_anamorphic.nut
+ffmpeg -i ega_screen.nut -aspect 4/3 -c copy ega_screen_overridden.nut
+
+ +
+
+

3.19 How do I run ffmpeg as a background task?

+ +

ffmpeg normally checks the console input, for entries like "q" to stop +and "?" to give help, while performing operations. ffmpeg does not have a way of +detecting when it is running as a background task. +When it checks the console input, that can cause the process running ffmpeg +in the background to suspend. +

+

To prevent those input checks, allowing ffmpeg to run as a background task, +use the -nostdin option +in the ffmpeg invocation. This is effective whether you run ffmpeg in a shell +or invoke ffmpeg in its own process via an operating system API. +

+

As an alternative, when you are running ffmpeg in a shell, you can redirect +standard input to /dev/null (on Linux and macOS) +or NUL (on Windows). You can do this redirect either +on the ffmpeg invocation, or from a shell script which calls ffmpeg. +

+

For example: +

+
+
ffmpeg -nostdin -i INPUT OUTPUT
+
+ +

or (on Linux, macOS, and other UNIX-like shells): +

+
+
ffmpeg -i INPUT OUTPUT </dev/null
+
+ +

or (on Windows): +

+
+
ffmpeg -i INPUT OUTPUT <NUL
+
+ +
+
+

3.20 How do I prevent ffmpeg from suspending with a message like suspended (tty output)?

+ +

If you run ffmpeg in the background, you may find that its process suspends. +There may be a message like suspended (tty output). The question is how +to prevent the process from being suspended. +

+

For example: +

+
+
% ffmpeg -i INPUT OUTPUT &> ~/tmp/log.txt &
+[1] 93352
+%
+[1]  + suspended (tty output)  ffmpeg -i INPUT OUTPUT &>
+
+ +

The message "tty output" notwithstanding, the problem here is that +ffmpeg normally checks the console input when it runs. The operating system +detects this, and suspends the process until you can bring it to the +foreground and attend to it. +

+

The solution is to use the right techniques to tell ffmpeg not to consult +console input. You can use the +-nostdin option, +or redirect standard input with < /dev/null. +See FAQ +How do I run ffmpeg as a background task? +for details. +

+
+
+
+

4 Development

+ + +
+

4.1 Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?

+ +

Yes. Check the doc/examples directory in the source +repository, also available online at: +https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples. +

+

Examples are also installed by default, usually in +$PREFIX/share/ffmpeg/examples. +

+

Also you may read the Developers Guide of the FFmpeg documentation. Alternatively, +examine the source code for one of the many open source projects that +already incorporate FFmpeg at (projects.html). +

+
+
+

4.2 Can you support my C compiler XXX?

+ +

It depends. If your compiler is C99-compliant, then patches to support +it are likely to be welcome if they do not pollute the source code +with #ifdefs related to the compiler. +

+
+
+

4.3 Is Microsoft Visual C++ supported?

+ +

Yes. Please see the Microsoft Visual C++ +section in the FFmpeg documentation. +

+
+
+

4.4 Can you add automake, libtool or autoconf support?

+ +

No. These tools are too bloated and they complicate the build. +

+
+
+

4.5 Why not rewrite FFmpeg in object-oriented C++?

+ +

FFmpeg is already organized in a highly modular manner and does not need to +be rewritten in a formal object language. Further, many of the developers +favor straight C; it works for them. For more arguments on this matter, +read "Programming Religion". +

+
+
+

4.6 Why are the ffmpeg programs devoid of debugging symbols?

+ +

The build process creates ffmpeg_g, ffplay_g, etc. which +contain full debug information. Those binaries are stripped to create +ffmpeg, ffplay, etc. If you need the debug information, use +the *_g versions. +

+
+
+

4.7 I do not like the LGPL, can I contribute code under the GPL instead?

+ +

Yes, as long as the code is optional and can easily and cleanly be placed +under #if CONFIG_GPL without breaking anything. So, for example, a new codec +or filter would be OK under GPL while a bug fix to LGPL code would not. +

+
+
+

4.8 I’m using FFmpeg from within my C application but the linker complains about missing symbols from the libraries themselves.

+ +

FFmpeg builds static libraries by default. In static libraries, dependencies +are not handled. That has two consequences. First, you must specify the +libraries in dependency order: -lavdevice must come before +-lavformat, -lavutil must come after everything else, etc. +Second, external libraries that are used in FFmpeg have to be specified too. +

+

An easy way to get the full list of required libraries in dependency order +is to use pkg-config. +

+
+
c99 -o program program.c $(pkg-config --cflags --libs libavformat libavcodec)
+
+ +

See doc/example/Makefile and doc/example/pc-uninstalled for +more details. +

+
+
+

4.9 I’m using FFmpeg from within my C++ application but the linker complains about missing symbols which seem to be available.

+ +

FFmpeg is a pure C project, so to use the libraries within your C++ application +you need to explicitly state that you are using a C library. You can do this by +encompassing your FFmpeg includes using extern "C". +

+

See http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3 +

+
+
+

4.10 I’m using libavutil from within my C++ application but the compiler complains about ’UINT64_C’ was not declared in this scope

+ +

FFmpeg is a pure C project using C99 math features, in order to enable C++ +to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS +

+
+
+

4.11 I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?

+ +

You have to create a custom AVIOContext using avio_alloc_context, +see libavformat/aviobuf.c in FFmpeg and libmpdemux/demux_lavf.c in MPlayer or MPlayer2 sources. +

+
+
+

4.12 Where is the documentation about ffv1, msmpeg4, asv1, 4xm?

+ +

see https://www.ffmpeg.org/~michael/ +

+
+
+

4.13 How do I feed H.263-RTP (and other codecs in RTP) to libavcodec?

+ +

Even if peculiar since it is network oriented, RTP is a container like any +other. You have to demux RTP before feeding the payload to libavcodec. +In this specific case please look at RFC 4629 to see how it should be done. +

+
+
+

4.14 AVStream.r_frame_rate is wrong, it is much larger than the frame rate.

+ +

r_frame_rate is NOT the average frame rate, it is the smallest frame rate +that can accurately represent all timestamps. So no, it is not +wrong if it is larger than the average! +For example, if you have mixed 25 and 30 fps content, then r_frame_rate +will be 150 (it is the least common multiple). +If you are looking for the average frame rate, see AVStream.avg_frame_rate. +

+
+
+

4.15 Why is make fate not running all tests?

+ +

Make sure you have the fate-suite samples and the SAMPLES Make variable +or FATE_SAMPLES environment variable or the --samples +configure option is set to the right path. +

+
+
+

4.16 Why is make fate not finding the samples?

+ +

Do you happen to have a ~ character in the samples path to indicate a +home directory? The value is used in ways where the shell cannot expand it, +causing FATE to not find files. Just replace ~ by the full path. +

+
+
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/fate.html b/mm_avh_working_space/bin/ffmpeg/doc/fate.html new file mode 100644 index 0000000000000000000000000000000000000000..5ab5ca2ef122c69d1e60a05e694bc45cbcadc6c7 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/fate.html @@ -0,0 +1,367 @@ + + + + + +FFmpeg Automated Testing Environment + + + + + + + + + + + + + + + + + + +
+ + + +
+

1 Introduction

+ +

FATE is an extended regression suite on the client-side and a means +for results aggregation and presentation on the server-side. +

+

The first part of this document explains how you can use FATE from +your FFmpeg source directory to test your ffmpeg binary. The second +part describes how you can run FATE to submit the results to FFmpeg’s +FATE server. +

+

In any way you can have a look at the publicly viewable FATE results +by visiting this website: +

+

http://fate.ffmpeg.org/ +

+

This is especially recommended for all people contributing source +code to FFmpeg, as it can be seen if some test on some platform broke +with their recent contribution. This usually happens on the platforms +the developers could not test on. +

+

The second part of this document describes how you can run FATE to +submit your results to FFmpeg’s FATE server. If you want to submit your +results be sure to check that your combination of CPU, OS and compiler +is not already listed on the above mentioned website. +

+

In the third part you can find a comprehensive listing of FATE makefile +targets and variables. +

+ +
+
+

2 Using FATE from your FFmpeg source directory

+ +

If you want to run FATE on your machine you need to have the samples +in place. You can get the samples via the build target fate-rsync. +Use this command from the top-level source directory: +

+
+
make fate-rsync SAMPLES=fate-suite/
+make fate       SAMPLES=fate-suite/
+
+ +

The above commands set the samples location by passing a makefile +variable via command line. It is also possible to set the samples +location at source configuration time by invoking configure with +--samples=<path to the samples directory>. Afterwards you can +invoke the makefile targets without setting the SAMPLES makefile +variable. This is illustrated by the following commands: +

+
+
./configure --samples=fate-suite/
+make fate-rsync
+make fate
+
+ +

Yet another way to tell FATE about the location of the sample +directory is by making sure the environment variable FATE_SAMPLES +contains the path to your samples directory. This can be achieved +by e.g. putting that variable in your shell profile or by setting +it in your interactive session. +

+
+
FATE_SAMPLES=fate-suite/ make fate
+
+ +
+

Do not put a ’~’ character in the samples path to indicate a home +directory. Because of shell nuances, this will cause FATE to fail. +

NOTE +

+

To get the complete list of tests, run the command: +

+
make fate-list
+
+ +

You can specify a subset of tests to run by specifying the +corresponding elements from the list with the fate- prefix, +e.g. as in: +

+
make fate-ffprobe_compact fate-ffprobe_xml
+
+ +

This makes it easier to run a few tests in case of failure without +running the complete test suite. +

+

To use a custom wrapper to run the test, pass --target-exec to +configure or set the TARGET_EXEC Make variable. +

+ +
+
+

3 Submitting the results to the FFmpeg result aggregation server

+ +

To submit your results to the server you should run fate through the +shell script tests/fate.sh from the FFmpeg sources. This script needs +to be invoked with a configuration file as its first argument. +

+
+
tests/fate.sh /path/to/fate_config
+
+ +

A configuration file template with comments describing the individual +configuration variables can be found at doc/fate_config.sh.template. +

+

The mentioned configuration template is also available here: +

slot=                                    # some unique identifier
+repo=git://source.ffmpeg.org/ffmpeg.git  # the source repository
+#branch=release/2.6                       # the branch to test
+samples=                                 # path to samples directory
+workdir=                                 # directory in which to do all the work
+#fate_recv="ssh -T fate@fate.ffmpeg.org" # command to submit report
+comment=                                 # optional description
+build_only=     # set to "yes" for a compile-only instance that skips tests
+ignore_tests=
+
+# the following are optional and map to configure options
+arch=
+cpu=
+cross_prefix=
+as=
+cc=
+ld=
+target_os=
+sysroot=
+target_exec=
+target_path=
+target_samples=
+extra_cflags=
+extra_ldflags=
+extra_libs=
+extra_conf=     # extra configure options not covered above
+
+#make=          # name of GNU make if not 'make'
+makeopts=       # extra options passed to 'make'
+#makeopts_fate= # extra options passed to 'make' when running tests,
+                # defaulting to makeopts above if this is not set
+#tar=           # command to create a tar archive from its arguments on stdout,
+                # defaults to 'tar c'
+
+

Create a configuration that suits your needs, based on the configuration +template. The slot configuration variable can be any string that is not +yet used, but it is suggested that you name it adhering to the following +pattern ‘arch-os-compiler-compiler version’. The +configuration file itself will be sourced in a shell script, therefore all +shell features may be used. This enables you to setup the environment as you +need it for your build. +

+

For your first test runs the fate_recv variable should be empty or +commented out. This will run everything as normal except that it will omit +the submission of the results to the server. The following files should be +present in $workdir as specified in the configuration file: +

+
    +
  • configure.log +
  • compile.log +
  • test.log +
  • report +
  • version +
+ +

When you have everything working properly you can create an SSH key pair +and send the public key to the FATE server administrator who can be contacted +at the email address . +

+

Configure your SSH client to use public key authentication with that key +when connecting to the FATE server. Also do not forget to check the identity +of the server and to accept its host key. This can usually be achieved by +running your SSH client manually and killing it after you accepted the key. +The FATE server’s fingerprint is: +

+
+
RSA
+

d3:f1:83:97:a4:75:2b:a6:fb:d6:e8:aa:81:93:97:51 +

+
ECDSA
+

76:9f:68:32:04:1e:d5:d4:ec:47:3f:dc:fc:18:17:86 +

+
+ +

If you have problems connecting to the FATE server, it may help to try out +the ssh command with one or more -v options. You should +get detailed output concerning your SSH configuration and the authentication +process. +

+

The only thing left is to automate the execution of the fate.sh script and +the synchronisation of the samples directory. +

+
+
+

4 Uploading new samples to the fate suite

+ +

If you need a sample uploaded send a mail to samples-request. +

+

This is for developers who have an account on the fate suite server. +If you upload new samples, please make sure they are as small as possible, +space on each client, network bandwidth and so on benefit from smaller test cases. +Also keep in mind older checkouts use existing sample files, that means in +practice generally do not replace, remove or overwrite files as it likely would +break older checkouts or releases. +Also all needed samples for a commit should be uploaded, ideally 24 +hours, before the push. +If you need an account for frequently uploading samples or you wish to help +others by doing that send a mail to ffmpeg-devel. +

+
+
#First update your local samples copy:
+rsync -vauL --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X fate-suite.ffmpeg.org:/home/samples/fate-suite/ ~/fate-suite
+
+#Then do a dry run checking what would be uploaded:
+rsync -vanL --no-g --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X ~/fate-suite/ fate-suite.ffmpeg.org:/home/samples/fate-suite
+
+#Upload the files:
+rsync -vaL  --no-g --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X ~/fate-suite/ fate-suite.ffmpeg.org:/home/samples/fate-suite
+
+ + +
+
+

5 FATE makefile targets and variables

+ + +
+

5.1 Makefile targets

+ +
+
fate-rsync
+

Download/synchronize sample files to the configured samples directory. +

+
+
fate-list
+

Will list all fate/regression test targets. +

+
+
fate
+

Run the FATE test suite (requires the fate-suite dataset). +

+
+ +
+
+

5.2 Makefile variables

+ +
+
V
+

Verbosity level, can be set to 0, 1 or 2. +

    +
  • 0: show just the test arguments +
  • 1: show just the command used in the test +
  • 2: show everything +
+ +
+
SAMPLES
+

Specify or override the path to the FATE samples at make time, it has a +meaning only while running the regression tests. +

+
+
THREADS
+

Specify how many threads to use while running regression tests, it is +quite useful to detect thread-related regressions. +

+
+
THREAD_TYPE
+

Specify which threading strategy test, either ‘slice’ or ‘frame’, +by default ‘slice+frame’ +

+
+
CPUFLAGS
+

Specify CPU flags. +

+
+
TARGET_EXEC
+

Specify or override the wrapper used to run the tests. +The TARGET_EXEC option provides a way to run FATE wrapped in +valgrind, qemu-user or wine or on remote targets +through ssh. +

+
+
GEN
+

Set to ‘1’ to generate the missing or mismatched references. +

+
+
HWACCEL
+

Specify which hardware acceleration to use while running regression tests, +by default ‘none’ is used. +

+
+
KEEP
+

Set to ‘1’ to keep temp files generated by fate test(s) when test is successful. +Default is ‘0’, which removes these files. Files are always kept when a test +fails. +

+
+
+ +
+
+

5.3 Examples

+ +
+
make V=1 SAMPLES=/var/fate/samples THREADS=2 CPUFLAGS=mmx fate
+
+
+
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-all.html b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-all.html new file mode 100644 index 0000000000000000000000000000000000000000..75a95e086d2122a917c3a6831b707a5000d6cc10 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-all.html @@ -0,0 +1,65738 @@ + + + + + +ffmpeg Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ +
+ + +
+
+
+

1 Synopsis

+ +

ffmpeg [global_options] {[input_file_options] -i input_url} ... {[output_file_options] output_url} ... +

+
+
+

2 Description

+ +

ffmpeg is a universal media converter. It can read a wide variety of +inputs - including live grabbing/recording devices - filter, and transcode them +into a plethora of output formats. +

+

ffmpeg reads from an arbitrary number of input "files" (which can be regular +files, pipes, network streams, grabbing devices, etc.), specified by the +-i option, and writes to an arbitrary number of output "files", which are +specified by a plain output url. Anything found on the command line which +cannot be interpreted as an option is considered to be an output url. +

+

Each input or output url can, in principle, contain any number of streams of +different types (video/audio/subtitle/attachment/data). The allowed number and/or +types of streams may be limited by the container format. Selecting which +streams from which inputs will go into which output is either done automatically +or with the -map option (see the Stream selection chapter). +

+

To refer to input files in options, you must use their indices (0-based). E.g. +the first input file is 0, the second is 1, etc. Similarly, streams +within a file are referred to by their indices. E.g. 2:3 refers to the +fourth stream in the third input file. Also see the Stream specifiers chapter. +

+

As a general rule, options are applied to the next specified +file. Therefore, order is important, and you can have the same +option on the command line multiple times. Each occurrence is +then applied to the next input or output file. +Exceptions from this rule are the global options (e.g. verbosity level), +which should be specified first. +

+

Do not mix input and output files – first specify all input files, then all +output files. Also do not mix options which belong to different files. All +options apply ONLY to the next input or output file and are reset between files. +

+

Some simple examples follow. +

+
    +
  • Convert an input media file to a different format, by re-encoding media streams: +
    +
    ffmpeg -i input.avi output.mp4
    +
    + +
  • Set the video bitrate of the output file to 64 kbit/s: +
    +
    ffmpeg -i input.avi -b:v 64k -bufsize 64k output.mp4
    +
    + +
  • Force the frame rate of the output file to 24 fps: +
    +
    ffmpeg -i input.avi -r 24 output.mp4
    +
    + +
  • Force the frame rate of the input file (valid for raw formats only) to 1 fps and +the frame rate of the output file to 24 fps: +
    +
    ffmpeg -r 1 -i input.m2v -r 24 output.mp4
    +
    +
+ +

The format option may be needed for raw input files. +

+ +
+
+

3 Detailed description

+ +

The transcoding process in ffmpeg for each output can be described by +the following diagram: +

+
 _______              ______________
+|       |            |              |
+| input |  demuxer   | encoded data |   decoder
+| file  | ---------> | packets      | -----+
+|_______|            |______________|      |
+                                           v
+                                       _________
+                                      |         |
+                                      | decoded |
+                                      | frames  |
+                                      |_________|
+ ________             ______________       |
+|        |           |              |      |
+| output | <-------- | encoded data | <----+
+| file   |   muxer   | packets      |   encoder
+|________|           |______________|
+
+
+
+

ffmpeg calls the libavformat library (containing demuxers) to read +input files and get packets containing encoded data from them. When there are +multiple input files, ffmpeg tries to keep them synchronized by +tracking lowest timestamp on any active input stream. +

+

Encoded packets are then passed to the decoder (unless streamcopy is selected +for the stream, see further for a description). The decoder produces +uncompressed frames (raw video/PCM audio/...) which can be processed further by +filtering (see next section). After filtering, the frames are passed to the +encoder, which encodes them and outputs encoded packets. Finally those are +passed to the muxer, which writes the encoded packets to the output file. +

+ +
+

3.1 Filtering

+

Before encoding, ffmpeg can process raw audio and video frames using +filters from the libavfilter library. Several chained filters form a filter +graph. ffmpeg distinguishes between two types of filtergraphs: +simple and complex. +

+ +
+

3.1.1 Simple filtergraphs

+

Simple filtergraphs are those that have exactly one input and output, both of +the same type. In the above diagram they can be represented by simply inserting +an additional step between decoding and encoding: +

+
 _________                        ______________
+|         |                      |              |
+| decoded |                      | encoded data |
+| frames  |\                   _ | packets      |
+|_________| \                  /||______________|
+             \   __________   /
+  simple     _\||          | /  encoder
+  filtergraph   | filtered |/
+                | frames   |
+                |__________|
+
+
+

Simple filtergraphs are configured with the per-stream -filter option +(with -vf and -af aliases for video and audio respectively). +A simple filtergraph for video can look for example like this: +

+
 _______        _____________        _______        ________
+|       |      |             |      |       |      |        |
+| input | ---> | deinterlace | ---> | scale | ---> | output |
+|_______|      |_____________|      |_______|      |________|
+
+
+

Note that some filters change frame properties but not frame contents. E.g. the +fps filter in the example above changes number of frames, but does not +touch the frame contents. Another example is the setpts filter, which +only sets timestamps and otherwise passes the frames unchanged. +

+
+
+

3.1.2 Complex filtergraphs

+

Complex filtergraphs are those which cannot be described as simply a linear +processing chain applied to one stream. This is the case, for example, when the graph has +more than one input and/or output, or when output stream type is different from +input. They can be represented with the following diagram: +

+
 _________
+|         |
+| input 0 |\                    __________
+|_________| \                  |          |
+             \   _________    /| output 0 |
+              \ |         |  / |__________|
+ _________     \| complex | /
+|         |     |         |/
+| input 1 |---->| filter  |\
+|_________|     |         | \   __________
+               /| graph   |  \ |          |
+              / |         |   \| output 1 |
+ _________   /  |_________|    |__________|
+|         | /
+| input 2 |/
+|_________|
+
+
+

Complex filtergraphs are configured with the -filter_complex option. +Note that this option is global, since a complex filtergraph, by its nature, +cannot be unambiguously associated with a single stream or file. +

+

The -lavfi option is equivalent to -filter_complex. +

+

A trivial example of a complex filtergraph is the overlay filter, which +has two video inputs and one video output, containing one video overlaid on top +of the other. Its audio counterpart is the amix filter. +

+
+
+
+

3.2 Stream copy

+

Stream copy is a mode selected by supplying the copy parameter to the +-codec option. It makes ffmpeg omit the decoding and encoding +step for the specified stream, so it does only demuxing and muxing. It is useful +for changing the container format or modifying container-level metadata. The +diagram above will, in this case, simplify to this: +

+
 _______              ______________            ________
+|       |            |              |          |        |
+| input |  demuxer   | encoded data |  muxer   | output |
+| file  | ---------> | packets      | -------> | file   |
+|_______|            |______________|          |________|
+
+
+

Since there is no decoding or encoding, it is very fast and there is no quality +loss. However, it might not work in some cases because of many factors. Applying +filters is obviously also impossible, since filters work on uncompressed data. +

+ +
+
+
+

4 Stream selection

+ +

ffmpeg provides the -map option for manual control of stream selection in each +output file. Users can skip -map and let ffmpeg perform automatic stream selection as +described below. The -vn / -an / -sn / -dn options can be used to skip inclusion of +video, audio, subtitle and data streams respectively, whether manually mapped or automatically +selected, except for those streams which are outputs of complex filtergraphs. +

+ +
+

4.1 Description

+

The sub-sections that follow describe the various rules that are involved in stream selection. +The examples that follow next show how these rules are applied in practice. +

+

While every effort is made to accurately reflect the behavior of the program, FFmpeg is under +continuous development and the code may have changed since the time of this writing. +

+ +
+

4.1.1 Automatic stream selection

+ +

In the absence of any map options for a particular output file, ffmpeg inspects the output +format to check which type of streams can be included in it, viz. video, audio and/or +subtitles. For each acceptable stream type, ffmpeg will pick one stream, when available, +from among all the inputs. +

+

It will select that stream based upon the following criteria: +

    +
  • for video, it is the stream with the highest resolution, +
  • for audio, it is the stream with the most channels, +
  • for subtitles, it is the first subtitle stream found but there’s a caveat. +The output format’s default subtitle encoder can be either text-based or image-based, +and only a subtitle stream of the same type will be chosen. +
+ +

In the case where several streams of the same type rate equally, the stream with the lowest +index is chosen. +

+

Data or attachment streams are not automatically selected and can only be included +using -map. +

+
+

4.1.2 Manual stream selection

+ +

When -map is used, only user-mapped streams are included in that output file, +with one possible exception for filtergraph outputs described below. +

+
+
+

4.1.3 Complex filtergraphs

+ +

If there are any complex filtergraph output streams with unlabeled pads, they will be added +to the first output file. This will lead to a fatal error if the stream type is not supported +by the output format. In the absence of the map option, the inclusion of these streams leads +to the automatic stream selection of their types being skipped. If map options are present, +these filtergraph streams are included in addition to the mapped streams. +

+

Complex filtergraph output streams with labeled pads must be mapped once and exactly once. +

+
+
+

4.1.4 Stream handling

+ +

Stream handling is independent of stream selection, with an exception for subtitles described +below. Stream handling is set via the -codec option addressed to streams within a +specific output file. In particular, codec options are applied by ffmpeg after the +stream selection process and thus do not influence the latter. If no -codec option is +specified for a stream type, ffmpeg will select the default encoder registered by the output +file muxer. +

+

An exception exists for subtitles. If a subtitle encoder is specified for an output file, the +first subtitle stream found of any type, text or image, will be included. ffmpeg does not validate +if the specified encoder can convert the selected stream or if the converted stream is acceptable +within the output format. This applies generally as well: when the user sets an encoder manually, +the stream selection process cannot check if the encoded stream can be muxed into the output file. +If it cannot, ffmpeg will abort and all output files will fail to be processed. +

+
+
+
+

4.2 Examples

+ +

The following examples illustrate the behavior, quirks and limitations of ffmpeg’s stream +selection methods. +

+

They assume the following three input files. +

+
+input file 'A.avi'
+      stream 0: video 640x360
+      stream 1: audio 2 channels
+
+input file 'B.mp4'
+      stream 0: video 1920x1080
+      stream 1: audio 2 channels
+      stream 2: subtitles (text)
+      stream 3: audio 5.1 channels
+      stream 4: subtitles (text)
+
+input file 'C.mkv'
+      stream 0: video 1280x720
+      stream 1: audio 2 channels
+      stream 2: subtitles (image)
+
+

Example: automatic stream selection

+
+
ffmpeg -i A.avi -i B.mp4 out1.mkv out2.wav -map 1:a -c:a copy out3.mov
+
+

There are three output files specified, and for the first two, no -map options +are set, so ffmpeg will select streams for these two files automatically. +

+

out1.mkv is a Matroska container file and accepts video, audio and subtitle streams, +so ffmpeg will try to select one of each type.
+For video, it will select stream 0 from B.mp4, which has the highest +resolution among all the input video streams.
+For audio, it will select stream 3 from B.mp4, since it has the greatest +number of channels.
+For subtitles, it will select stream 2 from B.mp4, which is the first subtitle +stream from among A.avi and B.mp4. +

+

out2.wav accepts only audio streams, so only stream 3 from B.mp4 is +selected. +

+

For out3.mov, since a -map option is set, no automatic stream selection will +occur. The -map 1:a option will select all audio streams from the second input +B.mp4. No other streams will be included in this output file. +

+

For the first two outputs, all included streams will be transcoded. The encoders chosen will +be the default ones registered by each output format, which may not match the codec of the +selected input streams. +

+

For the third output, codec option for audio streams has been set +to copy, so no decoding-filtering-encoding operations will occur, or can occur. +Packets of selected streams shall be conveyed from the input file and muxed within the output +file. +

+

Example: automatic subtitles selection

+
+
ffmpeg -i C.mkv out1.mkv -c:s dvdsub -an out2.mkv
+
+

Although out1.mkv is a Matroska container file which accepts subtitle streams, only a +video and audio stream shall be selected. The subtitle stream of C.mkv is image-based +and the default subtitle encoder of the Matroska muxer is text-based, so a transcode operation +for the subtitles is expected to fail and hence the stream isn’t selected. However, in +out2.mkv, a subtitle encoder is specified in the command and so, the subtitle stream is +selected, in addition to the video stream. The presence of -an disables audio stream +selection for out2.mkv. +

+

Example: unlabeled filtergraph outputs

+
+
ffmpeg -i A.avi -i C.mkv -i B.mp4 -filter_complex "overlay" out1.mp4 out2.srt
+
+

A filtergraph is setup here using the -filter_complex option and consists of a single +video filter. The overlay filter requires exactly two video inputs, but none are +specified, so the first two available video streams are used, those of A.avi and +C.mkv. The output pad of the filter has no label and so is sent to the first output file +out1.mp4. Due to this, automatic selection of the video stream is skipped, which would +have selected the stream in B.mp4. The audio stream with most channels viz. stream 3 +in B.mp4, is chosen automatically. No subtitle stream is chosen however, since the MP4 +format has no default subtitle encoder registered, and the user hasn’t specified a subtitle encoder. +

+

The 2nd output file, out2.srt, only accepts text-based subtitle streams. So, even though +the first subtitle stream available belongs to C.mkv, it is image-based and hence skipped. +The selected stream, stream 2 in B.mp4, is the first text-based subtitle stream. +

+

Example: labeled filtergraph outputs

+
+
ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex "[1:v]hue=s=0[outv];overlay;aresample" \
+       -map '[outv]' -an        out1.mp4 \
+                                out2.mkv \
+       -map '[outv]' -map 1:a:0 out3.mkv
+
+ +

The above command will fail, as the output pad labelled [outv] has been mapped twice. +None of the output files shall be processed. +

+
+
ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex "[1:v]hue=s=0[outv];overlay;aresample" \
+       -an        out1.mp4 \
+                  out2.mkv \
+       -map 1:a:0 out3.mkv
+
+ +

This command above will also fail as the hue filter output has a label, [outv], +and hasn’t been mapped anywhere. +

+

The command should be modified as follows, +

+
ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex "[1:v]hue=s=0,split=2[outv1][outv2];overlay;aresample" \
+        -map '[outv1]' -an        out1.mp4 \
+                                  out2.mkv \
+        -map '[outv2]' -map 1:a:0 out3.mkv
+
+

The video stream from B.mp4 is sent to the hue filter, whose output is cloned once using +the split filter, and both outputs labelled. Then a copy each is mapped to the first and third +output files. +

+

The overlay filter, requiring two video inputs, uses the first two unused video streams. Those +are the streams from A.avi and C.mkv. The overlay output isn’t labelled, so it is +sent to the first output file out1.mp4, regardless of the presence of the -map option. +

+

The aresample filter is sent the first unused audio stream, that of A.avi. Since this filter +output is also unlabelled, it too is mapped to the first output file. The presence of -an +only suppresses automatic or manual stream selection of audio streams, not outputs sent from +filtergraphs. Both these mapped streams shall be ordered before the mapped stream in out1.mp4. +

+

The video, audio and subtitle streams mapped to out2.mkv are entirely determined by +automatic stream selection. +

+

out3.mkv consists of the cloned video output from the hue filter and the first audio +stream from B.mp4. +
+

+ +
+
+
+

5 Options

+ +

All the numerical options, if not specified otherwise, accept a string +representing a number as input, which may be followed by one of the SI +unit prefixes, for example: ’K’, ’M’, or ’G’. +

+

If ’i’ is appended to the SI unit prefix, the complete prefix will be +interpreted as a unit prefix for binary multiples, which are based on +powers of 1024 instead of powers of 1000. Appending ’B’ to the SI unit +prefix multiplies the value by 8. This allows using, for example: +’KB’, ’MiB’, ’G’ and ’B’ as number suffixes. +

+

Options which do not take arguments are boolean options, and set the +corresponding value to true. They can be set to false by prefixing +the option name with "no". For example using "-nofoo" +will set the boolean option with name "foo" to false. +

+ +
+

5.1 Stream specifiers

+

Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers +are used to precisely specify which stream(s) a given option belongs to. +

+

A stream specifier is a string generally appended to the option name and +separated from it by a colon. E.g. -codec:a:1 ac3 contains the +a:1 stream specifier, which matches the second audio stream. Therefore, it +would select the ac3 codec for the second audio stream. +

+

A stream specifier can match several streams, so that the option is applied to all +of them. E.g. the stream specifier in -b:a 128k matches all audio +streams. +

+

An empty stream specifier matches all streams. For example, -codec copy +or -codec: copy would copy all the streams without reencoding. +

+

Possible forms of stream specifiers are: +

+
stream_index
+

Matches the stream with this index. E.g. -threads:1 4 would set the +thread count for the second stream to 4. If stream_index is used as an +additional stream specifier (see below), then it selects stream number +stream_index from the matching streams. Stream numbering is based on the +order of the streams as detected by libavformat except when a program ID is +also specified. In this case it is based on the ordering of the streams in the +program. +

+
stream_type[:additional_stream_specifier]
+

stream_type is one of following: ’v’ or ’V’ for video, ’a’ for audio, ’s’ +for subtitle, ’d’ for data, and ’t’ for attachments. ’v’ matches all video +streams, ’V’ only matches video streams which are not attached pictures, video +thumbnails or cover arts. If additional_stream_specifier is used, then +it matches streams which both have this type and match the +additional_stream_specifier. Otherwise, it matches all streams of the +specified type. +

+
p:program_id[:additional_stream_specifier]
+

Matches streams which are in the program with the id program_id. If +additional_stream_specifier is used, then it matches streams which both +are part of the program and match the additional_stream_specifier. +

+
+
#stream_id or i:stream_id
+

Match the stream by stream id (e.g. PID in MPEG-TS container). +

+
m:key[:value]
+

Matches streams with the metadata tag key having the specified value. If +value is not given, matches streams that contain the given tag with any +value. +

+
u
+

Matches streams with usable configuration, the codec must be defined and the +essential information such as video dimension or audio sample rate must be present. +

+

Note that in ffmpeg, matching by metadata will only work properly for +input files. +

+
+ +
+
+

5.2 Generic options

+ +

These options are shared amongst the ff* tools. +

+
+
-L
+

Show license. +

+
+
-h, -?, -help, --help [arg]
+

Show help. An optional parameter may be specified to print help about a specific +item. If no argument is specified, only basic (non advanced) tool +options are shown. +

+

Possible values of arg are: +

+
long
+

Print advanced tool options in addition to the basic tool options. +

+
+
full
+

Print complete list of options, including shared and private options +for encoders, decoders, demuxers, muxers, filters, etc. +

+
+
decoder=decoder_name
+

Print detailed information about the decoder named decoder_name. Use the +-decoders option to get a list of all decoders. +

+
+
encoder=encoder_name
+

Print detailed information about the encoder named encoder_name. Use the +-encoders option to get a list of all encoders. +

+
+
demuxer=demuxer_name
+

Print detailed information about the demuxer named demuxer_name. Use the +-formats option to get a list of all demuxers and muxers. +

+
+
muxer=muxer_name
+

Print detailed information about the muxer named muxer_name. Use the +-formats option to get a list of all muxers and demuxers. +

+
+
filter=filter_name
+

Print detailed information about the filter named filter_name. Use the +-filters option to get a list of all filters. +

+
+
bsf=bitstream_filter_name
+

Print detailed information about the bitstream filter named bitstream_filter_name. +Use the -bsfs option to get a list of all bitstream filters. +

+
+
protocol=protocol_name
+

Print detailed information about the protocol named protocol_name. +Use the -protocols option to get a list of all protocols. +

+
+ +
+
-version
+

Show version. +

+
+
-buildconf
+

Show the build configuration, one option per line. +

+
+
-formats
+

Show available formats (including devices). +

+
+
-demuxers
+

Show available demuxers. +

+
+
-muxers
+

Show available muxers. +

+
+
-devices
+

Show available devices. +

+
+
-codecs
+

Show all codecs known to libavcodec. +

+

Note that the term ’codec’ is used throughout this documentation as a shortcut +for what is more correctly called a media bitstream format. +

+
+
-decoders
+

Show available decoders. +

+
+
-encoders
+

Show all available encoders. +

+
+
-bsfs
+

Show available bitstream filters. +

+
+
-protocols
+

Show available protocols. +

+
+
-filters
+

Show available libavfilter filters. +

+
+
-pix_fmts
+

Show available pixel formats. +

+
+
-sample_fmts
+

Show available sample formats. +

+
+
-layouts
+

Show channel names and standard channel layouts. +

+
+
-dispositions
+

Show stream dispositions. +

+
+
-colors
+

Show recognized color names. +

+
+
-sources device[,opt1=val1[,opt2=val2]...]
+

Show autodetected sources of the input device. +Some devices may provide system-dependent source names that cannot be autodetected. +The returned list cannot be assumed to be always complete. +

+
ffmpeg -sources pulse,server=192.168.0.4
+
+ +
+
-sinks device[,opt1=val1[,opt2=val2]...]
+

Show autodetected sinks of the output device. +Some devices may provide system-dependent sink names that cannot be autodetected. +The returned list cannot be assumed to be always complete. +

+
ffmpeg -sinks pulse,server=192.168.0.4
+
+ +
+
-loglevel [flags+]loglevel | -v [flags+]loglevel
+

Set logging level and flags used by the library. +

+

The optional flags prefix can consist of the following values: +

+
repeat
+

Indicates that repeated log output should not be compressed to the first line +and the "Last message repeated n times" line will be omitted. +

+
level
+

Indicates that log output should add a [level] prefix to each message +line. This can be used as an alternative to log coloring, e.g. when dumping the +log to file. +

+
+

Flags can also be used alone by adding a ’+’/’-’ prefix to set/reset a single +flag without affecting other flags or changing loglevel. When +setting both flags and loglevel, a ’+’ separator is expected +between the last flags value and before loglevel. +

+

loglevel is a string or a number containing one of the following values: +

+
quiet, -8
+

Show nothing at all; be silent. +

+
panic, 0
+

Only show fatal errors which could lead the process to crash, such as +an assertion failure. This is not currently used for anything. +

+
fatal, 8
+

Only show fatal errors. These are errors after which the process absolutely +cannot continue. +

+
error, 16
+

Show all errors, including ones which can be recovered from. +

+
warning, 24
+

Show all warnings and errors. Any message related to possibly +incorrect or unexpected events will be shown. +

+
info, 32
+

Show informative messages during processing. This is in addition to +warnings and errors. This is the default value. +

+
verbose, 40
+

Same as info, except more verbose. +

+
debug, 48
+

Show everything, including debugging information. +

+
trace, 56
+
+ +

For example to enable repeated log output, add the level prefix, and set +loglevel to verbose: +

+
ffmpeg -loglevel repeat+level+verbose -i input output
+
+

Another example that enables repeated log output without affecting current +state of level prefix flag or loglevel: +

+
ffmpeg [...] -loglevel +repeat
+
+ +

By default the program logs to stderr. If coloring is supported by the +terminal, colors are used to mark errors and warnings. Log coloring +can be disabled setting the environment variable +AV_LOG_FORCE_NOCOLOR, or can be forced setting +the environment variable AV_LOG_FORCE_COLOR. +

+
+
-report
+

Dump full command line and log output to a file named +program-YYYYMMDD-HHMMSS.log in the current +directory. +This file can be useful for bug reports. +It also implies -loglevel debug. +

+

Setting the environment variable FFREPORT to any value has the +same effect. If the value is a ’:’-separated key=value sequence, these +options will affect the report; option values must be escaped if they +contain special characters or the options delimiter ’:’ (see the +“Quoting and escaping” section in the ffmpeg-utils manual). +

+

The following options are recognized: +

+
file
+

set the file name to use for the report; %p is expanded to the name +of the program, %t is expanded to a timestamp, %% is expanded +to a plain % +

+
level
+

set the log verbosity level using a numerical value (see -loglevel). +

+
+ +

For example, to output a report to a file named ffreport.log +using a log level of 32 (alias for log level info): +

+
+
FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
+
+ +

Errors in parsing the environment variable are not fatal, and will not +appear in the report. +

+
+
-hide_banner
+

Suppress printing banner. +

+

All FFmpeg tools will normally show a copyright notice, build options +and library versions. This option can be used to suppress printing +this information. +

+
+
-cpuflags flags (global)
+

Allows setting and clearing cpu flags. This option is intended +for testing. Do not use it unless you know what you’re doing. +

+
ffmpeg -cpuflags -sse+mmx ...
+ffmpeg -cpuflags mmx ...
+ffmpeg -cpuflags 0 ...
+
+

Possible flags for this option are: +

+
x86
+
+
mmx
+
mmxext
+
sse
+
sse2
+
sse2slow
+
sse3
+
sse3slow
+
ssse3
+
atom
+
sse4.1
+
sse4.2
+
avx
+
avx2
+
xop
+
fma3
+
fma4
+
3dnow
+
3dnowext
+
bmi1
+
bmi2
+
cmov
+
+
+
ARM
+
+
armv5te
+
armv6
+
armv6t2
+
vfp
+
vfpv3
+
neon
+
setend
+
+
+
AArch64
+
+
armv8
+
vfp
+
neon
+
+
+
PowerPC
+
+
altivec
+
+
+
Specific Processors
+
+
pentium2
+
pentium3
+
pentium4
+
k6
+
k62
+
athlon
+
athlonxp
+
k8
+
+
+
+ +
+
-cpucount count (global)
+

Override detection of CPU count. This option is intended +for testing. Do not use it unless you know what you’re doing. +

+
ffmpeg -cpucount 2
+
+ +
+
-max_alloc bytes
+

Set the maximum size limit for allocating a block on the heap by ffmpeg’s +family of malloc functions. Exercise extreme caution when using +this option. Don’t use if you do not understand the full consequence of doing so. +Default is INT_MAX. +

+
+ +
+
+

5.3 AVOptions

+ +

These options are provided directly by the libavformat, libavdevice and +libavcodec libraries. To see the list of available AVOptions, use the +-help option. They are separated into two categories: +

+
generic
+

These options can be set for any container, codec or device. Generic options +are listed under AVFormatContext options for containers/devices and under +AVCodecContext options for codecs. +

+
private
+

These options are specific to the given container, device or codec. Private +options are listed under their corresponding containers/devices/codecs. +

+
+ +

For example to write an ID3v2.3 header instead of a default ID3v2.4 to +an MP3 file, use the id3v2_version private option of the MP3 +muxer: +

+
ffmpeg -i input.flac -id3v2_version 3 out.mp3
+
+ +

All codec AVOptions are per-stream, and thus a stream specifier +should be attached to them: +

+
ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4
+
+ +

In the above example, a multichannel audio stream is mapped twice for output. +The first instance is encoded with codec ac3 and bitrate 640k. +The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using +absolute index of the output stream. +

+

Note: the -nooption syntax cannot be used for boolean +AVOptions, use -option 0/-option 1. +

+

Note: the old undocumented way of specifying per-stream AVOptions by +prepending v/a/s to the options name is now obsolete and will be +removed soon. +

+
+
+

5.4 Main options

+ +
+
-f fmt (input/output)
+

Force input or output file format. The format is normally auto detected for input +files and guessed from the file extension for output files, so this option is not +needed in most cases. +

+
+
-i url (input)
+

input file url +

+
+
-y (global)
+

Overwrite output files without asking. +

+
+
-n (global)
+

Do not overwrite output files, and exit immediately if a specified +output file already exists. +

+
+
-stream_loop number (input)
+

Set number of times input stream shall be looped. Loop 0 means no loop, +loop -1 means infinite loop. +

+
+
-recast_media (global)
+

Allow forcing a decoder of a different media type than the one +detected or designated by the demuxer. Useful for decoding media +data muxed as data streams. +

+
+
-c[:stream_specifier] codec (input/output,per-stream)
+
-codec[:stream_specifier] codec (input/output,per-stream)
+

Select an encoder (when used before an output file) or a decoder (when used +before an input file) for one or more streams. codec is the name of a +decoder/encoder or a special value copy (output only) to indicate that +the stream is not to be re-encoded. +

+

For example +

+
ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
+
+

encodes all video streams with libx264 and copies all audio streams. +

+

For each stream, the last matching c option is applied, so +

+
ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
+
+

will copy all the streams except the second video, which will be encoded with +libx264, and the 138th audio, which will be encoded with libvorbis. +

+
+
-t duration (input/output)
+

When used as an input option (before -i), limit the duration of +data read from the input file. +

+

When used as an output option (before an output url), stop writing the +output after its duration reaches duration. +

+

duration must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

-to and -t are mutually exclusive and -t has priority. +

+
+
-to position (input/output)
+

Stop writing the output or reading the input at position. +position must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

-to and -t are mutually exclusive and -t has priority. +

+
+
-fs limit_size (output)
+

Set the file size limit, expressed in bytes. No further chunk of bytes is written +after the limit is exceeded. The size of the output file is slightly more than the +requested file size. +

+
+
-ss position (input/output)
+

When used as an input option (before -i), seeks in this input file to +position. Note that in most formats it is not possible to seek exactly, +so ffmpeg will seek to the closest seek point before position. +When transcoding and -accurate_seek is enabled (the default), this +extra segment between the seek point and position will be decoded and +discarded. When doing stream copy or when -noaccurate_seek is used, it +will be preserved. +

+

When used as an output option (before an output url), decodes but discards +input until the timestamps reach position. +

+

position must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+
+
-sseof position (input)
+
+

Like the -ss option but relative to the "end of file". That is negative +values are earlier in the file, 0 is at EOF. +

+
+
-isync input_index (input)
+

Assign an input as a sync source. +

+

This will take the difference between the start times of the target and reference inputs and +offset the timestamps of the target file by that difference. The source timestamps of the two +inputs should derive from the same clock source for expected results. If copyts is set +then start_at_zero must also be set. If either of the inputs has no starting timestamp +then no sync adjustment is made. +

+

Acceptable values are those that refer to a valid ffmpeg input index. If the sync reference is +the target index itself or -1, then no adjustment is made to target timestamps. A sync +reference may not itself be synced to any other input. +

+

Default value is -1. +

+
+
-itsoffset offset (input)
+

Set the input time offset. +

+

offset must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

The offset is added to the timestamps of the input files. Specifying +a positive offset means that the corresponding streams are delayed by +the time duration specified in offset. +

+
+
-itsscale scale (input,per-stream)
+

Rescale input timestamps. scale should be a floating point number. +

+
+
-timestamp date (output)
+

Set the recording timestamp in the container. +

+

date must be a date specification, +see (ffmpeg-utils)the Date section in the ffmpeg-utils(1) manual. +

+
+
-metadata[:metadata_specifier] key=value (output,per-metadata)
+

Set a metadata key/value pair. +

+

An optional metadata_specifier may be given to set metadata +on streams, chapters or programs. See -map_metadata +documentation for details. +

+

This option overrides metadata set with -map_metadata. It is +also possible to delete metadata by using an empty value. +

+

For example, for setting the title in the output file: +

+
ffmpeg -i in.avi -metadata title="my title" out.flv
+
+ +

To set the language of the first audio stream: +

+
ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
+
+ +
+
-disposition[:stream_specifier] value (output,per-stream)
+

Sets the disposition for a stream. +

+

By default, the disposition is copied from the input stream, unless the output +stream this option applies to is fed by a complex filtergraph - in that case the +disposition is unset by default. +

+

value is a sequence of items separated by ’+’ or ’-’. The first item may +also be prefixed with ’+’ or ’-’, in which case this option modifies the default +value. Otherwise (the first item is not prefixed) this options overrides the +default value. A ’+’ prefix adds the given disposition, ’-’ removes it. It is +also possible to clear the disposition by setting it to 0. +

+

If no -disposition options were specified for an output file, ffmpeg will +automatically set the ’default’ disposition on the first stream of each type, +when there are multiple streams of this type in the output file and no stream of +that type is already marked as default. +

+

The -dispositions option lists the known dispositions. +

+

For example, to make the second audio stream the default stream: +

+
ffmpeg -i in.mkv -c copy -disposition:a:1 default out.mkv
+
+ +

To make the second subtitle stream the default stream and remove the default +disposition from the first subtitle stream: +

+
ffmpeg -i in.mkv -c copy -disposition:s:0 0 -disposition:s:1 default out.mkv
+
+ +

To add an embedded cover/thumbnail: +

+
ffmpeg -i in.mp4 -i IMAGE -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic out.mp4
+
+ +

Not all muxers support embedded thumbnails, and those who do, only support a few formats, like JPEG or PNG. +

+
+
-program [title=title:][program_num=program_num:]st=stream[:st=stream...] (output)
+
+

Creates a program with the specified title, program_num and adds the specified +stream(s) to it. +

+
+
-target type (output)
+

Specify target file type (vcd, svcd, dvd, dv, +dv50). type may be prefixed with pal-, ntsc- or +film- to use the corresponding standard. All the format options +(bitrate, codecs, buffer sizes) are then set automatically. You can just type: +

+
+
ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
+
+ +

Nevertheless you can specify additional options as long as you know +they do not conflict with the standard, as in: +

+
+
ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
+
+ +

The parameters set for each target are as follows. +

+

VCD +

+
pal:
+-f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
+-s 352x288 -r 25
+-codec:v mpeg1video -g 15 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
+-ar 44100 -ac 2
+-codec:a mp2 -b:a 224k
+
+ntsc:
+-f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
+-s 352x240 -r 30000/1001
+-codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
+-ar 44100 -ac 2
+-codec:a mp2 -b:a 224k
+
+film:
+-f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
+-s 352x240 -r 24000/1001
+-codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
+-ar 44100 -ac 2
+-codec:a mp2 -b:a 224k
+
+ +

SVCD +

+
pal:
+-f svcd -packetsize 2324
+-s 480x576 -pix_fmt yuv420p -r 25
+-codec:v mpeg2video -g 15 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
+-ar 44100
+-codec:a mp2 -b:a 224k
+
+ntsc:
+-f svcd -packetsize 2324
+-s 480x480 -pix_fmt yuv420p -r 30000/1001
+-codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
+-ar 44100
+-codec:a mp2 -b:a 224k
+
+film:
+-f svcd -packetsize 2324
+-s 480x480 -pix_fmt yuv420p -r 24000/1001
+-codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
+-ar 44100
+-codec:a mp2 -b:a 224k
+
+ +

DVD +

+
pal:
+-f dvd -muxrate 10080k -packetsize 2048
+-s 720x576 -pix_fmt yuv420p -r 25
+-codec:v mpeg2video -g 15 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
+-ar 48000
+-codec:a ac3 -b:a 448k
+
+ntsc:
+-f dvd -muxrate 10080k -packetsize 2048
+-s 720x480 -pix_fmt yuv420p -r 30000/1001
+-codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
+-ar 48000
+-codec:a ac3 -b:a 448k
+
+film:
+-f dvd -muxrate 10080k -packetsize 2048
+-s 720x480 -pix_fmt yuv420p -r 24000/1001
+-codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
+-ar 48000
+-codec:a ac3 -b:a 448k
+
+ +

DV +

+
pal:
+-f dv
+-s 720x576 -pix_fmt yuv420p -r 25
+-ar 48000 -ac 2
+
+ntsc:
+-f dv
+-s 720x480 -pix_fmt yuv411p -r 30000/1001
+-ar 48000 -ac 2
+
+film:
+-f dv
+-s 720x480 -pix_fmt yuv411p -r 24000/1001
+-ar 48000 -ac 2
+
+

The dv50 target is identical to the dv target except that the pixel format set is yuv422p for all three standards. +

+

Any user-set value for a parameter above will override the target preset value. In that case, the output may +not comply with the target standard. +

+
+
-dn (input/output)
+

As an input option, blocks all data streams of a file from being filtered or +being automatically selected or mapped for any output. See -discard +option to disable streams individually. +

+

As an output option, disables data recording i.e. automatic selection or +mapping of any data stream. For full manual control see the -map +option. +

+
+
-dframes number (output)
+

Set the number of data frames to output. This is an obsolete alias for +-frames:d, which you should use instead. +

+
+
-frames[:stream_specifier] framecount (output,per-stream)
+

Stop writing to the stream after framecount frames. +

+
+
-q[:stream_specifier] q (output,per-stream)
+
-qscale[:stream_specifier] q (output,per-stream)
+

Use fixed quality scale (VBR). The meaning of q/qscale is +codec-dependent. +If qscale is used without a stream_specifier then it applies only +to the video stream, this is to maintain compatibility with previous behavior +and as specifying the same codec specific value to 2 different codecs that is +audio and video generally is not what is intended when no stream_specifier is +used. +

+
+
-filter[:stream_specifier] filtergraph (output,per-stream)
+

Create the filtergraph specified by filtergraph and use it to +filter the stream. +

+

filtergraph is a description of the filtergraph to apply to +the stream, and must have a single input and a single output of the +same type of the stream. In the filtergraph, the input is associated +to the label in, and the output to the label out. See +the ffmpeg-filters manual for more information about the filtergraph +syntax. +

+

See the -filter_complex option if you +want to create filtergraphs with multiple inputs and/or outputs. +

+
+
-filter_script[:stream_specifier] filename (output,per-stream)
+

This option is similar to -filter, the only difference is that its +argument is the name of the file from which a filtergraph description is to be +read. +

+
+
-reinit_filter[:stream_specifier] integer (input,per-stream)
+

This boolean option determines if the filtergraph(s) to which this stream is fed gets +reinitialized when input frame parameters change mid-stream. This option is enabled by +default as most video and all audio filters cannot handle deviation in input frame properties. +Upon reinitialization, existing filter state is lost, like e.g. the frame count n +reference available in some filters. Any frames buffered at time of reinitialization are lost. +The properties where a change triggers reinitialization are, +for video, frame resolution or pixel format; +for audio, sample format, sample rate, channel count or channel layout. +

+
+
-filter_threads nb_threads (global)
+

Defines how many threads are used to process a filter pipeline. Each pipeline +will produce a thread pool with this many threads available for parallel processing. +The default is the number of available CPUs. +

+
+
-pre[:stream_specifier] preset_name (output,per-stream)
+

Specify the preset for matching stream(s). +

+
+
-stats (global)
+

Print encoding progress/statistics. It is on by default, to explicitly +disable it you need to specify -nostats. +

+
+
-stats_period time (global)
+

Set period at which encoding progress/statistics are updated. Default is 0.5 seconds. +

+
+
-progress url (global)
+

Send program-friendly progress information to url. +

+

Progress information is written periodically and at the end of +the encoding process. It is made of "key=value" lines. key +consists of only alphanumeric characters. The last key of a sequence of +progress information is always "progress". +

+

The update period is set using -stats_period. +

+
+
-stdin
+

Enable interaction on standard input. On by default unless standard input is +used as an input. To explicitly disable interaction you need to specify +-nostdin. +

+

Disabling interaction on standard input is useful, for example, if +ffmpeg is in the background process group. Roughly the same result can +be achieved with ffmpeg ... < /dev/null but it requires a +shell. +

+
+
-debug_ts (global)
+

Print timestamp information. It is off by default. This option is +mostly useful for testing and debugging purposes, and the output +format may change from one version to another, so it should not be +employed by portable scripts. +

+

See also the option -fdebug ts. +

+
+
-attach filename (output)
+

Add an attachment to the output file. This is supported by a few formats +like Matroska for e.g. fonts used in rendering subtitles. Attachments +are implemented as a specific type of stream, so this option will add +a new stream to the file. It is then possible to use per-stream options +on this stream in the usual way. Attachment streams created with this +option will be created after all the other streams (i.e. those created +with -map or automatic mappings). +

+

Note that for Matroska you also have to set the mimetype metadata tag: +

+
ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
+
+

(assuming that the attachment stream will be third in the output file). +

+
+
-dump_attachment[:stream_specifier] filename (input,per-stream)
+

Extract the matching attachment stream into a file named filename. If +filename is empty, then the value of the filename metadata tag +will be used. +

+

E.g. to extract the first attachment to a file named ’out.ttf’: +

+
ffmpeg -dump_attachment:t:0 out.ttf -i INPUT
+
+

To extract all attachments to files determined by the filename tag: +

+
ffmpeg -dump_attachment:t "" -i INPUT
+
+ +

Technical note – attachments are implemented as codec extradata, so this +option can actually be used to extract extradata from any stream, not just +attachments. +

+
+ +
+
+

5.5 Video Options

+ +
+
-vframes number (output)
+

Set the number of video frames to output. This is an obsolete alias for +-frames:v, which you should use instead. +

+
-r[:stream_specifier] fps (input/output,per-stream)
+

Set frame rate (Hz value, fraction or abbreviation). +

+

As an input option, ignore any timestamps stored in the file and instead +generate timestamps assuming constant frame rate fps. +This is not the same as the -framerate option used for some input formats +like image2 or v4l2 (it used to be the same in older versions of FFmpeg). +If in doubt use -framerate instead of the input option -r. +

+

As an output option: +

+
video encoding
+

Duplicate or drop frames right before encoding them to achieve constant output +frame rate fps. +

+
+
video streamcopy
+

Indicate to the muxer that fps is the stream frame rate. No data is +dropped or duplicated in this case. This may produce invalid files if fps +does not match the actual stream frame rate as determined by packet timestamps. +See also the setts bitstream filter. +

+
+
+ +
+
-fpsmax[:stream_specifier] fps (output,per-stream)
+

Set maximum frame rate (Hz value, fraction or abbreviation). +

+

Clamps output frame rate when output framerate is auto-set and is higher than this value. +Useful in batch processing or when input framerate is wrongly detected as very high. +It cannot be set together with -r. It is ignored during streamcopy. +

+
+
-s[:stream_specifier] size (input/output,per-stream)
+

Set frame size. +

+

As an input option, this is a shortcut for the video_size private +option, recognized by some demuxers for which the frame size is either not +stored in the file or is configurable – e.g. raw video or video grabbers. +

+

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). +

+
+
-aspect[:stream_specifier] aspect (output,per-stream)
+

Set the video display aspect ratio specified by aspect. +

+

aspect can be a floating point number string, or a string of the +form num:den, where num and den are the +numerator and denominator of the aspect ratio. For example "4:3", +"16:9", "1.3333", and "1.7777" are valid argument values. +

+

If used together with -vcodec copy, it will affect the aspect ratio +stored at container level, but not the aspect ratio stored in encoded +frames, if it exists. +

+
+
-display_rotation[:stream_specifier] rotation (input,per-stream)
+

Set video rotation metadata. +

+

rotation is a decimal number specifying the amount in degree by +which the video should be rotated counter-clockwise before being +displayed. +

+

This option overrides the rotation/display transform metadata stored in +the file, if any. When the video is being transcoded (rather than +copied) and -autorotate is enabled, the video will be rotated at +the filtering stage. Otherwise, the metadata will be written into the +output file if the muxer supports it. +

+

If the -display_hflip and/or -display_vflip options are +given, they are applied after the rotation specified by this option. +

+
+
-display_hflip[:stream_specifier] (input,per-stream)
+

Set whether on display the image should be horizontally flipped. +

+

See the -display_rotation option for more details. +

+
+
-display_vflip[:stream_specifier] (input,per-stream)
+

Set whether on display the image should be vertically flipped. +

+

See the -display_rotation option for more details. +

+
+
-vn (input/output)
+

As an input option, blocks all video streams of a file from being filtered or +being automatically selected or mapped for any output. See -discard +option to disable streams individually. +

+

As an output option, disables video recording i.e. automatic selection or +mapping of any video stream. For full manual control see the -map +option. +

+
+
-vcodec codec (output)
+

Set the video codec. This is an alias for -codec:v. +

+
+
-pass[:stream_specifier] n (output,per-stream)
+

Select the pass number (1 or 2). It is used to do two-pass +video encoding. The statistics of the video are recorded in the first +pass into a log file (see also the option -passlogfile), +and in the second pass that log file is used to generate the video +at the exact requested bitrate. +On pass 1, you may just deactivate audio and set output to null, +examples for Windows and Unix: +

+
ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
+ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
+
+ +
+
-passlogfile[:stream_specifier] prefix (output,per-stream)
+

Set two-pass log file name prefix to prefix, the default file name +prefix is “ffmpeg2pass”. The complete file name will be +PREFIX-N.log, where N is a number specific to the output +stream +

+
+
-vf filtergraph (output)
+

Create the filtergraph specified by filtergraph and use it to +filter the stream. +

+

This is an alias for -filter:v, see the -filter option. +

+
+
-autorotate
+

Automatically rotate the video according to file metadata. Enabled by +default, use -noautorotate to disable it. +

+
+
-autoscale
+

Automatically scale the video according to the resolution of first frame. +Enabled by default, use -noautoscale to disable it. When autoscale is +disabled, all output frames of filter graph might not be in the same resolution +and may be inadequate for some encoder/muxer. Therefore, it is not recommended +to disable it unless you really know what you are doing. +Disable autoscale at your own risk. +

+
+ +
+
+

5.6 Advanced Video options

+ +
+
-pix_fmt[:stream_specifier] format (input/output,per-stream)
+

Set pixel format. Use -pix_fmts to show all the supported +pixel formats. +If the selected pixel format can not be selected, ffmpeg will print a +warning and select the best pixel format supported by the encoder. +If pix_fmt is prefixed by a +, ffmpeg will exit with an error +if the requested pixel format can not be selected, and automatic conversions +inside filtergraphs are disabled. +If pix_fmt is a single +, ffmpeg selects the same pixel format +as the input (or graph output) and automatic conversions are disabled. +

+
+
-sws_flags flags (input/output)
+

Set default flags for the libswscale library. These flags are used by +automatically inserted scale filters and those within simple +filtergraphs, if not overridden within the filtergraph definition. +

+

See the (ffmpeg-scaler)ffmpeg-scaler manual for a list +of scaler options. +

+
+
-rc_override[:stream_specifier] override (output,per-stream)
+

Rate control override for specific intervals, formatted as "int,int,int" +list separated with slashes. Two first values are the beginning and +end frame numbers, last one is quantizer to use if positive, or quality +factor if negative. +

+
+
-psnr
+

Calculate PSNR of compressed frames. This option is deprecated, pass the +PSNR flag to the encoder instead, using -flags +psnr. +

+
+
-vstats
+

Dump video coding statistics to vstats_HHMMSS.log. See the +vstats file format section for the format description. +

+
+
-vstats_file file
+

Dump video coding statistics to file. See the +vstats file format section for the format description. +

+
+
-vstats_version file
+

Specify which version of the vstats format to use. Default is 2. See the +vstats file format section for the format description. +

+
+
-top[:stream_specifier] n (output,per-stream)
+

top=1/bottom=0/auto=-1 field first +

+
-vtag fourcc/tag (output)
+

Force video tag/fourcc. This is an alias for -tag:v. +

+
-vbsf bitstream_filter
+

Deprecated see -bsf +

+
+
-force_key_frames[:stream_specifier] time[,time...] (output,per-stream)
+
-force_key_frames[:stream_specifier] expr:expr (output,per-stream)
+
-force_key_frames[:stream_specifier] source (output,per-stream)
+
-force_key_frames[:stream_specifier] source_no_drop (output,per-stream)
+
+

force_key_frames can take arguments of the following form: +

+
+
time[,time...]
+

If the argument consists of timestamps, ffmpeg will round the specified times to the nearest +output timestamp as per the encoder time base and force a keyframe at the first frame having +timestamp equal or greater than the computed timestamp. Note that if the encoder time base is too +coarse, then the keyframes may be forced on frames with timestamps lower than the specified time. +The default encoder time base is the inverse of the output framerate but may be set otherwise +via -enc_time_base. +

+

If one of the times is "chapters[delta]", it is expanded into +the time of the beginning of all chapters in the file, shifted by +delta, expressed as a time in seconds. +This option can be useful to ensure that a seek point is present at a +chapter mark or any other designated place in the output file. +

+

For example, to insert a key frame at 5 minutes, plus key frames 0.1 second +before the beginning of every chapter: +

+
-force_key_frames 0:05:00,chapters-0.1
+
+ +
+
expr:expr
+

If the argument is prefixed with expr:, the string expr +is interpreted like an expression and is evaluated for each frame. A +key frame is forced in case the evaluation is non-zero. +

+

The expression in expr can contain the following constants: +

+
n
+

the number of current processed frame, starting from 0 +

+
n_forced
+

the number of forced frames +

+
prev_forced_n
+

the number of the previous forced frame, it is NAN when no +keyframe was forced yet +

+
prev_forced_t
+

the time of the previous forced frame, it is NAN when no +keyframe was forced yet +

+
t
+

the time of the current processed frame +

+
+ +

For example to force a key frame every 5 seconds, you can specify: +

+
-force_key_frames expr:gte(t,n_forced*5)
+
+ +

To force a key frame 5 seconds after the time of the last forced one, +starting from second 13: +

+
-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
+
+ +
+
source
+

If the argument is source, ffmpeg will force a key frame if +the current frame being encoded is marked as a key frame in its source. +

+
+
source_no_drop
+

If the argument is source_no_drop, ffmpeg will force a key frame if +the current frame being encoded is marked as a key frame in its source. +In cases where this particular source frame has to be dropped, +enforce the next available frame to become a key frame instead. +

+
+
+ +

Note that forcing too many keyframes is very harmful for the lookahead +algorithms of certain encoders: using fixed-GOP options or similar +would be more efficient. +

+
+
-copyinkf[:stream_specifier] (output,per-stream)
+

When doing stream copy, copy also non-key frames found at the +beginning. +

+
+
-init_hw_device type[=name][:device[,key=value...]]
+

Initialise a new hardware device of type type called name, using the +given device parameters. +If no name is specified it will receive a default name of the form "type%d". +

+

The meaning of device and the following arguments depends on the +device type: +

+
cuda
+

device is the number of the CUDA device. +

+

The following options are recognized: +

+
primary_ctx
+

If set to 1, uses the primary device context instead of creating a new one. +

+
+ +

Examples: +

+
-init_hw_device cuda:1
+

Choose the second device on the system. +

+
+
-init_hw_device cuda:0,primary_ctx=1
+

Choose the first device and use the primary device context. +

+
+ +
+
dxva2
+

device is the number of the Direct3D 9 display adapter. +

+
+
d3d11va
+

device is the number of the Direct3D 11 display adapter. +

+
+
vaapi
+

device is either an X11 display name, a DRM render node or a DirectX adapter index. +If not specified, it will attempt to open the default X11 display ($DISPLAY) +and then the first DRM render node (/dev/dri/renderD128), or the default +DirectX adapter on Windows. +

+
+
vdpau
+

device is an X11 display name. +If not specified, it will attempt to open the default X11 display ($DISPLAY). +

+
+
qsv
+

device selects a value in ‘MFX_IMPL_*’. Allowed values are: +

+
auto
+
sw
+
hw
+
auto_any
+
hw_any
+
hw2
+
hw3
+
hw4
+
+

If not specified, ‘auto_any’ is used. +(Note that it may be easier to achieve the desired result for QSV by creating the +platform-appropriate subdevice (‘dxva2’ or ‘d3d11va’ or ‘vaapi’) and then deriving a +QSV device from that.) +

+

Alternatively, ‘child_device_type’ helps to choose platform-appropriate subdevice type. +On Windows ‘d3d11va’ is used as default subdevice type. +

+

Examples: +

+
-init_hw_device qsv:hw,child_device_type=d3d11va
+

Choose the GPU subdevice with type ‘d3d11va’ and create QSV device with ‘MFX_IMPL_HARDWARE’. +

+
+
-init_hw_device qsv:hw,child_device_type=dxva2
+

Choose the GPU subdevice with type ‘dxva2’ and create QSV device with ‘MFX_IMPL_HARDWARE’. +

+
+ +
+
opencl
+

device selects the platform and device as platform_index.device_index. +

+

The set of devices can also be filtered using the key-value pairs to find only +devices matching particular platform or device strings. +

+

The strings usable as filters are: +

+
platform_profile
+
platform_version
+
platform_name
+
platform_vendor
+
platform_extensions
+
device_name
+
device_vendor
+
driver_version
+
device_version
+
device_profile
+
device_extensions
+
device_type
+
+ +

The indices and filters must together uniquely select a device. +

+

Examples: +

+
-init_hw_device opencl:0.1
+

Choose the second device on the first platform. +

+
+
-init_hw_device opencl:,device_name=Foo9000
+

Choose the device with a name containing the string Foo9000. +

+
+
-init_hw_device opencl:1,device_type=gpu,device_extensions=cl_khr_fp16
+

Choose the GPU device on the second platform supporting the cl_khr_fp16 +extension. +

+
+ +
+
vulkan
+

If device is an integer, it selects the device by its index in a +system-dependent list of devices. If device is any other string, it +selects the first device with a name containing that string as a substring. +

+

The following options are recognized: +

+
debug
+

If set to 1, enables the validation layer, if installed. +

+
linear_images
+

If set to 1, images allocated by the hwcontext will be linear and locally mappable. +

+
instance_extensions
+

A plus separated list of additional instance extensions to enable. +

+
device_extensions
+

A plus separated list of additional device extensions to enable. +

+
+ +

Examples: +

+
-init_hw_device vulkan:1
+

Choose the second device on the system. +

+
+
-init_hw_device vulkan:RADV
+

Choose the first device with a name containing the string RADV. +

+
+
-init_hw_device vulkan:0,instance_extensions=VK_KHR_wayland_surface+VK_KHR_xcb_surface
+

Choose the first device and enable the Wayland and XCB instance extensions. +

+
+ +
+
+ +
+
-init_hw_device type[=name]@source
+

Initialise a new hardware device of type type called name, +deriving it from the existing device with the name source. +

+
+
-init_hw_device list
+

List all hardware device types supported in this build of ffmpeg. +

+
+
-filter_hw_device name
+

Pass the hardware device called name to all filters in any filter graph. +This can be used to set the device to upload to with the hwupload filter, +or the device to map to with the hwmap filter. Other filters may also +make use of this parameter when they require a hardware device. Note that this +is typically only required when the input is not already in hardware frames - +when it is, filters will derive the device they require from the context of the +frames they receive as input. +

+

This is a global setting, so all filters will receive the same device. +

+
+
-hwaccel[:stream_specifier] hwaccel (input,per-stream)
+

Use hardware acceleration to decode the matching stream(s). The allowed values +of hwaccel are: +

+
none
+

Do not use any hardware acceleration (the default). +

+
+
auto
+

Automatically select the hardware acceleration method. +

+
+
vdpau
+

Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration. +

+
+
dxva2
+

Use DXVA2 (DirectX Video Acceleration) hardware acceleration. +

+
+
d3d11va
+

Use D3D11VA (DirectX Video Acceleration) hardware acceleration. +

+
+
vaapi
+

Use VAAPI (Video Acceleration API) hardware acceleration. +

+
+
qsv
+

Use the Intel QuickSync Video acceleration for video transcoding. +

+

Unlike most other values, this option does not enable accelerated decoding (that +is used automatically whenever a qsv decoder is selected), but accelerated +transcoding, without copying the frames into the system memory. +

+

For it to work, both the decoder and the encoder must support QSV acceleration +and no filters must be used. +

+
+ +

This option has no effect if the selected hwaccel is not available or not +supported by the chosen decoder. +

+

Note that most acceleration methods are intended for playback and will not be +faster than software decoding on modern CPUs. Additionally, ffmpeg +will usually need to copy the decoded frames from the GPU memory into the system +memory, resulting in further performance loss. This option is thus mainly +useful for testing. +

+
+
-hwaccel_device[:stream_specifier] hwaccel_device (input,per-stream)
+

Select a device to use for hardware acceleration. +

+

This option only makes sense when the -hwaccel option is also specified. +It can either refer to an existing device created with -init_hw_device +by name, or it can create a new device as if +‘-init_hw_devicetype:hwaccel_device +were called immediately before. +

+
+
-hwaccels
+

List all hardware acceleration components enabled in this build of ffmpeg. +Actual runtime availability depends on the hardware and its suitable driver +being installed. +

+
+
-fix_sub_duration_heartbeat[:stream_specifier]
+

Set a specific output video stream as the heartbeat stream according to which +to split and push through currently in-progress subtitle upon receipt of a +random access packet. +

+

This lowers the latency of subtitles for which the end packet or the following +subtitle has not yet been received. As a drawback, this will most likely lead +to duplication of subtitle events in order to cover the full duration, so +when dealing with use cases where latency of when the subtitle event is passed +on to output is not relevant this option should not be utilized. +

+

Requires -fix_sub_duration to be set for the relevant input subtitle +stream for this to have any effect, as well as for the input subtitle stream +having to be directly mapped to the same output in which the heartbeat stream +resides. +

+
+
+ +
+
+

5.7 Audio Options

+ +
+
-aframes number (output)
+

Set the number of audio frames to output. This is an obsolete alias for +-frames:a, which you should use instead. +

+
-ar[:stream_specifier] freq (input/output,per-stream)
+

Set the audio sampling frequency. For output streams it is set by +default to the frequency of the corresponding input stream. For input +streams this option only makes sense for audio grabbing devices and raw +demuxers and is mapped to the corresponding demuxer options. +

+
-aq q (output)
+

Set the audio quality (codec-specific, VBR). This is an alias for -q:a. +

+
-ac[:stream_specifier] channels (input/output,per-stream)
+

Set the number of audio channels. For output streams it is set by +default to the number of input audio channels. For input streams +this option only makes sense for audio grabbing devices and raw demuxers +and is mapped to the corresponding demuxer options. +

+
-an (input/output)
+

As an input option, blocks all audio streams of a file from being filtered or +being automatically selected or mapped for any output. See -discard +option to disable streams individually. +

+

As an output option, disables audio recording i.e. automatic selection or +mapping of any audio stream. For full manual control see the -map +option. +

+
-acodec codec (input/output)
+

Set the audio codec. This is an alias for -codec:a. +

+
-sample_fmt[:stream_specifier] sample_fmt (output,per-stream)
+

Set the audio sample format. Use -sample_fmts to get a list +of supported sample formats. +

+
+
-af filtergraph (output)
+

Create the filtergraph specified by filtergraph and use it to +filter the stream. +

+

This is an alias for -filter:a, see the -filter option. +

+
+ +
+
+

5.8 Advanced Audio options

+ +
+
-atag fourcc/tag (output)
+

Force audio tag/fourcc. This is an alias for -tag:a. +

+
-absf bitstream_filter
+

Deprecated, see -bsf +

+
-guess_layout_max channels (input,per-stream)
+

If some input channel layout is not known, try to guess only if it +corresponds to at most the specified number of channels. For example, 2 +tells to ffmpeg to recognize 1 channel as mono and 2 channels as +stereo but not 6 channels as 5.1. The default is to always try to guess. Use +0 to disable all guessing. +

+
+ +
+
+

5.9 Subtitle options

+ +
+
-scodec codec (input/output)
+

Set the subtitle codec. This is an alias for -codec:s. +

+
-sn (input/output)
+

As an input option, blocks all subtitle streams of a file from being filtered or +being automatically selected or mapped for any output. See -discard +option to disable streams individually. +

+

As an output option, disables subtitle recording i.e. automatic selection or +mapping of any subtitle stream. For full manual control see the -map +option. +

+
-sbsf bitstream_filter
+

Deprecated, see -bsf +

+
+ +
+
+

5.10 Advanced Subtitle options

+ +
+
-fix_sub_duration
+

Fix subtitles durations. For each subtitle, wait for the next packet in the +same stream and adjust the duration of the first to avoid overlap. This is +necessary with some subtitles codecs, especially DVB subtitles, because the +duration in the original packet is only a rough estimate and the end is +actually marked by an empty subtitle frame. Failing to use this option when +necessary can result in exaggerated durations or muxing failures due to +non-monotonic timestamps. +

+

Note that this option will delay the output of all data until the next +subtitle packet is decoded: it may increase memory consumption and latency a +lot. +

+
+
-canvas_size size
+

Set the size of the canvas used to render subtitles. +

+
+
+ +
+
+

5.11 Advanced options

+ +
+
-map [-]input_file_id[:stream_specifier][?] | [linklabel] (output)
+
+

Create one or more streams in the output file. This option has two forms for +specifying the data source(s): the first selects one or more streams from some +input file (specified with -i), the second takes an output from some +complex filtergraph (specified with -filter_complex or +-filter_complex_script). +

+

In the first form, an output stream is created for every stream from the input +file with the index input_file_id. If stream_specifier is given, +only those streams that match the specifier are used (see the +Stream specifiers section for the stream_specifier syntax). +

+

A - character before the stream identifier creates a "negative" mapping. +It disables matching streams from already created mappings. +

+

A trailing ? after the stream index will allow the map to be +optional: if the map matches no streams the map will be ignored instead +of failing. Note the map will still fail if an invalid input file index +is used; such as if the map refers to a non-existent input. +

+

An alternative [linklabel] form will map outputs from complex filter +graphs (see the -filter_complex option) to the output file. +linklabel must correspond to a defined output link label in the graph. +

+

This option may be specified multiple times, each adding more streams to the +output file. Any given input stream may also be mapped any number of times as a +source for different output streams, e.g. in order to use different encoding +options and/or filters. The streams are created in the output in the same order +in which the -map options are given on the commandline. +

+

Using this option disables the default mappings for this output file. +

+

Examples: +

+
+
map everything
+

To map ALL streams from the first input file to output +

+
ffmpeg -i INPUT -map 0 output
+
+ +
+
select specific stream
+

If you have two audio streams in the first input file, these streams are +identified by 0:0 and 0:1. You can use -map to select which +streams to place in an output file. For example: +

+
ffmpeg -i INPUT -map 0:1 out.wav
+
+

will map the second input stream in INPUT to the (single) output stream +in out.wav. +

+
+
create multiple streams
+

To select the stream with index 2 from input file a.mov (specified by the +identifier 0:2), and stream with index 6 from input b.mov +(specified by the identifier 1:6), and copy them to the output file +out.mov: +

+
ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
+
+ +
+
create multiple streams 2
+

To select all video and the third audio stream from an input file: +

+
ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT
+
+ +
+
negative map
+

To map all the streams except the second audio, use negative mappings +

+
ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
+
+ +
+
optional map
+

To map the video and audio streams from the first input, and using the +trailing ?, ignore the audio mapping if no audio streams exist in +the first input: +

+
ffmpeg -i INPUT -map 0:v -map 0:a? OUTPUT
+
+ +
+
map by language
+

To pick the English audio stream: +

+
ffmpeg -i INPUT -map 0:m:language:eng OUTPUT
+
+ +
+
+ +
+
-ignore_unknown
+

Ignore input streams with unknown type instead of failing if copying +such streams is attempted. +

+
+
-copy_unknown
+

Allow input streams with unknown type to be copied instead of failing if copying +such streams is attempted. +

+
+
-map_channel [input_file_id.stream_specifier.channel_id|-1][?][:output_file_id.stream_specifier]
+

This option is deprecated and will be removed. It can be replaced by the +pan filter. In some cases it may be easier to use some combination of the +channelsplit, channelmap, or amerge filters. +

+

Map an audio channel from a given input to an output. If +output_file_id.stream_specifier is not set, the audio channel will +be mapped on all the audio streams. +

+

Using "-1" instead of +input_file_id.stream_specifier.channel_id will map a muted +channel. +

+

A trailing ? will allow the map_channel to be +optional: if the map_channel matches no channel the map_channel will be ignored instead +of failing. +

+

For example, assuming INPUT is a stereo audio file, you can switch the +two audio channels with the following command: +

+
ffmpeg -i INPUT -map_channel 0.0.1 -map_channel 0.0.0 OUTPUT
+
+ +

If you want to mute the first channel and keep the second: +

+
ffmpeg -i INPUT -map_channel -1 -map_channel 0.0.1 OUTPUT
+
+ +

The order of the "-map_channel" option specifies the order of the channels in +the output stream. The output channel layout is guessed from the number of +channels mapped (mono if one "-map_channel", stereo if two, etc.). Using "-ac" +in combination of "-map_channel" makes the channel gain levels to be updated if +input and output channel layouts don’t match (for instance two "-map_channel" +options and "-ac 6"). +

+

You can also extract each channel of an input to specific outputs; the following +command extracts two channels of the INPUT audio stream (file 0, stream 0) +to the respective OUTPUT_CH0 and OUTPUT_CH1 outputs: +

+
ffmpeg -i INPUT -map_channel 0.0.0 OUTPUT_CH0 -map_channel 0.0.1 OUTPUT_CH1
+
+ +

The following example splits the channels of a stereo input into two separate +streams, which are put into the same output file: +

+
ffmpeg -i stereo.wav -map 0:0 -map 0:0 -map_channel 0.0.0:0.0 -map_channel 0.0.1:0.1 -y out.ogg
+
+ +

Note that currently each output stream can only contain channels from a single +input stream; you can’t for example use "-map_channel" to pick multiple input +audio channels contained in different streams (from the same or different files) +and merge them into a single output stream. It is therefore not currently +possible, for example, to turn two separate mono streams into a single stereo +stream. However splitting a stereo stream into two single channel mono streams +is possible. +

+

If you need this feature, a possible workaround is to use the amerge +filter. For example, if you need to merge a media (here input.mkv) with 2 +mono audio streams into one single stereo channel audio stream (and keep the +video stream), you can use the following command: +

+
ffmpeg -i input.mkv -filter_complex "[0:1] [0:2] amerge" -c:a pcm_s16le -c:v copy output.mkv
+
+ +

To map the first two audio channels from the first input, and using the +trailing ?, ignore the audio channel mapping if the first input is +mono instead of stereo: +

+
ffmpeg -i INPUT -map_channel 0.0.0 -map_channel 0.0.1? OUTPUT
+
+ +
+
-map_metadata[:metadata_spec_out] infile[:metadata_spec_in] (output,per-metadata)
+

Set metadata information of the next output file from infile. Note that +those are file indices (zero-based), not filenames. +Optional metadata_spec_in/out parameters specify, which metadata to copy. +A metadata specifier can have the following forms: +

+
g
+

global metadata, i.e. metadata that applies to the whole file +

+
+
s[:stream_spec]
+

per-stream metadata. stream_spec is a stream specifier as described +in the Stream specifiers chapter. In an input metadata specifier, the first +matching stream is copied from. In an output metadata specifier, all matching +streams are copied to. +

+
+
c:chapter_index
+

per-chapter metadata. chapter_index is the zero-based chapter index. +

+
+
p:program_index
+

per-program metadata. program_index is the zero-based program index. +

+
+

If metadata specifier is omitted, it defaults to global. +

+

By default, global metadata is copied from the first input file, +per-stream and per-chapter metadata is copied along with streams/chapters. These +default mappings are disabled by creating any mapping of the relevant type. A negative +file index can be used to create a dummy mapping that just disables automatic copying. +

+

For example to copy metadata from the first stream of the input file to global metadata +of the output file: +

+
ffmpeg -i in.ogg -map_metadata 0:s:0 out.mp3
+
+ +

To do the reverse, i.e. copy global metadata to all audio streams: +

+
ffmpeg -i in.mkv -map_metadata:s:a 0:g out.mkv
+
+

Note that simple 0 would work as well in this example, since global +metadata is assumed by default. +

+
+
-map_chapters input_file_index (output)
+

Copy chapters from input file with index input_file_index to the next +output file. If no chapter mapping is specified, then chapters are copied from +the first input file with at least one chapter. Use a negative file index to +disable any chapter copying. +

+
+
-benchmark (global)
+

Show benchmarking information at the end of an encode. +Shows real, system and user time used and maximum memory consumption. +Maximum memory consumption is not supported on all systems, +it will usually display as 0 if not supported. +

+
-benchmark_all (global)
+

Show benchmarking information during the encode. +Shows real, system and user time used in various steps (audio/video encode/decode). +

+
-timelimit duration (global)
+

Exit after ffmpeg has been running for duration seconds in CPU user time. +

+
-dump (global)
+

Dump each input packet to stderr. +

+
-hex (global)
+

When dumping packets, also dump the payload. +

+
-readrate speed (input)
+

Limit input read speed. +

+

Its value is a floating-point positive number which represents the maximum duration of +media, in seconds, that should be ingested in one second of wallclock time. +Default value is zero and represents no imposed limitation on speed of ingestion. +Value 1 represents real-time speed and is equivalent to -re. +

+

Mainly used to simulate a capture device or live input stream (e.g. when reading from a file). +Should not be used with a low value when input is an actual capture device or live stream as +it may cause packet loss. +

+

It is useful for when flow speed of output packets is important, such as live streaming. +

+
-re (input)
+

Read input at native frame rate. This is equivalent to setting -readrate 1. +

+
-readrate_initial_burst seconds
+

Set an initial read burst time, in seconds, after which -re/-readrate +will be enforced. +

+
-vsync parameter (global)
+
-fps_mode[:stream_specifier] parameter (output,per-stream)
+

Set video sync method / framerate mode. vsync is applied to all output video streams +but can be overridden for a stream by setting fps_mode. vsync is deprecated and will be +removed in the future. +

+

For compatibility reasons some of the values for vsync can be specified as numbers (shown +in parentheses in the following table). +

+
+
passthrough (0)
+

Each frame is passed with its timestamp from the demuxer to the muxer. +

+
cfr (1)
+

Frames will be duplicated and dropped to achieve exactly the requested +constant frame rate. +

+
vfr (2)
+

Frames are passed through with their timestamp or dropped so as to +prevent 2 frames from having the same timestamp. +

+
drop
+

As passthrough but destroys all timestamps, making the muxer generate +fresh timestamps based on frame-rate. +

+
auto (-1)
+

Chooses between cfr and vfr depending on muxer capabilities. This is the +default method. +

+
+ +

Note that the timestamps may be further modified by the muxer, after this. +For example, in the case that the format option avoid_negative_ts +is enabled. +

+

With -map you can select from which stream the timestamps should be +taken. You can leave either video or audio unchanged and sync the +remaining stream(s) to the unchanged one. +

+
+
-frame_drop_threshold parameter
+

Frame drop threshold, which specifies how much behind video frames can +be before they are dropped. In frame rate units, so 1.0 is one frame. +The default is -1.1. One possible usecase is to avoid framedrops in case +of noisy timestamps or to increase frame drop precision in case of exact +timestamps. +

+
+
-apad parameters (output,per-stream)
+

Pad the output audio stream(s). This is the same as applying -af apad. +Argument is a string of filter parameters composed the same as with the apad filter. +-shortest must be set for this output for the option to take effect. +

+
+
-copyts
+

Do not process input timestamps, but keep their values without trying +to sanitize them. In particular, do not remove the initial start time +offset value. +

+

Note that, depending on the vsync option or on specific muxer +processing (e.g. in case the format option avoid_negative_ts +is enabled) the output timestamps may mismatch with the input +timestamps even when this option is selected. +

+
+
-start_at_zero
+

When used with copyts, shift input timestamps so they start at zero. +

+

This means that using e.g. -ss 50 will make output timestamps start at +50 seconds, regardless of what timestamp the input file started at. +

+
+
-copytb mode
+

Specify how to set the encoder timebase when stream copying. mode is an +integer numeric value, and can assume one of the following values: +

+
+
1
+

Use the demuxer timebase. +

+

The time base is copied to the output encoder from the corresponding input +demuxer. This is sometimes required to avoid non monotonically increasing +timestamps when copying video streams with variable frame rate. +

+
+
0
+

Use the decoder timebase. +

+

The time base is copied to the output encoder from the corresponding input +decoder. +

+
+
-1
+

Try to make the choice automatically, in order to generate a sane output. +

+
+ +

Default value is -1. +

+
+
-enc_time_base[:stream_specifier] timebase (output,per-stream)
+

Set the encoder timebase. timebase is a floating point number, +and can assume one of the following values: +

+
+
0
+

Assign a default value according to the media type. +

+

For video - use 1/framerate, for audio - use 1/samplerate. +

+
+
-1
+

Use the input stream timebase when possible. +

+

If an input stream is not available, the default timebase will be used. +

+
+
>0
+

Use the provided number as the timebase. +

+

This field can be provided as a ratio of two integers (e.g. 1:24, 1:48000) +or as a floating point number (e.g. 0.04166, 2.0833e-5) +

+
+ +

Default value is 0. +

+
+
-bitexact (input/output)
+

Enable bitexact mode for (de)muxer and (de/en)coder +

+
-shortest (output)
+

Finish encoding when the shortest output stream ends. +

+

Note that this option may require buffering frames, which introduces extra +latency. The maximum amount of this latency may be controlled with the +-shortest_buf_duration option. +

+
+
-shortest_buf_duration duration (output)
+

The -shortest option may require buffering potentially large amounts +of data when at least one of the streams is "sparse" (i.e. has large gaps +between frames – this is typically the case for subtitles). +

+

This option controls the maximum duration of buffered frames in seconds. +Larger values may allow the -shortest option to produce more accurate +results, but increase memory use and latency. +

+

The default value is 10 seconds. +

+
+
-dts_delta_threshold threshold
+

Timestamp discontinuity delta threshold, expressed as a decimal number +of seconds. +

+

The timestamp discontinuity correction enabled by this option is only +applied to input formats accepting timestamp discontinuity (for which +the AV_FMT_DISCONT flag is enabled), e.g. MPEG-TS and HLS, and +is automatically disabled when employing the -copy_ts option +(unless wrapping is detected). +

+

If a timestamp discontinuity is detected whose absolute value is +greater than threshold, ffmpeg will remove the discontinuity by +decreasing/increasing the current DTS and PTS by the corresponding +delta value. +

+

The default value is 10. +

+
+
-dts_error_threshold threshold
+

Timestamp error delta threshold, expressed as a decimal number of +seconds. +

+

The timestamp correction enabled by this option is only applied to +input formats not accepting timestamp discontinuity (for which the +AV_FMT_DISCONT flag is not enabled). +

+

If a timestamp discontinuity is detected whose absolute value is +greater than threshold, ffmpeg will drop the PTS/DTS timestamp +value. +

+

The default value is 3600*30 (30 hours), which is arbitrarily +picked and quite conservative. +

+
+
-muxdelay seconds (output)
+

Set the maximum demux-decode delay. +

+
-muxpreload seconds (output)
+

Set the initial demux-decode delay. +

+
-streamid output-stream-index:new-value (output)
+

Assign a new stream-id value to an output stream. This option should be +specified prior to the output filename to which it applies. +For the situation where multiple output files exist, a streamid +may be reassigned to a different value. +

+

For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for +an output mpegts file: +

+
ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts
+
+ +
+
-bsf[:stream_specifier] bitstream_filters (output,per-stream)
+

Set bitstream filters for matching streams. bitstream_filters is +a comma-separated list of bitstream filters. Use the -bsfs option +to get the list of bitstream filters. +

+
ffmpeg -i h264.mp4 -c:v copy -bsf:v h264_mp4toannexb -an out.h264
+
+
+
ffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt
+
+ +
+
-tag[:stream_specifier] codec_tag (input/output,per-stream)
+

Force a tag/fourcc for matching streams. +

+
+
-timecode hh:mm:ssSEPff
+

Specify Timecode for writing. SEP is ’:’ for non drop timecode and ’;’ +(or ’.’) for drop. +

+
ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
+
+ +
+
-filter_complex filtergraph (global)
+

Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or +outputs. For simple graphs – those with one input and one output of the same +type – see the -filter options. filtergraph is a description of +the filtergraph, as described in the “Filtergraph syntax” section of the +ffmpeg-filters manual. +

+

Input link labels must refer to input streams using the +[file_index:stream_specifier] syntax (i.e. the same as -map +uses). If stream_specifier matches multiple streams, the first one will be +used. An unlabeled input will be connected to the first unused input stream of +the matching type. +

+

Output link labels are referred to with -map. Unlabeled outputs are +added to the first output file. +

+

Note that with this option it is possible to use only lavfi sources without +normal input files. +

+

For example, to overlay an image over video +

+
ffmpeg -i video.mkv -i image.png -filter_complex '[0:v][1:v]overlay[out]' -map
+'[out]' out.mkv
+
+

Here [0:v] refers to the first video stream in the first input file, +which is linked to the first (main) input of the overlay filter. Similarly the +first video stream in the second input is linked to the second (overlay) input +of overlay. +

+

Assuming there is only one video stream in each input file, we can omit input +labels, so the above is equivalent to +

+
ffmpeg -i video.mkv -i image.png -filter_complex 'overlay[out]' -map
+'[out]' out.mkv
+
+ +

Furthermore we can omit the output label and the single output from the filter +graph will be added to the output file automatically, so we can simply write +

+
ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
+
+ +

As a special exception, you can use a bitmap subtitle stream as input: it +will be converted into a video with the same size as the largest video in +the file, or 720x576 if no video is present. Note that this is an +experimental and temporary solution. It will be removed once libavfilter has +proper support for subtitles. +

+

For example, to hardcode subtitles on top of a DVB-T recording stored in +MPEG-TS format, delaying the subtitles by 1 second: +

+
ffmpeg -i input.ts -filter_complex \
+  '[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay' \
+  -sn -map '#0x2dc' output.mkv
+
+

(0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video, +audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too) +

+

To generate 5 seconds of pure red video using lavfi color source: +

+
ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
+
+ +
+
-filter_complex_threads nb_threads (global)
+

Defines how many threads are used to process a filter_complex graph. +Similar to filter_threads but used for -filter_complex graphs only. +The default is the number of available CPUs. +

+
+
-lavfi filtergraph (global)
+

Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or +outputs. Equivalent to -filter_complex. +

+
+
-filter_complex_script filename (global)
+

This option is similar to -filter_complex, the only difference is that +its argument is the name of the file from which a complex filtergraph +description is to be read. +

+
+
-accurate_seek (input)
+

This option enables or disables accurate seeking in input files with the +-ss option. It is enabled by default, so seeking is accurate when +transcoding. Use -noaccurate_seek to disable it, which may be useful +e.g. when copying some streams and transcoding the others. +

+
+
-seek_timestamp (input)
+

This option enables or disables seeking by timestamp in input files with the +-ss option. It is disabled by default. If enabled, the argument +to the -ss option is considered an actual timestamp, and is not +offset by the start time of the file. This matters only for files which do +not start from timestamp 0, such as transport streams. +

+
+
-thread_queue_size size (input/output)
+

For input, this option sets the maximum number of queued packets when reading +from the file or device. With low latency / high rate live streams, packets may +be discarded if they are not read in a timely manner; setting this value can +force ffmpeg to use a separate input thread and read packets as soon as they +arrive. By default ffmpeg only does this if multiple inputs are specified. +

+

For output, this option specified the maximum number of packets that may be +queued to each muxing thread. +

+
+
-sdp_file file (global)
+

Print sdp information for an output stream to file. +This allows dumping sdp information when at least one output isn’t an +rtp stream. (Requires at least one of the output formats to be rtp). +

+
+
-discard (input)
+

Allows discarding specific streams or frames from streams. +Any input stream can be fully discarded, using value all whereas +selective discarding of frames from a stream occurs at the demuxer +and is not supported by all demuxers. +

+
+
none
+

Discard no frame. +

+
+
default
+

Default, which discards no frames. +

+
+
noref
+

Discard all non-reference frames. +

+
+
bidir
+

Discard all bidirectional frames. +

+
+
nokey
+

Discard all frames excepts keyframes. +

+
+
all
+

Discard all frames. +

+
+ +
+
-abort_on flags (global)
+

Stop and abort on various conditions. The following flags are available: +

+
+
empty_output
+

No packets were passed to the muxer, the output is empty. +

+
empty_output_stream
+

No packets were passed to the muxer in some of the output streams. +

+
+ +
+
-max_error_rate (global)
+

Set fraction of decoding frame failures across all inputs which when crossed +ffmpeg will return exit code 69. Crossing this threshold does not terminate +processing. Range is a floating-point number between 0 to 1. Default is 2/3. +

+
+
-xerror (global)
+

Stop and exit on error +

+
+
-max_muxing_queue_size packets (output,per-stream)
+

When transcoding audio and/or video streams, ffmpeg will not begin writing into +the output until it has one packet for each such stream. While waiting for that +to happen, packets for other streams are buffered. This option sets the size of +this buffer, in packets, for the matching output stream. +

+

The default value of this option should be high enough for most uses, so only +touch this option if you are sure that you need it. +

+
+
-muxing_queue_data_threshold bytes (output,per-stream)
+

This is a minimum threshold until which the muxing queue size is not taken into +account. Defaults to 50 megabytes per stream, and is based on the overall size +of packets passed to the muxer. +

+
+
-auto_conversion_filters (global)
+

Enable automatically inserting format conversion filters in all filter +graphs, including those defined by -vf, -af, +-filter_complex and -lavfi. If filter format negotiation +requires a conversion, the initialization of the filters will fail. +Conversions can still be performed by inserting the relevant conversion +filter (scale, aresample) in the graph. +On by default, to explicitly disable it you need to specify +-noauto_conversion_filters. +

+
+
-bits_per_raw_sample[:stream_specifier] value (output,per-stream)
+

Declare the number of bits per raw sample in the given output stream to be +value. Note that this option sets the information provided to the +encoder/muxer, it does not change the stream to conform to this value. Setting +values that do not match the stream properties may result in encoding failures +or invalid output files. +

+
+
-stats_enc_pre[:stream_specifier] path (output,per-stream)
+
-stats_enc_post[:stream_specifier] path (output,per-stream)
+
-stats_mux_pre[:stream_specifier] path (output,per-stream)
+

Write per-frame encoding information about the matching streams into the file +given by path. +

+

-stats_enc_pre writes information about raw video or audio frames right +before they are sent for encoding, while -stats_enc_post writes +information about encoded packets as they are received from the encoder. +-stats_mux_pre writes information about packets just as they are about to +be sent to the muxer. Every frame or packet produces one line in the specified +file. The format of this line is controlled by -stats_enc_pre_fmt / +-stats_enc_post_fmt / -stats_mux_pre_fmt. +

+

When stats for multiple streams are written into a single file, the lines +corresponding to different streams will be interleaved. The precise order of +this interleaving is not specified and not guaranteed to remain stable between +different invocations of the program, even with the same options. +

+
+
-stats_enc_pre_fmt[:stream_specifier] format_spec (output,per-stream)
+
-stats_enc_post_fmt[:stream_specifier] format_spec (output,per-stream)
+
-stats_mux_pre_fmt[:stream_specifier] format_spec (output,per-stream)
+

Specify the format for the lines written with -stats_enc_pre / +-stats_enc_post / -stats_mux_pre. +

+

format_spec is a string that may contain directives of the form +{fmt}. format_spec is backslash-escaped — use \{, \}, and \\ +to write a literal {, }, or \, respectively, into the output. +

+

The directives given with fmt may be one of the following: +

+
fidx
+

Index of the output file. +

+
+
sidx
+

Index of the output stream in the file. +

+
+
n
+

Frame number. Pre-encoding: number of frames sent to the encoder so far. +Post-encoding: number of packets received from the encoder so far. +Muxing: number of packets submitted to the muxer for this stream so far. +

+
+
ni
+

Input frame number. Index of the input frame (i.e. output by a decoder) that +corresponds to this output frame or packet. -1 if unavailable. +

+
+
tb
+

Encoder timebase, as a rational number num/den. Note that this may be +different from the timebase used by the muxer. +

+
+
tbi
+

Timebase for ptsi, as a rational number num/den. Available when +ptsi is available, 0/1 otherwise. +

+
+
pts
+

Presentation timestamp of the frame or packet, as an integer. Should be +multiplied by the timebase to compute presentation time. +

+
+
ptsi
+

Presentation timestamp of the input frame (see ni), as an integer. Should +be multiplied by tbi to compute presentation time. Printed as +(2^63 - 1 = 9223372036854775807) when not available. +

+
+
t
+

Presentation time of the frame or packet, as a decimal number. Equal to +pts multiplied by tb. +

+
+
ti
+

Presentation time of the input frame (see ni), as a decimal number. Equal +to ptsi multiplied by tbi. Printed as inf when not available. +

+
+
dts
+

Decoding timestamp of the packet, as an integer. Should be multiplied by the +timebase to compute presentation time. Post-encoding only. +

+
+
dt
+

Decoding time of the frame or packet, as a decimal number. Equal to +dts multiplied by tb. +

+
+
sn
+

Number of audio samples sent to the encoder so far. Audio and pre-encoding only. +

+
+
samp
+

Number of audio samples in the frame. Audio and pre-encoding only. +

+
+
size
+

Size of the encoded packet in bytes. Post-encoding only. +

+
+
br
+

Current bitrate in bits per second. Post-encoding only. +

+
+
abr
+

Average bitrate for the whole stream so far, in bits per second, -1 if it cannot +be determined at this point. Post-encoding only. +

+
+ +

The default format strings are: +

+
pre-encoding
+

{fidx} {sidx} {n} {t} +

+
post-encoding
+

{fidx} {sidx} {n} {t} +

+
+

In the future, new items may be added to the end of the default formatting +strings. Users who depend on the format staying exactly the same, should +prescribe it manually. +

+

Note that stats for different streams written into the same file may have +different formats. +

+
+
+ +
+
+

5.12 Preset files

+

A preset file contains a sequence of option=value pairs, +one for each line, specifying a sequence of options which would be +awkward to specify on the command line. Lines starting with the hash +(’#’) character are ignored and are used to provide comments. Check +the presets directory in the FFmpeg source tree for examples. +

+

There are two types of preset files: ffpreset and avpreset files. +

+ +
+

5.12.1 ffpreset files

+

ffpreset files are specified with the vpre, apre, +spre, and fpre options. The fpre option takes the +filename of the preset instead of a preset name as input and can be +used for any kind of codec. For the vpre, apre, and +spre options, the options specified in a preset file are +applied to the currently selected codec of the same type as the preset +option. +

+

The argument passed to the vpre, apre, and spre +preset options identifies the preset file to use according to the +following rules: +

+

First ffmpeg searches for a file named arg.ffpreset in the +directories $FFMPEG_DATADIR (if set), and $HOME/.ffmpeg, and in +the datadir defined at configuration time (usually PREFIX/share/ffmpeg) +or in a ffpresets folder along the executable on win32, +in that order. For example, if the argument is libvpx-1080p, it will +search for the file libvpx-1080p.ffpreset. +

+

If no such file is found, then ffmpeg will search for a file named +codec_name-arg.ffpreset in the above-mentioned +directories, where codec_name is the name of the codec to which +the preset file options will be applied. For example, if you select +the video codec with -vcodec libvpx and use -vpre 1080p, +then it will search for the file libvpx-1080p.ffpreset. +

+
+
+

5.12.2 avpreset files

+

avpreset files are specified with the pre option. They work similar to +ffpreset files, but they only allow encoder- specific options. Therefore, an +option=value pair specifying an encoder cannot be used. +

+

When the pre option is specified, ffmpeg will look for files with the +suffix .avpreset in the directories $AVCONV_DATADIR (if set), and +$HOME/.avconv, and in the datadir defined at configuration time (usually +PREFIX/share/ffmpeg), in that order. +

+

First ffmpeg searches for a file named codec_name-arg.avpreset in +the above-mentioned directories, where codec_name is the name of the codec +to which the preset file options will be applied. For example, if you select the +video codec with -vcodec libvpx and use -pre 1080p, then it will +search for the file libvpx-1080p.avpreset. +

+

If no such file is found, then ffmpeg will search for a file named +arg.avpreset in the same directories. +

+
+
+
+

5.13 vstats file format

+

The -vstats and -vstats_file options enable generation of a file +containing statistics about the generated video outputs. +

+

The -vstats_version option controls the format version of the generated +file. +

+

With version 1 the format is: +

+
frame= FRAME q= FRAME_QUALITY PSNR= PSNR f_size= FRAME_SIZE s_size= STREAM_SIZEkB time= TIMESTAMP br= BITRATEkbits/s avg_br= AVERAGE_BITRATEkbits/s
+
+ +

With version 2 the format is: +

+
out= OUT_FILE_INDEX st= OUT_FILE_STREAM_INDEX frame= FRAME_NUMBER q= FRAME_QUALITYf PSNR= PSNR f_size= FRAME_SIZE s_size= STREAM_SIZEkB time= TIMESTAMP br= BITRATEkbits/s avg_br= AVERAGE_BITRATEkbits/s
+
+ +

The value corresponding to each key is described below: +

+
avg_br
+

average bitrate expressed in Kbits/s +

+
+
br
+

bitrate expressed in Kbits/s +

+
+
frame
+

number of encoded frame +

+
+
out
+

out file index +

+
+
PSNR
+

Peak Signal to Noise Ratio +

+
+
q
+

quality of the frame +

+
+
f_size
+

encoded packet size expressed as number of bytes +

+
+
s_size
+

stream size expressed in KiB +

+
+
st
+

out file stream index +

+
+
time
+

time of the packet +

+
+
type
+

picture type +

+
+ +

See also the -stats_enc options for an alternative way +to show encoding statistics. +

+ +
+
+
+

6 Examples

+ + +
+

6.1 Video and Audio grabbing

+ +

If you specify the input format and device then ffmpeg can grab video +and audio directly. +

+
+
ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
+
+ +

Or with an ALSA audio source (mono input, card id 1) instead of OSS: +

+
ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
+
+ +

Note that you must activate the right video source and channel before +launching ffmpeg with any TV viewer such as +xawtv by Gerd Knorr. You also +have to set the audio recording levels correctly with a +standard mixer. +

+
+
+

6.2 X11 grabbing

+ +

Grab the X11 display with ffmpeg via +

+
+
ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0 /tmp/out.mpg
+
+ +

0.0 is display.screen number of your X11 server, same as +the DISPLAY environment variable. +

+
+
ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg
+
+ +

0.0 is display.screen number of your X11 server, same as the DISPLAY environment +variable. 10 is the x-offset and 20 the y-offset for the grabbing. +

+
+
+

6.3 Video and Audio file format conversion

+ +

Any supported file format and protocol can serve as input to ffmpeg: +

+

Examples: +

    +
  • You can use YUV files as input: + +
    +
    ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
    +
    + +

    It will use the files: +

    +
    /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
    +/tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
    +
    + +

    The Y files use twice the resolution of the U and V files. They are +raw files, without header. They can be generated by all decent video +decoders. You must specify the size of the image with the -s option +if ffmpeg cannot guess it. +

    +
  • You can input from a raw YUV420P file: + +
    +
    ffmpeg -i /tmp/test.yuv /tmp/out.avi
    +
    + +

    test.yuv is a file containing raw YUV planar data. Each frame is composed +of the Y plane followed by the U and V planes at half vertical and +horizontal resolution. +

    +
  • You can output to a raw YUV420P file: + +
    +
    ffmpeg -i mydivx.avi hugefile.yuv
    +
    + +
  • You can set several input files and output files: + +
    +
    ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
    +
    + +

    Converts the audio file a.wav and the raw YUV video file a.yuv +to MPEG file a.mpg. +

    +
  • You can also do audio and video conversions at the same time: + +
    +
    ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
    +
    + +

    Converts a.wav to MPEG audio at 22050 Hz sample rate. +

    +
  • You can encode to several formats at the same time and define a +mapping from input stream to output streams: + +
    +
    ffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2
    +
    + +

    Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. ’-map +file:index’ specifies which input stream is used for each output +stream, in the order of the definition of output streams. +

    +
  • You can transcode decrypted VOBs: + +
    +
    ffmpeg -i snatch_1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi
    +
    + +

    This is a typical DVD ripping example; the input is a VOB file, the +output an AVI file with MPEG-4 video and MP3 audio. Note that in this +command we use B-frames so the MPEG-4 stream is DivX5 compatible, and +GOP size is 300 which means one intra frame every 10 seconds for 29.97fps +input video. Furthermore, the audio stream is MP3-encoded so you need +to enable LAME support by passing --enable-libmp3lame to configure. +The mapping is particularly useful for DVD transcoding +to get the desired audio language. +

    +

    NOTE: To see the supported input formats, use ffmpeg -demuxers. +

    +
  • You can extract images from a video, or create a video from many images: + +

    For extracting images from a video: +

    +
    ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
    +
    + +

    This will extract one video frame per second from the video and will +output them in files named foo-001.jpeg, foo-002.jpeg, +etc. Images will be rescaled to fit the new WxH values. +

    +

    If you want to extract just a limited number of frames, you can use the +above command in combination with the -frames:v or -t option, +or in combination with -ss to start extracting from a certain point in time. +

    +

    For creating a video from many images: +

    +
    ffmpeg -f image2 -framerate 12 -i foo-%03d.jpeg -s WxH foo.avi
    +
    + +

    The syntax foo-%03d.jpeg specifies to use a decimal number +composed of three digits padded with zeroes to express the sequence +number. It is the same syntax supported by the C printf function, but +only formats accepting a normal integer are suitable. +

    +

    When importing an image sequence, -i also supports expanding +shell-like wildcard patterns (globbing) internally, by selecting the +image2-specific -pattern_type glob option. +

    +

    For example, for creating a video from filenames matching the glob pattern +foo-*.jpeg: +

    +
    ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi
    +
    + +
  • You can put many streams of the same type in the output: + +
    +
    ffmpeg -i test1.avi -i test2.avi -map 1:1 -map 1:0 -map 0:1 -map 0:0 -c copy -y test12.nut
    +
    + +

    The resulting output file test12.nut will contain the first four streams +from the input files in reverse order. +

    +
  • To force CBR video output: +
    +
    ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
    +
    + +
  • The four options lmin, lmax, mblmin and mblmax use ’lambda’ units, +but you may use the QP2LAMBDA constant to easily convert from ’q’ units: +
    +
    ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
    +
    + +
+ +
+
+
+

7 Syntax

+ +

This section documents the syntax and formats employed by the FFmpeg +libraries and tools. +

+ +
+

7.1 Quoting and escaping

+ +

FFmpeg adopts the following quoting and escaping mechanism, unless +explicitly specified. The following rules are applied: +

+
    +
  • '’ and ‘\’ are special characters (respectively used for +quoting and escaping). In addition to them, there might be other +special characters depending on the specific syntax where the escaping +and quoting are employed. + +
  • A special character is escaped by prefixing it with a ‘\’. + +
  • All characters enclosed between ‘''’ are included literally in the +parsed string. The quote character ‘'’ itself cannot be quoted, +so you may need to close the quote and escape it. + +
  • Leading and trailing whitespaces, unless escaped or quoted, are +removed from the parsed string. +
+ +

Note that you may need to add a second level of escaping when using +the command line or a script, which depends on the syntax of the +adopted shell language. +

+

The function av_get_token defined in +libavutil/avstring.h can be used to parse a token quoted or +escaped according to the rules defined above. +

+

The tool tools/ffescape in the FFmpeg source tree can be used +to automatically quote or escape a string in a script. +

+ +
+

7.1.1 Examples

+ +
    +
  • Escape the string Crime d'Amour containing the ' special +character: +
    +
    Crime d\'Amour
    +
    + +
  • The string above contains a quote, so the ' needs to be escaped +when quoting it: +
    +
    'Crime d'\''Amour'
    +
    + +
  • Include leading or trailing whitespaces using quoting: +
    +
    '  this string starts and ends with whitespaces  '
    +
    + +
  • Escaping and quoting can be mixed together: +
    +
    ' The string '\'string\'' is a string '
    +
    + +
  • To include a literal ‘\’ you can use either escaping or quoting: +
    +
    'c:\foo' can be written as c:\\foo
    +
    +
+ +
+
+
+

7.2 Date

+ +

The accepted syntax is: +

+
[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
+now
+
+ +

If the value is "now" it takes the current time. +

+

Time is local time unless Z is appended, in which case it is +interpreted as UTC. +If the year-month-day part is not specified it takes the current +year-month-day. +

+
+
+

7.3 Time duration

+ +

There are two accepted syntaxes for expressing time duration. +

+
+
[-][HH:]MM:SS[.m...]
+
+ +

HH expresses the number of hours, MM the number of minutes +for a maximum of 2 digits, and SS the number of seconds for a +maximum of 2 digits. The m at the end expresses decimal value for +SS. +

+

or +

+
+
[-]S+[.m...][s|ms|us]
+
+ +

S expresses the number of seconds, with the optional decimal part +m. The optional literal suffixes ‘s’, ‘ms’ or ‘us’ +indicate to interpret the value as seconds, milliseconds or microseconds, +respectively. +

+

In both expressions, the optional ‘-’ indicates negative duration. +

+ +
+

7.3.1 Examples

+ +

The following examples are all valid time duration: +

+
+
55
+

55 seconds +

+
+
0.2
+

0.2 seconds +

+
+
200ms
+

200 milliseconds, that’s 0.2s +

+
+
200000us
+

200000 microseconds, that’s 0.2s +

+
+
12:03:45
+

12 hours, 03 minutes and 45 seconds +

+
+
23.189
+

23.189 seconds +

+
+ +
+
+
+

7.4 Video size

+

Specify the size of the sourced video, it may be a string of the form +widthxheight, or the name of a size abbreviation. +

+

The following abbreviations are recognized: +

+
ntsc
+

720x480 +

+
pal
+

720x576 +

+
qntsc
+

352x240 +

+
qpal
+

352x288 +

+
sntsc
+

640x480 +

+
spal
+

768x576 +

+
film
+

352x240 +

+
ntsc-film
+

352x240 +

+
sqcif
+

128x96 +

+
qcif
+

176x144 +

+
cif
+

352x288 +

+
4cif
+

704x576 +

+
16cif
+

1408x1152 +

+
qqvga
+

160x120 +

+
qvga
+

320x240 +

+
vga
+

640x480 +

+
svga
+

800x600 +

+
xga
+

1024x768 +

+
uxga
+

1600x1200 +

+
qxga
+

2048x1536 +

+
sxga
+

1280x1024 +

+
qsxga
+

2560x2048 +

+
hsxga
+

5120x4096 +

+
wvga
+

852x480 +

+
wxga
+

1366x768 +

+
wsxga
+

1600x1024 +

+
wuxga
+

1920x1200 +

+
woxga
+

2560x1600 +

+
wqsxga
+

3200x2048 +

+
wquxga
+

3840x2400 +

+
whsxga
+

6400x4096 +

+
whuxga
+

7680x4800 +

+
cga
+

320x200 +

+
ega
+

640x350 +

+
hd480
+

852x480 +

+
hd720
+

1280x720 +

+
hd1080
+

1920x1080 +

+
2k
+

2048x1080 +

+
2kflat
+

1998x1080 +

+
2kscope
+

2048x858 +

+
4k
+

4096x2160 +

+
4kflat
+

3996x2160 +

+
4kscope
+

4096x1716 +

+
nhd
+

640x360 +

+
hqvga
+

240x160 +

+
wqvga
+

400x240 +

+
fwqvga
+

432x240 +

+
hvga
+

480x320 +

+
qhd
+

960x540 +

+
2kdci
+

2048x1080 +

+
4kdci
+

4096x2160 +

+
uhd2160
+

3840x2160 +

+
uhd4320
+

7680x4320 +

+
+ +
+
+

7.5 Video rate

+ +

Specify the frame rate of a video, expressed as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a float +number or a valid video frame rate abbreviation. +

+

The following abbreviations are recognized: +

+
ntsc
+

30000/1001 +

+
pal
+

25/1 +

+
qntsc
+

30000/1001 +

+
qpal
+

25/1 +

+
sntsc
+

30000/1001 +

+
spal
+

25/1 +

+
film
+

24/1 +

+
ntsc-film
+

24000/1001 +

+
+ +
+
+

7.6 Ratio

+ +

A ratio can be expressed as an expression, or in the form +numerator:denominator. +

+

Note that a ratio with infinite (1/0) or negative value is +considered valid, so you should check on the returned value if you +want to exclude those values. +

+

The undefined value can be expressed using the "0:0" string. +

+
+
+

7.7 Color

+ +

It can be the name of a color as defined below (case insensitive match) or a +[0x|#]RRGGBB[AA] sequence, possibly followed by @ and a string +representing the alpha component. +

+

The alpha component may be a string composed by "0x" followed by an +hexadecimal number or a decimal number between 0.0 and 1.0, which +represents the opacity value (‘0x00’ or ‘0.0’ means completely +transparent, ‘0xff’ or ‘1.0’ completely opaque). If the alpha +component is not specified then ‘0xff’ is assumed. +

+

The string ‘random’ will result in a random color. +

+

The following names of colors are recognized: +

+
AliceBlue
+

0xF0F8FF +

+
AntiqueWhite
+

0xFAEBD7 +

+
Aqua
+

0x00FFFF +

+
Aquamarine
+

0x7FFFD4 +

+
Azure
+

0xF0FFFF +

+
Beige
+

0xF5F5DC +

+
Bisque
+

0xFFE4C4 +

+
Black
+

0x000000 +

+
BlanchedAlmond
+

0xFFEBCD +

+
Blue
+

0x0000FF +

+
BlueViolet
+

0x8A2BE2 +

+
Brown
+

0xA52A2A +

+
BurlyWood
+

0xDEB887 +

+
CadetBlue
+

0x5F9EA0 +

+
Chartreuse
+

0x7FFF00 +

+
Chocolate
+

0xD2691E +

+
Coral
+

0xFF7F50 +

+
CornflowerBlue
+

0x6495ED +

+
Cornsilk
+

0xFFF8DC +

+
Crimson
+

0xDC143C +

+
Cyan
+

0x00FFFF +

+
DarkBlue
+

0x00008B +

+
DarkCyan
+

0x008B8B +

+
DarkGoldenRod
+

0xB8860B +

+
DarkGray
+

0xA9A9A9 +

+
DarkGreen
+

0x006400 +

+
DarkKhaki
+

0xBDB76B +

+
DarkMagenta
+

0x8B008B +

+
DarkOliveGreen
+

0x556B2F +

+
Darkorange
+

0xFF8C00 +

+
DarkOrchid
+

0x9932CC +

+
DarkRed
+

0x8B0000 +

+
DarkSalmon
+

0xE9967A +

+
DarkSeaGreen
+

0x8FBC8F +

+
DarkSlateBlue
+

0x483D8B +

+
DarkSlateGray
+

0x2F4F4F +

+
DarkTurquoise
+

0x00CED1 +

+
DarkViolet
+

0x9400D3 +

+
DeepPink
+

0xFF1493 +

+
DeepSkyBlue
+

0x00BFFF +

+
DimGray
+

0x696969 +

+
DodgerBlue
+

0x1E90FF +

+
FireBrick
+

0xB22222 +

+
FloralWhite
+

0xFFFAF0 +

+
ForestGreen
+

0x228B22 +

+
Fuchsia
+

0xFF00FF +

+
Gainsboro
+

0xDCDCDC +

+
GhostWhite
+

0xF8F8FF +

+
Gold
+

0xFFD700 +

+
GoldenRod
+

0xDAA520 +

+
Gray
+

0x808080 +

+
Green
+

0x008000 +

+
GreenYellow
+

0xADFF2F +

+
HoneyDew
+

0xF0FFF0 +

+
HotPink
+

0xFF69B4 +

+
IndianRed
+

0xCD5C5C +

+
Indigo
+

0x4B0082 +

+
Ivory
+

0xFFFFF0 +

+
Khaki
+

0xF0E68C +

+
Lavender
+

0xE6E6FA +

+
LavenderBlush
+

0xFFF0F5 +

+
LawnGreen
+

0x7CFC00 +

+
LemonChiffon
+

0xFFFACD +

+
LightBlue
+

0xADD8E6 +

+
LightCoral
+

0xF08080 +

+
LightCyan
+

0xE0FFFF +

+
LightGoldenRodYellow
+

0xFAFAD2 +

+
LightGreen
+

0x90EE90 +

+
LightGrey
+

0xD3D3D3 +

+
LightPink
+

0xFFB6C1 +

+
LightSalmon
+

0xFFA07A +

+
LightSeaGreen
+

0x20B2AA +

+
LightSkyBlue
+

0x87CEFA +

+
LightSlateGray
+

0x778899 +

+
LightSteelBlue
+

0xB0C4DE +

+
LightYellow
+

0xFFFFE0 +

+
Lime
+

0x00FF00 +

+
LimeGreen
+

0x32CD32 +

+
Linen
+

0xFAF0E6 +

+
Magenta
+

0xFF00FF +

+
Maroon
+

0x800000 +

+
MediumAquaMarine
+

0x66CDAA +

+
MediumBlue
+

0x0000CD +

+
MediumOrchid
+

0xBA55D3 +

+
MediumPurple
+

0x9370D8 +

+
MediumSeaGreen
+

0x3CB371 +

+
MediumSlateBlue
+

0x7B68EE +

+
MediumSpringGreen
+

0x00FA9A +

+
MediumTurquoise
+

0x48D1CC +

+
MediumVioletRed
+

0xC71585 +

+
MidnightBlue
+

0x191970 +

+
MintCream
+

0xF5FFFA +

+
MistyRose
+

0xFFE4E1 +

+
Moccasin
+

0xFFE4B5 +

+
NavajoWhite
+

0xFFDEAD +

+
Navy
+

0x000080 +

+
OldLace
+

0xFDF5E6 +

+
Olive
+

0x808000 +

+
OliveDrab
+

0x6B8E23 +

+
Orange
+

0xFFA500 +

+
OrangeRed
+

0xFF4500 +

+
Orchid
+

0xDA70D6 +

+
PaleGoldenRod
+

0xEEE8AA +

+
PaleGreen
+

0x98FB98 +

+
PaleTurquoise
+

0xAFEEEE +

+
PaleVioletRed
+

0xD87093 +

+
PapayaWhip
+

0xFFEFD5 +

+
PeachPuff
+

0xFFDAB9 +

+
Peru
+

0xCD853F +

+
Pink
+

0xFFC0CB +

+
Plum
+

0xDDA0DD +

+
PowderBlue
+

0xB0E0E6 +

+
Purple
+

0x800080 +

+
Red
+

0xFF0000 +

+
RosyBrown
+

0xBC8F8F +

+
RoyalBlue
+

0x4169E1 +

+
SaddleBrown
+

0x8B4513 +

+
Salmon
+

0xFA8072 +

+
SandyBrown
+

0xF4A460 +

+
SeaGreen
+

0x2E8B57 +

+
SeaShell
+

0xFFF5EE +

+
Sienna
+

0xA0522D +

+
Silver
+

0xC0C0C0 +

+
SkyBlue
+

0x87CEEB +

+
SlateBlue
+

0x6A5ACD +

+
SlateGray
+

0x708090 +

+
Snow
+

0xFFFAFA +

+
SpringGreen
+

0x00FF7F +

+
SteelBlue
+

0x4682B4 +

+
Tan
+

0xD2B48C +

+
Teal
+

0x008080 +

+
Thistle
+

0xD8BFD8 +

+
Tomato
+

0xFF6347 +

+
Turquoise
+

0x40E0D0 +

+
Violet
+

0xEE82EE +

+
Wheat
+

0xF5DEB3 +

+
White
+

0xFFFFFF +

+
WhiteSmoke
+

0xF5F5F5 +

+
Yellow
+

0xFFFF00 +

+
YellowGreen
+

0x9ACD32 +

+
+ +
+
+

7.8 Channel Layout

+ +

A channel layout specifies the spatial disposition of the channels in +a multi-channel audio stream. To specify a channel layout, FFmpeg +makes use of a special syntax. +

+

Individual channels are identified by an id, as given by the table +below: +

+
FL
+

front left +

+
FR
+

front right +

+
FC
+

front center +

+
LFE
+

low frequency +

+
BL
+

back left +

+
BR
+

back right +

+
FLC
+

front left-of-center +

+
FRC
+

front right-of-center +

+
BC
+

back center +

+
SL
+

side left +

+
SR
+

side right +

+
TC
+

top center +

+
TFL
+

top front left +

+
TFC
+

top front center +

+
TFR
+

top front right +

+
TBL
+

top back left +

+
TBC
+

top back center +

+
TBR
+

top back right +

+
DL
+

downmix left +

+
DR
+

downmix right +

+
WL
+

wide left +

+
WR
+

wide right +

+
SDL
+

surround direct left +

+
SDR
+

surround direct right +

+
LFE2
+

low frequency 2 +

+
+ +

Standard channel layout compositions can be specified by using the +following identifiers: +

+
mono
+

FC +

+
stereo
+

FL+FR +

+
2.1
+

FL+FR+LFE +

+
3.0
+

FL+FR+FC +

+
3.0(back)
+

FL+FR+BC +

+
4.0
+

FL+FR+FC+BC +

+
quad
+

FL+FR+BL+BR +

+
quad(side)
+

FL+FR+SL+SR +

+
3.1
+

FL+FR+FC+LFE +

+
5.0
+

FL+FR+FC+BL+BR +

+
5.0(side)
+

FL+FR+FC+SL+SR +

+
4.1
+

FL+FR+FC+LFE+BC +

+
5.1
+

FL+FR+FC+LFE+BL+BR +

+
5.1(side)
+

FL+FR+FC+LFE+SL+SR +

+
6.0
+

FL+FR+FC+BC+SL+SR +

+
6.0(front)
+

FL+FR+FLC+FRC+SL+SR +

+
hexagonal
+

FL+FR+FC+BL+BR+BC +

+
6.1
+

FL+FR+FC+LFE+BC+SL+SR +

+
6.1
+

FL+FR+FC+LFE+BL+BR+BC +

+
6.1(front)
+

FL+FR+LFE+FLC+FRC+SL+SR +

+
7.0
+

FL+FR+FC+BL+BR+SL+SR +

+
7.0(front)
+

FL+FR+FC+FLC+FRC+SL+SR +

+
7.1
+

FL+FR+FC+LFE+BL+BR+SL+SR +

+
7.1(wide)
+

FL+FR+FC+LFE+BL+BR+FLC+FRC +

+
7.1(wide-side)
+

FL+FR+FC+LFE+FLC+FRC+SL+SR +

+
7.1(top)
+

FL+FR+FC+LFE+BL+BR+TFL+TFR +

+
octagonal
+

FL+FR+FC+BL+BR+BC+SL+SR +

+
cube
+

FL+FR+BL+BR+TFL+TFR+TBL+TBR +

+
hexadecagonal
+

FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR +

+
downmix
+

DL+DR +

+
22.2
+

FL+FR+FC+LFE+BL+BR+FLC+FRC+BC+SL+SR+TC+TFL+TFC+TFR+TBL+TBC+TBR+LFE2+TSL+TSR+BFC+BFL+BFR +

+
+ +

A custom channel layout can be specified as a sequence of terms, separated by ’+’. +Each term can be: +

    +
  • the name of a single channel (e.g. ‘FL’, ‘FR’, ‘FC’, ‘LFE’, etc.), +each optionally containing a custom name after a ’@’, (e.g. ‘FL@Left’, +‘FR@Right’, ‘FC@Center’, ‘LFE@Low_Frequency’, etc.) +
+ +

A standard channel layout can be specified by the following: +

    +
  • the name of a single channel (e.g. ‘FL’, ‘FR’, ‘FC’, ‘LFE’, etc.) + +
  • the name of a standard channel layout (e.g. ‘mono’, +‘stereo’, ‘4.0’, ‘quad’, ‘5.0’, etc.) + +
  • a number of channels, in decimal, followed by ’c’, yielding the default channel +layout for that number of channels (see the function +av_channel_layout_default). Note that not all channel counts have a +default layout. + +
  • a number of channels, in decimal, followed by ’C’, yielding an unknown channel +layout with the specified number of channels. Note that not all channel layout +specification strings support unknown channel layouts. + +
  • a channel layout mask, in hexadecimal starting with "0x" (see the +AV_CH_* macros in libavutil/channel_layout.h. +
+ +

Before libavutil version 53 the trailing character "c" to specify a number of +channels was optional, but now it is required, while a channel layout mask can +also be specified as a decimal number (if and only if not followed by "c" or "C"). +

+

See also the function av_channel_layout_from_string defined in +libavutil/channel_layout.h. +

+
+
+
+

8 Expression Evaluation

+ +

When evaluating an arithmetic expression, FFmpeg uses an internal +formula evaluator, implemented through the libavutil/eval.h +interface. +

+

An expression may contain unary, binary operators, constants, and +functions. +

+

Two expressions expr1 and expr2 can be combined to form +another expression "expr1;expr2". +expr1 and expr2 are evaluated in turn, and the new +expression evaluates to the value of expr2. +

+

The following binary operators are available: +, -, +*, /, ^. +

+

The following unary operators are available: +, -. +

+

The following functions are available: +

+
abs(x)
+

Compute absolute value of x. +

+
+
acos(x)
+

Compute arccosine of x. +

+
+
asin(x)
+

Compute arcsine of x. +

+
+
atan(x)
+

Compute arctangent of x. +

+
+
atan2(x, y)
+

Compute principal value of the arc tangent of y/x. +

+
+
between(x, min, max)
+

Return 1 if x is greater than or equal to min and lesser than or +equal to max, 0 otherwise. +

+
+
bitand(x, y)
+
bitor(x, y)
+

Compute bitwise and/or operation on x and y. +

+

The results of the evaluation of x and y are converted to +integers before executing the bitwise operation. +

+

Note that both the conversion to integer and the conversion back to +floating point can lose precision. Beware of unexpected results for +large numbers (usually 2^53 and larger). +

+
+
ceil(expr)
+

Round the value of expression expr upwards to the nearest +integer. For example, "ceil(1.5)" is "2.0". +

+
+
clip(x, min, max)
+

Return the value of x clipped between min and max. +

+
+
cos(x)
+

Compute cosine of x. +

+
+
cosh(x)
+

Compute hyperbolic cosine of x. +

+
+
eq(x, y)
+

Return 1 if x and y are equivalent, 0 otherwise. +

+
+
exp(x)
+

Compute exponential of x (with base e, the Euler’s number). +

+
+
floor(expr)
+

Round the value of expression expr downwards to the nearest +integer. For example, "floor(-1.5)" is "-2.0". +

+
+
gauss(x)
+

Compute Gauss function of x, corresponding to +exp(-x*x/2) / sqrt(2*PI). +

+
+
gcd(x, y)
+

Return the greatest common divisor of x and y. If both x and +y are 0 or either or both are less than zero then behavior is undefined. +

+
+
gt(x, y)
+

Return 1 if x is greater than y, 0 otherwise. +

+
+
gte(x, y)
+

Return 1 if x is greater than or equal to y, 0 otherwise. +

+
+
hypot(x, y)
+

This function is similar to the C function with the same name; it returns +"sqrt(x*x + y*y)", the length of the hypotenuse of a +right triangle with sides of length x and y, or the distance of the +point (x, y) from the origin. +

+
+
if(x, y)
+

Evaluate x, and if the result is non-zero return the result of +the evaluation of y, return 0 otherwise. +

+
+
if(x, y, z)
+

Evaluate x, and if the result is non-zero return the evaluation +result of y, otherwise the evaluation result of z. +

+
+
ifnot(x, y)
+

Evaluate x, and if the result is zero return the result of the +evaluation of y, return 0 otherwise. +

+
+
ifnot(x, y, z)
+

Evaluate x, and if the result is zero return the evaluation +result of y, otherwise the evaluation result of z. +

+
+
isinf(x)
+

Return 1.0 if x is +/-INFINITY, 0.0 otherwise. +

+
+
isnan(x)
+

Return 1.0 if x is NAN, 0.0 otherwise. +

+
+
ld(var)
+

Load the value of the internal variable with number +var, which was previously stored with st(var, expr). +The function returns the loaded value. +

+
+
lerp(x, y, z)
+

Return linear interpolation between x and y by amount of z. +

+
+
log(x)
+

Compute natural logarithm of x. +

+
+
lt(x, y)
+

Return 1 if x is lesser than y, 0 otherwise. +

+
+
lte(x, y)
+

Return 1 if x is lesser than or equal to y, 0 otherwise. +

+
+
max(x, y)
+

Return the maximum between x and y. +

+
+
min(x, y)
+

Return the minimum between x and y. +

+
+
mod(x, y)
+

Compute the remainder of division of x by y. +

+
+
not(expr)
+

Return 1.0 if expr is zero, 0.0 otherwise. +

+
+
pow(x, y)
+

Compute the power of x elevated y, it is equivalent to +"(x)^(y)". +

+
+
print(t)
+
print(t, l)
+

Print the value of expression t with loglevel l. If +l is not specified then a default log level is used. +Returns the value of the expression printed. +

+

Prints t with loglevel l +

+
+
random(x)
+

Return a pseudo random value between 0.0 and 1.0. x is the index of the +internal variable which will be used to save the seed/state. +

+
+
root(expr, max)
+

Find an input value for which the function represented by expr +with argument ld(0) is 0 in the interval 0..max. +

+

The expression in expr must denote a continuous function or the +result is undefined. +

+

ld(0) is used to represent the function input value, which means +that the given expression will be evaluated multiple times with +various input values that the expression can access through +ld(0). When the expression evaluates to 0 then the +corresponding input value will be returned. +

+
+
round(expr)
+

Round the value of expression expr to the nearest integer. For example, "round(1.5)" is "2.0". +

+
+
sgn(x)
+

Compute sign of x. +

+
+
sin(x)
+

Compute sine of x. +

+
+
sinh(x)
+

Compute hyperbolic sine of x. +

+
+
sqrt(expr)
+

Compute the square root of expr. This is equivalent to +"(expr)^.5". +

+
+
squish(x)
+

Compute expression 1/(1 + exp(4*x)). +

+
+
st(var, expr)
+

Store the value of the expression expr in an internal +variable. var specifies the number of the variable where to +store the value, and it is a value ranging from 0 to 9. The function +returns the value stored in the internal variable. +Note, Variables are currently not shared between expressions. +

+
+
tan(x)
+

Compute tangent of x. +

+
+
tanh(x)
+

Compute hyperbolic tangent of x. +

+
+
taylor(expr, x)
+
taylor(expr, x, id)
+

Evaluate a Taylor series at x, given an expression representing +the ld(id)-th derivative of a function at 0. +

+

When the series does not converge the result is undefined. +

+

ld(id) is used to represent the derivative order in expr, +which means that the given expression will be evaluated multiple times +with various input values that the expression can access through +ld(id). If id is not specified then 0 is assumed. +

+

Note, when you have the derivatives at y instead of 0, +taylor(expr, x-y) can be used. +

+
+
time(0)
+

Return the current (wallclock) time in seconds. +

+
+
trunc(expr)
+

Round the value of expression expr towards zero to the nearest +integer. For example, "trunc(-1.5)" is "-1.0". +

+
+
while(cond, expr)
+

Evaluate expression expr while the expression cond is +non-zero, and returns the value of the last expr evaluation, or +NAN if cond was always false. +

+
+ +

The following constants are available: +

+
PI
+

area of the unit disc, approximately 3.14 +

+
E
+

exp(1) (Euler’s number), approximately 2.718 +

+
PHI
+

golden ratio (1+sqrt(5))/2, approximately 1.618 +

+
+ +

Assuming that an expression is considered "true" if it has a non-zero +value, note that: +

+

* works like AND +

+

+ works like OR +

+

For example the construct: +

+
if (A AND B) then C
+
+

is equivalent to: +

+
if(A*B, C)
+
+ +

In your C code, you can extend the list of unary and binary functions, +and define recognized constants, so that they are available for your +expressions. +

+

The evaluator also recognizes the International System unit prefixes. +If ’i’ is appended after the prefix, binary prefixes are used, which +are based on powers of 1024 instead of powers of 1000. +The ’B’ postfix multiplies the value by 8, and can be appended after a +unit prefix or used alone. This allows using for example ’KB’, ’MiB’, +’G’ and ’B’ as number postfix. +

+

The list of available International System prefixes follows, with +indication of the corresponding powers of 10 and of 2. +

+
y
+

10^-24 / 2^-80 +

+
z
+

10^-21 / 2^-70 +

+
a
+

10^-18 / 2^-60 +

+
f
+

10^-15 / 2^-50 +

+
p
+

10^-12 / 2^-40 +

+
n
+

10^-9 / 2^-30 +

+
u
+

10^-6 / 2^-20 +

+
m
+

10^-3 / 2^-10 +

+
c
+

10^-2 +

+
d
+

10^-1 +

+
h
+

10^2 +

+
k
+

10^3 / 2^10 +

+
K
+

10^3 / 2^10 +

+
M
+

10^6 / 2^20 +

+
G
+

10^9 / 2^30 +

+
T
+

10^12 / 2^40 +

+
P
+

10^15 / 2^50 +

+
E
+

10^18 / 2^60 +

+
Z
+

10^21 / 2^70 +

+
Y
+

10^24 / 2^80 +

+
+ +
+
+

9 Codec Options

+ +

libavcodec provides some generic global options, which can be set on +all the encoders and decoders. In addition each codec may support +so-called private options, which are specific for a given codec. +

+

Sometimes, a global option may only affect a specific kind of codec, +and may be nonsensical or ignored by another, so you need to be aware +of the meaning of the specified options. Also some options are +meant only for decoding or encoding. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the +AVCodecContext options or using the libavutil/opt.h API +for programmatic use. +

+

The list of supported options follow: +

+
+
b integer (encoding,audio,video)
+

Set bitrate in bits/s. Default value is 200K. +

+
+
ab integer (encoding,audio)
+

Set audio bitrate (in bits/s). Default value is 128K. +

+
+
bt integer (encoding,video)
+

Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate +tolerance specifies how far ratecontrol is willing to deviate from the +target average bitrate value. This is not related to min/max +bitrate. Lowering tolerance too much has an adverse effect on quality. +

+
+
flags flags (decoding/encoding,audio,video,subtitles)
+

Set generic flags. +

+

Possible values: +

+
mv4
+

Use four motion vector by macroblock (mpeg4). +

+
qpel
+

Use 1/4 pel motion compensation. +

+
loop
+

Use loop filter. +

+
qscale
+

Use fixed qscale. +

+
pass1
+

Use internal 2pass ratecontrol in first pass mode. +

+
pass2
+

Use internal 2pass ratecontrol in second pass mode. +

+
gray
+

Only decode/encode grayscale. +

+
psnr
+

Set error[?] variables during encoding. +

+
truncated
+

Input bitstream might be randomly truncated. +

+
drop_changed
+

Don’t output frames whose parameters differ from first decoded frame in stream. +Error AVERROR_INPUT_CHANGED is returned when a frame is dropped. +

+
+
ildct
+

Use interlaced DCT. +

+
low_delay
+

Force low delay. +

+
global_header
+

Place global headers in extradata instead of every keyframe. +

+
bitexact
+

Only write platform-, build- and time-independent data. (except (I)DCT). +This ensures that file and data checksums are reproducible and match between +platforms. Its primary use is for regression testing. +

+
aic
+

Apply H263 advanced intra coding / mpeg4 ac prediction. +

+
ilme
+

Apply interlaced motion estimation. +

+
cgop
+

Use closed gop. +

+
output_corrupt
+

Output even potentially corrupted frames. +

+
+ +
+
time_base rational number
+

Set codec time base. +

+

It is the fundamental unit of time (in seconds) in terms of which +frame timestamps are represented. For fixed-fps content, timebase +should be 1 / frame_rate and timestamp increments should be +identically 1. +

+
+
g integer (encoding,video)
+

Set the group of picture (GOP) size. Default value is 12. +

+
+
ar integer (decoding/encoding,audio)
+

Set audio sampling rate (in Hz). +

+
+
ac integer (decoding/encoding,audio)
+

Set number of audio channels. +

+
+
cutoff integer (encoding,audio)
+

Set cutoff bandwidth. (Supported only by selected encoders, see +their respective documentation sections.) +

+
+
frame_size integer (encoding,audio)
+

Set audio frame size. +

+

Each submitted frame except the last must contain exactly frame_size +samples per channel. May be 0 when the codec has +CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not +restricted. It is set by some decoders to indicate constant frame +size. +

+
+
frame_number integer
+

Set the frame number. +

+
+
delay integer
+
qcomp float (encoding,video)
+

Set video quantizer scale compression (VBR). It is used as a constant +in the ratecontrol equation. Recommended range for default rc_eq: +0.0-1.0. +

+
+
qblur float (encoding,video)
+

Set video quantizer scale blur (VBR). +

+
+
qmin integer (encoding,video)
+

Set min video quantizer scale (VBR). Must be included between -1 and +69, default value is 2. +

+
+
qmax integer (encoding,video)
+

Set max video quantizer scale (VBR). Must be included between -1 and +1024, default value is 31. +

+
+
qdiff integer (encoding,video)
+

Set max difference between the quantizer scale (VBR). +

+
+
bf integer (encoding,video)
+

Set max number of B frames between non-B-frames. +

+

Must be an integer between -1 and 16. 0 means that B-frames are +disabled. If a value of -1 is used, it will choose an automatic value +depending on the encoder. +

+

Default value is 0. +

+
+
b_qfactor float (encoding,video)
+

Set qp factor between P and B frames. +

+
+
codec_tag integer
+
bug flags (decoding,video)
+

Workaround not auto detected encoder bugs. +

+

Possible values: +

+
autodetect
+
xvid_ilace
+

Xvid interlacing bug (autodetected if fourcc==XVIX) +

+
ump4
+

(autodetected if fourcc==UMP4) +

+
no_padding
+

padding bug (autodetected) +

+
amv
+
qpel_chroma
+
std_qpel
+

old standard qpel (autodetected per fourcc/version) +

+
qpel_chroma2
+
direct_blocksize
+

direct-qpel-blocksize bug (autodetected per fourcc/version) +

+
edge
+

edge padding bug (autodetected per fourcc/version) +

+
hpel_chroma
+
dc_clip
+
ms
+

Workaround various bugs in microsoft broken decoders. +

+
trunc
+

trancated frames +

+
+ +
+
strict integer (decoding/encoding,audio,video)
+

Specify how strictly to follow the standards. +

+

Possible values: +

+
very
+

strictly conform to an older more strict version of the spec or reference software +

+
strict
+

strictly conform to all the things in the spec no matter what consequences +

+
normal
+
unofficial
+

allow unofficial extensions +

+
experimental
+

allow non standardized experimental things, experimental +(unfinished/work in progress/not well tested) decoders and encoders. +Note: experimental decoders can pose a security risk, do not use this for +decoding untrusted input. +

+
+ +
+
b_qoffset float (encoding,video)
+

Set QP offset between P and B frames. +

+
+
err_detect flags (decoding,audio,video)
+

Set error detection flags. +

+

Possible values: +

+
crccheck
+

verify embedded CRCs +

+
bitstream
+

detect bitstream specification deviations +

+
buffer
+

detect improper bitstream length +

+
explode
+

abort decoding on minor error detection +

+
ignore_err
+

ignore decoding errors, and continue decoding. +This is useful if you want to analyze the content of a video and thus want +everything to be decoded no matter what. This option will not result in a video +that is pleasing to watch in case of errors. +

+
careful
+

consider things that violate the spec and have not been seen in the wild as errors +

+
compliant
+

consider all spec non compliancies as errors +

+
aggressive
+

consider things that a sane encoder should not do as an error +

+
+ +
+
has_b_frames integer
+
block_align integer
+
rc_override_count integer
+
maxrate integer (encoding,audio,video)
+

Set max bitrate tolerance (in bits/s). Requires bufsize to be set. +

+
+
minrate integer (encoding,audio,video)
+

Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR +encode. It is of little use elsewise. +

+
+
bufsize integer (encoding,audio,video)
+

Set ratecontrol buffer size (in bits). +

+
+
i_qfactor float (encoding,video)
+

Set QP factor between P and I frames. +

+
+
i_qoffset float (encoding,video)
+

Set QP offset between P and I frames. +

+
+
dct integer (encoding,video)
+

Set DCT algorithm. +

+

Possible values: +

+
auto
+

autoselect a good one (default) +

+
fastint
+

fast integer +

+
int
+

accurate integer +

+
mmx
+
altivec
+
faan
+

floating point AAN DCT +

+
+ +
+
lumi_mask float (encoding,video)
+

Compress bright areas stronger than medium ones. +

+
+
tcplx_mask float (encoding,video)
+

Set temporal complexity masking. +

+
+
scplx_mask float (encoding,video)
+

Set spatial complexity masking. +

+
+
p_mask float (encoding,video)
+

Set inter masking. +

+
+
dark_mask float (encoding,video)
+

Compress dark areas stronger than medium ones. +

+
+
idct integer (decoding/encoding,video)
+

Select IDCT implementation. +

+

Possible values: +

+
auto
+
int
+
simple
+
simplemmx
+
simpleauto
+

Automatically pick a IDCT compatible with the simple one +

+
+
arm
+
altivec
+
sh4
+
simplearm
+
simplearmv5te
+
simplearmv6
+
simpleneon
+
xvid
+
faani
+

floating point AAN IDCT +

+
+ +
+
slice_count integer
+
ec flags (decoding,video)
+

Set error concealment strategy. +

+

Possible values: +

+
guess_mvs
+

iterative motion vector (MV) search (slow) +

+
deblock
+

use strong deblock filter for damaged MBs +

+
favor_inter
+

favor predicting from the previous frame instead of the current +

+
+ +
+
bits_per_coded_sample integer
+
aspect rational number (encoding,video)
+

Set sample aspect ratio. +

+
+
sar rational number (encoding,video)
+

Set sample aspect ratio. Alias to aspect. +

+
+
debug flags (decoding/encoding,audio,video,subtitles)
+

Print specific debug info. +

+

Possible values: +

+
pict
+

picture info +

+
rc
+

rate control +

+
bitstream
+
mb_type
+

macroblock (MB) type +

+
qp
+

per-block quantization parameter (QP) +

+
dct_coeff
+
green_metadata
+

display complexity metadata for the upcoming frame, GoP or for a given duration. +

+
+
skip
+
startcode
+
er
+

error recognition +

+
mmco
+

memory management control operations (H.264) +

+
bugs
+
buffers
+

picture buffer allocations +

+
thread_ops
+

threading operations +

+
nomc
+

skip motion compensation +

+
+ +
+
cmp integer (encoding,video)
+

Set full pel me compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
subcmp integer (encoding,video)
+

Set sub pel me compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
mbcmp integer (encoding,video)
+

Set macroblock compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
ildctcmp integer (encoding,video)
+

Set interlaced dct compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
dia_size integer (encoding,video)
+

Set diamond type & size for motion estimation. +

+
(1024, INT_MAX)
+

full motion estimation(slowest) +

+
(768, 1024]
+

umh motion estimation +

+
(512, 768]
+

hex motion estimation +

+
(256, 512]
+

l2s diamond motion estimation +

+
[2,256]
+

var diamond motion estimation +

+
(-1, 2)
+

small diamond motion estimation +

+
-1
+

funny diamond motion estimation +

+
(INT_MIN, -1)
+

sab diamond motion estimation +

+
+ +
+
last_pred integer (encoding,video)
+

Set amount of motion predictors from the previous frame. +

+
+
precmp integer (encoding,video)
+

Set pre motion estimation compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
pre_dia_size integer (encoding,video)
+

Set diamond type & size for motion estimation pre-pass. +

+
+
subq integer (encoding,video)
+

Set sub pel motion estimation quality. +

+
+
me_range integer (encoding,video)
+

Set limit motion vectors range (1023 for DivX player). +

+
+
global_quality integer (encoding,audio,video)
+
slice_flags integer
+
mbd integer (encoding,video)
+

Set macroblock decision algorithm (high quality mode). +

+

Possible values: +

+
simple
+

use mbcmp (default) +

+
bits
+

use fewest bits +

+
rd
+

use best rate distortion +

+
+ +
+
rc_init_occupancy integer (encoding,video)
+

Set number of bits which should be loaded into the rc buffer before +decoding starts. +

+
+
flags2 flags (decoding/encoding,audio,video,subtitles)
+
+

Possible values: +

+
fast
+

Allow non spec compliant speedup tricks. +

+
noout
+

Skip bitstream encoding. +

+
ignorecrop
+

Ignore cropping information from sps. +

+
local_header
+

Place global headers at every keyframe instead of in extradata. +

+
chunks
+

Frame data might be split into multiple chunks. +

+
showall
+

Show all frames before the first keyframe. +

+
export_mvs
+

Export motion vectors into frame side-data (see AV_FRAME_DATA_MOTION_VECTORS) +for codecs that support it. See also doc/examples/export_mvs.c. +

+
skip_manual
+

Do not skip samples and export skip information as frame side data. +

+
ass_ro_flush_noop
+

Do not reset ASS ReadOrder field on flush. +

+
icc_profiles
+

Generate/parse embedded ICC profiles from/to colorimetry tags. +

+
+ +
+
export_side_data flags (decoding/encoding,audio,video,subtitles)
+
+

Possible values: +

+
mvs
+

Export motion vectors into frame side-data (see AV_FRAME_DATA_MOTION_VECTORS) +for codecs that support it. See also doc/examples/export_mvs.c. +

+
prft
+

Export encoder Producer Reference Time into packet side-data (see AV_PKT_DATA_PRFT) +for codecs that support it. +

+
venc_params
+

Export video encoding parameters through frame side data (see AV_FRAME_DATA_VIDEO_ENC_PARAMS) +for codecs that support it. At present, those are H.264 and VP9. +

+
film_grain
+

Export film grain parameters through frame side data (see AV_FRAME_DATA_FILM_GRAIN_PARAMS). +Supported at present by AV1 decoders. +

+
+ +
+
threads integer (decoding/encoding,video)
+

Set the number of threads to be used, in case the selected codec +implementation supports multi-threading. +

+

Possible values: +

+
auto, 0
+

automatically select the number of threads to set +

+
+ +

Default value is ‘auto’. +

+
+
dc integer (encoding,video)
+

Set intra_dc_precision. +

+
+
nssew integer (encoding,video)
+

Set nsse weight. +

+
+
skip_top integer (decoding,video)
+

Set number of macroblock rows at the top which are skipped. +

+
+
skip_bottom integer (decoding,video)
+

Set number of macroblock rows at the bottom which are skipped. +

+
+
profile integer (encoding,audio,video)
+
+

Set encoder codec profile. Default value is ‘unknown’. Encoder specific +profiles are documented in the relevant encoder documentation. +

+
+
level integer (encoding,audio,video)
+
+

Possible values: +

+
unknown
+
+ +
+
lowres integer (decoding,audio,video)
+

Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions. +

+
+
mblmin integer (encoding,video)
+

Set min macroblock lagrange factor (VBR). +

+
+
mblmax integer (encoding,video)
+

Set max macroblock lagrange factor (VBR). +

+
+
skip_loop_filter integer (decoding,video)
+
skip_idct integer (decoding,video)
+
skip_frame integer (decoding,video)
+
+

Make decoder discard processing depending on the frame type selected +by the option value. +

+

skip_loop_filter skips frame loop filtering, skip_idct +skips frame IDCT/dequantization, skip_frame skips decoding. +

+

Possible values: +

+
none
+

Discard no frame. +

+
+
default
+

Discard useless frames like 0-sized frames. +

+
+
noref
+

Discard all non-reference frames. +

+
+
bidir
+

Discard all bidirectional frames. +

+
+
nokey
+

Discard all frames excepts keyframes. +

+
+
nointra
+

Discard all frames except I frames. +

+
+
all
+

Discard all frames. +

+
+ +

Default value is ‘default’. +

+
+
bidir_refine integer (encoding,video)
+

Refine the two motion vectors used in bidirectional macroblocks. +

+
+
keyint_min integer (encoding,video)
+

Set minimum interval between IDR-frames. +

+
+
refs integer (encoding,video)
+

Set reference frames to consider for motion compensation. +

+
+
trellis integer (encoding,audio,video)
+

Set rate-distortion optimal quantization. +

+
+
mv0_threshold integer (encoding,video)
+
compression_level integer (encoding,audio,video)
+
bits_per_raw_sample integer
+
channel_layout integer (decoding/encoding,audio)
+
+

Possible values: +

+
request_channel_layout integer (decoding,audio)
+
+

Possible values: +

+
rc_max_vbv_use float (encoding,video)
+
rc_min_vbv_use float (encoding,video)
+
color_primaries integer (decoding/encoding,video)
+

Possible values: +

+
bt709
+

BT.709 +

+
bt470m
+

BT.470 M +

+
bt470bg
+

BT.470 BG +

+
smpte170m
+

SMPTE 170 M +

+
smpte240m
+

SMPTE 240 M +

+
film
+

Film +

+
bt2020
+

BT.2020 +

+
smpte428
+
smpte428_1
+

SMPTE ST 428-1 +

+
smpte431
+

SMPTE 431-2 +

+
smpte432
+

SMPTE 432-1 +

+
jedec-p22
+

JEDEC P22 +

+
+ +
+
color_trc integer (decoding/encoding,video)
+

Possible values: +

+
bt709
+

BT.709 +

+
gamma22
+

BT.470 M +

+
gamma28
+

BT.470 BG +

+
smpte170m
+

SMPTE 170 M +

+
smpte240m
+

SMPTE 240 M +

+
linear
+

Linear +

+
log
+
log100
+

Log +

+
log_sqrt
+
log316
+

Log square root +

+
iec61966_2_4
+
iec61966-2-4
+

IEC 61966-2-4 +

+
bt1361
+
bt1361e
+

BT.1361 +

+
iec61966_2_1
+
iec61966-2-1
+

IEC 61966-2-1 +

+
bt2020_10
+
bt2020_10bit
+

BT.2020 - 10 bit +

+
bt2020_12
+
bt2020_12bit
+

BT.2020 - 12 bit +

+
smpte2084
+

SMPTE ST 2084 +

+
smpte428
+
smpte428_1
+

SMPTE ST 428-1 +

+
arib-std-b67
+

ARIB STD-B67 +

+
+ +
+
colorspace integer (decoding/encoding,video)
+

Possible values: +

+
rgb
+

RGB +

+
bt709
+

BT.709 +

+
fcc
+

FCC +

+
bt470bg
+

BT.470 BG +

+
smpte170m
+

SMPTE 170 M +

+
smpte240m
+

SMPTE 240 M +

+
ycocg
+

YCOCG +

+
bt2020nc
+
bt2020_ncl
+

BT.2020 NCL +

+
bt2020c
+
bt2020_cl
+

BT.2020 CL +

+
smpte2085
+

SMPTE 2085 +

+
chroma-derived-nc
+

Chroma-derived NCL +

+
chroma-derived-c
+

Chroma-derived CL +

+
ictcp
+

ICtCp +

+
+ +
+
color_range integer (decoding/encoding,video)
+

If used as input parameter, it serves as a hint to the decoder, which +color_range the input has. +Possible values: +

+
tv
+
mpeg
+

MPEG (219*2^(n-8)) +

+
pc
+
jpeg
+

JPEG (2^n-1) +

+
+ +
+
chroma_sample_location integer (decoding/encoding,video)
+

Possible values: +

+
left
+
center
+
topleft
+
top
+
bottomleft
+
bottom
+
+ +
+
log_level_offset integer
+

Set the log level offset. +

+
+
slices integer (encoding,video)
+

Number of slices, used in parallelized encoding. +

+
+
thread_type flags (decoding/encoding,video)
+

Select which multithreading methods to use. +

+

Use of ‘frame’ will increase decoding delay by one frame per +thread, so clients which cannot provide future frames should not use +it. +

+

Possible values: +

+
slice
+

Decode more than one part of a single frame at once. +

+

Multithreading using slices works only when the video was encoded with +slices. +

+
+
frame
+

Decode more than one frame at once. +

+
+ +

Default value is ‘slice+frame’. +

+
+
audio_service_type integer (encoding,audio)
+

Set audio service type. +

+

Possible values: +

+
ma
+

Main Audio Service +

+
ef
+

Effects +

+
vi
+

Visually Impaired +

+
hi
+

Hearing Impaired +

+
di
+

Dialogue +

+
co
+

Commentary +

+
em
+

Emergency +

+
vo
+

Voice Over +

+
ka
+

Karaoke +

+
+ +
+
request_sample_fmt sample_fmt (decoding,audio)
+

Set sample format audio decoders should prefer. Default value is +none. +

+
+
pkt_timebase rational number
+
sub_charenc encoding (decoding,subtitles)
+

Set the input subtitles character encoding. +

+
+
field_order field_order (video)
+

Set/override the field order of the video. +Possible values: +

+
progressive
+

Progressive video +

+
tt
+

Interlaced video, top field coded and displayed first +

+
bb
+

Interlaced video, bottom field coded and displayed first +

+
tb
+

Interlaced video, top coded first, bottom displayed first +

+
bt
+

Interlaced video, bottom coded first, top displayed first +

+
+ +
+
skip_alpha bool (decoding,video)
+

Set to 1 to disable processing alpha (transparency). This works like the +‘gray’ flag in the flags option which skips chroma information +instead of alpha. Default is 0. +

+
+
codec_whitelist list (input)
+

"," separated list of allowed decoders. By default all are allowed. +

+
+
dump_separator string (input)
+

Separator used to separate the fields printed on the command line about the +Stream parameters. +For example, to separate the fields with newlines and indentation: +

+
ffprobe -dump_separator "
+                          "  -i ~/videos/matrixbench_mpeg2.mpg
+
+ +
+
max_pixels integer (decoding/encoding,video)
+

Maximum number of pixels per image. This value can be used to avoid out of +memory failures due to large images. +

+
+
apply_cropping bool (decoding,video)
+

Enable cropping if cropping parameters are multiples of the required +alignment for the left and top parameters. If the alignment is not met the +cropping will be partially applied to maintain alignment. +Default is 1 (enabled). +Note: The required alignment depends on if AV_CODEC_FLAG_UNALIGNED is set and the +CPU. AV_CODEC_FLAG_UNALIGNED cannot be changed from the command line. Also hardware +decoders will not apply left/top Cropping. +

+ +
+
+ + +
+
+

10 Decoders

+ +

Decoders are configured elements in FFmpeg which allow the decoding of +multimedia streams. +

+

When you configure your FFmpeg build, all the supported native decoders +are enabled by default. Decoders requiring an external library must be enabled +manually via the corresponding --enable-lib option. You can list all +available decoders using the configure option --list-decoders. +

+

You can disable all the decoders with the configure option +--disable-decoders and selectively enable / disable single decoders +with the options --enable-decoder=DECODER / +--disable-decoder=DECODER. +

+

The option -decoders of the ff* tools will display the list of +enabled decoders. +

+ +
+
+

11 Video Decoders

+ +

A description of some of the currently available video decoders +follows. +

+ +
+

11.1 av1

+ +

AOMedia Video 1 (AV1) decoder. +

+ +
+

11.1.1 Options

+ +
+
operating_point
+

Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0. +

+
+
+ +
+
+
+

11.2 rawvideo

+ +

Raw video decoder. +

+

This decoder decodes rawvideo streams. +

+ +
+

11.2.1 Options

+ +
+
top top_field_first
+

Specify the assumed field type of the input video. +

+
-1
+

the video is assumed to be progressive (default) +

+
0
+

bottom-field-first is assumed +

+
1
+

top-field-first is assumed +

+
+ +
+
+ +
+
+
+

11.3 libdav1d

+ +

dav1d AV1 decoder. +

+

libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec. +Requires the presence of the libdav1d headers and library during configuration. +You need to explicitly configure the build with --enable-libdav1d. +

+ +
+

11.3.1 Options

+ +

The following options are supported by the libdav1d wrapper. +

+
+
framethreads
+

Set amount of frame threads to use during decoding. The default value is 0 (autodetect). +This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the +option max_frame_delay and the global option threads instead. +

+
+
tilethreads
+

Set amount of tile threads to use during decoding. The default value is 0 (autodetect). +This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the +global option threads instead. +

+
+
max_frame_delay
+

Set max amount of frames the decoder may buffer internally. The default value is 0 +(autodetect). +

+
+
filmgrain
+

Apply film grain to the decoded video if present in the bitstream. Defaults to the +internal default of the library. +This option is deprecated and will be removed in the future. See the global option +export_side_data to export Film Grain parameters instead of applying it. +

+
+
oppoint
+

Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the +internal default of the library. +

+
+
alllayers
+

Output all spatial layers of a scalable AV1 bitstream. The default value is false. +

+
+
+ +
+
+
+

11.4 libdavs2

+ +

AVS2-P2/IEEE1857.4 video decoder wrapper. +

+

This decoder allows libavcodec to decode AVS2 streams with davs2 library. +

+ +
+
+

11.5 libuavs3d

+ +

AVS3-P2/IEEE1857.10 video decoder. +

+

libuavs3d allows libavcodec to decode AVS3 streams. +Requires the presence of the libuavs3d headers and library during configuration. +You need to explicitly configure the build with --enable-libuavs3d. +

+ +
+

11.5.1 Options

+ +

The following option is supported by the libuavs3d wrapper. +

+
+
frame_threads
+

Set amount of frame threads to use during decoding. The default value is 0 (autodetect). +

+
+
+ +
+
+
+

11.6 QSV Decoders

+ +

The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC, +JPEG/MJPEG, VP8, VP9, AV1). +

+ +
+

11.6.1 Common Options

+ +

The following options are supported by all qsv decoders. +

+
+
async_depth
+

Internal parallelization depth, the higher the value the higher the latency. +

+
+
gpu_copy
+

A GPU-accelerated copy between video and system memory +

+
default
+
on
+
off
+
+ +
+
+ +
+
+

11.6.2 HEVC Options

+

Extra options for hevc_qsv. +

+
+
load_plugin
+

A user plugin to load in an internal session +

+
none
+
hevc_sw
+
hevc_hw
+
+ +
+
load_plugins
+

A :-separate list of hexadecimal plugin UIDs to load in an internal session +

+
+
+ +
+
+
+

11.7 v210

+ +

Uncompressed 4:2:2 10-bit decoder. +

+ +
+

11.7.1 Options

+ +
+
custom_stride
+

Set the line size of the v210 data in bytes. The default value is 0 +(autodetect). You can use the special -1 value for a strideless v210 as seen in +BOXX files. +

+
+
+ + +
+
+
+
+

12 Audio Decoders

+ +

A description of some of the currently available audio decoders +follows. +

+ +
+

12.1 ac3

+ +

AC-3 audio decoder. +

+

This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as +the undocumented RealAudio 3 (a.k.a. dnet). +

+ +
+

12.1.1 AC-3 Decoder Options

+ +
+
-drc_scale value
+

Dynamic Range Scale Factor. The factor to apply to dynamic range values +from the AC-3 stream. This factor is applied exponentially. The default value is 1. +There are 3 notable scale factor ranges: +

+
drc_scale == 0
+

DRC disabled. Produces full range audio. +

+
0 < drc_scale <= 1
+

DRC enabled. Applies a fraction of the stream DRC value. +Audio reproduction is between full range and full compression. +

+
drc_scale > 1
+

DRC enabled. Applies drc_scale asymmetrically. +Loud sounds are fully compressed. Soft sounds are enhanced. +

+
+ +
+
+ +
+
+
+

12.2 flac

+ +

FLAC audio decoder. +

+

This decoder aims to implement the complete FLAC specification from Xiph. +

+ +
+

12.2.1 FLAC Decoder options

+ +
+
-use_buggy_lpc
+

The lavc FLAC encoder used to produce buggy streams with high lpc values +(like the default value). This option makes it possible to decode such streams +correctly by using lavc’s old buggy lpc logic for decoding. +

+
+
+ +
+
+
+

12.3 ffwavesynth

+ +

Internal wave synthesizer. +

+

This decoder generates wave patterns according to predefined sequences. Its +use is purely internal and the format of the data it accepts is not publicly +documented. +

+
+
+

12.4 libcelt

+ +

libcelt decoder wrapper. +

+

libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec. +Requires the presence of the libcelt headers and library during configuration. +You need to explicitly configure the build with --enable-libcelt. +

+
+
+

12.5 libgsm

+ +

libgsm decoder wrapper. +

+

libgsm allows libavcodec to decode the GSM full rate audio codec. Requires +the presence of the libgsm headers and library during configuration. You need +to explicitly configure the build with --enable-libgsm. +

+

This decoder supports both the ordinary GSM and the Microsoft variant. +

+
+
+

12.6 libilbc

+ +

libilbc decoder wrapper. +

+

libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC) +audio codec. Requires the presence of the libilbc headers and library during +configuration. You need to explicitly configure the build with +--enable-libilbc. +

+ +
+

12.6.1 Options

+ +

The following option is supported by the libilbc wrapper. +

+
+
enhance
+
+

Enable the enhancement of the decoded audio when set to 1. The default +value is 0 (disabled). +

+
+
+ +
+
+
+

12.7 libopencore-amrnb

+ +

libopencore-amrnb decoder wrapper. +

+

libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate +Narrowband audio codec. Using it requires the presence of the +libopencore-amrnb headers and library during configuration. You need to +explicitly configure the build with --enable-libopencore-amrnb. +

+

An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB +without this library. +

+
+
+

12.8 libopencore-amrwb

+ +

libopencore-amrwb decoder wrapper. +

+

libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate +Wideband audio codec. Using it requires the presence of the +libopencore-amrwb headers and library during configuration. You need to +explicitly configure the build with --enable-libopencore-amrwb. +

+

An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB +without this library. +

+
+
+

12.9 libopus

+ +

libopus decoder wrapper. +

+

libopus allows libavcodec to decode the Opus Interactive Audio Codec. +Requires the presence of the libopus headers and library during +configuration. You need to explicitly configure the build with +--enable-libopus. +

+

An FFmpeg native decoder for Opus exists, so users can decode Opus +without this library. +

+ +
+
+
+

13 Subtitles Decoders

+ + +
+

13.1 libaribb24

+ +

ARIB STD-B24 caption decoder. +

+

Implements profiles A and C of the ARIB STD-B24 standard. +

+ +
+

13.1.1 libaribb24 Decoder Options

+ +
+
-aribb24-base-path path
+

Sets the base path for the libaribb24 library. This is utilized for reading of +configuration files (for custom unicode conversions), and for dumping of +non-text symbols as images under that location. +

+

Unset by default. +

+
+
-aribb24-skip-ruby-text boolean
+

Tells the decoder wrapper to skip text blocks that contain half-height ruby +text. +

+

Enabled by default. +

+
+
+ +
+
+
+

13.2 libaribcaption

+ +

Yet another ARIB STD-B24 caption decoder using external libaribcaption +library. +

+

Implements profiles A and C of the Japanse ARIB STD-B24 standard, +Brazilian ABNT NBR 15606-1, and Philippines version of ISDB-T. +

+

Requires the presence of the libaribcaption headers and library +(https://github.com/xqq/libaribcaption) during configuration. +You need to explicitly configure the build with --enable-libaribcaption. +If both libaribb24 and libaribcaption are enabled, libaribcaption +decoder precedes. +

+ +
+

13.2.1 libaribcaption Decoder Options

+ +
+
-sub_type subtitle_type
+

Specifies the format of the decoded subtitles. +

+
+
bitmap
+

Graphical image. +

+
ass
+

ASS formatted text. +

+
text
+

Simple text based output without formatting. +

+
+ +

The default is ass as same as libaribb24 decoder. +Some present players (e.g., mpv) expect ASS format for ARIB caption. +

+
+
-caption_encoding encoding_scheme
+

Specifies the encoding scheme of input subtitle text. +

+
+
auto
+

Automatically detect text encoding. +

+
jis
+

8bit-char JIS encoding defined in ARIB STD B24. +This encoding used in Japan for ISDB captions. +

+
utf8
+

UTF-8 encoding defined in ARIB STD B24. +This encoding is used in Philippines for ISDB-T captions. +

+
latin
+

Latin character encoding defined in ABNT NBR 15606-1. +This encoding is used in South America for SBTVD / ISDB-Tb captions. +

+
+ +

The default is ass as same as libaribb24 decoder. +Some present players (e.g., mpv) expect ASS format for ARIB caption. +

+
+
-font font_name[,font_name2,...]
+

Specify comma-separated list of font family names to be used for bitmap +or ass type subtitle rendering. +Only first font name is used for ass type subtitle. +

+

If not specified, use internaly defined default font family. +

+
+
-ass_single_rect boolean
+

ARIB STD-B24 specifies that some captions may be displayed at different +positions at a time (multi-rectangle subtitle). +Since some players (e.g., old mpv) can’t handle multiple ASS rectangles +in a single AVSubtitle, or multiple ASS rectangles of indeterminate duration +with the same start timestamp, this option can change the behavior so that +all the texts are displayed in a single ASS rectangle. +

+

The default is false. +

+

If your player cannot handle AVSubtitles with multiple ASS rectangles properly, +set this option to true or define ASS_SINGLE_RECT=1 to change +default behavior at compilation. +

+
+
-replace_fullwidth_ascii boolean
+

Specify whether to replace MSZ (Middle Size, half width) fullwidth +alphanumerics with halfwidth alphanumerics. +

+

The default is true. +

+
+
-force_outline_text boolean
+

Specify whether always render outline text for all characters regardless of +the indication by charactor style. +

+

The default is false. +

+
+
-outline_width number (0.0 - 3.0)
+

Specify width for outline text, in dots (relative). +

+

The default is 1.5. +

+
+
-ignore_background boolean
+

Specify whether to ignore background color rendering. +

+

The default is false. +

+
+
-ignore_ruby boolean
+

Specify whether to ignore rendering for ruby-like (furigana) characters. +

+

The default is false. +

+
+
-replace_drcs boolean
+

Specify whether to render replaced DRCS characters as Unicode characters. +

+

The default is true. +

+
+
-canvas_size image_size
+

Specify the resolution of the canvas to render subtitles to; usually, this +should be frame size of input video. +This only applies when -subtitle_type is set to bitmap. +

+

The libaribcaption decoder assumes input frame size for bitmap rendering as below: +

    +
  1. PROFILE_A : 1440 x 1080 with SAR (PAR) 4:3 +
  2. PROFILE_C : 320 x 180 with SAR (PAR) 1:1 +
+ +

If actual frame size of input video does not match above assumption, +the rendered captions may be distorted. +To make the captions undistorted, add -canvas_size option to specify +actual input video size. +

+

Note that the -canvas_size option is not required for video with +different size but same aspect ratio. +In such cases, the caption will be stretched or shrunk to actual video size +if -canvas_size option is not specified. +If -canvas_size option is specified with different size, +the caption will be stretched or shrunk as specified size with calculated SAR. +

+
+
+ +
+
+

13.2.2 libaribcaption decoder usage examples

+ +

Display MPEG-TS file with ARIB subtitle by ffplay tool: +

+
ffplay -sub_type bitmap MPEG.TS
+
+ +

Display MPEG-TS file with input frame size 1920x1080 by ffplay tool: +

+
ffplay -sub_type bitmap -canvas_size 1920x1080 MPEG.TS
+
+ +

Embed ARIB subtitle in transcoded video: +

+
ffmpeg -sub_type bitmap -i src.m2t -filter_complex "[0:v][0:s]overlay" -vcodec h264 dest.mp4
+
+ +
+
+
+

13.3 dvbsub

+ + +
+

13.3.1 Options

+ +
+
compute_clut
+
+
-2
+

Compute clut once if no matching CLUT is in the stream. +

+
-1
+

Compute clut if no matching CLUT is in the stream. +

+
0
+

Never compute CLUT +

+
1
+

Always compute CLUT and override the one provided in the stream. +

+
+
+
dvb_substream
+

Selects the dvb substream, or all substreams if -1 which is default. +

+
+
+ +
+
+
+

13.4 dvdsub

+ +

This codec decodes the bitmap subtitles used in DVDs; the same subtitles can +also be found in VobSub file pairs and in some Matroska files. +

+ +
+

13.4.1 Options

+ +
+
palette
+

Specify the global palette used by the bitmaps. When stored in VobSub, the +palette is normally specified in the index file; in Matroska, the palette is +stored in the codec extra-data in the same format as in VobSub. In DVDs, the +palette is stored in the IFO file, and therefore not available when reading +from dumped VOB files. +

+

The format for this option is a string containing 16 24-bits hexadecimal +numbers (without 0x prefix) separated by commas, for example 0d00ee, +ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1, +7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b. +

+
+
ifo_palette
+

Specify the IFO file from which the global palette is obtained. +(experimental) +

+
+
forced_subs_only
+

Only decode subtitle entries marked as forced. Some titles have forced +and non-forced subtitles in the same track. Setting this flag to 1 +will only keep the forced subtitles. Default value is 0. +

+
+ +
+
+
+

13.5 libzvbi-teletext

+ +

Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext +subtitles. Requires the presence of the libzvbi headers and library during +configuration. You need to explicitly configure the build with +--enable-libzvbi. +

+ +
+

13.5.1 Options

+ +
+
txt_page
+

List of teletext page numbers to decode. Pages that do not match the specified +list are dropped. You may use the special * string to match all pages, +or subtitle to match all subtitle pages. +Default value is *. +

+
txt_default_region
+

Set default character set used for decoding, a value between 0 and 87 (see +ETS 300 706, Section 15, Table 32). Default value is -1, which does not +override the libzvbi default. This option is needed for some legacy level 1.0 +transmissions which cannot signal the proper charset. +

+
txt_chop_top
+

Discards the top teletext line. Default value is 1. +

+
txt_format
+

Specifies the format of the decoded subtitles. +

+
bitmap
+

The default format, you should use this for teletext pages, because certain +graphics and colors cannot be expressed in simple text or even ASS. +

+
text
+

Simple text based output without formatting. +

+
ass
+

Formatted ASS output, subtitle pages and teletext pages are returned in +different styles, subtitle pages are stripped down to text, but an effort is +made to keep the text alignment and the formatting. +

+
+
+
txt_left
+

X offset of generated bitmaps, default is 0. +

+
txt_top
+

Y offset of generated bitmaps, default is 0. +

+
txt_chop_spaces
+

Chops leading and trailing spaces and removes empty lines from the generated +text. This option is useful for teletext based subtitles where empty spaces may +be present at the start or at the end of the lines or empty lines may be +present between the subtitle lines because of double-sized teletext characters. +Default value is 1. +

+
txt_duration
+

Sets the display duration of the decoded teletext pages or subtitles in +milliseconds. Default value is -1 which means infinity or until the next +subtitle event comes. +

+
txt_transparent
+

Force transparent background of the generated teletext bitmaps. Default value +is 0 which means an opaque background. +

+
txt_opacity
+

Sets the opacity (0-255) of the teletext background. If +txt_transparent is not set, it only affects characters between a start +box and an end box, typically subtitles. Default value is 0 if +txt_transparent is set, 255 otherwise. +

+
+
+ +
+
+
+
+

14 Encoders

+ +

Encoders are configured elements in FFmpeg which allow the encoding of +multimedia streams. +

+

When you configure your FFmpeg build, all the supported native encoders +are enabled by default. Encoders requiring an external library must be enabled +manually via the corresponding --enable-lib option. You can list all +available encoders using the configure option --list-encoders. +

+

You can disable all the encoders with the configure option +--disable-encoders and selectively enable / disable single encoders +with the options --enable-encoder=ENCODER / +--disable-encoder=ENCODER. +

+

The option -encoders of the ff* tools will display the list of +enabled encoders. +

+ +
+
+

15 Audio Encoders

+ +

A description of some of the currently available audio encoders +follows. +

+ +
+

15.1 aac

+ +

Advanced Audio Coding (AAC) encoder. +

+

This encoder is the default AAC encoder, natively implemented into FFmpeg. +

+ +
+

15.1.1 Options

+ +
+
b
+

Set bit rate in bits/s. Setting this automatically activates constant bit rate +(CBR) mode. If this option is unspecified it is set to 128kbps. +

+
+
q
+

Set quality for variable bit rate (VBR) mode. This option is valid only using +the ffmpeg command-line tool. For library interface users, use +global_quality. +

+
+
cutoff
+

Set cutoff frequency. If unspecified will allow the encoder to dynamically +adjust the cutoff to improve clarity on low bitrates. +

+
+
aac_coder
+

Set AAC encoder coding method. Possible values: +

+
+
twoloop
+

Two loop searching (TLS) method. This is the default method. +

+

This method first sets quantizers depending on band thresholds and then tries +to find an optimal combination by adding or subtracting a specific value from +all quantizers and adjusting some individual quantizer a little. Will tune +itself based on whether aac_is, aac_ms and aac_pns +are enabled. +

+
+
anmr
+

Average noise to mask ratio (ANMR) trellis-based solution. +

+

This is an experimental coder which currently produces a lower quality, is more +unstable and is slower than the default twoloop coder but has potential. +Currently has no support for the aac_is or aac_pns options. +Not currently recommended. +

+
+
fast
+

Constant quantizer method. +

+

Uses a cheaper version of twoloop algorithm that doesn’t try to do as many +clever adjustments. Worse with low bitrates (less than 64kbps), but is better +and much faster at higher bitrates. +

+
+
+ +
+
aac_ms
+

Sets mid/side coding mode. The default value of "auto" will automatically use +M/S with bands which will benefit from such coding. Can be forced for all bands +using the value "enable", which is mainly useful for debugging or disabled using +"disable". +

+
+
aac_is
+

Sets intensity stereo coding tool usage. By default, it’s enabled and will +automatically toggle IS for similar pairs of stereo bands if it’s beneficial. +Can be disabled for debugging by setting the value to "disable". +

+
+
aac_pns
+

Uses perceptual noise substitution to replace low entropy high frequency bands +with imperceptible white noise during the decoding process. By default, it’s +enabled, but can be disabled for debugging purposes by using "disable". +

+
+
aac_tns
+

Enables the use of a multitap FIR filter which spans through the high frequency +bands to hide quantization noise during the encoding process and is reverted +by the decoder. As well as decreasing unpleasant artifacts in the high range +this also reduces the entropy in the high bands and allows for more bits to +be used by the mid-low bands. By default it’s enabled but can be disabled for +debugging by setting the option to "disable". +

+
+
aac_ltp
+

Enables the use of the long term prediction extension which increases coding +efficiency in very low bandwidth situations such as encoding of voice or +solo piano music by extending constant harmonic peaks in bands throughout +frames. This option is implied by profile:a aac_low and is incompatible with +aac_pred. Use in conjunction with -ar to decrease the samplerate. +

+
+
aac_pred
+

Enables the use of a more traditional style of prediction where the spectral +coefficients transmitted are replaced by the difference of the current +coefficients minus the previous "predicted" coefficients. In theory and sometimes +in practice this can improve quality for low to mid bitrate audio. +This option implies the aac_main profile and is incompatible with aac_ltp. +

+
+
profile
+

Sets the encoding profile, possible values: +

+
+
aac_low
+

The default, AAC "Low-complexity" profile. Is the most compatible and produces +decent quality. +

+
+
mpeg2_aac_low
+

Equivalent to -profile:a aac_low -aac_pns 0. PNS was introduced with the +MPEG4 specifications. +

+
+
aac_ltp
+

Long term prediction profile, is enabled by and will enable the aac_ltp +option. Introduced in MPEG4. +

+
+
aac_main
+

Main-type prediction profile, is enabled by and will enable the aac_pred +option. Introduced in MPEG2. +

+
+
+

If this option is unspecified it is set to ‘aac_low’. +

+
+ +
+
+
+

15.2 ac3 and ac3_fixed

+ +

AC-3 audio encoders. +

+

These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as +the undocumented RealAudio 3 (a.k.a. dnet). +

+

The ac3 encoder uses floating-point math, while the ac3_fixed +encoder only uses fixed-point integer math. This does not mean that one is +always faster, just that one or the other may be better suited to a +particular system. The ac3_fixed encoder is not the default codec for +any of the output formats, so it must be specified explicitly using the option +-acodec ac3_fixed in order to use it. +

+ +
+

15.2.1 AC-3 Metadata

+ +

The AC-3 metadata options are used to set parameters that describe the audio, +but in most cases do not affect the audio encoding itself. Some of the options +do directly affect or influence the decoding and playback of the resulting +bitstream, while others are just for informational purposes. A few of the +options will add bits to the output stream that could otherwise be used for +audio data, and will thus affect the quality of the output. Those will be +indicated accordingly with a note in the option list below. +

+

These parameters are described in detail in several publicly-available +documents. +

+ + +
+

15.2.1.1 Metadata Control Options

+ +
+
-per_frame_metadata boolean
+

Allow Per-Frame Metadata. Specifies if the encoder should check for changing +metadata for each frame. +

+
0
+

The metadata values set at initialization will be used for every frame in the +stream. (default) +

+
1
+

Metadata values can be changed before encoding each frame. +

+
+ +
+
+ +
+
+

15.2.1.2 Downmix Levels

+ +
+
-center_mixlev level
+

Center Mix Level. The amount of gain the decoder should apply to the center +channel when downmixing to stereo. This field will only be written to the +bitstream if a center channel is present. The value is specified as a scale +factor. There are 3 valid values: +

+
0.707
+

Apply -3dB gain +

+
0.595
+

Apply -4.5dB gain (default) +

+
0.500
+

Apply -6dB gain +

+
+ +
+
-surround_mixlev level
+

Surround Mix Level. The amount of gain the decoder should apply to the surround +channel(s) when downmixing to stereo. This field will only be written to the +bitstream if one or more surround channels are present. The value is specified +as a scale factor. There are 3 valid values: +

+
0.707
+

Apply -3dB gain +

+
0.500
+

Apply -6dB gain (default) +

+
0.000
+

Silence Surround Channel(s) +

+
+ +
+
+ +
+
+

15.2.1.3 Audio Production Information

+

Audio Production Information is optional information describing the mixing +environment. Either none or both of the fields are written to the bitstream. +

+
+
-mixing_level number
+

Mixing Level. Specifies peak sound pressure level (SPL) in the production +environment when the mix was mastered. Valid values are 80 to 111, or -1 for +unknown or not indicated. The default value is -1, but that value cannot be +used if the Audio Production Information is written to the bitstream. Therefore, +if the room_type option is not the default value, the mixing_level +option must not be -1. +

+
+
-room_type type
+

Room Type. Describes the equalization used during the final mixing session at +the studio or on the dubbing stage. A large room is a dubbing stage with the +industry standard X-curve equalization; a small room has flat equalization. +This field will not be written to the bitstream if both the mixing_level +option and the room_type option have the default values. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
large
+

Large Room +

+
2
+
small
+

Small Room +

+
+ +
+
+ +
+
+

15.2.1.4 Other Metadata Options

+ +
+
-copyright boolean
+

Copyright Indicator. Specifies whether a copyright exists for this audio. +

+
0
+
off
+

No Copyright Exists (default) +

+
1
+
on
+

Copyright Exists +

+
+ +
+
-dialnorm value
+

Dialogue Normalization. Indicates how far the average dialogue level of the +program is below digital 100% full scale (0 dBFS). This parameter determines a +level shift during audio reproduction that sets the average volume of the +dialogue to a preset level. The goal is to match volume level between program +sources. A value of -31dB will result in no volume level change, relative to +the source volume, during audio reproduction. Valid values are whole numbers in +the range -31 to -1, with -31 being the default. +

+
+
-dsur_mode mode
+

Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround +(Pro Logic). This field will only be written to the bitstream if the audio +stream is stereo. Using this option does NOT mean the encoder will actually +apply Dolby Surround processing. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
off
+

Not Dolby Surround Encoded +

+
2
+
on
+

Dolby Surround Encoded +

+
+ +
+
-original boolean
+

Original Bit Stream Indicator. Specifies whether this audio is from the +original source and not a copy. +

+
0
+
off
+

Not Original Source +

+
1
+
on
+

Original Source (default) +

+
+ +
+
+ +
+
+
+

15.2.2 Extended Bitstream Information

+

The extended bitstream options are part of the Alternate Bit Stream Syntax as +specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts. +If any one parameter in a group is specified, all values in that group will be +written to the bitstream. Default values are used for those that are written +but have not been specified. If the mixing levels are written, the decoder +will use these values instead of the ones specified in the center_mixlev +and surround_mixlev options if it supports the Alternate Bit Stream +Syntax. +

+ +
+

15.2.2.1 Extended Bitstream Information - Part 1

+ +
+
-dmix_mode mode
+

Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt +(Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
ltrt
+

Lt/Rt Downmix Preferred +

+
2
+
loro
+

Lo/Ro Downmix Preferred +

+
+ +
+
-ltrt_cmixlev level
+

Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the +center channel when downmixing to stereo in Lt/Rt mode. +

+
1.414
+

Apply +3dB gain +

+
1.189
+

Apply +1.5dB gain +

+
1.000
+

Apply 0dB gain +

+
0.841
+

Apply -1.5dB gain +

+
0.707
+

Apply -3.0dB gain +

+
0.595
+

Apply -4.5dB gain (default) +

+
0.500
+

Apply -6.0dB gain +

+
0.000
+

Silence Center Channel +

+
+ +
+
-ltrt_surmixlev level
+

Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the +surround channel(s) when downmixing to stereo in Lt/Rt mode. +

+
0.841
+

Apply -1.5dB gain +

+
0.707
+

Apply -3.0dB gain +

+
0.595
+

Apply -4.5dB gain +

+
0.500
+

Apply -6.0dB gain (default) +

+
0.000
+

Silence Surround Channel(s) +

+
+ +
+
-loro_cmixlev level
+

Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the +center channel when downmixing to stereo in Lo/Ro mode. +

+
1.414
+

Apply +3dB gain +

+
1.189
+

Apply +1.5dB gain +

+
1.000
+

Apply 0dB gain +

+
0.841
+

Apply -1.5dB gain +

+
0.707
+

Apply -3.0dB gain +

+
0.595
+

Apply -4.5dB gain (default) +

+
0.500
+

Apply -6.0dB gain +

+
0.000
+

Silence Center Channel +

+
+ +
+
-loro_surmixlev level
+

Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the +surround channel(s) when downmixing to stereo in Lo/Ro mode. +

+
0.841
+

Apply -1.5dB gain +

+
0.707
+

Apply -3.0dB gain +

+
0.595
+

Apply -4.5dB gain +

+
0.500
+

Apply -6.0dB gain (default) +

+
0.000
+

Silence Surround Channel(s) +

+
+ +
+
+ +
+
+

15.2.2.2 Extended Bitstream Information - Part 2

+ +
+
-dsurex_mode mode
+

Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX +(7.1 matrixed to 5.1). Using this option does NOT mean the encoder will actually +apply Dolby Surround EX processing. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
on
+

Dolby Surround EX Off +

+
2
+
off
+

Dolby Surround EX On +

+
+ +
+
-dheadphone_mode mode
+

Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone +encoding (multi-channel matrixed to 2.0 for use with headphones). Using this +option does NOT mean the encoder will actually apply Dolby Headphone +processing. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
on
+

Dolby Headphone Off +

+
2
+
off
+

Dolby Headphone On +

+
+ +
+
-ad_conv_type type
+

A/D Converter Type. Indicates whether the audio has passed through HDCD A/D +conversion. +

+
0
+
standard
+

Standard A/D Converter (default) +

+
1
+
hdcd
+

HDCD A/D Converter +

+
+ +
+
+ +
+
+
+

15.2.3 Other AC-3 Encoding Options

+ +
+
-stereo_rematrixing boolean
+

Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This +is an optional AC-3 feature that increases quality by selectively encoding +the left/right channels as mid/side. This option is enabled by default, and it +is highly recommended that it be left as enabled except for testing purposes. +

+
+
cutoff frequency
+

Set lowpass cutoff frequency. If unspecified, the encoder selects a default +determined by various other encoding parameters. +

+
+
+ +
+
+

15.2.4 Floating-Point-Only AC-3 Encoding Options

+ +

These options are only valid for the floating-point encoder and do not exist +for the fixed-point encoder due to the corresponding features not being +implemented in fixed-point. +

+
+
-channel_coupling boolean
+

Enables/Disables use of channel coupling, which is an optional AC-3 feature +that increases quality by combining high frequency information from multiple +channels into a single channel. The per-channel high frequency information is +sent with less accuracy in both the frequency and time domains. This allows +more bits to be used for lower frequencies while preserving enough information +to reconstruct the high frequencies. This option is enabled by default for the +floating-point encoder and should generally be left as enabled except for +testing purposes or to increase encoding speed. +

+
-1
+
auto
+

Selected by Encoder (default) +

+
0
+
off
+

Disable Channel Coupling +

+
1
+
on
+

Enable Channel Coupling +

+
+ +
+
-cpl_start_band number
+

Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a +value higher than the bandwidth is used, it will be reduced to 1 less than the +coupling end band. If auto is used, the start band will be determined by +the encoder based on the bit rate, sample rate, and channel layout. This option +has no effect if channel coupling is disabled. +

+
-1
+
auto
+

Selected by Encoder (default) +

+
+ +
+
+ +
+
+
+

15.3 flac

+ +

FLAC (Free Lossless Audio Codec) Encoder +

+ +
+

15.3.1 Options

+ +

The following options are supported by FFmpeg’s flac encoder. +

+
+
compression_level
+

Sets the compression level, which chooses defaults for many other options +if they are not set explicitly. Valid values are from 0 to 12, 5 is the +default. +

+
+
frame_size
+

Sets the size of the frames in samples per channel. +

+
+
lpc_coeff_precision
+

Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the +default. +

+
+
lpc_type
+

Sets the first stage LPC algorithm +

+
none
+

LPC is not used +

+
+
fixed
+

fixed LPC coefficients +

+
+
levinson
+
cholesky
+
+ +
+
lpc_passes
+

Number of passes to use for Cholesky factorization during LPC analysis +

+
+
min_partition_order
+

The minimum partition order +

+
+
max_partition_order
+

The maximum partition order +

+
+
prediction_order_method
+
+
estimation
+
2level
+
4level
+
8level
+
search
+

Bruteforce search +

+
log
+
+ +
+
ch_mode
+

Channel mode +

+
auto
+

The mode is chosen automatically for each frame +

+
indep
+

Channels are independently coded +

+
left_side
+
right_side
+
mid_side
+
+ +
+
exact_rice_parameters
+

Chooses if rice parameters are calculated exactly or approximately. +if set to 1 then they are chosen exactly, which slows the code down slightly and +improves compression slightly. +

+
+
multi_dim_quant
+

Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is +applied after the first stage to finetune the coefficients. This is quite slow +and slightly improves compression. +

+
+
+ +
+
+
+

15.4 opus

+ +

Opus encoder. +

+

This is a native FFmpeg encoder for the Opus format. Currently its in development and +only implements the CELT part of the codec. Its quality is usually worse and at best +is equal to the libopus encoder. +

+ +
+

15.4.1 Options

+ +
+
b
+

Set bit rate in bits/s. If unspecified it uses the number of channels and the layout +to make a good guess. +

+
+
opus_delay
+

Sets the maximum delay in milliseconds. Lower delays than 20ms will very quickly +decrease quality. +

+
+ +
+
+
+

15.5 libfdk_aac

+ +

libfdk-aac AAC (Advanced Audio Coding) encoder wrapper. +

+

The libfdk-aac library is based on the Fraunhofer FDK AAC code from +the Android project. +

+

Requires the presence of the libfdk-aac headers and library during +configuration. You need to explicitly configure the build with +--enable-libfdk-aac. The library is also incompatible with GPL, +so if you allow the use of GPL, you should configure with +--enable-gpl --enable-nonfree --enable-libfdk-aac. +

+

This encoder has support for the AAC-HE profiles. +

+

VBR encoding, enabled through the vbr or flags ++qscale options, is experimental and only works with some +combinations of parameters. +

+

Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or +higher. +

+

For more information see the fdk-aac project at +http://sourceforge.net/p/opencore-amr/fdk-aac/. +

+ +
+

15.5.1 Options

+ +

The following options are mapped on the shared FFmpeg codec options. +

+
+
b
+

Set bit rate in bits/s. If the bitrate is not explicitly specified, it +is automatically set to a suitable value depending on the selected +profile. +

+

In case VBR mode is enabled the option is ignored. +

+
+
ar
+

Set audio sampling rate (in Hz). +

+
+
channels
+

Set the number of audio channels. +

+
+
flags +qscale
+

Enable fixed quality, VBR (Variable Bit Rate) mode. +Note that VBR is implicitly enabled when the vbr value is +positive. +

+
+
cutoff
+

Set cutoff frequency. If not specified (or explicitly set to 0) it +will use a value automatically computed by the library. Default value +is 0. +

+
+
profile
+

Set audio profile. +

+

The following profiles are recognized: +

+
aac_low
+

Low Complexity AAC (LC) +

+
+
aac_he
+

High Efficiency AAC (HE-AAC) +

+
+
aac_he_v2
+

High Efficiency AAC version 2 (HE-AACv2) +

+
+
aac_ld
+

Low Delay AAC (LD) +

+
+
aac_eld
+

Enhanced Low Delay AAC (ELD) +

+
+ +

If not specified it is set to ‘aac_low’. +

+
+ +

The following are private options of the libfdk_aac encoder. +

+
+
afterburner
+

Enable afterburner feature if set to 1, disabled if set to 0. This +improves the quality but also the required processing power. +

+

Default value is 1. +

+
+
eld_sbr
+

Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled +if set to 0. +

+

Default value is 0. +

+
+
eld_v2
+

Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1, +disabled if set to 0. +

+

Note that option is available when fdk-aac version (AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2) > (4.0.0). +

+

Default value is 0. +

+
+
signaling
+

Set SBR/PS signaling style. +

+

It can assume one of the following values: +

+
default
+

choose signaling implicitly (explicit hierarchical by default, +implicit if global header is disabled) +

+
+
implicit
+

implicit backwards compatible signaling +

+
+
explicit_sbr
+

explicit SBR, implicit PS signaling +

+
+
explicit_hierarchical
+

explicit hierarchical signaling +

+
+ +

Default value is ‘default’. +

+
+
latm
+

Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0. +

+

Default value is 0. +

+
+
header_period
+

Set StreamMuxConfig and PCE repetition period (in frames) for sending +in-band configuration buffers within LATM/LOAS transport layer. +

+

Must be a 16-bits non-negative integer. +

+

Default value is 0. +

+
+
vbr
+

Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty +good) and 5 is highest quality. A value of 0 will disable VBR, and CBR +(Constant Bit Rate) is enabled. +

+

Currently only the ‘aac_low’ profile supports VBR encoding. +

+

VBR modes 1-5 correspond to roughly the following average bit rates: +

+
+
1
+

32 kbps/channel +

+
2
+

40 kbps/channel +

+
3
+

48-56 kbps/channel +

+
4
+

64 kbps/channel +

+
5
+

about 80-96 kbps/channel +

+
+ +

Default value is 0. +

+
+
frame_length
+

Set the audio frame length in samples. Default value is the internal +default of the library. Refer to the library’s documentation for information +about supported values. +

+
+ +
+
+

15.5.2 Examples

+ +
    +
  • Use ffmpeg to convert an audio file to VBR AAC in an M4A (MP4) +container: +
    +
    ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
    +
    + +
  • Use ffmpeg to convert an audio file to CBR 64k kbps AAC, using the +High-Efficiency AAC profile: +
    +
    ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
    +
    +
+ +
+
+
+

15.6 libmp3lame

+ +

LAME (Lame Ain’t an MP3 Encoder) MP3 encoder wrapper. +

+

Requires the presence of the libmp3lame headers and library during +configuration. You need to explicitly configure the build with +--enable-libmp3lame. +

+

See libshine for a fixed-point MP3 encoder, although with a +lower quality. +

+ +
+

15.6.1 Options

+ +

The following options are supported by the libmp3lame wrapper. The +lame-equivalent of the options are listed in parentheses. +

+
+
b (-b)
+

Set bitrate expressed in bits/s for CBR or ABR. LAME bitrate is +expressed in kilobits/s. +

+
+
q (-V)
+

Set constant quality setting for VBR. This option is valid only +using the ffmpeg command-line tool. For library interface +users, use global_quality. +

+
+
compression_level (-q)
+

Set algorithm quality. Valid arguments are integers in the 0-9 range, +with 0 meaning highest quality but slowest, and 9 meaning fastest +while producing the worst quality. +

+
+
cutoff (--lowpass)
+

Set lowpass cutoff frequency. If unspecified, the encoder dynamically +adjusts the cutoff. +

+
+
reservoir
+

Enable use of bit reservoir when set to 1. Default value is 1. LAME +has this enabled by default, but can be overridden by use +--nores option. +

+
+
joint_stereo (-m j)
+

Enable the encoder to use (on a frame by frame basis) either L/R +stereo or mid/side stereo. Default value is 1. +

+
+
abr (--abr)
+

Enable the encoder to use ABR when set to 1. The lame +--abr sets the target bitrate, while this options only +tells FFmpeg to use ABR still relies on b to set bitrate. +

+
+
copyright (-c)
+

Set MPEG audio copyright flag when set to 1. The default value is 0 +(disabled). +

+
+
original (-o)
+

Set MPEG audio original flag when set to 1. The default value is 1 +(enabled). +

+
+ +
+
+
+

15.7 libopencore-amrnb

+ +

OpenCORE Adaptive Multi-Rate Narrowband encoder. +

+

Requires the presence of the libopencore-amrnb headers and library during +configuration. You need to explicitly configure the build with +--enable-libopencore-amrnb --enable-version3. +

+

This is a mono-only encoder. Officially it only supports 8000Hz sample rate, +but you can override it by setting strict to ‘unofficial’ or +lower. +

+ +
+

15.7.1 Options

+ +
+
b
+

Set bitrate in bits per second. Only the following bitrates are supported, +otherwise libavcodec will round to the nearest valid bitrate. +

+
+
4750
+
5150
+
5900
+
6700
+
7400
+
7950
+
10200
+
12200
+
+ +
+
dtx
+

Allow discontinuous transmission (generate comfort noise) when set to 1. The +default value is 0 (disabled). +

+
+
+ +
+
+
+

15.8 libopus

+ +

libopus Opus Interactive Audio Codec encoder wrapper. +

+

Requires the presence of the libopus headers and library during +configuration. You need to explicitly configure the build with +--enable-libopus. +

+ +
+

15.8.1 Option Mapping

+ +

Most libopus options are modelled after the opusenc utility from +opus-tools. The following is an option mapping chart describing options +supported by the libopus wrapper, and their opusenc-equivalent +in parentheses. +

+
+
b (bitrate)
+

Set the bit rate in bits/s. FFmpeg’s b option is +expressed in bits/s, while opusenc’s bitrate in +kilobits/s. +

+
+
vbr (vbr, hard-cbr, and cvbr)
+

Set VBR mode. The FFmpeg vbr option has the following +valid arguments, with the opusenc equivalent options +in parentheses: +

+
+
off (hard-cbr)
+

Use constant bit rate encoding. +

+
+
on (vbr)
+

Use variable bit rate encoding (the default). +

+
+
constrained (cvbr)
+

Use constrained variable bit rate encoding. +

+
+ +
+
compression_level (comp)
+

Set encoding algorithm complexity. Valid options are integers in +the 0-10 range. 0 gives the fastest encodes but lower quality, while 10 +gives the highest quality but slowest encoding. The default is 10. +

+
+
frame_duration (framesize)
+

Set maximum frame size, or duration of a frame in milliseconds. The +argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller +frame sizes achieve lower latency but less quality at a given bitrate. +Sizes greater than 20ms are only interesting at fairly low bitrates. +The default is 20ms. +

+
+
packet_loss (expect-loss)
+

Set expected packet loss percentage. The default is 0. +

+
+
fec (n/a)
+

Enable inband forward error correction. packet_loss must be non-zero +to take advantage - frequency of FEC ’side-data’ is proportional to expected packet loss. +Default is disabled. +

+
+
application (N.A.)
+

Set intended application type. Valid options are listed below: +

+
+
voip
+

Favor improved speech intelligibility. +

+
audio
+

Favor faithfulness to the input (the default). +

+
lowdelay
+

Restrict to only the lowest delay modes. +

+
+ +
+
cutoff (N.A.)
+

Set cutoff bandwidth in Hz. The argument must be exactly one of the +following: 4000, 6000, 8000, 12000, or 20000, corresponding to +narrowband, mediumband, wideband, super wideband, and fullband +respectively. The default is 0 (cutoff disabled). +

+
+
mapping_family (mapping_family)
+

Set channel mapping family to be used by the encoder. The default value of -1 +uses mapping family 0 for mono and stereo inputs, and mapping family 1 +otherwise. The default also disables the surround masking and LFE bandwidth +optimzations in libopus, and requires that the input contains 8 channels or +fewer. +

+

Other values include 0 for mono and stereo, 1 for surround sound with masking +and LFE bandwidth optimizations, and 255 for independent streams with an +unspecified channel layout. +

+
+
apply_phase_inv (N.A.) (requires libopus >= 1.2)
+

If set to 0, disables the use of phase inversion for intensity stereo, +improving the quality of mono downmixes, but slightly reducing normal stereo +quality. The default is 1 (phase inversion enabled). +

+
+
+ +
+
+
+

15.9 libshine

+ +

Shine Fixed-Point MP3 encoder wrapper. +

+

Shine is a fixed-point MP3 encoder. It has a far better performance on +platforms without an FPU, e.g. armel CPUs, and some phones and tablets. +However, as it is more targeted on performance than quality, it is not on par +with LAME and other production-grade encoders quality-wise. Also, according to +the project’s homepage, this encoder may not be free of bugs as the code was +written a long time ago and the project was dead for at least 5 years. +

+

This encoder only supports stereo and mono input. This is also CBR-only. +

+

The original project (last updated in early 2007) is at +http://sourceforge.net/projects/libshine-fxp/. We only support the +updated fork by the Savonet/Liquidsoap project at https://github.com/savonet/shine. +

+

Requires the presence of the libshine headers and library during +configuration. You need to explicitly configure the build with +--enable-libshine. +

+

See also libmp3lame. +

+ +
+

15.9.1 Options

+ +

The following options are supported by the libshine wrapper. The +shineenc-equivalent of the options are listed in parentheses. +

+
+
b (-b)
+

Set bitrate expressed in bits/s for CBR. shineenc -b option +is expressed in kilobits/s. +

+
+
+ +
+
+
+

15.10 libtwolame

+ +

TwoLAME MP2 encoder wrapper. +

+

Requires the presence of the libtwolame headers and library during +configuration. You need to explicitly configure the build with +--enable-libtwolame. +

+ +
+

15.10.1 Options

+ +

The following options are supported by the libtwolame wrapper. The +twolame-equivalent options follow the FFmpeg ones and are in +parentheses. +

+
+
b (-b)
+

Set bitrate expressed in bits/s for CBR. twolame b +option is expressed in kilobits/s. Default value is 128k. +

+
+
q (-V)
+

Set quality for experimental VBR support. Maximum value range is +from -50 to 50, useful range is from -10 to 10. The higher the +value, the better the quality. This option is valid only using the +ffmpeg command-line tool. For library interface users, +use global_quality. +

+
+
mode (--mode)
+

Set the mode of the resulting audio. Possible values: +

+
+
auto
+

Choose mode automatically based on the input. This is the default. +

+
stereo
+

Stereo +

+
joint_stereo
+

Joint stereo +

+
dual_channel
+

Dual channel +

+
mono
+

Mono +

+
+ +
+
psymodel (--psyc-mode)
+

Set psychoacoustic model to use in encoding. The argument must be +an integer between -1 and 4, inclusive. The higher the value, the +better the quality. The default value is 3. +

+
+
energy_levels (--energy)
+

Enable energy levels extensions when set to 1. The default value is +0 (disabled). +

+
+
error_protection (--protect)
+

Enable CRC error protection when set to 1. The default value is 0 +(disabled). +

+
+
copyright (--copyright)
+

Set MPEG audio copyright flag when set to 1. The default value is 0 +(disabled). +

+
+
original (--original)
+

Set MPEG audio original flag when set to 1. The default value is 0 +(disabled). +

+
+
+ +
+
+
+

15.11 libvo-amrwbenc

+ +

VisualOn Adaptive Multi-Rate Wideband encoder. +

+

Requires the presence of the libvo-amrwbenc headers and library during +configuration. You need to explicitly configure the build with +--enable-libvo-amrwbenc --enable-version3. +

+

This is a mono-only encoder. Officially it only supports 16000Hz sample +rate, but you can override it by setting strict to +‘unofficial’ or lower. +

+ +
+

15.11.1 Options

+ +
+
b
+

Set bitrate in bits/s. Only the following bitrates are supported, otherwise +libavcodec will round to the nearest valid bitrate. +

+
+
6600
+
8850
+
12650
+
14250
+
15850
+
18250
+
19850
+
23050
+
23850
+
+ +
+
dtx
+

Allow discontinuous transmission (generate comfort noise) when set to 1. The +default value is 0 (disabled). +

+
+
+ +
+
+
+

15.12 libvorbis

+ +

libvorbis encoder wrapper. +

+

Requires the presence of the libvorbisenc headers and library during +configuration. You need to explicitly configure the build with +--enable-libvorbis. +

+ +
+

15.12.1 Options

+ +

The following options are supported by the libvorbis wrapper. The +oggenc-equivalent of the options are listed in parentheses. +

+

To get a more accurate and extensive documentation of the libvorbis +options, consult the libvorbisenc’s and oggenc’s documentations. +See http://xiph.org/vorbis/, +http://wiki.xiph.org/Vorbis-tools, and oggenc(1). +

+
+
b (-b)
+

Set bitrate expressed in bits/s for ABR. oggenc -b is +expressed in kilobits/s. +

+
+
q (-q)
+

Set constant quality setting for VBR. The value should be a float +number in the range of -1.0 to 10.0. The higher the value, the better +the quality. The default value is ‘3.0’. +

+

This option is valid only using the ffmpeg command-line tool. +For library interface users, use global_quality. +

+
+
cutoff (--advanced-encode-option lowpass_frequency=N)
+

Set cutoff bandwidth in Hz, a value of 0 disables cutoff. oggenc’s +related option is expressed in kHz. The default value is ‘0’ (cutoff +disabled). +

+
+
minrate (-m)
+

Set minimum bitrate expressed in bits/s. oggenc -m is +expressed in kilobits/s. +

+
+
maxrate (-M)
+

Set maximum bitrate expressed in bits/s. oggenc -M is +expressed in kilobits/s. This only has effect on ABR mode. +

+
+
iblock (--advanced-encode-option impulse_noisetune=N)
+

Set noise floor bias for impulse blocks. The value is a float number from +-15.0 to 0.0. A negative bias instructs the encoder to pay special attention +to the crispness of transients in the encoded audio. The tradeoff for better +transient response is a higher bitrate. +

+
+
+ +
+
+
+

15.13 mjpeg

+ +

Motion JPEG encoder. +

+ +
+

15.13.1 Options

+ +
+
huffman
+

Set the huffman encoding strategy. Possible values: +

+
+
default
+

Use the default huffman tables. This is the default strategy. +

+
+
optimal
+

Compute and use optimal huffman tables. +

+
+
+
+
+ +
+
+
+

15.14 wavpack

+ +

WavPack lossless audio encoder. +

+ +
+

15.14.1 Options

+ +

The equivalent options for wavpack command line utility are listed in +parentheses. +

+ +
+

15.14.1.1 Shared options

+ +

The following shared options are effective for this encoder. Only special notes +about this particular encoder will be documented here. For the general meaning +of the options, see the Codec Options chapter. +

+
+
frame_size (--blocksize)
+

For this encoder, the range for this option is between 128 and 131072. Default +is automatically decided based on sample rate and number of channel. +

+

For the complete formula of calculating default, see +libavcodec/wavpackenc.c. +

+
+
compression_level (-f, -h, -hh, and -x)
+
+ +
+
+

15.14.1.2 Private options

+ +
+
joint_stereo (-j)
+

Set whether to enable joint stereo. Valid values are: +

+
+
on (1)
+

Force mid/side audio encoding. +

+
off (0)
+

Force left/right audio encoding. +

+
auto
+

Let the encoder decide automatically. +

+
+ +
+
optimize_mono
+

Set whether to enable optimization for mono. This option is only effective for +non-mono streams. Available values: +

+
+
on
+

enabled +

+
off
+

disabled +

+
+ +
+
+ + +
+
+
+
+
+

16 Video Encoders

+ +

A description of some of the currently available video encoders +follows. +

+ +
+

16.1 a64_multi, a64_multi5

+ +

A64 / Commodore 64 multicolor charset encoder. a64_multi5 is extended with 5th color (colram). +

+
+
+

16.2 Cinepak

+ +

Cinepak aka CVID encoder. +Compatible with Windows 3.1 and vintage MacOS. +

+ +
+

16.2.1 Options

+ +
+
g integer
+

Keyframe interval. +A keyframe is inserted at least every -g frames, sometimes sooner. +

+
+
q:v integer
+

Quality factor. Lower is better. Higher gives lower bitrate. +The following table lists bitrates when encoding akiyo_cif.y4m for various values of -q:v with -g 100: +

+
+
-q:v 1 1918 kb/s
+
-q:v 2 1735 kb/s
+
-q:v 4 1500 kb/s
+
-q:v 10 1041 kb/s
+
-q:v 20 826 kb/s
+
-q:v 40 553 kb/s
+
-q:v 100 394 kb/s
+
-q:v 200 312 kb/s
+
-q:v 400 266 kb/s
+
-q:v 1000 237 kb/s
+
+ +
+
max_extra_cb_iterations integer
+

Max extra codebook recalculation passes, more is better and slower. +

+
+
skip_empty_cb boolean
+

Avoid wasting bytes, ignore vintage MacOS decoder. +

+
+
max_strips integer
+
min_strips integer
+

The minimum and maximum number of strips to use. +Wider range sometimes improves quality. +More strips is generally better quality but costs more bits. +Fewer strips tend to yield more keyframes. +Vintage compatible is 1..3. +

+
+
strip_number_adaptivity integer
+

How much number of strips is allowed to change between frames. +Higher is better but slower. +

+
+
+ +
+
+
+

16.3 GIF

+ +

GIF image/animation encoder. +

+ +
+

16.3.1 Options

+ +
+
gifflags integer
+

Sets the flags used for GIF encoding. +

+
+
offsetting
+

Enables picture offsetting. +

+

Default is enabled. +

+
+
transdiff
+

Enables transparency detection between frames. +

+

Default is enabled. +

+
+
+ +
+
gifimage integer
+

Enables encoding one full GIF image per frame, rather than an animated GIF. +

+

Default value is 0. +

+
+
global_palette integer
+

Writes a palette to the global GIF header where feasible. +

+

If disabled, every frame will always have a palette written, even if there +is a global palette supplied. +

+

Default value is 1. +

+
+
+ +
+
+
+

16.4 Hap

+ +

Vidvox Hap video encoder. +

+ +
+

16.4.1 Options

+ +
+
format integer
+

Specifies the Hap format to encode. +

+
+
hap
+
hap_alpha
+
hap_q
+
+ +

Default value is hap. +

+
+
chunks integer
+

Specifies the number of chunks to split frames into, between 1 and 64. This +permits multithreaded decoding of large frames, potentially at the cost of +data-rate. The encoder may modify this value to divide frames evenly. +

+

Default value is 1. +

+
+
compressor integer
+

Specifies the second-stage compressor to use. If set to none, +chunks will be limited to 1, as chunked uncompressed frames offer no +benefit. +

+
+
none
+
snappy
+
+ +

Default value is snappy. +

+
+
+ +
+
+
+

16.5 jpeg2000

+ +

The native jpeg 2000 encoder is lossy by default, the -q:v +option can be used to set the encoding quality. Lossless encoding +can be selected with -pred 1. +

+ +
+

16.5.1 Options

+ +
+
format integer
+

Can be set to either j2k or jp2 (the default) that +makes it possible to store non-rgb pix_fmts. +

+
+
tile_width integer
+

Sets tile width. Range is 1 to 1073741824. Default is 256. +

+
+
tile_height integer
+

Sets tile height. Range is 1 to 1073741824. Default is 256. +

+
+
pred integer
+

Allows setting the discrete wavelet transform (DWT) type +

+
dwt97int (Lossy)
+
dwt53 (Lossless)
+
+

Default is dwt97int +

+
+
sop boolean
+

Enable this to add SOP marker at the start of each packet. Disabled by default. +

+
+
eph boolean
+

Enable this to add EPH marker at the end of each packet header. Disabled by default. +

+
+
prog integer
+

Sets the progression order to be used by the encoder. +Possible values are: +

+
lrcp
+
rlcp
+
rpcl
+
pcrl
+
cprl
+
+

Set to lrcp by default. +

+
+
layer_rates string
+

By default, when this option is not used, compression is done using the quality metric. +This option allows for compression using compression ratio. The compression ratio for each +level could be specified. The compression ratio of a layer l species the what ratio of +total file size is contained in the first l layers. +

+

Example usage: +

+
+
ffmpeg -i input.bmp -c:v jpeg2000 -layer_rates "100,10,1" output.j2k
+
+ +

This would compress the image to contain 3 layers, where the data contained in the +first layer would be compressed by 1000 times, compressed by 100 in the first two layers, +and shall contain all data while using all 3 layers. +

+
+
+ +
+
+
+

16.6 librav1e

+ +

rav1e AV1 encoder wrapper. +

+

Requires the presence of the rav1e headers and library during configuration. +You need to explicitly configure the build with --enable-librav1e. +

+ +
+

16.6.1 Options

+ +
+
qmax
+

Sets the maximum quantizer to use when using bitrate mode. +

+
+
qmin
+

Sets the minimum quantizer to use when using bitrate mode. +

+
+
qp
+

Uses quantizer mode to encode at the given quantizer (0-255). +

+
+
speed
+

Selects the speed preset (0-10) to encode with. +

+
+
tiles
+

Selects how many tiles to encode with. +

+
+
tile-rows
+

Selects how many rows of tiles to encode with. +

+
+
tile-columns
+

Selects how many columns of tiles to encode with. +

+
+
rav1e-params
+

Set rav1e options using a list of key=value pairs separated +by ":". See rav1e --help for a list of options. +

+

For example to specify librav1e encoding options with -rav1e-params: +

+
+
ffmpeg -i input -c:v librav1e -b:v 500K -rav1e-params speed=5:low_latency=true output.mp4
+
+ +
+
+ +
+
+
+

16.7 libaom-av1

+ +

libaom AV1 encoder wrapper. +

+

Requires the presence of the libaom headers and library during +configuration. You need to explicitly configure the build with +--enable-libaom. +

+ +
+

16.7.1 Options

+ +

The wrapper supports the following standard libavcodec options: +

+
+
b
+

Set bitrate target in bits/second. By default this will use +variable-bitrate mode. If maxrate and minrate are +also set to the same value then it will use constant-bitrate mode, +otherwise if crf is set as well then it will use +constrained-quality mode. +

+
+
g keyint_min
+

Set key frame placement. The GOP size sets the maximum distance between +key frames; if zero the output stream will be intra-only. The minimum +distance is ignored unless it is the same as the GOP size, in which case +key frames will always appear at a fixed interval. Not set by default, +so without this option the library has completely free choice about +where to place key frames. +

+
+
qmin qmax
+

Set minimum/maximum quantisation values. Valid range is from 0 to 63 +(warning: this does not match the quantiser values actually used by AV1 +- divide by four to map real quantiser values to this range). Defaults +to min/max (no constraint). +

+
+
minrate maxrate bufsize rc_init_occupancy
+

Set rate control buffering parameters. Not used if not set - defaults +to unconstrained variable bitrate. +

+
+
threads
+

Set the number of threads to use while encoding. This may require the +tiles or row-mt options to also be set to actually +use the specified number of threads fully. Defaults to the number of +hardware threads supported by the host machine. +

+
+
profile
+

Set the encoding profile. Defaults to using the profile which matches +the bit depth and chroma subsampling of the input. +

+
+
+ +

The wrapper also has some specific options: +

+
+
cpu-used
+

Set the quality/encoding speed tradeoff. Valid range is from 0 to 8, +higher numbers indicating greater speed and lower quality. The default +value is 1, which will be slow and high quality. +

+
+
auto-alt-ref
+

Enable use of alternate reference frames. Defaults to the internal +default of the library. +

+
+
arnr-max-frames (frames)
+

Set altref noise reduction max frame count. Default is -1. +

+
+
arnr-strength (strength)
+

Set altref noise reduction filter strength. Range is -1 to 6. Default is -1. +

+
+
aq-mode (aq-mode)
+

Set adaptive quantization mode. Possible values: +

+
+
none (0)
+

Disabled. +

+
+
variance (1)
+

Variance-based. +

+
+
complexity (2)
+

Complexity-based. +

+
+
cyclic (3)
+

Cyclic refresh. +

+
+ +
+
tune (tune)
+

Set the distortion metric the encoder is tuned with. Default is psnr. +

+
+
psnr (0)
+
ssim (1)
+
+ +
+
lag-in-frames
+

Set the maximum number of frames which the encoder may keep in flight +at any one time for lookahead purposes. Defaults to the internal +default of the library. +

+
+
error-resilience
+

Enable error resilience features: +

+
default
+

Improve resilience against losses of whole frames. +

+
+

Not enabled by default. +

+
+
crf
+

Set the quality/size tradeoff for constant-quality (no bitrate target) +and constrained-quality (with maximum bitrate target) modes. Valid +range is 0 to 63, higher numbers indicating lower quality and smaller +output size. Only used if set; by default only the bitrate target is +used. +

+
+
static-thresh
+

Set a change threshold on blocks below which they will be skipped by +the encoder. Defined in arbitrary units as a nonnegative integer, +defaulting to zero (no blocks are skipped). +

+
+
drop-threshold
+

Set a threshold for dropping frames when close to rate control bounds. +Defined as a percentage of the target buffer - when the rate control +buffer falls below this percentage, frames will be dropped until it +has refilled above the threshold. Defaults to zero (no frames are +dropped). +

+
+
denoise-noise-level (level)
+

Amount of noise to be removed for grain synthesis. Grain synthesis is disabled if +this option is not set or set to 0. +

+
+
denoise-block-size (pixels)
+

Block size used for denoising for grain synthesis. If not set, AV1 codec +uses the default value of 32. +

+
+
undershoot-pct (pct)
+

Set datarate undershoot (min) percentage of the target bitrate. Range is -1 to 100. +Default is -1. +

+
+
overshoot-pct (pct)
+

Set datarate overshoot (max) percentage of the target bitrate. Range is -1 to 1000. +Default is -1. +

+
+
minsection-pct (pct)
+

Minimum percentage variation of the GOP bitrate from the target bitrate. If minsection-pct +is not set, the libaomenc wrapper computes it as follows: (minrate * 100 / bitrate). +Range is -1 to 100. Default is -1 (unset). +

+
+
maxsection-pct (pct)
+

Maximum percentage variation of the GOP bitrate from the target bitrate. If maxsection-pct +is not set, the libaomenc wrapper computes it as follows: (maxrate * 100 / bitrate). +Range is -1 to 5000. Default is -1 (unset). +

+
+
frame-parallel (boolean)
+

Enable frame parallel decodability features. Default is true. +

+
+
tiles
+

Set the number of tiles to encode the input video with, as columns x +rows. Larger numbers allow greater parallelism in both encoding and +decoding, but may decrease coding efficiency. Defaults to the minimum +number of tiles required by the size of the input video (this is 1x1 +(that is, a single tile) for sizes up to and including 4K). +

+
+
tile-columns tile-rows
+

Set the number of tiles as log2 of the number of tile rows and columns. +Provided for compatibility with libvpx/VP9. +

+
+
row-mt (Requires libaom >= 1.0.0-759-g90a15f4f2)
+

Enable row based multi-threading. Disabled by default. +

+
+
enable-cdef (boolean)
+

Enable Constrained Directional Enhancement Filter. The libaom-av1 +encoder enables CDEF by default. +

+
+
enable-restoration (boolean)
+

Enable Loop Restoration Filter. Default is true for libaom-av1. +

+
+
enable-global-motion (boolean)
+

Enable the use of global motion for block prediction. Default is true. +

+
+
enable-intrabc (boolean)
+

Enable block copy mode for intra block prediction. This mode is +useful for screen content. Default is true. +

+
+
enable-rect-partitions (boolean) (Requires libaom >= v2.0.0)
+

Enable rectangular partitions. Default is true. +

+
+
enable-1to4-partitions (boolean) (Requires libaom >= v2.0.0)
+

Enable 1:4/4:1 partitions. Default is true. +

+
+
enable-ab-partitions (boolean) (Requires libaom >= v2.0.0)
+

Enable AB shape partitions. Default is true. +

+
+
enable-angle-delta (boolean) (Requires libaom >= v2.0.0)
+

Enable angle delta intra prediction. Default is true. +

+
+
enable-cfl-intra (boolean) (Requires libaom >= v2.0.0)
+

Enable chroma predicted from luma intra prediction. Default is true. +

+
+
enable-filter-intra (boolean) (Requires libaom >= v2.0.0)
+

Enable filter intra predictor. Default is true. +

+
+
enable-intra-edge-filter (boolean) (Requires libaom >= v2.0.0)
+

Enable intra edge filter. Default is true. +

+
+
enable-smooth-intra (boolean) (Requires libaom >= v2.0.0)
+

Enable smooth intra prediction mode. Default is true. +

+
+
enable-paeth-intra (boolean) (Requires libaom >= v2.0.0)
+

Enable paeth predictor in intra prediction. Default is true. +

+
+
enable-palette (boolean) (Requires libaom >= v2.0.0)
+

Enable palette prediction mode. Default is true. +

+
+
enable-flip-idtx (boolean) (Requires libaom >= v2.0.0)
+

Enable extended transform type, including FLIPADST_DCT, DCT_FLIPADST, +FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT, +V_ADST, H_ADST, V_FLIPADST, H_FLIPADST. Default is true. +

+
+
enable-tx64 (boolean) (Requires libaom >= v2.0.0)
+

Enable 64-pt transform. Default is true. +

+
+
reduced-tx-type-set (boolean) (Requires libaom >= v2.0.0)
+

Use reduced set of transform types. Default is false. +

+
+
use-intra-dct-only (boolean) (Requires libaom >= v2.0.0)
+

Use DCT only for INTRA modes. Default is false. +

+
+
use-inter-dct-only (boolean) (Requires libaom >= v2.0.0)
+

Use DCT only for INTER modes. Default is false. +

+
+
use-intra-default-tx-only (boolean) (Requires libaom >= v2.0.0)
+

Use Default-transform only for INTRA modes. Default is false. +

+
+
enable-ref-frame-mvs (boolean) (Requires libaom >= v2.0.0)
+

Enable temporal mv prediction. Default is true. +

+
+
enable-reduced-reference-set (boolean) (Requires libaom >= v2.0.0)
+

Use reduced set of single and compound references. Default is false. +

+
+
enable-obmc (boolean) (Requires libaom >= v2.0.0)
+

Enable obmc. Default is true. +

+
+
enable-dual-filter (boolean) (Requires libaom >= v2.0.0)
+

Enable dual filter. Default is true. +

+
+
enable-diff-wtd-comp (boolean) (Requires libaom >= v2.0.0)
+

Enable difference-weighted compound. Default is true. +

+
+
enable-dist-wtd-comp (boolean) (Requires libaom >= v2.0.0)
+

Enable distance-weighted compound. Default is true. +

+
+
enable-onesided-comp (boolean) (Requires libaom >= v2.0.0)
+

Enable one sided compound. Default is true. +

+
+
enable-interinter-wedge (boolean) (Requires libaom >= v2.0.0)
+

Enable interinter wedge compound. Default is true. +

+
+
enable-interintra-wedge (boolean) (Requires libaom >= v2.0.0)
+

Enable interintra wedge compound. Default is true. +

+
+
enable-masked-comp (boolean) (Requires libaom >= v2.0.0)
+

Enable masked compound. Default is true. +

+
+
enable-interintra-comp (boolean) (Requires libaom >= v2.0.0)
+

Enable interintra compound. Default is true. +

+
+
enable-smooth-interintra (boolean) (Requires libaom >= v2.0.0)
+

Enable smooth interintra mode. Default is true. +

+
+
aom-params
+

Set libaom options using a list of key=value pairs separated +by ":". For a list of supported options, see aomenc --help under the +section "AV1 Specific Options". +

+

For example to specify libaom encoding options with -aom-params: +

+
+
ffmpeg -i input -c:v libaom-av1 -b:v 500K -aom-params tune=psnr:enable-tpl-model=1 output.mp4
+
+ +
+
+ +
+
+
+

16.8 libsvtav1

+ +

SVT-AV1 encoder wrapper. +

+

Requires the presence of the SVT-AV1 headers and library during configuration. +You need to explicitly configure the build with --enable-libsvtav1. +

+ +
+

16.8.1 Options

+ +
+
profile
+

Set the encoding profile. +

+
main
+
high
+
professional
+
+ +
+
level
+

Set the operating point level. For example: ’4.0’ +

+
+
hielevel
+

Set the Hierarchical prediction levels. +

+
3level
+
4level
+

This is the default. +

+
+ +
+
tier
+

Set the operating point tier. +

+
main
+

This is the default. +

+
high
+
+ +
+
qmax
+

Set the maximum quantizer to use when using a bitrate mode. +

+
+
qmin
+

Set the minimum quantizer to use when using a bitrate mode. +

+
+
crf
+

Constant rate factor value used in crf rate control mode (0-63). +

+
+
qp
+

Set the quantizer used in cqp rate control mode (0-63). +

+
+
sc_detection
+

Enable scene change detection. +

+
+
la_depth
+

Set number of frames to look ahead (0-120). +

+
+
preset
+

Set the quality-speed tradeoff, in the range 0 to 13. Higher values are +faster but lower quality. +

+
+
tile_rows
+

Set log2 of the number of rows of tiles to use (0-6). +

+
+
tile_columns
+

Set log2 of the number of columns of tiles to use (0-4). +

+
+
svtav1-params
+

Set SVT-AV1 options using a list of key=value pairs separated +by ":". See the SVT-AV1 encoder user guide for a list of accepted parameters. +

+
+
+ +
+
+
+

16.9 libjxl

+ +

libjxl JPEG XL encoder wrapper. +

+

Requires the presence of the libjxl headers and library during +configuration. You need to explicitly configure the build with +--enable-libjxl. +

+ +
+

16.9.1 Options

+ +

The libjxl wrapper supports the following options: +

+
+
distance
+

Set the target Butteraugli distance. This is a quality setting: lower +distance yields higher quality, with distance=1.0 roughly comparable to +libjpeg Quality 90 for photographic content. Setting distance=0.0 yields +true lossless encoding. Valid values range between 0.0 and 15.0, and sane +values rarely exceed 5.0. Setting distance=0.1 usually attains +transparency for most input. The default is 1.0. +

+
+
effort
+

Set the encoding effort used. Higher effort values produce more consistent +quality and usually produces a better quality/bpp curve, at the cost of +more CPU time required. Valid values range from 1 to 9, and the default is 7. +

+
+
modular
+

Force the encoder to use Modular mode instead of choosing automatically. The +default is to use VarDCT for lossy encoding and Modular for lossless. VarDCT +is generally superior to Modular for lossy encoding but does not support +lossless encoding. +

+
+
+ +
+
+
+

16.10 libkvazaar

+ +

Kvazaar H.265/HEVC encoder. +

+

Requires the presence of the libkvazaar headers and library during +configuration. You need to explicitly configure the build with +--enable-libkvazaar. +

+ +
+

16.10.1 Options

+ +
+
b
+

Set target video bitrate in bit/s and enable rate control. +

+
+
kvazaar-params
+

Set kvazaar parameters as a list of name=value pairs separated +by commas (,). See kvazaar documentation for a list of options. +

+
+
+ +
+
+
+

16.11 libopenh264

+ +

Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper. +

+

This encoder requires the presence of the libopenh264 headers and +library during configuration. You need to explicitly configure the +build with --enable-libopenh264. The library is detected using +pkg-config. +

+

For more information about the library see +http://www.openh264.org. +

+ +
+

16.11.1 Options

+ +

The following FFmpeg global options affect the configurations of the +libopenh264 encoder. +

+
+
b
+

Set the bitrate (as a number of bits per second). +

+
+
g
+

Set the GOP size. +

+
+
maxrate
+

Set the max bitrate (as a number of bits per second). +

+
+
flags +global_header
+

Set global header in the bitstream. +

+
+
slices
+

Set the number of slices, used in parallelized encoding. Default value +is 0. This is only used when slice_mode is set to +‘fixed’. +

+
+
loopfilter
+

Enable loop filter, if set to 1 (automatically enabled). To disable +set a value of 0. +

+
+
profile
+

Set profile restrictions. If set to the value of ‘main’ enable +CABAC (set the SEncParamExt.iEntropyCodingModeFlag flag to 1). +

+
+
max_nal_size
+

Set maximum NAL size in bytes. +

+
+
allow_skip_frames
+

Allow skipping frames to hit the target bitrate if set to 1. +

+
+ +
+
+
+

16.12 libtheora

+ +

libtheora Theora encoder wrapper. +

+

Requires the presence of the libtheora headers and library during +configuration. You need to explicitly configure the build with +--enable-libtheora. +

+

For more information about the libtheora project see +http://www.theora.org/. +

+ +
+

16.12.1 Options

+ +

The following global options are mapped to internal libtheora options +which affect the quality and the bitrate of the encoded stream. +

+
+
b
+

Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In +case VBR (Variable Bit Rate) mode is enabled this option is ignored. +

+
+
flags
+

Used to enable constant quality mode (VBR) encoding through the +qscale flag, and to enable the pass1 and pass2 +modes. +

+
+
g
+

Set the GOP size. +

+
+
global_quality
+

Set the global quality as an integer in lambda units. +

+

Only relevant when VBR mode is enabled with flags +qscale. The +value is converted to QP units by dividing it by FF_QP2LAMBDA, +clipped in the [0 - 10] range, and then multiplied by 6.3 to get a +value in the native libtheora range [0-63]. A higher value corresponds +to a higher quality. +

+
+
q
+

Enable VBR mode when set to a non-negative value, and set constant +quality value as a double floating point value in QP units. +

+

The value is clipped in the [0-10] range, and then multiplied by 6.3 +to get a value in the native libtheora range [0-63]. +

+

This option is valid only using the ffmpeg command-line +tool. For library interface users, use global_quality. +

+
+ +
+
+

16.12.2 Examples

+ +
    +
  • Set maximum constant quality (VBR) encoding with ffmpeg: +
    +
    ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
    +
    + +
  • Use ffmpeg to convert a CBR 1000 kbps Theora video stream: +
    +
    ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
    +
    +
+ +
+
+
+

16.13 libvpx

+ +

VP8/VP9 format supported through libvpx. +

+

Requires the presence of the libvpx headers and library during configuration. +You need to explicitly configure the build with --enable-libvpx. +

+ +
+

16.13.1 Options

+ +

The following options are supported by the libvpx wrapper. The +vpxenc-equivalent options or values are listed in parentheses +for easy migration. +

+

To reduce the duplication of documentation, only the private options +and some others requiring special attention are documented here. For +the documentation of the undocumented generic options, see +the Codec Options chapter. +

+

To get more documentation of the libvpx options, invoke the command +ffmpeg -h encoder=libvpx, ffmpeg -h encoder=libvpx-vp9 or +vpxenc --help. Further information is available in the libvpx API +documentation. +

+
+
b (target-bitrate)
+

Set bitrate in bits/s. Note that FFmpeg’s b option is +expressed in bits/s, while vpxenc’s target-bitrate is in +kilobits/s. +

+
+
g (kf-max-dist)
+
keyint_min (kf-min-dist)
+
qmin (min-q)
+

Minimum (Best Quality) Quantizer. +

+
+
qmax (max-q)
+

Maximum (Worst Quality) Quantizer. +Can be changed per-frame. +

+
+
bufsize (buf-sz, buf-optimal-sz)
+

Set ratecontrol buffer size (in bits). Note vpxenc’s options are +specified in milliseconds, the libvpx wrapper converts this value as follows: +buf-sz = bufsize * 1000 / bitrate, +buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6. +

+
+
rc_init_occupancy (buf-initial-sz)
+

Set number of bits which should be loaded into the rc buffer before decoding +starts. Note vpxenc’s option is specified in milliseconds, the libvpx +wrapper converts this value as follows: +rc_init_occupancy * 1000 / bitrate. +

+
+
undershoot-pct
+

Set datarate undershoot (min) percentage of the target bitrate. +

+
+
overshoot-pct
+

Set datarate overshoot (max) percentage of the target bitrate. +

+
+
skip_threshold (drop-frame)
+
qcomp (bias-pct)
+
maxrate (maxsection-pct)
+

Set GOP max bitrate in bits/s. Note vpxenc’s option is specified as a +percentage of the target bitrate, the libvpx wrapper converts this value as +follows: (maxrate * 100 / bitrate). +

+
+
minrate (minsection-pct)
+

Set GOP min bitrate in bits/s. Note vpxenc’s option is specified as a +percentage of the target bitrate, the libvpx wrapper converts this value as +follows: (minrate * 100 / bitrate). +

+
+
minrate, maxrate, b end-usage=cbr
+

(minrate == maxrate == bitrate). +

+
+
crf (end-usage=cq, cq-level)
+
tune (tune)
+
+
psnr (psnr)
+
ssim (ssim)
+
+ +
+
quality, deadline (deadline)
+
+
best
+

Use best quality deadline. Poorly named and quite slow, this option should be +avoided as it may give worse quality output than good. +

+
good
+

Use good quality deadline. This is a good trade-off between speed and quality +when used with the cpu-used option. +

+
realtime
+

Use realtime quality deadline. +

+
+ +
+
speed, cpu-used (cpu-used)
+

Set quality/speed ratio modifier. Higher values speed up the encode at the cost +of quality. +

+
+
nr (noise-sensitivity)
+
static-thresh
+

Set a change threshold on blocks below which they will be skipped by the +encoder. +

+
+
slices (token-parts)
+

Note that FFmpeg’s slices option gives the total number of partitions, +while vpxenc’s token-parts is given as +log2(partitions). +

+
+
max-intra-rate
+

Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0 +means unlimited. +

+
+
force_key_frames
+

VPX_EFLAG_FORCE_KF +

+
+
Alternate reference frame related
+
+
auto-alt-ref
+

Enable use of alternate reference frames (2-pass only). +Values greater than 1 enable multi-layer alternate reference frames (VP9 only). +

+
arnr-maxframes
+

Set altref noise reduction max frame count. +

+
arnr-type
+

Set altref noise reduction filter type: backward, forward, centered. +

+
arnr-strength
+

Set altref noise reduction filter strength. +

+
rc-lookahead, lag-in-frames (lag-in-frames)
+

Set number of frames to look ahead for frametype and ratecontrol. +

+
min-gf-interval
+

Set minimum golden/alternate reference frame interval (VP9 only). +

+
+ +
+
error-resilient
+

Enable error resiliency features. +

+
+
sharpness integer
+

Increase sharpness at the expense of lower PSNR. +The valid range is [0, 7]. +

+
+
ts-parameters
+

Sets the temporal scalability configuration using a :-separated list of +key=value pairs. For example, to specify temporal scalability parameters +with ffmpeg: +

+
ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
+ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
+ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
+
+

Below is a brief explanation of each of the parameters, please +refer to struct vpx_codec_enc_cfg in vpx/vpx_encoder.h for more +details. +

+
ts_number_layers
+

Number of temporal coding layers. +

+
ts_target_bitrate
+

Target bitrate for each temporal layer (in kbps). +(bitrate should be inclusive of the lower temporal layer). +

+
ts_rate_decimator
+

Frame rate decimation factor for each temporal layer. +

+
ts_periodicity
+

Length of the sequence defining frame temporal layer membership. +

+
ts_layer_id
+

Template defining the membership of frames to temporal layers. +

+
ts_layering_mode
+

(optional) Selecting the temporal structure from a set of pre-defined temporal layering modes. +Currently supports the following options. +

+
0
+

No temporal layering flags are provided internally, +relies on flags being passed in using metadata field in AVFrame +with following keys. +

+
vp8-flags
+

Sets the flags passed into the encoder to indicate the referencing scheme for +the current frame. +Refer to function vpx_codec_encode in vpx/vpx_encoder.h for more +details. +

+
temporal_id
+

Explicitly sets the temporal id of the current frame to encode. +

+
+
+
2
+

Two temporal layers. 0-1... +

+
3
+

Three temporal layers. 0-2-1-2...; with single reference frame. +

+
4
+

Same as option "3", except there is a dependency between +the two temporal layer 2 frames within the temporal period. +

+
+
+
+ +
+
VP9-specific options
+
+
lossless
+

Enable lossless mode. +

+
tile-columns
+

Set number of tile columns to use. Note this is given as +log2(tile_columns). For example, 8 tile columns would be requested by +setting the tile-columns option to 3. +

+
tile-rows
+

Set number of tile rows to use. Note this is given as log2(tile_rows). +For example, 4 tile rows would be requested by setting the tile-rows +option to 2. +

+
frame-parallel
+

Enable frame parallel decodability features. +

+
aq-mode
+

Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3: +cyclic refresh, 4: equator360). +

+
colorspace color-space
+

Set input color space. The VP9 bitstream supports signaling the following +colorspaces: +

+
rgbsRGB
+
bt709bt709
+
unspecifiedunknown
+
bt470bgbt601
+
smpte170msmpte170
+
smpte240msmpte240
+
bt2020_nclbt2020
+
+
+
row-mt boolean
+

Enable row based multi-threading. +

+
tune-content
+

Set content type: default (0), screen (1), film (2). +

+
corpus-complexity
+

Corpus VBR mode is a variant of standard VBR where the complexity distribution +midpoint is passed in rather than calculated for a specific clip or chunk. +

+

The valid range is [0, 10000]. 0 (default) uses standard VBR. +

+
enable-tpl boolean
+

Enable temporal dependency model. +

+
ref-frame-config
+

Using per-frame metadata, set members of the structure vpx_svc_ref_frame_config_t in vpx/vp8cx.h to fine-control referencing schemes and frame buffer management. +
Use a :-separated list of key=value pairs. +For example, +

+
av_dict_set(&av_frame->metadata, "ref-frame-config", \
+"rfc_update_buffer_slot=7:rfc_lst_fb_idx=0:rfc_gld_fb_idx=1:rfc_alt_fb_idx=2:rfc_reference_last=0:rfc_reference_golden=0:rfc_reference_alt_ref=0");
+
+
+
rfc_update_buffer_slot
+

Indicates the buffer slot number to update +

+
rfc_update_last
+

Indicates whether to update the LAST frame +

+
rfc_update_golden
+

Indicates whether to update GOLDEN frame +

+
rfc_update_alt_ref
+

Indicates whether to update ALT_REF frame +

+
rfc_lst_fb_idx
+

LAST frame buffer index +

+
rfc_gld_fb_idx
+

GOLDEN frame buffer index +

+
rfc_alt_fb_idx
+

ALT_REF frame buffer index +

+
rfc_reference_last
+

Indicates whether to reference LAST frame +

+
rfc_reference_golden
+

Indicates whether to reference GOLDEN frame +

+
rfc_reference_alt_ref
+

Indicates whether to reference ALT_REF frame +

+
rfc_reference_duration
+

Indicates frame duration +

+
+
+
+ +
+
+ +

For more information about libvpx see: +http://www.webmproject.org/ +

+
+
+
+

16.14 libwebp

+ +

libwebp WebP Image encoder wrapper +

+

libwebp is Google’s official encoder for WebP images. It can encode in either +lossy or lossless mode. Lossy images are essentially a wrapper around a VP8 +frame. Lossless images are a separate codec developed by Google. +

+ +
+

16.14.1 Pixel Format

+ +

Currently, libwebp only supports YUV420 for lossy and RGB for lossless due +to limitations of the format and libwebp. Alpha is supported for either mode. +Because of API limitations, if RGB is passed in when encoding lossy or YUV is +passed in for encoding lossless, the pixel format will automatically be +converted using functions from libwebp. This is not ideal and is done only for +convenience. +

+
+
+

16.14.2 Options

+ +
+
-lossless boolean
+

Enables/Disables use of lossless mode. Default is 0. +

+
+
-compression_level integer
+

For lossy, this is a quality/speed tradeoff. Higher values give better quality +for a given size at the cost of increased encoding time. For lossless, this is +a size/speed tradeoff. Higher values give smaller size at the cost of increased +encoding time. More specifically, it controls the number of extra algorithms +and compression tools used, and varies the combination of these tools. This +maps to the method option in libwebp. The valid range is 0 to 6. +Default is 4. +

+
+
-quality float
+

For lossy encoding, this controls image quality. For lossless encoding, this +controls the effort and time spent in compression. +Range is 0 to 100. Default is 75. +

+
+
-preset type
+

Configuration preset. This does some automatic settings based on the general +type of the image. +

+
none
+

Do not use a preset. +

+
default
+

Use the encoder default. +

+
picture
+

Digital picture, like portrait, inner shot +

+
photo
+

Outdoor photograph, with natural lighting +

+
drawing
+

Hand or line drawing, with high-contrast details +

+
icon
+

Small-sized colorful images +

+
text
+

Text-like +

+
+ +
+
+ +
+
+
+

16.15 libx264, libx264rgb

+ +

x264 H.264/MPEG-4 AVC encoder wrapper. +

+

This encoder requires the presence of the libx264 headers and library +during configuration. You need to explicitly configure the build with +--enable-libx264. +

+

libx264 supports an impressive number of features, including 8x8 and +4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC +entropy coding, interlacing (MBAFF), lossless mode, psy optimizations +for detail retention (adaptive quantization, psy-RD, psy-trellis). +

+

Many libx264 encoder options are mapped to FFmpeg global codec +options, while unique encoder options are provided through private +options. Additionally the x264opts and x264-params +private options allows one to pass a list of key=value tuples as accepted +by the libx264 x264_param_parse function. +

+

The x264 project website is at +http://www.videolan.org/developers/x264.html. +

+

The libx264rgb encoder is the same as libx264, except it accepts packed RGB +pixel formats as input instead of YUV. +

+ +
+

16.15.1 Supported Pixel Formats

+ +

x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at +x264’s configure time. +

+
+
+

16.15.2 Options

+ +

The following options are supported by the libx264 wrapper. The +x264-equivalent options or values are listed in parentheses +for easy migration. +

+

To reduce the duplication of documentation, only the private options +and some others requiring special attention are documented here. For +the documentation of the undocumented generic options, see +the Codec Options chapter. +

+

To get a more accurate and extensive documentation of the libx264 +options, invoke the command x264 --fullhelp or consult +the libx264 documentation. +

+
+
b (bitrate)
+

Set bitrate in bits/s. Note that FFmpeg’s b option is +expressed in bits/s, while x264’s bitrate is in +kilobits/s. +

+
+
bf (bframes)
+
g (keyint)
+
qmin (qpmin)
+

Minimum quantizer scale. +

+
+
qmax (qpmax)
+

Maximum quantizer scale. +

+
+
qdiff (qpstep)
+

Maximum difference between quantizer scales. +

+
+
qblur (qblur)
+

Quantizer curve blur +

+
+
qcomp (qcomp)
+

Quantizer curve compression factor +

+
+
refs (ref)
+

Number of reference frames each P-frame can use. The range is from 0-16. +

+
+
sc_threshold (scenecut)
+

Sets the threshold for the scene change detection. +

+
+
trellis (trellis)
+

Performs Trellis quantization to increase efficiency. Enabled by default. +

+
+
nr (nr)
+
me_range (merange)
+

Maximum range of the motion search in pixels. +

+
+
me_method (me)
+

Set motion estimation method. Possible values in the decreasing order +of speed: +

+
+
dia (dia)
+
epzs (dia)
+

Diamond search with radius 1 (fastest). ‘epzs’ is an alias for +‘dia’. +

+
hex (hex)
+

Hexagonal search with radius 2. +

+
umh (umh)
+

Uneven multi-hexagon search. +

+
esa (esa)
+

Exhaustive search. +

+
tesa (tesa)
+

Hadamard exhaustive search (slowest). +

+
+ +
+
forced-idr
+

Normally, when forcing a I-frame type, the encoder can select any type +of I-frame. This option forces it to choose an IDR-frame. +

+
+
subq (subme)
+

Sub-pixel motion estimation method. +

+
+
b_strategy (b-adapt)
+

Adaptive B-frame placement decision algorithm. Use only on first-pass. +

+
+
keyint_min (min-keyint)
+

Minimum GOP size. +

+
+
coder
+

Set entropy encoder. Possible values: +

+
+
ac
+

Enable CABAC. +

+
+
vlc
+

Enable CAVLC and disable CABAC. It generates the same effect as +x264’s --no-cabac option. +

+
+ +
+
cmp
+

Set full pixel motion estimation comparison algorithm. Possible values: +

+
+
chroma
+

Enable chroma in motion estimation. +

+
+
sad
+

Ignore chroma in motion estimation. It generates the same effect as +x264’s --no-chroma-me option. +

+
+ +
+
threads (threads)
+

Number of encoding threads. +

+
+
thread_type
+

Set multithreading technique. Possible values: +

+
+
slice
+

Slice-based multithreading. It generates the same effect as +x264’s --sliced-threads option. +

+
frame
+

Frame-based multithreading. +

+
+ +
+
flags
+

Set encoding flags. It can be used to disable closed GOP and enable +open GOP by setting it to -cgop. The result is similar to +the behavior of x264’s --open-gop option. +

+
+
rc_init_occupancy (vbv-init)
+
preset (preset)
+

Set the encoding preset. +

+
+
tune (tune)
+

Set tuning of the encoding params. +

+
+
profile (profile)
+

Set profile restrictions. +

+
+
fastfirstpass
+

Enable fast settings when encoding first pass, when set to 1. When set +to 0, it has the same effect of x264’s +--slow-firstpass option. +

+
+
crf (crf)
+

Set the quality for constant quality mode. +

+
+
crf_max (crf-max)
+

In CRF mode, prevents VBV from lowering quality beyond this point. +

+
+
qp (qp)
+

Set constant quantization rate control method parameter. +

+
+
aq-mode (aq-mode)
+

Set AQ method. Possible values: +

+
+
none (0)
+

Disabled. +

+
+
variance (1)
+

Variance AQ (complexity mask). +

+
+
autovariance (2)
+

Auto-variance AQ (experimental). +

+
+ +
+
aq-strength (aq-strength)
+

Set AQ strength, reduce blocking and blurring in flat and textured areas. +

+
+
psy
+

Use psychovisual optimizations when set to 1. When set to 0, it has the +same effect as x264’s --no-psy option. +

+
+
psy-rd (psy-rd)
+

Set strength of psychovisual optimization, in +psy-rd:psy-trellis format. +

+
+
rc-lookahead (rc-lookahead)
+

Set number of frames to look ahead for frametype and ratecontrol. +

+
+
weightb
+

Enable weighted prediction for B-frames when set to 1. When set to 0, +it has the same effect as x264’s --no-weightb option. +

+
+
weightp (weightp)
+

Set weighted prediction method for P-frames. Possible values: +

+
+
none (0)
+

Disabled +

+
simple (1)
+

Enable only weighted refs +

+
smart (2)
+

Enable both weighted refs and duplicates +

+
+ +
+
ssim (ssim)
+

Enable calculation and printing SSIM stats after the encoding. +

+
+
intra-refresh (intra-refresh)
+

Enable the use of Periodic Intra Refresh instead of IDR frames when set +to 1. +

+
+
avcintra-class (class)
+

Configure the encoder to generate AVC-Intra. +Valid values are 50,100 and 200 +

+
+
bluray-compat (bluray-compat)
+

Configure the encoder to be compatible with the bluray standard. +It is a shorthand for setting "bluray-compat=1 force-cfr=1". +

+
+
b-bias (b-bias)
+

Set the influence on how often B-frames are used. +

+
+
b-pyramid (b-pyramid)
+

Set method for keeping of some B-frames as references. Possible values: +

+
+
none (none)
+

Disabled. +

+
strict (strict)
+

Strictly hierarchical pyramid. +

+
normal (normal)
+

Non-strict (not Blu-ray compatible). +

+
+ +
+
mixed-refs
+

Enable the use of one reference per partition, as opposed to one +reference per macroblock when set to 1. When set to 0, it has the +same effect as x264’s --no-mixed-refs option. +

+
+
8x8dct
+

Enable adaptive spatial transform (high profile 8x8 transform) +when set to 1. When set to 0, it has the same effect as +x264’s --no-8x8dct option. +

+
+
fast-pskip
+

Enable early SKIP detection on P-frames when set to 1. When set +to 0, it has the same effect as x264’s +--no-fast-pskip option. +

+
+
aud (aud)
+

Enable use of access unit delimiters when set to 1. +

+
+
mbtree
+

Enable use macroblock tree ratecontrol when set to 1. When set +to 0, it has the same effect as x264’s +--no-mbtree option. +

+
+
deblock (deblock)
+

Set loop filter parameters, in alpha:beta form. +

+
+
cplxblur (cplxblur)
+

Set fluctuations reduction in QP (before curve compression). +

+
+
partitions (partitions)
+

Set partitions to consider as a comma-separated list of. Possible +values in the list: +

+
+
p8x8
+

8x8 P-frame partition. +

+
p4x4
+

4x4 P-frame partition. +

+
b8x8
+

4x4 B-frame partition. +

+
i8x8
+

8x8 I-frame partition. +

+
i4x4
+

4x4 I-frame partition. +(Enabling ‘p4x4’ requires ‘p8x8’ to be enabled. Enabling +‘i8x8’ requires adaptive spatial transform (8x8dct +option) to be enabled.) +

+
none (none)
+

Do not consider any partitions. +

+
all (all)
+

Consider every partition. +

+
+ +
+
direct-pred (direct)
+

Set direct MV prediction mode. Possible values: +

+
+
none (none)
+

Disable MV prediction. +

+
spatial (spatial)
+

Enable spatial predicting. +

+
temporal (temporal)
+

Enable temporal predicting. +

+
auto (auto)
+

Automatically decided. +

+
+ +
+
slice-max-size (slice-max-size)
+

Set the limit of the size of each slice in bytes. If not specified +but RTP payload size (ps) is specified, that is used. +

+
+
stats (stats)
+

Set the file name for multi-pass stats. +

+
+
nal-hrd (nal-hrd)
+

Set signal HRD information (requires vbv-bufsize to be set). +Possible values: +

+
+
none (none)
+

Disable HRD information signaling. +

+
vbr (vbr)
+

Variable bit rate. +

+
cbr (cbr)
+

Constant bit rate (not allowed in MP4 container). +

+
+ +
+
x264opts (N.A.)
+

Set any x264 option, see x264 --fullhelp for a list. +

+

Argument is a list of key=value couples separated by +":". In filter and psy-rd options that use ":" as a separator +themselves, use "," instead. They accept it as well since long ago but this +is kept undocumented for some reason. +

+

For example to specify libx264 encoding options with ffmpeg: +

+
ffmpeg -i foo.mpg -c:v libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
+
+ +
+
a53cc boolean
+

Import closed captions (which must be ATSC compatible format) into output. +Only the mpeg2 and h264 decoders provide these. Default is 1 (on). +

+
+
udu_sei boolean
+

Import user data unregistered SEI if available into output. Default is 0 (off). +

+
+
x264-params (N.A.)
+

Override the x264 configuration using a :-separated list of key=value +parameters. +

+

This option is functionally the same as the x264opts, but is +duplicated for compatibility with the Libav fork. +

+

For example to specify libx264 encoding options with ffmpeg: +

+
ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
+cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
+no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
+
+
+
+ +

Encoding ffpresets for common usages are provided so they can be used with the +general presets system (e.g. passing the pre option). +

+
+
+
+

16.16 libx265

+ +

x265 H.265/HEVC encoder wrapper. +

+

This encoder requires the presence of the libx265 headers and library +during configuration. You need to explicitly configure the build with +--enable-libx265. +

+ +
+

16.16.1 Options

+ +
+
b
+

Sets target video bitrate. +

+
+
bf
+
g
+

Set the GOP size. +

+
+
keyint_min
+

Minimum GOP size. +

+
+
refs
+

Number of reference frames each P-frame can use. The range is from 1-16. +

+
+
preset
+

Set the x265 preset. +

+
+
tune
+

Set the x265 tune parameter. +

+
+
profile
+

Set profile restrictions. +

+
+
crf
+

Set the quality for constant quality mode. +

+
+
qp
+

Set constant quantization rate control method parameter. +

+
+
qmin
+

Minimum quantizer scale. +

+
+
qmax
+

Maximum quantizer scale. +

+
+
qdiff
+

Maximum difference between quantizer scales. +

+
+
qblur
+

Quantizer curve blur +

+
+
qcomp
+

Quantizer curve compression factor +

+
+
i_qfactor
+
b_qfactor
+
forced-idr
+

Normally, when forcing a I-frame type, the encoder can select any type +of I-frame. This option forces it to choose an IDR-frame. +

+
+
udu_sei boolean
+

Import user data unregistered SEI if available into output. Default is 0 (off). +

+
+
x265-params
+

Set x265 options using a list of key=value couples separated +by ":". See x265 --help for a list of options. +

+

For example to specify libx265 encoding options with -x265-params: +

+
+
ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
+
+
+
+ +
+
+
+

16.17 libxavs2

+ +

xavs2 AVS2-P2/IEEE1857.4 encoder wrapper. +

+

This encoder requires the presence of the libxavs2 headers and library +during configuration. You need to explicitly configure the build with +--enable-libxavs2. +

+

The following standard libavcodec options are used: +

    +
  • b / bit_rate +
  • g / gop_size +
  • bf / max_b_frames +
+ +

The encoder also has its own specific options: +

+
+

16.17.1 Options

+ +
+
lcu_row_threads
+

Set the number of parallel threads for rows from 1 to 8 (default 5). +

+
+
initial_qp
+

Set the xavs2 quantization parameter from 1 to 63 (default 34). This is +used to set the initial qp for the first frame. +

+
+
qp
+

Set the xavs2 quantization parameter from 1 to 63 (default 34). This is +used to set the qp value under constant-QP mode. +

+
+
max_qp
+

Set the max qp for rate control from 1 to 63 (default 55). +

+
+
min_qp
+

Set the min qp for rate control from 1 to 63 (default 20). +

+
+
speed_level
+

Set the Speed level from 0 to 9 (default 0). Higher is better but slower. +

+
+
log_level
+

Set the log level from -1 to 3 (default 0). -1: none, 0: error, +1: warning, 2: info, 3: debug. +

+
+
xavs2-params
+

Set xavs2 options using a list of key=value couples separated +by ":". +

+

For example to specify libxavs2 encoding options with -xavs2-params: +

+
+
ffmpeg -i input -c:v libxavs2 -xavs2-params RdoqLevel=0 output.avs2
+
+
+
+ +
+
+
+

16.18 libxvid

+ +

Xvid MPEG-4 Part 2 encoder wrapper. +

+

This encoder requires the presence of the libxvidcore headers and library +during configuration. You need to explicitly configure the build with +--enable-libxvid --enable-gpl. +

+

The native mpeg4 encoder supports the MPEG-4 Part 2 format, so +users can encode to this format without this library. +

+ +
+

16.18.1 Options

+ +

The following options are supported by the libxvid wrapper. Some of +the following options are listed but are not documented, and +correspond to shared codec options. See the Codec +Options chapter for their documentation. The other shared options +which are not listed have no effect for the libxvid encoder. +

+
+
b
+
g
+
qmin
+
qmax
+
mpeg_quant
+
threads
+
bf
+
b_qfactor
+
b_qoffset
+
flags
+

Set specific encoding flags. Possible values: +

+
+
mv4
+

Use four motion vector by macroblock. +

+
+
aic
+

Enable high quality AC prediction. +

+
+
gray
+

Only encode grayscale. +

+
+
gmc
+

Enable the use of global motion compensation (GMC). +

+
+
qpel
+

Enable quarter-pixel motion compensation. +

+
+
cgop
+

Enable closed GOP. +

+
+
global_header
+

Place global headers in extradata instead of every keyframe. +

+
+
+ +
+
trellis
+
me_method
+

Set motion estimation method. Possible values in decreasing order of +speed and increasing order of quality: +

+
+
zero
+

Use no motion estimation (default). +

+
+
phods
+
x1
+
log
+

Enable advanced diamond zonal search for 16x16 blocks and half-pixel +refinement for 16x16 blocks. ‘x1’ and ‘log’ are aliases for +‘phods’. +

+
+
epzs
+

Enable all of the things described above, plus advanced diamond zonal +search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion +estimation on chroma planes. +

+
+
full
+

Enable all of the things described above, plus extended 16x16 and 8x8 +blocks search. +

+
+ +
+
mbd
+

Set macroblock decision algorithm. Possible values in the increasing +order of quality: +

+
+
simple
+

Use macroblock comparing function algorithm (default). +

+
+
bits
+

Enable rate distortion-based half pixel and quarter pixel refinement for +16x16 blocks. +

+
+
rd
+

Enable all of the things described above, plus rate distortion-based +half pixel and quarter pixel refinement for 8x8 blocks, and rate +distortion-based search using square pattern. +

+
+ +
+
lumi_aq
+

Enable lumi masking adaptive quantization when set to 1. Default is 0 +(disabled). +

+
+
variance_aq
+

Enable variance adaptive quantization when set to 1. Default is 0 +(disabled). +

+

When combined with lumi_aq, the resulting quality will not +be better than any of the two specified individually. In other +words, the resulting quality will be the worse one of the two +effects. +

+
+
ssim
+

Set structural similarity (SSIM) displaying method. Possible values: +

+
+
off
+

Disable displaying of SSIM information. +

+
+
avg
+

Output average SSIM at the end of encoding to stdout. The format of +showing the average SSIM is: +

+
+
Average SSIM: %f
+
+ +

For users who are not familiar with C, %f means a float number, or +a decimal (e.g. 0.939232). +

+
+
frame
+

Output both per-frame SSIM data during encoding and average SSIM at +the end of encoding to stdout. The format of per-frame information +is: +

+
+
       SSIM: avg: %1.3f min: %1.3f max: %1.3f
+
+ +

For users who are not familiar with C, %1.3f means a float number +rounded to 3 digits after the dot (e.g. 0.932). +

+
+
+ +
+
ssim_acc
+

Set SSIM accuracy. Valid options are integers within the range of +0-4, while 0 gives the most accurate result and 4 computes the +fastest. +

+
+
+ +
+
+
+

16.19 MediaFoundation

+ +

This provides wrappers to encoders (both audio and video) in the +MediaFoundation framework. It can access both SW and HW encoders. +Video encoders can take input in either of nv12 or yuv420p form +(some encoders support both, some support only either - in practice, +nv12 is the safer choice, especially among HW encoders). +

+
+
+

16.20 mpeg2

+ +

MPEG-2 video encoder. +

+ +
+

16.20.1 Options

+ +
+
profile
+

Select the mpeg2 profile to encode: +

+
+
422
+
high
+
ss
+

Spatially Scalable +

+
snr
+

SNR Scalable +

+
main
+
simple
+
+ +
+
level
+

Select the mpeg2 level to encode: +

+
+
high
+
high1440
+
main
+
low
+
+ +
+
seq_disp_ext integer
+

Specifies if the encoder should write a sequence_display_extension to the +output. +

+
-1
+
auto
+

Decide automatically to write it or not (this is the default) by checking if +the data to be written is different from the default or unspecified values. +

+
0
+
never
+

Never write it. +

+
1
+
always
+

Always write it. +

+
+
+
video_format integer
+

Specifies the video_format written into the sequence display extension +indicating the source of the video pictures. The default is ‘unspecified’, +can be ‘component’, ‘pal’, ‘ntsc’, ‘secam’ or ‘mac’. +For maximum compatibility, use ‘component’. +

+
a53cc boolean
+

Import closed captions (which must be ATSC compatible format) into output. +Default is 1 (on). +

+
+ +
+
+
+

16.21 png

+ +

PNG image encoder. +

+ +
+

16.21.1 Private options

+ +
+
dpi integer
+

Set physical density of pixels, in dots per inch, unset by default +

+
dpm integer
+

Set physical density of pixels, in dots per meter, unset by default +

+
+ +
+
+
+

16.22 ProRes

+ +

Apple ProRes encoder. +

+

FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder. +The used encoder can be chosen with the -vcodec option. +

+ +
+

16.22.1 Private Options for prores-ks

+ +
+
profile integer
+

Select the ProRes profile to encode +

+
proxy
+
lt
+
standard
+
hq
+
4444
+
4444xq
+
+ +
+
quant_mat integer
+

Select quantization matrix. +

+
auto
+
default
+
proxy
+
lt
+
standard
+
hq
+
+

If set to auto, the matrix matching the profile will be picked. +If not set, the matrix providing the highest quality, default, will be +picked. +

+
+
bits_per_mb integer
+

How many bits to allot for coding one macroblock. Different profiles use +between 200 and 2400 bits per macroblock, the maximum is 8000. +

+
+
mbs_per_slice integer
+

Number of macroblocks in each slice (1-8); the default value (8) +should be good in almost all situations. +

+
+
vendor string
+

Override the 4-byte vendor ID. +A custom vendor ID like apl0 would claim the stream was produced by +the Apple encoder. +

+
+
alpha_bits integer
+

Specify number of bits for alpha component. +Possible values are 0, 8 and 16. +Use 0 to disable alpha plane coding. +

+
+
+ +
+
+

16.22.2 Speed considerations

+ +

In the default mode of operation the encoder has to honor frame constraints +(i.e. not produce frames with size bigger than requested) while still making +output picture as good as possible. +A frame containing a lot of small details is harder to compress and the encoder +would spend more time searching for appropriate quantizers for each slice. +

+

Setting a higher bits_per_mb limit will improve the speed. +

+

For the fastest encoding speed set the qscale parameter (4 is the +recommended value) and do not set a size constraint. +

+
+
+
+

16.23 QSV Encoders

+ +

The family of Intel QuickSync Video encoders (MPEG-2, H.264, HEVC, JPEG/MJPEG, +VP9, AV1) +

+ +
+

16.23.1 Ratecontrol Method

+

The ratecontrol method is selected as follows: +

    +
  • When global_quality is specified, a quality-based mode is used. +Specifically this means either +
      +
    • CQP - constant quantizer scale, when the qscale codec flag is +also set (the -qscale ffmpeg option). + +
    • LA_ICQ - intelligent constant quality with lookahead, when the +look_ahead option is also set. + +
    • ICQ – intelligent constant quality otherwise. For the ICQ modes, global +quality range is 1 to 51, with 1 being the best quality. +
    + +
  • Otherwise, a bitrate-based mode is used. For all of those, you should specify at +least the desired average bitrate with the b option. +
      +
    • LA - VBR with lookahead, when the look_ahead option is specified. + +
    • VCM - video conferencing mode, when the vcm option is set. + +
    • CBR - constant bitrate, when maxrate is specified and equal to +the average bitrate. + +
    • VBR - variable bitrate, when maxrate is specified, but is higher +than the average bitrate. + +
    • AVBR - average VBR mode, when maxrate is not specified, both +avbr_accuracy and avbr_convergence are set to non-zero. This +mode is available for H264 and HEVC on Windows. +
    +
+ +

Note that depending on your system, a different mode than the one you specified +may be selected by the encoder. Set the verbosity level to verbose or +higher to see the actual settings used by the QSV runtime. +

+
+
+

16.23.2 Global Options -> MSDK Options

+

Additional libavcodec global options are mapped to MSDK options as follows: +

+
    +
  • g/gop_size -> GopPicSize + +
  • bf/max_b_frames+1 -> GopRefDist + +
  • rc_init_occupancy/rc_initial_buffer_occupancy -> +InitialDelayInKB + +
  • slices -> NumSlice + +
  • refs -> NumRefFrame + +
  • b_strategy/b_frame_strategy -> BRefType + +
  • cgop/CLOSED_GOP codec flag -> GopOptFlag + +
  • For the CQP mode, the i_qfactor/i_qoffset and +b_qfactor/b_qoffset set the difference between QPP and QPI, +and QPP and QPB respectively. + +
  • Setting the coder option to the value vlc will make the H.264 +encoder use CAVLC instead of CABAC. + +
+ +
+
+

16.23.3 Common Options

+

Following options are used by all qsv encoders. +

+
+
async_depth
+

Specifies how many asynchronous operations an application performs +before the application explicitly synchronizes the result. If zero, +the value is not specified. +

+
+
preset
+

This option itemizes a range of choices from veryfast (best speed) to veryslow +(best quality). +

+
veryfast
+
faster
+
fast
+
medium
+
slow
+
slower
+
veryslow
+
+ +
+
forced_idr
+

Forcing I frames as IDR frames. +

+
+
low_power
+

For encoders set this flag to ON to reduce power consumption and GPU usage. +

+
+ +
+
+

16.23.4 Runtime Options

+

Following options can be used durning qsv encoding. +

+
+
global_quality
+
i_quant_factor
+
i_quant_offset
+
b_quant_factor
+
b_quant_offset
+

Supported in h264_qsv and hevc_qsv. +Change these value to reset qsv codec’s qp configuration. +

+
+
max_frame_size
+

Supported in h264_qsv and hevc_qsv. +Change this value to reset qsv codec’s MaxFrameSize configuration. +

+
+
gop_size
+

Change this value to reset qsv codec’s gop configuration. +

+
+
int_ref_type
+
int_ref_cycle_size
+
int_ref_qp_delta
+
int_ref_cycle_dist
+

Supported in h264_qsv and hevc_qsv. +Change these value to reset qsv codec’s Intra Refresh configuration. +

+
+
qmax
+
qmin
+
max_qp_i
+
min_qp_i
+
max_qp_p
+
min_qp_p
+
max_qp_b
+
min_qp_b
+

Supported in h264_qsv. +Change these value to reset qsv codec’s max/min qp configuration. +

+
+
low_delay_brc
+

Supported in h264_qsv, hevc_qsv and av1_qsv. +Change this value to reset qsv codec’s low_delay_brc configuration. +

+
+
framerate
+

Change this value to reset qsv codec’s framerate configuration. +

+
+
bit_rate
+
rc_buffer_size
+
rc_initial_buffer_occupancy
+
rc_max_rate
+

Change these value to reset qsv codec’s bitrate control configuration. +

+
+
pic_timing_sei
+

Supported in h264_qsv and hevc_qsv. +Change this value to reset qsv codec’s pic_timing_sei configuration. +

+
+ +
+
+

16.23.5 H264 options

+

These options are used by h264_qsv +

+
+
extbrc
+

Extended bitrate control. +

+
+
recovery_point_sei
+

Set this flag to insert the recovery point SEI message at the beginning of every +intra refresh cycle. +

+
+
rdo
+

Enable rate distortion optimization. +

+
+
max_frame_size
+

Maximum encoded frame size in bytes. +

+
+
max_frame_size_i
+

Maximum encoded frame size for I frames in bytes. If this value is set as larger +than zero, then for I frames the value set by max_frame_size is ignored. +

+
+
max_frame_size_p
+

Maximum encoded frame size for P frames in bytes. If this value is set as larger +than zero, then for P frames the value set by max_frame_size is ignored. +

+
+
max_slice_size
+

Maximum encoded slice size in bytes. +

+
+
bitrate_limit
+

Toggle bitrate limitations. +Modifies bitrate to be in the range imposed by the QSV encoder. Setting this +flag off may lead to violation of HRD conformance. Mind that specifying bitrate +below the QSV encoder range might significantly affect quality. If on this +option takes effect in non CQP modes: if bitrate is not in the range imposed +by the QSV encoder, it will be changed to be in the range. +

+
+
mbbrc
+

Setting this flag enables macroblock level bitrate control that generally +improves subjective visual quality. Enabling this flag may have negative impact +on performance and objective visual quality metric. +

+
+
low_delay_brc
+

Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides +more accurate bitrate control to minimize the variance of bitstream size frame +by frame. Value: -1-default 0-off 1-on +

+
+
adaptive_i
+

This flag controls insertion of I frames by the QSV encoder. Turn ON this flag +to allow changing of frame type from P and B to I. +

+
+
adaptive_b
+

This flag controls changing of frame type from B to P. +

+
+
p_strategy
+

Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0). +

+
+
b_strategy
+

This option controls usage of B frames as reference. +

+
+
dblk_idc
+

This option disable deblocking. It has value in range 0~2. +

+
+
cavlc
+

If set, CAVLC is used; if unset, CABAC is used for encoding. +

+
+
vcm
+

Video conferencing mode, please see ratecontrol method. +

+
+
idr_interval
+

Distance (in I-frames) between IDR frames. +

+
+
pic_timing_sei
+

Insert picture timing SEI with pic_struct_syntax element. +

+
+
single_sei_nal_unit
+

Put all the SEI messages into one NALU. +

+
+
max_dec_frame_buffering
+

Maximum number of frames buffered in the DPB. +

+
+
look_ahead
+

Use VBR algorithm with look ahead. +

+
+
look_ahead_depth
+

Depth of look ahead in number frames. +

+
+
look_ahead_downsampling
+

Downscaling factor for the frames saved for the lookahead analysis. +

+
unknown
+
auto
+
off
+
2x
+
4x
+
+ +
+
int_ref_type
+

Specifies intra refresh type. The major goal of intra refresh is improvement of +error resilience without significant impact on encoded bitstream size caused by +I frames. The SDK encoder achieves this by encoding part of each frame in +refresh cycle using intra MBs. none means no refresh. vertical means +vertical refresh, by column of MBs. horizontal means horizontal refresh, +by rows of MBs. slice means horizontal refresh by slices without +overlapping. In case of slice, in_ref_cycle_size is ignored. To enable +intra refresh, B frame should be set to 0. +

+
+
int_ref_cycle_size
+

Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are +invalid values. +

+
+
int_ref_qp_delta
+

Specifies QP difference for inserted intra MBs. This is signed value in +[-51, 51] range if target encoding bit-depth for luma samples is 8 and this +range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively. +

+
+
int_ref_cycle_dist
+

Distance between the beginnings of the intra-refresh cycles in frames. +

+
+
profile
+
+
unknown
+
baseline
+
main
+
high
+
+ +
+
a53cc
+

Use A53 Closed Captions (if available). +

+
+
aud
+

Insert the Access Unit Delimiter NAL. +

+
+
mfmode
+

Multi-Frame Mode. +

+
off
+
auto
+
+ +
+
repeat_pps
+

Repeat pps for every frame. +

+
+
max_qp_i
+

Maximum video quantizer scale for I frame. +

+
+
min_qp_i
+

Minimum video quantizer scale for I frame. +

+
+
max_qp_p
+

Maximum video quantizer scale for P frame. +

+
+
min_qp_p
+

Minimum video quantizer scale for P frame. +

+
+
max_qp_b
+

Maximum video quantizer scale for B frame. +

+
+
min_qp_b
+

Minimum video quantizer scale for B frame. +

+
+
scenario
+

Provides a hint to encoder about the scenario for the encoding session. +

+
unknown
+
displayremoting
+
videoconference
+
archive
+
livestreaming
+
cameracapture
+
videosurveillance
+
gamestreaming
+
remotegaming
+
+ +
+
avbr_accuracy
+

Accuracy of the AVBR ratecontrol (unit of tenth of percent). +

+
+
avbr_convergence
+

Convergence of the AVBR ratecontrol (unit of 100 frames) +

+

The parameters avbr_accuracy and avbr_convergence are for the +average variable bitrate control (AVBR) algorithm. +The algorithm focuses on overall encoding quality while meeting the specified +bitrate, target_bitrate, within the accuracy range avbr_accuracy, +after a avbr_Convergence period. This method does not follow HRD and the +instant bitrate is not capped or padded. +

+
+
skip_frame
+

Use per-frame metadata "qsv_skip_frame" to skip frame when encoding. This option +defines the usage of this metadata. +

+
no_skip
+

Frame skipping is disabled. +

+
insert_dummy
+

Encoder inserts into bitstream frame where all macroblocks are encoded as +skipped. +

+
insert_nothing
+

Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped +frames are still used in brc. For example, gop still include skipped frames, and +the frames after skipped frames will be larger in size. +

+
brc_only
+

skip_frame metadata indicates the number of missed frames before the current +frame. +

+
+ +
+
+ +
+
+

16.23.6 HEVC Options

+

These options are used by hevc_qsv +

+
+
extbrc
+

Extended bitrate control. +

+
+
recovery_point_sei
+

Set this flag to insert the recovery point SEI message at the beginning of every +intra refresh cycle. +

+
+
rdo
+

Enable rate distortion optimization. +

+
+
max_frame_size
+

Maximum encoded frame size in bytes. +

+
+
max_frame_size_i
+

Maximum encoded frame size for I frames in bytes. If this value is set as larger +than zero, then for I frames the value set by max_frame_size is ignored. +

+
+
max_frame_size_p
+

Maximum encoded frame size for P frames in bytes. If this value is set as larger +than zero, then for P frames the value set by max_frame_size is ignored. +

+
+
max_slice_size
+

Maximum encoded slice size in bytes. +

+
+
mbbrc
+

Setting this flag enables macroblock level bitrate control that generally +improves subjective visual quality. Enabling this flag may have negative impact +on performance and objective visual quality metric. +

+
+
low_delay_brc
+

Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides +more accurate bitrate control to minimize the variance of bitstream size frame +by frame. Value: -1-default 0-off 1-on +

+
+
adaptive_i
+

This flag controls insertion of I frames by the QSV encoder. Turn ON this flag +to allow changing of frame type from P and B to I. +

+
+
adaptive_b
+

This flag controls changing of frame type from B to P. +

+
+
p_strategy
+

Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0). +

+
+
b_strategy
+

This option controls usage of B frames as reference. +

+
+
dblk_idc
+

This option disable deblocking. It has value in range 0~2. +

+
+
idr_interval
+

Distance (in I-frames) between IDR frames. +

+
begin_only
+

Output an IDR-frame only at the beginning of the stream. +

+
+ +
+
load_plugin
+

A user plugin to load in an internal session. +

+
none
+
hevc_sw
+
hevc_hw
+
+ +
+
load_plugins
+

A :-separate list of hexadecimal plugin UIDs to load in +an internal session. +

+
+
look_ahead_depth
+

Depth of look ahead in number frames, available when extbrc option is enabled. +

+
+
profile
+

Set the encoding profile (scc requires libmfx >= 1.32). +

+
+
unknown
+
main
+
main10
+
mainsp
+
rext
+
scc
+
+ +
+
tier
+

Set the encoding tier (only level >= 4 can support high tier). +This option only takes effect when the level option is specified. +

+
+
main
+
high
+
+ +
+
gpb
+

1: GPB (generalized P/B frame) +

+

0: regular P frame. +

+
+
tile_cols
+

Number of columns for tiled encoding. +

+
+
tile_rows
+

Number of rows for tiled encoding. +

+
+
aud
+

Insert the Access Unit Delimiter NAL. +

+
+
pic_timing_sei
+

Insert picture timing SEI with pic_struct_syntax element. +

+
+
transform_skip
+

Turn this option ON to enable transformskip. It is supported on platform equal +or newer than ICL. +

+
+
int_ref_type
+

Specifies intra refresh type. The major goal of intra refresh is improvement of +error resilience without significant impact on encoded bitstream size caused by +I frames. The SDK encoder achieves this by encoding part of each frame in +refresh cycle using intra MBs. none means no refresh. vertical means +vertical refresh, by column of MBs. horizontal means horizontal refresh, +by rows of MBs. slice means horizontal refresh by slices without +overlapping. In case of slice, in_ref_cycle_size is ignored. To enable +intra refresh, B frame should be set to 0. +

+
+
int_ref_cycle_size
+

Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are +invalid values. +

+
+
int_ref_qp_delta
+

Specifies QP difference for inserted intra MBs. This is signed value in +[-51, 51] range if target encoding bit-depth for luma samples is 8 and this +range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively. +

+
+
int_ref_cycle_dist
+

Distance between the beginnings of the intra-refresh cycles in frames. +

+
+
max_qp_i
+

Maximum video quantizer scale for I frame. +

+
+
min_qp_i
+

Minimum video quantizer scale for I frame. +

+
+
max_qp_p
+

Maximum video quantizer scale for P frame. +

+
+
min_qp_p
+

Minimum video quantizer scale for P frame. +

+
+
max_qp_b
+

Maximum video quantizer scale for B frame. +

+
+
min_qp_b
+

Minimum video quantizer scale for B frame. +

+
+
scenario
+

Provides a hint to encoder about the scenario for the encoding session. +

+
unknown
+
displayremoting
+
videoconference
+
archive
+
livestreaming
+
cameracapture
+
videosurveillance
+
gamestreaming
+
remotegaming
+
+ +
+
avbr_accuracy
+

Accuracy of the AVBR ratecontrol (unit of tenth of percent). +

+
+
avbr_convergence
+

Convergence of the AVBR ratecontrol (unit of 100 frames) +

+

The parameters avbr_accuracy and avbr_convergence are for the +average variable bitrate control (AVBR) algorithm. +The algorithm focuses on overall encoding quality while meeting the specified +bitrate, target_bitrate, within the accuracy range avbr_accuracy, +after a avbr_Convergence period. This method does not follow HRD and the +instant bitrate is not capped or padded. +

+
+
skip_frame
+

Use per-frame metadata "qsv_skip_frame" to skip frame when encoding. This option +defines the usage of this metadata. +

+
no_skip
+

Frame skipping is disabled. +

+
insert_dummy
+

Encoder inserts into bitstream frame where all macroblocks are encoded as +skipped. +

+
insert_nothing
+

Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped +frames are still used in brc. For example, gop still include skipped frames, and +the frames after skipped frames will be larger in size. +

+
brc_only
+

skip_frame metadata indicates the number of missed frames before the current +frame. +

+
+ +
+
+ +
+
+

16.23.7 MPEG2 Options

+

These options are used by mpeg2_qsv +

+
profile
+
+
unknown
+
simple
+
main
+
high
+
+
+
+ +
+
+

16.23.8 VP9 Options

+

These options are used by vp9_qsv +

+
profile
+
+
unknown
+
profile0
+
profile1
+
profile2
+
profile3
+
+ +
+
tile_cols
+

Number of columns for tiled encoding (requires libmfx >= 1.29). +

+
+
tile_rows
+

Number of rows for tiled encoding (requires libmfx >= 1.29). +

+
+ +
+
+

16.23.9 AV1 Options

+

These options are used by av1_qsv (requires libvpl). +

+
profile
+
+
unknown
+
main
+
+ +
+
tile_cols
+

Number of columns for tiled encoding. +

+
+
tile_rows
+

Number of rows for tiled encoding. +

+
+
adaptive_i
+

This flag controls insertion of I frames by the QSV encoder. Turn ON this flag +to allow changing of frame type from P and B to I. +

+
+
adaptive_b
+

This flag controls changing of frame type from B to P. +

+
+
b_strategy
+

This option controls usage of B frames as reference. +

+
+
extbrc
+

Extended bitrate control. +

+
+
look_ahead_depth
+

Depth of look ahead in number frames, available when extbrc option is enabled. +

+
+
low_delay_brc
+

Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides +more accurate bitrate control to minimize the variance of bitstream size frame +by frame. Value: -1-default 0-off 1-on +

+
+
max_frame_size
+

Set the allowed max size in bytes for each frame. If the frame size exceeds +the limitation, encoder will adjust the QP value to control the frame size. +Invalid in CQP rate control mode. +

+
+ +
+
+
+

16.24 snow

+ + +
+

16.24.1 Options

+ +
+
iterative_dia_size
+

dia size for the iterative motion estimation +

+
+ +
+
+
+

16.25 VAAPI encoders

+ +

Wrappers for hardware encoders accessible via VAAPI. +

+

These encoders only accept input in VAAPI hardware surfaces. If you have input +in software frames, use the hwupload filter to upload them to the GPU. +

+

The following standard libavcodec options are used: +

    +
  • g / gop_size +
  • bf / max_b_frames +
  • profile + +

    If not set, this will be determined automatically from the format of the input +frames and the profiles supported by the driver. +

  • level +
  • b / bit_rate +
  • maxrate / rc_max_rate +
  • bufsize / rc_buffer_size +
  • rc_init_occupancy / rc_initial_buffer_occupancy +
  • compression_level + +

    Speed / quality tradeoff: higher values are faster / worse quality. +

  • q / global_quality + +

    Size / quality tradeoff: higher values are smaller / worse quality. +

  • qmin +
  • qmax +
  • i_qfactor / i_quant_factor +
  • i_qoffset / i_quant_offset +
  • b_qfactor / b_quant_factor +
  • b_qoffset / b_quant_offset +
  • slices +
+ +

All encoders support the following options: +

+
low_power
+

Some drivers/platforms offer a second encoder for some codecs intended to use +less power than the default encoder; setting this option will attempt to use +that encoder. Note that it may support a reduced feature set, so some other +options may not be available in this mode. +

+
+
idr_interval
+

Set the number of normal intra frames between full-refresh (IDR) frames in +open-GOP mode. The intra frames are still IRAPs, but will not include global +headers and may have non-decodable leading pictures. +

+
+
b_depth
+

Set the B-frame reference depth. When set to one (the default), all B-frames +will refer only to P- or I-frames. When set to greater values multiple layers +of B-frames will be present, frames in each layer only referring to frames in +higher layers. +

+
+
async_depth
+

Maximum processing parallelism. Increase this to improve single channel +performance. This option doesn’t work if driver doesn’t implement vaSyncBuffer +function. Please make sure there are enough hw_frames allocated if a large +number of async_depth is used. +

+
+
max_frame_size
+

Set the allowed max size in bytes for each frame. If the frame size exceeds +the limitation, encoder will adjust the QP value to control the frame size. +Invalid in CQP rate control mode. +

+
+
rc_mode
+

Set the rate control mode to use. A given driver may only support a subset of +modes. +

+

Possible modes: +

+
auto
+

Choose the mode automatically based on driver support and the other options. +This is the default. +

+
CQP
+

Constant-quality. +

+
CBR
+

Constant-bitrate. +

+
VBR
+

Variable-bitrate. +

+
ICQ
+

Intelligent constant-quality. +

+
QVBR
+

Quality-defined variable-bitrate. +

+
AVBR
+

Average variable bitrate. +

+
+ +
+
+ +

Each encoder also has its own specific options: +

+
h264_vaapi
+

profile sets the value of profile_idc and the constraint_set*_flags. +level sets the value of level_idc. +

+
+
coder
+

Set entropy encoder (default is cabac). Possible values: +

+
+
ac
+
cabac
+

Use CABAC. +

+
+
vlc
+
cavlc
+

Use CAVLC. +

+
+ +
+
aud
+

Include access unit delimiters in the stream (not included by default). +

+
+
sei
+

Set SEI message types to include. +Some combination of the following values: +

+
identifier
+

Include a user_data_unregistered message containing information about +the encoder. +

+
timing
+

Include picture timing parameters (buffering_period and +pic_timing messages). +

+
recovery_point
+

Include recovery points where appropriate (recovery_point messages). +

+
+ +
+
+ +
+
hevc_vaapi
+

profile and level set the values of +general_profile_idc and general_level_idc respectively. +

+
+
aud
+

Include access unit delimiters in the stream (not included by default). +

+
+
tier
+

Set general_tier_flag. This may affect the level chosen for the stream +if it is not explicitly specified. +

+
+
sei
+

Set SEI message types to include. +Some combination of the following values: +

+
hdr
+

Include HDR metadata if the input frames have it +(mastering_display_colour_volume and content_light_level +messages). +

+
+ +
+
tiles
+

Set the number of tiles to encode the input video with, as columns x rows. +Larger numbers allow greater parallelism in both encoding and decoding, but +may decrease coding efficiency. +

+
+
+ +
+
mjpeg_vaapi
+

Only baseline DCT encoding is supported. The encoder always uses the standard +quantisation and huffman tables - global_quality scales the standard +quantisation table (range 1-100). +

+

For YUV, 4:2:0, 4:2:2 and 4:4:4 subsampling modes are supported. RGB is also +supported, and will create an RGB JPEG. +

+
+
jfif
+

Include JFIF header in each frame (not included by default). +

+
huffman
+

Include standard huffman tables (on by default). Turning this off will save +a few hundred bytes in each output frame, but may lose compatibility with some +JPEG decoders which don’t fully handle MJPEG. +

+
+ +
+
mpeg2_vaapi
+

profile and level set the value of profile_and_level_indication. +

+
+
vp8_vaapi
+

B-frames are not supported. +

+

global_quality sets the q_idx used for non-key frames (range 0-127). +

+
+
loop_filter_level
+
loop_filter_sharpness
+

Manually set the loop filter parameters. +

+
+ +
+
vp9_vaapi
+

global_quality sets the q_idx used for P-frames (range 0-255). +

+
+
loop_filter_level
+
loop_filter_sharpness
+

Manually set the loop filter parameters. +

+
+ +

B-frames are supported, but the output stream is always in encode order rather than display +order. If B-frames are enabled, it may be necessary to use the vp9_raw_reorder +bitstream filter to modify the output stream to display frames in the correct order. +

+

Only normal frames are produced - the vp9_superframe bitstream filter may be +required to produce a stream usable with all decoders. +

+
+
+ +
+
+

16.26 vbn

+ +

Vizrt Binary Image encoder. +

+

This format is used by the broadcast vendor Vizrt for quick texture streaming. +Advanced features of the format such as LZW compression of texture data or +generation of mipmaps are not supported. +

+ +
+

16.26.1 Options

+ +
+
format string
+

Sets the texture compression used by the VBN file. Can be dxt1, +dxt5 or raw. Default is dxt5. +

+
+ +
+
+
+

16.27 vc2

+ +

SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at +professional broadcasting but since it supports yuv420, yuv422 and yuv444 at +8 (limited range or full range), 10 or 12 bits, this makes it suitable for +other tasks which require low overhead and low compression (like screen +recording). +

+ +
+

16.27.1 Options

+ +
+
b
+

Sets target video bitrate. Usually that’s around 1:6 of the uncompressed +video bitrate (e.g. for 1920x1080 50fps yuv422p10 that’s around 400Mbps). Higher +values (close to the uncompressed bitrate) turn on lossless compression mode. +

+
+
field_order
+

Enables field coding when set (e.g. to tt - top field first) for interlaced +inputs. Should increase compression with interlaced content as it splits the +fields and encodes each separately. +

+
+
wavelet_depth
+

Sets the total amount of wavelet transforms to apply, between 1 and 5 (default). +Lower values reduce compression and quality. Less capable decoders may not be +able to handle values of wavelet_depth over 3. +

+
+
wavelet_type
+

Sets the transform type. Currently only 5_3 (LeGall) and 9_7 +(Deslauriers-Dubuc) +are implemented, with 9_7 being the one with better compression and thus +is the default. +

+
+
slice_width
+
slice_height
+

Sets the slice size for each slice. Larger values result in better compression. +For compatibility with other more limited decoders use slice_width of +32 and slice_height of 8. +

+
+
tolerance
+

Sets the undershoot tolerance of the rate control system in percent. This is +to prevent an expensive search from being run. +

+
+
qm
+

Sets the quantization matrix preset to use by default or when wavelet_depth +is set to 5 +

    +
  • default +Uses the default quantization matrix from the specifications, extended with +values for the fifth level. This provides a good balance between keeping detail +and omitting artifacts. + +
  • flat +Use a completely zeroed out quantization matrix. This increases PSNR but might +reduce perception. Use in bogus benchmarks. + +
  • color +Reduces detail but attempts to preserve color at extremely low bitrates. +
+ +
+
+ + +
+
+
+
+

17 Subtitles Encoders

+ + +
+

17.1 dvdsub

+ +

This codec encodes the bitmap subtitle format that is used in DVDs. +Typically they are stored in VOBSUB file pairs (*.idx + *.sub), +and they can also be used in Matroska files. +

+ +
+

17.1.1 Options

+ +
+
palette
+

Specify the global palette used by the bitmaps. +

+

The format for this option is a string containing 16 24-bits hexadecimal +numbers (without 0x prefix) separated by commas, for example 0d00ee, +ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1, +7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b. +

+
+
even_rows_fix
+

When set to 1, enable a work-around that makes the number of pixel rows +even in all subtitles. This fixes a problem with some players that +cut off the bottom row if the number is odd. The work-around just adds +a fully transparent row if needed. The overhead is low, typically +one byte per subtitle on average. +

+

By default, this work-around is disabled. +

+
+ +
+
+
+
+

18 Bitstream Filters

+ +

When you configure your FFmpeg build, all the supported bitstream +filters are enabled by default. You can list all available ones using +the configure option --list-bsfs. +

+

You can disable all the bitstream filters using the configure option +--disable-bsfs, and selectively enable any bitstream filter using +the option --enable-bsf=BSF, or you can disable a particular +bitstream filter using the option --disable-bsf=BSF. +

+

The option -bsfs of the ff* tools will display the list of +all the supported bitstream filters included in your build. +

+

The ff* tools have a -bsf option applied per stream, taking a +comma-separated list of filters, whose parameters follow the filter +name after a ’=’. +

+
+
ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
+
+ +

Below is a description of the currently available bitstream filters, +with their parameters, if any. +

+ +
+

18.1 aac_adtstoasc

+ +

Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration +bitstream. +

+

This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4 +ADTS header and removes the ADTS header. +

+

This filter is required for example when copying an AAC stream from a +raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or +to MOV/MP4 files and related formats such as 3GP or M4A. Please note +that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats. +

+
+
+

18.2 av1_metadata

+ +

Modify metadata embedded in an AV1 stream. +

+
+
td
+

Insert or remove temporal delimiter OBUs in all temporal units of the +stream. +

+
+
insert
+

Insert a TD at the beginning of every TU which does not already have one. +

+
remove
+

Remove the TD from the beginning of every TU which has one. +

+
+ +
+
color_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the color description fields in the stream (see AV1 section 6.4.2). +

+
+
color_range
+

Set the color range in the stream (see AV1 section 6.4.2; note that +this cannot be set for streams using BT.709 primaries, sRGB transfer +characteristic and identity (RGB) matrix coefficients). +

+
tv
+

Limited range. +

+
pc
+

Full range. +

+
+ +
+
chroma_sample_position
+

Set the chroma sample location in the stream (see AV1 section 6.4.2). +This can only be set for 4:2:0 streams. +

+
+
vertical
+

Left position (matching the default in MPEG-2 and H.264). +

+
colocated
+

Top-left position. +

+
+ +
+
tick_rate
+

Set the tick rate (time_scale / num_units_in_display_tick) in +the timing info in the sequence header. +

+
num_ticks_per_picture
+

Set the number of ticks in each picture, to indicate that the stream +has a fixed framerate. Ignored if tick_rate is not also set. +

+
+
delete_padding
+

Deletes Padding OBUs. +

+
+
+ +
+
+

18.3 chomp

+ +

Remove zero padding at the end of a packet. +

+
+
+

18.4 dca_core

+ +

Extract the core from a DCA/DTS stream, dropping extensions such as +DTS-HD. +

+
+
+

18.5 dump_extra

+ +

Add extradata to the beginning of the filtered packets except when +said packets already exactly begin with the extradata that is intended +to be added. +

+
+
freq
+

The additional argument specifies which packets should be filtered. +It accepts the values: +

+
k
+
keyframe
+

add extradata to all key packets +

+
+
e
+
all
+

add extradata to all packets +

+
+
+
+ +

If not specified it is assumed ‘k’. +

+

For example the following ffmpeg command forces a global +header (thus disabling individual packet headers) in the H.264 packets +generated by the libx264 encoder, but corrects them by adding +the header stored in extradata to the key packets: +

+
ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
+
+ +
+
+

18.6 dv_error_marker

+ +

Blocks in DV which are marked as damaged are replaced by blocks of the specified color. +

+
+
color
+

The color to replace damaged blocks by +

+
sta
+

A 16 bit mask which specifies which of the 16 possible error status values are +to be replaced by colored blocks. 0xFFFE is the default which replaces all non 0 +error status values. +

+
ok
+

No error, no concealment +

+
err
+

Error, No concealment +

+
res
+

Reserved +

+
notok
+

Error or concealment +

+
notres
+

Not reserved +

+
Aa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru
+

The specific error status code +

+
+

see page 44-46 or section 5.5 of +http://web.archive.org/web/20060927044735/http://www.smpte.org/smpte_store/standards/pdf/s314m.pdf +

+
+
+ +
+
+

18.7 eac3_core

+ +

Extract the core from a E-AC-3 stream, dropping extra channels. +

+
+
+

18.8 extract_extradata

+ +

Extract the in-band extradata. +

+

Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers, +or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either "in-band" (i.e. as a part +of the bitstream containing the coded frames) or "out of band" (e.g. on the +container level). This latter form is called "extradata" in FFmpeg terminology. +

+

This bitstream filter detects the in-band headers and makes them available as +extradata. +

+
+
remove
+

When this option is enabled, the long-term headers are removed from the +bitstream after extraction. +

+
+ +
+
+

18.9 filter_units

+ +

Remove units with types in or not in a given set from the stream. +

+
+
pass_types
+

List of unit types or ranges of unit types to pass through while removing +all others. This is specified as a ’|’-separated list of unit type values +or ranges of values with ’-’. +

+
+
remove_types
+

Identical to pass_types, except the units in the given set +removed and all others passed through. +

+
+ +

Extradata is unchanged by this transformation, but note that if the stream +contains inline parameter sets then the output may be unusable if they are +removed. +

+

For example, to remove all non-VCL NAL units from an H.264 stream: +

+
ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
+
+ +

To remove all AUDs, SEI and filler from an H.265 stream: +

+
ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
+
+ +
+
+

18.10 hapqa_extract

+ +

Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file. +

+
+
texture
+

Specifies the texture to keep. +

+
+
color
+
alpha
+
+ +
+
+ +

Convert HAPQA to HAPQ +

+
ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=color -tag:v HapY -metadata:s:v:0 encoder="HAPQ" hapq_file.mov
+
+ +

Convert HAPQA to HAPAlphaOnly +

+
ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=alpha -tag:v HapA -metadata:s:v:0 encoder="HAPAlpha Only" hapalphaonly_file.mov
+
+ +
+
+

18.11 h264_metadata

+ +

Modify metadata embedded in an H.264 stream. +

+
+
aud
+

Insert or remove AUD NAL units in all access units of the stream. +

+
+
pass
+
insert
+
remove
+
+ +

Default is pass. +

+
+
sample_aspect_ratio
+

Set the sample aspect ratio of the stream in the VUI parameters. +See H.264 table E-1. +

+
+
overscan_appropriate_flag
+

Set whether the stream is suitable for display using overscan +or not (see H.264 section E.2.1). +

+
+
video_format
+
video_full_range_flag
+

Set the video format in the stream (see H.264 section E.2.1 and +table E-2). +

+
+
colour_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the colour description in the stream (see H.264 section E.2.1 +and tables E-3, E-4 and E-5). +

+
+
chroma_sample_loc_type
+

Set the chroma sample location in the stream (see H.264 section +E.2.1 and figure E-1). +

+
+
tick_rate
+

Set the tick rate (time_scale / num_units_in_tick) in the VUI +parameters. This is the smallest time unit representable in the +stream, and in many cases represents the field rate of the stream +(double the frame rate). +

+
fixed_frame_rate_flag
+

Set whether the stream has fixed framerate - typically this indicates +that the framerate is exactly half the tick rate, but the exact +meaning is dependent on interlacing and the picture structure (see +H.264 section E.2.1 and table E-6). +

+
zero_new_constraint_set_flags
+

Zero constraint_set4_flag and constraint_set5_flag in the SPS. These +bits were reserved in a previous version of the H.264 spec, and thus +some hardware decoders require these to be zero. The result of zeroing +this is still a valid bitstream. +

+
+
crop_left
+
crop_right
+
crop_top
+
crop_bottom
+

Set the frame cropping offsets in the SPS. These values will replace +the current ones if the stream is already cropped. +

+

These fields are set in pixels. Note that some sizes may not be +representable if the chroma is subsampled or the stream is interlaced +(see H.264 section 7.4.2.1.1). +

+
+
sei_user_data
+

Insert a string as SEI unregistered user data. The argument must +be of the form UUID+string, where the UUID is as hex digits +possibly separated by hyphens, and the string can be anything. +

+

For example, ‘086f3693-b7b3-4f2c-9653-21492feee5b8+hello’ will +insert the string “hello” associated with the given UUID. +

+
+
delete_filler
+

Deletes both filler NAL units and filler SEI messages. +

+
+
display_orientation
+

Insert, extract or remove Display orientation SEI messages. +See H.264 section D.1.27 and D.2.27 for syntax and semantics. +

+
+
pass
+
insert
+
remove
+
extract
+
+ +

Default is pass. +

+

Insert mode works in conjunction with rotate and flip options. +Any pre-existing Display orientation messages will be removed in insert or remove mode. +Extract mode attaches the display matrix to the packet as side data. +

+
+
rotate
+

Set rotation in display orientation SEI (anticlockwise angle in degrees). +Range is -360 to +360. Default is NaN. +

+
+
flip
+

Set flip in display orientation SEI. +

+
+
horizontal
+
vertical
+
+ +

Default is unset. +

+
+
level
+

Set the level in the SPS. Refer to H.264 section A.3 and tables A-1 +to A-5. +

+

The argument must be the name of a level (for example, ‘4.2’), a +level_idc value (for example, ‘42’), or the special name ‘auto’ +indicating that the filter should attempt to guess the level from the +input stream properties. +

+
+
+ +
+
+

18.12 h264_mp4toannexb

+ +

Convert an H.264 bitstream from length prefixed mode to start code +prefixed mode (as defined in the Annex B of the ITU-T H.264 +specification). +

+

This is required by some streaming formats, typically the MPEG-2 +transport stream format (muxer mpegts). +

+

For example to remux an MP4 file containing an H.264 stream to mpegts +format with ffmpeg, you can use the command: +

+
+
ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
+
+ +

Please note that this filter is auto-inserted for MPEG-TS (muxer +mpegts) and raw H.264 (muxer h264) output formats. +

+
+
+

18.13 h264_redundant_pps

+ +

This applies a specific fixup to some Blu-ray streams which contain +redundant PPSs modifying irrelevant parameters of the stream which +confuse other transformations which require correct extradata. +

+
+
+

18.14 hevc_metadata

+ +

Modify metadata embedded in an HEVC stream. +

+
+
aud
+

Insert or remove AUD NAL units in all access units of the stream. +

+
+
insert
+
remove
+
+ +
+
sample_aspect_ratio
+

Set the sample aspect ratio in the stream in the VUI parameters. +

+
+
video_format
+
video_full_range_flag
+

Set the video format in the stream (see H.265 section E.3.1 and +table E.2). +

+
+
colour_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the colour description in the stream (see H.265 section E.3.1 +and tables E.3, E.4 and E.5). +

+
+
chroma_sample_loc_type
+

Set the chroma sample location in the stream (see H.265 section +E.3.1 and figure E.1). +

+
+
tick_rate
+

Set the tick rate in the VPS and VUI parameters (time_scale / +num_units_in_tick). Combined with num_ticks_poc_diff_one, this can +set a constant framerate in the stream. Note that it is likely to be +overridden by container parameters when the stream is in a container. +

+
+
num_ticks_poc_diff_one
+

Set poc_proportional_to_timing_flag in VPS and VUI and use this value +to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and +E.3.1). Ignored if tick_rate is not also set. +

+
+
crop_left
+
crop_right
+
crop_top
+
crop_bottom
+

Set the conformance window cropping offsets in the SPS. These values +will replace the current ones if the stream is already cropped. +

+

These fields are set in pixels. Note that some sizes may not be +representable if the chroma is subsampled (H.265 section 7.4.3.2.1). +

+
+
level
+

Set the level in the VPS and SPS. See H.265 section A.4 and tables +A.6 and A.7. +

+

The argument must be the name of a level (for example, ‘5.1’), a +general_level_idc value (for example, ‘153’ for level 5.1), +or the special name ‘auto’ indicating that the filter should +attempt to guess the level from the input stream properties. +

+
+
+ +
+
+

18.15 hevc_mp4toannexb

+ +

Convert an HEVC/H.265 bitstream from length prefixed mode to start code +prefixed mode (as defined in the Annex B of the ITU-T H.265 +specification). +

+

This is required by some streaming formats, typically the MPEG-2 +transport stream format (muxer mpegts). +

+

For example to remux an MP4 file containing an HEVC stream to mpegts +format with ffmpeg, you can use the command: +

+
+
ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
+
+ +

Please note that this filter is auto-inserted for MPEG-TS (muxer +mpegts) and raw HEVC/H.265 (muxer h265 or +hevc) output formats. +

+
+
+

18.16 imxdump

+ +

Modifies the bitstream to fit in MOV and to be usable by the Final Cut +Pro decoder. This filter only applies to the mpeg2video codec, and is +likely not needed for Final Cut Pro 7 and newer with the appropriate +-tag:v. +

+

For example, to remux 30 MB/sec NTSC IMX to MOV: +

+
+
ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
+
+ +
+
+

18.17 mjpeg2jpeg

+ +

Convert MJPEG/AVI1 packets to full JPEG/JFIF packets. +

+

MJPEG is a video codec wherein each video frame is essentially a +JPEG image. The individual frames can be extracted without loss, +e.g. by +

+
+
ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
+
+ +

Unfortunately, these chunks are incomplete JPEG images, because +they lack the DHT segment required for decoding. Quoting from +http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml: +

+

Avery Lee, writing in the rec.video.desktop newsgroup in 2001, +commented that "MJPEG, or at least the MJPEG in AVIs having the +MJPG fourcc, is restricted JPEG with a fixed – and *omitted* – +Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2, +and it must use basic Huffman encoding, not arithmetic or +progressive. . . . You can indeed extract the MJPEG frames and +decode them with a regular JPEG decoder, but you have to prepend +the DHT segment to them, or else the decoder won’t have any idea +how to decompress the data. The exact table necessary is given in +the OpenDML spec." +

+

This bitstream filter patches the header of frames extracted from an MJPEG +stream (carrying the AVI1 header ID and lacking a DHT segment) to +produce fully qualified JPEG images. +

+
+
ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
+exiftran -i -9 frame*.jpg
+ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
+
+ +
+
+

18.18 mjpegadump

+ +

Add an MJPEG A header to the bitstream, to enable decoding by +Quicktime. +

+
+
+

18.19 mov2textsub

+ +

Extract a representable text file from MOV subtitles, stripping the +metadata header from each subtitle packet. +

+

See also the text2movsub filter. +

+
+
+

18.20 mp3decomp

+ +

Decompress non-standard compressed MP3 audio headers. +

+
+
+

18.21 mpeg2_metadata

+ +

Modify metadata embedded in an MPEG-2 stream. +

+
+
display_aspect_ratio
+

Set the display aspect ratio in the stream. +

+

The following fixed values are supported: +

+
4/3
+
16/9
+
221/100
+
+

Any other value will result in square pixels being signalled instead +(see H.262 section 6.3.3 and table 6-3). +

+
+
frame_rate
+

Set the frame rate in the stream. This is constructed from a table +of known values combined with a small multiplier and divisor - if +the supplied value is not exactly representable, the nearest +representable value will be used instead (see H.262 section 6.3.3 +and table 6-4). +

+
+
video_format
+

Set the video format in the stream (see H.262 section 6.3.6 and +table 6-6). +

+
+
colour_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the colour description in the stream (see H.262 section 6.3.6 +and tables 6-7, 6-8 and 6-9). +

+
+
+ +
+
+

18.22 mpeg4_unpack_bframes

+ +

Unpack DivX-style packed B-frames. +

+

DivX-style packed B-frames are not valid MPEG-4 and were only a +workaround for the broken Video for Windows subsystem. +They use more space, can cause minor AV sync issues, require more +CPU power to decode (unless the player has some decoded picture queue +to compensate the 2,0,2,0 frame per packet style) and cause +trouble if copied into a standard container like mp4 or mpeg-ps/ts, +because MPEG-4 decoders may not be able to decode them, since they are +not valid MPEG-4. +

+

For example to fix an AVI file containing an MPEG-4 stream with +DivX-style packed B-frames using ffmpeg, you can use the command: +

+
+
ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
+
+ +
+
+

18.23 noise

+ +

Damages the contents of packets or simply drops them without damaging the +container. Can be used for fuzzing or testing error resilience/concealment. +

+

Parameters: +

+
amount
+

Accepts an expression whose evaluation per-packet determines how often bytes in that +packet will be modified. A value below 0 will result in a variable frequency. +Default is 0 which results in no modification. However, if neither amount nor drop is specified, +amount will be set to -1. See below for accepted variables. +

+
drop
+

Accepts an expression evaluated per-packet whose value determines whether that packet is dropped. +Evaluation to a positive value results in the packet being dropped. Evaluation to a negative +value results in a variable chance of it being dropped, roughly inverse in proportion to the magnitude +of the value. Default is 0 which results in no drops. See below for accepted variables. +

+
dropamount
+

Accepts a non-negative integer, which assigns a variable chance of it being dropped, roughly inverse +in proportion to the value. Default is 0 which results in no drops. This option is kept for backwards +compatibility and is equivalent to setting drop to a negative value with the same magnitude +i.e. dropamount=4 is the same as drop=-4. Ignored if drop is also specified. +

+
+ +

Both amount and drop accept expressions containing the following variables: +

+
+
n
+

The index of the packet, starting from zero. +

+
tb
+

The timebase for packet timestamps. +

+
pts
+

Packet presentation timestamp. +

+
dts
+

Packet decoding timestamp. +

+
nopts
+

Constant representing AV_NOPTS_VALUE. +

+
startpts
+

First non-AV_NOPTS_VALUE PTS seen in the stream. +

+
startdts
+

First non-AV_NOPTS_VALUE DTS seen in the stream. +

+
duration
+
d
+

Packet duration, in timebase units. +

+
pos
+

Packet position in input; may be -1 when unknown or not set. +

+
size
+

Packet size, in bytes. +

+
key
+

Whether packet is marked as a keyframe. +

+
state
+

A pseudo random integer, primarily derived from the content of packet payload. +

+
+ + +
+

18.23.1 Examples

+

Apply modification to every byte but don’t drop any packets. +

+
ffmpeg -i INPUT -c copy -bsf noise=1 output.mkv
+
+ +

Drop every video packet not marked as a keyframe after timestamp 30s but do not +modify any of the remaining packets. +

+
ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(t\,30)*not(key)' output.mkv
+
+ +

Drop one second of audio every 10 seconds and add some random noise to the rest. +

+
ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(t\,10)\,9\,10)' output.mkv
+
+ +
+
+
+

18.24 null

+

This bitstream filter passes the packets through unchanged. +

+
+
+

18.25 pcm_rechunk

+ +

Repacketize PCM audio to a fixed number of samples per packet or a fixed packet +rate per second. This is similar to the (ffmpeg-filters)asetnsamples audio +filter but works on audio packets instead of audio frames. +

+
+
nb_out_samples, n
+

Set the number of samples per each output audio packet. The number is intended +as the number of samples per each channel. Default value is 1024. +

+
+
pad, p
+

If set to 1, the filter will pad the last audio packet with silence, so that it +will contain the same number of samples (or roughly the same number of samples, +see frame_rate) as the previous ones. Default value is 1. +

+
+
frame_rate, r
+

This option makes the filter output a fixed number of packets per second instead +of a fixed number of samples per packet. If the audio sample rate is not +divisible by the frame rate then the number of samples will not be constant but +will vary slightly so that each packet will start as close to the frame +boundary as possible. Using this option has precedence over nb_out_samples. +

+
+ +

You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio +for NTSC frame rate using the frame_rate option. +

+
ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
+
+ +
+
+

18.26 pgs_frame_merge

+ +

Merge a sequence of PGS Subtitle segments ending with an "end of display set" +segment into a single packet. +

+

This is required by some containers that support PGS subtitles +(muxer matroska). +

+
+
+

18.27 prores_metadata

+ +

Modify color property metadata embedded in prores stream. +

+
+
color_primaries
+

Set the color primaries. +Available values are: +

+
+
auto
+

Keep the same color primaries property (default). +

+
+
unknown
+
bt709
+
bt470bg
+

BT601 625 +

+
+
smpte170m
+

BT601 525 +

+
+
bt2020
+
smpte431
+

DCI P3 +

+
+
smpte432
+

P3 D65 +

+
+
+ +
+
transfer_characteristics
+

Set the color transfer. +Available values are: +

+
+
auto
+

Keep the same transfer characteristics property (default). +

+
+
unknown
+
bt709
+

BT 601, BT 709, BT 2020 +

+
smpte2084
+

SMPTE ST 2084 +

+
arib-std-b67
+

ARIB STD-B67 +

+
+ + +
+
matrix_coefficients
+

Set the matrix coefficient. +Available values are: +

+
+
auto
+

Keep the same colorspace property (default). +

+
+
unknown
+
bt709
+
smpte170m
+

BT 601 +

+
+
bt2020nc
+
+
+
+ +

Set Rec709 colorspace for each frame of the file +

+
ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
+
+ +

Set Hybrid Log-Gamma parameters for each frame of the file +

+
ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc output.mov
+
+ +
+
+

18.28 remove_extra

+ +

Remove extradata from packets. +

+

It accepts the following parameter: +

+
freq
+

Set which frame types to remove extradata from. +

+
+
k
+

Remove extradata from non-keyframes only. +

+
+
keyframe
+

Remove extradata from keyframes only. +

+
+
e, all
+

Remove extradata from all frames. +

+
+
+
+
+ +
+
+

18.29 setts

+

Set PTS and DTS in packets. +

+

It accepts the following parameters: +

+
ts
+
pts
+
dts
+

Set expressions for PTS, DTS or both. +

+
duration
+

Set expression for duration. +

+
time_base
+

Set output time base. +

+
+ +

The expressions are evaluated through the eval API and can contain the following +constants: +

+
+
N
+

The count of the input packet. Starting from 0. +

+
+
TS
+

The demux timestamp in input in case of ts or dts option or presentation +timestamp in case of pts option. +

+
+
POS
+

The original position in the file of the packet, or undefined if undefined +for the current packet +

+
+
DTS
+

The demux timestamp in input. +

+
+
PTS
+

The presentation timestamp in input. +

+
+
DURATION
+

The duration in input. +

+
+
STARTDTS
+

The DTS of the first packet. +

+
+
STARTPTS
+

The PTS of the first packet. +

+
+
PREV_INDTS
+

The previous input DTS. +

+
+
PREV_INPTS
+

The previous input PTS. +

+
+
PREV_INDURATION
+

The previous input duration. +

+
+
PREV_OUTDTS
+

The previous output DTS. +

+
+
PREV_OUTPTS
+

The previous output PTS. +

+
+
PREV_OUTDURATION
+

The previous output duration. +

+
+
NEXT_DTS
+

The next input DTS. +

+
+
NEXT_PTS
+

The next input PTS. +

+
+
NEXT_DURATION
+

The next input duration. +

+
+
TB
+

The timebase of stream packet belongs. +

+
+
TB_OUT
+

The output timebase. +

+
+
SR
+

The sample rate of stream packet belongs. +

+
+
NOPTS
+

The AV_NOPTS_VALUE constant. +

+
+ +
+
+

18.30 text2movsub

+ +

Convert text subtitles to MOV subtitles (as used by the mov_text +codec) with metadata headers. +

+

See also the mov2textsub filter. +

+
+
+

18.31 trace_headers

+ +

Log trace output containing all syntax elements in the coded stream +headers (everything above the level of individual coded blocks). +This can be useful for debugging low-level stream issues. +

+

Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending +on the build only a subset of these may be available. +

+
+
+

18.32 truehd_core

+ +

Extract the core from a TrueHD stream, dropping ATMOS data. +

+
+
+

18.33 vp9_metadata

+ +

Modify metadata embedded in a VP9 stream. +

+
+
color_space
+

Set the color space value in the frame header. Note that any frame +set to RGB will be implicitly set to PC range and that RGB is +incompatible with profiles 0 and 2. +

+
unknown
+
bt601
+
bt709
+
smpte170
+
smpte240
+
bt2020
+
rgb
+
+ +
+
color_range
+

Set the color range value in the frame header. Note that any value +imposed by the color space will take precedence over this value. +

+
tv
+
pc
+
+
+
+ +
+
+

18.34 vp9_superframe

+ +

Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This +fixes merging of split/segmented VP9 streams where the alt-ref frame +was split from its visible counterpart. +

+
+
+

18.35 vp9_superframe_split

+ +

Split VP9 superframes into single frames. +

+
+
+

18.36 vp9_raw_reorder

+ +

Given a VP9 stream with correct timestamps but possibly out of order, +insert additional show-existing-frame packets to correct the ordering. +

+
+
+
+

19 Format Options

+ +

The libavformat library provides some generic global options, which +can be set on all the muxers and demuxers. In addition each muxer or +demuxer may support so-called private options, which are specific for +that component. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the +AVFormatContext options or using the libavutil/opt.h API +for programmatic use. +

+

The list of supported options follows: +

+
+
avioflags flags (input/output)
+

Possible values: +

+
direct
+

Reduce buffering. +

+
+ +
+
probesize integer (input)
+

Set probing size in bytes, i.e. the size of the data to analyze to get +stream information. A higher value will enable detecting more +information in case it is dispersed into the stream, but will increase +latency. Must be an integer not lesser than 32. It is 5000000 by default. +

+
+
max_probe_packets integer (input)
+

Set the maximum number of buffered packets when probing a codec. +Default is 2500 packets. +

+
+
packetsize integer (output)
+

Set packet size. +

+
+
fflags flags
+

Set format flags. Some are implemented for a limited number of formats. +

+

Possible values for input files: +

+
discardcorrupt
+

Discard corrupted packets. +

+
fastseek
+

Enable fast, but inaccurate seeks for some formats. +

+
genpts
+

Generate missing PTS if DTS is present. +

+
igndts
+

Ignore DTS if PTS is set. Inert when nofillin is set. +

+
ignidx
+

Ignore index. +

+
nobuffer
+

Reduce the latency introduced by buffering during initial input streams analysis. +

+
nofillin
+

Do not fill in missing values in packet fields that can be exactly calculated. +

+
noparse
+

Disable AVParsers, this needs +nofillin too. +

+
sortdts
+

Try to interleave output packets by DTS. At present, available only for AVIs with an index. +

+
+ +

Possible values for output files: +

+
autobsf
+

Automatically apply bitstream filters as required by the output format. Enabled by default. +

+
bitexact
+

Only write platform-, build- and time-independent data. +This ensures that file and data checksums are reproducible and match between +platforms. Its primary use is for regression testing. +

+
flush_packets
+

Write out packets immediately. +

+
shortest
+

Stop muxing at the end of the shortest stream. +It may be needed to increase max_interleave_delta to avoid flushing the longer +streams before EOF. +

+
+ +
+
seek2any integer (input)
+

Allow seeking to non-keyframes on demuxer level when supported if set to 1. +Default is 0. +

+
+
analyzeduration integer (input)
+

Specify how many microseconds are analyzed to probe the input. A +higher value will enable detecting more accurate information, but will +increase latency. It defaults to 5,000,000 microseconds = 5 seconds. +

+
+
cryptokey hexadecimal string (input)
+

Set decryption key. +

+
+
indexmem integer (input)
+

Set max memory used for timestamp index (per stream). +

+
+
rtbufsize integer (input)
+

Set max memory used for buffering real-time frames. +

+
+
fdebug flags (input/output)
+

Print specific debug info. +

+

Possible values: +

+
ts
+
+ +
+
max_delay integer (input/output)
+

Set maximum muxing or demuxing delay in microseconds. +

+
+
fpsprobesize integer (input)
+

Set number of frames used to probe fps. +

+
+
audio_preload integer (output)
+

Set microseconds by which audio packets should be interleaved earlier. +

+
+
chunk_duration integer (output)
+

Set microseconds for each chunk. +

+
+
chunk_size integer (output)
+

Set size in bytes for each chunk. +

+
+
err_detect, f_err_detect flags (input)
+

Set error detection flags. f_err_detect is deprecated and +should be used only via the ffmpeg tool. +

+

Possible values: +

+
crccheck
+

Verify embedded CRCs. +

+
bitstream
+

Detect bitstream specification deviations. +

+
buffer
+

Detect improper bitstream length. +

+
explode
+

Abort decoding on minor error detection. +

+
careful
+

Consider things that violate the spec and have not been seen in the +wild as errors. +

+
compliant
+

Consider all spec non compliancies as errors. +

+
aggressive
+

Consider things that a sane encoder should not do as an error. +

+
+ +
+
max_interleave_delta integer (output)
+

Set maximum buffering duration for interleaving. The duration is +expressed in microseconds, and defaults to 10000000 (10 seconds). +

+

To ensure all the streams are interleaved correctly, libavformat will +wait until it has at least one packet for each stream before actually +writing any packets to the output file. When some streams are +"sparse" (i.e. there are large gaps between successive packets), this +can result in excessive buffering. +

+

This field specifies the maximum difference between the timestamps of the +first and the last packet in the muxing queue, above which libavformat +will output a packet regardless of whether it has queued a packet for all +the streams. +

+

If set to 0, libavformat will continue buffering packets until it has +a packet for each stream, regardless of the maximum timestamp +difference between the buffered packets. +

+
+
use_wallclock_as_timestamps integer (input)
+

Use wallclock as timestamps if set to 1. Default is 0. +

+
+
avoid_negative_ts integer (output)
+
+

Possible values: +

+
make_non_negative
+

Shift timestamps to make them non-negative. +Also note that this affects only leading negative timestamps, and not +non-monotonic negative timestamps. +

+
make_zero
+

Shift timestamps so that the first timestamp is 0. +

+
auto (default)
+

Enables shifting when required by the target format. +

+
disabled
+

Disables shifting of timestamp. +

+
+ +

When shifting is enabled, all output timestamps are shifted by the +same amount. Audio, video, and subtitles desynching and relative +timestamp differences are preserved compared to how they would have +been without shifting. +

+
+
skip_initial_bytes integer (input)
+

Set number of bytes to skip before reading header and frames if set to 1. +Default is 0. +

+
+
correct_ts_overflow integer (input)
+

Correct single timestamp overflows if set to 1. Default is 1. +

+
+
flush_packets integer (output)
+

Flush the underlying I/O stream after each packet. Default is -1 (auto), which +means that the underlying protocol will decide, 1 enables it, and has the +effect of reducing the latency, 0 disables it and may increase IO throughput in +some cases. +

+
+
output_ts_offset offset (output)
+

Set the output time offset. +

+

offset must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

The offset is added by the muxer to the output timestamps. +

+

Specifying a positive offset means that the corresponding streams are +delayed bt the time duration specified in offset. Default value +is 0 (meaning that no offset is applied). +

+
+
format_whitelist list (input)
+

"," separated list of allowed demuxers. By default all are allowed. +

+
+
dump_separator string (input)
+

Separator used to separate the fields printed on the command line about the +Stream parameters. +For example, to separate the fields with newlines and indentation: +

+
ffprobe -dump_separator "
+                          "  -i ~/videos/matrixbench_mpeg2.mpg
+
+ +
+
max_streams integer (input)
+

Specifies the maximum number of streams. This can be used to reject files that +would require too many resources due to a large number of streams. +

+
+
skip_estimate_duration_from_pts bool (input)
+

Skip estimation of input duration when calculated using PTS. +At present, applicable for MPEG-PS and MPEG-TS. +

+
+
strict, f_strict integer (input/output)
+

Specify how strictly to follow the standards. f_strict is deprecated and +should be used only via the ffmpeg tool. +

+

Possible values: +

+
very
+

strictly conform to an older more strict version of the spec or reference software +

+
strict
+

strictly conform to all the things in the spec no matter what consequences +

+
normal
+
unofficial
+

allow unofficial extensions +

+
experimental
+

allow non standardized experimental things, experimental +(unfinished/work in progress/not well tested) decoders and encoders. +Note: experimental decoders can pose a security risk, do not use this for +decoding untrusted input. +

+
+ +
+
+ + + +
+

19.1 Format stream specifiers

+ +

Format stream specifiers allow selection of one or more streams that +match specific properties. +

+

The exact semantics of stream specifiers is defined by the +avformat_match_stream_specifier() function declared in the +libavformat/avformat.h header and documented in the +(ffmpeg)Stream specifiers section in the ffmpeg(1) manual. +

+
+
+
+

20 Demuxers

+ +

Demuxers are configured elements in FFmpeg that can read the +multimedia streams from a particular type of file. +

+

When you configure your FFmpeg build, all the supported demuxers +are enabled by default. You can list all available ones using the +configure option --list-demuxers. +

+

You can disable all the demuxers using the configure option +--disable-demuxers, and selectively enable a single demuxer with +the option --enable-demuxer=DEMUXER, or disable it +with the option --disable-demuxer=DEMUXER. +

+

The option -demuxers of the ff* tools will display the list of +enabled demuxers. Use -formats to view a combined list of +enabled demuxers and muxers. +

+

The description of some of the currently available demuxers follows. +

+ +
+

20.1 aa

+ +

Audible Format 2, 3, and 4 demuxer. +

+

This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files. +

+
+
+

20.2 aac

+ +

Raw Audio Data Transport Stream AAC demuxer. +

+

This demuxer is used to demux an ADTS input containing a single AAC stream +alongwith any ID3v1/2 or APE tags in it. +

+
+
+

20.3 apng

+ +

Animated Portable Network Graphics demuxer. +

+

This demuxer is used to demux APNG files. +All headers, but the PNG signature, up to (but not including) the first +fcTL chunk are transmitted as extradata. +Frames are then split as being all the chunks between two fcTL ones, or +between the last fcTL and IEND chunks. +

+
+
-ignore_loop bool
+

Ignore the loop variable in the file if set. Default is enabled. +

+
+
-max_fps int
+

Maximum framerate in frames per second. Default of 0 imposes no limit. +

+
+
-default_fps int
+

Default framerate in frames per second when none is specified in the file +(0 meaning as fast as possible). Default is 15. +

+
+
+ +
+
+

20.4 asf

+ +

Advanced Systems Format demuxer. +

+

This demuxer is used to demux ASF files and MMS network streams. +

+
+
-no_resync_search bool
+

Do not try to resynchronize by looking for a certain optional start code. +

+
+ +
+
+

20.5 concat

+ +

Virtual concatenation script demuxer. +

+

This demuxer reads a list of files and other directives from a text file and +demuxes them one after the other, as if all their packets had been muxed +together. +

+

The timestamps in the files are adjusted so that the first file starts at 0 +and each next file starts where the previous one finishes. Note that it is +done globally and may cause gaps if all streams do not have exactly the same +length. +

+

All files must have the same streams (same codecs, same time base, etc.). +

+

The duration of each file is used to adjust the timestamps of the next file: +if the duration is incorrect (because it was computed using the bit-rate or +because the file is truncated, for example), it can cause artifacts. The +duration directive can be used to override the duration stored in +each file. +

+ +
+

20.5.1 Syntax

+ +

The script is a text file in extended-ASCII, with one directive per line. +Empty lines, leading spaces and lines starting with ’#’ are ignored. The +following directive is recognized: +

+
+
file path
+

Path to a file to read; special characters and spaces must be escaped with +backslash or single quotes. +

+

All subsequent file-related directives apply to that file. +

+
+
ffconcat version 1.0
+

Identify the script type and version. +

+

To make FFmpeg recognize the format automatically, this directive must +appear exactly as is (no extra space or byte-order-mark) on the very first +line of the script. +

+
+
duration dur
+

Duration of the file. This information can be specified from the file; +specifying it here may be more efficient or help if the information from the +file is not available or accurate. +

+

If the duration is set for all files, then it is possible to seek in the +whole concatenated video. +

+
+
inpoint timestamp
+

In point of the file. When the demuxer opens the file it instantly seeks to the +specified timestamp. Seeking is done so that all streams can be presented +successfully at In point. +

+

This directive works best with intra frame codecs, because for non-intra frame +ones you will usually get extra packets before the actual In point and the +decoded content will most likely contain frames before In point too. +

+

For each file, packets before the file In point will have timestamps less than +the calculated start timestamp of the file (negative in case of the first +file), and the duration of the files (if not specified by the duration +directive) will be reduced based on their specified In point. +

+

Because of potential packets before the specified In point, packet timestamps +may overlap between two concatenated files. +

+
+
outpoint timestamp
+

Out point of the file. When the demuxer reaches the specified decoding +timestamp in any of the streams, it handles it as an end of file condition and +skips the current and all the remaining packets from all streams. +

+

Out point is exclusive, which means that the demuxer will not output packets +with a decoding timestamp greater or equal to Out point. +

+

This directive works best with intra frame codecs and formats where all streams +are tightly interleaved. For non-intra frame codecs you will usually get +additional packets with presentation timestamp after Out point therefore the +decoded content will most likely contain frames after Out point too. If your +streams are not tightly interleaved you may not get all the packets from all +streams before Out point and you may only will be able to decode the earliest +stream until Out point. +

+

The duration of the files (if not specified by the duration +directive) will be reduced based on their specified Out point. +

+
+
file_packet_metadata key=value
+

Metadata of the packets of the file. The specified metadata will be set for +each file packet. You can specify this directive multiple times to add multiple +metadata entries. +This directive is deprecated, use file_packet_meta instead. +

+
+
file_packet_meta key value
+

Metadata of the packets of the file. The specified metadata will be set for +each file packet. You can specify this directive multiple times to add multiple +metadata entries. +

+
+
option key value
+

Option to access, open and probe the file. +Can be present multiple times. +

+
+
stream
+

Introduce a stream in the virtual file. +All subsequent stream-related directives apply to the last introduced +stream. +Some streams properties must be set in order to allow identifying the +matching streams in the subfiles. +If no streams are defined in the script, the streams from the first file are +copied. +

+
+
exact_stream_id id
+

Set the id of the stream. +If this directive is given, the string with the corresponding id in the +subfiles will be used. +This is especially useful for MPEG-PS (VOB) files, where the order of the +streams is not reliable. +

+
+
stream_meta key value
+

Metadata for the stream. +Can be present multiple times. +

+
+
stream_codec value
+

Codec for the stream. +

+
+
stream_extradata hex_string
+

Extradata for the string, encoded in hexadecimal. +

+
+
chapter id start end
+

Add a chapter. id is an unique identifier, possibly small and +consecutive. +

+
+
+ +
+
+

20.5.2 Options

+ +

This demuxer accepts the following option: +

+
+
safe
+

If set to 1, reject unsafe file paths and directives. +A file path is considered safe if it +does not contain a protocol specification and is relative and all components +only contain characters from the portable character set (letters, digits, +period, underscore and hyphen) and have no period at the beginning of a +component. +

+

If set to 0, any file name is accepted. +

+

The default is 1. +

+
+
auto_convert
+

If set to 1, try to perform automatic conversions on packet data to make the +streams concatenable. +The default is 1. +

+

Currently, the only conversion is adding the h264_mp4toannexb bitstream +filter to H.264 streams in MP4 format. This is necessary in particular if +there are resolution changes. +

+
+
segment_time_metadata
+

If set to 1, every packet will contain the lavf.concat.start_time and the +lavf.concat.duration packet metadata values which are the start_time and +the duration of the respective file segments in the concatenated output +expressed in microseconds. The duration metadata is only set if it is known +based on the concat file. +The default is 0. +

+
+
+ +
+
+

20.5.3 Examples

+ +
    +
  • Use absolute filenames and include some comments: +
    +
    # my first filename
    +file /mnt/share/file-1.wav
    +# my second filename including whitespace
    +file '/mnt/share/file 2.wav'
    +# my third filename including whitespace plus single quote
    +file '/mnt/share/file 3'\''.wav'
    +
    + +
  • Allow for input format auto-probing, use safe filenames and set the duration of +the first file: +
    +
    ffconcat version 1.0
    +
    +file file-1.wav
    +duration 20.0
    +
    +file subdir/file-2.wav
    +
    +
+ +
+
+
+

20.6 dash

+ +

Dynamic Adaptive Streaming over HTTP demuxer. +

+

This demuxer presents all AVStreams found in the manifest. +By setting the discard flags on AVStreams the caller can decide +which streams to actually receive. +Each stream mirrors the id and bandwidth properties from the +<Representation> as metadata keys named "id" and "variant_bitrate" respectively. +

+ +
+

20.6.1 Options

+ +

This demuxer accepts the following option: +

+
+
cenc_decryption_key
+

16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7). +

+
+
+ +
+
+
+

20.7 ea

+ +

Electronic Arts Multimedia format demuxer. +

+

This format is used by various Electronic Arts games. +

+ +
+

20.7.1 Options

+ +
+
merge_alpha bool
+
+

Normally the VP6 alpha channel (if exists) is returned as a secondary video +stream, by setting this option you can make the demuxer return a single video +stream which contains the alpha channel in addition to the ordinary video. +

+
+
+ +
+
+
+

20.8 imf

+ +

Interoperable Master Format demuxer. +

+

This demuxer presents audio and video streams found in an IMF Composition, as +specified in SMPTE ST 2067-2. +

+
+
ffmpeg [-assetmaps <path of ASSETMAP1>,<path of ASSETMAP2>,...] -i <path of CPL> ...
+
+ +

If -assetmaps is not specified, the demuxer looks for a file called +ASSETMAP.xml in the same directory as the CPL. +

+
+
+

20.9 flv, live_flv, kux

+ +

Adobe Flash Video Format demuxer. +

+

This demuxer is used to demux FLV files and RTMP network streams. In case of live network streams, if you force format, you may use live_flv option instead of flv to survive timestamp discontinuities. +KUX is a flv variant used on the Youku platform. +

+
+
ffmpeg -f flv -i myfile.flv ...
+ffmpeg -f live_flv -i rtmp://<any.server>/anything/key ....
+
+ + +
+
-flv_metadata bool
+

Allocate the streams according to the onMetaData array content. +

+
+
-flv_ignore_prevtag bool
+

Ignore the size of previous tag value. +

+
+
-flv_full_metadata bool
+

Output all context of the onMetadata. +

+
+ +
+
+

20.10 gif

+ +

Animated GIF demuxer. +

+

It accepts the following options: +

+
+
min_delay
+

Set the minimum valid delay between frames in hundredths of seconds. +Range is 0 to 6000. Default value is 2. +

+
+
max_gif_delay
+

Set the maximum valid delay between frames in hundredth of seconds. +Range is 0 to 65535. Default value is 65535 (nearly eleven minutes), +the maximum value allowed by the specification. +

+
+
default_delay
+

Set the default delay between frames in hundredths of seconds. +Range is 0 to 6000. Default value is 10. +

+
+
ignore_loop
+

GIF files can contain information to loop a certain number of times (or +infinitely). If ignore_loop is set to 1, then the loop setting +from the input will be ignored and looping will not occur. If set to 0, +then looping will occur and will cycle the number of times according to +the GIF. Default value is 1. +

+
+ +

For example, with the overlay filter, place an infinitely looping GIF +over another video: +

+
ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
+
+ +

Note that in the above example the shortest option for overlay filter is +used to end the output video at the length of the shortest input file, +which in this case is input.mp4 as the GIF in this example loops +infinitely. +

+
+
+

20.11 hls

+ +

HLS demuxer +

+

Apple HTTP Live Streaming demuxer. +

+

This demuxer presents all AVStreams from all variant streams. +The id field is set to the bitrate variant index number. By setting +the discard flags on AVStreams (by pressing ’a’ or ’v’ in ffplay), +the caller can decide which variant streams to actually receive. +The total bitrate of the variant that the stream belongs to is +available in a metadata key named "variant_bitrate". +

+

It accepts the following options: +

+
+
live_start_index
+

segment index to start live streams at (negative values are from the end). +

+
+
prefer_x_start
+

prefer to use #EXT-X-START if it’s in playlist instead of live_start_index. +

+
+
allowed_extensions
+

’,’ separated list of file extensions that hls is allowed to access. +

+
+
max_reload
+

Maximum number of times a insufficient list is attempted to be reloaded. +Default value is 1000. +

+
+
m3u8_hold_counters
+

The maximum number of times to load m3u8 when it refreshes without new segments. +Default value is 1000. +

+
+
http_persistent
+

Use persistent HTTP connections. Applicable only for HTTP streams. +Enabled by default. +

+
+
http_multiple
+

Use multiple HTTP connections for downloading HTTP segments. +Enabled by default for HTTP/1.1 servers. +

+
+
http_seekable
+

Use HTTP partial requests for downloading HTTP segments. +0 = disable, 1 = enable, -1 = auto, Default is auto. +

+
+
seg_format_options
+

Set options for the demuxer of media segments using a list of key=value pairs separated by :. +

+
+
seg_max_retry
+

Maximum number of times to reload a segment on error, useful when segment skip on network error is not desired. +Default value is 0. +

+
+ +
+
+

20.12 image2

+ +

Image file demuxer. +

+

This demuxer reads from a list of image files specified by a pattern. +The syntax and meaning of the pattern is specified by the +option pattern_type. +

+

The pattern may contain a suffix which is used to automatically +determine the format of the images contained in the files. +

+

The size, the pixel format, and the format of each image must be the +same for all the files in the sequence. +

+

This demuxer accepts the following options: +

+
framerate
+

Set the frame rate for the video stream. It defaults to 25. +

+
loop
+

If set to 1, loop over the input. Default value is 0. +

+
pattern_type
+

Select the pattern type used to interpret the provided filename. +

+

pattern_type accepts one of the following values. +

+
none
+

Disable pattern matching, therefore the video will only contain the specified +image. You should use this option if you do not want to create sequences from +multiple images and your filenames may contain special pattern characters. +

+
sequence
+

Select a sequence pattern type, used to specify a sequence of files +indexed by sequential numbers. +

+

A sequence pattern may contain the string "%d" or "%0Nd", which +specifies the position of the characters representing a sequential +number in each filename matched by the pattern. If the form +"%d0Nd" is used, the string representing the number in each +filename is 0-padded and N is the total number of 0-padded +digits representing the number. The literal character ’%’ can be +specified in the pattern with the string "%%". +

+

If the sequence pattern contains "%d" or "%0Nd", the first filename of +the file list specified by the pattern must contain a number +inclusively contained between start_number and +start_number+start_number_range-1, and all the following +numbers must be sequential. +

+

For example the pattern "img-%03d.bmp" will match a sequence of +filenames of the form img-001.bmp, img-002.bmp, ..., +img-010.bmp, etc.; the pattern "i%%m%%g-%d.jpg" will match a +sequence of filenames of the form i%m%g-1.jpg, +i%m%g-2.jpg, ..., i%m%g-10.jpg, etc. +

+

Note that the pattern must not necessarily contain "%d" or +"%0Nd", for example to convert a single image file +img.jpeg you can employ the command: +

+
ffmpeg -i img.jpeg img.png
+
+ +
+
glob
+

Select a glob wildcard pattern type. +

+

The pattern is interpreted like a glob() pattern. This is only +selectable if libavformat was compiled with globbing support. +

+
+
glob_sequence (deprecated, will be removed)
+

Select a mixed glob wildcard/sequence pattern. +

+

If your version of libavformat was compiled with globbing support, and +the provided pattern contains at least one glob meta character among +%*?[]{} that is preceded by an unescaped "%", the pattern is +interpreted like a glob() pattern, otherwise it is interpreted +like a sequence pattern. +

+

All glob special characters %*?[]{} must be prefixed +with "%". To escape a literal "%" you shall use "%%". +

+

For example the pattern foo-%*.jpeg will match all the +filenames prefixed by "foo-" and terminating with ".jpeg", and +foo-%?%?%?.jpeg will match all the filenames prefixed with +"foo-", followed by a sequence of three characters, and terminating +with ".jpeg". +

+

This pattern type is deprecated in favor of glob and +sequence. +

+
+ +

Default value is glob_sequence. +

+
pixel_format
+

Set the pixel format of the images to read. If not specified the pixel +format is guessed from the first image file in the sequence. +

+
start_number
+

Set the index of the file matched by the image file pattern to start +to read from. Default value is 0. +

+
start_number_range
+

Set the index interval range to check when looking for the first image +file in the sequence, starting from start_number. Default value +is 5. +

+
ts_from_file
+

If set to 1, will set frame timestamp to modification time of image file. Note +that monotonity of timestamps is not provided: images go in the same order as +without this option. Default value is 0. +If set to 2, will set frame timestamp to the modification time of the image file in +nanosecond precision. +

+
video_size
+

Set the video size of the images to read. If not specified the video +size is guessed from the first image file in the sequence. +

+
export_path_metadata
+

If set to 1, will add two extra fields to the metadata found in input, making them +also available for other filters (see drawtext filter for examples). Default +value is 0. The extra fields are described below: +

+
lavf.image2dec.source_path
+

Corresponds to the full path to the input file being read. +

+
lavf.image2dec.source_basename
+

Corresponds to the name of the file being read. +

+
+ +
+
+ + +
+

20.12.1 Examples

+ +
    +
  • Use ffmpeg for creating a video from the images in the file +sequence img-001.jpeg, img-002.jpeg, ..., assuming an +input frame rate of 10 frames per second: +
    +
    ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
    +
    + +
  • As above, but start by reading from a file with index 100 in the sequence: +
    +
    ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
    +
    + +
  • Read images matching the "*.png" glob pattern , that is all the files +terminating with the ".png" suffix: +
    +
    ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
    +
    +
+ +
+
+
+

20.13 libgme

+ +

The Game Music Emu library is a collection of video game music file emulators. +

+

See https://bitbucket.org/mpyne/game-music-emu/overview for more information. +

+

It accepts the following options: +

+
+
track_index
+

Set the index of which track to demux. The demuxer can only export one track. +Track indexes start at 0. Default is to pick the first track. Number of tracks +is exported as tracks metadata entry. +

+
+
sample_rate
+

Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100. +

+
+
max_size (bytes)
+

The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size, +which in turn, acts as a ceiling for the size of files that can be read. +Default is 50 MiB. +

+
+
+ +
+
+

20.14 libmodplug

+ +

ModPlug based module demuxer +

+

See https://github.com/Konstanty/libmodplug +

+

It will export one 2-channel 16-bit 44.1 kHz audio stream. +Optionally, a pal8 16-color video stream can be exported with or without printed metadata. +

+

It accepts the following options: +

+
+
noise_reduction
+

Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0. +

+
+
reverb_depth
+

Set amount of reverb. Range 0-100. Default is 0. +

+
+
reverb_delay
+

Set delay in ms, clamped to 40-250 ms. Default is 0. +

+
+
bass_amount
+

Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0. +

+
+
bass_range
+

Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0. +

+
+
surround_depth
+

Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0. +

+
+
surround_delay
+

Set surround delay in ms, clamped to 5-40 ms. Default is 0. +

+
+
max_size
+

The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size, +which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB. +0 removes buffer size limit (not recommended). Default is 5 MiB. +

+
+
video_stream_expr
+

String which is evaluated using the eval API to assign colors to the generated video stream. +Variables which can be used are x, y, w, h, t, speed, +tempo, order, pattern and row. +

+
+
video_stream
+

Generate video stream. Can be 1 (on) or 0 (off). Default is 0. +

+
+
video_stream_w
+

Set video frame width in ’chars’ where one char indicates 8 pixels. Range is 20-512. Default is 30. +

+
+
video_stream_h
+

Set video frame height in ’chars’ where one char indicates 8 pixels. Range is 20-512. Default is 30. +

+
+
video_stream_ptxt
+

Print metadata on video stream. Includes speed, tempo, order, pattern, +row and ts (time in ms). Can be 1 (on) or 0 (off). Default is 1. +

+
+
+ +
+
+

20.15 libopenmpt

+ +

libopenmpt based module demuxer +

+

See https://lib.openmpt.org/libopenmpt/ for more information. +

+

Some files have multiple subsongs (tracks) this can be set with the subsong +option. +

+

It accepts the following options: +

+
+
subsong
+

Set the subsong index. This can be either ’all’, ’auto’, or the index of the +subsong. Subsong indexes start at 0. The default is ’auto’. +

+

The default value is to let libopenmpt choose. +

+
+
layout
+

Set the channel layout. Valid values are 1, 2, and 4 channel layouts. +The default value is STEREO. +

+
+
sample_rate
+

Set the sample rate for libopenmpt to output. +Range is from 1000 to INT_MAX. The value default is 48000. +

+
+ +
+
+

20.16 mov/mp4/3gp

+ +

Demuxer for Quicktime File Format & ISO/IEC Base Media File Format (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12). +

+

Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v +

+ +
+

20.16.1 Options

+ +

This demuxer accepts the following options: +

+
enable_drefs
+

Enable loading of external tracks, disabled by default. +Enabling this can theoretically leak information in some use cases. +

+
+
use_absolute_path
+

Allows loading of external tracks via absolute paths, disabled by default. +Enabling this poses a security risk. It should only be enabled if the source +is known to be non-malicious. +

+
+
seek_streams_individually
+

When seeking, identify the closest point in each stream individually and demux packets in +that stream from identified point. This can lead to a different sequence of packets compared +to demuxing linearly from the beginning. Default is true. +

+
+
ignore_editlist
+

Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the +timeline described by the edit list. Default is false. +

+
+
advanced_editlist
+

Modify the stream index to reflect the timeline described by the edit list. ignore_editlist +must be set to false for this option to be effective. +If both ignore_editlist and this option are set to false, then only the +start of the stream index is modified to reflect initial dwell time or starting timestamp +described by the edit list. Default is true. +

+
+
ignore_chapters
+

Don’t parse chapters. This includes GoPro ’HiLight’ tags/moments. Note that chapters are +only parsed when input is seekable. Default is false. +

+
+
use_mfra_for
+

For seekable fragmented input, set fragment’s starting timestamp from media fragment random access box, if present. +

+

Following options are available: +

+
auto
+

Auto-detect whether to set mfra timestamps as PTS or DTS (default) +

+
+
dts
+

Set mfra timestamps as DTS +

+
+
pts
+

Set mfra timestamps as PTS +

+
+
0
+

Don’t use mfra box to set timestamps +

+
+ +
+
use_tfdt
+

For fragmented input, set fragment’s starting timestamp to baseMediaDecodeTime from the tfdt box. +Default is enabled, which will prefer to use the tfdt box to set DTS. Disable to use the earliest_presentation_time from the sidx box. +In either case, the timestamp from the mfra box will be used if it’s available and use_mfra_for is +set to pts or dts. +

+
+
export_all
+

Export unrecognized boxes within the udta box as metadata entries. The first four +characters of the box type are set as the key. Default is false. +

+
+
export_xmp
+

Export entire contents of XMP_ box and uuid box as a string with key xmp. Note that +if export_all is set and this option isn’t, the contents of XMP_ box are still exported +but with key XMP_. Default is false. +

+
+
activation_bytes
+

4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below. +

+
+
audible_fixed_key
+

Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to +specify. +

+
+
decryption_key
+

16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7). +

+
+
max_stts_delta
+

Very high sample deltas written in a trak’s stts box may occasionally be intended but usually they are written in +error or used to store a negative value for dts correction when treated as signed 32-bit integers. This option lets +the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when +cast to int32 are used to adjust onward dts. +

+

Unit is the track time scale. Range is 0 to UINT_MAX. Default is UINT_MAX - 48000*10 which allows upto +a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of uint32 range. +

+
+ +
+
+

20.16.2 Audible AAX

+ +

Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret. +

+
ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
+
+ +
+
+
+

20.17 mpegts

+ +

MPEG-2 transport stream demuxer. +

+

This demuxer accepts the following options: +

+
resync_size
+

Set size limit for looking up a new synchronization. Default value is +65536. +

+
+
skip_unknown_pmt
+

Skip PMTs for programs not defined in the PAT. Default value is 0. +

+
+
fix_teletext_pts
+

Override teletext packet PTS and DTS values with the timestamps calculated +from the PCR of the first program which the teletext stream is part of and is +not discarded. Default value is 1, set this option to 0 if you want your +teletext packet PTS and DTS values untouched. +

+
+
ts_packetsize
+

Output option carrying the raw packet size in bytes. +Show the detected raw packet size, cannot be set by the user. +

+
+
scan_all_pmts
+

Scan and combine all PMTs. The value is an integer with value from -1 +to 1 (-1 means automatic setting, 1 means enabled, 0 means +disabled). Default value is -1. +

+
+
merge_pmt_versions
+

Re-use existing streams when a PMT’s version is updated and elementary +streams move to different PIDs. Default value is 0. +

+
+
max_packet_size
+

Set maximum size, in bytes, of packet emitted by the demuxer. Payloads above this size +are split across multiple packets. Range is 1 to INT_MAX/2. Default is 204800 bytes. +

+
+ +
+
+

20.18 mpjpeg

+ +

MJPEG encapsulated in multi-part MIME demuxer. +

+

This demuxer allows reading of MJPEG, where each frame is represented as a part of +multipart/x-mixed-replace stream. +

+
strict_mime_boundary
+

Default implementation applies a relaxed standard to multi-part MIME boundary detection, +to prevent regression with numerous existing endpoints not generating a proper MIME +MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check +of the boundary value. +

+
+ +
+
+

20.19 rawvideo

+ +

Raw video demuxer. +

+

This demuxer allows one to read raw video data. Since there is no header +specifying the assumed video parameters, the user must specify them +in order to be able to decode the data correctly. +

+

This demuxer accepts the following options: +

+
framerate
+

Set input video frame rate. Default value is 25. +

+
+
pixel_format
+

Set the input video pixel format. Default value is yuv420p. +

+
+
video_size
+

Set the input video size. This value must be specified explicitly. +

+
+ +

For example to read a rawvideo file input.raw with +ffplay, assuming a pixel format of rgb24, a video +size of 320x240, and a frame rate of 10 images per second, use +the command: +

+
ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
+
+ +
+
+

20.20 sbg

+ +

SBaGen script demuxer. +

+

This demuxer reads the script language used by SBaGen +http://uazu.net/sbagen/ to generate binaural beats sessions. A SBG +script looks like that: +

+
-SE
+a: 300-2.5/3 440+4.5/0
+b: 300-2.5/0 440+4.5/3
+off: -
+NOW      == a
++0:07:00 == b
++0:14:00 == a
++0:21:00 == b
++0:30:00    off
+
+ +

A SBG script can mix absolute and relative timestamps. If the script uses +either only absolute timestamps (including the script start time) or only +relative ones, then its layout is fixed, and the conversion is +straightforward. On the other hand, if the script mixes both kind of +timestamps, then the NOW reference for relative timestamps will be +taken from the current time of day at the time the script is read, and the +script layout will be frozen according to that reference. That means that if +the script is directly played, the actual times will match the absolute +timestamps up to the sound controller’s clock accuracy, but if the user +somehow pauses the playback or seeks, all times will be shifted accordingly. +

+
+
+

20.21 tedcaptions

+ +

JSON captions used for TED Talks. +

+

TED does not provide links to the captions, but they can be guessed from the +page. The file tools/bookmarklets.html from the FFmpeg source tree +contains a bookmarklet to expose them. +

+

This demuxer accepts the following option: +

+
start_time
+

Set the start time of the TED talk, in milliseconds. The default is 15000 +(15s). It is used to sync the captions with the downloadable videos, because +they include a 15s intro. +

+
+ +

Example: convert the captions to a format most players understand: +

+
ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
+
+ +
+
+

20.22 vapoursynth

+ +

Vapoursynth wrapper. +

+

Due to security concerns, Vapoursynth scripts will not +be autodetected so the input format has to be forced. For ff* CLI tools, +add -f vapoursynth before the input -i yourscript.vpy. +

+

This demuxer accepts the following option: +

+
max_script_size
+

The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size, +which in turn, acts as a ceiling for the size of scripts that can be read. +Default is 1 MiB. +

+
+ +
+
+
+

21 Muxers

+ +

Muxers are configured elements in FFmpeg which allow writing +multimedia streams to a particular type of file. +

+

When you configure your FFmpeg build, all the supported muxers +are enabled by default. You can list all available muxers using the +configure option --list-muxers. +

+

You can disable all the muxers with the configure option +--disable-muxers and selectively enable / disable single muxers +with the options --enable-muxer=MUXER / +--disable-muxer=MUXER. +

+

The option -muxers of the ff* tools will display the list of +enabled muxers. Use -formats to view a combined list of +enabled demuxers and muxers. +

+

A description of some of the currently available muxers follows. +

+ +
+

21.1 a64

+ +

A64 muxer for Commodore 64 video. Accepts a single a64_multi or a64_multi5 codec video stream. +

+
+
+

21.2 adts

+ +

Audio Data Transport Stream muxer. It accepts a single AAC stream. +

+ +
+

21.2.1 Options

+ +

It accepts the following options: +

+
+
write_id3v2 bool
+

Enable to write ID3v2.4 tags at the start of the stream. Default is disabled. +

+
+
write_apetag bool
+

Enable to write APE tags at the end of the stream. Default is disabled. +

+
+
write_mpeg2 bool
+

Enable to set MPEG version bit in the ADTS frame header to 1 which indicates MPEG-2. Default is 0, which indicates MPEG-4. +

+
+
+ +
+
+
+

21.3 aiff

+ +

Audio Interchange File Format muxer. +

+ +
+

21.3.1 Options

+ +

It accepts the following options: +

+
+
write_id3v2
+

Enable ID3v2 tags writing when set to 1. Default is 0 (disabled). +

+
+
id3v2_version
+

Select ID3v2 version to write. Currently only version 3 and 4 (aka. +ID3v2.3 and ID3v2.4) are supported. The default is version 4. +

+
+
+ +
+
+
+

21.4 alp

+ +

Muxer for audio of High Voltage Software’s Lego Racers game. It accepts a single ADPCM_IMA_ALP stream +with no more than 2 channels nor a sample rate greater than 44100 Hz. +

+

Extensions: tun, pcm +

+ +
+

21.4.1 Options

+ +

It accepts the following options: +

+
+
type type
+

Set file type. +

+
+
tun
+

Set file type as music. Must have a sample rate of 22050 Hz. +

+
+
pcm
+

Set file type as sfx. +

+
+
auto
+

Set file type as per output file extension. .pcm results in type pcm else type tun is set. (default) +

+
+
+ +
+
+ +
+
+
+

21.5 asf

+ +

Advanced Systems Format muxer. +

+

Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this +muxer too. +

+ +
+

21.5.1 Options

+ +

It accepts the following options: +

+
+
packet_size
+

Set the muxer packet size. By tuning this setting you may reduce data +fragmentation or muxer overhead depending on your source. Default value is +3200, minimum is 100, maximum is 64k. +

+
+
+ +
+
+
+

21.6 avi

+ +

Audio Video Interleaved muxer. +

+ +
+

21.6.1 Options

+ +

It accepts the following options: +

+
+
reserve_index_space
+

Reserve the specified amount of bytes for the OpenDML master index of each +stream within the file header. By default additional master indexes are +embedded within the data packets if there is no space left in the first master +index and are linked together as a chain of indexes. This index structure can +cause problems for some use cases, e.g. third-party software strictly relying +on the OpenDML index specification or when file seeking is slow. Reserving +enough index space in the file header avoids these problems. +

+

The required index space depends on the output file size and should be about 16 +bytes per gigabyte. When this option is omitted or set to zero the necessary +index space is guessed. +

+
+
write_channel_mask
+

Write the channel layout mask into the audio stream header. +

+

This option is enabled by default. Disabling the channel mask can be useful in +specific scenarios, e.g. when merging multiple audio streams into one for +compatibility with software that only supports a single audio stream in AVI +(see (ffmpeg-filters)the "amerge" section in the ffmpeg-filters manual). +

+
+
flipped_raw_rgb
+

If set to true, store positive height for raw RGB bitmaps, which indicates +bitmap is stored bottom-up. Note that this option does not flip the bitmap +which has to be done manually beforehand, e.g. by using the vflip filter. +Default is false and indicates bitmap is stored top down. +

+
+
+ +
+
+
+

21.7 chromaprint

+ +

Chromaprint fingerprinter. +

+

This muxer feeds audio data to the Chromaprint library, +which generates a fingerprint for the provided audio data. See https://acoustid.org/chromaprint +

+

It takes a single signed native-endian 16-bit raw audio stream of at most 2 channels. +

+ +
+

21.7.1 Options

+ +
+
silence_threshold
+

Threshold for detecting silence. Range is from -1 to 32767, where -1 disables +silence detection. Silence detection can only be used with version 3 of the +algorithm. +Silence detection must be disabled for use with the AcoustID service. Default is -1. +

+
+
algorithm
+

Version of algorithm to fingerprint with. Range is 0 to 4. +Version 3 enables silence detection. Default is 1. +

+
+
fp_format
+

Format to output the fingerprint as. Accepts the following options: +

+
raw
+

Binary raw fingerprint +

+
+
compressed
+

Binary compressed fingerprint +

+
+
base64
+

Base64 compressed fingerprint (default) +

+
+
+ +
+
+ +
+
+
+

21.8 crc

+ +

CRC (Cyclic Redundancy Check) testing format. +

+

This muxer computes and prints the Adler-32 CRC of all the input audio +and video frames. By default audio frames are converted to signed +16-bit raw audio and video frames to raw video before computing the +CRC. +

+

The output of the muxer consists of a single line of the form: +CRC=0xCRC, where CRC is a hexadecimal number 0-padded to +8 digits containing the CRC for all the decoded input frames. +

+

See also the framecrc muxer. +

+ +
+

21.8.1 Examples

+ +

For example to compute the CRC of the input, and store it in the file +out.crc: +

+
ffmpeg -i INPUT -f crc out.crc
+
+ +

You can print the CRC to stdout with the command: +

+
ffmpeg -i INPUT -f crc -
+
+ +

You can select the output format of each frame with ffmpeg by +specifying the audio and video codec and format. For example to +compute the CRC of the input audio converted to PCM unsigned 8-bit +and the input video converted to MPEG-2 video, use the command: +

+
ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
+
+ +
+
+
+

21.9 dash

+ +

Dynamic Adaptive Streaming over HTTP (DASH) muxer that creates segments +and manifest files according to the MPEG-DASH standard ISO/IEC 23009-1:2014. +

+

For more information see: +

+ + +

It creates a MPD manifest file and segment files for each stream. +

+

The segment filename might contain pre-defined identifiers used with SegmentTemplate +as defined in section 5.3.9.4.4 of the standard. Available identifiers are "$RepresentationID$", +"$Number$", "$Bandwidth$" and "$Time$". +In addition to the standard identifiers, an ffmpeg-specific "$ext$" identifier is also supported. +When specified ffmpeg will replace $ext$ in the file name with muxing format’s extensions such as mp4, webm etc., +

+
+
ffmpeg -re -i <input> -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
+-b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline \
+-profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 \
+-b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 \
+-window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" \
+-f dash /path/to/out.mpd
+
+ +
+
seg_duration duration
+

Set the segment length in seconds (fractional value can be set). The value is +treated as average segment duration when use_template is enabled and +use_timeline is disabled and as minimum segment duration for all the other +use cases. +

+
frag_duration duration
+

Set the length in seconds of fragments within segments (fractional value can be set). +

+
frag_type type
+

Set the type of interval for fragmentation. +

+
window_size size
+

Set the maximum number of segments kept in the manifest. +

+
extra_window_size size
+

Set the maximum number of segments kept outside of the manifest before removing from disk. +

+
remove_at_exit remove
+

Enable (1) or disable (0) removal of all segments when finished. +

+
use_template template
+

Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList. +

+
use_timeline timeline
+

Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate. +

+
single_file single_file
+

Enable (1) or disable (0) storing all segments in one file, accessed using byte ranges. +

+
single_file_name file_name
+

DASH-templated name to be used for baseURL. Implies single_file set to "1". In the template, "$ext$" is replaced with the file name extension specific for the segment format. +

+
init_seg_name init_name
+

DASH-templated name to used for the initialization segment. Default is "init-stream$RepresentationID$.$ext$". "$ext$" is replaced with the file name extension specific for the segment format. +

+
media_seg_name segment_name
+

DASH-templated name to used for the media segments. Default is "chunk-stream$RepresentationID$-$Number%05d$.$ext$". "$ext$" is replaced with the file name extension specific for the segment format. +

+
utc_timing_url utc_url
+

URL of the page that will return the UTC timestamp in ISO format. Example: "https://time.akamai.com/?iso" +

+
method method
+

Use the given HTTP method to create output files. Generally set to PUT or POST. +

+
http_user_agent user_agent
+

Override User-Agent field in HTTP header. Applicable only for HTTP output. +

+
http_persistent http_persistent
+

Use persistent HTTP connections. Applicable only for HTTP output. +

+
hls_playlist hls_playlist
+

Generate HLS playlist files as well. The master playlist is generated with the filename hls_master_name. +One media playlist file is generated for each stream with filenames media_0.m3u8, media_1.m3u8, etc. +

+
hls_master_name file_name
+

HLS master playlist name. Default is "master.m3u8". +

+
streaming streaming
+

Enable (1) or disable (0) chunk streaming mode of output. In chunk streaming +mode, each frame will be a moof fragment which forms a chunk. +

+
adaptation_sets adaptation_sets
+

Assign streams to AdaptationSets. Syntax is "id=x,streams=a,b,c id=y,streams=d,e" with x and y being the IDs +of the adaptation sets and a,b,c,d and e are the indices of the mapped streams. +

+

To map all video (or audio) streams to an AdaptationSet, "v" (or "a") can be used as stream identifier instead of IDs. +

+

When no assignment is defined, this defaults to an AdaptationSet for each stream. +

+

Optional syntax is "id=x,seg_duration=x,frag_duration=x,frag_type=type,descriptor=descriptor_string,streams=a,b,c id=y,seg_duration=y,frag_type=type,streams=d,e" and so on, +descriptor is useful to the scheme defined by ISO/IEC 23009-1:2014/Amd.2:2015. +For example, -adaptation_sets "id=0,descriptor=<SupplementalProperty schemeIdUri=\"urn:mpeg:dash:srd:2014\" value=\"0,0,0,1,1,2,2\"/>,streams=v". +Please note that descriptor string should be a self-closing xml tag. +seg_duration, frag_duration and frag_type override the global option values for each adaptation set. +For example, -adaptation_sets "id=0,seg_duration=2,frag_duration=1,frag_type=duration,streams=v id=1,seg_duration=2,frag_type=none,streams=a" +type_id marks an adaptation set as containing streams meant to be used for Trick Mode for the referenced adaptation set. +For example, -adaptation_sets "id=0,seg_duration=2,frag_type=none,streams=0 id=1,seg_duration=10,frag_type=none,trick_id=0,streams=1" +

+
timeout timeout
+

Set timeout for socket I/O operations. Applicable only for HTTP output. +

+
index_correction index_correction
+

Enable (1) or Disable (0) segment index correction logic. Applicable only when +use_template is enabled and use_timeline is disabled. +

+

When enabled, the logic monitors the flow of segment indexes. If a streams’s +segment index value is not at the expected real time position, then the logic +corrects that index value. +

+

Typically this logic is needed in live streaming use cases. The network bandwidth +fluctuations are common during long run streaming. Each fluctuation can cause +the segment indexes fall behind the expected real time position. +

+
format_options options_list
+

Set container format (mp4/webm) options using a : separated list of +key=value parameters. Values containing : special characters must be +escaped. +

+
+
global_sidx global_sidx
+

Write global SIDX atom. Applicable only for single file, mp4 output, non-streaming mode. +

+
+
dash_segment_type dash_segment_type
+

Possible values: +

+
auto
+

If this flag is set, the dash segment files format will be selected based on the stream codec. This is the default mode. +

+
+
mp4
+

If this flag is set, the dash segment files will be in in ISOBMFF format. +

+
+
webm
+

If this flag is set, the dash segment files will be in in WebM format. +

+
+ +
+
ignore_io_errors ignore_io_errors
+

Ignore IO errors during open and write. Useful for long-duration runs with network output. +

+
+
lhls lhls
+

Enable Low-latency HLS(LHLS). Adds #EXT-X-PREFETCH tag with current segment’s URI. +hls.js player folks are trying to standardize an open LHLS spec. The draft spec is available in https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md +This option tries to comply with the above open spec. +It enables streaming and hls_playlist options automatically. +This is an experimental feature. +

+

Note: This is not Apple’s version LHLS. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis +

+
+
ldash ldash
+

Enable Low-latency Dash by constraining the presence and values of some elements. +

+
+
master_m3u8_publish_rate master_m3u8_publish_rate
+

Publish master playlist repeatedly every after specified number of segment intervals. +

+
+
write_prft write_prft
+

Write Producer Reference Time elements on supported streams. This also enables writing +prft boxes in the underlying muxer. Applicable only when the utc_url option is enabled. +It’s set to auto by default, in which case the muxer will attempt to enable it only in modes +that require it. +

+
+
mpd_profile mpd_profile
+

Set one or more manifest profiles. +

+
+
http_opts http_opts
+

A :-separated list of key=value options to pass to the underlying HTTP +protocol. Applicable only for HTTP output. +

+
+
target_latency target_latency
+

Set an intended target latency in seconds (fractional value can be set) for serving. Applicable only when streaming and write_prft options are enabled. +This is an informative fields clients can use to measure the latency of the service. +

+
+
min_playback_rate min_playback_rate
+

Set the minimum playback rate indicated as appropriate for the purposes of automatically +adjusting playback latency and buffer occupancy during normal playback by clients. +

+
+
max_playback_rate max_playback_rate
+

Set the maximum playback rate indicated as appropriate for the purposes of automatically +adjusting playback latency and buffer occupancy during normal playback by clients. +

+
+
update_period update_period
+

Set the mpd update period ,for dynamic content. + The unit is second. +

+
+
+ +
+
+

21.10 fifo

+ +

The fifo pseudo-muxer allows the separation of encoding and muxing by using +first-in-first-out queue and running the actual muxer in a separate thread. This +is especially useful in combination with the tee muxer and can be used to +send data to several destinations with different reliability/writing speed/latency. +

+

API users should be aware that callback functions (interrupt_callback, +io_open and io_close) used within its AVFormatContext must be thread-safe. +

+

The behavior of the fifo muxer if the queue fills up or if the output fails is +selectable, +

+
    +
  • output can be transparently restarted with configurable delay between retries +based on real time or time of the processed stream. + +
  • encoding can be blocked during temporary failure, or continue transparently +dropping packets in case fifo queue fills up. + +
+ +
+
fifo_format
+

Specify the format name. Useful if it cannot be guessed from the +output name suffix. +

+
+
queue_size
+

Specify size of the queue (number of packets). Default value is 60. +

+
+
format_opts
+

Specify format options for the underlying muxer. Muxer options can be specified +as a list of key=value pairs separated by ’:’. +

+
+
drop_pkts_on_overflow bool
+

If set to 1 (true), in case the fifo queue fills up, packets will be dropped +rather than blocking the encoder. This makes it possible to continue streaming without +delaying the input, at the cost of omitting part of the stream. By default +this option is set to 0 (false), so in such cases the encoder will be blocked +until the muxer processes some of the packets and none of them is lost. +

+
+
attempt_recovery bool
+

If failure occurs, attempt to recover the output. This is especially useful +when used with network output, since it makes it possible to restart streaming transparently. +By default this option is set to 0 (false). +

+
+
max_recovery_attempts
+

Sets maximum number of successive unsuccessful recovery attempts after which +the output fails permanently. By default this option is set to 0 (unlimited). +

+
+
recovery_wait_time duration
+

Waiting time before the next recovery attempt after previous unsuccessful +recovery attempt. Default value is 5 seconds. +

+
+
recovery_wait_streamtime bool
+

If set to 0 (false), the real time is used when waiting for the recovery +attempt (i.e. the recovery will be attempted after at least +recovery_wait_time seconds). +If set to 1 (true), the time of the processed stream is taken into account +instead (i.e. the recovery will be attempted after at least recovery_wait_time +seconds of the stream is omitted). +By default, this option is set to 0 (false). +

+
+
recover_any_error bool
+

If set to 1 (true), recovery will be attempted regardless of type of the error +causing the failure. By default this option is set to 0 (false) and in case of +certain (usually permanent) errors the recovery is not attempted even when +attempt_recovery is set to 1. +

+
+
restart_with_keyframe bool
+

Specify whether to wait for the keyframe after recovering from +queue overflow or failure. This option is set to 0 (false) by default. +

+
+
timeshift duration
+

Buffer the specified amount of packets and delay writing the output. Note that +queue_size must be big enough to store the packets for timeshift. At the +end of the input the fifo buffer is flushed at realtime speed. +

+
+
+ + +
+

21.10.1 Examples

+ +
    +
  • Stream something to rtmp server, continue processing the stream at real-time +rate even in case of temporary failure (network outage) and attempt to recover +streaming every second indefinitely. +
    +
    ffmpeg -re -i ... -c:v libx264 -c:a aac -f fifo -fifo_format flv -map 0:v -map 0:a
    +  -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 1 rtmp://example.com/live/stream_name
    +
    + +
+ +
+
+
+

21.11 flv

+ +

Adobe Flash Video Format muxer. +

+

This muxer accepts the following options: +

+
+
flvflags flags
+

Possible values: +

+
+
aac_seq_header_detect
+

Place AAC sequence header based on audio stream data. +

+
+
no_sequence_end
+

Disable sequence end tag. +

+
+
no_metadata
+

Disable metadata tag. +

+
+
no_duration_filesize
+

Disable duration and filesize in metadata when they are equal to zero +at the end of stream. (Be used to non-seekable living stream). +

+
+
add_keyframe_index
+

Used to facilitate seeking; particularly for HTTP pseudo streaming. +

+
+
+
+ +
+
+

21.12 framecrc

+ +

Per-packet CRC (Cyclic Redundancy Check) testing format. +

+

This muxer computes and prints the Adler-32 CRC for each audio +and video packet. By default audio frames are converted to signed +16-bit raw audio and video frames to raw video before computing the +CRC. +

+

The output of the muxer consists of a line for each audio and video +packet of the form: +

+
stream_index, packet_dts, packet_pts, packet_duration, packet_size, 0xCRC
+
+ +

CRC is a hexadecimal number 0-padded to 8 digits containing the +CRC of the packet. +

+ +
+

21.12.1 Examples

+ +

For example to compute the CRC of the audio and video frames in +INPUT, converted to raw audio and video packets, and store it +in the file out.crc: +

+
ffmpeg -i INPUT -f framecrc out.crc
+
+ +

To print the information to stdout, use the command: +

+
ffmpeg -i INPUT -f framecrc -
+
+ +

With ffmpeg, you can select the output format to which the +audio and video frames are encoded before computing the CRC for each +packet by specifying the audio and video codec. For example, to +compute the CRC of each decoded input audio frame converted to PCM +unsigned 8-bit and of each decoded input video frame converted to +MPEG-2 video, use the command: +

+
ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
+
+ +

See also the crc muxer. +

+
+
+
+

21.13 framehash

+ +

Per-packet hash testing format. +

+

This muxer computes and prints a cryptographic hash for each audio +and video packet. This can be used for packet-by-packet equality +checks without having to individually do a binary comparison on each. +

+

By default audio frames are converted to signed 16-bit raw audio and +video frames to raw video before computing the hash, but the output +of explicit conversions to other codecs can also be used. It uses the +SHA-256 cryptographic hash function by default, but supports several +other algorithms. +

+

The output of the muxer consists of a line for each audio and video +packet of the form: +

+
stream_index, packet_dts, packet_pts, packet_duration, packet_size, hash
+
+ +

hash is a hexadecimal number representing the computed hash +for the packet. +

+
+
hash algorithm
+

Use the cryptographic hash function specified by the string algorithm. +Supported values include MD5, murmur3, RIPEMD128, +RIPEMD160, RIPEMD256, RIPEMD320, SHA160, +SHA224, SHA256 (default), SHA512/224, SHA512/256, +SHA384, SHA512, CRC32 and adler32. +

+
+
+ + +
+

21.13.1 Examples

+ +

To compute the SHA-256 hash of the audio and video frames in INPUT, +converted to raw audio and video packets, and store it in the file +out.sha256: +

+
ffmpeg -i INPUT -f framehash out.sha256
+
+ +

To print the information to stdout, using the MD5 hash function, use +the command: +

+
ffmpeg -i INPUT -f framehash -hash md5 -
+
+ +

See also the hash muxer. +

+
+
+
+

21.14 framemd5

+ +

Per-packet MD5 testing format. +

+

This is a variant of the framehash muxer. Unlike that muxer, +it defaults to using the MD5 hash function. +

+ +
+

21.14.1 Examples

+ +

To compute the MD5 hash of the audio and video frames in INPUT, +converted to raw audio and video packets, and store it in the file +out.md5: +

+
ffmpeg -i INPUT -f framemd5 out.md5
+
+ +

To print the information to stdout, use the command: +

+
ffmpeg -i INPUT -f framemd5 -
+
+ +

See also the framehash and md5 muxers. +

+
+
+
+

21.15 gif

+ +

Animated GIF muxer. +

+

It accepts the following options: +

+
+
loop
+

Set the number of times to loop the output. Use -1 for no loop, 0 +for looping indefinitely (default). +

+
+
final_delay
+

Force the delay (expressed in centiseconds) after the last frame. Each frame +ends with a delay until the next frame. The default is -1, which is a +special value to tell the muxer to re-use the previous delay. In case of a +loop, you might want to customize this value to mark a pause for instance. +

+
+ +

For example, to encode a gif looping 10 times, with a 5 seconds delay between +the loops: +

+
ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
+
+ +

Note 1: if you wish to extract the frames into separate GIF files, you need to +force the image2 muxer: +

+
ffmpeg -i INPUT -c:v gif -f image2 "out%d.gif"
+
+ +

Note 2: the GIF format has a very large time base: the delay between two frames +can therefore not be smaller than one centi second. +

+
+
+

21.16 hash

+ +

Hash testing format. +

+

This muxer computes and prints a cryptographic hash of all the input +audio and video frames. This can be used for equality checks without +having to do a complete binary comparison. +

+

By default audio frames are converted to signed 16-bit raw audio and +video frames to raw video before computing the hash, but the output +of explicit conversions to other codecs can also be used. Timestamps +are ignored. It uses the SHA-256 cryptographic hash function by default, +but supports several other algorithms. +

+

The output of the muxer consists of a single line of the form: +algo=hash, where algo is a short string representing +the hash function used, and hash is a hexadecimal number +representing the computed hash. +

+
+
hash algorithm
+

Use the cryptographic hash function specified by the string algorithm. +Supported values include MD5, murmur3, RIPEMD128, +RIPEMD160, RIPEMD256, RIPEMD320, SHA160, +SHA224, SHA256 (default), SHA512/224, SHA512/256, +SHA384, SHA512, CRC32 and adler32. +

+
+
+ + +
+

21.16.1 Examples

+ +

To compute the SHA-256 hash of the input converted to raw audio and +video, and store it in the file out.sha256: +

+
ffmpeg -i INPUT -f hash out.sha256
+
+ +

To print an MD5 hash to stdout use the command: +

+
ffmpeg -i INPUT -f hash -hash md5 -
+
+ +

See also the framehash muxer. +

+
+
+
+

21.17 hls

+ +

Apple HTTP Live Streaming muxer that segments MPEG-TS according to +the HTTP Live Streaming (HLS) specification. +

+

It creates a playlist file, and one or more segment files. The output filename +specifies the playlist filename. +

+

By default, the muxer creates a file for each segment produced. These files +have the same name as the playlist, followed by a sequential number and a +.ts extension. +

+

Make sure to require a closed GOP when encoding and to set the GOP +size to fit your segment time constraint. +

+

For example, to convert an input file with ffmpeg: +

+
ffmpeg -i in.mkv -c:v h264 -flags +cgop -g 30 -hls_time 1 out.m3u8
+
+

This example will produce the playlist, out.m3u8, and segment files: +out0.ts, out1.ts, out2.ts, etc. +

+

See also the segment muxer, which provides a more generic and +flexible implementation of a segmenter, and can be used to perform HLS +segmentation. +

+ +
+

21.17.1 Options

+ +

This muxer supports the following options: +

+
+
hls_init_time duration
+

Set the initial target segment length. Default value is 0. +

+

duration must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

Segment will be cut on the next key frame after this time has passed on the first m3u8 list. +After the initial playlist is filled ffmpeg will cut segments +at duration equal to hls_time +

+
+
hls_time duration
+

Set the target segment length. Default value is 2. +

+

duration must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +Segment will be cut on the next key frame after this time has passed. +

+
+
hls_list_size size
+

Set the maximum number of playlist entries. If set to 0 the list file +will contain all the segments. Default value is 5. +

+
+
hls_delete_threshold size
+

Set the number of unreferenced segments to keep on disk before hls_flags delete_segments +deletes them. Increase this to allow continue clients to download segments which +were recently referenced in the playlist. Default value is 1, meaning segments older than +hls_list_size+1 will be deleted. +

+
+
hls_start_number_source
+

Start the playlist sequence number (#EXT-X-MEDIA-SEQUENCE) according to the specified source. +Unless hls_flags single_file is set, it also specifies source of starting sequence numbers of +segment and subtitle filenames. In any case, if hls_flags append_list +is set and read playlist sequence number is greater than the specified start sequence number, +then that value will be used as start value. +

+

It accepts the following values: +

+
+
generic (default)
+

Set the starting sequence numbers according to start_number option value. +

+
+
epoch
+

The start number will be the seconds since epoch (1970-01-01 00:00:00) +

+
+
epoch_us
+

The start number will be the microseconds since epoch (1970-01-01 00:00:00) +

+
+
datetime
+

The start number will be based on the current date/time as YYYYmmddHHMMSS. e.g. 20161231235759. +

+
+
+ +
+
start_number number
+

Start the playlist sequence number (#EXT-X-MEDIA-SEQUENCE) from the specified number +when hls_start_number_source value is generic. (This is the default case.) +Unless hls_flags single_file is set, it also specifies starting sequence numbers of segment and subtitle filenames. +Default value is 0. +

+
+
hls_allow_cache allowcache
+

Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments. +

+
+
hls_base_url baseurl
+

Append baseurl to every entry in the playlist. +Useful to generate playlists with absolute paths. +

+

Note that the playlist sequence number must be unique for each segment +and it is not to be confused with the segment filename sequence number +which can be cyclic, for example if the wrap option is +specified. +

+
+
hls_segment_filename filename
+

Set the segment filename. Unless hls_flags single_file is set, +filename is used as a string format with the segment number: +

+
ffmpeg -i in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
+
+

This example will produce the playlist, out.m3u8, and segment files: +file000.ts, file001.ts, file002.ts, etc. +

+

filename may contain full path or relative path specification, +but only the file name part without any path info will be contained in the m3u8 segment list. +Should a relative path be specified, the path of the created segment +files will be relative to the current working directory. +When strftime_mkdir is set, the whole expanded value of filename will be written into the m3u8 segment list. +

+

When var_stream_map is set with two or more variant streams, the +filename pattern must contain the string "%v", this string specifies +the position of variant stream index in the generated segment file names. +

+
ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
+  -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \
+  -hls_segment_filename 'file_%v_%03d.ts' out_%v.m3u8
+
+

This example will produce the playlists segment file sets: +file_0_000.ts, file_0_001.ts, file_0_002.ts, etc. and +file_1_000.ts, file_1_001.ts, file_1_002.ts, etc. +

+

The string "%v" may be present in the filename or in the last directory name +containing the file, but only in one of them. (Additionally, %v may appear multiple times in the last +sub-directory or filename.) If the string %v is present in the directory name, then +sub-directories are created after expanding the directory name pattern. This +enables creation of segments corresponding to different variant streams in +subdirectories. +

+
ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
+  -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \
+  -hls_segment_filename 'vs%v/file_%03d.ts' vs%v/out.m3u8
+
+

This example will produce the playlists segment file sets: +vs0/file_000.ts, vs0/file_001.ts, vs0/file_002.ts, etc. and +vs1/file_000.ts, vs1/file_001.ts, vs1/file_002.ts, etc. +

+
+
strftime
+

Use strftime() on filename to expand the segment filename with localtime. +The segment number is also available in this mode, but to use it, you need to specify second_level_segment_index +hls_flag and %%d will be the specifier. +

+
ffmpeg -i in.nut -strftime 1 -hls_segment_filename 'file-%Y%m%d-%s.ts' out.m3u8
+
+

This example will produce the playlist, out.m3u8, and segment files: +file-20160215-1455569023.ts, file-20160215-1455569024.ts, etc. +Note: On some systems/environments, the %s specifier is not available. See + strftime() documentation. +

+
ffmpeg -i in.nut -strftime 1 -hls_flags second_level_segment_index -hls_segment_filename 'file-%Y%m%d-%%04d.ts' out.m3u8
+
+

This example will produce the playlist, out.m3u8, and segment files: +file-20160215-0001.ts, file-20160215-0002.ts, etc. +

+
+
strftime_mkdir
+

Used together with -strftime_mkdir, it will create all subdirectories which +is expanded in filename. +

+
ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y%m%d/file-%Y%m%d-%s.ts' out.m3u8
+
+

This example will create a directory 201560215 (if it does not exist), and then +produce the playlist, out.m3u8, and segment files: +20160215/file-20160215-1455569023.ts, 20160215/file-20160215-1455569024.ts, etc. +

+
+
ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y/%m/%d/file-%Y%m%d-%s.ts' out.m3u8
+
+

This example will create a directory hierarchy 2016/02/15 (if any of them do not exist), and then +produce the playlist, out.m3u8, and segment files: +2016/02/15/file-20160215-1455569023.ts, 2016/02/15/file-20160215-1455569024.ts, etc. +

+
+
hls_segment_options options_list
+

Set output format options using a :-separated list of key=value +parameters. Values containing : special characters must be +escaped. +

+
+
hls_key_info_file key_info_file
+

Use the information in key_info_file for segment encryption. The first +line of key_info_file specifies the key URI written to the playlist. The +key URL is used to access the encryption key during playback. The second line +specifies the path to the key file used to obtain the key during the encryption +process. The key file is read as a single packed array of 16 octets in binary +format. The optional third line specifies the initialization vector (IV) as a +hexadecimal string to be used instead of the segment sequence number (default) +for encryption. Changes to key_info_file will result in segment +encryption with the new key/IV and an entry in the playlist for the new key +URI/IV if hls_flags periodic_rekey is enabled. +

+

Key info file format: +

+
key URI
+key file path
+IV (optional)
+
+ +

Example key URIs: +

+
http://server/file.key
+/path/to/file.key
+file.key
+
+ +

Example key file paths: +

+
file.key
+/path/to/file.key
+
+ +

Example IV: +

+
0123456789ABCDEF0123456789ABCDEF
+
+ +

Key info file example: +

+
http://server/file.key
+/path/to/file.key
+0123456789ABCDEF0123456789ABCDEF
+
+ +

Example shell script: +

+
#!/bin/sh
+BASE_URL=${1:-'.'}
+openssl rand 16 > file.key
+echo $BASE_URL/file.key > file.keyinfo
+echo file.key >> file.keyinfo
+echo $(openssl rand -hex 16) >> file.keyinfo
+ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
+  -hls_key_info_file file.keyinfo out.m3u8
+
+ +
+
-hls_enc enc
+

Enable (1) or disable (0) the AES128 encryption. +When enabled every segment generated is encrypted and the encryption key +is saved as playlist name.key. +

+
+
-hls_enc_key key
+

16-octet key to encrypt the segments, by default it +is randomly generated. +

+
+
-hls_enc_key_url keyurl
+

If set, keyurl is prepended instead of baseurl to the key filename +in the playlist. +

+
+
-hls_enc_iv iv
+

16-octet initialization vector for every segment instead +of the autogenerated ones. +

+
+
hls_segment_type flags
+

Possible values: +

+
+
mpegts
+

Output segment files in MPEG-2 Transport Stream format. This is +compatible with all HLS versions. +

+
+
fmp4
+

Output segment files in fragmented MP4 format, similar to MPEG-DASH. +fmp4 files may be used in HLS version 7 and above. +

+
+
+ +
+
hls_fmp4_init_filename filename
+

Set filename to the fragment files header file, default filename is init.mp4. +

+

Use -strftime 1 on filename to expand the segment filename with localtime. +

+
ffmpeg -i in.nut  -hls_segment_type fmp4 -strftime 1 -hls_fmp4_init_filename "%s_init.mp4" out.m3u8
+
+

This will produce init like this +1602678741_init.mp4 +

+
+
hls_fmp4_init_resend
+

Resend init file after m3u8 file refresh every time, default is 0. +

+

When var_stream_map is set with two or more variant streams, the +filename pattern must contain the string "%v", this string specifies +the position of variant stream index in the generated init file names. +The string "%v" may be present in the filename or in the last directory name +containing the file. If the string is present in the directory name, then +sub-directories are created after expanding the directory name pattern. This +enables creation of init files corresponding to different variant streams in +subdirectories. +

+
+
hls_flags flags
+

Possible values: +

+
+
single_file
+

If this flag is set, the muxer will store all segments in a single MPEG-TS +file, and will use byte ranges in the playlist. HLS playlists generated with +this way will have the version number 4. +For example: +

+
ffmpeg -i in.nut -hls_flags single_file out.m3u8
+
+

Will produce the playlist, out.m3u8, and a single segment file, +out.ts. +

+
+
delete_segments
+

Segment files removed from the playlist are deleted after a period of time +equal to the duration of the segment plus the duration of the playlist. +

+
+
append_list
+

Append new segments into the end of old segment list, +and remove the #EXT-X-ENDLIST from the old segment list. +

+
+
round_durations
+

Round the duration info in the playlist file segment info to integer +values, instead of using floating point. +If there are no other features requiring higher HLS versions be used, +then this will allow ffmpeg to output a HLS version 2 m3u8. +

+
+
discont_start
+

Add the #EXT-X-DISCONTINUITY tag to the playlist, before the +first segment’s information. +

+
+
omit_endlist
+

Do not append the EXT-X-ENDLIST tag at the end of the playlist. +

+
+
periodic_rekey
+

The file specified by hls_key_info_file will be checked periodically and +detect updates to the encryption info. Be sure to replace this file atomically, +including the file containing the AES encryption key. +

+
+
independent_segments
+

Add the #EXT-X-INDEPENDENT-SEGMENTS to playlists that has video segments +and when all the segments of that playlist are guaranteed to start with a Key frame. +

+
+
iframes_only
+

Add the #EXT-X-I-FRAMES-ONLY to playlists that has video segments +and can play only I-frames in the #EXT-X-BYTERANGE mode. +

+
+
split_by_time
+

Allow segments to start on frames other than keyframes. This improves +behavior on some players when the time between keyframes is inconsistent, +but may make things worse on others, and can cause some oddities during +seeking. This flag should be used with the hls_time option. +

+
+
program_date_time
+

Generate EXT-X-PROGRAM-DATE-TIME tags. +

+
+
second_level_segment_index
+

Makes it possible to use segment indexes as %%d in hls_segment_filename expression +besides date/time values when strftime is on. +To get fixed width numbers with trailing zeroes, %%0xd format is available where x is the required width. +

+
+
second_level_segment_size
+

Makes it possible to use segment sizes (counted in bytes) as %%s in hls_segment_filename +expression besides date/time values when strftime is on. +To get fixed width numbers with trailing zeroes, %%0xs format is available where x is the required width. +

+
+
second_level_segment_duration
+

Makes it possible to use segment duration (calculated in microseconds) as %%t in hls_segment_filename +expression besides date/time values when strftime is on. +To get fixed width numbers with trailing zeroes, %%0xt format is available where x is the required width. +

+
+
ffmpeg -i sample.mpeg \
+   -f hls -hls_time 3 -hls_list_size 5 \
+   -hls_flags second_level_segment_index+second_level_segment_size+second_level_segment_duration \
+   -strftime 1 -strftime_mkdir 1 -hls_segment_filename "segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts" stream.m3u8
+
+

This will produce segments like this: +segment_20170102194334_0003_00122200_0000003000000.ts, segment_20170102194334_0004_00120072_0000003000000.ts etc. +

+
+
temp_file
+

Write segment data to filename.tmp and rename to filename only once the segment is complete. A webserver +serving up segments can be configured to reject requests to *.tmp to prevent access to in-progress segments +before they have been added to the m3u8 playlist. This flag also affects how m3u8 playlist files are created. +If this flag is set, all playlist files will written into temporary file and renamed after they are complete, similarly as segments are handled. +But playlists with file protocol and with type (hls_playlist_type) other than vod +are always written into temporary file regardless of this flag. Master playlist files (master_pl_name), if any, with file protocol, +are always written into temporary file regardless of this flag if master_pl_publish_rate value is other than zero. +

+
+
+ +
+
hls_playlist_type event
+

Emit #EXT-X-PLAYLIST-TYPE:EVENT in the m3u8 header. Forces +hls_list_size to 0; the playlist can only be appended to. +

+
+
hls_playlist_type vod
+

Emit #EXT-X-PLAYLIST-TYPE:VOD in the m3u8 header. Forces +hls_list_size to 0; the playlist must not change. +

+
+
method
+

Use the given HTTP method to create the hls files. +

+
ffmpeg -re -i in.ts -f hls -method PUT http://example.com/live/out.m3u8
+
+

This example will upload all the mpegts segment files to the HTTP +server using the HTTP PUT method, and update the m3u8 files every +refresh times using the same method. +Note that the HTTP server must support the given method for uploading +files. +

+
+
http_user_agent
+

Override User-Agent field in HTTP header. Applicable only for HTTP output. +

+
+
var_stream_map
+

Map string which specifies how to group the audio, video and subtitle streams +into different variant streams. The variant stream groups are separated +by space. +Expected string format is like this "a:0,v:0 a:1,v:1 ....". Here a:, v:, s: are +the keys to specify audio, video and subtitle streams respectively. +Allowed values are 0 to 9 (limited just based on practical usage). +

+

When there are two or more variant streams, the output filename pattern must +contain the string "%v", this string specifies the position of variant stream +index in the output media playlist filenames. The string "%v" may be present in +the filename or in the last directory name containing the file. If the string is +present in the directory name, then sub-directories are created after expanding +the directory name pattern. This enables creation of variant streams in +subdirectories. +

+
+
ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
+  -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \
+  http://example.com/live/out_%v.m3u8
+
+

This example creates two hls variant streams. The first variant stream will +contain video stream of bitrate 1000k and audio stream of bitrate 64k and the +second variant stream will contain video stream of bitrate 256k and audio +stream of bitrate 32k. Here, two media playlist with file names out_0.m3u8 and +out_1.m3u8 will be created. If you want something meaningful text instead of indexes +in result names, you may specify names for each or some of the variants +as in the following example. +

+ +
+
ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
+  -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0,name:my_hd v:1,a:1,name:my_sd" \
+  http://example.com/live/out_%v.m3u8
+
+ +

This example creates two hls variant streams as in the previous one. +But here, the two media playlist with file names out_my_hd.m3u8 and +out_my_sd.m3u8 will be created. +

+
+
ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k \
+  -map 0:v -map 0:a -map 0:v -f hls -var_stream_map "v:0 a:0 v:1" \
+  http://example.com/live/out_%v.m3u8
+
+

This example creates three hls variant streams. The first variant stream will +be a video only stream with video bitrate 1000k, the second variant stream will +be an audio only stream with bitrate 64k and the third variant stream will be a +video only stream with bitrate 256k. Here, three media playlist with file names +out_0.m3u8, out_1.m3u8 and out_2.m3u8 will be created. +

+
ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
+  -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \
+  http://example.com/live/vs_%v/out.m3u8
+
+

This example creates the variant streams in subdirectories. Here, the first +media playlist is created at http://example.com/live/vs_0/out.m3u8 and +the second one at http://example.com/live/vs_1/out.m3u8. +

+
ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k -b:v:1 3000k  \
+  -map 0:a -map 0:a -map 0:v -map 0:v -f hls \
+  -var_stream_map "a:0,agroup:aud_low a:1,agroup:aud_high v:0,agroup:aud_low v:1,agroup:aud_high" \
+  -master_pl_name master.m3u8 \
+  http://example.com/live/out_%v.m3u8
+
+

This example creates two audio only and two video only variant streams. In +addition to the #EXT-X-STREAM-INF tag for each variant stream in the master +playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams +and they are mapped to the two video only variant streams with audio group names +’aud_low’ and ’aud_high’. +

+

By default, a single hls variant containing all the encoded streams is created. +

+
+
ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
+  -map 0:a -map 0:a -map 0:v -f hls \
+  -var_stream_map "a:0,agroup:aud_low,default:yes a:1,agroup:aud_low v:0,agroup:aud_low" \
+  -master_pl_name master.m3u8 \
+  http://example.com/live/out_%v.m3u8
+
+

This example creates two audio only and one video only variant streams. In +addition to the #EXT-X-STREAM-INF tag for each variant stream in the master +playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams +and they are mapped to the one video only variant streams with audio group name +’aud_low’, and the audio group have default stat is NO or YES. +

+

By default, a single hls variant containing all the encoded streams is created. +

+
+
ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
+  -map 0:a -map 0:a -map 0:v -f hls \
+  -var_stream_map "a:0,agroup:aud_low,default:yes,language:ENG a:1,agroup:aud_low,language:CHN v:0,agroup:aud_low" \
+  -master_pl_name master.m3u8 \
+  http://example.com/live/out_%v.m3u8
+
+

This example creates two audio only and one video only variant streams. In +addition to the #EXT-X-STREAM-INF tag for each variant stream in the master +playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams +and they are mapped to the one video only variant streams with audio group name +’aud_low’, and the audio group have default stat is NO or YES, and one audio +have and language is named ENG, the other audio language is named CHN. +

+

By default, a single hls variant containing all the encoded streams is created. +

+
+
ffmpeg -y -i input_with_subtitle.mkv \
+ -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
+ -b:a:0 256k \
+ -c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \
+ -f hls -var_stream_map "v:0,a:0,s:0,sgroup:subtitle" \
+ -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
+ 10 -master_pl_publish_rate 10  -hls_flags \
+ delete_segments+discont_start+split_by_time ./tmp/video.m3u8
+
+ +

This example adds #EXT-X-MEDIA tag with TYPE=SUBTITLES in +the master playlist with webvtt subtitle group name ’subtitle’. Please make sure +the input file has one text subtitle stream at least. +

+
+
cc_stream_map
+

Map string which specifies different closed captions groups and their +attributes. The closed captions stream groups are separated by space. +Expected string format is like this +"ccgroup:<group name>,instreamid:<INSTREAM-ID>,language:<language code> ....". +’ccgroup’ and ’instreamid’ are mandatory attributes. ’language’ is an optional +attribute. +The closed captions groups configured using this option are mapped to different +variant streams by providing the same ’ccgroup’ name in the +var_stream_map string. If var_stream_map is not set, then the +first available ccgroup in cc_stream_map is mapped to the output variant +stream. The examples for these two use cases are given below. +

+
+
ffmpeg -re -i in.ts -b:v 1000k -b:a 64k -a53cc 1 -f hls \
+  -cc_stream_map "ccgroup:cc,instreamid:CC1,language:en" \
+  -master_pl_name master.m3u8 \
+  http://example.com/live/out.m3u8
+
+

This example adds #EXT-X-MEDIA tag with TYPE=CLOSED-CAPTIONS in +the master playlist with group name ’cc’, language ’en’ (english) and +INSTREAM-ID ’CC1’. Also, it adds CLOSED-CAPTIONS attribute with group +name ’cc’ for the output variant stream. +

+
ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
+  -a53cc:0 1 -a53cc:1 1\
+  -map 0:v -map 0:a -map 0:v -map 0:a -f hls \
+  -cc_stream_map "ccgroup:cc,instreamid:CC1,language:en ccgroup:cc,instreamid:CC2,language:sp" \
+  -var_stream_map "v:0,a:0,ccgroup:cc v:1,a:1,ccgroup:cc" \
+  -master_pl_name master.m3u8 \
+  http://example.com/live/out_%v.m3u8
+
+

This example adds two #EXT-X-MEDIA tags with TYPE=CLOSED-CAPTIONS in +the master playlist for the INSTREAM-IDs ’CC1’ and ’CC2’. Also, it adds +CLOSED-CAPTIONS attribute with group name ’cc’ for the two output variant +streams. +

+
+
master_pl_name
+

Create HLS master playlist with the given name. +

+
+
ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 http://example.com/live/out.m3u8
+
+

This example creates HLS master playlist with name master.m3u8 and it is +published at http://example.com/live/ +

+
+
master_pl_publish_rate
+

Publish master play list repeatedly every after specified number of segment intervals. +

+
+
ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 \
+-hls_time 2 -master_pl_publish_rate 30 http://example.com/live/out.m3u8
+
+ +

This example creates HLS master playlist with name master.m3u8 and keep +publishing it repeatedly every after 30 segments i.e. every after 60s. +

+
+
http_persistent
+

Use persistent HTTP connections. Applicable only for HTTP output. +

+
+
timeout
+

Set timeout for socket I/O operations. Applicable only for HTTP output. +

+
+
-ignore_io_errors
+

Ignore IO errors during open, write and delete. Useful for long-duration runs with network output. +

+
+
headers
+

Set custom HTTP headers, can override built in default headers. Applicable only for HTTP output. +

+
+
+ +
+
+
+

21.18 ico

+ +

ICO file muxer. +

+

Microsoft’s icon file format (ICO) has some strict limitations that should be noted: +

+
    +
  • Size cannot exceed 256 pixels in any dimension + +
  • Only BMP and PNG images can be stored + +
  • If a BMP image is used, it must be one of the following pixel formats: +
    +
    BMP Bit Depth      FFmpeg Pixel Format
    +1bit               pal8
    +4bit               pal8
    +8bit               pal8
    +16bit              rgb555le
    +24bit              bgr24
    +32bit              bgra
    +
    + +
  • If a BMP image is used, it must use the BITMAPINFOHEADER DIB header + +
  • If a PNG image is used, it must use the rgba pixel format +
+ +
+
+

21.19 image2

+ +

Image file muxer. +

+

The image file muxer writes video frames to image files. +

+

The output filenames are specified by a pattern, which can be used to +produce sequentially numbered series of files. +The pattern may contain the string "%d" or "%0Nd", this string +specifies the position of the characters representing a numbering in +the filenames. If the form "%0Nd" is used, the string +representing the number in each filename is 0-padded to N +digits. The literal character ’%’ can be specified in the pattern with +the string "%%". +

+

If the pattern contains "%d" or "%0Nd", the first filename of +the file list specified will contain the number 1, all the following +numbers will be sequential. +

+

The pattern may contain a suffix which is used to automatically +determine the format of the image files to write. +

+

For example the pattern "img-%03d.bmp" will specify a sequence of +filenames of the form img-001.bmp, img-002.bmp, ..., +img-010.bmp, etc. +The pattern "img%%-%d.jpg" will specify a sequence of filenames of the +form img%-1.jpg, img%-2.jpg, ..., img%-10.jpg, +etc. +

+

The image muxer supports the .Y.U.V image file format. This format is +special in that that each image frame consists of three files, for +each of the YUV420P components. To read or write this image file format, +specify the name of the ’.Y’ file. The muxer will automatically open the +’.U’ and ’.V’ files as required. +

+ +
+

21.19.1 Options

+ +
+
frame_pts
+

If set to 1, expand the filename with pts from pkt->pts. +Default value is 0. +

+
+
start_number
+

Start the sequence from the specified number. Default value is 1. +

+
+
update
+

If set to 1, the filename will always be interpreted as just a +filename, not a pattern, and the corresponding file will be continuously +overwritten with new images. Default value is 0. +

+
+
strftime
+

If set to 1, expand the filename with date and time information from +strftime(). Default value is 0. +

+
+
atomic_writing
+

Write output to a temporary file, which is renamed to target filename once +writing is completed. Default is disabled. +

+
+
protocol_opts options_list
+

Set protocol options as a :-separated list of key=value parameters. Values +containing the : special character must be escaped. +

+
+
+ +
+
+

21.19.2 Examples

+ +

The following example shows how to use ffmpeg for creating a +sequence of files img-001.jpeg, img-002.jpeg, ..., +taking one image every second from the input video: +

+
ffmpeg -i in.avi -vsync cfr -r 1 -f image2 'img-%03d.jpeg'
+
+ +

Note that with ffmpeg, if the format is not specified with the +-f option and the output filename specifies an image file +format, the image2 muxer is automatically selected, so the previous +command can be written as: +

+
ffmpeg -i in.avi -vsync cfr -r 1 'img-%03d.jpeg'
+
+ +

Note also that the pattern must not necessarily contain "%d" or +"%0Nd", for example to create a single image file +img.jpeg from the start of the input video you can employ the command: +

+
ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
+
+ +

The strftime option allows you to expand the filename with +date and time information. Check the documentation of +the strftime() function for the syntax. +

+

For example to generate image files from the strftime() +"%Y-%m-%d_%H-%M-%S" pattern, the following ffmpeg command +can be used: +

+
ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 "%Y-%m-%d_%H-%M-%S.jpg"
+
+ +

You can set the file name with current frame’s PTS: +

+
ffmpeg -f v4l2 -r 1 -i /dev/video0 -copyts -f image2 -frame_pts true %d.jpg
+
+ +

A more complex example is to publish contents of your desktop directly to a +WebDAV server every second: +

+
ffmpeg -f x11grab -framerate 1 -i :0.0 -q:v 6 -update 1 -protocol_opts method=PUT http://example.com/desktop.jpg
+
+ +
+
+
+

21.20 matroska

+ +

Matroska container muxer. +

+

This muxer implements the matroska and webm container specs. +

+ +
+

21.20.1 Metadata

+ +

The recognized metadata settings in this muxer are: +

+
+
title
+

Set title name provided to a single track. This gets mapped to +the FileDescription element for a stream written as attachment. +

+
+
language
+

Specify the language of the track in the Matroska languages form. +

+

The language can be either the 3 letters bibliographic ISO-639-2 (ISO +639-2/B) form (like "fre" for French), or a language code mixed with a +country code for specialities in languages (like "fre-ca" for Canadian +French). +

+
+
stereo_mode
+

Set stereo 3D video layout of two views in a single video track. +

+

The following values are recognized: +

+
mono
+

video is not stereo +

+
left_right
+

Both views are arranged side by side, Left-eye view is on the left +

+
bottom_top
+

Both views are arranged in top-bottom orientation, Left-eye view is at bottom +

+
top_bottom
+

Both views are arranged in top-bottom orientation, Left-eye view is on top +

+
checkerboard_rl
+

Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first +

+
checkerboard_lr
+

Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first +

+
row_interleaved_rl
+

Each view is constituted by a row based interleaving, Right-eye view is first row +

+
row_interleaved_lr
+

Each view is constituted by a row based interleaving, Left-eye view is first row +

+
col_interleaved_rl
+

Both views are arranged in a column based interleaving manner, Right-eye view is first column +

+
col_interleaved_lr
+

Both views are arranged in a column based interleaving manner, Left-eye view is first column +

+
anaglyph_cyan_red
+

All frames are in anaglyph format viewable through red-cyan filters +

+
right_left
+

Both views are arranged side by side, Right-eye view is on the left +

+
anaglyph_green_magenta
+

All frames are in anaglyph format viewable through green-magenta filters +

+
block_lr
+

Both eyes laced in one Block, Left-eye view is first +

+
block_rl
+

Both eyes laced in one Block, Right-eye view is first +

+
+
+
+ +

For example a 3D WebM clip can be created using the following command line: +

+
ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
+
+ +
+
+

21.20.2 Options

+ +

This muxer supports the following options: +

+
+
reserve_index_space
+

By default, this muxer writes the index for seeking (called cues in Matroska +terms) at the end of the file, because it cannot know in advance how much space +to leave for the index at the beginning of the file. However for some use cases +– e.g. streaming where seeking is possible but slow – it is useful to put the +index at the beginning of the file. +

+

If this option is set to a non-zero value, the muxer will reserve a given amount +of space in the file header and then try to write the cues there when the muxing +finishes. If the reserved space does not suffice, no Cues will be written, the +file will be finalized and writing the trailer will return an error. +A safe size for most use cases should be about 50kB per hour of video. +

+

Note that cues are only written if the output is seekable and this option will +have no effect if it is not. +

+
+
cues_to_front
+

If set, the muxer will write the index at the beginning of the file +by shifting the main data if necessary. This can be combined with +reserve_index_space in which case the data is only shifted if +the initially reserved space turns out to be insufficient. +

+

This option is ignored if the output is unseekable. +

+
+
default_mode
+

This option controls how the FlagDefault of the output tracks will be set. +It influences which tracks players should play by default. The default mode +is ‘passthrough’. +

+
infer
+

Every track with disposition default will have the FlagDefault set. +Additionally, for each type of track (audio, video or subtitle), if no track +with disposition default of this type exists, then the first track of this type +will be marked as default (if existing). This ensures that the default flag +is set in a sensible way even if the input originated from containers that +lack the concept of default tracks. +

+
infer_no_subs
+

This mode is the same as infer except that if no subtitle track with +disposition default exists, no subtitle track will be marked as default. +

+
passthrough
+

In this mode the FlagDefault is set if and only if the AV_DISPOSITION_DEFAULT +flag is set in the disposition of the corresponding stream. +

+
+ +
+
flipped_raw_rgb
+

If set to true, store positive height for raw RGB bitmaps, which indicates +bitmap is stored bottom-up. Note that this option does not flip the bitmap +which has to be done manually beforehand, e.g. by using the vflip filter. +Default is false and indicates bitmap is stored top down. +

+
+
+ +
+
+
+

21.21 md5

+ +

MD5 testing format. +

+

This is a variant of the hash muxer. Unlike that muxer, it +defaults to using the MD5 hash function. +

+ +
+

21.21.1 Examples

+ +

To compute the MD5 hash of the input converted to raw +audio and video, and store it in the file out.md5: +

+
ffmpeg -i INPUT -f md5 out.md5
+
+ +

You can print the MD5 to stdout with the command: +

+
ffmpeg -i INPUT -f md5 -
+
+ +

See also the hash and framemd5 muxers. +

+
+
+
+

21.22 mov, mp4, ismv

+ +

MOV/MP4/ISMV (Smooth Streaming) muxer. +

+

The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4 +file has all the metadata about all packets stored in one location +(written at the end of the file, it can be moved to the start for +better playback by adding +faststart to the -movflags, or +using the qt-faststart tool). +

+

A fragmented +file consists of a number of fragments, where packets and metadata +about these packets are stored together. Writing a fragmented +file has the advantage that the file is decodable even if the +writing is interrupted (while a normal MOV/MP4 is undecodable if +it is not properly finished), and it requires less memory when writing +very long files (since writing normal MOV/MP4 files stores info about +every single packet in memory until the file is closed). The downside +is that it is less compatible with other applications. +

+

Fragmentation is enabled by setting one of the options that define +how to cut the file into fragments: -frag_duration, -frag_size, +-min_frag_duration, -movflags +frag_keyframe and +-movflags +frag_custom. If more than one condition is specified, +fragments are cut when one of the specified conditions is fulfilled. The +exception to this is -min_frag_duration, which has to be fulfilled for +any of the other conditions to apply. +

+ +
+

21.22.1 Options

+ +
+
frag_duration duration
+

Create fragments that are duration microseconds long. +

+
frag_size size
+

Create fragments that contain up to size bytes of payload data. +

+
min_frag_duration duration
+

Don’t create fragments that are shorter than duration microseconds long. +

+
movflags flags
+

Set various muxing switches. The following flags can be used: +

+
frag_keyframe
+

Start a new fragment at each video keyframe. +

+
frag_custom
+

Allow the caller to manually choose when to cut fragments, by +calling av_write_frame(ctx, NULL) to write a fragment with +the packets written so far. (This is only useful with other +applications integrating libavformat, not from ffmpeg.) +

+
empty_moov
+

Write an initial moov atom directly at the start of the file, without +describing any samples in it. Generally, an mdat/moov pair is written +at the start of the file, as a normal MOV/MP4 file, containing only +a short portion of the file. With this option set, there is no initial +mdat atom, and the moov atom only describes the tracks but has +a zero duration. +

+

This option is implicitly set when writing ismv (Smooth Streaming) files. +

+
separate_moof
+

Write a separate moof (movie fragment) atom for each track. Normally, +packets for all tracks are written in a moof atom (which is slightly +more efficient), but with this option set, the muxer writes one moof/mdat +pair for each track, making it easier to separate tracks. +

+

This option is implicitly set when writing ismv (Smooth Streaming) files. +

+
skip_sidx
+

Skip writing of sidx atom. When bitrate overhead due to sidx atom is high, +this option could be used for cases where sidx atom is not mandatory. +When global_sidx flag is enabled, this option will be ignored. +

+
faststart
+

Run a second pass moving the index (moov atom) to the beginning of the file. +This operation can take a while, and will not work in various situations such +as fragmented output, thus it is not enabled by default. +

+
rtphint
+

Add RTP hinting tracks to the output file. +

+
disable_chpl
+

Disable Nero chapter markers (chpl atom). Normally, both Nero chapters +and a QuickTime chapter track are written to the file. With this option +set, only the QuickTime chapter track will be written. Nero chapters can +cause failures when the file is reprocessed with certain tagging programs, like +mp3Tag 2.61a and iTunes 11.3, most likely other versions are affected as well. +

+
omit_tfhd_offset
+

Do not write any absolute base_data_offset in tfhd atoms. This avoids +tying fragments to absolute byte positions in the file/streams. +

+
default_base_moof
+

Similarly to the omit_tfhd_offset, this flag avoids writing the +absolute base_data_offset field in tfhd atoms, but does so by using +the new default-base-is-moof flag instead. This flag is new from +14496-12:2012. This may make the fragments easier to parse in certain +circumstances (avoiding basing track fragment location calculations +on the implicit end of the previous track fragment). +

+
negative_cts_offsets
+

Enables utilization of version 1 of the CTTS box, in which the CTS offsets can +be negative. This enables the initial sample to have DTS/CTS of zero, and +reduces the need for edit lists for some cases such as video tracks with +B-frames. Additionally, eases conformance with the DASH-IF interoperability +guidelines. +

+

This option is implicitly set when writing ismv (Smooth Streaming) files. +

+
+ +
+
moov_size bytes
+

Reserves space for the moov atom at the beginning of the file instead of placing the +moov atom at the end. If the space reserved is insufficient, muxing will fail. +

+
+
write_tmcd
+

Specify on to force writing a timecode track, off to disable it +and auto to write a timecode track only for mov and mp4 output (default). +

+
+
write_btrt bool
+

Force or disable writing bitrate box inside stsd box of a track. +The box contains decoding buffer size (in bytes), maximum bitrate and +average bitrate for the track. The box will be skipped if none of these values +can be computed. +Default is -1 or auto, which will write the box only in MP4 mode. +

+
+
write_prft
+

Write producer time reference box (PRFT) with a specified time source for the +NTP field in the PRFT box. Set value as ‘wallclock’ to specify timesource +as wallclock time and ‘pts’ to specify timesource as input packets’ PTS +values. +

+

Setting value to ‘pts’ is applicable only for a live encoding use case, +where PTS values are set as as wallclock time at the source. For example, an +encoding use case with decklink capture source where video_pts and +audio_pts are set to ‘abs_wallclock’. +

+
+
empty_hdlr_name bool
+

Enable to skip writing the name inside a hdlr box. +Default is false. +

+
+
movie_timescale scale
+

Set the timescale written in the movie header box (mvhd). +Range is 1 to INT_MAX. Default is 1000. +

+
+
video_track_timescale scale
+

Set the timescale used for video tracks. Range is 0 to INT_MAX. +If set to 0, the timescale is automatically set based on +the native stream time base. Default is 0. +

+
+ +
+
+

21.22.2 Example

+ +

Smooth Streaming content can be pushed in real time to a publishing +point on IIS with this muxer. Example: +

+
ffmpeg -re <normal input/transcoding options> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
+
+ +
+
+
+

21.23 mp3

+ +

The MP3 muxer writes a raw MP3 stream with the following optional features: +

    +
  • An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and +2.4 are supported, the id3v2_version private option controls which one is +used (3 or 4). Setting id3v2_version to 0 disables the ID3v2 header +completely. + +

    The muxer supports writing attached pictures (APIC frames) to the ID3v2 header. +The pictures are supplied to the muxer in form of a video stream with a single +packet. There can be any number of those streams, each will correspond to a +single APIC frame. The stream metadata tags title and comment map +to APIC description and picture type respectively. See +http://id3.org/id3v2.4.0-frames for allowed picture types. +

    +

    Note that the APIC frames must be written at the beginning, so the muxer will +buffer the audio frames until it gets all the pictures. It is therefore advised +to provide the pictures as soon as possible to avoid excessive buffering. +

    +
  • A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by +default, but will be written only if the output is seekable. The +write_xing private option can be used to disable it. The frame contains +various information that may be useful to the decoder, like the audio duration +or encoder delay. + +
  • A legacy ID3v1 tag at the end of the file (disabled by default). It may be +enabled with the write_id3v1 private option, but as its capabilities are +very limited, its usage is not recommended. +
+ +

Examples: +

+

Write an mp3 with an ID3v2.3 header and an ID3v1 footer: +

+
ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
+
+ +

To attach a picture to an mp3 file select both the audio and the picture stream +with map: +

+
ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
+-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
+
+ +

Write a "clean" MP3 without any extra features: +

+
ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
+
+ +
+
+

21.24 mpegts

+ +

MPEG transport stream muxer. +

+

This muxer implements ISO 13818-1 and part of ETSI EN 300 468. +

+

The recognized metadata settings in mpegts muxer are service_provider +and service_name. If they are not set the default for +service_provider is ‘FFmpeg’ and the default for +service_name is ‘Service01’. +

+ +
+

21.24.1 Options

+ +

The muxer options are: +

+
+
mpegts_transport_stream_id integer
+

Set the ‘transport_stream_id’. This identifies a transponder in DVB. +Default is 0x0001. +

+
+
mpegts_original_network_id integer
+

Set the ‘original_network_id’. This is unique identifier of a +network in DVB. Its main use is in the unique identification of a service +through the path ‘Original_Network_ID, Transport_Stream_ID’. Default +is 0x0001. +

+
+
mpegts_service_id integer
+

Set the ‘service_id’, also known as program in DVB. Default is +0x0001. +

+
+
mpegts_service_type integer
+

Set the program ‘service_type’. Default is digital_tv. +Accepts the following options: +

+
hex_value
+

Any hexadecimal value between 0x01 and 0xff as defined in +ETSI 300 468. +

+
digital_tv
+

Digital TV service. +

+
digital_radio
+

Digital Radio service. +

+
teletext
+

Teletext service. +

+
advanced_codec_digital_radio
+

Advanced Codec Digital Radio service. +

+
mpeg2_digital_hdtv
+

MPEG2 Digital HDTV service. +

+
advanced_codec_digital_sdtv
+

Advanced Codec Digital SDTV service. +

+
advanced_codec_digital_hdtv
+

Advanced Codec Digital HDTV service. +

+
+ +
+
mpegts_pmt_start_pid integer
+

Set the first PID for PMTs. Default is 0x1000, minimum is 0x0020, +maximum is 0x1ffa. This option has no effect in m2ts mode where the PMT +PID is fixed 0x0100. +

+
+
mpegts_start_pid integer
+

Set the first PID for elementary streams. Default is 0x0100, minimum is +0x0020, maximum is 0x1ffa. This option has no effect in m2ts mode +where the elementary stream PIDs are fixed. +

+
+
mpegts_m2ts_mode boolean
+

Enable m2ts mode if set to 1. Default value is -1 which +disables m2ts mode. +

+
+
muxrate integer
+

Set a constant muxrate. Default is VBR. +

+
+
pes_payload_size integer
+

Set minimum PES packet payload in bytes. Default is 2930. +

+
+
mpegts_flags flags
+

Set mpegts flags. Accepts the following options: +

+
resend_headers
+

Reemit PAT/PMT before writing the next packet. +

+
latm
+

Use LATM packetization for AAC. +

+
pat_pmt_at_frames
+

Reemit PAT and PMT at each video frame. +

+
system_b
+

Conform to System B (DVB) instead of System A (ATSC). +

+
initial_discontinuity
+

Mark the initial packet of each stream as discontinuity. +

+
nit
+

Emit NIT table. +

+
omit_rai
+

Disable writing of random access indicator. +

+
+ +
+
mpegts_copyts boolean
+

Preserve original timestamps, if value is set to 1. Default value +is -1, which results in shifting timestamps so that they start from 0. +

+
+
omit_video_pes_length boolean
+

Omit the PES packet length for video packets. Default is 1 (true). +

+
+
pcr_period integer
+

Override the default PCR retransmission time in milliseconds. Default is +-1 which means that the PCR interval will be determined automatically: +20 ms is used for CBR streams, the highest multiple of the frame duration which +is less than 100 ms is used for VBR streams. +

+
+
pat_period duration
+

Maximum time in seconds between PAT/PMT tables. Default is 0.1. +

+
+
sdt_period duration
+

Maximum time in seconds between SDT tables. Default is 0.5. +

+
+
nit_period duration
+

Maximum time in seconds between NIT tables. Default is 0.5. +

+
+
tables_version integer
+

Set PAT, PMT, SDT and NIT version (default 0, valid values are from 0 to 31, inclusively). +This option allows updating stream structure so that standard consumer may +detect the change. To do so, reopen output AVFormatContext (in case of API +usage) or restart ffmpeg instance, cyclically changing +tables_version value: +

+
+
ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
+ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
+...
+ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
+ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
+ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
+...
+
+
+
+ +
+
+

21.24.2 Example

+ +
+
ffmpeg -i file.mpg -c copy \
+     -mpegts_original_network_id 0x1122 \
+     -mpegts_transport_stream_id 0x3344 \
+     -mpegts_service_id 0x5566 \
+     -mpegts_pmt_start_pid 0x1500 \
+     -mpegts_start_pid 0x150 \
+     -metadata service_provider="Some provider" \
+     -metadata service_name="Some Channel" \
+     out.ts
+
+ +
+
+
+

21.25 mxf, mxf_d10, mxf_opatom

+ +

MXF muxer. +

+ +
+

21.25.1 Options

+ +

The muxer options are: +

+
+
store_user_comments bool
+

Set if user comments should be stored if available or never. +IRT D-10 does not allow user comments. The default is thus to write them for +mxf and mxf_opatom but not for mxf_d10 +

+
+ +
+
+
+

21.26 null

+ +

Null muxer. +

+

This muxer does not generate any output file, it is mainly useful for +testing or benchmarking purposes. +

+

For example to benchmark decoding with ffmpeg you can use the +command: +

+
ffmpeg -benchmark -i INPUT -f null out.null
+
+ +

Note that the above command does not read or write the out.null +file, but specifying the output file is required by the ffmpeg +syntax. +

+

Alternatively you can write the command as: +

+
ffmpeg -benchmark -i INPUT -f null -
+
+ +
+
+

21.27 nut

+ +
+
-syncpoints flags
+

Change the syncpoint usage in nut: +

+
default use the normal low-overhead seeking aids.
+
none do not use the syncpoints at all, reducing the overhead but making the stream non-seekable;
+

Use of this option is not recommended, as the resulting files are very damage + sensitive and seeking is not possible. Also in general the overhead from + syncpoints is negligible. Note, -write_index 0 can be used to disable + all growing data tables, allowing to mux endless streams with limited memory + and without these disadvantages. +

+
timestamped extend the syncpoint with a wallclock field.
+
+

The none and timestamped flags are experimental. +

+
-write_index bool
+

Write index at the end, the default is to write an index. +

+
+ +
+
ffmpeg -i INPUT -f_strict experimental -syncpoints none - | processor
+
+ +
+
+

21.28 ogg

+ +

Ogg container muxer. +

+
+
-page_duration duration
+

Preferred page duration, in microseconds. The muxer will attempt to create +pages that are approximately duration microseconds long. This allows the +user to compromise between seek granularity and container overhead. The default +is 1 second. A value of 0 will fill all segments, making pages as large as +possible. A value of 1 will effectively use 1 packet-per-page in most +situations, giving a small seek granularity at the cost of additional container +overhead. +

+
-serial_offset value
+

Serial value from which to set the streams serial number. +Setting it to different and sufficiently large values ensures that the produced +ogg files can be safely chained. +

+
+
+ +
+
+

21.29 raw muxers

+ +

Raw muxers accept a single stream matching the designated codec. They do not store timestamps or metadata. +The recognized extension is the same as the muxer name unless indicated otherwise. +

+ +
+

21.29.1 ac3

+ +

Dolby Digital, also known as AC-3, audio. +

+
+
+

21.29.2 adx

+ +

CRI Middleware ADX audio. +

+

This muxer will write out the total sample count near the start of the first packet +when the output is seekable and the count can be stored in 32 bits. +

+
+
+

21.29.3 aptx

+ +

aptX (Audio Processing Technology for Bluetooth) audio. +

+
+
+

21.29.4 aptx_hd

+ +

aptX HD (Audio Processing Technology for Bluetooth) audio. +

+

Extensions: aptxhd +

+
+
+

21.29.5 avs2

+ +

AVS2-P2/IEEE1857.4 video. +

+

Extensions: avs, avs2 +

+
+
+

21.29.6 cavsvideo

+ +

Chinese AVS (Audio Video Standard) video. +

+

Extensions: cavs +

+
+
+

21.29.7 codec2raw

+ +

Codec 2 audio. +

+

No extension is registered so format name has to be supplied e.g. with the ffmpeg CLI tool -f codec2raw. +

+
+
+

21.29.8 data

+ +

Data muxer accepts a single stream with any codec of any type. +The input stream has to be selected using the -map option with the ffmpeg CLI tool. +

+

No extension is registered so format name has to be supplied e.g. with the ffmpeg CLI tool -f data. +

+
+
+

21.29.9 dirac

+ +

BBC Dirac video. The Dirac Pro codec is a subset and is standardized as SMPTE VC-2. +

+

Extensions: drc, vc2 +

+
+
+

21.29.10 dnxhd

+ +

Avid DNxHD video. It is standardized as SMPTE VC-3. Accepts DNxHR streams. +

+

Extensions: dnxhd, dnxhr +

+
+
+

21.29.11 dts

+ +

DTS Coherent Acoustics (DCA) audio. +

+
+
+

21.29.12 eac3

+ +

Dolby Digital Plus, also known as Enhanced AC-3, audio. +

+
+
+

21.29.13 g722

+ +

ITU-T G.722 audio. +

+
+
+

21.29.14 g723_1

+ +

ITU-T G.723.1 audio. +

+

Extensions: tco, rco +

+
+
+

21.29.15 g726

+ +

ITU-T G.726 big-endian ("left-justified") audio. +

+

No extension is registered so format name has to be supplied e.g. with the ffmpeg CLI tool -f g726. +

+
+
+

21.29.16 g726le

+ +

ITU-T G.726 little-endian ("right-justified") audio. +

+

No extension is registered so format name has to be supplied e.g. with the ffmpeg CLI tool -f g726le. +

+
+
+

21.29.17 gsm

+ +

Global System for Mobile Communications audio. +

+
+
+

21.29.18 h261

+ +

ITU-T H.261 video. +

+
+
+

21.29.19 h263

+ +

ITU-T H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2 video. +

+
+
+

21.29.20 h264

+ +

ITU-T H.264 / MPEG-4 Part 10 AVC video. Bitstream shall be converted to Annex B syntax if it’s in length-prefixed mode. +

+

Extensions: h264, 264 +

+
+
+

21.29.21 hevc

+ +

ITU-T H.265 / MPEG-H Part 2 HEVC video. Bitstream shall be converted to Annex B syntax if it’s in length-prefixed mode. +

+

Extensions: hevc, h265, 265 +

+
+
+

21.29.22 m4v

+ +

MPEG-4 Part 2 video. +

+
+
+

21.29.23 mjpeg

+ +

Motion JPEG video. +

+

Extensions: mjpg, mjpeg +

+
+
+

21.29.24 mlp

+ +

Meridian Lossless Packing, also known as Packed PCM, audio. +

+
+
+

21.29.25 mp2

+ +

MPEG-1 Audio Layer II audio. +

+

Extensions: mp2, m2a, mpa +

+
+
+

21.29.26 mpeg1video

+ +

MPEG-1 Part 2 video. +

+

Extensions: mpg, mpeg, m1v +

+
+
+

21.29.27 mpeg2video

+ +

ITU-T H.262 / MPEG-2 Part 2 video. +

+

Extensions: m2v +

+
+
+

21.29.28 obu

+ +

AV1 low overhead Open Bitstream Units muxer. Temporal delimiter OBUs will be inserted in all temporal units of the stream. +

+
+
+

21.29.29 rawvideo

+ +

Raw uncompressed video. +

+

Extensions: yuv, rgb +

+
+
+

21.29.30 sbc

+ +

Bluetooth SIG low-complexity subband codec audio. +

+

Extensions: sbc, msbc +

+
+
+

21.29.31 truehd

+ +

Dolby TrueHD audio. +

+

Extensions: thd +

+
+
+

21.29.32 vc1

+ +

SMPTE 421M / VC-1 video. +

+
+
+
+

21.30 segment, stream_segment, ssegment

+ +

Basic stream segmenter. +

+

This muxer outputs streams to a number of separate files of nearly +fixed duration. Output filename pattern can be set in a fashion +similar to image2, or by using a strftime template if +the strftime option is enabled. +

+

stream_segment is a variant of the muxer used to write to +streaming output formats, i.e. which do not require global headers, +and is recommended for outputting e.g. to MPEG transport stream segments. +ssegment is a shorter alias for stream_segment. +

+

Every segment starts with a keyframe of the selected reference stream, +which is set through the reference_stream option. +

+

Note that if you want accurate splitting for a video file, you need to +make the input key frames correspond to the exact splitting times +expected by the segmenter, or the segment muxer will start the new +segment with the key frame found next after the specified start +time. +

+

The segment muxer works best with a single constant frame rate video. +

+

Optionally it can generate a list of the created segments, by setting +the option segment_list. The list type is specified by the +segment_list_type option. The entry filenames in the segment +list are set by default to the basename of the corresponding segment +files. +

+

See also the hls muxer, which provides a more specific +implementation for HLS segmentation. +

+ +
+

21.30.1 Options

+ +

The segment muxer supports the following options: +

+
+
increment_tc 1|0
+

if set to 1, increment timecode between each segment +If this is selected, the input need to have +a timecode in the first video stream. Default value is +0. +

+
+
reference_stream specifier
+

Set the reference stream, as specified by the string specifier. +If specifier is set to auto, the reference is chosen +automatically. Otherwise it must be a stream specifier (see the “Stream +specifiers” chapter in the ffmpeg manual) which specifies the +reference stream. The default value is auto. +

+
+
segment_format format
+

Override the inner container format, by default it is guessed by the filename +extension. +

+
+
segment_format_options options_list
+

Set output format options using a :-separated list of key=value +parameters. Values containing the : special character must be +escaped. +

+
+
segment_list name
+

Generate also a listfile named name. If not specified no +listfile is generated. +

+
+
segment_list_flags flags
+

Set flags affecting the segment list generation. +

+

It currently supports the following flags: +

+
cache
+

Allow caching (only affects M3U8 list files). +

+
+
live
+

Allow live-friendly file generation. +

+
+ +
+
segment_list_size size
+

Update the list file so that it contains at most size +segments. If 0 the list file will contain all the segments. Default +value is 0. +

+
+
segment_list_entry_prefix prefix
+

Prepend prefix to each entry. Useful to generate absolute paths. +By default no prefix is applied. +

+
+
segment_list_type type
+

Select the listing format. +

+

The following values are recognized: +

+
flat
+

Generate a flat list for the created segments, one segment per line. +

+
+
csv, ext
+

Generate a list for the created segments, one segment per line, +each line matching the format (comma-separated values): +

+
segment_filename,segment_start_time,segment_end_time
+
+ +

segment_filename is the name of the output file generated by the +muxer according to the provided pattern. CSV escaping (according to +RFC4180) is applied if required. +

+

segment_start_time and segment_end_time specify +the segment start and end time expressed in seconds. +

+

A list file with the suffix ".csv" or ".ext" will +auto-select this format. +

+

ext’ is deprecated in favor or ‘csv’. +

+
+
ffconcat
+

Generate an ffconcat file for the created segments. The resulting file +can be read using the FFmpeg concat demuxer. +

+

A list file with the suffix ".ffcat" or ".ffconcat" will +auto-select this format. +

+
+
m3u8
+

Generate an extended M3U8 file, version 3, compliant with +http://tools.ietf.org/id/draft-pantos-http-live-streaming. +

+

A list file with the suffix ".m3u8" will auto-select this format. +

+
+ +

If not specified the type is guessed from the list file name suffix. +

+
+
segment_time time
+

Set segment duration to time, the value must be a duration +specification. Default value is "2". See also the +segment_times option. +

+

Note that splitting may not be accurate, unless you force the +reference stream key-frames at the given time. See the introductory +notice and the examples below. +

+
+
min_seg_duration time
+

Set minimum segment duration to time, the value must be a duration +specification. This prevents the muxer ending segments at a duration below +this value. Only effective with segment_time. Default value is "0". +

+
+
segment_atclocktime 1|0
+

If set to "1" split at regular clock time intervals starting from 00:00 +o’clock. The time value specified in segment_time is +used for setting the length of the splitting interval. +

+

For example with segment_time set to "900" this makes it possible +to create files at 12:00 o’clock, 12:15, 12:30, etc. +

+

Default value is "0". +

+
+
segment_clocktime_offset duration
+

Delay the segment splitting times with the specified duration when using +segment_atclocktime. +

+

For example with segment_time set to "900" and +segment_clocktime_offset set to "300" this makes it possible to +create files at 12:05, 12:20, 12:35, etc. +

+

Default value is "0". +

+
+
segment_clocktime_wrap_duration duration
+

Force the segmenter to only start a new segment if a packet reaches the muxer +within the specified duration after the segmenting clock time. This way you +can make the segmenter more resilient to backward local time jumps, such as +leap seconds or transition to standard time from daylight savings time. +

+

Default is the maximum possible duration which means starting a new segment +regardless of the elapsed time since the last clock time. +

+
+
segment_time_delta delta
+

Specify the accuracy time when selecting the start time for a +segment, expressed as a duration specification. Default value is "0". +

+

When delta is specified a key-frame will start a new segment if its +PTS satisfies the relation: +

+
PTS >= start_time - time_delta
+
+ +

This option is useful when splitting video content, which is always +split at GOP boundaries, in case a key frame is found just before the +specified split time. +

+

In particular may be used in combination with the ffmpeg option +force_key_frames. The key frame times specified by +force_key_frames may not be set accurately because of rounding +issues, with the consequence that a key frame time may result set just +before the specified time. For constant frame rate videos a value of +1/(2*frame_rate) should address the worst case mismatch between +the specified time and the time set by force_key_frames. +

+
+
segment_times times
+

Specify a list of split points. times contains a list of comma +separated duration specifications, in increasing order. See also +the segment_time option. +

+
+
segment_frames frames
+

Specify a list of split video frame numbers. frames contains a +list of comma separated integer numbers, in increasing order. +

+

This option specifies to start a new segment whenever a reference +stream key frame is found and the sequential number (starting from 0) +of the frame is greater or equal to the next value in the list. +

+
+
segment_wrap limit
+

Wrap around segment index once it reaches limit. +

+
+
segment_start_number number
+

Set the sequence number of the first segment. Defaults to 0. +

+
+
strftime 1|0
+

Use the strftime function to define the name of the new +segments to write. If this is selected, the output segment name must +contain a strftime function template. Default value is +0. +

+
+
break_non_keyframes 1|0
+

If enabled, allow segments to start on frames other than keyframes. This +improves behavior on some players when the time between keyframes is +inconsistent, but may make things worse on others, and can cause some oddities +during seeking. Defaults to 0. +

+
+
reset_timestamps 1|0
+

Reset timestamps at the beginning of each segment, so that each segment +will start with near-zero timestamps. It is meant to ease the playback +of the generated segments. May not work with some combinations of +muxers/codecs. It is set to 0 by default. +

+
+
initial_offset offset
+

Specify timestamp offset to apply to the output packet timestamps. The +argument must be a time duration specification, and defaults to 0. +

+
+
write_empty_segments 1|0
+

If enabled, write an empty segment if there are no packets during the period a +segment would usually span. Otherwise, the segment will be filled with the next +packet written. Defaults to 0. +

+
+ +

Make sure to require a closed GOP when encoding and to set the GOP +size to fit your segment time constraint. +

+
+
+

21.30.2 Examples

+ +
    +
  • Remux the content of file in.mkv to a list of segments +out-000.nut, out-001.nut, etc., and write the list of +generated segments to out.list: +
    +
    ffmpeg -i in.mkv -codec hevc -flags +cgop -g 60 -map 0 -f segment -segment_list out.list out%03d.nut
    +
    + +
  • Segment input and set output format options for the output segments: +
    +
    ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags=+faststart out%03d.mp4
    +
    + +
  • Segment the input file according to the split points specified by the +segment_times option: +
    +
    ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 out%03d.nut
    +
    + +
  • Use the ffmpeg force_key_frames +option to force key frames in the input at the specified location, together +with the segment option segment_time_delta to account for +possible roundings operated when setting key frame times. +
    +
    ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \
    +-f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
    +
    +

    In order to force key frames on the input file, transcoding is +required. +

    +
  • Segment the input file by splitting the input file according to the +frame numbers sequence specified with the segment_frames option: +
    +
    ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut
    +
    + +
  • Convert the in.mkv to TS segments using the libx264 +and aac encoders: +
    +
    ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a aac -f ssegment -segment_list out.list out%03d.ts
    +
    + +
  • Segment the input file, and create an M3U8 live playlist (can be used +as live HLS source): +
    +
    ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
    +-segment_list_flags +live -segment_time 10 out%03d.mkv
    +
    +
+ +
+
+
+

21.31 smoothstreaming

+ +

Smooth Streaming muxer generates a set of files (Manifest, chunks) suitable for serving with conventional web server. +

+
+
window_size
+

Specify the number of fragments kept in the manifest. Default 0 (keep all). +

+
+
extra_window_size
+

Specify the number of fragments kept outside of the manifest before removing from disk. Default 5. +

+
+
lookahead_count
+

Specify the number of lookahead fragments. Default 2. +

+
+
min_frag_duration
+

Specify the minimum fragment duration (in microseconds). Default 5000000. +

+
+
remove_at_exit
+

Specify whether to remove all fragments when finished. Default 0 (do not remove). +

+
+
+ +
+
+

21.32 streamhash

+ +

Per stream hash testing format. +

+

This muxer computes and prints a cryptographic hash of all the input frames, +on a per-stream basis. This can be used for equality checks without having +to do a complete binary comparison. +

+

By default audio frames are converted to signed 16-bit raw audio and +video frames to raw video before computing the hash, but the output +of explicit conversions to other codecs can also be used. Timestamps +are ignored. It uses the SHA-256 cryptographic hash function by default, +but supports several other algorithms. +

+

The output of the muxer consists of one line per stream of the form: +streamindex,streamtype,algo=hash, where +streamindex is the index of the mapped stream, streamtype is a +single character indicating the type of stream, algo is a short string +representing the hash function used, and hash is a hexadecimal number +representing the computed hash. +

+
+
hash algorithm
+

Use the cryptographic hash function specified by the string algorithm. +Supported values include MD5, murmur3, RIPEMD128, +RIPEMD160, RIPEMD256, RIPEMD320, SHA160, +SHA224, SHA256 (default), SHA512/224, SHA512/256, +SHA384, SHA512, CRC32 and adler32. +

+
+
+ + +
+

21.32.1 Examples

+ +

To compute the SHA-256 hash of the input converted to raw audio and +video, and store it in the file out.sha256: +

+
ffmpeg -i INPUT -f streamhash out.sha256
+
+ +

To print an MD5 hash to stdout use the command: +

+
ffmpeg -i INPUT -f streamhash -hash md5 -
+
+ +

See also the hash and framehash muxers. +

+
+
+
+

21.33 tee

+ +

The tee muxer can be used to write the same data to several outputs, such as files or streams. +It can be used, for example, to stream a video over a network and save it to disk at the same time. +

+

It is different from specifying several outputs to the ffmpeg +command-line tool. With the tee muxer, the audio and video data will be encoded only once. +With conventional multiple outputs, multiple encoding operations in parallel are initiated, +which can be a very expensive process. The tee muxer is not useful when using the libavformat API +directly because it is then possible to feed the same packets to several muxers directly. +

+

Since the tee muxer does not represent any particular output format, ffmpeg cannot auto-select +output streams. So all streams intended for output must be specified using -map. See +the examples below. +

+

Some encoders may need different options depending on the output format; +the auto-detection of this can not work with the tee muxer, so they need to be explicitly specified. +The main example is the global_header flag. +

+

The slave outputs are specified in the file name given to the muxer, +separated by ’|’. If any of the slave name contains the ’|’ separator, +leading or trailing spaces or any special character, those must be +escaped (see (ffmpeg-utils)the "Quoting and escaping" +section in the ffmpeg-utils(1) manual). +

+ +
+

21.33.1 Options

+ +
+
use_fifo bool
+

If set to 1, slave outputs will be processed in separate threads using the fifo +muxer. This allows to compensate for different speed/latency/reliability of +outputs and setup transparent recovery. By default this feature is turned off. +

+
+
fifo_options
+

Options to pass to fifo pseudo-muxer instances. See fifo. +

+
+
+ +

Muxer options can be specified for each slave by prepending them as a list of +key=value pairs separated by ’:’, between square brackets. If +the options values contain a special character or the ’:’ separator, they +must be escaped; note that this is a second level escaping. +

+

The following special options are also recognized: +

+
f
+

Specify the format name. Required if it cannot be guessed from the +output URL. +

+
+
bsfs[/spec]
+

Specify a list of bitstream filters to apply to the specified +output. +

+

It is possible to specify to which streams a given bitstream filter +applies, by appending a stream specifier to the option separated by +/. spec must be a stream specifier (see Format stream specifiers). +

+

If the stream specifier is not specified, the bitstream filters will be +applied to all streams in the output. This will cause that output operation +to fail if the output contains streams to which the bitstream filter cannot +be applied e.g. h264_mp4toannexb being applied to an output containing an audio stream. +

+

Options for a bitstream filter must be specified in the form of opt=value. +

+

Several bitstream filters can be specified, separated by ",". +

+
+
use_fifo bool
+

This allows to override tee muxer use_fifo option for individual slave muxer. +

+
+
fifo_options
+

This allows to override tee muxer fifo_options for individual slave muxer. +See fifo. +

+
+
select
+

Select the streams that should be mapped to the slave output, +specified by a stream specifier. If not specified, this defaults to +all the mapped streams. This will cause that output operation to fail +if the output format does not accept all mapped streams. +

+

You may use multiple stream specifiers separated by commas (,) e.g.: a:0,v +

+
+
onfail
+

Specify behaviour on output failure. This can be set to either abort (which is +default) or ignore. abort will cause whole process to fail in case of failure +on this slave output. ignore will ignore failure on this output, so other outputs +will continue without being affected. +

+
+ +
+
+

21.33.2 Examples

+ +
    +
  • Encode something and both archive it in a WebM file and stream it +as MPEG-TS over UDP: +
    +
    ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
    +  "archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
    +
    + +
  • As above, but continue streaming even if output to local file fails +(for example local drive fills up): +
    +
    ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
    +  "[onfail=ignore]archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
    +
    + +
  • Use ffmpeg to encode the input, and send the output +to three different destinations. The dump_extra bitstream +filter is used to add extradata information to all the output video +keyframes packets, as requested by the MPEG-TS format. The select +option is applied to out.aac in order to make it contain only +audio packets. +
    +
    ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
    +       -f tee "[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac"
    +
    + +
  • As above, but select only stream a:1 for the audio output. Note +that a second level escaping must be performed, as ":" is a special +character used to separate options. +
    +
    ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
    +       -f tee "[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=\'a:1\']out.aac"
    +
    +
+ +
+
+
+

21.34 webm_chunk

+ +

WebM Live Chunk Muxer. +

+

This muxer writes out WebM headers and chunks as separate files which can be +consumed by clients that support WebM Live streams via DASH. +

+ +
+

21.34.1 Options

+ +

This muxer supports the following options: +

+
+
chunk_start_index
+

Index of the first chunk (defaults to 0). +

+
+
header
+

Filename of the header where the initialization data will be written. +

+
+
audio_chunk_duration
+

Duration of each audio chunk in milliseconds (defaults to 5000). +

+
+ +
+
+

21.34.2 Example

+
+
ffmpeg -f v4l2 -i /dev/video0 \
+       -f alsa -i hw:0 \
+       -map 0:0 \
+       -c:v libvpx-vp9 \
+       -s 640x360 -keyint_min 30 -g 30 \
+       -f webm_chunk \
+       -header webm_live_video_360.hdr \
+       -chunk_start_index 1 \
+       webm_live_video_360_%d.chk \
+       -map 1:0 \
+       -c:a libvorbis \
+       -b:a 128k \
+       -f webm_chunk \
+       -header webm_live_audio_128.hdr \
+       -chunk_start_index 1 \
+       -audio_chunk_duration 1000 \
+       webm_live_audio_128_%d.chk
+
+ +
+
+
+

21.35 webm_dash_manifest

+ +

WebM DASH Manifest muxer. +

+

This muxer implements the WebM DASH Manifest specification to generate the DASH +manifest XML. It also supports manifest generation for DASH live streams. +

+

For more information see: +

+ + + +
+

21.35.1 Options

+ +

This muxer supports the following options: +

+
+
adaptation_sets
+

This option has the following syntax: "id=x,streams=a,b,c id=y,streams=d,e" where x and y are the +unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding +audio and video streams. Any number of adaptation sets can be added using this option. +

+
+
live
+

Set this to 1 to create a live stream DASH Manifest. Default: 0. +

+
+
chunk_start_index
+

Start index of the first chunk. This will go in the ‘startNumber’ attribute +of the ‘SegmentTemplate’ element in the manifest. Default: 0. +

+
+
chunk_duration_ms
+

Duration of each chunk in milliseconds. This will go in the ‘duration’ +attribute of the ‘SegmentTemplate’ element in the manifest. Default: 1000. +

+
+
utc_timing_url
+

URL of the page that will return the UTC timestamp in ISO format. This will go +in the ‘value’ attribute of the ‘UTCTiming’ element in the manifest. +Default: None. +

+
+
time_shift_buffer_depth
+

Smallest time (in seconds) shifting buffer for which any Representation is +guaranteed to be available. This will go in the ‘timeShiftBufferDepth’ +attribute of the ‘MPD’ element. Default: 60. +

+
+
minimum_update_period
+

Minimum update period (in seconds) of the manifest. This will go in the +‘minimumUpdatePeriod’ attribute of the ‘MPD’ element. Default: 0. +

+
+
+ +
+
+

21.35.2 Example

+
+
ffmpeg -f webm_dash_manifest -i video1.webm \
+       -f webm_dash_manifest -i video2.webm \
+       -f webm_dash_manifest -i audio1.webm \
+       -f webm_dash_manifest -i audio2.webm \
+       -map 0 -map 1 -map 2 -map 3 \
+       -c copy \
+       -f webm_dash_manifest \
+       -adaptation_sets "id=0,streams=0,1 id=1,streams=2,3" \
+       manifest.xml
+
+ +
+
+
+
+

22 Metadata

+ +

FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded +INI-like text file and then load it back using the metadata muxer/demuxer. +

+

The file format is as follows: +

    +
  1. A file consists of a header and a number of metadata tags divided into sections, +each on its own line. + +
  2. The header is a ‘;FFMETADATA’ string, followed by a version number (now 1). + +
  3. Metadata tags are of the form ‘key=value’ + +
  4. Immediately after header follows global metadata + +
  5. After global metadata there may be sections with per-stream/per-chapter +metadata. + +
  6. A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in +brackets (‘[’, ‘]’) and ends with next section or end of file. + +
  7. At the beginning of a chapter section there may be an optional timebase to be +used for start/end values. It must be in form +‘TIMEBASE=num/den’, where num and den are +integers. If the timebase is missing then start/end times are assumed to +be in nanoseconds. + +

    Next a chapter section must contain chapter start and end times in form +‘START=num’, ‘END=num’, where num is a positive +integer. +

    +
  8. Empty lines and lines starting with ‘;’ or ‘#’ are ignored. + +
  9. Metadata keys or values containing special characters (‘=’, ‘;’, +‘#’, ‘\’ and a newline) must be escaped with a backslash ‘\’. + +
  10. Note that whitespace in metadata (e.g. ‘foo = bar’) is considered to be +a part of the tag (in the example above key is ‘foo ’, value is +‘ bar’). +
+ +

A ffmetadata file might look like this: +

+
;FFMETADATA1
+title=bike\\shed
+;this is a comment
+artist=FFmpeg troll team
+
+[CHAPTER]
+TIMEBASE=1/1000
+START=0
+#chapter ends at 0:01:00
+END=60000
+title=chapter \#1
+[STREAM]
+title=multi\
+line
+
+ +

By using the ffmetadata muxer and demuxer it is possible to extract +metadata from an input file to an ffmetadata file, and then transcode +the file into an output file with the edited ffmetadata file. +

+

Extracting an ffmetadata file with ffmpeg goes as follows: +

+
ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
+
+ +

Reinserting edited metadata information from the FFMETADATAFILE file can +be done as: +

+
ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
+
+ +
+
+

23 Protocol Options

+ +

The libavformat library provides some generic global options, which +can be set on all the protocols. In addition each protocol may support +so-called private options, which are specific for that component. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the +AVFormatContext options or using the libavutil/opt.h API +for programmatic use. +

+

The list of supported options follows: +

+
+
protocol_whitelist list (input)
+

Set a ","-separated list of allowed protocols. "ALL" matches all protocols. Protocols +prefixed by "-" are disabled. +All protocols are allowed by default but protocols used by an another +protocol (nested protocols) are restricted to a per protocol subset. +

+
+ + +
+
+

24 Protocols

+ +

Protocols are configured elements in FFmpeg that enable access to +resources that require specific protocols. +

+

When you configure your FFmpeg build, all the supported protocols are +enabled by default. You can list all available ones using the +configure option "–list-protocols". +

+

You can disable all the protocols using the configure option +"–disable-protocols", and selectively enable a protocol using the +option "–enable-protocol=PROTOCOL", or you can disable a +particular protocol using the option +"–disable-protocol=PROTOCOL". +

+

The option "-protocols" of the ff* tools will display the list of +supported protocols. +

+

All protocols accept the following options: +

+
+
rw_timeout
+

Maximum time to wait for (network) read/write operations to complete, +in microseconds. +

+
+ +

A description of the currently available protocols follows. +

+ +
+

24.1 amqp

+ +

Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker based +publish-subscribe communication protocol. +

+

FFmpeg must be compiled with –enable-librabbitmq to support AMQP. A separate +AMQP broker must also be run. An example open-source AMQP broker is RabbitMQ. +

+

After starting the broker, an FFmpeg client may stream data to the broker using +the command: +

+
+
ffmpeg -re -i input -f mpegts amqp://[[user]:[password]@]hostname[:port][/vhost]
+
+ +

Where hostname and port (default is 5672) is the address of the broker. The +client may also set a user/password for authentication. The default for both +fields is "guest". Name of virtual host on broker can be set with vhost. The +default value is "/". +

+

Muliple subscribers may stream from the broker using the command: +

+
ffplay amqp://[[user]:[password]@]hostname[:port][/vhost]
+
+ +

In RabbitMQ all data published to the broker flows through a specific exchange, +and each subscribing client has an assigned queue/buffer. When a packet arrives +at an exchange, it may be copied to a client’s queue depending on the exchange +and routing_key fields. +

+

The following options are supported: +

+
+
exchange
+

Sets the exchange to use on the broker. RabbitMQ has several predefined +exchanges: "amq.direct" is the default exchange, where the publisher and +subscriber must have a matching routing_key; "amq.fanout" is the same as a +broadcast operation (i.e. the data is forwarded to all queues on the fanout +exchange independent of the routing_key); and "amq.topic" is similar to +"amq.direct", but allows for more complex pattern matching (refer to the RabbitMQ +documentation). +

+
+
routing_key
+

Sets the routing key. The default value is "amqp". The routing key is used on +the "amq.direct" and "amq.topic" exchanges to decide whether packets are written +to the queue of a subscriber. +

+
+
pkt_size
+

Maximum size of each packet sent/received to the broker. Default is 131072. +Minimum is 4096 and max is any large value (representable by an int). When +receiving packets, this sets an internal buffer size in FFmpeg. It should be +equal to or greater than the size of the published packets to the broker. Otherwise +the received message may be truncated causing decoding errors. +

+
+
connection_timeout
+

The timeout in seconds during the initial connection to the broker. The +default value is rw_timeout, or 5 seconds if rw_timeout is not set. +

+
+
delivery_mode mode
+

Sets the delivery mode of each message sent to broker. +The following values are accepted: +

+
persistent
+

Delivery mode set to "persistent" (2). This is the default value. +Messages may be written to the broker’s disk depending on its setup. +

+
+
non-persistent
+

Delivery mode set to "non-persistent" (1). +Messages will stay in broker’s memory unless the broker is under memory +pressure. +

+
+
+ +
+
+ +
+
+

24.2 async

+ +

Asynchronous data filling wrapper for input stream. +

+

Fill data in a background thread, to decouple I/O operation from demux thread. +

+
+
async:URL
+async:http://host/resource
+async:cache:http://host/resource
+
+ +
+
+

24.3 bluray

+ +

Read BluRay playlist. +

+

The accepted options are: +

+
angle
+

BluRay angle +

+
+
chapter
+

Start chapter (1...N) +

+
+
playlist
+

Playlist to read (BDMV/PLAYLIST/?????.mpls) +

+
+
+ +

Examples: +

+

Read longest playlist from BluRay mounted to /mnt/bluray: +

+
bluray:/mnt/bluray
+
+ +

Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2: +

+
-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
+
+ +
+
+

24.4 cache

+ +

Caching wrapper for input stream. +

+

Cache the input stream to temporary file. It brings seeking capability to live streams. +

+

The accepted options are: +

+
read_ahead_limit
+

Amount in bytes that may be read ahead when seeking isn’t supported. Range is -1 to INT_MAX. +-1 for unlimited. Default is 65536. +

+
+
+ +

URL Syntax is +

+
cache:URL
+
+ +
+
+

24.5 concat

+ +

Physical concatenation protocol. +

+

Read and seek from many resources in sequence as if they were +a unique resource. +

+

A URL accepted by this protocol has the syntax: +

+
concat:URL1|URL2|...|URLN
+
+ +

where URL1, URL2, ..., URLN are the urls of the +resource to be concatenated, each one possibly specifying a distinct +protocol. +

+

For example to read a sequence of files split1.mpeg, +split2.mpeg, split3.mpeg with ffplay use the +command: +

+
ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
+
+ +

Note that you may need to escape the character "|" which is special for +many shells. +

+
+
+

24.6 concatf

+ +

Physical concatenation protocol using a line break delimited list of +resources. +

+

Read and seek from many resources in sequence as if they were +a unique resource. +

+

A URL accepted by this protocol has the syntax: +

+
concatf:URL
+
+ +

where URL is the url containing a line break delimited list of +resources to be concatenated, each one possibly specifying a distinct +protocol. Special characters must be escaped with backslash or single +quotes. See (ffmpeg-utils)the "Quoting and escaping" +section in the ffmpeg-utils(1) manual. +

+

For example to read a sequence of files split1.mpeg, +split2.mpeg, split3.mpeg listed in separate lines within +a file split.txt with ffplay use the command: +

+
ffplay concatf:split.txt
+
+

Where split.txt contains the lines: +

+
split1.mpeg
+split2.mpeg
+split3.mpeg
+
+ +
+
+

24.7 crypto

+ +

AES-encrypted stream reading protocol. +

+

The accepted options are: +

+
key
+

Set the AES decryption key binary block from given hexadecimal representation. +

+
+
iv
+

Set the AES decryption initialization vector binary block from given hexadecimal representation. +

+
+ +

Accepted URL formats: +

+
crypto:URL
+crypto+URL
+
+ +
+
+

24.8 data

+ +

Data in-line in the URI. See http://en.wikipedia.org/wiki/Data_URI_scheme. +

+

For example, to convert a GIF file given inline with ffmpeg: +

+
ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
+
+ +
+
+

24.9 fd

+ +

File descriptor access protocol. +

+

The accepted syntax is: +

+
fd: -fd file_descriptor
+
+ +

If fd is not specified, by default the stdout file descriptor will be +used for writing, stdin for reading. Unlike the pipe protocol, fd protocol has +seek support if it corresponding to a regular file. fd protocol doesn’t support +pass file descriptor via URL for security. +

+

This protocol accepts the following options: +

+
+
blocksize
+

Set I/O operation maximum block size, in bytes. Default value is +INT_MAX, which results in not limiting the requested block size. +Setting this value reasonably low improves user termination request reaction +time, which is valuable if data transmission is slow. +

+
+
fd
+

Set file descriptor. +

+
+ +
+
+

24.10 file

+ +

File access protocol. +

+

Read from or write to a file. +

+

A file URL can have the form: +

+
file:filename
+
+ +

where filename is the path of the file to read. +

+

An URL that does not have a protocol prefix will be assumed to be a +file URL. Depending on the build, an URL that looks like a Windows +path with the drive letter at the beginning will also be assumed to be +a file URL (usually not the case in builds for unix-like systems). +

+

For example to read from a file input.mpeg with ffmpeg +use the command: +

+
ffmpeg -i file:input.mpeg output.mpeg
+
+ +

This protocol accepts the following options: +

+
+
truncate
+

Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. +

+
+
blocksize
+

Set I/O operation maximum block size, in bytes. Default value is +INT_MAX, which results in not limiting the requested block size. +Setting this value reasonably low improves user termination request reaction +time, which is valuable for files on slow medium. +

+
+
follow
+

If set to 1, the protocol will retry reading at the end of the file, allowing +reading files that still are being written. In order for this to terminate, +you either need to use the rw_timeout option, or use the interrupt callback +(for API users). +

+
+
seekable
+

Controls if seekability is advertised on the file. 0 means non-seekable, -1 +means auto (seekable for normal files, non-seekable for named pipes). +

+

Many demuxers handle seekable and non-seekable resources differently, +overriding this might speed up opening certain files at the cost of losing some +features (e.g. accurate seeking). +

+
+ +
+
+

24.11 ftp

+ +

FTP (File Transfer Protocol). +

+

Read from or write to remote resources using FTP protocol. +

+

Following syntax is required. +

+
ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
+
+ +

This protocol accepts the following options. +

+
+
timeout
+

Set timeout in microseconds of socket I/O operations used by the underlying low level +operation. By default it is set to -1, which means that the timeout is +not specified. +

+
+
ftp-user
+

Set a user to be used for authenticating to the FTP server. This is overridden by the +user in the FTP URL. +

+
+
ftp-password
+

Set a password to be used for authenticating to the FTP server. This is overridden by +the password in the FTP URL, or by ftp-anonymous-password if no user is set. +

+
+
ftp-anonymous-password
+

Password used when login as anonymous user. Typically an e-mail address +should be used. +

+
+
ftp-write-seekable
+

Control seekability of connection during encoding. If set to 1 the +resource is supposed to be seekable, if set to 0 it is assumed not +to be seekable. Default value is 0. +

+
+ +

NOTE: Protocol can be used as output, but it is recommended to not do +it, unless special care is taken (tests, customized server configuration +etc.). Different FTP servers behave in different way during seek +operation. ff* tools may produce incomplete content due to server limitations. +

+
+
+

24.12 gopher

+ +

Gopher protocol. +

+
+
+

24.13 gophers

+ +

Gophers protocol. +

+

The Gopher protocol with TLS encapsulation. +

+
+
+

24.14 hls

+ +

Read Apple HTTP Live Streaming compliant segmented stream as +a uniform one. The M3U8 playlists describing the segments can be +remote HTTP resources or local files, accessed using the standard +file protocol. +The nested protocol is declared by specifying +"+proto" after the hls URI scheme name, where proto +is either "file" or "http". +

+
+
hls+http://host/path/to/remote/resource.m3u8
+hls+file://path/to/local/resource.m3u8
+
+ +

Using this protocol is discouraged - the hls demuxer should work +just as well (if not, please report the issues) and is more complete. +To use the hls demuxer instead, simply use the direct URLs to the +m3u8 files. +

+
+
+

24.15 http

+ +

HTTP (Hyper Text Transfer Protocol). +

+

This protocol accepts the following options: +

+
+
seekable
+

Control seekability of connection. If set to 1 the resource is +supposed to be seekable, if set to 0 it is assumed not to be seekable, +if set to -1 it will try to autodetect if it is seekable. Default +value is -1. +

+
+
chunked_post
+

If set to 1 use chunked Transfer-Encoding for posts, default is 1. +

+
+
content_type
+

Set a specific content type for the POST messages or for listen mode. +

+
+
http_proxy
+

set HTTP proxy to tunnel through e.g. http://example.com:1234 +

+
+
headers
+

Set custom HTTP headers, can override built in default headers. The +value must be a string encoding the headers. +

+
+
multiple_requests
+

Use persistent connections if set to 1, default is 0. +

+
+
post_data
+

Set custom HTTP post data. +

+
+
referer
+

Set the Referer header. Include ’Referer: URL’ header in HTTP request. +

+
+
user_agent
+

Override the User-Agent header. If not specified the protocol will use a +string describing the libavformat build. ("Lavf/<version>") +

+
+
reconnect_at_eof
+

If set then eof is treated like an error and causes reconnection, this is useful +for live / endless streams. +

+
+
reconnect_streamed
+

If set then even streamed/non seekable streams will be reconnected on errors. +

+
+
reconnect_on_network_error
+

Reconnect automatically in case of TCP/TLS errors during connect. +

+
+
reconnect_on_http_error
+

A comma separated list of HTTP status codes to reconnect on. The list can +include specific status codes (e.g. ’503’) or the strings ’4xx’ / ’5xx’. +

+
+
reconnect_delay_max
+

Sets the maximum delay in seconds after which to give up reconnecting +

+
+
mime_type
+

Export the MIME type. +

+
+
http_version
+

Exports the HTTP response version number. Usually "1.0" or "1.1". +

+
+
icy
+

If set to 1 request ICY (SHOUTcast) metadata from the server. If the server +supports this, the metadata has to be retrieved by the application by reading +the icy_metadata_headers and icy_metadata_packet options. +The default is 1. +

+
+
icy_metadata_headers
+

If the server supports ICY metadata, this contains the ICY-specific HTTP reply +headers, separated by newline characters. +

+
+
icy_metadata_packet
+

If the server supports ICY metadata, and icy was set to 1, this +contains the last non-empty metadata packet sent by the server. It should be +polled in regular intervals by applications interested in mid-stream metadata +updates. +

+
+
cookies
+

Set the cookies to be sent in future requests. The format of each cookie is the +same as the value of a Set-Cookie HTTP response field. Multiple cookies can be +delimited by a newline character. +

+
+
offset
+

Set initial byte offset. +

+
+
end_offset
+

Try to limit the request to bytes preceding this offset. +

+
+
method
+

When used as a client option it sets the HTTP method for the request. +

+

When used as a server option it sets the HTTP method that is going to be +expected from the client(s). +If the expected and the received HTTP method do not match the client will +be given a Bad Request response. +When unset the HTTP method is not checked for now. This will be replaced by +autodetection in the future. +

+
+
listen
+

If set to 1 enables experimental HTTP server. This can be used to send data when +used as an output option, or read data from a client with HTTP POST when used as +an input option. +If set to 2 enables experimental multi-client HTTP server. This is not yet implemented +in ffmpeg.c and thus must not be used as a command line option. +

+
# Server side (sending):
+ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://server:port
+
+# Client side (receiving):
+ffmpeg -i http://server:port -c copy somefile.ogg
+
+# Client can also be done with wget:
+wget http://server:port -O somefile.ogg
+
+# Server side (receiving):
+ffmpeg -listen 1 -i http://server:port -c copy somefile.ogg
+
+# Client side (sending):
+ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://server:port
+
+# Client can also be done with wget:
+wget --post-file=somefile.ogg http://server:port
+
+ +
+
send_expect_100
+

Send an Expect: 100-continue header for POST. If set to 1 it will send, if set +to 0 it won’t, if set to -1 it will try to send if it is applicable. Default +value is -1. +

+
+
auth_type
+
+

Set HTTP authentication type. No option for Digest, since this method requires +getting nonce parameters from the server first and can’t be used straight away like +Basic. +

+
+
none
+

Choose the HTTP authentication type automatically. This is the default. +

+
basic
+
+

Choose the HTTP basic authentication. +

+

Basic authentication sends a Base64-encoded string that contains a user name and password +for the client. Base64 is not a form of encryption and should be considered the same as +sending the user name and password in clear text (Base64 is a reversible encoding). +If a resource needs to be protected, strongly consider using an authentication scheme +other than basic authentication. HTTPS/TLS should be used with basic authentication. +Without these additional security enhancements, basic authentication should not be used +to protect sensitive or valuable information. +

+
+ +
+
+ + +
+

24.15.1 HTTP Cookies

+ +

Some HTTP requests will be denied unless cookie values are passed in with the +request. The cookies option allows these cookies to be specified. At +the very least, each cookie must specify a value along with a path and domain. +HTTP requests that match both the domain and path will automatically include the +cookie value in the HTTP Cookie header field. Multiple cookies can be delimited +by a newline. +

+

The required syntax to play a stream specifying a cookie is: +

+
ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
+
+ +
+
+
+

24.16 Icecast

+ +

Icecast protocol (stream to Icecast servers) +

+

This protocol accepts the following options: +

+
+
ice_genre
+

Set the stream genre. +

+
+
ice_name
+

Set the stream name. +

+
+
ice_description
+

Set the stream description. +

+
+
ice_url
+

Set the stream website URL. +

+
+
ice_public
+

Set if the stream should be public. +The default is 0 (not public). +

+
+
user_agent
+

Override the User-Agent header. If not specified a string of the form +"Lavf/<version>" will be used. +

+
+
password
+

Set the Icecast mountpoint password. +

+
+
content_type
+

Set the stream content type. This must be set if it is different from +audio/mpeg. +

+
+
legacy_icecast
+

This enables support for Icecast versions < 2.4.0, that do not support the +HTTP PUT method but the SOURCE method. +

+
+
tls
+

Establish a TLS (HTTPS) connection to Icecast. +

+
+
+ +
+
icecast://[username[:password]@]server:port/mountpoint
+
+ +
+
+

24.17 ipfs

+ +

InterPlanetary File System (IPFS) protocol support. One can access files stored +on the IPFS network through so-called gateways. These are http(s) endpoints. +This protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be sent +to such a gateway. Users can (and should) host their own node which means this +protocol will use one’s local gateway to access files on the IPFS network. +

+

This protocol accepts the following options: +

+
+
gateway
+

Defines the gateway to use. When not set, the protocol will first try +locating the local gateway by looking at $IPFS_GATEWAY, $IPFS_PATH +and $HOME/.ipfs/, in that order. +

+
+
+ +

One can use this protocol in 2 ways. Using IPFS: +

+
ffplay ipfs://<hash>
+
+ +

Or the IPNS protocol (IPNS is mutable IPFS): +

+
ffplay ipns://<hash>
+
+ +
+
+

24.18 mmst

+ +

MMS (Microsoft Media Server) protocol over TCP. +

+
+
+

24.19 mmsh

+ +

MMS (Microsoft Media Server) protocol over HTTP. +

+

The required syntax is: +

+
mmsh://server[:port][/app][/playpath]
+
+ +
+
+

24.20 md5

+ +

MD5 output protocol. +

+

Computes the MD5 hash of the data to be written, and on close writes +this to the designated output or stdout if none is specified. It can +be used to test muxers without writing an actual file. +

+

Some examples follow. +

+
# Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
+ffmpeg -i input.flv -f avi -y md5:output.avi.md5
+
+# Write the MD5 hash of the encoded AVI file to stdout.
+ffmpeg -i input.flv -f avi -y md5:
+
+ +

Note that some formats (typically MOV) require the output protocol to +be seekable, so they will fail with the MD5 output protocol. +

+
+
+

24.21 pipe

+ +

UNIX pipe access protocol. +

+

Read and write from UNIX pipes. +

+

The accepted syntax is: +

+
pipe:[number]
+
+ +

If fd isn’t specified, number is the number corresponding to the file descriptor of the +pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If number +is not specified, by default the stdout file descriptor will be used +for writing, stdin for reading. +

+

For example to read from stdin with ffmpeg: +

+
cat test.wav | ffmpeg -i pipe:0
+# ...this is the same as...
+cat test.wav | ffmpeg -i pipe:
+
+ +

For writing to stdout with ffmpeg: +

+
ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
+# ...this is the same as...
+ffmpeg -i test.wav -f avi pipe: | cat > test.avi
+
+ +

This protocol accepts the following options: +

+
+
blocksize
+

Set I/O operation maximum block size, in bytes. Default value is +INT_MAX, which results in not limiting the requested block size. +Setting this value reasonably low improves user termination request reaction +time, which is valuable if data transmission is slow. +

+
fd
+

Set file descriptor. +

+
+ +

Note that some formats (typically MOV), require the output protocol to +be seekable, so they will fail with the pipe output protocol. +

+
+
+

24.22 prompeg

+ +

Pro-MPEG Code of Practice #3 Release 2 FEC protocol. +

+

The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism +for MPEG-2 Transport Streams sent over RTP. +

+

This protocol must be used in conjunction with the rtp_mpegts muxer and +the rtp protocol. +

+

The required syntax is: +

+
-f rtp_mpegts -fec prompeg=option=val... rtp://hostname:port
+
+ +

The destination UDP ports are port + 2 for the column FEC stream +and port + 4 for the row FEC stream. +

+

This protocol accepts the following options: +

+
l=n
+

The number of columns (4-20, LxD <= 100) +

+
+
d=n
+

The number of rows (4-20, LxD <= 100) +

+
+
+ +

Example usage: +

+
+
-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://hostname:port
+
+ +
+
+

24.23 rist

+ +

Reliable Internet Streaming Transport protocol +

+

The accepted options are: +

+
rist_profile
+

Supported values: +

+
simple
+
main
+

This one is default. +

+
advanced
+
+ +
+
buffer_size
+

Set internal RIST buffer size in milliseconds for retransmission of data. +Default value is 0 which means the librist default (1 sec). Maximum value is 30 +seconds. +

+
+
fifo_size
+

Size of the librist receiver output fifo in number of packets. This must be a +power of 2. +Defaults to 8192 (vs the librist default of 1024). +

+
+
overrun_nonfatal=1|0
+

Survive in case of librist fifo buffer overrun. Default value is 0. +

+
+
pkt_size
+

Set maximum packet size for sending data. 1316 by default. +

+
+
log_level
+

Set loglevel for RIST logging messages. You only need to set this if you +explicitly want to enable debug level messages or packet loss simulation, +otherwise the regular loglevel is respected. +

+
+
secret
+

Set override of encryption secret, by default is unset. +

+
+
encryption
+

Set encryption type, by default is disabled. +Acceptable values are 128 and 256. +

+
+ +
+
+

24.24 rtmp

+ +

Real-Time Messaging Protocol. +

+

The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia +content across a TCP/IP network. +

+

The required syntax is: +

+
rtmp://[username:password@]server[:port][/app][/instance][/playpath]
+
+ +

The accepted parameters are: +

+
username
+

An optional username (mostly for publishing). +

+
+
password
+

An optional password (mostly for publishing). +

+
+
server
+

The address of the RTMP server. +

+
+
port
+

The number of the TCP port to use (by default is 1935). +

+
+
app
+

It is the name of the application to access. It usually corresponds to +the path where the application is installed on the RTMP server +(e.g. /ondemand/, /flash/live/, etc.). You can override +the value parsed from the URI through the rtmp_app option, too. +

+
+
playpath
+

It is the path or name of the resource to play with reference to the +application specified in app, may be prefixed by "mp4:". You +can override the value parsed from the URI through the rtmp_playpath +option, too. +

+
+
listen
+

Act as a server, listening for an incoming connection. +

+
+
timeout
+

Maximum time to wait for the incoming connection. Implies listen. +

+
+ +

Additionally, the following parameters can be set via command line options +(or in code via AVOptions): +

+
rtmp_app
+

Name of application to connect on the RTMP server. This option +overrides the parameter specified in the URI. +

+
+
rtmp_buffer
+

Set the client buffer time in milliseconds. The default is 3000. +

+
+
rtmp_conn
+

Extra arbitrary AMF connection parameters, parsed from a string, +e.g. like B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0. +Each value is prefixed by a single character denoting the type, +B for Boolean, N for number, S for string, O for object, or Z for null, +followed by a colon. For Booleans the data must be either 0 or 1 for +FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or +1 to end or begin an object, respectively. Data items in subobjects may +be named, by prefixing the type with ’N’ and specifying the name before +the value (i.e. NB:myFlag:1). This option may be used multiple +times to construct arbitrary AMF sequences. +

+
+
rtmp_flashver
+

Version of the Flash plugin used to run the SWF player. The default +is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible; +<libavformat version>).) +

+
+
rtmp_flush_interval
+

Number of packets flushed in the same request (RTMPT only). The default +is 10. +

+
+
rtmp_live
+

Specify that the media is a live stream. No resuming or seeking in +live streams is possible. The default value is any, which means the +subscriber first tries to play the live stream specified in the +playpath. If a live stream of that name is not found, it plays the +recorded stream. The other possible values are live and +recorded. +

+
+
rtmp_pageurl
+

URL of the web page in which the media was embedded. By default no +value will be sent. +

+
+
rtmp_playpath
+

Stream identifier to play or to publish. This option overrides the +parameter specified in the URI. +

+
+
rtmp_subscribe
+

Name of live stream to subscribe to. By default no value will be sent. +It is only sent if the option is specified or if rtmp_live +is set to live. +

+
+
rtmp_swfhash
+

SHA256 hash of the decompressed SWF file (32 bytes). +

+
+
rtmp_swfsize
+

Size of the decompressed SWF file, required for SWFVerification. +

+
+
rtmp_swfurl
+

URL of the SWF player for the media. By default no value will be sent. +

+
+
rtmp_swfverify
+

URL to player swf file, compute hash/size automatically. +

+
+
rtmp_tcurl
+

URL of the target stream. Defaults to proto://host[:port]/app. +

+
+
tcp_nodelay=1|0
+

Set TCP_NODELAY to disable Nagle’s algorithm. Default value is 0. +

+

Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY. +

+
+
+ +

For example to read with ffplay a multimedia resource named +"sample" from the application "vod" from an RTMP server "myserver": +

+
ffplay rtmp://myserver/vod/sample
+
+ +

To publish to a password protected server, passing the playpath and +app names separately: +

+
ffmpeg -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@myserver/
+
+ +
+
+

24.25 rtmpe

+ +

Encrypted Real-Time Messaging Protocol. +

+

The Encrypted Real-Time Messaging Protocol (RTMPE) is used for +streaming multimedia content within standard cryptographic primitives, +consisting of Diffie-Hellman key exchange and HMACSHA256, generating +a pair of RC4 keys. +

+
+
+

24.26 rtmps

+ +

Real-Time Messaging Protocol over a secure SSL connection. +

+

The Real-Time Messaging Protocol (RTMPS) is used for streaming +multimedia content across an encrypted connection. +

+
+
+

24.27 rtmpt

+ +

Real-Time Messaging Protocol tunneled through HTTP. +

+

The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used +for streaming multimedia content within HTTP requests to traverse +firewalls. +

+
+
+

24.28 rtmpte

+ +

Encrypted Real-Time Messaging Protocol tunneled through HTTP. +

+

The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE) +is used for streaming multimedia content within HTTP requests to traverse +firewalls. +

+
+
+

24.29 rtmpts

+ +

Real-Time Messaging Protocol tunneled through HTTPS. +

+

The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used +for streaming multimedia content within HTTPS requests to traverse +firewalls. +

+
+
+

24.30 libsmbclient

+ +

libsmbclient permits one to manipulate CIFS/SMB network resources. +

+

Following syntax is required. +

+
+
smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
+
+ +

This protocol accepts the following options. +

+
+
timeout
+

Set timeout in milliseconds of socket I/O operations used by the underlying +low level operation. By default it is set to -1, which means that the timeout +is not specified. +

+
+
truncate
+

Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. +

+
+
workgroup
+

Set the workgroup used for making connections. By default workgroup is not specified. +

+
+
+ +

For more information see: http://www.samba.org/. +

+
+
+

24.31 libssh

+ +

Secure File Transfer Protocol via libssh +

+

Read from or write to remote resources using SFTP protocol. +

+

Following syntax is required. +

+
+
sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
+
+ +

This protocol accepts the following options. +

+
+
timeout
+

Set timeout of socket I/O operations used by the underlying low level +operation. By default it is set to -1, which means that the timeout +is not specified. +

+
+
truncate
+

Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. +

+
+
private_key
+

Specify the path of the file containing private key to use during authorization. +By default libssh searches for keys in the ~/.ssh/ directory. +

+
+
+ +

Example: Play a file stored on remote server. +

+
+
ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
+
+ +
+
+

24.32 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte

+ +

Real-Time Messaging Protocol and its variants supported through +librtmp. +

+

Requires the presence of the librtmp headers and library during +configuration. You need to explicitly configure the build with +"–enable-librtmp". If enabled this will replace the native RTMP +protocol. +

+

This protocol provides most client functions and a few server +functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT), +encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled +variants of these encrypted types (RTMPTE, RTMPTS). +

+

The required syntax is: +

+
rtmp_proto://server[:port][/app][/playpath] options
+
+ +

where rtmp_proto is one of the strings "rtmp", "rtmpt", "rtmpe", +"rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and +server, port, app and playpath have the same +meaning as specified for the RTMP native protocol. +options contains a list of space-separated options of the form +key=val. +

+

See the librtmp manual page (man 3 librtmp) for more information. +

+

For example, to stream a file in real-time to an RTMP server using +ffmpeg: +

+
ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
+
+ +

To play the same stream using ffplay: +

+
ffplay "rtmp://myserver/live/mystream live=1"
+
+ +
+
+

24.33 rtp

+ +

Real-time Transport Protocol. +

+

The required syntax for an RTP URL is: +rtp://hostname[:port][?option=val...] +

+

port specifies the RTP port to use. +

+

The following URL options are supported: +

+
+
ttl=n
+

Set the TTL (Time-To-Live) value (for multicast only). +

+
+
rtcpport=n
+

Set the remote RTCP port to n. +

+
+
localrtpport=n
+

Set the local RTP port to n. +

+
+
localrtcpport=n'
+

Set the local RTCP port to n. +

+
+
pkt_size=n
+

Set max packet size (in bytes) to n. +

+
+
buffer_size=size
+

Set the maximum UDP socket buffer size in bytes. +

+
+
connect=0|1
+

Do a connect() on the UDP socket (if set to 1) or not (if set +to 0). +

+
+
sources=ip[,ip]
+

List allowed source IP addresses. +

+
+
block=ip[,ip]
+

List disallowed (blocked) source IP addresses. +

+
+
write_to_source=0|1
+

Send packets to the source address of the latest received packet (if +set to 1) or to a default remote address (if set to 0). +

+
+
localport=n
+

Set the local RTP port to n. +

+
+
localaddr=addr
+

Local IP address of a network interface used for sending packets or joining +multicast groups. +

+
+
timeout=n
+

Set timeout (in microseconds) of socket I/O operations to n. +

+

This is a deprecated option. Instead, localrtpport should be +used. +

+
+
+ +

Important notes: +

+
    +
  1. If rtcpport is not set the RTCP port will be set to the RTP +port value plus 1. + +
  2. If localrtpport (the local RTP port) is not set any available +port will be used for the local RTP and RTCP ports. + +
  3. If localrtcpport (the local RTCP port) is not set it will be +set to the local RTP port value plus 1. +
+ +
+
+

24.34 rtsp

+ +

Real-Time Streaming Protocol. +

+

RTSP is not technically a protocol handler in libavformat, it is a demuxer +and muxer. The demuxer supports both normal RTSP (with data transferred +over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with +data transferred over RDT). +

+

The muxer can be used to send a stream using RTSP ANNOUNCE to a server +supporting it (currently Darwin Streaming Server and Mischa Spiegelmock’s +RTSP server). +

+

The required syntax for a RTSP url is: +

+
rtsp://hostname[:port]/path
+
+ +

Options can be set on the ffmpeg/ffplay command +line, or set in code via AVOptions or in +avformat_open_input. +

+ +
+

24.34.1 Muxer

+

The following options are supported. +

+
+
rtsp_transport
+

Set RTSP transport protocols. +

+

It accepts the following values: +

+
udp
+

Use UDP as lower transport protocol. +

+
+
tcp
+

Use TCP (interleaving within the RTSP control channel) as lower +transport protocol. +

+
+ +

Default value is ‘0’. +

+
+
rtsp_flags
+

Set RTSP flags. +

+

The following values are accepted: +

+
latm
+

Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC. +

+
rfc2190
+

Use RFC 2190 packetization instead of RFC 4629 for H.263. +

+
skip_rtcp
+

Don’t send RTCP sender reports. +

+
h264_mode0
+

Use mode 0 for H.264 in RTP. +

+
send_bye
+

Send RTCP BYE packets when finishing. +

+
+ +

Default value is ‘0’. +

+ +
+
min_port
+

Set minimum local UDP port. Default value is 5000. +

+
+
max_port
+

Set maximum local UDP port. Default value is 65000. +

+
+
buffer_size
+

Set the maximum socket buffer size in bytes. +

+
+
pkt_size
+

Set max send packet size (in bytes). Default value is 1472. +

+
+ +
+
+

24.34.2 Demuxer

+

The following options are supported. +

+
+
initial_pause
+

Do not start playing the stream immediately if set to 1. Default value +is 0. +

+
+
rtsp_transport
+

Set RTSP transport protocols. +

+

It accepts the following values: +

+
udp
+

Use UDP as lower transport protocol. +

+
+
tcp
+

Use TCP (interleaving within the RTSP control channel) as lower +transport protocol. +

+
+
udp_multicast
+

Use UDP multicast as lower transport protocol. +

+
+
http
+

Use HTTP tunneling as lower transport protocol, which is useful for +passing proxies. +

+
+
https
+

Use HTTPs tunneling as lower transport protocol, which is useful for +passing proxies and widely used for security consideration. +

+
+ +

Multiple lower transport protocols may be specified, in that case they are +tried one at a time (if the setup of one fails, the next one is tried). +For the muxer, only the ‘tcp’ and ‘udp’ options are supported. +

+
+
rtsp_flags
+

Set RTSP flags. +

+

The following values are accepted: +

+
filter_src
+

Accept packets only from negotiated peer address and port. +

+
listen
+

Act as a server, listening for an incoming connection. +

+
prefer_tcp
+

Try TCP for RTP transport first, if TCP is available as RTSP RTP transport. +

+
satip_raw
+

Export raw MPEG-TS stream instead of demuxing. The flag will simply write out +the raw stream, with the original PAT/PMT/PIDs intact. +

+
+ +

Default value is ‘none’. +

+
+
allowed_media_types
+

Set media types to accept from the server. +

+

The following flags are accepted: +

+
video
+
audio
+
data
+
subtitle
+
+ +

By default it accepts all media types. +

+
+
min_port
+

Set minimum local UDP port. Default value is 5000. +

+
+
max_port
+

Set maximum local UDP port. Default value is 65000. +

+
+
listen_timeout
+

Set maximum timeout (in seconds) to establish an initial connection. Setting +listen_timeout > 0 sets rtsp_flags to ‘listen’. Default is -1 +which means an infinite timeout when ‘listen’ mode is set. +

+
+
reorder_queue_size
+

Set number of packets to buffer for handling of reordered packets. +

+
+
timeout
+

Set socket TCP I/O timeout in microseconds. +

+
+
user_agent
+

Override User-Agent header. If not specified, it defaults to the +libavformat identifier string. +

+
+
buffer_size
+

Set the maximum socket buffer size in bytes. +

+
+ +

When receiving data over UDP, the demuxer tries to reorder received packets +(since they may arrive out of order, or packets may get lost totally). This +can be disabled by setting the maximum demuxing delay to zero (via +the max_delay field of AVFormatContext). +

+

When watching multi-bitrate Real-RTSP streams with ffplay, the +streams to display can be chosen with -vst n and +-ast n for video and audio respectively, and can be switched +on the fly by pressing v and a. +

+
+
+

24.34.3 Examples

+ +

The following examples all make use of the ffplay and +ffmpeg tools. +

+
    +
  • Watch a stream over UDP, with a max reordering delay of 0.5 seconds: +
    +
    ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
    +
    + +
  • Watch a stream tunneled over HTTP: +
    +
    ffplay -rtsp_transport http rtsp://server/video.mp4
    +
    + +
  • Send a stream in realtime to a RTSP server, for others to watch: +
    +
    ffmpeg -re -i input -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
    +
    + +
  • Receive a stream in realtime: +
    +
    ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp output
    +
    +
+ +
+
+
+

24.35 sap

+ +

Session Announcement Protocol (RFC 2974). This is not technically a +protocol handler in libavformat, it is a muxer and demuxer. +It is used for signalling of RTP streams, by announcing the SDP for the +streams regularly on a separate port. +

+ +
+

24.35.1 Muxer

+ +

The syntax for a SAP url given to the muxer is: +

+
sap://destination[:port][?options]
+
+ +

The RTP packets are sent to destination on port port, +or to port 5004 if no port is specified. +options is a &-separated list. The following options +are supported: +

+
+
announce_addr=address
+

Specify the destination IP address for sending the announcements to. +If omitted, the announcements are sent to the commonly used SAP +announcement multicast address 224.2.127.254 (sap.mcast.net), or +ff0e::2:7ffe if destination is an IPv6 address. +

+
+
announce_port=port
+

Specify the port to send the announcements on, defaults to +9875 if not specified. +

+
+
ttl=ttl
+

Specify the time to live value for the announcements and RTP packets, +defaults to 255. +

+
+
same_port=0|1
+

If set to 1, send all RTP streams on the same port pair. If zero (the +default), all streams are sent on unique ports, with each stream on a +port 2 numbers higher than the previous. +VLC/Live555 requires this to be set to 1, to be able to receive the stream. +The RTP stack in libavformat for receiving requires all streams to be sent +on unique ports. +

+
+ +

Example command lines follow. +

+

To broadcast a stream on the local subnet, for watching in VLC: +

+
+
ffmpeg -re -i input -f sap sap://224.0.0.255?same_port=1
+
+ +

Similarly, for watching in ffplay: +

+
+
ffmpeg -re -i input -f sap sap://224.0.0.255
+
+ +

And for watching in ffplay, over IPv6: +

+
+
ffmpeg -re -i input -f sap sap://[ff0e::1:2:3:4]
+
+ +
+
+

24.35.2 Demuxer

+ +

The syntax for a SAP url given to the demuxer is: +

+
sap://[address][:port]
+
+ +

address is the multicast address to listen for announcements on, +if omitted, the default 224.2.127.254 (sap.mcast.net) is used. port +is the port that is listened on, 9875 if omitted. +

+

The demuxers listens for announcements on the given address and port. +Once an announcement is received, it tries to receive that particular stream. +

+

Example command lines follow. +

+

To play back the first stream announced on the normal SAP multicast address: +

+
+
ffplay sap://
+
+ +

To play back the first stream announced on one the default IPv6 SAP multicast address: +

+
+
ffplay sap://[ff0e::2:7ffe]
+
+ +
+
+
+

24.36 sctp

+ +

Stream Control Transmission Protocol. +

+

The accepted URL syntax is: +

+
sctp://host:port[?options]
+
+ +

The protocol accepts the following options: +

+
listen
+

If set to any value, listen for an incoming connection. Outgoing connection is done by default. +

+
+
max_streams
+

Set the maximum number of streams. By default no limit is set. +

+
+ +
+
+

24.37 srt

+ +

Haivision Secure Reliable Transport Protocol via libsrt. +

+

The supported syntax for a SRT URL is: +

+
srt://hostname:port[?options]
+
+ +

options contains a list of &-separated options of the form +key=val. +

+

or +

+
+
options srt://hostname:port
+
+ +

options contains a list of ’-key val’ +options. +

+

This protocol accepts the following options. +

+
+
connect_timeout=milliseconds
+

Connection timeout; SRT cannot connect for RTT > 1500 msec +(2 handshake exchanges) with the default connect timeout of +3 seconds. This option applies to the caller and rendezvous +connection modes. The connect timeout is 10 times the value +set for the rendezvous mode (which can be used as a +workaround for this connection problem with earlier versions). +

+
+
ffs=bytes
+

Flight Flag Size (Window Size), in bytes. FFS is actually an +internal parameter and you should set it to not less than +recv_buffer_size and mss. The default value +is relatively large, therefore unless you set a very large receiver buffer, +you do not need to change this option. Default value is 25600. +

+
+
inputbw=bytes/seconds
+

Sender nominal input rate, in bytes per seconds. Used along with +oheadbw, when maxbw is set to relative (0), to +calculate maximum sending rate when recovery packets are sent +along with the main media stream: +inputbw * (100 + oheadbw) / 100 +if inputbw is not set while maxbw is set to +relative (0), the actual input rate is evaluated inside +the library. Default value is 0. +

+
+
iptos=tos
+

IP Type of Service. Applies to sender only. Default value is 0xB8. +

+
+
ipttl=ttl
+

IP Time To Live. Applies to sender only. Default value is 64. +

+
+
latency=microseconds
+

Timestamp-based Packet Delivery Delay. +Used to absorb bursts of missed packet retransmissions. +This flag sets both rcvlatency and peerlatency +to the same value. Note that prior to version 1.3.0 +this is the only flag to set the latency, however +this is effectively equivalent to setting peerlatency, +when side is sender and rcvlatency +when side is receiver, and the bidirectional stream +sending is not supported. +

+
+
listen_timeout=microseconds
+

Set socket listen timeout. +

+
+
maxbw=bytes/seconds
+

Maximum sending bandwidth, in bytes per seconds. +-1 infinite (CSRTCC limit is 30mbps) +0 relative to input rate (see inputbw) +>0 absolute limit value +Default value is 0 (relative) +

+
+
mode=caller|listener|rendezvous
+

Connection mode. +caller opens client connection. +listener starts server to listen for incoming connections. +rendezvous use Rendez-Vous connection mode. +Default value is caller. +

+
+
mss=bytes
+

Maximum Segment Size, in bytes. Used for buffer allocation +and rate calculation using a packet counter assuming fully +filled packets. The smallest MSS between the peers is +used. This is 1500 by default in the overall internet. +This is the maximum size of the UDP packet and can be +only decreased, unless you have some unusual dedicated +network settings. Default value is 1500. +

+
+
nakreport=1|0
+

If set to 1, Receiver will send ‘UMSG_LOSSREPORT‘ messages +periodically until a lost packet is retransmitted or +intentionally dropped. Default value is 1. +

+
+
oheadbw=percents
+

Recovery bandwidth overhead above input rate, in percents. +See inputbw. Default value is 25%. +

+
+
passphrase=string
+

HaiCrypt Encryption/Decryption Passphrase string, length +from 10 to 79 characters. The passphrase is the shared +secret between the sender and the receiver. It is used +to generate the Key Encrypting Key using PBKDF2 +(Password-Based Key Derivation Function). It is used +only if pbkeylen is non-zero. It is used on +the receiver only if the received data is encrypted. +The configured passphrase cannot be recovered (write-only). +

+
+
enforced_encryption=1|0
+

If true, both connection parties must have the same password +set (including empty, that is, with no encryption). If the +password doesn’t match or only one side is unencrypted, +the connection is rejected. Default is true. +

+
+
kmrefreshrate=packets
+

The number of packets to be transmitted after which the +encryption key is switched to a new key. Default is -1. +-1 means auto (0x1000000 in srt library). The range for +this option is integers in the 0 - INT_MAX. +

+
+
kmpreannounce=packets
+

The interval between when a new encryption key is sent and +when switchover occurs. This value also applies to the +subsequent interval between when switchover occurs and +when the old encryption key is decommissioned. Default is -1. +-1 means auto (0x1000 in srt library). The range for +this option is integers in the 0 - INT_MAX. +

+
+
snddropdelay=microseconds
+

The sender’s extra delay before dropping packets. This delay is +added to the default drop delay time interval value. +

+

Special value -1: Do not drop packets on the sender at all. +

+
+
payload_size=bytes
+

Sets the maximum declared size of a packet transferred +during the single call to the sending function in Live +mode. Use 0 if this value isn’t used (which is default in +file mode). +Default is -1 (automatic), which typically means MPEG-TS; +if you are going to use SRT +to send any different kind of payload, such as, for example, +wrapping a live stream in very small frames, then you can +use a bigger maximum frame size, though not greater than +1456 bytes. +

+
+
pkt_size=bytes
+

Alias for ‘payload_size’. +

+
+
peerlatency=microseconds
+

The latency value (as described in rcvlatency) that is +set by the sender side as a minimum value for the receiver. +

+
+
pbkeylen=bytes
+

Sender encryption key length, in bytes. +Only can be set to 0, 16, 24 and 32. +Enable sender encryption if not 0. +Not required on receiver (set to 0), +key size obtained from sender in HaiCrypt handshake. +Default value is 0. +

+
+
rcvlatency=microseconds
+

The time that should elapse since the moment when the +packet was sent and the moment when it’s delivered to +the receiver application in the receiving function. +This time should be a buffer time large enough to cover +the time spent for sending, unexpectedly extended RTT +time, and the time needed to retransmit the lost UDP +packet. The effective latency value will be the maximum +of this options’ value and the value of peerlatency +set by the peer side. Before version 1.3.0 this option +is only available as latency. +

+
+
recv_buffer_size=bytes
+

Set UDP receive buffer size, expressed in bytes. +

+
+
send_buffer_size=bytes
+

Set UDP send buffer size, expressed in bytes. +

+
+
timeout=microseconds
+

Set raise error timeouts for read, write and connect operations. Note that the +SRT library has internal timeouts which can be controlled separately, the +value set here is only a cap on those. +

+
+
tlpktdrop=1|0
+

Too-late Packet Drop. When enabled on receiver, it skips +missing packets that have not been delivered in time and +delivers the following packets to the application when +their time-to-play has come. It also sends a fake ACK to +the sender. When enabled on sender and enabled on the +receiving peer, the sender drops the older packets that +have no chance of being delivered in time. It was +automatically enabled in the sender if the receiver +supports it. +

+
+
sndbuf=bytes
+

Set send buffer size, expressed in bytes. +

+
+
rcvbuf=bytes
+

Set receive buffer size, expressed in bytes. +

+

Receive buffer must not be greater than ffs. +

+
+
lossmaxttl=packets
+

The value up to which the Reorder Tolerance may grow. When +Reorder Tolerance is > 0, then packet loss report is delayed +until that number of packets come in. Reorder Tolerance +increases every time a "belated" packet has come, but it +wasn’t due to retransmission (that is, when UDP packets tend +to come out of order), with the difference between the latest +sequence and this packet’s sequence, and not more than the +value of this option. By default it’s 0, which means that this +mechanism is turned off, and the loss report is always sent +immediately upon experiencing a "gap" in sequences. +

+
+
minversion
+

The minimum SRT version that is required from the peer. A connection +to a peer that does not satisfy the minimum version requirement +will be rejected. +

+

The version format in hex is 0xXXYYZZ for x.y.z in human readable +form. +

+
+
streamid=string
+

A string limited to 512 characters that can be set on the socket prior +to connecting. This stream ID will be able to be retrieved by the +listener side from the socket that is returned from srt_accept and +was connected by a socket with that set stream ID. SRT does not enforce +any special interpretation of the contents of this string. +This option doesn’t make sense in Rendezvous connection; the result +might be that simply one side will override the value from the other +side and it’s the matter of luck which one would win +

+
+
srt_streamid=string
+

Alias for ‘streamid’ to avoid conflict with ffmpeg command line option. +

+
+
smoother=live|file
+

The type of Smoother used for the transmission for that socket, which +is responsible for the transmission and congestion control. The Smoother +type must be exactly the same on both connecting parties, otherwise +the connection is rejected. +

+
+
messageapi=1|0
+

When set, this socket uses the Message API, otherwise it uses Buffer +API. Note that in live mode (see transtype) there’s only +message API available. In File mode you can chose to use one of two modes: +

+

Stream API (default, when this option is false). In this mode you may +send as many data as you wish with one sending instruction, or even use +dedicated functions that read directly from a file. The internal facility +will take care of any speed and congestion control. When receiving, you +can also receive as many data as desired, the data not extracted will be +waiting for the next call. There is no boundary between data portions in +the Stream mode. +

+

Message API. In this mode your single sending instruction passes exactly +one piece of data that has boundaries (a message). Contrary to Live mode, +this message may span across multiple UDP packets and the only size +limitation is that it shall fit as a whole in the sending buffer. The +receiver shall use as large buffer as necessary to receive the message, +otherwise the message will not be given up. When the message is not +complete (not all packets received or there was a packet loss) it will +not be given up. +

+
+
transtype=live|file
+

Sets the transmission type for the socket, in particular, setting this +option sets multiple other parameters to their default values as required +for a particular transmission type. +

+

live: Set options as for live transmission. In this mode, you should +send by one sending instruction only so many data that fit in one UDP packet, +and limited to the value defined first in payload_size (1316 is +default in this mode). There is no speed control in this mode, only the +bandwidth control, if configured, in order to not exceed the bandwidth with +the overhead transmission (retransmitted and control packets). +

+

file: Set options as for non-live transmission. See messageapi +for further explanations +

+
+
linger=seconds
+

The number of seconds that the socket waits for unsent data when closing. +Default is -1. -1 means auto (off with 0 seconds in live mode, on with 180 +seconds in file mode). The range for this option is integers in the +0 - INT_MAX. +

+
+
tsbpd=1|0
+

When true, use Timestamp-based Packet Delivery mode. The default behavior +depends on the transmission type: enabled in live mode, disabled in file +mode. +

+
+
+ +

For more information see: https://github.com/Haivision/srt. +

+
+
+

24.38 srtp

+ +

Secure Real-time Transport Protocol. +

+

The accepted options are: +

+
srtp_in_suite
+
srtp_out_suite
+

Select input and output encoding suites. +

+

Supported values: +

+
AES_CM_128_HMAC_SHA1_80
+
SRTP_AES128_CM_HMAC_SHA1_80
+
AES_CM_128_HMAC_SHA1_32
+
SRTP_AES128_CM_HMAC_SHA1_32
+
+ +
+
srtp_in_params
+
srtp_out_params
+

Set input and output encoding parameters, which are expressed by a +base64-encoded representation of a binary block. The first 16 bytes of +this binary block are used as master key, the following 14 bytes are +used as master salt. +

+
+ +
+
+

24.39 subfile

+ +

Virtually extract a segment of a file or another stream. +The underlying stream must be seekable. +

+

Accepted options: +

+
start
+

Start offset of the extracted segment, in bytes. +

+
end
+

End offset of the extracted segment, in bytes. +If set to 0, extract till end of file. +

+
+ +

Examples: +

+

Extract a chapter from a DVD VOB file (start and end sectors obtained +externally and multiplied by 2048): +

+
subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
+
+ +

Play an AVI file directly from a TAR archive: +

+
subfile,,start,183241728,end,366490624,,:archive.tar
+
+ +

Play a MPEG-TS file from start offset till end: +

+
subfile,,start,32815239,end,0,,:video.ts
+
+ +
+
+

24.40 tee

+ +

Writes the output to multiple protocols. The individual outputs are separated +by | +

+
+
tee:file://path/to/local/this.avi|file://path/to/local/that.avi
+
+ +
+
+

24.41 tcp

+ +

Transmission Control Protocol. +

+

The required syntax for a TCP url is: +

+
tcp://hostname:port[?options]
+
+ +

options contains a list of &-separated options of the form +key=val. +

+

The list of supported options follows. +

+
+
listen=2|1|0
+

Listen for an incoming connection. 0 disables listen, 1 enables listen in +single client mode, 2 enables listen in multi-client mode. Default value is 0. +

+
+
local_addr=addr
+

Local IP address of a network interface used for tcp socket connect. +

+
+
local_port=port
+

Local port used for tcp socket connect. +

+
+
timeout=microseconds
+

Set raise error timeout, expressed in microseconds. +

+

This option is only relevant in read mode: if no data arrived in more +than this time interval, raise error. +

+
+
listen_timeout=milliseconds
+

Set listen timeout, expressed in milliseconds. +

+
+
recv_buffer_size=bytes
+

Set receive buffer size, expressed bytes. +

+
+
send_buffer_size=bytes
+

Set send buffer size, expressed bytes. +

+
+
tcp_nodelay=1|0
+

Set TCP_NODELAY to disable Nagle’s algorithm. Default value is 0. +

+

Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY. +

+
+
tcp_mss=bytes
+

Set maximum segment size for outgoing TCP packets, expressed in bytes. +

+
+ +

The following example shows how to setup a listening TCP connection +with ffmpeg, which is then accessed with ffplay: +

+
ffmpeg -i input -f format tcp://hostname:port?listen
+ffplay tcp://hostname:port
+
+ +
+
+

24.42 tls

+ +

Transport Layer Security (TLS) / Secure Sockets Layer (SSL) +

+

The required syntax for a TLS/SSL url is: +

+
tls://hostname:port[?options]
+
+ +

The following parameters can be set via command line options +(or in code via AVOptions): +

+
+
ca_file, cafile=filename
+

A file containing certificate authority (CA) root certificates to treat +as trusted. If the linked TLS library contains a default this might not +need to be specified for verification to work, but not all libraries and +setups have defaults built in. +The file must be in OpenSSL PEM format. +

+
+
tls_verify=1|0
+

If enabled, try to verify the peer that we are communicating with. +Note, if using OpenSSL, this currently only makes sure that the +peer certificate is signed by one of the root certificates in the CA +database, but it does not validate that the certificate actually +matches the host name we are trying to connect to. (With other backends, +the host name is validated as well.) +

+

This is disabled by default since it requires a CA database to be +provided by the caller in many cases. +

+
+
cert_file, cert=filename
+

A file containing a certificate to use in the handshake with the peer. +(When operating as server, in listen mode, this is more often required +by the peer, while client certificates only are mandated in certain +setups.) +

+
+
key_file, key=filename
+

A file containing the private key for the certificate. +

+
+
listen=1|0
+

If enabled, listen for connections on the provided port, and assume +the server role in the handshake instead of the client role. +

+
+
http_proxy
+

The HTTP proxy to tunnel through, e.g. http://example.com:1234. +The proxy must support the CONNECT method. +

+
+
+ +

Example command lines: +

+

To create a TLS/SSL server that serves an input stream. +

+
+
ffmpeg -i input -f format tls://hostname:port?listen&cert=server.crt&key=server.key
+
+ +

To play back a stream from the TLS/SSL server using ffplay: +

+
+
ffplay tls://hostname:port
+
+ +
+
+

24.43 udp

+ +

User Datagram Protocol. +

+

The required syntax for an UDP URL is: +

+
udp://hostname:port[?options]
+
+ +

options contains a list of &-separated options of the form key=val. +

+

In case threading is enabled on the system, a circular buffer is used +to store the incoming data, which allows one to reduce loss of data due to +UDP socket buffer overruns. The fifo_size and +overrun_nonfatal options are related to this buffer. +

+

The list of supported options follows. +

+
+
buffer_size=size
+

Set the UDP maximum socket buffer size in bytes. This is used to set either +the receive or send buffer size, depending on what the socket is used for. +Default is 32 KB for output, 384 KB for input. See also fifo_size. +

+
+
bitrate=bitrate
+

If set to nonzero, the output will have the specified constant bitrate if the +input has enough packets to sustain it. +

+
+
burst_bits=bits
+

When using bitrate this specifies the maximum number of bits in +packet bursts. +

+
+
localport=port
+

Override the local UDP port to bind with. +

+
+
localaddr=addr
+

Local IP address of a network interface used for sending packets or joining +multicast groups. +

+
+
pkt_size=size
+

Set the size in bytes of UDP packets. +

+
+
reuse=1|0
+

Explicitly allow or disallow reusing UDP sockets. +

+
+
ttl=ttl
+

Set the time to live value (for multicast only). +

+
+
connect=1|0
+

Initialize the UDP socket with connect(). In this case, the +destination address can’t be changed with ff_udp_set_remote_url later. +If the destination address isn’t known at the start, this option can +be specified in ff_udp_set_remote_url, too. +This allows finding out the source address for the packets with getsockname, +and makes writes return with AVERROR(ECONNREFUSED) if "destination +unreachable" is received. +For receiving, this gives the benefit of only receiving packets from +the specified peer address/port. +

+
+
sources=address[,address]
+

Only receive packets sent from the specified addresses. In case of multicast, +also subscribe to multicast traffic coming from these addresses only. +

+
+
block=address[,address]
+

Ignore packets sent from the specified addresses. In case of multicast, also +exclude the source addresses in the multicast subscription. +

+
+
fifo_size=units
+

Set the UDP receiving circular buffer size, expressed as a number of +packets with size of 188 bytes. If not specified defaults to 7*4096. +

+
+
overrun_nonfatal=1|0
+

Survive in case of UDP receiving circular buffer overrun. Default +value is 0. +

+
+
timeout=microseconds
+

Set raise error timeout, expressed in microseconds. +

+

This option is only relevant in read mode: if no data arrived in more +than this time interval, raise error. +

+
+
broadcast=1|0
+

Explicitly allow or disallow UDP broadcasting. +

+

Note that broadcasting may not work properly on networks having +a broadcast storm protection. +

+
+ + +
+

24.43.1 Examples

+ +
    +
  • Use ffmpeg to stream over UDP to a remote endpoint: +
    +
    ffmpeg -i input -f format udp://hostname:port
    +
    + +
  • Use ffmpeg to stream in mpegts format over UDP using 188 +sized UDP packets, using a large input buffer: +
    +
    ffmpeg -i input -f mpegts udp://hostname:port?pkt_size=188&buffer_size=65535
    +
    + +
  • Use ffmpeg to receive over UDP from a remote endpoint: +
    +
    ffmpeg -i udp://[multicast-address]:port ...
    +
    +
+ +
+
+
+

24.44 unix

+ +

Unix local socket +

+

The required syntax for a Unix socket URL is: +

+
+
unix://filepath
+
+ +

The following parameters can be set via command line options +(or in code via AVOptions): +

+
+
timeout
+

Timeout in ms. +

+
listen
+

Create the Unix socket in listening mode. +

+
+ +
+
+

24.45 zmq

+ +

ZeroMQ asynchronous messaging using the libzmq library. +

+

This library supports unicast streaming to multiple clients without relying on +an external server. +

+

The required syntax for streaming or connecting to a stream is: +

+
zmq:tcp://ip-address:port
+
+ +

Example: +Create a localhost stream on port 5555: +

+
ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
+
+ +

Multiple clients may connect to the stream using: +

+
ffplay zmq:tcp://127.0.0.1:5555
+
+ +

Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern. +The server side binds to a port and publishes data. Clients connect to the +server (via IP address/port) and subscribe to the stream. The order in which +the server and client start generally does not matter. +

+

ffmpeg must be compiled with the –enable-libzmq option to support +this protocol. +

+

Options can be set on the ffmpeg/ffplay command +line. The following options are supported: +

+
+
pkt_size
+

Forces the maximum packet size for sending/receiving data. The default value is +131,072 bytes. On the server side, this sets the maximum size of sent packets +via ZeroMQ. On the clients, it sets an internal buffer size for receiving +packets. Note that pkt_size on the clients should be equal to or greater than +pkt_size on the server. Otherwise the received message may be truncated causing +decoding errors. +

+
+
+ +
+
+
+

25 Device Options

+ +

The libavdevice library provides the same interface as +libavformat. Namely, an input device is considered like a demuxer, and +an output device like a muxer, and the interface and generic device +options are the same provided by libavformat (see the ffmpeg-formats +manual). +

+

In addition each input or output device may support so-called private +options, which are specific for that component. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the device +AVFormatContext options or using the libavutil/opt.h API +for programmatic use. +

+ +
+
+

26 Input Devices

+ +

Input devices are configured elements in FFmpeg which enable accessing +the data coming from a multimedia device attached to your system. +

+

When you configure your FFmpeg build, all the supported input devices +are enabled by default. You can list all available ones using the +configure option "–list-indevs". +

+

You can disable all the input devices using the configure option +"–disable-indevs", and selectively enable an input device using the +option "–enable-indev=INDEV", or you can disable a particular +input device using the option "–disable-indev=INDEV". +

+

The option "-devices" of the ff* tools will display the list of +supported input devices. +

+

A description of the currently available input devices follows. +

+ +
+

26.1 alsa

+ +

ALSA (Advanced Linux Sound Architecture) input device. +

+

To enable this input device during configuration you need libasound +installed on your system. +

+

This device allows capturing from an ALSA device. The name of the +device to capture has to be an ALSA card identifier. +

+

An ALSA identifier has the syntax: +

+
hw:CARD[,DEV[,SUBDEV]]
+
+ +

where the DEV and SUBDEV components are optional. +

+

The three arguments (in order: CARD,DEV,SUBDEV) +specify card number or identifier, device number and subdevice number +(-1 means any). +

+

To see the list of cards currently recognized by your system check the +files /proc/asound/cards and /proc/asound/devices. +

+

For example to capture with ffmpeg from an ALSA device with +card id 0, you may run the command: +

+
ffmpeg -f alsa -i hw:0 alsaout.wav
+
+ +

For more information see: +http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html +

+ +
+

26.1.1 Options

+ +
+
sample_rate
+

Set the sample rate in Hz. Default is 48000. +

+
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

26.2 android_camera

+ +

Android camera input device. +

+

This input devices uses the Android Camera2 NDK API which is +available on devices with API level 24+. The availability of +android_camera is autodetected during configuration. +

+

This device allows capturing from all cameras on an Android device, +which are integrated into the Camera2 NDK API. +

+

The available cameras are enumerated internally and can be selected +with the camera_index parameter. The input file string is +discarded. +

+

Generally the back facing camera has index 0 while the front facing +camera has index 1. +

+ +
+

26.2.1 Options

+ +
+
video_size
+

Set the video size given as a string such as 640x480 or hd720. +Falls back to the first available configuration reported by +Android if requested video size is not available or by default. +

+
+
framerate
+

Set the video framerate. +Falls back to the first available configuration reported by +Android if requested framerate is not available or by default (-1). +

+
+
camera_index
+

Set the index of the camera to use. Default is 0. +

+
+
input_queue_size
+

Set the maximum number of frames to buffer. Default is 5. +

+
+
+ +
+
+
+

26.3 avfoundation

+ +

AVFoundation input device. +

+

AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX >= 10.7 as well as on iOS. +

+

The input filename has to be given in the following syntax: +

+
-i "[[VIDEO]:[AUDIO]]"
+
+

The first entry selects the video input while the latter selects the audio input. +The stream has to be specified by the device name or the device index as shown by the device list. +Alternatively, the video and/or audio input device can be chosen by index using the + + -video_device_index <INDEX> + +and/or + + -audio_device_index <INDEX> + +, overriding any +device name or index given in the input filename. +

+

All available devices can be enumerated by using -list_devices true, listing +all device names and corresponding indices. +

+

There are two device name aliases: +

+
default
+

Select the AVFoundation default device of the corresponding type. +

+
+
none
+

Do not record the corresponding media type. +This is equivalent to specifying an empty device name or index. +

+
+
+ + +
+

26.3.1 Options

+ +

AVFoundation supports the following options: +

+
+
-list_devices <TRUE|FALSE>
+

If set to true, a list of all available input devices is given showing all +device names and indices. +

+
+
-video_device_index <INDEX>
+

Specify the video device by its index. Overrides anything given in the input filename. +

+
+
-audio_device_index <INDEX>
+

Specify the audio device by its index. Overrides anything given in the input filename. +

+
+
-pixel_format <FORMAT>
+

Request the video device to use a specific pixel format. +If the specified format is not supported, a list of available formats is given +and the first one in this list is used instead. Available pixel formats are: +monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0, + bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10, + yuv420p, nv12, yuyv422, gray +

+
+
-framerate
+

Set the grabbing frame rate. Default is ntsc, corresponding to a +frame rate of 30000/1001. +

+
+
-video_size
+

Set the video frame size. +

+
+
-capture_cursor
+

Capture the mouse pointer. Default is 0. +

+
+
-capture_mouse_clicks
+

Capture the screen mouse clicks. Default is 0. +

+
+
-capture_raw_data
+

Capture the raw device data. Default is 0. +Using this option may result in receiving the underlying data delivered to the AVFoundation framework. E.g. for muxed devices that sends raw DV data to the framework (like tape-based camcorders), setting this option to false results in extracted video frames captured in the designated pixel format only. Setting this option to true results in receiving the raw DV stream untouched. +

+
+ +
+
+

26.3.2 Examples

+ +
    +
  • Print the list of AVFoundation supported devices and exit: +
    +
    $ ffmpeg -f avfoundation -list_devices true -i ""
    +
    + +
  • Record video from video device 0 and audio from audio device 0 into out.avi: +
    +
    $ ffmpeg -f avfoundation -i "0:0" out.avi
    +
    + +
  • Record video from video device 2 and audio from audio device 1 into out.avi: +
    +
    $ ffmpeg -f avfoundation -video_device_index 2 -i ":1" out.avi
    +
    + +
  • Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi: +
    +
    $ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
    +
    + +
  • Record raw DV data from a suitable input device and write the output into out.dv: +
    +
    $ ffmpeg -f avfoundation -capture_raw_data true -i "zr100:none" out.dv
    +
    + + +
+ +
+
+
+

26.4 bktr

+ +

BSD video input device. +

+ +
+

26.4.1 Options

+ +
+
framerate
+

Set the frame rate. +

+
+
video_size
+

Set the video frame size. Default is vga. +

+
+
standard
+
+

Available values are: +

+
pal
+
ntsc
+
secam
+
paln
+
palm
+
ntscj
+
+ +
+
+ +
+
+ +
+

26.6 dshow

+ +

Windows DirectShow input device. +

+

DirectShow support is enabled when FFmpeg is built with the mingw-w64 project. +Currently only audio and video devices are supported. +

+

Multiple devices may be opened as separate inputs, but they may also be +opened on the same input, which should improve synchronism between them. +

+

The input name should be in the format: +

+
+
TYPE=NAME[:TYPE=NAME]
+
+ +

where TYPE can be either audio or video, +and NAME is the device’s name or alternative name.. +

+ +
+

26.6.1 Options

+ +

If no options are specified, the device’s defaults are used. +If the device does not support the requested options, it will +fail to open. +

+
+
video_size
+

Set the video size in the captured video. +

+
+
framerate
+

Set the frame rate in the captured video. +

+
+
sample_rate
+

Set the sample rate (in Hz) of the captured audio. +

+
+
sample_size
+

Set the sample size (in bits) of the captured audio. +

+
+
channels
+

Set the number of channels in the captured audio. +

+
+
list_devices
+

If set to true, print a list of devices and exit. +

+
+
list_options
+

If set to true, print a list of selected device’s options +and exit. +

+
+
video_device_number
+

Set video device number for devices with the same name (starts at 0, +defaults to 0). +

+
+
audio_device_number
+

Set audio device number for devices with the same name (starts at 0, +defaults to 0). +

+
+
pixel_format
+

Select pixel format to be used by DirectShow. This may only be set when +the video codec is not set or set to rawvideo. +

+
+
audio_buffer_size
+

Set audio device buffer size in milliseconds (which can directly +impact latency, depending on the device). +Defaults to using the audio device’s +default buffer size (typically some multiple of 500ms). +Setting this value too low can degrade performance. +See also +http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx +

+
+
video_pin_name
+

Select video capture pin to use by name or alternative name. +

+
+
audio_pin_name
+

Select audio capture pin to use by name or alternative name. +

+
+
crossbar_video_input_pin_number
+

Select video input pin number for crossbar device. This will be +routed to the crossbar device’s Video Decoder output pin. +Note that changing this value can affect future invocations +(sets a new default) until system reboot occurs. +

+
+
crossbar_audio_input_pin_number
+

Select audio input pin number for crossbar device. This will be +routed to the crossbar device’s Audio Decoder output pin. +Note that changing this value can affect future invocations +(sets a new default) until system reboot occurs. +

+
+
show_video_device_dialog
+

If set to true, before capture starts, popup a display dialog +to the end user, allowing them to change video filter properties +and configurations manually. +Note that for crossbar devices, adjusting values in this dialog +may be needed at times to toggle between PAL (25 fps) and NTSC (29.97) +input frame rates, sizes, interlacing, etc. Changing these values can +enable different scan rates/frame rates and avoiding green bars at +the bottom, flickering scan lines, etc. +Note that with some devices, changing these properties can also affect future +invocations (sets new defaults) until system reboot occurs. +

+
+
show_audio_device_dialog
+

If set to true, before capture starts, popup a display dialog +to the end user, allowing them to change audio filter properties +and configurations manually. +

+
+
show_video_crossbar_connection_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify crossbar pin routings, when it opens a video device. +

+
+
show_audio_crossbar_connection_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify crossbar pin routings, when it opens an audio device. +

+
+
show_analog_tv_tuner_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify TV channels and frequencies. +

+
+
show_analog_tv_tuner_audio_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify TV audio (like mono vs. stereo, Language A,B or C). +

+
+
audio_device_load
+

Load an audio capture filter device from file instead of searching +it by name. It may load additional parameters too, if the filter +supports the serialization of its properties to. +To use this an audio capture source has to be specified, but it can +be anything even fake one. +

+
+
audio_device_save
+

Save the currently used audio capture filter device and its +parameters (if the filter supports it) to a file. +If a file with the same name exists it will be overwritten. +

+
+
video_device_load
+

Load a video capture filter device from file instead of searching +it by name. It may load additional parameters too, if the filter +supports the serialization of its properties to. +To use this a video capture source has to be specified, but it can +be anything even fake one. +

+
+
video_device_save
+

Save the currently used video capture filter device and its +parameters (if the filter supports it) to a file. +If a file with the same name exists it will be overwritten. +

+
+
use_video_device_timestamps
+

If set to false, the timestamp for video frames will be +derived from the wallclock instead of the timestamp provided by +the capture device. This allows working around devices that +provide unreliable timestamps. +

+
+
+ +
+
+

26.6.2 Examples

+ +
    +
  • Print the list of DirectShow supported devices and exit: +
    +
    $ ffmpeg -list_devices true -f dshow -i dummy
    +
    + +
  • Open video device Camera: +
    +
    $ ffmpeg -f dshow -i video="Camera"
    +
    + +
  • Open second video device with name Camera: +
    +
    $ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
    +
    + +
  • Open video device Camera and audio device Microphone: +
    +
    $ ffmpeg -f dshow -i video="Camera":audio="Microphone"
    +
    + +
  • Print the list of supported options in selected device and exit: +
    +
    $ ffmpeg -list_options true -f dshow -i video="Camera"
    +
    + +
  • Specify pin names to capture by name or alternative name, specify alternative device name: +
    +
    $ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i video=video="@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}":audio="Microphone"
    +
    + +
  • Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup: +
    +
    $ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
    +     -crossbar_audio_input_pin_number 3 -i video="AVerMedia BDA Analog Capture":audio="AVerMedia BDA Analog Capture"
    +
    + +
+ +
+
+
+

26.7 fbdev

+ +

Linux framebuffer input device. +

+

The Linux framebuffer is a graphic hardware-independent abstraction +layer to show graphics on a computer monitor, typically on the +console. It is accessed through a file device node, usually +/dev/fb0. +

+

For more detailed information read the file +Documentation/fb/framebuffer.txt included in the Linux source tree. +

+

See also http://linux-fbdev.sourceforge.net/, and fbset(1). +

+

To record from the framebuffer device /dev/fb0 with +ffmpeg: +

+
ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
+
+ +

You can take a single screenshot image with the command: +

+
ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
+
+ + +
+

26.7.1 Options

+ +
+
framerate
+

Set the frame rate. Default is 25. +

+
+
+ +
+
+
+

26.8 gdigrab

+ +

Win32 GDI-based screen capture device. +

+

This device allows you to capture a region of the display on Windows. +

+

There are two options for the input filename: +

+
desktop
+
+

or +

+
title=window_title
+
+ +

The first option will capture the entire desktop, or a fixed region of the +desktop. The second option will instead capture the contents of a single +window, regardless of its position on the screen. +

+

For example, to grab the entire desktop using ffmpeg: +

+
ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
+
+ +

Grab a 640x480 region at position 10,20: +

+
ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
+
+ +

Grab the contents of the window named "Calculator" +

+
ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
+
+ + +
+

26.8.1 Options

+ +
+
draw_mouse
+

Specify whether to draw the mouse pointer. Use the value 0 to +not draw the pointer. Default value is 1. +

+
+
framerate
+

Set the grabbing frame rate. Default value is ntsc, +corresponding to a frame rate of 30000/1001. +

+
+
show_region
+

Show grabbed region on screen. +

+

If show_region is specified with 1, then the grabbing +region will be indicated on screen. With this option, it is easy to +know what is being grabbed if only a portion of the screen is grabbed. +

+

Note that show_region is incompatible with grabbing the contents +of a single window. +

+

For example: +

+
ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
+
+ +
+
video_size
+

Set the video frame size. The default is to capture the full screen if desktop is selected, or the full window size if title=window_title is selected. +

+
+
offset_x
+

When capturing a region with video_size, set the distance from the left edge of the screen or desktop. +

+

Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned to the left of your primary monitor, you will need to use a negative offset_x value to move the region to that monitor. +

+
+
offset_y
+

When capturing a region with video_size, set the distance from the top edge of the screen or desktop. +

+

Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned above your primary monitor, you will need to use a negative offset_y value to move the region to that monitor. +

+
+
+ +
+
+
+

26.9 iec61883

+ +

FireWire DV/HDV input device using libiec61883. +

+

To enable this input device, you need libiec61883, libraw1394 and +libavc1394 installed on your system. Use the configure option +--enable-libiec61883 to compile with the device enabled. +

+

The iec61883 capture device supports capturing from a video device +connected via IEEE1394 (FireWire), using libiec61883 and the new Linux +FireWire stack (juju). This is the default DV/HDV input method in Linux +Kernel 2.6.37 and later, since the old FireWire stack was removed. +

+

Specify the FireWire port to be used as input file, or "auto" +to choose the first port connected. +

+ +
+

26.9.1 Options

+ +
+
dvtype
+

Override autodetection of DV/HDV. This should only be used if auto +detection does not work, or if usage of a different device type +should be prohibited. Treating a DV device as HDV (or vice versa) will +not work and result in undefined behavior. +The values auto, dv and hdv are supported. +

+
+
dvbuffer
+

Set maximum size of buffer for incoming data, in frames. For DV, this +is an exact value. For HDV, it is not frame exact, since HDV does +not have a fixed frame size. +

+
+
dvguid
+

Select the capture device by specifying its GUID. Capturing will only +be performed from the specified device and fails if no device with the +given GUID is found. This is useful to select the input if multiple +devices are connected at the same time. +Look at /sys/bus/firewire/devices to find out the GUIDs. +

+
+
+ +
+
+

26.9.2 Examples

+ +
    +
  • Grab and show the input of a FireWire DV/HDV device. +
    +
    ffplay -f iec61883 -i auto
    +
    + +
  • Grab and record the input of a FireWire DV/HDV device, +using a packet buffer of 100000 packets if the source is HDV. +
    +
    ffmpeg -f iec61883 -i auto -dvbuffer 100000 out.mpg
    +
    + +
+ +
+
+
+

26.10 jack

+ +

JACK input device. +

+

To enable this input device during configuration you need libjack +installed on your system. +

+

A JACK input device creates one or more JACK writable clients, one for +each audio channel, with name client_name:input_N, where +client_name is the name provided by the application, and N +is a number which identifies the channel. +Each writable client will send the acquired data to the FFmpeg input +device. +

+

Once you have created one or more JACK readable clients, you need to +connect them to one or more JACK writable clients. +

+

To connect or disconnect JACK clients you can use the jack_connect +and jack_disconnect programs, or do it through a graphical interface, +for example with qjackctl. +

+

To list the JACK clients and their properties you can invoke the command +jack_lsp. +

+

Follows an example which shows how to capture a JACK readable client +with ffmpeg. +

+
# Create a JACK writable client with name "ffmpeg".
+$ ffmpeg -f jack -i ffmpeg -y out.wav
+
+# Start the sample jack_metro readable client.
+$ jack_metro -b 120 -d 0.2 -f 4000
+
+# List the current JACK clients.
+$ jack_lsp -c
+system:capture_1
+system:capture_2
+system:playback_1
+system:playback_2
+ffmpeg:input_1
+metro:120_bpm
+
+# Connect metro to the ffmpeg writable client.
+$ jack_connect metro:120_bpm ffmpeg:input_1
+
+ +

For more information read: +http://jackaudio.org/ +

+ +
+

26.10.1 Options

+ +
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

26.11 kmsgrab

+ +

KMS video input device. +

+

Captures the KMS scanout framebuffer associated with a specified CRTC or plane as a +DRM object that can be passed to other hardware functions. +

+

Requires either DRM master or CAP_SYS_ADMIN to run. +

+

If you don’t understand what all of that means, you probably don’t want this. Look at +x11grab instead. +

+ +
+

26.11.1 Options

+ +
+
device
+

DRM device to capture on. Defaults to /dev/dri/card0. +

+
+
format
+

Pixel format of the framebuffer. This can be autodetected if you are running Linux 5.7 +or later, but needs to be provided for earlier versions. Defaults to bgr0, +which is the most common format used by the Linux console and Xorg X server. +

+
+
format_modifier
+

Format modifier to signal on output frames. This is necessary to import correctly into +some APIs. It can be autodetected if you are running Linux 5.7 or later, but will need +to be provided explicitly when needed in earlier versions. See the libdrm documentation +for possible values. +

+
+
crtc_id
+

KMS CRTC ID to define the capture source. The first active plane on the given CRTC +will be used. +

+
+
plane_id
+

KMS plane ID to define the capture source. Defaults to the first active plane found if +neither crtc_id nor plane_id are specified. +

+
+
framerate
+

Framerate to capture at. This is not synchronised to any page flipping or framebuffer +changes - it just defines the interval at which the framebuffer is sampled. Sampling +faster than the framebuffer update rate will generate independent frames with the same +content. Defaults to 30. +

+
+
+ +
+
+

26.11.2 Examples

+ +
    +
  • Capture from the first active plane, download the result to normal frames and encode. +This will only work if the framebuffer is both linear and mappable - if not, the result +may be scrambled or fail to download. +
    +
    ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4
    +
    + +
  • Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert to NV12 and encode as H.264. +
    +
    ffmpeg -crtc_id 42 -framerate 60 -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' -c:v h264_vaapi output.mp4
    +
    + +
  • To capture only part of a plane the output can be cropped - this can be used to capture +a single window, as long as it has a known absolute position and size. For example, to +capture and encode the middle quarter of a 1920x1080 plane: +
    +
    ffmpeg -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,crop=960:540:480:270,scale_vaapi=960:540:nv12' -c:v h264_vaapi output.mp4
    +
    + +
+ +
+
+
+

26.12 lavfi

+ +

Libavfilter input virtual device. +

+

This input device reads data from the open output pads of a libavfilter +filtergraph. +

+

For each filtergraph open output, the input device will create a +corresponding stream which is mapped to the generated output. +The filtergraph is specified through the option graph. +

+ +
+

26.12.1 Options

+ +
+
graph
+

Specify the filtergraph to use as input. Each video open output must be +labelled by a unique string of the form "outN", where N is a +number starting from 0 corresponding to the mapped input stream +generated by the device. +The first unlabelled output is automatically assigned to the "out0" +label, but all the others need to be specified explicitly. +

+

The suffix "+subcc" can be appended to the output label to create an extra +stream with the closed captions packets attached to that output +(experimental; only for EIA-608 / CEA-708 for now). +The subcc streams are created after all the normal streams, in the order of +the corresponding stream. +For example, if there is "out19+subcc", "out7+subcc" and up to "out42", the +stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19. +

+

If not specified defaults to the filename specified for the input +device. +

+
+
graph_file
+

Set the filename of the filtergraph to be read and sent to the other +filters. Syntax of the filtergraph is the same as the one specified by +the option graph. +

+
+
dumpgraph
+

Dump graph to stderr. +

+
+
+ +
+
+

26.12.2 Examples

+ +
    +
  • Create a color video stream and play it back with ffplay: +
    +
    ffplay -f lavfi -graph "color=c=pink [out0]" dummy
    +
    + +
  • As the previous example, but use filename for specifying the graph +description, and omit the "out0" label: +
    +
    ffplay -f lavfi color=c=pink
    +
    + +
  • Create three different video test filtered sources and play them: +
    +
    ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
    +
    + +
  • Read an audio stream from a file using the amovie source and play it +back with ffplay: +
    +
    ffplay -f lavfi "amovie=test.wav"
    +
    + +
  • Read an audio stream and a video stream and play it back with +ffplay: +
    +
    ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
    +
    + +
  • Dump decoded frames to images and closed captions to a file (experimental): +
    +
    ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
    +
    + +
+ +
+
+
+

26.13 libcdio

+ +

Audio-CD input device based on libcdio. +

+

To enable this input device during configuration you need libcdio +installed on your system. It requires the configure option +--enable-libcdio. +

+

This device allows playing and grabbing from an Audio-CD. +

+

For example to copy with ffmpeg the entire Audio-CD in /dev/sr0, +you may run the command: +

+
ffmpeg -f libcdio -i /dev/sr0 cd.wav
+
+ + +
+

26.13.1 Options

+
+
speed
+

Set drive reading speed. Default value is 0. +

+

The speed is specified CD-ROM speed units. The speed is set through +the libcdio cdio_cddap_speed_set function. On many CD-ROM +drives, specifying a value too large will result in using the fastest +speed. +

+
+
paranoia_mode
+

Set paranoia recovery mode flags. It accepts one of the following values: +

+
+
disable
+
verify
+
overlap
+
neverskip
+
full
+
+ +

Default value is ‘disable’. +

+

For more information about the available recovery modes, consult the +paranoia project documentation. +

+
+ +
+
+
+

26.14 libdc1394

+ +

IIDC1394 input device, based on libdc1394 and libraw1394. +

+

Requires the configure option --enable-libdc1394. +

+ +
+

26.14.1 Options

+
+
framerate
+

Set the frame rate. Default is ntsc, corresponding to a frame +rate of 30000/1001. +

+
+
pixel_format
+

Select the pixel format. Default is uyvy422. +

+
+
video_size
+

Set the video size given as a string such as 640x480 or hd720. +Default is qvga. +

+
+ +
+
+
+

26.15 openal

+ +

The OpenAL input device provides audio capture on all systems with a +working OpenAL 1.1 implementation. +

+

To enable this input device during configuration, you need OpenAL +headers and libraries installed on your system, and need to configure +FFmpeg with --enable-openal. +

+

OpenAL headers and libraries should be provided as part of your OpenAL +implementation, or as an additional download (an SDK). Depending on your +installation you may need to specify additional flags via the +--extra-cflags and --extra-ldflags for allowing the build +system to locate the OpenAL headers and libraries. +

+

An incomplete list of OpenAL implementations follows: +

+
+
Creative
+

The official Windows implementation, providing hardware acceleration +with supported devices and software fallback. +See http://openal.org/. +

+
OpenAL Soft
+

Portable, open source (LGPL) software implementation. Includes +backends for the most common sound APIs on the Windows, Linux, +Solaris, and BSD operating systems. +See http://kcat.strangesoft.net/openal.html. +

+
Apple
+

OpenAL is part of Core Audio, the official Mac OS X Audio interface. +See http://developer.apple.com/technologies/mac/audio-and-video.html +

+
+ +

This device allows one to capture from an audio input device handled +through OpenAL. +

+

You need to specify the name of the device to capture in the provided +filename. If the empty string is provided, the device will +automatically select the default device. You can get the list of the +supported devices by using the option list_devices. +

+ +
+

26.15.1 Options

+ +
+
channels
+

Set the number of channels in the captured audio. Only the values +1 (monaural) and 2 (stereo) are currently supported. +Defaults to 2. +

+
+
sample_size
+

Set the sample size (in bits) of the captured audio. Only the values +8 and 16 are currently supported. Defaults to +16. +

+
+
sample_rate
+

Set the sample rate (in Hz) of the captured audio. +Defaults to 44.1k. +

+
+
list_devices
+

If set to true, print a list of devices and exit. +Defaults to false. +

+
+
+ +
+
+

26.15.2 Examples

+ +

Print the list of OpenAL supported devices and exit: +

+
$ ffmpeg -list_devices true -f openal -i dummy out.ogg
+
+ +

Capture from the OpenAL device DR-BT101 via PulseAudio: +

+
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
+
+ +

Capture from the default device (note the empty string ” as filename): +

+
$ ffmpeg -f openal -i '' out.ogg
+
+ +

Capture from two devices simultaneously, writing to two different files, +within the same ffmpeg command: +

+
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
+
+

Note: not all OpenAL implementations support multiple simultaneous capture - +try the latest OpenAL Soft if the above does not work. +

+
+
+
+

26.16 oss

+ +

Open Sound System input device. +

+

The filename to provide to the input device is the device node +representing the OSS input device, and is usually set to +/dev/dsp. +

+

For example to grab from /dev/dsp using ffmpeg use the +command: +

+
ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
+
+ +

For more information about OSS see: +http://manuals.opensound.com/usersguide/dsp.html +

+ +
+

26.16.1 Options

+ +
+
sample_rate
+

Set the sample rate in Hz. Default is 48000. +

+
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

26.17 pulse

+ +

PulseAudio input device. +

+

To enable this output device you need to configure FFmpeg with --enable-libpulse. +

+

The filename to provide to the input device is a source device or the +string "default" +

+

To list the PulseAudio source devices and their properties you can invoke +the command pactl list sources. +

+

More information about PulseAudio can be found on http://www.pulseaudio.org. +

+ +
+

26.17.1 Options

+
+
server
+

Connect to a specific PulseAudio server, specified by an IP address. +Default server is used when not provided. +

+
+
name
+

Specify the application name PulseAudio will use when showing active clients, +by default it is the LIBAVFORMAT_IDENT string. +

+
+
stream_name
+

Specify the stream name PulseAudio will use when showing active streams, +by default it is "record". +

+
+
sample_rate
+

Specify the samplerate in Hz, by default 48kHz is used. +

+
+
channels
+

Specify the channels in use, by default 2 (stereo) is set. +

+
+
frame_size
+

This option does nothing and is deprecated. +

+
+
fragment_size
+

Specify the size in bytes of the minimal buffering fragment in PulseAudio, it +will affect the audio latency. By default it is set to 50 ms amount of data. +

+
+
wallclock
+

Set the initial PTS using the current time. Default is 1. +

+
+
+ +
+
+

26.17.2 Examples

+

Record a stream from default device: +

+
ffmpeg -f pulse -i default /tmp/pulse.wav
+
+ +
+
+
+

26.18 sndio

+ +

sndio input device. +

+

To enable this input device during configuration you need libsndio +installed on your system. +

+

The filename to provide to the input device is the device node +representing the sndio input device, and is usually set to +/dev/audio0. +

+

For example to grab from /dev/audio0 using ffmpeg use the +command: +

+
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
+
+ + +
+

26.18.1 Options

+ +
+
sample_rate
+

Set the sample rate in Hz. Default is 48000. +

+
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

26.19 video4linux2, v4l2

+ +

Video4Linux2 input video device. +

+

"v4l2" can be used as alias for "video4linux2". +

+

If FFmpeg is built with v4l-utils support (by using the +--enable-libv4l2 configure option), it is possible to use it with the +-use_libv4l2 input device option. +

+

The name of the device to grab is a file device node, usually Linux +systems tend to automatically create such nodes when the device +(e.g. an USB webcam) is plugged into the system, and has a name of the +kind /dev/videoN, where N is a number associated to +the device. +

+

Video4Linux2 devices usually support a limited set of +widthxheight sizes and frame rates. You can check which are +supported using -list_formats all for Video4Linux2 devices. +Some devices, like TV cards, support one or more standards. It is possible +to list all the supported standards using -list_standards all. +

+

The time base for the timestamps is 1 microsecond. Depending on the kernel +version and configuration, the timestamps may be derived from the real time +clock (origin at the Unix Epoch) or the monotonic clock (origin usually at +boot time, unaffected by NTP or manual changes to the clock). The +-timestamps abs or -ts abs option can be used to force +conversion into the real time clock. +

+

Some usage examples of the video4linux2 device with ffmpeg +and ffplay: +

    +
  • List supported formats for a video4linux2 device: +
    +
    ffplay -f video4linux2 -list_formats all /dev/video0
    +
    + +
  • Grab and show the input of a video4linux2 device: +
    +
    ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
    +
    + +
  • Grab and record the input of a video4linux2 device, leave the +frame rate and size as previously set: +
    +
    ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
    +
    +
+ +

For more information about Video4Linux, check http://linuxtv.org/. +

+ +
+

26.19.1 Options

+ +
+
standard
+

Set the standard. Must be the name of a supported standard. To get a +list of the supported standards, use the list_standards +option. +

+
+
channel
+

Set the input channel number. Default to -1, which means using the +previously selected channel. +

+
+
video_size
+

Set the video frame size. The argument must be a string in the form +WIDTHxHEIGHT or a valid size abbreviation. +

+
+
pixel_format
+

Select the pixel format (only valid for raw video input). +

+
+
input_format
+

Set the preferred pixel format (for raw video) or a codec name. +This option allows one to select the input format, when several are +available. +

+
+
framerate
+

Set the preferred video frame rate. +

+
+
list_formats
+

List available formats (supported pixel formats, codecs, and frame +sizes) and exit. +

+

Available values are: +

+
all
+

Show all available (compressed and non-compressed) formats. +

+
+
raw
+

Show only raw video (non-compressed) formats. +

+
+
compressed
+

Show only compressed formats. +

+
+ +
+
list_standards
+

List supported standards and exit. +

+

Available values are: +

+
all
+

Show all supported standards. +

+
+ +
+
timestamps, ts
+

Set type of timestamps for grabbed frames. +

+

Available values are: +

+
default
+

Use timestamps from the kernel. +

+
+
abs
+

Use absolute timestamps (wall clock). +

+
+
mono2abs
+

Force conversion from monotonic to absolute timestamps. +

+
+ +

Default value is default. +

+
+
use_libv4l2
+

Use libv4l2 (v4l-utils) conversion functions. Default is 0. +

+
+
+ +
+
+
+

26.20 vfwcap

+ +

VfW (Video for Windows) capture input device. +

+

The filename passed as input is the capture driver number, ranging from +0 to 9. You may use "list" as filename to print a list of drivers. Any +other filename will be interpreted as device number 0. +

+ +
+

26.20.1 Options

+ +
+
video_size
+

Set the video frame size. +

+
+
framerate
+

Set the grabbing frame rate. Default value is ntsc, +corresponding to a frame rate of 30000/1001. +

+
+
+ +
+
+
+

26.21 x11grab

+ +

X11 video input device. +

+

To enable this input device during configuration you need libxcb +installed on your system. It will be automatically detected during +configuration. +

+

This device allows one to capture a region of an X11 display. +

+

The filename passed as input has the syntax: +

+
[hostname]:display_number.screen_number[+x_offset,y_offset]
+
+ +

hostname:display_number.screen_number specifies the +X11 display name of the screen to grab from. hostname can be +omitted, and defaults to "localhost". The environment variable +DISPLAY contains the default display name. +

+

x_offset and y_offset specify the offsets of the grabbed +area with respect to the top-left border of the X11 screen. They +default to 0. +

+

Check the X11 documentation (e.g. man X) for more detailed +information. +

+

Use the xdpyinfo program for getting basic information about +the properties of your X11 display (e.g. grep for "name" or +"dimensions"). +

+

For example to grab from :0.0 using ffmpeg: +

+
ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +

Grab at position 10,20: +

+
ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
+
+ + +
+

26.21.1 Options

+ +
+
select_region
+

Specify whether to select the grabbing area graphically using the pointer. +A value of 1 prompts the user to select the grabbing area graphically +by clicking and dragging. A single click with no dragging will select the +whole screen. A region with zero width or height will also select the whole +screen. This option overwrites the video_size, grab_x, and +grab_y options. Default value is 0. +

+
+
draw_mouse
+

Specify whether to draw the mouse pointer. A value of 0 specifies +not to draw the pointer. Default value is 1. +

+
+
follow_mouse
+

Make the grabbed area follow the mouse. The argument can be +centered or a number of pixels PIXELS. +

+

When it is specified with "centered", the grabbing region follows the mouse +pointer and keeps the pointer at the center of region; otherwise, the region +follows only when the mouse pointer reaches within PIXELS (greater than +zero) to the edge of region. +

+

For example: +

+
ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +

To follow only when the mouse pointer reaches within 100 pixels to edge: +

+
ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +
+
framerate
+

Set the grabbing frame rate. Default value is ntsc, +corresponding to a frame rate of 30000/1001. +

+
+
show_region
+

Show grabbed region on screen. +

+

If show_region is specified with 1, then the grabbing +region will be indicated on screen. With this option, it is easy to +know what is being grabbed if only a portion of the screen is grabbed. +

+
+
region_border
+

Set the region border thickness if -show_region 1 is used. +Range is 1 to 128 and default is 3 (XCB-based x11grab only). +

+

For example: +

+
ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
+
+ +

With follow_mouse: +

+
ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +
+
window_id
+

Grab this window, instead of the whole screen. Default value is 0, which maps to +the whole screen (root window). +

+

The id of a window can be found using the xwininfo program, possibly with options -tree and +-root. +

+

If the window is later enlarged, the new area is not recorded. Video ends when +the window is closed, unmapped (i.e., iconified) or shrunk beyond the video +size (which defaults to the initial window size). +

+

This option disables options follow_mouse and select_region. +

+
+
video_size
+

Set the video frame size. Default is the full desktop or window. +

+
+
grab_x
+
grab_y
+

Set the grabbing region coordinates. They are expressed as offset from +the top left corner of the X11 window and correspond to the +x_offset and y_offset parameters in the device name. The +default value for both options is 0. +

+
+ +
+
+
+
+

27 Output Devices

+ +

Output devices are configured elements in FFmpeg that can write +multimedia data to an output device attached to your system. +

+

When you configure your FFmpeg build, all the supported output devices +are enabled by default. You can list all available ones using the +configure option "–list-outdevs". +

+

You can disable all the output devices using the configure option +"–disable-outdevs", and selectively enable an output device using the +option "–enable-outdev=OUTDEV", or you can disable a particular +input device using the option "–disable-outdev=OUTDEV". +

+

The option "-devices" of the ff* tools will display the list of +enabled output devices. +

+

A description of the currently available output devices follows. +

+ +
+

27.1 alsa

+ +

ALSA (Advanced Linux Sound Architecture) output device. +

+ +
+

27.1.1 Examples

+ +
    +
  • Play a file on default ALSA device: +
    +
    ffmpeg -i INPUT -f alsa default
    +
    + +
  • Play a file on soundcard 1, audio device 7: +
    +
    ffmpeg -i INPUT -f alsa hw:1,7
    +
    +
+ +
+
+
+

27.2 AudioToolbox

+ +

AudioToolbox output device. +

+

Allows native output to CoreAudio devices on OSX. +

+

The output filename can be empty (or -) to refer to the default system output device or a number that refers to the device index as shown using: -list_devices true. +

+

Alternatively, the audio input device can be chosen by index using the + + -audio_device_index <INDEX> + +, overriding any device name or index given in the input filename. +

+

All available devices can be enumerated by using -list_devices true, listing +all device names, UIDs and corresponding indices. +

+ +
+

27.2.1 Options

+ +

AudioToolbox supports the following options: +

+
+
-audio_device_index <INDEX>
+

Specify the audio device by its index. Overrides anything given in the output filename. +

+
+
+ +
+
+

27.2.2 Examples

+ +
    +
  • Print the list of supported devices and output a sine wave to the default device: +
    +
    $ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -list_devices true -
    +
    + +
  • Output a sine wave to the device with the index 2, overriding any output filename: +
    +
    $ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -audio_device_index 2 -
    +
    + +
+ +
+
+
+

27.3 caca

+ +

CACA output device. +

+

This output device allows one to show a video stream in CACA window. +Only one CACA window is allowed per application, so you can +have only one instance of this output device in an application. +

+

To enable this output device you need to configure FFmpeg with +--enable-libcaca. +libcaca is a graphics library that outputs text instead of pixels. +

+

For more information about libcaca, check: +http://caca.zoy.org/wiki/libcaca +

+ +
+

27.3.1 Options

+ +
+
window_title
+

Set the CACA window title, if not specified default to the filename +specified for the output device. +

+
+
window_size
+

Set the CACA window size, can be a string of the form +widthxheight or a video size abbreviation. +If not specified it defaults to the size of the input video. +

+
+
driver
+

Set display driver. +

+
+
algorithm
+

Set dithering algorithm. Dithering is necessary +because the picture being rendered has usually far more colours than +the available palette. +The accepted values are listed with -list_dither algorithms. +

+
+
antialias
+

Set antialias method. Antialiasing smoothens the rendered +image and avoids the commonly seen staircase effect. +The accepted values are listed with -list_dither antialiases. +

+
+
charset
+

Set which characters are going to be used when rendering text. +The accepted values are listed with -list_dither charsets. +

+
+
color
+

Set color to be used when rendering text. +The accepted values are listed with -list_dither colors. +

+
+
list_drivers
+

If set to true, print a list of available drivers and exit. +

+
+
list_dither
+

List available dither options related to the argument. +The argument must be one of algorithms, antialiases, +charsets, colors. +

+
+ +
+
+

27.3.2 Examples

+ +
    +
  • The following command shows the ffmpeg output is an +CACA window, forcing its size to 80x25: +
    +
    ffmpeg -i INPUT -c:v rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
    +
    + +
  • Show the list of available drivers and exit: +
    +
    ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
    +
    + +
  • Show the list of available dither colors and exit: +
    +
    ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
    +
    +
+ +
+
+ +
+

27.5 fbdev

+ +

Linux framebuffer output device. +

+

The Linux framebuffer is a graphic hardware-independent abstraction +layer to show graphics on a computer monitor, typically on the +console. It is accessed through a file device node, usually +/dev/fb0. +

+

For more detailed information read the file +Documentation/fb/framebuffer.txt included in the Linux source tree. +

+ +
+

27.5.1 Options

+
+
xoffset
+
yoffset
+

Set x/y coordinate of top left corner. Default is 0. +

+
+ +
+
+

27.5.2 Examples

+

Play a file on framebuffer device /dev/fb0. +Required pixel format depends on current framebuffer settings. +

+
ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0
+
+ +

See also http://linux-fbdev.sourceforge.net/, and fbset(1). +

+
+
+
+

27.6 opengl

+

OpenGL output device. +

+

To enable this output device you need to configure FFmpeg with --enable-opengl. +

+

This output device allows one to render to OpenGL context. +Context may be provided by application or default SDL window is created. +

+

When device renders to external context, application must implement handlers for following messages: +AV_DEV_TO_APP_CREATE_WINDOW_BUFFER - create OpenGL context on current thread. +AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER - make OpenGL context current. +AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER - swap buffers. +AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER - destroy OpenGL context. +Application is also required to inform a device about current resolution by sending AV_APP_TO_DEV_WINDOW_SIZE message. +

+ +
+

27.6.1 Options

+
+
background
+

Set background color. Black is a default. +

+
no_window
+

Disables default SDL window when set to non-zero value. +Application must provide OpenGL context and both window_size_cb and window_swap_buffers_cb callbacks when set. +

+
window_title
+

Set the SDL window title, if not specified default to the filename specified for the output device. +Ignored when no_window is set. +

+
window_size
+

Set preferred window size, can be a string of the form widthxheight or a video size abbreviation. +If not specified it defaults to the size of the input video, downscaled according to the aspect ratio. +Mostly usable when no_window is not set. +

+
+
+ +
+
+

27.6.2 Examples

+

Play a file on SDL window using OpenGL rendering: +

+
ffmpeg  -i INPUT -f opengl "window title"
+
+ +
+
+
+

27.7 oss

+ +

OSS (Open Sound System) output device. +

+
+
+

27.8 pulse

+ +

PulseAudio output device. +

+

To enable this output device you need to configure FFmpeg with --enable-libpulse. +

+

More information about PulseAudio can be found on http://www.pulseaudio.org +

+ +
+

27.8.1 Options

+
+
server
+

Connect to a specific PulseAudio server, specified by an IP address. +Default server is used when not provided. +

+
+
name
+

Specify the application name PulseAudio will use when showing active clients, +by default it is the LIBAVFORMAT_IDENT string. +

+
+
stream_name
+

Specify the stream name PulseAudio will use when showing active streams, +by default it is set to the specified output name. +

+
+
device
+

Specify the device to use. Default device is used when not provided. +List of output devices can be obtained with command pactl list sinks. +

+
+
buffer_size
+
buffer_duration
+

Control the size and duration of the PulseAudio buffer. A small buffer +gives more control, but requires more frequent updates. +

+

buffer_size specifies size in bytes while +buffer_duration specifies duration in milliseconds. +

+

When both options are provided then the highest value is used +(duration is recalculated to bytes using stream parameters). If they +are set to 0 (which is default), the device will use the default +PulseAudio duration value. By default PulseAudio set buffer duration +to around 2 seconds. +

+
+
prebuf
+

Specify pre-buffering size in bytes. The server does not start with +playback before at least prebuf bytes are available in the +buffer. By default this option is initialized to the same value as +buffer_size or buffer_duration (whichever is bigger). +

+
+
minreq
+

Specify minimum request size in bytes. The server does not request less +than minreq bytes from the client, instead waits until the buffer +is free enough to request more bytes at once. It is recommended to not set +this option, which will initialize this to a value that is deemed sensible +by the server. +

+
+
+ +
+
+

27.8.2 Examples

+

Play a file on default device on default server: +

+
ffmpeg  -i INPUT -f pulse "stream name"
+
+ +
+
+
+

27.9 sdl

+ +

SDL (Simple DirectMedia Layer) output device. +

+

"sdl2" can be used as alias for "sdl". +

+

This output device allows one to show a video stream in an SDL +window. Only one SDL window is allowed per application, so you can +have only one instance of this output device in an application. +

+

To enable this output device you need libsdl installed on your system +when configuring your build. +

+

For more information about SDL, check: +http://www.libsdl.org/ +

+ +
+

27.9.1 Options

+ +
+
window_borderless
+

Set SDL window border off. +Default value is 0 (enable window border). +

+
+
window_enable_quit
+

Enable quit action (using window button or keyboard key) +when non-zero value is provided. +Default value is 1 (enable quit action). +

+
+
window_fullscreen
+

Set fullscreen mode when non-zero value is provided. +Default value is zero. +

+
+
window_size
+

Set the SDL window size, can be a string of the form +widthxheight or a video size abbreviation. +If not specified it defaults to the size of the input video, +downscaled according to the aspect ratio. +

+
+
window_title
+

Set the SDL window title, if not specified default to the filename +specified for the output device. +

+
+
window_x
+
window_y
+

Set the position of the window on the screen. +

+
+ +
+
+

27.9.2 Interactive commands

+ +

The window created by the device can be controlled through the +following interactive commands. +

+
+
q, ESC
+

Quit the device immediately. +

+
+ +
+
+

27.9.3 Examples

+ +

The following command shows the ffmpeg output is an +SDL window, forcing its size to the qcif format: +

+
ffmpeg -i INPUT -c:v rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
+
+ +
+
+
+

27.10 sndio

+ +

sndio audio output device. +

+
+
+

27.11 v4l2

+ +

Video4Linux2 output device. +

+
+
+

27.12 xv

+ +

XV (XVideo) output device. +

+

This output device allows one to show a video stream in a X Window System +window. +

+ +
+

27.12.1 Options

+ +
+
display_name
+

Specify the hardware display name, which determines the display and +communications domain to be used. +

+

The display name or DISPLAY environment variable can be a string in +the format hostname[:number[.screen_number]]. +

+

hostname specifies the name of the host machine on which the +display is physically attached. number specifies the number of +the display server on that host machine. screen_number specifies +the screen to be used on that server. +

+

If unspecified, it defaults to the value of the DISPLAY environment +variable. +

+

For example, dual-headed:0.1 would specify screen 1 of display +0 on the machine named “dual-headed”. +

+

Check the X11 specification for more detailed information about the +display name format. +

+
+
window_id
+

When set to non-zero value then device doesn’t create new window, +but uses existing one with provided window_id. By default +this options is set to zero and device creates its own window. +

+
+
window_size
+

Set the created window size, can be a string of the form +widthxheight or a video size abbreviation. If not +specified it defaults to the size of the input video. +Ignored when window_id is set. +

+
+
window_x
+
window_y
+

Set the X and Y window offsets for the created window. They are both +set to 0 by default. The values may be ignored by the window manager. +Ignored when window_id is set. +

+
+
window_title
+

Set the window title, if not specified default to the filename +specified for the output device. Ignored when window_id is set. +

+
+ +

For more information about XVideo see http://www.x.org/. +

+
+
+

27.12.2 Examples

+ +
    +
  • Decode, display and encode video input with ffmpeg at the +same time: +
    +
    ffmpeg -i INPUT OUTPUT -f xv display
    +
    + +
  • Decode and display the input video to multiple X11 windows: +
    +
    ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
    +
    +
+ +
+
+
+
+

28 Resampler Options

+ +

The audio resampler supports the following named options. +

+

Options may be set by specifying -option value in the +FFmpeg tools, option=value for the aresample filter, +by setting the value explicitly in the +SwrContext options or using the libavutil/opt.h API for +programmatic use. +

+
+
uchl, used_chlayout
+

Set used input channel layout. Default is unset. This option is +only used for special remapping. +

+
+
isr, in_sample_rate
+

Set the input sample rate. Default value is 0. +

+
+
osr, out_sample_rate
+

Set the output sample rate. Default value is 0. +

+
+
isf, in_sample_fmt
+

Specify the input sample format. It is set by default to none. +

+
+
osf, out_sample_fmt
+

Specify the output sample format. It is set by default to none. +

+
+
tsf, internal_sample_fmt
+

Set the internal sample format. Default value is none. +This will automatically be chosen when it is not explicitly set. +

+
+
ichl, in_chlayout
+
ochl, out_chlayout
+

Set the input/output channel layout. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+
clev, center_mix_level
+

Set the center mix level. It is a value expressed in deciBel, and must be +in the interval [-32,32]. +

+
+
slev, surround_mix_level
+

Set the surround mix level. It is a value expressed in deciBel, and must +be in the interval [-32,32]. +

+
+
lfe_mix_level
+

Set LFE mix into non LFE level. It is used when there is a LFE input but no +LFE output. It is a value expressed in deciBel, and must +be in the interval [-32,32]. +

+
+
rmvol, rematrix_volume
+

Set rematrix volume. Default value is 1.0. +

+
+
rematrix_maxval
+

Set maximum output value for rematrixing. +This can be used to prevent clipping vs. preventing volume reduction. +A value of 1.0 prevents clipping. +

+
+
flags, swr_flags
+

Set flags used by the converter. Default value is 0. +

+

It supports the following individual flags: +

+
res
+

force resampling, this flag forces resampling to be used even when the +input and output sample rates match. +

+
+ +
+
dither_scale
+

Set the dither scale. Default value is 1. +

+
+
dither_method
+

Set dither method. Default value is 0. +

+

Supported values: +

+
rectangular
+

select rectangular dither +

+
triangular
+

select triangular dither +

+
triangular_hp
+

select triangular dither with high pass +

+
lipshitz
+

select Lipshitz noise shaping dither. +

+
shibata
+

select Shibata noise shaping dither. +

+
low_shibata
+

select low Shibata noise shaping dither. +

+
high_shibata
+

select high Shibata noise shaping dither. +

+
f_weighted
+

select f-weighted noise shaping dither +

+
modified_e_weighted
+

select modified-e-weighted noise shaping dither +

+
improved_e_weighted
+

select improved-e-weighted noise shaping dither +

+
+
+ +
+
resampler
+

Set resampling engine. Default value is swr. +

+

Supported values: +

+
swr
+

select the native SW Resampler; filter options precision and cheby are not +applicable in this case. +

+
soxr
+

select the SoX Resampler (where available); compensation, and filter options +filter_size, phase_shift, exact_rational, filter_type & kaiser_beta, are not +applicable in this case. +

+
+ +
+
filter_size
+

For swr only, set resampling filter size, default value is 32. +

+
+
phase_shift
+

For swr only, set resampling phase shift, default value is 10, and must be in +the interval [0,30]. +

+
+
linear_interp
+

Use linear interpolation when enabled (the default). Disable it if you want +to preserve speed instead of quality when exact_rational fails. +

+
+
exact_rational
+

For swr only, when enabled, try to use exact phase_count based on input and +output sample rate. However, if it is larger than 1 << phase_shift, +the phase_count will be 1 << phase_shift as fallback. Default is enabled. +

+
+
cutoff
+

Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float +value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr +(which, with a sample-rate of 44100, preserves the entire audio band to 20kHz). +

+
+
precision
+

For soxr only, the precision in bits to which the resampled signal will be +calculated. The default value of 20 (which, with suitable dithering, is +appropriate for a destination bit-depth of 16) gives SoX’s ’High Quality’; a +value of 28 gives SoX’s ’Very High Quality’. +

+
+
cheby
+

For soxr only, selects passband rolloff none (Chebyshev) & higher-precision +approximation for ’irrational’ ratios. Default value is 0. +

+
+
async
+

For swr only, simple 1 parameter audio sync to timestamps using stretching, +squeezing, filling and trimming. Setting this to 1 will enable filling and +trimming, larger values represent the maximum amount in samples that the data +may be stretched or squeezed for each second. +Default value is 0, thus no compensation is applied to make the samples match +the audio timestamps. +

+
+
first_pts
+

For swr only, assume the first pts should be this value. The time unit is 1 / sample rate. +This allows for padding/trimming at the start of stream. By default, no +assumption is made about the first frame’s expected pts, so no padding or +trimming is done. For example, this could be set to 0 to pad the beginning with +silence if an audio stream starts after the video stream or to trim any samples +with a negative pts due to encoder delay. +

+
+
min_comp
+

For swr only, set the minimum difference between timestamps and audio data (in +seconds) to trigger stretching/squeezing/filling or trimming of the +data to make it match the timestamps. The default is that +stretching/squeezing/filling and trimming is disabled +(min_comp = FLT_MAX). +

+
+
min_hard_comp
+

For swr only, set the minimum difference between timestamps and audio data (in +seconds) to trigger adding/dropping samples to make it match the +timestamps. This option effectively is a threshold to select between +hard (trim/fill) and soft (squeeze/stretch) compensation. Note that +all compensation is by default disabled through min_comp. +The default is 0.1. +

+
+
comp_duration
+

For swr only, set duration (in seconds) over which data is stretched/squeezed +to make it match the timestamps. Must be a non-negative double float value, +default value is 1.0. +

+
+
max_soft_comp
+

For swr only, set maximum factor by which data is stretched/squeezed to make it +match the timestamps. Must be a non-negative double float value, default value +is 0. +

+
+
matrix_encoding
+

Select matrixed stereo encoding. +

+

It accepts the following values: +

+
none
+

select none +

+
dolby
+

select Dolby +

+
dplii
+

select Dolby Pro Logic II +

+
+ +

Default value is none. +

+
+
filter_type
+

For swr only, select resampling filter type. This only affects resampling +operations. +

+

It accepts the following values: +

+
cubic
+

select cubic +

+
blackman_nuttall
+

select Blackman Nuttall windowed sinc +

+
kaiser
+

select Kaiser windowed sinc +

+
+ +
+
kaiser_beta
+

For swr only, set Kaiser window beta value. Must be a double float value in the +interval [2,16], default value is 9. +

+
+
output_sample_bits
+

For swr only, set number of used output sample bits for dithering. Must be an integer in the +interval [0,64], default value is 0, which means it’s not used. +

+
+
+ +
+
+

29 Scaler Options

+ +

The video scaler supports the following named options. +

+

Options may be set by specifying -option value in the +FFmpeg tools, with a few API-only exceptions noted below. +For programmatic use, they can be set explicitly in the +SwsContext options or through the libavutil/opt.h API. +

+
+
+
+
sws_flags
+

Set the scaler flags. This is also used to set the scaling +algorithm. Only a single algorithm should be selected. Default +value is ‘bicubic’. +

+

It accepts the following values: +

+
fast_bilinear
+

Select fast bilinear scaling algorithm. +

+
+
bilinear
+

Select bilinear scaling algorithm. +

+
+
bicubic
+

Select bicubic scaling algorithm. +

+
+
experimental
+

Select experimental scaling algorithm. +

+
+
neighbor
+

Select nearest neighbor rescaling algorithm. +

+
+
area
+

Select averaging area rescaling algorithm. +

+
+
bicublin
+

Select bicubic scaling algorithm for the luma component, bilinear for +chroma components. +

+
+
gauss
+

Select Gaussian rescaling algorithm. +

+
+
sinc
+

Select sinc rescaling algorithm. +

+
+
lanczos
+

Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be +changed by setting param0. +

+
+
spline
+

Select natural bicubic spline rescaling algorithm. +

+
+
print_info
+

Enable printing/debug logging. +

+
+
accurate_rnd
+

Enable accurate rounding. +

+
+
full_chroma_int
+

Enable full chroma interpolation. +

+
+
full_chroma_inp
+

Select full chroma input. +

+
+
bitexact
+

Enable bitexact output. +

+
+ +
+
srcw (API only)
+

Set source width. +

+
+
srch (API only)
+

Set source height. +

+
+
dstw (API only)
+

Set destination width. +

+
+
dsth (API only)
+

Set destination height. +

+
+
src_format (API only)
+

Set source pixel format (must be expressed as an integer). +

+
+
dst_format (API only)
+

Set destination pixel format (must be expressed as an integer). +

+
+
src_range (boolean)
+

If value is set to 1, indicates source is full range. Default value is +0, which indicates source is limited range. +

+
+
dst_range (boolean)
+

If value is set to 1, enable full range for destination. Default value +is 0, which enables limited range. +

+
+
param0, param1
+

Set scaling algorithm parameters. The specified values are specific of +some scaling algorithms and ignored by others. The specified values +are floating point number values. +

+
+
sws_dither
+

Set the dithering algorithm. Accepts one of the following +values. Default value is ‘auto’. +

+
+
auto
+

automatic choice +

+
+
none
+

no dithering +

+
+
bayer
+

bayer dither +

+
+
ed
+

error diffusion dither +

+
+
a_dither
+

arithmetic dither, based using addition +

+
+
x_dither
+

arithmetic dither, based using xor (more random/less apparent patterning that +a_dither). +

+
+
+ +
+
alphablend
+

Set the alpha blending to use when the input has alpha but the output does not. +Default value is ‘none’. +

+
+
uniform_color
+

Blend onto a uniform background color +

+
+
checkerboard
+

Blend onto a checkerboard +

+
+
none
+

No blending +

+
+
+ +
+
+ +
+
+

30 Filtering Introduction

+ +

Filtering in FFmpeg is enabled through the libavfilter library. +

+

In libavfilter, a filter can have multiple inputs and multiple +outputs. +To illustrate the sorts of things that are possible, we consider the +following filtergraph. +

+
                [main]
+input --> split ---------------------> overlay --> output
+            |                             ^
+            |[tmp]                  [flip]|
+            +-----> crop --> vflip -------+
+
+

This filtergraph splits the input stream in two streams, then sends one +stream through the crop filter and the vflip filter, before merging it +back with the other stream by overlaying it on top. You can use the +following command to achieve this: +

+
+
ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT
+
+ +

The result will be that the top half of the video is mirrored +onto the bottom half of the output video. +

+

Filters in the same linear chain are separated by commas, and distinct +linear chains of filters are separated by semicolons. In our example, +crop,vflip are in one linear chain, split and +overlay are separately in another. The points where the linear +chains join are labelled by names enclosed in square brackets. In the +example, the split filter generates two outputs that are associated to +the labels [main] and [tmp]. +

+

The stream sent to the second output of split, labelled as +[tmp], is processed through the crop filter, which crops +away the lower half part of the video, and then vertically flipped. The +overlay filter takes in input the first unchanged output of the +split filter (which was labelled as [main]), and overlay on its +lower half the output generated by the crop,vflip filterchain. +

+

Some filters take in input a list of parameters: they are specified +after the filter name and an equal sign, and are separated from each other +by a colon. +

+

There exist so-called source filters that do not have an +audio/video input, and sink filters that will not have audio/video +output. +

+ +
+
+

31 graph2dot

+ +

The graph2dot program included in the FFmpeg tools +directory can be used to parse a filtergraph description and issue a +corresponding textual representation in the dot language. +

+

Invoke the command: +

+
graph2dot -h
+
+ +

to see how to use graph2dot. +

+

You can then pass the dot description to the dot program (from +the graphviz suite of programs) and obtain a graphical representation +of the filtergraph. +

+

For example the sequence of commands: +

+
echo GRAPH_DESCRIPTION | \
+tools/graph2dot -o graph.tmp && \
+dot -Tpng graph.tmp -o graph.png && \
+display graph.png
+
+ +

can be used to create and display an image representing the graph +described by the GRAPH_DESCRIPTION string. Note that this string must be +a complete self-contained graph, with its inputs and outputs explicitly defined. +For example if your command line is of the form: +

+
ffmpeg -i infile -vf scale=640:360 outfile
+
+

your GRAPH_DESCRIPTION string will need to be of the form: +

+
nullsrc,scale=640:360,nullsink
+
+

you may also need to set the nullsrc parameters and add a format +filter in order to simulate a specific input file. +

+ +
+
+

32 Filtergraph description

+ +

A filtergraph is a directed graph of connected filters. It can contain +cycles, and there can be multiple links between a pair of +filters. Each link has one input pad on one side connecting it to one +filter from which it takes its input, and one output pad on the other +side connecting it to one filter accepting its output. +

+

Each filter in a filtergraph is an instance of a filter class +registered in the application, which defines the features and the +number of input and output pads of the filter. +

+

A filter with no input pads is called a "source", and a filter with no +output pads is called a "sink". +

+ +
+

32.1 Filtergraph syntax

+ +

A filtergraph has a textual representation, which is recognized by the +-filter/-vf/-af and +-filter_complex options in ffmpeg and +-vf/-af in ffplay, and by the +avfilter_graph_parse_ptr() function defined in +libavfilter/avfilter.h. +

+

A filterchain consists of a sequence of connected filters, each one +connected to the previous one in the sequence. A filterchain is +represented by a list of ","-separated filter descriptions. +

+

A filtergraph consists of a sequence of filterchains. A sequence of +filterchains is represented by a list of ";"-separated filterchain +descriptions. +

+

A filter is represented by a string of the form: +[in_link_1]...[in_link_N]filter_name@id=arguments[out_link_1]...[out_link_M] +

+

filter_name is the name of the filter class of which the +described filter is an instance of, and has to be the name of one of +the filter classes registered in the program optionally followed by "@id". +The name of the filter class is optionally followed by a string +"=arguments". +

+

arguments is a string which contains the parameters used to +initialize the filter instance. It may have one of two forms: +

    +
  • A ’:’-separated list of key=value pairs. + +
  • A ’:’-separated list of value. In this case, the keys are assumed to be +the option names in the order they are declared. E.g. the fade filter +declares three options in this order – type, start_frame and +nb_frames. Then the parameter list in:0:30 means that the value +in is assigned to the option type, 0 to +start_frame and 30 to nb_frames. + +
  • A ’:’-separated list of mixed direct value and long key=value +pairs. The direct value must precede the key=value pairs, and +follow the same constraints order of the previous point. The following +key=value pairs can be set in any preferred order. + +
+ +

If the option value itself is a list of items (e.g. the format filter +takes a list of pixel formats), the items in the list are usually separated by +‘|’. +

+

The list of arguments can be quoted using the character ‘'’ as initial +and ending mark, and the character ‘\’ for escaping the characters +within the quoted text; otherwise the argument string is considered +terminated when the next special character (belonging to the set +‘[]=;,’) is encountered. +

+

A special syntax implemented in the ffmpeg CLI tool allows loading +option values from files. This is done be prepending a slash ’/’ to the option +name, then the supplied value is interpreted as a path from which the actual +value is loaded. E.g. +

+
ffmpeg -i <INPUT> -vf drawtext=/text=/tmp/some_text <OUTPUT>
+
+

will load the text to be drawn from /tmp/some_text. API users wishing to +implement a similar feature should use the avfilter_graph_segment_*() +functions together with custom IO code. +

+

The name and arguments of the filter are optionally preceded and +followed by a list of link labels. +A link label allows one to name a link and associate it to a filter output +or input pad. The preceding labels in_link_1 +... in_link_N, are associated to the filter input pads, +the following labels out_link_1 ... out_link_M, are +associated to the output pads. +

+

When two link labels with the same name are found in the +filtergraph, a link between the corresponding input and output pad is +created. +

+

If an output pad is not labelled, it is linked by default to the first +unlabelled input pad of the next filter in the filterchain. +For example in the filterchain +

+
nullsrc, split[L1], [L2]overlay, nullsink
+
+

the split filter instance has two output pads, and the overlay filter +instance two input pads. The first output pad of split is labelled +"L1", the first input pad of overlay is labelled "L2", and the second +output pad of split is linked to the second input pad of overlay, +which are both unlabelled. +

+

In a filter description, if the input label of the first filter is not +specified, "in" is assumed; if the output label of the last filter is not +specified, "out" is assumed. +

+

In a complete filterchain all the unlabelled filter input and output +pads must be connected. A filtergraph is considered valid if all the +filter input and output pads of all the filterchains are connected. +

+

Leading and trailing whitespaces (space, tabs, or line feeds) separating tokens +in the filtergraph specification are ignored. This means that the filtergraph +can be expressed using empty lines and spaces to improve redability. +

+

For example, the filtergraph: +

+
testsrc,split[L1],hflip[L2];[L1][L2] hstack
+
+ +

can be represented as: +

+
testsrc,
+split [L1], hflip [L2];
+
+[L1][L2] hstack
+
+ +

Libavfilter will automatically insert scale filters where format +conversion is required. It is possible to specify swscale flags +for those automatically inserted scalers by prepending +sws_flags=flags; +to the filtergraph description. +

+

Here is a BNF description of the filtergraph syntax: +

+
NAME             ::= sequence of alphanumeric characters and '_'
+FILTER_NAME      ::= NAME["@"NAME]
+LINKLABEL        ::= "[" NAME "]"
+LINKLABELS       ::= LINKLABEL [LINKLABELS]
+FILTER_ARGUMENTS ::= sequence of chars (possibly quoted)
+FILTER           ::= [LINKLABELS] FILTER_NAME ["=" FILTER_ARGUMENTS] [LINKLABELS]
+FILTERCHAIN      ::= FILTER [,FILTERCHAIN]
+FILTERGRAPH      ::= [sws_flags=flags;] FILTERCHAIN [;FILTERGRAPH]
+
+ +
+
+

32.2 Notes on filtergraph escaping

+ +

Filtergraph description composition entails several levels of +escaping. See (ffmpeg-utils)the "Quoting and escaping" +section in the ffmpeg-utils(1) manual for more +information about the employed escaping procedure. +

+

A first level escaping affects the content of each filter option +value, which may contain the special character : used to +separate values, or one of the escaping characters \'. +

+

A second level escaping affects the whole filter description, which +may contain the escaping characters \' or the special +characters [],; used by the filtergraph description. +

+

Finally, when you specify a filtergraph on a shell commandline, you +need to perform a third level escaping for the shell special +characters contained within it. +

+

For example, consider the following string to be embedded in +the drawtext filter description text value: +

+
this is a 'string': may contain one, or more, special characters
+
+ +

This string contains the ' special escaping character, and the +: special character, so it needs to be escaped in this way: +

+
text=this is a \'string\'\: may contain one, or more, special characters
+
+ +

A second level of escaping is required when embedding the filter +description in a filtergraph description, in order to escape all the +filtergraph special characters. Thus the example above becomes: +

+
drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
+
+

(note that in addition to the \' escaping special characters, +also , needs to be escaped). +

+

Finally an additional level of escaping is needed when writing the +filtergraph description in a shell command, which depends on the +escaping rules of the adopted shell. For example, assuming that +\ is special and needs to be escaped with another \, the +previous string will finally result in: +

+
-vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
+
+ +

In order to avoid cumbersome escaping when using a commandline tool accepting a +filter specification as input, it is advisable to avoid direct inclusion of the +filter or options specification in the shell. +

+

For example, in case of the drawtext filter, you might prefer to +use the textfile option in place of text to specify the text +to render. +

+

When using the ffmpeg tool, you might consider to use the +(ffmpeg)-filter_script option or +(ffmpeg)-filter_complex_script option. +

+
+
+
+

33 Timeline editing

+ +

Some filters support a generic enable option. For the filters +supporting timeline editing, this option can be set to an expression which is +evaluated before sending a frame to the filter. If the evaluation is non-zero, +the filter will be enabled, otherwise the frame will be sent unchanged to the +next filter in the filtergraph. +

+

The expression accepts the following values: +

+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
n
+

sequential number of the input frame, starting from 0 +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, do +not use +

+
+
w
+
h
+

width and height of the input frame if video +

+
+ +

Additionally, these filters support an enable command that can be used +to re-define the expression. +

+

Like any other filtering option, the enable option follows the same +rules. +

+

For example, to enable a blur filter (smartblur) from 10 seconds to 3 +minutes, and a curves filter starting at 3 seconds: +

+
smartblur = enable='between(t,10,3*60)',
+curves    = enable='gte(t,3)' : preset=cross_process
+
+ +

See ffmpeg -filters to view which filters have timeline support. +

+ +
+
+

34 Changing options at runtime with a command

+ +

Some options can be changed during the operation of the filter using +a command. These options are marked ’T’ on the output of +ffmpeg -h filter=<name of filter>. +The name of the command is the name of the option and the argument is +the new value. +

+
+
+

35 Options for filters with several inputs (framesync)

+ +

Some filters with several inputs support a common set of options. +These options can only be set by name, not with the short notation. +

+
+
eof_action
+

The action to take when EOF is encountered on the secondary input; it accepts +one of the following values: +

+
+
repeat
+

Repeat the last frame (the default). +

+
endall
+

End both streams. +

+
pass
+

Pass the main input through. +

+
+ +
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+
repeatlast
+

If set to 1, force the filter to extend the last frame of secondary streams +until the end of the primary stream. A value of 0 disables this behavior. +Default value is 1. +

+
+
ts_sync_mode
+

How strictly to sync streams based on secondary input timestamps; it accepts +one of the following values: +

+
+
default
+

Frame from secondary input with the nearest lower or equal timestamp to the +primary input frame. +

+
nearest
+

Frame from secondary input with the absolute nearest timestamp to the primary +input frame. +

+
+
+
+ + +
+
+

36 Audio Filters

+ +

When you configure your FFmpeg build, you can disable any of the +existing filters using --disable-filters. +The configure output will show the audio filters included in your +build. +

+

Below is a description of the currently available audio filters. +

+ +
+

36.1 acompressor

+ +

A compressor is mainly used to reduce the dynamic range of a signal. +Especially modern music is mostly compressed at a high ratio to +improve the overall loudness. It’s done to get the highest attention +of a listener, "fatten" the sound and bring more "power" to the track. +If a signal is compressed too much it may sound dull or "dead" +afterwards or it may start to "pump" (which could be a powerful effect +but can also destroy a track completely). +The right compression is the key to reach a professional sound and is +the high art of mixing and mastering. Because of its complex settings +it may take a long time to get the right feeling for this kind of effect. +

+

Compression is done by detecting the volume above a chosen level +threshold and dividing it by the factor set with ratio. +So if you set the threshold to -12dB and your signal reaches -6dB a ratio +of 2:1 will result in a signal at -9dB. Because an exact manipulation of +the signal would cause distortion of the waveform the reduction can be +levelled over the time. This is done by setting "Attack" and "Release". +attack determines how long the signal has to rise above the threshold +before any reduction will occur and release sets the time the signal +has to fall below the threshold to reduce the reduction again. Shorter signals +than the chosen attack time will be left untouched. +The overall reduction of the signal can be made up afterwards with the +makeup setting. So compressing the peaks of a signal about 6dB and +raising the makeup to this level results in a signal twice as loud than the +source. To gain a softer entry in the compression the knee flattens the +hard edge at the threshold in the range of the chosen decibels. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. Default is 1. Range is between 0.015625 and 64. +

+
+
mode
+

Set mode of compressor operation. Can be upward or downward. +Default is downward. +

+
+
threshold
+

If a signal of stream rises above this level it will affect the gain +reduction. +By default it is 0.125. Range is between 0.00097563 and 1. +

+
+
ratio
+

Set a ratio by which the signal is reduced. 1:2 means that if the level +rose 4dB above the threshold, it will be only 2dB above after the reduction. +Default is 2. Range is between 1 and 20. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction starts. Default is 20. Range is between 0.01 and 2000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before +reduction is decreased again. Default is 250. Range is between 0.01 and 9000. +

+
+
makeup
+

Set the amount by how much signal will be amplified after processing. +Default is 1. Range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.82843. Range is between 1 and 8. +

+
+
link
+

Choose if the average level between all channels of input stream +or the louder(maximum) channel of input stream affects the +reduction. Default is average. +

+
+
detection
+

Should the exact signal be taken in case of peak or an RMS one in case +of rms. Default is rms which is mostly smoother. +

+
+
mix
+

How much to use compressed signal in output. Default is 1. +Range is between 0 and 1. +

+
+ + +
+

36.1.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.2 acontrast

+

Simple audio dynamic range compression/expansion filter. +

+

The filter accepts the following options: +

+
+
contrast
+

Set contrast. Default is 33. Allowed range is between 0 and 100. +

+
+ +
+
+

36.3 acopy

+ +

Copy the input audio source unchanged to the output. This is mainly useful for +testing purposes. +

+
+
+

36.4 acrossfade

+ +

Apply cross fade from one input audio stream to another input audio stream. +The cross fade is applied for specified duration near the end of first stream. +

+

The filter accepts the following options: +

+
+
nb_samples, ns
+

Specify the number of samples for which the cross fade effect has to last. +At the end of the cross fade effect the first input audio will be completely +silent. Default is 44100. +

+
+
duration, d
+

Specify the duration of the cross fade effect. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +By default the duration is determined by nb_samples. +If set this option is used instead of nb_samples. +

+
+
overlap, o
+

Should first stream end overlap with second stream start. Default is enabled. +

+
+
curve1
+

Set curve for cross fade transition for first stream. +

+
+
curve2
+

Set curve for cross fade transition for second stream. +

+

For description of available curve types see afade filter description. +

+
+ + +
+

36.4.1 Examples

+ +
    +
  • Cross fade from one input to another: +
    +
    ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
    +
    + +
  • Cross fade from one input to another but without overlapping: +
    +
    ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
    +
    +
+ +
+
+
+

36.5 acrossover

+

Split audio stream into several bands. +

+

This filter splits audio stream into two or more frequency ranges. +Summing all streams back will give flat output. +

+

The filter accepts the following options: +

+
+
split
+

Set split frequencies. Those must be positive and increasing. +

+
+
order
+

Set filter order for each band split. This controls filter roll-off or steepness +of filter transfer function. +Available values are: +

+
+
2nd
+

12 dB per octave. +

+
4th
+

24 dB per octave. +

+
6th
+

36 dB per octave. +

+
8th
+

48 dB per octave. +

+
10th
+

60 dB per octave. +

+
12th
+

72 dB per octave. +

+
14th
+

84 dB per octave. +

+
16th
+

96 dB per octave. +

+
18th
+

108 dB per octave. +

+
20th
+

120 dB per octave. +

+
+ +

Default is 4th. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 1. Default value is 1. +

+
+
gains
+

Set output gain for each band. Default value is 1 for all bands. +

+
+
precision
+

Set which precision to use when processing samples. +

+
+
auto
+

Auto pick internal sample format depending on other filters. +

+
+
float
+

Always use single-floating point precision sample format. +

+
+
double
+

Always use double-floating point precision sample format. +

+
+ +

Default value is auto. +

+
+ + +
+

36.5.1 Examples

+ +
    +
  • Split input audio stream into two bands (low and high) with split frequency of 1500 Hz, +each band will be in separate stream: +
    +
    ffmpeg -i in.flac -filter_complex 'acrossover=split=1500[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
    +
    + +
  • Same as above, but with higher filter order: +
    +
    ffmpeg -i in.flac -filter_complex 'acrossover=split=1500:order=8th[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
    +
    + +
  • Same as above, but also with additional middle band (frequencies between 1500 and 8000): +
    +
    ffmpeg -i in.flac -filter_complex 'acrossover=split=1500 8000:order=8th[LOW][MID][HIGH]' -map '[LOW]' low.wav -map '[MID]' mid.wav -map '[HIGH]' high.wav
    +
    +
+ +
+
+
+

36.6 acrusher

+ +

Reduce audio bit resolution. +

+

This filter is bit crusher with enhanced functionality. A bit crusher +is used to audibly reduce number of bits an audio signal is sampled +with. This doesn’t change the bit depth at all, it just produces the +effect. Material reduced in bit depth sounds more harsh and "digital". +This filter is able to even round to continuous values instead of discrete +bit depths. +Additionally it has a D/C offset which results in different crushing of +the lower and the upper half of the signal. +An Anti-Aliasing setting is able to produce "softer" crushing sounds. +

+

Another feature of this filter is the logarithmic mode. +This setting switches from linear distances between bits to logarithmic ones. +The result is a much more "natural" sounding crusher which doesn’t gate low +signals for example. The human ear has a logarithmic perception, +so this kind of crushing is much more pleasant. +Logarithmic crushing is also able to get anti-aliased. +

+

The filter accepts the following options: +

+
+
level_in
+

Set level in. +

+
+
level_out
+

Set level out. +

+
+
bits
+

Set bit reduction. +

+
+
mix
+

Set mixing amount. +

+
+
mode
+

Can be linear: lin or logarithmic: log. +

+
+
dc
+

Set DC. +

+
+
aa
+

Set anti-aliasing. +

+
+
samples
+

Set sample reduction. +

+
+
lfo
+

Enable LFO. By default disabled. +

+
+
lforange
+

Set LFO range. +

+
+
lforate
+

Set LFO rate. +

+
+ + +
+

36.6.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.7 acue

+ +

Delay audio filtering until a given wallclock timestamp. See the cue +filter. +

+
+
+

36.8 adeclick

+

Remove impulsive noise from input audio. +

+

Samples detected as impulsive noise are replaced by interpolated samples using +autoregressive modelling. +

+
+
window, w
+

Set window size, in milliseconds. Allowed range is from 10 to +100. Default value is 55 milliseconds. +This sets size of window which will be processed at once. +

+
+
overlap, o
+

Set window overlap, in percentage of window size. Allowed range is from +50 to 95. Default value is 75 percent. +Setting this to a very high value increases impulsive noise removal but makes +whole process much slower. +

+
+
arorder, a
+

Set autoregression order, in percentage of window size. Allowed range is from +0 to 25. Default value is 2 percent. This option also +controls quality of interpolated samples using neighbour good samples. +

+
+
threshold, t
+

Set threshold value. Allowed range is from 1 to 100. +Default value is 2. +This controls the strength of impulsive noise which is going to be removed. +The lower value, the more samples will be detected as impulsive noise. +

+
+
burst, b
+

Set burst fusion, in percentage of window size. Allowed range is 0 to +10. Default value is 2. +If any two samples detected as noise are spaced less than this value then any +sample between those two samples will be also detected as noise. +

+
+
method, m
+

Set overlap method. +

+

It accepts the following values: +

+
add, a
+

Select overlap-add method. Even not interpolated samples are slightly +changed with this method. +

+
+
save, s
+

Select overlap-save method. Not interpolated samples remain unchanged. +

+
+ +

Default value is a. +

+
+ +
+
+

36.9 adeclip

+

Remove clipped samples from input audio. +

+

Samples detected as clipped are replaced by interpolated samples using +autoregressive modelling. +

+
+
window, w
+

Set window size, in milliseconds. Allowed range is from 10 to 100. +Default value is 55 milliseconds. +This sets size of window which will be processed at once. +

+
+
overlap, o
+

Set window overlap, in percentage of window size. Allowed range is from 50 +to 95. Default value is 75 percent. +

+
+
arorder, a
+

Set autoregression order, in percentage of window size. Allowed range is from +0 to 25. Default value is 8 percent. This option also controls +quality of interpolated samples using neighbour good samples. +

+
+
threshold, t
+

Set threshold value. Allowed range is from 1 to 100. +Default value is 10. Higher values make clip detection less aggressive. +

+
+
hsize, n
+

Set size of histogram used to detect clips. Allowed range is from 100 to 9999. +Default value is 1000. Higher values make clip detection less aggressive. +

+
+
method, m
+

Set overlap method. +

+

It accepts the following values: +

+
add, a
+

Select overlap-add method. Even not interpolated samples are slightly changed +with this method. +

+
+
save, s
+

Select overlap-save method. Not interpolated samples remain unchanged. +

+
+ +

Default value is a. +

+
+ +
+
+

36.10 adecorrelate

+

Apply decorrelation to input audio stream. +

+

The filter accepts the following options: +

+
+
stages
+

Set decorrelation stages of filtering. Allowed +range is from 1 to 16. Default value is 6. +

+
+
seed
+

Set random seed used for setting delay in samples across channels. +

+
+ +
+
+

36.11 adelay

+ +

Delay one or more audio channels. +

+

Samples in delayed channel are filled with silence. +

+

The filter accepts the following option: +

+
+
delays
+

Set list of delays in milliseconds for each channel separated by ’|’. +Unused delays will be silently ignored. If number of given delays is +smaller than number of channels all remaining channels will not be delayed. +If you want to delay exact number of samples, append ’S’ to number. +If you want instead to delay in seconds, append ’s’ to number. +

+
+
all
+

Use last set delay for all remaining channels. By default is disabled. +This option if enabled changes how option delays is interpreted. +

+
+ + +
+

36.11.1 Examples

+ +
    +
  • Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave +the second channel (and any other channels that may be present) unchanged. +
    +
    adelay=1500|0|500
    +
    + +
  • Delay second channel by 500 samples, the third channel by 700 samples and leave +the first channel (and any other channels that may be present) unchanged. +
    +
    adelay=0|500S|700S
    +
    + +
  • Delay all channels by same number of samples: +
    +
    adelay=delays=64S:all=1
    +
    +
+ +
+
+
+

36.12 adenorm

+

Remedy denormals in audio by adding extremely low-level noise. +

+

This filter shall be placed before any filter that can produce denormals. +

+

A description of the accepted parameters follows. +

+
+
level
+

Set level of added noise in dB. Default is -351. +Allowed range is from -451 to -90. +

+
+
type
+

Set type of added noise. +

+
+
dc
+

Add DC signal. +

+
ac
+

Add AC signal. +

+
square
+

Add square signal. +

+
pulse
+

Add pulse signal. +

+
+ +

Default is dc. +

+
+ + +
+

36.12.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.13 aderivative, aintegral

+ +

Compute derivative/integral of audio stream. +

+

Applying both filters one after another produces original audio. +

+
+
+

36.14 adrc

+ +

Apply spectral dynamic range controller filter to input audio stream. +

+

A description of the accepted options follows. +

+
+
transfer
+

Set the transfer expression. +

+

The expression can contain the following constants: +

+
+
ch
+

current channel number +

+
+
sn
+

current sample number +

+
+
nb_channels
+

number of channels +

+
+
t
+

timestamp expressed in seconds +

+
+
sr
+

sample rate +

+
+
p
+

current frequency power value, in dB +

+
+
f
+

current frequency in Hz +

+
+ +

Default value is p. +

+
+
attack
+

Set the attack in milliseconds. Default is 50 milliseconds. +Allowed range is from 1 to 1000 milliseconds. +

+
release
+

Set the release in milliseconds. Default is 100 milliseconds. +Allowed range is from 5 to 2000 milliseconds. +

+
channels
+

Set which channels to filter, by default all channels in audio stream are filtered. +

+
+ + +
+

36.14.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

36.14.2 Examples

+ +
    +
  • Apply spectral compression to all frequencies with threshold of -50 dB and 1:6 ratio: +
    +
    adrc=transfer='if(gt(p,-50),-50+(p-(-50))/6,p)':attack=50:release=100
    +
    + +
  • Similar to above but with 1:2 ratio and filtering only front center channel: +
    +
    adrc=transfer='if(gt(p,-50),-50+(p-(-50))/2,p)':attack=50:release=100:channels=FC
    +
    + +
  • Apply spectral noise gate to all frequencies with threshold of -85 dB and with short attack time and short release time: +
    +
    adrc=transfer='if(lte(p,-85),p-800,p)':attack=1:release=5
    +
    + +
  • Apply spectral expansion to all frequencies with threshold of -10 dB and 1:2 ratio: +
    +
    adrc=transfer='if(lt(p,-10),-10+(p-(-10))*2,p)':attack=50:release=100
    +
    + +
  • Apply limiter to max -60 dB to all frequencies, with attack of 2 ms and release of 10 ms: +
    +
    adrc=transfer='min(p,-60)':attack=2:release=10
    +
    +
+ +
+
+
+

36.15 adynamicequalizer

+ +

Apply dynamic equalization to input audio stream. +

+

A description of the accepted options follows. +

+
+
threshold
+

Set the detection threshold used to trigger equalization. +Threshold detection is using detection filter. +Default value is 0. Allowed range is from 0 to 100. +

+
+
dfrequency
+

Set the detection frequency in Hz used for detection filter used to trigger equalization. +Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz. +

+
+
dqfactor
+

Set the detection resonance factor for detection filter used to trigger equalization. +Default value is 1. Allowed range is from 0.001 to 1000. +

+
+
tfrequency
+

Set the target frequency of equalization filter. +Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz. +

+
+
tqfactor
+

Set the target resonance factor for target equalization filter. +Default value is 1. Allowed range is from 0.001 to 1000. +

+
+
attack
+

Set the amount of milliseconds the signal from detection has to rise above +the detection threshold before equalization starts. +Default is 20. Allowed range is between 1 and 2000. +

+
+
release
+

Set the amount of milliseconds the signal from detection has to fall below the +detection threshold before equalization ends. +Default is 200. Allowed range is between 1 and 2000. +

+
+
ratio
+

Set the ratio by which the equalization gain is raised. +Default is 1. Allowed range is between 0 and 30. +

+
+
makeup
+

Set the makeup offset by which the equalization gain is raised. +Default is 0. Allowed range is between 0 and 100. +

+
+
range
+

Set the max allowed cut/boost amount. Default is 50. +Allowed range is from 1 to 200. +

+
+
mode
+

Set the mode of filter operation, can be one of the following: +

+
+
listen
+

Output only isolated detection signal. +

+
cut
+

Cut frequencies above detection threshold. +

+
boost
+

Boost frequencies bellow detection threshold. +

+
+

Default mode is ‘cut’. +

+
+
dftype
+

Set the type of detection filter, can be one of the following: +

+
+
bandpass
+
lowpass
+
highpass
+
peak
+
+

Default type is ‘bandpass’. +

+
+
tftype
+

Set the type of target filter, can be one of the following: +

+
+
bell
+
lowshelf
+
highshelf
+
+

Default type is ‘bell’. +

+
+
direction
+

Set processing direction relative to threshold. +

+
downward
+

Boost/Cut if threshold is higher/lower than detected volume. +

+
upward
+

Boost/Cut if threshold is lower/higher than detected volume. +

+
+

Default direction is ‘downward’. +

+
+
auto
+

Automatically gather threshold from detection filter. By default +is ‘disabled’. +This option is useful to detect threshold in certain time frame of +input audio stream, in such case option value is changed at runtime. +

+

Available values are: +

+
disabled
+

Disable using automatically gathered threshold value. +

+
off
+

Stop picking threshold value. +

+
on
+

Start picking threshold value. +

+
+ +
+
precision
+

Set which precision to use when processing samples. +

+
+
auto
+

Auto pick internal sample format depending on other filters. +

+
+
float
+

Always use single-floating point precision sample format. +

+
+
double
+

Always use double-floating point precision sample format. +

+
+
+
+ + +
+

36.15.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.16 adynamicsmooth

+ +

Apply dynamic smoothing to input audio stream. +

+

A description of the accepted options follows. +

+
+
sensitivity
+

Set an amount of sensitivity to frequency fluctations. Default is 2. +Allowed range is from 0 to 1e+06. +

+
+
basefreq
+

Set a base frequency for smoothing. Default value is 22050. +Allowed range is from 2 to 1e+06. +

+
+ + +
+

36.16.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.17 aecho

+ +

Apply echoing to the input audio. +

+

Echoes are reflected sound and can occur naturally amongst mountains +(and sometimes large buildings) when talking or shouting; digital echo +effects emulate this behaviour and are often used to help fill out the +sound of a single instrument or vocal. The time difference between the +original signal and the reflection is the delay, and the +loudness of the reflected signal is the decay. +Multiple echoes can have different delays and decays. +

+

A description of the accepted parameters follows. +

+
+
in_gain
+

Set input gain of reflected signal. Default is 0.6. +

+
+
out_gain
+

Set output gain of reflected signal. Default is 0.3. +

+
+
delays
+

Set list of time intervals in milliseconds between original signal and reflections +separated by ’|’. Allowed range for each delay is (0 - 90000.0]. +Default is 1000. +

+
+
decays
+

Set list of loudness of reflected signals separated by ’|’. +Allowed range for each decay is (0 - 1.0]. +Default is 0.5. +

+
+ + +
+

36.17.1 Examples

+ +
    +
  • Make it sound as if there are twice as many instruments as are actually playing: +
    +
    aecho=0.8:0.88:60:0.4
    +
    + +
  • If delay is very short, then it sounds like a (metallic) robot playing music: +
    +
    aecho=0.8:0.88:6:0.4
    +
    + +
  • A longer delay will sound like an open air concert in the mountains: +
    +
    aecho=0.8:0.9:1000:0.3
    +
    + +
  • Same as above but with one more mountain: +
    +
    aecho=0.8:0.9:1000|1800:0.3|0.25
    +
    +
+ +
+
+
+

36.18 aemphasis

+

Audio emphasis filter creates or restores material directly taken from LPs or +emphased CDs with different filter curves. E.g. to store music on vinyl the +signal has to be altered by a filter first to even out the disadvantages of +this recording medium. +Once the material is played back the inverse filter has to be applied to +restore the distortion of the frequency response. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. +

+
+
level_out
+

Set output gain. +

+
+
mode
+

Set filter mode. For restoring material use reproduction mode, otherwise +use production mode. Default is reproduction mode. +

+
+
type
+

Set filter type. Selects medium. Can be one of the following: +

+
+
col
+

select Columbia. +

+
emi
+

select EMI. +

+
bsi
+

select BSI (78RPM). +

+
riaa
+

select RIAA. +

+
cd
+

select Compact Disc (CD). +

+
50fm
+

select 50µs (FM). +

+
75fm
+

select 75µs (FM). +

+
50kf
+

select 50µs (FM-KF). +

+
75kf
+

select 75µs (FM-KF). +

+
+
+
+ + +
+

36.18.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.19 aeval

+ +

Modify an audio signal according to the specified expressions. +

+

This filter accepts one or more expressions (one for each channel), +which are evaluated and used to modify a corresponding audio signal. +

+

It accepts the following parameters: +

+
+
exprs
+

Set the ’|’-separated expressions list for each separate channel. If +the number of input channels is greater than the number of +expressions, the last specified expression is used for the remaining +output channels. +

+
+
channel_layout, c
+

Set output channel layout. If not specified, the channel layout is +specified by the number of expressions. If set to ‘same’, it will +use by default the same input channel layout. +

+
+ +

Each expression in exprs can contain the following constants and functions: +

+
+
ch
+

channel number of the current expression +

+
+
n
+

number of the evaluated sample, starting from 0 +

+
+
s
+

sample rate +

+
+
t
+

time of the evaluated sample expressed in seconds +

+
+
nb_in_channels
+
nb_out_channels
+

input and output number of channels +

+
+
val(CH)
+

the value of input channel with number CH +

+
+ +

Note: this filter is slow. For faster processing you should use a +dedicated filter. +

+ +
+

36.19.1 Examples

+ +
    +
  • Half volume: +
    +
    aeval=val(ch)/2:c=same
    +
    + +
  • Invert phase of the second channel: +
    +
    aeval=val(0)|-val(1)
    +
    +
+ +
+
+
+

36.20 aexciter

+ +

An exciter is used to produce high sound that is not present in the +original signal. This is done by creating harmonic distortions of the +signal which are restricted in range and added to the original signal. +An Exciter raises the upper end of an audio signal without simply raising +the higher frequencies like an equalizer would do to create a more +"crisp" or "brilliant" sound. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level prior processing of signal. +Allowed range is from 0 to 64. +Default value is 1. +

+
+
level_out
+

Set output level after processing of signal. +Allowed range is from 0 to 64. +Default value is 1. +

+
+
amount
+

Set the amount of harmonics added to original signal. +Allowed range is from 0 to 64. +Default value is 1. +

+
+
drive
+

Set the amount of newly created harmonics. +Allowed range is from 0.1 to 10. +Default value is 8.5. +

+
+
blend
+

Set the octave of newly created harmonics. +Allowed range is from -10 to 10. +Default value is 0. +

+
+
freq
+

Set the lower frequency limit of producing harmonics in Hz. +Allowed range is from 2000 to 12000 Hz. +Default is 7500 Hz. +

+
+
ceil
+

Set the upper frequency limit of producing harmonics. +Allowed range is from 9999 to 20000 Hz. +If value is lower than 10000 Hz no limit is applied. +

+
+
listen
+

Mute the original signal and output only added harmonics. +By default is disabled. +

+
+ + +
+

36.20.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.21 afade

+ +

Apply fade-in/out effect to input audio. +

+

A description of the accepted parameters follows. +

+
+
type, t
+

Specify the effect type, can be either in for fade-in, or +out for a fade-out effect. Default is in. +

+
+
start_sample, ss
+

Specify the number of the start sample for starting to apply the fade +effect. Default is 0. +

+
+
nb_samples, ns
+

Specify the number of samples for which the fade effect has to last. At +the end of the fade-in effect the output audio will have the same +volume as the input audio, at the end of the fade-out transition +the output audio will be silence. Default is 44100. +

+
+
start_time, st
+

Specify the start time of the fade effect. Default is 0. +The value must be specified as a time duration; see +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +If set this option is used instead of start_sample. +

+
+
duration, d
+

Specify the duration of the fade effect. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +At the end of the fade-in effect the output audio will have the same +volume as the input audio, at the end of the fade-out transition +the output audio will be silence. +By default the duration is determined by nb_samples. +If set this option is used instead of nb_samples. +

+
+
curve
+

Set curve for fade transition. +

+

It accepts the following values: +

+
tri
+

select triangular, linear slope (default) +

+
qsin
+

select quarter of sine wave +

+
hsin
+

select half of sine wave +

+
esin
+

select exponential sine wave +

+
log
+

select logarithmic +

+
ipar
+

select inverted parabola +

+
qua
+

select quadratic +

+
cub
+

select cubic +

+
squ
+

select square root +

+
cbr
+

select cubic root +

+
par
+

select parabola +

+
exp
+

select exponential +

+
iqsin
+

select inverted quarter of sine wave +

+
ihsin
+

select inverted half of sine wave +

+
dese
+

select double-exponential seat +

+
desi
+

select double-exponential sigmoid +

+
losi
+

select logistic sigmoid +

+
sinc
+

select sine cardinal function +

+
isinc
+

select inverted sine cardinal function +

+
nofade
+

no fade applied +

+
+ +
+
silence
+

Set the initial gain for fade-in or final gain for fade-out. +Default value is 0.0. +

+
+
unity
+

Set the initial gain for fade-out or final gain for fade-in. +Default value is 1.0. +

+
+ + +
+

36.21.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

36.21.2 Examples

+ +
    +
  • Fade in first 15 seconds of audio: +
    +
    afade=t=in:ss=0:d=15
    +
    + +
  • Fade out last 25 seconds of a 900 seconds audio: +
    +
    afade=t=out:st=875:d=25
    +
    +
+ +
+
+
+

36.22 afftdn

+

Denoise audio samples with FFT. +

+

A description of the accepted parameters follows. +

+
+
noise_reduction, nr
+

Set the noise reduction in dB, allowed range is 0.01 to 97. +Default value is 12 dB. +

+
+
noise_floor, nf
+

Set the noise floor in dB, allowed range is -80 to -20. +Default value is -50 dB. +

+
+
noise_type, nt
+

Set the noise type. +

+

It accepts the following values: +

+
white, w
+

Select white noise. +

+
+
vinyl, v
+

Select vinyl noise. +

+
+
shellac, s
+

Select shellac noise. +

+
+
custom, c
+

Select custom noise, defined in bn option. +

+

Default value is white noise. +

+
+ +
+
band_noise, bn
+

Set custom band noise profile for every one of 15 bands. +Bands are separated by ’ ’ or ’|’. +

+
+
residual_floor, rf
+

Set the residual floor in dB, allowed range is -80 to -20. +Default value is -38 dB. +

+
+
track_noise, tn
+

Enable noise floor tracking. By default is disabled. +With this enabled, noise floor is automatically adjusted. +

+
+
track_residual, tr
+

Enable residual tracking. By default is disabled. +

+
+
output_mode, om
+

Set the output mode. +

+

It accepts the following values: +

+
input, i
+

Pass input unchanged. +

+
+
output, o
+

Pass noise filtered out. +

+
+
noise, n
+

Pass only noise. +

+

Default value is output. +

+
+ +
+
adaptivity, ad
+

Set the adaptivity factor, used how fast to adapt gains adjustments per +each frequency bin. Value 0 enables instant adaptation, while higher values +react much slower. +Allowed range is from 0 to 1. Default value is 0.5. +

+
+
floor_offset, fo
+

Set the noise floor offset factor. This option is used to adjust offset applied to measured +noise floor. It is only effective when noise floor tracking is enabled. +Allowed range is from -2.0 to 2.0. Default value is 1.0. +

+
+
noise_link, nl
+

Set the noise link used for multichannel audio. +

+

It accepts the following values: +

+
none
+

Use unchanged channel’s noise floor. +

+
+
min
+

Use measured min noise floor of all channels. +

+
+
max
+

Use measured max noise floor of all channels. +

+
+
average
+

Use measured average noise floor of all channels. +

+

Default value is min. +

+
+ +
+
band_multiplier, bm
+

Set the band multiplier factor, used how much to spread bands across frequency bins. +Allowed range is from 0.2 to 5. Default value is 1.25. +

+
+
sample_noise, sn
+

Toggle capturing and measurement of noise profile from input audio. +

+

It accepts the following values: +

+
start, begin
+

Start sample noise capture. +

+
+
stop, end
+

Stop sample noise capture and measure new noise band profile. +

+

Default value is none. +

+
+ +
+
gain_smooth, gs
+

Set gain smooth spatial radius, used to smooth gains applied to each frequency bin. +Useful to reduce random music noise artefacts. +Higher values increases smoothing of gains. +Allowed range is from 0 to 50. +Default value is 0. +

+
+ + +
+

36.22.1 Commands

+ +

This filter supports the some above mentioned options as commands. +

+
+
+

36.22.2 Examples

+ +
    +
  • Reduce white noise by 10dB, and use previously measured noise floor of -40dB: +
    +
    afftdn=nr=10:nf=-40
    +
    + +
  • Reduce white noise by 10dB, also set initial noise floor to -80dB and enable automatic +tracking of noise floor so noise floor will gradually change during processing: +
    +
    afftdn=nr=10:nf=-80:tn=1
    +
    + +
  • Reduce noise by 20dB, using noise floor of -40dB and using commands to take noise profile +of first 0.4 seconds of input audio: +
    +
    asendcmd=0.0 afftdn sn start,asendcmd=0.4 afftdn sn stop,afftdn=nr=20:nf=-40
    +
    +
+ +
+
+
+

36.23 afftfilt

+

Apply arbitrary expressions to samples in frequency domain. +

+
+
real
+

Set frequency domain real expression for each separate channel separated +by ’|’. Default is "re". +If the number of input channels is greater than the number of +expressions, the last specified expression is used for the remaining +output channels. +

+
+
imag
+

Set frequency domain imaginary expression for each separate channel +separated by ’|’. Default is "im". +

+

Each expression in real and imag can contain the following +constants and functions: +

+
+
sr
+

sample rate +

+
+
b
+

current frequency bin number +

+
+
nb
+

number of available bins +

+
+
ch
+

channel number of the current expression +

+
+
chs
+

number of channels +

+
+
pts
+

current frame pts +

+
+
re
+

current real part of frequency bin of current channel +

+
+
im
+

current imaginary part of frequency bin of current channel +

+
+
real(b, ch)
+

Return the value of real part of frequency bin at location (bin,channel) +

+
+
imag(b, ch)
+

Return the value of imaginary part of frequency bin at location (bin,channel) +

+
+ +
+
win_size
+

Set window size. Allowed range is from 16 to 131072. +Default is 4096 +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann, hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hann. +

+
+
overlap
+

Set window overlap. If set to 1, the recommended overlap for selected +window function will be picked. Default is 0.75. +

+
+ + +
+

36.23.1 Examples

+ +
    +
  • Leave almost only low frequencies in audio: +
    +
    afftfilt="'real=re * (1-clip((b/nb)*b,0,1))':imag='im * (1-clip((b/nb)*b,0,1))'"
    +
    + +
  • Apply robotize effect: +
    +
    afftfilt="real='hypot(re,im)*sin(0)':imag='hypot(re,im)*cos(0)':win_size=512:overlap=0.75"
    +
    + +
  • Apply whisper effect: +
    +
    afftfilt="real='hypot(re,im)*cos((random(0)*2-1)*2*3.14)':imag='hypot(re,im)*sin((random(1)*2-1)*2*3.14)':win_size=128:overlap=0.8"
    +
    + +
  • Apply phase shift: +
    +
    afftfilt="real=re*cos(1)-im*sin(1):imag=re*sin(1)+im*cos(1)"
    +
    +
+ +
+
+
+

36.24 afir

+ +

Apply an arbitrary Finite Impulse Response filter. +

+

This filter is designed for applying long FIR filters, +up to 60 seconds long. +

+

It can be used as component for digital crossover filters, +room equalization, cross talk cancellation, wavefield synthesis, +auralization, ambiophonics, ambisonics and spatialization. +

+

This filter uses the streams higher than first one as FIR coefficients. +If the non-first stream holds a single channel, it will be used +for all input channels in the first stream, otherwise +the number of channels in the non-first stream must be same as +the number of channels in the first stream. +

+

It accepts the following parameters: +

+
+
dry
+

Set dry gain. This sets input gain. +

+
+
wet
+

Set wet gain. This sets final output gain. +

+
+
length
+

Set Impulse Response filter length. Default is 1, which means whole IR is processed. +

+
+
gtype
+

Enable applying gain measured from power of IR. +

+

Set which approach to use for auto gain measurement. +

+
+
none
+

Do not apply any gain. +

+
+
peak
+

select peak gain, very conservative approach. This is default value. +

+
+
dc
+

select DC gain, limited application. +

+
+
gn
+

select gain to noise approach, this is most popular one. +

+
+
ac
+

select AC gain. +

+
+
rms
+

select RMS gain. +

+
+ +
+
irgain
+

Set gain to be applied to IR coefficients before filtering. +Allowed range is 0 to 1. This gain is applied after any gain applied with gtype option. +

+
+
irfmt
+

Set format of IR stream. Can be mono or input. +Default is input. +

+
+
maxir
+

Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds. +Allowed range is 0.1 to 60 seconds. +

+
+
response
+

Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream. +By default it is disabled. +

+
+
channel
+

Set for which IR channel to display frequency response. By default is first channel +displayed. This option is used only when response is enabled. +

+
+
size
+

Set video stream size. This option is used only when response is enabled. +

+
+
rate
+

Set video stream frame rate. This option is used only when response is enabled. +

+
+
minp
+

Set minimal partition size used for convolution. Default is 8192. +Allowed range is from 1 to 65536. +Lower values decreases latency at cost of higher CPU usage. +

+
+
maxp
+

Set maximal partition size used for convolution. Default is 8192. +Allowed range is from 8 to 65536. +Lower values may increase CPU usage. +

+
+
nbirs
+

Set number of input impulse responses streams which will be switchable at runtime. +Allowed range is from 1 to 32. Default is 1. +

+
+
ir
+

Set IR stream which will be used for convolution, starting from 0, should always be +lower than supplied value by nbirs option. Default is 0. +This option can be changed at runtime via commands. +

+
+
precision
+

Set which precision to use when processing samples. +

+
+
auto
+

Auto pick internal sample format depending on other filters. +

+
+
float
+

Always use single-floating point precision sample format. +

+
+
double
+

Always use double-floating point precision sample format. +

+
+ +

Default value is auto. +

+
+
irload
+

Set when to load IR stream. Can be init or access. +First one load and prepares all IRs on initialization, second one +once on first access of specific IR. +Default is init. +

+
+ + +
+

36.24.1 Examples

+ +
    +
  • Apply reverb to stream using mono IR file as second input, complete command using ffmpeg: +
    +
    ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
    +
    + +
  • Apply true stereo processing given input stereo stream, and two stereo impulse responses for left and right channel, +the impulse response files are files with names l_ir.wav and r_ir.wav: +
    +
    "pan=4C|c0=FL|c1=FL|c2=FR|c3=FR[a];amovie=l_ir.wav[LIR];amovie=r_ir.wav[RIR];[LIR][RIR]amerge[ir];[a][ir]afir=irfmt=input:gtype=gn:irgain=-5dB,pan=stereo|FL<c0+c2|FR<c1+c3"
    +
    +
+ +
+
+
+

36.25 aformat

+ +

Set output format constraints for the input audio. The framework will +negotiate the most appropriate format to minimize conversions. +

+

It accepts the following parameters: +

+
sample_fmts, f
+

A ’|’-separated list of requested sample formats. +

+
+
sample_rates, r
+

A ’|’-separated list of requested sample rates. +

+
+
channel_layouts, cl
+

A ’|’-separated list of requested channel layouts. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+ +

If a parameter is omitted, all values are allowed. +

+

Force the output to either unsigned 8-bit or signed 16-bit stereo +

+
aformat=sample_fmts=u8|s16:channel_layouts=stereo
+
+ +
+
+

36.26 afreqshift

+

Apply frequency shift to input audio samples. +

+

The filter accepts the following options: +

+
+
shift
+

Specify frequency shift. Allowed range is -INT_MAX to INT_MAX. +Default value is 0.0. +

+
+
level
+

Set output gain applied to final output. Allowed range is from 0.0 to 1.0. +Default value is 1.0. +

+
+
order
+

Set filter order used for filtering. Allowed range is from 1 to 16. +Default value is 8. +

+
+ + +
+

36.26.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.27 afwtdn

+

Reduce broadband noise from input samples using Wavelets. +

+

A description of the accepted options follows. +

+
+
sigma
+

Set the noise sigma, allowed range is from 0 to 1. +Default value is 0. +This option controls strength of denoising applied to input samples. +Most useful way to set this option is via decibels, eg. -45dB. +

+
+
levels
+

Set the number of wavelet levels of decomposition. +Allowed range is from 1 to 12. +Default value is 10. +Setting this too low make denoising performance very poor. +

+
+
wavet
+

Set wavelet type for decomposition of input frame. +They are sorted by number of coefficients, from lowest to highest. +More coefficients means worse filtering speed, but overall better quality. +Available wavelets are: +

+
+
sym2
+
sym4
+
rbior68
+
deb10
+
sym10
+
coif5
+
bl3
+
+ +
+
percent
+

Set percent of full denoising. Allowed range is from 0 to 100 percent. +Default value is 85 percent or partial denoising. +

+
+
profile
+

If enabled, first input frame will be used as noise profile. +If first frame samples contain non-noise performance will be very poor. +

+
+
adaptive
+

If enabled, input frames are analyzed for presence of noise. +If noise is detected with high possibility then input frame profile will be +used for processing following frames, until new noise frame is detected. +

+
+
samples
+

Set size of single frame in number of samples. Allowed range is from 512 to +65536. Default frame size is 8192 samples. +

+
+
softness
+

Set softness applied inside thresholding function. Allowed range is from 0 to +10. Default softness is 1. +

+
+ + +
+

36.27.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.28 agate

+ +

A gate is mainly used to reduce lower parts of a signal. This kind of signal +processing reduces disturbing noise between useful signals. +

+

Gating is done by detecting the volume below a chosen level threshold +and dividing it by the factor set with ratio. The bottom of the noise +floor is set via range. Because an exact manipulation of the signal +would cause distortion of the waveform the reduction can be levelled over +time. This is done by setting attack and release. +

+

attack determines how long the signal has to fall below the threshold +before any reduction will occur and release sets the time the signal +has to rise above the threshold to reduce the reduction again. +Shorter signals than the chosen attack time will be left untouched. +

+
+
level_in
+

Set input level before filtering. +Default is 1. Allowed range is from 0.015625 to 64. +

+
+
mode
+

Set the mode of operation. Can be upward or downward. +Default is downward. If set to upward mode, higher parts of signal +will be amplified, expanding dynamic range in upward direction. +Otherwise, in case of downward lower parts of signal will be reduced. +

+
+
range
+

Set the level of gain reduction when the signal is below the threshold. +Default is 0.06125. Allowed range is from 0 to 1. +Setting this to 0 disables reduction and then filter behaves like expander. +

+
+
threshold
+

If a signal rises above this level the gain reduction is released. +Default is 0.125. Allowed range is from 0 to 1. +

+
+
ratio
+

Set a ratio by which the signal is reduced. +Default is 2. Allowed range is from 1 to 9000. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction stops. +Default is 20 milliseconds. Allowed range is from 0.01 to 9000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before the +reduction is increased again. Default is 250 milliseconds. +Allowed range is from 0.01 to 9000. +

+
+
makeup
+

Set amount of amplification of signal after processing. +Default is 1. Allowed range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.828427125. Allowed range is from 1 to 8. +

+
+
detection
+

Choose if exact signal should be taken for detection or an RMS like one. +Default is rms. Can be peak or rms. +

+
+
link
+

Choose if the average level between all channels or the louder channel affects +the reduction. +Default is average. Can be average or maximum. +

+
+ + +
+

36.28.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.29 aiir

+ +

Apply an arbitrary Infinite Impulse Response filter. +

+

It accepts the following parameters: +

+
+
zeros, z
+

Set B/numerator/zeros/reflection coefficients. +

+
+
poles, p
+

Set A/denominator/poles/ladder coefficients. +

+
+
gains, k
+

Set channels gains. +

+
+
dry_gain
+

Set input gain. +

+
+
wet_gain
+

Set output gain. +

+
+
format, f
+

Set coefficients format. +

+
+
ll
+

lattice-ladder function +

+
sf
+

analog transfer function +

+
tf
+

digital transfer function +

+
zp
+

Z-plane zeros/poles, cartesian (default) +

+
pr
+

Z-plane zeros/poles, polar radians +

+
pd
+

Z-plane zeros/poles, polar degrees +

+
sp
+

S-plane zeros/poles +

+
+ +
+
process, r
+

Set type of processing. +

+
+
d
+

direct processing +

+
s
+

serial processing +

+
p
+

parallel processing +

+
+ +
+
precision, e
+

Set filtering precision. +

+
+
dbl
+

double-precision floating-point (default) +

+
flt
+

single-precision floating-point +

+
i32
+

32-bit integers +

+
i16
+

16-bit integers +

+
+ +
+
normalize, n
+

Normalize filter coefficients, by default is enabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
mix
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
response
+

Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream. +By default it is disabled. +

+
+
channel
+

Set for which IR channel to display frequency response. By default is first channel +displayed. This option is used only when response is enabled. +

+
+
size
+

Set video stream size. This option is used only when response is enabled. +

+
+ +

Coefficients in tf and sf format are separated by spaces and are in ascending +order. +

+

Coefficients in zp format are separated by spaces and order of coefficients +doesn’t matter. Coefficients in zp format are complex numbers with i +imaginary unit. +

+

Different coefficients and gains can be provided for every channel, in such case +use ’|’ to separate coefficients or gains. Last provided coefficients will be +used for all remaining channels. +

+ +
+

36.29.1 Examples

+ +
    +
  • Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate: +
    +
    aiir=k=1:z=7.957584807809675810E-1 -2.575128568908332300 3.674839853930788710 -2.57512875289799137 7.957586296317130880E-1:p=1 -2.86950072432325953 3.63022088054647218 -2.28075678147272232 6.361362326477423500E-1:f=tf:r=d
    +
    + +
  • Same as above but in zp format: +
    +
    aiir=k=0.79575848078096756:z=0.80918701+0.58773007i 0.80918701-0.58773007i 0.80884700+0.58784055i 0.80884700-0.58784055i:p=0.63892345+0.59951235i 0.63892345-0.59951235i 0.79582691+0.44198673i 0.79582691-0.44198673i:f=zp:r=s
    +
    + +
  • Apply 3-rd order analog normalized Butterworth low-pass filter, using analog transfer function format: +
    +
    aiir=z=1.3057 0 0 0:p=1.3057 2.3892 2.1860 1:f=sf:r=d
    +
    +
+ +
+
+
+

36.30 alimiter

+ +

The limiter prevents an input signal from rising over a desired threshold. +This limiter uses lookahead technology to prevent your signal from distorting. +It means that there is a small delay after the signal is processed. Keep in mind +that the delay it produces is the attack time you set. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. Default is 1. +

+
+
level_out
+

Set output gain. Default is 1. +

+
+
limit
+

Don’t let signals above this level pass the limiter. Default is 1. +

+
+
attack
+

The limiter will reach its attenuation level in this amount of time in +milliseconds. Default is 5 milliseconds. +

+
+
release
+

Come back from limiting to attenuation 1.0 in this amount of milliseconds. +Default is 50 milliseconds. +

+
+
asc
+

When gain reduction is always needed ASC takes care of releasing to an +average reduction level rather than reaching a reduction of 0 in the release +time. +

+
+
asc_level
+

Select how much the release time is affected by ASC, 0 means nearly no changes +in release time while 1 produces higher release times. +

+
+
level
+

Auto level output signal. Default is enabled. +This normalizes audio back to 0dB if enabled. +

+
+
latency
+

Compensate the delay introduced by using the lookahead buffer set with attack +parameter. Also flush the valid audio data in the lookahead buffer when the +stream hits EOF. +

+
+ +

Depending on picked setting it is recommended to upsample input 2x or 4x times +with aresample before applying this filter. +

+
+
+

36.31 allpass

+ +

Apply a two-pole all-pass filter with central frequency (in Hz) +frequency, and filter-width width. +An all-pass filter changes the audio’s frequency to phase relationship +without changing its frequency to amplitude relationship. +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set frequency in Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
order, o
+

Set the filter order, can be 1 or 2. Default is 2. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+
+
+ + +
+

36.31.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change allpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change allpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change allpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change allpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

36.32 aloop

+ +

Loop audio samples. +

+

The filter accepts the following options: +

+
+
loop
+

Set the number of loops. Setting this value to -1 will result in infinite loops. +Default is 0. +

+
+
size
+

Set maximal number of samples. Default is 0. +

+
+
start
+

Set first sample of loop. Default is 0. +

+
+
time
+

Set the time of loop start in seconds. +Only used if option named start is set to -1. +

+
+ +
+
+

36.33 amerge

+ +

Merge two or more audio streams into a single multi-channel stream. +

+

The filter accepts the following options: +

+
+
inputs
+

Set the number of inputs. Default is 2. +

+
+
+ +

If the channel layouts of the inputs are disjoint, and therefore compatible, +the channel layout of the output will be set accordingly and the channels +will be reordered as necessary. If the channel layouts of the inputs are not +disjoint, the output will have all the channels of the first input then all +the channels of the second input, in that order, and the channel layout of +the output will be the default value corresponding to the total number of +channels. +

+

For example, if the first input is in 2.1 (FL+FR+LF) and the second input +is FC+BL+BR, then the output will be in 5.1, with the channels in the +following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the +first input, b1 is the first channel of the second input). +

+

On the other hand, if both input are in stereo, the output channels will be +in the default order: a1, a2, b1, b2, and the channel layout will be +arbitrarily set to 4.0, which may or may not be the expected value. +

+

All inputs must have the same sample rate, and format. +

+

If inputs do not have the same duration, the output will stop with the +shortest. +

+ +
+

36.33.1 Examples

+ +
    +
  • Merge two mono files into a stereo stream: +
    +
    amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
    +
    + +
  • Multiple merges assuming 1 video stream and 6 audio streams in input.mkv: +
    +
    ffmpeg -i input.mkv -filter_complex "[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6" -c:a pcm_s16le output.mkv
    +
    +
+ +
+
+
+

36.34 amix

+ +

Mixes multiple audio inputs into a single output. +

+

Note that this filter only supports float samples (the amerge +and pan audio filters support many formats). If the amix +input has integer samples then aresample will be automatically +inserted to perform the conversion to float samples. +

+

It accepts the following parameters: +

+
inputs
+

The number of inputs. If unspecified, it defaults to 2. +

+
+
duration
+

How to determine the end-of-stream. +

+
longest
+

The duration of the longest input. (default) +

+
+
shortest
+

The duration of the shortest input. +

+
+
first
+

The duration of the first input. +

+
+
+ +
+
dropout_transition
+

The transition time, in seconds, for volume renormalization when an input +stream ends. The default value is 2 seconds. +

+
+
weights
+

Specify weight of each input audio stream as a sequence of numbers separated +by a space. If fewer weights are specified compared to number of inputs, the +last weight is assigned to the remaining inputs. +Default weight for each input is 1. +

+
+
normalize
+

Always scale inputs instead of only doing summation of samples. +Beware of heavy clipping if inputs are not normalized prior or after filtering +by this filter if this option is disabled. By default is enabled. +

+
+ + +
+

36.34.1 Examples

+ +
    +
  • This will mix 3 input audio streams to a single output with the same duration as the +first input and a dropout transition time of 3 seconds: +
    +
    ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
    +
    + +
  • This will mix one vocal and one music input audio stream to a single output with the same duration as the +longest input. The music will have quarter the weight as the vocals, and the inputs are not normalized: +
    +
    ffmpeg -i VOCALS -i MUSIC -filter_complex amix=inputs=2:duration=longest:dropout_transition=0:weights="1 0.25":normalize=0 OUTPUT
    +
    + +
+ +
+
+

36.34.2 Commands

+ +

This filter supports the following commands: +

+
weights
+
normalize
+

Syntax is same as option with same name. +

+
+ +
+
+
+

36.35 amultiply

+ +

Multiply first audio stream with second audio stream and store result +in output audio stream. Multiplication is done by multiplying each +sample from first stream with sample at same position from second stream. +

+

With this element-wise multiplication one can create amplitude fades and +amplitude modulations. +

+
+
+

36.36 anequalizer

+ +

High-order parametric multiband equalizer for each channel. +

+

It accepts the following parameters: +

+
params
+
+

This option string is in format: +"cchn f=cf w=w g=g t=f | ..." +Each equalizer band is separated by ’|’. +

+
+
chn
+

Set channel number to which equalization will be applied. +If input doesn’t have that channel the entry is ignored. +

+
+
f
+

Set central frequency for band. +If input doesn’t have that frequency the entry is ignored. +

+
+
w
+

Set band width in Hertz. +

+
+
g
+

Set band gain in dB. +

+
+
t
+

Set filter type for band, optional, can be: +

+
+
0
+

Butterworth, this is default. +

+
+
1
+

Chebyshev type 1. +

+
+
2
+

Chebyshev type 2. +

+
+
+
+ +
+
curves
+

With this option activated frequency response of anequalizer is displayed +in video stream. +

+
+
size
+

Set video stream size. Only useful if curves option is activated. +

+
+
mgain
+

Set max gain that will be displayed. Only useful if curves option is activated. +Setting this to a reasonable value makes it possible to display gain which is derived from +neighbour bands which are too close to each other and thus produce higher gain +when both are activated. +

+
+
fscale
+

Set frequency scale used to draw frequency response in video output. +Can be linear or logarithmic. Default is logarithmic. +

+
+
colors
+

Set color for each channel curve which is going to be displayed in video stream. +This is list of color names separated by space or by ’|’. +Unrecognised or missing colors will be replaced by white color. +

+
+ + +
+

36.36.1 Examples

+ +
    +
  • Lower gain by 10 of central frequency 200Hz and width 100 Hz +for first 2 channels using Chebyshev type 1 filter: +
    +
    anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
    +
    +
+ +
+
+

36.36.2 Commands

+ +

This filter supports the following commands: +

+
change
+

Alter existing filter parameters. +Syntax for the commands is : "fN|f=freq|w=width|g=gain" +

+

fN is existing filter number, starting from 0, if no such filter is available +error is returned. +freq set new frequency parameter. +width set new width parameter in Hertz. +gain set new gain parameter in dB. +

+

Full filter invocation with asendcmd may look like this: +asendcmd=c=’4.0 anequalizer change 0|f=200|w=50|g=1’,anequalizer=... +

+
+ +
+
+
+

36.37 anlmdn

+ +

Reduce broadband noise in audio samples using Non-Local Means algorithm. +

+

Each sample is adjusted by looking for other samples with similar contexts. This +context similarity is defined by comparing their surrounding patches of size +p. Patches are searched in an area of r around the sample. +

+

The filter accepts the following options: +

+
+
strength, s
+

Set denoising strength. Allowed range is from 0.00001 to 10000. Default value is 0.00001. +

+
+
patch, p
+

Set patch radius duration. Allowed range is from 1 to 100 milliseconds. +Default value is 2 milliseconds. +

+
+
research, r
+

Set research radius duration. Allowed range is from 2 to 300 milliseconds. +Default value is 6 milliseconds. +

+
+
output, o
+

Set the output mode. +

+

It accepts the following values: +

+
i
+

Pass input unchanged. +

+
+
o
+

Pass noise filtered out. +

+
+
n
+

Pass only noise. +

+

Default value is o. +

+
+ +
+
smooth, m
+

Set smooth factor. Default value is 11. Allowed range is from 1 to 1000. +

+
+ + +
+

36.37.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.38 anlmf, anlms

+

Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first audio stream using the second audio stream. +

+

This adaptive filter is used to mimic a desired filter by finding the filter coefficients that +relate to producing the least mean square of the error signal (difference between the desired, +2nd input audio stream and the actual signal, the 1st input audio stream). +

+

A description of the accepted options follows. +

+
+
order
+

Set filter order. +

+
+
mu
+

Set filter mu. +

+
+
eps
+

Set the filter eps. +

+
+
leakage
+

Set the filter leakage. +

+
+
out_mode
+

It accepts the following values: +

+
i
+

Pass the 1st input. +

+
+
d
+

Pass the 2nd input. +

+
+
o
+

Pass difference between desired, 2nd input and error signal estimate. +

+
+
n
+

Pass difference between input, 1st input and error signal estimate. +

+
+
e
+

Pass error signal estimated samples. +

+

Default value is o. +

+
+
+
+ + +
+

36.38.1 Examples

+ +
    +
  • One of many usages of this filter is noise reduction, input audio is filtered +with same samples that are delayed by fixed amount, one such example for stereo audio is: +
    +
    asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
    +
    +
+ +
+
+

36.38.2 Commands

+ +

This filter supports the same commands as options, excluding option order. +

+
+
+
+

36.39 anull

+ +

Pass the audio source unchanged to the output. +

+
+
+

36.40 apad

+ +

Pad the end of an audio stream with silence. +

+

This can be used together with ffmpeg -shortest to +extend audio streams to the same length as the video stream. +

+

A description of the accepted options follows. +

+
+
packet_size
+

Set silence packet size. Default value is 4096. +

+
+
pad_len
+

Set the number of samples of silence to add to the end. After the +value is reached, the stream is terminated. This option is mutually +exclusive with whole_len. +

+
+
whole_len
+

Set the minimum total number of samples in the output audio stream. If +the value is longer than the input audio length, silence is added to +the end, until the value is reached. This option is mutually exclusive +with pad_len. +

+
+
pad_dur
+

Specify the duration of samples of silence to add. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. Used only if set to non-negative value. +

+
+
whole_dur
+

Specify the minimum total duration in the output audio stream. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. Used only if set to non-negative value. If the value is longer than +the input audio length, silence is added to the end, until the value is reached. +This option is mutually exclusive with pad_dur +

+
+ +

If neither the pad_len nor the whole_len nor pad_dur +nor whole_dur option is set, the filter will add silence to the end of +the input stream indefinitely. +

+

Note that for ffmpeg 4.4 and earlier a zero pad_dur or +whole_dur also caused the filter to add silence indefinitely. +

+ +
+

36.40.1 Examples

+ +
    +
  • Add 1024 samples of silence to the end of the input: +
    +
    apad=pad_len=1024
    +
    + +
  • Make sure the audio output will contain at least 10000 samples, pad +the input with silence if required: +
    +
    apad=whole_len=10000
    +
    + +
  • Use ffmpeg to pad the audio input with silence, so that the +video stream will always result the shortest and will be converted +until the end in the output file when using the shortest +option: +
    +
    ffmpeg -i VIDEO -i AUDIO -filter_complex "[1:0]apad" -shortest OUTPUT
    +
    +
+ +
+
+
+

36.41 aphaser

+

Add a phasing effect to the input audio. +

+

A phaser filter creates series of peaks and troughs in the frequency spectrum. +The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect. +

+

A description of the accepted parameters follows. +

+
+
in_gain
+

Set input gain. Default is 0.4. +

+
+
out_gain
+

Set output gain. Default is 0.74 +

+
+
delay
+

Set delay in milliseconds. Default is 3.0. +

+
+
decay
+

Set decay. Default is 0.4. +

+
+
speed
+

Set modulation speed in Hz. Default is 0.5. +

+
+
type
+

Set modulation type. Default is triangular. +

+

It accepts the following values: +

+
triangular, t
+
sinusoidal, s
+
+
+
+ +
+
+

36.42 aphaseshift

+

Apply phase shift to input audio samples. +

+

The filter accepts the following options: +

+
+
shift
+

Specify phase shift. Allowed range is from -1.0 to 1.0. +Default value is 0.0. +

+
+
level
+

Set output gain applied to final output. Allowed range is from 0.0 to 1.0. +Default value is 1.0. +

+
+
order
+

Set filter order used for filtering. Allowed range is from 1 to 16. +Default value is 8. +

+
+ + +
+

36.42.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.43 apsyclip

+

Apply Psychoacoustic clipper to input audio stream. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
level_out
+

Set output gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
clip
+

Set the clipping start value. Default value is 0dBFS or 1. +

+
+
diff
+

Output only difference samples, useful to hear introduced distortions. +By default is disabled. +

+
+
adaptive
+

Set strength of adaptive distortion applied. Default value is 0.5. +Allowed range is from 0 to 1. +

+
+
iterations
+

Set number of iterations of psychoacoustic clipper. +Allowed range is from 1 to 20. Default value is 10. +

+
+
level
+

Auto level output signal. Default is disabled. +This normalizes audio back to 0dBFS if enabled. +

+
+ + +
+

36.43.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.44 apulsator

+ +

Audio pulsator is something between an autopanner and a tremolo. +But it can produce funny stereo effects as well. Pulsator changes the volume +of the left and right channel based on a LFO (low frequency oscillator) with +different waveforms and shifted phases. +This filter have the ability to define an offset between left and right +channel. An offset of 0 means that both LFO shapes match each other. +The left and right channel are altered equally - a conventional tremolo. +An offset of 50% means that the shape of the right channel is exactly shifted +in phase (or moved backwards about half of the frequency) - pulsator acts as +an autopanner. At 1 both curves match again. Every setting in between moves the +phase shift gapless between all stages and produces some "bypassing" sounds with +sine and triangle waveforms. The more you set the offset near 1 (starting from +the 0.5) the faster the signal passes from the left to the right speaker. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
level_out
+

Set output gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
mode
+

Set waveform shape the LFO will use. Can be one of: sine, triangle, square, +sawup or sawdown. Default is sine. +

+
+
amount
+

Set modulation. Define how much of original signal is affected by the LFO. +

+
+
offset_l
+

Set left channel offset. Default is 0. Allowed range is [0 - 1]. +

+
+
offset_r
+

Set right channel offset. Default is 0.5. Allowed range is [0 - 1]. +

+
+
width
+

Set pulse width. Default is 1. Allowed range is [0 - 2]. +

+
+
timing
+

Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz. +

+
+
bpm
+

Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing +is set to bpm. +

+
+
ms
+

Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing +is set to ms. +

+
+
hz
+

Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used +if timing is set to hz. +

+
+ +
+
+

36.45 aresample

+ +

Resample the input audio to the specified parameters, using the +libswresample library. If none are specified then the filter will +automatically convert between its input and output. +

+

This filter is also able to stretch/squeeze the audio data to make it match +the timestamps or to inject silence / cut out audio to make it match the +timestamps, do a combination of both or do neither. +

+

The filter accepts the syntax +[sample_rate:]resampler_options, where sample_rate +expresses a sample rate and resampler_options is a list of +key=value pairs, separated by ":". See the +(ffmpeg-resampler)"Resampler Options" section in the +ffmpeg-resampler(1) manual +for the complete list of supported options. +

+ +
+

36.45.1 Examples

+ +
    +
  • Resample the input audio to 44100Hz: +
    +
    aresample=44100
    +
    + +
  • Stretch/squeeze samples to the given timestamps, with a maximum of 1000 +samples per second compensation: +
    +
    aresample=async=1000
    +
    +
+ +
+
+
+

36.46 areverse

+ +

Reverse an audio clip. +

+

Warning: This filter requires memory to buffer the entire clip, so trimming +is suggested. +

+ +
+

36.46.1 Examples

+ +
    +
  • Take the first 5 seconds of a clip, and reverse it. +
    +
    atrim=end=5,areverse
    +
    +
+ +
+
+
+

36.47 arls

+

Apply Recursive Least Squares algorithm to the first audio stream using the second audio stream. +

+

This adaptive filter is used to mimic a desired filter by recursively finding the filter coefficients that +relate to producing the minimal weighted linear least squares cost function of the error signal (difference +between the desired, 2nd input audio stream and the actual signal, the 1st input audio stream). +

+

A description of the accepted options follows. +

+
+
order
+

Set the filter order. +

+
+
lambda
+

Set the forgetting factor. +

+
+
delta
+

Set the coefficient to initialize internal covariance matrix. +

+
+
out_mode
+

Set the filter output samples. It accepts the following values: +

+
i
+

Pass the 1st input. +

+
+
d
+

Pass the 2nd input. +

+
+
o
+

Pass difference between desired, 2nd input and error signal estimate. +

+
+
n
+

Pass difference between input, 1st input and error signal estimate. +

+
+
e
+

Pass error signal estimated samples. +

+

Default value is o. +

+
+
+
+ +
+
+

36.48 arnndn

+ +

Reduce noise from speech using Recurrent Neural Networks. +

+

This filter accepts the following options: +

+
+
model, m
+

Set train model file to load. This option is always required. +

+
+
mix
+

Set how much to mix filtered samples into final output. +Allowed range is from -1 to 1. Default value is 1. +Negative values are special, they set how much to keep filtered noise +in the final filter output. Set this option to -1 to hear actual +noise removed from input signal. +

+
+ + +
+

36.48.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.49 asdr

+

Measure Audio Signal-to-Distortion Ratio. +

+

This filter takes two audio streams for input, and outputs first +audio stream. +Results are in dB per channel at end of either input. +

+
+
+

36.50 asetnsamples

+ +

Set the number of samples per each output audio frame. +

+

The last output packet may contain a different number of samples, as +the filter will flush all the remaining samples when the input audio +signals its end. +

+

The filter accepts the following options: +

+
+
nb_out_samples, n
+

Set the number of frames per each output audio frame. The number is +intended as the number of samples per each channel. +Default value is 1024. +

+
+
pad, p
+

If set to 1, the filter will pad the last audio frame with zeroes, so +that the last frame will contain the same number of samples as the +previous ones. Default value is 1. +

+
+ +

For example, to set the number of per-frame samples to 1234 and +disable padding for the last frame, use: +

+
asetnsamples=n=1234:p=0
+
+ +
+
+

36.51 asetrate

+ +

Set the sample rate without altering the PCM data. +This will result in a change of speed and pitch. +

+

The filter accepts the following options: +

+
+
sample_rate, r
+

Set the output sample rate. Default is 44100 Hz. +

+
+ +
+
+

36.52 ashowinfo

+ +

Show a line containing various information for each input audio frame. +The input audio is not modified. +

+

The shown line contains a sequence of key/value pairs of the form +key:value. +

+

The following values are shown in the output: +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +

+
+
pts
+

The presentation timestamp of the input frame, in time base units; the time base +depends on the filter input pad, and is usually 1/sample_rate. +

+
+
pts_time
+

The presentation timestamp of the input frame in seconds. +

+
+
fmt
+

The sample format. +

+
+
chlayout
+

The channel layout. +

+
+
rate
+

The sample rate for the audio frame. +

+
+
nb_samples
+

The number of samples (per channel) in the frame. +

+
+
checksum
+

The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar +audio, the data is treated as if all the planes were concatenated. +

+
+
plane_checksums
+

A list of Adler-32 checksums for each data plane. +

+
+ +
+
+

36.53 asoftclip

+

Apply audio soft clipping. +

+

Soft clipping is a type of distortion effect where the amplitude of a signal is saturated +along a smooth curve, rather than the abrupt shape of hard-clipping. +

+

This filter accepts the following options: +

+
+
type
+

Set type of soft-clipping. +

+

It accepts the following values: +

+
hard
+
tanh
+
atan
+
cubic
+
exp
+
alg
+
quintic
+
sin
+
erf
+
+ +
+
threshold
+

Set threshold from where to start clipping. Default value is 0dB or 1. +

+
+
output
+

Set gain applied to output. Default value is 0dB or 1. +

+
+
param
+

Set additional parameter which controls sigmoid function. +

+
+
oversample
+

Set oversampling factor. +

+
+ + +
+

36.53.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.54 aspectralstats

+ +

Display frequency domain statistical information about the audio channels. +Statistics are calculated and stored as metadata for each audio channel and for each audio frame. +

+

It accepts the following option: +

+
win_size
+

Set the window length in samples. Default value is 2048. +Allowed range is from 32 to 65536. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann, hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hann. +

+
+
overlap
+

Set window overlap. Allowed range is from 0 +to 1. Default value is 0.5. +

+
+
measure
+

Select the parameters which are measured. The metadata keys can +be used as flags, default is all which measures everything. +none disables all measurement. +

+
+ +

A list of each metadata key follows: +

+
+
mean
+
variance
+
centroid
+
spread
+
skewness
+
kurtosis
+
entropy
+
flatness
+
crest
+
flux
+
slope
+
decrease
+
rolloff
+
+ +
+
+

36.55 asr

+

Automatic Speech Recognition +

+

This filter uses PocketSphinx for speech recognition. To enable +compilation of this filter, you need to configure FFmpeg with +--enable-pocketsphinx. +

+

It accepts the following options: +

+
+
rate
+

Set sampling rate of input audio. Defaults is 16000. +This need to match speech models, otherwise one will get poor results. +

+
+
hmm
+

Set dictionary containing acoustic model files. +

+
+
dict
+

Set pronunciation dictionary. +

+
+
lm
+

Set language model file. +

+
+
lmctl
+

Set language model set. +

+
+
lmname
+

Set which language model to use. +

+
+
logfn
+

Set output for log messages. +

+
+ +

The filter exports recognized speech as the frame metadata lavfi.asr.text. +

+
+
+

36.56 astats

+ +

Display time domain statistical information about the audio channels. +Statistics are calculated and displayed for each audio channel and, +where applicable, an overall figure is also given. +

+

It accepts the following option: +

+
length
+

Short window length in seconds, used for peak and trough RMS measurement. +Default is 0.05 (50 milliseconds). Allowed range is [0 - 10]. +

+
+
metadata
+
+

Set metadata injection. All the metadata keys are prefixed with lavfi.astats.X, +where X is channel number starting from 1 or string Overall. Default is +disabled. +

+

Available keys for each channel are: +Bit_depth +Crest_factor +DC_offset +Dynamic_range +Entropy +Flat_factor +Max_difference +Max_level +Mean_difference +Min_difference +Min_level +Noise_floor +Noise_floor_count +Number_of_Infs +Number_of_NaNs +Number_of_denormals +Peak_count +Peak_level +RMS_difference +RMS_peak +RMS_trough +Zero_crossings +Zero_crossings_rate +

+

and for Overall: +Bit_depth +DC_offset +Entropy +Flat_factor +Max_difference +Max_level +Mean_difference +Min_difference +Min_level +Noise_floor +Noise_floor_count +Number_of_Infs +Number_of_NaNs +Number_of_denormals +Number_of_samples +Peak_count +Peak_level +RMS_difference +RMS_level +RMS_peak +RMS_trough +

+

For example, a full key looks like lavfi.astats.1.DC_offset or +lavfi.astats.Overall.Peak_count. +

+

Read below for the description of the keys. +

+
+
reset
+

Set the number of frames over which cumulative stats are calculated before +being reset. Default is disabled. +

+
+
measure_perchannel
+

Select the parameters which are measured per channel. The metadata keys can +be used as flags, default is all which measures everything. +none disables all per channel measurement. +

+
+
measure_overall
+

Select the parameters which are measured overall. The metadata keys can +be used as flags, default is all which measures everything. +none disables all overall measurement. +

+
+
+ +

A description of the measure keys follow: +

+
+
none
+

no measures +

+
+
all
+

all measures +

+
+
Bit_depth
+

overall bit depth of audio, i.e. number of bits used for each sample +

+
+
Crest_factor
+

standard ratio of peak to RMS level (note: not in dB) +

+
+
DC_offset
+

mean amplitude displacement from zero +

+
+
Dynamic_range
+

measured dynamic range of audio in dB +

+
+
Entropy
+

entropy measured across whole audio, entropy of value near 1.0 is typically measured for white noise +

+
+
Flat_factor
+

flatness (i.e. consecutive samples with the same value) of the signal at its peak levels +(i.e. either Min_level or Max_level) +

+
+
Max_difference
+

maximal difference between two consecutive samples +

+
+
Max_level
+

maximal sample level +

+
+
Mean_difference
+

mean difference between two consecutive samples, i.e. the average of each difference between two consecutive samples +

+
+
Min_difference
+

minimal difference between two consecutive samples +

+
+
Min_level
+

minimal sample level +

+
+
Noise_floor
+

minimum local peak measured in dBFS over a short window +

+
+
Noise_floor_count
+

number of occasions (not the number of samples) that the signal attained +Noise floor +

+
+
Number_of_Infs
+

number of samples with an infinite value +

+
+
Number_of_NaNs
+

number of samples with a NaN (not a number) value +

+
+
Number_of_denormals
+

number of samples with a subnormal value +

+
+
Number_of_samples
+

number of samples +

+
+
Peak_count
+

number of occasions (not the number of samples) that the signal attained either +Min_level or Max_level +

+
+
Peak_level
+

standard peak level measured in dBFS +

+
+
RMS_difference
+

Root Mean Square difference between two consecutive samples +

+
+
RMS_level
+

standard RMS level measured in dBFS +

+
+
RMS_peak
+
RMS_trough
+

peak and trough values for RMS level measured over a short window, +measured in dBFS. +

+
+
Zero crossings
+

number of points where the waveform crosses the zero level axis +

+
+
Zero crossings rate
+

rate of Zero crossings and number of audio samples +

+
+ +
+
+

36.57 asubboost

+

Boost subwoofer frequencies. +

+

The filter accepts the following options: +

+
+
dry
+

Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1. +Default value is 1.0. +

+
+
wet
+

Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1. +Default value is 1.0. +

+
+
boost
+

Set max boost factor. Allowed range is from 1 to 12. Default value is 2. +

+
+
decay
+

Set delay line decay gain value. Allowed range is from 0 to 1. +Default value is 0.0. +

+
+
feedback
+

Set delay line feedback gain value. Allowed range is from 0 to 1. +Default value is 0.9. +

+
+
cutoff
+

Set cutoff frequency in Hertz. Allowed range is 50 to 900. +Default value is 100. +

+
+
slope
+

Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1. +Default value is 0.5. +

+
+
delay
+

Set delay. Allowed range is from 1 to 100. +Default value is 20. +

+
+
channels
+

Set the channels to process. Default value is all available. +

+
+ + +
+

36.57.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.58 asubcut

+

Cut subwoofer frequencies. +

+

This filter allows to set custom, steeper +roll off than highpass filter, and thus is able to more attenuate +frequency content in stop-band. +

+

The filter accepts the following options: +

+
+
cutoff
+

Set cutoff frequency in Hertz. Allowed range is 2 to 200. +Default value is 20. +

+
+
order
+

Set filter order. Available values are from 3 to 20. +Default value is 10. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 1. Default value is 1. +

+
+ + +
+

36.58.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.59 asupercut

+

Cut super frequencies. +

+

The filter accepts the following options: +

+
+
cutoff
+

Set cutoff frequency in Hertz. Allowed range is 20000 to 192000. +Default value is 20000. +

+
+
order
+

Set filter order. Available values are from 3 to 20. +Default value is 10. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 1. Default value is 1. +

+
+ + +
+

36.59.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.60 asuperpass

+

Apply high order Butterworth band-pass filter. +

+

The filter accepts the following options: +

+
+
centerf
+

Set center frequency in Hertz. Allowed range is 2 to 999999. +Default value is 1000. +

+
+
order
+

Set filter order. Available values are from 4 to 20. +Default value is 4. +

+
+
qfactor
+

Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 2. Default value is 1. +

+
+ + +
+

36.60.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.61 asuperstop

+

Apply high order Butterworth band-stop filter. +

+

The filter accepts the following options: +

+
+
centerf
+

Set center frequency in Hertz. Allowed range is 2 to 999999. +Default value is 1000. +

+
+
order
+

Set filter order. Available values are from 4 to 20. +Default value is 4. +

+
+
qfactor
+

Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 2. Default value is 1. +

+
+ + +
+

36.61.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.62 atempo

+ +

Adjust audio tempo. +

+

The filter accepts exactly one parameter, the audio tempo. If not +specified then the filter will assume nominal 1.0 tempo. Tempo must +be in the [0.5, 100.0] range. +

+

Note that tempo greater than 2 will skip some samples rather than +blend them in. If for any reason this is a concern it is always +possible to daisy-chain several instances of atempo to achieve the +desired product tempo. +

+ +
+

36.62.1 Examples

+ +
    +
  • Slow down audio to 80% tempo: +
    +
    atempo=0.8
    +
    + +
  • To speed up audio to 300% tempo: +
    +
    atempo=3
    +
    + +
  • To speed up audio to 300% tempo by daisy-chaining two atempo instances: +
    +
    atempo=sqrt(3),atempo=sqrt(3)
    +
    +
+ +
+
+

36.62.2 Commands

+ +

This filter supports the following commands: +

+
tempo
+

Change filter tempo scale factor. +Syntax for the command is : "tempo" +

+
+ +
+
+
+

36.63 atilt

+

Apply spectral tilt filter to audio stream. +

+

This filter apply any spectral roll-off slope over any specified frequency band. +

+

The filter accepts the following options: +

+
+
freq
+

Set central frequency of tilt in Hz. Default is 10000 Hz. +

+
+
slope
+

Set slope direction of tilt. Default is 0. Allowed range is from -1 to 1. +

+
+
width
+

Set width of tilt. Default is 1000. Allowed range is from 100 to 10000. +

+
+
order
+

Set order of tilt filter. +

+
+
level
+

Set input volume level. Allowed range is from 0 to 4. +Defalt is 1. +

+
+ + +
+

36.63.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.64 atrim

+ +

Trim the input so that the output contains one continuous subpart of the input. +

+

It accepts the following parameters: +

+
start
+

Timestamp (in seconds) of the start of the section to keep. I.e. the audio +sample with the timestamp start will be the first sample in the output. +

+
+
end
+

Specify time of the first audio sample that will be dropped, i.e. the +audio sample immediately preceding the one with the timestamp end will be +the last sample in the output. +

+
+
start_pts
+

Same as start, except this option sets the start timestamp in samples +instead of seconds. +

+
+
end_pts
+

Same as end, except this option sets the end timestamp in samples instead +of seconds. +

+
+
duration
+

The maximum duration of the output in seconds. +

+
+
start_sample
+

The number of the first sample that should be output. +

+
+
end_sample
+

The number of the first sample that should be dropped. +

+
+ +

start, end, and duration are expressed as time +duration specifications; see +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

Note that the first two sets of the start/end options and the duration +option look at the frame timestamp, while the _sample options simply count the +samples that pass through the filter. So start/end_pts and start/end_sample will +give different results when the timestamps are wrong, inexact or do not start at +zero. Also note that this filter does not modify the timestamps. If you wish +to have the output timestamps start at zero, insert the asetpts filter after the +atrim filter. +

+

If multiple start or end options are set, this filter tries to be greedy and +keep all samples that match at least one of the specified constraints. To keep +only the part that matches all the constraints at once, chain multiple atrim +filters. +

+

The defaults are such that all the input is kept. So it is possible to set e.g. +just the end values to keep everything before the specified time. +

+

Examples: +

    +
  • Drop everything except the second minute of input: +
    +
    ffmpeg -i INPUT -af atrim=60:120
    +
    + +
  • Keep only the first 1000 samples: +
    +
    ffmpeg -i INPUT -af atrim=end_sample=1000
    +
    + +
+ +
+
+

36.65 axcorrelate

+

Calculate normalized windowed cross-correlation between two input audio streams. +

+

Resulted samples are always between -1 and 1 inclusive. +If result is 1 it means two input samples are highly correlated in that selected segment. +Result 0 means they are not correlated at all. +If result is -1 it means two input samples are out of phase, which means they cancel each +other. +

+

The filter accepts the following options: +

+
+
size
+

Set size of segment over which cross-correlation is calculated. +Default is 256. Allowed range is from 2 to 131072. +

+
+
algo
+

Set algorithm for cross-correlation. Can be slow or fast. +Default is slow. Fast algorithm assumes mean values over any given segment +are always zero and thus need much less calculations to make. +This is generally not true, but is valid for typical audio streams. +

+
+ + +
+

36.65.1 Examples

+ +
    +
  • Calculate correlation between channels in stereo audio stream: +
    +
    ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
    +
    +
+ +
+
+
+

36.66 bandpass

+ +

Apply a two-pole Butterworth band-pass filter with central +frequency frequency, and (3dB-point) band-width width. +The csg option selects a constant skirt gain (peak gain = Q) +instead of the default: constant 0dB peak gain. +The filter roll off at 6dB per octave (20dB per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the filter’s central frequency. Default is 3000. +

+
+
csg
+

Constant skirt gain if set to 1. Defaults to 0. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

36.66.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change bandpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change bandpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change bandpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change bandpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

36.67 bandreject

+ +

Apply a two-pole Butterworth band-reject filter with central +frequency frequency, and (3dB-point) band-width width. +The filter roll off at 6dB per octave (20dB per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the filter’s central frequency. Default is 3000. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

36.67.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change bandreject frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change bandreject width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change bandreject width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change bandreject mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

36.68 bass, lowshelf

+ +

Boost or cut the bass (lower) frequencies of the audio using a two-pole +shelving filter with a response similar to that of a standard +hi-fi’s tone-controls. This is also known as shelving equalisation (EQ). +

+

The filter accepts the following options: +

+
+
gain, g
+

Give the gain at 0 Hz. Its useful range is about -20 +(for a large cut) to +20 (for a large boost). +Beware of clipping when using a positive gain. +

+
+
frequency, f
+

Set the filter’s central frequency and so can be used +to extend or reduce the frequency range to be boosted or cut. +The default value is 100 Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Determine how steep is the filter’s shelf transition. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

36.68.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change bass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change bass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change bass width. +Syntax for the command is : "width" +

+
+
gain, g
+

Change bass gain. +Syntax for the command is : "gain" +

+
+
mix, m
+

Change bass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

36.69 biquad

+ +

Apply a biquad IIR filter with the given coefficients. +Where b0, b1, b2 and a0, a1, a2 +are the numerator and denominator coefficients respectively. +and channels, c specify which channels to filter, by default all +available are filtered. +

+ +
+

36.69.1 Commands

+ +

This filter supports the following commands: +

+
a0
+
a1
+
a2
+
b0
+
b1
+
b2
+

Change biquad parameter. +Syntax for the command is : "value" +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ +
+
+
+

36.70 bs2b

+

Bauer stereo to binaural transformation, which improves headphone listening of +stereo audio records. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libbs2b. +

+

It accepts the following parameters: +

+
profile
+

Pre-defined crossfeed level. +

+
default
+

Default level (fcut=700, feed=50). +

+
+
cmoy
+

Chu Moy circuit (fcut=700, feed=60). +

+
+
jmeier
+

Jan Meier circuit (fcut=650, feed=95). +

+
+
+ +
+
fcut
+

Cut frequency (in Hz). +

+
+
feed
+

Feed level (in Hz). +

+
+
+ +
+
+

36.71 channelmap

+ +

Remap input channels to new locations. +

+

It accepts the following parameters: +

+
map
+

Map channels from input to output. The argument is a ’|’-separated list of +mappings, each in the in_channel-out_channel or +in_channel form. in_channel can be either the name of the input +channel (e.g. FL for front left) or its index in the input channel layout. +out_channel is the name of the output channel or its index in the output +channel layout. If out_channel is not given then it is implicitly an +index, starting with zero and increasing by one for each mapping. +

+
+
channel_layout
+

The channel layout of the output stream. +

+
+ +

If no mapping is present, the filter will implicitly map input channels to +output channels, preserving indices. +

+ +
+

36.71.1 Examples

+ +
    +
  • For example, assuming a 5.1+downmix input MOV file, +
    +
    ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
    +
    +

    will create an output WAV file tagged as stereo from the downmix channels of +the input. +

    +
  • To fix a 5.1 WAV improperly encoded in AAC’s native channel order +
    +
    ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
    +
    +
+ +
+
+
+

36.72 channelsplit

+ +

Split each channel from an input audio stream into a separate output stream. +

+

It accepts the following parameters: +

+
channel_layout
+

The channel layout of the input stream. The default is "stereo". +

+
channels
+

A channel layout describing the channels to be extracted as separate output streams +or "all" to extract each input channel as a separate stream. The default is "all". +

+

Choosing channels not present in channel layout in the input will result in an error. +

+
+ + +
+

36.72.1 Examples

+ +
    +
  • For example, assuming a stereo input MP3 file, +
    +
    ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
    +
    +

    will create an output Matroska file with two audio streams, one containing only +the left channel and the other the right channel. +

    +
  • Split a 5.1 WAV file into per-channel files: +
    +
    ffmpeg -i in.wav -filter_complex
    +'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
    +-map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
    +front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
    +side_right.wav
    +
    + +
  • Extract only LFE from a 5.1 WAV file: +
    +
    ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
    +-map '[LFE]' lfe.wav
    +
    +
+ +
+
+
+

36.73 chorus

+

Add a chorus effect to the audio. +

+

Can make a single vocal sound like a chorus, but can also be applied to instrumentation. +

+

Chorus resembles an echo effect with a short delay, but whereas with echo the delay is +constant, with chorus, it is varied using using sinusoidal or triangular modulation. +The modulation depth defines the range the modulated delay is played before or after +the delay. Hence the delayed sound will sound slower or faster, that is the delayed +sound tuned around the original one, like in a chorus where some vocals are slightly +off key. +

+

It accepts the following parameters: +

+
in_gain
+

Set input gain. Default is 0.4. +

+
+
out_gain
+

Set output gain. Default is 0.4. +

+
+
delays
+

Set delays. A typical delay is around 40ms to 60ms. +

+
+
decays
+

Set decays. +

+
+
speeds
+

Set speeds. +

+
+
depths
+

Set depths. +

+
+ + +
+

36.73.1 Examples

+ +
    +
  • A single delay: +
    +
    chorus=0.7:0.9:55:0.4:0.25:2
    +
    + +
  • Two delays: +
    +
    chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
    +
    + +
  • Fuller sounding chorus with three delays: +
    +
    chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3
    +
    +
+ +
+
+
+

36.74 compand

+

Compress or expand the audio’s dynamic range. +

+

It accepts the following parameters: +

+
+
attacks
+
decays
+

A list of times in seconds for each channel over which the instantaneous level +of the input signal is averaged to determine its volume. attacks refers to +increase of volume and decays refers to decrease of volume. For most +situations, the attack time (response to the audio getting louder) should be +shorter than the decay time, because the human ear is more sensitive to sudden +loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and +a typical value for decay is 0.8 seconds. +If specified number of attacks & decays is lower than number of channels, the last +set attack/decay will be used for all remaining channels. +

+
+
points
+

A list of points for the transfer function, specified in dB relative to the +maximum possible signal amplitude. Each key points list must be defined using +the following syntax: x0/y0|x1/y1|x2/y2|.... or +x0/y0 x1/y1 x2/y2 .... +

+

The input values must be in strictly increasing order but the transfer function +does not have to be monotonically rising. The point 0/0 is assumed but +may be overridden (by 0/out-dBn). Typical values for the transfer +function are -70/-70|-60/-20|1/0. +

+
+
soft-knee
+

Set the curve radius in dB for all joints. It defaults to 0.01. +

+
+
gain
+

Set the additional gain in dB to be applied at all points on the transfer +function. This allows for easy adjustment of the overall gain. +It defaults to 0. +

+
+
volume
+

Set an initial volume, in dB, to be assumed for each channel when filtering +starts. This permits the user to supply a nominal level initially, so that, for +example, a very large gain is not applied to initial signal levels before the +companding has begun to operate. A typical value for audio which is initially +quiet is -90 dB. It defaults to 0. +

+
+
delay
+

Set a delay, in seconds. The input audio is analyzed immediately, but audio is +delayed before being fed to the volume adjuster. Specifying a delay +approximately equal to the attack/decay times allows the filter to effectively +operate in predictive rather than reactive mode. It defaults to 0. +

+
+
+ + +
+

36.74.1 Examples

+ +
    +
  • Make music with both quiet and loud passages suitable for listening to in a +noisy environment: +
    +
    compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
    +
    + +

    Another example for audio with whisper and explosion parts: +

    +
    compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
    +
    + +
  • A noise gate for when the noise is at a lower level than the signal: +
    +
    compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
    +
    + +
  • Here is another noise gate, this time for when the noise is at a higher level +than the signal (making it, in some ways, similar to squelch): +
    +
    compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
    +
    + +
  • 2:1 compression starting at -6dB: +
    +
    compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
    +
    + +
  • 2:1 compression starting at -9dB: +
    +
    compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
    +
    + +
  • 2:1 compression starting at -12dB: +
    +
    compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
    +
    + +
  • 2:1 compression starting at -18dB: +
    +
    compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
    +
    + +
  • 3:1 compression starting at -15dB: +
    +
    compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
    +
    + +
  • Compressor/Gate: +
    +
    compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
    +
    + +
  • Expander: +
    +
    compand=attacks=0:points=-80/-169|-54/-80|-49.5/-64.6|-41.1/-41.1|-25.8/-15|-10.8/-4.5|0/0|20/8.3
    +
    + +
  • Hard limiter at -6dB: +
    +
    compand=attacks=0:points=-80/-80|-6/-6|20/-6
    +
    + +
  • Hard limiter at -12dB: +
    +
    compand=attacks=0:points=-80/-80|-12/-12|20/-12
    +
    + +
  • Hard noise gate at -35 dB: +
    +
    compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
    +
    + +
  • Soft limiter: +
    +
    compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
    +
    +
+ +
+
+
+

36.75 compensationdelay

+ +

Compensation Delay Line is a metric based delay to compensate differing +positions of microphones or speakers. +

+

For example, you have recorded guitar with two microphones placed in +different locations. Because the front of sound wave has fixed speed in +normal conditions, the phasing of microphones can vary and depends on +their location and interposition. The best sound mix can be achieved when +these microphones are in phase (synchronized). Note that a distance of +~30 cm between microphones makes one microphone capture the signal in +antiphase to the other microphone. That makes the final mix sound moody. +This filter helps to solve phasing problems by adding different delays +to each microphone track and make them synchronized. +

+

The best result can be reached when you take one track as base and +synchronize other tracks one by one with it. +Remember that synchronization/delay tolerance depends on sample rate, too. +Higher sample rates will give more tolerance. +

+

The filter accepts the following parameters: +

+
+
mm
+

Set millimeters distance. This is compensation distance for fine tuning. +Default is 0. +

+
+
cm
+

Set cm distance. This is compensation distance for tightening distance setup. +Default is 0. +

+
+
m
+

Set meters distance. This is compensation distance for hard distance setup. +Default is 0. +

+
+
dry
+

Set dry amount. Amount of unprocessed (dry) signal. +Default is 0. +

+
+
wet
+

Set wet amount. Amount of processed (wet) signal. +Default is 1. +

+
+
temp
+

Set temperature in degrees Celsius. This is the temperature of the environment. +Default is 20. +

+
+ + +
+

36.75.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.76 crossfeed

+

Apply headphone crossfeed filter. +

+

Crossfeed is the process of blending the left and right channels of stereo +audio recording. +It is mainly used to reduce extreme stereo separation of low frequencies. +

+

The intent is to produce more speaker like sound to the listener. +

+

The filter accepts the following options: +

+
+
strength
+

Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1. +This sets gain of low shelf filter for side part of stereo image. +Default is -6dB. Max allowed is -30db when strength is set to 1. +

+
+
range
+

Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1. +This sets cut off frequency of low shelf filter. Default is cut off near +1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz. +

+
+
slope
+

Set curve slope of low shelf filter. Default is 0.5. +Allowed range is from 0.01 to 1. +

+
+
level_in
+

Set input gain. Default is 0.9. +

+
+
level_out
+

Set output gain. Default is 1. +

+
+
block_size
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

36.76.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.77 crystalizer

+

Simple algorithm for audio noise sharpening. +

+

This filter linearly increases differences betweeen each audio sample. +

+

The filter accepts the following options: +

+
+
i
+

Sets the intensity of effect (default: 2.0). Must be in range between -10.0 to 0 +(unchanged sound) to 10.0 (maximum effect). +To inverse filtering use negative value. +

+
+
c
+

Enable clipping. By default is enabled. +

+
+ + +
+

36.77.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.78 dcshift

+

Apply a DC shift to the audio. +

+

This can be useful to remove a DC offset (caused perhaps by a hardware problem +in the recording chain) from the audio. The effect of a DC offset is reduced +headroom and hence volume. The astats filter can be used to determine if +a signal has a DC offset. +

+
+
shift
+

Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift +the audio. +

+
+
limitergain
+

Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is +used to prevent clipping. +

+
+ +
+
+

36.79 deesser

+ +

Apply de-essing to the audio samples. +

+
+
i
+

Set intensity for triggering de-essing. Allowed range is from 0 to 1. +Default is 0. +

+
+
m
+

Set amount of ducking on treble part of sound. Allowed range is from 0 to 1. +Default is 0.5. +

+
+
f
+

How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1. +Default is 0.5. +

+
+
s
+

Set the output mode. +

+

It accepts the following values: +

+
i
+

Pass input unchanged. +

+
+
o
+

Pass ess filtered out. +

+
+
e
+

Pass only ess. +

+

Default value is o. +

+
+ +
+
+ +
+
+

36.80 dialoguenhance

+

Enhance dialogue in stereo audio. +

+

This filter accepts stereo input and produce surround (3.0) channels output. +The newly produced front center channel have enhanced speech dialogue originally +available in both stereo channels. +This filter outputs front left and front right channels same as available in stereo input. +

+

The filter accepts the following options: +

+
+
original
+

Set the original center factor to keep in front center channel output. +Allowed range is from 0 to 1. Default value is 1. +

+
+
enhance
+

Set the dialogue enhance factor to put in front center channel output. +Allowed range is from 0 to 3. Default value is 1. +

+
+
voice
+

Set the voice detection factor. +Allowed range is from 2 to 32. Default value is 2. +

+
+ + +
+

36.80.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.81 drmeter

+

Measure audio dynamic range. +

+

DR values of 14 and higher is found in very dynamic material. DR of 8 to 13 +is found in transition material. And anything less that 8 have very poor dynamics +and is very compressed. +

+

The filter accepts the following options: +

+
+
length
+

Set window length in seconds used to split audio into segments of equal length. +Default is 3 seconds. +

+
+ +
+
+

36.82 dynaudnorm

+

Dynamic Audio Normalizer. +

+

This filter applies a certain amount of gain to the input audio in order +to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in +contrast to more "simple" normalization algorithms, the Dynamic Audio +Normalizer *dynamically* re-adjusts the gain factor to the input audio. +This allows for applying extra gain to the "quiet" sections of the audio +while avoiding distortions or clipping the "loud" sections. In other words: +The Dynamic Audio Normalizer will "even out" the volume of quiet and loud +sections, in the sense that the volume of each section is brought to the +same target level. Note, however, that the Dynamic Audio Normalizer achieves +this goal *without* applying "dynamic range compressing". It will retain 100% +of the dynamic range *within* each section of the audio file. +

+
+
framelen, f
+

Set the frame length in milliseconds. In range from 10 to 8000 milliseconds. +Default is 500 milliseconds. +The Dynamic Audio Normalizer processes the input audio in small chunks, +referred to as frames. This is required, because a peak magnitude has no +meaning for just a single sample value. Instead, we need to determine the +peak magnitude for a contiguous sequence of sample values. While a "standard" +normalizer would simply use the peak magnitude of the complete file, the +Dynamic Audio Normalizer determines the peak magnitude individually for each +frame. The length of a frame is specified in milliseconds. By default, the +Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has +been found to give good results with most files. +Note that the exact frame length, in number of samples, will be determined +automatically, based on the sampling rate of the individual input audio file. +

+
+
gausssize, g
+

Set the Gaussian filter window size. In range from 3 to 301, must be odd +number. Default is 31. +Probably the most important parameter of the Dynamic Audio Normalizer is the +window size of the Gaussian smoothing filter. The filter’s window size +is specified in frames, centered around the current frame. For the sake of +simplicity, this must be an odd number. Consequently, the default value of 31 +takes into account the current frame, as well as the 15 preceding frames and +the 15 subsequent frames. Using a larger window results in a stronger +smoothing effect and thus in less gain variation, i.e. slower gain +adaptation. Conversely, using a smaller window results in a weaker smoothing +effect and thus in more gain variation, i.e. faster gain adaptation. +In other words, the more you increase this value, the more the Dynamic Audio +Normalizer will behave like a "traditional" normalization filter. On the +contrary, the more you decrease this value, the more the Dynamic Audio +Normalizer will behave like a dynamic range compressor. +

+
+
peak, p
+

Set the target peak value. This specifies the highest permissible magnitude +level for the normalized audio input. This filter will try to approach the +target peak magnitude as closely as possible, but at the same time it also +makes sure that the normalized signal will never exceed the peak magnitude. +A frame’s maximum local gain factor is imposed directly by the target peak +magnitude. The default value is 0.95 and thus leaves a headroom of 5%*. +It is not recommended to go above this value. +

+
+
maxgain, m
+

Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0. +The Dynamic Audio Normalizer determines the maximum possible (local) gain +factor for each input frame, i.e. the maximum gain factor that does not +result in clipping or distortion. The maximum gain factor is determined by +the frame’s highest magnitude sample. However, the Dynamic Audio Normalizer +additionally bounds the frame’s maximum gain factor by a predetermined +(global) maximum gain factor. This is done in order to avoid excessive gain +factors in "silent" or almost silent frames. By default, the maximum gain +factor is 10.0, For most inputs the default value should be sufficient and +it usually is not recommended to increase this value. Though, for input +with an extremely low overall volume level, it may be necessary to allow even +higher gain factors. Note, however, that the Dynamic Audio Normalizer does +not simply apply a "hard" threshold (i.e. cut off values above the threshold). +Instead, a "sigmoid" threshold function will be applied. This way, the +gain factors will smoothly approach the threshold value, but never exceed that +value. +

+
+
targetrms, r
+

Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled. +By default, the Dynamic Audio Normalizer performs "peak" normalization. +This means that the maximum local gain factor for each frame is defined +(only) by the frame’s highest magnitude sample. This way, the samples can +be amplified as much as possible without exceeding the maximum signal +level, i.e. without clipping. Optionally, however, the Dynamic Audio +Normalizer can also take into account the frame’s root mean square, +abbreviated RMS. In electrical engineering, the RMS is commonly used to +determine the power of a time-varying signal. It is therefore considered +that the RMS is a better approximation of the "perceived loudness" than +just looking at the signal’s peak magnitude. Consequently, by adjusting all +frames to a constant RMS value, a uniform "perceived loudness" can be +established. If a target RMS value has been specified, a frame’s local gain +factor is defined as the factor that would result in exactly that RMS value. +Note, however, that the maximum local gain factor is still restricted by the +frame’s highest magnitude sample, in order to prevent clipping. +

+
+
coupling, n
+

Enable channels coupling. By default is enabled. +By default, the Dynamic Audio Normalizer will amplify all channels by the same +amount. This means the same gain factor will be applied to all channels, i.e. +the maximum possible gain factor is determined by the "loudest" channel. +However, in some recordings, it may happen that the volume of the different +channels is uneven, e.g. one channel may be "quieter" than the other one(s). +In this case, this option can be used to disable the channel coupling. This way, +the gain factor will be determined independently for each channel, depending +only on the individual channel’s highest magnitude sample. This allows for +harmonizing the volume of the different channels. +

+
+
correctdc, c
+

Enable DC bias correction. By default is disabled. +An audio signal (in the time domain) is a sequence of sample values. +In the Dynamic Audio Normalizer these sample values are represented in the +-1.0 to 1.0 range, regardless of the original input format. Normally, the +audio signal, or "waveform", should be centered around the zero point. +That means if we calculate the mean value of all samples in a file, or in a +single frame, then the result should be 0.0 or at least very close to that +value. If, however, there is a significant deviation of the mean value from +0.0, in either positive or negative direction, this is referred to as a +DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic +Audio Normalizer provides optional DC bias correction. +With DC bias correction enabled, the Dynamic Audio Normalizer will determine +the mean value, or "DC correction" offset, of each input frame and subtract +that value from all of the frame’s sample values which ensures those samples +are centered around 0.0 again. Also, in order to avoid "gaps" at the frame +boundaries, the DC correction offset values will be interpolated smoothly +between neighbouring frames. +

+
+
altboundary, b
+

Enable alternative boundary mode. By default is disabled. +The Dynamic Audio Normalizer takes into account a certain neighbourhood +around each frame. This includes the preceding frames as well as the +subsequent frames. However, for the "boundary" frames, located at the very +beginning and at the very end of the audio file, not all neighbouring +frames are available. In particular, for the first few frames in the audio +file, the preceding frames are not known. And, similarly, for the last few +frames in the audio file, the subsequent frames are not known. Thus, the +question arises which gain factors should be assumed for the missing frames +in the "boundary" region. The Dynamic Audio Normalizer implements two modes +to deal with this situation. The default boundary mode assumes a gain factor +of exactly 1.0 for the missing frames, resulting in a smooth "fade in" and +"fade out" at the beginning and at the end of the input, respectively. +

+
+
compress, s
+

Set the compress factor. In range from 0.0 to 30.0. Default is 0.0. +By default, the Dynamic Audio Normalizer does not apply "traditional" +compression. This means that signal peaks will not be pruned and thus the +full dynamic range will be retained within each local neighbourhood. However, +in some cases it may be desirable to combine the Dynamic Audio Normalizer’s +normalization algorithm with a more "traditional" compression. +For this purpose, the Dynamic Audio Normalizer provides an optional compression +(thresholding) function. If (and only if) the compression feature is enabled, +all input frames will be processed by a soft knee thresholding function prior +to the actual normalization process. Put simply, the thresholding function is +going to prune all samples whose magnitude exceeds a certain threshold value. +However, the Dynamic Audio Normalizer does not simply apply a fixed threshold +value. Instead, the threshold value will be adjusted for each individual +frame. +In general, smaller parameters result in stronger compression, and vice versa. +Values below 3.0 are not recommended, because audible distortion may appear. +

+
+
threshold, t
+

Set the target threshold value. This specifies the lowest permissible +magnitude level for the audio input which will be normalized. +If input frame volume is above this value frame will be normalized. +Otherwise frame may not be normalized at all. The default value is set +to 0, which means all input frames will be normalized. +This option is mostly useful if digital noise is not wanted to be amplified. +

+
+
channels, h
+

Specify which channels to filter, by default all available channels are filtered. +

+
+
overlap, o
+

Specify overlap for frames. If set to 0 (default) no frame overlapping is done. +Using >0 and <1 values will make less conservative gain adjustments, like +when framelen option is set to smaller value, if framelen option value is +compensated for non-zero overlap then gain adjustments will be smoother across time +compared to zero overlap case. +

+
+
curve, v
+

Specify the peak mapping curve expression which is going to be used when calculating +gain applied to frames. The max output frame gain will still be limited by other +options mentioned previously for this filter. +

+

The expression can contain the following constants: +

+
+
ch
+

current channel number +

+
+
sn
+

current sample number +

+
+
nb_channels
+

number of channels +

+
+
t
+

timestamp expressed in seconds +

+
+
sr
+

sample rate +

+
+
p
+

current frame peak value +

+
+
+
+ + +
+

36.82.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.83 earwax

+ +

Make audio easier to listen to on headphones. +

+

This filter adds ‘cues’ to 44.1kHz stereo (i.e. audio CD format) audio +so that when listened to on headphones the stereo image is moved from +inside your head (standard for headphones) to outside and in front of +the listener (standard for speakers). +

+

Ported from SoX. +

+
+
+

36.84 equalizer

+ +

Apply a two-pole peaking equalisation (EQ) filter. With this +filter, the signal-level at and around a selected frequency can +be increased or decreased, whilst (unlike bandpass and bandreject +filters) that at all other frequencies is unchanged. +

+

In order to produce complex equalisation curves, this filter can +be given several times, each with a different central frequency. +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the filter’s central frequency in Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
gain, g
+

Set the required gain or attenuation in dB. +Beware of clipping when using a positive gain. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

36.84.1 Examples

+
    +
  • Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz: +
    +
    equalizer=f=1000:t=h:width=200:g=-10
    +
    + +
  • Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2: +
    +
    equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
    +
    +
+ +
+
+

36.84.2 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change equalizer frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change equalizer width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change equalizer width. +Syntax for the command is : "width" +

+
+
gain, g
+

Change equalizer gain. +Syntax for the command is : "gain" +

+
+
mix, m
+

Change equalizer mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

36.85 extrastereo

+ +

Linearly increases the difference between left and right channels which +adds some sort of "live" effect to playback. +

+

The filter accepts the following options: +

+
+
m
+

Sets the difference coefficient (default: 2.5). 0.0 means mono sound +(average of both channels), with 1.0 sound will be unchanged, with +-1.0 left and right channels will be swapped. +

+
+
c
+

Enable clipping. By default is enabled. +

+
+ + +
+

36.85.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.86 firequalizer

+

Apply FIR Equalization using arbitrary frequency response. +

+

The filter accepts the following option: +

+
+
gain
+

Set gain curve equation (in dB). The expression can contain variables: +

+
f
+

the evaluated frequency +

+
sr
+

sample rate +

+
ch
+

channel number, set to 0 when multichannels evaluation is disabled +

+
chid
+

channel id, see libavutil/channel_layout.h, set to the first channel id when +multichannels evaluation is disabled +

+
chs
+

number of channels +

+
chlayout
+

channel_layout, see libavutil/channel_layout.h +

+
+
+

and functions: +

+
gain_interpolate(f)
+

interpolate gain on frequency f based on gain_entry +

+
cubic_interpolate(f)
+

same as gain_interpolate, but smoother +

+
+

This option is also available as command. Default is gain_interpolate(f). +

+
+
gain_entry
+

Set gain entry for gain_interpolate function. The expression can +contain functions: +

+
entry(f, g)
+

store gain entry at frequency f with value g +

+
+

This option is also available as command. +

+
+
delay
+

Set filter delay in seconds. Higher value means more accurate. +Default is 0.01. +

+
+
accuracy
+

Set filter accuracy in Hz. Lower value means more accurate. +Default is 5. +

+
+
wfunc
+

Set window function. Acceptable values are: +

+
rectangular
+

rectangular window, useful when gain curve is already smooth +

+
hann
+

hann window (default) +

+
hamming
+

hamming window +

+
blackman
+

blackman window +

+
nuttall3
+

3-terms continuous 1st derivative nuttall window +

+
mnuttall3
+

minimum 3-terms discontinuous nuttall window +

+
nuttall
+

4-terms continuous 1st derivative nuttall window +

+
bnuttall
+

minimum 4-terms discontinuous nuttall (blackman-nuttall) window +

+
bharris
+

blackman-harris window +

+
tukey
+

tukey window +

+
+ +
+
fixed
+

If enabled, use fixed number of audio samples. This improves speed when +filtering with large delay. Default is disabled. +

+
+
multi
+

Enable multichannels evaluation on gain. Default is disabled. +

+
+
zero_phase
+

Enable zero phase mode by subtracting timestamp to compensate delay. +Default is disabled. +

+
+
scale
+

Set scale used by gain. Acceptable values are: +

+
linlin
+

linear frequency, linear gain +

+
linlog
+

linear frequency, logarithmic (in dB) gain (default) +

+
loglin
+

logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain +

+
loglog
+

logarithmic frequency, logarithmic gain +

+
+ +
+
dumpfile
+

Set file for dumping, suitable for gnuplot. +

+
+
dumpscale
+

Set scale for dumpfile. Acceptable values are same with scale option. +Default is linlog. +

+
+
fft2
+

Enable 2-channel convolution using complex FFT. This improves speed significantly. +Default is disabled. +

+
+
min_phase
+

Enable minimum phase impulse response. Default is disabled. +

+
+ + +
+

36.86.1 Examples

+
    +
  • lowpass at 1000 Hz: +
    +
    firequalizer=gain='if(lt(f,1000), 0, -INF)'
    +
    +
  • lowpass at 1000 Hz with gain_entry: +
    +
    firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
    +
    +
  • custom equalization: +
    +
    firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
    +
    +
  • higher delay with zero phase to compensate delay: +
    +
    firequalizer=delay=0.1:fixed=on:zero_phase=on
    +
    +
  • lowpass on left channel, highpass on right channel: +
    +
    firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
    +:gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
    +
    +
+ +
+
+
+

36.87 flanger

+

Apply a flanging effect to the audio. +

+

The filter accepts the following options: +

+
+
delay
+

Set base delay in milliseconds. Range from 0 to 30. Default value is 0. +

+
+
depth
+

Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2. +

+
+
regen
+

Set percentage regeneration (delayed signal feedback). Range from -95 to 95. +Default value is 0. +

+
+
width
+

Set percentage of delayed signal mixed with original. Range from 0 to 100. +Default value is 71. +

+
+
speed
+

Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5. +

+
+
shape
+

Set swept wave shape, can be triangular or sinusoidal. +Default value is sinusoidal. +

+
+
phase
+

Set swept wave percentage-shift for multi channel. Range from 0 to 100. +Default value is 25. +

+
+
interp
+

Set delay-line interpolation, linear or quadratic. +Default is linear. +

+
+ +
+
+

36.88 haas

+

Apply Haas effect to audio. +

+

Note that this makes most sense to apply on mono signals. +With this filter applied to mono signals it give some directionality and +stretches its stereo image. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level. By default is 1, or 0dB +

+
+
level_out
+

Set output level. By default is 1, or 0dB. +

+
+
side_gain
+

Set gain applied to side part of signal. By default is 1. +

+
+
middle_source
+

Set kind of middle source. Can be one of the following: +

+
+
left
+

Pick left channel. +

+
+
right
+

Pick right channel. +

+
+
mid
+

Pick middle part signal of stereo image. +

+
+
side
+

Pick side part signal of stereo image. +

+
+ +
+
middle_phase
+

Change middle phase. By default is disabled. +

+
+
left_delay
+

Set left channel delay. By default is 2.05 milliseconds. +

+
+
left_balance
+

Set left channel balance. By default is -1. +

+
+
left_gain
+

Set left channel gain. By default is 1. +

+
+
left_phase
+

Change left phase. By default is disabled. +

+
+
right_delay
+

Set right channel delay. By defaults is 2.12 milliseconds. +

+
+
right_balance
+

Set right channel balance. By default is 1. +

+
+
right_gain
+

Set right channel gain. By default is 1. +

+
+
right_phase
+

Change right phase. By default is enabled. +

+
+ +
+
+

36.89 hdcd

+ +

Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with +embedded HDCD codes is expanded into a 20-bit PCM stream. +

+

The filter supports the Peak Extend and Low-level Gain Adjustment features +of HDCD, and detects the Transient Filter flag. +

+
+
ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
+
+ +

When using the filter with wav, note the default encoding for wav is 16-bit, +so the resulting 20-bit stream will be truncated back to 16-bit. Use something +like -acodec pcm_s24le after the filter to get 24-bit PCM output. +

+
ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
+ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
+
+ +

The filter accepts the following options: +

+
+
disable_autoconvert
+

Disable any automatic format conversion or resampling in the filter graph. +

+
+
process_stereo
+

Process the stereo channels together. If target_gain does not match between +channels, consider it invalid and use the last valid target_gain. +

+
+
cdt_ms
+

Set the code detect timer period in ms. +

+
+
force_pe
+

Always extend peaks above -3dBFS even if PE isn’t signaled. +

+
+
analyze_mode
+

Replace audio with a solid tone and adjust the amplitude to signal some +specific aspect of the decoding process. The output file can be loaded in +an audio editor alongside the original to aid analysis. +

+

analyze_mode=pe:force_pe=true can be used to see all samples above the PE level. +

+

Modes are: +

+
0, off
+

Disabled +

+
1, lle
+

Gain adjustment level at each sample +

+
2, pe
+

Samples where peak extend occurs +

+
3, cdt
+

Samples where the code detect timer is active +

+
4, tgm
+

Samples where the target gain does not match between channels +

+
+
+
+ +
+
+

36.90 headphone

+ +

Apply head-related transfer functions (HRTFs) to create virtual +loudspeakers around the user for binaural listening via headphones. +The HRIRs are provided via additional streams, for each channel +one stereo input stream is needed. +

+

The filter accepts the following options: +

+
+
map
+

Set mapping of input streams for convolution. +The argument is a ’|’-separated list of channel names in order as they +are given as additional stream inputs for filter. +This also specify number of input streams. Number of input streams +must be not less than number of channels in first stream plus one. +

+
+
gain
+

Set gain applied to audio. Value is in dB. Default is 0. +

+
+
type
+

Set processing type. Can be time or freq. time is +processing audio in time domain which is slow. +freq is processing audio in frequency domain which is fast. +Default is freq. +

+
+
lfe
+

Set custom gain for LFE channels. Value is in dB. Default is 0. +

+
+
size
+

Set size of frame in number of samples which will be processed at once. +Default value is 1024. Allowed range is from 1024 to 96000. +

+
+
hrir
+

Set format of hrir stream. +Default value is stereo. Alternative value is multich. +If value is set to stereo, number of additional streams should +be greater or equal to number of input channels in first input stream. +Also each additional stream should have stereo number of channels. +If value is set to multich, number of additional streams should +be exactly one. Also number of input channels of additional stream +should be equal or greater than twice number of channels of first input +stream. +

+
+ + +
+

36.90.1 Examples

+ +
    +
  • Full example using wav files as coefficients with amovie filters for 7.1 downmix, +each amovie filter use stereo file with IR coefficients as input. +The files give coefficients for each position of virtual loudspeaker: +
    +
    ffmpeg -i input.wav
    +-filter_complex "amovie=azi_270_ele_0_DFC.wav[sr];amovie=azi_90_ele_0_DFC.wav[sl];amovie=azi_225_ele_0_DFC.wav[br];amovie=azi_135_ele_0_DFC.wav[bl];amovie=azi_0_ele_0_DFC.wav,asplit[fc][lfe];amovie=azi_35_ele_0_DFC.wav[fl];amovie=azi_325_ele_0_DFC.wav[fr];[0:a][fl][fr][fc][lfe][bl][br][sl][sr]headphone=FL|FR|FC|LFE|BL|BR|SL|SR"
    +output.wav
    +
    + +
  • Full example using wav files as coefficients with amovie filters for 7.1 downmix, +but now in multich hrir format. +
    +
    ffmpeg -i input.wav -filter_complex "amovie=minp.wav[hrirs];[0:a][hrirs]headphone=map=FL|FR|FC|LFE|BL|BR|SL|SR:hrir=multich"
    +output.wav
    +
    +
+ +
+
+
+

36.91 highpass

+ +

Apply a high-pass filter with 3dB point frequency. +The filter can be either single-pole, or double-pole (the default). +The filter roll off at 6dB per pole per octave (20dB per pole per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set frequency in Hz. Default is 3000. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +Applies only to double-pole filter. +The default is 0.707q and gives a Butterworth response. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

36.91.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change highpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change highpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change highpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change highpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

36.92 join

+ +

Join multiple input streams into one multi-channel stream. +

+

It accepts the following parameters: +

+
inputs
+

The number of input streams. It defaults to 2. +

+
+
channel_layout
+

The desired output channel layout. It defaults to stereo. +

+
+
map
+

Map channels from inputs to output. The argument is a ’|’-separated list of +mappings, each in the input_idx.in_channel-out_channel +form. input_idx is the 0-based index of the input stream. in_channel +can be either the name of the input channel (e.g. FL for front left) or its +index in the specified input stream. out_channel is the name of the output +channel. +

+
+ +

The filter will attempt to guess the mappings when they are not specified +explicitly. It does so by first trying to find an unused matching input channel +and if that fails it picks the first unused input channel. +

+

Join 3 inputs (with properly set channel layouts): +

+
ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
+
+ +

Build a 5.1 output from 6 single-channel streams: +

+
ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
+'join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-SL|4.0-SR|5.0-LFE'
+out
+
+ +
+
+

36.93 ladspa

+ +

Load a LADSPA (Linux Audio Developer’s Simple Plugin API) plugin. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-ladspa. +

+
+
file, f
+

Specifies the name of LADSPA plugin library to load. If the environment +variable LADSPA_PATH is defined, the LADSPA plugin is searched in +each one of the directories specified by the colon separated list in +LADSPA_PATH, otherwise in the standard LADSPA paths, which are in +this order: HOME/.ladspa/lib/, /usr/local/lib/ladspa/, +/usr/lib/ladspa/. +

+
+
plugin, p
+

Specifies the plugin within the library. Some libraries contain only +one plugin, but others contain many of them. If this is not set filter +will list all available plugins within the specified library. +

+
+
controls, c
+

Set the ’|’ separated list of controls which are zero or more floating point +values that determine the behavior of the loaded plugin (for example delay, +threshold or gain). +Controls need to be defined using the following syntax: +c0=value0|c1=value1|c2=value2|..., where +valuei is the value set on the i-th control. +Alternatively they can be also defined using the following syntax: +value0|value1|value2|..., where +valuei is the value set on the i-th control. +If controls is set to help, all available controls and +their valid ranges are printed. +

+
+
sample_rate, s
+

Specify the sample rate, default to 44100. Only used if plugin have +zero inputs. +

+
+
nb_samples, n
+

Set the number of samples per channel per each output frame, default +is 1024. Only used if plugin have zero inputs. +

+
+
duration, d
+

Set the minimum duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +Note that the resulting duration may be greater than the specified duration, +as the generated audio is always cut at the end of a complete frame. +If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +Only used if plugin have zero inputs. +

+
+
latency, l
+

Enable latency compensation, by default is disabled. +Only used if plugin have inputs. +

+
+ + +
+

36.93.1 Examples

+ +
    +
  • List all available plugins within amp (LADSPA example plugin) library: +
    +
    ladspa=file=amp
    +
    + +
  • List all available controls and their valid ranges for vcf_notch +plugin from VCF library: +
    +
    ladspa=f=vcf:p=vcf_notch:c=help
    +
    + +
  • Simulate low quality audio equipment using Computer Music Toolkit (CMT) +plugin library: +
    +
    ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
    +
    + +
  • Add reverberation to the audio using TAP-plugins +(Tom’s Audio Processing plugins): +
    +
    ladspa=file=tap_reverb:tap_reverb
    +
    + +
  • Generate white noise, with 0.2 amplitude: +
    +
    ladspa=file=cmt:noise_source_white:c=c0=.2
    +
    + +
  • Generate 20 bpm clicks using plugin C* Click - Metronome from the +C* Audio Plugin Suite (CAPS) library: +
    +
    ladspa=file=caps:Click:c=c1=20'
    +
    + +
  • Apply C* Eq10X2 - Stereo 10-band equaliser effect: +
    +
    ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
    +
    + +
  • Increase volume by 20dB using fast lookahead limiter from Steve Harris +SWH Plugins collection: +
    +
    ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
    +
    + +
  • Attenuate low frequencies using Multiband EQ from Steve Harris +SWH Plugins collection: +
    +
    ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
    +
    + +
  • Reduce stereo image using Narrower from the C* Audio Plugin Suite +(CAPS) library: +
    +
    ladspa=caps:Narrower
    +
    + +
  • Another white noise, now using C* Audio Plugin Suite (CAPS) library: +
    +
    ladspa=caps:White:.2
    +
    + +
  • Some fractal noise, using C* Audio Plugin Suite (CAPS) library: +
    +
    ladspa=caps:Fractal:c=c1=1
    +
    + +
  • Dynamic volume normalization using VLevel plugin: +
    +
    ladspa=vlevel-ladspa:vlevel_mono
    +
    +
+ +
+
+

36.93.2 Commands

+ +

This filter supports the following commands: +

+
cN
+

Modify the N-th control value. +

+

If the specified value is not valid, it is ignored and prior one is kept. +

+
+ +
+
+
+

36.94 loudnorm

+ +

EBU R128 loudness normalization. Includes both dynamic and linear normalization modes. +Support for both single pass (livestreams, files) and double pass (files) modes. +This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately +detect true peaks, the audio stream will be upsampled to 192 kHz. +Use the -ar option or aresample filter to explicitly set an output sample rate. +

+

The filter accepts the following options: +

+
+
I, i
+

Set integrated loudness target. +Range is -70.0 - -5.0. Default value is -24.0. +

+
+
LRA, lra
+

Set loudness range target. +Range is 1.0 - 50.0. Default value is 7.0. +

+
+
TP, tp
+

Set maximum true peak. +Range is -9.0 - +0.0. Default value is -2.0. +

+
+
measured_I, measured_i
+

Measured IL of input file. +Range is -99.0 - +0.0. +

+
+
measured_LRA, measured_lra
+

Measured LRA of input file. +Range is 0.0 - 99.0. +

+
+
measured_TP, measured_tp
+

Measured true peak of input file. +Range is -99.0 - +99.0. +

+
+
measured_thresh
+

Measured threshold of input file. +Range is -99.0 - +0.0. +

+
+
offset
+

Set offset gain. Gain is applied before the true-peak limiter. +Range is -99.0 - +99.0. Default is +0.0. +

+
+
linear
+

Normalize by linearly scaling the source audio. +measured_I, measured_LRA, measured_TP, +and measured_thresh must all be specified. Target LRA shouldn’t +be lower than source LRA and the change in integrated loudness shouldn’t +result in a true peak which exceeds the target TP. If any of these +conditions aren’t met, normalization mode will revert to dynamic. +Options are true or false. Default is true. +

+
+
dual_mono
+

Treat mono input files as "dual-mono". If a mono file is intended for playback +on a stereo system, its EBU R128 measurement will be perceptually incorrect. +If set to true, this option will compensate for this effect. +Multi-channel input files are not affected by this option. +Options are true or false. Default is false. +

+
+
print_format
+

Set print format for stats. Options are summary, json, or none. +Default value is none. +

+
+ +
+
+

36.95 lowpass

+ +

Apply a low-pass filter with 3dB point frequency. +The filter can be either single-pole or double-pole (the default). +The filter roll off at 6dB per pole per octave (20dB per pole per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set frequency in Hz. Default is 500. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +Applies only to double-pole filter. +The default is 0.707q and gives a Butterworth response. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

36.95.1 Examples

+
    +
  • Lowpass only LFE channel, it LFE is not present it does nothing: +
    +
    lowpass=c=LFE
    +
    +
+ +
+
+

36.95.2 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change lowpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change lowpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change lowpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change lowpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

36.96 lv2

+ +

Load a LV2 (LADSPA Version 2) plugin. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-lv2. +

+
+
plugin, p
+

Specifies the plugin URI. You may need to escape ’:’. +

+
+
controls, c
+

Set the ’|’ separated list of controls which are zero or more floating point +values that determine the behavior of the loaded plugin (for example delay, +threshold or gain). +If controls is set to help, all available controls and +their valid ranges are printed. +

+
+
sample_rate, s
+

Specify the sample rate, default to 44100. Only used if plugin have +zero inputs. +

+
+
nb_samples, n
+

Set the number of samples per channel per each output frame, default +is 1024. Only used if plugin have zero inputs. +

+
+
duration, d
+

Set the minimum duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +Note that the resulting duration may be greater than the specified duration, +as the generated audio is always cut at the end of a complete frame. +If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +Only used if plugin have zero inputs. +

+
+ + +
+

36.96.1 Examples

+ +
    +
  • Apply bass enhancer plugin from Calf: +
    +
    lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
    +
    + +
  • Apply vinyl plugin from Calf: +
    +
    lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
    +
    + +
  • Apply bit crusher plugin from ArtyFX: +
    +
    lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
    +
    +
+ +
+
+

36.96.2 Commands

+ +

This filter supports all options that are exported by plugin as commands. +

+
+
+
+

36.97 mcompand

+

Multiband Compress or expand the audio’s dynamic range. +

+

The input audio is divided into bands using 4th order Linkwitz-Riley IIRs. +This is akin to the crossover of a loudspeaker, and results in flat frequency +response when absent compander action. +

+

It accepts the following parameters: +

+
+
args
+

This option syntax is: +attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ... +For explanation of each item refer to compand filter documentation. +

+
+ +
+
+

36.98 pan

+ +

Mix channels with specific gain levels. The filter accepts the output +channel layout followed by a set of channels definitions. +

+

This filter is also designed to efficiently remap the channels of an audio +stream. +

+

The filter accepts parameters of the form: +"l|outdef|outdef|..." +

+
+
l
+

output channel layout or number of channels +

+
+
outdef
+

output channel specification, of the form: +"out_name=[gain*]in_name[(+-)[gain*]in_name...]" +

+
+
out_name
+

output channel to define, either a channel name (FL, FR, etc.) or a channel +number (c0, c1, etc.) +

+
+
gain
+

multiplicative coefficient for the channel, 1 leaving the volume unchanged +

+
+
in_name
+

input channel to use, see out_name for details; it is not possible to mix +named and numbered input channels +

+
+ +

If the ‘=’ in a channel specification is replaced by ‘<’, then the gains for +that specification will be renormalized so that the total is 1, thus +avoiding clipping noise. +

+ +
+

36.98.1 Mixing examples

+ +

For example, if you want to down-mix from stereo to mono, but with a bigger +factor for the left channel: +

+
pan=1c|c0=0.9*c0+0.1*c1
+
+ +

A customized down-mix to stereo that works automatically for 3-, 4-, 5- and +7-channels surround: +

+
pan=stereo| FL < FL + 0.5*FC + 0.6*BL + 0.6*SL | FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
+
+ +

Note that ffmpeg integrates a default down-mix (and up-mix) system +that should be preferred (see "-ac" option) unless you have very specific +needs. +

+
+
+

36.98.2 Remapping examples

+ +

The channel remapping will be effective if, and only if: +

+
    +
  • gain coefficients are zeroes or ones, +
  • only one input per channel output, +
+ +

If all these conditions are satisfied, the filter will notify the user ("Pure +channel mapping detected"), and use an optimized and lossless method to do the +remapping. +

+

For example, if you have a 5.1 source and want a stereo audio stream by +dropping the extra channels: +

+
pan="stereo| c0=FL | c1=FR"
+
+ +

Given the same source, you can also switch front left and front right channels +and keep the input channel layout: +

+
pan="5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5"
+
+ +

If the input is a stereo audio stream, you can mute the front left channel (and +still keep the stereo channel layout) with: +

+
pan="stereo|c1=c1"
+
+ +

Still with a stereo audio stream input, you can copy the right channel in both +front left and right: +

+
pan="stereo| c0=FR | c1=FR"
+
+ +
+
+
+

36.99 replaygain

+ +

ReplayGain scanner filter. This filter takes an audio stream as an input and +outputs it unchanged. +At end of filtering it displays track_gain and track_peak. +

+

The filter accepts the following exported read-only options: +

+
+
track_gain
+

Exported track gain in dB at end of stream. +

+
+
track_peak
+

Exported track peak at end of stream. +

+
+ +
+
+

36.100 resample

+ +

Convert the audio sample format, sample rate and channel layout. It is +not meant to be used directly. +

+
+
+

36.101 rubberband

+

Apply time-stretching and pitch-shifting with librubberband. +

+

To enable compilation of this filter, you need to configure FFmpeg with +--enable-librubberband. +

+

The filter accepts the following options: +

+
+
tempo
+

Set tempo scale factor. +

+
+
pitch
+

Set pitch scale factor. +

+
+
transients
+

Set transients detector. +Possible values are: +

+
crisp
+
mixed
+
smooth
+
+ +
+
detector
+

Set detector. +Possible values are: +

+
compound
+
percussive
+
soft
+
+ +
+
phase
+

Set phase. +Possible values are: +

+
laminar
+
independent
+
+ +
+
window
+

Set processing window size. +Possible values are: +

+
standard
+
short
+
long
+
+ +
+
smoothing
+

Set smoothing. +Possible values are: +

+
off
+
on
+
+ +
+
formant
+

Enable formant preservation when shift pitching. +Possible values are: +

+
shifted
+
preserved
+
+ +
+
pitchq
+

Set pitch quality. +Possible values are: +

+
quality
+
speed
+
consistency
+
+ +
+
channels
+

Set channels. +Possible values are: +

+
apart
+
together
+
+
+
+ + +
+

36.101.1 Commands

+ +

This filter supports the following commands: +

+
tempo
+

Change filter tempo scale factor. +Syntax for the command is : "tempo" +

+
+
pitch
+

Change filter pitch scale factor. +Syntax for the command is : "pitch" +

+
+ +
+
+
+

36.102 sidechaincompress

+ +

This filter acts like normal compressor but has the ability to compress +detected signal using second input signal. +It needs two input streams and returns one output stream. +First input stream will be processed depending on second stream signal. +The filtered signal then can be filtered with other filters in later stages of +processing. See pan and amerge filter. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. Default is 1. Range is between 0.015625 and 64. +

+
+
mode
+

Set mode of compressor operation. Can be upward or downward. +Default is downward. +

+
+
threshold
+

If a signal of second stream raises above this level it will affect the gain +reduction of first stream. +By default is 0.125. Range is between 0.00097563 and 1. +

+
+
ratio
+

Set a ratio about which the signal is reduced. 1:2 means that if the level +raised 4dB above the threshold, it will be only 2dB above after the reduction. +Default is 2. Range is between 1 and 20. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction starts. Default is 20. Range is between 0.01 and 2000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before +reduction is decreased again. Default is 250. Range is between 0.01 and 9000. +

+
+
makeup
+

Set the amount by how much signal will be amplified after processing. +Default is 1. Range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.82843. Range is between 1 and 8. +

+
+
link
+

Choose if the average level between all channels of side-chain stream +or the louder(maximum) channel of side-chain stream affects the +reduction. Default is average. +

+
+
detection
+

Should the exact signal be taken in case of peak or an RMS one in case +of rms. Default is rms which is mainly smoother. +

+
+
level_sc
+

Set sidechain gain. Default is 1. Range is between 0.015625 and 64. +

+
+
mix
+

How much to use compressed signal in output. Default is 1. +Range is between 0 and 1. +

+
+ + +
+

36.102.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

36.102.2 Examples

+ +
    +
  • Full ffmpeg example taking 2 audio inputs, 1st input to be compressed +depending on the signal of 2nd input and later compressed signal to be +merged with 2nd input: +
    +
    ffmpeg -i main.flac -i sidechain.flac -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge"
    +
    +
+ +
+
+
+

36.103 sidechaingate

+ +

A sidechain gate acts like a normal (wideband) gate but has the ability to +filter the detected signal before sending it to the gain reduction stage. +Normally a gate uses the full range signal to detect a level above the +threshold. +For example: If you cut all lower frequencies from your sidechain signal +the gate will decrease the volume of your track only if not enough highs +appear. With this technique you are able to reduce the resonation of a +natural drum or remove "rumbling" of muted strokes from a heavily distorted +guitar. +It needs two input streams and returns one output stream. +First input stream will be processed depending on second stream signal. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level before filtering. +Default is 1. Allowed range is from 0.015625 to 64. +

+
+
mode
+

Set the mode of operation. Can be upward or downward. +Default is downward. If set to upward mode, higher parts of signal +will be amplified, expanding dynamic range in upward direction. +Otherwise, in case of downward lower parts of signal will be reduced. +

+
+
range
+

Set the level of gain reduction when the signal is below the threshold. +Default is 0.06125. Allowed range is from 0 to 1. +Setting this to 0 disables reduction and then filter behaves like expander. +

+
+
threshold
+

If a signal rises above this level the gain reduction is released. +Default is 0.125. Allowed range is from 0 to 1. +

+
+
ratio
+

Set a ratio about which the signal is reduced. +Default is 2. Allowed range is from 1 to 9000. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction stops. +Default is 20 milliseconds. Allowed range is from 0.01 to 9000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before the +reduction is increased again. Default is 250 milliseconds. +Allowed range is from 0.01 to 9000. +

+
+
makeup
+

Set amount of amplification of signal after processing. +Default is 1. Allowed range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.828427125. Allowed range is from 1 to 8. +

+
+
detection
+

Choose if exact signal should be taken for detection or an RMS like one. +Default is rms. Can be peak or rms. +

+
+
link
+

Choose if the average level between all channels or the louder channel affects +the reduction. +Default is average. Can be average or maximum. +

+
+
level_sc
+

Set sidechain gain. Default is 1. Range is from 0.015625 to 64. +

+
+ + +
+

36.103.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

36.104 silencedetect

+ +

Detect silence in an audio stream. +

+

This filter logs a message when it detects that the input audio volume is less +or equal to a noise tolerance value for a duration greater or equal to the +minimum detected noise duration. +

+

The printed times and duration are expressed in seconds. The +lavfi.silence_start or lavfi.silence_start.X metadata key +is set on the first frame whose timestamp equals or exceeds the detection +duration and it contains the timestamp of the first frame of the silence. +

+

The lavfi.silence_duration or lavfi.silence_duration.X +and lavfi.silence_end or lavfi.silence_end.X metadata +keys are set on the first frame after the silence. If mono is +enabled, and each channel is evaluated separately, the .X +suffixed keys are used, and X corresponds to the channel number. +

+

The filter accepts the following options: +

+
+
noise, n
+

Set noise tolerance. Can be specified in dB (in case "dB" is appended to the +specified value) or amplitude ratio. Default is -60dB, or 0.001. +

+
+
duration, d
+

Set silence duration until notification (default is 2 seconds). See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+
+
mono, m
+

Process each channel separately, instead of combined. By default is disabled. +

+
+ + +
+

36.104.1 Examples

+ +
    +
  • Detect 5 seconds of silence with -50dB noise tolerance: +
    +
    silencedetect=n=-50dB:d=5
    +
    + +
  • Complete example with ffmpeg to detect silence with 0.0001 noise +tolerance in silence.mp3: +
    +
    ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
    +
    +
+ +
+
+
+

36.105 silenceremove

+ +

Remove silence from the beginning, middle or end of the audio. +

+

The filter accepts the following options: +

+
+
start_periods
+

This value is used to indicate if audio should be trimmed at beginning of +the audio. A value of zero indicates no silence should be trimmed from the +beginning. When specifying a non-zero value, it trims audio up until it +finds non-silence. Normally, when trimming silence from beginning of audio +the start_periods will be 1 but it can be increased to higher +values to trim all audio up to specific count of non-silence periods. +Default value is 0. +

+
+
start_duration
+

Specify the amount of time that non-silence must be detected before it stops +trimming audio. By increasing the duration, bursts of noises can be treated +as silence and trimmed off. Default value is 0. +

+
+
start_threshold
+

This indicates what sample value should be treated as silence. For digital +audio, a value of 0 may be fine but for audio recorded from analog, +you may wish to increase the value to account for background noise. +Can be specified in dB (in case "dB" is appended to the specified value) +or amplitude ratio. Default value is 0. +

+
+
start_silence
+

Specify max duration of silence at beginning that will be kept after +trimming. Default is 0, which is equal to trimming all samples detected +as silence. +

+
+
start_mode
+

Specify mode of detection of silence end in start of multi-channel audio. +Can be any or all. Default is any. +With any, any sample that is detected as non-silence will cause +stopped trimming of silence. +With all, only if all channels are detected as non-silence will cause +stopped trimming of silence. +

+
+
stop_periods
+

Set the count for trimming silence from the end of audio. +To remove silence from the middle of a file, specify a stop_periods +that is negative. This value is then treated as a positive value and is +used to indicate the effect should restart processing as specified by +start_periods, making it suitable for removing periods of silence +in the middle of the audio. +Default value is 0. +

+
+
stop_duration
+

Specify a duration of silence that must exist before audio is not copied any +more. By specifying a higher duration, silence that is wanted can be left in +the audio. +Default value is 0. +

+
+
stop_threshold
+

This is the same as start_threshold but for trimming silence from +the end of audio. +Can be specified in dB (in case "dB" is appended to the specified value) +or amplitude ratio. Default value is 0. +

+
+
stop_silence
+

Specify max duration of silence at end that will be kept after +trimming. Default is 0, which is equal to trimming all samples detected +as silence. +

+
+
stop_mode
+

Specify mode of detection of silence start in end of multi-channel audio. +Can be any or all. Default is any. +With any, any sample that is detected as non-silence will cause +stopped trimming of silence. +With all, only if all channels are detected as non-silence will cause +stopped trimming of silence. +

+
+
detection
+

Set how is silence detected. Can be rms or peak. Second is faster +and works better with digital silence which is exactly 0. +Default value is rms. +

+
+
window
+

Set duration in number of seconds used to calculate size of window in number +of samples for detecting silence. +Default value is 0.02. Allowed range is from 0 to 10. +

+
+ + +
+

36.105.1 Examples

+ +
    +
  • The following example shows how this filter can be used to start a recording +that does not contain the delay at the start which usually occurs between +pressing the record button and the start of the performance: +
    +
    silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
    +
    + +
  • Trim all silence encountered from beginning to end where there is more than 1 +second of silence in audio: +
    +
    silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
    +
    + +
  • Trim all digital silence samples, using peak detection, from beginning to end +where there is more than 0 samples of digital silence in audio and digital +silence is detected in all channels at same positions in stream: +
    +
    silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
    +
    +
+ +
+
+
+

36.106 sofalizer

+ +

SOFAlizer uses head-related transfer functions (HRTFs) to create virtual +loudspeakers around the user for binaural listening via headphones (audio +formats up to 9 channels supported). +The HRTFs are stored in SOFA files (see http://www.sofacoustics.org/ for a database). +SOFAlizer is developed at the Acoustics Research Institute (ARI) of the +Austrian Academy of Sciences. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libmysofa. +

+

The filter accepts the following options: +

+
+
sofa
+

Set the SOFA file used for rendering. +

+
+
gain
+

Set gain applied to audio. Value is in dB. Default is 0. +

+
+
rotation
+

Set rotation of virtual loudspeakers in deg. Default is 0. +

+
+
elevation
+

Set elevation of virtual speakers in deg. Default is 0. +

+
+
radius
+

Set distance in meters between loudspeakers and the listener with near-field +HRTFs. Default is 1. +

+
+
type
+

Set processing type. Can be time or freq. time is +processing audio in time domain which is slow. +freq is processing audio in frequency domain which is fast. +Default is freq. +

+
+
speakers
+

Set custom positions of virtual loudspeakers. Syntax for this option is: +<CH> <AZIM> <ELEV>[|<CH> <AZIM> <ELEV>|...]. +Each virtual loudspeaker is described with short channel name following with +azimuth and elevation in degrees. +Each virtual loudspeaker description is separated by ’|’. +For example to override front left and front right channel positions use: +’speakers=FL 45 15|FR 345 15’. +Descriptions with unrecognised channel names are ignored. +

+
+
lfegain
+

Set custom gain for LFE channels. Value is in dB. Default is 0. +

+
+
framesize
+

Set custom frame size in number of samples. Default is 1024. +Allowed range is from 1024 to 96000. Only used if option ‘type’ +is set to freq. +

+
+
normalize
+

Should all IRs be normalized upon importing SOFA file. +By default is enabled. +

+
+
interpolate
+

Should nearest IRs be interpolated with neighbor IRs if exact position +does not match. By default is disabled. +

+
+
minphase
+

Minphase all IRs upon loading of SOFA file. By default is disabled. +

+
+
anglestep
+

Set neighbor search angle step. Only used if option interpolate is enabled. +

+
+
radstep
+

Set neighbor search radius step. Only used if option interpolate is enabled. +

+
+ + +
+

36.106.1 Examples

+ +
    +
  • Using ClubFritz6 sofa file: +
    +
    sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
    +
    + +
  • Using ClubFritz12 sofa file and bigger radius with small rotation: +
    +
    sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
    +
    + +
  • Similar as above but with custom speaker positions for front left, front right, back left and back right +and also with custom gain: +
    +
    "sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|BL 135|BR 225:gain=28"
    +
    +
+ +
+
+
+

36.107 speechnorm

+

Speech Normalizer. +

+

This filter expands or compresses each half-cycle of audio samples +(local set of samples all above or all below zero and between two nearest zero crossings) depending +on threshold value, so audio reaches target peak value under conditions controlled by below options. +

+

The filter accepts the following options: +

+
+
peak, p
+

Set the expansion target peak value. This specifies the highest allowed absolute amplitude +level for the normalized audio input. Default value is 0.95. Allowed range is from 0.0 to 1.0. +

+
+
expansion, e
+

Set the maximum expansion factor. Allowed range is from 1.0 to 50.0. Default value is 2.0. +This option controls maximum local half-cycle of samples expansion. The maximum expansion +would be such that local peak value reaches target peak value but never to surpass it and that +ratio between new and previous peak value does not surpass this option value. +

+
+
compression, c
+

Set the maximum compression factor. Allowed range is from 1.0 to 50.0. Default value is 2.0. +This option controls maximum local half-cycle of samples compression. This option is used +only if threshold option is set to value greater than 0.0, then in such cases +when local peak is lower or same as value set by threshold all samples belonging to +that peak’s half-cycle will be compressed by current compression factor. +

+
+
threshold, t
+

Set the threshold value. Default value is 0.0. Allowed range is from 0.0 to 1.0. +This option specifies which half-cycles of samples will be compressed and which will be expanded. +Any half-cycle samples with their local peak value below or same as this option value will be +compressed by current compression factor, otherwise, if greater than threshold value they will be +expanded with expansion factor so that it could reach peak target value but never surpass it. +

+
+
raise, r
+

Set the expansion raising amount per each half-cycle of samples. Default value is 0.001. +Allowed range is from 0.0 to 1.0. This controls how fast expansion factor is raised per +each new half-cycle until it reaches expansion value. +Setting this options too high may lead to distortions. +

+
+
fall, f
+

Set the compression raising amount per each half-cycle of samples. Default value is 0.001. +Allowed range is from 0.0 to 1.0. This controls how fast compression factor is raised per +each new half-cycle until it reaches compression value. +

+
+
channels, h
+

Specify which channels to filter, by default all available channels are filtered. +

+
+
invert, i
+

Enable inverted filtering, by default is disabled. This inverts interpretation of threshold +option. When enabled any half-cycle of samples with their local peak value below or same as +threshold option will be expanded otherwise it will be compressed. +

+
+
link, l
+

Link channels when calculating gain applied to each filtered channel sample, by default is disabled. +When disabled each filtered channel gain calculation is independent, otherwise when this option +is enabled the minimum of all possible gains for each filtered channel is used. +

+
+
rms, m
+

Set the expansion target RMS value. This specifies the highest allowed RMS level for the normalized +audio input. Default value is 0.0, thus disabled. Allowed range is from 0.0 to 1.0. +

+
+ + +
+

36.107.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

36.107.2 Examples

+ +
    +
  • Weak and slow amplification: +
    +
    speechnorm=e=3:r=0.00001:l=1
    +
    + +
  • Moderate and slow amplification: +
    +
    speechnorm=e=6.25:r=0.00001:l=1
    +
    + +
  • Strong and fast amplification: +
    +
    speechnorm=e=12.5:r=0.0001:l=1
    +
    + +
  • Very strong and fast amplification: +
    +
    speechnorm=e=25:r=0.0001:l=1
    +
    + +
  • Extreme and fast amplification: +
    +
    speechnorm=e=50:r=0.0001:l=1
    +
    +
+ +
+
+
+

36.108 stereotools

+ +

This filter has some handy utilities to manage stereo signals, for converting +M/S stereo recordings to L/R signal while having control over the parameters +or spreading the stereo image of master track. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level before filtering for both channels. Defaults is 1. +Allowed range is from 0.015625 to 64. +

+
+
level_out
+

Set output level after filtering for both channels. Defaults is 1. +Allowed range is from 0.015625 to 64. +

+
+
balance_in
+

Set input balance between both channels. Default is 0. +Allowed range is from -1 to 1. +

+
+
balance_out
+

Set output balance between both channels. Default is 0. +Allowed range is from -1 to 1. +

+
+
softclip
+

Enable softclipping. Results in analog distortion instead of harsh digital 0dB +clipping. Disabled by default. +

+
+
mutel
+

Mute the left channel. Disabled by default. +

+
+
muter
+

Mute the right channel. Disabled by default. +

+
+
phasel
+

Change the phase of the left channel. Disabled by default. +

+
+
phaser
+

Change the phase of the right channel. Disabled by default. +

+
+
mode
+

Set stereo mode. Available values are: +

+
+
lr>lr
+

Left/Right to Left/Right, this is default. +

+
+
lr>ms
+

Left/Right to Mid/Side. +

+
+
ms>lr
+

Mid/Side to Left/Right. +

+
+
lr>ll
+

Left/Right to Left/Left. +

+
+
lr>rr
+

Left/Right to Right/Right. +

+
+
lr>l+r
+

Left/Right to Left + Right. +

+
+
lr>rl
+

Left/Right to Right/Left. +

+
+
ms>ll
+

Mid/Side to Left/Left. +

+
+
ms>rr
+

Mid/Side to Right/Right. +

+
+
ms>rl
+

Mid/Side to Right/Left. +

+
+
lr>l-r
+

Left/Right to Left - Right. +

+
+ +
+
slev
+

Set level of side signal. Default is 1. +Allowed range is from 0.015625 to 64. +

+
+
sbal
+

Set balance of side signal. Default is 0. +Allowed range is from -1 to 1. +

+
+
mlev
+

Set level of the middle signal. Default is 1. +Allowed range is from 0.015625 to 64. +

+
+
mpan
+

Set middle signal pan. Default is 0. Allowed range is from -1 to 1. +

+
+
base
+

Set stereo base between mono and inversed channels. Default is 0. +Allowed range is from -1 to 1. +

+
+
delay
+

Set delay in milliseconds how much to delay left from right channel and +vice versa. Default is 0. Allowed range is from -20 to 20. +

+
+
sclevel
+

Set S/C level. Default is 1. Allowed range is from 1 to 100. +

+
+
phase
+

Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360. +

+
+
bmode_in, bmode_out
+

Set balance mode for balance_in/balance_out option. +

+

Can be one of the following: +

+
+
balance
+

Classic balance mode. Attenuate one channel at time. +Gain is raised up to 1. +

+
+
amplitude
+

Similar as classic mode above but gain is raised up to 2. +

+
+
power
+

Equal power distribution, from -6dB to +6dB range. +

+
+
+
+ + +
+

36.108.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

36.108.2 Examples

+ +
    +
  • Apply karaoke like effect: +
    +
    stereotools=mlev=0.015625
    +
    + +
  • Convert M/S signal to L/R: +
    +
    "stereotools=mode=ms>lr"
    +
    +
+ +
+
+
+

36.109 stereowiden

+ +

This filter enhance the stereo effect by suppressing signal common to both +channels and by delaying the signal of left into right and vice versa, +thereby widening the stereo effect. +

+

The filter accepts the following options: +

+
+
delay
+

Time in milliseconds of the delay of left signal into right and vice versa. +Default is 20 milliseconds. +

+
+
feedback
+

Amount of gain in delayed signal into right and vice versa. Gives a delay +effect of left signal in right output and vice versa which gives widening +effect. Default is 0.3. +

+
+
crossfeed
+

Cross feed of left into right with inverted phase. This helps in suppressing +the mono. If the value is 1 it will cancel all the signal common to both +channels. Default is 0.3. +

+
+
drymix
+

Set level of input signal of original channel. Default is 0.8. +

+
+ + +
+

36.109.1 Commands

+ +

This filter supports the all above options except delay as commands. +

+
+
+
+

36.110 superequalizer

+

Apply 18 band equalizer. +

+

The filter accepts the following options: +

+
1b
+

Set 65Hz band gain. +

+
2b
+

Set 92Hz band gain. +

+
3b
+

Set 131Hz band gain. +

+
4b
+

Set 185Hz band gain. +

+
5b
+

Set 262Hz band gain. +

+
6b
+

Set 370Hz band gain. +

+
7b
+

Set 523Hz band gain. +

+
8b
+

Set 740Hz band gain. +

+
9b
+

Set 1047Hz band gain. +

+
10b
+

Set 1480Hz band gain. +

+
11b
+

Set 2093Hz band gain. +

+
12b
+

Set 2960Hz band gain. +

+
13b
+

Set 4186Hz band gain. +

+
14b
+

Set 5920Hz band gain. +

+
15b
+

Set 8372Hz band gain. +

+
16b
+

Set 11840Hz band gain. +

+
17b
+

Set 16744Hz band gain. +

+
18b
+

Set 20000Hz band gain. +

+
+ +
+
+

36.111 surround

+

Apply audio surround upmix filter. +

+

This filter allows to produce multichannel output from audio stream. +

+

The filter accepts the following options: +

+
+
chl_out
+

Set output channel layout. By default, this is 5.1. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+
chl_in
+

Set input channel layout. By default, this is stereo. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+
level_in
+

Set input volume level. By default, this is 1. +

+
+
level_out
+

Set output volume level. By default, this is 1. +

+
+
lfe
+

Enable LFE channel output if output channel layout has it. By default, this is enabled. +

+
+
lfe_low
+

Set LFE low cut off frequency. By default, this is 128 Hz. +

+
+
lfe_high
+

Set LFE high cut off frequency. By default, this is 256 Hz. +

+
+
lfe_mode
+

Set LFE mode, can be add or sub. Default is add. +In add mode, LFE channel is created from input audio and added to output. +In sub mode, LFE channel is created from input audio and added to output but +also all non-LFE output channels are subtracted with output LFE channel. +

+
+
smooth
+

Set temporal smoothness strength, used to gradually change factors when transforming +stereo sound in time. Allowed range is from 0.0 to 1.0. +Useful to improve output quality with focus option values greater than 0.0. +Default is 0.0. Only values inside this range and without edges are effective. +

+
+
angle
+

Set angle of stereo surround transform, Allowed range is from 0 to 360. +Default is 90. +

+
+
focus
+

Set focus of stereo surround transform, Allowed range is from -1 to 1. +Default is 0. +

+
+
fc_in
+

Set front center input volume. By default, this is 1. +

+
+
fc_out
+

Set front center output volume. By default, this is 1. +

+
+
fl_in
+

Set front left input volume. By default, this is 1. +

+
+
fl_out
+

Set front left output volume. By default, this is 1. +

+
+
fr_in
+

Set front right input volume. By default, this is 1. +

+
+
fr_out
+

Set front right output volume. By default, this is 1. +

+
+
sl_in
+

Set side left input volume. By default, this is 1. +

+
+
sl_out
+

Set side left output volume. By default, this is 1. +

+
+
sr_in
+

Set side right input volume. By default, this is 1. +

+
+
sr_out
+

Set side right output volume. By default, this is 1. +

+
+
bl_in
+

Set back left input volume. By default, this is 1. +

+
+
bl_out
+

Set back left output volume. By default, this is 1. +

+
+
br_in
+

Set back right input volume. By default, this is 1. +

+
+
br_out
+

Set back right output volume. By default, this is 1. +

+
+
bc_in
+

Set back center input volume. By default, this is 1. +

+
+
bc_out
+

Set back center output volume. By default, this is 1. +

+
+
lfe_in
+

Set LFE input volume. By default, this is 1. +

+
+
lfe_out
+

Set LFE output volume. By default, this is 1. +

+
+
allx
+

Set spread usage of stereo image across X axis for all channels. +Allowed range is from -1 to 15. +By default this value is negative -1, and thus unused. +

+
+
ally
+

Set spread usage of stereo image across Y axis for all channels. +Allowed range is from -1 to 15. +By default this value is negative -1, and thus unused. +

+
+
fcx, flx, frx, blx, brx, slx, srx, bcx
+

Set spread usage of stereo image across X axis for each channel. +Allowed range is from 0.06 to 15. +By default this value is 0.5. +

+
+
fcy, fly, fry, bly, bry, sly, sry, bcy
+

Set spread usage of stereo image across Y axis for each channel. +Allowed range is from 0.06 to 15. +By default this value is 0.5. +

+
+
win_size
+

Set window size. Allowed range is from 1024 to 65536. Default size is 4096. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann, hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hann. +

+
+
overlap
+

Set window overlap. If set to 1, the recommended overlap for selected +window function will be picked. Default is 0.5. +

+
+ +
+
+

36.112 tiltshelf

+ +

Boost or cut the lower frequencies and cut or boost higher frequencies +of the audio using a two-pole shelving filter with a response similar to +that of a standard hi-fi’s tone-controls. +This is also known as shelving equalisation (EQ). +

+

The filter accepts the following options: +

+
+
gain, g
+

Give the gain at 0 Hz. Its useful range is about -20 +(for a large cut) to +20 (for a large boost). +Beware of clipping when using a positive gain. +

+
+
frequency, f
+

Set the filter’s central frequency and so can be used +to extend or reduce the frequency range to be boosted or cut. +The default value is 3000 Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Determine how steep is the filter’s shelf transition. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

36.112.1 Commands

+ +

This filter supports some options as commands. +

+
+
+
+

36.113 treble, highshelf

+ +

Boost or cut treble (upper) frequencies of the audio using a two-pole +shelving filter with a response similar to that of a standard +hi-fi’s tone-controls. This is also known as shelving equalisation (EQ). +

+

The filter accepts the following options: +

+
+
gain, g
+

Give the gain at whichever is the lower of ~22 kHz and the +Nyquist frequency. Its useful range is about -20 (for a large cut) +to +20 (for a large boost). Beware of clipping when using a positive gain. +

+
+
frequency, f
+

Set the filter’s central frequency and so can be used +to extend or reduce the frequency range to be boosted or cut. +The default value is 3000 Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Determine how steep is the filter’s shelf transition. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

36.113.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change treble frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change treble width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change treble width. +Syntax for the command is : "width" +

+
+
gain, g
+

Change treble gain. +Syntax for the command is : "gain" +

+
+
mix, m
+

Change treble mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

36.114 tremolo

+ +

Sinusoidal amplitude modulation. +

+

The filter accepts the following options: +

+
+
f
+

Modulation frequency in Hertz. Modulation frequencies in the subharmonic range +(20 Hz or lower) will result in a tremolo effect. +This filter may also be used as a ring modulator by specifying +a modulation frequency higher than 20 Hz. +Range is 0.1 - 20000.0. Default value is 5.0 Hz. +

+
+
d
+

Depth of modulation as a percentage. Range is 0.0 - 1.0. +Default value is 0.5. +

+
+ +
+
+

36.115 vibrato

+ +

Sinusoidal phase modulation. +

+

The filter accepts the following options: +

+
+
f
+

Modulation frequency in Hertz. +Range is 0.1 - 20000.0. Default value is 5.0 Hz. +

+
+
d
+

Depth of modulation as a percentage. Range is 0.0 - 1.0. +Default value is 0.5. +

+
+ +
+
+

36.116 virtualbass

+ +

Apply audio Virtual Bass filter. +

+

This filter accepts stereo input and produce stereo with LFE (2.1) channels output. +The newly produced LFE channel have enhanced virtual bass originally obtained from both stereo channels. +This filter outputs front left and front right channels unchanged as available in stereo input. +

+

The filter accepts the following options: +

+
+
cutoff
+

Set the virtual bass cutoff frequency. Default value is 250 Hz. +Allowed range is from 100 to 500 Hz. +

+
+
strength
+

Set the virtual bass strength. Allowed range is from 0.5 to 3. +Default value is 3. +

+
+ +
+
+

36.117 volume

+ +

Adjust the input audio volume. +

+

It accepts the following parameters: +

+
volume
+

Set audio volume expression. +

+

Output values are clipped to the maximum value. +

+

The output audio volume is given by the relation: +

+
output_volume = volume * input_volume
+
+ +

The default value for volume is "1.0". +

+
+
precision
+

This parameter represents the mathematical precision. +

+

It determines which input sample formats will be allowed, which affects the +precision of the volume scaling. +

+
+
fixed
+

8-bit fixed-point; this limits input sample format to U8, S16, and S32. +

+
float
+

32-bit floating-point; this limits input sample format to FLT. (default) +

+
double
+

64-bit floating-point; this limits input sample format to DBL. +

+
+ +
+
replaygain
+

Choose the behaviour on encountering ReplayGain side data in input frames. +

+
+
drop
+

Remove ReplayGain side data, ignoring its contents (the default). +

+
+
ignore
+

Ignore ReplayGain side data, but leave it in the frame. +

+
+
track
+

Prefer the track gain, if present. +

+
+
album
+

Prefer the album gain, if present. +

+
+ +
+
replaygain_preamp
+

Pre-amplification gain in dB to apply to the selected replaygain gain. +

+

Default value for replaygain_preamp is 0.0. +

+
+
replaygain_noclip
+

Prevent clipping by limiting the gain applied. +

+

Default value for replaygain_noclip is 1. +

+
+
eval
+

Set when the volume expression is evaluated. +

+

It accepts the following values: +

+
once
+

only evaluate expression once during the filter initialization, or +when the ‘volume’ command is sent +

+
+
frame
+

evaluate expression for each incoming frame +

+
+ +

Default value is ‘once’. +

+
+ +

The volume expression can contain the following parameters. +

+
+
n
+

frame number (starting at zero) +

+
nb_channels
+

number of channels +

+
nb_consumed_samples
+

number of samples consumed by the filter +

+
nb_samples
+

number of samples in the current frame +

+
pos
+

original frame position in the file; deprecated, do not use +

+
pts
+

frame PTS +

+
sample_rate
+

sample rate +

+
startpts
+

PTS at start of stream +

+
startt
+

time at start of stream +

+
t
+

frame time +

+
tb
+

timestamp timebase +

+
volume
+

last set volume value +

+
+ +

Note that when eval is set to ‘once’ only the +sample_rate and tb variables are available, all other +variables will evaluate to NAN. +

+ +
+

36.117.1 Commands

+ +

This filter supports the following commands: +

+
volume
+

Modify the volume expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+

36.117.2 Examples

+ +
    +
  • Halve the input audio volume: +
    +
    volume=volume=0.5
    +volume=volume=1/2
    +volume=volume=-6.0206dB
    +
    + +

    In all the above example the named key for volume can be +omitted, for example like in: +

    +
    volume=0.5
    +
    + +
  • Increase input audio power by 6 decibels using fixed-point precision: +
    +
    volume=volume=6dB:precision=fixed
    +
    + +
  • Fade volume after time 10 with an annihilation period of 5 seconds: +
    +
    volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
    +
    +
+ +
+
+
+

36.118 volumedetect

+ +

Detect the volume of the input video. +

+

The filter has no parameters. It supports only 16-bit signed integer samples, +so the input will be converted when needed. Statistics about the volume will +be printed in the log when the input stream end is reached. +

+

In particular it will show the mean volume (root mean square), maximum +volume (on a per-sample basis), and the beginning of a histogram of the +registered volume values (from the maximum value to a cumulated 1/1000 of +the samples). +

+

All volumes are in decibels relative to the maximum PCM value. +

+ +
+

36.118.1 Examples

+ +

Here is an excerpt of the output: +

+
[Parsed_volumedetect_0  0xa23120] mean_volume: -27 dB
+[Parsed_volumedetect_0  0xa23120] max_volume: -4 dB
+[Parsed_volumedetect_0  0xa23120] histogram_4db: 6
+[Parsed_volumedetect_0  0xa23120] histogram_5db: 62
+[Parsed_volumedetect_0  0xa23120] histogram_6db: 286
+[Parsed_volumedetect_0  0xa23120] histogram_7db: 1042
+[Parsed_volumedetect_0  0xa23120] histogram_8db: 2551
+[Parsed_volumedetect_0  0xa23120] histogram_9db: 4609
+[Parsed_volumedetect_0  0xa23120] histogram_10db: 8409
+
+ +

It means that: +

    +
  • The mean square energy is approximately -27 dB, or 10^-2.7. +
  • The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB. +
  • There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc. +
+ +

In other words, raising the volume by +4 dB does not cause any clipping, +raising it by +5 dB causes clipping for 6 samples, etc. +

+ +
+
+
+
+

37 Audio Sources

+ +

Below is a description of the currently available audio sources. +

+ +
+

37.1 abuffer

+ +

Buffer audio frames, and make them available to the filter chain. +

+

This source is mainly intended for a programmatic use, in particular +through the interface defined in libavfilter/buffersrc.h. +

+

It accepts the following parameters: +

+
time_base
+

The timebase which will be used for timestamps of submitted frames. It must be +either a floating-point number or in numerator/denominator form. +

+
+
sample_rate
+

The sample rate of the incoming audio buffers. +

+
+
sample_fmt
+

The sample format of the incoming audio buffers. +Either a sample format name or its corresponding integer representation from +the enum AVSampleFormat in libavutil/samplefmt.h +

+
+
channel_layout
+

The channel layout of the incoming audio buffers. +Either a channel layout name from channel_layout_map in +libavutil/channel_layout.c or its corresponding integer representation +from the AV_CH_LAYOUT_* macros in libavutil/channel_layout.h +

+
+
channels
+

The number of channels of the incoming audio buffers. +If both channels and channel_layout are specified, then they +must be consistent. +

+
+
+ + +
+

37.1.1 Examples

+ +
+
abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
+
+ +

will instruct the source to accept planar 16bit signed stereo at 44100Hz. +Since the sample format with name "s16p" corresponds to the number +6 and the "stereo" channel layout corresponds to the value 0x3, this is +equivalent to: +

+
abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
+
+ +
+
+
+

37.2 aevalsrc

+ +

Generate an audio signal specified by an expression. +

+

This source accepts in input one or more expressions (one for each +channel), which are evaluated and used to generate a corresponding +audio signal. +

+

This source accepts the following options: +

+
+
exprs
+

Set the ’|’-separated expressions list for each separate channel. In case the +channel_layout option is not specified, the selected channel layout +depends on the number of provided expressions. Otherwise the last +specified expression is applied to the remaining output channels. +

+
+
channel_layout, c
+

Set the channel layout. The number of channels in the specified layout +must be equal to the number of specified expressions. +

+
+
duration, d
+

Set the minimum duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +Note that the resulting duration may be greater than the specified +duration, as the generated audio is always cut at the end of a +complete frame. +

+

If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +

+
+
nb_samples, n
+

Set the number of samples per channel per each output frame, +default to 1024. +

+
+
sample_rate, s
+

Specify the sample rate, default to 44100. +

+
+ +

Each expression in exprs can contain the following constants: +

+
+
n
+

number of the evaluated sample, starting from 0 +

+
+
t
+

time of the evaluated sample expressed in seconds, starting from 0 +

+
+
s
+

sample rate +

+
+
+ + +
+

37.2.1 Examples

+ +
    +
  • Generate silence: +
    +
    aevalsrc=0
    +
    + +
  • Generate a sin signal with frequency of 440 Hz, set sample rate to +8000 Hz: +
    +
    aevalsrc="sin(440*2*PI*t):s=8000"
    +
    + +
  • Generate a two channels signal, specify the channel layout (Front +Center + Back Center) explicitly: +
    +
    aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
    +
    + +
  • Generate white noise: +
    +
    aevalsrc="-2+random(0)"
    +
    + +
  • Generate an amplitude modulated signal: +
    +
    aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
    +
    + +
  • Generate 2.5 Hz binaural beats on a 360 Hz carrier: +
    +
    aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
    +
    + +
+ +
+
+
+

37.3 afdelaysrc

+ +

Generate a fractional delay FIR coefficients. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
delay, d
+

Set the fractional delay. Default is 0. +

+
+
sample_rate, r
+

Set the sample rate, default is 44100. +

+
+
nb_samples, n
+

Set the number of samples per each frame. Default is 1024. +

+
+
taps, t
+

Set the number of filter coefficents in output audio stream. +Default value is 0. +

+
+
channel_layout, c
+

Specifies the channel layout, and can be a string representing a channel layout. +The default value of channel_layout is "stereo". +

+
+ +
+
+

37.4 afireqsrc

+ +

Generate a FIR equalizer coefficients. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
preset, p
+

Set equalizer preset. +Default preset is flat. +

+

Available presets are: +

+
custom
+
flat
+
acoustic
+
bass
+
beats
+
classic
+
clear
+
deep bass
+
dubstep
+
electronic
+
hard-style
+
hip-hop
+
jazz
+
metal
+
movie
+
pop
+
r&b
+
rock
+
vocal booster
+
+ +
+
gains, g
+

Set custom gains for each band. Only used if the preset option is set to custom. +Gains are separated by white spaces and each gain is set in dBFS. +Default is 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0. +

+
+
bands, b
+

Set the custom bands from where custon equalizer gains are set. +This must be in strictly increasing order. Only used if the preset option is set to custom. +Bands are separated by white spaces and each band represent frequency in Hz. +Default is 25 40 63 100 160 250 400 630 1000 1600 2500 4000 6300 10000 16000 24000. +

+
+
taps, t
+

Set number of filter coefficents in output audio stream. +Default value is 4096. +

+
+
sample_rate, r
+

Set sample rate of output audio stream, default is 44100. +

+
+
nb_samples, n
+

Set number of samples per each frame in output audio stream. Default is 1024. +

+
+
interp, i
+

Set interpolation method for FIR equalizer coefficients. Can be linear or cubic. +

+
+
phase, h
+

Set phase type of FIR filter. Can be linear or min: minimum-phase. +Default is minimum-phase filter. +

+
+ +
+
+

37.5 afirsrc

+ +

Generate a FIR coefficients using frequency sampling method. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
taps, t
+

Set number of filter coefficents in output audio stream. +Default value is 1025. +

+
+
frequency, f
+

Set frequency points from where magnitude and phase are set. +This must be in non decreasing order, and first element must be 0, while last element +must be 1. Elements are separated by white spaces. +

+
+
magnitude, m
+

Set magnitude value for every frequency point set by frequency. +Number of values must be same as number of frequency points. +Values are separated by white spaces. +

+
+
phase, p
+

Set phase value for every frequency point set by frequency. +Number of values must be same as number of frequency points. +Values are separated by white spaces. +

+
+
sample_rate, r
+

Set sample rate, default is 44100. +

+
+
nb_samples, n
+

Set number of samples per each frame. Default is 1024. +

+
+
win_func, w
+

Set window function. Default is blackman. +

+
+ +
+
+

37.6 anullsrc

+ +

The null audio source, return unprocessed audio frames. It is mainly useful +as a template and to be employed in analysis / debugging tools, or as +the source for filters which ignore the input data (for example the sox +synth filter). +

+

This source accepts the following options: +

+
+
channel_layout, cl
+
+

Specifies the channel layout, and can be either an integer or a string +representing a channel layout. The default value of channel_layout +is "stereo". +

+

Check the channel_layout_map definition in +libavutil/channel_layout.c for the mapping between strings and +channel layout values. +

+
+
sample_rate, r
+

Specifies the sample rate, and defaults to 44100. +

+
+
nb_samples, n
+

Set the number of samples per requested frames. +

+
+
duration, d
+

Set the duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +

+
+ + +
+

37.6.1 Examples

+ +
    +
  • Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO. +
    +
    anullsrc=r=48000:cl=4
    +
    + +
  • Do the same operation with a more obvious syntax: +
    +
    anullsrc=r=48000:cl=mono
    +
    +
+ +

All the parameters need to be explicitly defined. +

+
+
+
+

37.7 flite

+ +

Synthesize a voice utterance using the libflite library. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libflite. +

+

Note that versions of the flite library prior to 2.0 are not thread-safe. +

+

The filter accepts the following options: +

+
+
list_voices
+

If set to 1, list the names of the available voices and exit +immediately. Default value is 0. +

+
+
nb_samples, n
+

Set the maximum number of samples per frame. Default value is 512. +

+
+
textfile
+

Set the filename containing the text to speak. +

+
+
text
+

Set the text to speak. +

+
+
voice, v
+

Set the voice to use for the speech synthesis. Default value is +kal. See also the list_voices option. +

+
+ + +
+

37.7.1 Examples

+ +
    +
  • Read from file speech.txt, and synthesize the text using the +standard flite voice: +
    +
    flite=textfile=speech.txt
    +
    + +
  • Read the specified text selecting the slt voice: +
    +
    flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
    +
    + +
  • Input text to ffmpeg: +
    +
    ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
    +
    + +
  • Make ffplay speak the specified text, using flite and +the lavfi device: +
    +
    ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
    +
    +
+ +

For more information about libflite, check: +http://www.festvox.org/flite/ +

+
+
+
+

37.8 anoisesrc

+ +

Generate a noise audio signal. +

+

The filter accepts the following options: +

+
+
sample_rate, r
+

Specify the sample rate. Default value is 48000 Hz. +

+
+
amplitude, a
+

Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value +is 1.0. +

+
+
duration, d
+

Specify the duration of the generated audio stream. Not specifying this option +results in noise with an infinite length. +

+
+
color, colour, c
+

Specify the color of noise. Available noise colors are white, pink, brown, +blue, violet and velvet. Default color is white. +

+
+
seed, s
+

Specify a value used to seed the PRNG. +

+
+
nb_samples, n
+

Set the number of samples per each output frame, default is 1024. +

+
+
density
+

Set the density (0.0 - 1.0) for the velvet noise generator, default is 0.05. +

+
+ + +
+

37.8.1 Examples

+ +
    +
  • Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5: +
    +
    anoisesrc=d=60:c=pink:r=44100:a=0.5
    +
    +
+ +
+
+
+

37.9 hilbert

+ +

Generate odd-tap Hilbert transform FIR coefficients. +

+

The resulting stream can be used with afir filter for phase-shifting +the signal by 90 degrees. +

+

This is used in many matrix coding schemes and for analytic signal generation. +The process is often written as a multiplication by i (or j), the imaginary unit. +

+

The filter accepts the following options: +

+
+
sample_rate, s
+

Set sample rate, default is 44100. +

+
+
taps, t
+

Set length of FIR filter, default is 22051. +

+
+
nb_samples, n
+

Set number of samples per each frame. +

+
+
win_func, w
+

Set window function to be used when generating FIR coefficients. +

+
+ +
+
+

37.10 sinc

+ +

Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
sample_rate, r
+

Set sample rate, default is 44100. +

+
+
nb_samples, n
+

Set number of samples per each frame. Default is 1024. +

+
+
hp
+

Set high-pass frequency. Default is 0. +

+
+
lp
+

Set low-pass frequency. Default is 0. +If high-pass frequency is lower than low-pass frequency and low-pass frequency +is higher than 0 then filter will create band-pass filter coefficients, +otherwise band-reject filter coefficients. +

+
+
phase
+

Set filter phase response. Default is 50. Allowed range is from 0 to 100. +

+
+
beta
+

Set Kaiser window beta. +

+
+
att
+

Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB. +

+
+
round
+

Enable rounding, by default is disabled. +

+
+
hptaps
+

Set number of taps for high-pass filter. +

+
+
lptaps
+

Set number of taps for low-pass filter. +

+
+ +
+
+

37.11 sine

+ +

Generate an audio signal made of a sine wave with amplitude 1/8. +

+

The audio signal is bit-exact. +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the carrier frequency. Default is 440 Hz. +

+
+
beep_factor, b
+

Enable a periodic beep every second with frequency beep_factor times +the carrier frequency. Default is 0, meaning the beep is disabled. +

+
+
sample_rate, r
+

Specify the sample rate, default is 44100. +

+
+
duration, d
+

Specify the duration of the generated audio stream. +

+
+
samples_per_frame
+

Set the number of samples per output frame. +

+

The expression can contain the following constants: +

+
+
n
+

The (sequential) number of the output audio frame, starting from 0. +

+
+
pts
+

The PTS (Presentation TimeStamp) of the output audio frame, +expressed in TB units. +

+
+
t
+

The PTS of the output audio frame, expressed in seconds. +

+
+
TB
+

The timebase of the output audio frames. +

+
+ +

Default is 1024. +

+
+ + +
+

37.11.1 Examples

+ +
    +
  • Generate a simple 440 Hz sine wave: +
    +
    sine
    +
    + +
  • Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds: +
    +
    sine=220:4:d=5
    +sine=f=220:b=4:d=5
    +sine=frequency=220:beep_factor=4:duration=5
    +
    + +
  • Generate a 1 kHz sine wave following 1602,1601,1602,1601,1602 NTSC +pattern: +
    +
    sine=1000:samples_per_frame='st(0,mod(n,5)); 1602-not(not(eq(ld(0),1)+eq(ld(0),3)))'
    +
    +
+ + +
+
+
+
+

38 Audio Sinks

+ +

Below is a description of the currently available audio sinks. +

+ +
+

38.1 abuffersink

+ +

Buffer audio frames, and make them available to the end of filter chain. +

+

This sink is mainly intended for programmatic use, in particular +through the interface defined in libavfilter/buffersink.h +or the options system. +

+

It accepts a pointer to an AVABufferSinkContext structure, which +defines the incoming buffers’ formats, to be passed as the opaque +parameter to avfilter_init_filter for initialization. +

+
+

38.2 anullsink

+ +

Null audio sink; do absolutely nothing with the input audio. It is +mainly useful as a template and for use in analysis / debugging +tools. +

+ +
+
+
+

39 Video Filters

+ +

When you configure your FFmpeg build, you can disable any of the +existing filters using --disable-filters. +The configure output will show the video filters included in your +build. +

+

Below is a description of the currently available video filters. +

+ +
+

39.1 addroi

+ +

Mark a region of interest in a video frame. +

+

The frame data is passed through unchanged, but metadata is attached +to the frame indicating regions of interest which can affect the +behaviour of later encoding. Multiple regions can be marked by +applying the filter multiple times. +

+
+
x
+

Region distance in pixels from the left edge of the frame. +

+
y
+

Region distance in pixels from the top edge of the frame. +

+
w
+

Region width in pixels. +

+
h
+

Region height in pixels. +

+

The parameters x, y, w and h are expressions, +and may contain the following variables: +

+
iw
+

Width of the input frame. +

+
ih
+

Height of the input frame. +

+
+ +
+
qoffset
+

Quantisation offset to apply within the region. +

+

This must be a real value in the range -1 to +1. A value of zero +indicates no quality change. A negative value asks for better quality +(less quantisation), while a positive value asks for worse quality +(greater quantisation). +

+

The range is calibrated so that the extreme values indicate the +largest possible offset - if the rest of the frame is encoded with the +worst possible quality, an offset of -1 indicates that this region +should be encoded with the best possible quality anyway. Intermediate +values are then interpolated in some codec-dependent way. +

+

For example, in 10-bit H.264 the quantisation parameter varies between +-12 and 51. A typical qoffset value of -1/10 therefore indicates that +this region should be encoded with a QP around one-tenth of the full +range better than the rest of the frame. So, if most of the frame +were to be encoded with a QP of around 30, this region would get a QP +of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3). +An extreme value of -1 would indicate that this region should be +encoded with the best possible quality regardless of the treatment of +the rest of the frame - that is, should be encoded at a QP of -12. +

+
clear
+

If set to true, remove any existing regions of interest marked on the +frame before adding the new one. +

+
+ + +
+

39.1.1 Examples

+ +
    +
  • Mark the centre quarter of the frame as interesting. +
    +
    addroi=iw/4:ih/4:iw/2:ih/2:-1/10
    +
    +
  • Mark the 100-pixel-wide region on the left edge of the frame as very +uninteresting (to be encoded at much lower quality than the rest of +the frame). +
    +
    addroi=0:0:100:ih:+1/5
    +
    +
+ +
+
+
+

39.2 alphaextract

+ +

Extract the alpha component from the input as a grayscale video. This +is especially useful with the alphamerge filter. +

+
+
+

39.3 alphamerge

+ +

Add or replace the alpha component of the primary input with the +grayscale value of a second input. This is intended for use with +alphaextract to allow the transmission or storage of frame +sequences that have alpha in a format that doesn’t support an alpha +channel. +

+

For example, to reconstruct full frames from a normal YUV-encoded video +and a separate video created with alphaextract, you might use: +

+
movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
+
+ +
+
+

39.4 amplify

+ +

Amplify differences between current pixel and pixels of adjacent frames in +same pixel location. +

+

This filter accepts the following options: +

+
+
radius
+

Set frame radius. Default is 2. Allowed range is from 1 to 63. +For example radius of 3 will instruct filter to calculate average of 7 frames. +

+
+
factor
+

Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535. +

+
+
threshold
+

Set threshold for difference amplification. Any difference greater or equal to +this value will not alter source pixel. Default is 10. +Allowed range is from 0 to 65535. +

+
+
tolerance
+

Set tolerance for difference amplification. Any difference lower to +this value will not alter source pixel. Default is 0. +Allowed range is from 0 to 65535. +

+
+
low
+

Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535. +This option controls maximum possible value that will decrease source pixel value. +

+
+
high
+

Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535. +This option controls maximum possible value that will increase source pixel value. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+ + +
+

39.4.1 Commands

+ +

This filter supports the following commands that corresponds to option of same name: +

+
factor
+
threshold
+
tolerance
+
low
+
high
+
planes
+
+ +
+
+
+

39.5 ass

+ +

Same as the subtitles filter, except that it doesn’t require libavcodec +and libavformat to work. On the other hand, it is limited to ASS (Advanced +Substation Alpha) subtitles files. +

+

This filter accepts the following option in addition to the common options from +the subtitles filter: +

+
+
shaping
+

Set the shaping engine +

+

Available values are: +

+
auto
+

The default libass shaping engine, which is the best available. +

+
simple
+

Fast, font-agnostic shaper that can do only substitutions +

+
complex
+

Slower shaper using OpenType for substitutions and positioning +

+
+ +

The default is auto. +

+
+ +
+
+

39.6 atadenoise

+

Apply an Adaptive Temporal Averaging Denoiser to the video input. +

+

The filter accepts the following options: +

+
+
0a
+

Set threshold A for 1st plane. Default is 0.02. +Valid range is 0 to 0.3. +

+
+
0b
+

Set threshold B for 1st plane. Default is 0.04. +Valid range is 0 to 5. +

+
+
1a
+

Set threshold A for 2nd plane. Default is 0.02. +Valid range is 0 to 0.3. +

+
+
1b
+

Set threshold B for 2nd plane. Default is 0.04. +Valid range is 0 to 5. +

+
+
2a
+

Set threshold A for 3rd plane. Default is 0.02. +Valid range is 0 to 0.3. +

+
+
2b
+

Set threshold B for 3rd plane. Default is 0.04. +Valid range is 0 to 5. +

+

Threshold A is designed to react on abrupt changes in the input signal and +threshold B is designed to react on continuous changes in the input signal. +

+
+
s
+

Set number of frames filter will use for averaging. Default is 9. Must be odd +number in range [5, 129]. +

+
+
p
+

Set what planes of frame filter will use for averaging. Default is all. +

+
+
a
+

Set what variant of algorithm filter will use for averaging. Default is p parallel. +Alternatively can be set to s serial. +

+

Parallel can be faster then serial, while other way around is never true. +Parallel will abort early on first change being greater then thresholds, while serial +will continue processing other side of frames if they are equal or below thresholds. +

+
+
0s
+
1s
+
2s
+

Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767. +Valid range is from 0 to 32767. +This options controls weight for each pixel in radius defined by size. +Default value means every pixel have same weight. +Setting this option to 0 effectively disables filtering. +

+
+ + +
+

39.6.1 Commands

+

This filter supports same commands as options except option s. +The command accepts the same syntax of the corresponding option. +

+
+
+
+

39.7 avgblur

+ +

Apply average blur filter. +

+

The filter accepts the following options: +

+
+
sizeX
+

Set horizontal radius size. +

+
+
planes
+

Set which planes to filter. By default all planes are filtered. +

+
+
sizeY
+

Set vertical radius size, if zero it will be same as sizeX. +Default is 0. +

+
+ + +
+

39.7.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

39.8 backgroundkey

+ +

Turns a static background into transparency. +

+

The filter accepts the following option: +

+
+
threshold
+

Threshold for scene change detection. +

+
similarity
+

Similarity percentage with the background. +

+
blend
+

Set the blend amount for pixels that are not similar. +

+
+ + +
+

39.8.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.9 bbox

+ +

Compute the bounding box for the non-black pixels in the input frame +luminance plane. +

+

This filter computes the bounding box containing all the pixels with a +luminance value greater than the minimum allowed value. +The parameters describing the bounding box are printed on the filter +log. +

+

The filter accepts the following option: +

+
+
min_val
+

Set the minimal luminance value. Default is 16. +

+
+ + +
+

39.9.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.10 bilateral

+

Apply bilateral filter, spatial smoothing while preserving edges. +

+

The filter accepts the following options: +

+
sigmaS
+

Set sigma of gaussian function to calculate spatial weight. +Allowed range is 0 to 512. Default is 0.1. +

+
+
sigmaR
+

Set sigma of gaussian function to calculate range weight. +Allowed range is 0 to 1. Default is 0.1. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

39.10.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.11 bilateral_cuda

+

CUDA accelerated bilateral filter, an edge preserving filter. +This filter is mathematically accurate thanks to the use of GPU acceleration. +For best output quality, use one to one chroma subsampling, i.e. yuv444p format. +

+

The filter accepts the following options: +

+
sigmaS
+

Set sigma of gaussian function to calculate spatial weight, also called sigma space. +Allowed range is 0.1 to 512. Default is 0.1. +

+
+
sigmaR
+

Set sigma of gaussian function to calculate color range weight, also called sigma color. +Allowed range is 0.1 to 512. Default is 0.1. +

+
+
window_size
+

Set window size of the bilateral function to determine the number of neighbours to loop on. +If the number entered is even, one will be added automatically. +Allowed range is 1 to 255. Default is 1. +

+
+ +
+

39.11.1 Examples

+ +
    +
  • Apply the bilateral filter on a video. + +
    +
    ./ffmpeg -v verbose \
    +-hwaccel cuda -hwaccel_output_format cuda -i input.mp4  \
    +-init_hw_device cuda \
    +-filter_complex \
    +" \
    +[0:v]scale_cuda=format=yuv444p[scaled_video];
    +[scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0" \
    +-an -sn -c:v h264_nvenc -cq 20 out.mp4
    +
    + +
+ +
+
+
+

39.12 bitplanenoise

+ +

Show and measure bit plane noise. +

+

The filter accepts the following options: +

+
+
bitplane
+

Set which plane to analyze. Default is 1. +

+
+
filter
+

Filter out noisy pixels from bitplane set above. +Default is disabled. +

+
+ +
+
+

39.13 blackdetect

+ +

Detect video intervals that are (almost) completely black. Can be +useful to detect chapter transitions, commercials, or invalid +recordings. +

+

The filter outputs its detection analysis to both the log as well as +frame metadata. If a black segment of at least the specified minimum +duration is found, a line with the start and end timestamps as well +as duration is printed to the log with level info. In addition, +a log line with level debug is printed per frame showing the +black amount detected for that frame. +

+

The filter also attaches metadata to the first frame of a black +segment with key lavfi.black_start and to the first frame +after the black segment ends with key lavfi.black_end. The +value is the frame’s timestamp. This metadata is added regardless +of the minimum duration specified. +

+

The filter accepts the following options: +

+
+
black_min_duration, d
+

Set the minimum detected black duration expressed in seconds. It must +be a non-negative floating point number. +

+

Default value is 2.0. +

+
+
picture_black_ratio_th, pic_th
+

Set the threshold for considering a picture "black". +Express the minimum value for the ratio: +

+
nb_black_pixels / nb_pixels
+
+ +

for which a picture is considered black. +Default value is 0.98. +

+
+
pixel_black_th, pix_th
+

Set the threshold for considering a pixel "black". +

+

The threshold expresses the maximum pixel luminance value for which a +pixel is considered "black". The provided value is scaled according to +the following equation: +

+
absolute_threshold = luminance_minimum_value + pixel_black_th * luminance_range_size
+
+ +

luminance_range_size and luminance_minimum_value depend on +the input video format, the range is [0-255] for YUV full-range +formats and [16-235] for YUV non full-range formats. +

+

Default value is 0.10. +

+
+ +

The following example sets the maximum pixel threshold to the minimum +value, and detects only black intervals of 2 or more seconds: +

+
blackdetect=d=2:pix_th=0.00
+
+ +
+
+

39.14 blackframe

+ +

Detect frames that are (almost) completely black. Can be useful to +detect chapter transitions or commercials. Output lines consist of +the frame number of the detected frame, the percentage of blackness, +the position in the file if known or -1 and the timestamp in seconds. +

+

In order to display the output lines, you need to set the loglevel at +least to the AV_LOG_INFO value. +

+

This filter exports frame metadata lavfi.blackframe.pblack. +The value represents the percentage of pixels in the picture that +are below the threshold value. +

+

It accepts the following parameters: +

+
+
amount
+

The percentage of the pixels that have to be below the threshold; it defaults to +98. +

+
+
threshold, thresh
+

The threshold below which a pixel value is considered black; it defaults to +32. +

+
+
+ +
+
+

39.15 blend

+ +

Blend two video frames into each other. +

+

The blend filter takes two input streams and outputs one +stream, the first input is the "top" layer and second input is +"bottom" layer. By default, the output terminates when the longest input terminates. +

+

The tblend (time blend) filter takes two consecutive frames +from one single stream, and outputs the result obtained by blending +the new frame on top of the old frame. +

+

A description of the accepted options follows. +

+
+
c0_mode
+
c1_mode
+
c2_mode
+
c3_mode
+
all_mode
+

Set blend mode for specific pixel component or all pixel components in case +of all_mode. Default value is normal. +

+

Available values for component modes are: +

+
addition
+
and
+
average
+
bleach
+
burn
+
darken
+
difference
+
divide
+
dodge
+
exclusion
+
extremity
+
freeze
+
geometric
+
glow
+
grainextract
+
grainmerge
+
hardlight
+
hardmix
+
hardoverlay
+
harmonic
+
heat
+
interpolate
+
lighten
+
linearlight
+
multiply
+
multiply128
+
negation
+
normal
+
or
+
overlay
+
phoenix
+
pinlight
+
reflect
+
screen
+
softdifference
+
softlight
+
stain
+
subtract
+
vividlight
+
xor
+
+ +
+
c0_opacity
+
c1_opacity
+
c2_opacity
+
c3_opacity
+
all_opacity
+

Set blend opacity for specific pixel component or all pixel components in case +of all_opacity. Only used in combination with pixel component blend modes. +

+
+
c0_expr
+
c1_expr
+
c2_expr
+
c3_expr
+
all_expr
+

Set blend expression for specific pixel component or all pixel components in case +of all_expr. Note that related mode options will be ignored if those are set. +

+

The expressions can use the following variables: +

+
+
N
+

The sequential number of the filtered frame, starting from 0. +

+
+
X
+
Y
+

the coordinates of the current sample +

+
+
W
+
H
+

the width and height of currently filtered plane +

+
+
SW
+
SH
+

Width and height scale for the plane being filtered. It is the +ratio between the dimensions of the current plane to the luma plane, +e.g. for a yuv420p frame, the values are 1,1 for +the luma plane and 0.5,0.5 for the chroma planes. +

+
+
T
+

Time of the current frame, expressed in seconds. +

+
+
TOP, A
+

Value of pixel component at current location for first video frame (top layer). +

+
+
BOTTOM, B
+

Value of pixel component at current location for second video frame (bottom layer). +

+
+
+
+ +

The blend filter also supports the framesync options. +

+ +
+

39.15.1 Examples

+ +
    +
  • Apply transition from bottom layer to top layer in first 10 seconds: +
    +
    blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
    +
    + +
  • Apply linear horizontal transition from top layer to bottom layer: +
    +
    blend=all_expr='A*(X/W)+B*(1-X/W)'
    +
    + +
  • Apply 1x1 checkerboard effect: +
    +
    blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
    +
    + +
  • Apply uncover left effect: +
    +
    blend=all_expr='if(gte(N*SW+X,W),A,B)'
    +
    + +
  • Apply uncover down effect: +
    +
    blend=all_expr='if(gte(Y-N*SH,0),A,B)'
    +
    + +
  • Apply uncover up-left effect: +
    +
    blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
    +
    + +
  • Split diagonally video and shows top and bottom layer on each side: +
    +
    blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
    +
    + +
  • Display differences between the current and the previous frame: +
    +
    tblend=all_mode=grainextract
    +
    +
+ +
+
+

39.15.2 Commands

+

This filter supports same commands as options. +

+
+
+
+

39.16 blockdetect

+ +

Determines blockiness of frames without altering the input frames. +

+

Based on Remco Muijs and Ihor Kirenko: "A no-reference blocking artifact measure for adaptive video processing." 2005 13th European signal processing conference. +

+

The filter accepts the following options: +

+
+
period_min
+
period_max
+

Set minimum and maximum values for determining pixel grids (periods). +Default values are [3,24]. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

39.16.1 Examples

+ +
    +
  • Determine blockiness for the first plane and search for periods within [8,32]: +
    +
    blockdetect=period_min=8:period_max=32:planes=1
    +
    +
+ +
+
+
+

39.17 blurdetect

+ +

Determines blurriness of frames without altering the input frames. +

+

Based on Marziliano, Pina, et al. "A no-reference perceptual blur metric." +Allows for a block-based abbreviation. +

+

The filter accepts the following options: +

+
+
low
+
high
+

Set low and high threshold values used by the Canny thresholding +algorithm. +

+

The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. +

+

low and high threshold values must be chosen in the range +[0,1], and low should be lesser or equal to high. +

+

Default value for low is 20/255, and default value for high +is 50/255. +

+
+
radius
+

Define the radius to search around an edge pixel for local maxima. +

+
+
block_pct
+

Determine blurriness only for the most significant blocks, given in percentage. +

+
+
block_width
+

Determine blurriness for blocks of width block_width. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of block_height. +

+
+
block_height
+

Determine blurriness for blocks of height block_height. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of block_width. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

39.17.1 Examples

+ +
    +
  • Determine blur for 80% of most significant 32x32 blocks: +
    +
    blurdetect=block_width=32:block_height=32:block_pct=80
    +
    +
+ +
+
+
+

39.18 bm3d

+ +

Denoise frames using Block-Matching 3D algorithm. +

+

The filter accepts the following options. +

+
+
sigma
+

Set denoising strength. Default value is 1. +Allowed range is from 0 to 999.9. +The denoising algorithm is very sensitive to sigma, so adjust it +according to the source. +

+
+
block
+

Set local patch size. This sets dimensions in 2D. +

+
+
bstep
+

Set sliding step for processing blocks. Default value is 4. +Allowed range is from 1 to 64. +Smaller values allows processing more reference blocks and is slower. +

+
+
group
+

Set maximal number of similar blocks for 3rd dimension. Default value is 1. +When set to 1, no block matching is done. Larger values allows more blocks +in single group. +Allowed range is from 1 to 256. +

+
+
range
+

Set radius for search block matching. Default is 9. +Allowed range is from 1 to INT32_MAX. +

+
+
mstep
+

Set step between two search locations for block matching. Default is 1. +Allowed range is from 1 to 64. Smaller is slower. +

+
+
thmse
+

Set threshold of mean square error for block matching. Valid range is 0 to +INT32_MAX. +

+
+
hdthr
+

Set thresholding parameter for hard thresholding in 3D transformed domain. +Larger values results in stronger hard-thresholding filtering in frequency +domain. +

+
+
estim
+

Set filtering estimation mode. Can be basic or final. +Default is basic. +

+
+
ref
+

If enabled, filter will use 2nd stream for block matching. +Default is disabled for basic value of estim option, +and always enabled if value of estim is final. +

+
+
planes
+

Set planes to filter. Default is all available except alpha. +

+
+ + +
+

39.18.1 Examples

+ +
    +
  • Basic filtering with bm3d: +
    +
    bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
    +
    + +
  • Same as above, but filtering only luma: +
    +
    bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
    +
    + +
  • Same as above, but with both estimation modes: +
    +
    split[a][b],[a]bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
    +
    + +
  • Same as above, but prefilter with nlmeans filter instead: +
    +
    split[a][b],[a]nlmeans=s=3:r=7:p=3[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
    +
    +
+ +
+
+
+

39.19 boxblur

+ +

Apply a boxblur algorithm to the input video. +

+

It accepts the following parameters: +

+
+
luma_radius, lr
+
luma_power, lp
+
chroma_radius, cr
+
chroma_power, cp
+
alpha_radius, ar
+
alpha_power, ap
+
+ +

A description of the accepted options follows. +

+
+
luma_radius, lr
+
chroma_radius, cr
+
alpha_radius, ar
+

Set an expression for the box radius in pixels used for blurring the +corresponding input plane. +

+

The radius value must be a non-negative number, and must not be +greater than the value of the expression min(w,h)/2 for the +luma and alpha planes, and of min(cw,ch)/2 for the chroma +planes. +

+

Default value for luma_radius is "2". If not specified, +chroma_radius and alpha_radius default to the +corresponding value set for luma_radius. +

+

The expressions can contain the following constants: +

+
w
+
h
+

The input width and height in pixels. +

+
+
cw
+
ch
+

The input chroma image width and height in pixels. +

+
+
hsub
+
vsub
+

The horizontal and vertical chroma subsample values. For example, for the +pixel format "yuv422p", hsub is 2 and vsub is 1. +

+
+ +
+
luma_power, lp
+
chroma_power, cp
+
alpha_power, ap
+

Specify how many times the boxblur filter is applied to the +corresponding plane. +

+

Default value for luma_power is 2. If not specified, +chroma_power and alpha_power default to the +corresponding value set for luma_power. +

+

A value of 0 will disable the effect. +

+
+ + +
+

39.19.1 Examples

+ +
    +
  • Apply a boxblur filter with the luma, chroma, and alpha radii +set to 2: +
    +
    boxblur=luma_radius=2:luma_power=1
    +boxblur=2:1
    +
    + +
  • Set the luma radius to 2, and alpha and chroma radius to 0: +
    +
    boxblur=2:1:cr=0:ar=0
    +
    + +
  • Set the luma and chroma radii to a fraction of the video dimension: +
    +
    boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
    +
    +
+ +
+
+
+

39.20 bwdif

+ +

Deinterlace the input video ("bwdif" stands for "Bob Weaver +Deinterlacing Filter"). +

+

Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic +interpolation algorithms. +It accepts the following parameters: +

+
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
0, send_frame
+

Output one frame for each frame. +

+
1, send_field
+

Output one frame for each field. +

+
+ +

The default value is send_field. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
0, tff
+

Assume the top field is first. +

+
1, bff
+

Assume the bottom field is first. +

+
-1, auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
0, all
+

Deinterlace all frames. +

+
1, interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+ +
+
+

39.21 ccrepack

+ +

Repack CEA-708 closed captioning side data +

+

This filter fixes various issues seen with commerical encoders +related to upstream malformed CEA-708 payloads, specifically +incorrect number of tuples (wrong cc_count for the target FPS), +and incorrect ordering of tuples (i.e. the CEA-608 tuples are not at +the first entries in the payload). +

+
+
+

39.22 cas

+ +

Apply Contrast Adaptive Sharpen filter to video stream. +

+

The filter accepts the following options: +

+
+
strength
+

Set the sharpening strength. Default value is 0. +

+
+
planes
+

Set planes to filter. Default value is to filter all +planes except alpha plane. +

+
+ + +
+

39.22.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

39.23 chromahold

+

Remove all color information for all colors except for certain one. +

+

The filter accepts the following options: +

+
+
color
+

The color which will not be replaced with neutral chroma. +

+
+
similarity
+

Similarity percentage with the above color. +0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +0.0 makes pixels either fully gray, or not gray at all. +Higher values result in more preserved color. +

+
+
yuv
+

Signals that the color passed is already in YUV instead of RGB. +

+

Literal colors like "green" or "red" don’t make sense with this enabled anymore. +This can be used to pass exact YUV values as hexadecimal numbers. +

+
+ + +
+

39.23.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

39.24 chromakey

+

YUV colorspace color/chroma keying. +

+

The filter accepts the following options: +

+
+
color
+

The color which will be replaced with transparency. +

+
+
similarity
+

Similarity percentage with the key color. +

+

0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +

+

0.0 makes pixels either fully transparent, or not transparent at all. +

+

Higher values result in semi-transparent pixels, with a higher transparency +the more similar the pixels color is to the key color. +

+
+
yuv
+

Signals that the color passed is already in YUV instead of RGB. +

+

Literal colors like "green" or "red" don’t make sense with this enabled anymore. +This can be used to pass exact YUV values as hexadecimal numbers. +

+
+ + +
+

39.24.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+

39.24.2 Examples

+ +
    +
  • Make every green pixel in the input image transparent: +
    +
    ffmpeg -i input.png -vf chromakey=green out.png
    +
    + +
  • Overlay a greenscreen-video on top of a static black background. +
    +
    ffmpeg -f lavfi -i color=c=black:s=1280x720 -i video.mp4 -shortest -filter_complex "[1:v]chromakey=0x70de77:0.1:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.mkv
    +
    +
+ +
+
+
+

39.25 chromakey_cuda

+

CUDA accelerated YUV colorspace color/chroma keying. +

+

This filter works like normal chromakey filter but operates on CUDA frames. +for more details and parameters see chromakey. +

+ +
+

39.25.1 Examples

+ +
    +
  • Make all the green pixels in the input video transparent and use it as an overlay for another video: + +
    +
    ./ffmpeg \
    +    -hwaccel cuda -hwaccel_output_format cuda -i input_green.mp4  \
    +    -hwaccel cuda -hwaccel_output_format cuda -i base_video.mp4 \
    +    -init_hw_device cuda \
    +    -filter_complex \
    +    " \
    +        [0:v]chromakey_cuda=0x25302D:0.1:0.12:1[overlay_video]; \
    +        [1:v]scale_cuda=format=yuv420p[base]; \
    +        [base][overlay_video]overlay_cuda" \
    +    -an -sn -c:v h264_nvenc -cq 20 output.mp4
    +
    + +
  • Process two software sources, explicitly uploading the frames: + +
    +
    ./ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda \
    +    -f lavfi -i color=size=800x600:color=white,format=yuv420p \
    +    -f lavfi -i yuvtestsrc=size=200x200,format=yuv420p \
    +    -filter_complex \
    +    " \
    +        [0]hwupload[under]; \
    +        [1]hwupload,chromakey_cuda=green:0.1:0.12[over]; \
    +        [under][over]overlay_cuda" \
    +    -c:v hevc_nvenc -cq 18 -preset slow output.mp4
    +
    + +
+ +
+
+
+

39.26 chromanr

+

Reduce chrominance noise. +

+

The filter accepts the following options: +

+
+
thres
+

Set threshold for averaging chrominance values. +Sum of absolute difference of Y, U and V pixel components of current +pixel and neighbour pixels lower than this threshold will be used in +averaging. Luma component is left unchanged and is copied to output. +Default value is 30. Allowed range is from 1 to 200. +

+
+
sizew
+

Set horizontal radius of rectangle used for averaging. +Allowed range is from 1 to 100. Default value is 5. +

+
+
sizeh
+

Set vertical radius of rectangle used for averaging. +Allowed range is from 1 to 100. Default value is 5. +

+
+
stepw
+

Set horizontal step when averaging. Default value is 1. +Allowed range is from 1 to 50. +Mostly useful to speed-up filtering. +

+
+
steph
+

Set vertical step when averaging. Default value is 1. +Allowed range is from 1 to 50. +Mostly useful to speed-up filtering. +

+
+
threy
+

Set Y threshold for averaging chrominance values. +Set finer control for max allowed difference between Y components +of current pixel and neigbour pixels. +Default value is 200. Allowed range is from 1 to 200. +

+
+
threu
+

Set U threshold for averaging chrominance values. +Set finer control for max allowed difference between U components +of current pixel and neigbour pixels. +Default value is 200. Allowed range is from 1 to 200. +

+
+
threv
+

Set V threshold for averaging chrominance values. +Set finer control for max allowed difference between V components +of current pixel and neigbour pixels. +Default value is 200. Allowed range is from 1 to 200. +

+
+
distance
+

Set distance type used in calculations. +

+
+
manhattan
+

Absolute difference. +

+
euclidean
+

Difference squared. +

+
+ +

Default distance type is manhattan. +

+
+ + +
+

39.26.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+
+
+
+

39.27 chromashift

+

Shift chroma pixels horizontally and/or vertically. +

+

The filter accepts the following options: +

+
cbh
+

Set amount to shift chroma-blue horizontally. +

+
cbv
+

Set amount to shift chroma-blue vertically. +

+
crh
+

Set amount to shift chroma-red horizontally. +

+
crv
+

Set amount to shift chroma-red vertically. +

+
edge
+

Set edge mode, can be smear, default, or warp. +

+
+ + +
+

39.27.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.28 ciescope

+ +

Display CIE color diagram with pixels overlaid onto it. +

+

The filter accepts the following options: +

+
+
system
+

Set color system. +

+
+
ntsc, 470m
+
ebu, 470bg
+
smpte
+
240m
+
apple
+
widergb
+
cie1931
+
rec709, hdtv
+
uhdtv, rec2020
+
dcip3
+
+ +
+
cie
+

Set CIE system. +

+
+
xyy
+
ucs
+
luv
+
+ +
+
gamuts
+

Set what gamuts to draw. +

+

See system option for available values. +

+
+
size, s
+

Set ciescope size, by default set to 512. +

+
+
intensity, i
+

Set intensity used to map input pixel values to CIE diagram. +

+
+
contrast
+

Set contrast used to draw tongue colors that are out of active color system gamut. +

+
+
corrgamma
+

Correct gamma displayed on scope, by default enabled. +

+
+
showwhite
+

Show white point on CIE diagram, by default disabled. +

+
+
gamma
+

Set input gamma. Used only with XYZ input color space. +

+
+
fill
+

Fill with CIE colors. By default is enabled. +

+
+ +
+
+

39.29 codecview

+ +

Visualize information exported by some codecs. +

+

Some codecs can export information through frames using side-data or other +means. For example, some MPEG based codecs export motion vectors through the +export_mvs flag in the codec flags2 option. +

+

The filter accepts the following option: +

+
+
block
+

Display block partition structure using the luma plane. +

+
+
mv
+

Set motion vectors to visualize. +

+

Available flags for mv are: +

+
+
pf
+

forward predicted MVs of P-frames +

+
bf
+

forward predicted MVs of B-frames +

+
bb
+

backward predicted MVs of B-frames +

+
+ +
+
qp
+

Display quantization parameters using the chroma planes. +

+
+
mv_type, mvt
+

Set motion vectors type to visualize. Includes MVs from all frames unless specified by frame_type option. +

+

Available flags for mv_type are: +

+
+
fp
+

forward predicted MVs +

+
bp
+

backward predicted MVs +

+
+ +
+
frame_type, ft
+

Set frame type to visualize motion vectors of. +

+

Available flags for frame_type are: +

+
+
if
+

intra-coded frames (I-frames) +

+
pf
+

predicted frames (P-frames) +

+
bf
+

bi-directionally predicted frames (B-frames) +

+
+
+
+ + +
+

39.29.1 Examples

+ +
    +
  • Visualize forward predicted MVs of all frames using ffplay: +
    +
    ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
    +
    + +
  • Visualize multi-directionals MVs of P and B-Frames using ffplay: +
    +
    ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
    +
    +
+ +
+
+
+

39.30 colorbalance

+

Modify intensity of primary colors (red, green and blue) of input frames. +

+

The filter allows an input frame to be adjusted in the shadows, midtones or highlights +regions for the red-cyan, green-magenta or blue-yellow balance. +

+

A positive adjustment value shifts the balance towards the primary color, a negative +value towards the complementary color. +

+

The filter accepts the following options: +

+
+
rs
+
gs
+
bs
+

Adjust red, green and blue shadows (darkest pixels). +

+
+
rm
+
gm
+
bm
+

Adjust red, green and blue midtones (medium pixels). +

+
+
rh
+
gh
+
bh
+

Adjust red, green and blue highlights (brightest pixels). +

+

Allowed ranges for options are [-1.0, 1.0]. Defaults are 0. +

+
+
pl
+

Preserve lightness when changing color balance. Default is disabled. +

+
+ + +
+

39.30.1 Examples

+ +
    +
  • Add red color cast to shadows: +
    +
    colorbalance=rs=.3
    +
    +
+ +
+
+

39.30.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.31 colorcontrast

+ +

Adjust color contrast between RGB components. +

+

The filter accepts the following options: +

+
+
rc
+

Set the red-cyan contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. +

+
+
gm
+

Set the green-magenta contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. +

+
+
by
+

Set the blue-yellow contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. +

+
+
rcw
+
gmw
+
byw
+

Set the weight of each rc, gm, by option value. Default value is 0.0. +Allowed range is from 0.0 to 1.0. If all weights are 0.0 filtering is disabled. +

+
+
pl
+

Set the amount of preserving lightness. Default value is 0.0. Allowed range is from 0.0 to 1.0. +

+
+ + +
+

39.31.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.32 colorcorrect

+ +

Adjust color white balance selectively for blacks and whites. +This filter operates in YUV colorspace. +

+

The filter accepts the following options: +

+
+
rl
+

Set the red shadow spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
bl
+

Set the blue shadow spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
rh
+

Set the red highlight spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
bh
+

Set the blue highlight spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
saturation
+

Set the amount of saturation. Allowed range is from -3.0 to 3.0. +Default value is 1. +

+
+
analyze
+

If set to anything other than manual it will analyze every frame and use derived +parameters for filtering output frame. +

+

Possible values are: +

+
manual
+
average
+
minmax
+
median
+
+

Default value is manual. +

+
+ + +
+

39.32.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.33 colorchannelmixer

+ +

Adjust video input frames by re-mixing color channels. +

+

This filter modifies a color channel by adding the values associated to +the other channels of the same pixels. For example if the value to +modify is red, the output value will be: +

+
red=red*rr + blue*rb + green*rg + alpha*ra
+
+ +

The filter accepts the following options: +

+
+
rr
+
rg
+
rb
+
ra
+

Adjust contribution of input red, green, blue and alpha channels for output red channel. +Default is 1 for rr, and 0 for rg, rb and ra. +

+
+
gr
+
gg
+
gb
+
ga
+

Adjust contribution of input red, green, blue and alpha channels for output green channel. +Default is 1 for gg, and 0 for gr, gb and ga. +

+
+
br
+
bg
+
bb
+
ba
+

Adjust contribution of input red, green, blue and alpha channels for output blue channel. +Default is 1 for bb, and 0 for br, bg and ba. +

+
+
ar
+
ag
+
ab
+
aa
+

Adjust contribution of input red, green, blue and alpha channels for output alpha channel. +Default is 1 for aa, and 0 for ar, ag and ab. +

+

Allowed ranges for options are [-2.0, 2.0]. +

+
+
pc
+

Set preserve color mode. The accepted values are: +

+
none
+

Disable color preserving, this is default. +

+
lum
+

Preserve luminance. +

+
max
+

Preserve max value of RGB triplet. +

+
avg
+

Preserve average value of RGB triplet. +

+
sum
+

Preserve sum value of RGB triplet. +

+
nrm
+

Preserve normalized value of RGB triplet. +

+
pwr
+

Preserve power value of RGB triplet. +

+
+ +
+
pa
+

Set the preserve color amount when changing colors. Allowed range is from [0.0, 1.0]. +Default is 0.0, thus disabled. +

+
+ + +
+

39.33.1 Examples

+ +
    +
  • Convert source to grayscale: +
    +
    colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
    +
    +
  • Simulate sepia tones: +
    +
    colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
    +
    +
+ +
+
+

39.33.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.34 colorize

+

Overlay a solid color on the video stream. +

+

The filter accepts the following options: +

+
+
hue
+

Set the color hue. Allowed range is from 0 to 360. +Default value is 0. +

+
+
saturation
+

Set the color saturation. Allowed range is from 0 to 1. +Default value is 0.5. +

+
+
lightness
+

Set the color lightness. Allowed range is from 0 to 1. +Default value is 0.5. +

+
+
mix
+

Set the mix of source lightness. By default is set to 1.0. +Allowed range is from 0.0 to 1.0. +

+
+ + +
+

39.34.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.35 colorkey

+

RGB colorspace color keying. +This filter operates on 8-bit RGB format frames by setting the alpha component of each pixel +which falls within the similarity radius of the key color to 0. The alpha value for pixels outside +the similarity radius depends on the value of the blend option. +

+

The filter accepts the following options: +

+
+
color
+

Set the color for which alpha will be set to 0 (full transparency). +See (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +Default is black. +

+
+
similarity
+

Set the radius from the key color within which other colors also have full transparency. +The computed distance is related to the unit fractional distance in 3D space between the RGB values +of the key color and the pixel’s color. Range is 0.01 to 1.0. 0.01 matches within a very small radius +around the exact key color, while 1.0 matches everything. +Default is 0.01. +

+
+
blend
+

Set how the alpha value for pixels that fall outside the similarity radius is computed. +0.0 makes pixels either fully transparent or fully opaque. +Higher values result in semi-transparent pixels, with greater transparency +the more similar the pixel color is to the key color. +Range is 0.0 to 1.0. Default is 0.0. +

+
+ + +
+

39.35.1 Examples

+ +
    +
  • Make every green pixel in the input image transparent: +
    +
    ffmpeg -i input.png -vf colorkey=green out.png
    +
    + +
  • Overlay a greenscreen-video on top of a static background image. +
    +
    ffmpeg -i background.png -i video.mp4 -filter_complex "[1:v]colorkey=0x3BBD1E:0.3:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.flv
    +
    +
+ +
+
+

39.35.2 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

39.36 colorhold

+

Remove all color information for all RGB colors except for certain one. +

+

The filter accepts the following options: +

+
+
color
+

The color which will not be replaced with neutral gray. +

+
+
similarity
+

Similarity percentage with the above color. +0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. 0.0 makes pixels fully gray. +Higher values result in more preserved color. +

+
+ + +
+

39.36.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

39.37 colorlevels

+ +

Adjust video input frames using levels. +

+

The filter accepts the following options: +

+
+
rimin
+
gimin
+
bimin
+
aimin
+

Adjust red, green, blue and alpha input black point. +Allowed ranges for options are [-1.0, 1.0]. Defaults are 0. +

+
+
rimax
+
gimax
+
bimax
+
aimax
+

Adjust red, green, blue and alpha input white point. +Allowed ranges for options are [-1.0, 1.0]. Defaults are 1. +

+

Input levels are used to lighten highlights (bright tones), darken shadows +(dark tones), change the balance of bright and dark tones. +

+
+
romin
+
gomin
+
bomin
+
aomin
+

Adjust red, green, blue and alpha output black point. +Allowed ranges for options are [0, 1.0]. Defaults are 0. +

+
+
romax
+
gomax
+
bomax
+
aomax
+

Adjust red, green, blue and alpha output white point. +Allowed ranges for options are [0, 1.0]. Defaults are 1. +

+

Output levels allows manual selection of a constrained output level range. +

+
+
preserve
+

Set preserve color mode. The accepted values are: +

+
none
+

Disable color preserving, this is default. +

+
lum
+

Preserve luminance. +

+
max
+

Preserve max value of RGB triplet. +

+
avg
+

Preserve average value of RGB triplet. +

+
sum
+

Preserve sum value of RGB triplet. +

+
nrm
+

Preserve normalized value of RGB triplet. +

+
pwr
+

Preserve power value of RGB triplet. +

+
+
+
+ + +
+

39.37.1 Examples

+ +
    +
  • Make video output darker: +
    +
    colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
    +
    + +
  • Increase contrast: +
    +
    colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
    +
    + +
  • Make video output lighter: +
    +
    colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
    +
    + +
  • Increase brightness: +
    +
    colorlevels=romin=0.5:gomin=0.5:bomin=0.5
    +
    +
+ +
+
+

39.37.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.38 colormap

+

Apply custom color maps to video stream. +

+

This filter needs three input video streams. +First stream is video stream that is going to be filtered out. +Second and third video stream specify color patches for source +color to target color mapping. +

+

The filter accepts the following options: +

+
+
patch_size
+

Set the source and target video stream patch size in pixels. +

+
+
nb_patches
+

Set the max number of used patches from source and target video stream. +Default value is number of patches available in additional video streams. +Max allowed number of patches is 64. +

+
+
type
+

Set the adjustments used for target colors. Can be relative or absolute. +Defaults is absolute. +

+
+
kernel
+

Set the kernel used to measure color differences between mapped colors. +

+

The accepted values are: +

+
euclidean
+
weuclidean
+
+ +

Default is euclidean. +

+
+ +
+
+

39.39 colormatrix

+ +

Convert color matrix. +

+

The filter accepts the following options: +

+
+
src
+
dst
+

Specify the source and destination color matrix. Both values must be +specified. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
fcc
+

FCC +

+
+
bt601
+

BT.601 +

+
+
bt470
+

BT.470 +

+
+
bt470bg
+

BT.470BG +

+
+
smpte170m
+

SMPTE-170M +

+
+
smpte240m
+

SMPTE-240M +

+
+
bt2020
+

BT.2020 +

+
+
+
+ +

For example to convert from BT.601 to SMPTE-240M, use the command: +

+
colormatrix=bt601:smpte240m
+
+ +
+
+

39.40 colorspace

+ +

Convert colorspace, transfer characteristics or color primaries. +Input video needs to have an even size. +

+

The filter accepts the following options: +

+
+
+
all
+

Specify all color properties at once. +

+

The accepted values are: +

+
bt470m
+

BT.470M +

+
+
bt470bg
+

BT.470BG +

+
+
bt601-6-525
+

BT.601-6 525 +

+
+
bt601-6-625
+

BT.601-6 625 +

+
+
bt709
+

BT.709 +

+
+
smpte170m
+

SMPTE-170M +

+
+
smpte240m
+

SMPTE-240M +

+
+
bt2020
+

BT.2020 +

+
+
+ +
+
space
+

Specify output colorspace. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
fcc
+

FCC +

+
+
bt470bg
+

BT.470BG or BT.601-6 625 +

+
+
smpte170m
+

SMPTE-170M or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
ycgco
+

YCgCo +

+
+
bt2020ncl
+

BT.2020 with non-constant luminance +

+
+
+ +
+
trc
+

Specify output transfer characteristics. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
bt470m
+

BT.470M +

+
+
bt470bg
+

BT.470BG +

+
+
gamma22
+

Constant gamma of 2.2 +

+
+
gamma28
+

Constant gamma of 2.8 +

+
+
smpte170m
+

SMPTE-170M, BT.601-6 625 or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
srgb
+

SRGB +

+
+
iec61966-2-1
+

iec61966-2-1 +

+
+
iec61966-2-4
+

iec61966-2-4 +

+
+
xvycc
+

xvycc +

+
+
bt2020-10
+

BT.2020 for 10-bits content +

+
+
bt2020-12
+

BT.2020 for 12-bits content +

+
+
+ +
+
primaries
+

Specify output color primaries. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
bt470m
+

BT.470M +

+
+
bt470bg
+

BT.470BG or BT.601-6 625 +

+
+
smpte170m
+

SMPTE-170M or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
film
+

film +

+
+
smpte431
+

SMPTE-431 +

+
+
smpte432
+

SMPTE-432 +

+
+
bt2020
+

BT.2020 +

+
+
jedec-p22
+

JEDEC P22 phosphors +

+
+
+ +
+
range
+

Specify output color range. +

+

The accepted values are: +

+
tv
+

TV (restricted) range +

+
+
mpeg
+

MPEG (restricted) range +

+
+
pc
+

PC (full) range +

+
+
jpeg
+

JPEG (full) range +

+
+
+ +
+
format
+

Specify output color format. +

+

The accepted values are: +

+
yuv420p
+

YUV 4:2:0 planar 8-bits +

+
+
yuv420p10
+

YUV 4:2:0 planar 10-bits +

+
+
yuv420p12
+

YUV 4:2:0 planar 12-bits +

+
+
yuv422p
+

YUV 4:2:2 planar 8-bits +

+
+
yuv422p10
+

YUV 4:2:2 planar 10-bits +

+
+
yuv422p12
+

YUV 4:2:2 planar 12-bits +

+
+
yuv444p
+

YUV 4:4:4 planar 8-bits +

+
+
yuv444p10
+

YUV 4:4:4 planar 10-bits +

+
+
yuv444p12
+

YUV 4:4:4 planar 12-bits +

+
+
+ +
+
fast
+

Do a fast conversion, which skips gamma/primary correction. This will take +significantly less CPU, but will be mathematically incorrect. To get output +compatible with that produced by the colormatrix filter, use fast=1. +

+
+
dither
+

Specify dithering mode. +

+

The accepted values are: +

+
none
+

No dithering +

+
+
fsb
+

Floyd-Steinberg dithering +

+
+ +
+
wpadapt
+

Whitepoint adaptation mode. +

+

The accepted values are: +

+
bradford
+

Bradford whitepoint adaptation +

+
+
vonkries
+

von Kries whitepoint adaptation +

+
+
identity
+

identity whitepoint adaptation (i.e. no whitepoint adaptation) +

+
+ +
+
iall
+

Override all input properties at once. Same accepted values as all. +

+
+
ispace
+

Override input colorspace. Same accepted values as space. +

+
+
iprimaries
+

Override input color primaries. Same accepted values as primaries. +

+
+
itrc
+

Override input transfer characteristics. Same accepted values as trc. +

+
+
irange
+

Override input color range. Same accepted values as range. +

+
+
+ +

The filter converts the transfer characteristics, color space and color +primaries to the specified user values. The output value, if not specified, +is set to a default value based on the "all" property. If that property is +also not specified, the filter will log an error. The output color range and +format default to the same value as the input color range and format. The +input transfer characteristics, color space, color primaries and color range +should be set on the input data. If any of these are missing, the filter will +log an error and no conversion will take place. +

+

For example to convert the input to SMPTE-240M, use the command: +

+
colorspace=smpte240m
+
+ +
+
+

39.41 colorspace_cuda

+ +

CUDA accelerated implementation of the colorspace filter. +

+

It is by no means feature complete compared to the software colorspace filter, +and at the current time only supports color range conversion between jpeg/full +and mpeg/limited range. +

+

The filter accepts the following options: +

+
+
range
+

Specify output color range. +

+

The accepted values are: +

+
tv
+

TV (restricted) range +

+
+
mpeg
+

MPEG (restricted) range +

+
+
pc
+

PC (full) range +

+
+
jpeg
+

JPEG (full) range +

+
+
+ +
+
+ +
+
+

39.42 colortemperature

+

Adjust color temperature in video to simulate variations in ambient color temperature. +

+

The filter accepts the following options: +

+
+
temperature
+

Set the temperature in Kelvin. Allowed range is from 1000 to 40000. +Default value is 6500 K. +

+
+
mix
+

Set mixing with filtered output. Allowed range is from 0 to 1. +Default value is 1. +

+
+
pl
+

Set the amount of preserving lightness. Allowed range is from 0 to 1. +Default value is 0. +

+
+ + +
+

39.42.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

39.43 convolution

+ +

Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements. +

+

The filter accepts the following options: +

+
+
0m
+
1m
+
2m
+
3m
+

Set matrix for each plane. +Matrix is sequence of 9, 25 or 49 signed integers in square mode, +and from 1 to 49 odd number of signed integers in row mode. +

+
+
0rdiv
+
1rdiv
+
2rdiv
+
3rdiv
+

Set multiplier for calculated value for each plane. +If unset or 0, it will be sum of all matrix elements. +

+
+
0bias
+
1bias
+
2bias
+
3bias
+

Set bias for each plane. This value is added to the result of the multiplication. +Useful for making the overall image brighter or darker. Default is 0.0. +

+
+
0mode
+
1mode
+
2mode
+
3mode
+

Set matrix mode for each plane. Can be square, row or column. +Default is square. +

+
+ + +
+

39.43.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

39.43.2 Examples

+ +
    +
  • Apply sharpen: +
    +
    convolution="0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0"
    +
    + +
  • Apply blur: +
    +
    convolution="1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9"
    +
    + +
  • Apply edge enhance: +
    +
    convolution="0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128"
    +
    + +
  • Apply edge detect: +
    +
    convolution="0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128"
    +
    + +
  • Apply laplacian edge detector which includes diagonals: +
    +
    convolution="1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0"
    +
    + +
  • Apply emboss: +
    +
    convolution="-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2"
    +
    +
+ +
+
+
+

39.44 convolve

+ +

Apply 2D convolution of video stream in frequency domain using second stream +as impulse. +

+

The filter accepts the following options: +

+
+
planes
+

Set which planes to process. +

+
+
impulse
+

Set which impulse video frames will be processed, can be first +or all. Default is all. +

+
+ +

The convolve filter also supports the framesync options. +

+
+
+

39.45 copy

+ +

Copy the input video source unchanged to the output. This is mainly useful for +testing purposes. +

+
+
+

39.46 coreimage

+

Video filtering on GPU using Apple’s CoreImage API on OSX. +

+

Hardware acceleration is based on an OpenGL context. Usually, this means it is +processed by video hardware. However, software-based OpenGL implementations +exist which means there is no guarantee for hardware processing. It depends on +the respective OSX. +

+

There are many filters and image generators provided by Apple that come with a +large variety of options. The filter has to be referenced by its name along +with its options. +

+

The coreimage filter accepts the following options: +

+
list_filters
+

List all available filters and generators along with all their respective +options as well as possible minimum and maximum values along with the default +values. +

+
list_filters=true
+
+ +
+
filter
+

Specify all filters by their respective name and options. +Use list_filters to determine all valid filter names and options. +Numerical options are specified by a float value and are automatically clamped +to their respective value range. Vector and color options have to be specified +by a list of space separated float values. Character escaping has to be done. +A special option name default is available to use default options for a +filter. +

+

It is required to specify either default or at least one of the filter options. +All omitted options are used with their default values. +The syntax of the filter string is as follows: +

+
filter=<NAME>@<OPTION>=<VALUE>[@<OPTION>=<VALUE>][@...][#<NAME>@<OPTION>=<VALUE>[@<OPTION>=<VALUE>][@...]][#...]
+
+ +
+
output_rect
+

Specify a rectangle where the output of the filter chain is copied into the +input image. It is given by a list of space separated float values: +

+
output_rect=x\ y\ width\ height
+
+

If not given, the output rectangle equals the dimensions of the input image. +The output rectangle is automatically cropped at the borders of the input +image. Negative values are valid for each component. +

+
output_rect=25\ 25\ 100\ 100
+
+
+
+ +

Several filters can be chained for successive processing without GPU-HOST +transfers allowing for fast processing of complex filter chains. +Currently, only filters with zero (generators) or exactly one (filters) input +image and one output image are supported. Also, transition filters are not yet +usable as intended. +

+

Some filters generate output images with additional padding depending on the +respective filter kernel. The padding is automatically removed to ensure the +filter output has the same size as the input image. +

+

For image generators, the size of the output image is determined by the +previous output image of the filter chain or the input image of the whole +filterchain, respectively. The generators do not use the pixel information of +this image to generate their output. However, the generated output is +blended onto this image, resulting in partial or complete coverage of the +output image. +

+

The coreimagesrc video source can be used for generating input images +which are directly fed into the filter chain. By using it, providing input +images by another video source or an input video is not required. +

+ +
+

39.46.1 Examples

+ +
    +
  • List all filters available: +
    +
    coreimage=list_filters=true
    +
    + +
  • Use the CIBoxBlur filter with default options to blur an image: +
    +
    coreimage=filter=CIBoxBlur@default
    +
    + +
  • Use a filter chain with CISepiaTone at default values and CIVignetteEffect with +its center at 100x100 and a radius of 50 pixels: +
    +
    coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
    +
    + +
  • Use nullsrc and CIQRCodeGenerator to create a QR code for the FFmpeg homepage, +given as complete and escaped command-line for Apple’s standard bash shell: +
    +
    ffmpeg -f lavfi -i nullsrc=s=100x100,coreimage=filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
    +
    +
+ +
+
+
+

39.47 corr

+ +

Obtain the correlation between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained per component, average, min and max correlation is printed through +the logging system. +

+

The filter stores the calculated correlation of each frame in frame metadata. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi corr -f null -
+
+ +
+
+

39.48 cover_rect

+ +

Cover a rectangular object +

+

It accepts the following options: +

+
+
cover
+

Filepath of the optional cover image, needs to be in yuv420. +

+
+
mode
+

Set covering mode. +

+

It accepts the following values: +

+
cover
+

cover it by the supplied image +

+
blur
+

cover it by interpolating the surrounding pixels +

+
+ +

Default value is blur. +

+
+ + +
+

39.48.1 Examples

+ +
    +
  • Cover a rectangular object by the supplied image of a given video using ffmpeg: +
    +
    ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
    +
    +
+ +
+
+
+

39.49 crop

+ +

Crop the input video to given dimensions. +

+

It accepts the following parameters: +

+
+
w, out_w
+

The width of the output video. It defaults to iw. +This expression is evaluated only once during the filter +configuration, or when the ‘w’ or ‘out_w’ command is sent. +

+
+
h, out_h
+

The height of the output video. It defaults to ih. +This expression is evaluated only once during the filter +configuration, or when the ‘h’ or ‘out_h’ command is sent. +

+
+
x
+

The horizontal position, in the input video, of the left edge of the output +video. It defaults to (in_w-out_w)/2. +This expression is evaluated per-frame. +

+
+
y
+

The vertical position, in the input video, of the top edge of the output video. +It defaults to (in_h-out_h)/2. +This expression is evaluated per-frame. +

+
+
keep_aspect
+

If set to 1 will force the output display aspect ratio +to be the same of the input, by changing the output sample aspect +ratio. It defaults to 0. +

+
+
exact
+

Enable exact cropping. If enabled, subsampled videos will be cropped at exact +width/height/x/y as specified and will not be rounded to nearest smaller value. +It defaults to 0. +

+
+ +

The out_w, out_h, x, y parameters are +expressions containing the following constants: +

+
+
x
+
y
+

The computed values for x and y. They are evaluated for +each new frame. +

+
+
in_w
+
in_h
+

The input width and height. +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (cropped) width and height. +

+
+
ow
+
oh
+

These are the same as out_w and out_h. +

+
+
a
+

same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (iw / ih) * sar +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
n
+

The number of the input frame, starting from 0. +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, +do not use +

+
+
t
+

The timestamp expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
+ +

The expression for out_w may depend on the value of out_h, +and the expression for out_h may depend on out_w, but they +cannot depend on x and y, as x and y are +evaluated after out_w and out_h. +

+

The x and y parameters specify the expressions for the +position of the top-left corner of the output (non-cropped) area. They +are evaluated for each frame. If the evaluated value is not valid, it +is approximated to the nearest valid value. +

+

The expression for x may depend on y, and the expression +for y may depend on x. +

+ +
+

39.49.1 Examples

+ +
    +
  • Crop area with size 100x100 at position (12,34). +
    +
    crop=100:100:12:34
    +
    + +

    Using named options, the example above becomes: +

    +
    crop=w=100:h=100:x=12:y=34
    +
    + +
  • Crop the central input area with size 100x100: +
    +
    crop=100:100
    +
    + +
  • Crop the central input area with size 2/3 of the input video: +
    +
    crop=2/3*in_w:2/3*in_h
    +
    + +
  • Crop the input video central square: +
    +
    crop=out_w=in_h
    +crop=in_h
    +
    + +
  • Delimit the rectangle with the top-left corner placed at position +100:100 and the right-bottom corner corresponding to the right-bottom +corner of the input image. +
    +
    crop=in_w-100:in_h-100:100:100
    +
    + +
  • Crop 10 pixels from the left and right borders, and 20 pixels from +the top and bottom borders +
    +
    crop=in_w-2*10:in_h-2*20
    +
    + +
  • Keep only the bottom right quarter of the input image: +
    +
    crop=in_w/2:in_h/2:in_w/2:in_h/2
    +
    + +
  • Crop height for getting Greek harmony: +
    +
    crop=in_w:1/PHI*in_w
    +
    + +
  • Apply trembling effect: +
    +
    crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)
    +
    + +
  • Apply erratic camera effect depending on timestamp: +
    +
    crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)
    +
    + +
  • Set x depending on the value of y: +
    +
    crop=in_w/2:in_h/2:y:10+10*sin(n/10)
    +
    +
+ +
+
+

39.49.2 Commands

+ +

This filter supports the following commands: +

+
w, out_w
+
h, out_h
+
x
+
y
+

Set width/height of the output video and the horizontal/vertical position +in the input video. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

39.50 cropdetect

+ +

Auto-detect the crop size. +

+

It calculates the necessary cropping parameters and prints the +recommended parameters via the logging system. The detected dimensions +correspond to the non-black or video area of the input video according to mode. +

+

It accepts the following parameters: +

+
+
mode
+

Depending on mode crop detection is based on either the mere black value of surrounding pixels or a combination of motion vectors and edge pixels. +

+
+
black
+

Detect black pixels surrounding the playing video. For fine control use option limit. +

+
+
mvedges
+

Detect the playing video by the motion vectors inside the video and scanning for edge pixels typically forming the border of a playing video. +

+
+ +
+
limit
+

Set higher black value threshold, which can be optionally specified +from nothing (0) to everything (255 for 8-bit based formats). An intensity +value greater to the set value is considered non-black. It defaults to 24. +You can also specify a value between 0.0 and 1.0 which will be scaled depending +on the bitdepth of the pixel format. +

+
+
round
+

The value which the width/height should be divisible by. It defaults to +16. The offset is automatically adjusted to center the video. Use 2 to +get only even dimensions (needed for 4:2:2 video). 16 is best when +encoding to most video codecs. +

+
+
skip
+

Set the number of initial frames for which evaluation is skipped. +Default is 2. Range is 0 to INT_MAX. +

+
+
reset_count, reset
+

Set the counter that determines after how many frames cropdetect will +reset the previously detected largest video area and start over to +detect the current optimal crop area. Default value is 0. +

+

This can be useful when channel logos distort the video area. 0 +indicates ’never reset’, and returns the largest area encountered during +playback. +

+
+
mv_threshold
+

Set motion in pixel units as threshold for motion detection. It defaults to 8. +

+
+
low
+
high
+

Set low and high threshold values used by the Canny thresholding +algorithm. +

+

The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. +

+

low and high threshold values must be chosen in the range +[0,1], and low should be lesser or equal to high. +

+

Default value for low is 5/255, and default value for high +is 15/255. +

+
+ + +
+

39.50.1 Examples

+ +
    +
  • Find video area surrounded by black borders: +
    +
    ffmpeg -i file.mp4 -vf cropdetect,metadata=mode=print -f null -
    +
    + +
  • Find an embedded video area, generate motion vectors beforehand: +
    +
    ffmpeg -i file.mp4 -vf mestimate,cropdetect=mode=mvedges,metadata=mode=print -f null -
    +
    + +
  • Find an embedded video area, use motion vectors from decoder: +
    +
    ffmpeg -flags2 +export_mvs -i file.mp4 -vf cropdetect=mode=mvedges,metadata=mode=print -f null -
    +
    +
+ +
+
+

39.50.2 Commands

+ +

This filter supports the following commands: +

+
+
limit
+

The command accepts the same syntax of the corresponding option. +If the specified expression is not valid, it is kept at its current value. +

+
+ +
+
+
+

39.51 cue

+ +

Delay video filtering until a given wallclock timestamp. The filter first +passes on preroll amount of frames, then it buffers at most +buffer amount of frames and waits for the cue. After reaching the cue +it forwards the buffered frames and also any subsequent frames coming in its +input. +

+

The filter can be used synchronize the output of multiple ffmpeg processes for +realtime output devices like decklink. By putting the delay in the filtering +chain and pre-buffering frames the process can pass on data to output almost +immediately after the target wallclock timestamp is reached. +

+

Perfect frame accuracy cannot be guaranteed, but the result is good enough for +some use cases. +

+
+
cue
+

The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0. +

+
+
preroll
+

The duration of content to pass on as preroll expressed in seconds. Default is 0. +

+
+
buffer
+

The maximum duration of content to buffer before waiting for the cue expressed +in seconds. Default is 0. +

+
+
+ +
+
+

39.52 curves

+ +

Apply color adjustments using curves. +

+

This filter is similar to the Adobe Photoshop and GIMP curves tools. Each +component (red, green and blue) has its values defined by N key points +tied from each other using a smooth curve. The x-axis represents the pixel +values from the input frame, and the y-axis the new pixel values to be set for +the output frame. +

+

By default, a component curve is defined by the two points (0;0) and +(1;1). This creates a straight line where each original pixel value is +"adjusted" to its own value, which means no change to the image. +

+

The filter allows you to redefine these two points and add some more. A new +curve will be define to pass smoothly through all these new coordinates. The +new defined points needs to be strictly increasing over the x-axis, and their +x and y values must be in the [0;1] interval. The curve is +formed by using a natural or monotonic cubic spline interpolation, depending +on the interp option (default: natural). The natural +spline produces a smoother curve in general while the monotonic (pchip) +spline guarantees the transitions between the specified points to be +monotonic. If the computed curves happened to go outside the vector spaces, +the values will be clipped accordingly. +

+

The filter accepts the following options: +

+
+
preset
+

Select one of the available color presets. This option can be used in addition +to the r, g, b parameters; in this case, the later +options takes priority on the preset values. +Available presets are: +

+
none
+
color_negative
+
cross_process
+
darker
+
increase_contrast
+
lighter
+
linear_contrast
+
medium_contrast
+
negative
+
strong_contrast
+
vintage
+
+

Default is none. +

+
master, m
+

Set the master key points. These points will define a second pass mapping. It +is sometimes called a "luminance" or "value" mapping. It can be used with +r, g, b or all since it acts like a +post-processing LUT. +

+
red, r
+

Set the key points for the red component. +

+
green, g
+

Set the key points for the green component. +

+
blue, b
+

Set the key points for the blue component. +

+
all
+

Set the key points for all components (not including master). +Can be used in addition to the other key points component +options. In this case, the unset component(s) will fallback on this +all setting. +

+
psfile
+

Specify a Photoshop curves file (.acv) to import the settings from. +

+
plot
+

Save Gnuplot script of the curves in specified file. +

+
interp
+

Specify the kind of interpolation. Available algorithms are: +

+
natural
+

Natural cubic spline using a piece-wise cubic polynomial that is twice continuously differentiable. +

+
pchip
+

Monotonic cubic spline using a piecewise cubic Hermite interpolating polynomial (PCHIP). +

+
+ +
+
+ +

To avoid some filtergraph syntax conflicts, each key points list need to be +defined using the following syntax: x0/y0 x1/y1 x2/y2 .... +

+ +
+

39.52.1 Commands

+ +

This filter supports same commands as options. +

+
+
+

39.52.2 Examples

+ +
    +
  • Increase slightly the middle level of blue: +
    +
    curves=blue='0/0 0.5/0.58 1/1'
    +
    + +
  • Vintage effect: +
    +
    curves=r='0/0.11 .42/.51 1/0.95':g='0/0 0.50/0.48 1/1':b='0/0.22 .49/.44 1/0.8'
    +
    +

    Here we obtain the following coordinates for each components: +

    +
    red
    +

    (0;0.11) (0.42;0.51) (1;0.95) +

    +
    green
    +

    (0;0) (0.50;0.48) (1;1) +

    +
    blue
    +

    (0;0.22) (0.49;0.44) (1;0.80) +

    +
    + +
  • The previous example can also be achieved with the associated built-in preset: +
    +
    curves=preset=vintage
    +
    + +
  • Or simply: +
    +
    curves=vintage
    +
    + +
  • Use a Photoshop preset and redefine the points of the green component: +
    +
    curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
    +
    + +
  • Check out the curves of the cross_process profile using ffmpeg +and gnuplot: +
    +
    ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
    +gnuplot -p /tmp/curves.plt
    +
    +
+ +
+
+
+

39.53 datascope

+ +

Video data analysis filter. +

+

This filter shows hexadecimal pixel values of part of video. +

+

The filter accepts the following options: +

+
+
size, s
+

Set output video size. +

+
+
x
+

Set x offset from where to pick pixels. +

+
+
y
+

Set y offset from where to pick pixels. +

+
+
mode
+

Set scope mode, can be one of the following: +

+
mono
+

Draw hexadecimal pixel values with white color on black background. +

+
+
color
+

Draw hexadecimal pixel values with input video pixel color on black +background. +

+
+
color2
+

Draw hexadecimal pixel values on color background picked from input video, +the text color is picked in such way so its always visible. +

+
+ +
+
axis
+

Draw rows and columns numbers on left and top of video. +

+
+
opacity
+

Set background opacity. +

+
+
format
+

Set display number format. Can be hex, or dec. Default is hex. +

+
+
components
+

Set pixel components to display. By default all pixel components are displayed. +

+
+ + +
+

39.53.1 Commands

+ +

This filter supports same commands as options excluding size option. +

+
+
+
+

39.54 dblur

+

Apply Directional blur filter. +

+

The filter accepts the following options: +

+
+
angle
+

Set angle of directional blur. Default is 45. +

+
+
radius
+

Set radius of directional blur. Default is 5. +

+
+
planes
+

Set which planes to filter. By default all planes are filtered. +

+
+ + +
+

39.54.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

39.55 dctdnoiz

+ +

Denoise frames using 2D DCT (frequency domain filtering). +

+

This filter is not designed for real time. +

+

The filter accepts the following options: +

+
+
sigma, s
+

Set the noise sigma constant. +

+

This sigma defines a hard threshold of 3 * sigma; every DCT +coefficient (absolute value) below this threshold with be dropped. +

+

If you need a more advanced filtering, see expr. +

+

Default is 0. +

+
+
overlap
+

Set number overlapping pixels for each block. Since the filter can be slow, you +may want to reduce this value, at the cost of a less effective filter and the +risk of various artefacts. +

+

If the overlapping value doesn’t permit processing the whole input width or +height, a warning will be displayed and according borders won’t be denoised. +

+

Default value is blocksize-1, which is the best possible setting. +

+
+
expr, e
+

Set the coefficient factor expression. +

+

For each coefficient of a DCT block, this expression will be evaluated as a +multiplier value for the coefficient. +

+

If this is option is set, the sigma option will be ignored. +

+

The absolute value of the coefficient can be accessed through the c +variable. +

+
+
n
+

Set the blocksize using the number of bits. 1<<n defines the +blocksize, which is the width and height of the processed blocks. +

+

The default value is 3 (8x8) and can be raised to 4 for a +blocksize of 16x16. Note that changing this setting has huge consequences +on the speed processing. Also, a larger block size does not necessarily means a +better de-noising. +

+
+ + +
+

39.55.1 Examples

+ +

Apply a denoise with a sigma of 4.5: +

+
dctdnoiz=4.5
+
+ +

The same operation can be achieved using the expression system: +

+
dctdnoiz=e='gte(c, 4.5*3)'
+
+ +

Violent denoise using a block size of 16x16: +

+
dctdnoiz=15:n=4
+
+ +
+
+
+

39.56 deband

+ +

Remove banding artifacts from input video. +It works by replacing banded pixels with average value of referenced pixels. +

+

The filter accepts the following options: +

+
+
1thr
+
2thr
+
3thr
+
4thr
+

Set banding detection threshold for each plane. Default is 0.02. +Valid range is 0.00003 to 0.5. +If difference between current pixel and reference pixel is less than threshold, +it will be considered as banded. +

+
+
range, r
+

Banding detection range in pixels. Default is 16. If positive, random number +in range 0 to set value will be used. If negative, exact absolute value +will be used. +The range defines square of four pixels around current pixel. +

+
+
direction, d
+

Set direction in radians from which four pixel will be compared. If positive, +random direction from 0 to set direction will be picked. If negative, exact of +absolute value will be picked. For example direction 0, -PI or -2*PI radians +will pick only pixels on same row and -PI/2 will pick only pixels on same +column. +

+
+
blur, b
+

If enabled, current pixel is compared with average value of all four +surrounding pixels. The default is enabled. If disabled current pixel is +compared with all four surrounding pixels. The pixel is considered banded +if only all four differences with surrounding pixels are less than threshold. +

+
+
coupling, c
+

If enabled, current pixel is changed if and only if all pixel components are banded, +e.g. banding detection threshold is triggered for all color components. +The default is disabled. +

+
+ + +
+

39.56.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.57 deblock

+ +

Remove blocking artifacts from input video. +

+

The filter accepts the following options: +

+
+
filter
+

Set filter type, can be weak or strong. Default is strong. +This controls what kind of deblocking is applied. +

+
+
block
+

Set size of block, allowed range is from 4 to 512. Default is 8. +

+
+
alpha
+
beta
+
gamma
+
delta
+

Set blocking detection thresholds. Allowed range is 0 to 1. +Defaults are: 0.098 for alpha and 0.05 for the rest. +Using higher threshold gives more deblocking strength. +Setting alpha controls threshold detection at exact edge of block. +Remaining options controls threshold detection near the edge. Each one for +below/above or left/right. Setting any of those to 0 disables +deblocking. +

+
+
planes
+

Set planes to filter. Default is to filter all available planes. +

+
+ + +
+

39.57.1 Examples

+ +
    +
  • Deblock using weak filter and block size of 4 pixels. +
    +
    deblock=filter=weak:block=4
    +
    + +
  • Deblock using strong filter, block size of 4 pixels and custom thresholds for +deblocking more edges. +
    +
    deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
    +
    + +
  • Similar as above, but filter only first plane. +
    +
    deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
    +
    + +
  • Similar as above, but filter only second and third plane. +
    +
    deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
    +
    +
+ +
+
+

39.57.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.58 decimate

+ +

Drop duplicated frames at regular intervals. +

+

The filter accepts the following options: +

+
+
cycle
+

Set the number of frames from which one will be dropped. Setting this to +N means one frame in every batch of N frames will be dropped. +Default is 5. +

+
+
dupthresh
+

Set the threshold for duplicate detection. If the difference metric for a frame +is less than or equal to this value, then it is declared as duplicate. Default +is 1.1 +

+
+
scthresh
+

Set scene change threshold. Default is 15. +

+
+
blockx
+
blocky
+

Set the size of the x and y-axis blocks used during metric calculations. +Larger blocks give better noise suppression, but also give worse detection of +small movements. Must be a power of two. Default is 32. +

+
+
ppsrc
+

Mark main input as a pre-processed input and activate clean source input +stream. This allows the input to be pre-processed with various filters to help +the metrics calculation while keeping the frame selection lossless. When set to +1, the first stream is for the pre-processed input, and the second +stream is the clean source from where the kept frames are chosen. Default is +0. +

+
+
chroma
+

Set whether or not chroma is considered in the metric calculations. Default is +1. +

+
+
mixed
+

Set whether or not the input only partially contains content to be decimated. +Default is false. +If enabled video output stream will be in variable frame rate. +

+
+ +
+
+

39.59 deconvolve

+ +

Apply 2D deconvolution of video stream in frequency domain using second stream +as impulse. +

+

The filter accepts the following options: +

+
+
planes
+

Set which planes to process. +

+
+
impulse
+

Set which impulse video frames will be processed, can be first +or all. Default is all. +

+
+
noise
+

Set noise when doing divisions. Default is 0.0000001. Useful when width +and height are not same and not power of 2 or if stream prior to convolving +had noise. +

+
+ +

The deconvolve filter also supports the framesync options. +

+
+
+

39.60 dedot

+ +

Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video. +

+

It accepts the following options: +

+
+
m
+

Set mode of operation. Can be combination of dotcrawl for cross-luminance reduction and/or +rainbows for cross-color reduction. +

+
+
lt
+

Set spatial luma threshold. Lower values increases reduction of cross-luminance. +

+
+
tl
+

Set tolerance for temporal luma. Higher values increases reduction of cross-luminance. +

+
+
tc
+

Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color. +

+
+
ct
+

Set temporal chroma threshold. Lower values increases reduction of cross-color. +

+
+ +
+
+

39.61 deflate

+ +

Apply deflate effect to the video. +

+

This filter replaces the pixel by the local(3x3) average by taking into account +only values lower than the pixel. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+ + +
+

39.61.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.62 deflicker

+ +

Remove temporal frame luminance variations. +

+

It accepts the following options: +

+
+
size, s
+

Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129. +

+
+
mode, m
+

Set averaging mode to smooth temporal luminance variations. +

+

Available values are: +

+
am
+

Arithmetic mean +

+
+
gm
+

Geometric mean +

+
+
hm
+

Harmonic mean +

+
+
qm
+

Quadratic mean +

+
+
cm
+

Cubic mean +

+
+
pm
+

Power mean +

+
+
median
+

Median +

+
+ +
+
bypass
+

Do not actually modify frame. Useful when one only wants metadata. +

+
+ +
+
+

39.63 dejudder

+ +

Remove judder produced by partially interlaced telecined content. +

+

Judder can be introduced, for instance, by pullup filter. If the original +source was partially telecined content then the output of pullup,dejudder +will have a variable frame rate. May change the recorded frame rate of the +container. Aside from that change, this filter will not affect constant frame +rate video. +

+

The option available in this filter is: +

+
cycle
+

Specify the length of the window over which the judder repeats. +

+

Accepts any integer greater than 1. Useful values are: +

+
4
+

If the original was telecined from 24 to 30 fps (Film to NTSC). +

+
+
5
+

If the original was telecined from 25 to 30 fps (PAL to NTSC). +

+
+
20
+

If a mixture of the two. +

+
+ +

The default is ‘4’. +

+
+ +
+ +
+

39.65 derain

+ +

Remove the rain in the input image/video by applying the derain methods based on +convolutional neural networks. Supported models: +

+ + +

Training as well as model generation scripts are provided in +the repository at https://github.com/XueweiMeng/derain_filter.git. +

+

The filter accepts the following options: +

+
+
filter_type
+

Specify which filter to use. This option accepts the following values: +

+
+
derain
+

Derain filter. To conduct derain filter, you need to use a derain model. +

+
+
dehaze
+

Dehaze filter. To conduct dehaze filter, you need to use a dehaze model. +

+
+

Default value is ‘derain’. +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +the following values: +

+
+
tensorflow
+

TensorFlow backend. To enable this backend you +need to install the TensorFlow for C library (see +https://www.tensorflow.org/install/lang_c) and configure FFmpeg with +--enable-libtensorflow +

+
+ +
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. TensorFlow can load files for only its format. +

+
+ +

To get full functionality (such as async execution), please use the dnn_processing filter. +

+
+
+

39.66 deshake

+ +

Attempt to fix small changes in horizontal and/or vertical shift. This +filter helps remove camera shake from hand-holding a camera, bumping a +tripod, moving on a vehicle, etc. +

+

The filter accepts the following options: +

+
+
x
+
y
+
w
+
h
+

Specify a rectangular area where to limit the search for motion +vectors. +If desired the search for motion vectors can be limited to a +rectangular area of the frame defined by its top left corner, width +and height. These parameters have the same meaning as the drawbox +filter which can be used to visualise the position of the bounding +box. +

+

This is useful when simultaneous movement of subjects within the frame +might be confused for camera motion by the motion vector search. +

+

If any or all of x, y, w and h are set to -1 +then the full frame is used. This allows later options to be set +without specifying the bounding box for the motion vector search. +

+

Default - search the whole frame. +

+
+
rx
+
ry
+

Specify the maximum extent of movement in x and y directions in the +range 0-64 pixels. Default 16. +

+
+
edge
+

Specify how to generate pixels to fill blanks at the edge of the +frame. Available values are: +

+
blank, 0
+

Fill zeroes at blank locations +

+
original, 1
+

Original image at blank locations +

+
clamp, 2
+

Extruded edge value at blank locations +

+
mirror, 3
+

Mirrored edge at blank locations +

+
+

Default value is ‘mirror’. +

+
+
blocksize
+

Specify the blocksize to use for motion search. Range 4-128 pixels, +default 8. +

+
+
contrast
+

Specify the contrast threshold for blocks. Only blocks with more than +the specified contrast (difference between darkest and lightest +pixels) will be considered. Range 1-255, default 125. +

+
+
search
+

Specify the search strategy. Available values are: +

+
exhaustive, 0
+

Set exhaustive search +

+
less, 1
+

Set less exhaustive search. +

+
+

Default value is ‘exhaustive’. +

+
+
filename
+

If set then a detailed log of the motion search is written to the +specified file. +

+
+
+ +
+
+

39.67 despill

+ +

Remove unwanted contamination of foreground colors, caused by reflected color of +greenscreen or bluescreen. +

+

This filter accepts the following options: +

+
+
type
+

Set what type of despill to use. +

+
+
mix
+

Set how spillmap will be generated. +

+
+
expand
+

Set how much to get rid of still remaining spill. +

+
+
red
+

Controls amount of red in spill area. +

+
+
green
+

Controls amount of green in spill area. +Should be -1 for greenscreen. +

+
+
blue
+

Controls amount of blue in spill area. +Should be -1 for bluescreen. +

+
+
brightness
+

Controls brightness of spill area, preserving colors. +

+
+
alpha
+

Modify alpha from generated spillmap. +

+
+ + +
+

39.67.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.68 detelecine

+ +

Apply an exact inverse of the telecine operation. It requires a predefined +pattern specified using the pattern option which must be the same as that passed +to the telecine filter. +

+

This filter accepts the following options: +

+
+
first_field
+
+
top, t
+

top field first +

+
bottom, b
+

bottom field first +The default value is top. +

+
+ +
+
pattern
+

A string of numbers representing the pulldown pattern you wish to apply. +The default value is 23. +

+
+
start_frame
+

A number representing position of the first frame with respect to the telecine +pattern. This is to be used if the stream is cut. The default value is 0. +

+
+ +
+
+

39.69 dilation

+ +

Apply dilation effect to the video. +

+

This filter replaces the pixel by the local(3x3) maximum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. Default is 255 i.e. all eight +pixels are used. +

+

Flags to local 3x3 coordinates maps like this: +

+

1 2 3 + 4 5 + 6 7 8 +

+
+ + +
+

39.69.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.70 displace

+ +

Displace pixels as indicated by second and third input stream. +

+

It takes three input streams and outputs one stream, the first input is the +source, and second and third input are displacement maps. +

+

The second input specifies how much to displace pixels along the +x-axis, while the third input specifies how much to displace pixels +along the y-axis. +If one of displacement map streams terminates, last frame from that +displacement map will be used. +

+

Note that once generated, displacements maps can be reused over and over again. +

+

A description of the accepted options follows. +

+
+
edge
+

Set displace behavior for pixels that are out of range. +

+

Available values are: +

+
blank
+

Missing pixels are replaced by black pixels. +

+
+
smear
+

Adjacent pixels will spread out to replace missing pixels. +

+
+
wrap
+

Out of range pixels are wrapped so they point to pixels of other side. +

+
+
mirror
+

Out of range pixels will be replaced with mirrored pixels. +

+
+

Default is ‘smear’. +

+
+
+ + +
+

39.70.1 Examples

+ +
    +
  • Add ripple effect to rgb input of video size hd720: +
    +
    ffmpeg -i INPUT -f lavfi -i nullsrc=s=hd720,lutrgb=128:128:128 -f lavfi -i nullsrc=s=hd720,geq='r=128+30*sin(2*PI*X/400+T):g=128+30*sin(2*PI*X/400+T):b=128+30*sin(2*PI*X/400+T)' -lavfi '[0][1][2]displace' OUTPUT
    +
    + +
  • Add wave effect to rgb input of video size hd720: +
    +
    ffmpeg -i INPUT -f lavfi -i nullsrc=hd720,geq='r=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):g=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):b=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T))' -lavfi '[1]split[x][y],[0][x][y]displace' OUTPUT
    +
    +
+ +
+
+
+

39.71 dnn_classify

+ +

Do classification with deep neural networks based on bounding boxes. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +only openvino now, tensorflow backends will be added. +

+
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. +

+
+
input
+

Set the input name of the dnn network. +

+
+
output
+

Set the output name of the dnn network. +

+
+
confidence
+

Set the confidence threshold (default: 0.5). +

+
+
labels
+

Set path to label file specifying the mapping between label id and name. +Each label name is written in one line, tailing spaces and empty lines are skipped. +The first line is the name of label id 0, +and the second line is the name of label id 1, etc. +The label id is considered as name if the label file is not provided. +

+
+
backend_configs
+

Set the configs to be passed into backend +

+

For tensorflow backend, you can set its configs with sess_config options, +please use tools/python/tf_sess_config.py to get the configs for your system. +

+
+
+ +
+
+

39.72 dnn_detect

+ +

Do object detection with deep neural networks. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +only openvino now, tensorflow backends will be added. +

+
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. +

+
+
input
+

Set the input name of the dnn network. +

+
+
output
+

Set the output name of the dnn network. +

+
+
confidence
+

Set the confidence threshold (default: 0.5). +

+
+
labels
+

Set path to label file specifying the mapping between label id and name. +Each label name is written in one line, tailing spaces and empty lines are skipped. +The first line is the name of label id 0 (usually it is ’background’), +and the second line is the name of label id 1, etc. +The label id is considered as name if the label file is not provided. +

+
+
backend_configs
+

Set the configs to be passed into backend. To use async execution, set async (default: set). +Roll back to sync execution if the backend does not support async. +

+
+
+ +
+
+

39.73 dnn_processing

+ +

Do image processing with deep neural networks. It works together with another filter +which converts the pixel format of the Frame to what the dnn network requires. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +the following values: +

+
+
tensorflow
+

TensorFlow backend. To enable this backend you +need to install the TensorFlow for C library (see +https://www.tensorflow.org/install/lang_c) and configure FFmpeg with +--enable-libtensorflow +

+
+
openvino
+

OpenVINO backend. To enable this backend you +need to build and install the OpenVINO for C library (see +https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md) and configure FFmpeg with +--enable-libopenvino (–extra-cflags=-I... –extra-ldflags=-L... might +be needed if the header files and libraries are not installed into system path) +

+
+
+ +
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. TensorFlow, OpenVINO backend can load files for only its format. +

+
+
input
+

Set the input name of the dnn network. +

+
+
output
+

Set the output name of the dnn network. +

+
+
backend_configs
+

Set the configs to be passed into backend. To use async execution, set async (default: set). +Roll back to sync execution if the backend does not support async. +

+

For tensorflow backend, you can set its configs with sess_config options, +please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system. +

+
+
+ + +
+

39.73.1 Examples

+ +
    +
  • Remove rain in rgb24 frame with can.pb (see derain filter): +
    +
    ./ffmpeg -i rain.jpg -vf format=rgb24,dnn_processing=dnn_backend=tensorflow:model=can.pb:input=x:output=y derain.jpg
    +
    + +
  • Handle the Y channel with srcnn.pb (see sr filter) for frame with yuv420p (planar YUV formats supported): +
    +
    ./ffmpeg -i 480p.jpg -vf format=yuv420p,scale=w=iw*2:h=ih*2,dnn_processing=dnn_backend=tensorflow:model=srcnn.pb:input=x:output=y -y srcnn.jpg
    +
    + +
  • Handle the Y channel with espcn.pb (see sr filter), which changes frame size, for format yuv420p (planar YUV formats supported), +please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system. +
    +
    ./ffmpeg -i 480p.jpg -vf format=yuv420p,dnn_processing=dnn_backend=tensorflow:model=espcn.pb:input=x:output=y:backend_configs=sess_config=0x10022805320e09cdccccccccccec3f20012a01303801 -y tmp.espcn.jpg
    +
    + +
+ +
+
+
+

39.74 drawbox

+ +

Draw a colored box on the input image. +

+

It accepts the following parameters: +

+
+
x
+
y
+

The expressions which specify the top left corner coordinates of the box. It defaults to 0. +

+
+
width, w
+
height, h
+

The expressions which specify the width and height of the box; if 0 they are interpreted as +the input width and height. It defaults to 0. +

+
+
color, c
+

Specify the color of the box to write. For the general syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. If the special +value invert is used, the box edge color is the same as the +video with inverted luma. +

+
+
thickness, t
+

The expression which sets the thickness of the box edge. +A value of fill will create a filled box. Default value is 3. +

+

See below for the list of accepted constants. +

+
+
replace
+

Applicable if the input has alpha. With value 1, the pixels of the painted box +will overwrite the video’s color and alpha pixels. +Default is 0, which composites the box onto the input, leaving the video’s alpha intact. +

+
+ +

The parameters for x, y, w and h and t are expressions containing the +following constants: +

+
+
dar
+

The input display aspect ratio, it is the same as (w / h) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
in_h, ih
+
in_w, iw
+

The input width and height. +

+
+
sar
+

The input sample aspect ratio. +

+
+
x
+
y
+

The x and y offset coordinates where the box is drawn. +

+
+
w
+
h
+

The width and height of the drawn box. +

+
+
box_source
+

Box source can be set as side_data_detection_bboxes if you want to use box data in +detection bboxes of side data. +

+

If box_source is set, the x, y, width and height will be ignored and +still use box data in detection bboxes of side data. So please do not use this parameter if you were +not sure about the box source. +

+
+
t
+

The thickness of the drawn box. +

+

These constants allow the x, y, w, h and t expressions to refer to +each other, so you may for example specify y=x/dar or h=w/dar. +

+
+
+ + +
+

39.74.1 Examples

+ +
    +
  • Draw a black box around the edge of the input image: +
    +
    drawbox
    +
    + +
  • Draw a box with color red and an opacity of 50%: +
    +
    drawbox=10:20:200:60:red@0.5
    +
    + +

    The previous example can be specified as: +

    +
    drawbox=x=10:y=20:w=200:h=60:color=red@0.5
    +
    + +
  • Fill the box with pink color: +
    +
    drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
    +
    + +
  • Draw a 2-pixel red 2.40:1 mask: +
    +
    drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
    +
    +
+ +
+
+

39.74.2 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

39.75 drawgraph

+

Draw a graph using input video metadata. +

+

It accepts the following parameters: +

+
+
m1
+

Set 1st frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg1
+

Set 1st foreground color expression. +

+
+
m2
+

Set 2nd frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg2
+

Set 2nd foreground color expression. +

+
+
m3
+

Set 3rd frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg3
+

Set 3rd foreground color expression. +

+
+
m4
+

Set 4th frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg4
+

Set 4th foreground color expression. +

+
+
min
+

Set minimal value of metadata value. +

+
+
max
+

Set maximal value of metadata value. +

+
+
bg
+

Set graph background color. Default is white. +

+
+
mode
+

Set graph mode. +

+

Available values for mode is: +

+
bar
+
dot
+
line
+
+ +

Default is line. +

+
+
slide
+

Set slide mode. +

+

Available values for slide is: +

+
frame
+

Draw new frame when right border is reached. +

+
+
replace
+

Replace old columns with new ones. +

+
+
scroll
+

Scroll from right to left. +

+
+
rscroll
+

Scroll from left to right. +

+
+
picture
+

Draw single picture. +

+
+ +

Default is frame. +

+
+
size
+

Set size of graph video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +The default value is 900x256. +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+

The foreground color expressions can use the following variables: +

+
MIN
+

Minimal value of metadata value. +

+
+
MAX
+

Maximal value of metadata value. +

+
+
VAL
+

Current metadata key value. +

+
+ +

The color is defined as 0xAABBGGRR. +

+
+ +

Example using metadata from signalstats filter: +

+
signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
+
+ +

Example using metadata from ebur128 filter: +

+
ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
+
+ +
+
+

39.76 drawgrid

+ +

Draw a grid on the input image. +

+

It accepts the following parameters: +

+
+
x
+
y
+

The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0. +

+
+
width, w
+
height, h
+

The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the +input width and height, respectively, minus thickness, so image gets +framed. Default to 0. +

+
+
color, c
+

Specify the color of the grid. For the general syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. If the special +value invert is used, the grid color is the same as the +video with inverted luma. +

+
+
thickness, t
+

The expression which sets the thickness of the grid line. Default value is 1. +

+

See below for the list of accepted constants. +

+
+
replace
+

Applicable if the input has alpha. With 1 the pixels of the painted grid +will overwrite the video’s color and alpha pixels. +Default is 0, which composites the grid onto the input, leaving the video’s alpha intact. +

+
+ +

The parameters for x, y, w and h and t are expressions containing the +following constants: +

+
+
dar
+

The input display aspect ratio, it is the same as (w / h) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
in_h, ih
+
in_w, iw
+

The input grid cell width and height. +

+
+
sar
+

The input sample aspect ratio. +

+
+
x
+
y
+

The x and y coordinates of some point of grid intersection (meant to configure offset). +

+
+
w
+
h
+

The width and height of the drawn cell. +

+
+
t
+

The thickness of the drawn cell. +

+

These constants allow the x, y, w, h and t expressions to refer to +each other, so you may for example specify y=x/dar or h=w/dar. +

+
+
+ + +
+

39.76.1 Examples

+ +
    +
  • Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%: +
    +
    drawgrid=width=100:height=100:thickness=2:color=red@0.5
    +
    + +
  • Draw a white 3x3 grid with an opacity of 50%: +
    +
    drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
    +
    +
+ +
+
+

39.76.2 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

39.77 drawtext

+ +

Draw a text string or text from a specified file on top of a video, using the +libfreetype library. +

+

To enable compilation of this filter, you need to configure FFmpeg with +--enable-libfreetype. +To enable default font fallback and the font option you need to +configure FFmpeg with --enable-libfontconfig. +To enable the text_shaping option, you need to configure FFmpeg with +--enable-libfribidi. +

+ +
+

39.77.1 Syntax

+ +

It accepts the following parameters: +

+
+
box
+

Used to draw a box around text using the background color. +The value must be either 1 (enable) or 0 (disable). +The default value of box is 0. +

+
+
boxborderw
+

Set the width of the border to be drawn around the box using boxcolor. +The default value of boxborderw is 0. +

+
+
boxcolor
+

The color to be used for drawing box around text. For the syntax of this +option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+

The default value of boxcolor is "white". +

+
+
line_spacing
+

Set the line spacing in pixels of the border to be drawn around the box using box. +The default value of line_spacing is 0. +

+
+
borderw
+

Set the width of the border to be drawn around the text using bordercolor. +The default value of borderw is 0. +

+
+
bordercolor
+

Set the color to be used for drawing border around text. For the syntax of this +option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+

The default value of bordercolor is "black". +

+
+
expansion
+

Select how the text is expanded. Can be either none, +strftime (deprecated) or normal (default). See the +Text expansion section below for details. +

+
+
basetime
+

Set a start time for the count. Value is in microseconds. Only applied +in the deprecated strftime expansion mode. To emulate in normal expansion +mode use the pts function, supplying the start time (in seconds) +as the second argument. +

+
+
fix_bounds
+

If true, check and fix text coords to avoid clipping. +

+
+
fontcolor
+

The color to be used for drawing fonts. For the syntax of this option, check +the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+

The default value of fontcolor is "black". +

+
+
fontcolor_expr
+

String which is expanded the same way as text to obtain dynamic +fontcolor value. By default this option has empty value and is not +processed. When this option is set, it overrides fontcolor option. +

+
+
font
+

The font family to be used for drawing text. By default Sans. +

+
+
fontfile
+

The font file to be used for drawing text. The path must be included. +This parameter is mandatory if the fontconfig support is disabled. +

+
+
alpha
+

Draw the text applying alpha blending. The value can +be a number between 0.0 and 1.0. +The expression accepts the same variables x, y as well. +The default value is 1. +Please see fontcolor_expr. +

+
+
fontsize
+

The font size to be used for drawing text. +The default value of fontsize is 16. +

+
+
text_shaping
+

If set to 1, attempt to shape the text (for example, reverse the order of +right-to-left text and join Arabic characters) before drawing it. +Otherwise, just draw the text exactly as given. +By default 1 (if supported). +

+
+
ft_load_flags
+

The flags to be used for loading the fonts. +

+

The flags map the corresponding flags supported by libfreetype, and are +a combination of the following values: +

+
default
+
no_scale
+
no_hinting
+
render
+
no_bitmap
+
vertical_layout
+
force_autohint
+
crop_bitmap
+
pedantic
+
ignore_global_advance_width
+
no_recurse
+
ignore_transform
+
monochrome
+
linear_design
+
no_autohint
+
+ +

Default value is "default". +

+

For more information consult the documentation for the FT_LOAD_* +libfreetype flags. +

+
+
shadowcolor
+

The color to be used for drawing a shadow behind the drawn text. For the +syntax of this option, check the (ffmpeg-utils)"Color" section in the +ffmpeg-utils manual. +

+

The default value of shadowcolor is "black". +

+
+
shadowx
+
shadowy
+

The x and y offsets for the text shadow position with respect to the +position of the text. They can be either positive or negative +values. The default value for both is "0". +

+
+
start_number
+

The starting frame number for the n/frame_num variable. The default value +is "0". +

+
+
tabsize
+

The size in number of spaces to use for rendering the tab. +Default value is 4. +

+
+
timecode
+

Set the initial timecode representation in "hh:mm:ss[:;.]ff" +format. It can be used with or without text parameter. timecode_rate +option must be specified. +

+
+
timecode_rate, rate, r
+

Set the timecode frame rate (timecode only). Value will be rounded to nearest +integer. Minimum value is "1". +Drop-frame timecode is supported for frame rates 30 & 60. +

+
+
tc24hmax
+

If set to 1, the output of the timecode option will wrap around at 24 hours. +Default is 0 (disabled). +

+
+
text
+

The text string to be drawn. The text must be a sequence of UTF-8 +encoded characters. +This parameter is mandatory if no file is specified with the parameter +textfile. +

+
+
textfile
+

A text file containing text to be drawn. The text must be a sequence +of UTF-8 encoded characters. +

+

This parameter is mandatory if no text string is specified with the +parameter text. +

+

If both text and textfile are specified, an error is thrown. +

+
+
text_source
+

Text source should be set as side_data_detection_bboxes if you want to use text data in +detection bboxes of side data. +

+

If text source is set, text and textfile will be ignored and still use +text data in detection bboxes of side data. So please do not use this parameter +if you are not sure about the text source. +

+
+
reload
+

The textfile will be reloaded at specified frame interval. +Be sure to update textfile atomically, or it may be read partially, +or even fail. +Range is 0 to INT_MAX. Default is 0. +

+
+
x
+
y
+

The expressions which specify the offsets where text will be drawn +within the video frame. They are relative to the top/left border of the +output image. +

+

The default value of x and y is "0". +

+

See below for the list of accepted constants and functions. +

+
+ +

The parameters for x and y are expressions containing the +following constants and functions: +

+
+
dar
+

input display aspect ratio, it is the same as (w / h) * sar +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
line_h, lh
+

the height of each text line +

+
+
main_h, h, H
+

the input height +

+
+
main_w, w, W
+

the input width +

+
+
max_glyph_a, ascent
+

the maximum distance from the baseline to the highest/upper grid +coordinate used to place a glyph outline point, for all the rendered +glyphs. +It is a positive value, due to the grid’s orientation with the Y axis +upwards. +

+
+
max_glyph_d, descent
+

the maximum distance from the baseline to the lowest grid coordinate +used to place a glyph outline point, for all the rendered glyphs. +This is a negative value, due to the grid’s orientation, with the Y axis +upwards. +

+
+
max_glyph_h
+

maximum glyph height, that is the maximum height for all the glyphs +contained in the rendered text, it is equivalent to ascent - +descent. +

+
+
max_glyph_w
+

maximum glyph width, that is the maximum width for all the glyphs +contained in the rendered text +

+
+
n
+

the number of input frame, starting from 0 +

+
+
rand(min, max)
+

return a random number included between min and max +

+
+
sar
+

The input sample aspect ratio. +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
text_h, th
+

the height of the rendered text +

+
+
text_w, tw
+

the width of the rendered text +

+
+
x
+
y
+

the x and y offset coordinates where the text is drawn. +

+

These parameters allow the x and y expressions to refer +to each other, so you can for example specify y=x/dar. +

+
+
pict_type
+

A one character description of the current frame’s picture type. +

+
+
pkt_pos
+

The current packet’s position in the input file or stream +(in bytes, from the start of the input). A value of -1 indicates +this info is not available. +

+
+
duration
+

The current packet’s duration, in seconds. +

+
+
pkt_size
+

The current packet’s size (in bytes). +

+
+ +
+
+

39.77.2 Text expansion

+ +

If expansion is set to strftime, the filter recognizes +sequences accepted by the strftime C function in the provided +text and expands them accordingly. Check the documentation of +strftime. This feature is deprecated in favor of normal +expansion with the gmtime or localtime expansion +functions. +

+

If expansion is set to none, the text is printed verbatim. +

+

If expansion is set to normal (which is the default), +the following expansion mechanism is used. +

+

The backslash character ‘\’, followed by any character, always expands to +the second character. +

+

Sequences of the form %{...} are expanded. The text between the +braces is a function name, possibly followed by arguments separated by ’:’. +If the arguments contain special characters or delimiters (’:’ or ’}’), +they should be escaped. +

+

Note that they probably must also be escaped as the value for the text +option in the filter argument string and as the filter argument in the +filtergraph description, and possibly also for the shell, that makes up to four +levels of escaping; using a text file with the textfile option avoids +these problems. +

+

The following functions are available: +

+
+
expr, e
+

The expression evaluation result. +

+

It must take one argument specifying the expression to be evaluated, +which accepts the same constants and functions as the x and +y values. Note that not all constants should be used, for +example the text size is not known when evaluating the expression, so +the constants text_w and text_h will have an undefined +value. +

+
+
expr_int_format, eif
+

Evaluate the expression’s value and output as formatted integer. +

+

The first argument is the expression to be evaluated, just as for the expr function. +The second argument specifies the output format. Allowed values are ‘x’, +‘X’, ‘d’ and ‘u’. They are treated exactly as in the +printf function. +The third parameter is optional and sets the number of positions taken by the output. +It can be used to add padding with zeros from the left. +

+
+
gmtime
+

The time at which the filter is running, expressed in UTC. +It can accept an argument: a strftime C function format string. +The format string is extended to support the variable %[1-6]N +which prints fractions of the second with optionally specified number of digits. +

+
+
localtime
+

The time at which the filter is running, expressed in the local time zone. +It can accept an argument: a strftime C function format string. +The format string is extended to support the variable %[1-6]N +which prints fractions of the second with optionally specified number of digits. +

+
+
metadata
+

Frame metadata. Takes one or two arguments. +

+

The first argument is mandatory and specifies the metadata key. +

+

The second argument is optional and specifies a default value, used when the +metadata key is not found or empty. +

+

Available metadata can be identified by inspecting entries +starting with TAG included within each frame section +printed by running ffprobe -show_frames. +

+

String metadata generated in filters leading to +the drawtext filter are also available. +

+
+
n, frame_num
+

The frame number, starting from 0. +

+
+
pict_type
+

A one character description of the current picture type. +

+
+
pts
+

The timestamp of the current frame. +It can take up to three arguments. +

+

The first argument is the format of the timestamp; it defaults to flt +for seconds as a decimal number with microsecond accuracy; hms stands +for a formatted [-]HH:MM:SS.mmm timestamp with millisecond accuracy. +gmtime stands for the timestamp of the frame formatted as UTC time; +localtime stands for the timestamp of the frame formatted as +local time zone time. +

+

The second argument is an offset added to the timestamp. +

+

If the format is set to hms, a third argument 24HH may be +supplied to present the hour part of the formatted timestamp in 24h format +(00-23). +

+

If the format is set to localtime or gmtime, a third +argument may be supplied: a strftime C function format string. +By default, YYYY-MM-DD HH:MM:SS format will be used. +

+
+ +
+
+

39.77.3 Commands

+ +

This filter supports altering parameters via commands: +

+
reinit
+

Alter existing filter parameters. +

+

Syntax for the argument is the same as for filter invocation, e.g. +

+
+
fontsize=56:fontcolor=green:text='Hello World'
+
+ +

Full filter invocation with sendcmd would look like this: +

+
+
sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
+
+
+
+ +

If the entire argument can’t be parsed or applied as valid values then the filter will +continue with its existing parameters. +

+
+
+

39.77.4 Examples

+ +
    +
  • Draw "Test Text" with font FreeSerif, using the default values for the +optional parameters. + +
    +
    drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
    +
    + +
  • Draw ’Test Text’ with font FreeSerif of size 24 at position x=100 +and y=50 (counting from the top-left corner of the screen), text is +yellow with a red box around it. Both the text and the box have an +opacity of 20%. + +
    +
    drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
    +          x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
    +
    + +

    Note that the double quotes are not necessary if spaces are not used +within the parameter list. +

    +
  • Show the text at the center of the video frame: +
    +
    drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2"
    +
    + +
  • Show the text at a random position, switching to a new position every 30 seconds: +
    +
    drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=if(eq(mod(t\,30)\,0)\,rand(0\,(w-text_w))\,x):y=if(eq(mod(t\,30)\,0)\,rand(0\,(h-text_h))\,y)"
    +
    + +
  • Show a text line sliding from right to left in the last row of the video +frame. The file LONG_LINE is assumed to contain a single line +with no newlines. +
    +
    drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"
    +
    + +
  • Show the content of file CREDITS off the bottom of the frame and scroll up. +
    +
    drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t"
    +
    + +
  • Draw a single green letter "g", at the center of the input video. +The glyph baseline is placed at half screen height. +
    +
    drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent"
    +
    + +
  • Show text for 1 second every 3 seconds: +
    +
    drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'"
    +
    + +
  • Use fontconfig to set the font. Note that the colons need to be escaped. +
    +
    drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
    +
    + +
  • Draw "Test Text" with font size dependent on height of the video. +
    +
    drawtext="text='Test Text': fontsize=h/30: x=(w-text_w)/2: y=(h-text_h*2)"
    +
    + +
  • Print the date of a real-time encoding (see documentation for the +strftime C function): +
    +
    drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
    +
    + +
  • Show text fading in and out (appearing/disappearing): +
    +
    #!/bin/sh
    +DS=1.0 # display start
    +DE=10.0 # display end
    +FID=1.5 # fade in duration
    +FOD=5 # fade out duration
    +ffplay -f lavfi "color,drawtext=text=TEST:fontsize=50:fontfile=FreeSerif.ttf:fontcolor_expr=ff0000%{eif\\\\: clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - $DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE - $FOD\\, $DE) )\\, 0\\, 255) \\\\: x\\\\: 2 }"
    +
    + +
  • Horizontally align multiple separate texts. Note that max_glyph_a +and the fontsize value are included in the y offset. +
    +
    drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
    +drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
    +
    + +
  • Plot special lavf.image2dec.source_basename metadata onto each frame if +such metadata exists. Otherwise, plot the string "NA". Note that image2 demuxer +must have option -export_path_metadata 1 for the special metadata fields +to be available for filters. +
    +
    drawtext="fontsize=20:fontcolor=white:fontfile=FreeSans.ttf:text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=10:y=10"
    +
    + +
+ +

For more information about libfreetype, check: +http://www.freetype.org/. +

+

For more information about fontconfig, check: +http://freedesktop.org/software/fontconfig/fontconfig-user.html. +

+

For more information about libfribidi, check: +http://fribidi.org/. +

+
+
+
+

39.78 edgedetect

+ +

Detect and draw edges. The filter uses the Canny Edge Detection algorithm. +

+

The filter accepts the following options: +

+
+
low
+
high
+

Set low and high threshold values used by the Canny thresholding +algorithm. +

+

The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. +

+

low and high threshold values must be chosen in the range +[0,1], and low should be lesser or equal to high. +

+

Default value for low is 20/255, and default value for high +is 50/255. +

+
+
mode
+

Define the drawing mode. +

+
+
wires
+

Draw white/gray wires on black background. +

+
+
colormix
+

Mix the colors to create a paint/cartoon effect. +

+
+
canny
+

Apply Canny edge detector on all selected planes. +

+
+

Default value is wires. +

+
+
planes
+

Select planes for filtering. By default all available planes are filtered. +

+
+ + +
+

39.78.1 Examples

+ +
    +
  • Standard edge detection with custom values for the hysteresis thresholding: +
    +
    edgedetect=low=0.1:high=0.4
    +
    + +
  • Painting effect without thresholding: +
    +
    edgedetect=mode=colormix:high=0
    +
    +
+ +
+
+
+

39.79 elbg

+ +

Apply a posterize effect using the ELBG (Enhanced LBG) algorithm. +

+

For each input image, the filter will compute the optimal mapping from +the input to the output given the codebook length, that is the number +of distinct output colors. +

+

This filter accepts the following options. +

+
+
codebook_length, l
+

Set codebook length. The value must be a positive integer, and +represents the number of distinct output colors. Default value is 256. +

+
+
nb_steps, n
+

Set the maximum number of iterations to apply for computing the optimal +mapping. The higher the value the better the result and the higher the +computation time. Default value is 1. +

+
+
seed, s
+

Set a random seed, must be an integer included between 0 and +UINT32_MAX. If not specified, or if explicitly set to -1, the filter +will try to use a good random seed on a best effort basis. +

+
+
pal8
+

Set pal8 output pixel format. This option does not work with codebook +length greater than 256. Default is disabled. +

+
+
use_alpha
+

Include alpha values in the quantization calculation. Allows creating +palettized output images (e.g. PNG8) with multiple alpha smooth blending. +

+
+ +
+
+

39.80 entropy

+ +

Measure graylevel entropy in histogram of color channels of video frames. +

+

It accepts the following parameters: +

+
+
mode
+

Can be either normal or diff. Default is normal. +

+

diff mode measures entropy of histogram delta values, absolute differences +between neighbour histogram values. +

+
+ +
+
+

39.81 epx

+

Apply the EPX magnification filter which is designed for pixel art. +

+

It accepts the following option: +

+
+
n
+

Set the scaling dimension: 2 for 2xEPX, 3 for +3xEPX. +Default is 3. +

+
+ +
+
+

39.82 eq

+

Set brightness, contrast, saturation and approximate gamma adjustment. +

+

The filter accepts the following options: +

+
+
contrast
+

Set the contrast expression. The value must be a float value in range +-1000.0 to 1000.0. The default value is "1". +

+
+
brightness
+

Set the brightness expression. The value must be a float value in +range -1.0 to 1.0. The default value is "0". +

+
+
saturation
+

Set the saturation expression. The value must be a float in +range 0.0 to 3.0. The default value is "1". +

+
+
gamma
+

Set the gamma expression. The value must be a float in range +0.1 to 10.0. The default value is "1". +

+
+
gamma_r
+

Set the gamma expression for red. The value must be a float in +range 0.1 to 10.0. The default value is "1". +

+
+
gamma_g
+

Set the gamma expression for green. The value must be a float in range +0.1 to 10.0. The default value is "1". +

+
+
gamma_b
+

Set the gamma expression for blue. The value must be a float in range +0.1 to 10.0. The default value is "1". +

+
+
gamma_weight
+

Set the gamma weight expression. It can be used to reduce the effect +of a high gamma value on bright image areas, e.g. keep them from +getting overamplified and just plain white. The value must be a float +in range 0.0 to 1.0. A value of 0.0 turns the +gamma correction all the way down while 1.0 leaves it at its +full strength. Default is "1". +

+
+
eval
+

Set when the expressions for brightness, contrast, saturation and +gamma expressions are evaluated. +

+

It accepts the following values: +

+
init
+

only evaluate expressions once during the filter initialization or +when a command is processed +

+
+
frame
+

evaluate expressions for each incoming frame +

+
+ +

Default value is ‘init’. +

+
+ +

The expressions accept the following parameters: +

+
n
+

frame count of the input frame starting from 0 +

+
+
pos
+

byte position of the corresponding packet in the input file, NAN if +unspecified; deprecated, do not use +

+
+
r
+

frame rate of the input video, NAN if the input frame rate is unknown +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+ + +
+

39.82.1 Commands

+

The filter supports the following commands: +

+
+
contrast
+

Set the contrast expression. +

+
+
brightness
+

Set the brightness expression. +

+
+
saturation
+

Set the saturation expression. +

+
+
gamma
+

Set the gamma expression. +

+
+
gamma_r
+

Set the gamma_r expression. +

+
+
gamma_g
+

Set gamma_g expression. +

+
+
gamma_b
+

Set gamma_b expression. +

+
+
gamma_weight
+

Set gamma_weight expression. +

+

The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+ +
+
+
+

39.83 erosion

+ +

Apply erosion effect to the video. +

+

This filter replaces the pixel by the local(3x3) minimum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. Default is 255 i.e. all eight +pixels are used. +

+

Flags to local 3x3 coordinates maps like this: +

+

1 2 3 + 4 5 + 6 7 8 +

+
+ + +
+

39.83.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.84 estdif

+ +

Deinterlace the input video ("estdif" stands for "Edge Slope +Tracing Deinterlacing Filter"). +

+

Spatial only filter that uses edge slope tracing algorithm +to interpolate missing lines. +It accepts the following parameters: +

+
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
frame
+

Output one frame for each frame. +

+
field
+

Output one frame for each field. +

+
+ +

The default value is field. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
tff
+

Assume the top field is first. +

+
bff
+

Assume the bottom field is first. +

+
auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
all
+

Deinterlace all frames. +

+
interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+
rslope
+

Specify the search radius for edge slope tracing. Default value is 1. +Allowed range is from 1 to 15. +

+
+
redge
+

Specify the search radius for best edge matching. Default value is 2. +Allowed range is from 0 to 15. +

+
+
ecost
+

Specify the edge cost for edge matching. Default value is 2. +Allowed range is from 0 to 50. +

+
+
mcost
+

Specify the middle cost for edge matching. Default value is 1. +Allowed range is from 0 to 50. +

+
+
dcost
+

Specify the distance cost for edge matching. Default value is 1. +Allowed range is from 0 to 50. +

+
+
interp
+

Specify the interpolation used. Default is 4-point interpolation. It accepts one +of the following values: +

+
+
2p
+

Two-point interpolation. +

+
4p
+

Four-point interpolation. +

+
6p
+

Six-point interpolation. +

+
+
+
+ + +
+

39.84.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

39.85 exposure

+

Adjust exposure of the video stream. +

+

The filter accepts the following options: +

+
+
exposure
+

Set the exposure correction in EV. Allowed range is from -3.0 to 3.0 EV +Default value is 0 EV. +

+
+
black
+

Set the black level correction. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+ + +
+

39.85.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

39.86 extractplanes

+ +

Extract color channel components from input video stream into +separate grayscale video streams. +

+

The filter accepts the following option: +

+
+
planes
+

Set plane(s) to extract. +

+

Available values for planes are: +

+
y
+
u
+
v
+
a
+
r
+
g
+
b
+
+ +

Choosing planes not available in the input will result in an error. +That means you cannot select r, g, b planes +with y, u, v planes at same time. +

+
+ + +
+

39.86.1 Examples

+ +
    +
  • Extract luma, u and v color channel component from input video frame +into 3 grayscale outputs: +
    +
    ffmpeg -i video.avi -filter_complex 'extractplanes=y+u+v[y][u][v]' -map '[y]' y.avi -map '[u]' u.avi -map '[v]' v.avi
    +
    +
+ +
+
+
+

39.87 fade

+ +

Apply a fade-in/out effect to the input video. +

+

It accepts the following parameters: +

+
+
type, t
+

The effect type can be either "in" for a fade-in, or "out" for a fade-out +effect. +Default is in. +

+
+
start_frame, s
+

Specify the number of the frame to start applying the fade +effect at. Default is 0. +

+
+
nb_frames, n
+

The number of frames that the fade effect lasts. At the end of the +fade-in effect, the output video will have the same intensity as the input video. +At the end of the fade-out transition, the output video will be filled with the +selected color. +Default is 25. +

+
+
alpha
+

If set to 1, fade only alpha channel, if one exists on the input. +Default value is 0. +

+
+
start_time, st
+

Specify the timestamp (in seconds) of the frame to start to apply the fade +effect. If both start_frame and start_time are specified, the fade will start at +whichever comes last. Default is 0. +

+
+
duration, d
+

The number of seconds for which the fade effect has to last. At the end of the +fade-in effect the output video will have the same intensity as the input video, +at the end of the fade-out transition the output video will be filled with the +selected color. +If both duration and nb_frames are specified, duration is used. Default is 0 +(nb_frames is used by default). +

+
+
color, c
+

Specify the color of the fade. Default is "black". +

+
+ + +
+

39.87.1 Examples

+ +
    +
  • Fade in the first 30 frames of video: +
    +
    fade=in:0:30
    +
    + +

    The command above is equivalent to: +

    +
    fade=t=in:s=0:n=30
    +
    + +
  • Fade out the last 45 frames of a 200-frame video: +
    +
    fade=out:155:45
    +fade=type=out:start_frame=155:nb_frames=45
    +
    + +
  • Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video: +
    +
    fade=in:0:25, fade=out:975:25
    +
    + +
  • Make the first 5 frames yellow, then fade in from frame 5-24: +
    +
    fade=in:5:20:color=yellow
    +
    + +
  • Fade in alpha over first 25 frames of video: +
    +
    fade=in:0:25:alpha=1
    +
    + +
  • Make the first 5.5 seconds black, then fade in for 0.5 seconds: +
    +
    fade=t=in:st=5.5:d=0.5
    +
    + +
+ +
+
+
+

39.88 feedback

+

Apply feedback video filter. +

+

This filter pass cropped input frames to 2nd output. +From there it can be filtered with other video filters. +After filter receives frame from 2nd input, that frame +is combined on top of original frame from 1st input and passed +to 1st output. +

+

The typical usage is filter only part of frame. +

+

The filter accepts the following options: +

+
x
+
y
+

Set the top left crop position. +

+
+
w
+
h
+

Set the crop size. +

+
+ + +
+

39.88.1 Examples

+ +
    +
  • Blur only top left rectangular part of video frame size 100x100 with gblur filter. +
    +
    [in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]gblur=8[blurin]
    +
    + +
  • Draw black box on top left part of video frame of size 100x100 with drawbox filter. +
    +
    [in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]drawbox=x=0:y=0:w=100:h=100:t=100[blurin]
    +
    +
+ +
+
+
+

39.89 fftdnoiz

+

Denoise frames using 3D FFT (frequency domain filtering). +

+

The filter accepts the following options: +

+
+
sigma
+

Set the noise sigma constant. This sets denoising strength. +Default value is 1. Allowed range is from 0 to 30. +Using very high sigma with low overlap may give blocking artifacts. +

+
+
amount
+

Set amount of denoising. By default all detected noise is reduced. +Default value is 1. Allowed range is from 0 to 1. +

+
+
block
+

Set size of block in pixels, Default is 32, can be 8 to 256. +

+
+
overlap
+

Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8. +

+
+
method
+

Set denoising method. Default is wiener, can also be hard. +

+
+
prev
+

Set number of previous frames to use for denoising. By default is set to 0. +

+
+
next
+

Set number of next frames to to use for denoising. By default is set to 0. +

+
+
planes
+

Set planes which will be filtered, by default are all available filtered +except alpha. +

+
+ +
+
+

39.90 fftfilt

+

Apply arbitrary expressions to samples in frequency domain +

+
+
dc_Y
+

Adjust the dc value (gain) of the luma plane of the image. The filter +accepts an integer value in range 0 to 1000. The default +value is set to 0. +

+
+
dc_U
+

Adjust the dc value (gain) of the 1st chroma plane of the image. The +filter accepts an integer value in range 0 to 1000. The +default value is set to 0. +

+
+
dc_V
+

Adjust the dc value (gain) of the 2nd chroma plane of the image. The +filter accepts an integer value in range 0 to 1000. The +default value is set to 0. +

+
+
weight_Y
+

Set the frequency domain weight expression for the luma plane. +

+
+
weight_U
+

Set the frequency domain weight expression for the 1st chroma plane. +

+
+
weight_V
+

Set the frequency domain weight expression for the 2nd chroma plane. +

+
+
eval
+

Set when the expressions are evaluated. +

+

It accepts the following values: +

+
init
+

Only evaluate expressions once during the filter initialization. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+ +

Default value is ‘init’. +

+

The filter accepts the following variables: +

+
X
+
Y
+

The coordinates of the current sample. +

+
+
W
+
H
+

The width and height of the image. +

+
+
N
+

The number of input frame, starting from 0. +

+
+
WS
+
HS
+

The size of FFT array for horizontal and vertical processing. +

+
+ + +
+

39.90.1 Examples

+ +
    +
  • High-pass: +
    +
    fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
    +
    + +
  • Low-pass: +
    +
    fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
    +
    + +
  • Sharpen: +
    +
    fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
    +
    + +
  • Blur: +
    +
    fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
    +
    + +
+ +
+
+
+

39.91 field

+ +

Extract a single field from an interlaced image using stride +arithmetic to avoid wasting CPU time. The output frames are marked as +non-interlaced. +

+

The filter accepts the following options: +

+
+
type
+

Specify whether to extract the top (if the value is 0 or +top) or the bottom field (if the value is 1 or +bottom). +

+
+ +
+
+

39.92 fieldhint

+ +

Create new frames by copying the top and bottom fields from surrounding frames +supplied as numbers by the hint file. +

+
+
hint
+

Set file containing hints: absolute/relative frame numbers. +

+

There must be one line for each frame in a clip. Each line must contain two +numbers separated by the comma, optionally followed by - or +. +Numbers supplied on each line of file can not be out of [N-1,N+1] where N +is current frame number for absolute mode or out of [-1, 1] range +for relative mode. First number tells from which frame to pick up top +field and second number tells from which frame to pick up bottom field. +

+

If optionally followed by + output frame will be marked as interlaced, +else if followed by - output frame will be marked as progressive, else +it will be marked same as input frame. +If optionally followed by t output frame will use only top field, or in +case of b it will use only bottom field. +If line starts with # or ; that line is skipped. +

+
+
mode
+

Can be item absolute or relative or pattern. Default is absolute. +The pattern mode is same as relative mode, except at last entry of file if there +are more frames to process than hint file is seek back to start. +

+
+ +

Example of first several lines of hint file for relative mode: +

+
0,0 - # first frame
+1,0 - # second frame, use third's frame top field and second's frame bottom field
+1,0 - # third frame, use fourth's frame top field and third's frame bottom field
+1,0 -
+0,0 -
+0,0 -
+1,0 -
+1,0 -
+1,0 -
+0,0 -
+0,0 -
+1,0 -
+1,0 -
+1,0 -
+0,0 -
+
+ +
+
+

39.93 fieldmatch

+ +

Field matching filter for inverse telecine. It is meant to reconstruct the +progressive frames from a telecined stream. The filter does not drop duplicated +frames, so to achieve a complete inverse telecine fieldmatch needs to be +followed by a decimation filter such as decimate in the filtergraph. +

+

The separation of the field matching and the decimation is notably motivated by +the possibility of inserting a de-interlacing filter fallback between the two. +If the source has mixed telecined and real interlaced content, +fieldmatch will not be able to match fields for the interlaced parts. +But these remaining combed frames will be marked as interlaced, and thus can be +de-interlaced by a later filter such as yadif before decimation. +

+

In addition to the various configuration options, fieldmatch can take an +optional second stream, activated through the ppsrc option. If +enabled, the frames reconstruction will be based on the fields and frames from +this second stream. This allows the first input to be pre-processed in order to +help the various algorithms of the filter, while keeping the output lossless +(assuming the fields are matched properly). Typically, a field-aware denoiser, +or brightness/contrast adjustments can help. +

+

Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project) +and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from +which fieldmatch is based on. While the semantic and usage are very +close, some behaviour and options names can differ. +

+

The decimate filter currently only works for constant frame rate input. +If your input has mixed telecined (30fps) and progressive content with a lower +framerate like 24fps use the following filterchain to produce the necessary cfr +stream: dejudder,fps=30000/1001,fieldmatch,decimate. +

+

The filter accepts the following options: +

+
+
order
+

Specify the assumed field order of the input stream. Available values are: +

+
+
auto
+

Auto detect parity (use FFmpeg’s internal parity value). +

+
bff
+

Assume bottom field first. +

+
tff
+

Assume top field first. +

+
+ +

Note that it is sometimes recommended not to trust the parity announced by the +stream. +

+

Default value is auto. +

+
+
mode
+

Set the matching mode or strategy to use. pc mode is the safest in the +sense that it won’t risk creating jerkiness due to duplicate frames when +possible, but if there are bad edits or blended fields it will end up +outputting combed frames when a good match might actually exist. On the other +hand, pcn_ub mode is the most risky in terms of creating jerkiness, +but will almost always find a good frame if there is one. The other values are +all somewhere in between pc and pcn_ub in terms of risking +jerkiness and creating duplicate frames versus finding good matches in sections +with bad edits, orphaned fields, blended fields, etc. +

+

More details about p/c/n/u/b are available in p/c/n/u/b meaning section. +

+

Available values are: +

+
+
pc
+

2-way matching (p/c) +

+
pc_n
+

2-way matching, and trying 3rd match if still combed (p/c + n) +

+
pc_u
+

2-way matching, and trying 3rd match (same order) if still combed (p/c + u) +

+
pc_n_ub
+

2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if +still combed (p/c + n + u/b) +

+
pcn
+

3-way matching (p/c/n) +

+
pcn_ub
+

3-way matching, and trying 4th/5th matches if all 3 of the original matches are +detected as combed (p/c/n + u/b) +

+
+ +

The parenthesis at the end indicate the matches that would be used for that +mode assuming order=tff (and field on auto or +top). +

+

In terms of speed pc mode is by far the fastest and pcn_ub is +the slowest. +

+

Default value is pc_n. +

+
+
ppsrc
+

Mark the main input stream as a pre-processed input, and enable the secondary +input stream as the clean source to pick the fields from. See the filter +introduction for more details. It is similar to the clip2 feature from +VFM/TFM. +

+

Default value is 0 (disabled). +

+
+
field
+

Set the field to match from. It is recommended to set this to the same value as +order unless you experience matching failures with that setting. In +certain circumstances changing the field that is used to match from can have a +large impact on matching performance. Available values are: +

+
+
auto
+

Automatic (same value as order). +

+
bottom
+

Match from the bottom field. +

+
top
+

Match from the top field. +

+
+ +

Default value is auto. +

+
+
mchroma
+

Set whether or not chroma is included during the match comparisons. In most +cases it is recommended to leave this enabled. You should set this to 0 +only if your clip has bad chroma problems such as heavy rainbowing or other +artifacts. Setting this to 0 could also be used to speed things up at +the cost of some accuracy. +

+

Default value is 1. +

+
+
y0
+
y1
+

These define an exclusion band which excludes the lines between y0 and +y1 from being included in the field matching decision. An exclusion +band can be used to ignore subtitles, a logo, or other things that may +interfere with the matching. y0 sets the starting scan line and +y1 sets the ending line; all lines in between y0 and +y1 (including y0 and y1) will be ignored. Setting +y0 and y1 to the same value will disable the feature. +y0 and y1 defaults to 0. +

+
+
scthresh
+

Set the scene change detection threshold as a percentage of maximum change on +the luma plane. Good values are in the [8.0, 14.0] range. Scene change +detection is only relevant in case combmatch=sc. The range for +scthresh is [0.0, 100.0]. +

+

Default value is 12.0. +

+
+
combmatch
+

When combatch is not none, fieldmatch will take into +account the combed scores of matches when deciding what match to use as the +final match. Available values are: +

+
+
none
+

No final matching based on combed scores. +

+
sc
+

Combed scores are only used when a scene change is detected. +

+
full
+

Use combed scores all the time. +

+
+ +

Default is sc. +

+
+
combdbg
+

Force fieldmatch to calculate the combed metrics for certain matches and +print them. This setting is known as micout in TFM/VFM vocabulary. +Available values are: +

+
+
none
+

No forced calculation. +

+
pcn
+

Force p/c/n calculations. +

+
pcnub
+

Force p/c/n/u/b calculations. +

+
+ +

Default value is none. +

+
+
cthresh
+

This is the area combing threshold used for combed frame detection. This +essentially controls how "strong" or "visible" combing must be to be detected. +Larger values mean combing must be more visible and smaller values mean combing +can be less visible or strong and still be detected. Valid settings are from +-1 (every pixel will be detected as combed) to 255 (no pixel will +be detected as combed). This is basically a pixel difference value. A good +range is [8, 12]. +

+

Default value is 9. +

+
+
chroma
+

Sets whether or not chroma is considered in the combed frame decision. Only +disable this if your source has chroma problems (rainbowing, etc.) that are +causing problems for the combed frame detection with chroma enabled. Actually, +using chroma=0 is usually more reliable, except for the case +where there is chroma only combing in the source. +

+

Default value is 0. +

+
+
blockx
+
blocky
+

Respectively set the x-axis and y-axis size of the window used during combed +frame detection. This has to do with the size of the area in which +combpel pixels are required to be detected as combed for a frame to be +declared combed. See the combpel parameter description for more info. +Possible values are any number that is a power of 2 starting at 4 and going up +to 512. +

+

Default value is 16. +

+
+
combpel
+

The number of combed pixels inside any of the blocky by +blockx size blocks on the frame for the frame to be detected as +combed. While cthresh controls how "visible" the combing must be, this +setting controls "how much" combing there must be in any localized area (a +window defined by the blockx and blocky settings) on the +frame. Minimum value is 0 and maximum is blocky x blockx (at +which point no frames will ever be detected as combed). This setting is known +as MI in TFM/VFM vocabulary. +

+

Default value is 80. +

+
+ + +
+

39.93.1 p/c/n/u/b meaning

+ + +
+

39.93.1.1 p/c/n

+ +

We assume the following telecined stream: +

+
+
Top fields:     1 2 2 3 4
+Bottom fields:  1 2 3 4 4
+
+ +

The numbers correspond to the progressive frame the fields relate to. Here, the +first two frames are progressive, the 3rd and 4th are combed, and so on. +

+

When fieldmatch is configured to run a matching from bottom +(field=bottom) this is how this input stream get transformed: +

+
+
Input stream:
+                T     1 2 2 3 4
+                B     1 2 3 4 4   <-- matching reference
+
+Matches:              c c n n c
+
+Output stream:
+                T     1 2 3 4 4
+                B     1 2 3 4 4
+
+ +

As a result of the field matching, we can see that some frames get duplicated. +To perform a complete inverse telecine, you need to rely on a decimation filter +after this operation. See for instance the decimate filter. +

+

The same operation now matching from top fields (field=top) +looks like this: +

+
+
Input stream:
+                T     1 2 2 3 4   <-- matching reference
+                B     1 2 3 4 4
+
+Matches:              c c p p c
+
+Output stream:
+                T     1 2 2 3 4
+                B     1 2 2 3 4
+
+ +

In these examples, we can see what p, c and n mean; +basically, they refer to the frame and field of the opposite parity: +

+
    +
  • p matches the field of the opposite parity in the previous frame +
  • c matches the field of the opposite parity in the current frame +
  • n matches the field of the opposite parity in the next frame +
+ +
+
+

39.93.1.2 u/b

+ +

The u and b matching are a bit special in the sense that they match +from the opposite parity flag. In the following examples, we assume that we are +currently matching the 2nd frame (Top:2, bottom:2). According to the match, a +’x’ is placed above and below each matched fields. +

+

With bottom matching (field=bottom): +

+
Match:           c         p           n          b          u
+
+                 x       x               x        x          x
+  Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
+  Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
+                 x         x           x        x              x
+
+Output frames:
+                 2          1          2          2          2
+                 2          2          2          1          3
+
+ +

With top matching (field=top): +

+
Match:           c         p           n          b          u
+
+                 x         x           x        x              x
+  Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
+  Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
+                 x       x               x        x          x
+
+Output frames:
+                 2          2          2          1          2
+                 2          1          3          2          2
+
+ +
+
+
+

39.93.2 Examples

+ +

Simple IVTC of a top field first telecined stream: +

+
fieldmatch=order=tff:combmatch=none, decimate
+
+ +

Advanced IVTC, with fallback on yadif for still combed frames: +

+
fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
+
+ +
+
+
+

39.94 fieldorder

+ +

Transform the field order of the input video. +

+

It accepts the following parameters: +

+
+
order
+

The output field order. Valid values are tff for top field first or bff +for bottom field first. +

+
+ +

The default value is ‘tff’. +

+

The transformation is done by shifting the picture content up or down +by one line, and filling the remaining line with appropriate picture content. +This method is consistent with most broadcast field order converters. +

+

If the input video is not flagged as being interlaced, or it is already +flagged as being of the required output field order, then this filter does +not alter the incoming video. +

+

It is very useful when converting to or from PAL DV material, +which is bottom field first. +

+

For example: +

+
ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
+
+ +
+
+

39.95 fifo, afifo

+ +

Buffer input images and send them when they are requested. +

+

It is mainly useful when auto-inserted by the libavfilter +framework. +

+

It does not take parameters. +

+
+
+

39.96 fillborders

+ +

Fill borders of the input video, without changing video stream dimensions. +Sometimes video can have garbage at the four edges and you may not want to +crop video input to keep size multiple of some number. +

+

This filter accepts the following options: +

+
+
left
+

Number of pixels to fill from left border. +

+
+
right
+

Number of pixels to fill from right border. +

+
+
top
+

Number of pixels to fill from top border. +

+
+
bottom
+

Number of pixels to fill from bottom border. +

+
+
mode
+

Set fill mode. +

+

It accepts the following values: +

+
smear
+

fill pixels using outermost pixels +

+
+
mirror
+

fill pixels using mirroring (half sample symmetric) +

+
+
fixed
+

fill pixels with constant value +

+
+
reflect
+

fill pixels using reflecting (whole sample symmetric) +

+
+
wrap
+

fill pixels using wrapping +

+
+
fade
+

fade pixels to constant value +

+
+
margins
+

fill pixels at top and bottom with weighted averages pixels near borders +

+
+ +

Default is smear. +

+
+
color
+

Set color for pixels in fixed or fade mode. Default is black. +

+
+ + +
+

39.96.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

39.97 find_rect

+ +

Find a rectangular object in the input video. +

+

The object to search for must be specified as a gray8 image specified with the +object option. +

+

For each possible match, a score is computed. If the score reaches the specified +threshold, the object is considered found. +

+

If the input video contains multiple instances of the object, the filter will +find only one of them. +

+

When an object is found, the following metadata entries are set in the matching +frame: +

+
lavfi.rect.w
+

width of object +

+
+
lavfi.rect.h
+

height of object +

+
+
lavfi.rect.x
+

x position of object +

+
+
lavfi.rect.y
+

y position of object +

+
+
lavfi.rect.score
+

match score of the found object +

+
+ +

It accepts the following options: +

+
+
object
+

Filepath of the object image, needs to be in gray8. +

+
+
threshold
+

Detection threshold, expressed as a decimal number in the range 0-1. +

+

A threshold value of 0.01 means only exact matches, a threshold of 0.99 means +almost everything matches. +

+

Default value is 0.5. +

+
+
mipmaps
+

Number of mipmaps, default is 3. +

+
+
xmin, ymin, xmax, ymax
+

Specifies the rectangle in which to search. +

+
+
discard
+

Discard frames where object is not detected. Default is disabled. +

+
+ + +
+

39.97.1 Examples

+ +
    +
  • Cover a rectangular object by the supplied image of a given video using ffmpeg: +
    +
    ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
    +
    + +
  • Find the position of an object in each frame using ffprobe and write +it to a log file: +
    +
    ffprobe -f lavfi movie=test.mp4,find_rect=object=object.pgm:threshold=0.3 \
    +  -show_entries frame=pkt_pts_time:frame_tags=lavfi.rect.x,lavfi.rect.y \
    +  -of csv -o find_rect.csv
    +
    + +
+ +
+
+
+

39.98 floodfill

+ +

Flood area with values of same pixel components with another values. +

+

It accepts the following options: +

+
x
+

Set pixel x coordinate. +

+
+
y
+

Set pixel y coordinate. +

+
+
s0
+

Set source #0 component value. +

+
+
s1
+

Set source #1 component value. +

+
+
s2
+

Set source #2 component value. +

+
+
s3
+

Set source #3 component value. +

+
+
d0
+

Set destination #0 component value. +

+
+
d1
+

Set destination #1 component value. +

+
+
d2
+

Set destination #2 component value. +

+
+
d3
+

Set destination #3 component value. +

+
+ +
+
+

39.99 format

+ +

Convert the input video to one of the specified pixel formats. +Libavfilter will try to pick one that is suitable as input to +the next filter. +

+

It accepts the following parameters: +

+
pix_fmts
+

A ’|’-separated list of pixel format names, such as +"pix_fmts=yuv420p|monow|rgb24". +

+
+
+ + +
+

39.99.1 Examples

+ +
    +
  • Convert the input video to the yuv420p format +
    +
    format=pix_fmts=yuv420p
    +
    + +

    Convert the input video to any of the formats in the list +

    +
    format=pix_fmts=yuv420p|yuv444p|yuv410p
    +
    +
+ +
+
+
+

39.100 fps

+ +

Convert the video to specified constant frame rate by duplicating or dropping +frames as necessary. +

+

It accepts the following parameters: +

+
fps
+

The desired output frame rate. It accepts expressions containing the following +constants: +

+
+
source_fps
+

The input’s frame rate +

+
+
ntsc
+

NTSC frame rate of 30000/1001 +

+
+
pal
+

PAL frame rate of 25.0 +

+
+
film
+

Film frame rate of 24.0 +

+
+
ntsc_film
+

NTSC-film frame rate of 24000/1001 +

+
+ +

The default is 25. +

+
+
start_time
+

Assume the first PTS should be the given value, in seconds. This allows for +padding/trimming at the start of stream. By default, no assumption is made +about the first frame’s expected PTS, so no padding or trimming is done. +For example, this could be set to 0 to pad the beginning with duplicates of +the first frame if a video stream starts after the audio stream or to trim any +frames with a negative PTS. +

+
+
round
+

Timestamp (PTS) rounding method. +

+

Possible values are: +

+
zero
+

round towards 0 +

+
inf
+

round away from 0 +

+
down
+

round towards -infinity +

+
up
+

round towards +infinity +

+
near
+

round to nearest +

+
+

The default is near. +

+
+
eof_action
+

Action performed when reading the last frame. +

+

Possible values are: +

+
round
+

Use same timestamp rounding method as used for other frames. +

+
pass
+

Pass through last frame if input duration has not been reached yet. +

+
+

The default is round. +

+
+
+ +

Alternatively, the options can be specified as a flat string: +fps[:start_time[:round]]. +

+

See also the setpts filter. +

+ +
+

39.100.1 Examples

+ +
    +
  • A typical usage in order to set the fps to 25: +
    +
    fps=fps=25
    +
    + +
  • Sets the fps to 24, using abbreviation and rounding method to round to nearest: +
    +
    fps=fps=film:round=near
    +
    +
+ +
+
+
+

39.101 framepack

+ +

Pack two different video streams into a stereoscopic video, setting proper +metadata on supported codecs. The two views should have the same size and +framerate and processing will stop when the shorter video ends. Please note +that you may conveniently adjust view properties with the scale and +fps filters. +

+

It accepts the following parameters: +

+
format
+

The desired packing format. Supported values are: +

+
+
sbs
+

The views are next to each other (default). +

+
+
tab
+

The views are on top of each other. +

+
+
lines
+

The views are packed by line. +

+
+
columns
+

The views are packed by column. +

+
+
frameseq
+

The views are temporally interleaved. +

+
+
+ +
+
+ +

Some examples: +

+
+
# Convert left and right views into a frame-sequential video
+ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
+
+# Convert views into a side-by-side video with the same output resolution as the input
+ffmpeg -i LEFT -i RIGHT -filter_complex [0:v]scale=w=iw/2[left],[1:v]scale=w=iw/2[right],[left][right]framepack=sbs OUTPUT
+
+ +
+
+

39.102 framerate

+ +

Change the frame rate by interpolating new video output frames from the source +frames. +

+

This filter is not designed to function correctly with interlaced media. If +you wish to change the frame rate of interlaced media then you are required +to deinterlace before this filter and re-interlace after this filter. +

+

A description of the accepted options follows. +

+
+
fps
+

Specify the output frames per second. This option can also be specified +as a value alone. The default is 50. +

+
+
interp_start
+

Specify the start of a range where the output frame will be created as a +linear interpolation of two frames. The range is [0-255], +the default is 15. +

+
+
interp_end
+

Specify the end of a range where the output frame will be created as a +linear interpolation of two frames. The range is [0-255], +the default is 240. +

+
+
scene
+

Specify the level at which a scene change is detected as a value between +0 and 100 to indicate a new scene; a low value reflects a low +probability for the current frame to introduce a new scene, while a higher +value means the current frame is more likely to be one. +The default is 8.2. +

+
+
flags
+

Specify flags influencing the filter process. +

+

Available value for flags is: +

+
+
scene_change_detect, scd
+

Enable scene change detection using the value of the option scene. +This flag is enabled by default. +

+
+
+
+ +
+
+

39.103 framestep

+ +

Select one frame every N-th frame. +

+

This filter accepts the following option: +

+
step
+

Select frame after every step frames. +Allowed values are positive integers higher than 0. Default value is 1. +

+
+ +
+
+

39.104 freezedetect

+ +

Detect frozen video. +

+

This filter logs a message and sets frame metadata when it detects that the +input video has no significant change in content during a specified duration. +Video freeze detection calculates the mean average absolute difference of all +the components of video frames and compares it to a noise floor. +

+

The printed times and duration are expressed in seconds. The +lavfi.freezedetect.freeze_start metadata key is set on the first frame +whose timestamp equals or exceeds the detection duration and it contains the +timestamp of the first frame of the freeze. The +lavfi.freezedetect.freeze_duration and +lavfi.freezedetect.freeze_end metadata keys are set on the first frame +after the freeze. +

+

The filter accepts the following options: +

+
+
noise, n
+

Set noise tolerance. Can be specified in dB (in case "dB" is appended to the +specified value) or as a difference ratio between 0 and 1. Default is -60dB, or +0.001. +

+
+
duration, d
+

Set freeze duration until notification (default is 2 seconds). +

+
+ +
+
+

39.105 freezeframes

+ +

Freeze video frames. +

+

This filter freezes video frames using frame from 2nd input. +

+

The filter accepts the following options: +

+
+
first
+

Set number of first frame from which to start freeze. +

+
+
last
+

Set number of last frame from which to end freeze. +

+
+
replace
+

Set number of frame from 2nd input which will be used instead of replaced frames. +

+
+ +
+
+

39.106 frei0r

+ +

Apply a frei0r effect to the input video. +

+

To enable the compilation of this filter, you need to install the frei0r +header and configure FFmpeg with --enable-frei0r. +

+

It accepts the following parameters: +

+
+
filter_name
+

The name of the frei0r effect to load. If the environment variable +FREI0R_PATH is defined, the frei0r effect is searched for in each of the +directories specified by the colon-separated list in FREI0R_PATH. +Otherwise, the standard frei0r paths are searched, in this order: +HOME/.frei0r-1/lib/, /usr/local/lib/frei0r-1/, +/usr/lib/frei0r-1/. +

+
+
filter_params
+

A ’|’-separated list of parameters to pass to the frei0r effect. +

+
+
+ +

A frei0r effect parameter can be a boolean (its value is either +"y" or "n"), a double, a color (specified as +R/G/B, where R, G, and B are floating point +numbers between 0.0 and 1.0, inclusive) or a color description as specified in the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual, +a position (specified as X/Y, where +X and Y are floating point numbers) and/or a string. +

+

The number and types of parameters depend on the loaded effect. If an +effect parameter is not specified, the default value is set. +

+ +
+

39.106.1 Examples

+ +
    +
  • Apply the distort0r effect, setting the first two double parameters: +
    +
    frei0r=filter_name=distort0r:filter_params=0.5|0.01
    +
    + +
  • Apply the colordistance effect, taking a color as the first parameter: +
    +
    frei0r=colordistance:0.2/0.3/0.4
    +frei0r=colordistance:violet
    +frei0r=colordistance:0x112233
    +
    + +
  • Apply the perspective effect, specifying the top left and top right image +positions: +
    +
    frei0r=perspective:0.2/0.2|0.8/0.2
    +
    +
+ +

For more information, see +http://frei0r.dyne.org +

+
+
+

39.106.2 Commands

+ +

This filter supports the filter_params option as commands. +

+
+
+
+

39.107 fspp

+ +

Apply fast and simple postprocessing. It is a faster version of spp. +

+

It splits (I)DCT into horizontal/vertical passes. Unlike the simple post- +processing filter, one of them is performed once per block, not per pixel. +This allows for much higher speed. +

+

The filter accepts the following options: +

+
+
quality
+

Set quality. This option defines the number of levels for averaging. It accepts +an integer in the range 4-5. Default value is 4. +

+
+
qp
+

Force a constant quantization parameter. It accepts an integer in range 0-63. +If not set, the filter will use the QP from the video stream (if available). +

+
+
strength
+

Set filter strength. It accepts an integer in range -15 to 32. Lower values mean +more details but also more artifacts, while higher values make the image smoother +but also blurrier. Default value is 0 − PSNR optimal. +

+
+
use_bframe_qp
+

Enable the use of the QP from the B-Frames if set to 1. Using this +option may cause flicker since the B-Frames have often larger QP. Default is +0 (not enabled). +

+
+
+ +
+
+

39.108 gblur

+ +

Apply Gaussian blur filter. +

+

The filter accepts the following options: +

+
+
sigma
+

Set horizontal sigma, standard deviation of Gaussian blur. Default is 0.5. +

+
+
steps
+

Set number of steps for Gaussian approximation. Default is 1. +

+
+
planes
+

Set which planes to filter. By default all planes are filtered. +

+
+
sigmaV
+

Set vertical sigma, if negative it will be same as sigma. +Default is -1. +

+
+ + +
+

39.108.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

39.109 geq

+ +

Apply generic equation to each pixel. +

+

The filter accepts the following options: +

+
+
lum_expr, lum
+

Set the luminance expression. +

+
cb_expr, cb
+

Set the chrominance blue expression. +

+
cr_expr, cr
+

Set the chrominance red expression. +

+
alpha_expr, a
+

Set the alpha expression. +

+
red_expr, r
+

Set the red expression. +

+
green_expr, g
+

Set the green expression. +

+
blue_expr, b
+

Set the blue expression. +

+
+ +

The colorspace is selected according to the specified options. If one +of the lum_expr, cb_expr, or cr_expr +options is specified, the filter will automatically select a YCbCr +colorspace. If one of the red_expr, green_expr, or +blue_expr options is specified, it will select an RGB +colorspace. +

+

If one of the chrominance expression is not defined, it falls back on the other +one. If no alpha expression is specified it will evaluate to opaque value. +If none of chrominance expressions are specified, they will evaluate +to the luminance expression. +

+

The expressions can use the following variables and functions: +

+
+
N
+

The sequential number of the filtered frame, starting from 0. +

+
+
X
+
Y
+

The coordinates of the current sample. +

+
+
W
+
H
+

The width and height of the image. +

+
+
SW
+
SH
+

Width and height scale depending on the currently filtered plane. It is the +ratio between the corresponding luma plane number of pixels and the current +plane ones. E.g. for YUV4:2:0 the values are 1,1 for the luma plane, and +0.5,0.5 for chroma planes. +

+
+
T
+

Time of the current frame, expressed in seconds. +

+
+
p(x, y)
+

Return the value of the pixel at location (x,y) of the current +plane. +

+
+
lum(x, y)
+

Return the value of the pixel at location (x,y) of the luminance +plane. +

+
+
cb(x, y)
+

Return the value of the pixel at location (x,y) of the +blue-difference chroma plane. Return 0 if there is no such plane. +

+
+
cr(x, y)
+

Return the value of the pixel at location (x,y) of the +red-difference chroma plane. Return 0 if there is no such plane. +

+
+
r(x, y)
+
g(x, y)
+
b(x, y)
+

Return the value of the pixel at location (x,y) of the +red/green/blue component. Return 0 if there is no such component. +

+
+
alpha(x, y)
+

Return the value of the pixel at location (x,y) of the alpha +plane. Return 0 if there is no such plane. +

+
+
psum(x,y), lumsum(x, y), cbsum(x,y), crsum(x,y), rsum(x,y), gsum(x,y), bsum(x,y), alphasum(x,y)
+

Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining +sums of samples within a rectangle. See the functions without the sum postfix. +

+
+
interpolation
+

Set one of interpolation methods: +

+
nearest, n
+
bilinear, b
+
+

Default is bilinear. +

+
+ +

For functions, if x and y are outside the area, the value will be +automatically clipped to the closer edge. +

+

Please note that this filter can use multiple threads in which case each slice +will have its own expression state. If you want to use only a single expression +state because your expressions depend on previous state then you should limit +the number of filter threads to 1. +

+ +
+

39.109.1 Examples

+ +
    +
  • Flip the image horizontally: +
    +
    geq=p(W-X\,Y)
    +
    + +
  • Generate a bidimensional sine wave, with angle PI/3 and a +wavelength of 100 pixels: +
    +
    geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
    +
    + +
  • Generate a fancy enigmatic moving light: +
    +
    nullsrc=s=256x256,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128
    +
    + +
  • Generate a quick emboss effect: +
    +
    format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
    +
    + +
  • Modify RGB components depending on pixel position: +
    +
    geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
    +
    + +
  • Create a radial gradient that is the same size as the input (also see +the vignette filter): +
    +
    geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray
    +
    +
+ +
+
+
+

39.110 gradfun

+ +

Fix the banding artifacts that are sometimes introduced into nearly flat +regions by truncation to 8-bit color depth. +Interpolate the gradients that should go where the bands are, and +dither them. +

+

It is designed for playback only. Do not use it prior to +lossy compression, because compression tends to lose the dither and +bring back the bands. +

+

It accepts the following parameters: +

+
+
strength
+

The maximum amount by which the filter will change any one pixel. This is also +the threshold for detecting nearly flat regions. Acceptable values range from +.51 to 64; the default value is 1.2. Out-of-range values will be clipped to the +valid range. +

+
+
radius
+

The neighborhood to fit the gradient to. A larger radius makes for smoother +gradients, but also prevents the filter from modifying the pixels near detailed +regions. Acceptable values are 8-32; the default value is 16. Out-of-range +values will be clipped to the valid range. +

+
+
+ +

Alternatively, the options can be specified as a flat string: +strength[:radius] +

+ +
+

39.110.1 Examples

+ +
    +
  • Apply the filter with a 3.5 strength and radius of 8: +
    +
    gradfun=3.5:8
    +
    + +
  • Specify radius, omitting the strength (which will fall-back to the default +value): +
    +
    gradfun=radius=8
    +
    + +
+ +
+
+
+

39.111 graphmonitor

+

Show various filtergraph stats. +

+

With this filter one can debug complete filtergraph. +Especially issues with links filling with queued frames. +

+

The filter accepts the following options: +

+
+
size, s
+

Set video output size. Default is hd720. +

+
+
opacity, o
+

Set video opacity. Default is 0.9. Allowed range is from 0 to 1. +

+
+
mode, m
+

Set output mode flags. +

+

Available values for flags are: +

+
full
+

No any filtering. Default. +

+
compact
+

Show only filters with queued frames. +

+
nozero
+

Show only filters with non-zero stats. +

+
noeof
+

Show only filters with non-eof stat. +

+
nodisabled
+

Show only filters that are enabled in timeline. +

+
+ +
+
flags, f
+

Set flags which enable which stats are shown in video. +

+

Available values for flags are: +

+
none
+

All flags turned off. +

+
+
all
+

All flags turned on. +

+
+
queue
+

Display number of queued frames in each link. +

+
+
frame_count_in
+

Display number of frames taken from filter. +

+
+
frame_count_out
+

Display number of frames given out from filter. +

+
+
frame_count_delta
+

Display delta number of frames between above two values. +

+
+
pts
+

Display current filtered frame pts. +

+
+
pts_delta
+

Display pts delta between current and previous frame. +

+
+
time
+

Display current filtered frame time. +

+
+
time_delta
+

Display time delta between current and previous frame. +

+
+
timebase
+

Display time base for filter link. +

+
+
format
+

Display used format for filter link. +

+
+
size
+

Display video size or number of audio channels in case of audio used by filter link. +

+
+
rate
+

Display video frame rate or sample rate in case of audio used by filter link. +

+
+
eof
+

Display link output status. +

+
+
sample_count_in
+

Display number of samples taken from filter. +

+
+
sample_count_out
+

Display number of samples given out from filter. +

+
+
sample_count_delta
+

Display delta number of samples between above two values. +

+
+
disabled
+

Show the timeline filter status. +

+
+ +
+
rate, r
+

Set upper limit for video rate of output stream, Default value is 25. +This guarantee that output video frame rate will not be higher than this value. +

+
+ +
+
+

39.112 grayworld

+

A color constancy filter that applies color correction based on the grayworld assumption +

+

See: https://www.researchgate.net/publication/275213614_A_New_Color_Correction_Method_for_Underwater_Imaging +

+

The algorithm uses linear light, so input +data should be linearized beforehand (and possibly correctly tagged). +

+
+
ffmpeg -i INPUT -vf zscale=transfer=linear,grayworld,zscale=transfer=bt709,format=yuv420p OUTPUT
+
+ +
+
+

39.113 greyedge

+

A color constancy variation filter which estimates scene illumination via grey edge algorithm +and corrects the scene colors accordingly. +

+

See: https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf +

+

The filter accepts the following options: +

+
+
difford
+

The order of differentiation to be applied on the scene. Must be chosen in the range +[0,2] and default value is 1. +

+
+
minknorm
+

The Minkowski parameter to be used for calculating the Minkowski distance. Must +be chosen in the range [0,20] and default value is 1. Set to 0 for getting +max value instead of calculating Minkowski distance. +

+
+
sigma
+

The standard deviation of Gaussian blur to be applied on the scene. Must be +chosen in the range [0,1024.0] and default value = 1. floor( sigma * break_off_sigma(3) ) +can’t be equal to 0 if difford is greater than 0. +

+
+ + +
+

39.113.1 Examples

+
    +
  • Grey Edge: +
    +
    greyedge=difford=1:minknorm=5:sigma=2
    +
    + +
  • Max Edge: +
    +
    greyedge=difford=1:minknorm=0:sigma=2
    +
    + +
+ +
+
+
+

39.114 guided

+

Apply guided filter for edge-preserving smoothing, dehazing and so on. +

+

The filter accepts the following options: +

+
radius
+

Set the box radius in pixels. +Allowed range is 1 to 20. Default is 3. +

+
+
eps
+

Set regularization parameter (with square). +Allowed range is 0 to 1. Default is 0.01. +

+
+
mode
+

Set filter mode. Can be basic or fast. +Default is basic. +

+
+
sub
+

Set subsampling ratio for fast mode. +Range is 2 to 64. Default is 4. +No subsampling occurs in basic mode. +

+
+
guidance
+

Set guidance mode. Can be off or on. Default is off. +If off, single input is required. +If on, two inputs of the same resolution and pixel format are required. +The second input serves as the guidance. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

39.114.1 Commands

+

This filter supports the all above options as commands. +

+
+
+

39.114.2 Examples

+
    +
  • Edge-preserving smoothing with guided filter: +
    +
    ffmpeg -i in.png -vf guided out.png
    +
    + +
  • Dehazing, structure-transferring filtering, detail enhancement with guided filter. +For the generation of guidance image, refer to paper "Guided Image Filtering". +See: http://kaiminghe.com/publications/pami12guidedfilter.pdf. +
    +
    ffmpeg -i in.png -i guidance.png -filter_complex guided=guidance=on out.png
    +
    + +
+ +
+
+
+

39.115 haldclut

+ +

Apply a Hald CLUT to a video stream. +

+

First input is the video stream to process, and second one is the Hald CLUT. +The Hald CLUT input can be a simple picture or a complete video stream. +

+

The filter accepts the following options: +

+
+
clut
+

Set which CLUT video frames will be processed from second input stream, +can be first or all. Default is all. +

+
+
shortest
+

Force termination when the shortest input terminates. Default is 0. +

+
repeatlast
+

Continue applying the last CLUT after the end of the stream. A value of +0 disable the filter after the last frame of the CLUT is reached. +Default is 1. +

+
+ +

haldclut also has the same interpolation options as lut3d (both +filters share the same internals). +

+

This filter also supports the framesync options. +

+

More information about the Hald CLUT can be found on Eskil Steenberg’s website +(Hald CLUT author) at http://www.quelsolaar.com/technology/clut.html. +

+ +
+

39.115.1 Commands

+ +

This filter supports the interp option as commands. +

+
+
+

39.115.2 Workflow examples

+ + +
+

39.115.2.1 Hald CLUT video stream

+ +

Generate an identity Hald CLUT stream altered with various effects: +

+
ffmpeg -f lavfi -i haldclutsrc=8 -vf "hue=H=2*PI*t:s=sin(2*PI*t)+1, curves=cross_process" -t 10 -c:v ffv1 clut.nut
+
+ +

Note: make sure you use a lossless codec. +

+

Then use it with haldclut to apply it on some random stream: +

+
ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
+
+ +

The Hald CLUT will be applied to the 10 first seconds (duration of +clut.nut), then the latest picture of that CLUT stream will be applied +to the remaining frames of the mandelbrot stream. +

+
+
+

39.115.2.2 Hald CLUT with preview

+ +

A Hald CLUT is supposed to be a squared image of Level*Level*Level by +Level*Level*Level pixels. For a given Hald CLUT, FFmpeg will select the +biggest possible square starting at the top left of the picture. The remaining +padding pixels (bottom or right) will be ignored. This area can be used to add +a preview of the Hald CLUT. +

+

Typically, the following generated Hald CLUT will be supported by the +haldclut filter: +

+
+
ffmpeg -f lavfi -i haldclutsrc=8 -vf "
+   pad=iw+320 [padded_clut];
+   smptebars=s=320x256, split [a][b];
+   [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
+   [main][b] overlay=W-320" -frames:v 1 clut.png
+
+ +

It contains the original and a preview of the effect of the CLUT: SMPTE color +bars are displayed on the right-top, and below the same color bars processed by +the color changes. +

+

Then, the effect of this Hald CLUT can be visualized with: +

+
ffplay input.mkv -vf "movie=clut.png, [in] haldclut"
+
+ +
+
+
+
+

39.116 hflip

+ +

Flip the input video horizontally. +

+

For example, to horizontally flip the input video with ffmpeg: +

+
ffmpeg -i in.avi -vf "hflip" out.avi
+
+ +
+
+

39.117 histeq

+

This filter applies a global color histogram equalization on a +per-frame basis. +

+

It can be used to correct video that has a compressed range of pixel +intensities. The filter redistributes the pixel intensities to +equalize their distribution across the intensity range. It may be +viewed as an "automatically adjusting contrast filter". This filter is +useful only for correcting degraded or poorly captured source +video. +

+

The filter accepts the following options: +

+
+
strength
+

Determine the amount of equalization to be applied. As the strength +is reduced, the distribution of pixel intensities more-and-more +approaches that of the input frame. The value must be a float number +in the range [0,1] and defaults to 0.200. +

+
+
intensity
+

Set the maximum intensity that can generated and scale the output +values appropriately. The strength should be set as desired and then +the intensity can be limited if needed to avoid washing-out. The value +must be a float number in the range [0,1] and defaults to 0.210. +

+
+
antibanding
+

Set the antibanding level. If enabled the filter will randomly vary +the luminance of output pixels by a small amount to avoid banding of +the histogram. Possible values are none, weak or +strong. It defaults to none. +

+
+ +
+
+

39.118 histogram

+ +

Compute and draw a color distribution histogram for the input video. +

+

The computed histogram is a representation of the color component +distribution in an image. +

+

Standard histogram displays the color components distribution in an image. +Displays color graph for each color component. Shows distribution of +the Y, U, V, A or R, G, B components, depending on input format, in the +current frame. Below each graph a color component scale meter is shown. +

+

The filter accepts the following options: +

+
+
level_height
+

Set height of level. Default value is 200. +Allowed range is [50, 2048]. +

+
+
scale_height
+

Set height of color scale. Default value is 12. +Allowed range is [0, 40]. +

+
+
display_mode
+

Set display mode. +It accepts the following values: +

+
stack
+

Per color component graphs are placed below each other. +

+
+
parade
+

Per color component graphs are placed side by side. +

+
+
overlay
+

Presents information identical to that in the parade, except +that the graphs representing color components are superimposed directly +over one another. +

+
+

Default is stack. +

+
+
levels_mode
+

Set mode. Can be either linear, or logarithmic. +Default is linear. +

+
+
components
+

Set what color components to display. +Default is 7. +

+
+
fgopacity
+

Set foreground opacity. Default is 0.7. +

+
+
bgopacity
+

Set background opacity. Default is 0.5. +

+
+
colors_mode
+

Set colors mode. +It accepts the following values: +

+
whiteonblack
+
blackonwhite
+
whiteongray
+
blackongray
+
coloronblack
+
coloronwhite
+
colorongray
+
blackoncolor
+
whiteoncolor
+
grayoncolor
+
+

Default is whiteonblack. +

+
+ + +
+

39.118.1 Examples

+ +
    +
  • Calculate and draw histogram: +
    +
    ffplay -i input -vf histogram
    +
    + +
+ +
+
+
+

39.119 hqdn3d

+ +

This is a high precision/quality 3d denoise filter. It aims to reduce +image noise, producing smooth images and making still images really +still. It should enhance compressibility. +

+

It accepts the following optional parameters: +

+
+
luma_spatial
+

A non-negative floating point number which specifies spatial luma strength. +It defaults to 4.0. +

+
+
chroma_spatial
+

A non-negative floating point number which specifies spatial chroma strength. +It defaults to 3.0*luma_spatial/4.0. +

+
+
luma_tmp
+

A floating point number which specifies luma temporal strength. It defaults to +6.0*luma_spatial/4.0. +

+
+
chroma_tmp
+

A floating point number which specifies chroma temporal strength. It defaults to +luma_tmp*chroma_spatial/luma_spatial. +

+
+ + +
+

39.119.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

39.120 hwdownload

+ +

Download hardware frames to system memory. +

+

The input must be in hardware frames, and the output a non-hardware format. +Not all formats will be supported on the output - it may be necessary to insert +an additional format filter immediately following in the graph to get +the output in a supported format. +

+
+
+

39.121 hwmap

+ +

Map hardware frames to system memory or to another device. +

+

This filter has several different modes of operation; which one is used depends +on the input and output formats: +

    +
  • Hardware frame input, normal frame output + +

    Map the input frames to system memory and pass them to the output. If the +original hardware frame is later required (for example, after overlaying +something else on part of it), the hwmap filter can be used again +in the next mode to retrieve it. +

  • Normal frame input, hardware frame output + +

    If the input is actually a software-mapped hardware frame, then unmap it - +that is, return the original hardware frame. +

    +

    Otherwise, a device must be provided. Create new hardware surfaces on that +device for the output, then map them back to the software format at the input +and give those frames to the preceding filter. This will then act like the +hwupload filter, but may be able to avoid an additional copy when +the input is already in a compatible format. +

  • Hardware frame input and output + +

    A device must be supplied for the output, either directly or with the +derive_device option. The input and output devices must be of +different types and compatible - the exact meaning of this is +system-dependent, but typically it means that they must refer to the same +underlying hardware context (for example, refer to the same graphics card). +

    +

    If the input frames were originally created on the output device, then unmap +to retrieve the original frames. +

    +

    Otherwise, map the frames to the output device - create new hardware frames +on the output corresponding to the frames on the input. +

+ +

The following additional parameters are accepted: +

+
+
mode
+

Set the frame mapping mode. Some combination of: +

+
read
+

The mapped frame should be readable. +

+
write
+

The mapped frame should be writeable. +

+
overwrite
+

The mapping will always overwrite the entire frame. +

+

This may improve performance in some cases, as the original contents of the +frame need not be loaded. +

+
direct
+

The mapping must not involve any copying. +

+

Indirect mappings to copies of frames are created in some cases where either +direct mapping is not possible or it would have unexpected properties. +Setting this flag ensures that the mapping is direct and will fail if that is +not possible. +

+
+

Defaults to read+write if not specified. +

+
+
derive_device type
+

Rather than using the device supplied at initialisation, instead derive a new +device of type type from the device the input frames exist on. +

+
+
reverse
+

In a hardware to hardware mapping, map in reverse - create frames in the sink +and map them back to the source. This may be necessary in some cases where +a mapping in one direction is required but only the opposite direction is +supported by the devices being used. +

+

This option is dangerous - it may break the preceding filter in undefined +ways if there are any additional constraints on that filter’s output. +Do not use it without fully understanding the implications of its use. +

+
+ +
+
+

39.122 hwupload

+ +

Upload system memory frames to hardware surfaces. +

+

The device to upload to must be supplied when the filter is initialised. If +using ffmpeg, select the appropriate device with the -filter_hw_device +option or with the derive_device option. The input and output devices +must be of different types and compatible - the exact meaning of this is +system-dependent, but typically it means that they must refer to the same +underlying hardware context (for example, refer to the same graphics card). +

+

The following additional parameters are accepted: +

+
+
derive_device type
+

Rather than using the device supplied at initialisation, instead derive a new +device of type type from the device the input frames exist on. +

+
+ +
+
+

39.123 hwupload_cuda

+ +

Upload system memory frames to a CUDA device. +

+

It accepts the following optional parameters: +

+
+
device
+

The number of the CUDA device to use +

+
+ +
+
+

39.124 hqx

+ +

Apply a high-quality magnification filter designed for pixel art. This filter +was originally created by Maxim Stepin. +

+

It accepts the following option: +

+
+
n
+

Set the scaling dimension: 2 for hq2x, 3 for +hq3x and 4 for hq4x. +Default is 3. +

+
+ +
+
+

39.125 hstack

+

Stack input videos horizontally. +

+

All streams must be of same pixel format and of same height. +

+

Note that this filter is faster than using overlay and pad filter +to create same output. +

+

The filter accepts the following option: +

+
+
inputs
+

Set number of input streams. Default is 2. +

+
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+ +
+
+

39.126 hsvhold

+

Turns a certain HSV range into gray values. +

+

This filter measures color difference between set HSV color in options +and ones measured in video stream. Depending on options, output +colors can be changed to be gray or not. +

+

The filter accepts the following options: +

+
+
hue
+

Set the hue value which will be used in color difference calculation. +Allowed range is from -360 to 360. Default value is 0. +

+
+
sat
+

Set the saturation value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
val
+

Set the value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
similarity
+

Set similarity percentage with the key color. +Allowed range is from 0 to 1. Default value is 0.01. +

+

0.00001 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +Allowed range is from 0 to 1. Default value is 0. +

+

0.0 makes pixels either fully gray, or not gray at all. +

+

Higher values result in more gray pixels, with a higher gray pixel +the more similar the pixels color is to the key color. +

+
+ +
+
+

39.127 hsvkey

+

Turns a certain HSV range into transparency. +

+

This filter measures color difference between set HSV color in options +and ones measured in video stream. Depending on options, output +colors can be changed to transparent by adding alpha channel. +

+

The filter accepts the following options: +

+
+
hue
+

Set the hue value which will be used in color difference calculation. +Allowed range is from -360 to 360. Default value is 0. +

+
+
sat
+

Set the saturation value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
val
+

Set the value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
similarity
+

Set similarity percentage with the key color. +Allowed range is from 0 to 1. Default value is 0.01. +

+

0.00001 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +Allowed range is from 0 to 1. Default value is 0. +

+

0.0 makes pixels either fully transparent, or not transparent at all. +

+

Higher values result in semi-transparent pixels, with a higher transparency +the more similar the pixels color is to the key color. +

+
+ +
+
+

39.128 hue

+ +

Modify the hue and/or the saturation of the input. +

+

It accepts the following parameters: +

+
+
h
+

Specify the hue angle as a number of degrees. It accepts an expression, +and defaults to "0". +

+
+
s
+

Specify the saturation in the [-10,10] range. It accepts an expression and +defaults to "1". +

+
+
H
+

Specify the hue angle as a number of radians. It accepts an +expression, and defaults to "0". +

+
+
b
+

Specify the brightness in the [-10,10] range. It accepts an expression and +defaults to "0". +

+
+ +

h and H are mutually exclusive, and can’t be +specified at the same time. +

+

The b, h, H and s option values are +expressions containing the following constants: +

+
+
n
+

frame count of the input frame starting from 0 +

+
+
pts
+

presentation timestamp of the input frame expressed in time base units +

+
+
r
+

frame rate of the input video, NAN if the input frame rate is unknown +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
tb
+

time base of the input video +

+
+ + +
+

39.128.1 Examples

+ +
    +
  • Set the hue to 90 degrees and the saturation to 1.0: +
    +
    hue=h=90:s=1
    +
    + +
  • Same command but expressing the hue in radians: +
    +
    hue=H=PI/2:s=1
    +
    + +
  • Rotate hue and make the saturation swing between 0 +and 2 over a period of 1 second: +
    +
    hue="H=2*PI*t: s=sin(2*PI*t)+1"
    +
    + +
  • Apply a 3 seconds saturation fade-in effect starting at 0: +
    +
    hue="s=min(t/3\,1)"
    +
    + +

    The general fade-in expression can be written as: +

    +
    hue="s=min(0\, max((t-START)/DURATION\, 1))"
    +
    + +
  • Apply a 3 seconds saturation fade-out effect starting at 5 seconds: +
    +
    hue="s=max(0\, min(1\, (8-t)/3))"
    +
    + +

    The general fade-out expression can be written as: +

    +
    hue="s=max(0\, min(1\, (START+DURATION-t)/DURATION))"
    +
    + +
+ +
+
+

39.128.2 Commands

+ +

This filter supports the following commands: +

+
b
+
s
+
h
+
H
+

Modify the hue and/or the saturation and/or brightness of the input video. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

39.129 huesaturation

+

Apply hue-saturation-intensity adjustments to input video stream. +

+

This filter operates in RGB colorspace. +

+

This filter accepts the following options: +

+
+
hue
+

Set the hue shift in degrees to apply. Default is 0. +Allowed range is from -180 to 180. +

+
+
saturation
+

Set the saturation shift. Default is 0. +Allowed range is from -1 to 1. +

+
+
intensity
+

Set the intensity shift. Default is 0. +Allowed range is from -1 to 1. +

+
+
colors
+

Set which primary and complementary colors are going to be adjusted. +This options is set by providing one or multiple values. +This can select multiple colors at once. By default all colors are selected. +

+
r
+

Adjust reds. +

+
y
+

Adjust yellows. +

+
g
+

Adjust greens. +

+
c
+

Adjust cyans. +

+
b
+

Adjust blues. +

+
m
+

Adjust magentas. +

+
a
+

Adjust all colors. +

+
+ +
+
strength
+

Set strength of filtering. Allowed range is from 0 to 100. +Default value is 1. +

+
+
rw, gw, bw
+

Set weight for each RGB component. Allowed range is from 0 to 1. +By default is set to 0.333, 0.334, 0.333. +Those options are used in saturation and lightess processing. +

+
+
lightness
+

Set preserving lightness, by default is disabled. +Adjusting hues can change lightness from original RGB triplet, +with this option enabled lightness is kept at same value. +

+
+ +
+
+

39.130 hysteresis

+ +

Grow first stream into second stream by connecting components. +This makes it possible to build more robust edge masks. +

+

This filter accepts the following options: +

+
+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+
threshold
+

Set threshold which is used in filtering. If pixel component value is higher than +this value filter algorithm for connecting components is activated. +By default value is 0. +

+
+ +

The hysteresis filter also supports the framesync options. +

+
+
+

39.131 iccdetect

+ +

Detect the colorspace from an embedded ICC profile (if present), and update +the frame’s tags accordingly. +

+

This filter accepts the following options: +

+
+
force
+

If true, the frame’s existing colorspace tags will always be overridden by +values detected from an ICC profile. Otherwise, they will only be assigned if +they contain unknown. Enabled by default. +

+
+ +
+
+

39.132 iccgen

+ +

Generate ICC profiles and attach them to frames. +

+

This filter accepts the following options: +

+
+
color_primaries
+
color_trc
+

Configure the colorspace that the ICC profile will be generated for. The +default value of auto infers the value from the input frame’s metadata, +defaulting to BT.709/sRGB as appropriate. +

+

See the setparams filter for a list of possible values, but note that +unknown are not valid values for this filter. +

+
+
force
+

If true, an ICC profile will be generated even if it would overwrite an +already existing ICC profile. Disabled by default. +

+
+ +
+
+

39.133 identity

+ +

Obtain the identity score between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained per component, average, min and max identity score is printed through +the logging system. +

+

The filter stores the calculated identity scores of each frame in frame metadata. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi identity -f null -
+
+ +
+
+

39.134 idet

+ +

Detect video interlacing type. +

+

This filter tries to detect if the input frames are interlaced, progressive, +top or bottom field first. It will also try to detect fields that are +repeated between adjacent frames (a sign of telecine). +

+

Single frame detection considers only immediately adjacent frames when classifying each frame. +Multiple frame detection incorporates the classification history of previous frames. +

+

The filter will log these metadata values: +

+
+
single.current_frame
+

Detected type of current frame using single-frame detection. One of: +“tff” (top field first), “bff” (bottom field first), +“progressive”, or “undetermined” +

+
+
single.tff
+

Cumulative number of frames detected as top field first using single-frame detection. +

+
+
multiple.tff
+

Cumulative number of frames detected as top field first using multiple-frame detection. +

+
+
single.bff
+

Cumulative number of frames detected as bottom field first using single-frame detection. +

+
+
multiple.current_frame
+

Detected type of current frame using multiple-frame detection. One of: +“tff” (top field first), “bff” (bottom field first), +“progressive”, or “undetermined” +

+
+
multiple.bff
+

Cumulative number of frames detected as bottom field first using multiple-frame detection. +

+
+
single.progressive
+

Cumulative number of frames detected as progressive using single-frame detection. +

+
+
multiple.progressive
+

Cumulative number of frames detected as progressive using multiple-frame detection. +

+
+
single.undetermined
+

Cumulative number of frames that could not be classified using single-frame detection. +

+
+
multiple.undetermined
+

Cumulative number of frames that could not be classified using multiple-frame detection. +

+
+
repeated.current_frame
+

Which field in the current frame is repeated from the last. One of “neither”, “top”, or “bottom”. +

+
+
repeated.neither
+

Cumulative number of frames with no repeated field. +

+
+
repeated.top
+

Cumulative number of frames with the top field repeated from the previous frame’s top field. +

+
+
repeated.bottom
+

Cumulative number of frames with the bottom field repeated from the previous frame’s bottom field. +

+
+ +

The filter accepts the following options: +

+
+
intl_thres
+

Set interlacing threshold. +

+
prog_thres
+

Set progressive threshold. +

+
rep_thres
+

Threshold for repeated field detection. +

+
half_life
+

Number of frames after which a given frame’s contribution to the +statistics is halved (i.e., it contributes only 0.5 to its +classification). The default of 0 means that all frames seen are given +full weight of 1.0 forever. +

+
analyze_interlaced_flag
+

When this is not 0 then idet will use the specified number of frames to determine +if the interlaced flag is accurate, it will not count undetermined frames. +If the flag is found to be accurate it will be used without any further +computations, if it is found to be inaccurate it will be cleared without any +further computations. This allows inserting the idet filter as a low computational +method to clean up the interlaced flag +

+
+ +
+
+

39.135 il

+ +

Deinterleave or interleave fields. +

+

This filter allows one to process interlaced images fields without +deinterlacing them. Deinterleaving splits the input frame into 2 +fields (so called half pictures). Odd lines are moved to the top +half of the output image, even lines to the bottom half. +You can process (filter) them independently and then re-interleave them. +

+

The filter accepts the following options: +

+
+
luma_mode, l
+
chroma_mode, c
+
alpha_mode, a
+

Available values for luma_mode, chroma_mode and +alpha_mode are: +

+
+
none
+

Do nothing. +

+
+
deinterleave, d
+

Deinterleave fields, placing one above the other. +

+
+
interleave, i
+

Interleave fields. Reverse the effect of deinterleaving. +

+
+

Default value is none. +

+
+
luma_swap, ls
+
chroma_swap, cs
+
alpha_swap, as
+

Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is 0. +

+
+ + +
+

39.135.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.136 inflate

+ +

Apply inflate effect to the video. +

+

This filter replaces the pixel by the local(3x3) average by taking into account +only values higher than the pixel. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+ + +
+

39.136.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.137 interlace

+ +

Simple interlacing filter from progressive contents. This interleaves upper (or +lower) lines from odd frames with lower (or upper) lines from even frames, +halving the frame rate and preserving image height. +

+
+
   Original        Original             New Frame
+   Frame 'j'      Frame 'j+1'             (tff)
+  ==========      ===========       ==================
+    Line 0  -------------------->    Frame 'j' Line 0
+    Line 1          Line 1  ---->   Frame 'j+1' Line 1
+    Line 2 --------------------->    Frame 'j' Line 2
+    Line 3          Line 3  ---->   Frame 'j+1' Line 3
+     ...             ...                   ...
+New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
+
+ +

It accepts the following optional parameters: +

+
+
scan
+

This determines whether the interlaced frame is taken from the even +(tff - default) or odd (bff) lines of the progressive frame. +

+
+
lowpass
+

Vertical lowpass filter to avoid twitter interlacing and +reduce moire patterns. +

+
+
0, off
+

Disable vertical lowpass filter +

+
+
1, linear
+

Enable linear filter (default) +

+
+
2, complex
+

Enable complex filter. This will slightly less reduce twitter and moire +but better retain detail and subjective sharpness impression. +

+
+
+
+
+ +
+
+

39.138 kerndeint

+ +

Deinterlace input video by applying Donald Graft’s adaptive kernel +deinterling. Work on interlaced parts of a video to produce +progressive frames. +

+

The description of the accepted parameters follows. +

+
+
thresh
+

Set the threshold which affects the filter’s tolerance when +determining if a pixel line must be processed. It must be an integer +in the range [0,255] and defaults to 10. A value of 0 will result in +applying the process on every pixels. +

+
+
map
+

Paint pixels exceeding the threshold value to white if set to 1. +Default is 0. +

+
+
order
+

Set the fields order. Swap fields if set to 1, leave fields alone if +0. Default is 0. +

+
+
sharp
+

Enable additional sharpening if set to 1. Default is 0. +

+
+
twoway
+

Enable twoway sharpening if set to 1. Default is 0. +

+
+ + +
+

39.138.1 Examples

+ +
    +
  • Apply default values: +
    +
    kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
    +
    + +
  • Enable additional sharpening: +
    +
    kerndeint=sharp=1
    +
    + +
  • Paint processed pixels in white: +
    +
    kerndeint=map=1
    +
    +
+ +
+
+
+

39.139 kirsch

+

Apply kirsch operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

39.139.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.140 lagfun

+ +

Slowly update darker pixels. +

+

This filter makes short flashes of light appear longer. +This filter accepts the following options: +

+
+
decay
+

Set factor for decaying. Default is .95. Allowed range is from 0 to 1. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+ + +
+

39.140.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.141 lenscorrection

+ +

Correct radial lens distortion +

+

This filter can be used to correct for radial distortion as can result from the use +of wide angle lenses, and thereby re-rectify the image. To find the right parameters +one can use tools available for example as part of opencv or simply trial-and-error. +To use opencv use the calibration sample (under samples/cpp) from the opencv sources +and extract the k1 and k2 coefficients from the resulting matrix. +

+

Note that effectively the same filter is available in the open-source tools Krita and +Digikam from the KDE project. +

+

In contrast to the vignette filter, which can also be used to compensate lens errors, +this filter corrects the distortion of the image, whereas vignette corrects the +brightness distribution, so you may want to use both filters together in certain +cases, though you will have to take care of ordering, i.e. whether vignetting should +be applied before or after lens correction. +

+ +
+

39.141.1 Options

+ +

The filter accepts the following options: +

+
+
cx
+

Relative x-coordinate of the focal point of the image, and thereby the center of the +distortion. This value has a range [0,1] and is expressed as fractions of the image +width. Default is 0.5. +

+
cy
+

Relative y-coordinate of the focal point of the image, and thereby the center of the +distortion. This value has a range [0,1] and is expressed as fractions of the image +height. Default is 0.5. +

+
k1
+

Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means +no correction. Default is 0. +

+
k2
+

Coefficient of the double quadratic correction term. This value has a range [-1,1]. +0 means no correction. Default is 0. +

+
i
+

Set interpolation type. Can be nearest or bilinear. +Default is nearest. +

+
fc
+

Specify the color of the unmapped pixels. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Default color is black@0. +

+
+ +

The formula that generates the correction is: +

+

r_src = r_tgt * (1 + k1 * (r_tgt / r_0)^2 + k2 * (r_tgt / r_0)^4) +

+

where r_0 is halve of the image diagonal and r_src and r_tgt are the +distances from the focal point in the source and target images, respectively. +

+
+
+

39.141.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.142 lensfun

+ +

Apply lens correction via the lensfun library (http://lensfun.sourceforge.net/). +

+

The lensfun filter requires the camera make, camera model, and lens model +to apply the lens correction. The filter will load the lensfun database and +query it to find the corresponding camera and lens entries in the database. As +long as these entries can be found with the given options, the filter can +perform corrections on frames. Note that incomplete strings will result in the +filter choosing the best match with the given options, and the filter will +output the chosen camera and lens models (logged with level "info"). You must +provide the make, camera model, and lens model as they are required. +

+

To obtain a list of available makes and models, leave out one or both of make and +model options. The filter will send the full list to the log with level INFO. +The first column is the make and the second column is the model. +To obtain a list of available lenses, set any values for make and model and leave out the +lens_model option. The filter will send the full list of lenses in the log with level +INFO. The ffmpeg tool will exit after the list is printed. +

+

The filter accepts the following options: +

+
+
make
+

The make of the camera (for example, "Canon"). This option is required. +

+
+
model
+

The model of the camera (for example, "Canon EOS 100D"). This option is +required. +

+
+
lens_model
+

The model of the lens (for example, "Canon EF-S 18-55mm f/3.5-5.6 IS STM"). This +option is required. +

+
+
db_path
+

The full path to the lens database folder. If not set, the filter will attempt to +load the database from the install path when the library was built. Default is unset. +

+
+
mode
+

The type of correction to apply. The following values are valid options: +

+
+
vignetting
+

Enables fixing lens vignetting. +

+
+
geometry
+

Enables fixing lens geometry. This is the default. +

+
+
subpixel
+

Enables fixing chromatic aberrations. +

+
+
vig_geo
+

Enables fixing lens vignetting and lens geometry. +

+
+
vig_subpixel
+

Enables fixing lens vignetting and chromatic aberrations. +

+
+
distortion
+

Enables fixing both lens geometry and chromatic aberrations. +

+
+
all
+

Enables all possible corrections. +

+
+
+
+
focal_length
+

The focal length of the image/video (zoom; expected constant for video). For +example, a 18–55mm lens has focal length range of [18–55], so a value in that +range should be chosen when using that lens. Default 18. +

+
+
aperture
+

The aperture of the image/video (expected constant for video). Note that +aperture is only used for vignetting correction. Default 3.5. +

+
+
focus_distance
+

The focus distance of the image/video (expected constant for video). Note that +focus distance is only used for vignetting and only slightly affects the +vignetting correction process. If unknown, leave it at the default value (which +is 1000). +

+
+
scale
+

The scale factor which is applied after transformation. After correction the +video is no longer necessarily rectangular. This parameter controls how much of +the resulting image is visible. The value 0 means that a value will be chosen +automatically such that there is little or no unmapped area in the output +image. 1.0 means that no additional scaling is done. Lower values may result +in more of the corrected image being visible, while higher values may avoid +unmapped areas in the output. +

+
+
target_geometry
+

The target geometry of the output image/video. The following values are valid +options: +

+
+
rectilinear (default)
+
fisheye
+
panoramic
+
equirectangular
+
fisheye_orthographic
+
fisheye_stereographic
+
fisheye_equisolid
+
fisheye_thoby
+
+
+
reverse
+

Apply the reverse of image correction (instead of correcting distortion, apply +it). +

+
+
interpolation
+

The type of interpolation used when correcting distortion. The following values +are valid options: +

+
+
nearest
+
linear (default)
+
lanczos
+
+
+
+ + +
+

39.142.1 Examples

+ +
    +
  • Apply lens correction with make "Canon", camera model "Canon EOS 100D", and lens +model "Canon EF-S 18-55mm f/3.5-5.6 IS STM" with focal length of "18" and +aperture of "8.0". + +
    +
    ffmpeg -i input.mov -vf lensfun=make=Canon:model="Canon EOS 100D":lens_model="Canon EF-S 18-55mm f/3.5-5.6 IS STM":focal_length=18:aperture=8 -c:v h264 -b:v 8000k output.mov
    +
    + +
  • Apply the same as before, but only for the first 5 seconds of video. + +
    +
    ffmpeg -i input.mov -vf lensfun=make=Canon:model="Canon EOS 100D":lens_model="Canon EF-S 18-55mm f/3.5-5.6 IS STM":focal_length=18:aperture=8:enable='lte(t\,5)' -c:v h264 -b:v 8000k output.mov
    +
    + +
+ +
+
+
+

39.143 libplacebo

+ +

Flexible GPU-accelerated processing filter based on libplacebo +(https://code.videolan.org/videolan/libplacebo). +

+ +
+

39.143.1 Options

+ +

The options for this filter are divided into the following sections: +

+ +
+

39.143.1.1 Output mode

+

These options control the overall output mode. By default, libplacebo will try +to preserve the source colorimetry and size as best as it can, but it will +apply any embedded film grain, dolby vision metadata or anamorphic SAR present +in source frames. +

+
w
+
h
+

Set the output video dimension expression. Default values are iw and +ih. +

+

Allows for the same expressions as the scale filter. +

+
+
crop_x
+
crop_y
+

Set the input crop x/y expressions, default values are (iw-cw)/2 and +(ih-ch)/2. +

+
+
crop_w
+
crop_h
+

Set the input crop width/height expressions, default values are iw and +ih. +

+
+
pos_x
+
pos_y
+

Set the output placement x/y expressions, default values are (ow-pw)/2 +and (oh-ph)/2. +

+
+
pos_w
+
pos_h
+

Set the output placement width/height expressions, default values are ow +and oh. +

+
+
fps
+

Set the output frame rate. This can be rational, e.g. 60000/1001. If +set to the special string none (the default), input timestamps will +instead be passed through to the output unmodified. Otherwise, the input video +frames will be interpolated as necessary to rescale the video to the specified +target framerate, in a manner as determined by the frame_mixer option. +

+
+
format
+

Set the output format override. If unset (the default), frames will be output +in the same format as the respective input frames. Otherwise, format conversion +will be performed. +

+
+
force_original_aspect_ratio
+
force_divisible_by
+

Work the same as the identical scale filter options. +

+
+
normalize_sar
+

If enabled, output frames will always have a pixel aspect ratio of 1:1. This +will introduce additional padding/cropping as necessary. If disabled (the +default), any aspect ratio mismatches, including those from e.g. anamorphic +video sources, are forwarded to the output pixel aspect ratio. +

+
+
pad_crop_ratio
+

Specifies a ratio (between 0.0 and 1.0) between padding and +cropping when the input aspect ratio does not match the output aspect ratio and +normalize_sar is in effect. The default of 0.0 always pads the +content with black borders, while a value of 1.0 always crops off parts +of the content. Intermediate values are possible, leading to a mix of the two +approaches. +

+
+
fillcolor
+

Set the color used to fill the output area not covered by the output image, for +example as a result of normalize_sar. For the general syntax of this +option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Defaults to black. +

+
+
colorspace
+
color_primaries
+
color_trc
+
range
+

Configure the colorspace that output frames will be delivered in. The default +value of auto outputs frames in the same format as the input frames, +leading to no change. For any other value, conversion will be performed. +

+

See the setparams filter for a list of possible values. +

+
+
apply_filmgrain
+

Apply film grain (e.g. AV1 or H.274) if present in source frames, and strip +it from the output. Enabled by default. +

+
+
apply_dolbyvision
+

Apply Dolby Vision RPU metadata if present in source frames, and strip it from +the output. Enabled by default. Note that Dolby Vision will always output +BT.2020+PQ, overriding the usual input frame metadata. These will also be +picked as the values of auto for the respective frame output options. +

+
+ +

In addition to the expression constants documented for the scale filter, +the crop_w, crop_h, crop_x, crop_y, +pos_w, pos_h, pos_x and pos_y options can +also contain the following constants: +

+
+
crop_w, cw
+
crop_h, ch
+

The computed values of crop_w and crop_h. +

+
+
pos_w, pw
+
pos_h, ph
+

The computed values of pos_w and pos_h. +

+
+
in_t, t
+

The input frame timestamp, in seconds. NAN if input timestamp is unknown. +

+
+
out_t, ot
+

The input frame timestamp, in seconds. NAN if input timestamp is unknown. +

+
+
n
+

The input frame number, starting with 0. +

+
+ +
+
+

39.143.1.2 Scaling

+

The options in this section control how libplacebo performs upscaling and (if +necessary) downscaling. Note that libplacebo will always internally operate on +4:4:4 content, so any sub-sampled chroma formats such as yuv420p will +necessarily be upsampled and downsampled as part of the rendering process. That +means scaling might be in effect even if the source and destination resolution +are the same. +

+
upscaler
+
downscaler
+

Configure the filter kernel used for upscaling and downscaling. The respective +defaults are spline36 and mitchell. For a full list of possible +values, pass help to these options. The most important values are: +

+
none
+

Forces the use of built-in GPU texture sampling (typically bilinear). Extremely +fast but poor quality, especially when downscaling. +

+
+
bilinear
+

Bilinear interpolation. Can generally be done for free on GPUs, except when +doing so would lead to aliasing. Fast and low quality. +

+
+
nearest
+

Nearest-neighbour interpolation. Sharp but highly aliasing. +

+
+
oversample
+

Algorithm that looks visually similar to nearest-neighbour interpolation but +tries to preserve pixel aspect ratio. Good for pixel art, since it results in +minimal distortion of the artistic appearance. +

+
+
lanczos
+

Standard sinc-sinc interpolation kernel. +

+
+
spline36
+

Cubic spline approximation of lanczos. No difference in performance, but has +very slightly less ringing. +

+
+
ewa_lanczos
+

Elliptically weighted average version of lanczos, based on a jinc-sinc kernel. +This is also popularly referred to as just "Jinc scaling". Slow but very high +quality. +

+
+
gaussian
+

Gaussian kernel. Has certain ideal mathematical properties, but subjectively +very blurry. +

+
+
mitchell
+

Cubic BC spline with parameters recommended by Mitchell and Netravali. Very +little ringing. +

+
+ +
+
frame_mixer
+

Controls the kernel used for mixing frames temporally. The default value is +none, which disables frame mixing. For a full list of possible values, +pass help to this option. The most important values are: +

+
none
+

Disables frame mixing, giving a result equivalent to "nearest neighbour" +semantics. +

+
+
oversample
+

Oversamples the input video to create a "Smooth Motion"-type effect: if an +output frame would exactly fall on the transition between two video frames, it +is blended according to the relative overlap. This is the recommended option +whenever preserving the original subjective appearance is desired. +

+
+
mitchell_clamp
+

Larger filter kernel that smoothly interpolates multiple frames in a manner +designed to eliminate ringing and other artefacts as much as possible. This is +the recommended option wherever maximum visual smoothness is desired. +

+
+
linear
+

Linear blend/fade between frames. Especially useful for constructing e.g. +slideshows. +

+
+ +
+
lut_entries
+

Configures the size of scaler LUTs, ranging from 1 to 256. The +default of 0 will pick libplacebo’s internal default, typically +64. +

+
+
antiringing
+

Enables anti-ringing (for non-EWA filters). The value (between 0.0 and +1.0) configures the strength of the anti-ringing algorithm. May increase +aliasing if set too high. Disabled by default. +

+
+
sigmoid
+

Enable sigmoidal compression during upscaling. Reduces ringing slightly. +Enabled by default. +

+
+ +
+
+

39.143.1.3 Debanding

+

Libplacebo comes with a built-in debanding filter that is good at counteracting +many common sources of banding and blocking. Turning this on is highly +recommended whenever quality is desired. +

+
deband
+

Enable (fast) debanding algorithm. Disabled by default. +

+
+
deband_iterations
+

Number of deband iterations of the debanding algorithm. Each iteration is +performed with progressively increased radius (and diminished threshold). +Recommended values are in the range 1 to 4. Defaults to 1. +

+
+
deband_threshold
+

Debanding filter strength. Higher numbers lead to more aggressive debanding. +Defaults to 4.0. +

+
+
deband_radius
+

Debanding filter radius. A higher radius is better for slow gradients, while +a lower radius is better for steep gradients. Defaults to 16.0. +

+
+
deband_grain
+

Amount of extra output grain to add. Helps hide imperfections. Defaults to +6.0. +

+
+ +
+
+

39.143.1.4 Color adjustment

+

A collection of subjective color controls. Not very rigorous, so the exact +effect will vary somewhat depending on the input primaries and colorspace. +

+
brightness
+

Brightness boost, between -1.0 and 1.0. Defaults to 0.0. +

+
+
contrast
+

Contrast gain, between 0.0 and 16.0. Defaults to 1.0. +

+
+
saturation
+

Saturation gain, between 0.0 and 16.0. Defaults to 1.0. +

+
+
hue
+

Hue shift in radians, between -3.14 and 3.14. Defaults to +0.0. This will rotate the UV subvector, defaulting to BT.709 +coefficients for RGB inputs. +

+
+
gamma
+

Gamma adjustment, between 0.0 and 16.0. Defaults to 1.0. +

+
+
cones
+

Cone model to use for color blindness simulation. Accepts any combination of +l, m and s. Here are some examples: +

+
m
+

Deuteranomaly / deuteranopia (affecting 3%-4% of the population) +

+
l
+

Protanomaly / protanopia (affecting 1%-2% of the population) +

+
l+m
+

Monochromacy (very rare) +

+
l+m+s
+

Achromatopsy (complete loss of daytime vision, extremely rare) +

+
+ +
+
cone-strength
+

Gain factor for the cones specified by cones, between 0.0 and +10.0. A value of 1.0 results in no change to color vision. A +value of 0.0 (the default) simulates complete loss of those cones. Values +above 1.0 result in exaggerating the differences between cones, which +may help compensate for reduced color vision. +

+
+ +
+
+

39.143.1.5 Peak detection

+

To help deal with sources that only have static HDR10 metadata (or no tagging +whatsoever), libplacebo uses its own internal frame analysis compute shader to +analyze source frames and adapt the tone mapping function in realtime. If this +is too slow, or if exactly reproducible frame-perfect results are needed, it’s +recommended to turn this feature off. +

+
peak_detect
+

Enable HDR peak detection. Ignores static MaxCLL/MaxFALL values in favor of +dynamic detection from the input. Note that the detected values do not get +written back to the output frames, they merely guide the internal tone mapping +process. Enabled by default. +

+
+
smoothing_period
+

Peak detection smoothing period, between 0.0 and 1000.0. Higher +values result in peak detection becoming less responsive to changes in the +input. Defaults to 100.0. +

+
+
minimum_peak
+

Lower bound on the detected peak (relative to SDR white), between 0.0 +and 100.0. Defaults to 1.0. +

+
+
scene_threshold_low
+
scene_threshold_high
+

Lower and upper thresholds for scene change detection. Expressed in a +logarithmic scale between 0.0 and 100.0. Default to 5.5 +and 10.0, respectively. Setting either to a negative value disables +this functionality. +

+
+
percentile
+

Which percentile of the frame brightness histogram to use as the source peak +for tone-mapping. Defaults to 99.995, a fairly conservative value. +Setting this to 100.0 disables frame histogram measurement and instead +uses the true peak brightness for tone-mapping. +

+
+ +
+
+

39.143.1.6 Tone mapping

+

The options in this section control how libplacebo performs tone-mapping and +gamut-mapping when dealing with mismatches between wide-gamut or HDR content. +In general, libplacebo relies on accurate source tagging and mastering display +gamut information to produce the best results. +

+
gamut_mode
+

How to handle out-of-gamut colors that can occur as a result of colorimetric +gamut mapping. +

+
clip
+

Do nothing, simply clip out-of-range colors to the RGB volume. Low quality but +extremely fast. +

+
perceptual
+

Perceptually soft-clip colors to the gamut volume. This is the default. +

+
relative
+

Relative colorimetric hard-clip. Similar to perceptual but without +the soft knee. +

+
saturation
+

Saturation mapping, maps primaries directly to primaries in RGB space. +Not recommended except for artificial computer graphics for which a bright, +saturated display is desired. +

+
absolute
+

Absolute colorimetric hard-clip. Performs no adjustment of the white point. +

+
desaturate
+

Hard-desaturates out-of-gamut colors towards white, while preserving the +luminance. Has a tendency to distort the visual appearance of bright objects. +

+
darken
+

Linearly reduces content brightness to preserves saturated details, followed by +clipping the remaining out-of-gamut colors. +

+
warn
+

Highlight out-of-gamut pixels (by inverting/marking them). +

+
linear
+

Linearly reduces chromaticity of the entire image to make it fit within the +target color volume. Be careful when using this on BT.2020 sources without +proper mastering metadata, as doing so will lead to excessive desaturation. +

+
+ +
+
tonemapping
+

Tone-mapping algorithm to use. Available values are: +

+
auto
+

Automatic selection based on internal heuristics. This is the default. +

+
clip
+

Performs no tone-mapping, just clips out-of-range colors. Retains perfect color +accuracy for in-range colors but completely destroys out-of-range information. +Does not perform any black point adaptation. Not configurable. +

+
st2094-40
+

EETF from SMPTE ST 2094-40 Annex B, which applies the Bezier curves from HDR10+ +dynamic metadata based on Bezier curves to perform tone-mapping. The OOTF used +is adjusted based on the ratio between the targeted and actual display peak +luminances. +

+
st2094-10
+

EETF from SMPTE ST 2094-10 Annex B.2, which takes into account the input signal +average luminance in addition to the maximum/minimum. The configurable contrast +parameter influences the slope of the linear output segment, defaulting to +1.0 for no increase/decrease in contrast. Note that this does not +currently include the subjective gain/offset/gamma controls defined in Annex +B.3. +

+
bt.2390
+

EETF from the ITU-R Report BT.2390, a hermite spline roll-off with linear +segment. The knee point offset is configurable. Note that this parameter +defaults to 1.0, rather than the value of 0.5 from the ITU-R +spec. +

+
bt.2446a
+

EETF from ITU-R Report BT.2446, method A. Designed for well-mastered HDR +sources. Can be used for both forward and inverse tone mapping. Not +configurable. +

+
spline
+

Simple spline consisting of two polynomials, joined by a single pivot point. +The parameter gives the pivot point (in PQ space), defaulting to 0.30. +Can be used for both forward and inverse tone mapping. +

+
reinhard
+

Simple non-linear, global tone mapping algorithm. The parameter specifies the +local contrast coefficient at the display peak. Essentially, a parameter of +0.5 implies that the reference white will be about half as bright as +when clipping. Defaults to 0.5, which results in the simplest +formulation of this function. +

+
mobius
+

Generalization of the reinhard tone mapping algorithm to support an additional +linear slope near black. The tone mapping parameter indicates the trade-off +between the linear section and the non-linear section. Essentially, for a given +parameter x, every color value below x will be mapped linearly, +while higher values get non-linearly tone-mapped. Values near 1.0 make +this curve behave like clip, while values near 0.0 make this +curve behave like reinhard. The default value is 0.3, which +provides a good balance between colorimetric accuracy and preserving +out-of-gamut details. +

+
hable
+

Piece-wise, filmic tone-mapping algorithm developed by John Hable for use in +Uncharted 2, inspired by a similar tone-mapping algorithm used by Kodak. +Popularized by its use in video games with HDR rendering. Preserves both dark +and bright details very well, but comes with the drawback of changing the +average brightness quite significantly. This is sort of similar to +reinhard with parameter 0.24. +

+
gamma
+

Fits a gamma (power) function to transfer between the source and target color +spaces, effectively resulting in a perceptual hard-knee joining two roughly +linear sections. This preserves details at all scales fairly accurately, but +can result in an image with a muted or dull appearance. The parameter is used +as the cutoff point, defaulting to 0.5. +

+
linear
+

Linearly stretches the input range to the output range, in PQ space. This will +preserve all details accurately, but results in a significantly different +average brightness. Can be used for inverse tone-mapping in addition to regular +tone-mapping. The parameter can be used as an additional linear gain +coefficient (defaulting to 1.0). +

+
+ +
+
tonemapping_param
+

For tunable tone mapping functions, this parameter can be used to fine-tune the +curve behavior. Refer to the documentation of tonemapping. The default +value of 0.0 is replaced by the curve’s preferred default setting. +

+
+
inverse_tonemapping
+

If enabled, this filter will also attempt stretching SDR signals to fill HDR +output color volumes. Disabled by default. +

+
+
tonemapping_lut_size
+

Size of the tone-mapping LUT, between 2 and 1024. Defaults to +256. Note that this figure is squared when combined with +peak_detect. +

+
+
hybrid_mix
+

If nonzero, this much of the upper range of the tone-mapped result is smoothly +mixed with a per-channel (LMS) tone-mapped version. Helps avoid unnatural +blown-out highlights when tone-mapping very bright, strongly saturated colors. +Defaults to 0.2. +

+
+ +
+
+

39.143.1.7 Dithering

+

By default, libplacebo will dither whenever necessary, which includes rendering +to any integer format below 16-bit precision. It’s recommended to always leave +this on, since not doing so may result in visible banding in the output, even +if the debanding filter is enabled. If maximum performance is needed, +use ordered_fixed instead of disabling dithering. +

+
dithering
+

Dithering method to use. Accepts the following values: +

+
none
+

Disables dithering completely. May result in visible banding. +

+
blue
+

Dither with pseudo-blue noise. This is the default. +

+
ordered
+

Tunable ordered dither pattern. +

+
ordered_fixed
+

Faster ordered dither with a fixed size of 6. Texture-less. +

+
white
+

Dither with white noise. Texture-less. +

+
+ +
+
dither_lut_size
+

Dither LUT size, as log base2 between 1 and 8. Defaults to +6, corresponding to a LUT size of 64x64. +

+
+
dither_temporal
+

Enables temporal dithering. Disabled by default. +

+
+ +
+
+

39.143.1.8 Custom shaders

+

libplacebo supports a number of custom shaders based on the mpv .hook GLSL +syntax. A collection of such shaders can be found here: +https://github.com/mpv-player/mpv/wiki/User-Scripts#user-shaders +

+

A full description of the mpv shader format is beyond the scope of this +section, but a summary can be found here: +https://mpv.io/manual/master/#options-glsl-shader +

+
custom_shader_path
+

Specifies a path to a custom shader file to load at runtime. +

+
+
custom_shader_bin
+

Specifies a complete custom shader as a raw string. +

+
+ +
+
+

39.143.1.9 Debugging / performance

+

All of the options in this section default off. They may be of assistance when +attempting to squeeze the maximum performance at the cost of quality. +

+
skip_aa
+

Disable anti-aliasing when downscaling. +

+
+
polar_cutoff
+

Truncate polar (EWA) scaler kernels below this absolute magnitude, between +0.0 and 1.0. +

+
+
disable_linear
+

Disable linear light scaling. +

+
+
disable_builtin
+

Disable built-in GPU sampling (forces LUT). +

+
+
disable_fbos
+

Forcibly disable FBOs, resulting in loss of almost all functionality, but +offering the maximum possible speed. +

+
+ +
+
+
+

39.143.2 Commands

+

This filter supports almost all of the above options as commands. +

+
+
+

39.143.3 Examples

+
    +
  • Tone-map input to standard gamut BT.709 output: +
    +
    libplacebo=colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv
    +
    + +
  • Rescale input to fit into standard 1080p, with high quality scaling: +
    +
    libplacebo=w=1920:h=1080:force_original_aspect_ratio=decrease:normalize_sar=true:upscaler=ewa_lanczos:downscaler=ewa_lanczos
    +
    + +
  • Interpolate low FPS / VFR input to smoothed constant 60 fps output: +
    +
    libplacebo=fps=60:frame_mixer=mitchell_clamp
    +
    + +
  • Convert input to standard sRGB JPEG: +
    +
    libplacebo=format=yuv420p:colorspace=bt470bg:color_primaries=bt709:color_trc=iec61966-2-1:range=pc
    +
    + +
  • Use higher quality debanding settings: +
    +
    libplacebo=deband=true:deband_iterations=3:deband_radius=8:deband_threshold=6
    +
    + +
  • Run this filter on the CPU, on systems with Mesa installed (and with the most +expensive options disabled): +
    +
    ffmpeg ... -init_hw_device vulkan:llvmpipe ... -vf libplacebo=upscaler=none:downscaler=none:peak_detect=false
    +
    + +
  • Suppress CPU-based AV1/H.274 film grain application in the decoder, in favor of +doing it with this filter. Note that this is only a gain if the frames are +either already on the GPU, or if you’re using libplacebo for other purposes, +since otherwise the VRAM roundtrip will more than offset any expected speedup. +
    +
    ffmpeg -export_side_data +film_grain ... -vf libplacebo=apply_filmgrain=true
    +
    + +
  • Interop with VAAPI hwdec to avoid round-tripping through RAM: +
    +
    ffmpeg -init_hw_device vulkan -hwaccel vaapi -hwaccel_output_format vaapi ... -vf libplacebo
    +
    +
+ +
+
+
+

39.144 libvmaf

+ +

Calulate the VMAF (Video Multi-Method Assessment Fusion) score for a +reference/distorted pair of input videos. +

+

The first input is the distorted video, and the second input is the reference video. +

+

The obtained VMAF score is printed through the logging system. +

+

It requires Netflix’s vmaf library (libvmaf) as a pre-requisite. +After installing the library it can be enabled using: +./configure --enable-libvmaf. +

+

The filter has following options: +

+
+
model
+

A ‘|‘ delimited list of vmaf models. Each model can be configured with a number of parameters. +Default value: "version=vmaf_v0.6.1" +

+
+
model_path
+

Deprecated, use model=’path=...’. +

+
+
enable_transform
+

Deprecated, use model=’enable_transform=true’. +

+
+
phone_model
+

Deprecated, use model=’enable_transform=true’. +

+
+
enable_conf_interval
+

Deprecated, use model=’enable_conf_interval=true’. +

+
+
feature
+

A ‘|‘ delimited list of features. Each feature can be configured with a number of parameters. +

+
+
psnr
+

Deprecated, use feature=’name=psnr’. +

+
+
ssim
+

Deprecated, use feature=’name=ssim’. +

+
+
ms_ssim
+

Deprecated, use feature=’name=ms_ssim’. +

+
+
log_path
+

Set the file path to be used to store log files. +

+
+
log_fmt
+

Set the format of the log file (xml, json, csv, or sub). +

+
+
n_threads
+

Set number of threads to be used when initializing libvmaf. +Default value: 0, no threads. +

+
+
n_subsample
+

Set frame subsampling interval to be used. +

+
+ +

This filter also supports the framesync options. +

+ +
+

39.144.1 Examples

+
    +
  • In the examples below, a distorted video distorted.mpg is +compared with a reference file reference.mpg. + +
  • Basic usage: +
    +
    ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf=log_path=output.xml -f null -
    +
    + +
  • Example with multiple models: +
    +
    ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='model=version=vmaf_v0.6.1\\:name=vmaf|version=vmaf_v0.6.1neg\\:name=vmaf_neg' -f null -
    +
    + +
  • Example with multiple addtional features: +
    +
    ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='feature=name=psnr|name=ciede' -f null -
    +
    + +
  • Example with options and different containers: +
    +
    ffmpeg -i distorted.mpg -i reference.mkv -lavfi "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]libvmaf=log_fmt=json:log_path=output.json" -f null -
    +
    +
+ +
+
+
+

39.145 limitdiff

+

Apply limited difference filter using second and optionally third video stream. +

+

The filter accepts the following options: +

+
+
threshold
+

Set the threshold to use when allowing certain differences between video streams. +Any absolute difference value lower or exact than this threshold will pick pixel components from +first video stream. +

+
+
elasticity
+

Set the elasticity of soft thresholding when processing video streams. +This value multiplied with first one sets second threshold. +Any absolute difference value greater or exact than second threshold will pick pixel components +from second video stream. For values between those two threshold +linear interpolation between first and second video stream will be used. +

+
+
reference
+

Enable the reference (third) video stream processing. By default is disabled. +If set, this video stream will be used for calculating absolute difference with first video +stream. +

+
+
planes
+

Specify which planes will be processed. Defaults to all available. +

+
+ + +
+

39.145.1 Commands

+ +

This filter supports the all above options as commands except option ‘reference’. +

+
+
+
+

39.146 limiter

+ +

Limits the pixel components values to the specified range [min, max]. +

+

The filter accepts the following options: +

+
+
min
+

Lower bound. Defaults to the lowest allowed value for the input. +

+
+
max
+

Upper bound. Defaults to the highest allowed value for the input. +

+
+
planes
+

Specify which planes will be processed. Defaults to all available. +

+
+ + +
+

39.146.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.147 loop

+ +

Loop video frames. +

+

The filter accepts the following options: +

+
+
loop
+

Set the number of loops. Setting this value to -1 will result in infinite loops. +Default is 0. +

+
+
size
+

Set maximal size in number of frames. Default is 0. +

+
+
start
+

Set first frame of loop. Default is 0. +

+
+
time
+

Set the time of loop start in seconds. +Only used if option named start is set to -1. +

+
+ + +
+

39.147.1 Examples

+ +
    +
  • Loop single first frame infinitely: +
    +
    loop=loop=-1:size=1:start=0
    +
    + +
  • Loop single first frame 10 times: +
    +
    loop=loop=10:size=1:start=0
    +
    + +
  • Loop 10 first frames 5 times: +
    +
    loop=loop=5:size=10:start=0
    +
    +
+ +
+
+
+

39.148 lut1d

+ +

Apply a 1D LUT to an input video. +

+

The filter accepts the following options: +

+
+
file
+

Set the 1D LUT file name. +

+

Currently supported formats: +

+
cube
+

Iridas +

+
csp
+

cineSpace +

+
+ +
+
interp
+

Select interpolation mode. +

+

Available values are: +

+
+
nearest
+

Use values from the nearest defined point. +

+
linear
+

Interpolate values using the linear interpolation. +

+
cosine
+

Interpolate values using the cosine interpolation. +

+
cubic
+

Interpolate values using the cubic interpolation. +

+
spline
+

Interpolate values using the spline interpolation. +

+
+
+
+ + +
+

39.148.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.149 lut3d

+ +

Apply a 3D LUT to an input video. +

+

The filter accepts the following options: +

+
+
file
+

Set the 3D LUT file name. +

+

Currently supported formats: +

+
3dl
+

AfterEffects +

+
cube
+

Iridas +

+
dat
+

DaVinci +

+
m3d
+

Pandora +

+
csp
+

cineSpace +

+
+
+
interp
+

Select interpolation mode. +

+

Available values are: +

+
+
nearest
+

Use values from the nearest defined point. +

+
trilinear
+

Interpolate values using the 8 points defining a cube. +

+
tetrahedral
+

Interpolate values using a tetrahedron. +

+
pyramid
+

Interpolate values using a pyramid. +

+
prism
+

Interpolate values using a prism. +

+
+
+
+ + +
+

39.149.1 Commands

+ +

This filter supports the interp option as commands. +

+
+
+
+

39.150 lumakey

+ +

Turn certain luma values into transparency. +

+

The filter accepts the following options: +

+
+
threshold
+

Set the luma which will be used as base for transparency. +Default value is 0. +

+
+
tolerance
+

Set the range of luma values to be keyed out. +Default value is 0.01. +

+
+
softness
+

Set the range of softness. Default value is 0. +Use this to control gradual transition from zero to full transparency. +

+
+ + +
+

39.150.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

39.151 lut, lutrgb, lutyuv

+ +

Compute a look-up table for binding each pixel component input value +to an output value, and apply it to the input video. +

+

lutyuv applies a lookup table to a YUV input video, lutrgb +to an RGB input video. +

+

These filters accept the following parameters: +

+
c0
+

set first pixel component expression +

+
c1
+

set second pixel component expression +

+
c2
+

set third pixel component expression +

+
c3
+

set fourth pixel component expression, corresponds to the alpha component +

+
+
r
+

set red component expression +

+
g
+

set green component expression +

+
b
+

set blue component expression +

+
a
+

alpha component expression +

+
+
y
+

set Y/luminance component expression +

+
u
+

set U/Cb component expression +

+
v
+

set V/Cr component expression +

+
+ +

Each of them specifies the expression to use for computing the lookup table for +the corresponding pixel component values. +

+

The exact component associated to each of the c* options depends on the +format in input. +

+

The lut filter requires either YUV or RGB pixel formats in input, +lutrgb requires RGB pixel formats in input, and lutyuv requires YUV. +

+

The expressions can contain the following constants and functions: +

+
+
w
+
h
+

The input width and height. +

+
+
val
+

The input value for the pixel component. +

+
+
clipval
+

The input value, clipped to the minval-maxval range. +

+
+
maxval
+

The maximum value for the pixel component. +

+
+
minval
+

The minimum value for the pixel component. +

+
+
negval
+

The negated value for the pixel component value, clipped to the +minval-maxval range; it corresponds to the expression +"maxval-clipval+minval". +

+
+
clip(val)
+

The computed value in val, clipped to the +minval-maxval range. +

+
+
gammaval(gamma)
+

The computed gamma correction value of the pixel component value, +clipped to the minval-maxval range. It corresponds to the +expression +"pow((clipval-minval)/(maxval-minval)\,gamma)*(maxval-minval)+minval" +

+
+
+ +

All expressions default to "clipval". +

+ +
+

39.151.1 Commands

+ +

This filter supports same commands as options. +

+
+
+

39.151.2 Examples

+ +
    +
  • Negate input video: +
    +
    lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
    +lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
    +
    + +

    The above is the same as: +

    +
    lutrgb="r=negval:g=negval:b=negval"
    +lutyuv="y=negval:u=negval:v=negval"
    +
    + +
  • Negate luminance: +
    +
    lutyuv=y=negval
    +
    + +
  • Remove chroma components, turning the video into a graytone image: +
    +
    lutyuv="u=128:v=128"
    +
    + +
  • Apply a luma burning effect: +
    +
    lutyuv="y=2*val"
    +
    + +
  • Remove green and blue components: +
    +
    lutrgb="g=0:b=0"
    +
    + +
  • Set a constant alpha channel value on input: +
    +
    format=rgba,lutrgb=a="maxval-minval/2"
    +
    + +
  • Correct luminance gamma by a factor of 0.5: +
    +
    lutyuv=y=gammaval(0.5)
    +
    + +
  • Discard least significant bits of luma: +
    +
    lutyuv=y='bitand(val, 128+64+32)'
    +
    + +
  • Technicolor like effect: +
    +
    lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
    +
    +
+ +
+
+
+

39.152 lut2, tlut2

+ +

The lut2 filter takes two input streams and outputs one +stream. +

+

The tlut2 (time lut2) filter takes two consecutive frames +from one single stream. +

+

This filter accepts the following parameters: +

+
c0
+

set first pixel component expression +

+
c1
+

set second pixel component expression +

+
c2
+

set third pixel component expression +

+
c3
+

set fourth pixel component expression, corresponds to the alpha component +

+
+
d
+

set output bit depth, only available for lut2 filter. By default is 0, +which means bit depth is automatically picked from first input format. +

+
+ +

The lut2 filter also supports the framesync options. +

+

Each of them specifies the expression to use for computing the lookup table for +the corresponding pixel component values. +

+

The exact component associated to each of the c* options depends on the +format in inputs. +

+

The expressions can contain the following constants: +

+
+
w
+
h
+

The input width and height. +

+
+
x
+

The first input value for the pixel component. +

+
+
y
+

The second input value for the pixel component. +

+
+
bdx
+

The first input video bit depth. +

+
+
bdy
+

The second input video bit depth. +

+
+ +

All expressions default to "x". +

+ +
+

39.152.1 Commands

+ +

This filter supports the all above options as commands except option d. +

+
+
+

39.152.2 Examples

+ +
    +
  • Highlight differences between two RGB video streams: +
    +
    lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1)'
    +
    + +
  • Highlight differences between two YUV video streams: +
    +
    lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1)'
    +
    + +
  • Show max difference between two video streams: +
    +
    lut2='if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1)))'
    +
    +
+ +
+
+
+

39.153 maskedclamp

+ +

Clamp the first input stream with the second input and third input stream. +

+

Returns the value of first stream to be between second input +stream - undershoot and third input stream + overshoot. +

+

This filter accepts the following options: +

+
undershoot
+

Default value is 0. +

+
+
overshoot
+

Default value is 0. +

+
+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

39.153.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.154 maskedmax

+ +

Merge the second and third input stream into output stream using absolute differences +between second input stream and first input stream and absolute difference between +third input stream and first input stream. The picked value will be from second input +stream if second absolute difference is greater than first one or from third input stream +otherwise. +

+

This filter accepts the following options: +

+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

39.154.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.155 maskedmerge

+ +

Merge the first input stream with the second input stream using per pixel +weights in the third input stream. +

+

A value of 0 in the third stream pixel component means that pixel component +from first stream is returned unchanged, while maximum value (eg. 255 for +8-bit videos) means that pixel component from second stream is returned +unchanged. Intermediate values define the amount of merging between both +input stream’s pixel components. +

+

This filter accepts the following options: +

+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

39.155.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.156 maskedmin

+ +

Merge the second and third input stream into output stream using absolute differences +between second input stream and first input stream and absolute difference between +third input stream and first input stream. The picked value will be from second input +stream if second absolute difference is less than first one or from third input stream +otherwise. +

+

This filter accepts the following options: +

+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

39.156.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.157 maskedthreshold

+

Pick pixels comparing absolute difference of two video streams with fixed +threshold. +

+

If absolute difference between pixel component of first and second video +stream is equal or lower than user supplied threshold than pixel component +from first video stream is picked, otherwise pixel component from second +video stream is picked. +

+

This filter accepts the following options: +

+
threshold
+

Set threshold used when picking pixels from absolute difference from two input +video streams. +

+
+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from second stream. +By default value 0xf, all planes will be processed. +

+
+
mode
+

Set mode of filter operation. Can be abs or diff. +Default is abs. +

+
+ + +
+

39.157.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.158 maskfun

+

Create mask from input video. +

+

For example it is useful to create motion masks after tblend filter. +

+

This filter accepts the following options: +

+
+
low
+

Set low threshold. Any pixel component lower or exact than this value will be set to 0. +

+
+
high
+

Set high threshold. Any pixel component higher than this value will be set to max value +allowed for current pixel format. +

+
+
planes
+

Set planes to filter, by default all available planes are filtered. +

+
+
fill
+

Fill all frame pixels with this value. +

+
+
sum
+

Set max average pixel value for frame. If sum of all pixel components is higher that this +average, output frame will be completely filled with value set by fill option. +Typically useful for scene changes when used in combination with tblend filter. +

+
+ + +
+

39.158.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.159 mcdeint

+ +

Apply motion-compensation deinterlacing. +

+

It needs one field per frame as input and must thus be used together +with yadif=1/3 or equivalent. +

+

This filter accepts the following options: +

+
mode
+

Set the deinterlacing mode. +

+

It accepts one of the following values: +

+
fast
+
medium
+
slow
+

use iterative motion estimation +

+
extra_slow
+

like ‘slow’, but use multiple reference frames. +

+
+

Default value is ‘fast’. +

+
+
parity
+

Set the picture field parity assumed for the input video. It must be +one of the following values: +

+
+
0, tff
+

assume top field first +

+
1, bff
+

assume bottom field first +

+
+ +

Default value is ‘bff’. +

+
+
qp
+

Set per-block quantization parameter (QP) used by the internal +encoder. +

+

Higher values should result in a smoother motion vector field but less +optimal individual vectors. Default value is 1. +

+
+ +
+
+

39.160 median

+ +

Pick median pixel from certain rectangle defined by radius. +

+

This filter accepts the following options: +

+
+
radius
+

Set horizontal radius size. Default value is 1. +Allowed range is integer from 1 to 127. +

+
+
planes
+

Set which planes to process. Default is 15, which is all available planes. +

+
+
radiusV
+

Set vertical radius size. Default value is 0. +Allowed range is integer from 0 to 127. +If it is 0, value will be picked from horizontal radius option. +

+
+
percentile
+

Set median percentile. Default value is 0.5. +Default value of 0.5 will pick always median values, while 0 will pick +minimum values, and 1 maximum values. +

+
+ + +
+

39.160.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

39.161 mergeplanes

+ +

Merge color channel components from several video streams. +

+

The filter accepts up to 4 input streams, and merge selected input +planes to the output video. +

+

This filter accepts the following options: +

+
mapping
+

Set input to output plane mapping. Default is 0. +

+

The mappings is specified as a bitmap. It should be specified as a +hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. ’Aa’ describes the +mapping for the first plane of the output stream. ’A’ sets the number of +the input stream to use (from 0 to 3), and ’a’ the plane number of the +corresponding input to use (from 0 to 3). The rest of the mappings is +similar, ’Bb’ describes the mapping for the output stream second +plane, ’Cc’ describes the mapping for the output stream third plane and +’Dd’ describes the mapping for the output stream fourth plane. +

+
+
format
+

Set output pixel format. Default is yuva444p. +

+
+
map0s
+
map1s
+
map2s
+
map3s
+

Set input to output stream mapping for output Nth plane. Default is 0. +

+
+
map0p
+
map1p
+
map2p
+
map3p
+

Set input to output plane mapping for output Nth plane. Default is 0. +

+
+ + +
+

39.161.1 Examples

+ +
    +
  • Merge three gray video streams of same width and height into single video stream: +
    +
    [a0][a1][a2]mergeplanes=0x001020:yuv444p
    +
    + +
  • Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream: +
    +
    [a0][a1]mergeplanes=0x00010210:yuva444p
    +
    + +
  • Swap Y and A plane in yuva444p stream: +
    +
    format=yuva444p,mergeplanes=0x03010200:yuva444p
    +
    + +
  • Swap U and V plane in yuv420p stream: +
    +
    format=yuv420p,mergeplanes=0x000201:yuv420p
    +
    + +
  • Cast a rgb24 clip to yuv444p: +
    +
    format=rgb24,mergeplanes=0x000102:yuv444p
    +
    +
+ +
+
+
+

39.162 mestimate

+ +

Estimate and export motion vectors using block matching algorithms. +Motion vectors are stored in frame side data to be used by other filters. +

+

This filter accepts the following options: +

+
method
+

Specify the motion estimation method. Accepts one of the following values: +

+
+
esa
+

Exhaustive search algorithm. +

+
tss
+

Three step search algorithm. +

+
tdls
+

Two dimensional logarithmic search algorithm. +

+
ntss
+

New three step search algorithm. +

+
fss
+

Four step search algorithm. +

+
ds
+

Diamond search algorithm. +

+
hexbs
+

Hexagon-based search algorithm. +

+
epzs
+

Enhanced predictive zonal search algorithm. +

+
umh
+

Uneven multi-hexagon search algorithm. +

+
+

Default value is ‘esa’. +

+
+
mb_size
+

Macroblock size. Default 16. +

+
+
search_param
+

Search parameter. Default 7. +

+
+ +
+
+

39.163 midequalizer

+ +

Apply Midway Image Equalization effect using two video streams. +

+

Midway Image Equalization adjusts a pair of images to have the same +histogram, while maintaining their dynamics as much as possible. It’s +useful for e.g. matching exposures from a pair of stereo cameras. +

+

This filter has two inputs and one output, which must be of same pixel format, but +may be of different sizes. The output of filter is first input adjusted with +midway histogram of both inputs. +

+

This filter accepts the following option: +

+
+
planes
+

Set which planes to process. Default is 15, which is all available planes. +

+
+ +
+
+

39.164 minterpolate

+ +

Convert the video to specified frame rate using motion interpolation. +

+

This filter accepts the following options: +

+
fps
+

Specify the output frame rate. This can be rational e.g. 60000/1001. Frames are dropped if fps is lower than source fps. Default 60. +

+
+
mi_mode
+

Motion interpolation mode. Following values are accepted: +

+
dup
+

Duplicate previous or next frame for interpolating new ones. +

+
blend
+

Blend source frames. Interpolated frame is mean of previous and next frames. +

+
mci
+

Motion compensated interpolation. Following options are effective when this mode is selected: +

+
+
mc_mode
+

Motion compensation mode. Following values are accepted: +

+
obmc
+

Overlapped block motion compensation. +

+
aobmc
+

Adaptive overlapped block motion compensation. Window weighting coefficients are controlled adaptively according to the reliabilities of the neighboring motion vectors to reduce oversmoothing. +

+
+

Default mode is ‘obmc’. +

+
+
me_mode
+

Motion estimation mode. Following values are accepted: +

+
bidir
+

Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions. +

+
bilat
+

Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame. +

+
+

Default mode is ‘bilat’. +

+
+
me
+

The algorithm to be used for motion estimation. Following values are accepted: +

+
esa
+

Exhaustive search algorithm. +

+
tss
+

Three step search algorithm. +

+
tdls
+

Two dimensional logarithmic search algorithm. +

+
ntss
+

New three step search algorithm. +

+
fss
+

Four step search algorithm. +

+
ds
+

Diamond search algorithm. +

+
hexbs
+

Hexagon-based search algorithm. +

+
epzs
+

Enhanced predictive zonal search algorithm. +

+
umh
+

Uneven multi-hexagon search algorithm. +

+
+

Default algorithm is ‘epzs’. +

+
+
mb_size
+

Macroblock size. Default 16. +

+
+
search_param
+

Motion estimation search parameter. Default 32. +

+
+
vsbmc
+

Enable variable-size block motion compensation. Motion estimation is applied with smaller block sizes at object boundaries in order to make the them less blur. Default is 0 (disabled). +

+
+
+
+ +
+
scd
+

Scene change detection method. Scene change leads motion vectors to be in random direction. Scene change detection replace interpolated frames by duplicate ones. May not be needed for other modes. Following values are accepted: +

+
none
+

Disable scene change detection. +

+
fdiff
+

Frame difference. Corresponding pixel values are compared and if it satisfies scd_threshold scene change is detected. +

+
+

Default method is ‘fdiff’. +

+
+
scd_threshold
+

Scene change detection threshold. Default is 10.. +

+
+ +
+
+

39.165 mix

+ +

Mix several video input streams into one video stream. +

+

A description of the accepted options follows. +

+
+
inputs
+

The number of inputs. If unspecified, it defaults to 2. +

+
+
weights
+

Specify weight of each input video stream as sequence. +Each weight is separated by space. If number of weights +is smaller than number of frames last specified +weight will be used for all remaining unset weights. +

+
+
scale
+

Specify scale, if it is set it will be multiplied with sum +of each weight multiplied with pixel values to give final destination +pixel value. By default scale is auto scaled to sum of weights. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+
duration
+

Specify how end of stream is determined. +

+
longest
+

The duration of the longest input. (default) +

+
+
shortest
+

The duration of the shortest input. +

+
+
first
+

The duration of the first input. +

+
+
+
+ + +
+

39.165.1 Commands

+ +

This filter supports the following commands: +

+
weights
+
scale
+
planes
+

Syntax is same as option with same name. +

+
+ +
+
+
+

39.166 monochrome

+

Convert video to gray using custom color filter. +

+

A description of the accepted options follows. +

+
+
cb
+

Set the chroma blue spot. Allowed range is from -1 to 1. +Default value is 0. +

+
+
cr
+

Set the chroma red spot. Allowed range is from -1 to 1. +Default value is 0. +

+
+
size
+

Set the color filter size. Allowed range is from .1 to 10. +Default value is 1. +

+
+
high
+

Set the highlights strength. Allowed range is from 0 to 1. +Default value is 0. +

+
+ + +
+

39.166.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.167 morpho

+ +

This filter allows to apply main morphological grayscale transforms, +erode and dilate with arbitrary structures set in second input stream. +

+

Unlike naive implementation and much slower performance in erosion +and dilation filters, when speed is critical morpho filter +should be used instead. +

+

A description of accepted options follows, +

+
+
mode
+

Set morphological transform to apply, can be: +

+
+
erode
+
dilate
+
open
+
close
+
gradient
+
tophat
+
blackhat
+
+

Default is erode. +

+
+
planes
+

Set planes to filter, by default all planes except alpha are filtered. +

+
+
structure
+

Set which structure video frames will be processed from second input stream, +can be first or all. Default is all. +

+
+ +

The morpho filter also supports the framesync options. +

+ +
+

39.167.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

39.168 mpdecimate

+ +

Drop frames that do not differ greatly from the previous frame in +order to reduce frame rate. +

+

The main use of this filter is for very-low-bitrate encoding +(e.g. streaming over dialup modem), but it could in theory be used for +fixing movies that were inverse-telecined incorrectly. +

+

A description of the accepted options follows. +

+
+
max
+

Set the maximum number of consecutive frames which can be dropped (if +positive), or the minimum interval between dropped frames (if +negative). If the value is 0, the frame is dropped disregarding the +number of previous sequentially dropped frames. +

+

Default value is 0. +

+
+
keep
+

Set the maximum number of consecutive similar frames to ignore before to start dropping them. +If the value is 0, the frame is dropped disregarding the +number of previous sequentially similar frames. +

+

Default value is 0. +

+
+
hi
+
lo
+
frac
+

Set the dropping threshold values. +

+

Values for hi and lo are for 8x8 pixel blocks and +represent actual pixel value differences, so a threshold of 64 +corresponds to 1 unit of difference for each pixel, or the same spread +out differently over the block. +

+

A frame is a candidate for dropping if no 8x8 blocks differ by more +than a threshold of hi, and if no more than frac blocks (1 +meaning the whole image) differ by more than a threshold of lo. +

+

Default value for hi is 64*12, default value for lo is +64*5, and default value for frac is 0.33. +

+
+ +
+
+

39.169 msad

+ +

Obtain the MSAD (Mean Sum of Absolute Differences) between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained per component, average, min and max MSAD is printed through +the logging system. +

+

The filter stores the calculated MSAD of each frame in frame metadata. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi msad -f null -
+
+ +
+
+

39.170 multiply

+

Multiply first video stream pixels values with second video stream pixels values. +

+

The filter accepts the following options: +

+
+
scale
+

Set the scale applied to second video stream. By default is 1. +Allowed range is from 0 to 9. +

+
+
offset
+

Set the offset applied to second video stream. By default is 0.5. +Allowed range is from -1 to 1. +

+
+
planes
+

Specify planes from input video stream that will be processed. +By default all planes are processed. +

+
+ + +
+

39.170.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

39.171 negate

+ +

Negate (invert) the input video. +

+

It accepts the following option: +

+
+
components
+

Set components to negate. +

+

Available values for components are: +

+
y
+
u
+
v
+
a
+
r
+
g
+
b
+
+ +
+
negate_alpha
+

With value 1, it negates the alpha component, if present. Default value is 0. +

+
+ + +
+

39.171.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

39.172 nlmeans

+ +

Denoise frames using Non-Local Means algorithm. +

+

Each pixel is adjusted by looking for other pixels with similar contexts. This +context similarity is defined by comparing their surrounding patches of size +pxp. Patches are searched in an area of rxr +around the pixel. +

+

Note that the research area defines centers for patches, which means some +patches will be made of pixels outside that research area. +

+

The filter accepts the following options. +

+
+
s
+

Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0]. +

+
+
p
+

Set patch size. Default is 7. Must be odd number in range [0, 99]. +

+
+
pc
+

Same as p but for chroma planes. +

+

The default value is 0 and means automatic. +

+
+
r
+

Set research size. Default is 15. Must be odd number in range [0, 99]. +

+
+
rc
+

Same as r but for chroma planes. +

+

The default value is 0 and means automatic. +

+
+ +
+
+

39.173 nnedi

+ +

Deinterlace video using neural network edge directed interpolation. +

+

This filter accepts the following options: +

+
+
weights
+

Mandatory option, without binary file filter can not work. +Currently file can be found here: +https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin +

+
+
deint
+

Set which frames to deinterlace, by default it is all. +Can be all or interlaced. +

+
+
field
+

Set mode of operation. +

+

Can be one of the following: +

+
+
af
+

Use frame flags, both fields. +

+
a
+

Use frame flags, single field. +

+
t
+

Use top field only. +

+
b
+

Use bottom field only. +

+
tf
+

Use both fields, top first. +

+
bf
+

Use both fields, bottom first. +

+
+ +
+
planes
+

Set which planes to process, by default filter process all frames. +

+
+
nsize
+

Set size of local neighborhood around each pixel, used by the predictor neural +network. +

+

Can be one of the following: +

+
+
s8x6
+
s16x6
+
s32x6
+
s48x6
+
s8x4
+
s16x4
+
s32x4
+
+ +
+
nns
+

Set the number of neurons in predictor neural network. +Can be one of the following: +

+
+
n16
+
n32
+
n64
+
n128
+
n256
+
+ +
+
qual
+

Controls the number of different neural network predictions that are blended +together to compute the final output value. Can be fast, default or +slow. +

+
+
etype
+

Set which set of weights to use in the predictor. +Can be one of the following: +

+
+
a, abs
+

weights trained to minimize absolute error +

+
s, mse
+

weights trained to minimize squared error +

+
+ +
+
pscrn
+

Controls whether or not the prescreener neural network is used to decide +which pixels should be processed by the predictor neural network and which +can be handled by simple cubic interpolation. +The prescreener is trained to know whether cubic interpolation will be +sufficient for a pixel or whether it should be predicted by the predictor nn. +The computational complexity of the prescreener nn is much less than that of +the predictor nn. Since most pixels can be handled by cubic interpolation, +using the prescreener generally results in much faster processing. +The prescreener is pretty accurate, so the difference between using it and not +using it is almost always unnoticeable. +

+

Can be one of the following: +

+
+
none
+
original
+
new
+
new2
+
new3
+
+ +

Default is new. +

+
+ + +
+

39.173.1 Commands

+

This filter supports same commands as options, excluding weights option. +

+
+
+
+

39.174 noformat

+ +

Force libavfilter not to use any of the specified pixel formats for the +input to the next filter. +

+

It accepts the following parameters: +

+
pix_fmts
+

A ’|’-separated list of pixel format names, such as +pix_fmts=yuv420p|monow|rgb24". +

+
+
+ + +
+

39.174.1 Examples

+ +
    +
  • Force libavfilter to use a format different from yuv420p for the +input to the vflip filter: +
    +
    noformat=pix_fmts=yuv420p,vflip
    +
    + +
  • Convert the input video to any of the formats not contained in the list: +
    +
    noformat=yuv420p|yuv444p|yuv410p
    +
    +
+ +
+
+
+

39.175 noise

+ +

Add noise on video input frame. +

+

The filter accepts the following options: +

+
+
all_seed
+
c0_seed
+
c1_seed
+
c2_seed
+
c3_seed
+

Set noise seed for specific pixel component or all pixel components in case +of all_seed. Default value is 123457. +

+
+
all_strength, alls
+
c0_strength, c0s
+
c1_strength, c1s
+
c2_strength, c2s
+
c3_strength, c3s
+

Set noise strength for specific pixel component or all pixel components in case +all_strength. Default value is 0. Allowed range is [0, 100]. +

+
+
all_flags, allf
+
c0_flags, c0f
+
c1_flags, c1f
+
c2_flags, c2f
+
c3_flags, c3f
+

Set pixel component flags or set flags for all components if all_flags. +Available values for component flags are: +

+
a
+

averaged temporal noise (smoother) +

+
p
+

mix random noise with a (semi)regular pattern +

+
t
+

temporal noise (noise pattern changes between frames) +

+
u
+

uniform noise (gaussian otherwise) +

+
+
+
+ + +
+

39.175.1 Examples

+ +

Add temporal and uniform noise to input video: +

+
noise=alls=20:allf=t+u
+
+ +
+
+
+

39.176 normalize

+ +

Normalize RGB video (aka histogram stretching, contrast stretching). +See: https://en.wikipedia.org/wiki/Normalization_(image_processing) +

+

For each channel of each frame, the filter computes the input range and maps +it linearly to the user-specified output range. The output range defaults +to the full dynamic range from pure black to pure white. +

+

Temporal smoothing can be used on the input range to reduce flickering (rapid +changes in brightness) caused when small dark or bright objects enter or leave +the scene. This is similar to the auto-exposure (automatic gain control) on a +video camera, and, like a video camera, it may cause a period of over- or +under-exposure of the video. +

+

The R,G,B channels can be normalized independently, which may cause some +color shifting, or linked together as a single channel, which prevents +color shifting. Linked normalization preserves hue. Independent normalization +does not, so it can be used to remove some color casts. Independent and linked +normalization can be combined in any ratio. +

+

The normalize filter accepts the following options: +

+
+
blackpt
+
whitept
+

Colors which define the output range. The minimum input value is mapped to +the blackpt. The maximum input value is mapped to the whitept. +The defaults are black and white respectively. Specifying white for +blackpt and black for whitept will give color-inverted, +normalized video. Shades of grey can be used to reduce the dynamic range +(contrast). Specifying saturated colors here can create some interesting +effects. +

+
+
smoothing
+

The number of previous frames to use for temporal smoothing. The input range +of each channel is smoothed using a rolling average over the current frame +and the smoothing previous frames. The default is 0 (no temporal +smoothing). +

+
+
independence
+

Controls the ratio of independent (color shifting) channel normalization to +linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully +independent. Defaults to 1.0 (fully independent). +

+
+
strength
+

Overall strength of the filter. 1.0 is full strength. 0.0 is a rather +expensive no-op. Defaults to 1.0 (full strength). +

+
+
+ + +
+

39.176.1 Commands

+

This filter supports same commands as options, excluding smoothing option. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+

39.176.2 Examples

+ +

Stretch video contrast to use the full dynamic range, with no temporal +smoothing; may flicker depending on the source content: +

+
normalize=blackpt=black:whitept=white:smoothing=0
+
+ +

As above, but with 50 frames of temporal smoothing; flicker should be +reduced, depending on the source content: +

+
normalize=blackpt=black:whitept=white:smoothing=50
+
+ +

As above, but with hue-preserving linked channel normalization: +

+
normalize=blackpt=black:whitept=white:smoothing=50:independence=0
+
+ +

As above, but with half strength: +

+
normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
+
+ +

Map the darkest input color to red, the brightest input color to cyan: +

+
normalize=blackpt=red:whitept=cyan
+
+ +
+
+
+

39.177 null

+ +

Pass the video source unchanged to the output. +

+
+
+

39.178 ocr

+

Optical Character Recognition +

+

This filter uses Tesseract for optical character recognition. To enable +compilation of this filter, you need to configure FFmpeg with +--enable-libtesseract. +

+

It accepts the following options: +

+
+
datapath
+

Set datapath to tesseract data. Default is to use whatever was +set at installation. +

+
+
language
+

Set language, default is "eng". +

+
+
whitelist
+

Set character whitelist. +

+
+
blacklist
+

Set character blacklist. +

+
+ +

The filter exports recognized text as the frame metadata lavfi.ocr.text. +The filter exports confidence of recognized words as the frame metadata lavfi.ocr.confidence. +

+
+
+

39.179 ocv

+ +

Apply a video transform using libopencv. +

+

To enable this filter, install the libopencv library and headers and +configure FFmpeg with --enable-libopencv. +

+

It accepts the following parameters: +

+
+
filter_name
+

The name of the libopencv filter to apply. +

+
+
filter_params
+

The parameters to pass to the libopencv filter. If not specified, the default +values are assumed. +

+
+
+ +

Refer to the official libopencv documentation for more precise +information: +http://docs.opencv.org/master/modules/imgproc/doc/filtering.html +

+

Several libopencv filters are supported; see the following subsections. +

+ +
+

39.179.1 dilate

+ +

Dilate an image by using a specific structuring element. +It corresponds to the libopencv function cvDilate. +

+

It accepts the parameters: struct_el|nb_iterations. +

+

struct_el represents a structuring element, and has the syntax: +colsxrows+anchor_xxanchor_y/shape +

+

cols and rows represent the number of columns and rows of +the structuring element, anchor_x and anchor_y the anchor +point, and shape the shape for the structuring element. shape +must be "rect", "cross", "ellipse", or "custom". +

+

If the value for shape is "custom", it must be followed by a +string of the form "=filename". The file with name +filename is assumed to represent a binary image, with each +printable character corresponding to a bright pixel. When a custom +shape is used, cols and rows are ignored, the number +or columns and rows of the read file are assumed instead. +

+

The default value for struct_el is "3x3+0x0/rect". +

+

nb_iterations specifies the number of times the transform is +applied to the image, and defaults to 1. +

+

Some examples: +

+
# Use the default values
+ocv=dilate
+
+# Dilate using a structuring element with a 5x5 cross, iterating two times
+ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
+
+# Read the shape from the file diamond.shape, iterating two times.
+# The file diamond.shape may contain a pattern of characters like this
+#   *
+#  ***
+# *****
+#  ***
+#   *
+# The specified columns and rows are ignored
+# but the anchor point coordinates are not
+ocv=dilate:0x0+2x2/custom=diamond.shape|2
+
+ +
+
+

39.179.2 erode

+ +

Erode an image by using a specific structuring element. +It corresponds to the libopencv function cvErode. +

+

It accepts the parameters: struct_el:nb_iterations, +with the same syntax and semantics as the dilate filter. +

+
+
+

39.179.3 smooth

+ +

Smooth the input video. +

+

The filter takes the following parameters: +type|param1|param2|param3|param4. +

+

type is the type of smooth filter to apply, and must be one of +the following values: "blur", "blur_no_scale", "median", "gaussian", +or "bilateral". The default value is "gaussian". +

+

The meaning of param1, param2, param3, and param4 +depends on the smooth type. param1 and +param2 accept integer positive values or 0. param3 and +param4 accept floating point values. +

+

The default value for param1 is 3. The default value for the +other parameters is 0. +

+

These parameters correspond to the parameters assigned to the +libopencv function cvSmooth. +

+
+
+
+

39.180 oscilloscope

+ +

2D Video Oscilloscope. +

+

Useful to measure spatial impulse, step responses, chroma delays, etc. +

+

It accepts the following parameters: +

+
+
x
+

Set scope center x position. +

+
+
y
+

Set scope center y position. +

+
+
s
+

Set scope size, relative to frame diagonal. +

+
+
t
+

Set scope tilt/rotation. +

+
+
o
+

Set trace opacity. +

+
+
tx
+

Set trace center x position. +

+
+
ty
+

Set trace center y position. +

+
+
tw
+

Set trace width, relative to width of frame. +

+
+
th
+

Set trace height, relative to height of frame. +

+
+
c
+

Set which components to trace. By default it traces first three components. +

+
+
g
+

Draw trace grid. By default is enabled. +

+
+
st
+

Draw some statistics. By default is enabled. +

+
+
sc
+

Draw scope. By default is enabled. +

+
+ + +
+

39.180.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+

39.180.2 Examples

+ +
    +
  • Inspect full first row of video frame. +
    +
    oscilloscope=x=0.5:y=0:s=1
    +
    + +
  • Inspect full last row of video frame. +
    +
    oscilloscope=x=0.5:y=1:s=1
    +
    + +
  • Inspect full 5th line of video frame of height 1080. +
    +
    oscilloscope=x=0.5:y=5/1080:s=1
    +
    + +
  • Inspect full last column of video frame. +
    +
    oscilloscope=x=1:y=0.5:s=1:t=1
    +
    + +
+ +
+
+
+

39.181 overlay

+ +

Overlay one video on top of another. +

+

It takes two inputs and has one output. The first input is the "main" +video on which the second input is overlaid. +

+

It accepts the following parameters: +

+

A description of the accepted options follows. +

+
+
x
+
y
+

Set the expression for the x and y coordinates of the overlaid video +on the main video. Default value is "0" for both expressions. In case +the expression is invalid, it is set to a huge value (meaning that the +overlay will not be displayed within the output visible area). +

+
+
eof_action
+

See framesync. +

+
+
eval
+

Set when the expressions for x, and y are evaluated. +

+

It accepts the following values: +

+
init
+

only evaluate expressions once during the filter initialization or +when a command is processed +

+
+
frame
+

evaluate expressions for each incoming frame +

+
+ +

Default value is ‘frame’. +

+
+
shortest
+

See framesync. +

+
+
format
+

Set the format for the output video. +

+

It accepts the following values: +

+
yuv420
+

force YUV420 output +

+
+
yuv420p10
+

force YUV420p10 output +

+
+
yuv422
+

force YUV422 output +

+
+
yuv422p10
+

force YUV422p10 output +

+
+
yuv444
+

force YUV444 output +

+
+
rgb
+

force packed RGB output +

+
+
gbrp
+

force planar RGB output +

+
+
auto
+

automatically pick format +

+
+ +

Default value is ‘yuv420’. +

+
+
repeatlast
+

See framesync. +

+
+
alpha
+

Set format of alpha of the overlaid video, it can be straight or +premultiplied. Default is straight. +

+
+ +

The x, and y expressions can contain the following +parameters. +

+
+
main_w, W
+
main_h, H
+

The main input width and height. +

+
+
overlay_w, w
+
overlay_h, h
+

The overlay input width and height. +

+
+
x
+
y
+

The computed values for x and y. They are evaluated for +each new frame. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values of the output +format. For example for the pixel format "yuv422p" hsub is 2 and +vsub is 1. +

+
+
n
+

the number of input frame, starting from 0 +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, +do not use +

+
+
t
+

The timestamp, expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
+ +

This filter also supports the framesync options. +

+

Note that the n, t variables are available only +when evaluation is done per frame, and will evaluate to NAN +when eval is set to ‘init’. +

+

Be aware that frames are taken from each input video in timestamp +order, hence, if their initial timestamps differ, it is a good idea +to pass the two inputs through a setpts=PTS-STARTPTS filter to +have them begin in the same zero timestamp, as the example for +the movie filter does. +

+

You can chain together more overlays but you should test the +efficiency of such approach. +

+ +
+

39.181.1 Commands

+ +

This filter supports the following commands: +

+
x
+
y
+

Modify the x and y of the overlay input. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+

39.181.2 Examples

+ +
    +
  • Draw the overlay at 10 pixels from the bottom right corner of the main +video: +
    +
    overlay=main_w-overlay_w-10:main_h-overlay_h-10
    +
    + +

    Using named options the example above becomes: +

    +
    overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
    +
    + +
  • Insert a transparent PNG logo in the bottom left corner of the input, +using the ffmpeg tool with the -filter_complex option: +
    +
    ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
    +
    + +
  • Insert 2 different transparent PNG logos (second logo on bottom +right corner) using the ffmpeg tool: +
    +
    ffmpeg -i input -i logo1 -i logo2 -filter_complex 'overlay=x=10:y=H-h-10,overlay=x=W-w-10:y=H-h-10' output
    +
    + +
  • Add a transparent color layer on top of the main video; WxH +must specify the size of the main input to the overlay filter: +
    +
    color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
    +
    + +
  • Play an original video and a filtered version (here with the deshake +filter) side by side using the ffplay tool: +
    +
    ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
    +
    + +

    The above command is the same as: +

    +
    ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
    +
    + +
  • Make a sliding overlay appearing from the left to the right top part of the +screen starting since time 2: +
    +
    overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
    +
    + +
  • Compose output by putting two input videos side to side: +
    +
    ffmpeg -i left.avi -i right.avi -filter_complex "
    +nullsrc=size=200x100 [background];
    +[0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
    +[1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
    +[background][left]       overlay=shortest=1       [background+left];
    +[background+left][right] overlay=shortest=1:x=100 [left+right]
    +"
    +
    + +
  • Mask 10-20 seconds of a video by applying the delogo filter to a section +
    +
    ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
    +-vf '[in]split[split_main][split_delogo];[split_delogo]trim=start=360:end=371,delogo=0:0:640:480[delogoed];[split_main][delogoed]overlay=eof_action=pass[out]'
    +masked.avi
    +
    + +
  • Chain several overlays in cascade: +
    +
    nullsrc=s=200x200 [bg];
    +testsrc=s=100x100, split=4 [in0][in1][in2][in3];
    +[in0] lutrgb=r=0, [bg]   overlay=0:0     [mid0];
    +[in1] lutrgb=g=0, [mid0] overlay=100:0   [mid1];
    +[in2] lutrgb=b=0, [mid1] overlay=0:100   [mid2];
    +[in3] null,       [mid2] overlay=100:100 [out0]
    +
    + +
+ +
+
+
+

39.182 overlay_cuda

+ +

Overlay one video on top of another. +

+

This is the CUDA variant of the overlay filter. +It only accepts CUDA frames. The underlying input pixel formats have to match. +

+

It takes two inputs and has one output. The first input is the "main" +video on which the second input is overlaid. +

+

It accepts the following parameters: +

+
+
x
+
y
+

Set expressions for the x and y coordinates of the overlaid video +on the main video. +

+

They can contain the following parameters: +

+
+
main_w, W
+
main_h, H
+

The main input width and height. +

+
+
overlay_w, w
+
overlay_h, h
+

The overlay input width and height. +

+
+
x
+
y
+

The computed values for x and y. They are evaluated for +each new frame. +

+
+
n
+

The ordinal index of the main input frame, starting from 0. +

+
+
pos
+

The byte offset position in the file of the main input frame, NAN if unknown. +Deprecated, do not use. +

+
+
t
+

The timestamp of the main input frame, expressed in seconds, NAN if unknown. +

+
+
+ +

Default value is "0" for both expressions. +

+
+
eval
+

Set when the expressions for x and y are evaluated. +

+

It accepts the following values: +

+
init
+

Evaluate expressions once during filter initialization or +when a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame +

+
+ +

Default value is frame. +

+
+
eof_action
+

See framesync. +

+
+
shortest
+

See framesync. +

+
+
repeatlast
+

See framesync. +

+
+
+ +

This filter also supports the framesync options. +

+
+
+

39.183 owdenoise

+ +

Apply Overcomplete Wavelet denoiser. +

+

The filter accepts the following options: +

+
+
depth
+

Set depth. +

+

Larger depth values will denoise lower frequency components more, but +slow down filtering. +

+

Must be an int in the range 8-16, default is 8. +

+
+
luma_strength, ls
+

Set luma strength. +

+

Must be a double value in the range 0-1000, default is 1.0. +

+
+
chroma_strength, cs
+

Set chroma strength. +

+

Must be a double value in the range 0-1000, default is 1.0. +

+
+ +
+
+

39.184 pad

+ +

Add paddings to the input image, and place the original input at the +provided x, y coordinates. +

+

It accepts the following parameters: +

+
+
width, w
+
height, h
+

Specify an expression for the size of the output image with the +paddings added. If the value for width or height is 0, the +corresponding input size is used for the output. +

+

The width expression can reference the value set by the +height expression, and vice versa. +

+

The default value of width and height is 0. +

+
+
x
+
y
+

Specify the offsets to place the input image at within the padded area, +with respect to the top/left border of the output image. +

+

The x expression can reference the value set by the y +expression, and vice versa. +

+

The default value of x and y is 0. +

+

If x or y evaluate to a negative number, they’ll be changed +so the input image is centered on the padded area. +

+
+
color
+

Specify the color of the padded area. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. +

+

The default value of color is "black". +

+
+
eval
+

Specify when to evaluate width, height, x and y expression. +

+

It accepts the following values: +

+
+
init
+

Only evaluate expressions once during the filter initialization or when +a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+
+ +

Default value is ‘init’. +

+
+
aspect
+

Pad to aspect instead to a resolution. +

+
+
+ +

The value for the width, height, x, and y +options are expressions containing the following constants: +

+
+
in_w
+
in_h
+

The input video width and height. +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output width and height (the size of the padded area), as +specified by the width and height expressions. +

+
+
ow
+
oh
+

These are the same as out_w and out_h. +

+
+
x
+
y
+

The x and y offsets as specified by the x and y +expressions, or NAN if not yet specified. +

+
+
a
+

same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (iw / ih) * sar +

+
+
hsub
+
vsub
+

The horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ + +
+

39.184.1 Examples

+ +
    +
  • Add paddings with the color "violet" to the input video. The output video +size is 640x480, and the top-left corner of the input video is placed at +column 0, row 40 +
    +
    pad=640:480:0:40:violet
    +
    + +

    The example above is equivalent to the following command: +

    +
    pad=width=640:height=480:x=0:y=40:color=violet
    +
    + +
  • Pad the input to get an output with dimensions increased by 3/2, +and put the input video at the center of the padded area: +
    +
    pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • Pad the input to get a squared output with size equal to the maximum +value between the input width and height, and put the input video at +the center of the padded area: +
    +
    pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • Pad the input to get a final w/h ratio of 16:9: +
    +
    pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • In case of anamorphic video, in order to set the output display aspect +correctly, it is necessary to use sar in the expression, +according to the relation: +
    +
    (ih * X / ih) * sar = output_dar
    +X = output_dar / sar
    +
    + +

    Thus the previous example needs to be modified to: +

    +
    pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • Double the output size and put the input video in the bottom-right +corner of the output padded area: +
    +
    pad="2*iw:2*ih:ow-iw:oh-ih"
    +
    +
+ +
+
+
+

39.185 palettegen

+ +

Generate one palette for a whole video stream. +

+

It accepts the following options: +

+
+
max_colors
+

Set the maximum number of colors to quantize in the palette. +Note: the palette will still contain 256 colors; the unused palette entries +will be black. +

+
+
reserve_transparent
+

Create a palette of 255 colors maximum and reserve the last one for +transparency. Reserving the transparency color is useful for GIF optimization. +If not set, the maximum of colors in the palette will be 256. You probably want +to disable this option for a standalone image. +Set by default. +

+
+
transparency_color
+

Set the color that will be used as background for transparency. +

+
+
stats_mode
+

Set statistics mode. +

+

It accepts the following values: +

+
full
+

Compute full frame histograms. +

+
diff
+

Compute histograms only for the part that differs from previous frame. This +might be relevant to give more importance to the moving part of your input if +the background is static. +

+
single
+

Compute new histogram for each frame. +

+
+ +

Default value is full. +

+
+ +

The filter also exports the frame metadata lavfi.color_quant_ratio +(nb_color_in / nb_color_out) which you can use to evaluate the degree of +color quantization of the palette. This information is also visible at +info logging level. +

+ +
+

39.185.1 Examples

+ +
    +
  • Generate a representative palette of a given video using ffmpeg: +
    +
    ffmpeg -i input.mkv -vf palettegen palette.png
    +
    +
+ +
+
+
+

39.186 paletteuse

+ +

Use a palette to downsample an input video stream. +

+

The filter takes two inputs: one video stream and a palette. The palette must +be a 256 pixels image. +

+

It accepts the following options: +

+
+
dither
+

Select dithering mode. Available algorithms are: +

+
bayer
+

Ordered 8x8 bayer dithering (deterministic) +

+
heckbert
+

Dithering as defined by Paul Heckbert in 1982 (simple error diffusion). +Note: this dithering is sometimes considered "wrong" and is included as a +reference. +

+
floyd_steinberg
+

Floyd and Steingberg dithering (error diffusion) +

+
sierra2
+

Frankie Sierra dithering v2 (error diffusion) +

+
sierra2_4a
+

Frankie Sierra dithering v2 "Lite" (error diffusion) +

+
sierra3
+

Frankie Sierra dithering v3 (error diffusion) +

+
burkes
+

Burkes dithering (error diffusion) +

+
atkinson
+

Atkinson dithering by Bill Atkinson at Apple Computer (error diffusion) +

+
none
+

Disable dithering. +

+
+ +

Default is sierra2_4a. +

+
+
bayer_scale
+

When bayer dithering is selected, this option defines the scale of the +pattern (how much the crosshatch pattern is visible). A low value means more +visible pattern for less banding, and higher value means less visible pattern +at the cost of more banding. +

+

The option must be an integer value in the range [0,5]. Default is 2. +

+
+
diff_mode
+

If set, define the zone to process +

+
+
rectangle
+

Only the changing rectangle will be reprocessed. This is similar to GIF +cropping/offsetting compression mechanism. This option can be useful for speed +if only a part of the image is changing, and has use cases such as limiting the +scope of the error diffusal dither to the rectangle that bounds the +moving scene (it leads to more deterministic output if the scene doesn’t change +much, and as a result less moving noise and better GIF compression). +

+
+ +

Default is none. +

+
+
new
+

Take new palette for each output frame. +

+
+
alpha_threshold
+

Sets the alpha threshold for transparency. Alpha values above this threshold +will be treated as completely opaque, and values below this threshold will be +treated as completely transparent. +

+

The option must be an integer value in the range [0,255]. Default is 128. +

+
+ + +
+

39.186.1 Examples

+ +
    +
  • Use a palette (generated for example with palettegen) to encode a GIF +using ffmpeg: +
    +
    ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
    +
    +
+ +
+
+
+

39.187 perspective

+ +

Correct perspective of video not recorded perpendicular to the screen. +

+

A description of the accepted parameters follows. +

+
+
x0
+
y0
+
x1
+
y1
+
x2
+
y2
+
x3
+
y3
+

Set coordinates expression for top left, top right, bottom left and bottom right corners. +Default values are 0:0:W:0:0:H:W:H with which perspective will remain unchanged. +If the sense option is set to source, then the specified points will be sent +to the corners of the destination. If the sense option is set to destination, +then the corners of the source will be sent to the specified coordinates. +

+

The expressions can use the following variables: +

+
+
W
+
H
+

the width and height of video frame. +

+
in
+

Input frame count. +

+
on
+

Output frame count. +

+
+ +
+
interpolation
+

Set interpolation for perspective correction. +

+

It accepts the following values: +

+
linear
+
cubic
+
+ +

Default value is ‘linear’. +

+
+
sense
+

Set interpretation of coordinate options. +

+

It accepts the following values: +

+
0, source
+
+

Send point in the source specified by the given coordinates to +the corners of the destination. +

+
+
1, destination
+
+

Send the corners of the source to the point in the destination specified +by the given coordinates. +

+

Default value is ‘source’. +

+
+ +
+
eval
+

Set when the expressions for coordinates x0,y0,...x3,y3 are evaluated. +

+

It accepts the following values: +

+
init
+

only evaluate expressions once during the filter initialization or +when a command is processed +

+
+
frame
+

evaluate expressions for each incoming frame +

+
+ +

Default value is ‘init’. +

+
+ +
+
+

39.188 phase

+ +

Delay interlaced video by one field time so that the field order changes. +

+

The intended use is to fix PAL movies that have been captured with the +opposite field order to the film-to-video transfer. +

+

A description of the accepted parameters follows. +

+
+
mode
+

Set phase mode. +

+

It accepts the following values: +

+
t
+

Capture field order top-first, transfer bottom-first. +Filter will delay the bottom field. +

+
+
b
+

Capture field order bottom-first, transfer top-first. +Filter will delay the top field. +

+
+
p
+

Capture and transfer with the same field order. This mode only exists +for the documentation of the other options to refer to, but if you +actually select it, the filter will faithfully do nothing. +

+
+
a
+

Capture field order determined automatically by field flags, transfer +opposite. +Filter selects among ‘t’ and ‘b’ modes on a frame by frame +basis using field flags. If no field information is available, +then this works just like ‘u’. +

+
+
u
+

Capture unknown or varying, transfer opposite. +Filter selects among ‘t’ and ‘b’ on a frame by frame basis by +analyzing the images and selecting the alternative that produces best +match between the fields. +

+
+
T
+

Capture top-first, transfer unknown or varying. +Filter selects among ‘t’ and ‘p’ using image analysis. +

+
+
B
+

Capture bottom-first, transfer unknown or varying. +Filter selects among ‘b’ and ‘p’ using image analysis. +

+
+
A
+

Capture determined by field flags, transfer unknown or varying. +Filter selects among ‘t’, ‘b’ and ‘p’ using field flags and +image analysis. If no field information is available, then this works just +like ‘U’. This is the default mode. +

+
+
U
+

Both capture and transfer unknown or varying. +Filter selects among ‘t’, ‘b’ and ‘p’ using image analysis only. +

+
+
+
+ + +
+

39.188.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.189 photosensitivity

+

Reduce various flashes in video, so to help users with epilepsy. +

+

It accepts the following options: +

+
frames, f
+

Set how many frames to use when filtering. Default is 30. +

+
+
threshold, t
+

Set detection threshold factor. Default is 1. +Lower is stricter. +

+
+
skip
+

Set how many pixels to skip when sampling frames. Default is 1. +Allowed range is from 1 to 1024. +

+
+
bypass
+

Leave frames unchanged. Default is disabled. +

+
+ +
+
+

39.190 pixdesctest

+ +

Pixel format descriptor test filter, mainly useful for internal +testing. The output video should be equal to the input video. +

+

For example: +

+
format=monow, pixdesctest
+
+ +

can be used to test the monowhite pixel format descriptor definition. +

+
+
+

39.191 pixelize

+

Apply pixelization to video stream. +

+

The filter accepts the following options: +

+
width, w
+
height, h
+

Set block dimensions that will be used for pixelization. +Default value is 16. +

+
+
mode, m
+

Set the mode of pixelization used. +

+

Possible values are: +

+
avg
+
min
+
max
+
+

Default value is avg. +

+
+
planes, p
+

Set what planes to filter. Default is to filter all planes. +

+
+ + +
+

39.191.1 Commands

+ +

This filter supports all options as commands. +

+
+
+
+

39.192 pixscope

+ +

Display sample values of color channels. Mainly useful for checking color +and levels. Minimum supported resolution is 640x480. +

+

The filters accept the following options: +

+
+
x
+

Set scope X position, relative offset on X axis. +

+
+
y
+

Set scope Y position, relative offset on Y axis. +

+
+
w
+

Set scope width. +

+
+
h
+

Set scope height. +

+
+
o
+

Set window opacity. This window also holds statistics about pixel area. +

+
+
wx
+

Set window X position, relative offset on X axis. +

+
+
wy
+

Set window Y position, relative offset on Y axis. +

+
+ + +
+

39.192.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

39.193 pp

+ +

Enable the specified chain of postprocessing subfilters using libpostproc. This +library should be automatically selected with a GPL build (--enable-gpl). +Subfilters must be separated by ’/’ and can be disabled by prepending a ’-’. +Each subfilter and some options have a short and a long name that can be used +interchangeably, i.e. dr/dering are the same. +

+

The filters accept the following options: +

+
+
subfilters
+

Set postprocessing subfilters string. +

+
+ +

All subfilters share common options to determine their scope: +

+
+
a/autoq
+

Honor the quality commands for this subfilter. +

+
+
c/chrom
+

Do chrominance filtering, too (default). +

+
+
y/nochrom
+

Do luminance filtering only (no chrominance). +

+
+
n/noluma
+

Do chrominance filtering only (no luminance). +

+
+ +

These options can be appended after the subfilter name, separated by a ’|’. +

+

Available subfilters are: +

+
+
hb/hdeblock[|difference[|flatness]]
+

Horizontal deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+ +
+
vb/vdeblock[|difference[|flatness]]
+

Vertical deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+ +
+
ha/hadeblock[|difference[|flatness]]
+

Accurate horizontal deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+ +
+
va/vadeblock[|difference[|flatness]]
+

Accurate vertical deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+
+
+ +

The horizontal and vertical deblocking filters share the difference and +flatness values so you cannot set different horizontal and vertical +thresholds. +

+
+
h1/x1hdeblock
+

Experimental horizontal deblocking filter +

+
+
v1/x1vdeblock
+

Experimental vertical deblocking filter +

+
+
dr/dering
+

Deringing filter +

+
+
tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer
+
+
threshold1
+

larger -> stronger filtering +

+
threshold2
+

larger -> stronger filtering +

+
threshold3
+

larger -> stronger filtering +

+
+ +
+
al/autolevels[:f/fullyrange], automatic brightness / contrast correction
+
+
f/fullyrange
+

Stretch luminance to 0-255. +

+
+ +
+
lb/linblenddeint
+

Linear blend deinterlacing filter that deinterlaces the given block by +filtering all lines with a (1 2 1) filter. +

+
+
li/linipoldeint
+

Linear interpolating deinterlacing filter that deinterlaces the given block by +linearly interpolating every second line. +

+
+
ci/cubicipoldeint
+

Cubic interpolating deinterlacing filter deinterlaces the given block by +cubically interpolating every second line. +

+
+
md/mediandeint
+

Median deinterlacing filter that deinterlaces the given block by applying a +median filter to every second line. +

+
+
fd/ffmpegdeint
+

FFmpeg deinterlacing filter that deinterlaces the given block by filtering every +second line with a (-1 4 2 4 -1) filter. +

+
+
l5/lowpass5
+

Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given +block by filtering all lines with a (-1 2 6 2 -1) filter. +

+
+
fq/forceQuant[|quantizer]
+

Overrides the quantizer table from the input with the constant quantizer you +specify. +

+
quantizer
+

Quantizer to use +

+
+ +
+
de/default
+

Default pp filter combination (hb|a,vb|a,dr|a) +

+
+
fa/fast
+

Fast pp filter combination (h1|a,v1|a,dr|a) +

+
+
ac
+

High quality pp filter combination (ha|a|128|7,va|a,dr|a) +

+
+ + +
+

39.193.1 Examples

+ +
    +
  • Apply horizontal and vertical deblocking, deringing and automatic +brightness/contrast: +
    +
    pp=hb/vb/dr/al
    +
    + +
  • Apply default filters without brightness/contrast correction: +
    +
    pp=de/-al
    +
    + +
  • Apply default filters and temporal denoiser: +
    +
    pp=default/tmpnoise|1|2|3
    +
    + +
  • Apply deblocking on luminance only, and switch vertical deblocking on or off +automatically depending on available CPU time: +
    +
    pp=hb|y/vb|a
    +
    +
+ +
+
+
+

39.194 pp7

+

Apply Postprocessing filter 7. It is variant of the spp filter, +similar to spp = 6 with 7 point DCT, where only the center sample is +used after IDCT. +

+

The filter accepts the following options: +

+
+
qp
+

Force a constant quantization parameter. It accepts an integer in range +0 to 63. If not set, the filter will use the QP from the video stream +(if available). +

+
+
mode
+

Set thresholding mode. Available modes are: +

+
+
hard
+

Set hard thresholding. +

+
soft
+

Set soft thresholding (better de-ringing effect, but likely blurrier). +

+
medium
+

Set medium thresholding (good results, default). +

+
+
+
+ +
+
+

39.195 premultiply

+

Apply alpha premultiply effect to input video stream using first plane +of second stream as alpha. +

+

Both streams must have same dimensions and same pixel format. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
inplace
+

Do not require 2nd input for processing, instead use alpha plane from input stream. +

+
+ +
+
+

39.196 prewitt

+

Apply prewitt operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

39.196.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.197 pseudocolor

+ +

Alter frame colors in video with pseudocolors. +

+

This filter accepts the following options: +

+
+
c0
+

set pixel first component expression +

+
+
c1
+

set pixel second component expression +

+
+
c2
+

set pixel third component expression +

+
+
c3
+

set pixel fourth component expression, corresponds to the alpha component +

+
+
index, i
+

set component to use as base for altering colors +

+
+
preset, p
+

Pick one of built-in LUTs. By default is set to none. +

+

Available LUTs: +

+
magma
+
inferno
+
plasma
+
viridis
+
turbo
+
cividis
+
range1
+
range2
+
shadows
+
highlights
+
solar
+
nominal
+
preferred
+
total
+
spectral
+
+ +
+
opacity
+

Set opacity of output colors. Allowed range is from 0 to 1. +Default value is set to 1. +

+
+ +

Each of the expression options specifies the expression to use for computing +the lookup table for the corresponding pixel component values. +

+

The expressions can contain the following constants and functions: +

+
+
w
+
h
+

The input width and height. +

+
+
val
+

The input value for the pixel component. +

+
+
ymin, umin, vmin, amin
+

The minimum allowed component value. +

+
+
ymax, umax, vmax, amax
+

The maximum allowed component value. +

+
+ +

All expressions default to "val". +

+ +
+

39.197.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

39.197.2 Examples

+ +
    +
  • Change too high luma values to gradient: +
    +
    pseudocolor="'if(between(val,ymax,amax),lerp(ymin,ymax,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(umax,umin,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(vmin,vmax,(val-ymax)/(amax-ymax)),-1):-1'"
    +
    +
+ +
+
+
+

39.198 psnr

+ +

Obtain the average, maximum and minimum PSNR (Peak Signal to Noise +Ratio) between two input videos. +

+

This filter takes in input two input videos, the first input is +considered the "main" source and is passed unchanged to the +output. The second input is used as a "reference" video for computing +the PSNR. +

+

Both video inputs must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained average PSNR is printed through the logging system. +

+

The filter stores the accumulated MSE (mean squared error) of each +frame, and at the end of the processing it is averaged across all frames +equally, and the following formula is applied to obtain the PSNR: +

+
+
PSNR = 10*log10(MAX^2/MSE)
+
+ +

Where MAX is the average of the maximum values of each component of the +image. +

+

The description of the accepted parameters follows. +

+
+
stats_file, f
+

If specified the filter will use the named file to save the PSNR of +each individual frame. When filename equals "-" the data is sent to +standard output. +

+
+
stats_version
+

Specifies which version of the stats file format to use. Details of +each format are written below. +Default value is 1. +

+
+
stats_add_max
+

Determines whether the max value is output to the stats log. +Default value is 0. +Requires stats_version >= 2. If this is set and stats_version < 2, +the filter will return an error. +

+
+ +

This filter also supports the framesync options. +

+

The file printed if stats_file is selected, contains a sequence of +key/value pairs of the form key:value for each compared +couple of frames. +

+

If a stats_version greater than 1 is specified, a header line precedes +the list of per-frame-pair stats, with key value pairs following the frame +format with the following parameters: +

+
+
psnr_log_version
+

The version of the log file format. Will match stats_version. +

+
+
fields
+

A comma separated list of the per-frame-pair parameters included in +the log. +

+
+ +

A description of each shown per-frame-pair parameter follows: +

+
+
n
+

sequential number of the input frame, starting from 1 +

+
+
mse_avg
+

Mean Square Error pixel-by-pixel average difference of the compared +frames, averaged over all the image components. +

+
+
mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a
+

Mean Square Error pixel-by-pixel average difference of the compared +frames for the component specified by the suffix. +

+
+
psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a
+

Peak Signal to Noise ratio of the compared frames for the component +specified by the suffix. +

+
+
max_avg, max_y, max_u, max_v
+

Maximum allowed value for each channel, and average over all +channels. +

+
+ + +
+

39.198.1 Examples

+
    +
  • For example: +
    +
    movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
    +[main][ref] psnr="stats_file=stats.log" [out]
    +
    + +

    On this example the input file being processed is compared with the +reference file ref_movie.mpg. The PSNR of each individual frame +is stored in stats.log. +

    +
  • Another example with different containers: +
    +
    ffmpeg -i main.mpg -i ref.mkv -lavfi  "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]psnr" -f null -
    +
    +
+ +
+
+
+

39.199 pullup

+ +

Pulldown reversal (inverse telecine) filter, capable of handling mixed +hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive +content. +

+

The pullup filter is designed to take advantage of future context in making +its decisions. This filter is stateless in the sense that it does not lock +onto a pattern to follow, but it instead looks forward to the following +fields in order to identify matches and rebuild progressive frames. +

+

To produce content with an even framerate, insert the fps filter after +pullup, use fps=24000/1001 if the input frame rate is 29.97fps, +fps=24 for 30fps and the (rare) telecined 25fps input. +

+

The filter accepts the following options: +

+
+
jl
+
jr
+
jt
+
jb
+

These options set the amount of "junk" to ignore at the left, right, top, and +bottom of the image, respectively. Left and right are in units of 8 pixels, +while top and bottom are in units of 2 lines. +The default is 8 pixels on each side. +

+
+
sb
+

Set the strict breaks. Setting this option to 1 will reduce the chances of +filter generating an occasional mismatched frame, but it may also cause an +excessive number of frames to be dropped during high motion sequences. +Conversely, setting it to -1 will make filter match fields more easily. +This may help processing of video where there is slight blurring between +the fields, but may also cause there to be interlaced frames in the output. +Default value is 0. +

+
+
mp
+

Set the metric plane to use. It accepts the following values: +

+
l
+

Use luma plane. +

+
+
u
+

Use chroma blue plane. +

+
+
v
+

Use chroma red plane. +

+
+ +

This option may be set to use chroma plane instead of the default luma plane +for doing filter’s computations. This may improve accuracy on very clean +source material, but more likely will decrease accuracy, especially if there +is chroma noise (rainbow effect) or any grayscale video. +The main purpose of setting mp to a chroma plane is to reduce CPU +load and make pullup usable in realtime on slow machines. +

+
+ +

For best results (without duplicated frames in the output file) it is +necessary to change the output frame rate. For example, to inverse +telecine NTSC input: +

+
ffmpeg -i input -vf pullup -r 24000/1001 ...
+
+ +
+
+

39.200 qp

+ +

Change video quantization parameters (QP). +

+

The filter accepts the following option: +

+
+
qp
+

Set expression for quantization parameter. +

+
+ +

The expression is evaluated through the eval API and can contain, among others, +the following constants: +

+
+
known
+

1 if index is not 129, 0 otherwise. +

+
+
qp
+

Sequential index starting from -129 to 128. +

+
+ + +
+

39.200.1 Examples

+ +
    +
  • Some equation like: +
    +
    qp=2+2*sin(PI*qp)
    +
    +
+ +
+
+
+

39.201 random

+ +

Flush video frames from internal cache of frames into a random order. +No frame is discarded. +Inspired by frei0r nervous filter. +

+
+
frames
+

Set size in number of frames of internal cache, in range from 2 to +512. Default is 30. +

+
+
seed
+

Set seed for random number generator, must be an integer included between +0 and UINT32_MAX. If not specified, or if explicitly set to +less than 0, the filter will try to use a good random seed on a +best effort basis. +

+
+ +
+
+

39.202 readeia608

+ +

Read closed captioning (EIA-608) information from the top lines of a video frame. +

+

This filter adds frame metadata for lavfi.readeia608.X.cc and +lavfi.readeia608.X.line, where X is the number of the identified line +with EIA-608 data (starting from 0). A description of each metadata value follows: +

+
+
lavfi.readeia608.X.cc
+

The two bytes stored as EIA-608 data (printed in hexadecimal). +

+
+
lavfi.readeia608.X.line
+

The number of the line on which the EIA-608 data was identified and read. +

+
+ +

This filter accepts the following options: +

+
+
scan_min
+

Set the line to start scanning for EIA-608 data. Default is 0. +

+
+
scan_max
+

Set the line to end scanning for EIA-608 data. Default is 29. +

+
+
spw
+

Set the ratio of width reserved for sync code detection. +Default is 0.27. Allowed range is [0.1 - 0.7]. +

+
+
chp
+

Enable checking the parity bit. In the event of a parity error, the filter will output +0x00 for that character. Default is false. +

+
+
lp
+

Lowpass lines prior to further processing. Default is enabled. +

+
+ + +
+

39.202.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

39.202.2 Examples

+ +
    +
  • Output a csv with presentation time and the first two lines of identified EIA-608 captioning data. +
    +
    ffprobe -f lavfi -i movie=captioned_video.mov,readeia608 -show_entries frame=pts_time:frame_tags=lavfi.readeia608.0.cc,lavfi.readeia608.1.cc -of csv
    +
    +
+ +
+
+
+

39.203 readvitc

+ +

Read vertical interval timecode (VITC) information from the top lines of a +video frame. +

+

The filter adds frame metadata key lavfi.readvitc.tc_str with the +timecode value, if a valid timecode has been detected. Further metadata key +lavfi.readvitc.found is set to 0/1 depending on whether +timecode data has been found or not. +

+

This filter accepts the following options: +

+
+
scan_max
+

Set the maximum number of lines to scan for VITC data. If the value is set to +-1 the full video frame is scanned. Default is 45. +

+
+
thr_b
+

Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0], +default value is 0.2. The value must be equal or less than thr_w. +

+
+
thr_w
+

Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0], +default value is 0.6. The value must be equal or greater than thr_b. +

+
+ + +
+

39.203.1 Examples

+ +
    +
  • Detect and draw VITC data onto the video frame; if no valid VITC is detected, +draw --:--:--:-- as a placeholder: +
    +
    ffmpeg -i input.avi -filter:v 'readvitc,drawtext=fontfile=FreeMono.ttf:text=%{metadata\\:lavfi.readvitc.tc_str\\:--\\\\\\:--\\\\\\:--\\\\\\:--}:x=(w-tw)/2:y=400-ascent'
    +
    +
+ +
+
+
+

39.204 remap

+ +

Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream. +

+

Destination pixel at position (X, Y) will be picked from source (x, y) position +where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero +value for pixel will be used for destination pixel. +

+

Xmap and Ymap input video streams must be of same dimensions. Output video stream +will have Xmap/Ymap video stream dimensions. +Xmap and Ymap input video streams are 16bit depth, single channel. +

+
+
format
+

Specify pixel format of output from this filter. Can be color or gray. +Default is color. +

+
+
fill
+

Specify the color of the unmapped pixels. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Default color is black. +

+
+ +
+
+

39.205 removegrain

+ +

The removegrain filter is a spatial denoiser for progressive video. +

+
+
m0
+

Set mode for the first plane. +

+
+
m1
+

Set mode for the second plane. +

+
+
m2
+

Set mode for the third plane. +

+
+
m3
+

Set mode for the fourth plane. +

+
+ +

Range of mode is from 0 to 24. Description of each mode follows: +

+
+
0
+

Leave input plane unchanged. Default. +

+
+
1
+

Clips the pixel with the minimum and maximum of the 8 neighbour pixels. +

+
+
2
+

Clips the pixel with the second minimum and maximum of the 8 neighbour pixels. +

+
+
3
+

Clips the pixel with the third minimum and maximum of the 8 neighbour pixels. +

+
+
4
+

Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels. +This is equivalent to a median filter. +

+
+
5
+

Line-sensitive clipping giving the minimal change. +

+
+
6
+

Line-sensitive clipping, intermediate. +

+
+
7
+

Line-sensitive clipping, intermediate. +

+
+
8
+

Line-sensitive clipping, intermediate. +

+
+
9
+

Line-sensitive clipping on a line where the neighbours pixels are the closest. +

+
+
10
+

Replaces the target pixel with the closest neighbour. +

+
+
11
+

[1 2 1] horizontal and vertical kernel blur. +

+
+
12
+

Same as mode 11. +

+
+
13
+

Bob mode, interpolates top field from the line where the neighbours +pixels are the closest. +

+
+
14
+

Bob mode, interpolates bottom field from the line where the neighbours +pixels are the closest. +

+
+
15
+

Bob mode, interpolates top field. Same as 13 but with a more complicated +interpolation formula. +

+
+
16
+

Bob mode, interpolates bottom field. Same as 14 but with a more complicated +interpolation formula. +

+
+
17
+

Clips the pixel with the minimum and maximum of respectively the maximum and +minimum of each pair of opposite neighbour pixels. +

+
+
18
+

Line-sensitive clipping using opposite neighbours whose greatest distance from +the current pixel is minimal. +

+
+
19
+

Replaces the pixel with the average of its 8 neighbours. +

+
+
20
+

Averages the 9 pixels ([1 1 1] horizontal and vertical blur). +

+
+
21
+

Clips pixels using the averages of opposite neighbour. +

+
+
22
+

Same as mode 21 but simpler and faster. +

+
+
23
+

Small edge and halo removal, but reputed useless. +

+
+
24
+

Similar as 23. +

+
+ +
+ +
+

39.207 repeatfields

+ +

This filter uses the repeat_field flag from the Video ES headers and hard repeats +fields based on its value. +

+
+
+

39.208 reverse

+ +

Reverse a video clip. +

+

Warning: This filter requires memory to buffer the entire clip, so trimming +is suggested. +

+ +
+

39.208.1 Examples

+ +
    +
  • Take the first 5 seconds of a clip, and reverse it. +
    +
    trim=end=5,reverse
    +
    +
+ +
+
+
+

39.209 rgbashift

+

Shift R/G/B/A pixels horizontally and/or vertically. +

+

The filter accepts the following options: +

+
rh
+

Set amount to shift red horizontally. +

+
rv
+

Set amount to shift red vertically. +

+
gh
+

Set amount to shift green horizontally. +

+
gv
+

Set amount to shift green vertically. +

+
bh
+

Set amount to shift blue horizontally. +

+
bv
+

Set amount to shift blue vertically. +

+
ah
+

Set amount to shift alpha horizontally. +

+
av
+

Set amount to shift alpha vertically. +

+
edge
+

Set edge mode, can be smear, default, or warp. +

+
+ + +
+

39.209.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.210 roberts

+

Apply roberts cross operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

39.210.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.211 rotate

+ +

Rotate video by an arbitrary angle expressed in radians. +

+

The filter accepts the following options: +

+

A description of the optional parameters follows. +

+
angle, a
+

Set an expression for the angle by which to rotate the input video +clockwise, expressed as a number of radians. A negative value will +result in a counter-clockwise rotation. By default it is set to "0". +

+

This expression is evaluated for each frame. +

+
+
out_w, ow
+

Set the output width expression, default value is "iw". +This expression is evaluated just once during configuration. +

+
+
out_h, oh
+

Set the output height expression, default value is "ih". +This expression is evaluated just once during configuration. +

+
+
bilinear
+

Enable bilinear interpolation if set to 1, a value of 0 disables +it. Default value is 1. +

+
+
fillcolor, c
+

Set the color used to fill the output area not covered by the rotated +image. For the general syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +If the special value "none" is selected then no +background is printed (useful for example if the background is never shown). +

+

Default value is "black". +

+
+ +

The expressions for the angle and the output size can contain the +following constants and functions: +

+
+
n
+

sequential number of the input frame, starting from 0. It is always NAN +before the first frame is filtered. +

+
+
t
+

time in seconds of the input frame, it is set to 0 when the filter is +configured. It is always NAN before the first frame is filtered. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
in_w, iw
+
in_h, ih
+

the input video width and height +

+
+
out_w, ow
+
out_h, oh
+

the output width and height, that is the size of the padded area as +specified by the width and height expressions +

+
+
rotw(a)
+
roth(a)
+

the minimal width/height required for completely containing the input +video rotated by a radians. +

+

These are only available when computing the out_w and +out_h expressions. +

+
+ + +
+

39.211.1 Examples

+ +
    +
  • Rotate the input by PI/6 radians clockwise: +
    +
    rotate=PI/6
    +
    + +
  • Rotate the input by PI/6 radians counter-clockwise: +
    +
    rotate=-PI/6
    +
    + +
  • Rotate the input by 45 degrees clockwise: +
    +
    rotate=45*PI/180
    +
    + +
  • Apply a constant rotation with period T, starting from an angle of PI/3: +
    +
    rotate=PI/3+2*PI*t/T
    +
    + +
  • Make the input video rotation oscillating with a period of T +seconds and an amplitude of A radians: +
    +
    rotate=A*sin(2*PI/T*t)
    +
    + +
  • Rotate the video, output size is chosen so that the whole rotating +input video is always completely contained in the output: +
    +
    rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
    +
    + +
  • Rotate the video, reduce the output size so that no background is ever +shown: +
    +
    rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
    +
    +
+ +
+
+

39.211.2 Commands

+ +

The filter supports the following commands: +

+
+
a, angle
+

Set the angle expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

39.212 sab

+ +

Apply Shape Adaptive Blur. +

+

The filter accepts the following options: +

+
+
luma_radius, lr
+

Set luma blur filter strength, must be a value in range 0.1-4.0, default +value is 1.0. A greater value will result in a more blurred image, and +in slower processing. +

+
+
luma_pre_filter_radius, lpfr
+

Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default +value is 1.0. +

+
+
luma_strength, ls
+

Set luma maximum difference between pixels to still be considered, must +be a value in the 0.1-100.0 range, default value is 1.0. +

+
+
chroma_radius, cr
+

Set chroma blur filter strength, must be a value in range -0.9-4.0. A +greater value will result in a more blurred image, and in slower +processing. +

+
+
chroma_pre_filter_radius, cpfr
+

Set chroma pre-filter radius, must be a value in the -0.9-2.0 range. +

+
+
chroma_strength, cs
+

Set chroma maximum difference between pixels to still be considered, +must be a value in the -0.9-100.0 range. +

+
+ +

Each chroma option value, if not explicitly specified, is set to the +corresponding luma option value. +

+
+
+

39.213 scale

+ +

Scale (resize) the input video, using the libswscale library. +

+

The scale filter forces the output display aspect ratio to be the same +of the input, by changing the output sample aspect ratio. +

+

If the input image format is different from the format requested by +the next filter, the scale filter will convert the input to the +requested format. +

+ +
+

39.213.1 Options

+

The filter accepts the following options, or any of the options +supported by the libswscale scaler. +

+

See (ffmpeg-scaler)the ffmpeg-scaler manual for +the complete list of scaler options. +

+
+
width, w
+
height, h
+

Set the output video dimension expression. Default value is the input +dimension. +

+

If the width or w value is 0, the input width is used for +the output. If the height or h value is 0, the input height +is used for the output. +

+

If one and only one of the values is -n with n >= 1, the scale filter +will use a value that maintains the aspect ratio of the input image, +calculated from the other specified dimension. After that it will, +however, make sure that the calculated dimension is divisible by n and +adjust the value if necessary. +

+

If both values are -n with n >= 1, the behavior will be identical to +both values being set to 0 as previously detailed. +

+

See below for the list of accepted constants for use in the dimension +expression. +

+
+
eval
+

Specify when to evaluate width and height expression. It accepts the following values: +

+
+
init
+

Only evaluate expressions once during the filter initialization or when a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+
+ +

Default value is ‘init’. +

+ +
+
interl
+

Set the interlacing mode. It accepts the following values: +

+
+
1
+

Force interlaced aware scaling. +

+
+
0
+

Do not apply interlaced scaling. +

+
+
-1
+

Select interlaced aware scaling depending on whether the source frames +are flagged as interlaced or not. +

+
+ +

Default value is ‘0’. +

+
+
flags
+

Set libswscale scaling flags. See +(ffmpeg-scaler)the ffmpeg-scaler manual for the +complete list of values. If not explicitly specified the filter applies +the default flags. +

+ +
+
param0, param1
+

Set libswscale input parameters for scaling algorithms that need them. See +(ffmpeg-scaler)the ffmpeg-scaler manual for the +complete documentation. If not explicitly specified the filter applies +empty parameters. +

+ + +
+
size, s
+

Set the video size. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
in_color_matrix
+
out_color_matrix
+

Set in/output YCbCr color space type. +

+

This allows the autodetected value to be overridden as well as allows forcing +a specific value used for the output and encoder. +

+

If not specified, the color space type depends on the pixel format. +

+

Possible values: +

+
+
auto
+

Choose automatically. +

+
+
bt709
+

Format conforming to International Telecommunication Union (ITU) +Recommendation BT.709. +

+
+
fcc
+

Set color space conforming to the United States Federal Communications +Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a). +

+
+
bt601
+
bt470
+
smpte170m
+

Set color space conforming to: +

+
    +
  • ITU Radiocommunication Sector (ITU-R) Recommendation BT.601 + +
  • ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G + +
  • Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004 + +
+ +
+
smpte240m
+

Set color space conforming to SMPTE ST 240:1999. +

+
+
bt2020
+

Set color space conforming to ITU-R BT.2020 non-constant luminance system. +

+
+ +
+
in_range
+
out_range
+

Set in/output YCbCr sample range. +

+

This allows the autodetected value to be overridden as well as allows forcing +a specific value used for the output and encoder. If not specified, the +range depends on the pixel format. Possible values: +

+
+
auto/unknown
+

Choose automatically. +

+
+
jpeg/full/pc
+

Set full range (0-255 in case of 8-bit luma). +

+
+
mpeg/limited/tv
+

Set "MPEG" range (16-235 in case of 8-bit luma). +

+
+ +
+
force_original_aspect_ratio
+

Enable decreasing or increasing output video width or height if necessary to +keep the original aspect ratio. Possible values: +

+
+
disable
+

Scale the video as specified and disable this feature. +

+
+
decrease
+

The output video dimensions will automatically be decreased if needed. +

+
+
increase
+

The output video dimensions will automatically be increased if needed. +

+
+
+ +

One useful instance of this option is that when you know a specific device’s +maximum allowed resolution, you can use this to limit the output video to +that, while retaining the aspect ratio. For example, device A allows +1280x720 playback, and your video is 1920x800. Using this option (set it to +decrease) and specifying 1280x720 to the command line makes the output +1280x533. +

+

Please note that this is a different thing than specifying -1 for w +or h, you still need to specify the output resolution for this option +to work. +

+
+
force_divisible_by
+

Ensures that both the output dimensions, width and height, are divisible by the +given integer when used together with force_original_aspect_ratio. This +works similar to using -n in the w and h options. +

+

This option respects the value set for force_original_aspect_ratio, +increasing or decreasing the resolution accordingly. The video’s aspect ratio +may be slightly modified. +

+

This option can be handy if you need to have a video fit within or exceed +a defined resolution using force_original_aspect_ratio but also have +encoder restrictions on width or height divisibility. +

+
+
+ +

The values of the w and h options are expressions +containing the following constants: +

+
+
in_w
+
in_h
+

The input width and height +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (scaled) width and height +

+
+
ow
+
oh
+

These are the same as out_w and out_h +

+
+
a
+

The same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

The input display aspect ratio. Calculated from (iw / ih) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical input chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
ohsub
+
ovsub
+

horizontal and vertical output chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +Only available with eval=frame. +

+
+
t
+

The presentation timestamp of the input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
pos
+

The position (byte offset) of the frame in the input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +Deprecated, do not use. +

+
+ +
+
+

39.213.2 Examples

+ +
    +
  • Scale the input video to a size of 200x100 +
    +
    scale=w=200:h=100
    +
    + +

    This is equivalent to: +

    +
    scale=200:100
    +
    + +

    or: +

    +
    scale=200x100
    +
    + +
  • Specify a size abbreviation for the output size: +
    +
    scale=qcif
    +
    + +

    which can also be written as: +

    +
    scale=size=qcif
    +
    + +
  • Scale the input to 2x: +
    +
    scale=w=2*iw:h=2*ih
    +
    + +
  • The above is the same as: +
    +
    scale=2*in_w:2*in_h
    +
    + +
  • Scale the input to 2x with forced interlaced scaling: +
    +
    scale=2*iw:2*ih:interl=1
    +
    + +
  • Scale the input to half size: +
    +
    scale=w=iw/2:h=ih/2
    +
    + +
  • Increase the width, and set the height to the same size: +
    +
    scale=3/2*iw:ow
    +
    + +
  • Seek Greek harmony: +
    +
    scale=iw:1/PHI*iw
    +scale=ih*PHI:ih
    +
    + +
  • Increase the height, and set the width to 3/2 of the height: +
    +
    scale=w=3/2*oh:h=3/5*ih
    +
    + +
  • Increase the size, making the size a multiple of the chroma +subsample values: +
    +
    scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
    +
    + +
  • Increase the width to a maximum of 500 pixels, +keeping the same aspect ratio as the input: +
    +
    scale=w='min(500\, iw*3/2):h=-1'
    +
    + +
  • Make pixels square by combining scale and setsar: +
    +
    scale='trunc(ih*dar):ih',setsar=1/1
    +
    + +
  • Make pixels square by combining scale and setsar, +making sure the resulting resolution is even (required by some codecs): +
    +
    scale='trunc(ih*dar/2)*2:trunc(ih/2)*2',setsar=1/1
    +
    +
+ +
+
+

39.213.3 Commands

+ +

This filter supports the following commands: +

+
width, w
+
height, h
+

Set the output video dimension expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

39.214 scale_cuda

+ +

Scale (resize) and convert (pixel format) the input video, using accelerated CUDA kernels. +Setting the output width and height works in the same way as for the scale filter. +

+

The filter accepts the following options: +

+
w
+
h
+

Set the output video dimension expression. Default value is the input dimension. +

+

Allows for the same expressions as the scale filter. +

+
+
interp_algo
+

Sets the algorithm used for scaling: +

+
+
nearest
+

Nearest neighbour +

+

Used by default if input parameters match the desired output. +

+
+
bilinear
+

Bilinear +

+
+
bicubic
+

Bicubic +

+

This is the default. +

+
+
lanczos
+

Lanczos +

+
+
+ +
+
format
+

Controls the output pixel format. By default, or if none is specified, the input +pixel format is used. +

+

The filter does not support converting between YUV and RGB pixel formats. +

+
+
passthrough
+

If set to 0, every frame is processed, even if no conversion is neccesary. +This mode can be useful to use the filter as a buffer for a downstream +frame-consumer that exhausts the limited decoder frame pool. +

+

If set to 1, frames are passed through as-is if they match the desired output +parameters. This is the default behaviour. +

+
+
param
+

Algorithm-Specific parameter. +

+

Affects the curves of the bicubic algorithm. +

+
+
force_original_aspect_ratio
+
force_divisible_by
+

Work the same as the identical scale filter options. +

+
+
+ + +
+

39.214.1 Examples

+ +
    +
  • Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p. +
    +
    scale_cuda=-2:720:format=yuv420p
    +
    + +
  • Upscale to 4K using nearest neighbour algorithm. +
    +
    scale_cuda=4096:2160:interp_algo=nearest
    +
    + +
  • Don’t do any conversion or scaling, but copy all input frames into newly allocated ones. +This can be useful to deal with a filter and encode chain that otherwise exhausts the +decoders frame pool. +
    +
    scale_cuda=passthrough=0
    +
    +
+ +
+
+
+

39.215 scale_npp

+ +

Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel +format conversion on CUDA video frames. Setting the output width and height +works in the same way as for the scale filter. +

+

The following additional options are accepted: +

+
format
+

The pixel format of the output CUDA frames. If set to the string "same" (the +default), the input format will be kept. Note that automatic format negotiation +and conversion is not yet supported for hardware frames +

+
+
interp_algo
+

The interpolation algorithm used for resizing. One of the following: +

+
nn
+

Nearest neighbour. +

+
+
linear
+
cubic
+
cubic2p_bspline
+

2-parameter cubic (B=1, C=0) +

+
+
cubic2p_catmullrom
+

2-parameter cubic (B=0, C=1/2) +

+
+
cubic2p_b05c03
+

2-parameter cubic (B=1/2, C=3/10) +

+
+
super
+

Supersampling +

+
+
lanczos
+
+ +
+
force_original_aspect_ratio
+

Enable decreasing or increasing output video width or height if necessary to +keep the original aspect ratio. Possible values: +

+
+
disable
+

Scale the video as specified and disable this feature. +

+
+
decrease
+

The output video dimensions will automatically be decreased if needed. +

+
+
increase
+

The output video dimensions will automatically be increased if needed. +

+
+
+ +

One useful instance of this option is that when you know a specific device’s +maximum allowed resolution, you can use this to limit the output video to +that, while retaining the aspect ratio. For example, device A allows +1280x720 playback, and your video is 1920x800. Using this option (set it to +decrease) and specifying 1280x720 to the command line makes the output +1280x533. +

+

Please note that this is a different thing than specifying -1 for w +or h, you still need to specify the output resolution for this option +to work. +

+
+
force_divisible_by
+

Ensures that both the output dimensions, width and height, are divisible by the +given integer when used together with force_original_aspect_ratio. This +works similar to using -n in the w and h options. +

+

This option respects the value set for force_original_aspect_ratio, +increasing or decreasing the resolution accordingly. The video’s aspect ratio +may be slightly modified. +

+

This option can be handy if you need to have a video fit within or exceed +a defined resolution using force_original_aspect_ratio but also have +encoder restrictions on width or height divisibility. +

+
+
eval
+

Specify when to evaluate width and height expression. It accepts the following values: +

+
+
init
+

Only evaluate expressions once during the filter initialization or when a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+
+ +
+
+ +

The values of the w and h options are expressions +containing the following constants: +

+
+
in_w
+
in_h
+

The input width and height +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (scaled) width and height +

+
+
ow
+
oh
+

These are the same as out_w and out_h +

+
+
a
+

The same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

The input display aspect ratio. Calculated from (iw / ih) * sar. +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +Only available with eval=frame. +

+
+
t
+

The presentation timestamp of the input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
pos
+

The position (byte offset) of the frame in the input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +Deprecated, do not use. +

+
+ +
+
+

39.216 scale2ref

+ +

Scale (resize) the input video, based on a reference video. +

+

See the scale filter for available options, scale2ref supports the same but +uses the reference video instead of the main input as basis. scale2ref also +supports the following additional constants for the w and +h options: +

+
+
main_w
+
main_h
+

The main input video’s width and height +

+
+
main_a
+

The same as main_w / main_h +

+
+
main_sar
+

The main input video’s sample aspect ratio +

+
+
main_dar, mdar
+

The main input video’s display aspect ratio. Calculated from +(main_w / main_h) * main_sar. +

+
+
main_hsub
+
main_vsub
+

The main input video’s horizontal and vertical chroma subsample values. +For example for the pixel format "yuv422p" hsub is 2 and vsub +is 1. +

+
+
main_n
+

The (sequential) number of the main input frame, starting from 0. +Only available with eval=frame. +

+
+
main_t
+

The presentation timestamp of the main input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
main_pos
+

The position (byte offset) of the frame in the main input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +

+
+ + +
+

39.216.1 Examples

+ +
    +
  • Scale a subtitle stream (b) to match the main video (a) in size before overlaying +
    +
    'scale2ref[b][a];[a][b]overlay'
    +
    + +
  • Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio. +
    +
    [logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]
    +
    +
+ +
+
+

39.216.2 Commands

+ +

This filter supports the following commands: +

+
width, w
+
height, h
+

Set the output video dimension expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

39.217 scale2ref_npp

+ +

Use the NVIDIA Performance Primitives (libnpp) to scale (resize) the input +video, based on a reference video. +

+

See the scale_npp filter for available options, scale2ref_npp supports the same +but uses the reference video instead of the main input as basis. scale2ref_npp +also supports the following additional constants for the w and +h options: +

+
+
main_w
+
main_h
+

The main input video’s width and height +

+
+
main_a
+

The same as main_w / main_h +

+
+
main_sar
+

The main input video’s sample aspect ratio +

+
+
main_dar, mdar
+

The main input video’s display aspect ratio. Calculated from +(main_w / main_h) * main_sar. +

+
+
main_n
+

The (sequential) number of the main input frame, starting from 0. +Only available with eval=frame. +

+
+
main_t
+

The presentation timestamp of the main input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
main_pos
+

The position (byte offset) of the frame in the main input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +

+
+ + +
+

39.217.1 Examples

+ +
    +
  • Scale a subtitle stream (b) to match the main video (a) in size before overlaying +
    +
    'scale2ref_npp[b][a];[a][b]overlay_cuda'
    +
    + +
  • Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio. +
    +
    [logo-in][video-in]scale2ref_npp=w=oh*mdar:h=ih/10[logo-out][video-out]
    +
    +
+ +
+
+
+

39.218 scharr

+

Apply scharr operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

39.218.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.219 scroll

+

Scroll input video horizontally and/or vertically by constant speed. +

+

The filter accepts the following options: +

+
horizontal, h
+

Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1. +Negative values changes scrolling direction. +

+
+
vertical, v
+

Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1. +Negative values changes scrolling direction. +

+
+
hpos
+

Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1. +

+
+
vpos
+

Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1. +

+
+ + +
+

39.219.1 Commands

+ +

This filter supports the following commands: +

+
horizontal, h
+

Set the horizontal scrolling speed. +

+
vertical, v
+

Set the vertical scrolling speed. +

+
+ +
+
+
+

39.220 scdet

+ +

Detect video scene change. +

+

This filter sets frame metadata with mafd between frame, the scene score, and +forward the frame to the next filter, so they can use these metadata to detect +scene change or others. +

+

In addition, this filter logs a message and sets frame metadata when it detects +a scene change by threshold. +

+

lavfi.scd.mafd metadata keys are set with mafd for every frame. +

+

lavfi.scd.score metadata keys are set with scene change score for every frame +to detect scene change. +

+

lavfi.scd.time metadata keys are set with current filtered frame time which +detect scene change with threshold. +

+

The filter accepts the following options: +

+
+
threshold, t
+

Set the scene change detection threshold as a percentage of maximum change. Good +values are in the [8.0, 14.0] range. The range for threshold is +[0., 100.]. +

+

Default value is 10.. +

+
+
sc_pass, s
+

Set the flag to pass scene change frames to the next filter. Default value is 0 +You can enable it if you want to get snapshot of scene change frames only. +

+
+ +
+
+

39.221 selectivecolor

+ +

Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such +as "reds", "yellows", "greens", "cyans", ...). The adjustment range is defined +by the "purity" of the color (that is, how saturated it already is). +

+

This filter is similar to the Adobe Photoshop Selective Color tool. +

+

The filter accepts the following options: +

+
+
correction_method
+

Select color correction method. +

+

Available values are: +

+
absolute
+

Specified adjustments are applied "as-is" (added/subtracted to original pixel +component value). +

+
relative
+

Specified adjustments are relative to the original component value. +

+
+

Default is absolute. +

+
reds
+

Adjustments for red pixels (pixels where the red component is the maximum) +

+
yellows
+

Adjustments for yellow pixels (pixels where the blue component is the minimum) +

+
greens
+

Adjustments for green pixels (pixels where the green component is the maximum) +

+
cyans
+

Adjustments for cyan pixels (pixels where the red component is the minimum) +

+
blues
+

Adjustments for blue pixels (pixels where the blue component is the maximum) +

+
magentas
+

Adjustments for magenta pixels (pixels where the green component is the minimum) +

+
whites
+

Adjustments for white pixels (pixels where all components are greater than 128) +

+
neutrals
+

Adjustments for all pixels except pure black and pure white +

+
blacks
+

Adjustments for black pixels (pixels where all components are lesser than 128) +

+
psfile
+

Specify a Photoshop selective color file (.asv) to import the settings from. +

+
+ +

All the adjustment settings (reds, yellows, ...) accept up to +4 space separated floating point adjustment values in the [-1,1] range, +respectively to adjust the amount of cyan, magenta, yellow and black for the +pixels of its range. +

+ +
+

39.221.1 Examples

+ +
    +
  • Increase cyan by 50% and reduce yellow by 33% in every green areas, and +increase magenta by 27% in blue areas: +
    +
    selectivecolor=greens=.5 0 -.33 0:blues=0 .27
    +
    + +
  • Use a Photoshop selective color preset: +
    +
    selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
    +
    +
+ +
+
+
+

39.222 separatefields

+ +

The separatefields takes a frame-based video input and splits +each frame into its components fields, producing a new half height clip +with twice the frame rate and twice the frame count. +

+

This filter use field-dominance information in frame to decide which +of each pair of fields to place first in the output. +If it gets it wrong use setfield filter before separatefields filter. +

+
+
+

39.223 setdar, setsar

+ +

The setdar filter sets the Display Aspect Ratio for the filter +output video. +

+

This is done by changing the specified Sample (aka Pixel) Aspect +Ratio, according to the following equation: +

+
DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR
+
+ +

Keep in mind that the setdar filter does not modify the pixel +dimensions of the video frame. Also, the display aspect ratio set by +this filter may be changed by later filters in the filterchain, +e.g. in case of scaling or if another "setdar" or a "setsar" filter is +applied. +

+

The setsar filter sets the Sample (aka Pixel) Aspect Ratio for +the filter output video. +

+

Note that as a consequence of the application of this filter, the +output display aspect ratio will change according to the equation +above. +

+

Keep in mind that the sample aspect ratio set by the setsar +filter may be changed by later filters in the filterchain, e.g. if +another "setsar" or a "setdar" filter is applied. +

+

It accepts the following parameters: +

+
+
r, ratio, dar (setdar only), sar (setsar only)
+

Set the aspect ratio used by the filter. +

+

The parameter can be a floating point number string, or an expression. If the +parameter is not specified, the value "0" is assumed, meaning that the same +input value is used. +

+
+
max
+

Set the maximum integer value to use for expressing numerator and +denominator when reducing the expressed aspect ratio to a rational. +Default value is 100. +

+
+
+ +

The parameter sar is an expression containing the following constants: +

+
+
w, h
+

The input width and height. +

+
+
a
+

Same as w / h. +

+
+
sar
+

The input sample aspect ratio. +

+
+
dar
+

The input display aspect ratio. It is the same as +(w / h) * sar. +

+
+
hsub, vsub
+

Horizontal and vertical chroma subsample values. For example, for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ + +
+

39.223.1 Examples

+ +
    +
  • To change the display aspect ratio to 16:9, specify one of the following: +
    +
    setdar=dar=1.77777
    +setdar=dar=16/9
    +
    + +
  • To change the sample aspect ratio to 10:11, specify: +
    +
    setsar=sar=10/11
    +
    + +
  • To set a display aspect ratio of 16:9, and specify a maximum integer value of +1000 in the aspect ratio reduction, use the command: +
    +
    setdar=ratio=16/9:max=1000
    +
    + +
+ +
+
+
+

39.224 setfield

+ +

Force field for the output video frame. +

+

The setfield filter marks the interlace type field for the +output frames. It does not change the input frame, but only sets the +corresponding property, which affects how the frame is treated by +following filters (e.g. fieldorder or yadif). +

+

The filter accepts the following options: +

+
+
mode
+

Available values are: +

+
+
auto
+

Keep the same field property. +

+
+
bff
+

Mark the frame as bottom-field-first. +

+
+
tff
+

Mark the frame as top-field-first. +

+
+
prog
+

Mark the frame as progressive. +

+
+
+
+ +
+
+

39.225 setparams

+ +

Force frame parameter for the output video frame. +

+

The setparams filter marks interlace and color range for the +output frames. It does not change the input frame, but only sets the +corresponding property, which affects how the frame is treated by +filters/encoders. +

+
+
field_mode
+

Available values are: +

+
+
auto
+

Keep the same field property (default). +

+
+
bff
+

Mark the frame as bottom-field-first. +

+
+
tff
+

Mark the frame as top-field-first. +

+
+
prog
+

Mark the frame as progressive. +

+
+ +
+
range
+

Available values are: +

+
+
auto
+

Keep the same color range property (default). +

+
+
unspecified, unknown
+

Mark the frame as unspecified color range. +

+
+
limited, tv, mpeg
+

Mark the frame as limited range. +

+
+
full, pc, jpeg
+

Mark the frame as full range. +

+
+ +
+
color_primaries
+

Set the color primaries. +Available values are: +

+
+
auto
+

Keep the same color primaries property (default). +

+
+
bt709
+
unknown
+
bt470m
+
bt470bg
+
smpte170m
+
smpte240m
+
film
+
bt2020
+
smpte428
+
smpte431
+
smpte432
+
jedec-p22
+
+ +
+
color_trc
+

Set the color transfer. +Available values are: +

+
+
auto
+

Keep the same color trc property (default). +

+
+
bt709
+
unknown
+
bt470m
+
bt470bg
+
smpte170m
+
smpte240m
+
linear
+
log100
+
log316
+
iec61966-2-4
+
bt1361e
+
iec61966-2-1
+
bt2020-10
+
bt2020-12
+
smpte2084
+
smpte428
+
arib-std-b67
+
+ +
+
colorspace
+

Set the colorspace. +Available values are: +

+
+
auto
+

Keep the same colorspace property (default). +

+
+
gbr
+
bt709
+
unknown
+
fcc
+
bt470bg
+
smpte170m
+
smpte240m
+
ycgco
+
bt2020nc
+
bt2020c
+
smpte2085
+
chroma-derived-nc
+
chroma-derived-c
+
ictcp
+
+
+
+ +
+
+

39.226 sharpen_npp

+

Use the NVIDIA Performance Primitives (libnpp) to perform image sharpening with +border control. +

+

The following additional options are accepted: +

+
border_type
+

Type of sampling to be used ad frame borders. One of the following: +

+
replicate
+

Replicate pixel values. +

+
+
+
+
+ +
+
+

39.227 shear

+

Apply shear transform to input video. +

+

This filter supports the following options: +

+
+
shx
+

Shear factor in X-direction. Default value is 0. +Allowed range is from -2 to 2. +

+
+
shy
+

Shear factor in Y-direction. Default value is 0. +Allowed range is from -2 to 2. +

+
+
fillcolor, c
+

Set the color used to fill the output area not covered by the transformed +video. For the general syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +If the special value "none" is selected then no +background is printed (useful for example if the background is never shown). +

+

Default value is "black". +

+
+
interp
+

Set interpolation type. Can be bilinear or nearest. Default is bilinear. +

+
+ + +
+

39.227.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.228 showinfo

+ +

Show a line containing various information for each input video frame. +The input video is not modified. +

+

This filter supports the following options: +

+
+
checksum
+

Calculate checksums of each plane. By default enabled. +

+
+ +

The shown line contains a sequence of key/value pairs of the form +key:value. +

+

The following values are shown in the output: +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +

+
+
pts
+

The Presentation TimeStamp of the input frame, expressed as a number of +time base units. The time base unit depends on the filter input pad. +

+
+
pts_time
+

The Presentation TimeStamp of the input frame, expressed as a number of +seconds. +

+
+
fmt
+

The pixel format name. +

+
+
sar
+

The sample aspect ratio of the input frame, expressed in the form +num/den. +

+
+
s
+

The size of the input frame. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
i
+

The type of interlaced mode ("P" for "progressive", "T" for top field first, "B" +for bottom field first). +

+
+
iskey
+

This is 1 if the frame is a key frame, 0 otherwise. +

+
+
type
+

The picture type of the input frame ("I" for an I-frame, "P" for a +P-frame, "B" for a B-frame, or "?" for an unknown type). +Also refer to the documentation of the AVPictureType enum and of +the av_get_picture_type_char function defined in +libavutil/avutil.h. +

+
+
checksum
+

The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame. +

+
+
plane_checksum
+

The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame, +expressed in the form "[c0 c1 c2 c3]". +

+
+
mean
+

The mean value of pixels in each plane of the input frame, expressed in the form +"[mean0 mean1 mean2 mean3]". +

+
+
stdev
+

The standard deviation of pixel values in each plane of the input frame, expressed +in the form "[stdev0 stdev1 stdev2 stdev3]". +

+
+
+ +
+
+

39.229 showpalette

+ +

Displays the 256 colors palette of each frame. This filter is only relevant for +pal8 pixel format frames. +

+

It accepts the following option: +

+
+
s
+

Set the size of the box used to represent one palette color entry. Default is +30 (for a 30x30 pixel box). +

+
+ +
+
+

39.230 shuffleframes

+ +

Reorder and/or duplicate and/or drop video frames. +

+

It accepts the following parameters: +

+
+
mapping
+

Set the destination indexes of input frames. +This is space or ’|’ separated list of indexes that maps input frames to output +frames. Number of indexes also sets maximal value that each index may have. +’-1’ index have special meaning and that is to drop frame. +

+
+ +

The first frame has the index 0. The default is to keep the input unchanged. +

+ +
+

39.230.1 Examples

+ +
    +
  • Swap second and third frame of every three frames of the input: +
    +
    ffmpeg -i INPUT -vf "shuffleframes=0 2 1" OUTPUT
    +
    + +
  • Swap 10th and 1st frame of every ten frames of the input: +
    +
    ffmpeg -i INPUT -vf "shuffleframes=9 1 2 3 4 5 6 7 8 0" OUTPUT
    +
    +
+ +
+
+
+

39.231 shufflepixels

+ +

Reorder pixels in video frames. +

+

This filter accepts the following options: +

+
+
direction, d
+

Set shuffle direction. Can be forward or inverse direction. +Default direction is forward. +

+
+
mode, m
+

Set shuffle mode. Can be horizontal, vertical or block mode. +

+
+
width, w
+
height, h
+

Set shuffle block_size. In case of horizontal shuffle mode only width +part of size is used, and in case of vertical shuffle mode only height +part of size is used. +

+
+
seed, s
+

Set random seed used with shuffling pixels. Mainly useful to set to be able +to reverse filtering process to get original input. +For example, to reverse forward shuffle you need to use same parameters +and exact same seed and to set direction to inverse. +

+
+ +
+
+

39.232 shuffleplanes

+ +

Reorder and/or duplicate video planes. +

+

It accepts the following parameters: +

+
+
map0
+

The index of the input plane to be used as the first output plane. +

+
+
map1
+

The index of the input plane to be used as the second output plane. +

+
+
map2
+

The index of the input plane to be used as the third output plane. +

+
+
map3
+

The index of the input plane to be used as the fourth output plane. +

+
+
+ +

The first plane has the index 0. The default is to keep the input unchanged. +

+ +
+

39.232.1 Examples

+ +
    +
  • Swap the second and third planes of the input: +
    +
    ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
    +
    +
+ +
+
+
+

39.233 signalstats

+

Evaluate various visual metrics that assist in determining issues associated +with the digitization of analog video media. +

+

By default the filter will log these metadata values: +

+
+
YMIN
+

Display the minimal Y value contained within the input frame. Expressed in +range of [0-255]. +

+
+
YLOW
+

Display the Y value at the 10% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
YAVG
+

Display the average Y value within the input frame. Expressed in range of +[0-255]. +

+
+
YHIGH
+

Display the Y value at the 90% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
YMAX
+

Display the maximum Y value contained within the input frame. Expressed in +range of [0-255]. +

+
+
UMIN
+

Display the minimal U value contained within the input frame. Expressed in +range of [0-255]. +

+
+
ULOW
+

Display the U value at the 10% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
UAVG
+

Display the average U value within the input frame. Expressed in range of +[0-255]. +

+
+
UHIGH
+

Display the U value at the 90% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
UMAX
+

Display the maximum U value contained within the input frame. Expressed in +range of [0-255]. +

+
+
VMIN
+

Display the minimal V value contained within the input frame. Expressed in +range of [0-255]. +

+
+
VLOW
+

Display the V value at the 10% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
VAVG
+

Display the average V value within the input frame. Expressed in range of +[0-255]. +

+
+
VHIGH
+

Display the V value at the 90% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
VMAX
+

Display the maximum V value contained within the input frame. Expressed in +range of [0-255]. +

+
+
SATMIN
+

Display the minimal saturation value contained within the input frame. +Expressed in range of [0-~181.02]. +

+
+
SATLOW
+

Display the saturation value at the 10% percentile within the input frame. +Expressed in range of [0-~181.02]. +

+
+
SATAVG
+

Display the average saturation value within the input frame. Expressed in range +of [0-~181.02]. +

+
+
SATHIGH
+

Display the saturation value at the 90% percentile within the input frame. +Expressed in range of [0-~181.02]. +

+
+
SATMAX
+

Display the maximum saturation value contained within the input frame. +Expressed in range of [0-~181.02]. +

+
+
HUEMED
+

Display the median value for hue within the input frame. Expressed in range of +[0-360]. +

+
+
HUEAVG
+

Display the average value for hue within the input frame. Expressed in range of +[0-360]. +

+
+
YDIF
+

Display the average of sample value difference between all values of the Y +plane in the current frame and corresponding values of the previous input frame. +Expressed in range of [0-255]. +

+
+
UDIF
+

Display the average of sample value difference between all values of the U +plane in the current frame and corresponding values of the previous input frame. +Expressed in range of [0-255]. +

+
+
VDIF
+

Display the average of sample value difference between all values of the V +plane in the current frame and corresponding values of the previous input frame. +Expressed in range of [0-255]. +

+
+
YBITDEPTH
+

Display bit depth of Y plane in current frame. +Expressed in range of [0-16]. +

+
+
UBITDEPTH
+

Display bit depth of U plane in current frame. +Expressed in range of [0-16]. +

+
+
VBITDEPTH
+

Display bit depth of V plane in current frame. +Expressed in range of [0-16]. +

+
+ +

The filter accepts the following options: +

+
+
stat
+
out
+
+

stat specify an additional form of image analysis. +out output video with the specified type of pixel highlighted. +

+

Both options accept the following values: +

+
+
tout
+

Identify temporal outliers pixels. A temporal outlier is a pixel +unlike the neighboring pixels of the same field. Examples of temporal outliers +include the results of video dropouts, head clogs, or tape tracking issues. +

+
+
vrep
+

Identify vertical line repetition. Vertical line repetition includes +similar rows of pixels within a frame. In born-digital video vertical line +repetition is common, but this pattern is uncommon in video digitized from an +analog source. When it occurs in video that results from the digitization of an +analog source it can indicate concealment from a dropout compensator. +

+
+
brng
+

Identify pixels that fall outside of legal broadcast range. +

+
+ +
+
color, c
+

Set the highlight color for the out option. The default color is +yellow. +

+
+ + +
+

39.233.1 Examples

+ +
    +
  • Output data of various video metrics: +
    +
    ffprobe -f lavfi movie=example.mov,signalstats="stat=tout+vrep+brng" -show_frames
    +
    + +
  • Output specific data about the minimum and maximum values of the Y plane per frame: +
    +
    ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
    +
    + +
  • Playback video while highlighting pixels that are outside of broadcast range in red. +
    +
    ffplay example.mov -vf signalstats="out=brng:color=red"
    +
    + +
  • Playback video with signalstats metadata drawn over the frame. +
    +
    ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
    +
    + +

    The contents of signalstat_drawtext.txt used in the command are: +

    +
    time %{pts:hms}
    +Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
    +U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
    +V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
    +saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
    +
    +
    +
+ +
+
+
+

39.234 signature

+ +

Calculates the MPEG-7 Video Signature. The filter can handle more than one +input. In this case the matching between the inputs can be calculated additionally. +The filter always passes through the first input. The signature of each stream can +be written into a file. +

+

It accepts the following options: +

+
+
detectmode
+

Enable or disable the matching process. +

+

Available values are: +

+
+
off
+

Disable the calculation of a matching (default). +

+
full
+

Calculate the matching for the whole video and output whether the whole video +matches or only parts. +

+
fast
+

Calculate only until a matching is found or the video ends. Should be faster in +some cases. +

+
+ +
+
nb_inputs
+

Set the number of inputs. The option value must be a non negative integer. +Default value is 1. +

+
+
filename
+

Set the path to which the output is written. If there is more than one input, +the path must be a prototype, i.e. must contain %d or %0nd (where n is a positive +integer), that will be replaced with the input number. If no filename is +specified, no output will be written. This is the default. +

+
+
format
+

Choose the output format. +

+

Available values are: +

+
+
binary
+

Use the specified binary representation (default). +

+
xml
+

Use the specified xml representation. +

+
+ +
+
th_d
+

Set threshold to detect one word as similar. The option value must be an integer +greater than zero. The default value is 9000. +

+
+
th_dc
+

Set threshold to detect all words as similar. The option value must be an integer +greater than zero. The default value is 60000. +

+
+
th_xh
+

Set threshold to detect frames as similar. The option value must be an integer +greater than zero. The default value is 116. +

+
+
th_di
+

Set the minimum length of a sequence in frames to recognize it as matching +sequence. The option value must be a non negative integer value. +The default value is 0. +

+
+
th_it
+

Set the minimum relation, that matching frames to all frames must have. +The option value must be a double value between 0 and 1. The default value is 0.5. +

+
+ + +
+

39.234.1 Examples

+ +
    +
  • To calculate the signature of an input video and store it in signature.bin: +
    +
    ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
    +
    + +
  • To detect whether two videos match and store the signatures in XML format in +signature0.xml and signature1.xml: +
    +
    ffmpeg -i input1.mkv -i input2.mkv -filter_complex "[0:v][1:v] signature=nb_inputs=2:detectmode=full:format=xml:filename=signature%d.xml" -map :v -f null -
    +
    + +
+ +
+
+
+

39.235 siti

+ +

Calculate Spatial Information (SI) and Temporal Information (TI) scores for a video, +as defined in ITU-T Rec. P.910 (11/21): Subjective video quality assessment methods +for multimedia applications. Available PDF at https://www.itu.int/rec/T-REC-P.910-202111-S/en. +Note that this is a legacy implementation that corresponds to a superseded recommendation. +Refer to ITU-T Rec. P.910 (07/22) for the latest version: https://www.itu.int/rec/T-REC-P.910-202207-I/en +

+

It accepts the following option: +

+
+
print_summary
+

If set to 1, Summary statistics will be printed to the console. Default 0. +

+
+ + +
+

39.235.1 Examples

+
    +
  • To calculate SI/TI metrics and print summary: +
    +
    ffmpeg -i input.mp4 -vf siti=print_summary=1 -f null -
    +
    +
+ +
+
+
+

39.236 smartblur

+ +

Blur the input video without impacting the outlines. +

+

It accepts the following options: +

+
+
luma_radius, lr
+

Set the luma radius. The option value must be a float number in +the range [0.1,5.0] that specifies the variance of the gaussian filter +used to blur the image (slower if larger). Default value is 1.0. +

+
+
luma_strength, ls
+

Set the luma strength. The option value must be a float number +in the range [-1.0,1.0] that configures the blurring. A value included +in [0.0,1.0] will blur the image whereas a value included in +[-1.0,0.0] will sharpen the image. Default value is 1.0. +

+
+
luma_threshold, lt
+

Set the luma threshold used as a coefficient to determine +whether a pixel should be blurred or not. The option value must be an +integer in the range [-30,30]. A value of 0 will filter all the image, +a value included in [0,30] will filter flat areas and a value included +in [-30,0] will filter edges. Default value is 0. +

+
+
chroma_radius, cr
+

Set the chroma radius. The option value must be a float number in +the range [0.1,5.0] that specifies the variance of the gaussian filter +used to blur the image (slower if larger). Default value is luma_radius. +

+
+
chroma_strength, cs
+

Set the chroma strength. The option value must be a float number +in the range [-1.0,1.0] that configures the blurring. A value included +in [0.0,1.0] will blur the image whereas a value included in +[-1.0,0.0] will sharpen the image. Default value is luma_strength. +

+
+
chroma_threshold, ct
+

Set the chroma threshold used as a coefficient to determine +whether a pixel should be blurred or not. The option value must be an +integer in the range [-30,30]. A value of 0 will filter all the image, +a value included in [0,30] will filter flat areas and a value included +in [-30,0] will filter edges. Default value is luma_threshold. +

+
+ +

If a chroma option is not explicitly set, the corresponding luma value +is set. +

+
+
+

39.237 sobel

+

Apply sobel operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

39.237.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.238 spp

+ +

Apply a simple postprocessing filter that compresses and decompresses the image +at several (or - in the case of quality level 6 - all) shifts +and average the results. +

+

The filter accepts the following options: +

+
+
quality
+

Set quality. This option defines the number of levels for averaging. It accepts +an integer in the range 0-6. If set to 0, the filter will have no +effect. A value of 6 means the higher quality. For each increment of +that value the speed drops by a factor of approximately 2. Default value is +3. +

+
+
qp
+

Force a constant quantization parameter. If not set, the filter will use the QP +from the video stream (if available). +

+
+
mode
+

Set thresholding mode. Available modes are: +

+
+
hard
+

Set hard thresholding (default). +

+
soft
+

Set soft thresholding (better de-ringing effect, but likely blurrier). +

+
+ +
+
use_bframe_qp
+

Enable the use of the QP from the B-Frames if set to 1. Using this +option may cause flicker since the B-Frames have often larger QP. Default is +0 (not enabled). +

+
+ + +
+

39.238.1 Commands

+ +

This filter supports the following commands: +

+
quality, level
+

Set quality level. The value max can be used to set the maximum level, +currently 6. +

+
+ +
+
+
+

39.239 sr

+ +

Scale the input by applying one of the super-resolution methods based on +convolutional neural networks. Supported models: +

+ + +

Training scripts as well as scripts for model file (.pb) saving can be found at +https://github.com/XueweiMeng/sr/tree/sr_dnn_native. Original repository +is at https://github.com/HighVoltageRocknRoll/sr.git. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +the following values: +

+
+
tensorflow
+

TensorFlow backend. To enable this backend you +need to install the TensorFlow for C library (see +https://www.tensorflow.org/install/lang_c) and configure FFmpeg with +--enable-libtensorflow +

+
+ +
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. TensorFlow, OpenVINO backend +can load files for only its format. +

+
+
scale_factor
+

Set scale factor for SRCNN model. Allowed values are 2, 3 and 4. +Default value is 2. Scale factor is necessary for SRCNN model, because it accepts +input upscaled using bicubic upscaling with proper scale factor. +

+
+ +

To get full functionality (such as async execution), please use the dnn_processing filter. +

+
+
+

39.240 ssim

+ +

Obtain the SSIM (Structural SImilarity Metric) between two input videos. +

+

This filter takes in input two input videos, the first input is +considered the "main" source and is passed unchanged to the +output. The second input is used as a "reference" video for computing +the SSIM. +

+

Both video inputs must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The filter stores the calculated SSIM of each frame. +

+

The description of the accepted parameters follows. +

+
+
stats_file, f
+

If specified the filter will use the named file to save the SSIM of +each individual frame. When filename equals "-" the data is sent to +standard output. +

+
+ +

The file printed if stats_file is selected, contains a sequence of +key/value pairs of the form key:value for each compared +couple of frames. +

+

A description of each shown parameter follows: +

+
+
n
+

sequential number of the input frame, starting from 1 +

+
+
Y, U, V, R, G, B
+

SSIM of the compared frames for the component specified by the suffix. +

+
+
All
+

SSIM of the compared frames for the whole frame. +

+
+
dB
+

Same as above but in dB representation. +

+
+ +

This filter also supports the framesync options. +

+ +
+

39.240.1 Examples

+
    +
  • For example: +
    +
    movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
    +[main][ref] ssim="stats_file=stats.log" [out]
    +
    + +

    On this example the input file being processed is compared with the +reference file ref_movie.mpg. The SSIM of each individual frame +is stored in stats.log. +

    +
  • Another example with both psnr and ssim at same time: +
    +
    ffmpeg -i main.mpg -i ref.mpg -lavfi  "ssim;[0:v][1:v]psnr" -f null -
    +
    + +
  • Another example with different containers: +
    +
    ffmpeg -i main.mpg -i ref.mkv -lavfi  "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]ssim" -f null -
    +
    +
+ +
+
+
+

39.241 stereo3d

+ +

Convert between different stereoscopic image formats. +

+

The filters accept the following options: +

+
+
in
+

Set stereoscopic image format of input. +

+

Available values for input image formats are: +

+
sbsl
+

side by side parallel (left eye left, right eye right) +

+
+
sbsr
+

side by side crosseye (right eye left, left eye right) +

+
+
sbs2l
+

side by side parallel with half width resolution +(left eye left, right eye right) +

+
+
sbs2r
+

side by side crosseye with half width resolution +(right eye left, left eye right) +

+
+
abl
+
tbl
+

above-below (left eye above, right eye below) +

+
+
abr
+
tbr
+

above-below (right eye above, left eye below) +

+
+
ab2l
+
tb2l
+

above-below with half height resolution +(left eye above, right eye below) +

+
+
ab2r
+
tb2r
+

above-below with half height resolution +(right eye above, left eye below) +

+
+
al
+

alternating frames (left eye first, right eye second) +

+
+
ar
+

alternating frames (right eye first, left eye second) +

+
+
irl
+

interleaved rows (left eye has top row, right eye starts on next row) +

+
+
irr
+

interleaved rows (right eye has top row, left eye starts on next row) +

+
+
icl
+

interleaved columns, left eye first +

+
+
icr
+

interleaved columns, right eye first +

+

Default value is ‘sbsl’. +

+
+ +
+
out
+

Set stereoscopic image format of output. +

+
+
sbsl
+

side by side parallel (left eye left, right eye right) +

+
+
sbsr
+

side by side crosseye (right eye left, left eye right) +

+
+
sbs2l
+

side by side parallel with half width resolution +(left eye left, right eye right) +

+
+
sbs2r
+

side by side crosseye with half width resolution +(right eye left, left eye right) +

+
+
abl
+
tbl
+

above-below (left eye above, right eye below) +

+
+
abr
+
tbr
+

above-below (right eye above, left eye below) +

+
+
ab2l
+
tb2l
+

above-below with half height resolution +(left eye above, right eye below) +

+
+
ab2r
+
tb2r
+

above-below with half height resolution +(right eye above, left eye below) +

+
+
al
+

alternating frames (left eye first, right eye second) +

+
+
ar
+

alternating frames (right eye first, left eye second) +

+
+
irl
+

interleaved rows (left eye has top row, right eye starts on next row) +

+
+
irr
+

interleaved rows (right eye has top row, left eye starts on next row) +

+
+
arbg
+

anaglyph red/blue gray +(red filter on left eye, blue filter on right eye) +

+
+
argg
+

anaglyph red/green gray +(red filter on left eye, green filter on right eye) +

+
+
arcg
+

anaglyph red/cyan gray +(red filter on left eye, cyan filter on right eye) +

+
+
arch
+

anaglyph red/cyan half colored +(red filter on left eye, cyan filter on right eye) +

+
+
arcc
+

anaglyph red/cyan color +(red filter on left eye, cyan filter on right eye) +

+
+
arcd
+

anaglyph red/cyan color optimized with the least squares projection of dubois +(red filter on left eye, cyan filter on right eye) +

+
+
agmg
+

anaglyph green/magenta gray +(green filter on left eye, magenta filter on right eye) +

+
+
agmh
+

anaglyph green/magenta half colored +(green filter on left eye, magenta filter on right eye) +

+
+
agmc
+

anaglyph green/magenta colored +(green filter on left eye, magenta filter on right eye) +

+
+
agmd
+

anaglyph green/magenta color optimized with the least squares projection of dubois +(green filter on left eye, magenta filter on right eye) +

+
+
aybg
+

anaglyph yellow/blue gray +(yellow filter on left eye, blue filter on right eye) +

+
+
aybh
+

anaglyph yellow/blue half colored +(yellow filter on left eye, blue filter on right eye) +

+
+
aybc
+

anaglyph yellow/blue colored +(yellow filter on left eye, blue filter on right eye) +

+
+
aybd
+

anaglyph yellow/blue color optimized with the least squares projection of dubois +(yellow filter on left eye, blue filter on right eye) +

+
+
ml
+

mono output (left eye only) +

+
+
mr
+

mono output (right eye only) +

+
+
chl
+

checkerboard, left eye first +

+
+
chr
+

checkerboard, right eye first +

+
+
icl
+

interleaved columns, left eye first +

+
+
icr
+

interleaved columns, right eye first +

+
+
hdmi
+

HDMI frame pack +

+
+ +

Default value is ‘arcd’. +

+
+ + +
+

39.241.1 Examples

+ +
    +
  • Convert input video from side by side parallel to anaglyph yellow/blue dubois: +
    +
    stereo3d=sbsl:aybd
    +
    + +
  • Convert input video from above below (left eye above, right eye below) to side by side crosseye. +
    +
    stereo3d=abl:sbsr
    +
    +
+ +
+
+
+

39.242 streamselect, astreamselect

+

Select video or audio streams. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of inputs. Default is 2. +

+
+
map
+

Set input indexes to remap to outputs. +

+
+ + +
+

39.242.1 Commands

+ +

The streamselect and astreamselect filter supports the following +commands: +

+
+
map
+

Set input indexes to remap to outputs. +

+
+ +
+
+

39.242.2 Examples

+ +
    +
  • Select first 5 seconds 1st stream and rest of time 2nd stream: +
    +
    sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
    +
    + +
  • Same as above, but for audio: +
    +
    asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
    +
    +
+ +
+
+
+

39.243 subtitles

+ +

Draw subtitles on top of input video using the libass library. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libass. This filter also requires a build with libavcodec and +libavformat to convert the passed subtitles file to ASS (Advanced Substation +Alpha) subtitles format. +

+

The filter accepts the following options: +

+
+
filename, f
+

Set the filename of the subtitle file to read. It must be specified. +

+
+
original_size
+

Specify the size of the original video, the video for which the ASS file +was composed. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to +correctly scale the fonts if the aspect ratio has been changed. +

+
+
fontsdir
+

Set a directory path containing fonts that can be used by the filter. +These fonts will be used in addition to whatever the font provider uses. +

+
+
alpha
+

Process alpha channel, by default alpha channel is untouched. +

+
+
charenc
+

Set subtitles input character encoding. subtitles filter only. Only +useful if not UTF-8. +

+
+
stream_index, si
+

Set subtitles stream index. subtitles filter only. +

+
+
force_style
+

Override default style or script info parameters of the subtitles. It accepts a +string containing ASS style format KEY=VALUE couples separated by ",". +

+
+ +

If the first key is not specified, it is assumed that the first value +specifies the filename. +

+

For example, to render the file sub.srt on top of the input +video, use the command: +

+
subtitles=sub.srt
+
+ +

which is equivalent to: +

+
subtitles=filename=sub.srt
+
+ +

To render the default subtitles stream from file video.mkv, use: +

+
subtitles=video.mkv
+
+ +

To render the second subtitles stream from that file, use: +

+
subtitles=video.mkv:si=1
+
+ +

To make the subtitles stream from sub.srt appear in 80% transparent blue +DejaVu Serif, use: +

+
subtitles=sub.srt:force_style='Fontname=DejaVu Serif,PrimaryColour=&HCCFF0000'
+
+ +
+
+

39.244 super2xsai

+ +

Scale the input by 2x and smooth using the Super2xSaI (Scale and +Interpolate) pixel art scaling algorithm. +

+

Useful for enlarging pixel art images without reducing sharpness. +

+
+
+

39.245 swaprect

+ +

Swap two rectangular objects in video. +

+

This filter accepts the following options: +

+
+
w
+

Set object width. +

+
+
h
+

Set object height. +

+
+
x1
+

Set 1st rect x coordinate. +

+
+
y1
+

Set 1st rect y coordinate. +

+
+
x2
+

Set 2nd rect x coordinate. +

+
+
y2
+

Set 2nd rect y coordinate. +

+

All expressions are evaluated once for each frame. +

+
+ +

The all options are expressions containing the following constants: +

+
+
w
+
h
+

The input width and height. +

+
+
a
+

same as w / h +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (w / h) * sar +

+
+
n
+

The number of the input frame, starting from 0. +

+
+
t
+

The timestamp expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, +do not use +

+
+ + +
+

39.245.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.246 swapuv

+

Swap U & V plane. +

+
+
+

39.247 tblend

+

Blend successive video frames. +

+

See blend +

+
+
+

39.248 telecine

+ +

Apply telecine process to the video. +

+

This filter accepts the following options: +

+
+
first_field
+
+
top, t
+

top field first +

+
bottom, b
+

bottom field first +The default value is top. +

+
+ +
+
pattern
+

A string of numbers representing the pulldown pattern you wish to apply. +The default value is 23. +

+
+ +
+
Some typical patterns:
+
+NTSC output (30i):
+27.5p: 32222
+24p: 23 (classic)
+24p: 2332 (preferred)
+20p: 33
+18p: 334
+16p: 3444
+
+PAL output (25i):
+27.5p: 12222
+24p: 222222222223 ("Euro pulldown")
+16.67p: 33
+16p: 33333334
+
+ +
+
+

39.249 thistogram

+ +

Compute and draw a color distribution histogram for the input video across time. +

+

Unlike histogram video filter which only shows histogram of single input frame +at certain time, this filter shows also past histograms of number of frames defined +by width option. +

+

The computed histogram is a representation of the color component +distribution in an image. +

+

The filter accepts the following options: +

+
+
width, w
+

Set width of single color component output. Default value is 0. +Value of 0 means width will be picked from input video. +This also set number of passed histograms to keep. +Allowed range is [0, 8192]. +

+
+
display_mode, d
+

Set display mode. +It accepts the following values: +

+
stack
+

Per color component graphs are placed below each other. +

+
+
parade
+

Per color component graphs are placed side by side. +

+
+
overlay
+

Presents information identical to that in the parade, except +that the graphs representing color components are superimposed directly +over one another. +

+
+

Default is stack. +

+
+
levels_mode, m
+

Set mode. Can be either linear, or logarithmic. +Default is linear. +

+
+
components, c
+

Set what color components to display. +Default is 7. +

+
+
bgopacity, b
+

Set background opacity. Default is 0.9. +

+
+
envelope, e
+

Show envelope. Default is disabled. +

+
+
ecolor, ec
+

Set envelope color. Default is gold. +

+
+
slide
+

Set slide mode. +

+

Available values for slide is: +

+
frame
+

Draw new frame when right border is reached. +

+
+
replace
+

Replace old columns with new ones. +

+
+
scroll
+

Scroll from right to left. +

+
+
rscroll
+

Scroll from left to right. +

+
+
picture
+

Draw single picture. +

+
+ +

Default is replace. +

+
+ +
+
+

39.250 threshold

+ +

Apply threshold effect to video stream. +

+

This filter needs four video streams to perform thresholding. +First stream is stream we are filtering. +Second stream is holding threshold values, third stream is holding min values, +and last, fourth stream is holding max values. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+ +

For example if first stream pixel’s component value is less then threshold value +of pixel component from 2nd threshold stream, third stream value will picked, +otherwise fourth stream pixel component value will be picked. +

+

Using color source filter one can perform various types of thresholding: +

+ +
+

39.250.1 Commands

+ +

This filter supports the all options as commands. +

+
+
+

39.250.2 Examples

+ +
    +
  • Binary threshold, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=black -f lavfi -i color=white -lavfi threshold output.avi
    +
    + +
  • Inverted binary threshold, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -f lavfi -i color=black -lavfi threshold output.avi
    +
    + +
  • Truncate binary threshold, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=gray -lavfi threshold output.avi
    +
    + +
  • Threshold to zero, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -i 320x240.avi -lavfi threshold output.avi
    +
    + +
  • Inverted threshold to zero, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=white -lavfi threshold output.avi
    +
    +
+ +
+
+
+

39.251 thumbnail

+

Select the most representative frame in a given sequence of consecutive frames. +

+

The filter accepts the following options: +

+
+
n
+

Set the frames batch size to analyze; in a set of n frames, the filter +will pick one of them, and then handle the next batch of n frames until +the end. Default is 100. +

+
+
log
+

Set the log level to display picked frame stats. +Default is info. +

+
+ +

Since the filter keeps track of the whole frames sequence, a bigger n +value will result in a higher memory usage, so a high value is not recommended. +

+ +
+

39.251.1 Examples

+ +
    +
  • Extract one picture each 50 frames: +
    +
    thumbnail=50
    +
    + +
  • Complete example of a thumbnail creation with ffmpeg: +
    +
    ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
    +
    +
+ +
+
+
+

39.252 tile

+ +

Tile several successive frames together. +

+

The untile filter can do the reverse. +

+

The filter accepts the following options: +

+
+
layout
+

Set the grid size in the form COLUMNSxROWS. Range is upto UINT_MAX cells. +Default is 6x5. +

+
+
nb_frames
+

Set the maximum number of frames to render in the given area. It must be less +than or equal to wxh. The default value is 0, meaning all +the area will be used. +

+
+
margin
+

Set the outer border margin in pixels. Range is 0 to 1024. Default is 0. +

+
+
padding
+

Set the inner border thickness (i.e. the number of pixels between frames). For +more advanced padding options (such as having different values for the edges), +refer to the pad video filter. Range is 0 to 1024. Default is 0. +

+
+
color
+

Specify the color of the unused area. For the syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +The default value of color is "black". +

+
+
overlap
+

Set the number of frames to overlap when tiling several successive frames together. +The value must be between 0 and nb_frames - 1. Default is 0. +

+
+
init_padding
+

Set the number of frames to initially be empty before displaying first output frame. +This controls how soon will one get first output frame. +The value must be between 0 and nb_frames - 1. Default is 0. +

+
+ + +
+

39.252.1 Examples

+ +
    +
  • Produce 8x8 PNG tiles of all keyframes (-skip_frame nokey) in a movie: +
    +
    ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
    +
    +

    The -vsync 0 is necessary to prevent ffmpeg from +duplicating each output frame to accommodate the originally detected frame +rate. +

    +
  • Display 5 pictures in an area of 3x2 frames, +with 7 pixels between them, and 2 pixels of initial margin, using +mixed flat and named options: +
    +
    tile=3x2:nb_frames=5:padding=7:margin=2
    +
    +
+ +
+
+
+

39.253 tinterlace

+ +

Perform various types of temporal field interlacing. +

+

Frames are counted starting from 1, so the first input frame is +considered odd. +

+

The filter accepts the following options: +

+
+
mode
+

Specify the mode of the interlacing. This option can also be specified +as a value alone. See below for a list of values for this option. +

+

Available values are: +

+
+
merge, 0
+

Move odd frames into the upper field, even into the lower field, +generating a double height frame at half frame rate. +

+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+
+ +
+
drop_even, 1
+

Only output odd frames, even frames are dropped, generating a frame with +unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111                           33333
+11111                           33333
+11111                           33333
+11111                           33333
+
+ +
+
drop_odd, 2
+

Only output even frames, odd frames are dropped, generating a frame with +unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+                22222                           44444
+                22222                           44444
+                22222                           44444
+                22222                           44444
+
+ +
+
pad, 3
+

Expand each frame to full height, but pad alternate lines with black, +generating a frame with double height at the same input frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111           .....           33333           .....
+.....           22222           .....           44444
+11111           .....           33333           .....
+.....           22222           .....           44444
+11111           .....           33333           .....
+.....           22222           .....           44444
+11111           .....           33333           .....
+.....           22222           .....           44444
+
+ + +
+
interleave_top, 4
+

Interleave the upper field from odd frames with the lower field from +even frames, generating a frame with unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111<-         22222           33333<-         44444
+11111           22222<-         33333           44444<-
+11111<-         22222           33333<-         44444
+11111           22222<-         33333           44444<-
+
+Output:
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+
+ + +
+
interleave_bottom, 5
+

Interleave the lower field from odd frames with the upper field from +even frames, generating a frame with unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222<-         33333           44444<-
+11111<-         22222           33333<-         44444
+11111           22222<-         33333           44444<-
+11111<-         22222           33333<-         44444
+
+Output:
+22222                           44444
+11111                           33333
+22222                           44444
+11111                           33333
+
+ + +
+
interlacex2, 6
+

Double frame rate with unchanged height. Frames are inserted each +containing the second temporal field from the previous input frame and +the first temporal field from the next input frame. This mode relies on +the top_field_first flag. Useful for interlaced video displays with no +field synchronisation. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+ 11111           22222           33333           44444
+11111           22222           33333           44444
+ 11111           22222           33333           44444
+
+Output:
+11111   22222   22222   33333   33333   44444   44444
+ 11111   11111   22222   22222   33333   33333   44444
+11111   22222   22222   33333   33333   44444   44444
+ 11111   11111   22222   22222   33333   33333   44444
+
+ + +
+
mergex2, 7
+

Move odd frames into the upper field, even into the lower field, +generating a double height frame at same frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111           33333           33333           55555
+22222           22222           44444           44444
+11111           33333           33333           55555
+22222           22222           44444           44444
+11111           33333           33333           55555
+22222           22222           44444           44444
+11111           33333           33333           55555
+22222           22222           44444           44444
+
+ +
+
+ +

Numeric values are deprecated but are accepted for backward +compatibility reasons. +

+

Default mode is merge. +

+
+
flags
+

Specify flags influencing the filter process. +

+

Available value for flags is: +

+
+
low_pass_filter, vlpf
+

Enable linear vertical low-pass filtering in the filter. +Vertical low-pass filtering is required when creating an interlaced +destination from a progressive source which contains high-frequency +vertical detail. Filtering will reduce interlace ’twitter’ and Moire +patterning. +

+
+
complex_filter, cvlpf
+

Enable complex vertical low-pass filtering. +This will slightly less reduce interlace ’twitter’ and Moire +patterning but better retain detail and subjective sharpness impression. +

+
+
bypass_il
+

Bypass already interlaced frames, only adjust the frame rate. +

+
+ +

Vertical low-pass filtering and bypassing already interlaced frames can only be +enabled for mode interleave_top and interleave_bottom. +

+
+
+ +
+
+

39.254 tmedian

+

Pick median pixels from several successive input video frames. +

+

The filter accepts the following options: +

+
+
radius
+

Set radius of median filter. +Default is 1. Allowed range is from 1 to 127. +

+
+
planes
+

Set which planes to filter. Default value is 15, by which all planes are processed. +

+
+
percentile
+

Set median percentile. Default value is 0.5. +Default value of 0.5 will pick always median values, while 0 will pick +minimum values, and 1 maximum values. +

+
+ + +
+

39.254.1 Commands

+ +

This filter supports all above options as commands, excluding option radius. +

+
+
+
+

39.255 tmidequalizer

+ +

Apply Temporal Midway Video Equalization effect. +

+

Midway Video Equalization adjusts a sequence of video frames to have the same +histograms, while maintaining their dynamics as much as possible. It’s +useful for e.g. matching exposures from a video frames sequence. +

+

This filter accepts the following option: +

+
+
radius
+

Set filtering radius. Default is 5. Allowed range is from 1 to 127. +

+
+
sigma
+

Set filtering sigma. Default is 0.5. This controls strength of filtering. +Setting this option to 0 effectively does nothing. +

+
+
planes
+

Set which planes to process. Default is 15, which is all available planes. +

+
+ +
+
+

39.256 tmix

+ +

Mix successive video frames. +

+

A description of the accepted options follows. +

+
+
frames
+

The number of successive frames to mix. If unspecified, it defaults to 3. +

+
+
weights
+

Specify weight of each input video frame. +Each weight is separated by space. If number of weights is smaller than +number of frames last specified weight will be used for all remaining +unset weights. +

+
+
scale
+

Specify scale, if it is set it will be multiplied with sum +of each weight multiplied with pixel values to give final destination +pixel value. By default scale is auto scaled to sum of weights. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+ + +
+

39.256.1 Examples

+ +
    +
  • Average 7 successive frames: +
    +
    tmix=frames=7:weights="1 1 1 1 1 1 1"
    +
    + +
  • Apply simple temporal convolution: +
    +
    tmix=frames=3:weights="-1 3 -1"
    +
    + +
  • Similar as above but only showing temporal differences: +
    +
    tmix=frames=3:weights="-1 2 -1":scale=1
    +
    +
+ +
+
+

39.256.2 Commands

+ +

This filter supports the following commands: +

+
weights
+
scale
+
planes
+

Syntax is same as option with same name. +

+
+ +
+
+
+

39.257 tonemap

+

Tone map colors from different dynamic ranges. +

+

This filter expects data in single precision floating point, as it needs to +operate on (and can output) out-of-range values. Another filter, such as +zscale, is needed to convert the resulting frame to a usable format. +

+

The tonemapping algorithms implemented only work on linear light, so input +data should be linearized beforehand (and possibly correctly tagged). +

+
+
ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
+
+ + +
+

39.257.1 Options

+

The filter accepts the following options. +

+
+
tonemap
+

Set the tone map algorithm to use. +

+

Possible values are: +

+
none
+

Do not apply any tone map, only desaturate overbright pixels. +

+
+
clip
+

Hard-clip any out-of-range values. Use it for perfect color accuracy for +in-range values, while distorting out-of-range values. +

+
+
linear
+

Stretch the entire reference gamut to a linear multiple of the display. +

+
+
gamma
+

Fit a logarithmic transfer between the tone curves. +

+
+
reinhard
+

Preserve overall image brightness with a simple curve, using nonlinear +contrast, which results in flattening details and degrading color accuracy. +

+
+
hable
+

Preserve both dark and bright details better than reinhard, at the cost +of slightly darkening everything. Use it when detail preservation is more +important than color and brightness accuracy. +

+
+
mobius
+

Smoothly map out-of-range values, while retaining contrast and colors for +in-range material as much as possible. Use it when color accuracy is more +important than detail preservation. +

+
+ +

Default is none. +

+
+
param
+

Tune the tone mapping algorithm. +

+

This affects the following algorithms: +

+
none
+

Ignored. +

+
+
linear
+

Specifies the scale factor to use while stretching. +Default to 1.0. +

+
+
gamma
+

Specifies the exponent of the function. +Default to 1.8. +

+
+
clip
+

Specify an extra linear coefficient to multiply into the signal before clipping. +Default to 1.0. +

+
+
reinhard
+

Specify the local contrast coefficient at the display peak. +Default to 0.5, which means that in-gamut values will be about half as bright +as when clipping. +

+
+
hable
+

Ignored. +

+
+
mobius
+

Specify the transition point from linear to mobius transform. Every value +below this point is guaranteed to be mapped 1:1. The higher the value, the +more accurate the result will be, at the cost of losing bright details. +Default to 0.3, which due to the steep initial slope still preserves in-range +colors fairly accurately. +

+
+ +
+
desat
+

Apply desaturation for highlights that exceed this level of brightness. The +higher the parameter, the more color information will be preserved. This +setting helps prevent unnaturally blown-out colors for super-highlights, by +(smoothly) turning into white instead. This makes images feel more natural, +at the cost of reducing information about out-of-range colors. +

+

The default of 2.0 is somewhat conservative and will mostly just apply to +skies or directly sunlit surfaces. A setting of 0.0 disables this option. +

+

This option works only if the input frame has a supported color tag. +

+
+
peak
+

Override signal/nominal/reference peak with this value. Useful when the +embedded peak information in display metadata is not reliable or when tone +mapping from a lower range to a higher range. +

+
+ +
+
+
+

39.258 tpad

+ +

Temporarily pad video frames. +

+

The filter accepts the following options: +

+
+
start
+

Specify number of delay frames before input video stream. Default is 0. +

+
+
stop
+

Specify number of padding frames after input video stream. +Set to -1 to pad indefinitely. Default is 0. +

+
+
start_mode
+

Set kind of frames added to beginning of stream. +Can be either add or clone. +With add frames of solid-color are added. +With clone frames are clones of first frame. +Default is add. +

+
+
stop_mode
+

Set kind of frames added to end of stream. +Can be either add or clone. +With add frames of solid-color are added. +With clone frames are clones of last frame. +Default is add. +

+
+
start_duration, stop_duration
+

Specify the duration of the start/stop delay. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +These options override start and stop. Default is 0. +

+
+
color
+

Specify the color of the padded area. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. +

+

The default value of color is "black". +

+
+ +
+
+

39.259 transpose

+ +

Transpose rows with columns in the input video and optionally flip it. +

+

It accepts the following parameters: +

+
+
dir
+

Specify the transposition direction. +

+

Can assume the following values: +

+
0, 4, cclock_flip
+

Rotate by 90 degrees counterclockwise and vertically flip (default), that is: +

+
L.R     L.l
+. . ->  . .
+l.r     R.r
+
+ +
+
1, 5, clock
+

Rotate by 90 degrees clockwise, that is: +

+
L.R     l.L
+. . ->  . .
+l.r     r.R
+
+ +
+
2, 6, cclock
+

Rotate by 90 degrees counterclockwise, that is: +

+
L.R     R.r
+. . ->  . .
+l.r     L.l
+
+ +
+
3, 7, clock_flip
+

Rotate by 90 degrees clockwise and vertically flip, that is: +

+
L.R     r.R
+. . ->  . .
+l.r     l.L
+
+
+
+ +

For values between 4-7, the transposition is only done if the input +video geometry is portrait and not landscape. These values are +deprecated, the passthrough option should be used instead. +

+

Numerical values are deprecated, and should be dropped in favor of +symbolic constants. +

+
+
passthrough
+

Do not apply the transposition if the input geometry matches the one +specified by the specified value. It accepts the following values: +

+
none
+

Always apply transposition. +

+
portrait
+

Preserve portrait geometry (when height >= width). +

+
landscape
+

Preserve landscape geometry (when width >= height). +

+
+ +

Default value is none. +

+
+ +

For example to rotate by 90 degrees clockwise and preserve portrait +layout: +

+
transpose=dir=1:passthrough=portrait
+
+ +

The command above can also be specified as: +

+
transpose=1:portrait
+
+ +
+
+

39.260 transpose_npp

+ +

Transpose rows with columns in the input video and optionally flip it. +For more in depth examples see the transpose video filter, which shares mostly the same options. +

+

It accepts the following parameters: +

+
+
dir
+

Specify the transposition direction. +

+

Can assume the following values: +

+
cclock_flip
+

Rotate by 90 degrees counterclockwise and vertically flip. (default) +

+
+
clock
+

Rotate by 90 degrees clockwise. +

+
+
cclock
+

Rotate by 90 degrees counterclockwise. +

+
+
clock_flip
+

Rotate by 90 degrees clockwise and vertically flip. +

+
+ +
+
passthrough
+

Do not apply the transposition if the input geometry matches the one +specified by the specified value. It accepts the following values: +

+
none
+

Always apply transposition. (default) +

+
portrait
+

Preserve portrait geometry (when height >= width). +

+
landscape
+

Preserve landscape geometry (when width >= height). +

+
+ +
+
+ +
+
+

39.261 trim

+

Trim the input so that the output contains one continuous subpart of the input. +

+

It accepts the following parameters: +

+
start
+

Specify the time of the start of the kept section, i.e. the frame with the +timestamp start will be the first frame in the output. +

+
+
end
+

Specify the time of the first frame that will be dropped, i.e. the frame +immediately preceding the one with the timestamp end will be the last +frame in the output. +

+
+
start_pts
+

This is the same as start, except this option sets the start timestamp +in timebase units instead of seconds. +

+
+
end_pts
+

This is the same as end, except this option sets the end timestamp +in timebase units instead of seconds. +

+
+
duration
+

The maximum duration of the output in seconds. +

+
+
start_frame
+

The number of the first frame that should be passed to the output. +

+
+
end_frame
+

The number of the first frame that should be dropped. +

+
+ +

start, end, and duration are expressed as time +duration specifications; see +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

Note that the first two sets of the start/end options and the duration +option look at the frame timestamp, while the _frame variants simply count the +frames that pass through the filter. Also note that this filter does not modify +the timestamps. If you wish for the output timestamps to start at zero, insert a +setpts filter after the trim filter. +

+

If multiple start or end options are set, this filter tries to be greedy and +keep all the frames that match at least one of the specified constraints. To keep +only the part that matches all the constraints at once, chain multiple trim +filters. +

+

The defaults are such that all the input is kept. So it is possible to set e.g. +just the end values to keep everything before the specified time. +

+

Examples: +

    +
  • Drop everything except the second minute of input: +
    +
    ffmpeg -i INPUT -vf trim=60:120
    +
    + +
  • Keep only the first second: +
    +
    ffmpeg -i INPUT -vf trim=duration=1
    +
    + +
+ +
+
+

39.262 unpremultiply

+

Apply alpha unpremultiply effect to input video stream using first plane +of second stream as alpha. +

+

Both streams must have same dimensions and same pixel format. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+

If the format has 1 or 2 components, then luma is bit 0. +If the format has 3 or 4 components: +for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red; +for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V. +If present, the alpha channel is always the last bit. +

+
+
inplace
+

Do not require 2nd input for processing, instead use alpha plane from input stream. +

+
+ +
+
+

39.263 unsharp

+ +

Sharpen or blur the input video. +

+

It accepts the following parameters: +

+
+
luma_msize_x, lx
+

Set the luma matrix horizontal size. It must be an odd integer between +3 and 23. The default value is 5. +

+
+
luma_msize_y, ly
+

Set the luma matrix vertical size. It must be an odd integer between 3 +and 23. The default value is 5. +

+
+
luma_amount, la
+

Set the luma effect strength. It must be a floating point number, reasonable +values lay between -1.5 and 1.5. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+

Default value is 1.0. +

+
+
chroma_msize_x, cx
+

Set the chroma matrix horizontal size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
chroma_msize_y, cy
+

Set the chroma matrix vertical size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
chroma_amount, ca
+

Set the chroma effect strength. It must be a floating point number, reasonable +values lay between -1.5 and 1.5. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+

Default value is 0.0. +

+
+
alpha_msize_x, ax
+

Set the alpha matrix horizontal size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
alpha_msize_y, ay
+

Set the alpha matrix vertical size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
alpha_amount, aa
+

Set the alpha effect strength. It must be a floating point number, reasonable +values lay between -1.5 and 1.5. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+

Default value is 0.0. +

+
+
+ +

All parameters are optional and default to the equivalent of the +string ’5:5:1.0:5:5:0.0’. +

+ +
+

39.263.1 Examples

+ +
    +
  • Apply strong luma sharpen effect: +
    +
    unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
    +
    + +
  • Apply a strong blur of both luma and chroma parameters: +
    +
    unsharp=7:7:-2:7:7:-2
    +
    +
+ +
+
+
+

39.264 untile

+ +

Decompose a video made of tiled images into the individual images. +

+

The frame rate of the output video is the frame rate of the input video +multiplied by the number of tiles. +

+

This filter does the reverse of tile. +

+

The filter accepts the following options: +

+
+
layout
+

Set the grid size (i.e. the number of lines and columns). For the syntax of +this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+ + +
+

39.264.1 Examples

+ +
    +
  • Produce a 1-second video from a still image file made of 25 frames stacked +vertically, like an analogic film reel: +
    +
    ffmpeg -r 1 -i image.jpg -vf untile=1x25 movie.mkv
    +
    +
+ +
+
+
+

39.265 uspp

+ +

Apply ultra slow/simple postprocessing filter that compresses and decompresses +the image at several (or - in the case of quality level 8 - all) +shifts and average the results. +

+

The way this differs from the behavior of spp is that uspp actually encodes & +decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8 +DCT similar to MJPEG. +

+

This filter is only available in ffmpeg version 4.4 or earlier. +

+

The filter accepts the following options: +

+
+
quality
+

Set quality. This option defines the number of levels for averaging. It accepts +an integer in the range 0-8. If set to 0, the filter will have no +effect. A value of 8 means the higher quality. For each increment of +that value the speed drops by a factor of approximately 2. Default value is +3. +

+
+
qp
+

Force a constant quantization parameter. If not set, the filter will use the QP +from the video stream (if available). +

+
+
codec
+

Use specified codec instead of snow. +

+
+ +
+
+

39.266 v360

+ +

Convert 360 videos between various formats. +

+

The filter accepts the following options: +

+
+
input
+
output
+

Set format of the input/output video. +

+

Available formats: +

+
+
e
+
equirect
+

Equirectangular projection. +

+
+
c3x2
+
c6x1
+
c1x6
+

Cubemap with 3x2/6x1/1x6 layout. +

+

Format specific options: +

+
+
in_pad
+
out_pad
+

Set padding proportion for the input/output cubemap. Values in decimals. +

+

Example values: +

+
0
+

No padding. +

+
0.01
+

1% of face is padding. For example, with 1920x1280 resolution face size would be 640x640 and padding would be 3 pixels from each side. (640 * 0.01 = 6 pixels) +

+
+ +

Default value is 0. +Maximum value is 0.1. +

+
+
fin_pad
+
fout_pad
+

Set fixed padding for the input/output cubemap. Values in pixels. +

+

Default value is 0. If greater than zero it overrides other padding options. +

+
+
in_forder
+
out_forder
+

Set order of faces for the input/output cubemap. Choose one direction for each position. +

+

Designation of directions: +

+
r
+

right +

+
l
+

left +

+
u
+

up +

+
d
+

down +

+
f
+

forward +

+
b
+

back +

+
+ +

Default value is rludfb. +

+
+
in_frot
+
out_frot
+

Set rotation of faces for the input/output cubemap. Choose one angle for each position. +

+

Designation of angles: +

+
0
+

0 degrees clockwise +

+
1
+

90 degrees clockwise +

+
2
+

180 degrees clockwise +

+
3
+

270 degrees clockwise +

+
+ +

Default value is 000000. +

+
+ +
+
eac
+

Equi-Angular Cubemap. +

+
+
flat
+
gnomonic
+
rectilinear
+

Regular video. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
dfisheye
+

Dual fisheye. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
barrel
+
fb
+
barrelsplit
+

Facebook’s 360 formats. +

+
+
sg
+

Stereographic format. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
mercator
+

Mercator format. +

+
+
ball
+

Ball format, gives significant distortion toward the back. +

+
+
hammer
+

Hammer-Aitoff map projection format. +

+
+
sinusoidal
+

Sinusoidal map projection format. +

+
+
fisheye
+

Fisheye projection. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
pannini
+

Pannini projection. +

+

Format specific options: +

+
h_fov
+

Set output pannini parameter. +

+
+
ih_fov
+

Set input pannini parameter. +

+
+ +
+
cylindrical
+

Cylindrical projection. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
perspective
+

Perspective projection. (output only) +

+

Format specific options: +

+
v_fov
+

Set perspective parameter. +

+
+ +
+
tetrahedron
+

Tetrahedron projection. +

+
+
tsp
+

Truncated square pyramid projection. +

+
+
he
+
hequirect
+

Half equirectangular projection. +

+
+
equisolid
+

Equisolid format. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
og
+

Orthographic format. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
octahedron
+

Octahedron projection. +

+
+
cylindricalea
+

Cylindrical Equal Area projection. +

+
+ +
+
interp
+

Set interpolation method.
+Note: more complex interpolation methods require much more memory to run. +

+

Available methods: +

+
+
near
+
nearest
+

Nearest neighbour. +

+
line
+
linear
+

Bilinear interpolation. +

+
lagrange9
+

Lagrange9 interpolation. +

+
cube
+
cubic
+

Bicubic interpolation. +

+
lanc
+
lanczos
+

Lanczos interpolation. +

+
sp16
+
spline16
+

Spline16 interpolation. +

+
gauss
+
gaussian
+

Gaussian interpolation. +

+
mitchell
+

Mitchell interpolation. +

+
+ +

Default value is line. +

+
+
w
+
h
+

Set the output video resolution. +

+

Default resolution depends on formats. +

+
+
in_stereo
+
out_stereo
+

Set the input/output stereo format. +

+
+
2d
+

2D mono +

+
sbs
+

Side by side +

+
tb
+

Top bottom +

+
+ +

Default value is 2d for input and output format. +

+
+
yaw
+
pitch
+
roll
+

Set rotation for the output video. Values in degrees. +

+
+
rorder
+

Set rotation order for the output video. Choose one item for each position. +

+
+
y, Y
+

yaw +

+
p, P
+

pitch +

+
r, R
+

roll +

+
+ +

Default value is ypr. +

+
+
h_flip
+
v_flip
+
d_flip
+

Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values. +

+
+
ih_flip
+
iv_flip
+

Set if input video is flipped horizontally/vertically. Boolean values. +

+
+
in_trans
+

Set if input video is transposed. Boolean value, by default disabled. +

+
+
out_trans
+

Set if output video needs to be transposed. Boolean value, by default disabled. +

+
+
h_offset
+
v_offset
+

Set output horizontal/vertical off-axis offset. Default is set to 0. +Allowed range is from -1 to 1. +

+
+
alpha_mask
+

Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled. +

+
+
reset_rot
+

Reset rotation of output video. Boolean value, by default disabled. +

+
+ + +
+

39.266.1 Examples

+ +
    +
  • Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation: +
    +
    ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
    +
    +
  • Extract back view of Equi-Angular Cubemap: +
    +
    ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
    +
    +
  • Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format: +
    +
    v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
    +
    +
+ +
+
+

39.266.2 Commands

+ +

This filter supports subset of above options as commands. +

+
+
+
+

39.267 vaguedenoiser

+ +

Apply a wavelet based denoiser. +

+

It transforms each frame from the video input into the wavelet domain, +using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to +the obtained coefficients. It does an inverse wavelet transform after. +Due to wavelet properties, it should give a nice smoothed result, and +reduced noise, without blurring picture features. +

+

This filter accepts the following options: +

+
+
threshold
+

The filtering strength. The higher, the more filtered the video will be. +Hard thresholding can use a higher threshold than soft thresholding +before the video looks overfiltered. Default value is 2. +

+
+
method
+

The filtering method the filter will use. +

+

It accepts the following values: +

+
hard
+

All values under the threshold will be zeroed. +

+
+
soft
+

All values under the threshold will be zeroed. All values above will be +reduced by the threshold. +

+
+
garrote
+

Scales or nullifies coefficients - intermediary between (more) soft and +(less) hard thresholding. +

+
+ +

Default is garrote. +

+
+
nsteps
+

Number of times, the wavelet will decompose the picture. Picture can’t +be decomposed beyond a particular point (typically, 8 for a 640x480 +frame - as 2^9 = 512 > 480). Valid values are integers between 1 and 32. Default value is 6. +

+
+
percent
+

Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85. +

+
+
planes
+

A list of the planes to process. By default all planes are processed. +

+
+
type
+

The threshold type the filter will use. +

+

It accepts the following values: +

+
universal
+

Threshold used is same for all decompositions. +

+
+
bayes
+

Threshold used depends also on each decomposition coefficients. +

+
+ +

Default is universal. +

+
+ +
+
+

39.268 varblur

+

Apply variable blur filter by using 2nd video stream to set blur radius. +The 2nd stream must have the same dimensions. +

+

This filter accepts the following options: +

+
+
min_r
+

Set min allowed radius. Allowed range is from 0 to 254. Default is 0. +

+
max_r
+

Set max allowed radius. Allowed range is from 1 to 255. Default is 8. +

+
planes
+

Set which planes to process. By default, all are used. +

+
+ +

The varblur filter also supports the framesync options. +

+ +
+

39.268.1 Commands

+ +

This filter supports all the above options as commands. +

+
+
+
+

39.269 vectorscope

+ +

Display 2 color component values in the two dimensional graph (which is called +a vectorscope). +

+

This filter accepts the following options: +

+
+
mode, m
+

Set vectorscope mode. +

+

It accepts the following values: +

+
gray
+
tint
+

Gray values are displayed on graph, higher brightness means more pixels have +same component color value on location in graph. This is the default mode. +

+
+
color
+

Gray values are displayed on graph. Surrounding pixels values which are not +present in video frame are drawn in gradient of 2 color components which are +set by option x and y. The 3rd color component is static. +

+
+
color2
+

Actual color components values present in video frame are displayed on graph. +

+
+
color3
+

Similar as color2 but higher frequency of same values x and y +on graph increases value of another color component, which is luminance by +default values of x and y. +

+
+
color4
+

Actual colors present in video frame are displayed on graph. If two different +colors map to same position on graph then color with higher value of component +not present in graph is picked. +

+
+
color5
+

Gray values are displayed on graph. Similar to color but with 3rd color +component picked from radial gradient. +

+
+ +
+
x
+

Set which color component will be represented on X-axis. Default is 1. +

+
+
y
+

Set which color component will be represented on Y-axis. Default is 2. +

+
+
intensity, i
+

Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness +of color component which represents frequency of (X, Y) location in graph. +

+
+
envelope, e
+
+
none
+

No envelope, this is default. +

+
+
instant
+

Instant envelope, even darkest single pixel will be clearly highlighted. +

+
+
peak
+

Hold maximum and minimum values presented in graph over time. This way you +can still spot out of range values without constantly looking at vectorscope. +

+
+
peak+instant
+

Peak and instant envelope combined together. +

+
+ +
+
graticule, g
+

Set what kind of graticule to draw. +

+
none
+
green
+
color
+
invert
+
+ +
+
opacity, o
+

Set graticule opacity. +

+
+
flags, f
+

Set graticule flags. +

+
+
white
+

Draw graticule for white point. +

+
+
black
+

Draw graticule for black point. +

+
+
name
+

Draw color points short names. +

+
+ +
+
bgopacity, b
+

Set background opacity. +

+
+
lthreshold, l
+

Set low threshold for color component not represented on X or Y axis. +Values lower than this value will be ignored. Default is 0. +Note this value is multiplied with actual max possible value one pixel component +can have. So for 8-bit input and low threshold value of 0.1 actual threshold +is 0.1 * 255 = 25. +

+
+
hthreshold, h
+

Set high threshold for color component not represented on X or Y axis. +Values higher than this value will be ignored. Default is 1. +Note this value is multiplied with actual max possible value one pixel component +can have. So for 8-bit input and high threshold value of 0.9 actual threshold +is 0.9 * 255 = 230. +

+
+
colorspace, c
+

Set what kind of colorspace to use when drawing graticule. +

+
auto
+
601
+
709
+
+

Default is auto. +

+
+
tint0, t0
+
tint1, t1
+

Set color tint for gray/tint vectorscope mode. By default both options are zero. +This means no tint, and output will remain gray. +

+
+ +
+
+

39.270 vidstabdetect

+ +

Analyze video stabilization/deshaking. Perform pass 1 of 2, see +vidstabtransform for pass 2. +

+

This filter generates a file with relative translation and rotation +transform information about subsequent frames, which is then used by +the vidstabtransform filter. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libvidstab. +

+

This filter accepts the following options: +

+
+
result
+

Set the path to the file used to write the transforms information. +Default value is transforms.trf. +

+
+
shakiness
+

Set how shaky the video is and how quick the camera is. It accepts an +integer in the range 1-10, a value of 1 means little shakiness, a +value of 10 means strong shakiness. Default value is 5. +

+
+
accuracy
+

Set the accuracy of the detection process. It must be a value in the +range 1-15. A value of 1 means low accuracy, a value of 15 means high +accuracy. Default value is 15. +

+
+
stepsize
+

Set stepsize of the search process. The region around minimum is +scanned with 1 pixel resolution. Default value is 6. +

+
+
mincontrast
+

Set minimum contrast. Below this value a local measurement field is +discarded. Must be a floating point value in the range 0-1. Default +value is 0.3. +

+
+
tripod
+

Set reference frame number for tripod mode. +

+

If enabled, the motion of the frames is compared to a reference frame +in the filtered stream, identified by the specified number. The idea +is to compensate all movements in a more-or-less static scene and keep +the camera view absolutely still. +

+

If set to 0, it is disabled. The frames are counted starting from 1. +

+
+
show
+

Show fields and transforms in the resulting frames. It accepts an +integer in the range 0-2. Default value is 0, which disables any +visualization. +

+
+ + +
+

39.270.1 Examples

+ +
    +
  • Use default values: +
    +
    vidstabdetect
    +
    + +
  • Analyze strongly shaky movie and put the results in file +mytransforms.trf: +
    +
    vidstabdetect=shakiness=10:accuracy=15:result="mytransforms.trf"
    +
    + +
  • Visualize the result of internal transformations in the resulting +video: +
    +
    vidstabdetect=show=1
    +
    + +
  • Analyze a video with medium shakiness using ffmpeg: +
    +
    ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
    +
    +
+ +
+
+
+

39.271 vidstabtransform

+ +

Video stabilization/deshaking: pass 2 of 2, +see vidstabdetect for pass 1. +

+

Read a file with transform information for each frame and +apply/compensate them. Together with the vidstabdetect +filter this can be used to deshake videos. See also +http://public.hronopik.de/vid.stab. It is important to also use +the unsharp filter, see below. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libvidstab. +

+ +
+

39.271.1 Options

+ +
+
input
+

Set path to the file used to read the transforms. Default value is +transforms.trf. +

+
+
smoothing
+

Set the number of frames (value*2 + 1) used for lowpass filtering the +camera movements. Default value is 10. +

+

For example a number of 10 means that 21 frames are used (10 in the +past and 10 in the future) to smoothen the motion in the video. A +larger value leads to a smoother video, but limits the acceleration of +the camera (pan/tilt movements). 0 is a special case where a static +camera is simulated. +

+
+
optalgo
+

Set the camera path optimization algorithm. +

+

Accepted values are: +

+
gauss
+

gaussian kernel low-pass filter on camera motion (default) +

+
avg
+

averaging on transformations +

+
+ +
+
maxshift
+

Set maximal number of pixels to translate frames. Default value is -1, +meaning no limit. +

+
+
maxangle
+

Set maximal angle in radians (degree*PI/180) to rotate frames. Default +value is -1, meaning no limit. +

+
+
crop
+

Specify how to deal with borders that may be visible due to movement +compensation. +

+

Available values are: +

+
keep
+

keep image information from previous frame (default) +

+
black
+

fill the border black +

+
+ +
+
invert
+

Invert transforms if set to 1. Default value is 0. +

+
+
relative
+

Consider transforms as relative to previous frame if set to 1, +absolute if set to 0. Default value is 0. +

+
+
zoom
+

Set percentage to zoom. A positive value will result in a zoom-in +effect, a negative value in a zoom-out effect. Default value is 0 (no +zoom). +

+
+
optzoom
+

Set optimal zooming to avoid borders. +

+

Accepted values are: +

+
0
+

disabled +

+
1
+

optimal static zoom value is determined (only very strong movements +will lead to visible borders) (default) +

+
2
+

optimal adaptive zoom value is determined (no borders will be +visible), see zoomspeed +

+
+ +

Note that the value given at zoom is added to the one calculated here. +

+
+
zoomspeed
+

Set percent to zoom maximally each frame (enabled when +optzoom is set to 2). Range is from 0 to 5, default value is +0.25. +

+
+
interpol
+

Specify type of interpolation. +

+

Available values are: +

+
no
+

no interpolation +

+
linear
+

linear only horizontal +

+
bilinear
+

linear in both directions (default) +

+
bicubic
+

cubic in both directions (slow) +

+
+ +
+
tripod
+

Enable virtual tripod mode if set to 1, which is equivalent to +relative=0:smoothing=0. Default value is 0. +

+

Use also tripod option of vidstabdetect. +

+
+
debug
+

Increase log verbosity if set to 1. Also the detected global motions +are written to the temporary file global_motions.trf. Default +value is 0. +

+
+ +
+
+

39.271.2 Examples

+ +
    +
  • Use ffmpeg for a typical stabilization with default values: +
    +
    ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
    +
    + +

    Note the use of the unsharp filter which is always recommended. +

    +
  • Zoom in a bit more and load transform data from a given file: +
    +
    vidstabtransform=zoom=5:input="mytransforms.trf"
    +
    + +
  • Smoothen the video even more: +
    +
    vidstabtransform=smoothing=30
    +
    +
+ +
+
+
+

39.272 vflip

+ +

Flip the input video vertically. +

+

For example, to vertically flip a video with ffmpeg: +

+
ffmpeg -i in.avi -vf "vflip" out.avi
+
+ +
+
+

39.273 vfrdet

+ +

Detect variable frame rate video. +

+

This filter tries to detect if the input is variable or constant frame rate. +

+

At end it will output number of frames detected as having variable delta pts, +and ones with constant delta pts. +If there was frames with variable delta, than it will also show min, max and +average delta encountered. +

+
+
+

39.274 vibrance

+ +

Boost or alter saturation. +

+

The filter accepts the following options: +

+
intensity
+

Set strength of boost if positive value or strength of alter if negative value. +Default is 0. Allowed range is from -2 to 2. +

+
+
rbal
+

Set the red balance. Default is 1. Allowed range is from -10 to 10. +

+
+
gbal
+

Set the green balance. Default is 1. Allowed range is from -10 to 10. +

+
+
bbal
+

Set the blue balance. Default is 1. Allowed range is from -10 to 10. +

+
+
rlum
+

Set the red luma coefficient. +

+
+
glum
+

Set the green luma coefficient. +

+
+
blum
+

Set the blue luma coefficient. +

+
+
alternate
+

If intensity is negative and this is set to 1, colors will change, +otherwise colors will be less saturated, more towards gray. +

+
+ + +
+

39.274.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

39.275 vif

+ +

Obtain the average VIF (Visual Information Fidelity) between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained average VIF score is printed through the logging system. +

+

The filter stores the calculated VIF score of each frame. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi vif -f null -
+
+ +
+
+

39.276 vignette

+ +

Make or reverse a natural vignetting effect. +

+

The filter accepts the following options: +

+
+
angle, a
+

Set lens angle expression as a number of radians. +

+

The value is clipped in the [0,PI/2] range. +

+

Default value: "PI/5" +

+
+
x0
+
y0
+

Set center coordinates expressions. Respectively "w/2" and "h/2" +by default. +

+
+
mode
+

Set forward/backward mode. +

+

Available modes are: +

+
forward
+

The larger the distance from the central point, the darker the image becomes. +

+
+
backward
+

The larger the distance from the central point, the brighter the image becomes. +This can be used to reverse a vignette effect, though there is no automatic +detection to extract the lens angle and other settings (yet). It can +also be used to create a burning effect. +

+
+ +

Default value is ‘forward’. +

+
+
eval
+

Set evaluation mode for the expressions (angle, x0, y0). +

+

It accepts the following values: +

+
init
+

Evaluate expressions only once during the filter initialization. +

+
+
frame
+

Evaluate expressions for each incoming frame. This is way slower than the +‘init’ mode since it requires all the scalers to be re-computed, but it +allows advanced dynamic expressions. +

+
+ +

Default value is ‘init’. +

+
+
dither
+

Set dithering to reduce the circular banding effects. Default is 1 +(enabled). +

+
+
aspect
+

Set vignette aspect. This setting allows one to adjust the shape of the vignette. +Setting this value to the SAR of the input will make a rectangular vignetting +following the dimensions of the video. +

+

Default is 1/1. +

+
+ + +
+

39.276.1 Expressions

+ +

The alpha, x0 and y0 expressions can contain the +following parameters. +

+
+
w
+
h
+

input width and height +

+
+
n
+

the number of input frame, starting from 0 +

+
+
pts
+

the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in +TB units, NAN if undefined +

+
+
r
+

frame rate of the input video, NAN if the input frame rate is unknown +

+
+
t
+

the PTS (Presentation TimeStamp) of the filtered video frame, +expressed in seconds, NAN if undefined +

+
+
tb
+

time base of the input video +

+
+ + +
+
+

39.276.2 Examples

+ +
    +
  • Apply simple strong vignetting effect: +
    +
    vignette=PI/4
    +
    + +
  • Make a flickering vignetting: +
    +
    vignette='PI/4+random(1)*PI/50':eval=frame
    +
    + +
+ +
+
+
+

39.277 vmafmotion

+ +

Obtain the average VMAF motion score of a video. +It is one of the component metrics of VMAF. +

+

The obtained average motion score is printed through the logging system. +

+

The filter accepts the following options: +

+
+
stats_file
+

If specified, the filter will use the named file to save the motion score of +each frame with respect to the previous frame. +When filename equals "-" the data is sent to standard output. +

+
+ +

Example: +

+
ffmpeg -i ref.mpg -vf vmafmotion -f null -
+
+ +
+
+

39.278 vstack

+

Stack input videos vertically. +

+

All streams must be of same pixel format and of same width. +

+

Note that this filter is faster than using overlay and pad filter +to create same output. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of input streams. Default is 2. +

+
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+ +
+
+

39.279 w3fdif

+ +

Deinterlace the input video ("w3fdif" stands for "Weston 3 Field +Deinterlacing Filter"). +

+

Based on the process described by Martin Weston for BBC R&D, and +implemented based on the de-interlace algorithm written by Jim +Easterbrook for BBC R&D, the Weston 3 field deinterlacing filter +uses filter coefficients calculated by BBC R&D. +

+

This filter uses field-dominance information in frame to decide which +of each pair of fields to place first in the output. +If it gets it wrong use setfield filter before w3fdif filter. +

+

There are two sets of filter coefficients, so called "simple" +and "complex". Which set of filter coefficients is used can +be set by passing an optional parameter: +

+
+
filter
+

Set the interlacing filter coefficients. Accepts one of the following values: +

+
+
simple
+

Simple filter coefficient set. +

+
complex
+

More-complex filter coefficient set. +

+
+

Default value is ‘complex’. +

+
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
frame
+

Output one frame for each frame. +

+
field
+

Output one frame for each field. +

+
+ +

The default value is field. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
tff
+

Assume the top field is first. +

+
bff
+

Assume the bottom field is first. +

+
auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following values: +

+
+
all
+

Deinterlace all frames, +

+
interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

Default value is ‘all’. +

+
+ + +
+

39.279.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

39.280 waveform

+

Video waveform monitor. +

+

The waveform monitor plots color component intensity. By default luminance +only. Each column of the waveform corresponds to a column of pixels in the +source video. +

+

It accepts the following options: +

+
+
mode, m
+

Can be either row, or column. Default is column. +In row mode, the graph on the left side represents color component value 0 and +the right side represents value = 255. In column mode, the top side represents +color component value = 0 and bottom side represents value = 255. +

+
+
intensity, i
+

Set intensity. Smaller values are useful to find out how many values of the same +luminance are distributed across input rows/columns. +Default value is 0.04. Allowed range is [0, 1]. +

+
+
mirror, r
+

Set mirroring mode. 0 means unmirrored, 1 means mirrored. +In mirrored mode, higher values will be represented on the left +side for row mode and at the top for column mode. Default is +1 (mirrored). +

+
+
display, d
+

Set display mode. +It accepts the following values: +

+
overlay
+

Presents information identical to that in the parade, except +that the graphs representing color components are superimposed directly +over one another. +

+

This display mode makes it easier to spot relative differences or similarities +in overlapping areas of the color components that are supposed to be identical, +such as neutral whites, grays, or blacks. +

+
+
stack
+

Display separate graph for the color components side by side in +row mode or one below the other in column mode. +

+
+
parade
+

Display separate graph for the color components side by side in +column mode or one below the other in row mode. +

+

Using this display mode makes it easy to spot color casts in the highlights +and shadows of an image, by comparing the contours of the top and the bottom +graphs of each waveform. Since whites, grays, and blacks are characterized +by exactly equal amounts of red, green, and blue, neutral areas of the picture +should display three waveforms of roughly equal width/height. If not, the +correction is easy to perform by making level adjustments the three waveforms. +

+
+

Default is stack. +

+
+
components, c
+

Set which color components to display. Default is 1, which means only luminance +or red color component if input is in RGB colorspace. If is set for example to +7 it will display all 3 (if) available color components. +

+
+
envelope, e
+
+
none
+

No envelope, this is default. +

+
+
instant
+

Instant envelope, minimum and maximum values presented in graph will be easily +visible even with small step value. +

+
+
peak
+

Hold minimum and maximum values presented in graph across time. This way you +can still spot out of range values without constantly looking at waveforms. +

+
+
peak+instant
+

Peak and instant envelope combined together. +

+
+ +
+
filter, f
+
+
lowpass
+

No filtering, this is default. +

+
+
flat
+

Luma and chroma combined together. +

+
+
aflat
+

Similar as above, but shows difference between blue and red chroma. +

+
+
xflat
+

Similar as above, but use different colors. +

+
+
yflat
+

Similar as above, but again with different colors. +

+
+
chroma
+

Displays only chroma. +

+
+
color
+

Displays actual color value on waveform. +

+
+
acolor
+

Similar as above, but with luma showing frequency of chroma values. +

+
+ +
+
graticule, g
+

Set which graticule to display. +

+
+
none
+

Do not display graticule. +

+
+
green
+

Display green graticule showing legal broadcast ranges. +

+
+
orange
+

Display orange graticule showing legal broadcast ranges. +

+
+
invert
+

Display invert graticule showing legal broadcast ranges. +

+
+ +
+
opacity, o
+

Set graticule opacity. +

+
+
flags, fl
+

Set graticule flags. +

+
+
numbers
+

Draw numbers above lines. By default enabled. +

+
+
dots
+

Draw dots instead of lines. +

+
+ +
+
scale, s
+

Set scale used for displaying graticule. +

+
+
digital
+
millivolts
+
ire
+
+

Default is digital. +

+
+
bgopacity, b
+

Set background opacity. +

+
+
tint0, t0
+
tint1, t1
+

Set tint for output. +Only used with lowpass filter and when display is not overlay and input +pixel formats are not RGB. +

+
+
fitmode, fm
+

Set sample aspect ratio of video output frames. +Can be used to configure waveform so it is not +streched too much in one of directions. +

+
+
none
+

Set sample aspect ration to 1/1. +

+
size
+

Set sample aspect ratio to match input size of video +

+
+

Default is ‘none’. +

+
+
input
+

Set input formats for filter to pick from. +Can be ‘all’, for selecting from all available formats, +or ‘first’, for selecting first available format. +Default is ‘first’. +

+
+ +
+
+

39.281 weave, doubleweave

+ +

The weave takes a field-based video input and join +each two sequential fields into single frame, producing a new double +height clip with half the frame rate and half the frame count. +

+

The doubleweave works same as weave but without +halving frame rate and frame count. +

+

It accepts the following option: +

+
+
first_field
+

Set first field. Available values are: +

+
+
top, t
+

Set the frame as top-field-first. +

+
+
bottom, b
+

Set the frame as bottom-field-first. +

+
+
+
+ + +
+

39.281.1 Examples

+ +
    +
  • Interlace video using select and separatefields filter: +
    +
    separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
    +
    +
+ +
+
+
+

39.282 xbr

+

Apply the xBR high-quality magnification filter which is designed for pixel +art. It follows a set of edge-detection rules, see +https://forums.libretro.com/t/xbr-algorithm-tutorial/123. +

+

It accepts the following option: +

+
+
n
+

Set the scaling dimension: 2 for 2xBR, 3 for +3xBR and 4 for 4xBR. +Default is 3. +

+
+ +
+
+

39.283 xcorrelate

+

Apply normalized cross-correlation between first and second input video stream. +

+

Second input video stream dimensions must be lower than first input video stream. +

+

The filter accepts the following options: +

+
+
planes
+

Set which planes to process. +

+
+
secondary
+

Set which secondary video frames will be processed from second input video stream, +can be first or all. Default is all. +

+
+ +

The xcorrelate filter also supports the framesync options. +

+
+
+

39.284 xfade

+ +

Apply cross fade from one input video stream to another input video stream. +The cross fade is applied for specified duration. +

+

Both inputs must be constant frame-rate and have the same resolution, pixel format, +frame rate and timebase. +

+

The filter accepts the following options: +

+
+
transition
+

Set one of available transition effects: +

+
+
custom
+
fade
+
wipeleft
+
wiperight
+
wipeup
+
wipedown
+
slideleft
+
slideright
+
slideup
+
slidedown
+
circlecrop
+
rectcrop
+
distance
+
fadeblack
+
fadewhite
+
radial
+
smoothleft
+
smoothright
+
smoothup
+
smoothdown
+
circleopen
+
circleclose
+
vertopen
+
vertclose
+
horzopen
+
horzclose
+
dissolve
+
pixelize
+
diagtl
+
diagtr
+
diagbl
+
diagbr
+
hlslice
+
hrslice
+
vuslice
+
vdslice
+
hblur
+
fadegrays
+
wipetl
+
wipetr
+
wipebl
+
wipebr
+
squeezeh
+
squeezev
+
zoomin
+
fadefast
+
fadeslow
+
hlwind
+
hrwind
+
vuwind
+
vdwind
+
+

Default transition effect is fade. +

+
+
duration
+

Set cross fade duration in seconds. +Range is 0 to 60 seconds. +Default duration is 1 second. +

+
+
offset
+

Set cross fade start relative to first input stream in seconds. +Default offset is 0. +

+
+
expr
+

Set expression for custom transition effect. +

+

The expressions can use the following variables and functions: +

+
+
X
+
Y
+

The coordinates of the current sample. +

+
+
W
+
H
+

The width and height of the image. +

+
+
P
+

Progress of transition effect. +

+
+
PLANE
+

Currently processed plane. +

+
+
A
+

Return value of first input at current location and plane. +

+
+
B
+

Return value of second input at current location and plane. +

+
+
a0(x, y)
+
a1(x, y)
+
a2(x, y)
+
a3(x, y)
+

Return the value of the pixel at location (x,y) of the +first/second/third/fourth component of first input. +

+
+
b0(x, y)
+
b1(x, y)
+
b2(x, y)
+
b3(x, y)
+

Return the value of the pixel at location (x,y) of the +first/second/third/fourth component of second input. +

+
+
+
+ + +
+

39.284.1 Examples

+ +
    +
  • Cross fade from one input video to another input video, with fade transition and duration of transition +of 2 seconds starting at offset of 5 seconds: +
    +
    ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
    +
    +
+ +
+
+
+

39.285 xmedian

+

Pick median pixels from several input videos. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of inputs. +Default is 3. Allowed range is from 3 to 255. +If number of inputs is even number, than result will be mean value between two median values. +

+
+
planes
+

Set which planes to filter. Default value is 15, by which all planes are processed. +

+
+
percentile
+

Set median percentile. Default value is 0.5. +Default value of 0.5 will pick always median values, while 0 will pick +minimum values, and 1 maximum values. +

+
+ + +
+

39.285.1 Commands

+ +

This filter supports all above options as commands, excluding option inputs. +

+
+
+
+

39.286 xstack

+

Stack video inputs into custom layout. +

+

All streams must be of same pixel format. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of input streams. Default is 2. +

+
+
layout
+

Specify layout of inputs. +This option requires the desired layout configuration to be explicitly set by the user. +This sets position of each video input in output. Each input +is separated by ’|’. +The first number represents the column, and the second number represents the row. +Numbers start at 0 and are separated by ’_’. Optionally one can use wX and hX, +where X is video input from which to take width or height. +Multiple values can be used when separated by ’+’. In such +case values are summed together. +

+

Note that if inputs are of different sizes gaps may appear, as not all of +the output video frame will be filled. Similarly, videos can overlap each +other if their position doesn’t leave enough space for the full frame of +adjoining videos. +

+

For 2 inputs, a default layout of 0_0|w0_0 (equivalent to +grid=2x1) is set. In all other cases, a layout or a grid must be set by +the user. Either grid or layout can be specified at a time. +Specifying both will result in an error. +

+
+
grid
+

Specify a fixed size grid of inputs. +This option is used to create a fixed size grid of the input streams. Set the +grid size in the form COLUMNSxROWS. There must be ROWS * COLUMNS +input streams and they will be arranged as a grid with ROWS rows and +COLUMNS columns. When using this option, each input stream within a row +must have the same height and all the rows must have the same width. +

+

If grid is set, then inputs option is ignored and is implicitly +set to ROWS * COLUMNS. +

+

For 2 inputs, a default grid of 2x1 (equivalent to +layout=0_0|w0_0) is set. In all other cases, a layout or a grid must be +set by the user. Either grid or layout can be specified at a time. +Specifying both will result in an error. +

+
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+
fill
+

If set to valid color, all unused pixels will be filled with that color. +By default fill is set to none, so it is disabled. +

+
+ + +
+

39.286.1 Examples

+ +
    +
  • Display 4 inputs into 2x2 grid. + +

    Layout: +

    +
    input1(0, 0)  | input3(w0, 0)
    +input2(0, h0) | input4(w0, h0)
    +
    + +
    +
    xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
    +
    + +

    Note that if inputs are of different sizes, gaps or overlaps may occur. +

    +
  • Display 4 inputs into 1x4 grid. + +

    Layout: +

    +
    input1(0, 0)
    +input2(0, h0)
    +input3(0, h0+h1)
    +input4(0, h0+h1+h2)
    +
    + +
    +
    xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
    +
    + +

    Note that if inputs are of different widths, unused space will appear. +

    +
  • Display 9 inputs into 3x3 grid. + +

    Layout: +

    +
    input1(0, 0)       | input4(w0, 0)      | input7(w0+w3, 0)
    +input2(0, h0)      | input5(w0, h0)     | input8(w0+w3, h0)
    +input3(0, h0+h1)   | input6(w0, h0+h1)  | input9(w0+w3, h0+h1)
    +
    + +
    +
    xstack=inputs=9:layout=0_0|0_h0|0_h0+h1|w0_0|w0_h0|w0_h0+h1|w0+w3_0|w0+w3_h0|w0+w3_h0+h1
    +
    + +

    Note that if inputs are of different sizes, gaps or overlaps may occur. +

    +
  • Display 16 inputs into 4x4 grid. + +

    Layout: +

    +
    input1(0, 0)       | input5(w0, 0)       | input9 (w0+w4, 0)       | input13(w0+w4+w8, 0)
    +input2(0, h0)      | input6(w0, h0)      | input10(w0+w4, h0)      | input14(w0+w4+w8, h0)
    +input3(0, h0+h1)   | input7(w0, h0+h1)   | input11(w0+w4, h0+h1)   | input15(w0+w4+w8, h0+h1)
    +input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
    +
    + +
    +
    xstack=inputs=16:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0+w4_0|
    +w0+w4_h0|w0+w4_h0+h1|w0+w4_h0+h1+h2|w0+w4+w8_0|w0+w4+w8_h0|w0+w4+w8_h0+h1|w0+w4+w8_h0+h1+h2
    +
    + +

    Note that if inputs are of different sizes, gaps or overlaps may occur. +

    +
+ +
+
+
+

39.287 yadif

+ +

Deinterlace the input video ("yadif" means "yet another deinterlacing +filter"). +

+

It accepts the following parameters: +

+ +
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
0, send_frame
+

Output one frame for each frame. +

+
1, send_field
+

Output one frame for each field. +

+
2, send_frame_nospatial
+

Like send_frame, but it skips the spatial interlacing check. +

+
3, send_field_nospatial
+

Like send_field, but it skips the spatial interlacing check. +

+
+ +

The default value is send_frame. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
0, tff
+

Assume the top field is first. +

+
1, bff
+

Assume the bottom field is first. +

+
-1, auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
0, all
+

Deinterlace all frames. +

+
1, interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+ +
+
+

39.288 yadif_cuda

+ +

Deinterlace the input video using the yadif algorithm, but implemented +in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec +and/or nvenc. +

+

It accepts the following parameters: +

+ +
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
0, send_frame
+

Output one frame for each frame. +

+
1, send_field
+

Output one frame for each field. +

+
2, send_frame_nospatial
+

Like send_frame, but it skips the spatial interlacing check. +

+
3, send_field_nospatial
+

Like send_field, but it skips the spatial interlacing check. +

+
+ +

The default value is send_frame. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
0, tff
+

Assume the top field is first. +

+
1, bff
+

Assume the bottom field is first. +

+
-1, auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
0, all
+

Deinterlace all frames. +

+
1, interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+ +
+
+

39.289 yaepblur

+ +

Apply blur filter while preserving edges ("yaepblur" means "yet another edge preserving blur filter"). +The algorithm is described in +"J. S. Lee, Digital image enhancement and noise filtering by use of local statistics, IEEE Trans. Pattern Anal. Mach. Intell. PAMI-2, 1980." +

+

It accepts the following parameters: +

+
+
radius, r
+

Set the window radius. Default value is 3. +

+
+
planes, p
+

Set which planes to filter. Default is only the first plane. +

+
+
sigma, s
+

Set blur strength. Default value is 128. +

+
+ + +
+

39.289.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

39.290 zoompan

+ +

Apply Zoom & Pan effect. +

+

This filter accepts the following options: +

+
+
zoom, z
+

Set the zoom expression. Range is 1-10. Default is 1. +

+
+
x
+
y
+

Set the x and y expression. Default is 0. +

+
+
d
+

Set the duration expression in number of frames. +This sets for how many number of frames effect will last for +single input image. Default is 90. +

+
+
s
+

Set the output image size, default is ’hd720’. +

+
+
fps
+

Set the output frame rate, default is ’25’. +

+
+ +

Each expression can contain the following constants: +

+
+
in_w, iw
+

Input width. +

+
+
in_h, ih
+

Input height. +

+
+
out_w, ow
+

Output width. +

+
+
out_h, oh
+

Output height. +

+
+
in
+

Input frame count. +

+
+
on
+

Output frame count. +

+
+
in_time, it
+

The input timestamp expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
out_time, time, ot
+

The output timestamp expressed in seconds. +

+
+
x
+
y
+

Last calculated ’x’ and ’y’ position from ’x’ and ’y’ expression +for current input frame. +

+
+
px
+
py
+

’x’ and ’y’ of last output frame of previous input frame or 0 when there was +not yet such frame (first input frame). +

+
+
zoom
+

Last calculated zoom from ’z’ expression for current input frame. +

+
+
pzoom
+

Last calculated zoom of last output frame of previous input frame. +

+
+
duration
+

Number of output frames for current input frame. Calculated from ’d’ expression +for each input frame. +

+
+
pduration
+

number of output frames created for previous input frame +

+
+
a
+

Rational number: input width / input height +

+
+
sar
+

sample aspect ratio +

+
+
dar
+

display aspect ratio +

+
+
+ + +
+

39.290.1 Examples

+ +
    +
  • Zoom in up to 1.5x and pan at same time to some spot near center of picture: +
    +
    zoompan=z='min(zoom+0.0015,1.5)':d=700:x='if(gte(zoom,1.5),x,x+1/a)':y='if(gte(zoom,1.5),y,y+1)':s=640x360
    +
    + +
  • Zoom in up to 1.5x and pan always at center of picture: +
    +
    zoompan=z='min(zoom+0.0015,1.5)':d=700:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
    +
    + +
  • Same as above but without pausing: +
    +
    zoompan=z='min(max(zoom,pzoom)+0.0015,1.5)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
    +
    + +
  • Zoom in 2x into center of picture only for the first second of the input video: +
    +
    zoompan=z='if(between(in_time,0,1),2,1)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
    +
    + +
+ +
+
+
+

39.291 zscale

+

Scale (resize) the input video, using the z.lib library: +https://github.com/sekrit-twc/zimg. To enable compilation of this +filter, you need to configure FFmpeg with --enable-libzimg. +

+

The zscale filter forces the output display aspect ratio to be the same +as the input, by changing the output sample aspect ratio. +

+

If the input image format is different from the format requested by +the next filter, the zscale filter will convert the input to the +requested format. +

+ +
+

39.291.1 Options

+

The filter accepts the following options. +

+
+
width, w
+
height, h
+

Set the output video dimension expression. Default value is the input +dimension. +

+

If the width or w value is 0, the input width is used for +the output. If the height or h value is 0, the input height +is used for the output. +

+

If one and only one of the values is -n with n >= 1, the zscale filter +will use a value that maintains the aspect ratio of the input image, +calculated from the other specified dimension. After that it will, +however, make sure that the calculated dimension is divisible by n and +adjust the value if necessary. +

+

If both values are -n with n >= 1, the behavior will be identical to +both values being set to 0 as previously detailed. +

+

See below for the list of accepted constants for use in the dimension +expression. +

+
+
size, s
+

Set the video size. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
dither, d
+

Set the dither type. +

+

Possible values are: +

+
none
+
ordered
+
random
+
error_diffusion
+
+ +

Default is none. +

+
+
filter, f
+

Set the resize filter type. +

+

Possible values are: +

+
point
+
bilinear
+
bicubic
+
spline16
+
spline36
+
lanczos
+
+ +

Default is bilinear. +

+
+
range, r
+

Set the color range. +

+

Possible values are: +

+
input
+
limited
+
full
+
+ +

Default is same as input. +

+
+
primaries, p
+

Set the color primaries. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
170m
+
240m
+
2020
+
+ +

Default is same as input. +

+
+
transfer, t
+

Set the transfer characteristics. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
601
+
linear
+
2020_10
+
2020_12
+
smpte2084
+
iec61966-2-1
+
arib-std-b67
+
+ +

Default is same as input. +

+
+
matrix, m
+

Set the colorspace matrix. +

+

Possible value are: +

+
input
+
709
+
unspecified
+
470bg
+
170m
+
2020_ncl
+
2020_cl
+
+ +

Default is same as input. +

+
+
rangein, rin
+

Set the input color range. +

+

Possible values are: +

+
input
+
limited
+
full
+
+ +

Default is same as input. +

+
+
primariesin, pin
+

Set the input color primaries. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
170m
+
240m
+
2020
+
+ +

Default is same as input. +

+
+
transferin, tin
+

Set the input transfer characteristics. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
601
+
linear
+
2020_10
+
2020_12
+
+ +

Default is same as input. +

+
+
matrixin, min
+

Set the input colorspace matrix. +

+

Possible value are: +

+
input
+
709
+
unspecified
+
470bg
+
170m
+
2020_ncl
+
2020_cl
+
+ +
+
chromal, c
+

Set the output chroma location. +

+

Possible values are: +

+
input
+
left
+
center
+
topleft
+
top
+
bottomleft
+
bottom
+
+ +
+
chromalin, cin
+

Set the input chroma location. +

+

Possible values are: +

+
input
+
left
+
center
+
topleft
+
top
+
bottomleft
+
bottom
+
+ +
+
npl
+

Set the nominal peak luminance. +

+
+
param_a
+

Parameter A for scaling filters. Parameter "b" for bicubic, and the number of +filter taps for lanczos. +

+
+
param_b
+

Parameter B for scaling filters. Parameter "c" for bicubic. +

+
+ +

The values of the w and h options are expressions +containing the following constants: +

+
+
in_w
+
in_h
+

The input width and height +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (scaled) width and height +

+
+
ow
+
oh
+

These are the same as out_w and out_h +

+
+
a
+

The same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

The input display aspect ratio. Calculated from (iw / ih) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical input chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
ohsub
+
ovsub
+

horizontal and vertical output chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ +
+
+

39.291.2 Commands

+ +

This filter supports the following commands: +

+
width, w
+
height, h
+

Set the output video dimension expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ + +
+
+
+
+

40 OpenCL Video Filters

+ +

Below is a description of the currently available OpenCL video filters. +

+

To enable compilation of these filters you need to configure FFmpeg with +--enable-opencl. +

+

Running OpenCL filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph. +

+
-init_hw_device opencl[=name][:device[,key=value...]]
+

Initialise a new hardware device of type opencl called name, using the +given device parameters. +

+
+
-filter_hw_device name
+

Pass the hardware device called name to all filters in any filter graph. +

+
+
+ +

For more detailed information see https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options +

+
    +
  • Example of choosing the first device on the second platform and running avgblur_opencl filter with default parameters on it. +
    +
    -init_hw_device opencl=gpu:1.0 -filter_hw_device gpu -i INPUT -vf "hwupload, avgblur_opencl, hwdownload" OUTPUT
    +
    +
+ +

Since OpenCL filters are not able to access frame data in normal memory, all frame data needs to be uploaded(hwupload) to hardware surfaces connected to the appropriate device before being used and then downloaded(hwdownload) back to normal memory. Note that hwupload will upload to a surface with the same layout as the software frame, so it may be necessary to add a format filter immediately before to get the input into the right format and hwdownload does not support all formats on the output - it may be necessary to insert an additional format filter immediately following in the graph to get the output in a supported format. +

+ +
+

40.1 avgblur_opencl

+ +

Apply average blur filter. +

+

The filter accepts the following options: +

+
+
sizeX
+

Set horizontal radius size. +Range is [1, 1024] and default value is 1. +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
sizeY
+

Set vertical radius size. Range is [1, 1024] and default value is 0. If zero, sizeX value will be used. +

+
+ + +
+

40.1.1 Example

+ +
    +
  • Apply average blur filter with horizontal and vertical size of 3, setting each pixel of the output to the average value of the 7x7 region centered on it in the input. For pixels on the edges of the image, the region does not extend beyond the image boundaries, and so out-of-range coordinates are not used in the calculations. +
    +
    -i INPUT -vf "hwupload, avgblur_opencl=3, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

40.2 boxblur_opencl

+ +

Apply a boxblur algorithm to the input video. +

+

It accepts the following parameters: +

+
+
luma_radius, lr
+
luma_power, lp
+
chroma_radius, cr
+
chroma_power, cp
+
alpha_radius, ar
+
alpha_power, ap
+
+ +

A description of the accepted options follows. +

+
+
luma_radius, lr
+
chroma_radius, cr
+
alpha_radius, ar
+

Set an expression for the box radius in pixels used for blurring the +corresponding input plane. +

+

The radius value must be a non-negative number, and must not be +greater than the value of the expression min(w,h)/2 for the +luma and alpha planes, and of min(cw,ch)/2 for the chroma +planes. +

+

Default value for luma_radius is "2". If not specified, +chroma_radius and alpha_radius default to the +corresponding value set for luma_radius. +

+

The expressions can contain the following constants: +

+
w
+
h
+

The input width and height in pixels. +

+
+
cw
+
ch
+

The input chroma image width and height in pixels. +

+
+
hsub
+
vsub
+

The horizontal and vertical chroma subsample values. For example, for the +pixel format "yuv422p", hsub is 2 and vsub is 1. +

+
+ +
+
luma_power, lp
+
chroma_power, cp
+
alpha_power, ap
+

Specify how many times the boxblur filter is applied to the +corresponding plane. +

+

Default value for luma_power is 2. If not specified, +chroma_power and alpha_power default to the +corresponding value set for luma_power. +

+

A value of 0 will disable the effect. +

+
+ + +
+

40.2.1 Examples

+ +

Apply boxblur filter, setting each pixel of the output to the average value of box-radiuses luma_radius, chroma_radius, alpha_radius for each plane respectively. The filter will apply luma_power, chroma_power, alpha_power times onto the corresponding plane. For pixels on the edges of the image, the radius does not extend beyond the image boundaries, and so out-of-range coordinates are not used in the calculations. +

+
    +
  • Apply a boxblur filter with the luma, chroma, and alpha radius +set to 2 and luma, chroma, and alpha power set to 3. The filter will run 3 times with box-radius set to 2 for every plane of the image. +
    +
    -i INPUT -vf "hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload" OUTPUT
    +-i INPUT -vf "hwupload, boxblur_opencl=2:3, hwdownload" OUTPUT
    +
    + +
  • Apply a boxblur filter with luma radius set to 2, luma_power to 1, chroma_radius to 4, chroma_power to 5, alpha_radius to 3 and alpha_power to 7. + +

    For the luma plane, a 2x2 box radius will be run once. +

    +

    For the chroma plane, a 4x4 box radius will be run 5 times. +

    +

    For the alpha plane, a 3x3 box radius will be run 7 times. +

    +
    -i INPUT -vf "hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

40.3 colorkey_opencl

+

RGB colorspace color keying. +

+

The filter accepts the following options: +

+
+
color
+

The color which will be replaced with transparency. +

+
+
similarity
+

Similarity percentage with the key color. +

+

0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +

+

0.0 makes pixels either fully transparent, or not transparent at all. +

+

Higher values result in semi-transparent pixels, with a higher transparency +the more similar the pixels color is to the key color. +

+
+ + +
+

40.3.1 Examples

+ +
    +
  • Make every semi-green pixel in the input transparent with some slight blending: +
    +
    -i INPUT -vf "hwupload, colorkey_opencl=green:0.3:0.1, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

40.4 convolution_opencl

+ +

Apply convolution of 3x3, 5x5, 7x7 matrix. +

+

The filter accepts the following options: +

+
+
0m
+
1m
+
2m
+
3m
+

Set matrix for each plane. +Matrix is sequence of 9, 25 or 49 signed numbers. +Default value for each plane is 0 0 0 0 1 0 0 0 0. +

+
+
0rdiv
+
1rdiv
+
2rdiv
+
3rdiv
+

Set multiplier for calculated value for each plane. +If unset or 0, it will be sum of all matrix elements. +The option value must be a float number greater or equal to 0.0. Default value is 1.0. +

+
+
0bias
+
1bias
+
2bias
+
3bias
+

Set bias for each plane. This value is added to the result of the multiplication. +Useful for making the overall image brighter or darker. +The option value must be a float number greater or equal to 0.0. Default value is 0.0. +

+
+
+ + +
+

40.4.1 Examples

+ +
    +
  • Apply sharpen: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0, hwdownload" OUTPUT
    +
    + +
  • Apply blur: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9, hwdownload" OUTPUT
    +
    + +
  • Apply edge enhance: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128, hwdownload" OUTPUT
    +
    + +
  • Apply edge detect: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128, hwdownload" OUTPUT
    +
    + +
  • Apply laplacian edge detector which includes diagonals: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0, hwdownload" OUTPUT
    +
    + +
  • Apply emboss: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

40.5 erosion_opencl

+ +

Apply erosion effect to the video. +

+

This filter replaces the pixel by the local(3x3) minimum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane. Range is [0, 65535] and default value is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. +Range is [0, 255] and default value is 255, i.e. all eight pixels are used. +

+

Flags to local 3x3 coordinates region centered on x: +

+

1 2 3 +

+

4 x 5 +

+

6 7 8 +

+
+ + +
+

40.5.1 Example

+ +
    +
  • Apply erosion filter with threshold0 set to 30, threshold1 set 40, threshold2 set to 50 and coordinates set to 231, setting each pixel of the output to the local minimum between pixels: 1, 2, 3, 6, 7, 8 of the 3x3 region centered on it in the input. If the difference between input pixel and local minimum is more then threshold of the corresponding plane, output pixel will be set to input pixel - threshold of corresponding plane. +
    +
    -i INPUT -vf "hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

40.6 deshake_opencl

+

Feature-point based video stabilization filter. +

+

The filter accepts the following options: +

+
+
tripod
+

Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to 0. +

+
+
debug
+

Whether or not additional debug info should be displayed, both in the processed output and in the console. +

+

Note that in order to see console debug output you will also need to pass -v verbose to ffmpeg. +

+

Viewing point matches in the output video is only supported for RGB input. +

+

Defaults to 0. +

+
+
adaptive_crop
+

Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels. +

+

Defaults to 1. +

+
+
refine_features
+

Whether or not feature points should be refined at a sub-pixel level. +

+

This can be turned off for a slight performance gain at the cost of precision. +

+

Defaults to 1. +

+
+
smooth_strength
+

The strength of the smoothing applied to the camera path from 0.0 to 1.0. +

+

1.0 is the maximum smoothing strength while values less than that result in less smoothing. +

+

0.0 causes the filter to adaptively choose a smoothing strength on a per-frame basis. +

+

Defaults to 0.0. +

+
+
smooth_window_multiplier
+

Controls the size of the smoothing window (the number of frames buffered to determine motion information from). +

+

The size of the smoothing window is determined by multiplying the framerate of the video by this number. +

+

Acceptable values range from 0.1 to 10.0. +

+

Larger values increase the amount of motion data available for determining how to smooth the camera path, +potentially improving smoothness, but also increase latency and memory usage. +

+

Defaults to 2.0. +

+
+
+ + +
+

40.6.1 Examples

+ +
    +
  • Stabilize a video with a fixed, medium smoothing strength: +
    +
    -i INPUT -vf "hwupload, deshake_opencl=smooth_strength=0.5, hwdownload" OUTPUT
    +
    + +
  • Stabilize a video with debugging (both in console and in rendered video): +
    +
    -i INPUT -filter_complex "[0:v]format=rgba, hwupload, deshake_opencl=debug=1, hwdownload, format=rgba, format=yuv420p" -v verbose OUTPUT
    +
    +
+ +
+
+
+

40.7 dilation_opencl

+ +

Apply dilation effect to the video. +

+

This filter replaces the pixel by the local(3x3) maximum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane. Range is [0, 65535] and default value is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. +Range is [0, 255] and default value is 255, i.e. all eight pixels are used. +

+

Flags to local 3x3 coordinates region centered on x: +

+

1 2 3 +

+

4 x 5 +

+

6 7 8 +

+
+ + +
+

40.7.1 Example

+ +
    +
  • Apply dilation filter with threshold0 set to 30, threshold1 set 40, threshold2 set to 50 and coordinates set to 231, setting each pixel of the output to the local maximum between pixels: 1, 2, 3, 6, 7, 8 of the 3x3 region centered on it in the input. If the difference between input pixel and local maximum is more then threshold of the corresponding plane, output pixel will be set to input pixel + threshold of corresponding plane. +
    +
    -i INPUT -vf "hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

40.8 nlmeans_opencl

+ +

Non-local Means denoise filter through OpenCL, this filter accepts same options as nlmeans. +

+
+
+

40.9 overlay_opencl

+ +

Overlay one video on top of another. +

+

It takes two inputs and has one output. The first input is the "main" video on which the second input is overlaid. +This filter requires same memory layout for all the inputs. So, format conversion may be needed. +

+

The filter accepts the following options: +

+
+
x
+

Set the x coordinate of the overlaid video on the main video. +Default value is 0. +

+
+
y
+

Set the y coordinate of the overlaid video on the main video. +Default value is 0. +

+
+
+ + +
+

40.9.1 Examples

+ +
    +
  • Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs are yuv420p format. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_opencl, hwdownload" OUTPUT
    +
    +
  • The inputs have same memory layout for color channels , the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_opencl, hwdownload" OUTPUT
    +
    + +
+ +
+
+
+

40.10 pad_opencl

+ +

Add paddings to the input image, and place the original input at the +provided x, y coordinates. +

+

It accepts the following options: +

+
+
width, w
+
height, h
+

Specify an expression for the size of the output image with the +paddings added. If the value for width or height is 0, the +corresponding input size is used for the output. +

+

The width expression can reference the value set by the +height expression, and vice versa. +

+

The default value of width and height is 0. +

+
+
x
+
y
+

Specify the offsets to place the input image at within the padded area, +with respect to the top/left border of the output image. +

+

The x expression can reference the value set by the y +expression, and vice versa. +

+

The default value of x and y is 0. +

+

If x or y evaluate to a negative number, they’ll be changed +so the input image is centered on the padded area. +

+
+
color
+

Specify the color of the padded area. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. +

+
+
aspect
+

Pad to an aspect instead to a resolution. +

+
+ +

The value for the width, height, x, and y +options are expressions containing the following constants: +

+
+
in_w
+
in_h
+

The input video width and height. +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output width and height (the size of the padded area), as +specified by the width and height expressions. +

+
+
ow
+
oh
+

These are the same as out_w and out_h. +

+
+
x
+
y
+

The x and y offsets as specified by the x and y +expressions, or NAN if not yet specified. +

+
+
a
+

same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (iw / ih) * sar +

+
+ +
+
+

40.11 prewitt_opencl

+ +

Apply the Prewitt operator (https://en.wikipedia.org/wiki/Prewitt_operator) to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +Range is [0.0, 65535] and default value is 1.0. +

+
+
delta
+

Set value which will be added to filtered result. +Range is [-65535, 65535] and default value is 0.0. +

+
+ + +
+

40.11.1 Example

+ +
    +
  • Apply the Prewitt operator with scale set to 2 and delta set to 10. +
    +
    -i INPUT -vf "hwupload, prewitt_opencl=scale=2:delta=10, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

40.12 program_opencl

+ +

Filter video using an OpenCL program. +

+
+
source
+

OpenCL program source file. +

+
+
kernel
+

Kernel name in program. +

+
+
inputs
+

Number of inputs to the filter. Defaults to 1. +

+
+
size, s
+

Size of output frames. Defaults to the same as the first input. +

+
+
+ +

The program_opencl filter also supports the framesync options. +

+

The program source file must contain a kernel function with the given name, +which will be run once for each plane of the output. Each run on a plane +gets enqueued as a separate 2D global NDRange with one work-item for each +pixel to be generated. The global ID offset for each work-item is therefore +the coordinates of a pixel in the destination image. +

+

The kernel function needs to take the following arguments: +

    +
  • Destination image, __write_only image2d_t. + +

    This image will become the output; the kernel should write all of it. +

  • Frame index, unsigned int. + +

    This is a counter starting from zero and increasing by one for each frame. +

  • Source images, __read_only image2d_t. + +

    These are the most recent images on each input. The kernel may read from +them to generate the output, but they can’t be written to. +

+ +

Example programs: +

+
    +
  • Copy the input to the output (output must be the same size as the input). +
    __kernel void copy(__write_only image2d_t destination,
    +                   unsigned int index,
    +                   __read_only  image2d_t source)
    +{
    +    const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
    +
    +    int2 location = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float4 value = read_imagef(source, sampler, location);
    +
    +    write_imagef(destination, location, value);
    +}
    +
    +
  • Apply a simple transformation, rotating the input by an amount increasing +with the index counter. Pixel values are linearly interpolated by the +sampler, and the output need not have the same dimensions as the input. +
    __kernel void rotate_image(__write_only image2d_t dst,
    +                           unsigned int index,
    +                           __read_only  image2d_t src)
    +{
    +    const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
    +                               CLK_FILTER_LINEAR);
    +
    +    float angle = (float)index / 100.0f;
    +
    +    float2 dst_dim = convert_float2(get_image_dim(dst));
    +    float2 src_dim = convert_float2(get_image_dim(src));
    +
    +    float2 dst_cen = dst_dim / 2.0f;
    +    float2 src_cen = src_dim / 2.0f;
    +
    +    int2   dst_loc = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float2 dst_pos = convert_float2(dst_loc) - dst_cen;
    +    float2 src_pos = {
    +        cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
    +        sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
    +    };
    +    src_pos = src_pos * src_dim / dst_dim;
    +
    +    float2 src_loc = src_pos + src_cen;
    +
    +    if (src_loc.x < 0.0f      || src_loc.y < 0.0f ||
    +        src_loc.x > src_dim.x || src_loc.y > src_dim.y)
    +        write_imagef(dst, dst_loc, 0.5f);
    +    else
    +        write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
    +}
    +
    +
  • Blend two inputs together, with the amount of each input used varying +with the index counter. +
    __kernel void blend_images(__write_only image2d_t dst,
    +                           unsigned int index,
    +                           __read_only  image2d_t src1,
    +                           __read_only  image2d_t src2)
    +{
    +    const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
    +                               CLK_FILTER_LINEAR);
    +
    +    float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
    +
    +    int2  dst_loc = (int2)(get_global_id(0), get_global_id(1));
    +    int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
    +    int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
    +
    +    float4 val1 = read_imagef(src1, sampler, src1_loc);
    +    float4 val2 = read_imagef(src2, sampler, src2_loc);
    +
    +    write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
    +}
    +
    +
+ +
+
+

40.13 remap_opencl

+ +

Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream. +

+

Destination pixel at position (X, Y) will be picked from source (x, y) position +where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero +value for pixel will be used for destination pixel. +

+

Xmap and Ymap input video streams must be of same dimensions. Output video stream +will have Xmap/Ymap video stream dimensions. +Xmap and Ymap input video streams are 32bit float pixel format, single channel. +

+
+
interp
+

Specify interpolation used for remapping of pixels. +Allowed values are near and linear. +Default value is linear. +

+
+
fill
+

Specify the color of the unmapped pixels. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Default color is black. +

+
+ +
+
+

40.14 roberts_opencl

+

Apply the Roberts cross operator (https://en.wikipedia.org/wiki/Roberts_cross) to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +Range is [0.0, 65535] and default value is 1.0. +

+
+
delta
+

Set value which will be added to filtered result. +Range is [-65535, 65535] and default value is 0.0. +

+
+ + +
+

40.14.1 Example

+ +
    +
  • Apply the Roberts cross operator with scale set to 2 and delta set to 10 +
    +
    -i INPUT -vf "hwupload, roberts_opencl=scale=2:delta=10, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

40.15 sobel_opencl

+ +

Apply the Sobel operator (https://en.wikipedia.org/wiki/Sobel_operator) to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +Range is [0.0, 65535] and default value is 1.0. +

+
+
delta
+

Set value which will be added to filtered result. +Range is [-65535, 65535] and default value is 0.0. +

+
+ + +
+

40.15.1 Example

+ +
    +
  • Apply sobel operator with scale set to 2 and delta set to 10 +
    +
    -i INPUT -vf "hwupload, sobel_opencl=scale=2:delta=10, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

40.16 tonemap_opencl

+ +

Perform HDR(PQ/HLG) to SDR conversion with tone-mapping. +

+

It accepts the following parameters: +

+
+
tonemap
+

Specify the tone-mapping operator to be used. Same as tonemap option in tonemap. +

+
+
param
+

Tune the tone mapping algorithm. same as param option in tonemap. +

+
+
desat
+

Apply desaturation for highlights that exceed this level of brightness. The +higher the parameter, the more color information will be preserved. This +setting helps prevent unnaturally blown-out colors for super-highlights, by +(smoothly) turning into white instead. This makes images feel more natural, +at the cost of reducing information about out-of-range colors. +

+

The default value is 0.5, and the algorithm here is a little different from +the cpu version tonemap currently. A setting of 0.0 disables this option. +

+
+
threshold
+

The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold +is used to detect whether the scene has changed or not. If the distance between +the current frame average brightness and the current running average exceeds +a threshold value, we would re-calculate scene average and peak brightness. +The default value is 0.2. +

+
+
format
+

Specify the output pixel format. +

+

Currently supported formats are: +

+
p010
+
nv12
+
+ +
+
range, r
+

Set the output color range. +

+

Possible values are: +

+
tv/mpeg
+
pc/jpeg
+
+ +

Default is same as input. +

+
+
primaries, p
+

Set the output color primaries. +

+

Possible values are: +

+
bt709
+
bt2020
+
+ +

Default is same as input. +

+
+
transfer, t
+

Set the output transfer characteristics. +

+

Possible values are: +

+
bt709
+
bt2020
+
+ +

Default is bt709. +

+
+
matrix, m
+

Set the output colorspace matrix. +

+

Possible value are: +

+
bt709
+
bt2020
+
+ +

Default is same as input. +

+
+
+ + +
+

40.16.1 Example

+ +
    +
  • Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator. +
    +
    -i INPUT -vf "format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010" OUTPUT
    +
    +
+ +
+
+
+

40.17 unsharp_opencl

+ +

Sharpen or blur the input video. +

+

It accepts the following parameters: +

+
+
luma_msize_x, lx
+

Set the luma matrix horizontal size. +Range is [1, 23] and default value is 5. +

+
+
luma_msize_y, ly
+

Set the luma matrix vertical size. +Range is [1, 23] and default value is 5. +

+
+
luma_amount, la
+

Set the luma effect strength. +Range is [-10, 10] and default value is 1.0. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+
+
chroma_msize_x, cx
+

Set the chroma matrix horizontal size. +Range is [1, 23] and default value is 5. +

+
+
chroma_msize_y, cy
+

Set the chroma matrix vertical size. +Range is [1, 23] and default value is 5. +

+
+
chroma_amount, ca
+

Set the chroma effect strength. +Range is [-10, 10] and default value is 0.0. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+
+
+ +

All parameters are optional and default to the equivalent of the +string ’5:5:1.0:5:5:0.0’. +

+ +
+

40.17.1 Examples

+ +
    +
  • Apply strong luma sharpen effect: +
    +
    -i INPUT -vf "hwupload, unsharp_opencl=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5, hwdownload" OUTPUT
    +
    + +
  • Apply a strong blur of both luma and chroma parameters: +
    +
    -i INPUT -vf "hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

40.18 xfade_opencl

+ +

Cross fade two videos with custom transition effect by using OpenCL. +

+

It accepts the following options: +

+
+
transition
+

Set one of possible transition effects. +

+
+
custom
+

Select custom transition effect, the actual transition description +will be picked from source and kernel options. +

+
+
fade
+
wipeleft
+
wiperight
+
wipeup
+
wipedown
+
slideleft
+
slideright
+
slideup
+
slidedown
+
+

Default transition is fade. +

+
+ +
+
source
+

OpenCL program source file for custom transition. +

+
+
kernel
+

Set name of kernel to use for custom transition from program source file. +

+
+
duration
+

Set duration of video transition. +

+
+
offset
+

Set time of start of transition relative to first video. +

+
+ +

The program source file must contain a kernel function with the given name, +which will be run once for each plane of the output. Each run on a plane +gets enqueued as a separate 2D global NDRange with one work-item for each +pixel to be generated. The global ID offset for each work-item is therefore +the coordinates of a pixel in the destination image. +

+

The kernel function needs to take the following arguments: +

    +
  • Destination image, __write_only image2d_t. + +

    This image will become the output; the kernel should write all of it. +

    +
  • First Source image, __read_only image2d_t. +Second Source image, __read_only image2d_t. + +

    These are the most recent images on each input. The kernel may read from +them to generate the output, but they can’t be written to. +

    +
  • Transition progress, float. This value is always between 0 and 1 inclusive. +
+ +

Example programs: +

+
    +
  • Apply dots curtain transition effect: +
    __kernel void blend_images(__write_only image2d_t dst,
    +                           __read_only  image2d_t src1,
    +                           __read_only  image2d_t src2,
    +                           float progress)
    +{
    +    const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
    +                               CLK_FILTER_LINEAR);
    +    int2  p = (int2)(get_global_id(0), get_global_id(1));
    +    float2 rp = (float2)(get_global_id(0), get_global_id(1));
    +    float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
    +    rp = rp / dim;
    +
    +    float2 dots = (float2)(20.0, 20.0);
    +    float2 center = (float2)(0,0);
    +    float2 unused;
    +
    +    float4 val1 = read_imagef(src1, sampler, p);
    +    float4 val2 = read_imagef(src2, sampler, p);
    +    bool next = distance(fract(rp * dots, &unused), (float2)(0.5, 0.5)) < (progress / distance(rp, center));
    +
    +    write_imagef(dst, p, next ? val1 : val2);
    +}
    +
    +
+ + +
+
+
+

41 VAAPI Video Filters

+ +

VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters. +

+

To enable compilation of these filters you need to configure FFmpeg with +--enable-vaapi. +

+

To use vaapi filters, you need to setup the vaapi device correctly. For more information, please read https://trac.ffmpeg.org/wiki/Hardware/VAAPI +

+ +
+

41.1 overlay_vaapi

+ +

Overlay one video on the top of another. +

+

It takes two inputs and has one output. The first input is the "main" video on which the second input is overlaid. +

+

The filter accepts the following options: +

+
+
x
+
y
+

Set expressions for the x and y coordinates of the overlaid video +on the main video. +

+

Default value is "0" for both expressions. +

+
+
w
+
h
+

Set expressions for the width and height the overlaid video +on the main video. +

+

Default values are ’overlay_iw’ for ’w’ and ’overlay_ih*w/overlay_iw’ for ’h’. +

+

The expressions can contain the following parameters: +

+
+
main_w, W
+
main_h, H
+

The main input width and height. +

+
+
overlay_iw
+
overlay_ih
+

The overlay input width and height. +

+
+
overlay_w, w
+
overlay_h, h
+

The overlay output width and height. +

+
+
overlay_x, x
+
overlay_y, y
+

Position of the overlay layer inside of main +

+
+
+ +
+
alpha
+

Set transparency of overlaid video. Allowed range is 0.0 to 1.0. +Higher value means lower transparency. +Default value is 1.0. +

+
+
eof_action
+

See framesync. +

+
+
shortest
+

See framesync. +

+
+
repeatlast
+

See framesync. +

+
+
+ +

This filter also supports the framesync options. +

+
+

41.1.1 Examples

+ +
    +
  • Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs for this filter are yuv420p format. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_vaapi" OUTPUT
    +
    +
  • Overlay an image LOGO at the offset (200, 100) from the top-left corner of the INPUT video. +The inputs have same memory layout for color channels, the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_vaapi=x=200:y=100:w=400:h=300:alpha=1.0, hwdownload, format=nv12" OUTPUT
    +
    + +
+ +
+
+
+

41.2 tonemap_vaapi

+ +

Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping. +It maps the dynamic range of HDR10 content to the SDR content. +It currently only accepts HDR10 as input. +

+

It accepts the following parameters: +

+
+
format
+

Specify the output pixel format. +

+

Currently supported formats are: +

+
p010
+
nv12
+
+ +

Default is nv12. +

+
+
primaries, p
+

Set the output color primaries. +

+

Default is same as input. +

+
+
transfer, t
+

Set the output transfer characteristics. +

+

Default is bt709. +

+
+
matrix, m
+

Set the output colorspace matrix. +

+

Default is same as input. +

+
+
+ + +
+

41.2.1 Example

+ +
    +
  • Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format +
    +
    tonemap_vaapi=format=p010:t=bt2020-10
    +
    +
+ +
+
+
+

41.3 hstack_vaapi

+

Stack input videos horizontally. +

+

This is the VA-API variant of the hstack filter, each input stream may +have different height, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See hstack. +

+
+
shortest
+

See hstack. +

+
+
height
+

Set height of output. If set to 0, this filter will set height of output to +height of the first input stream. Default value is 0. +

+
+ +
+
+

41.4 vstack_vaapi

+

Stack input videos vertically. +

+

This is the VA-API variant of the vstack filter, each input stream may +have different width, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See vstack. +

+
+
shortest
+

See vstack. +

+
+
width
+

Set width of output. If set to 0, this filter will set width of output to +width of the first input stream. Default value is 0. +

+
+ +
+
+

41.5 xstack_vaapi

+

Stack video inputs into custom layout. +

+

This is the VA-API variant of the xstack filter, each input stream may +have different size, this filter will scale down/up each input stream to the +given output size, or the size of the first input stream. +

+

It accepts the following options: +

+
+
inputs
+

See xstack. +

+
+
shortest
+

See xstack. +

+
+
layout
+

See xstack. +Moreover, this permits the user to supply output size for each input stream. +

+
xstack_vaapi=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
+
+ +
+
grid
+

See xstack. +

+
+
grid_tile_size
+

Set output size for each input stream when grid is set. If this option +is not set, this filter will set output size by default to the size of the +first input stream. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
fill
+

See xstack. +

+
+ + +
+
+
+

42 QSV Video Filters

+ +

Below is a description of the currently available QSV video filters. +

+

To enable compilation of these filters you need to configure FFmpeg with +--enable-libmfx or --enable-libvpl. +

+

To use QSV filters, you need to setup the QSV device correctly. For more information, please read https://trac.ffmpeg.org/wiki/Hardware/QuickSync +

+ +
+

42.1 hstack_qsv

+

Stack input videos horizontally. +

+

This is the QSV variant of the hstack filter, each input stream may +have different height, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See hstack. +

+
+
shortest
+

See hstack. +

+
+
height
+

Set height of output. If set to 0, this filter will set height of output to +height of the first input stream. Default value is 0. +

+
+ +
+
+

42.2 vstack_qsv

+

Stack input videos vertically. +

+

This is the QSV variant of the vstack filter, each input stream may +have different width, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See vstack. +

+
+
shortest
+

See vstack. +

+
+
width
+

Set width of output. If set to 0, this filter will set width of output to +width of the first input stream. Default value is 0. +

+
+ +
+
+

42.3 xstack_qsv

+

Stack video inputs into custom layout. +

+

This is the QSV variant of the xstack filter. +

+

It accepts the following options: +

+
+
inputs
+

See xstack. +

+
+
shortest
+

See xstack. +

+
+
layout
+

See xstack. +Moreover, this permits the user to supply output size for each input stream. +

+
xstack_qsv=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
+
+ +
+
grid
+

See xstack. +

+
+
grid_tile_size
+

Set output size for each input stream when grid is set. If this option +is not set, this filter will set output size by default to the size of the +first input stream. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
fill
+

See xstack. +

+
+ + +
+
+
+

43 Video Sources

+ +

Below is a description of the currently available video sources. +

+ +
+

43.1 buffer

+ +

Buffer video frames, and make them available to the filter chain. +

+

This source is mainly intended for a programmatic use, in particular +through the interface defined in libavfilter/buffersrc.h. +

+

It accepts the following parameters: +

+
+
video_size
+

Specify the size (width and height) of the buffered video frames. For the +syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
width
+

The input video width. +

+
+
height
+

The input video height. +

+
+
pix_fmt
+

A string representing the pixel format of the buffered video frames. +It may be a number corresponding to a pixel format, or a pixel format +name. +

+
+
time_base
+

Specify the timebase assumed by the timestamps of the buffered frames. +

+
+
frame_rate
+

Specify the frame rate expected for the video stream. +

+
+
pixel_aspect, sar
+

The sample (pixel) aspect ratio of the input video. +

+
+
hw_frames_ctx
+

When using a hardware pixel format, this should be a reference to an +AVHWFramesContext describing input frames. +

+
+ +

For example: +

+
buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
+
+ +

will instruct the source to accept video frames with size 320x240 and +with format "yuv410p", assuming 1/24 as the timestamps timebase and +square pixels (1:1 sample aspect ratio). +Since the pixel format with name "yuv410p" corresponds to the number 6 +(check the enum AVPixelFormat definition in libavutil/pixfmt.h), +this example corresponds to: +

+
buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
+
+ +

Alternatively, the options can be specified as a flat string, but this +syntax is deprecated: +

+

width:height:pix_fmt:time_base.num:time_base.den:pixel_aspect.num:pixel_aspect.den +

+
+
+

43.2 cellauto

+ +

Create a pattern generated by an elementary cellular automaton. +

+

The initial state of the cellular automaton can be defined through the +filename and pattern options. If such options are +not specified an initial state is created randomly. +

+

At each new frame a new row in the video is filled with the result of +the cellular automaton next generation. The behavior when the whole +frame is filled is defined by the scroll option. +

+

This source accepts the following options: +

+
+
filename, f
+

Read the initial cellular automaton state, i.e. the starting row, from +the specified file. +In the file, each non-whitespace character is considered an alive +cell, a newline will terminate the row, and further characters in the +file will be ignored. +

+
+
pattern, p
+

Read the initial cellular automaton state, i.e. the starting row, from +the specified string. +

+

Each non-whitespace character in the string is considered an alive +cell, a newline will terminate the row, and further characters in the +string will be ignored. +

+
+
rate, r
+

Set the video rate, that is the number of frames generated per second. +Default is 25. +

+
+
random_fill_ratio, ratio
+

Set the random fill ratio for the initial cellular automaton row. It +is a floating point number value ranging from 0 to 1, defaults to +1/PHI. +

+

This option is ignored when a file or a pattern is specified. +

+
+
random_seed, seed
+

Set the seed for filling randomly the initial row, must be an integer +included between 0 and UINT32_MAX. If not specified, or if explicitly +set to -1, the filter will try to use a good random seed on a best +effort basis. +

+
+
rule
+

Set the cellular automaton rule, it is a number ranging from 0 to 255. +Default value is 110. +

+
+
size, s
+

Set the size of the output video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+

If filename or pattern is specified, the size is set +by default to the width of the specified initial state row, and the +height is set to width * PHI. +

+

If size is set, it must contain the width of the specified +pattern string, and the specified pattern will be centered in the +larger row. +

+

If a filename or a pattern string is not specified, the size value +defaults to "320x518" (used for a randomly generated initial state). +

+
+
scroll
+

If set to 1, scroll the output upward when all the rows in the output +have been already filled. If set to 0, the new generated row will be +written over the top row just after the bottom row is filled. +Defaults to 1. +

+
+
start_full, full
+

If set to 1, completely fill the output with generated rows before +outputting the first frame. +This is the default behavior, for disabling set the value to 0. +

+
+
stitch
+

If set to 1, stitch the left and right row edges together. +This is the default behavior, for disabling set the value to 0. +

+
+ + +
+

43.2.1 Examples

+ +
    +
  • Read the initial state from pattern, and specify an output of +size 200x400. +
    +
    cellauto=f=pattern:s=200x400
    +
    + +
  • Generate a random initial row with a width of 200 cells, with a fill +ratio of 2/3: +
    +
    cellauto=ratio=2/3:s=200x200
    +
    + +
  • Create a pattern generated by rule 18 starting by a single alive cell +centered on an initial row with width 100: +
    +
    cellauto=p=@:s=100x400:full=0:rule=18
    +
    + +
  • Specify a more elaborated initial pattern: +
    +
    cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
    +
    + +
+ +
+
+
+

43.3 coreimagesrc

+

Video source generated on GPU using Apple’s CoreImage API on OSX. +

+

This video source is a specialized version of the coreimage video filter. +Use a core image generator at the beginning of the applied filterchain to +generate the content. +

+

The coreimagesrc video source accepts the following options: +

+
list_generators
+

List all available generators along with all their respective options as well as +possible minimum and maximum values along with the default values. +

+
list_generators=true
+
+ +
+
size, s
+

Specify the size of the sourced video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +The default value is 320x240. +

+
+
rate, r
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a floating point +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
sar
+

Set the sample aspect ratio of the sourced video. +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+ +

Additionally, all options of the coreimage video filter are accepted. +A complete filterchain can be used for further processing of the +generated input without CPU-HOST transfer. See coreimage documentation +and examples for details. +

+ +
+

43.3.1 Examples

+ +
    +
  • Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage, +given as complete and escaped command-line for Apple’s standard bash shell: +
    +
    ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
    +
    +

    This example is equivalent to the QRCode example of coreimage without the +need for a nullsrc video source. +

+ + +
+
+
+

43.4 ddagrab

+ +

Captures the Windows Desktop via Desktop Duplication API. +

+

The filter exclusively returns D3D11 Hardware Frames, for on-gpu encoding +or processing. So an explicit hwdownload is needed for any kind of +software processing. +

+

It accepts the following options: +

+
+
output_idx
+

DXGI Output Index to capture. +

+

Usually corresponds to the index Windows has given the screen minus one, +so it’s starting at 0. +

+

Defaults to output 0. +

+
+
draw_mouse
+

Whether to draw the mouse cursor. +

+

Defaults to true. +

+

Only affects hardware cursors. If a game or application renders its own cursor, +it’ll always be captured. +

+
+
framerate
+

Framerate at which the desktop will be captured. +

+

Defaults to 30 FPS. +

+
+
video_size
+

Specify the size of the captured video. +

+

Defaults to the full size of the screen. +

+

Cropped from the bottom/right if smaller than screen size. +

+
+
offset_x
+

Horizontal offset of the captured video. +

+
+
offset_y
+

Vertical offset of the captured video. +

+
+
output_fmt
+

Desired filter output format. +Defaults to 8 Bit BGRA. +

+

It accepts the following values: +

+
auto
+

Passes all supported output formats to DDA and returns what DDA decides to use. +

+
8bit
+
bgra
+

8 Bit formats always work, and DDA will convert to them if neccesary. +

+
10bit
+
x2bgr10
+

Filter initialization will fail if 10 bit format is requested but unavailable. +

+
+ +
+
+ + +
+

43.4.1 Examples

+ +

Capture primary screen and encode using nvenc: +

+
ffmpeg -f lavfi -i ddagrab -c:v h264_nvenc -cq 18 output.mp4
+
+ +

You can also skip the lavfi device and directly use the filter. +Also demonstrates downloading the frame and encoding with libx264. +Explicit output format specification is required in this case: +

+
ffmpeg -filter_complex ddagrab=output_idx=1:framerate=60,hwdownload,format=bgra -c:v libx264 -crf 18 output.mp4
+
+ +

If you want to capture only a subsection of the desktop, this can be achieved +by specifying a smaller size and its offsets into the screen: +

+
ddagrab=video_size=800x600:offset_x=100:offset_y=100
+
+ + +
+
+
+

43.5 gradients

+

Generate several gradients. +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "640x480". +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
c0, c1, c2, c3, c4, c5, c6, c7
+

Set 8 colors. Default values for colors is to pick random one. +

+
+
x0, y0, y0, y1
+

Set gradient line source and destination points. If negative or out of range, random ones +are picked. +

+
+
nb_colors, n
+

Set number of colors to use at once. Allowed range is from 2 to 8. Default value is 2. +

+
+
seed
+

Set seed for picking gradient line points. +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+
speed
+

Set speed of gradients rotation. +

+
+
type, t
+

Set type of gradients, can be linear or radial or circular or spiral. +

+
+ + +
+
+

43.6 mandelbrot

+ +

Generate a Mandelbrot set fractal, and progressively zoom towards the +point specified with start_x and start_y. +

+

This source accepts the following options: +

+
+
end_pts
+

Set the terminal pts value. Default value is 400. +

+
+
end_scale
+

Set the terminal scale value. +Must be a floating point value. Default value is 0.3. +

+
+
inner
+

Set the inner coloring mode, that is the algorithm used to draw the +Mandelbrot fractal internal region. +

+

It shall assume one of the following values: +

+
black
+

Set black mode. +

+
convergence
+

Show time until convergence. +

+
mincol
+

Set color based on point closest to the origin of the iterations. +

+
period
+

Set period mode. +

+
+ +

Default value is mincol. +

+
+
bailout
+

Set the bailout value. Default value is 10.0. +

+
+
maxiter
+

Set the maximum of iterations performed by the rendering +algorithm. Default value is 7189. +

+
+
outer
+

Set outer coloring mode. +It shall assume one of following values: +

+
iteration_count
+

Set iteration count mode. +

+
normalized_iteration_count
+

set normalized iteration count mode. +

+
+

Default value is normalized_iteration_count. +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "640x480". +

+
+
start_scale
+

Set the initial scale value. Default value is 3.0. +

+
+
start_x
+

Set the initial x position. Must be a floating point value between +-100 and 100. Default value is -0.743643887037158704752191506114774. +

+
+
start_y
+

Set the initial y position. Must be a floating point value between +-100 and 100. Default value is -0.131825904205311970493132056385139. +

+
+ +
+
+

43.7 mptestsrc

+ +

Generate various test patterns, as generated by the MPlayer test filter. +

+

The size of the generated video is fixed, and is 256x256. +This source is useful in particular for testing encoding features. +

+

This source accepts the following options: +

+
+
rate, r
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a floating point +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+
test, t
+
+

Set the number or the name of the test to perform. Supported tests are: +

+
dc_luma
+
dc_chroma
+
freq_luma
+
freq_chroma
+
amp_luma
+
amp_chroma
+
cbp
+
mv
+
ring1
+
ring2
+
all
+
max_frames, m
+

Set the maximum number of frames generated for each test, default value is 30. +

+
+
+ +

Default value is "all", which will cycle through the list of all tests. +

+
+ +

Some examples: +

+
mptestsrc=t=dc_luma
+
+ +

will generate a "dc_luma" test pattern. +

+
+
+

43.8 frei0r_src

+ +

Provide a frei0r source. +

+

To enable compilation of this filter you need to install the frei0r +header and configure FFmpeg with --enable-frei0r. +

+

This source accepts the following parameters: +

+
+
size
+

The size of the video to generate. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
framerate
+

The framerate of the generated video. It may be a string of the form +num/den or a frame rate abbreviation. +

+
+
filter_name
+

The name to the frei0r source to load. For more information regarding frei0r and +how to set the parameters, read the frei0r section in the video filters +documentation. +

+
+
filter_params
+

A ’|’-separated list of parameters to pass to the frei0r source. +

+
+
+ +

For example, to generate a frei0r partik0l source with size 200x200 +and frame rate 10 which is overlaid on the overlay filter main input: +

+
frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
+
+ +
+
+

43.9 life

+ +

Generate a life pattern. +

+

This source is based on a generalization of John Conway’s life game. +

+

The sourced input represents a life grid, each pixel represents a cell +which can be in one of two possible states, alive or dead. Every cell +interacts with its eight neighbours, which are the cells that are +horizontally, vertically, or diagonally adjacent. +

+

At each interaction the grid evolves according to the adopted rule, +which specifies the number of neighbor alive cells which will make a +cell stay alive or born. The rule option allows one to specify +the rule to adopt. +

+

This source accepts the following options: +

+
+
filename, f
+

Set the file from which to read the initial grid state. In the file, +each non-whitespace character is considered an alive cell, and newline +is used to delimit the end of each row. +

+

If this option is not specified, the initial grid is generated +randomly. +

+
+
rate, r
+

Set the video rate, that is the number of frames generated per second. +Default is 25. +

+
+
random_fill_ratio, ratio
+

Set the random fill ratio for the initial random grid. It is a +floating point number value ranging from 0 to 1, defaults to 1/PHI. +It is ignored when a file is specified. +

+
+
random_seed, seed
+

Set the seed for filling the initial random grid, must be an integer +included between 0 and UINT32_MAX. If not specified, or if explicitly +set to -1, the filter will try to use a good random seed on a best +effort basis. +

+
+
rule
+

Set the life rule. +

+

A rule can be specified with a code of the kind "SNS/BNB", +where NS and NB are sequences of numbers in the range 0-8, +NS specifies the number of alive neighbor cells which make a +live cell stay alive, and NB the number of alive neighbor cells +which make a dead cell to become alive (i.e. to "born"). +"s" and "b" can be used in place of "S" and "B", respectively. +

+

Alternatively a rule can be specified by an 18-bits integer. The 9 +high order bits are used to encode the next cell state if it is alive +for each number of neighbor alive cells, the low order bits specify +the rule for "borning" new cells. Higher order bits encode for an +higher number of neighbor cells. +For example the number 6153 = (12<<9)+9 specifies a stay alive +rule of 12 and a born rule of 9, which corresponds to "S23/B03". +

+

Default value is "S23/B3", which is the original Conway’s game of life +rule, and will keep a cell alive if it has 2 or 3 neighbor alive +cells, and will born a new cell if there are three alive cells around +a dead cell. +

+
+
size, s
+

Set the size of the output video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+

If filename is specified, the size is set by default to the +same size of the input file. If size is set, it must contain +the size specified in the input file, and the initial grid defined in +that file is centered in the larger resulting area. +

+

If a filename is not specified, the size value defaults to "320x240" +(used for a randomly generated initial grid). +

+
+
stitch
+

If set to 1, stitch the left and right grid edges together, and the +top and bottom edges also. Defaults to 1. +

+
+
mold
+

Set cell mold speed. If set, a dead cell will go from death_color to +mold_color with a step of mold. mold can have a +value from 0 to 255. +

+
+
life_color
+

Set the color of living (or new born) cells. +

+
+
death_color
+

Set the color of dead cells. If mold is set, this is the first color +used to represent a dead cell. +

+
+
mold_color
+

Set mold color, for definitely dead and moldy cells. +

+

For the syntax of these 3 color options, check the (ffmpeg-utils)"Color" section in the +ffmpeg-utils manual. +

+
+ + +
+

43.9.1 Examples

+ +
    +
  • Read a grid from pattern, and center it on a grid of size +300x300 pixels: +
    +
    life=f=pattern:s=300x300
    +
    + +
  • Generate a random grid of size 200x200, with a fill ratio of 2/3: +
    +
    life=ratio=2/3:s=200x200
    +
    + +
  • Specify a custom rule for evolving a randomly generated grid: +
    +
    life=rule=S14/B34
    +
    + +
  • Full example with slow death effect (mold) using ffplay: +
    +
    ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
    +
    +
+ +
+
+
+

43.10 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc

+ +

The allrgb source returns frames of size 4096x4096 of all rgb colors. +

+

The allyuv source returns frames of size 4096x4096 of all yuv colors. +

+

The color source provides an uniformly colored input. +

+

The colorchart source provides a colors checker chart. +

+

The colorspectrum source provides a color spectrum input. +

+

The haldclutsrc source provides an identity Hald CLUT. See also +haldclut filter. +

+

The nullsrc source returns unprocessed video frames. It is +mainly useful to be employed in analysis / debugging tools, or as the +source for filters which ignore the input data. +

+

The pal75bars source generates a color bars pattern, based on +EBU PAL recommendations with 75% color levels. +

+

The pal100bars source generates a color bars pattern, based on +EBU PAL recommendations with 100% color levels. +

+

The rgbtestsrc source generates an RGB test pattern useful for +detecting RGB vs BGR issues. You should see a red, green and blue +stripe from top to bottom. +

+

The smptebars source generates a color bars pattern, based on +the SMPTE Engineering Guideline EG 1-1990. +

+

The smptehdbars source generates a color bars pattern, based on +the SMPTE RP 219-2002. +

+

The testsrc source generates a test video pattern, showing a +color pattern, a scrolling gradient and a timestamp. This is mainly +intended for testing purposes. +

+

The testsrc2 source is similar to testsrc, but supports more +pixel formats instead of just rgb24. This allows using it as an +input for other tests without requiring a format conversion. +

+

The yuvtestsrc source generates an YUV test pattern. You should +see a y, cb and cr stripe from top to bottom. +

+

The sources accept the following parameters: +

+
+
level
+

Specify the level of the Hald CLUT, only available in the haldclutsrc +source. A level of N generates a picture of N*N*N by N*N*N +pixels to be used as identity matrix for 3D lookup tables. Each component is +coded on a 1/(N*N) scale. +

+
+
color, c
+

Specify the color of the source, only available in the color +source. For the syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+
+
size, s
+

Specify the size of the sourced video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +The default value is 320x240. +

+

This option is not available with the allrgb, allyuv, and +haldclutsrc filters. +

+
+
rate, r
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a floating point +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+

Since the frame rate is used as time base, all frames including the last one +will have their full duration. If the specified duration is not a multiple +of the frame duration, it will be rounded up. +

+
+
sar
+

Set the sample aspect ratio of the sourced video. +

+
+
alpha
+

Specify the alpha (opacity) of the background, only available in the +testsrc2 source. The value must be between 0 (fully transparent) and +255 (fully opaque, the default). +

+
+
decimals, n
+

Set the number of decimals to show in the timestamp, only available in the +testsrc source. +

+

The displayed timestamp value will correspond to the original +timestamp value multiplied by the power of 10 of the specified +value. Default value is 0. +

+
+
type
+

Set the type of the color spectrum, only available in the +colorspectrum source. Can be one of the following: +

+
+
black
+
white
+
all
+
+ +
+
patch_size
+

Set patch size of single color patch, only available in the +colorchart source. Default is 64x64. +

+
+
preset
+

Set colorchecker colors preset, only available in the +colorchart source. +

+

Available values are: +

+
reference
+
skintones
+
+ +

Default value is reference. +

+
+ + +
+

43.10.1 Examples

+ +
    +
  • Generate a video with a duration of 5.3 seconds, with size +176x144 and a frame rate of 10 frames per second: +
    +
    testsrc=duration=5.3:size=qcif:rate=10
    +
    + +
  • The following graph description will generate a red source +with an opacity of 0.2, with size "qcif" and a frame rate of 10 +frames per second: +
    +
    color=c=red@0.2:s=qcif:r=10
    +
    + +
  • If the input content is to be ignored, nullsrc can be used. The +following command generates noise in the luminance plane by employing +the geq filter: +
    +
    nullsrc=s=256x256, geq=random(1)*255:128:128
    +
    +
+ +
+
+

43.10.2 Commands

+ +

The color source supports the following commands: +

+
+
c, color
+

Set the color of the created image. Accepts the same syntax of the +corresponding color option. +

+
+ +
+
+
+

43.11 openclsrc

+ +

Generate video using an OpenCL program. +

+
+
source
+

OpenCL program source file. +

+
+
kernel
+

Kernel name in program. +

+
+
size, s
+

Size of frames to generate. This must be set. +

+
+
format
+

Pixel format to use for the generated frames. This must be set. +

+
+
rate, r
+

Number of frames generated every second. Default value is ’25’. +

+
+
+ +

For details of how the program loading works, see the program_opencl +filter. +

+

Example programs: +

+
    +
  • Generate a colour ramp by setting pixel values from the position of the pixel +in the output image. (Note that this will work with all pixel formats, but +the generated output will not be the same.) +
    __kernel void ramp(__write_only image2d_t dst,
    +                   unsigned int index)
    +{
    +    int2 loc = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float4 val;
    +    val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
    +
    +    write_imagef(dst, loc, val);
    +}
    +
    +
  • Generate a Sierpinski carpet pattern, panning by a single pixel each frame. +
    __kernel void sierpinski_carpet(__write_only image2d_t dst,
    +                                unsigned int index)
    +{
    +    int2 loc = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float4 value = 0.0f;
    +    int x = loc.x + index;
    +    int y = loc.y + index;
    +    while (x > 0 || y > 0) {
    +        if (x % 3 == 1 && y % 3 == 1) {
    +            value = 1.0f;
    +            break;
    +        }
    +        x /= 3;
    +        y /= 3;
    +    }
    +
    +    write_imagef(dst, loc, value);
    +}
    +
    +
+ +
+
+

43.12 sierpinski

+ +

Generate a Sierpinski carpet/triangle fractal, and randomly pan around. +

+

This source accepts the following options: +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "640x480". +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
seed
+

Set seed which is used for random panning. +

+
+
jump
+

Set max jump for single pan destination. Allowed range is from 1 to 10000. +

+
+
type
+

Set fractal type, can be default carpet or triangle. +

+
+ +
+
+

43.13 zoneplate

+

Generate a zoneplate test video pattern. +

+

This source accepts the following options: +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "320x240". +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+
sar
+

Set the sample aspect ratio of the sourced video. +

+
+
precision
+

Set precision in bits for look-up table for sine calculations. Default value is 10. +Allowed range is from 4 to 16. +

+
+
xo
+

Set horizontal axis offset for output signal. Default value is 0. +

+
+
yo
+

Set vertical axis offset for output signal. Default value is 0. +

+
+
to
+

Set time axis offset for output signal. Default value is 0. +

+
+
k0
+

Set 0-order, constant added to signal phase. Default value is 0. +

+
+
kx
+

Set 1-order, phase factor multiplier for horizontal axis. Default value is 0. +

+
+
ky
+

Set 1-order, phase factor multiplier for vertical axis. Default value is 0. +

+
+
kt
+

Set 1-order, phase factor multiplier for time axis. Default value is 0. +

+
+
kxt, kyt, kxy
+

Set phase factor multipliers for combination of spatial and temporal axis. +Default value is 0. +

+
+
kx2
+

Set 2-order, phase factor multiplier for horizontal axis. Default value is 0. +

+
+
ky2
+

Set 2-order, phase factor multiplier for vertical axis. Default value is 0. +

+
+
kt2
+

Set 2-order, phase factor multiplier for time axis. Default value is 0. +

+
+
ku
+

Set the constant added to final phase to produce chroma-blue component of signal. +Default value is 0. +

+
+
kv
+

Set the constant added to final phase to produce chroma-red component of signal. +Default value is 0. +

+
+ + +
+

43.13.1 Commands

+ +

This source supports the some above options as commands. +

+
+
+

43.13.2 Examples

+ +
    +
  • Generate horizontal color sine sweep: +
    +
    zoneplate=ku=512:kv=0:kt2=0:kx2=256:s=wvga:xo=-426:kt=11
    +
    + +
  • Generate vertical color sine sweep: +
    +
    zoneplate=ku=512:kv=0:kt2=0:ky2=156:s=wvga:yo=-240:kt=11
    +
    + +
  • Generate circular zone-plate: +
    +
    zoneplate=ku=512:kv=100:kt2=0:ky2=256:kx2=556:s=wvga:yo=0:kt=11
    +
    +
+ + +
+
+
+
+

44 Video Sinks

+ +

Below is a description of the currently available video sinks. +

+ +
+

44.1 buffersink

+ +

Buffer video frames, and make them available to the end of the filter +graph. +

+

This sink is mainly intended for programmatic use, in particular +through the interface defined in libavfilter/buffersink.h +or the options system. +

+

It accepts a pointer to an AVBufferSinkContext structure, which +defines the incoming buffers’ formats, to be passed as the opaque +parameter to avfilter_init_filter for initialization. +

+
+
+

44.2 nullsink

+ +

Null video sink: do absolutely nothing with the input video. It is +mainly useful as a template and for use in analysis / debugging +tools. +

+ +
+
+
+

45 Multimedia Filters

+ +

Below is a description of the currently available multimedia filters. +

+ +
+

45.1 a3dscope

+ +

Convert input audio to 3d scope video output. +

+

The filter accepts the following options: +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is hd720. +

+
+
fov
+

Set the camera field of view. Default is 90 degrees. +Allowed range is from 40 to 150. +

+
+
roll
+

Set the camera roll. +

+
+
pitch
+

Set the camera pitch. +

+
+
yaw
+

Set the camera yaw. +

+
+
xzoom
+

Set the camera zoom on X-axis. +

+
+
yzoom
+

Set the camera zoom on Y-axis. +

+
+
zzoom
+

Set the camera zoom on Z-axis. +

+
+
xpos
+

Set the camera position on X-axis. +

+
+
ypos
+

Set the camera position on Y-axis. +

+
+
zpos
+

Set the camera position on Z-axis. +

+
+
length
+

Set the length of displayed audio waves in number of frames. +

+
+ + +
+

45.1.1 Commands

+ +

Filter supports the some above options as commands. +

+
+
+
+

45.2 abitscope

+ +

Convert input audio to a video output, displaying the audio bit scope. +

+

The filter accepts the following options: +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 1024x256. +

+
+
colors
+

Specify list of colors separated by space or by ’|’ which will be used to +draw channels. Unrecognized or missing colors will be replaced +by white color. +

+
+
mode, m
+

Set output mode. Can be bars or trace. Default is bars. +

+
+ +
+
+

45.3 adrawgraph

+

Draw a graph using input audio metadata. +

+

See drawgraph +

+
+
+

45.4 agraphmonitor

+ +

See graphmonitor. +

+
+
+

45.5 ahistogram

+ +

Convert input audio to a video output, displaying the volume histogram. +

+

The filter accepts the following options: +

+
+
dmode
+

Specify how histogram is calculated. +

+

It accepts the following values: +

+
single
+

Use single histogram for all channels. +

+
separate
+

Use separate histogram for each channel. +

+
+

Default is single. +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is hd720. +

+
+
scale
+

Set display scale. +

+

It accepts the following values: +

+
log
+

logarithmic +

+
sqrt
+

square root +

+
cbrt
+

cubic root +

+
lin
+

linear +

+
rlog
+

reverse logarithmic +

+
+

Default is log. +

+
+
ascale
+

Set amplitude scale. +

+

It accepts the following values: +

+
log
+

logarithmic +

+
lin
+

linear +

+
+

Default is log. +

+
+
acount
+

Set how much frames to accumulate in histogram. +Default is 1. Setting this to -1 accumulates all frames. +

+
+
rheight
+

Set histogram ratio of window height. +

+
+
slide
+

Set sonogram sliding. +

+

It accepts the following values: +

+
replace
+

replace old rows with new ones. +

+
scroll
+

scroll from top to bottom. +

+
+

Default is replace. +

+
+
hmode
+

Set histogram mode. +

+

It accepts the following values: +

+
abs
+

Use absolute values of samples. +

+
sign
+

Use untouched values of samples. +

+
+

Default is abs. +

+
+ +
+
+

45.6 aphasemeter

+ +

Measures phase of input audio, which is exported as metadata lavfi.aphasemeter.phase, +representing mean phase of current audio frame. A video output can also be produced and is +enabled by default. The audio is passed through as first output. +

+

Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in +range [-1, 1] where -1 means left and right channels are completely out of phase +and 1 means channels are in phase. +

+

The filter accepts the following options, all related to its video output: +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+
+
size, s
+

Set the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 800x400. +

+
+
rc
+
gc
+
bc
+

Specify the red, green, blue contrast. Default values are 2, +7 and 1. +Allowed range is [0, 255]. +

+
+
mpc
+

Set color which will be used for drawing median phase. If color is +none which is default, no median phase value will be drawn. +

+
+
video
+

Enable video output. Default is enabled. +

+
+ + +
+

45.6.1 phasing detection

+ +

The filter also detects out of phase and mono sequences in stereo streams. +It logs the sequence start, end and duration when it lasts longer or as long as the minimum set. +

+

The filter accepts the following options for this detection: +

+
+
phasing
+

Enable mono and out of phase detection. Default is disabled. +

+
+
tolerance, t
+

Set phase tolerance for mono detection, in amplitude ratio. Default is 0. +Allowed range is [0, 1]. +

+
+
angle, a
+

Set angle threshold for out of phase detection, in degree. Default is 170. +Allowed range is [90, 180]. +

+
+
duration, d
+

Set mono or out of phase duration until notification, expressed in seconds. Default is 2. +

+
+ +
+
+

45.6.2 Examples

+ +
    +
  • Complete example with ffmpeg to detect 1 second of mono with 0.001 phase tolerance: +
    +
    ffmpeg -i stereo.wav -af aphasemeter=video=0:phasing=1:duration=1:tolerance=0.001 -f null -
    +
    +
+ +
+
+
+

45.7 avectorscope

+ +

Convert input audio to a video output, representing the audio vector +scope. +

+

The filter is used to measure the difference between channels of stereo +audio stream. A monaural signal, consisting of identical left and right +signal, results in straight vertical line. Any stereo separation is visible +as a deviation from this line, creating a Lissajous figure. +If the straight (or deviation from it) but horizontal line appears this +indicates that the left and right channels are out of phase. +

+

The filter accepts the following options: +

+
+
mode, m
+

Set the vectorscope mode. +

+

Available values are: +

+
lissajous
+

Lissajous rotated by 45 degrees. +

+
+
lissajous_xy
+

Same as above but not rotated. +

+
+
polar
+

Shape resembling half of circle. +

+
+ +

Default value is ‘lissajous’. +

+
+
size, s
+

Set the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 400x400. +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+
+
rc
+
gc
+
bc
+
ac
+

Specify the red, green, blue and alpha contrast. Default values are 40, +160, 80 and 255. +Allowed range is [0, 255]. +

+
+
rf
+
gf
+
bf
+
af
+

Specify the red, green, blue and alpha fade. Default values are 15, +10, 5 and 5. +Allowed range is [0, 255]. +

+
+
zoom
+

Set the zoom factor. Default value is 1. Allowed range is [0, 10]. +Values lower than 1 will auto adjust zoom factor to maximal possible value. +

+
+
draw
+

Set the vectorscope drawing mode. +

+

Available values are: +

+
dot
+

Draw dot for each sample. +

+
+
line
+

Draw line between previous and current sample. +

+
+
aaline
+

Draw anti-aliased line between previous and current sample. +

+
+ +

Default value is ‘dot’. +

+
+
scale
+

Specify amplitude scale of audio samples. +

+

Available values are: +

+
lin
+

Linear. +

+
+
sqrt
+

Square root. +

+
+
cbrt
+

Cubic root. +

+
+
log
+

Logarithmic. +

+
+ +
+
swap
+

Swap left channel axis with right channel axis. +

+
+
mirror
+

Mirror axis. +

+
+
none
+

No mirror. +

+
+
x
+

Mirror only x axis. +

+
+
y
+

Mirror only y axis. +

+
+
xy
+

Mirror both axis. +

+
+ +
+
+ + +
+

45.7.1 Examples

+ +
    +
  • Complete example using ffplay: +
    +
    ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
    +             [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
    +
    +
+ +
+
+

45.7.2 Commands

+ +

This filter supports the all above options as commands except options size and rate. +

+
+
+
+

45.8 bench, abench

+ +

Benchmark part of a filtergraph. +

+

The filter accepts the following options: +

+
+
action
+

Start or stop a timer. +

+

Available values are: +

+
start
+

Get the current time, set it as frame metadata (using the key +lavfi.bench.start_time), and forward the frame to the next filter. +

+
+
stop
+

Get the current time and fetch the lavfi.bench.start_time metadata from +the input frame metadata to get the time difference. Time difference, average, +maximum and minimum time (respectively t, avg, max and +min) are then printed. The timestamps are expressed in seconds. +

+
+
+
+ + +
+

45.8.1 Examples

+ +
    +
  • Benchmark selectivecolor filter: +
    +
    bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
    +
    +
+ +
+
+
+

45.9 concat

+ +

Concatenate audio and video streams, joining them together one after the +other. +

+

The filter works on segments of synchronized video and audio streams. All +segments must have the same number of streams of each type, and that will +also be the number of streams at output. +

+

The filter accepts the following options: +

+
+
n
+

Set the number of segments. Default is 2. +

+
+
v
+

Set the number of output video streams, that is also the number of video +streams in each segment. Default is 1. +

+
+
a
+

Set the number of output audio streams, that is also the number of audio +streams in each segment. Default is 0. +

+
+
unsafe
+

Activate unsafe mode: do not fail if segments have a different format. +

+
+
+ +

The filter has v+a outputs: first v video outputs, then +a audio outputs. +

+

There are nx(v+a) inputs: first the inputs for the first +segment, in the same order as the outputs, then the inputs for the second +segment, etc. +

+

Related streams do not always have exactly the same duration, for various +reasons including codec frame size or sloppy authoring. For that reason, +related synchronized streams (e.g. a video and its audio track) should be +concatenated at once. The concat filter will use the duration of the longest +stream in each segment (except the last one), and if necessary pad shorter +audio streams with silence. +

+

For this filter to work correctly, all segments must start at timestamp 0. +

+

All corresponding streams must have the same parameters in all segments; the +filtering system will automatically select a common pixel format for video +streams, and a common sample format, sample rate and channel layout for +audio streams, but other settings, such as resolution, must be converted +explicitly by the user. +

+

Different frame rates are acceptable but will result in variable frame rate +at output; be sure to configure the output file to handle it. +

+ +
+

45.9.1 Examples

+ +
    +
  • Concatenate an opening, an episode and an ending, all in bilingual version +(video in stream 0, audio in streams 1 and 2): +
    +
    ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
    +  '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
    +   concat=n=3:v=1:a=2 [v] [a1] [a2]' \
    +  -map '[v]' -map '[a1]' -map '[a2]' output.mkv
    +
    + +
  • Concatenate two parts, handling audio and video separately, using the +(a)movie sources, and adjusting the resolution: +
    +
    movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
    +movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
    +[v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
    +
    +

    Note that a desync will happen at the stitch if the audio and video streams +do not have exactly the same duration in the first file. +

    +
+ +
+
+

45.9.2 Commands

+ +

This filter supports the following commands: +

+
next
+

Close the current segment and step to the next one +

+
+ +
+
+
+

45.10 ebur128

+ +

EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness +level. By default, it logs a message at a frequency of 10Hz with the +Momentary loudness (identified by M), Short-term loudness (S), +Integrated loudness (I) and Loudness Range (LRA). +

+

The filter can only analyze streams which have +sample format is double-precision floating point. The input stream will be converted to +this specification, if needed. Users may need to insert aformat and/or aresample filters +after this filter to obtain the original parameters. +

+

The filter also has a video output (see the video option) with a real +time graph to observe the loudness evolution. The graphic contains the logged +message mentioned above, so it is not printed anymore when this option is set, +unless the verbose logging is set. The main graphing area contains the +short-term loudness (3 seconds of analysis), and the gauge on the right is for +the momentary loudness (400 milliseconds), but can optionally be configured +to instead display short-term loudness (see gauge). +

+

The green area marks a +/- 1LU target range around the target loudness +(-23LUFS by default, unless modified through target). +

+

More information about the Loudness Recommendation EBU R128 on +http://tech.ebu.ch/loudness. +

+

The filter accepts the following options: +

+
+
video
+

Activate the video output. The audio stream is passed unchanged whether this +option is set or no. The video stream will be the first output stream if +activated. Default is 0. +

+
+
size
+

Set the video size. This option is for video only. For the syntax of this +option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default and minimum resolution is 640x480. +

+
+
meter
+

Set the EBU scale meter. Default is 9. Common values are 9 and +18, respectively for EBU scale meter +9 and EBU scale meter +18. Any +other integer value between this range is allowed. +

+
+
metadata
+

Set metadata injection. If set to 1, the audio input will be segmented +into 100ms output frames, each of them containing various loudness information +in metadata. All the metadata keys are prefixed with lavfi.r128.. +

+

Default is 0. +

+
+
framelog
+

Force the frame logging level. +

+

Available values are: +

+
quiet
+

logging disabled +

+
info
+

information logging level +

+
verbose
+

verbose logging level +

+
+ +

By default, the logging level is set to info. If the video or +the metadata options are set, it switches to verbose. +

+
+
peak
+

Set peak mode(s). +

+

Available modes can be cumulated (the option is a flag type). Possible +values are: +

+
none
+

Disable any peak mode (default). +

+
sample
+

Enable sample-peak mode. +

+

Simple peak mode looking for the higher sample value. It logs a message +for sample-peak (identified by SPK). +

+
true
+

Enable true-peak mode. +

+

If enabled, the peak lookup is done on an over-sampled version of the input +stream for better peak accuracy. It logs a message for true-peak. +(identified by TPK) and true-peak per frame (identified by FTPK). +This mode requires a build with libswresample. +

+
+ +
+
dualmono
+

Treat mono input files as "dual mono". If a mono file is intended for playback +on a stereo system, its EBU R128 measurement will be perceptually incorrect. +If set to true, this option will compensate for this effect. +Multi-channel input files are not affected by this option. +

+
+
panlaw
+

Set a specific pan law to be used for the measurement of dual mono files. +This parameter is optional, and has a default value of -3.01dB. +

+
+
target
+

Set a specific target level (in LUFS) used as relative zero in the visualization. +This parameter is optional and has a default value of -23LUFS as specified +by EBU R128. However, material published online may prefer a level of -16LUFS +(e.g. for use with podcasts or video platforms). +

+
+
gauge
+

Set the value displayed by the gauge. Valid values are momentary and s +shortterm. By default the momentary value will be used, but in certain +scenarios it may be more useful to observe the short term value instead (e.g. +live mixing). +

+
+
scale
+

Sets the display scale for the loudness. Valid parameters are absolute +(in LUFS) or relative (LU) relative to the target. This only affects the +video output, not the summary or continuous log output. +

+
+
integrated
+

Read-only exported value for measured integrated loudness, in LUFS. +

+
+
range
+

Read-only exported value for measured loudness range, in LU. +

+
+
lra_low
+

Read-only exported value for measured LRA low, in LUFS. +

+
+
lra_high
+

Read-only exported value for measured LRA high, in LUFS. +

+
+
sample_peak
+

Read-only exported value for measured sample peak, in dBFS. +

+
+
true_peak
+

Read-only exported value for measured true peak, in dBFS. +

+
+ + +
+

45.10.1 Examples

+ +
    +
  • Real-time graph using ffplay, with a EBU scale meter +18: +
    +
    ffplay -f lavfi -i "amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]"
    +
    + +
  • Run an analysis with ffmpeg: +
    +
    ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
    +
    +
+ +
+
+
+

45.11 interleave, ainterleave

+ +

Temporally interleave frames from several inputs. +

+

interleave works with video inputs, ainterleave with audio. +

+

These filters read frames from several inputs and send the oldest +queued frame to the output. +

+

Input streams must have well defined, monotonically increasing frame +timestamp values. +

+

In order to submit one frame to output, these filters need to enqueue +at least one frame for each input, so they cannot work in case one +input is not yet terminated and will not receive incoming frames. +

+

For example consider the case when one input is a select filter +which always drops input frames. The interleave filter will keep +reading from that input, but it will never be able to send new frames +to output until the input sends an end-of-stream signal. +

+

Also, depending on inputs synchronization, the filters will drop +frames in case one input receives more frames than the other ones, and +the queue is already filled. +

+

These filters accept the following options: +

+
+
nb_inputs, n
+

Set the number of different inputs, it is 2 by default. +

+
+
duration
+

How to determine the end-of-stream. +

+
+
longest
+

The duration of the longest input. (default) +

+
+
shortest
+

The duration of the shortest input. +

+
+
first
+

The duration of the first input. +

+
+ +
+
+ + +
+

45.11.1 Examples

+ +
    +
  • Interleave frames belonging to different streams using ffmpeg: +
    +
    ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex "[0:v][1:v] interleave" out.avi
    +
    + +
  • Add flickering blur effect: +
    +
    select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
    +
    +
+ +
+
+
+

45.12 latency, alatency

+

Measure filtering latency. +

+

Report previous filter filtering latency, delay in number of audio samples for audio filters +or number of video frames for video filters. +

+

On end of input stream, filter will report min and max measured latency for previous running filter +in filtergraph. +

+
+
+

45.13 metadata, ametadata

+ +

Manipulate frame metadata. +

+

This filter accepts the following options: +

+
+
mode
+

Set mode of operation of the filter. +

+

Can be one of the following: +

+
+
select
+

If both value and key is set, select frames +which have such metadata. If only key is set, select +every frame that has such key in metadata. +

+
+
add
+

Add new metadata key and value. If key is already available +do nothing. +

+
+
modify
+

Modify value of already present key. +

+
+
delete
+

If value is set, delete only keys that have such value. +Otherwise, delete key. If key is not set, delete all metadata values in +the frame. +

+
+
print
+

Print key and its value if metadata was found. If key is not set print all +metadata values available in frame. +

+
+ +
+
key
+

Set key used with all modes. Must be set for all modes except print and delete. +

+
+
value
+

Set metadata value which will be used. This option is mandatory for +modify and add mode. +

+
+
function
+

Which function to use when comparing metadata value and value. +

+

Can be one of following: +

+
+
same_str
+

Values are interpreted as strings, returns true if metadata value is same as value. +

+
+
starts_with
+

Values are interpreted as strings, returns true if metadata value starts with +the value option string. +

+
+
less
+

Values are interpreted as floats, returns true if metadata value is less than value. +

+
+
equal
+

Values are interpreted as floats, returns true if value is equal with metadata value. +

+
+
greater
+

Values are interpreted as floats, returns true if metadata value is greater than value. +

+
+
expr
+

Values are interpreted as floats, returns true if expression from option expr +evaluates to true. +

+
+
ends_with
+

Values are interpreted as strings, returns true if metadata value ends with +the value option string. +

+
+ +
+
expr
+

Set expression which is used when function is set to expr. +The expression is evaluated through the eval API and can contain the following +constants: +

+
+
VALUE1, FRAMEVAL
+

Float representation of value from metadata key. +

+
+
VALUE2, USERVAL
+

Float representation of value as supplied by user in value option. +

+
+ +
+
file
+

If specified in print mode, output is written to the named file. Instead of +plain filename any writable url can be specified. Filename “-” is a shorthand +for standard output. If file option is not set, output is written to the log +with AV_LOG_INFO loglevel. +

+
+
direct
+

Reduces buffering in print mode when output is written to a URL set using file. +

+
+
+ + +
+

45.13.1 Examples

+ +
    +
  • Print all metadata values for frames with key lavfi.signalstats.YDIF with values +between 0 and 1. +
    +
    signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
    +
    +
  • Print silencedetect output to file metadata.txt. +
    +
    silencedetect,ametadata=mode=print:file=metadata.txt
    +
    +
  • Direct all metadata to a pipe with file descriptor 4. +
    +
    metadata=mode=print:file='pipe\:4'
    +
    +
+ +
+
+
+

45.14 perms, aperms

+ +

Set read/write permissions for the output frames. +

+

These filters are mainly aimed at developers to test direct path in the +following filter in the filtergraph. +

+

The filters accept the following options: +

+
+
mode
+

Select the permissions mode. +

+

It accepts the following values: +

+
none
+

Do nothing. This is the default. +

+
ro
+

Set all the output frames read-only. +

+
rw
+

Set all the output frames directly writable. +

+
toggle
+

Make the frame read-only if writable, and writable if read-only. +

+
random
+

Set each output frame read-only or writable randomly. +

+
+ +
+
seed
+

Set the seed for the random mode, must be an integer included between +0 and UINT32_MAX. If not specified, or if explicitly set to +-1, the filter will try to use a good random seed on a best effort +basis. +

+
+ +

Note: in case of auto-inserted filter between the permission filter and the +following one, the permission might not be received as expected in that +following filter. Inserting a format or aformat filter before the +perms/aperms filter can avoid this problem. +

+
+
+

45.15 realtime, arealtime

+ +

Slow down filtering to match real time approximately. +

+

These filters will pause the filtering for a variable amount of time to +match the output rate with the input timestamps. +They are similar to the re option to ffmpeg. +

+

They accept the following options: +

+
+
limit
+

Time limit for the pauses. Any pause longer than that will be considered +a timestamp discontinuity and reset the timer. Default is 2 seconds. +

+
speed
+

Speed factor for processing. The value must be a float larger than zero. +Values larger than 1.0 will result in faster than realtime processing, +smaller will slow processing down. The limit is automatically adapted +accordingly. Default is 1.0. +

+

A processing speed faster than what is possible without these filters cannot +be achieved. +

+
+ + +
+

45.15.1 Commands

+ +

Both filters supports the all above options as commands. +

+
+
+
+

45.16 segment, asegment

+ +

Split single input stream into multiple streams. +

+

This filter does opposite of concat filters. +

+

segment works on video frames, asegment on audio samples. +

+

This filter accepts the following options: +

+
+
timestamps
+

Timestamps of output segments separated by ’|’. The first segment will run +from the beginning of the input stream. The last segment will run until +the end of the input stream +

+
+
frames, samples
+

Exact frame/sample count to split the segments. +

+
+ +

In all cases, prefixing an each segment with ’+’ will make it relative to the +previous segment. +

+ +
+

45.16.1 Examples

+ +
    +
  • Split input audio stream into three output audio streams, starting at start of input audio stream +and storing that in 1st output audio stream, then following at 60th second and storing than in 2nd +output audio stream, and last after 150th second of input audio stream store in 3rd output audio stream: +
    +
    asegment=timestamps="60|150"
    +
    + +
+ +
+
+
+

45.17 select, aselect

+ +

Select frames to pass in output. +

+

This filter accepts the following options: +

+
+
expr, e
+

Set expression, which is evaluated for each input frame. +

+

If the expression is evaluated to zero, the frame is discarded. +

+

If the evaluation result is negative or NaN, the frame is sent to the +first output; otherwise it is sent to the output with index +ceil(val)-1, assuming that the input index starts from 0. +

+

For example a value of 1.2 corresponds to the output with index +ceil(1.2)-1 = 2-1 = 1, that is the second output. +

+
+
outputs, n
+

Set the number of outputs. The output to which to send the selected +frame is based on the result of the evaluation. Default value is 1. +

+
+ +

The expression can contain the following constants: +

+
+
n
+

The (sequential) number of the filtered frame, starting from 0. +

+
+
selected_n
+

The (sequential) number of the selected frame, starting from 0. +

+
+
prev_selected_n
+

The sequential number of the last selected frame. It’s NAN if undefined. +

+
+
TB
+

The timebase of the input timestamps. +

+
+
pts
+

The PTS (Presentation TimeStamp) of the filtered frame, +expressed in TB units. It’s NAN if undefined. +

+
+
t
+

The PTS of the filtered frame, +expressed in seconds. It’s NAN if undefined. +

+
+
prev_pts
+

The PTS of the previously filtered frame. It’s NAN if undefined. +

+
+
prev_selected_pts
+

The PTS of the last previously filtered frame. It’s NAN if undefined. +

+
+
prev_selected_t
+

The PTS of the last previously selected frame, expressed in seconds. It’s NAN if undefined. +

+
+
start_pts
+

The first PTS in the stream which is not NAN. It remains NAN if not found. +

+
+
start_t
+

The first PTS, in seconds, in the stream which is not NAN. It remains NAN if not found. +

+
+
pict_type (video only)
+

The type of the filtered frame. It can assume one of the following +values: +

+
I
+
P
+
B
+
S
+
SI
+
SP
+
BI
+
+ +
+
interlace_type (video only)
+

The frame interlace type. It can assume one of the following values: +

+
PROGRESSIVE
+

The frame is progressive (not interlaced). +

+
TOPFIRST
+

The frame is top-field-first. +

+
BOTTOMFIRST
+

The frame is bottom-field-first. +

+
+ +
+
consumed_sample_n (audio only)
+

the number of selected samples before the current frame +

+
+
samples_n (audio only)
+

the number of samples in the current frame +

+
+
sample_rate (audio only)
+

the input sample rate +

+
+
key
+

This is 1 if the filtered frame is a key-frame, 0 otherwise. +

+
+
pos
+

the position in the file of the filtered frame, -1 if the information +is not available (e.g. for synthetic video); deprecated, do not use +

+
+
scene (video only)
+

value between 0 and 1 to indicate a new scene; a low value reflects a low +probability for the current frame to introduce a new scene, while a higher +value means the current frame is more likely to be one (see the example below) +

+
+
concatdec_select
+

The concat demuxer can select only part of a concat input file by setting an +inpoint and an outpoint, but the output packets may not be entirely contained +in the selected interval. By using this variable, it is possible to skip frames +generated by the concat demuxer which are not exactly contained in the selected +interval. +

+

This works by comparing the frame pts against the lavf.concat.start_time +and the lavf.concat.duration packet metadata values which are also +present in the decoded frames. +

+

The concatdec_select variable is -1 if the frame pts is at least +start_time and either the duration metadata is missing or the frame pts is less +than start_time + duration, 0 otherwise, and NaN if the start_time metadata is +missing. +

+

That basically means that an input frame is selected if its pts is within the +interval set by the concat demuxer. +

+
+
+ +

The default value of the select expression is "1". +

+ +
+

45.17.1 Examples

+ +
    +
  • Select all frames in input: +
    +
    select
    +
    + +

    The example above is the same as: +

    +
    select=1
    +
    + +
  • Skip all frames: +
    +
    select=0
    +
    + +
  • Select only I-frames: +
    +
    select='eq(pict_type\,I)'
    +
    + +
  • Select one frame every 100: +
    +
    select='not(mod(n\,100))'
    +
    + +
  • Select only frames contained in the 10-20 time interval: +
    +
    select=between(t\,10\,20)
    +
    + +
  • Select only I-frames contained in the 10-20 time interval: +
    +
    select=between(t\,10\,20)*eq(pict_type\,I)
    +
    + +
  • Select frames with a minimum distance of 10 seconds: +
    +
    select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
    +
    + +
  • Use aselect to select only audio frames with samples number > 100: +
    +
    aselect='gt(samples_n\,100)'
    +
    + +
  • Create a mosaic of the first scenes: +
    +
    ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
    +
    + +

    Comparing scene against a value between 0.3 and 0.5 is generally a sane +choice. +

    +
  • Send even and odd frames to separate outputs, and compose them: +
    +
    select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
    +
    + +
  • Select useful frames from an ffconcat file which is using inpoints and +outpoints but where the source files are not intra frame only. +
    +
    ffmpeg -copyts -vsync 0 -segment_time_metadata 1 -i input.ffconcat -vf select=concatdec_select -af aselect=concatdec_select output.avi
    +
    +
+ +
+
+
+

45.18 sendcmd, asendcmd

+ +

Send commands to filters in the filtergraph. +

+

These filters read commands to be sent to other filters in the +filtergraph. +

+

sendcmd must be inserted between two video filters, +asendcmd must be inserted between two audio filters, but apart +from that they act the same way. +

+

The specification of commands can be provided in the filter arguments +with the commands option, or in a file specified by the +filename option. +

+

These filters accept the following options: +

+
commands, c
+

Set the commands to be read and sent to the other filters. +

+
filename, f
+

Set the filename of the commands to be read and sent to the other +filters. +

+
+ + +
+

45.18.1 Commands syntax

+ +

A commands description consists of a sequence of interval +specifications, comprising a list of commands to be executed when a +particular event related to that interval occurs. The occurring event +is typically the current frame time entering or leaving a given time +interval. +

+

An interval is specified by the following syntax: +

+
START[-END] COMMANDS;
+
+ +

The time interval is specified by the START and END times. +END is optional and defaults to the maximum time. +

+

The current frame time is considered within the specified interval if +it is included in the interval [START, END), that is when +the time is greater or equal to START and is lesser than +END. +

+

COMMANDS consists of a sequence of one or more command +specifications, separated by ",", relating to that interval. The +syntax of a command specification is given by: +

+
[FLAGS] TARGET COMMAND ARG
+
+ +

FLAGS is optional and specifies the type of events relating to +the time interval which enable sending the specified command, and must +be a non-null sequence of identifier flags separated by "+" or "|" and +enclosed between "[" and "]". +

+

The following flags are recognized: +

+
enter
+

The command is sent when the current frame timestamp enters the +specified interval. In other words, the command is sent when the +previous frame timestamp was not in the given interval, and the +current is. +

+
+
leave
+

The command is sent when the current frame timestamp leaves the +specified interval. In other words, the command is sent when the +previous frame timestamp was in the given interval, and the +current is not. +

+
+
expr
+

The command ARG is interpreted as expression and result of +expression is passed as ARG. +

+

The expression is evaluated through the eval API and can contain the following +constants: +

+
+
POS
+

Original position in the file of the frame, or undefined if undefined +for the current frame. Deprecated, do not use. +

+
+
PTS
+

The presentation timestamp in input. +

+
+
N
+

The count of the input frame for video or audio, starting from 0. +

+
+
T
+

The time in seconds of the current frame. +

+
+
TS
+

The start time in seconds of the current command interval. +

+
+
TE
+

The end time in seconds of the current command interval. +

+
+
TI
+

The interpolated time of the current command interval, TI = (T - TS) / (TE - TS). +

+
+
W
+

The video frame width. +

+
+
H
+

The video frame height. +

+
+ +
+
+ +

If FLAGS is not specified, a default value of [enter] is +assumed. +

+

TARGET specifies the target of the command, usually the name of +the filter class or a specific filter instance name. +

+

COMMAND specifies the name of the command for the target filter. +

+

ARG is optional and specifies the optional list of argument for +the given COMMAND. +

+

Between one interval specification and another, whitespaces, or +sequences of characters starting with # until the end of line, +are ignored and can be used to annotate comments. +

+

A simplified BNF description of the commands specification syntax +follows: +

+
COMMAND_FLAG  ::= "enter" | "leave"
+COMMAND_FLAGS ::= COMMAND_FLAG [(+|"|")COMMAND_FLAG]
+COMMAND       ::= ["[" COMMAND_FLAGS "]"] TARGET COMMAND [ARG]
+COMMANDS      ::= COMMAND [,COMMANDS]
+INTERVAL      ::= START[-END] COMMANDS
+INTERVALS     ::= INTERVAL[;INTERVALS]
+
+ +
+
+

45.18.2 Examples

+ +
    +
  • Specify audio tempo change at second 4: +
    +
    asendcmd=c='4.0 atempo tempo 1.5',atempo
    +
    + +
  • Target a specific filter instance: +
    +
    asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
    +
    + +
  • Specify a list of drawtext and hue commands in a file. +
    +
    # show text in the interval 5-10
    +5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
    +         [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
    +
    +# desaturate the image in the interval 15-20
    +15.0-20.0 [enter] hue s 0,
    +          [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
    +          [leave] hue s 1,
    +          [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
    +
    +# apply an exponential saturation fade-out effect, starting from time 25
    +25 [enter] hue s exp(25-t)
    +
    + +

    A filtergraph allowing to read and process the above command list +stored in a file test.cmd, can be specified with: +

    +
    sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
    +
    +
+ +
+
+
+

45.19 setpts, asetpts

+ +

Change the PTS (presentation timestamp) of the input frames. +

+

setpts works on video frames, asetpts on audio frames. +

+

This filter accepts the following options: +

+
+
expr
+

The expression which is evaluated for each frame to construct its timestamp. +

+
+
+ +

The expression is evaluated through the eval API and can contain the following +constants: +

+
+
FRAME_RATE, FR
+

frame rate, only defined for constant frame-rate video +

+
+
PTS
+

The presentation timestamp in input +

+
+
N
+

The count of the input frame for video or the number of consumed samples, +not including the current frame for audio, starting from 0. +

+
+
NB_CONSUMED_SAMPLES
+

The number of consumed samples, not including the current frame (only +audio) +

+
+
NB_SAMPLES, S
+

The number of samples in the current frame (only audio) +

+
+
SAMPLE_RATE, SR
+

The audio sample rate. +

+
+
STARTPTS
+

The PTS of the first frame. +

+
+
STARTT
+

the time in seconds of the first frame +

+
+
INTERLACED
+

State whether the current frame is interlaced. +

+
+
T
+

the time in seconds of the current frame +

+
+
POS
+

original position in the file of the frame, or undefined if undefined +for the current frame; deprecated, do not use +

+
+
PREV_INPTS
+

The previous input PTS. +

+
+
PREV_INT
+

previous input time in seconds +

+
+
PREV_OUTPTS
+

The previous output PTS. +

+
+
PREV_OUTT
+

previous output time in seconds +

+
+
RTCTIME
+

The wallclock (RTC) time in microseconds. This is deprecated, use time(0) +instead. +

+
+
RTCSTART
+

The wallclock (RTC) time at the start of the movie in microseconds. +

+
+
TB
+

The timebase of the input timestamps. +

+
+
T_CHANGE
+

Time of the first frame after command was applied or time of the first frame if no commands. +

+
+
+ + +
+

45.19.1 Examples

+ +
    +
  • Start counting PTS from zero +
    +
    setpts=PTS-STARTPTS
    +
    + +
  • Apply fast motion effect: +
    +
    setpts=0.5*PTS
    +
    + +
  • Apply slow motion effect: +
    +
    setpts=2.0*PTS
    +
    + +
  • Set fixed rate of 25 frames per second: +
    +
    setpts=N/(25*TB)
    +
    + +
  • Set fixed rate 25 fps with some jitter: +
    +
    setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
    +
    + +
  • Apply an offset of 10 seconds to the input PTS: +
    +
    setpts=PTS+10/TB
    +
    + +
  • Generate timestamps from a "live source" and rebase onto the current timebase: +
    +
    setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
    +
    + +
  • Generate timestamps by counting samples: +
    +
    asetpts=N/SR/TB
    +
    + +
+ +
+
+

45.19.2 Commands

+ +

Both filters support all above options as commands. +

+
+
+
+

45.20 setrange

+ +

Force color range for the output video frame. +

+

The setrange filter marks the color range property for the +output frames. It does not change the input frame, but only sets the +corresponding property, which affects how the frame is treated by +following filters. +

+

The filter accepts the following options: +

+
+
range
+

Available values are: +

+
+
auto
+

Keep the same color range property. +

+
+
unspecified, unknown
+

Set the color range as unspecified. +

+
+
limited, tv, mpeg
+

Set the color range as limited. +

+
+
full, pc, jpeg
+

Set the color range as full. +

+
+
+
+ +
+
+

45.21 settb, asettb

+ +

Set the timebase to use for the output frames timestamps. +It is mainly useful for testing timebase configuration. +

+

It accepts the following parameters: +

+
+
expr, tb
+

The expression which is evaluated into the output timebase. +

+
+
+ +

The value for tb is an arithmetic expression representing a +rational. The expression can contain the constants "AVTB" (the default +timebase), "intb" (the input timebase) and "sr" (the sample rate, +audio only). Default value is "intb". +

+ +
+

45.21.1 Examples

+ +
    +
  • Set the timebase to 1/25: +
    +
    settb=expr=1/25
    +
    + +
  • Set the timebase to 1/10: +
    +
    settb=expr=0.1
    +
    + +
  • Set the timebase to 1001/1000: +
    +
    settb=1+0.001
    +
    + +
  • Set the timebase to 2*intb: +
    +
    settb=2*intb
    +
    + +
  • Set the default timebase value: +
    +
    settb=AVTB
    +
    +
+ +
+
+
+

45.22 showcqt

+

Convert input audio to a video output representing frequency spectrum +logarithmically using Brown-Puckette constant Q transform algorithm with +direct frequency domain coefficient calculation (but the transform itself +is not really constant Q, instead the Q factor is actually variable/clamped), +with musical tone scale, from E0 to D#10. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. It must be even. For the syntax of this option, +check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 1920x1080. +

+
+
fps, rate, r
+

Set the output frame rate. Default value is 25. +

+
+
bar_h
+

Set the bargraph height. It must be even. Default value is -1 which +computes the bargraph height automatically. +

+
+
axis_h
+

Set the axis height. It must be even. Default value is -1 which computes +the axis height automatically. +

+
+
sono_h
+

Set the sonogram height. It must be even. Default value is -1 which +computes the sonogram height automatically. +

+
+
fullhd
+

Set the fullhd resolution. This option is deprecated, use size, s +instead. Default value is 1. +

+
+
sono_v, volume
+

Specify the sonogram volume expression. It can contain variables: +

+
bar_v
+

the bar_v evaluated expression +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option +

+
+

and functions: +

+
a_weighting(f)
+

A-weighting of equal loudness +

+
b_weighting(f)
+

B-weighting of equal loudness +

+
c_weighting(f)
+

C-weighting of equal loudness. +

+
+

Default value is 16. +

+
+
bar_v, volume2
+

Specify the bargraph volume expression. It can contain variables: +

+
sono_v
+

the sono_v evaluated expression +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option +

+
+

and functions: +

+
a_weighting(f)
+

A-weighting of equal loudness +

+
b_weighting(f)
+

B-weighting of equal loudness +

+
c_weighting(f)
+

C-weighting of equal loudness. +

+
+

Default value is sono_v. +

+
+
sono_g, gamma
+

Specify the sonogram gamma. Lower gamma makes the spectrum more contrast, +higher gamma makes the spectrum having more range. Default value is 3. +Acceptable range is [1, 7]. +

+
+
bar_g, gamma2
+

Specify the bargraph gamma. Default value is 1. Acceptable range is +[1, 7]. +

+
+
bar_t
+

Specify the bargraph transparency level. Lower value makes the bargraph sharper. +Default value is 1. Acceptable range is [0, 1]. +

+
+
timeclamp, tc
+

Specify the transform timeclamp. At low frequency, there is trade-off between +accuracy in time domain and frequency domain. If timeclamp is lower, +event in time domain is represented more accurately (such as fast bass drum), +otherwise event in frequency domain is represented more accurately +(such as bass guitar). Acceptable range is [0.002, 1]. Default value is 0.17. +

+
+
attack
+

Set attack time in seconds. The default is 0 (disabled). Otherwise, it +limits future samples by applying asymmetric windowing in time domain, useful +when low latency is required. Accepted range is [0, 1]. +

+
+
basefreq
+

Specify the transform base frequency. Default value is 20.01523126408007475, +which is frequency 50 cents below E0. Acceptable range is [10, 100000]. +

+
+
endfreq
+

Specify the transform end frequency. Default value is 20495.59681441799654, +which is frequency 50 cents above D#10. Acceptable range is [10, 100000]. +

+
+
coeffclamp
+

This option is deprecated and ignored. +

+
+
tlength
+

Specify the transform length in time domain. Use this option to control accuracy +trade-off between time domain and frequency domain at every frequency sample. +It can contain variables: +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option. +

+
+

Default value is 384*tc/(384+tc*f). +

+
+
count
+

Specify the transform count for every video frame. Default value is 6. +Acceptable range is [1, 30]. +

+
+
fcount
+

Specify the transform count for every single pixel. Default value is 0, +which makes it computed automatically. Acceptable range is [0, 10]. +

+
+
fontfile
+

Specify font file for use with freetype to draw the axis. If not specified, +use embedded font. Note that drawing with font file or embedded font is not +implemented with custom basefreq and endfreq, use axisfile +option instead. +

+
+
font
+

Specify fontconfig pattern. This has lower priority than fontfile. The +: in the pattern may be replaced by | to avoid unnecessary +escaping. +

+
+
fontcolor
+

Specify font color expression. This is arithmetic expression that should return +integer value 0xRRGGBB. It can contain variables: +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option +

+
+

and functions: +

+
midi(f)
+

midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69) +

+
r(x), g(x), b(x)
+

red, green, and blue value of intensity x. +

+
+

Default value is st(0, (midi(f)-59.5)/12); +st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0)); +r(1-ld(1)) + b(ld(1)). +

+
+
axisfile
+

Specify image file to draw the axis. This option override fontfile and +fontcolor option. +

+
+
axis, text
+

Enable/disable drawing text to the axis. If it is set to 0, drawing to +the axis is disabled, ignoring fontfile and axisfile option. +Default value is 1. +

+
+
csp
+

Set colorspace. The accepted values are: +

+
unspecified
+

Unspecified (default) +

+
+
bt709
+

BT.709 +

+
+
fcc
+

FCC +

+
+
bt470bg
+

BT.470BG or BT.601-6 625 +

+
+
smpte170m
+

SMPTE-170M or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
bt2020ncl
+

BT.2020 with non-constant luminance +

+
+
+ +
+
cscheme
+

Set spectrogram color scheme. This is list of floating point values with format +left_r|left_g|left_b|right_r|right_g|right_b. +The default is 1|0.5|0|0|0.5|1. +

+
+
+ + +
+

45.22.1 Examples

+ +
    +
  • Playing audio while showing the spectrum: +
    +
    ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
    +
    + +
  • Same as above, but with frame rate 30 fps: +
    +
    ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
    +
    + +
  • Playing at 1280x720: +
    +
    ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
    +
    + +
  • Disable sonogram display: +
    +
    sono_h=0
    +
    + +
  • A1 and its harmonics: A1, A2, (near)E3, A3: +
    +
    ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
    +                 asplit[a][out1]; [a] showcqt [out0]'
    +
    + +
  • Same as above, but with more accuracy in frequency domain: +
    +
    ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
    +                 asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
    +
    + +
  • Custom volume: +
    +
    bar_v=10:sono_v=bar_v*a_weighting(f)
    +
    + +
  • Custom gamma, now spectrum is linear to the amplitude. +
    +
    bar_g=2:sono_g=2
    +
    + +
  • Custom tlength equation: +
    +
    tc=0.33:tlength='st(0,0.17); 384*tc / (384 / ld(0) + tc*f /(1-ld(0))) + 384*tc / (tc*f / ld(0) + 384 /(1-ld(0)))'
    +
    + +
  • Custom fontcolor and fontfile, C-note is colored green, others are colored blue: +
    +
    fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
    +
    + +
  • Custom font using fontconfig: +
    +
    font='Courier New,Monospace,mono|bold'
    +
    + +
  • Custom frequency range with custom axis using image file: +
    +
    axisfile=myaxis.png:basefreq=40:endfreq=10000
    +
    +
+ +
+
+
+

45.23 showcwt

+ +

Convert input audio to video output representing frequency spectrum +using Continuous Wavelet Transform and Morlet wavelet. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, +check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 640x512. +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+
+
scale
+

Set the frequency scale used. Allowed values are: +

+
+
linear
+
log2
+
bark
+
mel
+
erbs
+
+

Default value is linear. +

+
+
min
+

Set the minimum frequency that will be used in output. +Default is 20 Hz. +

+
+
max
+

Set the maximum frequency that will be used in output. +Default is 20000 Hz. The real frequency upper limit +depends on input audio’s sample rate and such will be enforced +on this value when it is set to value greater than Nyquist frequency. +

+
+
logb
+

Set the logarithmic basis for brightness strength when +mapping calculated magnitude values to pixel values. +Allowed range is from 0 to 1. +Default value is 0.0001. +

+
+
deviation
+

Set the frequency deviation. +Lower values than 1 are more frequency oriented, +while higher values than 1 are more time oriented. +Allowed range is from 0 to 10. +Default value is 1. +

+
+
pps
+

Set the number of pixel output per each second in one row. +Allowed range is from 1 to 1024. +Default value is 64. +

+
+
mode
+

Set the output visual mode. Allowed values are: +

+
+
magnitude
+

Show magnitude. +

+
phase
+

Show only phase. +

+
magphase
+

Show combination of magnitude and phase. +Magnitude is mapped to brightness and phase to color. +

+
channel
+

Show unique color per channel magnitude. +

+
stereo
+

Show unique color per stereo difference. +

+
+ +

Default value is magnitude. +

+
+
slide
+

Set the output slide method. Allowed values are: +

+
+
replace
+
scroll
+
frame
+
+ +
+
direction
+

Set the direction method for output slide method. Allowed values are: +

+
+
lr
+

Direction from left to right. +

+
rl
+

Direction from right to left. +

+
ud
+

Direction from up to down. +

+
du
+

Direction from down to up. +

+
+
+
+ +
+
+

45.24 showfreqs

+ +

Convert input audio to video output representing the audio power spectrum. +Audio amplitude is on Y-axis while frequency is on X-axis. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify size of video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default is 1024x512. +

+
+
rate, r
+

Set video rate. Default is 25. +

+
+
mode
+

Set display mode. +This set how each frequency bin will be represented. +

+

It accepts the following values: +

+
line
+
bar
+
dot
+
+

Default is bar. +

+
+
ascale
+

Set amplitude scale. +

+

It accepts the following values: +

+
lin
+

Linear scale. +

+
+
sqrt
+

Square root scale. +

+
+
cbrt
+

Cubic root scale. +

+
+
log
+

Logarithmic scale. +

+
+

Default is log. +

+
+
fscale
+

Set frequency scale. +

+

It accepts the following values: +

+
lin
+

Linear scale. +

+
+
log
+

Logarithmic scale. +

+
+
rlog
+

Reverse logarithmic scale. +

+
+

Default is lin. +

+
+
win_size
+

Set window size. Allowed range is from 16 to 65536. +

+

Default is 2048 +

+
+
win_func
+

Set windowing function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hanning. +

+
+
overlap
+

Set window overlap. In range [0, 1]. Default is 1, +which means optimal overlap for selected window function will be picked. +

+
+
averaging
+

Set time averaging. Setting this to 0 will display current maximal peaks. +Default is 1, which means time averaging is disabled. +

+
+
colors
+

Specify list of colors separated by space or by ’|’ which will be used to +draw channel frequencies. Unrecognized or missing colors will be replaced +by white color. +

+
+
cmode
+

Set channel display mode. +

+

It accepts the following values: +

+
combined
+
separate
+
+

Default is combined. +

+
+
minamp
+

Set minimum amplitude used in log amplitude scaler. +

+
+
data
+

Set data display mode. +

+

It accepts the following values: +

+
magnitude
+
phase
+
delay
+
+

Default is magnitude. +

+
+
channels
+

Set channels to use when processing audio. By default all are processed. +

+
+ +
+
+

45.25 showspatial

+ +

Convert stereo input audio to a video output, representing the spatial relationship +between two channels. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 512x512. +

+
+
win_size
+

Set window size. Allowed range is from 1024 to 65536. Default size is 4096. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+ +

Default value is hann. +

+
+
rate, r
+

Set output framerate. +

+
+ +
+
+

45.26 showspectrum

+ +

Convert input audio to a video output, representing the audio frequency +spectrum. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 640x512. +

+
+
slide
+

Specify how the spectrum should slide along the window. +

+

It accepts the following values: +

+
replace
+

the samples start again on the left when they reach the right +

+
scroll
+

the samples scroll from right to left +

+
fullframe
+

frames are only produced when the samples reach the right +

+
rscroll
+

the samples scroll from left to right +

+
lreplace
+

the samples start again on the right when they reach the left +

+
+ +

Default value is replace. +

+
+
mode
+

Specify display mode. +

+

It accepts the following values: +

+
combined
+

all channels are displayed in the same row +

+
separate
+

all channels are displayed in separate rows +

+
+ +

Default value is ‘combined’. +

+
+
color
+

Specify display color mode. +

+

It accepts the following values: +

+
channel
+

each channel is displayed in a separate color +

+
intensity
+

each channel is displayed using the same color scheme +

+
rainbow
+

each channel is displayed using the rainbow color scheme +

+
moreland
+

each channel is displayed using the moreland color scheme +

+
nebulae
+

each channel is displayed using the nebulae color scheme +

+
fire
+

each channel is displayed using the fire color scheme +

+
fiery
+

each channel is displayed using the fiery color scheme +

+
fruit
+

each channel is displayed using the fruit color scheme +

+
cool
+

each channel is displayed using the cool color scheme +

+
magma
+

each channel is displayed using the magma color scheme +

+
green
+

each channel is displayed using the green color scheme +

+
viridis
+

each channel is displayed using the viridis color scheme +

+
plasma
+

each channel is displayed using the plasma color scheme +

+
cividis
+

each channel is displayed using the cividis color scheme +

+
terrain
+

each channel is displayed using the terrain color scheme +

+
+ +

Default value is ‘channel’. +

+
+
scale
+

Specify scale used for calculating intensity color values. +

+

It accepts the following values: +

+
lin
+

linear +

+
sqrt
+

square root, default +

+
cbrt
+

cubic root +

+
log
+

logarithmic +

+
4thrt
+

4th root +

+
5thrt
+

5th root +

+
+ +

Default value is ‘sqrt’. +

+
+
fscale
+

Specify frequency scale. +

+

It accepts the following values: +

+
lin
+

linear +

+
log
+

logarithmic +

+
+ +

Default value is ‘lin’. +

+
+
saturation
+

Set saturation modifier for displayed colors. Negative values provide +alternative color scheme. 0 is no saturation at all. +Saturation must be in [-10.0, 10.0] range. +Default value is 1. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+ +

Default value is hann. +

+
+
orientation
+

Set orientation of time vs frequency axis. Can be vertical or +horizontal. Default is vertical. +

+
+
overlap
+

Set ratio of overlap window. Default value is 0. +When value is 1 overlap is set to recommended size for specific +window function currently used. +

+
+
gain
+

Set scale gain for calculating intensity color values. +Default value is 1. +

+
+
data
+

Set which data to display. Can be magnitude, default or phase, +or unwrapped phase: uphase. +

+
+
rotation
+

Set color rotation, must be in [-1.0, 1.0] range. +Default value is 0. +

+
+
start
+

Set start frequency from which to display spectrogram. Default is 0. +

+
+
stop
+

Set stop frequency to which to display spectrogram. Default is 0. +

+
+
fps
+

Set upper frame rate limit. Default is auto, unlimited. +

+
+
legend
+

Draw time and frequency axes and legends. Default is disabled. +

+
+
drange
+

Set dynamic range used to calculate intensity color values. Default is 120 dBFS. +Allowed range is from 10 to 200. +

+
+
limit
+

Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS. +Allowed range is from -100 to 100. +

+
+
opacity
+

Set opacity strength when using pixel format output with alpha component. +

+
+ +

The usage is very similar to the showwaves filter; see the examples in that +section. +

+ +
+

45.26.1 Examples

+ +
    +
  • Large window with logarithmic color scaling: +
    +
    showspectrum=s=1280x480:scale=log
    +
    + +
  • Complete example for a colored and sliding spectrum per channel using ffplay: +
    +
    ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
    +             [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
    +
    +
+ +
+
+
+

45.27 showspectrumpic

+ +

Convert input audio to a single video frame, representing the audio frequency +spectrum. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 4096x2048. +

+
+
mode
+

Specify display mode. +

+

It accepts the following values: +

+
combined
+

all channels are displayed in the same row +

+
separate
+

all channels are displayed in separate rows +

+
+

Default value is ‘combined’. +

+
+
color
+

Specify display color mode. +

+

It accepts the following values: +

+
channel
+

each channel is displayed in a separate color +

+
intensity
+

each channel is displayed using the same color scheme +

+
rainbow
+

each channel is displayed using the rainbow color scheme +

+
moreland
+

each channel is displayed using the moreland color scheme +

+
nebulae
+

each channel is displayed using the nebulae color scheme +

+
fire
+

each channel is displayed using the fire color scheme +

+
fiery
+

each channel is displayed using the fiery color scheme +

+
fruit
+

each channel is displayed using the fruit color scheme +

+
cool
+

each channel is displayed using the cool color scheme +

+
magma
+

each channel is displayed using the magma color scheme +

+
green
+

each channel is displayed using the green color scheme +

+
viridis
+

each channel is displayed using the viridis color scheme +

+
plasma
+

each channel is displayed using the plasma color scheme +

+
cividis
+

each channel is displayed using the cividis color scheme +

+
terrain
+

each channel is displayed using the terrain color scheme +

+
+

Default value is ‘intensity’. +

+
+
scale
+

Specify scale used for calculating intensity color values. +

+

It accepts the following values: +

+
lin
+

linear +

+
sqrt
+

square root, default +

+
cbrt
+

cubic root +

+
log
+

logarithmic +

+
4thrt
+

4th root +

+
5thrt
+

5th root +

+
+

Default value is ‘log’. +

+
+
fscale
+

Specify frequency scale. +

+

It accepts the following values: +

+
lin
+

linear +

+
log
+

logarithmic +

+
+ +

Default value is ‘lin’. +

+
+
saturation
+

Set saturation modifier for displayed colors. Negative values provide +alternative color scheme. 0 is no saturation at all. +Saturation must be in [-10.0, 10.0] range. +Default value is 1. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default value is hann. +

+
+
orientation
+

Set orientation of time vs frequency axis. Can be vertical or +horizontal. Default is vertical. +

+
+
gain
+

Set scale gain for calculating intensity color values. +Default value is 1. +

+
+
legend
+

Draw time and frequency axes and legends. Default is enabled. +

+
+
rotation
+

Set color rotation, must be in [-1.0, 1.0] range. +Default value is 0. +

+
+
start
+

Set start frequency from which to display spectrogram. Default is 0. +

+
+
stop
+

Set stop frequency to which to display spectrogram. Default is 0. +

+
+
drange
+

Set dynamic range used to calculate intensity color values. Default is 120 dBFS. +Allowed range is from 10 to 200. +

+
+
limit
+

Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS. +Allowed range is from -100 to 100. +

+
+
opacity
+

Set opacity strength when using pixel format output with alpha component. +

+
+ + +
+

45.27.1 Examples

+ +
    +
  • Extract an audio spectrogram of a whole audio track +in a 1024x1024 picture using ffmpeg: +
    +
    ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
    +
    +
+ +
+
+
+

45.28 showvolume

+ +

Convert input audio volume to a video output. +

+

The filter accepts the following options: +

+
+
rate, r
+

Set video rate. +

+
+
b
+

Set border width, allowed range is [0, 5]. Default is 1. +

+
+
w
+

Set channel width, allowed range is [80, 8192]. Default is 400. +

+
+
h
+

Set channel height, allowed range is [1, 900]. Default is 20. +

+
+
f
+

Set fade, allowed range is [0, 1]. Default is 0.95. +

+
+
c
+

Set volume color expression. +

+

The expression can use the following variables: +

+
+
VOLUME
+

Current max volume of channel in dB. +

+
+
PEAK
+

Current peak. +

+
+
CHANNEL
+

Current channel number, starting from 0. +

+
+ +
+
t
+

If set, displays channel names. Default is enabled. +

+
+
v
+

If set, displays volume values. Default is enabled. +

+
+
o
+

Set orientation, can be horizontal: h or vertical: v, +default is h. +

+
+
s
+

Set step size, allowed range is [0, 5]. Default is 0, which means +step is disabled. +

+
+
p
+

Set background opacity, allowed range is [0, 1]. Default is 0. +

+
+
m
+

Set metering mode, can be peak: p or rms: r, +default is p. +

+
+
ds
+

Set display scale, can be linear: lin or log: log, +default is lin. +

+
+
dm
+

In second. +If set to > 0., display a line for the max level +in the previous seconds. +default is disabled: 0. +

+
+
dmc
+

The color of the max line. Use when dm option is set to > 0. +default is: orange +

+
+ +
+
+

45.29 showwaves

+ +

Convert input audio to a video output, representing the samples waves. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 600x240. +

+
+
mode
+

Set display mode. +

+

Available values are: +

+
point
+

Draw a point for each sample. +

+
+
line
+

Draw a vertical line for each sample. +

+
+
p2p
+

Draw a point for each sample and a line between them. +

+
+
cline
+

Draw a centered vertical line for each sample. +

+
+ +

Default value is point. +

+
+
n
+

Set the number of samples which are printed on the same column. A +larger value will decrease the frame rate. Must be a positive +integer. This option can be set only if the value for rate +is not explicitly specified. +

+
+
rate, r
+

Set the (approximate) output frame rate. This is done by setting the +option n. Default value is "25". +

+
+
split_channels
+

Set if channels should be drawn separately or overlap. Default value is 0. +

+
+
colors
+

Set colors separated by ’|’ which are going to be used for drawing of each channel. +

+
+
scale
+

Set amplitude scale. +

+

Available values are: +

+
lin
+

Linear. +

+
+
log
+

Logarithmic. +

+
+
sqrt
+

Square root. +

+
+
cbrt
+

Cubic root. +

+
+ +

Default is linear. +

+
+
draw
+

Set the draw mode. This is mostly useful to set for high n. +

+

Available values are: +

+
scale
+

Scale pixel values for each drawn sample. +

+
+
full
+

Draw every sample directly. +

+
+ +

Default value is scale. +

+
+ + +
+

45.29.1 Examples

+ +
    +
  • Output the input file audio and the corresponding video representation +at the same time: +
    +
    amovie=a.mp3,asplit[out0],showwaves[out1]
    +
    + +
  • Create a synthetic signal and show it with showwaves, forcing a +frame rate of 30 frames per second: +
    +
    aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
    +
    +
+ +
+
+
+

45.30 showwavespic

+ +

Convert input audio to a single video frame, representing the samples waves. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 600x240. +

+
+
split_channels
+

Set if channels should be drawn separately or overlap. Default value is 0. +

+
+
colors
+

Set colors separated by ’|’ which are going to be used for drawing of each channel. +

+
+
scale
+

Set amplitude scale. +

+

Available values are: +

+
lin
+

Linear. +

+
+
log
+

Logarithmic. +

+
+
sqrt
+

Square root. +

+
+
cbrt
+

Cubic root. +

+
+ +

Default is linear. +

+
+
draw
+

Set the draw mode. +

+

Available values are: +

+
scale
+

Scale pixel values for each drawn sample. +

+
+
full
+

Draw every sample directly. +

+
+ +

Default value is scale. +

+
+
filter
+

Set the filter mode. +

+

Available values are: +

+
average
+

Use average samples values for each drawn sample. +

+
+
peak
+

Use peak samples values for each drawn sample. +

+
+ +

Default value is average. +

+
+ + +
+

45.30.1 Examples

+ +
    +
  • Extract a channel split representation of the wave form of a whole audio track +in a 1024x800 picture using ffmpeg: +
    +
    ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
    +
    +
+ +
+
+
+

45.31 sidedata, asidedata

+ +

Delete frame side data, or select frames based on it. +

+

This filter accepts the following options: +

+
+
mode
+

Set mode of operation of the filter. +

+

Can be one of the following: +

+
+
select
+

Select every frame with side data of type. +

+
+
delete
+

Delete side data of type. If type is not set, delete all side +data in the frame. +

+
+
+ +
+
type
+

Set side data type used with all modes. Must be set for select mode. For +the list of frame side data types, refer to the AVFrameSideDataType enum +in libavutil/frame.h. For example, to choose +AV_FRAME_DATA_PANSCAN side data, you must specify PANSCAN. +

+
+
+ +
+
+

45.32 spectrumsynth

+ +

Synthesize audio from 2 input video spectrums, first input stream represents +magnitude across time and second represents phase across time. +The filter will transform from frequency domain as displayed in videos back +to time domain as presented in audio output. +

+

This filter is primarily created for reversing processed showspectrum +filter outputs, but can synthesize sound from other spectrograms too. +But in such case results are going to be poor if the phase data is not +available, because in such cases phase data need to be recreated, usually +it’s just recreated from random noise. +For best results use gray only output (channel color mode in +showspectrum filter) and log scale for magnitude video and +lin scale for phase video. To produce phase, for 2nd video, use +data option. Inputs videos should generally use fullframe +slide mode as that saves resources needed for decoding video. +

+

The filter accepts the following options: +

+
+
sample_rate
+

Specify sample rate of output audio, the sample rate of audio from which +spectrum was generated may differ. +

+
+
channels
+

Set number of channels represented in input video spectrums. +

+
+
scale
+

Set scale which was used when generating magnitude input spectrum. +Can be lin or log. Default is log. +

+
+
slide
+

Set slide which was used when generating inputs spectrums. +Can be replace, scroll, fullframe or rscroll. +Default is fullframe. +

+
+
win_func
+

Set window function used for resynthesis. +

+
+
overlap
+

Set window overlap. In range [0, 1]. Default is 1, +which means optimal overlap for selected window function will be picked. +

+
+
orientation
+

Set orientation of input videos. Can be vertical or horizontal. +Default is vertical. +

+
+ + +
+

45.32.1 Examples

+ +
    +
  • First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate, +then resynthesize videos back to audio with spectrumsynth: +
    +
    ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=log:overlap=0.875:color=channel:slide=fullframe:data=magnitude -an -c:v rawvideo magnitude.nut
    +ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=lin:overlap=0.875:color=channel:slide=fullframe:data=phase -an -c:v rawvideo phase.nut
    +ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
    +
    +
+ +
+
+
+

45.33 split, asplit

+ +

Split input into several identical outputs. +

+

asplit works with audio input, split with video. +

+

The filter accepts a single parameter which specifies the number of outputs. If +unspecified, it defaults to 2. +

+ +
+

45.33.1 Examples

+ +
    +
  • Create two separate outputs from the same input: +
    +
    [in] split [out0][out1]
    +
    + +
  • To create 3 or more outputs, you need to specify the number of +outputs, like in: +
    +
    [in] asplit=3 [out0][out1][out2]
    +
    + +
  • Create two separate outputs from the same input, one cropped and +one padded: +
    +
    [in] split [splitout1][splitout2];
    +[splitout1] crop=100:100:0:0    [cropout];
    +[splitout2] pad=200:200:100:100 [padout];
    +
    + +
  • Create 5 copies of the input audio with ffmpeg: +
    +
    ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
    +
    +
+ +
+
+
+

45.34 zmq, azmq

+ +

Receive commands sent through a libzmq client, and forward them to +filters in the filtergraph. +

+

zmq and azmq work as a pass-through filters. zmq +must be inserted between two video filters, azmq between two +audio filters. Both are capable to send messages to any filter type. +

+

To enable these filters you need to install the libzmq library and +headers and configure FFmpeg with --enable-libzmq. +

+

For more information about libzmq see: +http://www.zeromq.org/ +

+

The zmq and azmq filters work as a libzmq server, which +receives messages sent through a network interface defined by the +bind_address (or the abbreviation "b") option. +Default value of this option is tcp://localhost:5555. You may +want to alter this value to your needs, but do not forget to escape any +’:’ signs (see filtergraph escaping). +

+

The received message must be in the form: +

+
TARGET COMMAND [ARG]
+
+ +

TARGET specifies the target of the command, usually the name of +the filter class or a specific filter instance name. The default +filter instance name uses the pattern ‘Parsed_<filter_name>_<index>’, +but you can override this by using the ‘filter_name@id’ syntax +(see Filtergraph syntax). +

+

COMMAND specifies the name of the command for the target filter. +

+

ARG is optional and specifies the optional argument list for the +given COMMAND. +

+

Upon reception, the message is processed and the corresponding command +is injected into the filtergraph. Depending on the result, the filter +will send a reply to the client, adopting the format: +

+
ERROR_CODE ERROR_REASON
+MESSAGE
+
+ +

MESSAGE is optional. +

+ +
+

45.34.1 Examples

+ +

Look at tools/zmqsend for an example of a zmq client which can +be used to send commands processed by these filters. +

+

Consider the following filtergraph generated by ffplay. +In this example the last overlay filter has an instance name. All other +filters will have default instance names. +

+
+
ffplay -dumpgraph 1 -f lavfi "
+color=s=100x100:c=red  [l];
+color=s=100x100:c=blue [r];
+nullsrc=s=200x100, zmq [bg];
+[bg][l]   overlay     [bg+l];
+[bg+l][r] overlay@my=x=100 "
+
+ +

To change the color of the left side of the video, the following +command can be used: +

+
echo Parsed_color_0 c yellow | tools/zmqsend
+
+ +

To change the right side: +

+
echo Parsed_color_1 c pink | tools/zmqsend
+
+ +

To change the position of the right side: +

+
echo overlay@my x 150 | tools/zmqsend
+
+ + + +
+
+
+
+

46 Multimedia Sources

+ +

Below is a description of the currently available multimedia sources. +

+ +
+

46.1 amovie

+ +

This is the same as movie source, except it selects an audio +stream by default. +

+
+
+

46.2 avsynctest

+

Generate an Audio/Video Sync Test. +

+

Generated stream periodically shows flash video frame and emits beep in audio. +Useful to inspect A/V sync issues. +

+

It accepts the following options: +

+
+
size, s
+

Set output video size. Default value is hd720. +

+
+
framerate, fr
+

Set output video frame rate. Default value is 30. +

+
+
samplerate, sr
+

Set output audio sample rate. Default value is 44100. +

+
+
amplitude, a
+

Set output audio beep amplitude. Default value is 0.7. +

+
+
period, p
+

Set output audio beep period in seconds. Default value is 3. +

+
+
delay, dl
+

Set output video flash delay in number of frames. Default value is 0. +

+
+
cycle, c
+

Enable cycling of video delays, by default is disabled. +

+
+
duration, d
+

Set stream output duration. By default duration is unlimited. +

+
+
fg, bg, ag
+

Set foreground/background/additional color. +

+
+ + +
+

46.2.1 Commands

+ +

This source supports the some above options as commands. +

+
+
+
+

46.3 movie

+ +

Read audio and/or video stream(s) from a movie container. +

+

It accepts the following parameters: +

+
+
filename
+

The name of the resource to read (not necessarily a file; it can also be a +device or a stream accessed through some protocol). +

+
+
format_name, f
+

Specifies the format assumed for the movie to read, and can be either +the name of a container or an input device. If not specified, the +format is guessed from movie_name or by probing. +

+
+
seek_point, sp
+

Specifies the seek point in seconds. The frames will be output +starting from this seek point. The parameter is evaluated with +av_strtod, so the numerical value may be suffixed by an IS +postfix. The default value is "0". +

+
+
streams, s
+

Specifies the streams to read. Several streams can be specified, +separated by "+". The source will then have as many outputs, in the +same order. The syntax is explained in the (ffmpeg)"Stream specifiers" +section in the ffmpeg manual. Two special names, "dv" and "da" specify +respectively the default (best suited) video and audio stream. Default +is "dv", or "da" if the filter is called as "amovie". +

+
+
stream_index, si
+

Specifies the index of the video stream to read. If the value is -1, +the most suitable video stream will be automatically selected. The default +value is "-1". Deprecated. If the filter is called "amovie", it will select +audio instead of video. +

+
+
loop
+

Specifies how many times to read the stream in sequence. +If the value is 0, the stream will be looped infinitely. +Default value is "1". +

+

Note that when the movie is looped the source timestamps are not +changed, so it will generate non monotonically increasing timestamps. +

+
+
discontinuity
+

Specifies the time difference between frames above which the point is +considered a timestamp discontinuity which is removed by adjusting the later +timestamps. +

+
+
dec_threads
+

Specifies the number of threads for decoding +

+
+
format_opts
+

Specify format options for the opened file. Format options can be specified +as a list of key=value pairs separated by ’:’. The following example +shows how to add protocol_whitelist and protocol_blacklist options: +

+
ffplay -f lavfi
+"movie=filename='1.sdp':format_opts='protocol_whitelist=file,rtp,udp\:protocol_blacklist=http'"
+
+
+
+ +

It allows overlaying a second video on top of the main input of +a filtergraph, as shown in this graph: +

+
input -----------> deltapts0 --> overlay --> output
+                                    ^
+                                    |
+movie --> scale--> deltapts1 -------+
+
+ +
+

46.3.1 Examples

+ +
    +
  • Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it +on top of the input labelled "in": +
    +
    movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
    +[in] setpts=PTS-STARTPTS [main];
    +[main][over] overlay=16:16 [out]
    +
    + +
  • Read from a video4linux2 device, and overlay it on top of the input +labelled "in": +
    +
    movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
    +[in] setpts=PTS-STARTPTS [main];
    +[main][over] overlay=16:16 [out]
    +
    + +
  • Read the first video stream and the audio stream with id 0x81 from +dvd.vob; the video is connected to the pad named "video" and the audio is +connected to the pad named "audio": +
    +
    movie=dvd.vob:s=v:0+#0x81 [video] [audio]
    +
    +
+ +
+
+

46.3.2 Commands

+ +

Both movie and amovie support the following commands: +

+
seek
+

Perform seek using "av_seek_frame". +The syntax is: seek stream_index|timestamp|flags +

    +
  • stream_index: If stream_index is -1, a default +stream is selected, and timestamp is automatically converted +from AV_TIME_BASE units to the stream specific time_base. +
  • timestamp: Timestamp in AVStream.time_base units +or, if no stream is specified, in AV_TIME_BASE units. +
  • flags: Flags which select direction and seeking mode. +
+ +
+
get_duration
+

Get movie duration in AV_TIME_BASE units. +

+
+
+ +
+
+
+
+

47 External libraries

+ +

FFmpeg can be hooked up with a number of external libraries to add support +for more formats. None of them are used by default, their use has to be +explicitly requested by passing the appropriate flags to +./configure. +

+ +
+

47.1 Alliance for Open Media (AOM)

+ +

FFmpeg can make use of the AOM library for AV1 decoding and encoding. +

+

Go to http://aomedia.org/ and follow the instructions for +installing the library. Then pass --enable-libaom to configure to +enable it. +

+
+
+

47.2 AMD AMF/VCE

+ +

FFmpeg can use the AMD Advanced Media Framework library +for accelerated H.264 and HEVC(only windows) encoding on hardware with Video Coding Engine (VCE). +

+

To enable support you must obtain the AMF framework header files(version 1.4.9+) from +https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git. +

+

Create an AMF/ directory in the system include path. +Copy the contents of AMF/amf/public/include/ into that directory. +Then configure FFmpeg with --enable-amf. +

+

Initialization of amf encoder occurs in this order: +1) trying to initialize through dx11(only windows) +2) trying to initialize through dx9(only windows) +3) trying to initialize through vulkan +

+

To use h.264(AMD VCE) encoder on linux amdgru-pro version 19.20+ and amf-amdgpu-pro +package(amdgru-pro contains, but does not install automatically) are required. +

+

This driver can be installed using amdgpu-pro-install script in official amd driver archive. +

+
+
+

47.3 AviSynth

+ +

FFmpeg can read AviSynth scripts as input. To enable support, pass +--enable-avisynth to configure after installing the headers +provided by AviSynth+. +AviSynth+ can be configured to install only the headers by either +passing -DHEADERS_ONLY:bool=on to the normal CMake-based build +system, or by using the supplied GNUmakefile. +

+

For Windows, supported AviSynth variants are +AviSynth 2.6 RC1 or higher for 32-bit builds and +AviSynth+ r1718 or higher for 32-bit and 64-bit builds. +

+

For Linux, macOS, and BSD, the only supported AviSynth variant is +AviSynth+, starting with version 3.5. +

+
+

In 2016, AviSynth+ added support for building with GCC. However, due to +the eccentricities of Windows’ calling conventions, 32-bit GCC builds +of AviSynth+ are not compatible with typical 32-bit builds of FFmpeg. +

+

By default, FFmpeg assumes compatibility with 32-bit MSVC builds of +AviSynth+ since that is the most widely-used and entrenched build +configuration. Users can override this and enable support for 32-bit +GCC builds of AviSynth+ by passing -DAVSC_WIN32_GCC32 to +--extra-cflags when configuring FFmpeg. +

+

64-bit builds of FFmpeg are not affected, and can use either MSVC or +GCC builds of AviSynth+ without any special flags. +

NOTE +

+
+

AviSynth(+) is loaded dynamically. Distributors can build FFmpeg +with --enable-avisynth, and the binaries will work regardless +of the end user having AviSynth installed. If/when an end user +would like to use AviSynth scripts, then they can install AviSynth(+) +and FFmpeg will be able to find and use it to open scripts. +

NOTE +

+
+
+

47.4 Chromaprint

+ +

FFmpeg can make use of the Chromaprint library for generating audio fingerprints. +Pass --enable-chromaprint to configure to +enable it. See https://acoustid.org/chromaprint. +

+
+
+

47.5 codec2

+ +

FFmpeg can make use of the codec2 library for codec2 decoding and encoding. +There is currently no native decoder, so libcodec2 must be used for decoding. +

+

Go to http://freedv.org/, download "Codec 2 source archive". +Build and install using CMake. Debian users can install the libcodec2-dev package instead. +Once libcodec2 is installed you can pass --enable-libcodec2 to configure to enable it. +

+

The easiest way to use codec2 is with .c2 files, since they contain the mode information required for decoding. +To encode such a file, use a .c2 file extension and give the libcodec2 encoder the -mode option: +ffmpeg -i input.wav -mode 700C output.c2. +Playback is as simple as ffplay output.c2. +For a list of supported modes, run ffmpeg -h encoder=libcodec2. +Raw codec2 files are also supported. +To make sense of them the mode in use needs to be specified as a format option: +ffmpeg -f codec2raw -mode 1300 -i input.raw output.wav. +

+
+
+

47.6 dav1d

+ +

FFmpeg can make use of the dav1d library for AV1 video decoding. +

+

Go to https://code.videolan.org/videolan/dav1d and follow the instructions for +installing the library. Then pass --enable-libdav1d to configure to enable it. +

+
+
+

47.7 davs2

+ +

FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video decoding. +

+

Go to https://github.com/pkuvcl/davs2 and follow the instructions for +installing the library. Then pass --enable-libdavs2 to configure to +enable it. +

+
+

libdavs2 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

47.8 uavs3d

+ +

FFmpeg can make use of the uavs3d library for AVS3-P2/IEEE1857.10 video decoding. +

+

Go to https://github.com/uavs3/uavs3d and follow the instructions for +installing the library. Then pass --enable-libuavs3d to configure to +enable it. +

+
+
+

47.9 Game Music Emu

+ +

FFmpeg can make use of the Game Music Emu library to read audio from supported video game +music file formats. Pass --enable-libgme to configure to +enable it. See https://bitbucket.org/mpyne/game-music-emu/overview. +

+
+
+

47.10 Intel QuickSync Video

+ +

FFmpeg can use Intel QuickSync Video (QSV) for accelerated decoding and encoding +of multiple codecs. To use QSV, FFmpeg must be linked against the libmfx +dispatcher, which loads the actual decoding libraries. +

+

The dispatcher is open source and can be downloaded from +https://github.com/lu-zero/mfx_dispatch.git. FFmpeg needs to be configured +with the --enable-libmfx option and pkg-config needs to be able to +locate the dispatcher’s .pc files. +

+
+
+

47.11 Kvazaar

+ +

FFmpeg can make use of the Kvazaar library for HEVC encoding. +

+

Go to https://github.com/ultravideo/kvazaar and follow the +instructions for installing the library. Then pass +--enable-libkvazaar to configure to enable it. +

+
+
+

47.12 LAME

+ +

FFmpeg can make use of the LAME library for MP3 encoding. +

+

Go to http://lame.sourceforge.net/ and follow the +instructions for installing the library. +Then pass --enable-libmp3lame to configure to enable it. +

+
+
+

47.13 libilbc

+ +

iLBC is a narrowband speech codec that has been made freely available +by Google as part of the WebRTC project. libilbc is a packaging friendly +copy of the iLBC codec. FFmpeg can make use of the libilbc library for +iLBC decoding and encoding. +

+

Go to https://github.com/TimothyGu/libilbc and follow the instructions for +installing the library. Then pass --enable-libilbc to configure to +enable it. +

+
+
+

47.14 libjxl

+ +

JPEG XL is an image format intended to fully replace legacy JPEG for an extended +period of life. See https://jpegxl.info/ for more information, and see +https://github.com/libjxl/libjxl for the library source. You can pass +--enable-libjxl to configure in order enable the libjxl wrapper. +

+
+
+

47.15 libvpx

+ +

FFmpeg can make use of the libvpx library for VP8/VP9 decoding and encoding. +

+

Go to http://www.webmproject.org/ and follow the instructions for +installing the library. Then pass --enable-libvpx to configure to +enable it. +

+
+
+

47.16 ModPlug

+ +

FFmpeg can make use of this library, originating in Modplug-XMMS, to read from MOD-like music files. +See https://github.com/Konstanty/libmodplug. Pass --enable-libmodplug to configure to +enable it. +

+
+
+

47.17 OpenCORE, VisualOn, and Fraunhofer libraries

+ +

Spun off Google Android sources, OpenCore, VisualOn and Fraunhofer +libraries provide encoders for a number of audio codecs. +

+
+

OpenCORE and VisualOn libraries are under the Apache License 2.0 +(see http://www.apache.org/licenses/LICENSE-2.0 for details), which is +incompatible to the LGPL version 2.1 and GPL version 2. You have to +upgrade FFmpeg’s license to LGPL version 3 (or if you have enabled +GPL components, GPL version 3) by passing --enable-version3 to configure in +order to use it. +

+

The license of the Fraunhofer AAC library is incompatible with the GPL. +Therefore, for GPL builds, you have to pass --enable-nonfree to +configure in order to use it. To the best of our knowledge, it is +compatible with the LGPL. +

NOTE +

+ +
+

47.17.1 OpenCORE AMR

+ +

FFmpeg can make use of the OpenCORE libraries for AMR-NB +decoding/encoding and AMR-WB decoding. +

+

Go to http://sourceforge.net/projects/opencore-amr/ and follow the +instructions for installing the libraries. +Then pass --enable-libopencore-amrnb and/or +--enable-libopencore-amrwb to configure to enable them. +

+
+
+

47.17.2 VisualOn AMR-WB encoder library

+ +

FFmpeg can make use of the VisualOn AMR-WBenc library for AMR-WB encoding. +

+

Go to http://sourceforge.net/projects/opencore-amr/ and follow the +instructions for installing the library. +Then pass --enable-libvo-amrwbenc to configure to enable it. +

+
+
+

47.17.3 Fraunhofer AAC library

+ +

FFmpeg can make use of the Fraunhofer AAC library for AAC decoding & encoding. +

+

Go to http://sourceforge.net/projects/opencore-amr/ and follow the +instructions for installing the library. +Then pass --enable-libfdk-aac to configure to enable it. +

+
+
+
+

47.18 OpenH264

+ +

FFmpeg can make use of the OpenH264 library for H.264 decoding and encoding. +

+

Go to http://www.openh264.org/ and follow the instructions for +installing the library. Then pass --enable-libopenh264 to configure to +enable it. +

+

For decoding, this library is much more limited than the built-in decoder +in libavcodec; currently, this library lacks support for decoding B-frames +and some other main/high profile features. (It currently only supports +constrained baseline profile and CABAC.) Using it is mostly useful for +testing and for taking advantage of Cisco’s patent portfolio license +(http://www.openh264.org/BINARY_LICENSE.txt). +

+
+
+

47.19 OpenJPEG

+ +

FFmpeg can use the OpenJPEG libraries for decoding/encoding J2K videos. Go to +http://www.openjpeg.org/ to get the libraries and follow the installation +instructions. To enable using OpenJPEG in FFmpeg, pass --enable-libopenjpeg to +./configure. +

+
+
+

47.20 rav1e

+ +

FFmpeg can make use of rav1e (Rust AV1 Encoder) via its C bindings to encode videos. +Go to https://github.com/xiph/rav1e/ and follow the instructions to build +the C library. To enable using rav1e in FFmpeg, pass --enable-librav1e +to ./configure. +

+
+
+

47.21 SVT-AV1

+ +

FFmpeg can make use of the Scalable Video Technology for AV1 library for AV1 encoding. +

+

Go to https://gitlab.com/AOMediaCodec/SVT-AV1/ and follow the instructions +for installing the library. Then pass --enable-libsvtav1 to configure to +enable it. +

+
+
+

47.22 TwoLAME

+ +

FFmpeg can make use of the TwoLAME library for MP2 encoding. +

+

Go to http://www.twolame.org/ and follow the +instructions for installing the library. +Then pass --enable-libtwolame to configure to enable it. +

+
+
+

47.23 VapourSynth

+ +

FFmpeg can read VapourSynth scripts as input. To enable support, pass +--enable-vapoursynth to configure. Vapoursynth is detected via +pkg-config. Versions 42 or greater supported. +See http://www.vapoursynth.com/. +

+

Due to security concerns, Vapoursynth scripts will not +be autodetected so the input format has to be forced. For ff* CLI tools, +add -f vapoursynth before the input -i yourscript.vpy. +

+
+
+

47.24 x264

+ +

FFmpeg can make use of the x264 library for H.264 encoding. +

+

Go to http://www.videolan.org/developers/x264.html and follow the +instructions for installing the library. Then pass --enable-libx264 to +configure to enable it. +

+
+

x264 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

47.25 x265

+ +

FFmpeg can make use of the x265 library for HEVC encoding. +

+

Go to http://x265.org/developers.html and follow the instructions +for installing the library. Then pass --enable-libx265 to configure +to enable it. +

+
+

x265 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

47.26 xavs

+ +

FFmpeg can make use of the xavs library for AVS encoding. +

+

Go to http://xavs.sf.net/ and follow the instructions for +installing the library. Then pass --enable-libxavs to configure to +enable it. +

+
+
+

47.27 xavs2

+ +

FFmpeg can make use of the xavs2 library for AVS2-P2/IEEE1857.4 video encoding. +

+

Go to https://github.com/pkuvcl/xavs2 and follow the instructions for +installing the library. Then pass --enable-libxavs2 to configure to +enable it. +

+
+

libxavs2 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

47.28 ZVBI

+ +

ZVBI is a VBI decoding library which can be used by FFmpeg to decode DVB +teletext pages and DVB teletext subtitles. +

+

Go to http://sourceforge.net/projects/zapping/ and follow the instructions for +installing the library. Then pass --enable-libzvbi to configure to +enable it. +

+
+
+
+

48 Supported File Formats, Codecs or Features

+ +

You can use the -formats and -codecs options to have an exhaustive list. +

+ +
+

48.1 File Formats

+ +

FFmpeg supports the following file formats through the libavformat +library: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
3dostrX
4xmX4X Technologies format, used in some games.
8088flex TMVX
AAXXAudible Enhanced Audio format, used in audiobooks.
AAXAudible Format 2, 3, and 4, used in audiobooks.
ACT VoiceXcontains G.729 audio
Adobe FilmstripXX
Audio IFF (AIFF)XX
American Laser Games MMXMultimedia format used in games like Mad Dog McCree.
3GPP AMRXX
Amazing Studio Packed Animation FileXMultimedia format used in game Heart Of Darkness.
Apple HTTP Live StreamingX
Artworx Data FormatX
Interplay ACMXAudio only format used in some Interplay games.
ADPXAudio format used on the Nintendo Gamecube.
AFCXAudio format used on the Nintendo Gamecube.
ADS/SS2XAudio format used on the PS2.
APNGXX
ASFXXAdvanced / Active Streaming Format.
ASTXXAudio format used on the Nintendo Wii.
AVIXX
AviSynthX
AVRXAudio format used on Mac.
AVSXMultimedia format used by the Creature Shock game.
Beam Software SIFFXAudio and video format used in some games by Beam Software.
Bethesda Softworks VIDXUsed in some games from Bethesda Softworks.
Binary textX
BinkXMultimedia format used by many games.
Bink AudioXAudio only multimedia format used by some games.
Bitmap Brothers JVXUsed in Z and Z95 games.
BRPXArgonaut Games format.
Brute Force & IgnoranceXUsed in the game Flash Traffic: City of Angels.
BFSTMXAudio format used on the Nintendo WiiU (based on BRSTM).
BRSTMXAudio format used on the Nintendo Wii.
BW64XBroadcast Wave 64bit.
BWFXX
codec2 (raw)XXMust be given -mode format option to decode correctly.
codec2 (.c2 files)XXContains header with version and mode info, simplifying playback.
CRI ADXXXAudio-only format used in console video games.
CRI AIXX
CRI HCAXAudio-only format used in console video games.
Discworld II BMVX
Interplay C93XUsed in the game Cyberia from Interplay.
Delphine Software International CINXMultimedia format used by Delphine Software games.
Digital Speech Standard (DSS)X
CD+GXVideo format used by CD+G karaoke disks
Phantom CineX
Commodore CDXLXAmiga CD video format
Core Audio FormatXXApple Core Audio Format
CRC testing formatX
Creative VoiceXXCreated for the Sound Blaster Pro.
CRYO APCXAudio format used in some games by CRYO Interactive Entertainment.
D-Cinema audioXX
Deluxe Paint AnimationX
DCSTRX
DFAXThis format is used in Chronomaster game
DirectDraw SurfaceX
DSD Stream File (DSF)X
DV videoXX
DXAXThis format is used in the non-Windows version of the Feeble Files + game and different game cutscenes repacked for use with ScummVM.
Electronic Arts cdataX
Electronic Arts MultimediaXUsed in various EA games; files have extensions like WVE and UV2.
Ensoniq Paris Audio FileX
FFM (FFserver live feed)XX
Flash (SWF)XX
Flash 9 (AVM2)XXOnly embedded audio is decoded.
FLI/FLC/FLX animationX.fli/.flc files
Flash Video (FLV)XXMacromedia Flash video files
framecrc testing formatX
FunCom ISSXAudio format used in various games from FunCom like The Longest Journey.
G.723.1XX
G.726XBoth left- and right-justified.
G.729 BITXX
G.729 rawX
GENHXAudio format for various games.
GIF AnimationXX
GXFXXGeneral eXchange Format SMPTE 360M, used by Thomson Grass Valley + playout servers.
HNMXOnly version 4 supported, used in some games from Cryo Interactive
iCEDraw FileX
ICOXXMicrosoft Windows ICO
id Quake II CIN videoX
id RoQXXUsed in Quake III, Jedi Knight 2 and other computer games.
IEC61937 encapsulationXX
IFFXInterchange File Format
IFVXA format used by some old CCTV DVRs.
iLBCXX
Interplay MVEXFormat used in various Interplay computer games.
Iterated Systems ClearVideoXI-frames only
IV8XA format generated by IndigoVision 8000 video server.
IVF (On2)XXA format used by libvpx
Internet Video RecordingX
IRCAMXX
LAFXLimitless Audio Format
LATMXX
LMLM4XUsed by Linux Media Labs MPEG-4 PCI boards
LOASXcontains LATM multiplexed AAC audio
LRCXX
LVFX
LXFXVR native stream format, used by Leitch/Harris’ video servers.
Magic Lantern Video (MLV)X
MatroskaXX
Matroska audioX
FFmpeg metadataXXMetadata in text format.
MAXIS XAXUsed in Sim City 3000; file extension .xa.
MCAXUsed in some games from Capcom; file extension .mca.
MD StudioX
Metal Gear Solid: The Twin SnakesX
Megalux FrameXUsed by Megalux Ultimate Paint
MobiClip MODSX
MobiClip MOFLEXX
Mobotix .mxgX
Monkey’s AudioX
Motion Pixels MVIX
MOV/QuickTime/MP4XX3GP, 3GP2, PSP, iPod variants supported
MP2XX
MP3XX
MPEG-1 SystemXXmuxed audio and video, VCD format supported
MPEG-PS (program stream)XXalso known as VOB file, SVCD and DVD format supported
MPEG-TS (transport stream)XXalso known as DVB Transport Stream
MPEG-4XXMPEG-4 is a variant of QuickTime.
MSFXAudio format used on the PS3.
Mirillis FIC videoXNo cursor rendering.
MIDI Sample Dump StandardX
MIME multipart JPEGX
MSN TCP webcamXUsed by MSN Messenger webcam streams.
MTVX
MusepackX
Musepack SV8X
Material eXchange Format (MXF)XXSMPTE 377M, used by D-Cinema, broadcast industry.
Material eXchange Format (MXF), D-10 MappingXXSMPTE 386M, D-10/IMX Mapping.
NC camera feedXNC (AVIP NC4600) camera streams
NIST SPeech HEader REsourcesX
Computerized Speech Lab NSPX
NTT TwinVQ (VQF)XNippon Telegraph and Telephone Corporation TwinVQ.
Nullsoft Streaming VideoX
NuppelVideoX
NUTXXNUT Open Container Format
OggXX
Playstation Portable PMPX
Portable Voice FormatX
RK Audio (RKA)X
TechnoTrend PVAXUsed by TechnoTrend DVB PCI boards.
QCPX
raw ADTS (AAC)XX
raw AC-3XX
raw AMR-NBX
raw AMR-WBX
raw APACX
raw aptXXX
raw aptX HDXX
raw BonkX
raw Chinese AVS videoXX
raw DFPWMXX
raw DiracXX
raw DNxHDXX
raw DTSXX
raw DTS-HDX
raw E-AC-3XX
raw FLACXX
raw GSMX
raw H.261XX
raw H.263XX
raw H.264XX
raw HEVCXX
raw Ingenient MJPEGX
raw MJPEGXX
raw MLPX
raw MPEGX
raw MPEG-1X
raw MPEG-2X
raw MPEG-4XX
raw NULLX
raw videoXX
raw id RoQX
raw OBUXX
raw SBCXX
raw ShortenX
raw TAKX
raw TrueHDXX
raw VC-1XX
raw PCM A-lawXX
raw PCM mu-lawXX
raw PCM Archimedes VIDCXX
raw PCM signed 8 bitXX
raw PCM signed 16 bit big-endianXX
raw PCM signed 16 bit little-endianXX
raw PCM signed 24 bit big-endianXX
raw PCM signed 24 bit little-endianXX
raw PCM signed 32 bit big-endianXX
raw PCM signed 32 bit little-endianXX
raw PCM signed 64 bit big-endianXX
raw PCM signed 64 bit little-endianXX
raw PCM unsigned 8 bitXX
raw PCM unsigned 16 bit big-endianXX
raw PCM unsigned 16 bit little-endianXX
raw PCM unsigned 24 bit big-endianXX
raw PCM unsigned 24 bit little-endianXX
raw PCM unsigned 32 bit big-endianXX
raw PCM unsigned 32 bit little-endianXX
raw PCM 16.8 floating point little-endianX
raw PCM 24.0 floating point little-endianX
raw PCM floating-point 32 bit big-endianXX
raw PCM floating-point 32 bit little-endianXX
raw PCM floating-point 64 bit big-endianXX
raw PCM floating-point 64 bit little-endianXX
RDTX
REDCODE R3DXFile format used by RED Digital cameras, contains JPEG 2000 frames and PCM audio.
RealMediaXX
RedirectorX
RedSparkX
Renderware TeXture DictionaryX
Resolume DXVX
RF64X
RL2XAudio and video format used in some games by Entertainment Software Partners.
RPL/ARMovieX
Lego Mindstorms RSOXX
RSDX
RTMPXXOutput is performed by publishing stream to RTMP server
RTPXX
RTSPXX
Sample Dump eXchangeX
SAPXX
SBGX
SDNSX
SDPX
SERX
Digital Pictures SGAX
Sega FILM/CPKXXUsed in many Sega Saturn console games.
Silicon Graphics MovieX
Sierra SOLX.sol files used in Sierra Online games.
Sierra VMDXUsed in Sierra CD-ROM games.
SmackerXMultimedia format used by many games.
SMJPEGXXUsed in certain Loki game ports.
SMPTE 337M encapsulationX
SmushXMultimedia format used in some LucasArts games.
Sony OpenMG (OMA)XXAudio format used in Sony Sonic Stage and Sony Vegas.
Sony PlayStation STRX
Sony Wave64 (W64)XX
SoX native formatXX
SUN AU formatXX
SUP raw PGS subtitlesXX
SVAGXAudio format used in Konami PS2 games.
TDSCX
Text filesX
THPXUsed on the Nintendo GameCube.
Tiertex Limited SEQXTiertex .seq files used in the DOS CD-ROM version of the game Flashback.
True AudioXX
VAGXAudio format used in many Sony PS2 games.
VC-1 test bitstreamXX
Vidvox HapXX
VivoX
VPKXAudio format used in Sony PS games.
Marble WADYX
WAVXX
Waveform ArchiverX
WavPackXX
WebMXX
Windows Televison (WTV)XX
Wing Commander III movieXMultimedia format used in Origin’s Wing Commander III computer game.
Westwood Studios audioXXMultimedia format used in Westwood Studios games.
Westwood Studios VQAXMultimedia format used in Westwood Studios games.
Wideband Single-bit Data (WSD)X
WVEX
Konami XMDX
XMVXMicrosoft video container used in Xbox games.
XVAGXAudio format used on the PS3.
xWMAXMicrosoft audio container used by XAudio 2.
eXtended BINary text (XBIN)X
YUV4MPEG pipeXX
Psygnosis YOPX
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+
+
+

48.2 Image Formats

+ +

FFmpeg can read and write images for each frame of a video sequence. The +following image formats are supported: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
.Y.U.VXXone raw file per component
Alias PIXXXAlias/Wavefront PIX image format
animated GIFXX
APNGXXAnimated Portable Network Graphics
BMPXXMicrosoft BMP image
BRender PIXXArgonaut BRender 3D engine image format.
CRIXCintel RAW
DPXXXDigital Picture Exchange
EXRXOpenEXR
FITSXXFlexible Image Transport System
HDRXXRadiance HDR RGBE Image format
IMGXGEM Raster image
JPEGXXProgressive JPEG is not supported.
JPEG 2000XX
JPEG-LSXX
LJPEGXLossless JPEG
Media 100X
MSPXMicrosoft Paint image
PAMXXPAM is a PNM extension with alpha support.
PBMXXPortable BitMap image
PCDXPhotoCD
PCXXXPC Paintbrush
PFMXXPortable FloatMap image
PGMXXPortable GrayMap image
PGMYUVXXPGM with U and V components in YUV 4:2:0
PGXXPGX file decoder
PHMXXPortable HalfFloatMap image
PICXPictor/PC Paint
PNGXXPortable Network Graphics image
PPMXXPortable PixelMap image
PSDXPhotoshop
PTXXV.Flash PTX format
QOIXXQuite OK Image format
SGIXXSGI RGB image format
Sun RasterfileXXSun RAS image format
TIFFXXYUV, JPEG and some extension is not supported yet.
Truevision TargaXXTarga (.TGA) image format
VBNXXVizrt Binary Image format
WBMPXXWireless Application Protocol Bitmap image format
WebPEXWebP image format, encoding supported through external library libwebp
XBMXXX BitMap image format
XFaceXXX-Face image format
XPMXX PixMap image format
XWDXXX Window Dump image format
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+

E means that support is provided through an external library. +

+
+
+

48.3 Video Codecs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
4X MovieXUsed in certain computer games.
8088flex TMVX
A64 multicolorXCreates video suitable to be played on a commodore 64 (multicolor mode).
Amazing Studio PAF VideoX
American Laser Games MMXUsed in games like Mad Dog McCree.
Amuse Graphics MovieX
AMV VideoXXUsed in Chinese MP3 players.
ANSI/ASCII artX
Apple Intermediate CodecX
Apple MJPEG-BX
Apple PixletX
Apple ProResXXfourcc: apch,apcn,apcs,apco,ap4h,ap4x
Apple QuickDrawXfourcc: qdrw
Argonaut VideoXUsed in some Argonaut games.
Asus v1XXfourcc: ASV1
Asus v2XXfourcc: ASV2
ATI VCR1Xfourcc: VCR1
ATI VCR2Xfourcc: VCR2
Auravision AuraX
Auravision Aura 2X
Autodesk Animator Flic videoX
Autodesk RLEXfourcc: AASC
AV1EESupported through external libraries libaom, libdav1d, librav1e and libsvtav1
Avid 1:1 10-bit RGB PackerXXfourcc: AVrp
AVS (Audio Video Standard) videoXVideo encoding used by the Creature Shock game.
AVS2-P2/IEEE1857.4EESupported through external libraries libxavs2 and libdavs2
AVS3-P2/IEEE1857.10ESupported through external library libuavs3d
AYUVXXMicrosoft uncompressed packed 4:4:4:4
Beam Software VBX
Bethesda VID videoXUsed in some games from Bethesda Softworks.
Bink VideoX
BitJazz SheerVideoX
Bitmap Brothers JV videoX
y41p Brooktree uncompressed 4:1:1 12-bitXX
Brooktree ProSumer VideoXfourcc: BT20
Brute Force & IgnoranceXUsed in the game Flash Traffic: City of Angels.
C93 videoXCodec used in Cyberia game.
CamStudioXfourcc: CSCD
CD+GXVideo codec for CD+G karaoke disks
CDXLXAmiga CD video codec
Chinese AVS videoEXAVS1-P2, JiZhun profile, encoding through external library libxavs
Delphine Software International CIN videoXCodec used in Delphine Software International games.
Discworld II BMV VideoX
CineForm HDXX
Canopus HQX
Canopus HQAX
Canopus HQXX
Canopus Lossless CodecX
CDToonsXCodec used in various Broderbund games.
CinepakX
Cirrus Logic AccuPakXXfourcc: CLJR
CPiA Video FormatX
Creative YUV (CYUV)X
DFAXCodec used in Chronomaster game.
DiracEXsupported though the native vc2 (Dirac Pro) encoder
Deluxe Paint AnimationX
DNxHDXXaka SMPTE VC3
Duck TrueMotion 1.0Xfourcc: DUCK
Duck TrueMotion 2.0Xfourcc: TM20
Duck TrueMotion 2.0 RTXfourcc: TR20
DV (Digital Video)XX
Dxtory capture formatX
Feeble Files/ScummVM DXAXCodec originally used in Feeble Files game.
Electronic Arts CMV videoXUsed in NHL 95 game.
Electronic Arts Madcow videoX
Electronic Arts TGV videoX
Electronic Arts TGQ videoX
Electronic Arts TQI videoX
Escape 124X
Escape 130X
FFmpeg video codec #1XXlossless codec (fourcc: FFV1)
Flash Screen Video v1XXfourcc: FSV1
Flash Screen Video v2XX
Flash Video (FLV)XXSorenson H.263 used in Flash
FM Screen Capture CodecX
Forward UncompressedX
FrapsX
Go2MeetingXfourcc: G2M2, G2M3
Go2WebinarXfourcc: G2M4
Gremlin Digital VideoX
H.261XX
H.263 / H.263-1996XX
H.263+ / H.263-1998 / H.263 version 2XX
H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10EXencoding supported through external library libx264 and OpenH264
HEVCXXencoding supported through external library libx265 and libkvazaar
HNM version 4X
HuffYUVXX
HuffYUV FFmpeg variantXX
IBM UltimotionXfourcc: ULTI
id Cinematic videoXUsed in Quake II.
id RoQ videoXXUsed in Quake III, Jedi Knight 2, other computer games.
IFF ILBMXIFF interleaved bitmap
IFF ByteRun1XIFF run length encoded bitmap
Infinity IMM4X
Intel H.263X
Intel Indeo 2X
Intel Indeo 3X
Intel Indeo 4X
Intel Indeo 5X
Interplay C93XUsed in the game Cyberia from Interplay.
Interplay MVE videoXUsed in Interplay .MVE files.
J2KXX
Karl Morton’s video codecXCodec used in Worms games.
Kega Game Video (KGV1)XKega emulator screen capture codec.
LagarithX
LCL (LossLess Codec Library) MSZHX
LCL (LossLess Codec Library) ZLIBEE
LOCOX
LucasArts SANM/SmushXUsed in LucasArts games / SMUSH animations.
lossless MJPEGXX
MagicYUV VideoXX
Mandsoft Screen Capture CodecX
Microsoft ATC ScreenXAlso known as Microsoft Screen 3.
Microsoft Expression Encoder ScreenXAlso known as Microsoft Titanium Screen 2.
Microsoft RLEX
Microsoft Screen 1XAlso known as Windows Media Video V7 Screen.
Microsoft Screen 2XAlso known as Windows Media Video V9 Screen.
Microsoft Video 1X
MimicXUsed in MSN Messenger Webcam streams.
Miro VideoXLXfourcc: VIXL
MJPEG (Motion JPEG)XX
Mobotix MxPEG videoX
Motion Pixels videoX
MPEG-1 videoXX
MPEG-2 videoXX
MPEG-4 part 2XXlibxvidcore can be used alternatively for encoding.
MPEG-4 part 2 Microsoft variant version 1X
MPEG-4 part 2 Microsoft variant version 2XX
MPEG-4 part 2 Microsoft variant version 3XX
Newtek SpeedHQXX
Nintendo Gamecube THP videoX
NotchLCX
NuppelVideo/RTjpegXVideo encoding used in NuppelVideo files.
On2 VP3Xstill experimental
On2 VP4Xfourcc: VP40
On2 VP5Xfourcc: VP50
On2 VP6Xfourcc: VP60,VP61,VP62
On2 VP7Xfourcc: VP70,VP71
VP8EXfourcc: VP80, encoding supported through external library libvpx
VP9EXencoding supported through external library libvpx
Pinnacle TARGA CineWave YUV16Xfourcc: Y216
Q-team QPEGXfourccs: QPEG, Q1.0, Q1.1
QuickTime 8BPS videoX
QuickTime Animation (RLE) videoXXfourcc: ’rle ’
QuickTime Graphics (SMC)XXfourcc: ’smc ’
QuickTime video (RPZA)XXfourcc: rpza
R10K AJA Kona 10-bit RGB CodecXX
R210 Quicktime Uncompressed RGB 10-bitXX
Raw VideoXX
RealVideo 1.0XX
RealVideo 2.0XX
RealVideo 3.0Xstill far from ideal
RealVideo 4.0X
Renderware TXD (TeXture Dictionary)XTexture dictionaries used by the Renderware Engine.
RL2 videoXused in some games by Entertainment Software Partners
ScreenPressorX
ScreenpressoX
Screen Recorder Gold CodecX
Sierra VMD videoXUsed in Sierra VMD files.
Silicon Graphics Motion Video Compressor 1 (MVC1)X
Silicon Graphics Motion Video Compressor 2 (MVC2)X
Silicon Graphics RLE 8-bit videoX
Smacker videoXVideo encoding used in Smacker.
SMPTE VC-1X
SnowXXexperimental wavelet codec (fourcc: SNOW)
Sony PlayStation MDEC (Motion DECoder)X
Sorenson Vector Quantizer 1XXfourcc: SVQ1
Sorenson Vector Quantizer 3Xfourcc: SVQ3
Sunplus JPEG (SP5X)Xfourcc: SP5X
TechSmith Screen Capture CodecXfourcc: TSCC
TechSmith Screen Capture Codec 2Xfourcc: TSC2
TheoraEXencoding supported through external library libtheora
Tiertex Limited SEQ videoXCodec used in DOS CD-ROM FlashBack game.
Ut VideoXX
v210 QuickTime uncompressed 4:2:2 10-bitXX
v308 QuickTime uncompressed 4:4:4XX
v408 QuickTime uncompressed 4:4:4:4XX
v410 QuickTime uncompressed 4:4:4 10-bitXX
VBLE Lossless CodecX
VMware Screen Codec / VMware VideoXCodec used in videos captured by VMware.
Westwood Studios VQA (Vector Quantized Animation) videoX
Windows Media ImageX
Windows Media Video 7XX
Windows Media Video 8XX
Windows Media Video 9Xnot completely working
Wing Commander III / XanXUsed in Wing Commander III .MVE files.
Wing Commander IV / XanXUsed in Wing Commander IV.
Winnov WNV1X
WMV7XX
YAMAHA SMAFXX
Psygnosis YOP VideoX
yuv4XXlibquicktime uncompressed packed 4:2:0
ZeroCodec Lossless VideoX
ZLIBXXpart of LCL, encoder experimental
Zip Motion Blocks VideoXXEncoder works only in PAL8.
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+

E means that support is provided through an external library. +

+
+
+

48.4 Audio Codecs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
8SVX exponentialX
8SVX fibonacciX
AACEXXencoding supported through internal encoder and external library libfdk-aac
AAC+EIXencoding supported through external library libfdk-aac
AC-3IXIX
ACELP.KELVINX
ADPCM 4X MovieX
ADPCM Yamaha AICAX
ADPCM AmuseGraphics MovieX
ADPCM Argonaut GamesXX
ADPCM CDROM XAX
ADPCM Creative TechnologyX16 -> 4, 8 -> 4, 8 -> 3, 8 -> 2
ADPCM Electronic ArtsXUsed in various EA titles.
ADPCM Electronic Arts Maxis CDROM XSXUsed in Sim City 3000.
ADPCM Electronic Arts R1X
ADPCM Electronic Arts R2X
ADPCM Electronic Arts R3X
ADPCM Electronic Arts XASX
ADPCM G.722XX
ADPCM G.726XX
ADPCM IMA Acorn ReplayX
ADPCM IMA AMVXXUsed in AMV files
ADPCM IMA Cunning DevelopmentsX
ADPCM IMA Electronic Arts EACSX
ADPCM IMA Electronic Arts SEADX
ADPCM IMA FuncomX
ADPCM IMA High Voltage Software ALPXX
ADPCM IMA Mobiclip MOFLEXX
ADPCM IMA QuickTimeXX
ADPCM IMA Simon & Schuster InteractiveXX
ADPCM IMA Ubisoft APMXX
ADPCM IMA Loki SDL MJPEGX
ADPCM IMA WAVXX
ADPCM IMA WestwoodX
ADPCM ISS IMAXUsed in FunCom games.
ADPCM IMA DialogicX
ADPCM IMA Duck DK3XUsed in some Sega Saturn console games.
ADPCM IMA Duck DK4XUsed in some Sega Saturn console games.
ADPCM IMA RadicalX
ADPCM MicrosoftXX
ADPCM MS IMAXX
ADPCM Nintendo Gamecube AFCX
ADPCM Nintendo Gamecube DTKX
ADPCM Nintendo THPX
ADPCM PlaystationX
ADPCM QT IMAXX
ADPCM SEGA CRI ADXXXUsed in Sega Dreamcast games.
ADPCM Shockwave FlashXX
ADPCM Sound Blaster Pro 2-bitX
ADPCM Sound Blaster Pro 2.6-bitX
ADPCM Sound Blaster Pro 4-bitX
ADPCM VIMAXUsed in LucasArts SMUSH animations.
ADPCM Konami XMDX
ADPCM Westwood Studios IMAXXUsed in Westwood Studios games like Command and Conquer.
ADPCM YamahaXX
ADPCM ZorkX
AMR-NBEXencoding supported through external library libopencore-amrnb
AMR-WBEXencoding supported through external library libvo-amrwbenc
Amazing Studio PAF AudioX
Apple lossless audioXXQuickTime fourcc ’alac’
aptXXXUsed in Bluetooth A2DP
aptX HDXXUsed in Bluetooth A2DP
ATRAC1X
ATRAC3X
ATRAC3+X
ATRAC9X
Bink AudioXUsed in Bink and Smacker files in many games.
Bonk audioX
CELTEdecoding supported through external library libcelt
codec2EEen/decoding supported through external library libcodec2
CRI HCAX
Delphine Software International CIN audioXCodec used in Delphine Software International games.
DFPWMXX
Digital Speech Standard - Standard Play mode (DSS SP)X
Discworld II BMV AudioX
COOKXAll versions except 5.1 are supported.
DCA (DTS Coherent Acoustics)XXsupported extensions: XCh, XXCH, X96, XBR, XLL, LBR (partially)
Dolby EX
DPCM Cuberoot-Delta-ExactXUsed in few games.
DPCM GremlinX
DPCM id RoQXXUsed in Quake III, Jedi Knight 2 and other computer games.
DPCM Marble WADYX
DPCM InterplayXUsed in various Interplay computer games.
DPCM Squareroot-Delta-ExactXUsed in various games.
DPCM Sierra OnlineXUsed in Sierra Online game audio files.
DPCM SolX
DPCM XanXUsed in Origin’s Wing Commander IV AVI files.
DPCM Xilam DERFX
DSD (Direct Stream Digital), least significant bit firstX
DSD (Direct Stream Digital), most significant bit firstX
DSD (Direct Stream Digital), least significant bit first, planarX
DSD (Direct Stream Digital), most significant bit first, planarX
DSP Group TrueSpeechX
DST (Direct Stream Transfer)X
DV audioX
Enhanced AC-3XX
EVRC (Enhanced Variable Rate Codec)X
FLAC (Free Lossless Audio Codec)XIX
FTR VoiceX
G.723.1XX
G.729X
GSMEXencoding supported through external library libgsm
GSM Microsoft variantEXencoding supported through external library libgsm
IAC (Indeo Audio Coder)X
iLBC (Internet Low Bitrate Codec)EEXencoding and decoding supported through external library libilbc
IMC (Intel Music Coder)X
Interplay ACMX
MACE (Macintosh Audio Compression/Expansion) 3:1X
MACE (Macintosh Audio Compression/Expansion) 6:1X
Marian’s A-pac audioX
MI-SC4 (Micronas SC-4 Audio)X
MLP (Meridian Lossless Packing)XXUsed in DVD-Audio discs.
Monkey’s AudioX
MP1 (MPEG audio layer 1)IX
MP2 (MPEG audio layer 2)IXIXencoding supported also through external library TwoLAME
MP3 (MPEG audio layer 3)EIXencoding supported through external library LAME, ADU MP3 and MP3onMP4 also supported
MPEG-4 Audio Lossless Coding (ALS)X
MobiClip FastAudioX
Musepack SV7X
Musepack SV8X
Nellymoser AsaoXX
On2 AVC (Audio for Video Codec)X
OpusEXencoding supported through external library libopus
PCM A-lawXX
PCM mu-lawXX
PCM Archimedes VIDCXX
PCM signed 8-bit planarXX
PCM signed 16-bit big-endian planarXX
PCM signed 16-bit little-endian planarXX
PCM signed 24-bit little-endian planarXX
PCM signed 32-bit little-endian planarXX
PCM 32-bit floating point big-endianXX
PCM 32-bit floating point little-endianXX
PCM 64-bit floating point big-endianXX
PCM 64-bit floating point little-endianXX
PCM D-Cinema audio signed 24-bitXX
PCM signed 8-bitXX
PCM signed 16-bit big-endianXX
PCM signed 16-bit little-endianXX
PCM signed 24-bit big-endianXX
PCM signed 24-bit little-endianXX
PCM signed 32-bit big-endianXX
PCM signed 32-bit little-endianXX
PCM signed 16/20/24-bit big-endian in MPEG-TSX
PCM unsigned 8-bitXX
PCM unsigned 16-bit big-endianXX
PCM unsigned 16-bit little-endianXX
PCM unsigned 24-bit big-endianXX
PCM unsigned 24-bit little-endianXX
PCM unsigned 32-bit big-endianXX
PCM unsigned 32-bit little-endianXX
PCM SGAX
QCELP / PureVoiceX
QDesign Music Codec 1X
QDesign Music Codec 2XThere are still some distortions.
RealAudio 1.0 (14.4K)XXReal 14400 bit/s codec
RealAudio 2.0 (28.8K)XReal 28800 bit/s codec
RealAudio 3.0 (dnet)IXXReal low bitrate AC-3 codec
RealAudio LosslessX
RealAudio SIPR / ACELP.NETX
RK Audio (RKA)X
SBC (low-complexity subband codec)XXUsed in Bluetooth A2DP
ShortenX
Sierra VMD audioXUsed in Sierra VMD files.
Smacker audioX
SMPTE 302M AES3 audioXX
SonicXXexperimental codec
Sonic losslessXXexperimental codec
SpeexEEXsupported through external library libspeex
TAK (Tom’s lossless Audio Kompressor)X
True Audio (TTA)XX
TrueHDXXUsed in HD-DVD and Blu-Ray discs.
TwinVQ (VQF flavor)X
VIMAXUsed in LucasArts SMUSH animations.
ViewQuest VQCX
VorbisEXA native but very primitive encoder exists.
Voxware MetaSoundX
Waveform ArchiverX
WavPackXX
Westwood Audio (SND1)X
Windows Media Audio 1XX
Windows Media Audio 2XX
Windows Media Audio LosslessX
Windows Media Audio ProX
Windows Media Audio VoiceX
Xbox Media Audio 1X
Xbox Media Audio 2X
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+

E means that support is provided through an external library. +

+

I means that an integer-only version is available, too (ensures high +performance on systems without hardware floating point support). +

+
+
+

48.5 Subtitle Formats

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameMuxingDemuxingEncodingDecoding
3GPP Timed TextXX
AQTitleXX
DVBXXXX
DVB teletextXE
DVDXXXX
JACOsubXXX
MicroDVDXXX
MPL2XX
MPsub (MPlayer)XX
PGSX
PJS (Phoenix)XX
RealTextXX
SAMIXX
Spruce format (STL)XX
SSA/ASSXXXX
SubRip (SRT)XXXX
SubViewer v1XX
SubViewerXX
TED Talks captionsXX
TTMLXX
VobSub (IDX+SUB)XX
VPlayerXX
WebVTTXXXX
XSUBXX
+ +

X means that the feature is supported. +

+

E means that support is provided through an external library. +

+
+
+

48.6 Network Protocols

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameSupport
AMQPE
fileX
FTPX
GopherX
GophersX
HLSX
HTTPX
HTTPSX
IcecastX
MMSHX
MMSTX
pipeX
Pro-MPEG FECX
RTMPX
RTMPEX
RTMPSX
RTMPTX
RTMPTEX
RTMPTSX
RTPX
SAMBAE
SCTPX
SFTPE
TCPX
TLSX
UDPX
ZMQE
+ +

X means that the protocol is supported. +

+

E means that support is provided through an external library. +

+ +
+
+

48.7 Input/Output Devices

+ + + + + + + + + + + + + + + + + + + + + + +
NameInputOutput
ALSAXX
BKTRX
cacaX
DV1394X
Lavfi virtual deviceX
Linux framebufferXX
JACKX
LIBCDIOX
LIBDC1394X
OpenALX
OpenGLX
OSSXX
PulseAudioXX
SDLX
Video4Linux2XX
VfW captureX
X11 grabbingX
Win32 grabbingX
+ +

X means that input/output is supported. +

+
+
+

48.8 Timecode

+ + + + + + + + + + +
Codec/formatReadWrite
AVIXX
DVXX
GXFXX
MOVXX
MPEG1/2XX
MXFXX
+ +
+
+ +
+

50 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-bitstream-filters.html b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-bitstream-filters.html new file mode 100644 index 0000000000000000000000000000000000000000..94038fa8b5a25cb58de4cb8708befb1f57c095c7 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-bitstream-filters.html @@ -0,0 +1,1307 @@ + + + + + +FFmpeg Bitstream Filters Documentation + + + + + + + + + + + + + + + + + +
+ + + +
+

1 Description

+ +

This document describes the bitstream filters provided by the +libavcodec library. +

+

A bitstream filter operates on the encoded stream data, and performs +bitstream level modifications without performing decoding. +

+ +
+
+

2 Bitstream Filters

+ +

When you configure your FFmpeg build, all the supported bitstream +filters are enabled by default. You can list all available ones using +the configure option --list-bsfs. +

+

You can disable all the bitstream filters using the configure option +--disable-bsfs, and selectively enable any bitstream filter using +the option --enable-bsf=BSF, or you can disable a particular +bitstream filter using the option --disable-bsf=BSF. +

+

The option -bsfs of the ff* tools will display the list of +all the supported bitstream filters included in your build. +

+

The ff* tools have a -bsf option applied per stream, taking a +comma-separated list of filters, whose parameters follow the filter +name after a ’=’. +

+
+
ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
+
+ +

Below is a description of the currently available bitstream filters, +with their parameters, if any. +

+ +
+

2.1 aac_adtstoasc

+ +

Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration +bitstream. +

+

This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4 +ADTS header and removes the ADTS header. +

+

This filter is required for example when copying an AAC stream from a +raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or +to MOV/MP4 files and related formats such as 3GP or M4A. Please note +that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats. +

+
+
+

2.2 av1_metadata

+ +

Modify metadata embedded in an AV1 stream. +

+
+
td
+

Insert or remove temporal delimiter OBUs in all temporal units of the +stream. +

+
+
insert
+

Insert a TD at the beginning of every TU which does not already have one. +

+
remove
+

Remove the TD from the beginning of every TU which has one. +

+
+ +
+
color_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the color description fields in the stream (see AV1 section 6.4.2). +

+
+
color_range
+

Set the color range in the stream (see AV1 section 6.4.2; note that +this cannot be set for streams using BT.709 primaries, sRGB transfer +characteristic and identity (RGB) matrix coefficients). +

+
tv
+

Limited range. +

+
pc
+

Full range. +

+
+ +
+
chroma_sample_position
+

Set the chroma sample location in the stream (see AV1 section 6.4.2). +This can only be set for 4:2:0 streams. +

+
+
vertical
+

Left position (matching the default in MPEG-2 and H.264). +

+
colocated
+

Top-left position. +

+
+ +
+
tick_rate
+

Set the tick rate (time_scale / num_units_in_display_tick) in +the timing info in the sequence header. +

+
num_ticks_per_picture
+

Set the number of ticks in each picture, to indicate that the stream +has a fixed framerate. Ignored if tick_rate is not also set. +

+
+
delete_padding
+

Deletes Padding OBUs. +

+
+
+ +
+
+

2.3 chomp

+ +

Remove zero padding at the end of a packet. +

+
+
+

2.4 dca_core

+ +

Extract the core from a DCA/DTS stream, dropping extensions such as +DTS-HD. +

+
+
+

2.5 dump_extra

+ +

Add extradata to the beginning of the filtered packets except when +said packets already exactly begin with the extradata that is intended +to be added. +

+
+
freq
+

The additional argument specifies which packets should be filtered. +It accepts the values: +

+
k
+
keyframe
+

add extradata to all key packets +

+
+
e
+
all
+

add extradata to all packets +

+
+
+
+ +

If not specified it is assumed ‘k’. +

+

For example the following ffmpeg command forces a global +header (thus disabling individual packet headers) in the H.264 packets +generated by the libx264 encoder, but corrects them by adding +the header stored in extradata to the key packets: +

+
ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
+
+ +
+
+

2.6 dv_error_marker

+ +

Blocks in DV which are marked as damaged are replaced by blocks of the specified color. +

+
+
color
+

The color to replace damaged blocks by +

+
sta
+

A 16 bit mask which specifies which of the 16 possible error status values are +to be replaced by colored blocks. 0xFFFE is the default which replaces all non 0 +error status values. +

+
ok
+

No error, no concealment +

+
err
+

Error, No concealment +

+
res
+

Reserved +

+
notok
+

Error or concealment +

+
notres
+

Not reserved +

+
Aa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru
+

The specific error status code +

+
+

see page 44-46 or section 5.5 of +http://web.archive.org/web/20060927044735/http://www.smpte.org/smpte_store/standards/pdf/s314m.pdf +

+
+
+ +
+
+

2.7 eac3_core

+ +

Extract the core from a E-AC-3 stream, dropping extra channels. +

+
+
+

2.8 extract_extradata

+ +

Extract the in-band extradata. +

+

Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers, +or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either "in-band" (i.e. as a part +of the bitstream containing the coded frames) or "out of band" (e.g. on the +container level). This latter form is called "extradata" in FFmpeg terminology. +

+

This bitstream filter detects the in-band headers and makes them available as +extradata. +

+
+
remove
+

When this option is enabled, the long-term headers are removed from the +bitstream after extraction. +

+
+ +
+
+

2.9 filter_units

+ +

Remove units with types in or not in a given set from the stream. +

+
+
pass_types
+

List of unit types or ranges of unit types to pass through while removing +all others. This is specified as a ’|’-separated list of unit type values +or ranges of values with ’-’. +

+
+
remove_types
+

Identical to pass_types, except the units in the given set +removed and all others passed through. +

+
+ +

Extradata is unchanged by this transformation, but note that if the stream +contains inline parameter sets then the output may be unusable if they are +removed. +

+

For example, to remove all non-VCL NAL units from an H.264 stream: +

+
ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
+
+ +

To remove all AUDs, SEI and filler from an H.265 stream: +

+
ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
+
+ +
+
+

2.10 hapqa_extract

+ +

Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file. +

+
+
texture
+

Specifies the texture to keep. +

+
+
color
+
alpha
+
+ +
+
+ +

Convert HAPQA to HAPQ +

+
ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=color -tag:v HapY -metadata:s:v:0 encoder="HAPQ" hapq_file.mov
+
+ +

Convert HAPQA to HAPAlphaOnly +

+
ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=alpha -tag:v HapA -metadata:s:v:0 encoder="HAPAlpha Only" hapalphaonly_file.mov
+
+ +
+
+

2.11 h264_metadata

+ +

Modify metadata embedded in an H.264 stream. +

+
+
aud
+

Insert or remove AUD NAL units in all access units of the stream. +

+
+
pass
+
insert
+
remove
+
+ +

Default is pass. +

+
+
sample_aspect_ratio
+

Set the sample aspect ratio of the stream in the VUI parameters. +See H.264 table E-1. +

+
+
overscan_appropriate_flag
+

Set whether the stream is suitable for display using overscan +or not (see H.264 section E.2.1). +

+
+
video_format
+
video_full_range_flag
+

Set the video format in the stream (see H.264 section E.2.1 and +table E-2). +

+
+
colour_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the colour description in the stream (see H.264 section E.2.1 +and tables E-3, E-4 and E-5). +

+
+
chroma_sample_loc_type
+

Set the chroma sample location in the stream (see H.264 section +E.2.1 and figure E-1). +

+
+
tick_rate
+

Set the tick rate (time_scale / num_units_in_tick) in the VUI +parameters. This is the smallest time unit representable in the +stream, and in many cases represents the field rate of the stream +(double the frame rate). +

+
fixed_frame_rate_flag
+

Set whether the stream has fixed framerate - typically this indicates +that the framerate is exactly half the tick rate, but the exact +meaning is dependent on interlacing and the picture structure (see +H.264 section E.2.1 and table E-6). +

+
zero_new_constraint_set_flags
+

Zero constraint_set4_flag and constraint_set5_flag in the SPS. These +bits were reserved in a previous version of the H.264 spec, and thus +some hardware decoders require these to be zero. The result of zeroing +this is still a valid bitstream. +

+
+
crop_left
+
crop_right
+
crop_top
+
crop_bottom
+

Set the frame cropping offsets in the SPS. These values will replace +the current ones if the stream is already cropped. +

+

These fields are set in pixels. Note that some sizes may not be +representable if the chroma is subsampled or the stream is interlaced +(see H.264 section 7.4.2.1.1). +

+
+
sei_user_data
+

Insert a string as SEI unregistered user data. The argument must +be of the form UUID+string, where the UUID is as hex digits +possibly separated by hyphens, and the string can be anything. +

+

For example, ‘086f3693-b7b3-4f2c-9653-21492feee5b8+hello’ will +insert the string “hello” associated with the given UUID. +

+
+
delete_filler
+

Deletes both filler NAL units and filler SEI messages. +

+
+
display_orientation
+

Insert, extract or remove Display orientation SEI messages. +See H.264 section D.1.27 and D.2.27 for syntax and semantics. +

+
+
pass
+
insert
+
remove
+
extract
+
+ +

Default is pass. +

+

Insert mode works in conjunction with rotate and flip options. +Any pre-existing Display orientation messages will be removed in insert or remove mode. +Extract mode attaches the display matrix to the packet as side data. +

+
+
rotate
+

Set rotation in display orientation SEI (anticlockwise angle in degrees). +Range is -360 to +360. Default is NaN. +

+
+
flip
+

Set flip in display orientation SEI. +

+
+
horizontal
+
vertical
+
+ +

Default is unset. +

+
+
level
+

Set the level in the SPS. Refer to H.264 section A.3 and tables A-1 +to A-5. +

+

The argument must be the name of a level (for example, ‘4.2’), a +level_idc value (for example, ‘42’), or the special name ‘auto’ +indicating that the filter should attempt to guess the level from the +input stream properties. +

+
+
+ +
+
+

2.12 h264_mp4toannexb

+ +

Convert an H.264 bitstream from length prefixed mode to start code +prefixed mode (as defined in the Annex B of the ITU-T H.264 +specification). +

+

This is required by some streaming formats, typically the MPEG-2 +transport stream format (muxer mpegts). +

+

For example to remux an MP4 file containing an H.264 stream to mpegts +format with ffmpeg, you can use the command: +

+
+
ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
+
+ +

Please note that this filter is auto-inserted for MPEG-TS (muxer +mpegts) and raw H.264 (muxer h264) output formats. +

+
+
+

2.13 h264_redundant_pps

+ +

This applies a specific fixup to some Blu-ray streams which contain +redundant PPSs modifying irrelevant parameters of the stream which +confuse other transformations which require correct extradata. +

+
+
+

2.14 hevc_metadata

+ +

Modify metadata embedded in an HEVC stream. +

+
+
aud
+

Insert or remove AUD NAL units in all access units of the stream. +

+
+
insert
+
remove
+
+ +
+
sample_aspect_ratio
+

Set the sample aspect ratio in the stream in the VUI parameters. +

+
+
video_format
+
video_full_range_flag
+

Set the video format in the stream (see H.265 section E.3.1 and +table E.2). +

+
+
colour_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the colour description in the stream (see H.265 section E.3.1 +and tables E.3, E.4 and E.5). +

+
+
chroma_sample_loc_type
+

Set the chroma sample location in the stream (see H.265 section +E.3.1 and figure E.1). +

+
+
tick_rate
+

Set the tick rate in the VPS and VUI parameters (time_scale / +num_units_in_tick). Combined with num_ticks_poc_diff_one, this can +set a constant framerate in the stream. Note that it is likely to be +overridden by container parameters when the stream is in a container. +

+
+
num_ticks_poc_diff_one
+

Set poc_proportional_to_timing_flag in VPS and VUI and use this value +to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and +E.3.1). Ignored if tick_rate is not also set. +

+
+
crop_left
+
crop_right
+
crop_top
+
crop_bottom
+

Set the conformance window cropping offsets in the SPS. These values +will replace the current ones if the stream is already cropped. +

+

These fields are set in pixels. Note that some sizes may not be +representable if the chroma is subsampled (H.265 section 7.4.3.2.1). +

+
+
level
+

Set the level in the VPS and SPS. See H.265 section A.4 and tables +A.6 and A.7. +

+

The argument must be the name of a level (for example, ‘5.1’), a +general_level_idc value (for example, ‘153’ for level 5.1), +or the special name ‘auto’ indicating that the filter should +attempt to guess the level from the input stream properties. +

+
+
+ +
+
+

2.15 hevc_mp4toannexb

+ +

Convert an HEVC/H.265 bitstream from length prefixed mode to start code +prefixed mode (as defined in the Annex B of the ITU-T H.265 +specification). +

+

This is required by some streaming formats, typically the MPEG-2 +transport stream format (muxer mpegts). +

+

For example to remux an MP4 file containing an HEVC stream to mpegts +format with ffmpeg, you can use the command: +

+
+
ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
+
+ +

Please note that this filter is auto-inserted for MPEG-TS (muxer +mpegts) and raw HEVC/H.265 (muxer h265 or +hevc) output formats. +

+
+
+

2.16 imxdump

+ +

Modifies the bitstream to fit in MOV and to be usable by the Final Cut +Pro decoder. This filter only applies to the mpeg2video codec, and is +likely not needed for Final Cut Pro 7 and newer with the appropriate +-tag:v. +

+

For example, to remux 30 MB/sec NTSC IMX to MOV: +

+
+
ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
+
+ +
+
+

2.17 mjpeg2jpeg

+ +

Convert MJPEG/AVI1 packets to full JPEG/JFIF packets. +

+

MJPEG is a video codec wherein each video frame is essentially a +JPEG image. The individual frames can be extracted without loss, +e.g. by +

+
+
ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
+
+ +

Unfortunately, these chunks are incomplete JPEG images, because +they lack the DHT segment required for decoding. Quoting from +http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml: +

+

Avery Lee, writing in the rec.video.desktop newsgroup in 2001, +commented that "MJPEG, or at least the MJPEG in AVIs having the +MJPG fourcc, is restricted JPEG with a fixed – and *omitted* – +Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2, +and it must use basic Huffman encoding, not arithmetic or +progressive. . . . You can indeed extract the MJPEG frames and +decode them with a regular JPEG decoder, but you have to prepend +the DHT segment to them, or else the decoder won’t have any idea +how to decompress the data. The exact table necessary is given in +the OpenDML spec." +

+

This bitstream filter patches the header of frames extracted from an MJPEG +stream (carrying the AVI1 header ID and lacking a DHT segment) to +produce fully qualified JPEG images. +

+
+
ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
+exiftran -i -9 frame*.jpg
+ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
+
+ +
+
+

2.18 mjpegadump

+ +

Add an MJPEG A header to the bitstream, to enable decoding by +Quicktime. +

+
+
+

2.19 mov2textsub

+ +

Extract a representable text file from MOV subtitles, stripping the +metadata header from each subtitle packet. +

+

See also the text2movsub filter. +

+
+
+

2.20 mp3decomp

+ +

Decompress non-standard compressed MP3 audio headers. +

+
+
+

2.21 mpeg2_metadata

+ +

Modify metadata embedded in an MPEG-2 stream. +

+
+
display_aspect_ratio
+

Set the display aspect ratio in the stream. +

+

The following fixed values are supported: +

+
4/3
+
16/9
+
221/100
+
+

Any other value will result in square pixels being signalled instead +(see H.262 section 6.3.3 and table 6-3). +

+
+
frame_rate
+

Set the frame rate in the stream. This is constructed from a table +of known values combined with a small multiplier and divisor - if +the supplied value is not exactly representable, the nearest +representable value will be used instead (see H.262 section 6.3.3 +and table 6-4). +

+
+
video_format
+

Set the video format in the stream (see H.262 section 6.3.6 and +table 6-6). +

+
+
colour_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the colour description in the stream (see H.262 section 6.3.6 +and tables 6-7, 6-8 and 6-9). +

+
+
+ +
+
+

2.22 mpeg4_unpack_bframes

+ +

Unpack DivX-style packed B-frames. +

+

DivX-style packed B-frames are not valid MPEG-4 and were only a +workaround for the broken Video for Windows subsystem. +They use more space, can cause minor AV sync issues, require more +CPU power to decode (unless the player has some decoded picture queue +to compensate the 2,0,2,0 frame per packet style) and cause +trouble if copied into a standard container like mp4 or mpeg-ps/ts, +because MPEG-4 decoders may not be able to decode them, since they are +not valid MPEG-4. +

+

For example to fix an AVI file containing an MPEG-4 stream with +DivX-style packed B-frames using ffmpeg, you can use the command: +

+
+
ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
+
+ +
+
+

2.23 noise

+ +

Damages the contents of packets or simply drops them without damaging the +container. Can be used for fuzzing or testing error resilience/concealment. +

+

Parameters: +

+
amount
+

Accepts an expression whose evaluation per-packet determines how often bytes in that +packet will be modified. A value below 0 will result in a variable frequency. +Default is 0 which results in no modification. However, if neither amount nor drop is specified, +amount will be set to -1. See below for accepted variables. +

+
drop
+

Accepts an expression evaluated per-packet whose value determines whether that packet is dropped. +Evaluation to a positive value results in the packet being dropped. Evaluation to a negative +value results in a variable chance of it being dropped, roughly inverse in proportion to the magnitude +of the value. Default is 0 which results in no drops. See below for accepted variables. +

+
dropamount
+

Accepts a non-negative integer, which assigns a variable chance of it being dropped, roughly inverse +in proportion to the value. Default is 0 which results in no drops. This option is kept for backwards +compatibility and is equivalent to setting drop to a negative value with the same magnitude +i.e. dropamount=4 is the same as drop=-4. Ignored if drop is also specified. +

+
+ +

Both amount and drop accept expressions containing the following variables: +

+
+
n
+

The index of the packet, starting from zero. +

+
tb
+

The timebase for packet timestamps. +

+
pts
+

Packet presentation timestamp. +

+
dts
+

Packet decoding timestamp. +

+
nopts
+

Constant representing AV_NOPTS_VALUE. +

+
startpts
+

First non-AV_NOPTS_VALUE PTS seen in the stream. +

+
startdts
+

First non-AV_NOPTS_VALUE DTS seen in the stream. +

+
duration
+
d
+

Packet duration, in timebase units. +

+
pos
+

Packet position in input; may be -1 when unknown or not set. +

+
size
+

Packet size, in bytes. +

+
key
+

Whether packet is marked as a keyframe. +

+
state
+

A pseudo random integer, primarily derived from the content of packet payload. +

+
+ + +
+

2.23.1 Examples

+

Apply modification to every byte but don’t drop any packets. +

+
ffmpeg -i INPUT -c copy -bsf noise=1 output.mkv
+
+ +

Drop every video packet not marked as a keyframe after timestamp 30s but do not +modify any of the remaining packets. +

+
ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(t\,30)*not(key)' output.mkv
+
+ +

Drop one second of audio every 10 seconds and add some random noise to the rest. +

+
ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(t\,10)\,9\,10)' output.mkv
+
+ +
+
+
+

2.24 null

+

This bitstream filter passes the packets through unchanged. +

+
+
+

2.25 pcm_rechunk

+ +

Repacketize PCM audio to a fixed number of samples per packet or a fixed packet +rate per second. This is similar to the (ffmpeg-filters)asetnsamples audio +filter but works on audio packets instead of audio frames. +

+
+
nb_out_samples, n
+

Set the number of samples per each output audio packet. The number is intended +as the number of samples per each channel. Default value is 1024. +

+
+
pad, p
+

If set to 1, the filter will pad the last audio packet with silence, so that it +will contain the same number of samples (or roughly the same number of samples, +see frame_rate) as the previous ones. Default value is 1. +

+
+
frame_rate, r
+

This option makes the filter output a fixed number of packets per second instead +of a fixed number of samples per packet. If the audio sample rate is not +divisible by the frame rate then the number of samples will not be constant but +will vary slightly so that each packet will start as close to the frame +boundary as possible. Using this option has precedence over nb_out_samples. +

+
+ +

You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio +for NTSC frame rate using the frame_rate option. +

+
ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
+
+ +
+
+

2.26 pgs_frame_merge

+ +

Merge a sequence of PGS Subtitle segments ending with an "end of display set" +segment into a single packet. +

+

This is required by some containers that support PGS subtitles +(muxer matroska). +

+
+
+

2.27 prores_metadata

+ +

Modify color property metadata embedded in prores stream. +

+
+
color_primaries
+

Set the color primaries. +Available values are: +

+
+
auto
+

Keep the same color primaries property (default). +

+
+
unknown
+
bt709
+
bt470bg
+

BT601 625 +

+
+
smpte170m
+

BT601 525 +

+
+
bt2020
+
smpte431
+

DCI P3 +

+
+
smpte432
+

P3 D65 +

+
+
+ +
+
transfer_characteristics
+

Set the color transfer. +Available values are: +

+
+
auto
+

Keep the same transfer characteristics property (default). +

+
+
unknown
+
bt709
+

BT 601, BT 709, BT 2020 +

+
smpte2084
+

SMPTE ST 2084 +

+
arib-std-b67
+

ARIB STD-B67 +

+
+ + +
+
matrix_coefficients
+

Set the matrix coefficient. +Available values are: +

+
+
auto
+

Keep the same colorspace property (default). +

+
+
unknown
+
bt709
+
smpte170m
+

BT 601 +

+
+
bt2020nc
+
+
+
+ +

Set Rec709 colorspace for each frame of the file +

+
ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
+
+ +

Set Hybrid Log-Gamma parameters for each frame of the file +

+
ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc output.mov
+
+ +
+
+

2.28 remove_extra

+ +

Remove extradata from packets. +

+

It accepts the following parameter: +

+
freq
+

Set which frame types to remove extradata from. +

+
+
k
+

Remove extradata from non-keyframes only. +

+
+
keyframe
+

Remove extradata from keyframes only. +

+
+
e, all
+

Remove extradata from all frames. +

+
+
+
+
+ +
+
+

2.29 setts

+

Set PTS and DTS in packets. +

+

It accepts the following parameters: +

+
ts
+
pts
+
dts
+

Set expressions for PTS, DTS or both. +

+
duration
+

Set expression for duration. +

+
time_base
+

Set output time base. +

+
+ +

The expressions are evaluated through the eval API and can contain the following +constants: +

+
+
N
+

The count of the input packet. Starting from 0. +

+
+
TS
+

The demux timestamp in input in case of ts or dts option or presentation +timestamp in case of pts option. +

+
+
POS
+

The original position in the file of the packet, or undefined if undefined +for the current packet +

+
+
DTS
+

The demux timestamp in input. +

+
+
PTS
+

The presentation timestamp in input. +

+
+
DURATION
+

The duration in input. +

+
+
STARTDTS
+

The DTS of the first packet. +

+
+
STARTPTS
+

The PTS of the first packet. +

+
+
PREV_INDTS
+

The previous input DTS. +

+
+
PREV_INPTS
+

The previous input PTS. +

+
+
PREV_INDURATION
+

The previous input duration. +

+
+
PREV_OUTDTS
+

The previous output DTS. +

+
+
PREV_OUTPTS
+

The previous output PTS. +

+
+
PREV_OUTDURATION
+

The previous output duration. +

+
+
NEXT_DTS
+

The next input DTS. +

+
+
NEXT_PTS
+

The next input PTS. +

+
+
NEXT_DURATION
+

The next input duration. +

+
+
TB
+

The timebase of stream packet belongs. +

+
+
TB_OUT
+

The output timebase. +

+
+
SR
+

The sample rate of stream packet belongs. +

+
+
NOPTS
+

The AV_NOPTS_VALUE constant. +

+
+ +
+
+

2.30 text2movsub

+ +

Convert text subtitles to MOV subtitles (as used by the mov_text +codec) with metadata headers. +

+

See also the mov2textsub filter. +

+
+
+

2.31 trace_headers

+ +

Log trace output containing all syntax elements in the coded stream +headers (everything above the level of individual coded blocks). +This can be useful for debugging low-level stream issues. +

+

Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending +on the build only a subset of these may be available. +

+
+
+

2.32 truehd_core

+ +

Extract the core from a TrueHD stream, dropping ATMOS data. +

+
+
+

2.33 vp9_metadata

+ +

Modify metadata embedded in a VP9 stream. +

+
+
color_space
+

Set the color space value in the frame header. Note that any frame +set to RGB will be implicitly set to PC range and that RGB is +incompatible with profiles 0 and 2. +

+
unknown
+
bt601
+
bt709
+
smpte170
+
smpte240
+
bt2020
+
rgb
+
+ +
+
color_range
+

Set the color range value in the frame header. Note that any value +imposed by the color space will take precedence over this value. +

+
tv
+
pc
+
+
+
+ +
+
+

2.34 vp9_superframe

+ +

Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This +fixes merging of split/segmented VP9 streams where the alt-ref frame +was split from its visible counterpart. +

+
+
+

2.35 vp9_superframe_split

+ +

Split VP9 superframes into single frames. +

+
+
+

2.36 vp9_raw_reorder

+ +

Given a VP9 stream with correct timestamps but possibly out of order, +insert additional show-existing-frame packets to correct the ordering. +

+ +
+
+
+

3 See Also

+ +

ffmpeg, ffplay, ffprobe, +libavcodec +

+ +
+
+

4 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-codecs.html b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-codecs.html new file mode 100644 index 0000000000000000000000000000000000000000..4dc608d7c31abd24a04957bcf154992bd249bd4b --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-codecs.html @@ -0,0 +1,7686 @@ + + + + + +FFmpeg Codecs Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ +
+ + +
+
+
+

1 Description

+ +

This document describes the codecs (decoders and encoders) provided by +the libavcodec library. +

+ +
+
+

2 Codec Options

+ +

libavcodec provides some generic global options, which can be set on +all the encoders and decoders. In addition each codec may support +so-called private options, which are specific for a given codec. +

+

Sometimes, a global option may only affect a specific kind of codec, +and may be nonsensical or ignored by another, so you need to be aware +of the meaning of the specified options. Also some options are +meant only for decoding or encoding. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the +AVCodecContext options or using the libavutil/opt.h API +for programmatic use. +

+

The list of supported options follow: +

+
+
b integer (encoding,audio,video)
+

Set bitrate in bits/s. Default value is 200K. +

+
+
ab integer (encoding,audio)
+

Set audio bitrate (in bits/s). Default value is 128K. +

+
+
bt integer (encoding,video)
+

Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate +tolerance specifies how far ratecontrol is willing to deviate from the +target average bitrate value. This is not related to min/max +bitrate. Lowering tolerance too much has an adverse effect on quality. +

+
+
flags flags (decoding/encoding,audio,video,subtitles)
+

Set generic flags. +

+

Possible values: +

+
mv4
+

Use four motion vector by macroblock (mpeg4). +

+
qpel
+

Use 1/4 pel motion compensation. +

+
loop
+

Use loop filter. +

+
qscale
+

Use fixed qscale. +

+
pass1
+

Use internal 2pass ratecontrol in first pass mode. +

+
pass2
+

Use internal 2pass ratecontrol in second pass mode. +

+
gray
+

Only decode/encode grayscale. +

+
psnr
+

Set error[?] variables during encoding. +

+
truncated
+

Input bitstream might be randomly truncated. +

+
drop_changed
+

Don’t output frames whose parameters differ from first decoded frame in stream. +Error AVERROR_INPUT_CHANGED is returned when a frame is dropped. +

+
+
ildct
+

Use interlaced DCT. +

+
low_delay
+

Force low delay. +

+
global_header
+

Place global headers in extradata instead of every keyframe. +

+
bitexact
+

Only write platform-, build- and time-independent data. (except (I)DCT). +This ensures that file and data checksums are reproducible and match between +platforms. Its primary use is for regression testing. +

+
aic
+

Apply H263 advanced intra coding / mpeg4 ac prediction. +

+
ilme
+

Apply interlaced motion estimation. +

+
cgop
+

Use closed gop. +

+
output_corrupt
+

Output even potentially corrupted frames. +

+
+ +
+
time_base rational number
+

Set codec time base. +

+

It is the fundamental unit of time (in seconds) in terms of which +frame timestamps are represented. For fixed-fps content, timebase +should be 1 / frame_rate and timestamp increments should be +identically 1. +

+
+
g integer (encoding,video)
+

Set the group of picture (GOP) size. Default value is 12. +

+
+
ar integer (decoding/encoding,audio)
+

Set audio sampling rate (in Hz). +

+
+
ac integer (decoding/encoding,audio)
+

Set number of audio channels. +

+
+
cutoff integer (encoding,audio)
+

Set cutoff bandwidth. (Supported only by selected encoders, see +their respective documentation sections.) +

+
+
frame_size integer (encoding,audio)
+

Set audio frame size. +

+

Each submitted frame except the last must contain exactly frame_size +samples per channel. May be 0 when the codec has +CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not +restricted. It is set by some decoders to indicate constant frame +size. +

+
+
frame_number integer
+

Set the frame number. +

+
+
delay integer
+
qcomp float (encoding,video)
+

Set video quantizer scale compression (VBR). It is used as a constant +in the ratecontrol equation. Recommended range for default rc_eq: +0.0-1.0. +

+
+
qblur float (encoding,video)
+

Set video quantizer scale blur (VBR). +

+
+
qmin integer (encoding,video)
+

Set min video quantizer scale (VBR). Must be included between -1 and +69, default value is 2. +

+
+
qmax integer (encoding,video)
+

Set max video quantizer scale (VBR). Must be included between -1 and +1024, default value is 31. +

+
+
qdiff integer (encoding,video)
+

Set max difference between the quantizer scale (VBR). +

+
+
bf integer (encoding,video)
+

Set max number of B frames between non-B-frames. +

+

Must be an integer between -1 and 16. 0 means that B-frames are +disabled. If a value of -1 is used, it will choose an automatic value +depending on the encoder. +

+

Default value is 0. +

+
+
b_qfactor float (encoding,video)
+

Set qp factor between P and B frames. +

+
+
codec_tag integer
+
bug flags (decoding,video)
+

Workaround not auto detected encoder bugs. +

+

Possible values: +

+
autodetect
+
xvid_ilace
+

Xvid interlacing bug (autodetected if fourcc==XVIX) +

+
ump4
+

(autodetected if fourcc==UMP4) +

+
no_padding
+

padding bug (autodetected) +

+
amv
+
qpel_chroma
+
std_qpel
+

old standard qpel (autodetected per fourcc/version) +

+
qpel_chroma2
+
direct_blocksize
+

direct-qpel-blocksize bug (autodetected per fourcc/version) +

+
edge
+

edge padding bug (autodetected per fourcc/version) +

+
hpel_chroma
+
dc_clip
+
ms
+

Workaround various bugs in microsoft broken decoders. +

+
trunc
+

trancated frames +

+
+ +
+
strict integer (decoding/encoding,audio,video)
+

Specify how strictly to follow the standards. +

+

Possible values: +

+
very
+

strictly conform to an older more strict version of the spec or reference software +

+
strict
+

strictly conform to all the things in the spec no matter what consequences +

+
normal
+
unofficial
+

allow unofficial extensions +

+
experimental
+

allow non standardized experimental things, experimental +(unfinished/work in progress/not well tested) decoders and encoders. +Note: experimental decoders can pose a security risk, do not use this for +decoding untrusted input. +

+
+ +
+
b_qoffset float (encoding,video)
+

Set QP offset between P and B frames. +

+
+
err_detect flags (decoding,audio,video)
+

Set error detection flags. +

+

Possible values: +

+
crccheck
+

verify embedded CRCs +

+
bitstream
+

detect bitstream specification deviations +

+
buffer
+

detect improper bitstream length +

+
explode
+

abort decoding on minor error detection +

+
ignore_err
+

ignore decoding errors, and continue decoding. +This is useful if you want to analyze the content of a video and thus want +everything to be decoded no matter what. This option will not result in a video +that is pleasing to watch in case of errors. +

+
careful
+

consider things that violate the spec and have not been seen in the wild as errors +

+
compliant
+

consider all spec non compliancies as errors +

+
aggressive
+

consider things that a sane encoder should not do as an error +

+
+ +
+
has_b_frames integer
+
block_align integer
+
rc_override_count integer
+
maxrate integer (encoding,audio,video)
+

Set max bitrate tolerance (in bits/s). Requires bufsize to be set. +

+
+
minrate integer (encoding,audio,video)
+

Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR +encode. It is of little use elsewise. +

+
+
bufsize integer (encoding,audio,video)
+

Set ratecontrol buffer size (in bits). +

+
+
i_qfactor float (encoding,video)
+

Set QP factor between P and I frames. +

+
+
i_qoffset float (encoding,video)
+

Set QP offset between P and I frames. +

+
+
dct integer (encoding,video)
+

Set DCT algorithm. +

+

Possible values: +

+
auto
+

autoselect a good one (default) +

+
fastint
+

fast integer +

+
int
+

accurate integer +

+
mmx
+
altivec
+
faan
+

floating point AAN DCT +

+
+ +
+
lumi_mask float (encoding,video)
+

Compress bright areas stronger than medium ones. +

+
+
tcplx_mask float (encoding,video)
+

Set temporal complexity masking. +

+
+
scplx_mask float (encoding,video)
+

Set spatial complexity masking. +

+
+
p_mask float (encoding,video)
+

Set inter masking. +

+
+
dark_mask float (encoding,video)
+

Compress dark areas stronger than medium ones. +

+
+
idct integer (decoding/encoding,video)
+

Select IDCT implementation. +

+

Possible values: +

+
auto
+
int
+
simple
+
simplemmx
+
simpleauto
+

Automatically pick a IDCT compatible with the simple one +

+
+
arm
+
altivec
+
sh4
+
simplearm
+
simplearmv5te
+
simplearmv6
+
simpleneon
+
xvid
+
faani
+

floating point AAN IDCT +

+
+ +
+
slice_count integer
+
ec flags (decoding,video)
+

Set error concealment strategy. +

+

Possible values: +

+
guess_mvs
+

iterative motion vector (MV) search (slow) +

+
deblock
+

use strong deblock filter for damaged MBs +

+
favor_inter
+

favor predicting from the previous frame instead of the current +

+
+ +
+
bits_per_coded_sample integer
+
aspect rational number (encoding,video)
+

Set sample aspect ratio. +

+
+
sar rational number (encoding,video)
+

Set sample aspect ratio. Alias to aspect. +

+
+
debug flags (decoding/encoding,audio,video,subtitles)
+

Print specific debug info. +

+

Possible values: +

+
pict
+

picture info +

+
rc
+

rate control +

+
bitstream
+
mb_type
+

macroblock (MB) type +

+
qp
+

per-block quantization parameter (QP) +

+
dct_coeff
+
green_metadata
+

display complexity metadata for the upcoming frame, GoP or for a given duration. +

+
+
skip
+
startcode
+
er
+

error recognition +

+
mmco
+

memory management control operations (H.264) +

+
bugs
+
buffers
+

picture buffer allocations +

+
thread_ops
+

threading operations +

+
nomc
+

skip motion compensation +

+
+ +
+
cmp integer (encoding,video)
+

Set full pel me compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
subcmp integer (encoding,video)
+

Set sub pel me compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
mbcmp integer (encoding,video)
+

Set macroblock compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
ildctcmp integer (encoding,video)
+

Set interlaced dct compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
dia_size integer (encoding,video)
+

Set diamond type & size for motion estimation. +

+
(1024, INT_MAX)
+

full motion estimation(slowest) +

+
(768, 1024]
+

umh motion estimation +

+
(512, 768]
+

hex motion estimation +

+
(256, 512]
+

l2s diamond motion estimation +

+
[2,256]
+

var diamond motion estimation +

+
(-1, 2)
+

small diamond motion estimation +

+
-1
+

funny diamond motion estimation +

+
(INT_MIN, -1)
+

sab diamond motion estimation +

+
+ +
+
last_pred integer (encoding,video)
+

Set amount of motion predictors from the previous frame. +

+
+
precmp integer (encoding,video)
+

Set pre motion estimation compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
pre_dia_size integer (encoding,video)
+

Set diamond type & size for motion estimation pre-pass. +

+
+
subq integer (encoding,video)
+

Set sub pel motion estimation quality. +

+
+
me_range integer (encoding,video)
+

Set limit motion vectors range (1023 for DivX player). +

+
+
global_quality integer (encoding,audio,video)
+
slice_flags integer
+
mbd integer (encoding,video)
+

Set macroblock decision algorithm (high quality mode). +

+

Possible values: +

+
simple
+

use mbcmp (default) +

+
bits
+

use fewest bits +

+
rd
+

use best rate distortion +

+
+ +
+
rc_init_occupancy integer (encoding,video)
+

Set number of bits which should be loaded into the rc buffer before +decoding starts. +

+
+
flags2 flags (decoding/encoding,audio,video,subtitles)
+
+

Possible values: +

+
fast
+

Allow non spec compliant speedup tricks. +

+
noout
+

Skip bitstream encoding. +

+
ignorecrop
+

Ignore cropping information from sps. +

+
local_header
+

Place global headers at every keyframe instead of in extradata. +

+
chunks
+

Frame data might be split into multiple chunks. +

+
showall
+

Show all frames before the first keyframe. +

+
export_mvs
+

Export motion vectors into frame side-data (see AV_FRAME_DATA_MOTION_VECTORS) +for codecs that support it. See also doc/examples/export_mvs.c. +

+
skip_manual
+

Do not skip samples and export skip information as frame side data. +

+
ass_ro_flush_noop
+

Do not reset ASS ReadOrder field on flush. +

+
icc_profiles
+

Generate/parse embedded ICC profiles from/to colorimetry tags. +

+
+ +
+
export_side_data flags (decoding/encoding,audio,video,subtitles)
+
+

Possible values: +

+
mvs
+

Export motion vectors into frame side-data (see AV_FRAME_DATA_MOTION_VECTORS) +for codecs that support it. See also doc/examples/export_mvs.c. +

+
prft
+

Export encoder Producer Reference Time into packet side-data (see AV_PKT_DATA_PRFT) +for codecs that support it. +

+
venc_params
+

Export video encoding parameters through frame side data (see AV_FRAME_DATA_VIDEO_ENC_PARAMS) +for codecs that support it. At present, those are H.264 and VP9. +

+
film_grain
+

Export film grain parameters through frame side data (see AV_FRAME_DATA_FILM_GRAIN_PARAMS). +Supported at present by AV1 decoders. +

+
+ +
+
threads integer (decoding/encoding,video)
+

Set the number of threads to be used, in case the selected codec +implementation supports multi-threading. +

+

Possible values: +

+
auto, 0
+

automatically select the number of threads to set +

+
+ +

Default value is ‘auto’. +

+
+
dc integer (encoding,video)
+

Set intra_dc_precision. +

+
+
nssew integer (encoding,video)
+

Set nsse weight. +

+
+
skip_top integer (decoding,video)
+

Set number of macroblock rows at the top which are skipped. +

+
+
skip_bottom integer (decoding,video)
+

Set number of macroblock rows at the bottom which are skipped. +

+
+
profile integer (encoding,audio,video)
+
+

Set encoder codec profile. Default value is ‘unknown’. Encoder specific +profiles are documented in the relevant encoder documentation. +

+
+
level integer (encoding,audio,video)
+
+

Possible values: +

+
unknown
+
+ +
+
lowres integer (decoding,audio,video)
+

Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions. +

+
+
mblmin integer (encoding,video)
+

Set min macroblock lagrange factor (VBR). +

+
+
mblmax integer (encoding,video)
+

Set max macroblock lagrange factor (VBR). +

+
+
skip_loop_filter integer (decoding,video)
+
skip_idct integer (decoding,video)
+
skip_frame integer (decoding,video)
+
+

Make decoder discard processing depending on the frame type selected +by the option value. +

+

skip_loop_filter skips frame loop filtering, skip_idct +skips frame IDCT/dequantization, skip_frame skips decoding. +

+

Possible values: +

+
none
+

Discard no frame. +

+
+
default
+

Discard useless frames like 0-sized frames. +

+
+
noref
+

Discard all non-reference frames. +

+
+
bidir
+

Discard all bidirectional frames. +

+
+
nokey
+

Discard all frames excepts keyframes. +

+
+
nointra
+

Discard all frames except I frames. +

+
+
all
+

Discard all frames. +

+
+ +

Default value is ‘default’. +

+
+
bidir_refine integer (encoding,video)
+

Refine the two motion vectors used in bidirectional macroblocks. +

+
+
keyint_min integer (encoding,video)
+

Set minimum interval between IDR-frames. +

+
+
refs integer (encoding,video)
+

Set reference frames to consider for motion compensation. +

+
+
trellis integer (encoding,audio,video)
+

Set rate-distortion optimal quantization. +

+
+
mv0_threshold integer (encoding,video)
+
compression_level integer (encoding,audio,video)
+
bits_per_raw_sample integer
+
channel_layout integer (decoding/encoding,audio)
+
+

Possible values: +

+
request_channel_layout integer (decoding,audio)
+
+

Possible values: +

+
rc_max_vbv_use float (encoding,video)
+
rc_min_vbv_use float (encoding,video)
+
color_primaries integer (decoding/encoding,video)
+

Possible values: +

+
bt709
+

BT.709 +

+
bt470m
+

BT.470 M +

+
bt470bg
+

BT.470 BG +

+
smpte170m
+

SMPTE 170 M +

+
smpte240m
+

SMPTE 240 M +

+
film
+

Film +

+
bt2020
+

BT.2020 +

+
smpte428
+
smpte428_1
+

SMPTE ST 428-1 +

+
smpte431
+

SMPTE 431-2 +

+
smpte432
+

SMPTE 432-1 +

+
jedec-p22
+

JEDEC P22 +

+
+ +
+
color_trc integer (decoding/encoding,video)
+

Possible values: +

+
bt709
+

BT.709 +

+
gamma22
+

BT.470 M +

+
gamma28
+

BT.470 BG +

+
smpte170m
+

SMPTE 170 M +

+
smpte240m
+

SMPTE 240 M +

+
linear
+

Linear +

+
log
+
log100
+

Log +

+
log_sqrt
+
log316
+

Log square root +

+
iec61966_2_4
+
iec61966-2-4
+

IEC 61966-2-4 +

+
bt1361
+
bt1361e
+

BT.1361 +

+
iec61966_2_1
+
iec61966-2-1
+

IEC 61966-2-1 +

+
bt2020_10
+
bt2020_10bit
+

BT.2020 - 10 bit +

+
bt2020_12
+
bt2020_12bit
+

BT.2020 - 12 bit +

+
smpte2084
+

SMPTE ST 2084 +

+
smpte428
+
smpte428_1
+

SMPTE ST 428-1 +

+
arib-std-b67
+

ARIB STD-B67 +

+
+ +
+
colorspace integer (decoding/encoding,video)
+

Possible values: +

+
rgb
+

RGB +

+
bt709
+

BT.709 +

+
fcc
+

FCC +

+
bt470bg
+

BT.470 BG +

+
smpte170m
+

SMPTE 170 M +

+
smpte240m
+

SMPTE 240 M +

+
ycocg
+

YCOCG +

+
bt2020nc
+
bt2020_ncl
+

BT.2020 NCL +

+
bt2020c
+
bt2020_cl
+

BT.2020 CL +

+
smpte2085
+

SMPTE 2085 +

+
chroma-derived-nc
+

Chroma-derived NCL +

+
chroma-derived-c
+

Chroma-derived CL +

+
ictcp
+

ICtCp +

+
+ +
+
color_range integer (decoding/encoding,video)
+

If used as input parameter, it serves as a hint to the decoder, which +color_range the input has. +Possible values: +

+
tv
+
mpeg
+

MPEG (219*2^(n-8)) +

+
pc
+
jpeg
+

JPEG (2^n-1) +

+
+ +
+
chroma_sample_location integer (decoding/encoding,video)
+

Possible values: +

+
left
+
center
+
topleft
+
top
+
bottomleft
+
bottom
+
+ +
+
log_level_offset integer
+

Set the log level offset. +

+
+
slices integer (encoding,video)
+

Number of slices, used in parallelized encoding. +

+
+
thread_type flags (decoding/encoding,video)
+

Select which multithreading methods to use. +

+

Use of ‘frame’ will increase decoding delay by one frame per +thread, so clients which cannot provide future frames should not use +it. +

+

Possible values: +

+
slice
+

Decode more than one part of a single frame at once. +

+

Multithreading using slices works only when the video was encoded with +slices. +

+
+
frame
+

Decode more than one frame at once. +

+
+ +

Default value is ‘slice+frame’. +

+
+
audio_service_type integer (encoding,audio)
+

Set audio service type. +

+

Possible values: +

+
ma
+

Main Audio Service +

+
ef
+

Effects +

+
vi
+

Visually Impaired +

+
hi
+

Hearing Impaired +

+
di
+

Dialogue +

+
co
+

Commentary +

+
em
+

Emergency +

+
vo
+

Voice Over +

+
ka
+

Karaoke +

+
+ +
+
request_sample_fmt sample_fmt (decoding,audio)
+

Set sample format audio decoders should prefer. Default value is +none. +

+
+
pkt_timebase rational number
+
sub_charenc encoding (decoding,subtitles)
+

Set the input subtitles character encoding. +

+
+
field_order field_order (video)
+

Set/override the field order of the video. +Possible values: +

+
progressive
+

Progressive video +

+
tt
+

Interlaced video, top field coded and displayed first +

+
bb
+

Interlaced video, bottom field coded and displayed first +

+
tb
+

Interlaced video, top coded first, bottom displayed first +

+
bt
+

Interlaced video, bottom coded first, top displayed first +

+
+ +
+
skip_alpha bool (decoding,video)
+

Set to 1 to disable processing alpha (transparency). This works like the +‘gray’ flag in the flags option which skips chroma information +instead of alpha. Default is 0. +

+
+
codec_whitelist list (input)
+

"," separated list of allowed decoders. By default all are allowed. +

+
+
dump_separator string (input)
+

Separator used to separate the fields printed on the command line about the +Stream parameters. +For example, to separate the fields with newlines and indentation: +

+
ffprobe -dump_separator "
+                          "  -i ~/videos/matrixbench_mpeg2.mpg
+
+ +
+
max_pixels integer (decoding/encoding,video)
+

Maximum number of pixels per image. This value can be used to avoid out of +memory failures due to large images. +

+
+
apply_cropping bool (decoding,video)
+

Enable cropping if cropping parameters are multiples of the required +alignment for the left and top parameters. If the alignment is not met the +cropping will be partially applied to maintain alignment. +Default is 1 (enabled). +Note: The required alignment depends on if AV_CODEC_FLAG_UNALIGNED is set and the +CPU. AV_CODEC_FLAG_UNALIGNED cannot be changed from the command line. Also hardware +decoders will not apply left/top Cropping. +

+ +
+
+ + +
+
+

3 Decoders

+ +

Decoders are configured elements in FFmpeg which allow the decoding of +multimedia streams. +

+

When you configure your FFmpeg build, all the supported native decoders +are enabled by default. Decoders requiring an external library must be enabled +manually via the corresponding --enable-lib option. You can list all +available decoders using the configure option --list-decoders. +

+

You can disable all the decoders with the configure option +--disable-decoders and selectively enable / disable single decoders +with the options --enable-decoder=DECODER / +--disable-decoder=DECODER. +

+

The option -decoders of the ff* tools will display the list of +enabled decoders. +

+ +
+
+

4 Video Decoders

+ +

A description of some of the currently available video decoders +follows. +

+ +
+

4.1 av1

+ +

AOMedia Video 1 (AV1) decoder. +

+ +
+

4.1.1 Options

+ +
+
operating_point
+

Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0. +

+
+
+ +
+
+
+

4.2 rawvideo

+ +

Raw video decoder. +

+

This decoder decodes rawvideo streams. +

+ +
+

4.2.1 Options

+ +
+
top top_field_first
+

Specify the assumed field type of the input video. +

+
-1
+

the video is assumed to be progressive (default) +

+
0
+

bottom-field-first is assumed +

+
1
+

top-field-first is assumed +

+
+ +
+
+ +
+
+
+

4.3 libdav1d

+ +

dav1d AV1 decoder. +

+

libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec. +Requires the presence of the libdav1d headers and library during configuration. +You need to explicitly configure the build with --enable-libdav1d. +

+ +
+

4.3.1 Options

+ +

The following options are supported by the libdav1d wrapper. +

+
+
framethreads
+

Set amount of frame threads to use during decoding. The default value is 0 (autodetect). +This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the +option max_frame_delay and the global option threads instead. +

+
+
tilethreads
+

Set amount of tile threads to use during decoding. The default value is 0 (autodetect). +This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the +global option threads instead. +

+
+
max_frame_delay
+

Set max amount of frames the decoder may buffer internally. The default value is 0 +(autodetect). +

+
+
filmgrain
+

Apply film grain to the decoded video if present in the bitstream. Defaults to the +internal default of the library. +This option is deprecated and will be removed in the future. See the global option +export_side_data to export Film Grain parameters instead of applying it. +

+
+
oppoint
+

Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the +internal default of the library. +

+
+
alllayers
+

Output all spatial layers of a scalable AV1 bitstream. The default value is false. +

+
+
+ +
+
+
+

4.4 libdavs2

+ +

AVS2-P2/IEEE1857.4 video decoder wrapper. +

+

This decoder allows libavcodec to decode AVS2 streams with davs2 library. +

+ +
+
+

4.5 libuavs3d

+ +

AVS3-P2/IEEE1857.10 video decoder. +

+

libuavs3d allows libavcodec to decode AVS3 streams. +Requires the presence of the libuavs3d headers and library during configuration. +You need to explicitly configure the build with --enable-libuavs3d. +

+ +
+

4.5.1 Options

+ +

The following option is supported by the libuavs3d wrapper. +

+
+
frame_threads
+

Set amount of frame threads to use during decoding. The default value is 0 (autodetect). +

+
+
+ +
+
+
+

4.6 QSV Decoders

+ +

The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC, +JPEG/MJPEG, VP8, VP9, AV1). +

+ +
+

4.6.1 Common Options

+ +

The following options are supported by all qsv decoders. +

+
+
async_depth
+

Internal parallelization depth, the higher the value the higher the latency. +

+
+
gpu_copy
+

A GPU-accelerated copy between video and system memory +

+
default
+
on
+
off
+
+ +
+
+ +
+
+

4.6.2 HEVC Options

+

Extra options for hevc_qsv. +

+
+
load_plugin
+

A user plugin to load in an internal session +

+
none
+
hevc_sw
+
hevc_hw
+
+ +
+
load_plugins
+

A :-separate list of hexadecimal plugin UIDs to load in an internal session +

+
+
+ +
+
+
+

4.7 v210

+ +

Uncompressed 4:2:2 10-bit decoder. +

+ +
+

4.7.1 Options

+ +
+
custom_stride
+

Set the line size of the v210 data in bytes. The default value is 0 +(autodetect). You can use the special -1 value for a strideless v210 as seen in +BOXX files. +

+
+
+ + +
+
+
+
+

5 Audio Decoders

+ +

A description of some of the currently available audio decoders +follows. +

+ +
+

5.1 ac3

+ +

AC-3 audio decoder. +

+

This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as +the undocumented RealAudio 3 (a.k.a. dnet). +

+ +
+

5.1.1 AC-3 Decoder Options

+ +
+
-drc_scale value
+

Dynamic Range Scale Factor. The factor to apply to dynamic range values +from the AC-3 stream. This factor is applied exponentially. The default value is 1. +There are 3 notable scale factor ranges: +

+
drc_scale == 0
+

DRC disabled. Produces full range audio. +

+
0 < drc_scale <= 1
+

DRC enabled. Applies a fraction of the stream DRC value. +Audio reproduction is between full range and full compression. +

+
drc_scale > 1
+

DRC enabled. Applies drc_scale asymmetrically. +Loud sounds are fully compressed. Soft sounds are enhanced. +

+
+ +
+
+ +
+
+
+

5.2 flac

+ +

FLAC audio decoder. +

+

This decoder aims to implement the complete FLAC specification from Xiph. +

+ +
+

5.2.1 FLAC Decoder options

+ +
+
-use_buggy_lpc
+

The lavc FLAC encoder used to produce buggy streams with high lpc values +(like the default value). This option makes it possible to decode such streams +correctly by using lavc’s old buggy lpc logic for decoding. +

+
+
+ +
+
+
+

5.3 ffwavesynth

+ +

Internal wave synthesizer. +

+

This decoder generates wave patterns according to predefined sequences. Its +use is purely internal and the format of the data it accepts is not publicly +documented. +

+
+
+

5.4 libcelt

+ +

libcelt decoder wrapper. +

+

libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec. +Requires the presence of the libcelt headers and library during configuration. +You need to explicitly configure the build with --enable-libcelt. +

+
+
+

5.5 libgsm

+ +

libgsm decoder wrapper. +

+

libgsm allows libavcodec to decode the GSM full rate audio codec. Requires +the presence of the libgsm headers and library during configuration. You need +to explicitly configure the build with --enable-libgsm. +

+

This decoder supports both the ordinary GSM and the Microsoft variant. +

+
+
+

5.6 libilbc

+ +

libilbc decoder wrapper. +

+

libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC) +audio codec. Requires the presence of the libilbc headers and library during +configuration. You need to explicitly configure the build with +--enable-libilbc. +

+ +
+

5.6.1 Options

+ +

The following option is supported by the libilbc wrapper. +

+
+
enhance
+
+

Enable the enhancement of the decoded audio when set to 1. The default +value is 0 (disabled). +

+
+
+ +
+
+
+

5.7 libopencore-amrnb

+ +

libopencore-amrnb decoder wrapper. +

+

libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate +Narrowband audio codec. Using it requires the presence of the +libopencore-amrnb headers and library during configuration. You need to +explicitly configure the build with --enable-libopencore-amrnb. +

+

An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB +without this library. +

+
+
+

5.8 libopencore-amrwb

+ +

libopencore-amrwb decoder wrapper. +

+

libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate +Wideband audio codec. Using it requires the presence of the +libopencore-amrwb headers and library during configuration. You need to +explicitly configure the build with --enable-libopencore-amrwb. +

+

An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB +without this library. +

+
+
+

5.9 libopus

+ +

libopus decoder wrapper. +

+

libopus allows libavcodec to decode the Opus Interactive Audio Codec. +Requires the presence of the libopus headers and library during +configuration. You need to explicitly configure the build with +--enable-libopus. +

+

An FFmpeg native decoder for Opus exists, so users can decode Opus +without this library. +

+ +
+
+
+

6 Subtitles Decoders

+ + +
+

6.1 libaribb24

+ +

ARIB STD-B24 caption decoder. +

+

Implements profiles A and C of the ARIB STD-B24 standard. +

+ +
+

6.1.1 libaribb24 Decoder Options

+ +
+
-aribb24-base-path path
+

Sets the base path for the libaribb24 library. This is utilized for reading of +configuration files (for custom unicode conversions), and for dumping of +non-text symbols as images under that location. +

+

Unset by default. +

+
+
-aribb24-skip-ruby-text boolean
+

Tells the decoder wrapper to skip text blocks that contain half-height ruby +text. +

+

Enabled by default. +

+
+
+ +
+
+
+

6.2 libaribcaption

+ +

Yet another ARIB STD-B24 caption decoder using external libaribcaption +library. +

+

Implements profiles A and C of the Japanse ARIB STD-B24 standard, +Brazilian ABNT NBR 15606-1, and Philippines version of ISDB-T. +

+

Requires the presence of the libaribcaption headers and library +(https://github.com/xqq/libaribcaption) during configuration. +You need to explicitly configure the build with --enable-libaribcaption. +If both libaribb24 and libaribcaption are enabled, libaribcaption +decoder precedes. +

+ +
+

6.2.1 libaribcaption Decoder Options

+ +
+
-sub_type subtitle_type
+

Specifies the format of the decoded subtitles. +

+
+
bitmap
+

Graphical image. +

+
ass
+

ASS formatted text. +

+
text
+

Simple text based output without formatting. +

+
+ +

The default is ass as same as libaribb24 decoder. +Some present players (e.g., mpv) expect ASS format for ARIB caption. +

+
+
-caption_encoding encoding_scheme
+

Specifies the encoding scheme of input subtitle text. +

+
+
auto
+

Automatically detect text encoding. +

+
jis
+

8bit-char JIS encoding defined in ARIB STD B24. +This encoding used in Japan for ISDB captions. +

+
utf8
+

UTF-8 encoding defined in ARIB STD B24. +This encoding is used in Philippines for ISDB-T captions. +

+
latin
+

Latin character encoding defined in ABNT NBR 15606-1. +This encoding is used in South America for SBTVD / ISDB-Tb captions. +

+
+ +

The default is ass as same as libaribb24 decoder. +Some present players (e.g., mpv) expect ASS format for ARIB caption. +

+
+
-font font_name[,font_name2,...]
+

Specify comma-separated list of font family names to be used for bitmap +or ass type subtitle rendering. +Only first font name is used for ass type subtitle. +

+

If not specified, use internaly defined default font family. +

+
+
-ass_single_rect boolean
+

ARIB STD-B24 specifies that some captions may be displayed at different +positions at a time (multi-rectangle subtitle). +Since some players (e.g., old mpv) can’t handle multiple ASS rectangles +in a single AVSubtitle, or multiple ASS rectangles of indeterminate duration +with the same start timestamp, this option can change the behavior so that +all the texts are displayed in a single ASS rectangle. +

+

The default is false. +

+

If your player cannot handle AVSubtitles with multiple ASS rectangles properly, +set this option to true or define ASS_SINGLE_RECT=1 to change +default behavior at compilation. +

+
+
-replace_fullwidth_ascii boolean
+

Specify whether to replace MSZ (Middle Size, half width) fullwidth +alphanumerics with halfwidth alphanumerics. +

+

The default is true. +

+
+
-force_outline_text boolean
+

Specify whether always render outline text for all characters regardless of +the indication by charactor style. +

+

The default is false. +

+
+
-outline_width number (0.0 - 3.0)
+

Specify width for outline text, in dots (relative). +

+

The default is 1.5. +

+
+
-ignore_background boolean
+

Specify whether to ignore background color rendering. +

+

The default is false. +

+
+
-ignore_ruby boolean
+

Specify whether to ignore rendering for ruby-like (furigana) characters. +

+

The default is false. +

+
+
-replace_drcs boolean
+

Specify whether to render replaced DRCS characters as Unicode characters. +

+

The default is true. +

+
+
-canvas_size image_size
+

Specify the resolution of the canvas to render subtitles to; usually, this +should be frame size of input video. +This only applies when -subtitle_type is set to bitmap. +

+

The libaribcaption decoder assumes input frame size for bitmap rendering as below: +

    +
  1. PROFILE_A : 1440 x 1080 with SAR (PAR) 4:3 +
  2. PROFILE_C : 320 x 180 with SAR (PAR) 1:1 +
+ +

If actual frame size of input video does not match above assumption, +the rendered captions may be distorted. +To make the captions undistorted, add -canvas_size option to specify +actual input video size. +

+

Note that the -canvas_size option is not required for video with +different size but same aspect ratio. +In such cases, the caption will be stretched or shrunk to actual video size +if -canvas_size option is not specified. +If -canvas_size option is specified with different size, +the caption will be stretched or shrunk as specified size with calculated SAR. +

+
+
+ +
+
+

6.2.2 libaribcaption decoder usage examples

+ +

Display MPEG-TS file with ARIB subtitle by ffplay tool: +

+
ffplay -sub_type bitmap MPEG.TS
+
+ +

Display MPEG-TS file with input frame size 1920x1080 by ffplay tool: +

+
ffplay -sub_type bitmap -canvas_size 1920x1080 MPEG.TS
+
+ +

Embed ARIB subtitle in transcoded video: +

+
ffmpeg -sub_type bitmap -i src.m2t -filter_complex "[0:v][0:s]overlay" -vcodec h264 dest.mp4
+
+ +
+
+
+

6.3 dvbsub

+ + +
+

6.3.1 Options

+ +
+
compute_clut
+
+
-2
+

Compute clut once if no matching CLUT is in the stream. +

+
-1
+

Compute clut if no matching CLUT is in the stream. +

+
0
+

Never compute CLUT +

+
1
+

Always compute CLUT and override the one provided in the stream. +

+
+
+
dvb_substream
+

Selects the dvb substream, or all substreams if -1 which is default. +

+
+
+ +
+
+
+

6.4 dvdsub

+ +

This codec decodes the bitmap subtitles used in DVDs; the same subtitles can +also be found in VobSub file pairs and in some Matroska files. +

+ +
+

6.4.1 Options

+ +
+
palette
+

Specify the global palette used by the bitmaps. When stored in VobSub, the +palette is normally specified in the index file; in Matroska, the palette is +stored in the codec extra-data in the same format as in VobSub. In DVDs, the +palette is stored in the IFO file, and therefore not available when reading +from dumped VOB files. +

+

The format for this option is a string containing 16 24-bits hexadecimal +numbers (without 0x prefix) separated by commas, for example 0d00ee, +ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1, +7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b. +

+
+
ifo_palette
+

Specify the IFO file from which the global palette is obtained. +(experimental) +

+
+
forced_subs_only
+

Only decode subtitle entries marked as forced. Some titles have forced +and non-forced subtitles in the same track. Setting this flag to 1 +will only keep the forced subtitles. Default value is 0. +

+
+ +
+
+
+

6.5 libzvbi-teletext

+ +

Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext +subtitles. Requires the presence of the libzvbi headers and library during +configuration. You need to explicitly configure the build with +--enable-libzvbi. +

+ +
+

6.5.1 Options

+ +
+
txt_page
+

List of teletext page numbers to decode. Pages that do not match the specified +list are dropped. You may use the special * string to match all pages, +or subtitle to match all subtitle pages. +Default value is *. +

+
txt_default_region
+

Set default character set used for decoding, a value between 0 and 87 (see +ETS 300 706, Section 15, Table 32). Default value is -1, which does not +override the libzvbi default. This option is needed for some legacy level 1.0 +transmissions which cannot signal the proper charset. +

+
txt_chop_top
+

Discards the top teletext line. Default value is 1. +

+
txt_format
+

Specifies the format of the decoded subtitles. +

+
bitmap
+

The default format, you should use this for teletext pages, because certain +graphics and colors cannot be expressed in simple text or even ASS. +

+
text
+

Simple text based output without formatting. +

+
ass
+

Formatted ASS output, subtitle pages and teletext pages are returned in +different styles, subtitle pages are stripped down to text, but an effort is +made to keep the text alignment and the formatting. +

+
+
+
txt_left
+

X offset of generated bitmaps, default is 0. +

+
txt_top
+

Y offset of generated bitmaps, default is 0. +

+
txt_chop_spaces
+

Chops leading and trailing spaces and removes empty lines from the generated +text. This option is useful for teletext based subtitles where empty spaces may +be present at the start or at the end of the lines or empty lines may be +present between the subtitle lines because of double-sized teletext characters. +Default value is 1. +

+
txt_duration
+

Sets the display duration of the decoded teletext pages or subtitles in +milliseconds. Default value is -1 which means infinity or until the next +subtitle event comes. +

+
txt_transparent
+

Force transparent background of the generated teletext bitmaps. Default value +is 0 which means an opaque background. +

+
txt_opacity
+

Sets the opacity (0-255) of the teletext background. If +txt_transparent is not set, it only affects characters between a start +box and an end box, typically subtitles. Default value is 0 if +txt_transparent is set, 255 otherwise. +

+
+
+ +
+
+
+
+

7 Encoders

+ +

Encoders are configured elements in FFmpeg which allow the encoding of +multimedia streams. +

+

When you configure your FFmpeg build, all the supported native encoders +are enabled by default. Encoders requiring an external library must be enabled +manually via the corresponding --enable-lib option. You can list all +available encoders using the configure option --list-encoders. +

+

You can disable all the encoders with the configure option +--disable-encoders and selectively enable / disable single encoders +with the options --enable-encoder=ENCODER / +--disable-encoder=ENCODER. +

+

The option -encoders of the ff* tools will display the list of +enabled encoders. +

+ +
+
+

8 Audio Encoders

+ +

A description of some of the currently available audio encoders +follows. +

+ +
+

8.1 aac

+ +

Advanced Audio Coding (AAC) encoder. +

+

This encoder is the default AAC encoder, natively implemented into FFmpeg. +

+ +
+

8.1.1 Options

+ +
+
b
+

Set bit rate in bits/s. Setting this automatically activates constant bit rate +(CBR) mode. If this option is unspecified it is set to 128kbps. +

+
+
q
+

Set quality for variable bit rate (VBR) mode. This option is valid only using +the ffmpeg command-line tool. For library interface users, use +global_quality. +

+
+
cutoff
+

Set cutoff frequency. If unspecified will allow the encoder to dynamically +adjust the cutoff to improve clarity on low bitrates. +

+
+
aac_coder
+

Set AAC encoder coding method. Possible values: +

+
+
twoloop
+

Two loop searching (TLS) method. This is the default method. +

+

This method first sets quantizers depending on band thresholds and then tries +to find an optimal combination by adding or subtracting a specific value from +all quantizers and adjusting some individual quantizer a little. Will tune +itself based on whether aac_is, aac_ms and aac_pns +are enabled. +

+
+
anmr
+

Average noise to mask ratio (ANMR) trellis-based solution. +

+

This is an experimental coder which currently produces a lower quality, is more +unstable and is slower than the default twoloop coder but has potential. +Currently has no support for the aac_is or aac_pns options. +Not currently recommended. +

+
+
fast
+

Constant quantizer method. +

+

Uses a cheaper version of twoloop algorithm that doesn’t try to do as many +clever adjustments. Worse with low bitrates (less than 64kbps), but is better +and much faster at higher bitrates. +

+
+
+ +
+
aac_ms
+

Sets mid/side coding mode. The default value of "auto" will automatically use +M/S with bands which will benefit from such coding. Can be forced for all bands +using the value "enable", which is mainly useful for debugging or disabled using +"disable". +

+
+
aac_is
+

Sets intensity stereo coding tool usage. By default, it’s enabled and will +automatically toggle IS for similar pairs of stereo bands if it’s beneficial. +Can be disabled for debugging by setting the value to "disable". +

+
+
aac_pns
+

Uses perceptual noise substitution to replace low entropy high frequency bands +with imperceptible white noise during the decoding process. By default, it’s +enabled, but can be disabled for debugging purposes by using "disable". +

+
+
aac_tns
+

Enables the use of a multitap FIR filter which spans through the high frequency +bands to hide quantization noise during the encoding process and is reverted +by the decoder. As well as decreasing unpleasant artifacts in the high range +this also reduces the entropy in the high bands and allows for more bits to +be used by the mid-low bands. By default it’s enabled but can be disabled for +debugging by setting the option to "disable". +

+
+
aac_ltp
+

Enables the use of the long term prediction extension which increases coding +efficiency in very low bandwidth situations such as encoding of voice or +solo piano music by extending constant harmonic peaks in bands throughout +frames. This option is implied by profile:a aac_low and is incompatible with +aac_pred. Use in conjunction with -ar to decrease the samplerate. +

+
+
aac_pred
+

Enables the use of a more traditional style of prediction where the spectral +coefficients transmitted are replaced by the difference of the current +coefficients minus the previous "predicted" coefficients. In theory and sometimes +in practice this can improve quality for low to mid bitrate audio. +This option implies the aac_main profile and is incompatible with aac_ltp. +

+
+
profile
+

Sets the encoding profile, possible values: +

+
+
aac_low
+

The default, AAC "Low-complexity" profile. Is the most compatible and produces +decent quality. +

+
+
mpeg2_aac_low
+

Equivalent to -profile:a aac_low -aac_pns 0. PNS was introduced with the +MPEG4 specifications. +

+
+
aac_ltp
+

Long term prediction profile, is enabled by and will enable the aac_ltp +option. Introduced in MPEG4. +

+
+
aac_main
+

Main-type prediction profile, is enabled by and will enable the aac_pred +option. Introduced in MPEG2. +

+
+
+

If this option is unspecified it is set to ‘aac_low’. +

+
+ +
+
+
+

8.2 ac3 and ac3_fixed

+ +

AC-3 audio encoders. +

+

These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as +the undocumented RealAudio 3 (a.k.a. dnet). +

+

The ac3 encoder uses floating-point math, while the ac3_fixed +encoder only uses fixed-point integer math. This does not mean that one is +always faster, just that one or the other may be better suited to a +particular system. The ac3_fixed encoder is not the default codec for +any of the output formats, so it must be specified explicitly using the option +-acodec ac3_fixed in order to use it. +

+ +
+

8.2.1 AC-3 Metadata

+ +

The AC-3 metadata options are used to set parameters that describe the audio, +but in most cases do not affect the audio encoding itself. Some of the options +do directly affect or influence the decoding and playback of the resulting +bitstream, while others are just for informational purposes. A few of the +options will add bits to the output stream that could otherwise be used for +audio data, and will thus affect the quality of the output. Those will be +indicated accordingly with a note in the option list below. +

+

These parameters are described in detail in several publicly-available +documents. +

+ + +
+

8.2.1.1 Metadata Control Options

+ +
+
-per_frame_metadata boolean
+

Allow Per-Frame Metadata. Specifies if the encoder should check for changing +metadata for each frame. +

+
0
+

The metadata values set at initialization will be used for every frame in the +stream. (default) +

+
1
+

Metadata values can be changed before encoding each frame. +

+
+ +
+
+ +
+
+

8.2.1.2 Downmix Levels

+ +
+
-center_mixlev level
+

Center Mix Level. The amount of gain the decoder should apply to the center +channel when downmixing to stereo. This field will only be written to the +bitstream if a center channel is present. The value is specified as a scale +factor. There are 3 valid values: +

+
0.707
+

Apply -3dB gain +

+
0.595
+

Apply -4.5dB gain (default) +

+
0.500
+

Apply -6dB gain +

+
+ +
+
-surround_mixlev level
+

Surround Mix Level. The amount of gain the decoder should apply to the surround +channel(s) when downmixing to stereo. This field will only be written to the +bitstream if one or more surround channels are present. The value is specified +as a scale factor. There are 3 valid values: +

+
0.707
+

Apply -3dB gain +

+
0.500
+

Apply -6dB gain (default) +

+
0.000
+

Silence Surround Channel(s) +

+
+ +
+
+ +
+
+

8.2.1.3 Audio Production Information

+

Audio Production Information is optional information describing the mixing +environment. Either none or both of the fields are written to the bitstream. +

+
+
-mixing_level number
+

Mixing Level. Specifies peak sound pressure level (SPL) in the production +environment when the mix was mastered. Valid values are 80 to 111, or -1 for +unknown or not indicated. The default value is -1, but that value cannot be +used if the Audio Production Information is written to the bitstream. Therefore, +if the room_type option is not the default value, the mixing_level +option must not be -1. +

+
+
-room_type type
+

Room Type. Describes the equalization used during the final mixing session at +the studio or on the dubbing stage. A large room is a dubbing stage with the +industry standard X-curve equalization; a small room has flat equalization. +This field will not be written to the bitstream if both the mixing_level +option and the room_type option have the default values. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
large
+

Large Room +

+
2
+
small
+

Small Room +

+
+ +
+
+ +
+
+

8.2.1.4 Other Metadata Options

+ +
+
-copyright boolean
+

Copyright Indicator. Specifies whether a copyright exists for this audio. +

+
0
+
off
+

No Copyright Exists (default) +

+
1
+
on
+

Copyright Exists +

+
+ +
+
-dialnorm value
+

Dialogue Normalization. Indicates how far the average dialogue level of the +program is below digital 100% full scale (0 dBFS). This parameter determines a +level shift during audio reproduction that sets the average volume of the +dialogue to a preset level. The goal is to match volume level between program +sources. A value of -31dB will result in no volume level change, relative to +the source volume, during audio reproduction. Valid values are whole numbers in +the range -31 to -1, with -31 being the default. +

+
+
-dsur_mode mode
+

Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround +(Pro Logic). This field will only be written to the bitstream if the audio +stream is stereo. Using this option does NOT mean the encoder will actually +apply Dolby Surround processing. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
off
+

Not Dolby Surround Encoded +

+
2
+
on
+

Dolby Surround Encoded +

+
+ +
+
-original boolean
+

Original Bit Stream Indicator. Specifies whether this audio is from the +original source and not a copy. +

+
0
+
off
+

Not Original Source +

+
1
+
on
+

Original Source (default) +

+
+ +
+
+ +
+
+
+

8.2.2 Extended Bitstream Information

+

The extended bitstream options are part of the Alternate Bit Stream Syntax as +specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts. +If any one parameter in a group is specified, all values in that group will be +written to the bitstream. Default values are used for those that are written +but have not been specified. If the mixing levels are written, the decoder +will use these values instead of the ones specified in the center_mixlev +and surround_mixlev options if it supports the Alternate Bit Stream +Syntax. +

+ +
+

8.2.2.1 Extended Bitstream Information - Part 1

+ +
+
-dmix_mode mode
+

Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt +(Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
ltrt
+

Lt/Rt Downmix Preferred +

+
2
+
loro
+

Lo/Ro Downmix Preferred +

+
+ +
+
-ltrt_cmixlev level
+

Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the +center channel when downmixing to stereo in Lt/Rt mode. +

+
1.414
+

Apply +3dB gain +

+
1.189
+

Apply +1.5dB gain +

+
1.000
+

Apply 0dB gain +

+
0.841
+

Apply -1.5dB gain +

+
0.707
+

Apply -3.0dB gain +

+
0.595
+

Apply -4.5dB gain (default) +

+
0.500
+

Apply -6.0dB gain +

+
0.000
+

Silence Center Channel +

+
+ +
+
-ltrt_surmixlev level
+

Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the +surround channel(s) when downmixing to stereo in Lt/Rt mode. +

+
0.841
+

Apply -1.5dB gain +

+
0.707
+

Apply -3.0dB gain +

+
0.595
+

Apply -4.5dB gain +

+
0.500
+

Apply -6.0dB gain (default) +

+
0.000
+

Silence Surround Channel(s) +

+
+ +
+
-loro_cmixlev level
+

Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the +center channel when downmixing to stereo in Lo/Ro mode. +

+
1.414
+

Apply +3dB gain +

+
1.189
+

Apply +1.5dB gain +

+
1.000
+

Apply 0dB gain +

+
0.841
+

Apply -1.5dB gain +

+
0.707
+

Apply -3.0dB gain +

+
0.595
+

Apply -4.5dB gain (default) +

+
0.500
+

Apply -6.0dB gain +

+
0.000
+

Silence Center Channel +

+
+ +
+
-loro_surmixlev level
+

Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the +surround channel(s) when downmixing to stereo in Lo/Ro mode. +

+
0.841
+

Apply -1.5dB gain +

+
0.707
+

Apply -3.0dB gain +

+
0.595
+

Apply -4.5dB gain +

+
0.500
+

Apply -6.0dB gain (default) +

+
0.000
+

Silence Surround Channel(s) +

+
+ +
+
+ +
+
+

8.2.2.2 Extended Bitstream Information - Part 2

+ +
+
-dsurex_mode mode
+

Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX +(7.1 matrixed to 5.1). Using this option does NOT mean the encoder will actually +apply Dolby Surround EX processing. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
on
+

Dolby Surround EX Off +

+
2
+
off
+

Dolby Surround EX On +

+
+ +
+
-dheadphone_mode mode
+

Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone +encoding (multi-channel matrixed to 2.0 for use with headphones). Using this +option does NOT mean the encoder will actually apply Dolby Headphone +processing. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
on
+

Dolby Headphone Off +

+
2
+
off
+

Dolby Headphone On +

+
+ +
+
-ad_conv_type type
+

A/D Converter Type. Indicates whether the audio has passed through HDCD A/D +conversion. +

+
0
+
standard
+

Standard A/D Converter (default) +

+
1
+
hdcd
+

HDCD A/D Converter +

+
+ +
+
+ +
+
+
+

8.2.3 Other AC-3 Encoding Options

+ +
+
-stereo_rematrixing boolean
+

Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This +is an optional AC-3 feature that increases quality by selectively encoding +the left/right channels as mid/side. This option is enabled by default, and it +is highly recommended that it be left as enabled except for testing purposes. +

+
+
cutoff frequency
+

Set lowpass cutoff frequency. If unspecified, the encoder selects a default +determined by various other encoding parameters. +

+
+
+ +
+
+

8.2.4 Floating-Point-Only AC-3 Encoding Options

+ +

These options are only valid for the floating-point encoder and do not exist +for the fixed-point encoder due to the corresponding features not being +implemented in fixed-point. +

+
+
-channel_coupling boolean
+

Enables/Disables use of channel coupling, which is an optional AC-3 feature +that increases quality by combining high frequency information from multiple +channels into a single channel. The per-channel high frequency information is +sent with less accuracy in both the frequency and time domains. This allows +more bits to be used for lower frequencies while preserving enough information +to reconstruct the high frequencies. This option is enabled by default for the +floating-point encoder and should generally be left as enabled except for +testing purposes or to increase encoding speed. +

+
-1
+
auto
+

Selected by Encoder (default) +

+
0
+
off
+

Disable Channel Coupling +

+
1
+
on
+

Enable Channel Coupling +

+
+ +
+
-cpl_start_band number
+

Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a +value higher than the bandwidth is used, it will be reduced to 1 less than the +coupling end band. If auto is used, the start band will be determined by +the encoder based on the bit rate, sample rate, and channel layout. This option +has no effect if channel coupling is disabled. +

+
-1
+
auto
+

Selected by Encoder (default) +

+
+ +
+
+ +
+
+
+

8.3 flac

+ +

FLAC (Free Lossless Audio Codec) Encoder +

+ +
+

8.3.1 Options

+ +

The following options are supported by FFmpeg’s flac encoder. +

+
+
compression_level
+

Sets the compression level, which chooses defaults for many other options +if they are not set explicitly. Valid values are from 0 to 12, 5 is the +default. +

+
+
frame_size
+

Sets the size of the frames in samples per channel. +

+
+
lpc_coeff_precision
+

Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the +default. +

+
+
lpc_type
+

Sets the first stage LPC algorithm +

+
none
+

LPC is not used +

+
+
fixed
+

fixed LPC coefficients +

+
+
levinson
+
cholesky
+
+ +
+
lpc_passes
+

Number of passes to use for Cholesky factorization during LPC analysis +

+
+
min_partition_order
+

The minimum partition order +

+
+
max_partition_order
+

The maximum partition order +

+
+
prediction_order_method
+
+
estimation
+
2level
+
4level
+
8level
+
search
+

Bruteforce search +

+
log
+
+ +
+
ch_mode
+

Channel mode +

+
auto
+

The mode is chosen automatically for each frame +

+
indep
+

Channels are independently coded +

+
left_side
+
right_side
+
mid_side
+
+ +
+
exact_rice_parameters
+

Chooses if rice parameters are calculated exactly or approximately. +if set to 1 then they are chosen exactly, which slows the code down slightly and +improves compression slightly. +

+
+
multi_dim_quant
+

Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is +applied after the first stage to finetune the coefficients. This is quite slow +and slightly improves compression. +

+
+
+ +
+
+
+

8.4 opus

+ +

Opus encoder. +

+

This is a native FFmpeg encoder for the Opus format. Currently its in development and +only implements the CELT part of the codec. Its quality is usually worse and at best +is equal to the libopus encoder. +

+ +
+

8.4.1 Options

+ +
+
b
+

Set bit rate in bits/s. If unspecified it uses the number of channels and the layout +to make a good guess. +

+
+
opus_delay
+

Sets the maximum delay in milliseconds. Lower delays than 20ms will very quickly +decrease quality. +

+
+ +
+
+
+

8.5 libfdk_aac

+ +

libfdk-aac AAC (Advanced Audio Coding) encoder wrapper. +

+

The libfdk-aac library is based on the Fraunhofer FDK AAC code from +the Android project. +

+

Requires the presence of the libfdk-aac headers and library during +configuration. You need to explicitly configure the build with +--enable-libfdk-aac. The library is also incompatible with GPL, +so if you allow the use of GPL, you should configure with +--enable-gpl --enable-nonfree --enable-libfdk-aac. +

+

This encoder has support for the AAC-HE profiles. +

+

VBR encoding, enabled through the vbr or flags ++qscale options, is experimental and only works with some +combinations of parameters. +

+

Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or +higher. +

+

For more information see the fdk-aac project at +http://sourceforge.net/p/opencore-amr/fdk-aac/. +

+ +
+

8.5.1 Options

+ +

The following options are mapped on the shared FFmpeg codec options. +

+
+
b
+

Set bit rate in bits/s. If the bitrate is not explicitly specified, it +is automatically set to a suitable value depending on the selected +profile. +

+

In case VBR mode is enabled the option is ignored. +

+
+
ar
+

Set audio sampling rate (in Hz). +

+
+
channels
+

Set the number of audio channels. +

+
+
flags +qscale
+

Enable fixed quality, VBR (Variable Bit Rate) mode. +Note that VBR is implicitly enabled when the vbr value is +positive. +

+
+
cutoff
+

Set cutoff frequency. If not specified (or explicitly set to 0) it +will use a value automatically computed by the library. Default value +is 0. +

+
+
profile
+

Set audio profile. +

+

The following profiles are recognized: +

+
aac_low
+

Low Complexity AAC (LC) +

+
+
aac_he
+

High Efficiency AAC (HE-AAC) +

+
+
aac_he_v2
+

High Efficiency AAC version 2 (HE-AACv2) +

+
+
aac_ld
+

Low Delay AAC (LD) +

+
+
aac_eld
+

Enhanced Low Delay AAC (ELD) +

+
+ +

If not specified it is set to ‘aac_low’. +

+
+ +

The following are private options of the libfdk_aac encoder. +

+
+
afterburner
+

Enable afterburner feature if set to 1, disabled if set to 0. This +improves the quality but also the required processing power. +

+

Default value is 1. +

+
+
eld_sbr
+

Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled +if set to 0. +

+

Default value is 0. +

+
+
eld_v2
+

Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1, +disabled if set to 0. +

+

Note that option is available when fdk-aac version (AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2) > (4.0.0). +

+

Default value is 0. +

+
+
signaling
+

Set SBR/PS signaling style. +

+

It can assume one of the following values: +

+
default
+

choose signaling implicitly (explicit hierarchical by default, +implicit if global header is disabled) +

+
+
implicit
+

implicit backwards compatible signaling +

+
+
explicit_sbr
+

explicit SBR, implicit PS signaling +

+
+
explicit_hierarchical
+

explicit hierarchical signaling +

+
+ +

Default value is ‘default’. +

+
+
latm
+

Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0. +

+

Default value is 0. +

+
+
header_period
+

Set StreamMuxConfig and PCE repetition period (in frames) for sending +in-band configuration buffers within LATM/LOAS transport layer. +

+

Must be a 16-bits non-negative integer. +

+

Default value is 0. +

+
+
vbr
+

Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty +good) and 5 is highest quality. A value of 0 will disable VBR, and CBR +(Constant Bit Rate) is enabled. +

+

Currently only the ‘aac_low’ profile supports VBR encoding. +

+

VBR modes 1-5 correspond to roughly the following average bit rates: +

+
+
1
+

32 kbps/channel +

+
2
+

40 kbps/channel +

+
3
+

48-56 kbps/channel +

+
4
+

64 kbps/channel +

+
5
+

about 80-96 kbps/channel +

+
+ +

Default value is 0. +

+
+
frame_length
+

Set the audio frame length in samples. Default value is the internal +default of the library. Refer to the library’s documentation for information +about supported values. +

+
+ +
+
+

8.5.2 Examples

+ +
    +
  • Use ffmpeg to convert an audio file to VBR AAC in an M4A (MP4) +container: +
    +
    ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
    +
    + +
  • Use ffmpeg to convert an audio file to CBR 64k kbps AAC, using the +High-Efficiency AAC profile: +
    +
    ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
    +
    +
+ +
+
+
+

8.6 libmp3lame

+ +

LAME (Lame Ain’t an MP3 Encoder) MP3 encoder wrapper. +

+

Requires the presence of the libmp3lame headers and library during +configuration. You need to explicitly configure the build with +--enable-libmp3lame. +

+

See libshine for a fixed-point MP3 encoder, although with a +lower quality. +

+ +
+

8.6.1 Options

+ +

The following options are supported by the libmp3lame wrapper. The +lame-equivalent of the options are listed in parentheses. +

+
+
b (-b)
+

Set bitrate expressed in bits/s for CBR or ABR. LAME bitrate is +expressed in kilobits/s. +

+
+
q (-V)
+

Set constant quality setting for VBR. This option is valid only +using the ffmpeg command-line tool. For library interface +users, use global_quality. +

+
+
compression_level (-q)
+

Set algorithm quality. Valid arguments are integers in the 0-9 range, +with 0 meaning highest quality but slowest, and 9 meaning fastest +while producing the worst quality. +

+
+
cutoff (--lowpass)
+

Set lowpass cutoff frequency. If unspecified, the encoder dynamically +adjusts the cutoff. +

+
+
reservoir
+

Enable use of bit reservoir when set to 1. Default value is 1. LAME +has this enabled by default, but can be overridden by use +--nores option. +

+
+
joint_stereo (-m j)
+

Enable the encoder to use (on a frame by frame basis) either L/R +stereo or mid/side stereo. Default value is 1. +

+
+
abr (--abr)
+

Enable the encoder to use ABR when set to 1. The lame +--abr sets the target bitrate, while this options only +tells FFmpeg to use ABR still relies on b to set bitrate. +

+
+
copyright (-c)
+

Set MPEG audio copyright flag when set to 1. The default value is 0 +(disabled). +

+
+
original (-o)
+

Set MPEG audio original flag when set to 1. The default value is 1 +(enabled). +

+
+ +
+
+
+

8.7 libopencore-amrnb

+ +

OpenCORE Adaptive Multi-Rate Narrowband encoder. +

+

Requires the presence of the libopencore-amrnb headers and library during +configuration. You need to explicitly configure the build with +--enable-libopencore-amrnb --enable-version3. +

+

This is a mono-only encoder. Officially it only supports 8000Hz sample rate, +but you can override it by setting strict to ‘unofficial’ or +lower. +

+ +
+

8.7.1 Options

+ +
+
b
+

Set bitrate in bits per second. Only the following bitrates are supported, +otherwise libavcodec will round to the nearest valid bitrate. +

+
+
4750
+
5150
+
5900
+
6700
+
7400
+
7950
+
10200
+
12200
+
+ +
+
dtx
+

Allow discontinuous transmission (generate comfort noise) when set to 1. The +default value is 0 (disabled). +

+
+
+ +
+
+
+

8.8 libopus

+ +

libopus Opus Interactive Audio Codec encoder wrapper. +

+

Requires the presence of the libopus headers and library during +configuration. You need to explicitly configure the build with +--enable-libopus. +

+ +
+

8.8.1 Option Mapping

+ +

Most libopus options are modelled after the opusenc utility from +opus-tools. The following is an option mapping chart describing options +supported by the libopus wrapper, and their opusenc-equivalent +in parentheses. +

+
+
b (bitrate)
+

Set the bit rate in bits/s. FFmpeg’s b option is +expressed in bits/s, while opusenc’s bitrate in +kilobits/s. +

+
+
vbr (vbr, hard-cbr, and cvbr)
+

Set VBR mode. The FFmpeg vbr option has the following +valid arguments, with the opusenc equivalent options +in parentheses: +

+
+
off (hard-cbr)
+

Use constant bit rate encoding. +

+
+
on (vbr)
+

Use variable bit rate encoding (the default). +

+
+
constrained (cvbr)
+

Use constrained variable bit rate encoding. +

+
+ +
+
compression_level (comp)
+

Set encoding algorithm complexity. Valid options are integers in +the 0-10 range. 0 gives the fastest encodes but lower quality, while 10 +gives the highest quality but slowest encoding. The default is 10. +

+
+
frame_duration (framesize)
+

Set maximum frame size, or duration of a frame in milliseconds. The +argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller +frame sizes achieve lower latency but less quality at a given bitrate. +Sizes greater than 20ms are only interesting at fairly low bitrates. +The default is 20ms. +

+
+
packet_loss (expect-loss)
+

Set expected packet loss percentage. The default is 0. +

+
+
fec (n/a)
+

Enable inband forward error correction. packet_loss must be non-zero +to take advantage - frequency of FEC ’side-data’ is proportional to expected packet loss. +Default is disabled. +

+
+
application (N.A.)
+

Set intended application type. Valid options are listed below: +

+
+
voip
+

Favor improved speech intelligibility. +

+
audio
+

Favor faithfulness to the input (the default). +

+
lowdelay
+

Restrict to only the lowest delay modes. +

+
+ +
+
cutoff (N.A.)
+

Set cutoff bandwidth in Hz. The argument must be exactly one of the +following: 4000, 6000, 8000, 12000, or 20000, corresponding to +narrowband, mediumband, wideband, super wideband, and fullband +respectively. The default is 0 (cutoff disabled). +

+
+
mapping_family (mapping_family)
+

Set channel mapping family to be used by the encoder. The default value of -1 +uses mapping family 0 for mono and stereo inputs, and mapping family 1 +otherwise. The default also disables the surround masking and LFE bandwidth +optimzations in libopus, and requires that the input contains 8 channels or +fewer. +

+

Other values include 0 for mono and stereo, 1 for surround sound with masking +and LFE bandwidth optimizations, and 255 for independent streams with an +unspecified channel layout. +

+
+
apply_phase_inv (N.A.) (requires libopus >= 1.2)
+

If set to 0, disables the use of phase inversion for intensity stereo, +improving the quality of mono downmixes, but slightly reducing normal stereo +quality. The default is 1 (phase inversion enabled). +

+
+
+ +
+
+
+

8.9 libshine

+ +

Shine Fixed-Point MP3 encoder wrapper. +

+

Shine is a fixed-point MP3 encoder. It has a far better performance on +platforms without an FPU, e.g. armel CPUs, and some phones and tablets. +However, as it is more targeted on performance than quality, it is not on par +with LAME and other production-grade encoders quality-wise. Also, according to +the project’s homepage, this encoder may not be free of bugs as the code was +written a long time ago and the project was dead for at least 5 years. +

+

This encoder only supports stereo and mono input. This is also CBR-only. +

+

The original project (last updated in early 2007) is at +http://sourceforge.net/projects/libshine-fxp/. We only support the +updated fork by the Savonet/Liquidsoap project at https://github.com/savonet/shine. +

+

Requires the presence of the libshine headers and library during +configuration. You need to explicitly configure the build with +--enable-libshine. +

+

See also libmp3lame. +

+ +
+

8.9.1 Options

+ +

The following options are supported by the libshine wrapper. The +shineenc-equivalent of the options are listed in parentheses. +

+
+
b (-b)
+

Set bitrate expressed in bits/s for CBR. shineenc -b option +is expressed in kilobits/s. +

+
+
+ +
+
+
+

8.10 libtwolame

+ +

TwoLAME MP2 encoder wrapper. +

+

Requires the presence of the libtwolame headers and library during +configuration. You need to explicitly configure the build with +--enable-libtwolame. +

+ +
+

8.10.1 Options

+ +

The following options are supported by the libtwolame wrapper. The +twolame-equivalent options follow the FFmpeg ones and are in +parentheses. +

+
+
b (-b)
+

Set bitrate expressed in bits/s for CBR. twolame b +option is expressed in kilobits/s. Default value is 128k. +

+
+
q (-V)
+

Set quality for experimental VBR support. Maximum value range is +from -50 to 50, useful range is from -10 to 10. The higher the +value, the better the quality. This option is valid only using the +ffmpeg command-line tool. For library interface users, +use global_quality. +

+
+
mode (--mode)
+

Set the mode of the resulting audio. Possible values: +

+
+
auto
+

Choose mode automatically based on the input. This is the default. +

+
stereo
+

Stereo +

+
joint_stereo
+

Joint stereo +

+
dual_channel
+

Dual channel +

+
mono
+

Mono +

+
+ +
+
psymodel (--psyc-mode)
+

Set psychoacoustic model to use in encoding. The argument must be +an integer between -1 and 4, inclusive. The higher the value, the +better the quality. The default value is 3. +

+
+
energy_levels (--energy)
+

Enable energy levels extensions when set to 1. The default value is +0 (disabled). +

+
+
error_protection (--protect)
+

Enable CRC error protection when set to 1. The default value is 0 +(disabled). +

+
+
copyright (--copyright)
+

Set MPEG audio copyright flag when set to 1. The default value is 0 +(disabled). +

+
+
original (--original)
+

Set MPEG audio original flag when set to 1. The default value is 0 +(disabled). +

+
+
+ +
+
+
+

8.11 libvo-amrwbenc

+ +

VisualOn Adaptive Multi-Rate Wideband encoder. +

+

Requires the presence of the libvo-amrwbenc headers and library during +configuration. You need to explicitly configure the build with +--enable-libvo-amrwbenc --enable-version3. +

+

This is a mono-only encoder. Officially it only supports 16000Hz sample +rate, but you can override it by setting strict to +‘unofficial’ or lower. +

+ +
+

8.11.1 Options

+ +
+
b
+

Set bitrate in bits/s. Only the following bitrates are supported, otherwise +libavcodec will round to the nearest valid bitrate. +

+
+
6600
+
8850
+
12650
+
14250
+
15850
+
18250
+
19850
+
23050
+
23850
+
+ +
+
dtx
+

Allow discontinuous transmission (generate comfort noise) when set to 1. The +default value is 0 (disabled). +

+
+
+ +
+
+
+

8.12 libvorbis

+ +

libvorbis encoder wrapper. +

+

Requires the presence of the libvorbisenc headers and library during +configuration. You need to explicitly configure the build with +--enable-libvorbis. +

+ +
+

8.12.1 Options

+ +

The following options are supported by the libvorbis wrapper. The +oggenc-equivalent of the options are listed in parentheses. +

+

To get a more accurate and extensive documentation of the libvorbis +options, consult the libvorbisenc’s and oggenc’s documentations. +See http://xiph.org/vorbis/, +http://wiki.xiph.org/Vorbis-tools, and oggenc(1). +

+
+
b (-b)
+

Set bitrate expressed in bits/s for ABR. oggenc -b is +expressed in kilobits/s. +

+
+
q (-q)
+

Set constant quality setting for VBR. The value should be a float +number in the range of -1.0 to 10.0. The higher the value, the better +the quality. The default value is ‘3.0’. +

+

This option is valid only using the ffmpeg command-line tool. +For library interface users, use global_quality. +

+
+
cutoff (--advanced-encode-option lowpass_frequency=N)
+

Set cutoff bandwidth in Hz, a value of 0 disables cutoff. oggenc’s +related option is expressed in kHz. The default value is ‘0’ (cutoff +disabled). +

+
+
minrate (-m)
+

Set minimum bitrate expressed in bits/s. oggenc -m is +expressed in kilobits/s. +

+
+
maxrate (-M)
+

Set maximum bitrate expressed in bits/s. oggenc -M is +expressed in kilobits/s. This only has effect on ABR mode. +

+
+
iblock (--advanced-encode-option impulse_noisetune=N)
+

Set noise floor bias for impulse blocks. The value is a float number from +-15.0 to 0.0. A negative bias instructs the encoder to pay special attention +to the crispness of transients in the encoded audio. The tradeoff for better +transient response is a higher bitrate. +

+
+
+ +
+
+
+

8.13 mjpeg

+ +

Motion JPEG encoder. +

+ +
+

8.13.1 Options

+ +
+
huffman
+

Set the huffman encoding strategy. Possible values: +

+
+
default
+

Use the default huffman tables. This is the default strategy. +

+
+
optimal
+

Compute and use optimal huffman tables. +

+
+
+
+
+ +
+
+
+

8.14 wavpack

+ +

WavPack lossless audio encoder. +

+ +
+

8.14.1 Options

+ +

The equivalent options for wavpack command line utility are listed in +parentheses. +

+ +
+

8.14.1.1 Shared options

+ +

The following shared options are effective for this encoder. Only special notes +about this particular encoder will be documented here. For the general meaning +of the options, see the Codec Options chapter. +

+
+
frame_size (--blocksize)
+

For this encoder, the range for this option is between 128 and 131072. Default +is automatically decided based on sample rate and number of channel. +

+

For the complete formula of calculating default, see +libavcodec/wavpackenc.c. +

+
+
compression_level (-f, -h, -hh, and -x)
+
+ +
+
+

8.14.1.2 Private options

+ +
+
joint_stereo (-j)
+

Set whether to enable joint stereo. Valid values are: +

+
+
on (1)
+

Force mid/side audio encoding. +

+
off (0)
+

Force left/right audio encoding. +

+
auto
+

Let the encoder decide automatically. +

+
+ +
+
optimize_mono
+

Set whether to enable optimization for mono. This option is only effective for +non-mono streams. Available values: +

+
+
on
+

enabled +

+
off
+

disabled +

+
+ +
+
+ + +
+
+
+
+
+

9 Video Encoders

+ +

A description of some of the currently available video encoders +follows. +

+ +
+

9.1 a64_multi, a64_multi5

+ +

A64 / Commodore 64 multicolor charset encoder. a64_multi5 is extended with 5th color (colram). +

+
+
+

9.2 Cinepak

+ +

Cinepak aka CVID encoder. +Compatible with Windows 3.1 and vintage MacOS. +

+ +
+

9.2.1 Options

+ +
+
g integer
+

Keyframe interval. +A keyframe is inserted at least every -g frames, sometimes sooner. +

+
+
q:v integer
+

Quality factor. Lower is better. Higher gives lower bitrate. +The following table lists bitrates when encoding akiyo_cif.y4m for various values of -q:v with -g 100: +

+
+
-q:v 1 1918 kb/s
+
-q:v 2 1735 kb/s
+
-q:v 4 1500 kb/s
+
-q:v 10 1041 kb/s
+
-q:v 20 826 kb/s
+
-q:v 40 553 kb/s
+
-q:v 100 394 kb/s
+
-q:v 200 312 kb/s
+
-q:v 400 266 kb/s
+
-q:v 1000 237 kb/s
+
+ +
+
max_extra_cb_iterations integer
+

Max extra codebook recalculation passes, more is better and slower. +

+
+
skip_empty_cb boolean
+

Avoid wasting bytes, ignore vintage MacOS decoder. +

+
+
max_strips integer
+
min_strips integer
+

The minimum and maximum number of strips to use. +Wider range sometimes improves quality. +More strips is generally better quality but costs more bits. +Fewer strips tend to yield more keyframes. +Vintage compatible is 1..3. +

+
+
strip_number_adaptivity integer
+

How much number of strips is allowed to change between frames. +Higher is better but slower. +

+
+
+ +
+
+
+

9.3 GIF

+ +

GIF image/animation encoder. +

+ +
+

9.3.1 Options

+ +
+
gifflags integer
+

Sets the flags used for GIF encoding. +

+
+
offsetting
+

Enables picture offsetting. +

+

Default is enabled. +

+
+
transdiff
+

Enables transparency detection between frames. +

+

Default is enabled. +

+
+
+ +
+
gifimage integer
+

Enables encoding one full GIF image per frame, rather than an animated GIF. +

+

Default value is 0. +

+
+
global_palette integer
+

Writes a palette to the global GIF header where feasible. +

+

If disabled, every frame will always have a palette written, even if there +is a global palette supplied. +

+

Default value is 1. +

+
+
+ +
+
+
+

9.4 Hap

+ +

Vidvox Hap video encoder. +

+ +
+

9.4.1 Options

+ +
+
format integer
+

Specifies the Hap format to encode. +

+
+
hap
+
hap_alpha
+
hap_q
+
+ +

Default value is hap. +

+
+
chunks integer
+

Specifies the number of chunks to split frames into, between 1 and 64. This +permits multithreaded decoding of large frames, potentially at the cost of +data-rate. The encoder may modify this value to divide frames evenly. +

+

Default value is 1. +

+
+
compressor integer
+

Specifies the second-stage compressor to use. If set to none, +chunks will be limited to 1, as chunked uncompressed frames offer no +benefit. +

+
+
none
+
snappy
+
+ +

Default value is snappy. +

+
+
+ +
+
+
+

9.5 jpeg2000

+ +

The native jpeg 2000 encoder is lossy by default, the -q:v +option can be used to set the encoding quality. Lossless encoding +can be selected with -pred 1. +

+ +
+

9.5.1 Options

+ +
+
format integer
+

Can be set to either j2k or jp2 (the default) that +makes it possible to store non-rgb pix_fmts. +

+
+
tile_width integer
+

Sets tile width. Range is 1 to 1073741824. Default is 256. +

+
+
tile_height integer
+

Sets tile height. Range is 1 to 1073741824. Default is 256. +

+
+
pred integer
+

Allows setting the discrete wavelet transform (DWT) type +

+
dwt97int (Lossy)
+
dwt53 (Lossless)
+
+

Default is dwt97int +

+
+
sop boolean
+

Enable this to add SOP marker at the start of each packet. Disabled by default. +

+
+
eph boolean
+

Enable this to add EPH marker at the end of each packet header. Disabled by default. +

+
+
prog integer
+

Sets the progression order to be used by the encoder. +Possible values are: +

+
lrcp
+
rlcp
+
rpcl
+
pcrl
+
cprl
+
+

Set to lrcp by default. +

+
+
layer_rates string
+

By default, when this option is not used, compression is done using the quality metric. +This option allows for compression using compression ratio. The compression ratio for each +level could be specified. The compression ratio of a layer l species the what ratio of +total file size is contained in the first l layers. +

+

Example usage: +

+
+
ffmpeg -i input.bmp -c:v jpeg2000 -layer_rates "100,10,1" output.j2k
+
+ +

This would compress the image to contain 3 layers, where the data contained in the +first layer would be compressed by 1000 times, compressed by 100 in the first two layers, +and shall contain all data while using all 3 layers. +

+
+
+ +
+
+
+

9.6 librav1e

+ +

rav1e AV1 encoder wrapper. +

+

Requires the presence of the rav1e headers and library during configuration. +You need to explicitly configure the build with --enable-librav1e. +

+ +
+

9.6.1 Options

+ +
+
qmax
+

Sets the maximum quantizer to use when using bitrate mode. +

+
+
qmin
+

Sets the minimum quantizer to use when using bitrate mode. +

+
+
qp
+

Uses quantizer mode to encode at the given quantizer (0-255). +

+
+
speed
+

Selects the speed preset (0-10) to encode with. +

+
+
tiles
+

Selects how many tiles to encode with. +

+
+
tile-rows
+

Selects how many rows of tiles to encode with. +

+
+
tile-columns
+

Selects how many columns of tiles to encode with. +

+
+
rav1e-params
+

Set rav1e options using a list of key=value pairs separated +by ":". See rav1e --help for a list of options. +

+

For example to specify librav1e encoding options with -rav1e-params: +

+
+
ffmpeg -i input -c:v librav1e -b:v 500K -rav1e-params speed=5:low_latency=true output.mp4
+
+ +
+
+ +
+
+
+

9.7 libaom-av1

+ +

libaom AV1 encoder wrapper. +

+

Requires the presence of the libaom headers and library during +configuration. You need to explicitly configure the build with +--enable-libaom. +

+ +
+

9.7.1 Options

+ +

The wrapper supports the following standard libavcodec options: +

+
+
b
+

Set bitrate target in bits/second. By default this will use +variable-bitrate mode. If maxrate and minrate are +also set to the same value then it will use constant-bitrate mode, +otherwise if crf is set as well then it will use +constrained-quality mode. +

+
+
g keyint_min
+

Set key frame placement. The GOP size sets the maximum distance between +key frames; if zero the output stream will be intra-only. The minimum +distance is ignored unless it is the same as the GOP size, in which case +key frames will always appear at a fixed interval. Not set by default, +so without this option the library has completely free choice about +where to place key frames. +

+
+
qmin qmax
+

Set minimum/maximum quantisation values. Valid range is from 0 to 63 +(warning: this does not match the quantiser values actually used by AV1 +- divide by four to map real quantiser values to this range). Defaults +to min/max (no constraint). +

+
+
minrate maxrate bufsize rc_init_occupancy
+

Set rate control buffering parameters. Not used if not set - defaults +to unconstrained variable bitrate. +

+
+
threads
+

Set the number of threads to use while encoding. This may require the +tiles or row-mt options to also be set to actually +use the specified number of threads fully. Defaults to the number of +hardware threads supported by the host machine. +

+
+
profile
+

Set the encoding profile. Defaults to using the profile which matches +the bit depth and chroma subsampling of the input. +

+
+
+ +

The wrapper also has some specific options: +

+
+
cpu-used
+

Set the quality/encoding speed tradeoff. Valid range is from 0 to 8, +higher numbers indicating greater speed and lower quality. The default +value is 1, which will be slow and high quality. +

+
+
auto-alt-ref
+

Enable use of alternate reference frames. Defaults to the internal +default of the library. +

+
+
arnr-max-frames (frames)
+

Set altref noise reduction max frame count. Default is -1. +

+
+
arnr-strength (strength)
+

Set altref noise reduction filter strength. Range is -1 to 6. Default is -1. +

+
+
aq-mode (aq-mode)
+

Set adaptive quantization mode. Possible values: +

+
+
none (0)
+

Disabled. +

+
+
variance (1)
+

Variance-based. +

+
+
complexity (2)
+

Complexity-based. +

+
+
cyclic (3)
+

Cyclic refresh. +

+
+ +
+
tune (tune)
+

Set the distortion metric the encoder is tuned with. Default is psnr. +

+
+
psnr (0)
+
ssim (1)
+
+ +
+
lag-in-frames
+

Set the maximum number of frames which the encoder may keep in flight +at any one time for lookahead purposes. Defaults to the internal +default of the library. +

+
+
error-resilience
+

Enable error resilience features: +

+
default
+

Improve resilience against losses of whole frames. +

+
+

Not enabled by default. +

+
+
crf
+

Set the quality/size tradeoff for constant-quality (no bitrate target) +and constrained-quality (with maximum bitrate target) modes. Valid +range is 0 to 63, higher numbers indicating lower quality and smaller +output size. Only used if set; by default only the bitrate target is +used. +

+
+
static-thresh
+

Set a change threshold on blocks below which they will be skipped by +the encoder. Defined in arbitrary units as a nonnegative integer, +defaulting to zero (no blocks are skipped). +

+
+
drop-threshold
+

Set a threshold for dropping frames when close to rate control bounds. +Defined as a percentage of the target buffer - when the rate control +buffer falls below this percentage, frames will be dropped until it +has refilled above the threshold. Defaults to zero (no frames are +dropped). +

+
+
denoise-noise-level (level)
+

Amount of noise to be removed for grain synthesis. Grain synthesis is disabled if +this option is not set or set to 0. +

+
+
denoise-block-size (pixels)
+

Block size used for denoising for grain synthesis. If not set, AV1 codec +uses the default value of 32. +

+
+
undershoot-pct (pct)
+

Set datarate undershoot (min) percentage of the target bitrate. Range is -1 to 100. +Default is -1. +

+
+
overshoot-pct (pct)
+

Set datarate overshoot (max) percentage of the target bitrate. Range is -1 to 1000. +Default is -1. +

+
+
minsection-pct (pct)
+

Minimum percentage variation of the GOP bitrate from the target bitrate. If minsection-pct +is not set, the libaomenc wrapper computes it as follows: (minrate * 100 / bitrate). +Range is -1 to 100. Default is -1 (unset). +

+
+
maxsection-pct (pct)
+

Maximum percentage variation of the GOP bitrate from the target bitrate. If maxsection-pct +is not set, the libaomenc wrapper computes it as follows: (maxrate * 100 / bitrate). +Range is -1 to 5000. Default is -1 (unset). +

+
+
frame-parallel (boolean)
+

Enable frame parallel decodability features. Default is true. +

+
+
tiles
+

Set the number of tiles to encode the input video with, as columns x +rows. Larger numbers allow greater parallelism in both encoding and +decoding, but may decrease coding efficiency. Defaults to the minimum +number of tiles required by the size of the input video (this is 1x1 +(that is, a single tile) for sizes up to and including 4K). +

+
+
tile-columns tile-rows
+

Set the number of tiles as log2 of the number of tile rows and columns. +Provided for compatibility with libvpx/VP9. +

+
+
row-mt (Requires libaom >= 1.0.0-759-g90a15f4f2)
+

Enable row based multi-threading. Disabled by default. +

+
+
enable-cdef (boolean)
+

Enable Constrained Directional Enhancement Filter. The libaom-av1 +encoder enables CDEF by default. +

+
+
enable-restoration (boolean)
+

Enable Loop Restoration Filter. Default is true for libaom-av1. +

+
+
enable-global-motion (boolean)
+

Enable the use of global motion for block prediction. Default is true. +

+
+
enable-intrabc (boolean)
+

Enable block copy mode for intra block prediction. This mode is +useful for screen content. Default is true. +

+
+
enable-rect-partitions (boolean) (Requires libaom >= v2.0.0)
+

Enable rectangular partitions. Default is true. +

+
+
enable-1to4-partitions (boolean) (Requires libaom >= v2.0.0)
+

Enable 1:4/4:1 partitions. Default is true. +

+
+
enable-ab-partitions (boolean) (Requires libaom >= v2.0.0)
+

Enable AB shape partitions. Default is true. +

+
+
enable-angle-delta (boolean) (Requires libaom >= v2.0.0)
+

Enable angle delta intra prediction. Default is true. +

+
+
enable-cfl-intra (boolean) (Requires libaom >= v2.0.0)
+

Enable chroma predicted from luma intra prediction. Default is true. +

+
+
enable-filter-intra (boolean) (Requires libaom >= v2.0.0)
+

Enable filter intra predictor. Default is true. +

+
+
enable-intra-edge-filter (boolean) (Requires libaom >= v2.0.0)
+

Enable intra edge filter. Default is true. +

+
+
enable-smooth-intra (boolean) (Requires libaom >= v2.0.0)
+

Enable smooth intra prediction mode. Default is true. +

+
+
enable-paeth-intra (boolean) (Requires libaom >= v2.0.0)
+

Enable paeth predictor in intra prediction. Default is true. +

+
+
enable-palette (boolean) (Requires libaom >= v2.0.0)
+

Enable palette prediction mode. Default is true. +

+
+
enable-flip-idtx (boolean) (Requires libaom >= v2.0.0)
+

Enable extended transform type, including FLIPADST_DCT, DCT_FLIPADST, +FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT, +V_ADST, H_ADST, V_FLIPADST, H_FLIPADST. Default is true. +

+
+
enable-tx64 (boolean) (Requires libaom >= v2.0.0)
+

Enable 64-pt transform. Default is true. +

+
+
reduced-tx-type-set (boolean) (Requires libaom >= v2.0.0)
+

Use reduced set of transform types. Default is false. +

+
+
use-intra-dct-only (boolean) (Requires libaom >= v2.0.0)
+

Use DCT only for INTRA modes. Default is false. +

+
+
use-inter-dct-only (boolean) (Requires libaom >= v2.0.0)
+

Use DCT only for INTER modes. Default is false. +

+
+
use-intra-default-tx-only (boolean) (Requires libaom >= v2.0.0)
+

Use Default-transform only for INTRA modes. Default is false. +

+
+
enable-ref-frame-mvs (boolean) (Requires libaom >= v2.0.0)
+

Enable temporal mv prediction. Default is true. +

+
+
enable-reduced-reference-set (boolean) (Requires libaom >= v2.0.0)
+

Use reduced set of single and compound references. Default is false. +

+
+
enable-obmc (boolean) (Requires libaom >= v2.0.0)
+

Enable obmc. Default is true. +

+
+
enable-dual-filter (boolean) (Requires libaom >= v2.0.0)
+

Enable dual filter. Default is true. +

+
+
enable-diff-wtd-comp (boolean) (Requires libaom >= v2.0.0)
+

Enable difference-weighted compound. Default is true. +

+
+
enable-dist-wtd-comp (boolean) (Requires libaom >= v2.0.0)
+

Enable distance-weighted compound. Default is true. +

+
+
enable-onesided-comp (boolean) (Requires libaom >= v2.0.0)
+

Enable one sided compound. Default is true. +

+
+
enable-interinter-wedge (boolean) (Requires libaom >= v2.0.0)
+

Enable interinter wedge compound. Default is true. +

+
+
enable-interintra-wedge (boolean) (Requires libaom >= v2.0.0)
+

Enable interintra wedge compound. Default is true. +

+
+
enable-masked-comp (boolean) (Requires libaom >= v2.0.0)
+

Enable masked compound. Default is true. +

+
+
enable-interintra-comp (boolean) (Requires libaom >= v2.0.0)
+

Enable interintra compound. Default is true. +

+
+
enable-smooth-interintra (boolean) (Requires libaom >= v2.0.0)
+

Enable smooth interintra mode. Default is true. +

+
+
aom-params
+

Set libaom options using a list of key=value pairs separated +by ":". For a list of supported options, see aomenc --help under the +section "AV1 Specific Options". +

+

For example to specify libaom encoding options with -aom-params: +

+
+
ffmpeg -i input -c:v libaom-av1 -b:v 500K -aom-params tune=psnr:enable-tpl-model=1 output.mp4
+
+ +
+
+ +
+
+
+

9.8 libsvtav1

+ +

SVT-AV1 encoder wrapper. +

+

Requires the presence of the SVT-AV1 headers and library during configuration. +You need to explicitly configure the build with --enable-libsvtav1. +

+ +
+

9.8.1 Options

+ +
+
profile
+

Set the encoding profile. +

+
main
+
high
+
professional
+
+ +
+
level
+

Set the operating point level. For example: ’4.0’ +

+
+
hielevel
+

Set the Hierarchical prediction levels. +

+
3level
+
4level
+

This is the default. +

+
+ +
+
tier
+

Set the operating point tier. +

+
main
+

This is the default. +

+
high
+
+ +
+
qmax
+

Set the maximum quantizer to use when using a bitrate mode. +

+
+
qmin
+

Set the minimum quantizer to use when using a bitrate mode. +

+
+
crf
+

Constant rate factor value used in crf rate control mode (0-63). +

+
+
qp
+

Set the quantizer used in cqp rate control mode (0-63). +

+
+
sc_detection
+

Enable scene change detection. +

+
+
la_depth
+

Set number of frames to look ahead (0-120). +

+
+
preset
+

Set the quality-speed tradeoff, in the range 0 to 13. Higher values are +faster but lower quality. +

+
+
tile_rows
+

Set log2 of the number of rows of tiles to use (0-6). +

+
+
tile_columns
+

Set log2 of the number of columns of tiles to use (0-4). +

+
+
svtav1-params
+

Set SVT-AV1 options using a list of key=value pairs separated +by ":". See the SVT-AV1 encoder user guide for a list of accepted parameters. +

+
+
+ +
+
+
+

9.9 libjxl

+ +

libjxl JPEG XL encoder wrapper. +

+

Requires the presence of the libjxl headers and library during +configuration. You need to explicitly configure the build with +--enable-libjxl. +

+ +
+

9.9.1 Options

+ +

The libjxl wrapper supports the following options: +

+
+
distance
+

Set the target Butteraugli distance. This is a quality setting: lower +distance yields higher quality, with distance=1.0 roughly comparable to +libjpeg Quality 90 for photographic content. Setting distance=0.0 yields +true lossless encoding. Valid values range between 0.0 and 15.0, and sane +values rarely exceed 5.0. Setting distance=0.1 usually attains +transparency for most input. The default is 1.0. +

+
+
effort
+

Set the encoding effort used. Higher effort values produce more consistent +quality and usually produces a better quality/bpp curve, at the cost of +more CPU time required. Valid values range from 1 to 9, and the default is 7. +

+
+
modular
+

Force the encoder to use Modular mode instead of choosing automatically. The +default is to use VarDCT for lossy encoding and Modular for lossless. VarDCT +is generally superior to Modular for lossy encoding but does not support +lossless encoding. +

+
+
+ +
+
+
+

9.10 libkvazaar

+ +

Kvazaar H.265/HEVC encoder. +

+

Requires the presence of the libkvazaar headers and library during +configuration. You need to explicitly configure the build with +--enable-libkvazaar. +

+ +
+

9.10.1 Options

+ +
+
b
+

Set target video bitrate in bit/s and enable rate control. +

+
+
kvazaar-params
+

Set kvazaar parameters as a list of name=value pairs separated +by commas (,). See kvazaar documentation for a list of options. +

+
+
+ +
+
+
+

9.11 libopenh264

+ +

Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper. +

+

This encoder requires the presence of the libopenh264 headers and +library during configuration. You need to explicitly configure the +build with --enable-libopenh264. The library is detected using +pkg-config. +

+

For more information about the library see +http://www.openh264.org. +

+ +
+

9.11.1 Options

+ +

The following FFmpeg global options affect the configurations of the +libopenh264 encoder. +

+
+
b
+

Set the bitrate (as a number of bits per second). +

+
+
g
+

Set the GOP size. +

+
+
maxrate
+

Set the max bitrate (as a number of bits per second). +

+
+
flags +global_header
+

Set global header in the bitstream. +

+
+
slices
+

Set the number of slices, used in parallelized encoding. Default value +is 0. This is only used when slice_mode is set to +‘fixed’. +

+
+
loopfilter
+

Enable loop filter, if set to 1 (automatically enabled). To disable +set a value of 0. +

+
+
profile
+

Set profile restrictions. If set to the value of ‘main’ enable +CABAC (set the SEncParamExt.iEntropyCodingModeFlag flag to 1). +

+
+
max_nal_size
+

Set maximum NAL size in bytes. +

+
+
allow_skip_frames
+

Allow skipping frames to hit the target bitrate if set to 1. +

+
+ +
+
+
+

9.12 libtheora

+ +

libtheora Theora encoder wrapper. +

+

Requires the presence of the libtheora headers and library during +configuration. You need to explicitly configure the build with +--enable-libtheora. +

+

For more information about the libtheora project see +http://www.theora.org/. +

+ +
+

9.12.1 Options

+ +

The following global options are mapped to internal libtheora options +which affect the quality and the bitrate of the encoded stream. +

+
+
b
+

Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In +case VBR (Variable Bit Rate) mode is enabled this option is ignored. +

+
+
flags
+

Used to enable constant quality mode (VBR) encoding through the +qscale flag, and to enable the pass1 and pass2 +modes. +

+
+
g
+

Set the GOP size. +

+
+
global_quality
+

Set the global quality as an integer in lambda units. +

+

Only relevant when VBR mode is enabled with flags +qscale. The +value is converted to QP units by dividing it by FF_QP2LAMBDA, +clipped in the [0 - 10] range, and then multiplied by 6.3 to get a +value in the native libtheora range [0-63]. A higher value corresponds +to a higher quality. +

+
+
q
+

Enable VBR mode when set to a non-negative value, and set constant +quality value as a double floating point value in QP units. +

+

The value is clipped in the [0-10] range, and then multiplied by 6.3 +to get a value in the native libtheora range [0-63]. +

+

This option is valid only using the ffmpeg command-line +tool. For library interface users, use global_quality. +

+
+ +
+
+

9.12.2 Examples

+ +
    +
  • Set maximum constant quality (VBR) encoding with ffmpeg: +
    +
    ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
    +
    + +
  • Use ffmpeg to convert a CBR 1000 kbps Theora video stream: +
    +
    ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
    +
    +
+ +
+
+
+

9.13 libvpx

+ +

VP8/VP9 format supported through libvpx. +

+

Requires the presence of the libvpx headers and library during configuration. +You need to explicitly configure the build with --enable-libvpx. +

+ +
+

9.13.1 Options

+ +

The following options are supported by the libvpx wrapper. The +vpxenc-equivalent options or values are listed in parentheses +for easy migration. +

+

To reduce the duplication of documentation, only the private options +and some others requiring special attention are documented here. For +the documentation of the undocumented generic options, see +the Codec Options chapter. +

+

To get more documentation of the libvpx options, invoke the command +ffmpeg -h encoder=libvpx, ffmpeg -h encoder=libvpx-vp9 or +vpxenc --help. Further information is available in the libvpx API +documentation. +

+
+
b (target-bitrate)
+

Set bitrate in bits/s. Note that FFmpeg’s b option is +expressed in bits/s, while vpxenc’s target-bitrate is in +kilobits/s. +

+
+
g (kf-max-dist)
+
keyint_min (kf-min-dist)
+
qmin (min-q)
+

Minimum (Best Quality) Quantizer. +

+
+
qmax (max-q)
+

Maximum (Worst Quality) Quantizer. +Can be changed per-frame. +

+
+
bufsize (buf-sz, buf-optimal-sz)
+

Set ratecontrol buffer size (in bits). Note vpxenc’s options are +specified in milliseconds, the libvpx wrapper converts this value as follows: +buf-sz = bufsize * 1000 / bitrate, +buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6. +

+
+
rc_init_occupancy (buf-initial-sz)
+

Set number of bits which should be loaded into the rc buffer before decoding +starts. Note vpxenc’s option is specified in milliseconds, the libvpx +wrapper converts this value as follows: +rc_init_occupancy * 1000 / bitrate. +

+
+
undershoot-pct
+

Set datarate undershoot (min) percentage of the target bitrate. +

+
+
overshoot-pct
+

Set datarate overshoot (max) percentage of the target bitrate. +

+
+
skip_threshold (drop-frame)
+
qcomp (bias-pct)
+
maxrate (maxsection-pct)
+

Set GOP max bitrate in bits/s. Note vpxenc’s option is specified as a +percentage of the target bitrate, the libvpx wrapper converts this value as +follows: (maxrate * 100 / bitrate). +

+
+
minrate (minsection-pct)
+

Set GOP min bitrate in bits/s. Note vpxenc’s option is specified as a +percentage of the target bitrate, the libvpx wrapper converts this value as +follows: (minrate * 100 / bitrate). +

+
+
minrate, maxrate, b end-usage=cbr
+

(minrate == maxrate == bitrate). +

+
+
crf (end-usage=cq, cq-level)
+
tune (tune)
+
+
psnr (psnr)
+
ssim (ssim)
+
+ +
+
quality, deadline (deadline)
+
+
best
+

Use best quality deadline. Poorly named and quite slow, this option should be +avoided as it may give worse quality output than good. +

+
good
+

Use good quality deadline. This is a good trade-off between speed and quality +when used with the cpu-used option. +

+
realtime
+

Use realtime quality deadline. +

+
+ +
+
speed, cpu-used (cpu-used)
+

Set quality/speed ratio modifier. Higher values speed up the encode at the cost +of quality. +

+
+
nr (noise-sensitivity)
+
static-thresh
+

Set a change threshold on blocks below which they will be skipped by the +encoder. +

+
+
slices (token-parts)
+

Note that FFmpeg’s slices option gives the total number of partitions, +while vpxenc’s token-parts is given as +log2(partitions). +

+
+
max-intra-rate
+

Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0 +means unlimited. +

+
+
force_key_frames
+

VPX_EFLAG_FORCE_KF +

+
+
Alternate reference frame related
+
+
auto-alt-ref
+

Enable use of alternate reference frames (2-pass only). +Values greater than 1 enable multi-layer alternate reference frames (VP9 only). +

+
arnr-maxframes
+

Set altref noise reduction max frame count. +

+
arnr-type
+

Set altref noise reduction filter type: backward, forward, centered. +

+
arnr-strength
+

Set altref noise reduction filter strength. +

+
rc-lookahead, lag-in-frames (lag-in-frames)
+

Set number of frames to look ahead for frametype and ratecontrol. +

+
min-gf-interval
+

Set minimum golden/alternate reference frame interval (VP9 only). +

+
+ +
+
error-resilient
+

Enable error resiliency features. +

+
+
sharpness integer
+

Increase sharpness at the expense of lower PSNR. +The valid range is [0, 7]. +

+
+
ts-parameters
+

Sets the temporal scalability configuration using a :-separated list of +key=value pairs. For example, to specify temporal scalability parameters +with ffmpeg: +

+
ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
+ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
+ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
+
+

Below is a brief explanation of each of the parameters, please +refer to struct vpx_codec_enc_cfg in vpx/vpx_encoder.h for more +details. +

+
ts_number_layers
+

Number of temporal coding layers. +

+
ts_target_bitrate
+

Target bitrate for each temporal layer (in kbps). +(bitrate should be inclusive of the lower temporal layer). +

+
ts_rate_decimator
+

Frame rate decimation factor for each temporal layer. +

+
ts_periodicity
+

Length of the sequence defining frame temporal layer membership. +

+
ts_layer_id
+

Template defining the membership of frames to temporal layers. +

+
ts_layering_mode
+

(optional) Selecting the temporal structure from a set of pre-defined temporal layering modes. +Currently supports the following options. +

+
0
+

No temporal layering flags are provided internally, +relies on flags being passed in using metadata field in AVFrame +with following keys. +

+
vp8-flags
+

Sets the flags passed into the encoder to indicate the referencing scheme for +the current frame. +Refer to function vpx_codec_encode in vpx/vpx_encoder.h for more +details. +

+
temporal_id
+

Explicitly sets the temporal id of the current frame to encode. +

+
+
+
2
+

Two temporal layers. 0-1... +

+
3
+

Three temporal layers. 0-2-1-2...; with single reference frame. +

+
4
+

Same as option "3", except there is a dependency between +the two temporal layer 2 frames within the temporal period. +

+
+
+
+ +
+
VP9-specific options
+
+
lossless
+

Enable lossless mode. +

+
tile-columns
+

Set number of tile columns to use. Note this is given as +log2(tile_columns). For example, 8 tile columns would be requested by +setting the tile-columns option to 3. +

+
tile-rows
+

Set number of tile rows to use. Note this is given as log2(tile_rows). +For example, 4 tile rows would be requested by setting the tile-rows +option to 2. +

+
frame-parallel
+

Enable frame parallel decodability features. +

+
aq-mode
+

Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3: +cyclic refresh, 4: equator360). +

+
colorspace color-space
+

Set input color space. The VP9 bitstream supports signaling the following +colorspaces: +

+
rgbsRGB
+
bt709bt709
+
unspecifiedunknown
+
bt470bgbt601
+
smpte170msmpte170
+
smpte240msmpte240
+
bt2020_nclbt2020
+
+
+
row-mt boolean
+

Enable row based multi-threading. +

+
tune-content
+

Set content type: default (0), screen (1), film (2). +

+
corpus-complexity
+

Corpus VBR mode is a variant of standard VBR where the complexity distribution +midpoint is passed in rather than calculated for a specific clip or chunk. +

+

The valid range is [0, 10000]. 0 (default) uses standard VBR. +

+
enable-tpl boolean
+

Enable temporal dependency model. +

+
ref-frame-config
+

Using per-frame metadata, set members of the structure vpx_svc_ref_frame_config_t in vpx/vp8cx.h to fine-control referencing schemes and frame buffer management. +
Use a :-separated list of key=value pairs. +For example, +

+
av_dict_set(&av_frame->metadata, "ref-frame-config", \
+"rfc_update_buffer_slot=7:rfc_lst_fb_idx=0:rfc_gld_fb_idx=1:rfc_alt_fb_idx=2:rfc_reference_last=0:rfc_reference_golden=0:rfc_reference_alt_ref=0");
+
+
+
rfc_update_buffer_slot
+

Indicates the buffer slot number to update +

+
rfc_update_last
+

Indicates whether to update the LAST frame +

+
rfc_update_golden
+

Indicates whether to update GOLDEN frame +

+
rfc_update_alt_ref
+

Indicates whether to update ALT_REF frame +

+
rfc_lst_fb_idx
+

LAST frame buffer index +

+
rfc_gld_fb_idx
+

GOLDEN frame buffer index +

+
rfc_alt_fb_idx
+

ALT_REF frame buffer index +

+
rfc_reference_last
+

Indicates whether to reference LAST frame +

+
rfc_reference_golden
+

Indicates whether to reference GOLDEN frame +

+
rfc_reference_alt_ref
+

Indicates whether to reference ALT_REF frame +

+
rfc_reference_duration
+

Indicates frame duration +

+
+
+
+ +
+
+ +

For more information about libvpx see: +http://www.webmproject.org/ +

+
+
+
+

9.14 libwebp

+ +

libwebp WebP Image encoder wrapper +

+

libwebp is Google’s official encoder for WebP images. It can encode in either +lossy or lossless mode. Lossy images are essentially a wrapper around a VP8 +frame. Lossless images are a separate codec developed by Google. +

+ +
+

9.14.1 Pixel Format

+ +

Currently, libwebp only supports YUV420 for lossy and RGB for lossless due +to limitations of the format and libwebp. Alpha is supported for either mode. +Because of API limitations, if RGB is passed in when encoding lossy or YUV is +passed in for encoding lossless, the pixel format will automatically be +converted using functions from libwebp. This is not ideal and is done only for +convenience. +

+
+
+

9.14.2 Options

+ +
+
-lossless boolean
+

Enables/Disables use of lossless mode. Default is 0. +

+
+
-compression_level integer
+

For lossy, this is a quality/speed tradeoff. Higher values give better quality +for a given size at the cost of increased encoding time. For lossless, this is +a size/speed tradeoff. Higher values give smaller size at the cost of increased +encoding time. More specifically, it controls the number of extra algorithms +and compression tools used, and varies the combination of these tools. This +maps to the method option in libwebp. The valid range is 0 to 6. +Default is 4. +

+
+
-quality float
+

For lossy encoding, this controls image quality. For lossless encoding, this +controls the effort and time spent in compression. +Range is 0 to 100. Default is 75. +

+
+
-preset type
+

Configuration preset. This does some automatic settings based on the general +type of the image. +

+
none
+

Do not use a preset. +

+
default
+

Use the encoder default. +

+
picture
+

Digital picture, like portrait, inner shot +

+
photo
+

Outdoor photograph, with natural lighting +

+
drawing
+

Hand or line drawing, with high-contrast details +

+
icon
+

Small-sized colorful images +

+
text
+

Text-like +

+
+ +
+
+ +
+
+
+

9.15 libx264, libx264rgb

+ +

x264 H.264/MPEG-4 AVC encoder wrapper. +

+

This encoder requires the presence of the libx264 headers and library +during configuration. You need to explicitly configure the build with +--enable-libx264. +

+

libx264 supports an impressive number of features, including 8x8 and +4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC +entropy coding, interlacing (MBAFF), lossless mode, psy optimizations +for detail retention (adaptive quantization, psy-RD, psy-trellis). +

+

Many libx264 encoder options are mapped to FFmpeg global codec +options, while unique encoder options are provided through private +options. Additionally the x264opts and x264-params +private options allows one to pass a list of key=value tuples as accepted +by the libx264 x264_param_parse function. +

+

The x264 project website is at +http://www.videolan.org/developers/x264.html. +

+

The libx264rgb encoder is the same as libx264, except it accepts packed RGB +pixel formats as input instead of YUV. +

+ +
+

9.15.1 Supported Pixel Formats

+ +

x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at +x264’s configure time. +

+
+
+

9.15.2 Options

+ +

The following options are supported by the libx264 wrapper. The +x264-equivalent options or values are listed in parentheses +for easy migration. +

+

To reduce the duplication of documentation, only the private options +and some others requiring special attention are documented here. For +the documentation of the undocumented generic options, see +the Codec Options chapter. +

+

To get a more accurate and extensive documentation of the libx264 +options, invoke the command x264 --fullhelp or consult +the libx264 documentation. +

+
+
b (bitrate)
+

Set bitrate in bits/s. Note that FFmpeg’s b option is +expressed in bits/s, while x264’s bitrate is in +kilobits/s. +

+
+
bf (bframes)
+
g (keyint)
+
qmin (qpmin)
+

Minimum quantizer scale. +

+
+
qmax (qpmax)
+

Maximum quantizer scale. +

+
+
qdiff (qpstep)
+

Maximum difference between quantizer scales. +

+
+
qblur (qblur)
+

Quantizer curve blur +

+
+
qcomp (qcomp)
+

Quantizer curve compression factor +

+
+
refs (ref)
+

Number of reference frames each P-frame can use. The range is from 0-16. +

+
+
sc_threshold (scenecut)
+

Sets the threshold for the scene change detection. +

+
+
trellis (trellis)
+

Performs Trellis quantization to increase efficiency. Enabled by default. +

+
+
nr (nr)
+
me_range (merange)
+

Maximum range of the motion search in pixels. +

+
+
me_method (me)
+

Set motion estimation method. Possible values in the decreasing order +of speed: +

+
+
dia (dia)
+
epzs (dia)
+

Diamond search with radius 1 (fastest). ‘epzs’ is an alias for +‘dia’. +

+
hex (hex)
+

Hexagonal search with radius 2. +

+
umh (umh)
+

Uneven multi-hexagon search. +

+
esa (esa)
+

Exhaustive search. +

+
tesa (tesa)
+

Hadamard exhaustive search (slowest). +

+
+ +
+
forced-idr
+

Normally, when forcing a I-frame type, the encoder can select any type +of I-frame. This option forces it to choose an IDR-frame. +

+
+
subq (subme)
+

Sub-pixel motion estimation method. +

+
+
b_strategy (b-adapt)
+

Adaptive B-frame placement decision algorithm. Use only on first-pass. +

+
+
keyint_min (min-keyint)
+

Minimum GOP size. +

+
+
coder
+

Set entropy encoder. Possible values: +

+
+
ac
+

Enable CABAC. +

+
+
vlc
+

Enable CAVLC and disable CABAC. It generates the same effect as +x264’s --no-cabac option. +

+
+ +
+
cmp
+

Set full pixel motion estimation comparison algorithm. Possible values: +

+
+
chroma
+

Enable chroma in motion estimation. +

+
+
sad
+

Ignore chroma in motion estimation. It generates the same effect as +x264’s --no-chroma-me option. +

+
+ +
+
threads (threads)
+

Number of encoding threads. +

+
+
thread_type
+

Set multithreading technique. Possible values: +

+
+
slice
+

Slice-based multithreading. It generates the same effect as +x264’s --sliced-threads option. +

+
frame
+

Frame-based multithreading. +

+
+ +
+
flags
+

Set encoding flags. It can be used to disable closed GOP and enable +open GOP by setting it to -cgop. The result is similar to +the behavior of x264’s --open-gop option. +

+
+
rc_init_occupancy (vbv-init)
+
preset (preset)
+

Set the encoding preset. +

+
+
tune (tune)
+

Set tuning of the encoding params. +

+
+
profile (profile)
+

Set profile restrictions. +

+
+
fastfirstpass
+

Enable fast settings when encoding first pass, when set to 1. When set +to 0, it has the same effect of x264’s +--slow-firstpass option. +

+
+
crf (crf)
+

Set the quality for constant quality mode. +

+
+
crf_max (crf-max)
+

In CRF mode, prevents VBV from lowering quality beyond this point. +

+
+
qp (qp)
+

Set constant quantization rate control method parameter. +

+
+
aq-mode (aq-mode)
+

Set AQ method. Possible values: +

+
+
none (0)
+

Disabled. +

+
+
variance (1)
+

Variance AQ (complexity mask). +

+
+
autovariance (2)
+

Auto-variance AQ (experimental). +

+
+ +
+
aq-strength (aq-strength)
+

Set AQ strength, reduce blocking and blurring in flat and textured areas. +

+
+
psy
+

Use psychovisual optimizations when set to 1. When set to 0, it has the +same effect as x264’s --no-psy option. +

+
+
psy-rd (psy-rd)
+

Set strength of psychovisual optimization, in +psy-rd:psy-trellis format. +

+
+
rc-lookahead (rc-lookahead)
+

Set number of frames to look ahead for frametype and ratecontrol. +

+
+
weightb
+

Enable weighted prediction for B-frames when set to 1. When set to 0, +it has the same effect as x264’s --no-weightb option. +

+
+
weightp (weightp)
+

Set weighted prediction method for P-frames. Possible values: +

+
+
none (0)
+

Disabled +

+
simple (1)
+

Enable only weighted refs +

+
smart (2)
+

Enable both weighted refs and duplicates +

+
+ +
+
ssim (ssim)
+

Enable calculation and printing SSIM stats after the encoding. +

+
+
intra-refresh (intra-refresh)
+

Enable the use of Periodic Intra Refresh instead of IDR frames when set +to 1. +

+
+
avcintra-class (class)
+

Configure the encoder to generate AVC-Intra. +Valid values are 50,100 and 200 +

+
+
bluray-compat (bluray-compat)
+

Configure the encoder to be compatible with the bluray standard. +It is a shorthand for setting "bluray-compat=1 force-cfr=1". +

+
+
b-bias (b-bias)
+

Set the influence on how often B-frames are used. +

+
+
b-pyramid (b-pyramid)
+

Set method for keeping of some B-frames as references. Possible values: +

+
+
none (none)
+

Disabled. +

+
strict (strict)
+

Strictly hierarchical pyramid. +

+
normal (normal)
+

Non-strict (not Blu-ray compatible). +

+
+ +
+
mixed-refs
+

Enable the use of one reference per partition, as opposed to one +reference per macroblock when set to 1. When set to 0, it has the +same effect as x264’s --no-mixed-refs option. +

+
+
8x8dct
+

Enable adaptive spatial transform (high profile 8x8 transform) +when set to 1. When set to 0, it has the same effect as +x264’s --no-8x8dct option. +

+
+
fast-pskip
+

Enable early SKIP detection on P-frames when set to 1. When set +to 0, it has the same effect as x264’s +--no-fast-pskip option. +

+
+
aud (aud)
+

Enable use of access unit delimiters when set to 1. +

+
+
mbtree
+

Enable use macroblock tree ratecontrol when set to 1. When set +to 0, it has the same effect as x264’s +--no-mbtree option. +

+
+
deblock (deblock)
+

Set loop filter parameters, in alpha:beta form. +

+
+
cplxblur (cplxblur)
+

Set fluctuations reduction in QP (before curve compression). +

+
+
partitions (partitions)
+

Set partitions to consider as a comma-separated list of. Possible +values in the list: +

+
+
p8x8
+

8x8 P-frame partition. +

+
p4x4
+

4x4 P-frame partition. +

+
b8x8
+

4x4 B-frame partition. +

+
i8x8
+

8x8 I-frame partition. +

+
i4x4
+

4x4 I-frame partition. +(Enabling ‘p4x4’ requires ‘p8x8’ to be enabled. Enabling +‘i8x8’ requires adaptive spatial transform (8x8dct +option) to be enabled.) +

+
none (none)
+

Do not consider any partitions. +

+
all (all)
+

Consider every partition. +

+
+ +
+
direct-pred (direct)
+

Set direct MV prediction mode. Possible values: +

+
+
none (none)
+

Disable MV prediction. +

+
spatial (spatial)
+

Enable spatial predicting. +

+
temporal (temporal)
+

Enable temporal predicting. +

+
auto (auto)
+

Automatically decided. +

+
+ +
+
slice-max-size (slice-max-size)
+

Set the limit of the size of each slice in bytes. If not specified +but RTP payload size (ps) is specified, that is used. +

+
+
stats (stats)
+

Set the file name for multi-pass stats. +

+
+
nal-hrd (nal-hrd)
+

Set signal HRD information (requires vbv-bufsize to be set). +Possible values: +

+
+
none (none)
+

Disable HRD information signaling. +

+
vbr (vbr)
+

Variable bit rate. +

+
cbr (cbr)
+

Constant bit rate (not allowed in MP4 container). +

+
+ +
+
x264opts (N.A.)
+

Set any x264 option, see x264 --fullhelp for a list. +

+

Argument is a list of key=value couples separated by +":". In filter and psy-rd options that use ":" as a separator +themselves, use "," instead. They accept it as well since long ago but this +is kept undocumented for some reason. +

+

For example to specify libx264 encoding options with ffmpeg: +

+
ffmpeg -i foo.mpg -c:v libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
+
+ +
+
a53cc boolean
+

Import closed captions (which must be ATSC compatible format) into output. +Only the mpeg2 and h264 decoders provide these. Default is 1 (on). +

+
+
udu_sei boolean
+

Import user data unregistered SEI if available into output. Default is 0 (off). +

+
+
x264-params (N.A.)
+

Override the x264 configuration using a :-separated list of key=value +parameters. +

+

This option is functionally the same as the x264opts, but is +duplicated for compatibility with the Libav fork. +

+

For example to specify libx264 encoding options with ffmpeg: +

+
ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
+cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
+no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
+
+
+
+ +

Encoding ffpresets for common usages are provided so they can be used with the +general presets system (e.g. passing the pre option). +

+
+
+
+

9.16 libx265

+ +

x265 H.265/HEVC encoder wrapper. +

+

This encoder requires the presence of the libx265 headers and library +during configuration. You need to explicitly configure the build with +--enable-libx265. +

+ +
+

9.16.1 Options

+ +
+
b
+

Sets target video bitrate. +

+
+
bf
+
g
+

Set the GOP size. +

+
+
keyint_min
+

Minimum GOP size. +

+
+
refs
+

Number of reference frames each P-frame can use. The range is from 1-16. +

+
+
preset
+

Set the x265 preset. +

+
+
tune
+

Set the x265 tune parameter. +

+
+
profile
+

Set profile restrictions. +

+
+
crf
+

Set the quality for constant quality mode. +

+
+
qp
+

Set constant quantization rate control method parameter. +

+
+
qmin
+

Minimum quantizer scale. +

+
+
qmax
+

Maximum quantizer scale. +

+
+
qdiff
+

Maximum difference between quantizer scales. +

+
+
qblur
+

Quantizer curve blur +

+
+
qcomp
+

Quantizer curve compression factor +

+
+
i_qfactor
+
b_qfactor
+
forced-idr
+

Normally, when forcing a I-frame type, the encoder can select any type +of I-frame. This option forces it to choose an IDR-frame. +

+
+
udu_sei boolean
+

Import user data unregistered SEI if available into output. Default is 0 (off). +

+
+
x265-params
+

Set x265 options using a list of key=value couples separated +by ":". See x265 --help for a list of options. +

+

For example to specify libx265 encoding options with -x265-params: +

+
+
ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
+
+
+
+ +
+
+
+

9.17 libxavs2

+ +

xavs2 AVS2-P2/IEEE1857.4 encoder wrapper. +

+

This encoder requires the presence of the libxavs2 headers and library +during configuration. You need to explicitly configure the build with +--enable-libxavs2. +

+

The following standard libavcodec options are used: +

    +
  • b / bit_rate +
  • g / gop_size +
  • bf / max_b_frames +
+ +

The encoder also has its own specific options: +

+
+

9.17.1 Options

+ +
+
lcu_row_threads
+

Set the number of parallel threads for rows from 1 to 8 (default 5). +

+
+
initial_qp
+

Set the xavs2 quantization parameter from 1 to 63 (default 34). This is +used to set the initial qp for the first frame. +

+
+
qp
+

Set the xavs2 quantization parameter from 1 to 63 (default 34). This is +used to set the qp value under constant-QP mode. +

+
+
max_qp
+

Set the max qp for rate control from 1 to 63 (default 55). +

+
+
min_qp
+

Set the min qp for rate control from 1 to 63 (default 20). +

+
+
speed_level
+

Set the Speed level from 0 to 9 (default 0). Higher is better but slower. +

+
+
log_level
+

Set the log level from -1 to 3 (default 0). -1: none, 0: error, +1: warning, 2: info, 3: debug. +

+
+
xavs2-params
+

Set xavs2 options using a list of key=value couples separated +by ":". +

+

For example to specify libxavs2 encoding options with -xavs2-params: +

+
+
ffmpeg -i input -c:v libxavs2 -xavs2-params RdoqLevel=0 output.avs2
+
+
+
+ +
+
+
+

9.18 libxvid

+ +

Xvid MPEG-4 Part 2 encoder wrapper. +

+

This encoder requires the presence of the libxvidcore headers and library +during configuration. You need to explicitly configure the build with +--enable-libxvid --enable-gpl. +

+

The native mpeg4 encoder supports the MPEG-4 Part 2 format, so +users can encode to this format without this library. +

+ +
+

9.18.1 Options

+ +

The following options are supported by the libxvid wrapper. Some of +the following options are listed but are not documented, and +correspond to shared codec options. See the Codec +Options chapter for their documentation. The other shared options +which are not listed have no effect for the libxvid encoder. +

+
+
b
+
g
+
qmin
+
qmax
+
mpeg_quant
+
threads
+
bf
+
b_qfactor
+
b_qoffset
+
flags
+

Set specific encoding flags. Possible values: +

+
+
mv4
+

Use four motion vector by macroblock. +

+
+
aic
+

Enable high quality AC prediction. +

+
+
gray
+

Only encode grayscale. +

+
+
gmc
+

Enable the use of global motion compensation (GMC). +

+
+
qpel
+

Enable quarter-pixel motion compensation. +

+
+
cgop
+

Enable closed GOP. +

+
+
global_header
+

Place global headers in extradata instead of every keyframe. +

+
+
+ +
+
trellis
+
me_method
+

Set motion estimation method. Possible values in decreasing order of +speed and increasing order of quality: +

+
+
zero
+

Use no motion estimation (default). +

+
+
phods
+
x1
+
log
+

Enable advanced diamond zonal search for 16x16 blocks and half-pixel +refinement for 16x16 blocks. ‘x1’ and ‘log’ are aliases for +‘phods’. +

+
+
epzs
+

Enable all of the things described above, plus advanced diamond zonal +search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion +estimation on chroma planes. +

+
+
full
+

Enable all of the things described above, plus extended 16x16 and 8x8 +blocks search. +

+
+ +
+
mbd
+

Set macroblock decision algorithm. Possible values in the increasing +order of quality: +

+
+
simple
+

Use macroblock comparing function algorithm (default). +

+
+
bits
+

Enable rate distortion-based half pixel and quarter pixel refinement for +16x16 blocks. +

+
+
rd
+

Enable all of the things described above, plus rate distortion-based +half pixel and quarter pixel refinement for 8x8 blocks, and rate +distortion-based search using square pattern. +

+
+ +
+
lumi_aq
+

Enable lumi masking adaptive quantization when set to 1. Default is 0 +(disabled). +

+
+
variance_aq
+

Enable variance adaptive quantization when set to 1. Default is 0 +(disabled). +

+

When combined with lumi_aq, the resulting quality will not +be better than any of the two specified individually. In other +words, the resulting quality will be the worse one of the two +effects. +

+
+
ssim
+

Set structural similarity (SSIM) displaying method. Possible values: +

+
+
off
+

Disable displaying of SSIM information. +

+
+
avg
+

Output average SSIM at the end of encoding to stdout. The format of +showing the average SSIM is: +

+
+
Average SSIM: %f
+
+ +

For users who are not familiar with C, %f means a float number, or +a decimal (e.g. 0.939232). +

+
+
frame
+

Output both per-frame SSIM data during encoding and average SSIM at +the end of encoding to stdout. The format of per-frame information +is: +

+
+
       SSIM: avg: %1.3f min: %1.3f max: %1.3f
+
+ +

For users who are not familiar with C, %1.3f means a float number +rounded to 3 digits after the dot (e.g. 0.932). +

+
+
+ +
+
ssim_acc
+

Set SSIM accuracy. Valid options are integers within the range of +0-4, while 0 gives the most accurate result and 4 computes the +fastest. +

+
+
+ +
+
+
+

9.19 MediaFoundation

+ +

This provides wrappers to encoders (both audio and video) in the +MediaFoundation framework. It can access both SW and HW encoders. +Video encoders can take input in either of nv12 or yuv420p form +(some encoders support both, some support only either - in practice, +nv12 is the safer choice, especially among HW encoders). +

+
+
+

9.20 mpeg2

+ +

MPEG-2 video encoder. +

+ +
+

9.20.1 Options

+ +
+
profile
+

Select the mpeg2 profile to encode: +

+
+
422
+
high
+
ss
+

Spatially Scalable +

+
snr
+

SNR Scalable +

+
main
+
simple
+
+ +
+
level
+

Select the mpeg2 level to encode: +

+
+
high
+
high1440
+
main
+
low
+
+ +
+
seq_disp_ext integer
+

Specifies if the encoder should write a sequence_display_extension to the +output. +

+
-1
+
auto
+

Decide automatically to write it or not (this is the default) by checking if +the data to be written is different from the default or unspecified values. +

+
0
+
never
+

Never write it. +

+
1
+
always
+

Always write it. +

+
+
+
video_format integer
+

Specifies the video_format written into the sequence display extension +indicating the source of the video pictures. The default is ‘unspecified’, +can be ‘component’, ‘pal’, ‘ntsc’, ‘secam’ or ‘mac’. +For maximum compatibility, use ‘component’. +

+
a53cc boolean
+

Import closed captions (which must be ATSC compatible format) into output. +Default is 1 (on). +

+
+ +
+
+
+

9.21 png

+ +

PNG image encoder. +

+ +
+

9.21.1 Private options

+ +
+
dpi integer
+

Set physical density of pixels, in dots per inch, unset by default +

+
dpm integer
+

Set physical density of pixels, in dots per meter, unset by default +

+
+ +
+
+
+

9.22 ProRes

+ +

Apple ProRes encoder. +

+

FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder. +The used encoder can be chosen with the -vcodec option. +

+ +
+

9.22.1 Private Options for prores-ks

+ +
+
profile integer
+

Select the ProRes profile to encode +

+
proxy
+
lt
+
standard
+
hq
+
4444
+
4444xq
+
+ +
+
quant_mat integer
+

Select quantization matrix. +

+
auto
+
default
+
proxy
+
lt
+
standard
+
hq
+
+

If set to auto, the matrix matching the profile will be picked. +If not set, the matrix providing the highest quality, default, will be +picked. +

+
+
bits_per_mb integer
+

How many bits to allot for coding one macroblock. Different profiles use +between 200 and 2400 bits per macroblock, the maximum is 8000. +

+
+
mbs_per_slice integer
+

Number of macroblocks in each slice (1-8); the default value (8) +should be good in almost all situations. +

+
+
vendor string
+

Override the 4-byte vendor ID. +A custom vendor ID like apl0 would claim the stream was produced by +the Apple encoder. +

+
+
alpha_bits integer
+

Specify number of bits for alpha component. +Possible values are 0, 8 and 16. +Use 0 to disable alpha plane coding. +

+
+
+ +
+
+

9.22.2 Speed considerations

+ +

In the default mode of operation the encoder has to honor frame constraints +(i.e. not produce frames with size bigger than requested) while still making +output picture as good as possible. +A frame containing a lot of small details is harder to compress and the encoder +would spend more time searching for appropriate quantizers for each slice. +

+

Setting a higher bits_per_mb limit will improve the speed. +

+

For the fastest encoding speed set the qscale parameter (4 is the +recommended value) and do not set a size constraint. +

+
+
+
+

9.23 QSV Encoders

+ +

The family of Intel QuickSync Video encoders (MPEG-2, H.264, HEVC, JPEG/MJPEG, +VP9, AV1) +

+ +
+

9.23.1 Ratecontrol Method

+

The ratecontrol method is selected as follows: +

    +
  • When global_quality is specified, a quality-based mode is used. +Specifically this means either +
      +
    • CQP - constant quantizer scale, when the qscale codec flag is +also set (the -qscale ffmpeg option). + +
    • LA_ICQ - intelligent constant quality with lookahead, when the +look_ahead option is also set. + +
    • ICQ – intelligent constant quality otherwise. For the ICQ modes, global +quality range is 1 to 51, with 1 being the best quality. +
    + +
  • Otherwise, a bitrate-based mode is used. For all of those, you should specify at +least the desired average bitrate with the b option. +
      +
    • LA - VBR with lookahead, when the look_ahead option is specified. + +
    • VCM - video conferencing mode, when the vcm option is set. + +
    • CBR - constant bitrate, when maxrate is specified and equal to +the average bitrate. + +
    • VBR - variable bitrate, when maxrate is specified, but is higher +than the average bitrate. + +
    • AVBR - average VBR mode, when maxrate is not specified, both +avbr_accuracy and avbr_convergence are set to non-zero. This +mode is available for H264 and HEVC on Windows. +
    +
+ +

Note that depending on your system, a different mode than the one you specified +may be selected by the encoder. Set the verbosity level to verbose or +higher to see the actual settings used by the QSV runtime. +

+
+
+

9.23.2 Global Options -> MSDK Options

+

Additional libavcodec global options are mapped to MSDK options as follows: +

+
    +
  • g/gop_size -> GopPicSize + +
  • bf/max_b_frames+1 -> GopRefDist + +
  • rc_init_occupancy/rc_initial_buffer_occupancy -> +InitialDelayInKB + +
  • slices -> NumSlice + +
  • refs -> NumRefFrame + +
  • b_strategy/b_frame_strategy -> BRefType + +
  • cgop/CLOSED_GOP codec flag -> GopOptFlag + +
  • For the CQP mode, the i_qfactor/i_qoffset and +b_qfactor/b_qoffset set the difference between QPP and QPI, +and QPP and QPB respectively. + +
  • Setting the coder option to the value vlc will make the H.264 +encoder use CAVLC instead of CABAC. + +
+ +
+
+

9.23.3 Common Options

+

Following options are used by all qsv encoders. +

+
+
async_depth
+

Specifies how many asynchronous operations an application performs +before the application explicitly synchronizes the result. If zero, +the value is not specified. +

+
+
preset
+

This option itemizes a range of choices from veryfast (best speed) to veryslow +(best quality). +

+
veryfast
+
faster
+
fast
+
medium
+
slow
+
slower
+
veryslow
+
+ +
+
forced_idr
+

Forcing I frames as IDR frames. +

+
+
low_power
+

For encoders set this flag to ON to reduce power consumption and GPU usage. +

+
+ +
+
+

9.23.4 Runtime Options

+

Following options can be used durning qsv encoding. +

+
+
global_quality
+
i_quant_factor
+
i_quant_offset
+
b_quant_factor
+
b_quant_offset
+

Supported in h264_qsv and hevc_qsv. +Change these value to reset qsv codec’s qp configuration. +

+
+
max_frame_size
+

Supported in h264_qsv and hevc_qsv. +Change this value to reset qsv codec’s MaxFrameSize configuration. +

+
+
gop_size
+

Change this value to reset qsv codec’s gop configuration. +

+
+
int_ref_type
+
int_ref_cycle_size
+
int_ref_qp_delta
+
int_ref_cycle_dist
+

Supported in h264_qsv and hevc_qsv. +Change these value to reset qsv codec’s Intra Refresh configuration. +

+
+
qmax
+
qmin
+
max_qp_i
+
min_qp_i
+
max_qp_p
+
min_qp_p
+
max_qp_b
+
min_qp_b
+

Supported in h264_qsv. +Change these value to reset qsv codec’s max/min qp configuration. +

+
+
low_delay_brc
+

Supported in h264_qsv, hevc_qsv and av1_qsv. +Change this value to reset qsv codec’s low_delay_brc configuration. +

+
+
framerate
+

Change this value to reset qsv codec’s framerate configuration. +

+
+
bit_rate
+
rc_buffer_size
+
rc_initial_buffer_occupancy
+
rc_max_rate
+

Change these value to reset qsv codec’s bitrate control configuration. +

+
+
pic_timing_sei
+

Supported in h264_qsv and hevc_qsv. +Change this value to reset qsv codec’s pic_timing_sei configuration. +

+
+ +
+
+

9.23.5 H264 options

+

These options are used by h264_qsv +

+
+
extbrc
+

Extended bitrate control. +

+
+
recovery_point_sei
+

Set this flag to insert the recovery point SEI message at the beginning of every +intra refresh cycle. +

+
+
rdo
+

Enable rate distortion optimization. +

+
+
max_frame_size
+

Maximum encoded frame size in bytes. +

+
+
max_frame_size_i
+

Maximum encoded frame size for I frames in bytes. If this value is set as larger +than zero, then for I frames the value set by max_frame_size is ignored. +

+
+
max_frame_size_p
+

Maximum encoded frame size for P frames in bytes. If this value is set as larger +than zero, then for P frames the value set by max_frame_size is ignored. +

+
+
max_slice_size
+

Maximum encoded slice size in bytes. +

+
+
bitrate_limit
+

Toggle bitrate limitations. +Modifies bitrate to be in the range imposed by the QSV encoder. Setting this +flag off may lead to violation of HRD conformance. Mind that specifying bitrate +below the QSV encoder range might significantly affect quality. If on this +option takes effect in non CQP modes: if bitrate is not in the range imposed +by the QSV encoder, it will be changed to be in the range. +

+
+
mbbrc
+

Setting this flag enables macroblock level bitrate control that generally +improves subjective visual quality. Enabling this flag may have negative impact +on performance and objective visual quality metric. +

+
+
low_delay_brc
+

Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides +more accurate bitrate control to minimize the variance of bitstream size frame +by frame. Value: -1-default 0-off 1-on +

+
+
adaptive_i
+

This flag controls insertion of I frames by the QSV encoder. Turn ON this flag +to allow changing of frame type from P and B to I. +

+
+
adaptive_b
+

This flag controls changing of frame type from B to P. +

+
+
p_strategy
+

Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0). +

+
+
b_strategy
+

This option controls usage of B frames as reference. +

+
+
dblk_idc
+

This option disable deblocking. It has value in range 0~2. +

+
+
cavlc
+

If set, CAVLC is used; if unset, CABAC is used for encoding. +

+
+
vcm
+

Video conferencing mode, please see ratecontrol method. +

+
+
idr_interval
+

Distance (in I-frames) between IDR frames. +

+
+
pic_timing_sei
+

Insert picture timing SEI with pic_struct_syntax element. +

+
+
single_sei_nal_unit
+

Put all the SEI messages into one NALU. +

+
+
max_dec_frame_buffering
+

Maximum number of frames buffered in the DPB. +

+
+
look_ahead
+

Use VBR algorithm with look ahead. +

+
+
look_ahead_depth
+

Depth of look ahead in number frames. +

+
+
look_ahead_downsampling
+

Downscaling factor for the frames saved for the lookahead analysis. +

+
unknown
+
auto
+
off
+
2x
+
4x
+
+ +
+
int_ref_type
+

Specifies intra refresh type. The major goal of intra refresh is improvement of +error resilience without significant impact on encoded bitstream size caused by +I frames. The SDK encoder achieves this by encoding part of each frame in +refresh cycle using intra MBs. none means no refresh. vertical means +vertical refresh, by column of MBs. horizontal means horizontal refresh, +by rows of MBs. slice means horizontal refresh by slices without +overlapping. In case of slice, in_ref_cycle_size is ignored. To enable +intra refresh, B frame should be set to 0. +

+
+
int_ref_cycle_size
+

Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are +invalid values. +

+
+
int_ref_qp_delta
+

Specifies QP difference for inserted intra MBs. This is signed value in +[-51, 51] range if target encoding bit-depth for luma samples is 8 and this +range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively. +

+
+
int_ref_cycle_dist
+

Distance between the beginnings of the intra-refresh cycles in frames. +

+
+
profile
+
+
unknown
+
baseline
+
main
+
high
+
+ +
+
a53cc
+

Use A53 Closed Captions (if available). +

+
+
aud
+

Insert the Access Unit Delimiter NAL. +

+
+
mfmode
+

Multi-Frame Mode. +

+
off
+
auto
+
+ +
+
repeat_pps
+

Repeat pps for every frame. +

+
+
max_qp_i
+

Maximum video quantizer scale for I frame. +

+
+
min_qp_i
+

Minimum video quantizer scale for I frame. +

+
+
max_qp_p
+

Maximum video quantizer scale for P frame. +

+
+
min_qp_p
+

Minimum video quantizer scale for P frame. +

+
+
max_qp_b
+

Maximum video quantizer scale for B frame. +

+
+
min_qp_b
+

Minimum video quantizer scale for B frame. +

+
+
scenario
+

Provides a hint to encoder about the scenario for the encoding session. +

+
unknown
+
displayremoting
+
videoconference
+
archive
+
livestreaming
+
cameracapture
+
videosurveillance
+
gamestreaming
+
remotegaming
+
+ +
+
avbr_accuracy
+

Accuracy of the AVBR ratecontrol (unit of tenth of percent). +

+
+
avbr_convergence
+

Convergence of the AVBR ratecontrol (unit of 100 frames) +

+

The parameters avbr_accuracy and avbr_convergence are for the +average variable bitrate control (AVBR) algorithm. +The algorithm focuses on overall encoding quality while meeting the specified +bitrate, target_bitrate, within the accuracy range avbr_accuracy, +after a avbr_Convergence period. This method does not follow HRD and the +instant bitrate is not capped or padded. +

+
+
skip_frame
+

Use per-frame metadata "qsv_skip_frame" to skip frame when encoding. This option +defines the usage of this metadata. +

+
no_skip
+

Frame skipping is disabled. +

+
insert_dummy
+

Encoder inserts into bitstream frame where all macroblocks are encoded as +skipped. +

+
insert_nothing
+

Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped +frames are still used in brc. For example, gop still include skipped frames, and +the frames after skipped frames will be larger in size. +

+
brc_only
+

skip_frame metadata indicates the number of missed frames before the current +frame. +

+
+ +
+
+ +
+
+

9.23.6 HEVC Options

+

These options are used by hevc_qsv +

+
+
extbrc
+

Extended bitrate control. +

+
+
recovery_point_sei
+

Set this flag to insert the recovery point SEI message at the beginning of every +intra refresh cycle. +

+
+
rdo
+

Enable rate distortion optimization. +

+
+
max_frame_size
+

Maximum encoded frame size in bytes. +

+
+
max_frame_size_i
+

Maximum encoded frame size for I frames in bytes. If this value is set as larger +than zero, then for I frames the value set by max_frame_size is ignored. +

+
+
max_frame_size_p
+

Maximum encoded frame size for P frames in bytes. If this value is set as larger +than zero, then for P frames the value set by max_frame_size is ignored. +

+
+
max_slice_size
+

Maximum encoded slice size in bytes. +

+
+
mbbrc
+

Setting this flag enables macroblock level bitrate control that generally +improves subjective visual quality. Enabling this flag may have negative impact +on performance and objective visual quality metric. +

+
+
low_delay_brc
+

Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides +more accurate bitrate control to minimize the variance of bitstream size frame +by frame. Value: -1-default 0-off 1-on +

+
+
adaptive_i
+

This flag controls insertion of I frames by the QSV encoder. Turn ON this flag +to allow changing of frame type from P and B to I. +

+
+
adaptive_b
+

This flag controls changing of frame type from B to P. +

+
+
p_strategy
+

Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0). +

+
+
b_strategy
+

This option controls usage of B frames as reference. +

+
+
dblk_idc
+

This option disable deblocking. It has value in range 0~2. +

+
+
idr_interval
+

Distance (in I-frames) between IDR frames. +

+
begin_only
+

Output an IDR-frame only at the beginning of the stream. +

+
+ +
+
load_plugin
+

A user plugin to load in an internal session. +

+
none
+
hevc_sw
+
hevc_hw
+
+ +
+
load_plugins
+

A :-separate list of hexadecimal plugin UIDs to load in +an internal session. +

+
+
look_ahead_depth
+

Depth of look ahead in number frames, available when extbrc option is enabled. +

+
+
profile
+

Set the encoding profile (scc requires libmfx >= 1.32). +

+
+
unknown
+
main
+
main10
+
mainsp
+
rext
+
scc
+
+ +
+
tier
+

Set the encoding tier (only level >= 4 can support high tier). +This option only takes effect when the level option is specified. +

+
+
main
+
high
+
+ +
+
gpb
+

1: GPB (generalized P/B frame) +

+

0: regular P frame. +

+
+
tile_cols
+

Number of columns for tiled encoding. +

+
+
tile_rows
+

Number of rows for tiled encoding. +

+
+
aud
+

Insert the Access Unit Delimiter NAL. +

+
+
pic_timing_sei
+

Insert picture timing SEI with pic_struct_syntax element. +

+
+
transform_skip
+

Turn this option ON to enable transformskip. It is supported on platform equal +or newer than ICL. +

+
+
int_ref_type
+

Specifies intra refresh type. The major goal of intra refresh is improvement of +error resilience without significant impact on encoded bitstream size caused by +I frames. The SDK encoder achieves this by encoding part of each frame in +refresh cycle using intra MBs. none means no refresh. vertical means +vertical refresh, by column of MBs. horizontal means horizontal refresh, +by rows of MBs. slice means horizontal refresh by slices without +overlapping. In case of slice, in_ref_cycle_size is ignored. To enable +intra refresh, B frame should be set to 0. +

+
+
int_ref_cycle_size
+

Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are +invalid values. +

+
+
int_ref_qp_delta
+

Specifies QP difference for inserted intra MBs. This is signed value in +[-51, 51] range if target encoding bit-depth for luma samples is 8 and this +range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively. +

+
+
int_ref_cycle_dist
+

Distance between the beginnings of the intra-refresh cycles in frames. +

+
+
max_qp_i
+

Maximum video quantizer scale for I frame. +

+
+
min_qp_i
+

Minimum video quantizer scale for I frame. +

+
+
max_qp_p
+

Maximum video quantizer scale for P frame. +

+
+
min_qp_p
+

Minimum video quantizer scale for P frame. +

+
+
max_qp_b
+

Maximum video quantizer scale for B frame. +

+
+
min_qp_b
+

Minimum video quantizer scale for B frame. +

+
+
scenario
+

Provides a hint to encoder about the scenario for the encoding session. +

+
unknown
+
displayremoting
+
videoconference
+
archive
+
livestreaming
+
cameracapture
+
videosurveillance
+
gamestreaming
+
remotegaming
+
+ +
+
avbr_accuracy
+

Accuracy of the AVBR ratecontrol (unit of tenth of percent). +

+
+
avbr_convergence
+

Convergence of the AVBR ratecontrol (unit of 100 frames) +

+

The parameters avbr_accuracy and avbr_convergence are for the +average variable bitrate control (AVBR) algorithm. +The algorithm focuses on overall encoding quality while meeting the specified +bitrate, target_bitrate, within the accuracy range avbr_accuracy, +after a avbr_Convergence period. This method does not follow HRD and the +instant bitrate is not capped or padded. +

+
+
skip_frame
+

Use per-frame metadata "qsv_skip_frame" to skip frame when encoding. This option +defines the usage of this metadata. +

+
no_skip
+

Frame skipping is disabled. +

+
insert_dummy
+

Encoder inserts into bitstream frame where all macroblocks are encoded as +skipped. +

+
insert_nothing
+

Similar to insert_dummy, but encoder inserts nothing into bitstream. The skipped +frames are still used in brc. For example, gop still include skipped frames, and +the frames after skipped frames will be larger in size. +

+
brc_only
+

skip_frame metadata indicates the number of missed frames before the current +frame. +

+
+ +
+
+ +
+
+

9.23.7 MPEG2 Options

+

These options are used by mpeg2_qsv +

+
profile
+
+
unknown
+
simple
+
main
+
high
+
+
+
+ +
+
+

9.23.8 VP9 Options

+

These options are used by vp9_qsv +

+
profile
+
+
unknown
+
profile0
+
profile1
+
profile2
+
profile3
+
+ +
+
tile_cols
+

Number of columns for tiled encoding (requires libmfx >= 1.29). +

+
+
tile_rows
+

Number of rows for tiled encoding (requires libmfx >= 1.29). +

+
+ +
+
+

9.23.9 AV1 Options

+

These options are used by av1_qsv (requires libvpl). +

+
profile
+
+
unknown
+
main
+
+ +
+
tile_cols
+

Number of columns for tiled encoding. +

+
+
tile_rows
+

Number of rows for tiled encoding. +

+
+
adaptive_i
+

This flag controls insertion of I frames by the QSV encoder. Turn ON this flag +to allow changing of frame type from P and B to I. +

+
+
adaptive_b
+

This flag controls changing of frame type from B to P. +

+
+
b_strategy
+

This option controls usage of B frames as reference. +

+
+
extbrc
+

Extended bitrate control. +

+
+
look_ahead_depth
+

Depth of look ahead in number frames, available when extbrc option is enabled. +

+
+
low_delay_brc
+

Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides +more accurate bitrate control to minimize the variance of bitstream size frame +by frame. Value: -1-default 0-off 1-on +

+
+
max_frame_size
+

Set the allowed max size in bytes for each frame. If the frame size exceeds +the limitation, encoder will adjust the QP value to control the frame size. +Invalid in CQP rate control mode. +

+
+ +
+
+
+

9.24 snow

+ + +
+

9.24.1 Options

+ +
+
iterative_dia_size
+

dia size for the iterative motion estimation +

+
+ +
+
+
+

9.25 VAAPI encoders

+ +

Wrappers for hardware encoders accessible via VAAPI. +

+

These encoders only accept input in VAAPI hardware surfaces. If you have input +in software frames, use the hwupload filter to upload them to the GPU. +

+

The following standard libavcodec options are used: +

    +
  • g / gop_size +
  • bf / max_b_frames +
  • profile + +

    If not set, this will be determined automatically from the format of the input +frames and the profiles supported by the driver. +

  • level +
  • b / bit_rate +
  • maxrate / rc_max_rate +
  • bufsize / rc_buffer_size +
  • rc_init_occupancy / rc_initial_buffer_occupancy +
  • compression_level + +

    Speed / quality tradeoff: higher values are faster / worse quality. +

  • q / global_quality + +

    Size / quality tradeoff: higher values are smaller / worse quality. +

  • qmin +
  • qmax +
  • i_qfactor / i_quant_factor +
  • i_qoffset / i_quant_offset +
  • b_qfactor / b_quant_factor +
  • b_qoffset / b_quant_offset +
  • slices +
+ +

All encoders support the following options: +

+
low_power
+

Some drivers/platforms offer a second encoder for some codecs intended to use +less power than the default encoder; setting this option will attempt to use +that encoder. Note that it may support a reduced feature set, so some other +options may not be available in this mode. +

+
+
idr_interval
+

Set the number of normal intra frames between full-refresh (IDR) frames in +open-GOP mode. The intra frames are still IRAPs, but will not include global +headers and may have non-decodable leading pictures. +

+
+
b_depth
+

Set the B-frame reference depth. When set to one (the default), all B-frames +will refer only to P- or I-frames. When set to greater values multiple layers +of B-frames will be present, frames in each layer only referring to frames in +higher layers. +

+
+
async_depth
+

Maximum processing parallelism. Increase this to improve single channel +performance. This option doesn’t work if driver doesn’t implement vaSyncBuffer +function. Please make sure there are enough hw_frames allocated if a large +number of async_depth is used. +

+
+
max_frame_size
+

Set the allowed max size in bytes for each frame. If the frame size exceeds +the limitation, encoder will adjust the QP value to control the frame size. +Invalid in CQP rate control mode. +

+
+
rc_mode
+

Set the rate control mode to use. A given driver may only support a subset of +modes. +

+

Possible modes: +

+
auto
+

Choose the mode automatically based on driver support and the other options. +This is the default. +

+
CQP
+

Constant-quality. +

+
CBR
+

Constant-bitrate. +

+
VBR
+

Variable-bitrate. +

+
ICQ
+

Intelligent constant-quality. +

+
QVBR
+

Quality-defined variable-bitrate. +

+
AVBR
+

Average variable bitrate. +

+
+ +
+
+ +

Each encoder also has its own specific options: +

+
h264_vaapi
+

profile sets the value of profile_idc and the constraint_set*_flags. +level sets the value of level_idc. +

+
+
coder
+

Set entropy encoder (default is cabac). Possible values: +

+
+
ac
+
cabac
+

Use CABAC. +

+
+
vlc
+
cavlc
+

Use CAVLC. +

+
+ +
+
aud
+

Include access unit delimiters in the stream (not included by default). +

+
+
sei
+

Set SEI message types to include. +Some combination of the following values: +

+
identifier
+

Include a user_data_unregistered message containing information about +the encoder. +

+
timing
+

Include picture timing parameters (buffering_period and +pic_timing messages). +

+
recovery_point
+

Include recovery points where appropriate (recovery_point messages). +

+
+ +
+
+ +
+
hevc_vaapi
+

profile and level set the values of +general_profile_idc and general_level_idc respectively. +

+
+
aud
+

Include access unit delimiters in the stream (not included by default). +

+
+
tier
+

Set general_tier_flag. This may affect the level chosen for the stream +if it is not explicitly specified. +

+
+
sei
+

Set SEI message types to include. +Some combination of the following values: +

+
hdr
+

Include HDR metadata if the input frames have it +(mastering_display_colour_volume and content_light_level +messages). +

+
+ +
+
tiles
+

Set the number of tiles to encode the input video with, as columns x rows. +Larger numbers allow greater parallelism in both encoding and decoding, but +may decrease coding efficiency. +

+
+
+ +
+
mjpeg_vaapi
+

Only baseline DCT encoding is supported. The encoder always uses the standard +quantisation and huffman tables - global_quality scales the standard +quantisation table (range 1-100). +

+

For YUV, 4:2:0, 4:2:2 and 4:4:4 subsampling modes are supported. RGB is also +supported, and will create an RGB JPEG. +

+
+
jfif
+

Include JFIF header in each frame (not included by default). +

+
huffman
+

Include standard huffman tables (on by default). Turning this off will save +a few hundred bytes in each output frame, but may lose compatibility with some +JPEG decoders which don’t fully handle MJPEG. +

+
+ +
+
mpeg2_vaapi
+

profile and level set the value of profile_and_level_indication. +

+
+
vp8_vaapi
+

B-frames are not supported. +

+

global_quality sets the q_idx used for non-key frames (range 0-127). +

+
+
loop_filter_level
+
loop_filter_sharpness
+

Manually set the loop filter parameters. +

+
+ +
+
vp9_vaapi
+

global_quality sets the q_idx used for P-frames (range 0-255). +

+
+
loop_filter_level
+
loop_filter_sharpness
+

Manually set the loop filter parameters. +

+
+ +

B-frames are supported, but the output stream is always in encode order rather than display +order. If B-frames are enabled, it may be necessary to use the vp9_raw_reorder +bitstream filter to modify the output stream to display frames in the correct order. +

+

Only normal frames are produced - the vp9_superframe bitstream filter may be +required to produce a stream usable with all decoders. +

+
+
+ +
+
+

9.26 vbn

+ +

Vizrt Binary Image encoder. +

+

This format is used by the broadcast vendor Vizrt for quick texture streaming. +Advanced features of the format such as LZW compression of texture data or +generation of mipmaps are not supported. +

+ +
+

9.26.1 Options

+ +
+
format string
+

Sets the texture compression used by the VBN file. Can be dxt1, +dxt5 or raw. Default is dxt5. +

+
+ +
+
+
+

9.27 vc2

+ +

SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at +professional broadcasting but since it supports yuv420, yuv422 and yuv444 at +8 (limited range or full range), 10 or 12 bits, this makes it suitable for +other tasks which require low overhead and low compression (like screen +recording). +

+ +
+

9.27.1 Options

+ +
+
b
+

Sets target video bitrate. Usually that’s around 1:6 of the uncompressed +video bitrate (e.g. for 1920x1080 50fps yuv422p10 that’s around 400Mbps). Higher +values (close to the uncompressed bitrate) turn on lossless compression mode. +

+
+
field_order
+

Enables field coding when set (e.g. to tt - top field first) for interlaced +inputs. Should increase compression with interlaced content as it splits the +fields and encodes each separately. +

+
+
wavelet_depth
+

Sets the total amount of wavelet transforms to apply, between 1 and 5 (default). +Lower values reduce compression and quality. Less capable decoders may not be +able to handle values of wavelet_depth over 3. +

+
+
wavelet_type
+

Sets the transform type. Currently only 5_3 (LeGall) and 9_7 +(Deslauriers-Dubuc) +are implemented, with 9_7 being the one with better compression and thus +is the default. +

+
+
slice_width
+
slice_height
+

Sets the slice size for each slice. Larger values result in better compression. +For compatibility with other more limited decoders use slice_width of +32 and slice_height of 8. +

+
+
tolerance
+

Sets the undershoot tolerance of the rate control system in percent. This is +to prevent an expensive search from being run. +

+
+
qm
+

Sets the quantization matrix preset to use by default or when wavelet_depth +is set to 5 +

    +
  • default +Uses the default quantization matrix from the specifications, extended with +values for the fifth level. This provides a good balance between keeping detail +and omitting artifacts. + +
  • flat +Use a completely zeroed out quantization matrix. This increases PSNR but might +reduce perception. Use in bogus benchmarks. + +
  • color +Reduces detail but attempts to preserve color at extremely low bitrates. +
+ +
+
+ + +
+
+
+
+

10 Subtitles Encoders

+ + +
+

10.1 dvdsub

+ +

This codec encodes the bitmap subtitle format that is used in DVDs. +Typically they are stored in VOBSUB file pairs (*.idx + *.sub), +and they can also be used in Matroska files. +

+ +
+

10.1.1 Options

+ +
+
palette
+

Specify the global palette used by the bitmaps. +

+

The format for this option is a string containing 16 24-bits hexadecimal +numbers (without 0x prefix) separated by commas, for example 0d00ee, +ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1, +7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b. +

+
+
even_rows_fix
+

When set to 1, enable a work-around that makes the number of pixel rows +even in all subtitles. This fixes a problem with some players that +cut off the bottom row if the number is odd. The work-around just adds +a fully transparent row if needed. The overhead is low, typically +one byte per subtitle on average. +

+

By default, this work-around is disabled. +

+
+ + +
+
+
+
+

11 See Also

+ +

ffmpeg, ffplay, ffprobe, +libavcodec +

+ +
+
+

12 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-devices.html b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-devices.html new file mode 100644 index 0000000000000000000000000000000000000000..f122b421279052ee2b5afec42e27ffd5aee013a9 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-devices.html @@ -0,0 +1,2817 @@ + + + + + +FFmpeg Devices Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ + +
+
+

1 Description

+ +

This document describes the input and output devices provided by the +libavdevice library. +

+ +
+
+

2 Device Options

+ +

The libavdevice library provides the same interface as +libavformat. Namely, an input device is considered like a demuxer, and +an output device like a muxer, and the interface and generic device +options are the same provided by libavformat (see the ffmpeg-formats +manual). +

+

In addition each input or output device may support so-called private +options, which are specific for that component. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the device +AVFormatContext options or using the libavutil/opt.h API +for programmatic use. +

+ +
+
+

3 Input Devices

+ +

Input devices are configured elements in FFmpeg which enable accessing +the data coming from a multimedia device attached to your system. +

+

When you configure your FFmpeg build, all the supported input devices +are enabled by default. You can list all available ones using the +configure option "–list-indevs". +

+

You can disable all the input devices using the configure option +"–disable-indevs", and selectively enable an input device using the +option "–enable-indev=INDEV", or you can disable a particular +input device using the option "–disable-indev=INDEV". +

+

The option "-devices" of the ff* tools will display the list of +supported input devices. +

+

A description of the currently available input devices follows. +

+ +
+

3.1 alsa

+ +

ALSA (Advanced Linux Sound Architecture) input device. +

+

To enable this input device during configuration you need libasound +installed on your system. +

+

This device allows capturing from an ALSA device. The name of the +device to capture has to be an ALSA card identifier. +

+

An ALSA identifier has the syntax: +

+
hw:CARD[,DEV[,SUBDEV]]
+
+ +

where the DEV and SUBDEV components are optional. +

+

The three arguments (in order: CARD,DEV,SUBDEV) +specify card number or identifier, device number and subdevice number +(-1 means any). +

+

To see the list of cards currently recognized by your system check the +files /proc/asound/cards and /proc/asound/devices. +

+

For example to capture with ffmpeg from an ALSA device with +card id 0, you may run the command: +

+
ffmpeg -f alsa -i hw:0 alsaout.wav
+
+ +

For more information see: +http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html +

+ +
+

3.1.1 Options

+ +
+
sample_rate
+

Set the sample rate in Hz. Default is 48000. +

+
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

3.2 android_camera

+ +

Android camera input device. +

+

This input devices uses the Android Camera2 NDK API which is +available on devices with API level 24+. The availability of +android_camera is autodetected during configuration. +

+

This device allows capturing from all cameras on an Android device, +which are integrated into the Camera2 NDK API. +

+

The available cameras are enumerated internally and can be selected +with the camera_index parameter. The input file string is +discarded. +

+

Generally the back facing camera has index 0 while the front facing +camera has index 1. +

+ +
+

3.2.1 Options

+ +
+
video_size
+

Set the video size given as a string such as 640x480 or hd720. +Falls back to the first available configuration reported by +Android if requested video size is not available or by default. +

+
+
framerate
+

Set the video framerate. +Falls back to the first available configuration reported by +Android if requested framerate is not available or by default (-1). +

+
+
camera_index
+

Set the index of the camera to use. Default is 0. +

+
+
input_queue_size
+

Set the maximum number of frames to buffer. Default is 5. +

+
+
+ +
+
+
+

3.3 avfoundation

+ +

AVFoundation input device. +

+

AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX >= 10.7 as well as on iOS. +

+

The input filename has to be given in the following syntax: +

+
-i "[[VIDEO]:[AUDIO]]"
+
+

The first entry selects the video input while the latter selects the audio input. +The stream has to be specified by the device name or the device index as shown by the device list. +Alternatively, the video and/or audio input device can be chosen by index using the + + -video_device_index <INDEX> + +and/or + + -audio_device_index <INDEX> + +, overriding any +device name or index given in the input filename. +

+

All available devices can be enumerated by using -list_devices true, listing +all device names and corresponding indices. +

+

There are two device name aliases: +

+
default
+

Select the AVFoundation default device of the corresponding type. +

+
+
none
+

Do not record the corresponding media type. +This is equivalent to specifying an empty device name or index. +

+
+
+ + +
+

3.3.1 Options

+ +

AVFoundation supports the following options: +

+
+
-list_devices <TRUE|FALSE>
+

If set to true, a list of all available input devices is given showing all +device names and indices. +

+
+
-video_device_index <INDEX>
+

Specify the video device by its index. Overrides anything given in the input filename. +

+
+
-audio_device_index <INDEX>
+

Specify the audio device by its index. Overrides anything given in the input filename. +

+
+
-pixel_format <FORMAT>
+

Request the video device to use a specific pixel format. +If the specified format is not supported, a list of available formats is given +and the first one in this list is used instead. Available pixel formats are: +monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0, + bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10, + yuv420p, nv12, yuyv422, gray +

+
+
-framerate
+

Set the grabbing frame rate. Default is ntsc, corresponding to a +frame rate of 30000/1001. +

+
+
-video_size
+

Set the video frame size. +

+
+
-capture_cursor
+

Capture the mouse pointer. Default is 0. +

+
+
-capture_mouse_clicks
+

Capture the screen mouse clicks. Default is 0. +

+
+
-capture_raw_data
+

Capture the raw device data. Default is 0. +Using this option may result in receiving the underlying data delivered to the AVFoundation framework. E.g. for muxed devices that sends raw DV data to the framework (like tape-based camcorders), setting this option to false results in extracted video frames captured in the designated pixel format only. Setting this option to true results in receiving the raw DV stream untouched. +

+
+ +
+
+

3.3.2 Examples

+ +
    +
  • Print the list of AVFoundation supported devices and exit: +
    +
    $ ffmpeg -f avfoundation -list_devices true -i ""
    +
    + +
  • Record video from video device 0 and audio from audio device 0 into out.avi: +
    +
    $ ffmpeg -f avfoundation -i "0:0" out.avi
    +
    + +
  • Record video from video device 2 and audio from audio device 1 into out.avi: +
    +
    $ ffmpeg -f avfoundation -video_device_index 2 -i ":1" out.avi
    +
    + +
  • Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi: +
    +
    $ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
    +
    + +
  • Record raw DV data from a suitable input device and write the output into out.dv: +
    +
    $ ffmpeg -f avfoundation -capture_raw_data true -i "zr100:none" out.dv
    +
    + + +
+ +
+
+
+

3.4 bktr

+ +

BSD video input device. +

+ +
+

3.4.1 Options

+ +
+
framerate
+

Set the frame rate. +

+
+
video_size
+

Set the video frame size. Default is vga. +

+
+
standard
+
+

Available values are: +

+
pal
+
ntsc
+
secam
+
paln
+
palm
+
ntscj
+
+ +
+
+ +
+
+ +
+

3.6 dshow

+ +

Windows DirectShow input device. +

+

DirectShow support is enabled when FFmpeg is built with the mingw-w64 project. +Currently only audio and video devices are supported. +

+

Multiple devices may be opened as separate inputs, but they may also be +opened on the same input, which should improve synchronism between them. +

+

The input name should be in the format: +

+
+
TYPE=NAME[:TYPE=NAME]
+
+ +

where TYPE can be either audio or video, +and NAME is the device’s name or alternative name.. +

+ +
+

3.6.1 Options

+ +

If no options are specified, the device’s defaults are used. +If the device does not support the requested options, it will +fail to open. +

+
+
video_size
+

Set the video size in the captured video. +

+
+
framerate
+

Set the frame rate in the captured video. +

+
+
sample_rate
+

Set the sample rate (in Hz) of the captured audio. +

+
+
sample_size
+

Set the sample size (in bits) of the captured audio. +

+
+
channels
+

Set the number of channels in the captured audio. +

+
+
list_devices
+

If set to true, print a list of devices and exit. +

+
+
list_options
+

If set to true, print a list of selected device’s options +and exit. +

+
+
video_device_number
+

Set video device number for devices with the same name (starts at 0, +defaults to 0). +

+
+
audio_device_number
+

Set audio device number for devices with the same name (starts at 0, +defaults to 0). +

+
+
pixel_format
+

Select pixel format to be used by DirectShow. This may only be set when +the video codec is not set or set to rawvideo. +

+
+
audio_buffer_size
+

Set audio device buffer size in milliseconds (which can directly +impact latency, depending on the device). +Defaults to using the audio device’s +default buffer size (typically some multiple of 500ms). +Setting this value too low can degrade performance. +See also +http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx +

+
+
video_pin_name
+

Select video capture pin to use by name or alternative name. +

+
+
audio_pin_name
+

Select audio capture pin to use by name or alternative name. +

+
+
crossbar_video_input_pin_number
+

Select video input pin number for crossbar device. This will be +routed to the crossbar device’s Video Decoder output pin. +Note that changing this value can affect future invocations +(sets a new default) until system reboot occurs. +

+
+
crossbar_audio_input_pin_number
+

Select audio input pin number for crossbar device. This will be +routed to the crossbar device’s Audio Decoder output pin. +Note that changing this value can affect future invocations +(sets a new default) until system reboot occurs. +

+
+
show_video_device_dialog
+

If set to true, before capture starts, popup a display dialog +to the end user, allowing them to change video filter properties +and configurations manually. +Note that for crossbar devices, adjusting values in this dialog +may be needed at times to toggle between PAL (25 fps) and NTSC (29.97) +input frame rates, sizes, interlacing, etc. Changing these values can +enable different scan rates/frame rates and avoiding green bars at +the bottom, flickering scan lines, etc. +Note that with some devices, changing these properties can also affect future +invocations (sets new defaults) until system reboot occurs. +

+
+
show_audio_device_dialog
+

If set to true, before capture starts, popup a display dialog +to the end user, allowing them to change audio filter properties +and configurations manually. +

+
+
show_video_crossbar_connection_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify crossbar pin routings, when it opens a video device. +

+
+
show_audio_crossbar_connection_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify crossbar pin routings, when it opens an audio device. +

+
+
show_analog_tv_tuner_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify TV channels and frequencies. +

+
+
show_analog_tv_tuner_audio_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify TV audio (like mono vs. stereo, Language A,B or C). +

+
+
audio_device_load
+

Load an audio capture filter device from file instead of searching +it by name. It may load additional parameters too, if the filter +supports the serialization of its properties to. +To use this an audio capture source has to be specified, but it can +be anything even fake one. +

+
+
audio_device_save
+

Save the currently used audio capture filter device and its +parameters (if the filter supports it) to a file. +If a file with the same name exists it will be overwritten. +

+
+
video_device_load
+

Load a video capture filter device from file instead of searching +it by name. It may load additional parameters too, if the filter +supports the serialization of its properties to. +To use this a video capture source has to be specified, but it can +be anything even fake one. +

+
+
video_device_save
+

Save the currently used video capture filter device and its +parameters (if the filter supports it) to a file. +If a file with the same name exists it will be overwritten. +

+
+
use_video_device_timestamps
+

If set to false, the timestamp for video frames will be +derived from the wallclock instead of the timestamp provided by +the capture device. This allows working around devices that +provide unreliable timestamps. +

+
+
+ +
+
+

3.6.2 Examples

+ +
    +
  • Print the list of DirectShow supported devices and exit: +
    +
    $ ffmpeg -list_devices true -f dshow -i dummy
    +
    + +
  • Open video device Camera: +
    +
    $ ffmpeg -f dshow -i video="Camera"
    +
    + +
  • Open second video device with name Camera: +
    +
    $ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
    +
    + +
  • Open video device Camera and audio device Microphone: +
    +
    $ ffmpeg -f dshow -i video="Camera":audio="Microphone"
    +
    + +
  • Print the list of supported options in selected device and exit: +
    +
    $ ffmpeg -list_options true -f dshow -i video="Camera"
    +
    + +
  • Specify pin names to capture by name or alternative name, specify alternative device name: +
    +
    $ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i video=video="@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}":audio="Microphone"
    +
    + +
  • Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup: +
    +
    $ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
    +     -crossbar_audio_input_pin_number 3 -i video="AVerMedia BDA Analog Capture":audio="AVerMedia BDA Analog Capture"
    +
    + +
+ +
+
+
+

3.7 fbdev

+ +

Linux framebuffer input device. +

+

The Linux framebuffer is a graphic hardware-independent abstraction +layer to show graphics on a computer monitor, typically on the +console. It is accessed through a file device node, usually +/dev/fb0. +

+

For more detailed information read the file +Documentation/fb/framebuffer.txt included in the Linux source tree. +

+

See also http://linux-fbdev.sourceforge.net/, and fbset(1). +

+

To record from the framebuffer device /dev/fb0 with +ffmpeg: +

+
ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
+
+ +

You can take a single screenshot image with the command: +

+
ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
+
+ + +
+

3.7.1 Options

+ +
+
framerate
+

Set the frame rate. Default is 25. +

+
+
+ +
+
+
+

3.8 gdigrab

+ +

Win32 GDI-based screen capture device. +

+

This device allows you to capture a region of the display on Windows. +

+

There are two options for the input filename: +

+
desktop
+
+

or +

+
title=window_title
+
+ +

The first option will capture the entire desktop, or a fixed region of the +desktop. The second option will instead capture the contents of a single +window, regardless of its position on the screen. +

+

For example, to grab the entire desktop using ffmpeg: +

+
ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
+
+ +

Grab a 640x480 region at position 10,20: +

+
ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
+
+ +

Grab the contents of the window named "Calculator" +

+
ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
+
+ + +
+

3.8.1 Options

+ +
+
draw_mouse
+

Specify whether to draw the mouse pointer. Use the value 0 to +not draw the pointer. Default value is 1. +

+
+
framerate
+

Set the grabbing frame rate. Default value is ntsc, +corresponding to a frame rate of 30000/1001. +

+
+
show_region
+

Show grabbed region on screen. +

+

If show_region is specified with 1, then the grabbing +region will be indicated on screen. With this option, it is easy to +know what is being grabbed if only a portion of the screen is grabbed. +

+

Note that show_region is incompatible with grabbing the contents +of a single window. +

+

For example: +

+
ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
+
+ +
+
video_size
+

Set the video frame size. The default is to capture the full screen if desktop is selected, or the full window size if title=window_title is selected. +

+
+
offset_x
+

When capturing a region with video_size, set the distance from the left edge of the screen or desktop. +

+

Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned to the left of your primary monitor, you will need to use a negative offset_x value to move the region to that monitor. +

+
+
offset_y
+

When capturing a region with video_size, set the distance from the top edge of the screen or desktop. +

+

Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned above your primary monitor, you will need to use a negative offset_y value to move the region to that monitor. +

+
+
+ +
+
+
+

3.9 iec61883

+ +

FireWire DV/HDV input device using libiec61883. +

+

To enable this input device, you need libiec61883, libraw1394 and +libavc1394 installed on your system. Use the configure option +--enable-libiec61883 to compile with the device enabled. +

+

The iec61883 capture device supports capturing from a video device +connected via IEEE1394 (FireWire), using libiec61883 and the new Linux +FireWire stack (juju). This is the default DV/HDV input method in Linux +Kernel 2.6.37 and later, since the old FireWire stack was removed. +

+

Specify the FireWire port to be used as input file, or "auto" +to choose the first port connected. +

+ +
+

3.9.1 Options

+ +
+
dvtype
+

Override autodetection of DV/HDV. This should only be used if auto +detection does not work, or if usage of a different device type +should be prohibited. Treating a DV device as HDV (or vice versa) will +not work and result in undefined behavior. +The values auto, dv and hdv are supported. +

+
+
dvbuffer
+

Set maximum size of buffer for incoming data, in frames. For DV, this +is an exact value. For HDV, it is not frame exact, since HDV does +not have a fixed frame size. +

+
+
dvguid
+

Select the capture device by specifying its GUID. Capturing will only +be performed from the specified device and fails if no device with the +given GUID is found. This is useful to select the input if multiple +devices are connected at the same time. +Look at /sys/bus/firewire/devices to find out the GUIDs. +

+
+
+ +
+
+

3.9.2 Examples

+ +
    +
  • Grab and show the input of a FireWire DV/HDV device. +
    +
    ffplay -f iec61883 -i auto
    +
    + +
  • Grab and record the input of a FireWire DV/HDV device, +using a packet buffer of 100000 packets if the source is HDV. +
    +
    ffmpeg -f iec61883 -i auto -dvbuffer 100000 out.mpg
    +
    + +
+ +
+
+
+

3.10 jack

+ +

JACK input device. +

+

To enable this input device during configuration you need libjack +installed on your system. +

+

A JACK input device creates one or more JACK writable clients, one for +each audio channel, with name client_name:input_N, where +client_name is the name provided by the application, and N +is a number which identifies the channel. +Each writable client will send the acquired data to the FFmpeg input +device. +

+

Once you have created one or more JACK readable clients, you need to +connect them to one or more JACK writable clients. +

+

To connect or disconnect JACK clients you can use the jack_connect +and jack_disconnect programs, or do it through a graphical interface, +for example with qjackctl. +

+

To list the JACK clients and their properties you can invoke the command +jack_lsp. +

+

Follows an example which shows how to capture a JACK readable client +with ffmpeg. +

+
# Create a JACK writable client with name "ffmpeg".
+$ ffmpeg -f jack -i ffmpeg -y out.wav
+
+# Start the sample jack_metro readable client.
+$ jack_metro -b 120 -d 0.2 -f 4000
+
+# List the current JACK clients.
+$ jack_lsp -c
+system:capture_1
+system:capture_2
+system:playback_1
+system:playback_2
+ffmpeg:input_1
+metro:120_bpm
+
+# Connect metro to the ffmpeg writable client.
+$ jack_connect metro:120_bpm ffmpeg:input_1
+
+ +

For more information read: +http://jackaudio.org/ +

+ +
+

3.10.1 Options

+ +
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

3.11 kmsgrab

+ +

KMS video input device. +

+

Captures the KMS scanout framebuffer associated with a specified CRTC or plane as a +DRM object that can be passed to other hardware functions. +

+

Requires either DRM master or CAP_SYS_ADMIN to run. +

+

If you don’t understand what all of that means, you probably don’t want this. Look at +x11grab instead. +

+ +
+

3.11.1 Options

+ +
+
device
+

DRM device to capture on. Defaults to /dev/dri/card0. +

+
+
format
+

Pixel format of the framebuffer. This can be autodetected if you are running Linux 5.7 +or later, but needs to be provided for earlier versions. Defaults to bgr0, +which is the most common format used by the Linux console and Xorg X server. +

+
+
format_modifier
+

Format modifier to signal on output frames. This is necessary to import correctly into +some APIs. It can be autodetected if you are running Linux 5.7 or later, but will need +to be provided explicitly when needed in earlier versions. See the libdrm documentation +for possible values. +

+
+
crtc_id
+

KMS CRTC ID to define the capture source. The first active plane on the given CRTC +will be used. +

+
+
plane_id
+

KMS plane ID to define the capture source. Defaults to the first active plane found if +neither crtc_id nor plane_id are specified. +

+
+
framerate
+

Framerate to capture at. This is not synchronised to any page flipping or framebuffer +changes - it just defines the interval at which the framebuffer is sampled. Sampling +faster than the framebuffer update rate will generate independent frames with the same +content. Defaults to 30. +

+
+
+ +
+
+

3.11.2 Examples

+ +
    +
  • Capture from the first active plane, download the result to normal frames and encode. +This will only work if the framebuffer is both linear and mappable - if not, the result +may be scrambled or fail to download. +
    +
    ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4
    +
    + +
  • Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert to NV12 and encode as H.264. +
    +
    ffmpeg -crtc_id 42 -framerate 60 -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' -c:v h264_vaapi output.mp4
    +
    + +
  • To capture only part of a plane the output can be cropped - this can be used to capture +a single window, as long as it has a known absolute position and size. For example, to +capture and encode the middle quarter of a 1920x1080 plane: +
    +
    ffmpeg -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,crop=960:540:480:270,scale_vaapi=960:540:nv12' -c:v h264_vaapi output.mp4
    +
    + +
+ +
+
+
+

3.12 lavfi

+ +

Libavfilter input virtual device. +

+

This input device reads data from the open output pads of a libavfilter +filtergraph. +

+

For each filtergraph open output, the input device will create a +corresponding stream which is mapped to the generated output. +The filtergraph is specified through the option graph. +

+ +
+

3.12.1 Options

+ +
+
graph
+

Specify the filtergraph to use as input. Each video open output must be +labelled by a unique string of the form "outN", where N is a +number starting from 0 corresponding to the mapped input stream +generated by the device. +The first unlabelled output is automatically assigned to the "out0" +label, but all the others need to be specified explicitly. +

+

The suffix "+subcc" can be appended to the output label to create an extra +stream with the closed captions packets attached to that output +(experimental; only for EIA-608 / CEA-708 for now). +The subcc streams are created after all the normal streams, in the order of +the corresponding stream. +For example, if there is "out19+subcc", "out7+subcc" and up to "out42", the +stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19. +

+

If not specified defaults to the filename specified for the input +device. +

+
+
graph_file
+

Set the filename of the filtergraph to be read and sent to the other +filters. Syntax of the filtergraph is the same as the one specified by +the option graph. +

+
+
dumpgraph
+

Dump graph to stderr. +

+
+
+ +
+
+

3.12.2 Examples

+ +
    +
  • Create a color video stream and play it back with ffplay: +
    +
    ffplay -f lavfi -graph "color=c=pink [out0]" dummy
    +
    + +
  • As the previous example, but use filename for specifying the graph +description, and omit the "out0" label: +
    +
    ffplay -f lavfi color=c=pink
    +
    + +
  • Create three different video test filtered sources and play them: +
    +
    ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
    +
    + +
  • Read an audio stream from a file using the amovie source and play it +back with ffplay: +
    +
    ffplay -f lavfi "amovie=test.wav"
    +
    + +
  • Read an audio stream and a video stream and play it back with +ffplay: +
    +
    ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
    +
    + +
  • Dump decoded frames to images and closed captions to a file (experimental): +
    +
    ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
    +
    + +
+ +
+
+
+

3.13 libcdio

+ +

Audio-CD input device based on libcdio. +

+

To enable this input device during configuration you need libcdio +installed on your system. It requires the configure option +--enable-libcdio. +

+

This device allows playing and grabbing from an Audio-CD. +

+

For example to copy with ffmpeg the entire Audio-CD in /dev/sr0, +you may run the command: +

+
ffmpeg -f libcdio -i /dev/sr0 cd.wav
+
+ + +
+

3.13.1 Options

+
+
speed
+

Set drive reading speed. Default value is 0. +

+

The speed is specified CD-ROM speed units. The speed is set through +the libcdio cdio_cddap_speed_set function. On many CD-ROM +drives, specifying a value too large will result in using the fastest +speed. +

+
+
paranoia_mode
+

Set paranoia recovery mode flags. It accepts one of the following values: +

+
+
disable
+
verify
+
overlap
+
neverskip
+
full
+
+ +

Default value is ‘disable’. +

+

For more information about the available recovery modes, consult the +paranoia project documentation. +

+
+ +
+
+
+

3.14 libdc1394

+ +

IIDC1394 input device, based on libdc1394 and libraw1394. +

+

Requires the configure option --enable-libdc1394. +

+ +
+

3.14.1 Options

+
+
framerate
+

Set the frame rate. Default is ntsc, corresponding to a frame +rate of 30000/1001. +

+
+
pixel_format
+

Select the pixel format. Default is uyvy422. +

+
+
video_size
+

Set the video size given as a string such as 640x480 or hd720. +Default is qvga. +

+
+ +
+
+
+

3.15 openal

+ +

The OpenAL input device provides audio capture on all systems with a +working OpenAL 1.1 implementation. +

+

To enable this input device during configuration, you need OpenAL +headers and libraries installed on your system, and need to configure +FFmpeg with --enable-openal. +

+

OpenAL headers and libraries should be provided as part of your OpenAL +implementation, or as an additional download (an SDK). Depending on your +installation you may need to specify additional flags via the +--extra-cflags and --extra-ldflags for allowing the build +system to locate the OpenAL headers and libraries. +

+

An incomplete list of OpenAL implementations follows: +

+
+
Creative
+

The official Windows implementation, providing hardware acceleration +with supported devices and software fallback. +See http://openal.org/. +

+
OpenAL Soft
+

Portable, open source (LGPL) software implementation. Includes +backends for the most common sound APIs on the Windows, Linux, +Solaris, and BSD operating systems. +See http://kcat.strangesoft.net/openal.html. +

+
Apple
+

OpenAL is part of Core Audio, the official Mac OS X Audio interface. +See http://developer.apple.com/technologies/mac/audio-and-video.html +

+
+ +

This device allows one to capture from an audio input device handled +through OpenAL. +

+

You need to specify the name of the device to capture in the provided +filename. If the empty string is provided, the device will +automatically select the default device. You can get the list of the +supported devices by using the option list_devices. +

+ +
+

3.15.1 Options

+ +
+
channels
+

Set the number of channels in the captured audio. Only the values +1 (monaural) and 2 (stereo) are currently supported. +Defaults to 2. +

+
+
sample_size
+

Set the sample size (in bits) of the captured audio. Only the values +8 and 16 are currently supported. Defaults to +16. +

+
+
sample_rate
+

Set the sample rate (in Hz) of the captured audio. +Defaults to 44.1k. +

+
+
list_devices
+

If set to true, print a list of devices and exit. +Defaults to false. +

+
+
+ +
+
+

3.15.2 Examples

+ +

Print the list of OpenAL supported devices and exit: +

+
$ ffmpeg -list_devices true -f openal -i dummy out.ogg
+
+ +

Capture from the OpenAL device DR-BT101 via PulseAudio: +

+
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
+
+ +

Capture from the default device (note the empty string ” as filename): +

+
$ ffmpeg -f openal -i '' out.ogg
+
+ +

Capture from two devices simultaneously, writing to two different files, +within the same ffmpeg command: +

+
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
+
+

Note: not all OpenAL implementations support multiple simultaneous capture - +try the latest OpenAL Soft if the above does not work. +

+
+
+
+

3.16 oss

+ +

Open Sound System input device. +

+

The filename to provide to the input device is the device node +representing the OSS input device, and is usually set to +/dev/dsp. +

+

For example to grab from /dev/dsp using ffmpeg use the +command: +

+
ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
+
+ +

For more information about OSS see: +http://manuals.opensound.com/usersguide/dsp.html +

+ +
+

3.16.1 Options

+ +
+
sample_rate
+

Set the sample rate in Hz. Default is 48000. +

+
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

3.17 pulse

+ +

PulseAudio input device. +

+

To enable this output device you need to configure FFmpeg with --enable-libpulse. +

+

The filename to provide to the input device is a source device or the +string "default" +

+

To list the PulseAudio source devices and their properties you can invoke +the command pactl list sources. +

+

More information about PulseAudio can be found on http://www.pulseaudio.org. +

+ +
+

3.17.1 Options

+
+
server
+

Connect to a specific PulseAudio server, specified by an IP address. +Default server is used when not provided. +

+
+
name
+

Specify the application name PulseAudio will use when showing active clients, +by default it is the LIBAVFORMAT_IDENT string. +

+
+
stream_name
+

Specify the stream name PulseAudio will use when showing active streams, +by default it is "record". +

+
+
sample_rate
+

Specify the samplerate in Hz, by default 48kHz is used. +

+
+
channels
+

Specify the channels in use, by default 2 (stereo) is set. +

+
+
frame_size
+

This option does nothing and is deprecated. +

+
+
fragment_size
+

Specify the size in bytes of the minimal buffering fragment in PulseAudio, it +will affect the audio latency. By default it is set to 50 ms amount of data. +

+
+
wallclock
+

Set the initial PTS using the current time. Default is 1. +

+
+
+ +
+
+

3.17.2 Examples

+

Record a stream from default device: +

+
ffmpeg -f pulse -i default /tmp/pulse.wav
+
+ +
+
+
+

3.18 sndio

+ +

sndio input device. +

+

To enable this input device during configuration you need libsndio +installed on your system. +

+

The filename to provide to the input device is the device node +representing the sndio input device, and is usually set to +/dev/audio0. +

+

For example to grab from /dev/audio0 using ffmpeg use the +command: +

+
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
+
+ + +
+

3.18.1 Options

+ +
+
sample_rate
+

Set the sample rate in Hz. Default is 48000. +

+
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

3.19 video4linux2, v4l2

+ +

Video4Linux2 input video device. +

+

"v4l2" can be used as alias for "video4linux2". +

+

If FFmpeg is built with v4l-utils support (by using the +--enable-libv4l2 configure option), it is possible to use it with the +-use_libv4l2 input device option. +

+

The name of the device to grab is a file device node, usually Linux +systems tend to automatically create such nodes when the device +(e.g. an USB webcam) is plugged into the system, and has a name of the +kind /dev/videoN, where N is a number associated to +the device. +

+

Video4Linux2 devices usually support a limited set of +widthxheight sizes and frame rates. You can check which are +supported using -list_formats all for Video4Linux2 devices. +Some devices, like TV cards, support one or more standards. It is possible +to list all the supported standards using -list_standards all. +

+

The time base for the timestamps is 1 microsecond. Depending on the kernel +version and configuration, the timestamps may be derived from the real time +clock (origin at the Unix Epoch) or the monotonic clock (origin usually at +boot time, unaffected by NTP or manual changes to the clock). The +-timestamps abs or -ts abs option can be used to force +conversion into the real time clock. +

+

Some usage examples of the video4linux2 device with ffmpeg +and ffplay: +

    +
  • List supported formats for a video4linux2 device: +
    +
    ffplay -f video4linux2 -list_formats all /dev/video0
    +
    + +
  • Grab and show the input of a video4linux2 device: +
    +
    ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
    +
    + +
  • Grab and record the input of a video4linux2 device, leave the +frame rate and size as previously set: +
    +
    ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
    +
    +
+ +

For more information about Video4Linux, check http://linuxtv.org/. +

+ +
+

3.19.1 Options

+ +
+
standard
+

Set the standard. Must be the name of a supported standard. To get a +list of the supported standards, use the list_standards +option. +

+
+
channel
+

Set the input channel number. Default to -1, which means using the +previously selected channel. +

+
+
video_size
+

Set the video frame size. The argument must be a string in the form +WIDTHxHEIGHT or a valid size abbreviation. +

+
+
pixel_format
+

Select the pixel format (only valid for raw video input). +

+
+
input_format
+

Set the preferred pixel format (for raw video) or a codec name. +This option allows one to select the input format, when several are +available. +

+
+
framerate
+

Set the preferred video frame rate. +

+
+
list_formats
+

List available formats (supported pixel formats, codecs, and frame +sizes) and exit. +

+

Available values are: +

+
all
+

Show all available (compressed and non-compressed) formats. +

+
+
raw
+

Show only raw video (non-compressed) formats. +

+
+
compressed
+

Show only compressed formats. +

+
+ +
+
list_standards
+

List supported standards and exit. +

+

Available values are: +

+
all
+

Show all supported standards. +

+
+ +
+
timestamps, ts
+

Set type of timestamps for grabbed frames. +

+

Available values are: +

+
default
+

Use timestamps from the kernel. +

+
+
abs
+

Use absolute timestamps (wall clock). +

+
+
mono2abs
+

Force conversion from monotonic to absolute timestamps. +

+
+ +

Default value is default. +

+
+
use_libv4l2
+

Use libv4l2 (v4l-utils) conversion functions. Default is 0. +

+
+
+ +
+
+
+

3.20 vfwcap

+ +

VfW (Video for Windows) capture input device. +

+

The filename passed as input is the capture driver number, ranging from +0 to 9. You may use "list" as filename to print a list of drivers. Any +other filename will be interpreted as device number 0. +

+ +
+

3.20.1 Options

+ +
+
video_size
+

Set the video frame size. +

+
+
framerate
+

Set the grabbing frame rate. Default value is ntsc, +corresponding to a frame rate of 30000/1001. +

+
+
+ +
+
+
+

3.21 x11grab

+ +

X11 video input device. +

+

To enable this input device during configuration you need libxcb +installed on your system. It will be automatically detected during +configuration. +

+

This device allows one to capture a region of an X11 display. +

+

The filename passed as input has the syntax: +

+
[hostname]:display_number.screen_number[+x_offset,y_offset]
+
+ +

hostname:display_number.screen_number specifies the +X11 display name of the screen to grab from. hostname can be +omitted, and defaults to "localhost". The environment variable +DISPLAY contains the default display name. +

+

x_offset and y_offset specify the offsets of the grabbed +area with respect to the top-left border of the X11 screen. They +default to 0. +

+

Check the X11 documentation (e.g. man X) for more detailed +information. +

+

Use the xdpyinfo program for getting basic information about +the properties of your X11 display (e.g. grep for "name" or +"dimensions"). +

+

For example to grab from :0.0 using ffmpeg: +

+
ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +

Grab at position 10,20: +

+
ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
+
+ + +
+

3.21.1 Options

+ +
+
select_region
+

Specify whether to select the grabbing area graphically using the pointer. +A value of 1 prompts the user to select the grabbing area graphically +by clicking and dragging. A single click with no dragging will select the +whole screen. A region with zero width or height will also select the whole +screen. This option overwrites the video_size, grab_x, and +grab_y options. Default value is 0. +

+
+
draw_mouse
+

Specify whether to draw the mouse pointer. A value of 0 specifies +not to draw the pointer. Default value is 1. +

+
+
follow_mouse
+

Make the grabbed area follow the mouse. The argument can be +centered or a number of pixels PIXELS. +

+

When it is specified with "centered", the grabbing region follows the mouse +pointer and keeps the pointer at the center of region; otherwise, the region +follows only when the mouse pointer reaches within PIXELS (greater than +zero) to the edge of region. +

+

For example: +

+
ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +

To follow only when the mouse pointer reaches within 100 pixels to edge: +

+
ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +
+
framerate
+

Set the grabbing frame rate. Default value is ntsc, +corresponding to a frame rate of 30000/1001. +

+
+
show_region
+

Show grabbed region on screen. +

+

If show_region is specified with 1, then the grabbing +region will be indicated on screen. With this option, it is easy to +know what is being grabbed if only a portion of the screen is grabbed. +

+
+
region_border
+

Set the region border thickness if -show_region 1 is used. +Range is 1 to 128 and default is 3 (XCB-based x11grab only). +

+

For example: +

+
ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
+
+ +

With follow_mouse: +

+
ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +
+
window_id
+

Grab this window, instead of the whole screen. Default value is 0, which maps to +the whole screen (root window). +

+

The id of a window can be found using the xwininfo program, possibly with options -tree and +-root. +

+

If the window is later enlarged, the new area is not recorded. Video ends when +the window is closed, unmapped (i.e., iconified) or shrunk beyond the video +size (which defaults to the initial window size). +

+

This option disables options follow_mouse and select_region. +

+
+
video_size
+

Set the video frame size. Default is the full desktop or window. +

+
+
grab_x
+
grab_y
+

Set the grabbing region coordinates. They are expressed as offset from +the top left corner of the X11 window and correspond to the +x_offset and y_offset parameters in the device name. The +default value for both options is 0. +

+
+ +
+
+
+
+

4 Output Devices

+ +

Output devices are configured elements in FFmpeg that can write +multimedia data to an output device attached to your system. +

+

When you configure your FFmpeg build, all the supported output devices +are enabled by default. You can list all available ones using the +configure option "–list-outdevs". +

+

You can disable all the output devices using the configure option +"–disable-outdevs", and selectively enable an output device using the +option "–enable-outdev=OUTDEV", or you can disable a particular +input device using the option "–disable-outdev=OUTDEV". +

+

The option "-devices" of the ff* tools will display the list of +enabled output devices. +

+

A description of the currently available output devices follows. +

+ +
+

4.1 alsa

+ +

ALSA (Advanced Linux Sound Architecture) output device. +

+ +
+

4.1.1 Examples

+ +
    +
  • Play a file on default ALSA device: +
    +
    ffmpeg -i INPUT -f alsa default
    +
    + +
  • Play a file on soundcard 1, audio device 7: +
    +
    ffmpeg -i INPUT -f alsa hw:1,7
    +
    +
+ +
+
+
+

4.2 AudioToolbox

+ +

AudioToolbox output device. +

+

Allows native output to CoreAudio devices on OSX. +

+

The output filename can be empty (or -) to refer to the default system output device or a number that refers to the device index as shown using: -list_devices true. +

+

Alternatively, the audio input device can be chosen by index using the + + -audio_device_index <INDEX> + +, overriding any device name or index given in the input filename. +

+

All available devices can be enumerated by using -list_devices true, listing +all device names, UIDs and corresponding indices. +

+ +
+

4.2.1 Options

+ +

AudioToolbox supports the following options: +

+
+
-audio_device_index <INDEX>
+

Specify the audio device by its index. Overrides anything given in the output filename. +

+
+
+ +
+
+

4.2.2 Examples

+ +
    +
  • Print the list of supported devices and output a sine wave to the default device: +
    +
    $ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -list_devices true -
    +
    + +
  • Output a sine wave to the device with the index 2, overriding any output filename: +
    +
    $ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -audio_device_index 2 -
    +
    + +
+ +
+
+
+

4.3 caca

+ +

CACA output device. +

+

This output device allows one to show a video stream in CACA window. +Only one CACA window is allowed per application, so you can +have only one instance of this output device in an application. +

+

To enable this output device you need to configure FFmpeg with +--enable-libcaca. +libcaca is a graphics library that outputs text instead of pixels. +

+

For more information about libcaca, check: +http://caca.zoy.org/wiki/libcaca +

+ +
+

4.3.1 Options

+ +
+
window_title
+

Set the CACA window title, if not specified default to the filename +specified for the output device. +

+
+
window_size
+

Set the CACA window size, can be a string of the form +widthxheight or a video size abbreviation. +If not specified it defaults to the size of the input video. +

+
+
driver
+

Set display driver. +

+
+
algorithm
+

Set dithering algorithm. Dithering is necessary +because the picture being rendered has usually far more colours than +the available palette. +The accepted values are listed with -list_dither algorithms. +

+
+
antialias
+

Set antialias method. Antialiasing smoothens the rendered +image and avoids the commonly seen staircase effect. +The accepted values are listed with -list_dither antialiases. +

+
+
charset
+

Set which characters are going to be used when rendering text. +The accepted values are listed with -list_dither charsets. +

+
+
color
+

Set color to be used when rendering text. +The accepted values are listed with -list_dither colors. +

+
+
list_drivers
+

If set to true, print a list of available drivers and exit. +

+
+
list_dither
+

List available dither options related to the argument. +The argument must be one of algorithms, antialiases, +charsets, colors. +

+
+ +
+
+

4.3.2 Examples

+ +
    +
  • The following command shows the ffmpeg output is an +CACA window, forcing its size to 80x25: +
    +
    ffmpeg -i INPUT -c:v rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
    +
    + +
  • Show the list of available drivers and exit: +
    +
    ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
    +
    + +
  • Show the list of available dither colors and exit: +
    +
    ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
    +
    +
+ +
+
+ +
+

4.5 fbdev

+ +

Linux framebuffer output device. +

+

The Linux framebuffer is a graphic hardware-independent abstraction +layer to show graphics on a computer monitor, typically on the +console. It is accessed through a file device node, usually +/dev/fb0. +

+

For more detailed information read the file +Documentation/fb/framebuffer.txt included in the Linux source tree. +

+ +
+

4.5.1 Options

+
+
xoffset
+
yoffset
+

Set x/y coordinate of top left corner. Default is 0. +

+
+ +
+
+

4.5.2 Examples

+

Play a file on framebuffer device /dev/fb0. +Required pixel format depends on current framebuffer settings. +

+
ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0
+
+ +

See also http://linux-fbdev.sourceforge.net/, and fbset(1). +

+
+
+
+

4.6 opengl

+

OpenGL output device. +

+

To enable this output device you need to configure FFmpeg with --enable-opengl. +

+

This output device allows one to render to OpenGL context. +Context may be provided by application or default SDL window is created. +

+

When device renders to external context, application must implement handlers for following messages: +AV_DEV_TO_APP_CREATE_WINDOW_BUFFER - create OpenGL context on current thread. +AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER - make OpenGL context current. +AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER - swap buffers. +AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER - destroy OpenGL context. +Application is also required to inform a device about current resolution by sending AV_APP_TO_DEV_WINDOW_SIZE message. +

+ +
+

4.6.1 Options

+
+
background
+

Set background color. Black is a default. +

+
no_window
+

Disables default SDL window when set to non-zero value. +Application must provide OpenGL context and both window_size_cb and window_swap_buffers_cb callbacks when set. +

+
window_title
+

Set the SDL window title, if not specified default to the filename specified for the output device. +Ignored when no_window is set. +

+
window_size
+

Set preferred window size, can be a string of the form widthxheight or a video size abbreviation. +If not specified it defaults to the size of the input video, downscaled according to the aspect ratio. +Mostly usable when no_window is not set. +

+
+
+ +
+
+

4.6.2 Examples

+

Play a file on SDL window using OpenGL rendering: +

+
ffmpeg  -i INPUT -f opengl "window title"
+
+ +
+
+
+

4.7 oss

+ +

OSS (Open Sound System) output device. +

+
+
+

4.8 pulse

+ +

PulseAudio output device. +

+

To enable this output device you need to configure FFmpeg with --enable-libpulse. +

+

More information about PulseAudio can be found on http://www.pulseaudio.org +

+ +
+

4.8.1 Options

+
+
server
+

Connect to a specific PulseAudio server, specified by an IP address. +Default server is used when not provided. +

+
+
name
+

Specify the application name PulseAudio will use when showing active clients, +by default it is the LIBAVFORMAT_IDENT string. +

+
+
stream_name
+

Specify the stream name PulseAudio will use when showing active streams, +by default it is set to the specified output name. +

+
+
device
+

Specify the device to use. Default device is used when not provided. +List of output devices can be obtained with command pactl list sinks. +

+
+
buffer_size
+
buffer_duration
+

Control the size and duration of the PulseAudio buffer. A small buffer +gives more control, but requires more frequent updates. +

+

buffer_size specifies size in bytes while +buffer_duration specifies duration in milliseconds. +

+

When both options are provided then the highest value is used +(duration is recalculated to bytes using stream parameters). If they +are set to 0 (which is default), the device will use the default +PulseAudio duration value. By default PulseAudio set buffer duration +to around 2 seconds. +

+
+
prebuf
+

Specify pre-buffering size in bytes. The server does not start with +playback before at least prebuf bytes are available in the +buffer. By default this option is initialized to the same value as +buffer_size or buffer_duration (whichever is bigger). +

+
+
minreq
+

Specify minimum request size in bytes. The server does not request less +than minreq bytes from the client, instead waits until the buffer +is free enough to request more bytes at once. It is recommended to not set +this option, which will initialize this to a value that is deemed sensible +by the server. +

+
+
+ +
+
+

4.8.2 Examples

+

Play a file on default device on default server: +

+
ffmpeg  -i INPUT -f pulse "stream name"
+
+ +
+
+
+

4.9 sdl

+ +

SDL (Simple DirectMedia Layer) output device. +

+

"sdl2" can be used as alias for "sdl". +

+

This output device allows one to show a video stream in an SDL +window. Only one SDL window is allowed per application, so you can +have only one instance of this output device in an application. +

+

To enable this output device you need libsdl installed on your system +when configuring your build. +

+

For more information about SDL, check: +http://www.libsdl.org/ +

+ +
+

4.9.1 Options

+ +
+
window_borderless
+

Set SDL window border off. +Default value is 0 (enable window border). +

+
+
window_enable_quit
+

Enable quit action (using window button or keyboard key) +when non-zero value is provided. +Default value is 1 (enable quit action). +

+
+
window_fullscreen
+

Set fullscreen mode when non-zero value is provided. +Default value is zero. +

+
+
window_size
+

Set the SDL window size, can be a string of the form +widthxheight or a video size abbreviation. +If not specified it defaults to the size of the input video, +downscaled according to the aspect ratio. +

+
+
window_title
+

Set the SDL window title, if not specified default to the filename +specified for the output device. +

+
+
window_x
+
window_y
+

Set the position of the window on the screen. +

+
+ +
+
+

4.9.2 Interactive commands

+ +

The window created by the device can be controlled through the +following interactive commands. +

+
+
q, ESC
+

Quit the device immediately. +

+
+ +
+
+

4.9.3 Examples

+ +

The following command shows the ffmpeg output is an +SDL window, forcing its size to the qcif format: +

+
ffmpeg -i INPUT -c:v rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
+
+ +
+
+
+

4.10 sndio

+ +

sndio audio output device. +

+
+
+

4.11 v4l2

+ +

Video4Linux2 output device. +

+
+
+

4.12 xv

+ +

XV (XVideo) output device. +

+

This output device allows one to show a video stream in a X Window System +window. +

+ +
+

4.12.1 Options

+ +
+
display_name
+

Specify the hardware display name, which determines the display and +communications domain to be used. +

+

The display name or DISPLAY environment variable can be a string in +the format hostname[:number[.screen_number]]. +

+

hostname specifies the name of the host machine on which the +display is physically attached. number specifies the number of +the display server on that host machine. screen_number specifies +the screen to be used on that server. +

+

If unspecified, it defaults to the value of the DISPLAY environment +variable. +

+

For example, dual-headed:0.1 would specify screen 1 of display +0 on the machine named “dual-headed”. +

+

Check the X11 specification for more detailed information about the +display name format. +

+
+
window_id
+

When set to non-zero value then device doesn’t create new window, +but uses existing one with provided window_id. By default +this options is set to zero and device creates its own window. +

+
+
window_size
+

Set the created window size, can be a string of the form +widthxheight or a video size abbreviation. If not +specified it defaults to the size of the input video. +Ignored when window_id is set. +

+
+
window_x
+
window_y
+

Set the X and Y window offsets for the created window. They are both +set to 0 by default. The values may be ignored by the window manager. +Ignored when window_id is set. +

+
+
window_title
+

Set the window title, if not specified default to the filename +specified for the output device. Ignored when window_id is set. +

+
+ +

For more information about XVideo see http://www.x.org/. +

+
+
+

4.12.2 Examples

+ +
    +
  • Decode, display and encode video input with ffmpeg at the +same time: +
    +
    ffmpeg -i INPUT OUTPUT -f xv display
    +
    + +
  • Decode and display the input video to multiple X11 windows: +
    +
    ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
    +
    +
+ + +
+
+
+
+

5 See Also

+ +

ffmpeg, ffplay, ffprobe, +libavdevice +

+ +
+
+

6 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-filters.html b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-filters.html new file mode 100644 index 0000000000000000000000000000000000000000..e2f978b5a49a1c243a5feae9c7f30ab6d04b02fd --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-filters.html @@ -0,0 +1,39787 @@ + + + + + +FFmpeg Filters Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ +
+ + +
+
+
+

1 Description

+ +

This document describes filters, sources, and sinks provided by the +libavfilter library. +

+ +
+
+

2 Filtering Introduction

+ +

Filtering in FFmpeg is enabled through the libavfilter library. +

+

In libavfilter, a filter can have multiple inputs and multiple +outputs. +To illustrate the sorts of things that are possible, we consider the +following filtergraph. +

+
                [main]
+input --> split ---------------------> overlay --> output
+            |                             ^
+            |[tmp]                  [flip]|
+            +-----> crop --> vflip -------+
+
+

This filtergraph splits the input stream in two streams, then sends one +stream through the crop filter and the vflip filter, before merging it +back with the other stream by overlaying it on top. You can use the +following command to achieve this: +

+
+
ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT
+
+ +

The result will be that the top half of the video is mirrored +onto the bottom half of the output video. +

+

Filters in the same linear chain are separated by commas, and distinct +linear chains of filters are separated by semicolons. In our example, +crop,vflip are in one linear chain, split and +overlay are separately in another. The points where the linear +chains join are labelled by names enclosed in square brackets. In the +example, the split filter generates two outputs that are associated to +the labels [main] and [tmp]. +

+

The stream sent to the second output of split, labelled as +[tmp], is processed through the crop filter, which crops +away the lower half part of the video, and then vertically flipped. The +overlay filter takes in input the first unchanged output of the +split filter (which was labelled as [main]), and overlay on its +lower half the output generated by the crop,vflip filterchain. +

+

Some filters take in input a list of parameters: they are specified +after the filter name and an equal sign, and are separated from each other +by a colon. +

+

There exist so-called source filters that do not have an +audio/video input, and sink filters that will not have audio/video +output. +

+ +
+
+

3 graph2dot

+ +

The graph2dot program included in the FFmpeg tools +directory can be used to parse a filtergraph description and issue a +corresponding textual representation in the dot language. +

+

Invoke the command: +

+
graph2dot -h
+
+ +

to see how to use graph2dot. +

+

You can then pass the dot description to the dot program (from +the graphviz suite of programs) and obtain a graphical representation +of the filtergraph. +

+

For example the sequence of commands: +

+
echo GRAPH_DESCRIPTION | \
+tools/graph2dot -o graph.tmp && \
+dot -Tpng graph.tmp -o graph.png && \
+display graph.png
+
+ +

can be used to create and display an image representing the graph +described by the GRAPH_DESCRIPTION string. Note that this string must be +a complete self-contained graph, with its inputs and outputs explicitly defined. +For example if your command line is of the form: +

+
ffmpeg -i infile -vf scale=640:360 outfile
+
+

your GRAPH_DESCRIPTION string will need to be of the form: +

+
nullsrc,scale=640:360,nullsink
+
+

you may also need to set the nullsrc parameters and add a format +filter in order to simulate a specific input file. +

+ +
+
+

4 Filtergraph description

+ +

A filtergraph is a directed graph of connected filters. It can contain +cycles, and there can be multiple links between a pair of +filters. Each link has one input pad on one side connecting it to one +filter from which it takes its input, and one output pad on the other +side connecting it to one filter accepting its output. +

+

Each filter in a filtergraph is an instance of a filter class +registered in the application, which defines the features and the +number of input and output pads of the filter. +

+

A filter with no input pads is called a "source", and a filter with no +output pads is called a "sink". +

+ +
+

4.1 Filtergraph syntax

+ +

A filtergraph has a textual representation, which is recognized by the +-filter/-vf/-af and +-filter_complex options in ffmpeg and +-vf/-af in ffplay, and by the +avfilter_graph_parse_ptr() function defined in +libavfilter/avfilter.h. +

+

A filterchain consists of a sequence of connected filters, each one +connected to the previous one in the sequence. A filterchain is +represented by a list of ","-separated filter descriptions. +

+

A filtergraph consists of a sequence of filterchains. A sequence of +filterchains is represented by a list of ";"-separated filterchain +descriptions. +

+

A filter is represented by a string of the form: +[in_link_1]...[in_link_N]filter_name@id=arguments[out_link_1]...[out_link_M] +

+

filter_name is the name of the filter class of which the +described filter is an instance of, and has to be the name of one of +the filter classes registered in the program optionally followed by "@id". +The name of the filter class is optionally followed by a string +"=arguments". +

+

arguments is a string which contains the parameters used to +initialize the filter instance. It may have one of two forms: +

    +
  • A ’:’-separated list of key=value pairs. + +
  • A ’:’-separated list of value. In this case, the keys are assumed to be +the option names in the order they are declared. E.g. the fade filter +declares three options in this order – type, start_frame and +nb_frames. Then the parameter list in:0:30 means that the value +in is assigned to the option type, 0 to +start_frame and 30 to nb_frames. + +
  • A ’:’-separated list of mixed direct value and long key=value +pairs. The direct value must precede the key=value pairs, and +follow the same constraints order of the previous point. The following +key=value pairs can be set in any preferred order. + +
+ +

If the option value itself is a list of items (e.g. the format filter +takes a list of pixel formats), the items in the list are usually separated by +‘|’. +

+

The list of arguments can be quoted using the character ‘'’ as initial +and ending mark, and the character ‘\’ for escaping the characters +within the quoted text; otherwise the argument string is considered +terminated when the next special character (belonging to the set +‘[]=;,’) is encountered. +

+

A special syntax implemented in the ffmpeg CLI tool allows loading +option values from files. This is done be prepending a slash ’/’ to the option +name, then the supplied value is interpreted as a path from which the actual +value is loaded. E.g. +

+
ffmpeg -i <INPUT> -vf drawtext=/text=/tmp/some_text <OUTPUT>
+
+

will load the text to be drawn from /tmp/some_text. API users wishing to +implement a similar feature should use the avfilter_graph_segment_*() +functions together with custom IO code. +

+

The name and arguments of the filter are optionally preceded and +followed by a list of link labels. +A link label allows one to name a link and associate it to a filter output +or input pad. The preceding labels in_link_1 +... in_link_N, are associated to the filter input pads, +the following labels out_link_1 ... out_link_M, are +associated to the output pads. +

+

When two link labels with the same name are found in the +filtergraph, a link between the corresponding input and output pad is +created. +

+

If an output pad is not labelled, it is linked by default to the first +unlabelled input pad of the next filter in the filterchain. +For example in the filterchain +

+
nullsrc, split[L1], [L2]overlay, nullsink
+
+

the split filter instance has two output pads, and the overlay filter +instance two input pads. The first output pad of split is labelled +"L1", the first input pad of overlay is labelled "L2", and the second +output pad of split is linked to the second input pad of overlay, +which are both unlabelled. +

+

In a filter description, if the input label of the first filter is not +specified, "in" is assumed; if the output label of the last filter is not +specified, "out" is assumed. +

+

In a complete filterchain all the unlabelled filter input and output +pads must be connected. A filtergraph is considered valid if all the +filter input and output pads of all the filterchains are connected. +

+

Leading and trailing whitespaces (space, tabs, or line feeds) separating tokens +in the filtergraph specification are ignored. This means that the filtergraph +can be expressed using empty lines and spaces to improve redability. +

+

For example, the filtergraph: +

+
testsrc,split[L1],hflip[L2];[L1][L2] hstack
+
+ +

can be represented as: +

+
testsrc,
+split [L1], hflip [L2];
+
+[L1][L2] hstack
+
+ +

Libavfilter will automatically insert scale filters where format +conversion is required. It is possible to specify swscale flags +for those automatically inserted scalers by prepending +sws_flags=flags; +to the filtergraph description. +

+

Here is a BNF description of the filtergraph syntax: +

+
NAME             ::= sequence of alphanumeric characters and '_'
+FILTER_NAME      ::= NAME["@"NAME]
+LINKLABEL        ::= "[" NAME "]"
+LINKLABELS       ::= LINKLABEL [LINKLABELS]
+FILTER_ARGUMENTS ::= sequence of chars (possibly quoted)
+FILTER           ::= [LINKLABELS] FILTER_NAME ["=" FILTER_ARGUMENTS] [LINKLABELS]
+FILTERCHAIN      ::= FILTER [,FILTERCHAIN]
+FILTERGRAPH      ::= [sws_flags=flags;] FILTERCHAIN [;FILTERGRAPH]
+
+ +
+
+

4.2 Notes on filtergraph escaping

+ +

Filtergraph description composition entails several levels of +escaping. See (ffmpeg-utils)the "Quoting and escaping" +section in the ffmpeg-utils(1) manual for more +information about the employed escaping procedure. +

+

A first level escaping affects the content of each filter option +value, which may contain the special character : used to +separate values, or one of the escaping characters \'. +

+

A second level escaping affects the whole filter description, which +may contain the escaping characters \' or the special +characters [],; used by the filtergraph description. +

+

Finally, when you specify a filtergraph on a shell commandline, you +need to perform a third level escaping for the shell special +characters contained within it. +

+

For example, consider the following string to be embedded in +the drawtext filter description text value: +

+
this is a 'string': may contain one, or more, special characters
+
+ +

This string contains the ' special escaping character, and the +: special character, so it needs to be escaped in this way: +

+
text=this is a \'string\'\: may contain one, or more, special characters
+
+ +

A second level of escaping is required when embedding the filter +description in a filtergraph description, in order to escape all the +filtergraph special characters. Thus the example above becomes: +

+
drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
+
+

(note that in addition to the \' escaping special characters, +also , needs to be escaped). +

+

Finally an additional level of escaping is needed when writing the +filtergraph description in a shell command, which depends on the +escaping rules of the adopted shell. For example, assuming that +\ is special and needs to be escaped with another \, the +previous string will finally result in: +

+
-vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
+
+ +

In order to avoid cumbersome escaping when using a commandline tool accepting a +filter specification as input, it is advisable to avoid direct inclusion of the +filter or options specification in the shell. +

+

For example, in case of the drawtext filter, you might prefer to +use the textfile option in place of text to specify the text +to render. +

+

When using the ffmpeg tool, you might consider to use the +(ffmpeg)-filter_script option or +(ffmpeg)-filter_complex_script option. +

+
+
+
+

5 Timeline editing

+ +

Some filters support a generic enable option. For the filters +supporting timeline editing, this option can be set to an expression which is +evaluated before sending a frame to the filter. If the evaluation is non-zero, +the filter will be enabled, otherwise the frame will be sent unchanged to the +next filter in the filtergraph. +

+

The expression accepts the following values: +

+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
n
+

sequential number of the input frame, starting from 0 +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, do +not use +

+
+
w
+
h
+

width and height of the input frame if video +

+
+ +

Additionally, these filters support an enable command that can be used +to re-define the expression. +

+

Like any other filtering option, the enable option follows the same +rules. +

+

For example, to enable a blur filter (smartblur) from 10 seconds to 3 +minutes, and a curves filter starting at 3 seconds: +

+
smartblur = enable='between(t,10,3*60)',
+curves    = enable='gte(t,3)' : preset=cross_process
+
+ +

See ffmpeg -filters to view which filters have timeline support. +

+ +
+
+

6 Changing options at runtime with a command

+ +

Some options can be changed during the operation of the filter using +a command. These options are marked ’T’ on the output of +ffmpeg -h filter=<name of filter>. +The name of the command is the name of the option and the argument is +the new value. +

+
+
+

7 Options for filters with several inputs (framesync)

+ +

Some filters with several inputs support a common set of options. +These options can only be set by name, not with the short notation. +

+
+
eof_action
+

The action to take when EOF is encountered on the secondary input; it accepts +one of the following values: +

+
+
repeat
+

Repeat the last frame (the default). +

+
endall
+

End both streams. +

+
pass
+

Pass the main input through. +

+
+ +
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+
repeatlast
+

If set to 1, force the filter to extend the last frame of secondary streams +until the end of the primary stream. A value of 0 disables this behavior. +Default value is 1. +

+
+
ts_sync_mode
+

How strictly to sync streams based on secondary input timestamps; it accepts +one of the following values: +

+
+
default
+

Frame from secondary input with the nearest lower or equal timestamp to the +primary input frame. +

+
nearest
+

Frame from secondary input with the absolute nearest timestamp to the primary +input frame. +

+
+
+
+ + +
+
+

8 Audio Filters

+ +

When you configure your FFmpeg build, you can disable any of the +existing filters using --disable-filters. +The configure output will show the audio filters included in your +build. +

+

Below is a description of the currently available audio filters. +

+ +
+

8.1 acompressor

+ +

A compressor is mainly used to reduce the dynamic range of a signal. +Especially modern music is mostly compressed at a high ratio to +improve the overall loudness. It’s done to get the highest attention +of a listener, "fatten" the sound and bring more "power" to the track. +If a signal is compressed too much it may sound dull or "dead" +afterwards or it may start to "pump" (which could be a powerful effect +but can also destroy a track completely). +The right compression is the key to reach a professional sound and is +the high art of mixing and mastering. Because of its complex settings +it may take a long time to get the right feeling for this kind of effect. +

+

Compression is done by detecting the volume above a chosen level +threshold and dividing it by the factor set with ratio. +So if you set the threshold to -12dB and your signal reaches -6dB a ratio +of 2:1 will result in a signal at -9dB. Because an exact manipulation of +the signal would cause distortion of the waveform the reduction can be +levelled over the time. This is done by setting "Attack" and "Release". +attack determines how long the signal has to rise above the threshold +before any reduction will occur and release sets the time the signal +has to fall below the threshold to reduce the reduction again. Shorter signals +than the chosen attack time will be left untouched. +The overall reduction of the signal can be made up afterwards with the +makeup setting. So compressing the peaks of a signal about 6dB and +raising the makeup to this level results in a signal twice as loud than the +source. To gain a softer entry in the compression the knee flattens the +hard edge at the threshold in the range of the chosen decibels. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. Default is 1. Range is between 0.015625 and 64. +

+
+
mode
+

Set mode of compressor operation. Can be upward or downward. +Default is downward. +

+
+
threshold
+

If a signal of stream rises above this level it will affect the gain +reduction. +By default it is 0.125. Range is between 0.00097563 and 1. +

+
+
ratio
+

Set a ratio by which the signal is reduced. 1:2 means that if the level +rose 4dB above the threshold, it will be only 2dB above after the reduction. +Default is 2. Range is between 1 and 20. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction starts. Default is 20. Range is between 0.01 and 2000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before +reduction is decreased again. Default is 250. Range is between 0.01 and 9000. +

+
+
makeup
+

Set the amount by how much signal will be amplified after processing. +Default is 1. Range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.82843. Range is between 1 and 8. +

+
+
link
+

Choose if the average level between all channels of input stream +or the louder(maximum) channel of input stream affects the +reduction. Default is average. +

+
+
detection
+

Should the exact signal be taken in case of peak or an RMS one in case +of rms. Default is rms which is mostly smoother. +

+
+
mix
+

How much to use compressed signal in output. Default is 1. +Range is between 0 and 1. +

+
+ + +
+

8.1.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.2 acontrast

+

Simple audio dynamic range compression/expansion filter. +

+

The filter accepts the following options: +

+
+
contrast
+

Set contrast. Default is 33. Allowed range is between 0 and 100. +

+
+ +
+
+

8.3 acopy

+ +

Copy the input audio source unchanged to the output. This is mainly useful for +testing purposes. +

+
+
+

8.4 acrossfade

+ +

Apply cross fade from one input audio stream to another input audio stream. +The cross fade is applied for specified duration near the end of first stream. +

+

The filter accepts the following options: +

+
+
nb_samples, ns
+

Specify the number of samples for which the cross fade effect has to last. +At the end of the cross fade effect the first input audio will be completely +silent. Default is 44100. +

+
+
duration, d
+

Specify the duration of the cross fade effect. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +By default the duration is determined by nb_samples. +If set this option is used instead of nb_samples. +

+
+
overlap, o
+

Should first stream end overlap with second stream start. Default is enabled. +

+
+
curve1
+

Set curve for cross fade transition for first stream. +

+
+
curve2
+

Set curve for cross fade transition for second stream. +

+

For description of available curve types see afade filter description. +

+
+ + +
+

8.4.1 Examples

+ +
    +
  • Cross fade from one input to another: +
    +
    ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
    +
    + +
  • Cross fade from one input to another but without overlapping: +
    +
    ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
    +
    +
+ +
+
+
+

8.5 acrossover

+

Split audio stream into several bands. +

+

This filter splits audio stream into two or more frequency ranges. +Summing all streams back will give flat output. +

+

The filter accepts the following options: +

+
+
split
+

Set split frequencies. Those must be positive and increasing. +

+
+
order
+

Set filter order for each band split. This controls filter roll-off or steepness +of filter transfer function. +Available values are: +

+
+
2nd
+

12 dB per octave. +

+
4th
+

24 dB per octave. +

+
6th
+

36 dB per octave. +

+
8th
+

48 dB per octave. +

+
10th
+

60 dB per octave. +

+
12th
+

72 dB per octave. +

+
14th
+

84 dB per octave. +

+
16th
+

96 dB per octave. +

+
18th
+

108 dB per octave. +

+
20th
+

120 dB per octave. +

+
+ +

Default is 4th. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 1. Default value is 1. +

+
+
gains
+

Set output gain for each band. Default value is 1 for all bands. +

+
+
precision
+

Set which precision to use when processing samples. +

+
+
auto
+

Auto pick internal sample format depending on other filters. +

+
+
float
+

Always use single-floating point precision sample format. +

+
+
double
+

Always use double-floating point precision sample format. +

+
+ +

Default value is auto. +

+
+ + +
+

8.5.1 Examples

+ +
    +
  • Split input audio stream into two bands (low and high) with split frequency of 1500 Hz, +each band will be in separate stream: +
    +
    ffmpeg -i in.flac -filter_complex 'acrossover=split=1500[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
    +
    + +
  • Same as above, but with higher filter order: +
    +
    ffmpeg -i in.flac -filter_complex 'acrossover=split=1500:order=8th[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
    +
    + +
  • Same as above, but also with additional middle band (frequencies between 1500 and 8000): +
    +
    ffmpeg -i in.flac -filter_complex 'acrossover=split=1500 8000:order=8th[LOW][MID][HIGH]' -map '[LOW]' low.wav -map '[MID]' mid.wav -map '[HIGH]' high.wav
    +
    +
+ +
+
+
+

8.6 acrusher

+ +

Reduce audio bit resolution. +

+

This filter is bit crusher with enhanced functionality. A bit crusher +is used to audibly reduce number of bits an audio signal is sampled +with. This doesn’t change the bit depth at all, it just produces the +effect. Material reduced in bit depth sounds more harsh and "digital". +This filter is able to even round to continuous values instead of discrete +bit depths. +Additionally it has a D/C offset which results in different crushing of +the lower and the upper half of the signal. +An Anti-Aliasing setting is able to produce "softer" crushing sounds. +

+

Another feature of this filter is the logarithmic mode. +This setting switches from linear distances between bits to logarithmic ones. +The result is a much more "natural" sounding crusher which doesn’t gate low +signals for example. The human ear has a logarithmic perception, +so this kind of crushing is much more pleasant. +Logarithmic crushing is also able to get anti-aliased. +

+

The filter accepts the following options: +

+
+
level_in
+

Set level in. +

+
+
level_out
+

Set level out. +

+
+
bits
+

Set bit reduction. +

+
+
mix
+

Set mixing amount. +

+
+
mode
+

Can be linear: lin or logarithmic: log. +

+
+
dc
+

Set DC. +

+
+
aa
+

Set anti-aliasing. +

+
+
samples
+

Set sample reduction. +

+
+
lfo
+

Enable LFO. By default disabled. +

+
+
lforange
+

Set LFO range. +

+
+
lforate
+

Set LFO rate. +

+
+ + +
+

8.6.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.7 acue

+ +

Delay audio filtering until a given wallclock timestamp. See the cue +filter. +

+
+
+

8.8 adeclick

+

Remove impulsive noise from input audio. +

+

Samples detected as impulsive noise are replaced by interpolated samples using +autoregressive modelling. +

+
+
window, w
+

Set window size, in milliseconds. Allowed range is from 10 to +100. Default value is 55 milliseconds. +This sets size of window which will be processed at once. +

+
+
overlap, o
+

Set window overlap, in percentage of window size. Allowed range is from +50 to 95. Default value is 75 percent. +Setting this to a very high value increases impulsive noise removal but makes +whole process much slower. +

+
+
arorder, a
+

Set autoregression order, in percentage of window size. Allowed range is from +0 to 25. Default value is 2 percent. This option also +controls quality of interpolated samples using neighbour good samples. +

+
+
threshold, t
+

Set threshold value. Allowed range is from 1 to 100. +Default value is 2. +This controls the strength of impulsive noise which is going to be removed. +The lower value, the more samples will be detected as impulsive noise. +

+
+
burst, b
+

Set burst fusion, in percentage of window size. Allowed range is 0 to +10. Default value is 2. +If any two samples detected as noise are spaced less than this value then any +sample between those two samples will be also detected as noise. +

+
+
method, m
+

Set overlap method. +

+

It accepts the following values: +

+
add, a
+

Select overlap-add method. Even not interpolated samples are slightly +changed with this method. +

+
+
save, s
+

Select overlap-save method. Not interpolated samples remain unchanged. +

+
+ +

Default value is a. +

+
+ +
+
+

8.9 adeclip

+

Remove clipped samples from input audio. +

+

Samples detected as clipped are replaced by interpolated samples using +autoregressive modelling. +

+
+
window, w
+

Set window size, in milliseconds. Allowed range is from 10 to 100. +Default value is 55 milliseconds. +This sets size of window which will be processed at once. +

+
+
overlap, o
+

Set window overlap, in percentage of window size. Allowed range is from 50 +to 95. Default value is 75 percent. +

+
+
arorder, a
+

Set autoregression order, in percentage of window size. Allowed range is from +0 to 25. Default value is 8 percent. This option also controls +quality of interpolated samples using neighbour good samples. +

+
+
threshold, t
+

Set threshold value. Allowed range is from 1 to 100. +Default value is 10. Higher values make clip detection less aggressive. +

+
+
hsize, n
+

Set size of histogram used to detect clips. Allowed range is from 100 to 9999. +Default value is 1000. Higher values make clip detection less aggressive. +

+
+
method, m
+

Set overlap method. +

+

It accepts the following values: +

+
add, a
+

Select overlap-add method. Even not interpolated samples are slightly changed +with this method. +

+
+
save, s
+

Select overlap-save method. Not interpolated samples remain unchanged. +

+
+ +

Default value is a. +

+
+ +
+
+

8.10 adecorrelate

+

Apply decorrelation to input audio stream. +

+

The filter accepts the following options: +

+
+
stages
+

Set decorrelation stages of filtering. Allowed +range is from 1 to 16. Default value is 6. +

+
+
seed
+

Set random seed used for setting delay in samples across channels. +

+
+ +
+
+

8.11 adelay

+ +

Delay one or more audio channels. +

+

Samples in delayed channel are filled with silence. +

+

The filter accepts the following option: +

+
+
delays
+

Set list of delays in milliseconds for each channel separated by ’|’. +Unused delays will be silently ignored. If number of given delays is +smaller than number of channels all remaining channels will not be delayed. +If you want to delay exact number of samples, append ’S’ to number. +If you want instead to delay in seconds, append ’s’ to number. +

+
+
all
+

Use last set delay for all remaining channels. By default is disabled. +This option if enabled changes how option delays is interpreted. +

+
+ + +
+

8.11.1 Examples

+ +
    +
  • Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave +the second channel (and any other channels that may be present) unchanged. +
    +
    adelay=1500|0|500
    +
    + +
  • Delay second channel by 500 samples, the third channel by 700 samples and leave +the first channel (and any other channels that may be present) unchanged. +
    +
    adelay=0|500S|700S
    +
    + +
  • Delay all channels by same number of samples: +
    +
    adelay=delays=64S:all=1
    +
    +
+ +
+
+
+

8.12 adenorm

+

Remedy denormals in audio by adding extremely low-level noise. +

+

This filter shall be placed before any filter that can produce denormals. +

+

A description of the accepted parameters follows. +

+
+
level
+

Set level of added noise in dB. Default is -351. +Allowed range is from -451 to -90. +

+
+
type
+

Set type of added noise. +

+
+
dc
+

Add DC signal. +

+
ac
+

Add AC signal. +

+
square
+

Add square signal. +

+
pulse
+

Add pulse signal. +

+
+ +

Default is dc. +

+
+ + +
+

8.12.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.13 aderivative, aintegral

+ +

Compute derivative/integral of audio stream. +

+

Applying both filters one after another produces original audio. +

+
+
+

8.14 adrc

+ +

Apply spectral dynamic range controller filter to input audio stream. +

+

A description of the accepted options follows. +

+
+
transfer
+

Set the transfer expression. +

+

The expression can contain the following constants: +

+
+
ch
+

current channel number +

+
+
sn
+

current sample number +

+
+
nb_channels
+

number of channels +

+
+
t
+

timestamp expressed in seconds +

+
+
sr
+

sample rate +

+
+
p
+

current frequency power value, in dB +

+
+
f
+

current frequency in Hz +

+
+ +

Default value is p. +

+
+
attack
+

Set the attack in milliseconds. Default is 50 milliseconds. +Allowed range is from 1 to 1000 milliseconds. +

+
release
+

Set the release in milliseconds. Default is 100 milliseconds. +Allowed range is from 5 to 2000 milliseconds. +

+
channels
+

Set which channels to filter, by default all channels in audio stream are filtered. +

+
+ + +
+

8.14.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

8.14.2 Examples

+ +
    +
  • Apply spectral compression to all frequencies with threshold of -50 dB and 1:6 ratio: +
    +
    adrc=transfer='if(gt(p,-50),-50+(p-(-50))/6,p)':attack=50:release=100
    +
    + +
  • Similar to above but with 1:2 ratio and filtering only front center channel: +
    +
    adrc=transfer='if(gt(p,-50),-50+(p-(-50))/2,p)':attack=50:release=100:channels=FC
    +
    + +
  • Apply spectral noise gate to all frequencies with threshold of -85 dB and with short attack time and short release time: +
    +
    adrc=transfer='if(lte(p,-85),p-800,p)':attack=1:release=5
    +
    + +
  • Apply spectral expansion to all frequencies with threshold of -10 dB and 1:2 ratio: +
    +
    adrc=transfer='if(lt(p,-10),-10+(p-(-10))*2,p)':attack=50:release=100
    +
    + +
  • Apply limiter to max -60 dB to all frequencies, with attack of 2 ms and release of 10 ms: +
    +
    adrc=transfer='min(p,-60)':attack=2:release=10
    +
    +
+ +
+
+
+

8.15 adynamicequalizer

+ +

Apply dynamic equalization to input audio stream. +

+

A description of the accepted options follows. +

+
+
threshold
+

Set the detection threshold used to trigger equalization. +Threshold detection is using detection filter. +Default value is 0. Allowed range is from 0 to 100. +

+
+
dfrequency
+

Set the detection frequency in Hz used for detection filter used to trigger equalization. +Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz. +

+
+
dqfactor
+

Set the detection resonance factor for detection filter used to trigger equalization. +Default value is 1. Allowed range is from 0.001 to 1000. +

+
+
tfrequency
+

Set the target frequency of equalization filter. +Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz. +

+
+
tqfactor
+

Set the target resonance factor for target equalization filter. +Default value is 1. Allowed range is from 0.001 to 1000. +

+
+
attack
+

Set the amount of milliseconds the signal from detection has to rise above +the detection threshold before equalization starts. +Default is 20. Allowed range is between 1 and 2000. +

+
+
release
+

Set the amount of milliseconds the signal from detection has to fall below the +detection threshold before equalization ends. +Default is 200. Allowed range is between 1 and 2000. +

+
+
ratio
+

Set the ratio by which the equalization gain is raised. +Default is 1. Allowed range is between 0 and 30. +

+
+
makeup
+

Set the makeup offset by which the equalization gain is raised. +Default is 0. Allowed range is between 0 and 100. +

+
+
range
+

Set the max allowed cut/boost amount. Default is 50. +Allowed range is from 1 to 200. +

+
+
mode
+

Set the mode of filter operation, can be one of the following: +

+
+
listen
+

Output only isolated detection signal. +

+
cut
+

Cut frequencies above detection threshold. +

+
boost
+

Boost frequencies bellow detection threshold. +

+
+

Default mode is ‘cut’. +

+
+
dftype
+

Set the type of detection filter, can be one of the following: +

+
+
bandpass
+
lowpass
+
highpass
+
peak
+
+

Default type is ‘bandpass’. +

+
+
tftype
+

Set the type of target filter, can be one of the following: +

+
+
bell
+
lowshelf
+
highshelf
+
+

Default type is ‘bell’. +

+
+
direction
+

Set processing direction relative to threshold. +

+
downward
+

Boost/Cut if threshold is higher/lower than detected volume. +

+
upward
+

Boost/Cut if threshold is lower/higher than detected volume. +

+
+

Default direction is ‘downward’. +

+
+
auto
+

Automatically gather threshold from detection filter. By default +is ‘disabled’. +This option is useful to detect threshold in certain time frame of +input audio stream, in such case option value is changed at runtime. +

+

Available values are: +

+
disabled
+

Disable using automatically gathered threshold value. +

+
off
+

Stop picking threshold value. +

+
on
+

Start picking threshold value. +

+
+ +
+
precision
+

Set which precision to use when processing samples. +

+
+
auto
+

Auto pick internal sample format depending on other filters. +

+
+
float
+

Always use single-floating point precision sample format. +

+
+
double
+

Always use double-floating point precision sample format. +

+
+
+
+ + +
+

8.15.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.16 adynamicsmooth

+ +

Apply dynamic smoothing to input audio stream. +

+

A description of the accepted options follows. +

+
+
sensitivity
+

Set an amount of sensitivity to frequency fluctations. Default is 2. +Allowed range is from 0 to 1e+06. +

+
+
basefreq
+

Set a base frequency for smoothing. Default value is 22050. +Allowed range is from 2 to 1e+06. +

+
+ + +
+

8.16.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.17 aecho

+ +

Apply echoing to the input audio. +

+

Echoes are reflected sound and can occur naturally amongst mountains +(and sometimes large buildings) when talking or shouting; digital echo +effects emulate this behaviour and are often used to help fill out the +sound of a single instrument or vocal. The time difference between the +original signal and the reflection is the delay, and the +loudness of the reflected signal is the decay. +Multiple echoes can have different delays and decays. +

+

A description of the accepted parameters follows. +

+
+
in_gain
+

Set input gain of reflected signal. Default is 0.6. +

+
+
out_gain
+

Set output gain of reflected signal. Default is 0.3. +

+
+
delays
+

Set list of time intervals in milliseconds between original signal and reflections +separated by ’|’. Allowed range for each delay is (0 - 90000.0]. +Default is 1000. +

+
+
decays
+

Set list of loudness of reflected signals separated by ’|’. +Allowed range for each decay is (0 - 1.0]. +Default is 0.5. +

+
+ + +
+

8.17.1 Examples

+ +
    +
  • Make it sound as if there are twice as many instruments as are actually playing: +
    +
    aecho=0.8:0.88:60:0.4
    +
    + +
  • If delay is very short, then it sounds like a (metallic) robot playing music: +
    +
    aecho=0.8:0.88:6:0.4
    +
    + +
  • A longer delay will sound like an open air concert in the mountains: +
    +
    aecho=0.8:0.9:1000:0.3
    +
    + +
  • Same as above but with one more mountain: +
    +
    aecho=0.8:0.9:1000|1800:0.3|0.25
    +
    +
+ +
+
+
+

8.18 aemphasis

+

Audio emphasis filter creates or restores material directly taken from LPs or +emphased CDs with different filter curves. E.g. to store music on vinyl the +signal has to be altered by a filter first to even out the disadvantages of +this recording medium. +Once the material is played back the inverse filter has to be applied to +restore the distortion of the frequency response. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. +

+
+
level_out
+

Set output gain. +

+
+
mode
+

Set filter mode. For restoring material use reproduction mode, otherwise +use production mode. Default is reproduction mode. +

+
+
type
+

Set filter type. Selects medium. Can be one of the following: +

+
+
col
+

select Columbia. +

+
emi
+

select EMI. +

+
bsi
+

select BSI (78RPM). +

+
riaa
+

select RIAA. +

+
cd
+

select Compact Disc (CD). +

+
50fm
+

select 50µs (FM). +

+
75fm
+

select 75µs (FM). +

+
50kf
+

select 50µs (FM-KF). +

+
75kf
+

select 75µs (FM-KF). +

+
+
+
+ + +
+

8.18.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.19 aeval

+ +

Modify an audio signal according to the specified expressions. +

+

This filter accepts one or more expressions (one for each channel), +which are evaluated and used to modify a corresponding audio signal. +

+

It accepts the following parameters: +

+
+
exprs
+

Set the ’|’-separated expressions list for each separate channel. If +the number of input channels is greater than the number of +expressions, the last specified expression is used for the remaining +output channels. +

+
+
channel_layout, c
+

Set output channel layout. If not specified, the channel layout is +specified by the number of expressions. If set to ‘same’, it will +use by default the same input channel layout. +

+
+ +

Each expression in exprs can contain the following constants and functions: +

+
+
ch
+

channel number of the current expression +

+
+
n
+

number of the evaluated sample, starting from 0 +

+
+
s
+

sample rate +

+
+
t
+

time of the evaluated sample expressed in seconds +

+
+
nb_in_channels
+
nb_out_channels
+

input and output number of channels +

+
+
val(CH)
+

the value of input channel with number CH +

+
+ +

Note: this filter is slow. For faster processing you should use a +dedicated filter. +

+ +
+

8.19.1 Examples

+ +
    +
  • Half volume: +
    +
    aeval=val(ch)/2:c=same
    +
    + +
  • Invert phase of the second channel: +
    +
    aeval=val(0)|-val(1)
    +
    +
+ +
+
+
+

8.20 aexciter

+ +

An exciter is used to produce high sound that is not present in the +original signal. This is done by creating harmonic distortions of the +signal which are restricted in range and added to the original signal. +An Exciter raises the upper end of an audio signal without simply raising +the higher frequencies like an equalizer would do to create a more +"crisp" or "brilliant" sound. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level prior processing of signal. +Allowed range is from 0 to 64. +Default value is 1. +

+
+
level_out
+

Set output level after processing of signal. +Allowed range is from 0 to 64. +Default value is 1. +

+
+
amount
+

Set the amount of harmonics added to original signal. +Allowed range is from 0 to 64. +Default value is 1. +

+
+
drive
+

Set the amount of newly created harmonics. +Allowed range is from 0.1 to 10. +Default value is 8.5. +

+
+
blend
+

Set the octave of newly created harmonics. +Allowed range is from -10 to 10. +Default value is 0. +

+
+
freq
+

Set the lower frequency limit of producing harmonics in Hz. +Allowed range is from 2000 to 12000 Hz. +Default is 7500 Hz. +

+
+
ceil
+

Set the upper frequency limit of producing harmonics. +Allowed range is from 9999 to 20000 Hz. +If value is lower than 10000 Hz no limit is applied. +

+
+
listen
+

Mute the original signal and output only added harmonics. +By default is disabled. +

+
+ + +
+

8.20.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.21 afade

+ +

Apply fade-in/out effect to input audio. +

+

A description of the accepted parameters follows. +

+
+
type, t
+

Specify the effect type, can be either in for fade-in, or +out for a fade-out effect. Default is in. +

+
+
start_sample, ss
+

Specify the number of the start sample for starting to apply the fade +effect. Default is 0. +

+
+
nb_samples, ns
+

Specify the number of samples for which the fade effect has to last. At +the end of the fade-in effect the output audio will have the same +volume as the input audio, at the end of the fade-out transition +the output audio will be silence. Default is 44100. +

+
+
start_time, st
+

Specify the start time of the fade effect. Default is 0. +The value must be specified as a time duration; see +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +If set this option is used instead of start_sample. +

+
+
duration, d
+

Specify the duration of the fade effect. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +At the end of the fade-in effect the output audio will have the same +volume as the input audio, at the end of the fade-out transition +the output audio will be silence. +By default the duration is determined by nb_samples. +If set this option is used instead of nb_samples. +

+
+
curve
+

Set curve for fade transition. +

+

It accepts the following values: +

+
tri
+

select triangular, linear slope (default) +

+
qsin
+

select quarter of sine wave +

+
hsin
+

select half of sine wave +

+
esin
+

select exponential sine wave +

+
log
+

select logarithmic +

+
ipar
+

select inverted parabola +

+
qua
+

select quadratic +

+
cub
+

select cubic +

+
squ
+

select square root +

+
cbr
+

select cubic root +

+
par
+

select parabola +

+
exp
+

select exponential +

+
iqsin
+

select inverted quarter of sine wave +

+
ihsin
+

select inverted half of sine wave +

+
dese
+

select double-exponential seat +

+
desi
+

select double-exponential sigmoid +

+
losi
+

select logistic sigmoid +

+
sinc
+

select sine cardinal function +

+
isinc
+

select inverted sine cardinal function +

+
nofade
+

no fade applied +

+
+ +
+
silence
+

Set the initial gain for fade-in or final gain for fade-out. +Default value is 0.0. +

+
+
unity
+

Set the initial gain for fade-out or final gain for fade-in. +Default value is 1.0. +

+
+ + +
+

8.21.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

8.21.2 Examples

+ +
    +
  • Fade in first 15 seconds of audio: +
    +
    afade=t=in:ss=0:d=15
    +
    + +
  • Fade out last 25 seconds of a 900 seconds audio: +
    +
    afade=t=out:st=875:d=25
    +
    +
+ +
+
+
+

8.22 afftdn

+

Denoise audio samples with FFT. +

+

A description of the accepted parameters follows. +

+
+
noise_reduction, nr
+

Set the noise reduction in dB, allowed range is 0.01 to 97. +Default value is 12 dB. +

+
+
noise_floor, nf
+

Set the noise floor in dB, allowed range is -80 to -20. +Default value is -50 dB. +

+
+
noise_type, nt
+

Set the noise type. +

+

It accepts the following values: +

+
white, w
+

Select white noise. +

+
+
vinyl, v
+

Select vinyl noise. +

+
+
shellac, s
+

Select shellac noise. +

+
+
custom, c
+

Select custom noise, defined in bn option. +

+

Default value is white noise. +

+
+ +
+
band_noise, bn
+

Set custom band noise profile for every one of 15 bands. +Bands are separated by ’ ’ or ’|’. +

+
+
residual_floor, rf
+

Set the residual floor in dB, allowed range is -80 to -20. +Default value is -38 dB. +

+
+
track_noise, tn
+

Enable noise floor tracking. By default is disabled. +With this enabled, noise floor is automatically adjusted. +

+
+
track_residual, tr
+

Enable residual tracking. By default is disabled. +

+
+
output_mode, om
+

Set the output mode. +

+

It accepts the following values: +

+
input, i
+

Pass input unchanged. +

+
+
output, o
+

Pass noise filtered out. +

+
+
noise, n
+

Pass only noise. +

+

Default value is output. +

+
+ +
+
adaptivity, ad
+

Set the adaptivity factor, used how fast to adapt gains adjustments per +each frequency bin. Value 0 enables instant adaptation, while higher values +react much slower. +Allowed range is from 0 to 1. Default value is 0.5. +

+
+
floor_offset, fo
+

Set the noise floor offset factor. This option is used to adjust offset applied to measured +noise floor. It is only effective when noise floor tracking is enabled. +Allowed range is from -2.0 to 2.0. Default value is 1.0. +

+
+
noise_link, nl
+

Set the noise link used for multichannel audio. +

+

It accepts the following values: +

+
none
+

Use unchanged channel’s noise floor. +

+
+
min
+

Use measured min noise floor of all channels. +

+
+
max
+

Use measured max noise floor of all channels. +

+
+
average
+

Use measured average noise floor of all channels. +

+

Default value is min. +

+
+ +
+
band_multiplier, bm
+

Set the band multiplier factor, used how much to spread bands across frequency bins. +Allowed range is from 0.2 to 5. Default value is 1.25. +

+
+
sample_noise, sn
+

Toggle capturing and measurement of noise profile from input audio. +

+

It accepts the following values: +

+
start, begin
+

Start sample noise capture. +

+
+
stop, end
+

Stop sample noise capture and measure new noise band profile. +

+

Default value is none. +

+
+ +
+
gain_smooth, gs
+

Set gain smooth spatial radius, used to smooth gains applied to each frequency bin. +Useful to reduce random music noise artefacts. +Higher values increases smoothing of gains. +Allowed range is from 0 to 50. +Default value is 0. +

+
+ + +
+

8.22.1 Commands

+ +

This filter supports the some above mentioned options as commands. +

+
+
+

8.22.2 Examples

+ +
    +
  • Reduce white noise by 10dB, and use previously measured noise floor of -40dB: +
    +
    afftdn=nr=10:nf=-40
    +
    + +
  • Reduce white noise by 10dB, also set initial noise floor to -80dB and enable automatic +tracking of noise floor so noise floor will gradually change during processing: +
    +
    afftdn=nr=10:nf=-80:tn=1
    +
    + +
  • Reduce noise by 20dB, using noise floor of -40dB and using commands to take noise profile +of first 0.4 seconds of input audio: +
    +
    asendcmd=0.0 afftdn sn start,asendcmd=0.4 afftdn sn stop,afftdn=nr=20:nf=-40
    +
    +
+ +
+
+
+

8.23 afftfilt

+

Apply arbitrary expressions to samples in frequency domain. +

+
+
real
+

Set frequency domain real expression for each separate channel separated +by ’|’. Default is "re". +If the number of input channels is greater than the number of +expressions, the last specified expression is used for the remaining +output channels. +

+
+
imag
+

Set frequency domain imaginary expression for each separate channel +separated by ’|’. Default is "im". +

+

Each expression in real and imag can contain the following +constants and functions: +

+
+
sr
+

sample rate +

+
+
b
+

current frequency bin number +

+
+
nb
+

number of available bins +

+
+
ch
+

channel number of the current expression +

+
+
chs
+

number of channels +

+
+
pts
+

current frame pts +

+
+
re
+

current real part of frequency bin of current channel +

+
+
im
+

current imaginary part of frequency bin of current channel +

+
+
real(b, ch)
+

Return the value of real part of frequency bin at location (bin,channel) +

+
+
imag(b, ch)
+

Return the value of imaginary part of frequency bin at location (bin,channel) +

+
+ +
+
win_size
+

Set window size. Allowed range is from 16 to 131072. +Default is 4096 +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann, hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hann. +

+
+
overlap
+

Set window overlap. If set to 1, the recommended overlap for selected +window function will be picked. Default is 0.75. +

+
+ + +
+

8.23.1 Examples

+ +
    +
  • Leave almost only low frequencies in audio: +
    +
    afftfilt="'real=re * (1-clip((b/nb)*b,0,1))':imag='im * (1-clip((b/nb)*b,0,1))'"
    +
    + +
  • Apply robotize effect: +
    +
    afftfilt="real='hypot(re,im)*sin(0)':imag='hypot(re,im)*cos(0)':win_size=512:overlap=0.75"
    +
    + +
  • Apply whisper effect: +
    +
    afftfilt="real='hypot(re,im)*cos((random(0)*2-1)*2*3.14)':imag='hypot(re,im)*sin((random(1)*2-1)*2*3.14)':win_size=128:overlap=0.8"
    +
    + +
  • Apply phase shift: +
    +
    afftfilt="real=re*cos(1)-im*sin(1):imag=re*sin(1)+im*cos(1)"
    +
    +
+ +
+
+
+

8.24 afir

+ +

Apply an arbitrary Finite Impulse Response filter. +

+

This filter is designed for applying long FIR filters, +up to 60 seconds long. +

+

It can be used as component for digital crossover filters, +room equalization, cross talk cancellation, wavefield synthesis, +auralization, ambiophonics, ambisonics and spatialization. +

+

This filter uses the streams higher than first one as FIR coefficients. +If the non-first stream holds a single channel, it will be used +for all input channels in the first stream, otherwise +the number of channels in the non-first stream must be same as +the number of channels in the first stream. +

+

It accepts the following parameters: +

+
+
dry
+

Set dry gain. This sets input gain. +

+
+
wet
+

Set wet gain. This sets final output gain. +

+
+
length
+

Set Impulse Response filter length. Default is 1, which means whole IR is processed. +

+
+
gtype
+

Enable applying gain measured from power of IR. +

+

Set which approach to use for auto gain measurement. +

+
+
none
+

Do not apply any gain. +

+
+
peak
+

select peak gain, very conservative approach. This is default value. +

+
+
dc
+

select DC gain, limited application. +

+
+
gn
+

select gain to noise approach, this is most popular one. +

+
+
ac
+

select AC gain. +

+
+
rms
+

select RMS gain. +

+
+ +
+
irgain
+

Set gain to be applied to IR coefficients before filtering. +Allowed range is 0 to 1. This gain is applied after any gain applied with gtype option. +

+
+
irfmt
+

Set format of IR stream. Can be mono or input. +Default is input. +

+
+
maxir
+

Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds. +Allowed range is 0.1 to 60 seconds. +

+
+
response
+

Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream. +By default it is disabled. +

+
+
channel
+

Set for which IR channel to display frequency response. By default is first channel +displayed. This option is used only when response is enabled. +

+
+
size
+

Set video stream size. This option is used only when response is enabled. +

+
+
rate
+

Set video stream frame rate. This option is used only when response is enabled. +

+
+
minp
+

Set minimal partition size used for convolution. Default is 8192. +Allowed range is from 1 to 65536. +Lower values decreases latency at cost of higher CPU usage. +

+
+
maxp
+

Set maximal partition size used for convolution. Default is 8192. +Allowed range is from 8 to 65536. +Lower values may increase CPU usage. +

+
+
nbirs
+

Set number of input impulse responses streams which will be switchable at runtime. +Allowed range is from 1 to 32. Default is 1. +

+
+
ir
+

Set IR stream which will be used for convolution, starting from 0, should always be +lower than supplied value by nbirs option. Default is 0. +This option can be changed at runtime via commands. +

+
+
precision
+

Set which precision to use when processing samples. +

+
+
auto
+

Auto pick internal sample format depending on other filters. +

+
+
float
+

Always use single-floating point precision sample format. +

+
+
double
+

Always use double-floating point precision sample format. +

+
+ +

Default value is auto. +

+
+
irload
+

Set when to load IR stream. Can be init or access. +First one load and prepares all IRs on initialization, second one +once on first access of specific IR. +Default is init. +

+
+ + +
+

8.24.1 Examples

+ +
    +
  • Apply reverb to stream using mono IR file as second input, complete command using ffmpeg: +
    +
    ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
    +
    + +
  • Apply true stereo processing given input stereo stream, and two stereo impulse responses for left and right channel, +the impulse response files are files with names l_ir.wav and r_ir.wav: +
    +
    "pan=4C|c0=FL|c1=FL|c2=FR|c3=FR[a];amovie=l_ir.wav[LIR];amovie=r_ir.wav[RIR];[LIR][RIR]amerge[ir];[a][ir]afir=irfmt=input:gtype=gn:irgain=-5dB,pan=stereo|FL<c0+c2|FR<c1+c3"
    +
    +
+ +
+
+
+

8.25 aformat

+ +

Set output format constraints for the input audio. The framework will +negotiate the most appropriate format to minimize conversions. +

+

It accepts the following parameters: +

+
sample_fmts, f
+

A ’|’-separated list of requested sample formats. +

+
+
sample_rates, r
+

A ’|’-separated list of requested sample rates. +

+
+
channel_layouts, cl
+

A ’|’-separated list of requested channel layouts. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+ +

If a parameter is omitted, all values are allowed. +

+

Force the output to either unsigned 8-bit or signed 16-bit stereo +

+
aformat=sample_fmts=u8|s16:channel_layouts=stereo
+
+ +
+
+

8.26 afreqshift

+

Apply frequency shift to input audio samples. +

+

The filter accepts the following options: +

+
+
shift
+

Specify frequency shift. Allowed range is -INT_MAX to INT_MAX. +Default value is 0.0. +

+
+
level
+

Set output gain applied to final output. Allowed range is from 0.0 to 1.0. +Default value is 1.0. +

+
+
order
+

Set filter order used for filtering. Allowed range is from 1 to 16. +Default value is 8. +

+
+ + +
+

8.26.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.27 afwtdn

+

Reduce broadband noise from input samples using Wavelets. +

+

A description of the accepted options follows. +

+
+
sigma
+

Set the noise sigma, allowed range is from 0 to 1. +Default value is 0. +This option controls strength of denoising applied to input samples. +Most useful way to set this option is via decibels, eg. -45dB. +

+
+
levels
+

Set the number of wavelet levels of decomposition. +Allowed range is from 1 to 12. +Default value is 10. +Setting this too low make denoising performance very poor. +

+
+
wavet
+

Set wavelet type for decomposition of input frame. +They are sorted by number of coefficients, from lowest to highest. +More coefficients means worse filtering speed, but overall better quality. +Available wavelets are: +

+
+
sym2
+
sym4
+
rbior68
+
deb10
+
sym10
+
coif5
+
bl3
+
+ +
+
percent
+

Set percent of full denoising. Allowed range is from 0 to 100 percent. +Default value is 85 percent or partial denoising. +

+
+
profile
+

If enabled, first input frame will be used as noise profile. +If first frame samples contain non-noise performance will be very poor. +

+
+
adaptive
+

If enabled, input frames are analyzed for presence of noise. +If noise is detected with high possibility then input frame profile will be +used for processing following frames, until new noise frame is detected. +

+
+
samples
+

Set size of single frame in number of samples. Allowed range is from 512 to +65536. Default frame size is 8192 samples. +

+
+
softness
+

Set softness applied inside thresholding function. Allowed range is from 0 to +10. Default softness is 1. +

+
+ + +
+

8.27.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.28 agate

+ +

A gate is mainly used to reduce lower parts of a signal. This kind of signal +processing reduces disturbing noise between useful signals. +

+

Gating is done by detecting the volume below a chosen level threshold +and dividing it by the factor set with ratio. The bottom of the noise +floor is set via range. Because an exact manipulation of the signal +would cause distortion of the waveform the reduction can be levelled over +time. This is done by setting attack and release. +

+

attack determines how long the signal has to fall below the threshold +before any reduction will occur and release sets the time the signal +has to rise above the threshold to reduce the reduction again. +Shorter signals than the chosen attack time will be left untouched. +

+
+
level_in
+

Set input level before filtering. +Default is 1. Allowed range is from 0.015625 to 64. +

+
+
mode
+

Set the mode of operation. Can be upward or downward. +Default is downward. If set to upward mode, higher parts of signal +will be amplified, expanding dynamic range in upward direction. +Otherwise, in case of downward lower parts of signal will be reduced. +

+
+
range
+

Set the level of gain reduction when the signal is below the threshold. +Default is 0.06125. Allowed range is from 0 to 1. +Setting this to 0 disables reduction and then filter behaves like expander. +

+
+
threshold
+

If a signal rises above this level the gain reduction is released. +Default is 0.125. Allowed range is from 0 to 1. +

+
+
ratio
+

Set a ratio by which the signal is reduced. +Default is 2. Allowed range is from 1 to 9000. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction stops. +Default is 20 milliseconds. Allowed range is from 0.01 to 9000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before the +reduction is increased again. Default is 250 milliseconds. +Allowed range is from 0.01 to 9000. +

+
+
makeup
+

Set amount of amplification of signal after processing. +Default is 1. Allowed range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.828427125. Allowed range is from 1 to 8. +

+
+
detection
+

Choose if exact signal should be taken for detection or an RMS like one. +Default is rms. Can be peak or rms. +

+
+
link
+

Choose if the average level between all channels or the louder channel affects +the reduction. +Default is average. Can be average or maximum. +

+
+ + +
+

8.28.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.29 aiir

+ +

Apply an arbitrary Infinite Impulse Response filter. +

+

It accepts the following parameters: +

+
+
zeros, z
+

Set B/numerator/zeros/reflection coefficients. +

+
+
poles, p
+

Set A/denominator/poles/ladder coefficients. +

+
+
gains, k
+

Set channels gains. +

+
+
dry_gain
+

Set input gain. +

+
+
wet_gain
+

Set output gain. +

+
+
format, f
+

Set coefficients format. +

+
+
ll
+

lattice-ladder function +

+
sf
+

analog transfer function +

+
tf
+

digital transfer function +

+
zp
+

Z-plane zeros/poles, cartesian (default) +

+
pr
+

Z-plane zeros/poles, polar radians +

+
pd
+

Z-plane zeros/poles, polar degrees +

+
sp
+

S-plane zeros/poles +

+
+ +
+
process, r
+

Set type of processing. +

+
+
d
+

direct processing +

+
s
+

serial processing +

+
p
+

parallel processing +

+
+ +
+
precision, e
+

Set filtering precision. +

+
+
dbl
+

double-precision floating-point (default) +

+
flt
+

single-precision floating-point +

+
i32
+

32-bit integers +

+
i16
+

16-bit integers +

+
+ +
+
normalize, n
+

Normalize filter coefficients, by default is enabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
mix
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
response
+

Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream. +By default it is disabled. +

+
+
channel
+

Set for which IR channel to display frequency response. By default is first channel +displayed. This option is used only when response is enabled. +

+
+
size
+

Set video stream size. This option is used only when response is enabled. +

+
+ +

Coefficients in tf and sf format are separated by spaces and are in ascending +order. +

+

Coefficients in zp format are separated by spaces and order of coefficients +doesn’t matter. Coefficients in zp format are complex numbers with i +imaginary unit. +

+

Different coefficients and gains can be provided for every channel, in such case +use ’|’ to separate coefficients or gains. Last provided coefficients will be +used for all remaining channels. +

+ +
+

8.29.1 Examples

+ +
    +
  • Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate: +
    +
    aiir=k=1:z=7.957584807809675810E-1 -2.575128568908332300 3.674839853930788710 -2.57512875289799137 7.957586296317130880E-1:p=1 -2.86950072432325953 3.63022088054647218 -2.28075678147272232 6.361362326477423500E-1:f=tf:r=d
    +
    + +
  • Same as above but in zp format: +
    +
    aiir=k=0.79575848078096756:z=0.80918701+0.58773007i 0.80918701-0.58773007i 0.80884700+0.58784055i 0.80884700-0.58784055i:p=0.63892345+0.59951235i 0.63892345-0.59951235i 0.79582691+0.44198673i 0.79582691-0.44198673i:f=zp:r=s
    +
    + +
  • Apply 3-rd order analog normalized Butterworth low-pass filter, using analog transfer function format: +
    +
    aiir=z=1.3057 0 0 0:p=1.3057 2.3892 2.1860 1:f=sf:r=d
    +
    +
+ +
+
+
+

8.30 alimiter

+ +

The limiter prevents an input signal from rising over a desired threshold. +This limiter uses lookahead technology to prevent your signal from distorting. +It means that there is a small delay after the signal is processed. Keep in mind +that the delay it produces is the attack time you set. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. Default is 1. +

+
+
level_out
+

Set output gain. Default is 1. +

+
+
limit
+

Don’t let signals above this level pass the limiter. Default is 1. +

+
+
attack
+

The limiter will reach its attenuation level in this amount of time in +milliseconds. Default is 5 milliseconds. +

+
+
release
+

Come back from limiting to attenuation 1.0 in this amount of milliseconds. +Default is 50 milliseconds. +

+
+
asc
+

When gain reduction is always needed ASC takes care of releasing to an +average reduction level rather than reaching a reduction of 0 in the release +time. +

+
+
asc_level
+

Select how much the release time is affected by ASC, 0 means nearly no changes +in release time while 1 produces higher release times. +

+
+
level
+

Auto level output signal. Default is enabled. +This normalizes audio back to 0dB if enabled. +

+
+
latency
+

Compensate the delay introduced by using the lookahead buffer set with attack +parameter. Also flush the valid audio data in the lookahead buffer when the +stream hits EOF. +

+
+ +

Depending on picked setting it is recommended to upsample input 2x or 4x times +with aresample before applying this filter. +

+
+
+

8.31 allpass

+ +

Apply a two-pole all-pass filter with central frequency (in Hz) +frequency, and filter-width width. +An all-pass filter changes the audio’s frequency to phase relationship +without changing its frequency to amplitude relationship. +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set frequency in Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
order, o
+

Set the filter order, can be 1 or 2. Default is 2. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+
+
+ + +
+

8.31.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change allpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change allpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change allpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change allpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

8.32 aloop

+ +

Loop audio samples. +

+

The filter accepts the following options: +

+
+
loop
+

Set the number of loops. Setting this value to -1 will result in infinite loops. +Default is 0. +

+
+
size
+

Set maximal number of samples. Default is 0. +

+
+
start
+

Set first sample of loop. Default is 0. +

+
+
time
+

Set the time of loop start in seconds. +Only used if option named start is set to -1. +

+
+ +
+
+

8.33 amerge

+ +

Merge two or more audio streams into a single multi-channel stream. +

+

The filter accepts the following options: +

+
+
inputs
+

Set the number of inputs. Default is 2. +

+
+
+ +

If the channel layouts of the inputs are disjoint, and therefore compatible, +the channel layout of the output will be set accordingly and the channels +will be reordered as necessary. If the channel layouts of the inputs are not +disjoint, the output will have all the channels of the first input then all +the channels of the second input, in that order, and the channel layout of +the output will be the default value corresponding to the total number of +channels. +

+

For example, if the first input is in 2.1 (FL+FR+LF) and the second input +is FC+BL+BR, then the output will be in 5.1, with the channels in the +following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the +first input, b1 is the first channel of the second input). +

+

On the other hand, if both input are in stereo, the output channels will be +in the default order: a1, a2, b1, b2, and the channel layout will be +arbitrarily set to 4.0, which may or may not be the expected value. +

+

All inputs must have the same sample rate, and format. +

+

If inputs do not have the same duration, the output will stop with the +shortest. +

+ +
+

8.33.1 Examples

+ +
    +
  • Merge two mono files into a stereo stream: +
    +
    amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
    +
    + +
  • Multiple merges assuming 1 video stream and 6 audio streams in input.mkv: +
    +
    ffmpeg -i input.mkv -filter_complex "[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6" -c:a pcm_s16le output.mkv
    +
    +
+ +
+
+
+

8.34 amix

+ +

Mixes multiple audio inputs into a single output. +

+

Note that this filter only supports float samples (the amerge +and pan audio filters support many formats). If the amix +input has integer samples then aresample will be automatically +inserted to perform the conversion to float samples. +

+

It accepts the following parameters: +

+
inputs
+

The number of inputs. If unspecified, it defaults to 2. +

+
+
duration
+

How to determine the end-of-stream. +

+
longest
+

The duration of the longest input. (default) +

+
+
shortest
+

The duration of the shortest input. +

+
+
first
+

The duration of the first input. +

+
+
+ +
+
dropout_transition
+

The transition time, in seconds, for volume renormalization when an input +stream ends. The default value is 2 seconds. +

+
+
weights
+

Specify weight of each input audio stream as a sequence of numbers separated +by a space. If fewer weights are specified compared to number of inputs, the +last weight is assigned to the remaining inputs. +Default weight for each input is 1. +

+
+
normalize
+

Always scale inputs instead of only doing summation of samples. +Beware of heavy clipping if inputs are not normalized prior or after filtering +by this filter if this option is disabled. By default is enabled. +

+
+ + +
+

8.34.1 Examples

+ +
    +
  • This will mix 3 input audio streams to a single output with the same duration as the +first input and a dropout transition time of 3 seconds: +
    +
    ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
    +
    + +
  • This will mix one vocal and one music input audio stream to a single output with the same duration as the +longest input. The music will have quarter the weight as the vocals, and the inputs are not normalized: +
    +
    ffmpeg -i VOCALS -i MUSIC -filter_complex amix=inputs=2:duration=longest:dropout_transition=0:weights="1 0.25":normalize=0 OUTPUT
    +
    + +
+ +
+
+

8.34.2 Commands

+ +

This filter supports the following commands: +

+
weights
+
normalize
+

Syntax is same as option with same name. +

+
+ +
+
+
+

8.35 amultiply

+ +

Multiply first audio stream with second audio stream and store result +in output audio stream. Multiplication is done by multiplying each +sample from first stream with sample at same position from second stream. +

+

With this element-wise multiplication one can create amplitude fades and +amplitude modulations. +

+
+
+

8.36 anequalizer

+ +

High-order parametric multiband equalizer for each channel. +

+

It accepts the following parameters: +

+
params
+
+

This option string is in format: +"cchn f=cf w=w g=g t=f | ..." +Each equalizer band is separated by ’|’. +

+
+
chn
+

Set channel number to which equalization will be applied. +If input doesn’t have that channel the entry is ignored. +

+
+
f
+

Set central frequency for band. +If input doesn’t have that frequency the entry is ignored. +

+
+
w
+

Set band width in Hertz. +

+
+
g
+

Set band gain in dB. +

+
+
t
+

Set filter type for band, optional, can be: +

+
+
0
+

Butterworth, this is default. +

+
+
1
+

Chebyshev type 1. +

+
+
2
+

Chebyshev type 2. +

+
+
+
+ +
+
curves
+

With this option activated frequency response of anequalizer is displayed +in video stream. +

+
+
size
+

Set video stream size. Only useful if curves option is activated. +

+
+
mgain
+

Set max gain that will be displayed. Only useful if curves option is activated. +Setting this to a reasonable value makes it possible to display gain which is derived from +neighbour bands which are too close to each other and thus produce higher gain +when both are activated. +

+
+
fscale
+

Set frequency scale used to draw frequency response in video output. +Can be linear or logarithmic. Default is logarithmic. +

+
+
colors
+

Set color for each channel curve which is going to be displayed in video stream. +This is list of color names separated by space or by ’|’. +Unrecognised or missing colors will be replaced by white color. +

+
+ + +
+

8.36.1 Examples

+ +
    +
  • Lower gain by 10 of central frequency 200Hz and width 100 Hz +for first 2 channels using Chebyshev type 1 filter: +
    +
    anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
    +
    +
+ +
+
+

8.36.2 Commands

+ +

This filter supports the following commands: +

+
change
+

Alter existing filter parameters. +Syntax for the commands is : "fN|f=freq|w=width|g=gain" +

+

fN is existing filter number, starting from 0, if no such filter is available +error is returned. +freq set new frequency parameter. +width set new width parameter in Hertz. +gain set new gain parameter in dB. +

+

Full filter invocation with asendcmd may look like this: +asendcmd=c=’4.0 anequalizer change 0|f=200|w=50|g=1’,anequalizer=... +

+
+ +
+
+
+

8.37 anlmdn

+ +

Reduce broadband noise in audio samples using Non-Local Means algorithm. +

+

Each sample is adjusted by looking for other samples with similar contexts. This +context similarity is defined by comparing their surrounding patches of size +p. Patches are searched in an area of r around the sample. +

+

The filter accepts the following options: +

+
+
strength, s
+

Set denoising strength. Allowed range is from 0.00001 to 10000. Default value is 0.00001. +

+
+
patch, p
+

Set patch radius duration. Allowed range is from 1 to 100 milliseconds. +Default value is 2 milliseconds. +

+
+
research, r
+

Set research radius duration. Allowed range is from 2 to 300 milliseconds. +Default value is 6 milliseconds. +

+
+
output, o
+

Set the output mode. +

+

It accepts the following values: +

+
i
+

Pass input unchanged. +

+
+
o
+

Pass noise filtered out. +

+
+
n
+

Pass only noise. +

+

Default value is o. +

+
+ +
+
smooth, m
+

Set smooth factor. Default value is 11. Allowed range is from 1 to 1000. +

+
+ + +
+

8.37.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.38 anlmf, anlms

+

Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first audio stream using the second audio stream. +

+

This adaptive filter is used to mimic a desired filter by finding the filter coefficients that +relate to producing the least mean square of the error signal (difference between the desired, +2nd input audio stream and the actual signal, the 1st input audio stream). +

+

A description of the accepted options follows. +

+
+
order
+

Set filter order. +

+
+
mu
+

Set filter mu. +

+
+
eps
+

Set the filter eps. +

+
+
leakage
+

Set the filter leakage. +

+
+
out_mode
+

It accepts the following values: +

+
i
+

Pass the 1st input. +

+
+
d
+

Pass the 2nd input. +

+
+
o
+

Pass difference between desired, 2nd input and error signal estimate. +

+
+
n
+

Pass difference between input, 1st input and error signal estimate. +

+
+
e
+

Pass error signal estimated samples. +

+

Default value is o. +

+
+
+
+ + +
+

8.38.1 Examples

+ +
    +
  • One of many usages of this filter is noise reduction, input audio is filtered +with same samples that are delayed by fixed amount, one such example for stereo audio is: +
    +
    asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
    +
    +
+ +
+
+

8.38.2 Commands

+ +

This filter supports the same commands as options, excluding option order. +

+
+
+
+

8.39 anull

+ +

Pass the audio source unchanged to the output. +

+
+
+

8.40 apad

+ +

Pad the end of an audio stream with silence. +

+

This can be used together with ffmpeg -shortest to +extend audio streams to the same length as the video stream. +

+

A description of the accepted options follows. +

+
+
packet_size
+

Set silence packet size. Default value is 4096. +

+
+
pad_len
+

Set the number of samples of silence to add to the end. After the +value is reached, the stream is terminated. This option is mutually +exclusive with whole_len. +

+
+
whole_len
+

Set the minimum total number of samples in the output audio stream. If +the value is longer than the input audio length, silence is added to +the end, until the value is reached. This option is mutually exclusive +with pad_len. +

+
+
pad_dur
+

Specify the duration of samples of silence to add. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. Used only if set to non-negative value. +

+
+
whole_dur
+

Specify the minimum total duration in the output audio stream. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. Used only if set to non-negative value. If the value is longer than +the input audio length, silence is added to the end, until the value is reached. +This option is mutually exclusive with pad_dur +

+
+ +

If neither the pad_len nor the whole_len nor pad_dur +nor whole_dur option is set, the filter will add silence to the end of +the input stream indefinitely. +

+

Note that for ffmpeg 4.4 and earlier a zero pad_dur or +whole_dur also caused the filter to add silence indefinitely. +

+ +
+

8.40.1 Examples

+ +
    +
  • Add 1024 samples of silence to the end of the input: +
    +
    apad=pad_len=1024
    +
    + +
  • Make sure the audio output will contain at least 10000 samples, pad +the input with silence if required: +
    +
    apad=whole_len=10000
    +
    + +
  • Use ffmpeg to pad the audio input with silence, so that the +video stream will always result the shortest and will be converted +until the end in the output file when using the shortest +option: +
    +
    ffmpeg -i VIDEO -i AUDIO -filter_complex "[1:0]apad" -shortest OUTPUT
    +
    +
+ +
+
+
+

8.41 aphaser

+

Add a phasing effect to the input audio. +

+

A phaser filter creates series of peaks and troughs in the frequency spectrum. +The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect. +

+

A description of the accepted parameters follows. +

+
+
in_gain
+

Set input gain. Default is 0.4. +

+
+
out_gain
+

Set output gain. Default is 0.74 +

+
+
delay
+

Set delay in milliseconds. Default is 3.0. +

+
+
decay
+

Set decay. Default is 0.4. +

+
+
speed
+

Set modulation speed in Hz. Default is 0.5. +

+
+
type
+

Set modulation type. Default is triangular. +

+

It accepts the following values: +

+
triangular, t
+
sinusoidal, s
+
+
+
+ +
+
+

8.42 aphaseshift

+

Apply phase shift to input audio samples. +

+

The filter accepts the following options: +

+
+
shift
+

Specify phase shift. Allowed range is from -1.0 to 1.0. +Default value is 0.0. +

+
+
level
+

Set output gain applied to final output. Allowed range is from 0.0 to 1.0. +Default value is 1.0. +

+
+
order
+

Set filter order used for filtering. Allowed range is from 1 to 16. +Default value is 8. +

+
+ + +
+

8.42.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.43 apsyclip

+

Apply Psychoacoustic clipper to input audio stream. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
level_out
+

Set output gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
clip
+

Set the clipping start value. Default value is 0dBFS or 1. +

+
+
diff
+

Output only difference samples, useful to hear introduced distortions. +By default is disabled. +

+
+
adaptive
+

Set strength of adaptive distortion applied. Default value is 0.5. +Allowed range is from 0 to 1. +

+
+
iterations
+

Set number of iterations of psychoacoustic clipper. +Allowed range is from 1 to 20. Default value is 10. +

+
+
level
+

Auto level output signal. Default is disabled. +This normalizes audio back to 0dBFS if enabled. +

+
+ + +
+

8.43.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.44 apulsator

+ +

Audio pulsator is something between an autopanner and a tremolo. +But it can produce funny stereo effects as well. Pulsator changes the volume +of the left and right channel based on a LFO (low frequency oscillator) with +different waveforms and shifted phases. +This filter have the ability to define an offset between left and right +channel. An offset of 0 means that both LFO shapes match each other. +The left and right channel are altered equally - a conventional tremolo. +An offset of 50% means that the shape of the right channel is exactly shifted +in phase (or moved backwards about half of the frequency) - pulsator acts as +an autopanner. At 1 both curves match again. Every setting in between moves the +phase shift gapless between all stages and produces some "bypassing" sounds with +sine and triangle waveforms. The more you set the offset near 1 (starting from +the 0.5) the faster the signal passes from the left to the right speaker. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
level_out
+

Set output gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
mode
+

Set waveform shape the LFO will use. Can be one of: sine, triangle, square, +sawup or sawdown. Default is sine. +

+
+
amount
+

Set modulation. Define how much of original signal is affected by the LFO. +

+
+
offset_l
+

Set left channel offset. Default is 0. Allowed range is [0 - 1]. +

+
+
offset_r
+

Set right channel offset. Default is 0.5. Allowed range is [0 - 1]. +

+
+
width
+

Set pulse width. Default is 1. Allowed range is [0 - 2]. +

+
+
timing
+

Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz. +

+
+
bpm
+

Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing +is set to bpm. +

+
+
ms
+

Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing +is set to ms. +

+
+
hz
+

Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used +if timing is set to hz. +

+
+ +
+
+

8.45 aresample

+ +

Resample the input audio to the specified parameters, using the +libswresample library. If none are specified then the filter will +automatically convert between its input and output. +

+

This filter is also able to stretch/squeeze the audio data to make it match +the timestamps or to inject silence / cut out audio to make it match the +timestamps, do a combination of both or do neither. +

+

The filter accepts the syntax +[sample_rate:]resampler_options, where sample_rate +expresses a sample rate and resampler_options is a list of +key=value pairs, separated by ":". See the +(ffmpeg-resampler)"Resampler Options" section in the +ffmpeg-resampler(1) manual +for the complete list of supported options. +

+ +
+

8.45.1 Examples

+ +
    +
  • Resample the input audio to 44100Hz: +
    +
    aresample=44100
    +
    + +
  • Stretch/squeeze samples to the given timestamps, with a maximum of 1000 +samples per second compensation: +
    +
    aresample=async=1000
    +
    +
+ +
+
+
+

8.46 areverse

+ +

Reverse an audio clip. +

+

Warning: This filter requires memory to buffer the entire clip, so trimming +is suggested. +

+ +
+

8.46.1 Examples

+ +
    +
  • Take the first 5 seconds of a clip, and reverse it. +
    +
    atrim=end=5,areverse
    +
    +
+ +
+
+
+

8.47 arls

+

Apply Recursive Least Squares algorithm to the first audio stream using the second audio stream. +

+

This adaptive filter is used to mimic a desired filter by recursively finding the filter coefficients that +relate to producing the minimal weighted linear least squares cost function of the error signal (difference +between the desired, 2nd input audio stream and the actual signal, the 1st input audio stream). +

+

A description of the accepted options follows. +

+
+
order
+

Set the filter order. +

+
+
lambda
+

Set the forgetting factor. +

+
+
delta
+

Set the coefficient to initialize internal covariance matrix. +

+
+
out_mode
+

Set the filter output samples. It accepts the following values: +

+
i
+

Pass the 1st input. +

+
+
d
+

Pass the 2nd input. +

+
+
o
+

Pass difference between desired, 2nd input and error signal estimate. +

+
+
n
+

Pass difference between input, 1st input and error signal estimate. +

+
+
e
+

Pass error signal estimated samples. +

+

Default value is o. +

+
+
+
+ +
+
+

8.48 arnndn

+ +

Reduce noise from speech using Recurrent Neural Networks. +

+

This filter accepts the following options: +

+
+
model, m
+

Set train model file to load. This option is always required. +

+
+
mix
+

Set how much to mix filtered samples into final output. +Allowed range is from -1 to 1. Default value is 1. +Negative values are special, they set how much to keep filtered noise +in the final filter output. Set this option to -1 to hear actual +noise removed from input signal. +

+
+ + +
+

8.48.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.49 asdr

+

Measure Audio Signal-to-Distortion Ratio. +

+

This filter takes two audio streams for input, and outputs first +audio stream. +Results are in dB per channel at end of either input. +

+
+
+

8.50 asetnsamples

+ +

Set the number of samples per each output audio frame. +

+

The last output packet may contain a different number of samples, as +the filter will flush all the remaining samples when the input audio +signals its end. +

+

The filter accepts the following options: +

+
+
nb_out_samples, n
+

Set the number of frames per each output audio frame. The number is +intended as the number of samples per each channel. +Default value is 1024. +

+
+
pad, p
+

If set to 1, the filter will pad the last audio frame with zeroes, so +that the last frame will contain the same number of samples as the +previous ones. Default value is 1. +

+
+ +

For example, to set the number of per-frame samples to 1234 and +disable padding for the last frame, use: +

+
asetnsamples=n=1234:p=0
+
+ +
+
+

8.51 asetrate

+ +

Set the sample rate without altering the PCM data. +This will result in a change of speed and pitch. +

+

The filter accepts the following options: +

+
+
sample_rate, r
+

Set the output sample rate. Default is 44100 Hz. +

+
+ +
+
+

8.52 ashowinfo

+ +

Show a line containing various information for each input audio frame. +The input audio is not modified. +

+

The shown line contains a sequence of key/value pairs of the form +key:value. +

+

The following values are shown in the output: +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +

+
+
pts
+

The presentation timestamp of the input frame, in time base units; the time base +depends on the filter input pad, and is usually 1/sample_rate. +

+
+
pts_time
+

The presentation timestamp of the input frame in seconds. +

+
+
fmt
+

The sample format. +

+
+
chlayout
+

The channel layout. +

+
+
rate
+

The sample rate for the audio frame. +

+
+
nb_samples
+

The number of samples (per channel) in the frame. +

+
+
checksum
+

The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar +audio, the data is treated as if all the planes were concatenated. +

+
+
plane_checksums
+

A list of Adler-32 checksums for each data plane. +

+
+ +
+
+

8.53 asoftclip

+

Apply audio soft clipping. +

+

Soft clipping is a type of distortion effect where the amplitude of a signal is saturated +along a smooth curve, rather than the abrupt shape of hard-clipping. +

+

This filter accepts the following options: +

+
+
type
+

Set type of soft-clipping. +

+

It accepts the following values: +

+
hard
+
tanh
+
atan
+
cubic
+
exp
+
alg
+
quintic
+
sin
+
erf
+
+ +
+
threshold
+

Set threshold from where to start clipping. Default value is 0dB or 1. +

+
+
output
+

Set gain applied to output. Default value is 0dB or 1. +

+
+
param
+

Set additional parameter which controls sigmoid function. +

+
+
oversample
+

Set oversampling factor. +

+
+ + +
+

8.53.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.54 aspectralstats

+ +

Display frequency domain statistical information about the audio channels. +Statistics are calculated and stored as metadata for each audio channel and for each audio frame. +

+

It accepts the following option: +

+
win_size
+

Set the window length in samples. Default value is 2048. +Allowed range is from 32 to 65536. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann, hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hann. +

+
+
overlap
+

Set window overlap. Allowed range is from 0 +to 1. Default value is 0.5. +

+
+
measure
+

Select the parameters which are measured. The metadata keys can +be used as flags, default is all which measures everything. +none disables all measurement. +

+
+ +

A list of each metadata key follows: +

+
+
mean
+
variance
+
centroid
+
spread
+
skewness
+
kurtosis
+
entropy
+
flatness
+
crest
+
flux
+
slope
+
decrease
+
rolloff
+
+ +
+
+

8.55 asr

+

Automatic Speech Recognition +

+

This filter uses PocketSphinx for speech recognition. To enable +compilation of this filter, you need to configure FFmpeg with +--enable-pocketsphinx. +

+

It accepts the following options: +

+
+
rate
+

Set sampling rate of input audio. Defaults is 16000. +This need to match speech models, otherwise one will get poor results. +

+
+
hmm
+

Set dictionary containing acoustic model files. +

+
+
dict
+

Set pronunciation dictionary. +

+
+
lm
+

Set language model file. +

+
+
lmctl
+

Set language model set. +

+
+
lmname
+

Set which language model to use. +

+
+
logfn
+

Set output for log messages. +

+
+ +

The filter exports recognized speech as the frame metadata lavfi.asr.text. +

+
+
+

8.56 astats

+ +

Display time domain statistical information about the audio channels. +Statistics are calculated and displayed for each audio channel and, +where applicable, an overall figure is also given. +

+

It accepts the following option: +

+
length
+

Short window length in seconds, used for peak and trough RMS measurement. +Default is 0.05 (50 milliseconds). Allowed range is [0 - 10]. +

+
+
metadata
+
+

Set metadata injection. All the metadata keys are prefixed with lavfi.astats.X, +where X is channel number starting from 1 or string Overall. Default is +disabled. +

+

Available keys for each channel are: +Bit_depth +Crest_factor +DC_offset +Dynamic_range +Entropy +Flat_factor +Max_difference +Max_level +Mean_difference +Min_difference +Min_level +Noise_floor +Noise_floor_count +Number_of_Infs +Number_of_NaNs +Number_of_denormals +Peak_count +Peak_level +RMS_difference +RMS_peak +RMS_trough +Zero_crossings +Zero_crossings_rate +

+

and for Overall: +Bit_depth +DC_offset +Entropy +Flat_factor +Max_difference +Max_level +Mean_difference +Min_difference +Min_level +Noise_floor +Noise_floor_count +Number_of_Infs +Number_of_NaNs +Number_of_denormals +Number_of_samples +Peak_count +Peak_level +RMS_difference +RMS_level +RMS_peak +RMS_trough +

+

For example, a full key looks like lavfi.astats.1.DC_offset or +lavfi.astats.Overall.Peak_count. +

+

Read below for the description of the keys. +

+
+
reset
+

Set the number of frames over which cumulative stats are calculated before +being reset. Default is disabled. +

+
+
measure_perchannel
+

Select the parameters which are measured per channel. The metadata keys can +be used as flags, default is all which measures everything. +none disables all per channel measurement. +

+
+
measure_overall
+

Select the parameters which are measured overall. The metadata keys can +be used as flags, default is all which measures everything. +none disables all overall measurement. +

+
+
+ +

A description of the measure keys follow: +

+
+
none
+

no measures +

+
+
all
+

all measures +

+
+
Bit_depth
+

overall bit depth of audio, i.e. number of bits used for each sample +

+
+
Crest_factor
+

standard ratio of peak to RMS level (note: not in dB) +

+
+
DC_offset
+

mean amplitude displacement from zero +

+
+
Dynamic_range
+

measured dynamic range of audio in dB +

+
+
Entropy
+

entropy measured across whole audio, entropy of value near 1.0 is typically measured for white noise +

+
+
Flat_factor
+

flatness (i.e. consecutive samples with the same value) of the signal at its peak levels +(i.e. either Min_level or Max_level) +

+
+
Max_difference
+

maximal difference between two consecutive samples +

+
+
Max_level
+

maximal sample level +

+
+
Mean_difference
+

mean difference between two consecutive samples, i.e. the average of each difference between two consecutive samples +

+
+
Min_difference
+

minimal difference between two consecutive samples +

+
+
Min_level
+

minimal sample level +

+
+
Noise_floor
+

minimum local peak measured in dBFS over a short window +

+
+
Noise_floor_count
+

number of occasions (not the number of samples) that the signal attained +Noise floor +

+
+
Number_of_Infs
+

number of samples with an infinite value +

+
+
Number_of_NaNs
+

number of samples with a NaN (not a number) value +

+
+
Number_of_denormals
+

number of samples with a subnormal value +

+
+
Number_of_samples
+

number of samples +

+
+
Peak_count
+

number of occasions (not the number of samples) that the signal attained either +Min_level or Max_level +

+
+
Peak_level
+

standard peak level measured in dBFS +

+
+
RMS_difference
+

Root Mean Square difference between two consecutive samples +

+
+
RMS_level
+

standard RMS level measured in dBFS +

+
+
RMS_peak
+
RMS_trough
+

peak and trough values for RMS level measured over a short window, +measured in dBFS. +

+
+
Zero crossings
+

number of points where the waveform crosses the zero level axis +

+
+
Zero crossings rate
+

rate of Zero crossings and number of audio samples +

+
+ +
+
+

8.57 asubboost

+

Boost subwoofer frequencies. +

+

The filter accepts the following options: +

+
+
dry
+

Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1. +Default value is 1.0. +

+
+
wet
+

Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1. +Default value is 1.0. +

+
+
boost
+

Set max boost factor. Allowed range is from 1 to 12. Default value is 2. +

+
+
decay
+

Set delay line decay gain value. Allowed range is from 0 to 1. +Default value is 0.0. +

+
+
feedback
+

Set delay line feedback gain value. Allowed range is from 0 to 1. +Default value is 0.9. +

+
+
cutoff
+

Set cutoff frequency in Hertz. Allowed range is 50 to 900. +Default value is 100. +

+
+
slope
+

Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1. +Default value is 0.5. +

+
+
delay
+

Set delay. Allowed range is from 1 to 100. +Default value is 20. +

+
+
channels
+

Set the channels to process. Default value is all available. +

+
+ + +
+

8.57.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.58 asubcut

+

Cut subwoofer frequencies. +

+

This filter allows to set custom, steeper +roll off than highpass filter, and thus is able to more attenuate +frequency content in stop-band. +

+

The filter accepts the following options: +

+
+
cutoff
+

Set cutoff frequency in Hertz. Allowed range is 2 to 200. +Default value is 20. +

+
+
order
+

Set filter order. Available values are from 3 to 20. +Default value is 10. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 1. Default value is 1. +

+
+ + +
+

8.58.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.59 asupercut

+

Cut super frequencies. +

+

The filter accepts the following options: +

+
+
cutoff
+

Set cutoff frequency in Hertz. Allowed range is 20000 to 192000. +Default value is 20000. +

+
+
order
+

Set filter order. Available values are from 3 to 20. +Default value is 10. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 1. Default value is 1. +

+
+ + +
+

8.59.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.60 asuperpass

+

Apply high order Butterworth band-pass filter. +

+

The filter accepts the following options: +

+
+
centerf
+

Set center frequency in Hertz. Allowed range is 2 to 999999. +Default value is 1000. +

+
+
order
+

Set filter order. Available values are from 4 to 20. +Default value is 4. +

+
+
qfactor
+

Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 2. Default value is 1. +

+
+ + +
+

8.60.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.61 asuperstop

+

Apply high order Butterworth band-stop filter. +

+

The filter accepts the following options: +

+
+
centerf
+

Set center frequency in Hertz. Allowed range is 2 to 999999. +Default value is 1000. +

+
+
order
+

Set filter order. Available values are from 4 to 20. +Default value is 4. +

+
+
qfactor
+

Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 2. Default value is 1. +

+
+ + +
+

8.61.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.62 atempo

+ +

Adjust audio tempo. +

+

The filter accepts exactly one parameter, the audio tempo. If not +specified then the filter will assume nominal 1.0 tempo. Tempo must +be in the [0.5, 100.0] range. +

+

Note that tempo greater than 2 will skip some samples rather than +blend them in. If for any reason this is a concern it is always +possible to daisy-chain several instances of atempo to achieve the +desired product tempo. +

+ +
+

8.62.1 Examples

+ +
    +
  • Slow down audio to 80% tempo: +
    +
    atempo=0.8
    +
    + +
  • To speed up audio to 300% tempo: +
    +
    atempo=3
    +
    + +
  • To speed up audio to 300% tempo by daisy-chaining two atempo instances: +
    +
    atempo=sqrt(3),atempo=sqrt(3)
    +
    +
+ +
+
+

8.62.2 Commands

+ +

This filter supports the following commands: +

+
tempo
+

Change filter tempo scale factor. +Syntax for the command is : "tempo" +

+
+ +
+
+
+

8.63 atilt

+

Apply spectral tilt filter to audio stream. +

+

This filter apply any spectral roll-off slope over any specified frequency band. +

+

The filter accepts the following options: +

+
+
freq
+

Set central frequency of tilt in Hz. Default is 10000 Hz. +

+
+
slope
+

Set slope direction of tilt. Default is 0. Allowed range is from -1 to 1. +

+
+
width
+

Set width of tilt. Default is 1000. Allowed range is from 100 to 10000. +

+
+
order
+

Set order of tilt filter. +

+
+
level
+

Set input volume level. Allowed range is from 0 to 4. +Defalt is 1. +

+
+ + +
+

8.63.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.64 atrim

+ +

Trim the input so that the output contains one continuous subpart of the input. +

+

It accepts the following parameters: +

+
start
+

Timestamp (in seconds) of the start of the section to keep. I.e. the audio +sample with the timestamp start will be the first sample in the output. +

+
+
end
+

Specify time of the first audio sample that will be dropped, i.e. the +audio sample immediately preceding the one with the timestamp end will be +the last sample in the output. +

+
+
start_pts
+

Same as start, except this option sets the start timestamp in samples +instead of seconds. +

+
+
end_pts
+

Same as end, except this option sets the end timestamp in samples instead +of seconds. +

+
+
duration
+

The maximum duration of the output in seconds. +

+
+
start_sample
+

The number of the first sample that should be output. +

+
+
end_sample
+

The number of the first sample that should be dropped. +

+
+ +

start, end, and duration are expressed as time +duration specifications; see +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

Note that the first two sets of the start/end options and the duration +option look at the frame timestamp, while the _sample options simply count the +samples that pass through the filter. So start/end_pts and start/end_sample will +give different results when the timestamps are wrong, inexact or do not start at +zero. Also note that this filter does not modify the timestamps. If you wish +to have the output timestamps start at zero, insert the asetpts filter after the +atrim filter. +

+

If multiple start or end options are set, this filter tries to be greedy and +keep all samples that match at least one of the specified constraints. To keep +only the part that matches all the constraints at once, chain multiple atrim +filters. +

+

The defaults are such that all the input is kept. So it is possible to set e.g. +just the end values to keep everything before the specified time. +

+

Examples: +

    +
  • Drop everything except the second minute of input: +
    +
    ffmpeg -i INPUT -af atrim=60:120
    +
    + +
  • Keep only the first 1000 samples: +
    +
    ffmpeg -i INPUT -af atrim=end_sample=1000
    +
    + +
+ +
+
+

8.65 axcorrelate

+

Calculate normalized windowed cross-correlation between two input audio streams. +

+

Resulted samples are always between -1 and 1 inclusive. +If result is 1 it means two input samples are highly correlated in that selected segment. +Result 0 means they are not correlated at all. +If result is -1 it means two input samples are out of phase, which means they cancel each +other. +

+

The filter accepts the following options: +

+
+
size
+

Set size of segment over which cross-correlation is calculated. +Default is 256. Allowed range is from 2 to 131072. +

+
+
algo
+

Set algorithm for cross-correlation. Can be slow or fast. +Default is slow. Fast algorithm assumes mean values over any given segment +are always zero and thus need much less calculations to make. +This is generally not true, but is valid for typical audio streams. +

+
+ + +
+

8.65.1 Examples

+ +
    +
  • Calculate correlation between channels in stereo audio stream: +
    +
    ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
    +
    +
+ +
+
+
+

8.66 bandpass

+ +

Apply a two-pole Butterworth band-pass filter with central +frequency frequency, and (3dB-point) band-width width. +The csg option selects a constant skirt gain (peak gain = Q) +instead of the default: constant 0dB peak gain. +The filter roll off at 6dB per octave (20dB per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the filter’s central frequency. Default is 3000. +

+
+
csg
+

Constant skirt gain if set to 1. Defaults to 0. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

8.66.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change bandpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change bandpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change bandpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change bandpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

8.67 bandreject

+ +

Apply a two-pole Butterworth band-reject filter with central +frequency frequency, and (3dB-point) band-width width. +The filter roll off at 6dB per octave (20dB per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the filter’s central frequency. Default is 3000. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

8.67.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change bandreject frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change bandreject width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change bandreject width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change bandreject mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

8.68 bass, lowshelf

+ +

Boost or cut the bass (lower) frequencies of the audio using a two-pole +shelving filter with a response similar to that of a standard +hi-fi’s tone-controls. This is also known as shelving equalisation (EQ). +

+

The filter accepts the following options: +

+
+
gain, g
+

Give the gain at 0 Hz. Its useful range is about -20 +(for a large cut) to +20 (for a large boost). +Beware of clipping when using a positive gain. +

+
+
frequency, f
+

Set the filter’s central frequency and so can be used +to extend or reduce the frequency range to be boosted or cut. +The default value is 100 Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Determine how steep is the filter’s shelf transition. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

8.68.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change bass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change bass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change bass width. +Syntax for the command is : "width" +

+
+
gain, g
+

Change bass gain. +Syntax for the command is : "gain" +

+
+
mix, m
+

Change bass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

8.69 biquad

+ +

Apply a biquad IIR filter with the given coefficients. +Where b0, b1, b2 and a0, a1, a2 +are the numerator and denominator coefficients respectively. +and channels, c specify which channels to filter, by default all +available are filtered. +

+ +
+

8.69.1 Commands

+ +

This filter supports the following commands: +

+
a0
+
a1
+
a2
+
b0
+
b1
+
b2
+

Change biquad parameter. +Syntax for the command is : "value" +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ +
+
+
+

8.70 bs2b

+

Bauer stereo to binaural transformation, which improves headphone listening of +stereo audio records. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libbs2b. +

+

It accepts the following parameters: +

+
profile
+

Pre-defined crossfeed level. +

+
default
+

Default level (fcut=700, feed=50). +

+
+
cmoy
+

Chu Moy circuit (fcut=700, feed=60). +

+
+
jmeier
+

Jan Meier circuit (fcut=650, feed=95). +

+
+
+ +
+
fcut
+

Cut frequency (in Hz). +

+
+
feed
+

Feed level (in Hz). +

+
+
+ +
+
+

8.71 channelmap

+ +

Remap input channels to new locations. +

+

It accepts the following parameters: +

+
map
+

Map channels from input to output. The argument is a ’|’-separated list of +mappings, each in the in_channel-out_channel or +in_channel form. in_channel can be either the name of the input +channel (e.g. FL for front left) or its index in the input channel layout. +out_channel is the name of the output channel or its index in the output +channel layout. If out_channel is not given then it is implicitly an +index, starting with zero and increasing by one for each mapping. +

+
+
channel_layout
+

The channel layout of the output stream. +

+
+ +

If no mapping is present, the filter will implicitly map input channels to +output channels, preserving indices. +

+ +
+

8.71.1 Examples

+ +
    +
  • For example, assuming a 5.1+downmix input MOV file, +
    +
    ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
    +
    +

    will create an output WAV file tagged as stereo from the downmix channels of +the input. +

    +
  • To fix a 5.1 WAV improperly encoded in AAC’s native channel order +
    +
    ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
    +
    +
+ +
+
+
+

8.72 channelsplit

+ +

Split each channel from an input audio stream into a separate output stream. +

+

It accepts the following parameters: +

+
channel_layout
+

The channel layout of the input stream. The default is "stereo". +

+
channels
+

A channel layout describing the channels to be extracted as separate output streams +or "all" to extract each input channel as a separate stream. The default is "all". +

+

Choosing channels not present in channel layout in the input will result in an error. +

+
+ + +
+

8.72.1 Examples

+ +
    +
  • For example, assuming a stereo input MP3 file, +
    +
    ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
    +
    +

    will create an output Matroska file with two audio streams, one containing only +the left channel and the other the right channel. +

    +
  • Split a 5.1 WAV file into per-channel files: +
    +
    ffmpeg -i in.wav -filter_complex
    +'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
    +-map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
    +front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
    +side_right.wav
    +
    + +
  • Extract only LFE from a 5.1 WAV file: +
    +
    ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
    +-map '[LFE]' lfe.wav
    +
    +
+ +
+
+
+

8.73 chorus

+

Add a chorus effect to the audio. +

+

Can make a single vocal sound like a chorus, but can also be applied to instrumentation. +

+

Chorus resembles an echo effect with a short delay, but whereas with echo the delay is +constant, with chorus, it is varied using using sinusoidal or triangular modulation. +The modulation depth defines the range the modulated delay is played before or after +the delay. Hence the delayed sound will sound slower or faster, that is the delayed +sound tuned around the original one, like in a chorus where some vocals are slightly +off key. +

+

It accepts the following parameters: +

+
in_gain
+

Set input gain. Default is 0.4. +

+
+
out_gain
+

Set output gain. Default is 0.4. +

+
+
delays
+

Set delays. A typical delay is around 40ms to 60ms. +

+
+
decays
+

Set decays. +

+
+
speeds
+

Set speeds. +

+
+
depths
+

Set depths. +

+
+ + +
+

8.73.1 Examples

+ +
    +
  • A single delay: +
    +
    chorus=0.7:0.9:55:0.4:0.25:2
    +
    + +
  • Two delays: +
    +
    chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
    +
    + +
  • Fuller sounding chorus with three delays: +
    +
    chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3
    +
    +
+ +
+
+
+

8.74 compand

+

Compress or expand the audio’s dynamic range. +

+

It accepts the following parameters: +

+
+
attacks
+
decays
+

A list of times in seconds for each channel over which the instantaneous level +of the input signal is averaged to determine its volume. attacks refers to +increase of volume and decays refers to decrease of volume. For most +situations, the attack time (response to the audio getting louder) should be +shorter than the decay time, because the human ear is more sensitive to sudden +loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and +a typical value for decay is 0.8 seconds. +If specified number of attacks & decays is lower than number of channels, the last +set attack/decay will be used for all remaining channels. +

+
+
points
+

A list of points for the transfer function, specified in dB relative to the +maximum possible signal amplitude. Each key points list must be defined using +the following syntax: x0/y0|x1/y1|x2/y2|.... or +x0/y0 x1/y1 x2/y2 .... +

+

The input values must be in strictly increasing order but the transfer function +does not have to be monotonically rising. The point 0/0 is assumed but +may be overridden (by 0/out-dBn). Typical values for the transfer +function are -70/-70|-60/-20|1/0. +

+
+
soft-knee
+

Set the curve radius in dB for all joints. It defaults to 0.01. +

+
+
gain
+

Set the additional gain in dB to be applied at all points on the transfer +function. This allows for easy adjustment of the overall gain. +It defaults to 0. +

+
+
volume
+

Set an initial volume, in dB, to be assumed for each channel when filtering +starts. This permits the user to supply a nominal level initially, so that, for +example, a very large gain is not applied to initial signal levels before the +companding has begun to operate. A typical value for audio which is initially +quiet is -90 dB. It defaults to 0. +

+
+
delay
+

Set a delay, in seconds. The input audio is analyzed immediately, but audio is +delayed before being fed to the volume adjuster. Specifying a delay +approximately equal to the attack/decay times allows the filter to effectively +operate in predictive rather than reactive mode. It defaults to 0. +

+
+
+ + +
+

8.74.1 Examples

+ +
    +
  • Make music with both quiet and loud passages suitable for listening to in a +noisy environment: +
    +
    compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
    +
    + +

    Another example for audio with whisper and explosion parts: +

    +
    compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
    +
    + +
  • A noise gate for when the noise is at a lower level than the signal: +
    +
    compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
    +
    + +
  • Here is another noise gate, this time for when the noise is at a higher level +than the signal (making it, in some ways, similar to squelch): +
    +
    compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
    +
    + +
  • 2:1 compression starting at -6dB: +
    +
    compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
    +
    + +
  • 2:1 compression starting at -9dB: +
    +
    compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
    +
    + +
  • 2:1 compression starting at -12dB: +
    +
    compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
    +
    + +
  • 2:1 compression starting at -18dB: +
    +
    compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
    +
    + +
  • 3:1 compression starting at -15dB: +
    +
    compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
    +
    + +
  • Compressor/Gate: +
    +
    compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
    +
    + +
  • Expander: +
    +
    compand=attacks=0:points=-80/-169|-54/-80|-49.5/-64.6|-41.1/-41.1|-25.8/-15|-10.8/-4.5|0/0|20/8.3
    +
    + +
  • Hard limiter at -6dB: +
    +
    compand=attacks=0:points=-80/-80|-6/-6|20/-6
    +
    + +
  • Hard limiter at -12dB: +
    +
    compand=attacks=0:points=-80/-80|-12/-12|20/-12
    +
    + +
  • Hard noise gate at -35 dB: +
    +
    compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
    +
    + +
  • Soft limiter: +
    +
    compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
    +
    +
+ +
+
+
+

8.75 compensationdelay

+ +

Compensation Delay Line is a metric based delay to compensate differing +positions of microphones or speakers. +

+

For example, you have recorded guitar with two microphones placed in +different locations. Because the front of sound wave has fixed speed in +normal conditions, the phasing of microphones can vary and depends on +their location and interposition. The best sound mix can be achieved when +these microphones are in phase (synchronized). Note that a distance of +~30 cm between microphones makes one microphone capture the signal in +antiphase to the other microphone. That makes the final mix sound moody. +This filter helps to solve phasing problems by adding different delays +to each microphone track and make them synchronized. +

+

The best result can be reached when you take one track as base and +synchronize other tracks one by one with it. +Remember that synchronization/delay tolerance depends on sample rate, too. +Higher sample rates will give more tolerance. +

+

The filter accepts the following parameters: +

+
+
mm
+

Set millimeters distance. This is compensation distance for fine tuning. +Default is 0. +

+
+
cm
+

Set cm distance. This is compensation distance for tightening distance setup. +Default is 0. +

+
+
m
+

Set meters distance. This is compensation distance for hard distance setup. +Default is 0. +

+
+
dry
+

Set dry amount. Amount of unprocessed (dry) signal. +Default is 0. +

+
+
wet
+

Set wet amount. Amount of processed (wet) signal. +Default is 1. +

+
+
temp
+

Set temperature in degrees Celsius. This is the temperature of the environment. +Default is 20. +

+
+ + +
+

8.75.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.76 crossfeed

+

Apply headphone crossfeed filter. +

+

Crossfeed is the process of blending the left and right channels of stereo +audio recording. +It is mainly used to reduce extreme stereo separation of low frequencies. +

+

The intent is to produce more speaker like sound to the listener. +

+

The filter accepts the following options: +

+
+
strength
+

Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1. +This sets gain of low shelf filter for side part of stereo image. +Default is -6dB. Max allowed is -30db when strength is set to 1. +

+
+
range
+

Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1. +This sets cut off frequency of low shelf filter. Default is cut off near +1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz. +

+
+
slope
+

Set curve slope of low shelf filter. Default is 0.5. +Allowed range is from 0.01 to 1. +

+
+
level_in
+

Set input gain. Default is 0.9. +

+
+
level_out
+

Set output gain. Default is 1. +

+
+
block_size
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

8.76.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.77 crystalizer

+

Simple algorithm for audio noise sharpening. +

+

This filter linearly increases differences betweeen each audio sample. +

+

The filter accepts the following options: +

+
+
i
+

Sets the intensity of effect (default: 2.0). Must be in range between -10.0 to 0 +(unchanged sound) to 10.0 (maximum effect). +To inverse filtering use negative value. +

+
+
c
+

Enable clipping. By default is enabled. +

+
+ + +
+

8.77.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.78 dcshift

+

Apply a DC shift to the audio. +

+

This can be useful to remove a DC offset (caused perhaps by a hardware problem +in the recording chain) from the audio. The effect of a DC offset is reduced +headroom and hence volume. The astats filter can be used to determine if +a signal has a DC offset. +

+
+
shift
+

Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift +the audio. +

+
+
limitergain
+

Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is +used to prevent clipping. +

+
+ +
+
+

8.79 deesser

+ +

Apply de-essing to the audio samples. +

+
+
i
+

Set intensity for triggering de-essing. Allowed range is from 0 to 1. +Default is 0. +

+
+
m
+

Set amount of ducking on treble part of sound. Allowed range is from 0 to 1. +Default is 0.5. +

+
+
f
+

How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1. +Default is 0.5. +

+
+
s
+

Set the output mode. +

+

It accepts the following values: +

+
i
+

Pass input unchanged. +

+
+
o
+

Pass ess filtered out. +

+
+
e
+

Pass only ess. +

+

Default value is o. +

+
+ +
+
+ +
+
+

8.80 dialoguenhance

+

Enhance dialogue in stereo audio. +

+

This filter accepts stereo input and produce surround (3.0) channels output. +The newly produced front center channel have enhanced speech dialogue originally +available in both stereo channels. +This filter outputs front left and front right channels same as available in stereo input. +

+

The filter accepts the following options: +

+
+
original
+

Set the original center factor to keep in front center channel output. +Allowed range is from 0 to 1. Default value is 1. +

+
+
enhance
+

Set the dialogue enhance factor to put in front center channel output. +Allowed range is from 0 to 3. Default value is 1. +

+
+
voice
+

Set the voice detection factor. +Allowed range is from 2 to 32. Default value is 2. +

+
+ + +
+

8.80.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.81 drmeter

+

Measure audio dynamic range. +

+

DR values of 14 and higher is found in very dynamic material. DR of 8 to 13 +is found in transition material. And anything less that 8 have very poor dynamics +and is very compressed. +

+

The filter accepts the following options: +

+
+
length
+

Set window length in seconds used to split audio into segments of equal length. +Default is 3 seconds. +

+
+ +
+
+

8.82 dynaudnorm

+

Dynamic Audio Normalizer. +

+

This filter applies a certain amount of gain to the input audio in order +to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in +contrast to more "simple" normalization algorithms, the Dynamic Audio +Normalizer *dynamically* re-adjusts the gain factor to the input audio. +This allows for applying extra gain to the "quiet" sections of the audio +while avoiding distortions or clipping the "loud" sections. In other words: +The Dynamic Audio Normalizer will "even out" the volume of quiet and loud +sections, in the sense that the volume of each section is brought to the +same target level. Note, however, that the Dynamic Audio Normalizer achieves +this goal *without* applying "dynamic range compressing". It will retain 100% +of the dynamic range *within* each section of the audio file. +

+
+
framelen, f
+

Set the frame length in milliseconds. In range from 10 to 8000 milliseconds. +Default is 500 milliseconds. +The Dynamic Audio Normalizer processes the input audio in small chunks, +referred to as frames. This is required, because a peak magnitude has no +meaning for just a single sample value. Instead, we need to determine the +peak magnitude for a contiguous sequence of sample values. While a "standard" +normalizer would simply use the peak magnitude of the complete file, the +Dynamic Audio Normalizer determines the peak magnitude individually for each +frame. The length of a frame is specified in milliseconds. By default, the +Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has +been found to give good results with most files. +Note that the exact frame length, in number of samples, will be determined +automatically, based on the sampling rate of the individual input audio file. +

+
+
gausssize, g
+

Set the Gaussian filter window size. In range from 3 to 301, must be odd +number. Default is 31. +Probably the most important parameter of the Dynamic Audio Normalizer is the +window size of the Gaussian smoothing filter. The filter’s window size +is specified in frames, centered around the current frame. For the sake of +simplicity, this must be an odd number. Consequently, the default value of 31 +takes into account the current frame, as well as the 15 preceding frames and +the 15 subsequent frames. Using a larger window results in a stronger +smoothing effect and thus in less gain variation, i.e. slower gain +adaptation. Conversely, using a smaller window results in a weaker smoothing +effect and thus in more gain variation, i.e. faster gain adaptation. +In other words, the more you increase this value, the more the Dynamic Audio +Normalizer will behave like a "traditional" normalization filter. On the +contrary, the more you decrease this value, the more the Dynamic Audio +Normalizer will behave like a dynamic range compressor. +

+
+
peak, p
+

Set the target peak value. This specifies the highest permissible magnitude +level for the normalized audio input. This filter will try to approach the +target peak magnitude as closely as possible, but at the same time it also +makes sure that the normalized signal will never exceed the peak magnitude. +A frame’s maximum local gain factor is imposed directly by the target peak +magnitude. The default value is 0.95 and thus leaves a headroom of 5%*. +It is not recommended to go above this value. +

+
+
maxgain, m
+

Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0. +The Dynamic Audio Normalizer determines the maximum possible (local) gain +factor for each input frame, i.e. the maximum gain factor that does not +result in clipping or distortion. The maximum gain factor is determined by +the frame’s highest magnitude sample. However, the Dynamic Audio Normalizer +additionally bounds the frame’s maximum gain factor by a predetermined +(global) maximum gain factor. This is done in order to avoid excessive gain +factors in "silent" or almost silent frames. By default, the maximum gain +factor is 10.0, For most inputs the default value should be sufficient and +it usually is not recommended to increase this value. Though, for input +with an extremely low overall volume level, it may be necessary to allow even +higher gain factors. Note, however, that the Dynamic Audio Normalizer does +not simply apply a "hard" threshold (i.e. cut off values above the threshold). +Instead, a "sigmoid" threshold function will be applied. This way, the +gain factors will smoothly approach the threshold value, but never exceed that +value. +

+
+
targetrms, r
+

Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled. +By default, the Dynamic Audio Normalizer performs "peak" normalization. +This means that the maximum local gain factor for each frame is defined +(only) by the frame’s highest magnitude sample. This way, the samples can +be amplified as much as possible without exceeding the maximum signal +level, i.e. without clipping. Optionally, however, the Dynamic Audio +Normalizer can also take into account the frame’s root mean square, +abbreviated RMS. In electrical engineering, the RMS is commonly used to +determine the power of a time-varying signal. It is therefore considered +that the RMS is a better approximation of the "perceived loudness" than +just looking at the signal’s peak magnitude. Consequently, by adjusting all +frames to a constant RMS value, a uniform "perceived loudness" can be +established. If a target RMS value has been specified, a frame’s local gain +factor is defined as the factor that would result in exactly that RMS value. +Note, however, that the maximum local gain factor is still restricted by the +frame’s highest magnitude sample, in order to prevent clipping. +

+
+
coupling, n
+

Enable channels coupling. By default is enabled. +By default, the Dynamic Audio Normalizer will amplify all channels by the same +amount. This means the same gain factor will be applied to all channels, i.e. +the maximum possible gain factor is determined by the "loudest" channel. +However, in some recordings, it may happen that the volume of the different +channels is uneven, e.g. one channel may be "quieter" than the other one(s). +In this case, this option can be used to disable the channel coupling. This way, +the gain factor will be determined independently for each channel, depending +only on the individual channel’s highest magnitude sample. This allows for +harmonizing the volume of the different channels. +

+
+
correctdc, c
+

Enable DC bias correction. By default is disabled. +An audio signal (in the time domain) is a sequence of sample values. +In the Dynamic Audio Normalizer these sample values are represented in the +-1.0 to 1.0 range, regardless of the original input format. Normally, the +audio signal, or "waveform", should be centered around the zero point. +That means if we calculate the mean value of all samples in a file, or in a +single frame, then the result should be 0.0 or at least very close to that +value. If, however, there is a significant deviation of the mean value from +0.0, in either positive or negative direction, this is referred to as a +DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic +Audio Normalizer provides optional DC bias correction. +With DC bias correction enabled, the Dynamic Audio Normalizer will determine +the mean value, or "DC correction" offset, of each input frame and subtract +that value from all of the frame’s sample values which ensures those samples +are centered around 0.0 again. Also, in order to avoid "gaps" at the frame +boundaries, the DC correction offset values will be interpolated smoothly +between neighbouring frames. +

+
+
altboundary, b
+

Enable alternative boundary mode. By default is disabled. +The Dynamic Audio Normalizer takes into account a certain neighbourhood +around each frame. This includes the preceding frames as well as the +subsequent frames. However, for the "boundary" frames, located at the very +beginning and at the very end of the audio file, not all neighbouring +frames are available. In particular, for the first few frames in the audio +file, the preceding frames are not known. And, similarly, for the last few +frames in the audio file, the subsequent frames are not known. Thus, the +question arises which gain factors should be assumed for the missing frames +in the "boundary" region. The Dynamic Audio Normalizer implements two modes +to deal with this situation. The default boundary mode assumes a gain factor +of exactly 1.0 for the missing frames, resulting in a smooth "fade in" and +"fade out" at the beginning and at the end of the input, respectively. +

+
+
compress, s
+

Set the compress factor. In range from 0.0 to 30.0. Default is 0.0. +By default, the Dynamic Audio Normalizer does not apply "traditional" +compression. This means that signal peaks will not be pruned and thus the +full dynamic range will be retained within each local neighbourhood. However, +in some cases it may be desirable to combine the Dynamic Audio Normalizer’s +normalization algorithm with a more "traditional" compression. +For this purpose, the Dynamic Audio Normalizer provides an optional compression +(thresholding) function. If (and only if) the compression feature is enabled, +all input frames will be processed by a soft knee thresholding function prior +to the actual normalization process. Put simply, the thresholding function is +going to prune all samples whose magnitude exceeds a certain threshold value. +However, the Dynamic Audio Normalizer does not simply apply a fixed threshold +value. Instead, the threshold value will be adjusted for each individual +frame. +In general, smaller parameters result in stronger compression, and vice versa. +Values below 3.0 are not recommended, because audible distortion may appear. +

+
+
threshold, t
+

Set the target threshold value. This specifies the lowest permissible +magnitude level for the audio input which will be normalized. +If input frame volume is above this value frame will be normalized. +Otherwise frame may not be normalized at all. The default value is set +to 0, which means all input frames will be normalized. +This option is mostly useful if digital noise is not wanted to be amplified. +

+
+
channels, h
+

Specify which channels to filter, by default all available channels are filtered. +

+
+
overlap, o
+

Specify overlap for frames. If set to 0 (default) no frame overlapping is done. +Using >0 and <1 values will make less conservative gain adjustments, like +when framelen option is set to smaller value, if framelen option value is +compensated for non-zero overlap then gain adjustments will be smoother across time +compared to zero overlap case. +

+
+
curve, v
+

Specify the peak mapping curve expression which is going to be used when calculating +gain applied to frames. The max output frame gain will still be limited by other +options mentioned previously for this filter. +

+

The expression can contain the following constants: +

+
+
ch
+

current channel number +

+
+
sn
+

current sample number +

+
+
nb_channels
+

number of channels +

+
+
t
+

timestamp expressed in seconds +

+
+
sr
+

sample rate +

+
+
p
+

current frame peak value +

+
+
+
+ + +
+

8.82.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.83 earwax

+ +

Make audio easier to listen to on headphones. +

+

This filter adds ‘cues’ to 44.1kHz stereo (i.e. audio CD format) audio +so that when listened to on headphones the stereo image is moved from +inside your head (standard for headphones) to outside and in front of +the listener (standard for speakers). +

+

Ported from SoX. +

+
+
+

8.84 equalizer

+ +

Apply a two-pole peaking equalisation (EQ) filter. With this +filter, the signal-level at and around a selected frequency can +be increased or decreased, whilst (unlike bandpass and bandreject +filters) that at all other frequencies is unchanged. +

+

In order to produce complex equalisation curves, this filter can +be given several times, each with a different central frequency. +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the filter’s central frequency in Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
gain, g
+

Set the required gain or attenuation in dB. +Beware of clipping when using a positive gain. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

8.84.1 Examples

+
    +
  • Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz: +
    +
    equalizer=f=1000:t=h:width=200:g=-10
    +
    + +
  • Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2: +
    +
    equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
    +
    +
+ +
+
+

8.84.2 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change equalizer frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change equalizer width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change equalizer width. +Syntax for the command is : "width" +

+
+
gain, g
+

Change equalizer gain. +Syntax for the command is : "gain" +

+
+
mix, m
+

Change equalizer mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

8.85 extrastereo

+ +

Linearly increases the difference between left and right channels which +adds some sort of "live" effect to playback. +

+

The filter accepts the following options: +

+
+
m
+

Sets the difference coefficient (default: 2.5). 0.0 means mono sound +(average of both channels), with 1.0 sound will be unchanged, with +-1.0 left and right channels will be swapped. +

+
+
c
+

Enable clipping. By default is enabled. +

+
+ + +
+

8.85.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.86 firequalizer

+

Apply FIR Equalization using arbitrary frequency response. +

+

The filter accepts the following option: +

+
+
gain
+

Set gain curve equation (in dB). The expression can contain variables: +

+
f
+

the evaluated frequency +

+
sr
+

sample rate +

+
ch
+

channel number, set to 0 when multichannels evaluation is disabled +

+
chid
+

channel id, see libavutil/channel_layout.h, set to the first channel id when +multichannels evaluation is disabled +

+
chs
+

number of channels +

+
chlayout
+

channel_layout, see libavutil/channel_layout.h +

+
+
+

and functions: +

+
gain_interpolate(f)
+

interpolate gain on frequency f based on gain_entry +

+
cubic_interpolate(f)
+

same as gain_interpolate, but smoother +

+
+

This option is also available as command. Default is gain_interpolate(f). +

+
+
gain_entry
+

Set gain entry for gain_interpolate function. The expression can +contain functions: +

+
entry(f, g)
+

store gain entry at frequency f with value g +

+
+

This option is also available as command. +

+
+
delay
+

Set filter delay in seconds. Higher value means more accurate. +Default is 0.01. +

+
+
accuracy
+

Set filter accuracy in Hz. Lower value means more accurate. +Default is 5. +

+
+
wfunc
+

Set window function. Acceptable values are: +

+
rectangular
+

rectangular window, useful when gain curve is already smooth +

+
hann
+

hann window (default) +

+
hamming
+

hamming window +

+
blackman
+

blackman window +

+
nuttall3
+

3-terms continuous 1st derivative nuttall window +

+
mnuttall3
+

minimum 3-terms discontinuous nuttall window +

+
nuttall
+

4-terms continuous 1st derivative nuttall window +

+
bnuttall
+

minimum 4-terms discontinuous nuttall (blackman-nuttall) window +

+
bharris
+

blackman-harris window +

+
tukey
+

tukey window +

+
+ +
+
fixed
+

If enabled, use fixed number of audio samples. This improves speed when +filtering with large delay. Default is disabled. +

+
+
multi
+

Enable multichannels evaluation on gain. Default is disabled. +

+
+
zero_phase
+

Enable zero phase mode by subtracting timestamp to compensate delay. +Default is disabled. +

+
+
scale
+

Set scale used by gain. Acceptable values are: +

+
linlin
+

linear frequency, linear gain +

+
linlog
+

linear frequency, logarithmic (in dB) gain (default) +

+
loglin
+

logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain +

+
loglog
+

logarithmic frequency, logarithmic gain +

+
+ +
+
dumpfile
+

Set file for dumping, suitable for gnuplot. +

+
+
dumpscale
+

Set scale for dumpfile. Acceptable values are same with scale option. +Default is linlog. +

+
+
fft2
+

Enable 2-channel convolution using complex FFT. This improves speed significantly. +Default is disabled. +

+
+
min_phase
+

Enable minimum phase impulse response. Default is disabled. +

+
+ + +
+

8.86.1 Examples

+
    +
  • lowpass at 1000 Hz: +
    +
    firequalizer=gain='if(lt(f,1000), 0, -INF)'
    +
    +
  • lowpass at 1000 Hz with gain_entry: +
    +
    firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
    +
    +
  • custom equalization: +
    +
    firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
    +
    +
  • higher delay with zero phase to compensate delay: +
    +
    firequalizer=delay=0.1:fixed=on:zero_phase=on
    +
    +
  • lowpass on left channel, highpass on right channel: +
    +
    firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
    +:gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
    +
    +
+ +
+
+
+

8.87 flanger

+

Apply a flanging effect to the audio. +

+

The filter accepts the following options: +

+
+
delay
+

Set base delay in milliseconds. Range from 0 to 30. Default value is 0. +

+
+
depth
+

Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2. +

+
+
regen
+

Set percentage regeneration (delayed signal feedback). Range from -95 to 95. +Default value is 0. +

+
+
width
+

Set percentage of delayed signal mixed with original. Range from 0 to 100. +Default value is 71. +

+
+
speed
+

Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5. +

+
+
shape
+

Set swept wave shape, can be triangular or sinusoidal. +Default value is sinusoidal. +

+
+
phase
+

Set swept wave percentage-shift for multi channel. Range from 0 to 100. +Default value is 25. +

+
+
interp
+

Set delay-line interpolation, linear or quadratic. +Default is linear. +

+
+ +
+
+

8.88 haas

+

Apply Haas effect to audio. +

+

Note that this makes most sense to apply on mono signals. +With this filter applied to mono signals it give some directionality and +stretches its stereo image. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level. By default is 1, or 0dB +

+
+
level_out
+

Set output level. By default is 1, or 0dB. +

+
+
side_gain
+

Set gain applied to side part of signal. By default is 1. +

+
+
middle_source
+

Set kind of middle source. Can be one of the following: +

+
+
left
+

Pick left channel. +

+
+
right
+

Pick right channel. +

+
+
mid
+

Pick middle part signal of stereo image. +

+
+
side
+

Pick side part signal of stereo image. +

+
+ +
+
middle_phase
+

Change middle phase. By default is disabled. +

+
+
left_delay
+

Set left channel delay. By default is 2.05 milliseconds. +

+
+
left_balance
+

Set left channel balance. By default is -1. +

+
+
left_gain
+

Set left channel gain. By default is 1. +

+
+
left_phase
+

Change left phase. By default is disabled. +

+
+
right_delay
+

Set right channel delay. By defaults is 2.12 milliseconds. +

+
+
right_balance
+

Set right channel balance. By default is 1. +

+
+
right_gain
+

Set right channel gain. By default is 1. +

+
+
right_phase
+

Change right phase. By default is enabled. +

+
+ +
+
+

8.89 hdcd

+ +

Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with +embedded HDCD codes is expanded into a 20-bit PCM stream. +

+

The filter supports the Peak Extend and Low-level Gain Adjustment features +of HDCD, and detects the Transient Filter flag. +

+
+
ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
+
+ +

When using the filter with wav, note the default encoding for wav is 16-bit, +so the resulting 20-bit stream will be truncated back to 16-bit. Use something +like -acodec pcm_s24le after the filter to get 24-bit PCM output. +

+
ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
+ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
+
+ +

The filter accepts the following options: +

+
+
disable_autoconvert
+

Disable any automatic format conversion or resampling in the filter graph. +

+
+
process_stereo
+

Process the stereo channels together. If target_gain does not match between +channels, consider it invalid and use the last valid target_gain. +

+
+
cdt_ms
+

Set the code detect timer period in ms. +

+
+
force_pe
+

Always extend peaks above -3dBFS even if PE isn’t signaled. +

+
+
analyze_mode
+

Replace audio with a solid tone and adjust the amplitude to signal some +specific aspect of the decoding process. The output file can be loaded in +an audio editor alongside the original to aid analysis. +

+

analyze_mode=pe:force_pe=true can be used to see all samples above the PE level. +

+

Modes are: +

+
0, off
+

Disabled +

+
1, lle
+

Gain adjustment level at each sample +

+
2, pe
+

Samples where peak extend occurs +

+
3, cdt
+

Samples where the code detect timer is active +

+
4, tgm
+

Samples where the target gain does not match between channels +

+
+
+
+ +
+
+

8.90 headphone

+ +

Apply head-related transfer functions (HRTFs) to create virtual +loudspeakers around the user for binaural listening via headphones. +The HRIRs are provided via additional streams, for each channel +one stereo input stream is needed. +

+

The filter accepts the following options: +

+
+
map
+

Set mapping of input streams for convolution. +The argument is a ’|’-separated list of channel names in order as they +are given as additional stream inputs for filter. +This also specify number of input streams. Number of input streams +must be not less than number of channels in first stream plus one. +

+
+
gain
+

Set gain applied to audio. Value is in dB. Default is 0. +

+
+
type
+

Set processing type. Can be time or freq. time is +processing audio in time domain which is slow. +freq is processing audio in frequency domain which is fast. +Default is freq. +

+
+
lfe
+

Set custom gain for LFE channels. Value is in dB. Default is 0. +

+
+
size
+

Set size of frame in number of samples which will be processed at once. +Default value is 1024. Allowed range is from 1024 to 96000. +

+
+
hrir
+

Set format of hrir stream. +Default value is stereo. Alternative value is multich. +If value is set to stereo, number of additional streams should +be greater or equal to number of input channels in first input stream. +Also each additional stream should have stereo number of channels. +If value is set to multich, number of additional streams should +be exactly one. Also number of input channels of additional stream +should be equal or greater than twice number of channels of first input +stream. +

+
+ + +
+

8.90.1 Examples

+ +
    +
  • Full example using wav files as coefficients with amovie filters for 7.1 downmix, +each amovie filter use stereo file with IR coefficients as input. +The files give coefficients for each position of virtual loudspeaker: +
    +
    ffmpeg -i input.wav
    +-filter_complex "amovie=azi_270_ele_0_DFC.wav[sr];amovie=azi_90_ele_0_DFC.wav[sl];amovie=azi_225_ele_0_DFC.wav[br];amovie=azi_135_ele_0_DFC.wav[bl];amovie=azi_0_ele_0_DFC.wav,asplit[fc][lfe];amovie=azi_35_ele_0_DFC.wav[fl];amovie=azi_325_ele_0_DFC.wav[fr];[0:a][fl][fr][fc][lfe][bl][br][sl][sr]headphone=FL|FR|FC|LFE|BL|BR|SL|SR"
    +output.wav
    +
    + +
  • Full example using wav files as coefficients with amovie filters for 7.1 downmix, +but now in multich hrir format. +
    +
    ffmpeg -i input.wav -filter_complex "amovie=minp.wav[hrirs];[0:a][hrirs]headphone=map=FL|FR|FC|LFE|BL|BR|SL|SR:hrir=multich"
    +output.wav
    +
    +
+ +
+
+
+

8.91 highpass

+ +

Apply a high-pass filter with 3dB point frequency. +The filter can be either single-pole, or double-pole (the default). +The filter roll off at 6dB per pole per octave (20dB per pole per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set frequency in Hz. Default is 3000. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +Applies only to double-pole filter. +The default is 0.707q and gives a Butterworth response. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

8.91.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change highpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change highpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change highpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change highpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

8.92 join

+ +

Join multiple input streams into one multi-channel stream. +

+

It accepts the following parameters: +

+
inputs
+

The number of input streams. It defaults to 2. +

+
+
channel_layout
+

The desired output channel layout. It defaults to stereo. +

+
+
map
+

Map channels from inputs to output. The argument is a ’|’-separated list of +mappings, each in the input_idx.in_channel-out_channel +form. input_idx is the 0-based index of the input stream. in_channel +can be either the name of the input channel (e.g. FL for front left) or its +index in the specified input stream. out_channel is the name of the output +channel. +

+
+ +

The filter will attempt to guess the mappings when they are not specified +explicitly. It does so by first trying to find an unused matching input channel +and if that fails it picks the first unused input channel. +

+

Join 3 inputs (with properly set channel layouts): +

+
ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
+
+ +

Build a 5.1 output from 6 single-channel streams: +

+
ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
+'join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-SL|4.0-SR|5.0-LFE'
+out
+
+ +
+
+

8.93 ladspa

+ +

Load a LADSPA (Linux Audio Developer’s Simple Plugin API) plugin. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-ladspa. +

+
+
file, f
+

Specifies the name of LADSPA plugin library to load. If the environment +variable LADSPA_PATH is defined, the LADSPA plugin is searched in +each one of the directories specified by the colon separated list in +LADSPA_PATH, otherwise in the standard LADSPA paths, which are in +this order: HOME/.ladspa/lib/, /usr/local/lib/ladspa/, +/usr/lib/ladspa/. +

+
+
plugin, p
+

Specifies the plugin within the library. Some libraries contain only +one plugin, but others contain many of them. If this is not set filter +will list all available plugins within the specified library. +

+
+
controls, c
+

Set the ’|’ separated list of controls which are zero or more floating point +values that determine the behavior of the loaded plugin (for example delay, +threshold or gain). +Controls need to be defined using the following syntax: +c0=value0|c1=value1|c2=value2|..., where +valuei is the value set on the i-th control. +Alternatively they can be also defined using the following syntax: +value0|value1|value2|..., where +valuei is the value set on the i-th control. +If controls is set to help, all available controls and +their valid ranges are printed. +

+
+
sample_rate, s
+

Specify the sample rate, default to 44100. Only used if plugin have +zero inputs. +

+
+
nb_samples, n
+

Set the number of samples per channel per each output frame, default +is 1024. Only used if plugin have zero inputs. +

+
+
duration, d
+

Set the minimum duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +Note that the resulting duration may be greater than the specified duration, +as the generated audio is always cut at the end of a complete frame. +If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +Only used if plugin have zero inputs. +

+
+
latency, l
+

Enable latency compensation, by default is disabled. +Only used if plugin have inputs. +

+
+ + +
+

8.93.1 Examples

+ +
    +
  • List all available plugins within amp (LADSPA example plugin) library: +
    +
    ladspa=file=amp
    +
    + +
  • List all available controls and their valid ranges for vcf_notch +plugin from VCF library: +
    +
    ladspa=f=vcf:p=vcf_notch:c=help
    +
    + +
  • Simulate low quality audio equipment using Computer Music Toolkit (CMT) +plugin library: +
    +
    ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
    +
    + +
  • Add reverberation to the audio using TAP-plugins +(Tom’s Audio Processing plugins): +
    +
    ladspa=file=tap_reverb:tap_reverb
    +
    + +
  • Generate white noise, with 0.2 amplitude: +
    +
    ladspa=file=cmt:noise_source_white:c=c0=.2
    +
    + +
  • Generate 20 bpm clicks using plugin C* Click - Metronome from the +C* Audio Plugin Suite (CAPS) library: +
    +
    ladspa=file=caps:Click:c=c1=20'
    +
    + +
  • Apply C* Eq10X2 - Stereo 10-band equaliser effect: +
    +
    ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
    +
    + +
  • Increase volume by 20dB using fast lookahead limiter from Steve Harris +SWH Plugins collection: +
    +
    ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
    +
    + +
  • Attenuate low frequencies using Multiband EQ from Steve Harris +SWH Plugins collection: +
    +
    ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
    +
    + +
  • Reduce stereo image using Narrower from the C* Audio Plugin Suite +(CAPS) library: +
    +
    ladspa=caps:Narrower
    +
    + +
  • Another white noise, now using C* Audio Plugin Suite (CAPS) library: +
    +
    ladspa=caps:White:.2
    +
    + +
  • Some fractal noise, using C* Audio Plugin Suite (CAPS) library: +
    +
    ladspa=caps:Fractal:c=c1=1
    +
    + +
  • Dynamic volume normalization using VLevel plugin: +
    +
    ladspa=vlevel-ladspa:vlevel_mono
    +
    +
+ +
+
+

8.93.2 Commands

+ +

This filter supports the following commands: +

+
cN
+

Modify the N-th control value. +

+

If the specified value is not valid, it is ignored and prior one is kept. +

+
+ +
+
+
+

8.94 loudnorm

+ +

EBU R128 loudness normalization. Includes both dynamic and linear normalization modes. +Support for both single pass (livestreams, files) and double pass (files) modes. +This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately +detect true peaks, the audio stream will be upsampled to 192 kHz. +Use the -ar option or aresample filter to explicitly set an output sample rate. +

+

The filter accepts the following options: +

+
+
I, i
+

Set integrated loudness target. +Range is -70.0 - -5.0. Default value is -24.0. +

+
+
LRA, lra
+

Set loudness range target. +Range is 1.0 - 50.0. Default value is 7.0. +

+
+
TP, tp
+

Set maximum true peak. +Range is -9.0 - +0.0. Default value is -2.0. +

+
+
measured_I, measured_i
+

Measured IL of input file. +Range is -99.0 - +0.0. +

+
+
measured_LRA, measured_lra
+

Measured LRA of input file. +Range is 0.0 - 99.0. +

+
+
measured_TP, measured_tp
+

Measured true peak of input file. +Range is -99.0 - +99.0. +

+
+
measured_thresh
+

Measured threshold of input file. +Range is -99.0 - +0.0. +

+
+
offset
+

Set offset gain. Gain is applied before the true-peak limiter. +Range is -99.0 - +99.0. Default is +0.0. +

+
+
linear
+

Normalize by linearly scaling the source audio. +measured_I, measured_LRA, measured_TP, +and measured_thresh must all be specified. Target LRA shouldn’t +be lower than source LRA and the change in integrated loudness shouldn’t +result in a true peak which exceeds the target TP. If any of these +conditions aren’t met, normalization mode will revert to dynamic. +Options are true or false. Default is true. +

+
+
dual_mono
+

Treat mono input files as "dual-mono". If a mono file is intended for playback +on a stereo system, its EBU R128 measurement will be perceptually incorrect. +If set to true, this option will compensate for this effect. +Multi-channel input files are not affected by this option. +Options are true or false. Default is false. +

+
+
print_format
+

Set print format for stats. Options are summary, json, or none. +Default value is none. +

+
+ +
+
+

8.95 lowpass

+ +

Apply a low-pass filter with 3dB point frequency. +The filter can be either single-pole or double-pole (the default). +The filter roll off at 6dB per pole per octave (20dB per pole per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set frequency in Hz. Default is 500. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +Applies only to double-pole filter. +The default is 0.707q and gives a Butterworth response. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

8.95.1 Examples

+
    +
  • Lowpass only LFE channel, it LFE is not present it does nothing: +
    +
    lowpass=c=LFE
    +
    +
+ +
+
+

8.95.2 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change lowpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change lowpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change lowpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change lowpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

8.96 lv2

+ +

Load a LV2 (LADSPA Version 2) plugin. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-lv2. +

+
+
plugin, p
+

Specifies the plugin URI. You may need to escape ’:’. +

+
+
controls, c
+

Set the ’|’ separated list of controls which are zero or more floating point +values that determine the behavior of the loaded plugin (for example delay, +threshold or gain). +If controls is set to help, all available controls and +their valid ranges are printed. +

+
+
sample_rate, s
+

Specify the sample rate, default to 44100. Only used if plugin have +zero inputs. +

+
+
nb_samples, n
+

Set the number of samples per channel per each output frame, default +is 1024. Only used if plugin have zero inputs. +

+
+
duration, d
+

Set the minimum duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +Note that the resulting duration may be greater than the specified duration, +as the generated audio is always cut at the end of a complete frame. +If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +Only used if plugin have zero inputs. +

+
+ + +
+

8.96.1 Examples

+ +
    +
  • Apply bass enhancer plugin from Calf: +
    +
    lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
    +
    + +
  • Apply vinyl plugin from Calf: +
    +
    lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
    +
    + +
  • Apply bit crusher plugin from ArtyFX: +
    +
    lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
    +
    +
+ +
+
+

8.96.2 Commands

+ +

This filter supports all options that are exported by plugin as commands. +

+
+
+
+

8.97 mcompand

+

Multiband Compress or expand the audio’s dynamic range. +

+

The input audio is divided into bands using 4th order Linkwitz-Riley IIRs. +This is akin to the crossover of a loudspeaker, and results in flat frequency +response when absent compander action. +

+

It accepts the following parameters: +

+
+
args
+

This option syntax is: +attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ... +For explanation of each item refer to compand filter documentation. +

+
+ +
+
+

8.98 pan

+ +

Mix channels with specific gain levels. The filter accepts the output +channel layout followed by a set of channels definitions. +

+

This filter is also designed to efficiently remap the channels of an audio +stream. +

+

The filter accepts parameters of the form: +"l|outdef|outdef|..." +

+
+
l
+

output channel layout or number of channels +

+
+
outdef
+

output channel specification, of the form: +"out_name=[gain*]in_name[(+-)[gain*]in_name...]" +

+
+
out_name
+

output channel to define, either a channel name (FL, FR, etc.) or a channel +number (c0, c1, etc.) +

+
+
gain
+

multiplicative coefficient for the channel, 1 leaving the volume unchanged +

+
+
in_name
+

input channel to use, see out_name for details; it is not possible to mix +named and numbered input channels +

+
+ +

If the ‘=’ in a channel specification is replaced by ‘<’, then the gains for +that specification will be renormalized so that the total is 1, thus +avoiding clipping noise. +

+ +
+

8.98.1 Mixing examples

+ +

For example, if you want to down-mix from stereo to mono, but with a bigger +factor for the left channel: +

+
pan=1c|c0=0.9*c0+0.1*c1
+
+ +

A customized down-mix to stereo that works automatically for 3-, 4-, 5- and +7-channels surround: +

+
pan=stereo| FL < FL + 0.5*FC + 0.6*BL + 0.6*SL | FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
+
+ +

Note that ffmpeg integrates a default down-mix (and up-mix) system +that should be preferred (see "-ac" option) unless you have very specific +needs. +

+
+
+

8.98.2 Remapping examples

+ +

The channel remapping will be effective if, and only if: +

+
    +
  • gain coefficients are zeroes or ones, +
  • only one input per channel output, +
+ +

If all these conditions are satisfied, the filter will notify the user ("Pure +channel mapping detected"), and use an optimized and lossless method to do the +remapping. +

+

For example, if you have a 5.1 source and want a stereo audio stream by +dropping the extra channels: +

+
pan="stereo| c0=FL | c1=FR"
+
+ +

Given the same source, you can also switch front left and front right channels +and keep the input channel layout: +

+
pan="5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5"
+
+ +

If the input is a stereo audio stream, you can mute the front left channel (and +still keep the stereo channel layout) with: +

+
pan="stereo|c1=c1"
+
+ +

Still with a stereo audio stream input, you can copy the right channel in both +front left and right: +

+
pan="stereo| c0=FR | c1=FR"
+
+ +
+
+
+

8.99 replaygain

+ +

ReplayGain scanner filter. This filter takes an audio stream as an input and +outputs it unchanged. +At end of filtering it displays track_gain and track_peak. +

+

The filter accepts the following exported read-only options: +

+
+
track_gain
+

Exported track gain in dB at end of stream. +

+
+
track_peak
+

Exported track peak at end of stream. +

+
+ +
+
+

8.100 resample

+ +

Convert the audio sample format, sample rate and channel layout. It is +not meant to be used directly. +

+
+
+

8.101 rubberband

+

Apply time-stretching and pitch-shifting with librubberband. +

+

To enable compilation of this filter, you need to configure FFmpeg with +--enable-librubberband. +

+

The filter accepts the following options: +

+
+
tempo
+

Set tempo scale factor. +

+
+
pitch
+

Set pitch scale factor. +

+
+
transients
+

Set transients detector. +Possible values are: +

+
crisp
+
mixed
+
smooth
+
+ +
+
detector
+

Set detector. +Possible values are: +

+
compound
+
percussive
+
soft
+
+ +
+
phase
+

Set phase. +Possible values are: +

+
laminar
+
independent
+
+ +
+
window
+

Set processing window size. +Possible values are: +

+
standard
+
short
+
long
+
+ +
+
smoothing
+

Set smoothing. +Possible values are: +

+
off
+
on
+
+ +
+
formant
+

Enable formant preservation when shift pitching. +Possible values are: +

+
shifted
+
preserved
+
+ +
+
pitchq
+

Set pitch quality. +Possible values are: +

+
quality
+
speed
+
consistency
+
+ +
+
channels
+

Set channels. +Possible values are: +

+
apart
+
together
+
+
+
+ + +
+

8.101.1 Commands

+ +

This filter supports the following commands: +

+
tempo
+

Change filter tempo scale factor. +Syntax for the command is : "tempo" +

+
+
pitch
+

Change filter pitch scale factor. +Syntax for the command is : "pitch" +

+
+ +
+
+
+

8.102 sidechaincompress

+ +

This filter acts like normal compressor but has the ability to compress +detected signal using second input signal. +It needs two input streams and returns one output stream. +First input stream will be processed depending on second stream signal. +The filtered signal then can be filtered with other filters in later stages of +processing. See pan and amerge filter. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. Default is 1. Range is between 0.015625 and 64. +

+
+
mode
+

Set mode of compressor operation. Can be upward or downward. +Default is downward. +

+
+
threshold
+

If a signal of second stream raises above this level it will affect the gain +reduction of first stream. +By default is 0.125. Range is between 0.00097563 and 1. +

+
+
ratio
+

Set a ratio about which the signal is reduced. 1:2 means that if the level +raised 4dB above the threshold, it will be only 2dB above after the reduction. +Default is 2. Range is between 1 and 20. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction starts. Default is 20. Range is between 0.01 and 2000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before +reduction is decreased again. Default is 250. Range is between 0.01 and 9000. +

+
+
makeup
+

Set the amount by how much signal will be amplified after processing. +Default is 1. Range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.82843. Range is between 1 and 8. +

+
+
link
+

Choose if the average level between all channels of side-chain stream +or the louder(maximum) channel of side-chain stream affects the +reduction. Default is average. +

+
+
detection
+

Should the exact signal be taken in case of peak or an RMS one in case +of rms. Default is rms which is mainly smoother. +

+
+
level_sc
+

Set sidechain gain. Default is 1. Range is between 0.015625 and 64. +

+
+
mix
+

How much to use compressed signal in output. Default is 1. +Range is between 0 and 1. +

+
+ + +
+

8.102.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

8.102.2 Examples

+ +
    +
  • Full ffmpeg example taking 2 audio inputs, 1st input to be compressed +depending on the signal of 2nd input and later compressed signal to be +merged with 2nd input: +
    +
    ffmpeg -i main.flac -i sidechain.flac -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge"
    +
    +
+ +
+
+
+

8.103 sidechaingate

+ +

A sidechain gate acts like a normal (wideband) gate but has the ability to +filter the detected signal before sending it to the gain reduction stage. +Normally a gate uses the full range signal to detect a level above the +threshold. +For example: If you cut all lower frequencies from your sidechain signal +the gate will decrease the volume of your track only if not enough highs +appear. With this technique you are able to reduce the resonation of a +natural drum or remove "rumbling" of muted strokes from a heavily distorted +guitar. +It needs two input streams and returns one output stream. +First input stream will be processed depending on second stream signal. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level before filtering. +Default is 1. Allowed range is from 0.015625 to 64. +

+
+
mode
+

Set the mode of operation. Can be upward or downward. +Default is downward. If set to upward mode, higher parts of signal +will be amplified, expanding dynamic range in upward direction. +Otherwise, in case of downward lower parts of signal will be reduced. +

+
+
range
+

Set the level of gain reduction when the signal is below the threshold. +Default is 0.06125. Allowed range is from 0 to 1. +Setting this to 0 disables reduction and then filter behaves like expander. +

+
+
threshold
+

If a signal rises above this level the gain reduction is released. +Default is 0.125. Allowed range is from 0 to 1. +

+
+
ratio
+

Set a ratio about which the signal is reduced. +Default is 2. Allowed range is from 1 to 9000. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction stops. +Default is 20 milliseconds. Allowed range is from 0.01 to 9000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before the +reduction is increased again. Default is 250 milliseconds. +Allowed range is from 0.01 to 9000. +

+
+
makeup
+

Set amount of amplification of signal after processing. +Default is 1. Allowed range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.828427125. Allowed range is from 1 to 8. +

+
+
detection
+

Choose if exact signal should be taken for detection or an RMS like one. +Default is rms. Can be peak or rms. +

+
+
link
+

Choose if the average level between all channels or the louder channel affects +the reduction. +Default is average. Can be average or maximum. +

+
+
level_sc
+

Set sidechain gain. Default is 1. Range is from 0.015625 to 64. +

+
+ + +
+

8.103.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

8.104 silencedetect

+ +

Detect silence in an audio stream. +

+

This filter logs a message when it detects that the input audio volume is less +or equal to a noise tolerance value for a duration greater or equal to the +minimum detected noise duration. +

+

The printed times and duration are expressed in seconds. The +lavfi.silence_start or lavfi.silence_start.X metadata key +is set on the first frame whose timestamp equals or exceeds the detection +duration and it contains the timestamp of the first frame of the silence. +

+

The lavfi.silence_duration or lavfi.silence_duration.X +and lavfi.silence_end or lavfi.silence_end.X metadata +keys are set on the first frame after the silence. If mono is +enabled, and each channel is evaluated separately, the .X +suffixed keys are used, and X corresponds to the channel number. +

+

The filter accepts the following options: +

+
+
noise, n
+

Set noise tolerance. Can be specified in dB (in case "dB" is appended to the +specified value) or amplitude ratio. Default is -60dB, or 0.001. +

+
+
duration, d
+

Set silence duration until notification (default is 2 seconds). See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+
+
mono, m
+

Process each channel separately, instead of combined. By default is disabled. +

+
+ + +
+

8.104.1 Examples

+ +
    +
  • Detect 5 seconds of silence with -50dB noise tolerance: +
    +
    silencedetect=n=-50dB:d=5
    +
    + +
  • Complete example with ffmpeg to detect silence with 0.0001 noise +tolerance in silence.mp3: +
    +
    ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
    +
    +
+ +
+
+
+

8.105 silenceremove

+ +

Remove silence from the beginning, middle or end of the audio. +

+

The filter accepts the following options: +

+
+
start_periods
+

This value is used to indicate if audio should be trimmed at beginning of +the audio. A value of zero indicates no silence should be trimmed from the +beginning. When specifying a non-zero value, it trims audio up until it +finds non-silence. Normally, when trimming silence from beginning of audio +the start_periods will be 1 but it can be increased to higher +values to trim all audio up to specific count of non-silence periods. +Default value is 0. +

+
+
start_duration
+

Specify the amount of time that non-silence must be detected before it stops +trimming audio. By increasing the duration, bursts of noises can be treated +as silence and trimmed off. Default value is 0. +

+
+
start_threshold
+

This indicates what sample value should be treated as silence. For digital +audio, a value of 0 may be fine but for audio recorded from analog, +you may wish to increase the value to account for background noise. +Can be specified in dB (in case "dB" is appended to the specified value) +or amplitude ratio. Default value is 0. +

+
+
start_silence
+

Specify max duration of silence at beginning that will be kept after +trimming. Default is 0, which is equal to trimming all samples detected +as silence. +

+
+
start_mode
+

Specify mode of detection of silence end in start of multi-channel audio. +Can be any or all. Default is any. +With any, any sample that is detected as non-silence will cause +stopped trimming of silence. +With all, only if all channels are detected as non-silence will cause +stopped trimming of silence. +

+
+
stop_periods
+

Set the count for trimming silence from the end of audio. +To remove silence from the middle of a file, specify a stop_periods +that is negative. This value is then treated as a positive value and is +used to indicate the effect should restart processing as specified by +start_periods, making it suitable for removing periods of silence +in the middle of the audio. +Default value is 0. +

+
+
stop_duration
+

Specify a duration of silence that must exist before audio is not copied any +more. By specifying a higher duration, silence that is wanted can be left in +the audio. +Default value is 0. +

+
+
stop_threshold
+

This is the same as start_threshold but for trimming silence from +the end of audio. +Can be specified in dB (in case "dB" is appended to the specified value) +or amplitude ratio. Default value is 0. +

+
+
stop_silence
+

Specify max duration of silence at end that will be kept after +trimming. Default is 0, which is equal to trimming all samples detected +as silence. +

+
+
stop_mode
+

Specify mode of detection of silence start in end of multi-channel audio. +Can be any or all. Default is any. +With any, any sample that is detected as non-silence will cause +stopped trimming of silence. +With all, only if all channels are detected as non-silence will cause +stopped trimming of silence. +

+
+
detection
+

Set how is silence detected. Can be rms or peak. Second is faster +and works better with digital silence which is exactly 0. +Default value is rms. +

+
+
window
+

Set duration in number of seconds used to calculate size of window in number +of samples for detecting silence. +Default value is 0.02. Allowed range is from 0 to 10. +

+
+ + +
+

8.105.1 Examples

+ +
    +
  • The following example shows how this filter can be used to start a recording +that does not contain the delay at the start which usually occurs between +pressing the record button and the start of the performance: +
    +
    silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
    +
    + +
  • Trim all silence encountered from beginning to end where there is more than 1 +second of silence in audio: +
    +
    silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
    +
    + +
  • Trim all digital silence samples, using peak detection, from beginning to end +where there is more than 0 samples of digital silence in audio and digital +silence is detected in all channels at same positions in stream: +
    +
    silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
    +
    +
+ +
+
+
+

8.106 sofalizer

+ +

SOFAlizer uses head-related transfer functions (HRTFs) to create virtual +loudspeakers around the user for binaural listening via headphones (audio +formats up to 9 channels supported). +The HRTFs are stored in SOFA files (see http://www.sofacoustics.org/ for a database). +SOFAlizer is developed at the Acoustics Research Institute (ARI) of the +Austrian Academy of Sciences. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libmysofa. +

+

The filter accepts the following options: +

+
+
sofa
+

Set the SOFA file used for rendering. +

+
+
gain
+

Set gain applied to audio. Value is in dB. Default is 0. +

+
+
rotation
+

Set rotation of virtual loudspeakers in deg. Default is 0. +

+
+
elevation
+

Set elevation of virtual speakers in deg. Default is 0. +

+
+
radius
+

Set distance in meters between loudspeakers and the listener with near-field +HRTFs. Default is 1. +

+
+
type
+

Set processing type. Can be time or freq. time is +processing audio in time domain which is slow. +freq is processing audio in frequency domain which is fast. +Default is freq. +

+
+
speakers
+

Set custom positions of virtual loudspeakers. Syntax for this option is: +<CH> <AZIM> <ELEV>[|<CH> <AZIM> <ELEV>|...]. +Each virtual loudspeaker is described with short channel name following with +azimuth and elevation in degrees. +Each virtual loudspeaker description is separated by ’|’. +For example to override front left and front right channel positions use: +’speakers=FL 45 15|FR 345 15’. +Descriptions with unrecognised channel names are ignored. +

+
+
lfegain
+

Set custom gain for LFE channels. Value is in dB. Default is 0. +

+
+
framesize
+

Set custom frame size in number of samples. Default is 1024. +Allowed range is from 1024 to 96000. Only used if option ‘type’ +is set to freq. +

+
+
normalize
+

Should all IRs be normalized upon importing SOFA file. +By default is enabled. +

+
+
interpolate
+

Should nearest IRs be interpolated with neighbor IRs if exact position +does not match. By default is disabled. +

+
+
minphase
+

Minphase all IRs upon loading of SOFA file. By default is disabled. +

+
+
anglestep
+

Set neighbor search angle step. Only used if option interpolate is enabled. +

+
+
radstep
+

Set neighbor search radius step. Only used if option interpolate is enabled. +

+
+ + +
+

8.106.1 Examples

+ +
    +
  • Using ClubFritz6 sofa file: +
    +
    sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
    +
    + +
  • Using ClubFritz12 sofa file and bigger radius with small rotation: +
    +
    sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
    +
    + +
  • Similar as above but with custom speaker positions for front left, front right, back left and back right +and also with custom gain: +
    +
    "sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|BL 135|BR 225:gain=28"
    +
    +
+ +
+
+
+

8.107 speechnorm

+

Speech Normalizer. +

+

This filter expands or compresses each half-cycle of audio samples +(local set of samples all above or all below zero and between two nearest zero crossings) depending +on threshold value, so audio reaches target peak value under conditions controlled by below options. +

+

The filter accepts the following options: +

+
+
peak, p
+

Set the expansion target peak value. This specifies the highest allowed absolute amplitude +level for the normalized audio input. Default value is 0.95. Allowed range is from 0.0 to 1.0. +

+
+
expansion, e
+

Set the maximum expansion factor. Allowed range is from 1.0 to 50.0. Default value is 2.0. +This option controls maximum local half-cycle of samples expansion. The maximum expansion +would be such that local peak value reaches target peak value but never to surpass it and that +ratio between new and previous peak value does not surpass this option value. +

+
+
compression, c
+

Set the maximum compression factor. Allowed range is from 1.0 to 50.0. Default value is 2.0. +This option controls maximum local half-cycle of samples compression. This option is used +only if threshold option is set to value greater than 0.0, then in such cases +when local peak is lower or same as value set by threshold all samples belonging to +that peak’s half-cycle will be compressed by current compression factor. +

+
+
threshold, t
+

Set the threshold value. Default value is 0.0. Allowed range is from 0.0 to 1.0. +This option specifies which half-cycles of samples will be compressed and which will be expanded. +Any half-cycle samples with their local peak value below or same as this option value will be +compressed by current compression factor, otherwise, if greater than threshold value they will be +expanded with expansion factor so that it could reach peak target value but never surpass it. +

+
+
raise, r
+

Set the expansion raising amount per each half-cycle of samples. Default value is 0.001. +Allowed range is from 0.0 to 1.0. This controls how fast expansion factor is raised per +each new half-cycle until it reaches expansion value. +Setting this options too high may lead to distortions. +

+
+
fall, f
+

Set the compression raising amount per each half-cycle of samples. Default value is 0.001. +Allowed range is from 0.0 to 1.0. This controls how fast compression factor is raised per +each new half-cycle until it reaches compression value. +

+
+
channels, h
+

Specify which channels to filter, by default all available channels are filtered. +

+
+
invert, i
+

Enable inverted filtering, by default is disabled. This inverts interpretation of threshold +option. When enabled any half-cycle of samples with their local peak value below or same as +threshold option will be expanded otherwise it will be compressed. +

+
+
link, l
+

Link channels when calculating gain applied to each filtered channel sample, by default is disabled. +When disabled each filtered channel gain calculation is independent, otherwise when this option +is enabled the minimum of all possible gains for each filtered channel is used. +

+
+
rms, m
+

Set the expansion target RMS value. This specifies the highest allowed RMS level for the normalized +audio input. Default value is 0.0, thus disabled. Allowed range is from 0.0 to 1.0. +

+
+ + +
+

8.107.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

8.107.2 Examples

+ +
    +
  • Weak and slow amplification: +
    +
    speechnorm=e=3:r=0.00001:l=1
    +
    + +
  • Moderate and slow amplification: +
    +
    speechnorm=e=6.25:r=0.00001:l=1
    +
    + +
  • Strong and fast amplification: +
    +
    speechnorm=e=12.5:r=0.0001:l=1
    +
    + +
  • Very strong and fast amplification: +
    +
    speechnorm=e=25:r=0.0001:l=1
    +
    + +
  • Extreme and fast amplification: +
    +
    speechnorm=e=50:r=0.0001:l=1
    +
    +
+ +
+
+
+

8.108 stereotools

+ +

This filter has some handy utilities to manage stereo signals, for converting +M/S stereo recordings to L/R signal while having control over the parameters +or spreading the stereo image of master track. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level before filtering for both channels. Defaults is 1. +Allowed range is from 0.015625 to 64. +

+
+
level_out
+

Set output level after filtering for both channels. Defaults is 1. +Allowed range is from 0.015625 to 64. +

+
+
balance_in
+

Set input balance between both channels. Default is 0. +Allowed range is from -1 to 1. +

+
+
balance_out
+

Set output balance between both channels. Default is 0. +Allowed range is from -1 to 1. +

+
+
softclip
+

Enable softclipping. Results in analog distortion instead of harsh digital 0dB +clipping. Disabled by default. +

+
+
mutel
+

Mute the left channel. Disabled by default. +

+
+
muter
+

Mute the right channel. Disabled by default. +

+
+
phasel
+

Change the phase of the left channel. Disabled by default. +

+
+
phaser
+

Change the phase of the right channel. Disabled by default. +

+
+
mode
+

Set stereo mode. Available values are: +

+
+
lr>lr
+

Left/Right to Left/Right, this is default. +

+
+
lr>ms
+

Left/Right to Mid/Side. +

+
+
ms>lr
+

Mid/Side to Left/Right. +

+
+
lr>ll
+

Left/Right to Left/Left. +

+
+
lr>rr
+

Left/Right to Right/Right. +

+
+
lr>l+r
+

Left/Right to Left + Right. +

+
+
lr>rl
+

Left/Right to Right/Left. +

+
+
ms>ll
+

Mid/Side to Left/Left. +

+
+
ms>rr
+

Mid/Side to Right/Right. +

+
+
ms>rl
+

Mid/Side to Right/Left. +

+
+
lr>l-r
+

Left/Right to Left - Right. +

+
+ +
+
slev
+

Set level of side signal. Default is 1. +Allowed range is from 0.015625 to 64. +

+
+
sbal
+

Set balance of side signal. Default is 0. +Allowed range is from -1 to 1. +

+
+
mlev
+

Set level of the middle signal. Default is 1. +Allowed range is from 0.015625 to 64. +

+
+
mpan
+

Set middle signal pan. Default is 0. Allowed range is from -1 to 1. +

+
+
base
+

Set stereo base between mono and inversed channels. Default is 0. +Allowed range is from -1 to 1. +

+
+
delay
+

Set delay in milliseconds how much to delay left from right channel and +vice versa. Default is 0. Allowed range is from -20 to 20. +

+
+
sclevel
+

Set S/C level. Default is 1. Allowed range is from 1 to 100. +

+
+
phase
+

Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360. +

+
+
bmode_in, bmode_out
+

Set balance mode for balance_in/balance_out option. +

+

Can be one of the following: +

+
+
balance
+

Classic balance mode. Attenuate one channel at time. +Gain is raised up to 1. +

+
+
amplitude
+

Similar as classic mode above but gain is raised up to 2. +

+
+
power
+

Equal power distribution, from -6dB to +6dB range. +

+
+
+
+ + +
+

8.108.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

8.108.2 Examples

+ +
    +
  • Apply karaoke like effect: +
    +
    stereotools=mlev=0.015625
    +
    + +
  • Convert M/S signal to L/R: +
    +
    "stereotools=mode=ms>lr"
    +
    +
+ +
+
+
+

8.109 stereowiden

+ +

This filter enhance the stereo effect by suppressing signal common to both +channels and by delaying the signal of left into right and vice versa, +thereby widening the stereo effect. +

+

The filter accepts the following options: +

+
+
delay
+

Time in milliseconds of the delay of left signal into right and vice versa. +Default is 20 milliseconds. +

+
+
feedback
+

Amount of gain in delayed signal into right and vice versa. Gives a delay +effect of left signal in right output and vice versa which gives widening +effect. Default is 0.3. +

+
+
crossfeed
+

Cross feed of left into right with inverted phase. This helps in suppressing +the mono. If the value is 1 it will cancel all the signal common to both +channels. Default is 0.3. +

+
+
drymix
+

Set level of input signal of original channel. Default is 0.8. +

+
+ + +
+

8.109.1 Commands

+ +

This filter supports the all above options except delay as commands. +

+
+
+
+

8.110 superequalizer

+

Apply 18 band equalizer. +

+

The filter accepts the following options: +

+
1b
+

Set 65Hz band gain. +

+
2b
+

Set 92Hz band gain. +

+
3b
+

Set 131Hz band gain. +

+
4b
+

Set 185Hz band gain. +

+
5b
+

Set 262Hz band gain. +

+
6b
+

Set 370Hz band gain. +

+
7b
+

Set 523Hz band gain. +

+
8b
+

Set 740Hz band gain. +

+
9b
+

Set 1047Hz band gain. +

+
10b
+

Set 1480Hz band gain. +

+
11b
+

Set 2093Hz band gain. +

+
12b
+

Set 2960Hz band gain. +

+
13b
+

Set 4186Hz band gain. +

+
14b
+

Set 5920Hz band gain. +

+
15b
+

Set 8372Hz band gain. +

+
16b
+

Set 11840Hz band gain. +

+
17b
+

Set 16744Hz band gain. +

+
18b
+

Set 20000Hz band gain. +

+
+ +
+
+

8.111 surround

+

Apply audio surround upmix filter. +

+

This filter allows to produce multichannel output from audio stream. +

+

The filter accepts the following options: +

+
+
chl_out
+

Set output channel layout. By default, this is 5.1. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+
chl_in
+

Set input channel layout. By default, this is stereo. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+
level_in
+

Set input volume level. By default, this is 1. +

+
+
level_out
+

Set output volume level. By default, this is 1. +

+
+
lfe
+

Enable LFE channel output if output channel layout has it. By default, this is enabled. +

+
+
lfe_low
+

Set LFE low cut off frequency. By default, this is 128 Hz. +

+
+
lfe_high
+

Set LFE high cut off frequency. By default, this is 256 Hz. +

+
+
lfe_mode
+

Set LFE mode, can be add or sub. Default is add. +In add mode, LFE channel is created from input audio and added to output. +In sub mode, LFE channel is created from input audio and added to output but +also all non-LFE output channels are subtracted with output LFE channel. +

+
+
smooth
+

Set temporal smoothness strength, used to gradually change factors when transforming +stereo sound in time. Allowed range is from 0.0 to 1.0. +Useful to improve output quality with focus option values greater than 0.0. +Default is 0.0. Only values inside this range and without edges are effective. +

+
+
angle
+

Set angle of stereo surround transform, Allowed range is from 0 to 360. +Default is 90. +

+
+
focus
+

Set focus of stereo surround transform, Allowed range is from -1 to 1. +Default is 0. +

+
+
fc_in
+

Set front center input volume. By default, this is 1. +

+
+
fc_out
+

Set front center output volume. By default, this is 1. +

+
+
fl_in
+

Set front left input volume. By default, this is 1. +

+
+
fl_out
+

Set front left output volume. By default, this is 1. +

+
+
fr_in
+

Set front right input volume. By default, this is 1. +

+
+
fr_out
+

Set front right output volume. By default, this is 1. +

+
+
sl_in
+

Set side left input volume. By default, this is 1. +

+
+
sl_out
+

Set side left output volume. By default, this is 1. +

+
+
sr_in
+

Set side right input volume. By default, this is 1. +

+
+
sr_out
+

Set side right output volume. By default, this is 1. +

+
+
bl_in
+

Set back left input volume. By default, this is 1. +

+
+
bl_out
+

Set back left output volume. By default, this is 1. +

+
+
br_in
+

Set back right input volume. By default, this is 1. +

+
+
br_out
+

Set back right output volume. By default, this is 1. +

+
+
bc_in
+

Set back center input volume. By default, this is 1. +

+
+
bc_out
+

Set back center output volume. By default, this is 1. +

+
+
lfe_in
+

Set LFE input volume. By default, this is 1. +

+
+
lfe_out
+

Set LFE output volume. By default, this is 1. +

+
+
allx
+

Set spread usage of stereo image across X axis for all channels. +Allowed range is from -1 to 15. +By default this value is negative -1, and thus unused. +

+
+
ally
+

Set spread usage of stereo image across Y axis for all channels. +Allowed range is from -1 to 15. +By default this value is negative -1, and thus unused. +

+
+
fcx, flx, frx, blx, brx, slx, srx, bcx
+

Set spread usage of stereo image across X axis for each channel. +Allowed range is from 0.06 to 15. +By default this value is 0.5. +

+
+
fcy, fly, fry, bly, bry, sly, sry, bcy
+

Set spread usage of stereo image across Y axis for each channel. +Allowed range is from 0.06 to 15. +By default this value is 0.5. +

+
+
win_size
+

Set window size. Allowed range is from 1024 to 65536. Default size is 4096. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann, hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hann. +

+
+
overlap
+

Set window overlap. If set to 1, the recommended overlap for selected +window function will be picked. Default is 0.5. +

+
+ +
+
+

8.112 tiltshelf

+ +

Boost or cut the lower frequencies and cut or boost higher frequencies +of the audio using a two-pole shelving filter with a response similar to +that of a standard hi-fi’s tone-controls. +This is also known as shelving equalisation (EQ). +

+

The filter accepts the following options: +

+
+
gain, g
+

Give the gain at 0 Hz. Its useful range is about -20 +(for a large cut) to +20 (for a large boost). +Beware of clipping when using a positive gain. +

+
+
frequency, f
+

Set the filter’s central frequency and so can be used +to extend or reduce the frequency range to be boosted or cut. +The default value is 3000 Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Determine how steep is the filter’s shelf transition. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

8.112.1 Commands

+ +

This filter supports some options as commands. +

+
+
+
+

8.113 treble, highshelf

+ +

Boost or cut treble (upper) frequencies of the audio using a two-pole +shelving filter with a response similar to that of a standard +hi-fi’s tone-controls. This is also known as shelving equalisation (EQ). +

+

The filter accepts the following options: +

+
+
gain, g
+

Give the gain at whichever is the lower of ~22 kHz and the +Nyquist frequency. Its useful range is about -20 (for a large cut) +to +20 (for a large boost). Beware of clipping when using a positive gain. +

+
+
frequency, f
+

Set the filter’s central frequency and so can be used +to extend or reduce the frequency range to be boosted or cut. +The default value is 3000 Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Determine how steep is the filter’s shelf transition. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

8.113.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change treble frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change treble width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change treble width. +Syntax for the command is : "width" +

+
+
gain, g
+

Change treble gain. +Syntax for the command is : "gain" +

+
+
mix, m
+

Change treble mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

8.114 tremolo

+ +

Sinusoidal amplitude modulation. +

+

The filter accepts the following options: +

+
+
f
+

Modulation frequency in Hertz. Modulation frequencies in the subharmonic range +(20 Hz or lower) will result in a tremolo effect. +This filter may also be used as a ring modulator by specifying +a modulation frequency higher than 20 Hz. +Range is 0.1 - 20000.0. Default value is 5.0 Hz. +

+
+
d
+

Depth of modulation as a percentage. Range is 0.0 - 1.0. +Default value is 0.5. +

+
+ +
+
+

8.115 vibrato

+ +

Sinusoidal phase modulation. +

+

The filter accepts the following options: +

+
+
f
+

Modulation frequency in Hertz. +Range is 0.1 - 20000.0. Default value is 5.0 Hz. +

+
+
d
+

Depth of modulation as a percentage. Range is 0.0 - 1.0. +Default value is 0.5. +

+
+ +
+
+

8.116 virtualbass

+ +

Apply audio Virtual Bass filter. +

+

This filter accepts stereo input and produce stereo with LFE (2.1) channels output. +The newly produced LFE channel have enhanced virtual bass originally obtained from both stereo channels. +This filter outputs front left and front right channels unchanged as available in stereo input. +

+

The filter accepts the following options: +

+
+
cutoff
+

Set the virtual bass cutoff frequency. Default value is 250 Hz. +Allowed range is from 100 to 500 Hz. +

+
+
strength
+

Set the virtual bass strength. Allowed range is from 0.5 to 3. +Default value is 3. +

+
+ +
+
+

8.117 volume

+ +

Adjust the input audio volume. +

+

It accepts the following parameters: +

+
volume
+

Set audio volume expression. +

+

Output values are clipped to the maximum value. +

+

The output audio volume is given by the relation: +

+
output_volume = volume * input_volume
+
+ +

The default value for volume is "1.0". +

+
+
precision
+

This parameter represents the mathematical precision. +

+

It determines which input sample formats will be allowed, which affects the +precision of the volume scaling. +

+
+
fixed
+

8-bit fixed-point; this limits input sample format to U8, S16, and S32. +

+
float
+

32-bit floating-point; this limits input sample format to FLT. (default) +

+
double
+

64-bit floating-point; this limits input sample format to DBL. +

+
+ +
+
replaygain
+

Choose the behaviour on encountering ReplayGain side data in input frames. +

+
+
drop
+

Remove ReplayGain side data, ignoring its contents (the default). +

+
+
ignore
+

Ignore ReplayGain side data, but leave it in the frame. +

+
+
track
+

Prefer the track gain, if present. +

+
+
album
+

Prefer the album gain, if present. +

+
+ +
+
replaygain_preamp
+

Pre-amplification gain in dB to apply to the selected replaygain gain. +

+

Default value for replaygain_preamp is 0.0. +

+
+
replaygain_noclip
+

Prevent clipping by limiting the gain applied. +

+

Default value for replaygain_noclip is 1. +

+
+
eval
+

Set when the volume expression is evaluated. +

+

It accepts the following values: +

+
once
+

only evaluate expression once during the filter initialization, or +when the ‘volume’ command is sent +

+
+
frame
+

evaluate expression for each incoming frame +

+
+ +

Default value is ‘once’. +

+
+ +

The volume expression can contain the following parameters. +

+
+
n
+

frame number (starting at zero) +

+
nb_channels
+

number of channels +

+
nb_consumed_samples
+

number of samples consumed by the filter +

+
nb_samples
+

number of samples in the current frame +

+
pos
+

original frame position in the file; deprecated, do not use +

+
pts
+

frame PTS +

+
sample_rate
+

sample rate +

+
startpts
+

PTS at start of stream +

+
startt
+

time at start of stream +

+
t
+

frame time +

+
tb
+

timestamp timebase +

+
volume
+

last set volume value +

+
+ +

Note that when eval is set to ‘once’ only the +sample_rate and tb variables are available, all other +variables will evaluate to NAN. +

+ +
+

8.117.1 Commands

+ +

This filter supports the following commands: +

+
volume
+

Modify the volume expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+

8.117.2 Examples

+ +
    +
  • Halve the input audio volume: +
    +
    volume=volume=0.5
    +volume=volume=1/2
    +volume=volume=-6.0206dB
    +
    + +

    In all the above example the named key for volume can be +omitted, for example like in: +

    +
    volume=0.5
    +
    + +
  • Increase input audio power by 6 decibels using fixed-point precision: +
    +
    volume=volume=6dB:precision=fixed
    +
    + +
  • Fade volume after time 10 with an annihilation period of 5 seconds: +
    +
    volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
    +
    +
+ +
+
+
+

8.118 volumedetect

+ +

Detect the volume of the input video. +

+

The filter has no parameters. It supports only 16-bit signed integer samples, +so the input will be converted when needed. Statistics about the volume will +be printed in the log when the input stream end is reached. +

+

In particular it will show the mean volume (root mean square), maximum +volume (on a per-sample basis), and the beginning of a histogram of the +registered volume values (from the maximum value to a cumulated 1/1000 of +the samples). +

+

All volumes are in decibels relative to the maximum PCM value. +

+ +
+

8.118.1 Examples

+ +

Here is an excerpt of the output: +

+
[Parsed_volumedetect_0  0xa23120] mean_volume: -27 dB
+[Parsed_volumedetect_0  0xa23120] max_volume: -4 dB
+[Parsed_volumedetect_0  0xa23120] histogram_4db: 6
+[Parsed_volumedetect_0  0xa23120] histogram_5db: 62
+[Parsed_volumedetect_0  0xa23120] histogram_6db: 286
+[Parsed_volumedetect_0  0xa23120] histogram_7db: 1042
+[Parsed_volumedetect_0  0xa23120] histogram_8db: 2551
+[Parsed_volumedetect_0  0xa23120] histogram_9db: 4609
+[Parsed_volumedetect_0  0xa23120] histogram_10db: 8409
+
+ +

It means that: +

    +
  • The mean square energy is approximately -27 dB, or 10^-2.7. +
  • The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB. +
  • There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc. +
+ +

In other words, raising the volume by +4 dB does not cause any clipping, +raising it by +5 dB causes clipping for 6 samples, etc. +

+ +
+
+
+
+

9 Audio Sources

+ +

Below is a description of the currently available audio sources. +

+ +
+

9.1 abuffer

+ +

Buffer audio frames, and make them available to the filter chain. +

+

This source is mainly intended for a programmatic use, in particular +through the interface defined in libavfilter/buffersrc.h. +

+

It accepts the following parameters: +

+
time_base
+

The timebase which will be used for timestamps of submitted frames. It must be +either a floating-point number or in numerator/denominator form. +

+
+
sample_rate
+

The sample rate of the incoming audio buffers. +

+
+
sample_fmt
+

The sample format of the incoming audio buffers. +Either a sample format name or its corresponding integer representation from +the enum AVSampleFormat in libavutil/samplefmt.h +

+
+
channel_layout
+

The channel layout of the incoming audio buffers. +Either a channel layout name from channel_layout_map in +libavutil/channel_layout.c or its corresponding integer representation +from the AV_CH_LAYOUT_* macros in libavutil/channel_layout.h +

+
+
channels
+

The number of channels of the incoming audio buffers. +If both channels and channel_layout are specified, then they +must be consistent. +

+
+
+ + +
+

9.1.1 Examples

+ +
+
abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
+
+ +

will instruct the source to accept planar 16bit signed stereo at 44100Hz. +Since the sample format with name "s16p" corresponds to the number +6 and the "stereo" channel layout corresponds to the value 0x3, this is +equivalent to: +

+
abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
+
+ +
+
+
+

9.2 aevalsrc

+ +

Generate an audio signal specified by an expression. +

+

This source accepts in input one or more expressions (one for each +channel), which are evaluated and used to generate a corresponding +audio signal. +

+

This source accepts the following options: +

+
+
exprs
+

Set the ’|’-separated expressions list for each separate channel. In case the +channel_layout option is not specified, the selected channel layout +depends on the number of provided expressions. Otherwise the last +specified expression is applied to the remaining output channels. +

+
+
channel_layout, c
+

Set the channel layout. The number of channels in the specified layout +must be equal to the number of specified expressions. +

+
+
duration, d
+

Set the minimum duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +Note that the resulting duration may be greater than the specified +duration, as the generated audio is always cut at the end of a +complete frame. +

+

If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +

+
+
nb_samples, n
+

Set the number of samples per channel per each output frame, +default to 1024. +

+
+
sample_rate, s
+

Specify the sample rate, default to 44100. +

+
+ +

Each expression in exprs can contain the following constants: +

+
+
n
+

number of the evaluated sample, starting from 0 +

+
+
t
+

time of the evaluated sample expressed in seconds, starting from 0 +

+
+
s
+

sample rate +

+
+
+ + +
+

9.2.1 Examples

+ +
    +
  • Generate silence: +
    +
    aevalsrc=0
    +
    + +
  • Generate a sin signal with frequency of 440 Hz, set sample rate to +8000 Hz: +
    +
    aevalsrc="sin(440*2*PI*t):s=8000"
    +
    + +
  • Generate a two channels signal, specify the channel layout (Front +Center + Back Center) explicitly: +
    +
    aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
    +
    + +
  • Generate white noise: +
    +
    aevalsrc="-2+random(0)"
    +
    + +
  • Generate an amplitude modulated signal: +
    +
    aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
    +
    + +
  • Generate 2.5 Hz binaural beats on a 360 Hz carrier: +
    +
    aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
    +
    + +
+ +
+
+
+

9.3 afdelaysrc

+ +

Generate a fractional delay FIR coefficients. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
delay, d
+

Set the fractional delay. Default is 0. +

+
+
sample_rate, r
+

Set the sample rate, default is 44100. +

+
+
nb_samples, n
+

Set the number of samples per each frame. Default is 1024. +

+
+
taps, t
+

Set the number of filter coefficents in output audio stream. +Default value is 0. +

+
+
channel_layout, c
+

Specifies the channel layout, and can be a string representing a channel layout. +The default value of channel_layout is "stereo". +

+
+ +
+
+

9.4 afireqsrc

+ +

Generate a FIR equalizer coefficients. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
preset, p
+

Set equalizer preset. +Default preset is flat. +

+

Available presets are: +

+
custom
+
flat
+
acoustic
+
bass
+
beats
+
classic
+
clear
+
deep bass
+
dubstep
+
electronic
+
hard-style
+
hip-hop
+
jazz
+
metal
+
movie
+
pop
+
r&b
+
rock
+
vocal booster
+
+ +
+
gains, g
+

Set custom gains for each band. Only used if the preset option is set to custom. +Gains are separated by white spaces and each gain is set in dBFS. +Default is 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0. +

+
+
bands, b
+

Set the custom bands from where custon equalizer gains are set. +This must be in strictly increasing order. Only used if the preset option is set to custom. +Bands are separated by white spaces and each band represent frequency in Hz. +Default is 25 40 63 100 160 250 400 630 1000 1600 2500 4000 6300 10000 16000 24000. +

+
+
taps, t
+

Set number of filter coefficents in output audio stream. +Default value is 4096. +

+
+
sample_rate, r
+

Set sample rate of output audio stream, default is 44100. +

+
+
nb_samples, n
+

Set number of samples per each frame in output audio stream. Default is 1024. +

+
+
interp, i
+

Set interpolation method for FIR equalizer coefficients. Can be linear or cubic. +

+
+
phase, h
+

Set phase type of FIR filter. Can be linear or min: minimum-phase. +Default is minimum-phase filter. +

+
+ +
+
+

9.5 afirsrc

+ +

Generate a FIR coefficients using frequency sampling method. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
taps, t
+

Set number of filter coefficents in output audio stream. +Default value is 1025. +

+
+
frequency, f
+

Set frequency points from where magnitude and phase are set. +This must be in non decreasing order, and first element must be 0, while last element +must be 1. Elements are separated by white spaces. +

+
+
magnitude, m
+

Set magnitude value for every frequency point set by frequency. +Number of values must be same as number of frequency points. +Values are separated by white spaces. +

+
+
phase, p
+

Set phase value for every frequency point set by frequency. +Number of values must be same as number of frequency points. +Values are separated by white spaces. +

+
+
sample_rate, r
+

Set sample rate, default is 44100. +

+
+
nb_samples, n
+

Set number of samples per each frame. Default is 1024. +

+
+
win_func, w
+

Set window function. Default is blackman. +

+
+ +
+
+

9.6 anullsrc

+ +

The null audio source, return unprocessed audio frames. It is mainly useful +as a template and to be employed in analysis / debugging tools, or as +the source for filters which ignore the input data (for example the sox +synth filter). +

+

This source accepts the following options: +

+
+
channel_layout, cl
+
+

Specifies the channel layout, and can be either an integer or a string +representing a channel layout. The default value of channel_layout +is "stereo". +

+

Check the channel_layout_map definition in +libavutil/channel_layout.c for the mapping between strings and +channel layout values. +

+
+
sample_rate, r
+

Specifies the sample rate, and defaults to 44100. +

+
+
nb_samples, n
+

Set the number of samples per requested frames. +

+
+
duration, d
+

Set the duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +

+
+ + +
+

9.6.1 Examples

+ +
    +
  • Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO. +
    +
    anullsrc=r=48000:cl=4
    +
    + +
  • Do the same operation with a more obvious syntax: +
    +
    anullsrc=r=48000:cl=mono
    +
    +
+ +

All the parameters need to be explicitly defined. +

+
+
+
+

9.7 flite

+ +

Synthesize a voice utterance using the libflite library. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libflite. +

+

Note that versions of the flite library prior to 2.0 are not thread-safe. +

+

The filter accepts the following options: +

+
+
list_voices
+

If set to 1, list the names of the available voices and exit +immediately. Default value is 0. +

+
+
nb_samples, n
+

Set the maximum number of samples per frame. Default value is 512. +

+
+
textfile
+

Set the filename containing the text to speak. +

+
+
text
+

Set the text to speak. +

+
+
voice, v
+

Set the voice to use for the speech synthesis. Default value is +kal. See also the list_voices option. +

+
+ + +
+

9.7.1 Examples

+ +
    +
  • Read from file speech.txt, and synthesize the text using the +standard flite voice: +
    +
    flite=textfile=speech.txt
    +
    + +
  • Read the specified text selecting the slt voice: +
    +
    flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
    +
    + +
  • Input text to ffmpeg: +
    +
    ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
    +
    + +
  • Make ffplay speak the specified text, using flite and +the lavfi device: +
    +
    ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
    +
    +
+ +

For more information about libflite, check: +http://www.festvox.org/flite/ +

+
+
+
+

9.8 anoisesrc

+ +

Generate a noise audio signal. +

+

The filter accepts the following options: +

+
+
sample_rate, r
+

Specify the sample rate. Default value is 48000 Hz. +

+
+
amplitude, a
+

Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value +is 1.0. +

+
+
duration, d
+

Specify the duration of the generated audio stream. Not specifying this option +results in noise with an infinite length. +

+
+
color, colour, c
+

Specify the color of noise. Available noise colors are white, pink, brown, +blue, violet and velvet. Default color is white. +

+
+
seed, s
+

Specify a value used to seed the PRNG. +

+
+
nb_samples, n
+

Set the number of samples per each output frame, default is 1024. +

+
+
density
+

Set the density (0.0 - 1.0) for the velvet noise generator, default is 0.05. +

+
+ + +
+

9.8.1 Examples

+ +
    +
  • Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5: +
    +
    anoisesrc=d=60:c=pink:r=44100:a=0.5
    +
    +
+ +
+
+
+

9.9 hilbert

+ +

Generate odd-tap Hilbert transform FIR coefficients. +

+

The resulting stream can be used with afir filter for phase-shifting +the signal by 90 degrees. +

+

This is used in many matrix coding schemes and for analytic signal generation. +The process is often written as a multiplication by i (or j), the imaginary unit. +

+

The filter accepts the following options: +

+
+
sample_rate, s
+

Set sample rate, default is 44100. +

+
+
taps, t
+

Set length of FIR filter, default is 22051. +

+
+
nb_samples, n
+

Set number of samples per each frame. +

+
+
win_func, w
+

Set window function to be used when generating FIR coefficients. +

+
+ +
+
+

9.10 sinc

+ +

Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
sample_rate, r
+

Set sample rate, default is 44100. +

+
+
nb_samples, n
+

Set number of samples per each frame. Default is 1024. +

+
+
hp
+

Set high-pass frequency. Default is 0. +

+
+
lp
+

Set low-pass frequency. Default is 0. +If high-pass frequency is lower than low-pass frequency and low-pass frequency +is higher than 0 then filter will create band-pass filter coefficients, +otherwise band-reject filter coefficients. +

+
+
phase
+

Set filter phase response. Default is 50. Allowed range is from 0 to 100. +

+
+
beta
+

Set Kaiser window beta. +

+
+
att
+

Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB. +

+
+
round
+

Enable rounding, by default is disabled. +

+
+
hptaps
+

Set number of taps for high-pass filter. +

+
+
lptaps
+

Set number of taps for low-pass filter. +

+
+ +
+
+

9.11 sine

+ +

Generate an audio signal made of a sine wave with amplitude 1/8. +

+

The audio signal is bit-exact. +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the carrier frequency. Default is 440 Hz. +

+
+
beep_factor, b
+

Enable a periodic beep every second with frequency beep_factor times +the carrier frequency. Default is 0, meaning the beep is disabled. +

+
+
sample_rate, r
+

Specify the sample rate, default is 44100. +

+
+
duration, d
+

Specify the duration of the generated audio stream. +

+
+
samples_per_frame
+

Set the number of samples per output frame. +

+

The expression can contain the following constants: +

+
+
n
+

The (sequential) number of the output audio frame, starting from 0. +

+
+
pts
+

The PTS (Presentation TimeStamp) of the output audio frame, +expressed in TB units. +

+
+
t
+

The PTS of the output audio frame, expressed in seconds. +

+
+
TB
+

The timebase of the output audio frames. +

+
+ +

Default is 1024. +

+
+ + +
+

9.11.1 Examples

+ +
    +
  • Generate a simple 440 Hz sine wave: +
    +
    sine
    +
    + +
  • Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds: +
    +
    sine=220:4:d=5
    +sine=f=220:b=4:d=5
    +sine=frequency=220:beep_factor=4:duration=5
    +
    + +
  • Generate a 1 kHz sine wave following 1602,1601,1602,1601,1602 NTSC +pattern: +
    +
    sine=1000:samples_per_frame='st(0,mod(n,5)); 1602-not(not(eq(ld(0),1)+eq(ld(0),3)))'
    +
    +
+ + +
+
+
+
+

10 Audio Sinks

+ +

Below is a description of the currently available audio sinks. +

+ +
+

10.1 abuffersink

+ +

Buffer audio frames, and make them available to the end of filter chain. +

+

This sink is mainly intended for programmatic use, in particular +through the interface defined in libavfilter/buffersink.h +or the options system. +

+

It accepts a pointer to an AVABufferSinkContext structure, which +defines the incoming buffers’ formats, to be passed as the opaque +parameter to avfilter_init_filter for initialization. +

+
+

10.2 anullsink

+ +

Null audio sink; do absolutely nothing with the input audio. It is +mainly useful as a template and for use in analysis / debugging +tools. +

+ +
+
+
+

11 Video Filters

+ +

When you configure your FFmpeg build, you can disable any of the +existing filters using --disable-filters. +The configure output will show the video filters included in your +build. +

+

Below is a description of the currently available video filters. +

+ +
+

11.1 addroi

+ +

Mark a region of interest in a video frame. +

+

The frame data is passed through unchanged, but metadata is attached +to the frame indicating regions of interest which can affect the +behaviour of later encoding. Multiple regions can be marked by +applying the filter multiple times. +

+
+
x
+

Region distance in pixels from the left edge of the frame. +

+
y
+

Region distance in pixels from the top edge of the frame. +

+
w
+

Region width in pixels. +

+
h
+

Region height in pixels. +

+

The parameters x, y, w and h are expressions, +and may contain the following variables: +

+
iw
+

Width of the input frame. +

+
ih
+

Height of the input frame. +

+
+ +
+
qoffset
+

Quantisation offset to apply within the region. +

+

This must be a real value in the range -1 to +1. A value of zero +indicates no quality change. A negative value asks for better quality +(less quantisation), while a positive value asks for worse quality +(greater quantisation). +

+

The range is calibrated so that the extreme values indicate the +largest possible offset - if the rest of the frame is encoded with the +worst possible quality, an offset of -1 indicates that this region +should be encoded with the best possible quality anyway. Intermediate +values are then interpolated in some codec-dependent way. +

+

For example, in 10-bit H.264 the quantisation parameter varies between +-12 and 51. A typical qoffset value of -1/10 therefore indicates that +this region should be encoded with a QP around one-tenth of the full +range better than the rest of the frame. So, if most of the frame +were to be encoded with a QP of around 30, this region would get a QP +of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3). +An extreme value of -1 would indicate that this region should be +encoded with the best possible quality regardless of the treatment of +the rest of the frame - that is, should be encoded at a QP of -12. +

+
clear
+

If set to true, remove any existing regions of interest marked on the +frame before adding the new one. +

+
+ + +
+

11.1.1 Examples

+ +
    +
  • Mark the centre quarter of the frame as interesting. +
    +
    addroi=iw/4:ih/4:iw/2:ih/2:-1/10
    +
    +
  • Mark the 100-pixel-wide region on the left edge of the frame as very +uninteresting (to be encoded at much lower quality than the rest of +the frame). +
    +
    addroi=0:0:100:ih:+1/5
    +
    +
+ +
+
+
+

11.2 alphaextract

+ +

Extract the alpha component from the input as a grayscale video. This +is especially useful with the alphamerge filter. +

+
+
+

11.3 alphamerge

+ +

Add or replace the alpha component of the primary input with the +grayscale value of a second input. This is intended for use with +alphaextract to allow the transmission or storage of frame +sequences that have alpha in a format that doesn’t support an alpha +channel. +

+

For example, to reconstruct full frames from a normal YUV-encoded video +and a separate video created with alphaextract, you might use: +

+
movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
+
+ +
+
+

11.4 amplify

+ +

Amplify differences between current pixel and pixels of adjacent frames in +same pixel location. +

+

This filter accepts the following options: +

+
+
radius
+

Set frame radius. Default is 2. Allowed range is from 1 to 63. +For example radius of 3 will instruct filter to calculate average of 7 frames. +

+
+
factor
+

Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535. +

+
+
threshold
+

Set threshold for difference amplification. Any difference greater or equal to +this value will not alter source pixel. Default is 10. +Allowed range is from 0 to 65535. +

+
+
tolerance
+

Set tolerance for difference amplification. Any difference lower to +this value will not alter source pixel. Default is 0. +Allowed range is from 0 to 65535. +

+
+
low
+

Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535. +This option controls maximum possible value that will decrease source pixel value. +

+
+
high
+

Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535. +This option controls maximum possible value that will increase source pixel value. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+ + +
+

11.4.1 Commands

+ +

This filter supports the following commands that corresponds to option of same name: +

+
factor
+
threshold
+
tolerance
+
low
+
high
+
planes
+
+ +
+
+
+

11.5 ass

+ +

Same as the subtitles filter, except that it doesn’t require libavcodec +and libavformat to work. On the other hand, it is limited to ASS (Advanced +Substation Alpha) subtitles files. +

+

This filter accepts the following option in addition to the common options from +the subtitles filter: +

+
+
shaping
+

Set the shaping engine +

+

Available values are: +

+
auto
+

The default libass shaping engine, which is the best available. +

+
simple
+

Fast, font-agnostic shaper that can do only substitutions +

+
complex
+

Slower shaper using OpenType for substitutions and positioning +

+
+ +

The default is auto. +

+
+ +
+
+

11.6 atadenoise

+

Apply an Adaptive Temporal Averaging Denoiser to the video input. +

+

The filter accepts the following options: +

+
+
0a
+

Set threshold A for 1st plane. Default is 0.02. +Valid range is 0 to 0.3. +

+
+
0b
+

Set threshold B for 1st plane. Default is 0.04. +Valid range is 0 to 5. +

+
+
1a
+

Set threshold A for 2nd plane. Default is 0.02. +Valid range is 0 to 0.3. +

+
+
1b
+

Set threshold B for 2nd plane. Default is 0.04. +Valid range is 0 to 5. +

+
+
2a
+

Set threshold A for 3rd plane. Default is 0.02. +Valid range is 0 to 0.3. +

+
+
2b
+

Set threshold B for 3rd plane. Default is 0.04. +Valid range is 0 to 5. +

+

Threshold A is designed to react on abrupt changes in the input signal and +threshold B is designed to react on continuous changes in the input signal. +

+
+
s
+

Set number of frames filter will use for averaging. Default is 9. Must be odd +number in range [5, 129]. +

+
+
p
+

Set what planes of frame filter will use for averaging. Default is all. +

+
+
a
+

Set what variant of algorithm filter will use for averaging. Default is p parallel. +Alternatively can be set to s serial. +

+

Parallel can be faster then serial, while other way around is never true. +Parallel will abort early on first change being greater then thresholds, while serial +will continue processing other side of frames if they are equal or below thresholds. +

+
+
0s
+
1s
+
2s
+

Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767. +Valid range is from 0 to 32767. +This options controls weight for each pixel in radius defined by size. +Default value means every pixel have same weight. +Setting this option to 0 effectively disables filtering. +

+
+ + +
+

11.6.1 Commands

+

This filter supports same commands as options except option s. +The command accepts the same syntax of the corresponding option. +

+
+
+
+

11.7 avgblur

+ +

Apply average blur filter. +

+

The filter accepts the following options: +

+
+
sizeX
+

Set horizontal radius size. +

+
+
planes
+

Set which planes to filter. By default all planes are filtered. +

+
+
sizeY
+

Set vertical radius size, if zero it will be same as sizeX. +Default is 0. +

+
+ + +
+

11.7.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

11.8 backgroundkey

+ +

Turns a static background into transparency. +

+

The filter accepts the following option: +

+
+
threshold
+

Threshold for scene change detection. +

+
similarity
+

Similarity percentage with the background. +

+
blend
+

Set the blend amount for pixels that are not similar. +

+
+ + +
+

11.8.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.9 bbox

+ +

Compute the bounding box for the non-black pixels in the input frame +luminance plane. +

+

This filter computes the bounding box containing all the pixels with a +luminance value greater than the minimum allowed value. +The parameters describing the bounding box are printed on the filter +log. +

+

The filter accepts the following option: +

+
+
min_val
+

Set the minimal luminance value. Default is 16. +

+
+ + +
+

11.9.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.10 bilateral

+

Apply bilateral filter, spatial smoothing while preserving edges. +

+

The filter accepts the following options: +

+
sigmaS
+

Set sigma of gaussian function to calculate spatial weight. +Allowed range is 0 to 512. Default is 0.1. +

+
+
sigmaR
+

Set sigma of gaussian function to calculate range weight. +Allowed range is 0 to 1. Default is 0.1. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

11.10.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.11 bilateral_cuda

+

CUDA accelerated bilateral filter, an edge preserving filter. +This filter is mathematically accurate thanks to the use of GPU acceleration. +For best output quality, use one to one chroma subsampling, i.e. yuv444p format. +

+

The filter accepts the following options: +

+
sigmaS
+

Set sigma of gaussian function to calculate spatial weight, also called sigma space. +Allowed range is 0.1 to 512. Default is 0.1. +

+
+
sigmaR
+

Set sigma of gaussian function to calculate color range weight, also called sigma color. +Allowed range is 0.1 to 512. Default is 0.1. +

+
+
window_size
+

Set window size of the bilateral function to determine the number of neighbours to loop on. +If the number entered is even, one will be added automatically. +Allowed range is 1 to 255. Default is 1. +

+
+ +
+

11.11.1 Examples

+ +
    +
  • Apply the bilateral filter on a video. + +
    +
    ./ffmpeg -v verbose \
    +-hwaccel cuda -hwaccel_output_format cuda -i input.mp4  \
    +-init_hw_device cuda \
    +-filter_complex \
    +" \
    +[0:v]scale_cuda=format=yuv444p[scaled_video];
    +[scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0" \
    +-an -sn -c:v h264_nvenc -cq 20 out.mp4
    +
    + +
+ +
+
+
+

11.12 bitplanenoise

+ +

Show and measure bit plane noise. +

+

The filter accepts the following options: +

+
+
bitplane
+

Set which plane to analyze. Default is 1. +

+
+
filter
+

Filter out noisy pixels from bitplane set above. +Default is disabled. +

+
+ +
+
+

11.13 blackdetect

+ +

Detect video intervals that are (almost) completely black. Can be +useful to detect chapter transitions, commercials, or invalid +recordings. +

+

The filter outputs its detection analysis to both the log as well as +frame metadata. If a black segment of at least the specified minimum +duration is found, a line with the start and end timestamps as well +as duration is printed to the log with level info. In addition, +a log line with level debug is printed per frame showing the +black amount detected for that frame. +

+

The filter also attaches metadata to the first frame of a black +segment with key lavfi.black_start and to the first frame +after the black segment ends with key lavfi.black_end. The +value is the frame’s timestamp. This metadata is added regardless +of the minimum duration specified. +

+

The filter accepts the following options: +

+
+
black_min_duration, d
+

Set the minimum detected black duration expressed in seconds. It must +be a non-negative floating point number. +

+

Default value is 2.0. +

+
+
picture_black_ratio_th, pic_th
+

Set the threshold for considering a picture "black". +Express the minimum value for the ratio: +

+
nb_black_pixels / nb_pixels
+
+ +

for which a picture is considered black. +Default value is 0.98. +

+
+
pixel_black_th, pix_th
+

Set the threshold for considering a pixel "black". +

+

The threshold expresses the maximum pixel luminance value for which a +pixel is considered "black". The provided value is scaled according to +the following equation: +

+
absolute_threshold = luminance_minimum_value + pixel_black_th * luminance_range_size
+
+ +

luminance_range_size and luminance_minimum_value depend on +the input video format, the range is [0-255] for YUV full-range +formats and [16-235] for YUV non full-range formats. +

+

Default value is 0.10. +

+
+ +

The following example sets the maximum pixel threshold to the minimum +value, and detects only black intervals of 2 or more seconds: +

+
blackdetect=d=2:pix_th=0.00
+
+ +
+
+

11.14 blackframe

+ +

Detect frames that are (almost) completely black. Can be useful to +detect chapter transitions or commercials. Output lines consist of +the frame number of the detected frame, the percentage of blackness, +the position in the file if known or -1 and the timestamp in seconds. +

+

In order to display the output lines, you need to set the loglevel at +least to the AV_LOG_INFO value. +

+

This filter exports frame metadata lavfi.blackframe.pblack. +The value represents the percentage of pixels in the picture that +are below the threshold value. +

+

It accepts the following parameters: +

+
+
amount
+

The percentage of the pixels that have to be below the threshold; it defaults to +98. +

+
+
threshold, thresh
+

The threshold below which a pixel value is considered black; it defaults to +32. +

+
+
+ +
+
+

11.15 blend

+ +

Blend two video frames into each other. +

+

The blend filter takes two input streams and outputs one +stream, the first input is the "top" layer and second input is +"bottom" layer. By default, the output terminates when the longest input terminates. +

+

The tblend (time blend) filter takes two consecutive frames +from one single stream, and outputs the result obtained by blending +the new frame on top of the old frame. +

+

A description of the accepted options follows. +

+
+
c0_mode
+
c1_mode
+
c2_mode
+
c3_mode
+
all_mode
+

Set blend mode for specific pixel component or all pixel components in case +of all_mode. Default value is normal. +

+

Available values for component modes are: +

+
addition
+
and
+
average
+
bleach
+
burn
+
darken
+
difference
+
divide
+
dodge
+
exclusion
+
extremity
+
freeze
+
geometric
+
glow
+
grainextract
+
grainmerge
+
hardlight
+
hardmix
+
hardoverlay
+
harmonic
+
heat
+
interpolate
+
lighten
+
linearlight
+
multiply
+
multiply128
+
negation
+
normal
+
or
+
overlay
+
phoenix
+
pinlight
+
reflect
+
screen
+
softdifference
+
softlight
+
stain
+
subtract
+
vividlight
+
xor
+
+ +
+
c0_opacity
+
c1_opacity
+
c2_opacity
+
c3_opacity
+
all_opacity
+

Set blend opacity for specific pixel component or all pixel components in case +of all_opacity. Only used in combination with pixel component blend modes. +

+
+
c0_expr
+
c1_expr
+
c2_expr
+
c3_expr
+
all_expr
+

Set blend expression for specific pixel component or all pixel components in case +of all_expr. Note that related mode options will be ignored if those are set. +

+

The expressions can use the following variables: +

+
+
N
+

The sequential number of the filtered frame, starting from 0. +

+
+
X
+
Y
+

the coordinates of the current sample +

+
+
W
+
H
+

the width and height of currently filtered plane +

+
+
SW
+
SH
+

Width and height scale for the plane being filtered. It is the +ratio between the dimensions of the current plane to the luma plane, +e.g. for a yuv420p frame, the values are 1,1 for +the luma plane and 0.5,0.5 for the chroma planes. +

+
+
T
+

Time of the current frame, expressed in seconds. +

+
+
TOP, A
+

Value of pixel component at current location for first video frame (top layer). +

+
+
BOTTOM, B
+

Value of pixel component at current location for second video frame (bottom layer). +

+
+
+
+ +

The blend filter also supports the framesync options. +

+ +
+

11.15.1 Examples

+ +
    +
  • Apply transition from bottom layer to top layer in first 10 seconds: +
    +
    blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
    +
    + +
  • Apply linear horizontal transition from top layer to bottom layer: +
    +
    blend=all_expr='A*(X/W)+B*(1-X/W)'
    +
    + +
  • Apply 1x1 checkerboard effect: +
    +
    blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
    +
    + +
  • Apply uncover left effect: +
    +
    blend=all_expr='if(gte(N*SW+X,W),A,B)'
    +
    + +
  • Apply uncover down effect: +
    +
    blend=all_expr='if(gte(Y-N*SH,0),A,B)'
    +
    + +
  • Apply uncover up-left effect: +
    +
    blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
    +
    + +
  • Split diagonally video and shows top and bottom layer on each side: +
    +
    blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
    +
    + +
  • Display differences between the current and the previous frame: +
    +
    tblend=all_mode=grainextract
    +
    +
+ +
+
+

11.15.2 Commands

+

This filter supports same commands as options. +

+
+
+
+

11.16 blockdetect

+ +

Determines blockiness of frames without altering the input frames. +

+

Based on Remco Muijs and Ihor Kirenko: "A no-reference blocking artifact measure for adaptive video processing." 2005 13th European signal processing conference. +

+

The filter accepts the following options: +

+
+
period_min
+
period_max
+

Set minimum and maximum values for determining pixel grids (periods). +Default values are [3,24]. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

11.16.1 Examples

+ +
    +
  • Determine blockiness for the first plane and search for periods within [8,32]: +
    +
    blockdetect=period_min=8:period_max=32:planes=1
    +
    +
+ +
+
+
+

11.17 blurdetect

+ +

Determines blurriness of frames without altering the input frames. +

+

Based on Marziliano, Pina, et al. "A no-reference perceptual blur metric." +Allows for a block-based abbreviation. +

+

The filter accepts the following options: +

+
+
low
+
high
+

Set low and high threshold values used by the Canny thresholding +algorithm. +

+

The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. +

+

low and high threshold values must be chosen in the range +[0,1], and low should be lesser or equal to high. +

+

Default value for low is 20/255, and default value for high +is 50/255. +

+
+
radius
+

Define the radius to search around an edge pixel for local maxima. +

+
+
block_pct
+

Determine blurriness only for the most significant blocks, given in percentage. +

+
+
block_width
+

Determine blurriness for blocks of width block_width. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of block_height. +

+
+
block_height
+

Determine blurriness for blocks of height block_height. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of block_width. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

11.17.1 Examples

+ +
    +
  • Determine blur for 80% of most significant 32x32 blocks: +
    +
    blurdetect=block_width=32:block_height=32:block_pct=80
    +
    +
+ +
+
+
+

11.18 bm3d

+ +

Denoise frames using Block-Matching 3D algorithm. +

+

The filter accepts the following options. +

+
+
sigma
+

Set denoising strength. Default value is 1. +Allowed range is from 0 to 999.9. +The denoising algorithm is very sensitive to sigma, so adjust it +according to the source. +

+
+
block
+

Set local patch size. This sets dimensions in 2D. +

+
+
bstep
+

Set sliding step for processing blocks. Default value is 4. +Allowed range is from 1 to 64. +Smaller values allows processing more reference blocks and is slower. +

+
+
group
+

Set maximal number of similar blocks for 3rd dimension. Default value is 1. +When set to 1, no block matching is done. Larger values allows more blocks +in single group. +Allowed range is from 1 to 256. +

+
+
range
+

Set radius for search block matching. Default is 9. +Allowed range is from 1 to INT32_MAX. +

+
+
mstep
+

Set step between two search locations for block matching. Default is 1. +Allowed range is from 1 to 64. Smaller is slower. +

+
+
thmse
+

Set threshold of mean square error for block matching. Valid range is 0 to +INT32_MAX. +

+
+
hdthr
+

Set thresholding parameter for hard thresholding in 3D transformed domain. +Larger values results in stronger hard-thresholding filtering in frequency +domain. +

+
+
estim
+

Set filtering estimation mode. Can be basic or final. +Default is basic. +

+
+
ref
+

If enabled, filter will use 2nd stream for block matching. +Default is disabled for basic value of estim option, +and always enabled if value of estim is final. +

+
+
planes
+

Set planes to filter. Default is all available except alpha. +

+
+ + +
+

11.18.1 Examples

+ +
    +
  • Basic filtering with bm3d: +
    +
    bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
    +
    + +
  • Same as above, but filtering only luma: +
    +
    bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
    +
    + +
  • Same as above, but with both estimation modes: +
    +
    split[a][b],[a]bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
    +
    + +
  • Same as above, but prefilter with nlmeans filter instead: +
    +
    split[a][b],[a]nlmeans=s=3:r=7:p=3[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
    +
    +
+ +
+
+
+

11.19 boxblur

+ +

Apply a boxblur algorithm to the input video. +

+

It accepts the following parameters: +

+
+
luma_radius, lr
+
luma_power, lp
+
chroma_radius, cr
+
chroma_power, cp
+
alpha_radius, ar
+
alpha_power, ap
+
+ +

A description of the accepted options follows. +

+
+
luma_radius, lr
+
chroma_radius, cr
+
alpha_radius, ar
+

Set an expression for the box radius in pixels used for blurring the +corresponding input plane. +

+

The radius value must be a non-negative number, and must not be +greater than the value of the expression min(w,h)/2 for the +luma and alpha planes, and of min(cw,ch)/2 for the chroma +planes. +

+

Default value for luma_radius is "2". If not specified, +chroma_radius and alpha_radius default to the +corresponding value set for luma_radius. +

+

The expressions can contain the following constants: +

+
w
+
h
+

The input width and height in pixels. +

+
+
cw
+
ch
+

The input chroma image width and height in pixels. +

+
+
hsub
+
vsub
+

The horizontal and vertical chroma subsample values. For example, for the +pixel format "yuv422p", hsub is 2 and vsub is 1. +

+
+ +
+
luma_power, lp
+
chroma_power, cp
+
alpha_power, ap
+

Specify how many times the boxblur filter is applied to the +corresponding plane. +

+

Default value for luma_power is 2. If not specified, +chroma_power and alpha_power default to the +corresponding value set for luma_power. +

+

A value of 0 will disable the effect. +

+
+ + +
+

11.19.1 Examples

+ +
    +
  • Apply a boxblur filter with the luma, chroma, and alpha radii +set to 2: +
    +
    boxblur=luma_radius=2:luma_power=1
    +boxblur=2:1
    +
    + +
  • Set the luma radius to 2, and alpha and chroma radius to 0: +
    +
    boxblur=2:1:cr=0:ar=0
    +
    + +
  • Set the luma and chroma radii to a fraction of the video dimension: +
    +
    boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
    +
    +
+ +
+
+
+

11.20 bwdif

+ +

Deinterlace the input video ("bwdif" stands for "Bob Weaver +Deinterlacing Filter"). +

+

Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic +interpolation algorithms. +It accepts the following parameters: +

+
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
0, send_frame
+

Output one frame for each frame. +

+
1, send_field
+

Output one frame for each field. +

+
+ +

The default value is send_field. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
0, tff
+

Assume the top field is first. +

+
1, bff
+

Assume the bottom field is first. +

+
-1, auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
0, all
+

Deinterlace all frames. +

+
1, interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+ +
+
+

11.21 ccrepack

+ +

Repack CEA-708 closed captioning side data +

+

This filter fixes various issues seen with commerical encoders +related to upstream malformed CEA-708 payloads, specifically +incorrect number of tuples (wrong cc_count for the target FPS), +and incorrect ordering of tuples (i.e. the CEA-608 tuples are not at +the first entries in the payload). +

+
+
+

11.22 cas

+ +

Apply Contrast Adaptive Sharpen filter to video stream. +

+

The filter accepts the following options: +

+
+
strength
+

Set the sharpening strength. Default value is 0. +

+
+
planes
+

Set planes to filter. Default value is to filter all +planes except alpha plane. +

+
+ + +
+

11.22.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

11.23 chromahold

+

Remove all color information for all colors except for certain one. +

+

The filter accepts the following options: +

+
+
color
+

The color which will not be replaced with neutral chroma. +

+
+
similarity
+

Similarity percentage with the above color. +0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +0.0 makes pixels either fully gray, or not gray at all. +Higher values result in more preserved color. +

+
+
yuv
+

Signals that the color passed is already in YUV instead of RGB. +

+

Literal colors like "green" or "red" don’t make sense with this enabled anymore. +This can be used to pass exact YUV values as hexadecimal numbers. +

+
+ + +
+

11.23.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

11.24 chromakey

+

YUV colorspace color/chroma keying. +

+

The filter accepts the following options: +

+
+
color
+

The color which will be replaced with transparency. +

+
+
similarity
+

Similarity percentage with the key color. +

+

0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +

+

0.0 makes pixels either fully transparent, or not transparent at all. +

+

Higher values result in semi-transparent pixels, with a higher transparency +the more similar the pixels color is to the key color. +

+
+
yuv
+

Signals that the color passed is already in YUV instead of RGB. +

+

Literal colors like "green" or "red" don’t make sense with this enabled anymore. +This can be used to pass exact YUV values as hexadecimal numbers. +

+
+ + +
+

11.24.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+

11.24.2 Examples

+ +
    +
  • Make every green pixel in the input image transparent: +
    +
    ffmpeg -i input.png -vf chromakey=green out.png
    +
    + +
  • Overlay a greenscreen-video on top of a static black background. +
    +
    ffmpeg -f lavfi -i color=c=black:s=1280x720 -i video.mp4 -shortest -filter_complex "[1:v]chromakey=0x70de77:0.1:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.mkv
    +
    +
+ +
+
+
+

11.25 chromakey_cuda

+

CUDA accelerated YUV colorspace color/chroma keying. +

+

This filter works like normal chromakey filter but operates on CUDA frames. +for more details and parameters see chromakey. +

+ +
+

11.25.1 Examples

+ +
    +
  • Make all the green pixels in the input video transparent and use it as an overlay for another video: + +
    +
    ./ffmpeg \
    +    -hwaccel cuda -hwaccel_output_format cuda -i input_green.mp4  \
    +    -hwaccel cuda -hwaccel_output_format cuda -i base_video.mp4 \
    +    -init_hw_device cuda \
    +    -filter_complex \
    +    " \
    +        [0:v]chromakey_cuda=0x25302D:0.1:0.12:1[overlay_video]; \
    +        [1:v]scale_cuda=format=yuv420p[base]; \
    +        [base][overlay_video]overlay_cuda" \
    +    -an -sn -c:v h264_nvenc -cq 20 output.mp4
    +
    + +
  • Process two software sources, explicitly uploading the frames: + +
    +
    ./ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda \
    +    -f lavfi -i color=size=800x600:color=white,format=yuv420p \
    +    -f lavfi -i yuvtestsrc=size=200x200,format=yuv420p \
    +    -filter_complex \
    +    " \
    +        [0]hwupload[under]; \
    +        [1]hwupload,chromakey_cuda=green:0.1:0.12[over]; \
    +        [under][over]overlay_cuda" \
    +    -c:v hevc_nvenc -cq 18 -preset slow output.mp4
    +
    + +
+ +
+
+
+

11.26 chromanr

+

Reduce chrominance noise. +

+

The filter accepts the following options: +

+
+
thres
+

Set threshold for averaging chrominance values. +Sum of absolute difference of Y, U and V pixel components of current +pixel and neighbour pixels lower than this threshold will be used in +averaging. Luma component is left unchanged and is copied to output. +Default value is 30. Allowed range is from 1 to 200. +

+
+
sizew
+

Set horizontal radius of rectangle used for averaging. +Allowed range is from 1 to 100. Default value is 5. +

+
+
sizeh
+

Set vertical radius of rectangle used for averaging. +Allowed range is from 1 to 100. Default value is 5. +

+
+
stepw
+

Set horizontal step when averaging. Default value is 1. +Allowed range is from 1 to 50. +Mostly useful to speed-up filtering. +

+
+
steph
+

Set vertical step when averaging. Default value is 1. +Allowed range is from 1 to 50. +Mostly useful to speed-up filtering. +

+
+
threy
+

Set Y threshold for averaging chrominance values. +Set finer control for max allowed difference between Y components +of current pixel and neigbour pixels. +Default value is 200. Allowed range is from 1 to 200. +

+
+
threu
+

Set U threshold for averaging chrominance values. +Set finer control for max allowed difference between U components +of current pixel and neigbour pixels. +Default value is 200. Allowed range is from 1 to 200. +

+
+
threv
+

Set V threshold for averaging chrominance values. +Set finer control for max allowed difference between V components +of current pixel and neigbour pixels. +Default value is 200. Allowed range is from 1 to 200. +

+
+
distance
+

Set distance type used in calculations. +

+
+
manhattan
+

Absolute difference. +

+
euclidean
+

Difference squared. +

+
+ +

Default distance type is manhattan. +

+
+ + +
+

11.26.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+
+
+
+

11.27 chromashift

+

Shift chroma pixels horizontally and/or vertically. +

+

The filter accepts the following options: +

+
cbh
+

Set amount to shift chroma-blue horizontally. +

+
cbv
+

Set amount to shift chroma-blue vertically. +

+
crh
+

Set amount to shift chroma-red horizontally. +

+
crv
+

Set amount to shift chroma-red vertically. +

+
edge
+

Set edge mode, can be smear, default, or warp. +

+
+ + +
+

11.27.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.28 ciescope

+ +

Display CIE color diagram with pixels overlaid onto it. +

+

The filter accepts the following options: +

+
+
system
+

Set color system. +

+
+
ntsc, 470m
+
ebu, 470bg
+
smpte
+
240m
+
apple
+
widergb
+
cie1931
+
rec709, hdtv
+
uhdtv, rec2020
+
dcip3
+
+ +
+
cie
+

Set CIE system. +

+
+
xyy
+
ucs
+
luv
+
+ +
+
gamuts
+

Set what gamuts to draw. +

+

See system option for available values. +

+
+
size, s
+

Set ciescope size, by default set to 512. +

+
+
intensity, i
+

Set intensity used to map input pixel values to CIE diagram. +

+
+
contrast
+

Set contrast used to draw tongue colors that are out of active color system gamut. +

+
+
corrgamma
+

Correct gamma displayed on scope, by default enabled. +

+
+
showwhite
+

Show white point on CIE diagram, by default disabled. +

+
+
gamma
+

Set input gamma. Used only with XYZ input color space. +

+
+
fill
+

Fill with CIE colors. By default is enabled. +

+
+ +
+
+

11.29 codecview

+ +

Visualize information exported by some codecs. +

+

Some codecs can export information through frames using side-data or other +means. For example, some MPEG based codecs export motion vectors through the +export_mvs flag in the codec flags2 option. +

+

The filter accepts the following option: +

+
+
block
+

Display block partition structure using the luma plane. +

+
+
mv
+

Set motion vectors to visualize. +

+

Available flags for mv are: +

+
+
pf
+

forward predicted MVs of P-frames +

+
bf
+

forward predicted MVs of B-frames +

+
bb
+

backward predicted MVs of B-frames +

+
+ +
+
qp
+

Display quantization parameters using the chroma planes. +

+
+
mv_type, mvt
+

Set motion vectors type to visualize. Includes MVs from all frames unless specified by frame_type option. +

+

Available flags for mv_type are: +

+
+
fp
+

forward predicted MVs +

+
bp
+

backward predicted MVs +

+
+ +
+
frame_type, ft
+

Set frame type to visualize motion vectors of. +

+

Available flags for frame_type are: +

+
+
if
+

intra-coded frames (I-frames) +

+
pf
+

predicted frames (P-frames) +

+
bf
+

bi-directionally predicted frames (B-frames) +

+
+
+
+ + +
+

11.29.1 Examples

+ +
    +
  • Visualize forward predicted MVs of all frames using ffplay: +
    +
    ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
    +
    + +
  • Visualize multi-directionals MVs of P and B-Frames using ffplay: +
    +
    ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
    +
    +
+ +
+
+
+

11.30 colorbalance

+

Modify intensity of primary colors (red, green and blue) of input frames. +

+

The filter allows an input frame to be adjusted in the shadows, midtones or highlights +regions for the red-cyan, green-magenta or blue-yellow balance. +

+

A positive adjustment value shifts the balance towards the primary color, a negative +value towards the complementary color. +

+

The filter accepts the following options: +

+
+
rs
+
gs
+
bs
+

Adjust red, green and blue shadows (darkest pixels). +

+
+
rm
+
gm
+
bm
+

Adjust red, green and blue midtones (medium pixels). +

+
+
rh
+
gh
+
bh
+

Adjust red, green and blue highlights (brightest pixels). +

+

Allowed ranges for options are [-1.0, 1.0]. Defaults are 0. +

+
+
pl
+

Preserve lightness when changing color balance. Default is disabled. +

+
+ + +
+

11.30.1 Examples

+ +
    +
  • Add red color cast to shadows: +
    +
    colorbalance=rs=.3
    +
    +
+ +
+
+

11.30.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.31 colorcontrast

+ +

Adjust color contrast between RGB components. +

+

The filter accepts the following options: +

+
+
rc
+

Set the red-cyan contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. +

+
+
gm
+

Set the green-magenta contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. +

+
+
by
+

Set the blue-yellow contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. +

+
+
rcw
+
gmw
+
byw
+

Set the weight of each rc, gm, by option value. Default value is 0.0. +Allowed range is from 0.0 to 1.0. If all weights are 0.0 filtering is disabled. +

+
+
pl
+

Set the amount of preserving lightness. Default value is 0.0. Allowed range is from 0.0 to 1.0. +

+
+ + +
+

11.31.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.32 colorcorrect

+ +

Adjust color white balance selectively for blacks and whites. +This filter operates in YUV colorspace. +

+

The filter accepts the following options: +

+
+
rl
+

Set the red shadow spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
bl
+

Set the blue shadow spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
rh
+

Set the red highlight spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
bh
+

Set the blue highlight spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
saturation
+

Set the amount of saturation. Allowed range is from -3.0 to 3.0. +Default value is 1. +

+
+
analyze
+

If set to anything other than manual it will analyze every frame and use derived +parameters for filtering output frame. +

+

Possible values are: +

+
manual
+
average
+
minmax
+
median
+
+

Default value is manual. +

+
+ + +
+

11.32.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.33 colorchannelmixer

+ +

Adjust video input frames by re-mixing color channels. +

+

This filter modifies a color channel by adding the values associated to +the other channels of the same pixels. For example if the value to +modify is red, the output value will be: +

+
red=red*rr + blue*rb + green*rg + alpha*ra
+
+ +

The filter accepts the following options: +

+
+
rr
+
rg
+
rb
+
ra
+

Adjust contribution of input red, green, blue and alpha channels for output red channel. +Default is 1 for rr, and 0 for rg, rb and ra. +

+
+
gr
+
gg
+
gb
+
ga
+

Adjust contribution of input red, green, blue and alpha channels for output green channel. +Default is 1 for gg, and 0 for gr, gb and ga. +

+
+
br
+
bg
+
bb
+
ba
+

Adjust contribution of input red, green, blue and alpha channels for output blue channel. +Default is 1 for bb, and 0 for br, bg and ba. +

+
+
ar
+
ag
+
ab
+
aa
+

Adjust contribution of input red, green, blue and alpha channels for output alpha channel. +Default is 1 for aa, and 0 for ar, ag and ab. +

+

Allowed ranges for options are [-2.0, 2.0]. +

+
+
pc
+

Set preserve color mode. The accepted values are: +

+
none
+

Disable color preserving, this is default. +

+
lum
+

Preserve luminance. +

+
max
+

Preserve max value of RGB triplet. +

+
avg
+

Preserve average value of RGB triplet. +

+
sum
+

Preserve sum value of RGB triplet. +

+
nrm
+

Preserve normalized value of RGB triplet. +

+
pwr
+

Preserve power value of RGB triplet. +

+
+ +
+
pa
+

Set the preserve color amount when changing colors. Allowed range is from [0.0, 1.0]. +Default is 0.0, thus disabled. +

+
+ + +
+

11.33.1 Examples

+ +
    +
  • Convert source to grayscale: +
    +
    colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
    +
    +
  • Simulate sepia tones: +
    +
    colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
    +
    +
+ +
+
+

11.33.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.34 colorize

+

Overlay a solid color on the video stream. +

+

The filter accepts the following options: +

+
+
hue
+

Set the color hue. Allowed range is from 0 to 360. +Default value is 0. +

+
+
saturation
+

Set the color saturation. Allowed range is from 0 to 1. +Default value is 0.5. +

+
+
lightness
+

Set the color lightness. Allowed range is from 0 to 1. +Default value is 0.5. +

+
+
mix
+

Set the mix of source lightness. By default is set to 1.0. +Allowed range is from 0.0 to 1.0. +

+
+ + +
+

11.34.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.35 colorkey

+

RGB colorspace color keying. +This filter operates on 8-bit RGB format frames by setting the alpha component of each pixel +which falls within the similarity radius of the key color to 0. The alpha value for pixels outside +the similarity radius depends on the value of the blend option. +

+

The filter accepts the following options: +

+
+
color
+

Set the color for which alpha will be set to 0 (full transparency). +See (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +Default is black. +

+
+
similarity
+

Set the radius from the key color within which other colors also have full transparency. +The computed distance is related to the unit fractional distance in 3D space between the RGB values +of the key color and the pixel’s color. Range is 0.01 to 1.0. 0.01 matches within a very small radius +around the exact key color, while 1.0 matches everything. +Default is 0.01. +

+
+
blend
+

Set how the alpha value for pixels that fall outside the similarity radius is computed. +0.0 makes pixels either fully transparent or fully opaque. +Higher values result in semi-transparent pixels, with greater transparency +the more similar the pixel color is to the key color. +Range is 0.0 to 1.0. Default is 0.0. +

+
+ + +
+

11.35.1 Examples

+ +
    +
  • Make every green pixel in the input image transparent: +
    +
    ffmpeg -i input.png -vf colorkey=green out.png
    +
    + +
  • Overlay a greenscreen-video on top of a static background image. +
    +
    ffmpeg -i background.png -i video.mp4 -filter_complex "[1:v]colorkey=0x3BBD1E:0.3:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.flv
    +
    +
+ +
+
+

11.35.2 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

11.36 colorhold

+

Remove all color information for all RGB colors except for certain one. +

+

The filter accepts the following options: +

+
+
color
+

The color which will not be replaced with neutral gray. +

+
+
similarity
+

Similarity percentage with the above color. +0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. 0.0 makes pixels fully gray. +Higher values result in more preserved color. +

+
+ + +
+

11.36.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

11.37 colorlevels

+ +

Adjust video input frames using levels. +

+

The filter accepts the following options: +

+
+
rimin
+
gimin
+
bimin
+
aimin
+

Adjust red, green, blue and alpha input black point. +Allowed ranges for options are [-1.0, 1.0]. Defaults are 0. +

+
+
rimax
+
gimax
+
bimax
+
aimax
+

Adjust red, green, blue and alpha input white point. +Allowed ranges for options are [-1.0, 1.0]. Defaults are 1. +

+

Input levels are used to lighten highlights (bright tones), darken shadows +(dark tones), change the balance of bright and dark tones. +

+
+
romin
+
gomin
+
bomin
+
aomin
+

Adjust red, green, blue and alpha output black point. +Allowed ranges for options are [0, 1.0]. Defaults are 0. +

+
+
romax
+
gomax
+
bomax
+
aomax
+

Adjust red, green, blue and alpha output white point. +Allowed ranges for options are [0, 1.0]. Defaults are 1. +

+

Output levels allows manual selection of a constrained output level range. +

+
+
preserve
+

Set preserve color mode. The accepted values are: +

+
none
+

Disable color preserving, this is default. +

+
lum
+

Preserve luminance. +

+
max
+

Preserve max value of RGB triplet. +

+
avg
+

Preserve average value of RGB triplet. +

+
sum
+

Preserve sum value of RGB triplet. +

+
nrm
+

Preserve normalized value of RGB triplet. +

+
pwr
+

Preserve power value of RGB triplet. +

+
+
+
+ + +
+

11.37.1 Examples

+ +
    +
  • Make video output darker: +
    +
    colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
    +
    + +
  • Increase contrast: +
    +
    colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
    +
    + +
  • Make video output lighter: +
    +
    colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
    +
    + +
  • Increase brightness: +
    +
    colorlevels=romin=0.5:gomin=0.5:bomin=0.5
    +
    +
+ +
+
+

11.37.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.38 colormap

+

Apply custom color maps to video stream. +

+

This filter needs three input video streams. +First stream is video stream that is going to be filtered out. +Second and third video stream specify color patches for source +color to target color mapping. +

+

The filter accepts the following options: +

+
+
patch_size
+

Set the source and target video stream patch size in pixels. +

+
+
nb_patches
+

Set the max number of used patches from source and target video stream. +Default value is number of patches available in additional video streams. +Max allowed number of patches is 64. +

+
+
type
+

Set the adjustments used for target colors. Can be relative or absolute. +Defaults is absolute. +

+
+
kernel
+

Set the kernel used to measure color differences between mapped colors. +

+

The accepted values are: +

+
euclidean
+
weuclidean
+
+ +

Default is euclidean. +

+
+ +
+
+

11.39 colormatrix

+ +

Convert color matrix. +

+

The filter accepts the following options: +

+
+
src
+
dst
+

Specify the source and destination color matrix. Both values must be +specified. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
fcc
+

FCC +

+
+
bt601
+

BT.601 +

+
+
bt470
+

BT.470 +

+
+
bt470bg
+

BT.470BG +

+
+
smpte170m
+

SMPTE-170M +

+
+
smpte240m
+

SMPTE-240M +

+
+
bt2020
+

BT.2020 +

+
+
+
+ +

For example to convert from BT.601 to SMPTE-240M, use the command: +

+
colormatrix=bt601:smpte240m
+
+ +
+
+

11.40 colorspace

+ +

Convert colorspace, transfer characteristics or color primaries. +Input video needs to have an even size. +

+

The filter accepts the following options: +

+
+
+
all
+

Specify all color properties at once. +

+

The accepted values are: +

+
bt470m
+

BT.470M +

+
+
bt470bg
+

BT.470BG +

+
+
bt601-6-525
+

BT.601-6 525 +

+
+
bt601-6-625
+

BT.601-6 625 +

+
+
bt709
+

BT.709 +

+
+
smpte170m
+

SMPTE-170M +

+
+
smpte240m
+

SMPTE-240M +

+
+
bt2020
+

BT.2020 +

+
+
+ +
+
space
+

Specify output colorspace. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
fcc
+

FCC +

+
+
bt470bg
+

BT.470BG or BT.601-6 625 +

+
+
smpte170m
+

SMPTE-170M or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
ycgco
+

YCgCo +

+
+
bt2020ncl
+

BT.2020 with non-constant luminance +

+
+
+ +
+
trc
+

Specify output transfer characteristics. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
bt470m
+

BT.470M +

+
+
bt470bg
+

BT.470BG +

+
+
gamma22
+

Constant gamma of 2.2 +

+
+
gamma28
+

Constant gamma of 2.8 +

+
+
smpte170m
+

SMPTE-170M, BT.601-6 625 or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
srgb
+

SRGB +

+
+
iec61966-2-1
+

iec61966-2-1 +

+
+
iec61966-2-4
+

iec61966-2-4 +

+
+
xvycc
+

xvycc +

+
+
bt2020-10
+

BT.2020 for 10-bits content +

+
+
bt2020-12
+

BT.2020 for 12-bits content +

+
+
+ +
+
primaries
+

Specify output color primaries. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
bt470m
+

BT.470M +

+
+
bt470bg
+

BT.470BG or BT.601-6 625 +

+
+
smpte170m
+

SMPTE-170M or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
film
+

film +

+
+
smpte431
+

SMPTE-431 +

+
+
smpte432
+

SMPTE-432 +

+
+
bt2020
+

BT.2020 +

+
+
jedec-p22
+

JEDEC P22 phosphors +

+
+
+ +
+
range
+

Specify output color range. +

+

The accepted values are: +

+
tv
+

TV (restricted) range +

+
+
mpeg
+

MPEG (restricted) range +

+
+
pc
+

PC (full) range +

+
+
jpeg
+

JPEG (full) range +

+
+
+ +
+
format
+

Specify output color format. +

+

The accepted values are: +

+
yuv420p
+

YUV 4:2:0 planar 8-bits +

+
+
yuv420p10
+

YUV 4:2:0 planar 10-bits +

+
+
yuv420p12
+

YUV 4:2:0 planar 12-bits +

+
+
yuv422p
+

YUV 4:2:2 planar 8-bits +

+
+
yuv422p10
+

YUV 4:2:2 planar 10-bits +

+
+
yuv422p12
+

YUV 4:2:2 planar 12-bits +

+
+
yuv444p
+

YUV 4:4:4 planar 8-bits +

+
+
yuv444p10
+

YUV 4:4:4 planar 10-bits +

+
+
yuv444p12
+

YUV 4:4:4 planar 12-bits +

+
+
+ +
+
fast
+

Do a fast conversion, which skips gamma/primary correction. This will take +significantly less CPU, but will be mathematically incorrect. To get output +compatible with that produced by the colormatrix filter, use fast=1. +

+
+
dither
+

Specify dithering mode. +

+

The accepted values are: +

+
none
+

No dithering +

+
+
fsb
+

Floyd-Steinberg dithering +

+
+ +
+
wpadapt
+

Whitepoint adaptation mode. +

+

The accepted values are: +

+
bradford
+

Bradford whitepoint adaptation +

+
+
vonkries
+

von Kries whitepoint adaptation +

+
+
identity
+

identity whitepoint adaptation (i.e. no whitepoint adaptation) +

+
+ +
+
iall
+

Override all input properties at once. Same accepted values as all. +

+
+
ispace
+

Override input colorspace. Same accepted values as space. +

+
+
iprimaries
+

Override input color primaries. Same accepted values as primaries. +

+
+
itrc
+

Override input transfer characteristics. Same accepted values as trc. +

+
+
irange
+

Override input color range. Same accepted values as range. +

+
+
+ +

The filter converts the transfer characteristics, color space and color +primaries to the specified user values. The output value, if not specified, +is set to a default value based on the "all" property. If that property is +also not specified, the filter will log an error. The output color range and +format default to the same value as the input color range and format. The +input transfer characteristics, color space, color primaries and color range +should be set on the input data. If any of these are missing, the filter will +log an error and no conversion will take place. +

+

For example to convert the input to SMPTE-240M, use the command: +

+
colorspace=smpte240m
+
+ +
+
+

11.41 colorspace_cuda

+ +

CUDA accelerated implementation of the colorspace filter. +

+

It is by no means feature complete compared to the software colorspace filter, +and at the current time only supports color range conversion between jpeg/full +and mpeg/limited range. +

+

The filter accepts the following options: +

+
+
range
+

Specify output color range. +

+

The accepted values are: +

+
tv
+

TV (restricted) range +

+
+
mpeg
+

MPEG (restricted) range +

+
+
pc
+

PC (full) range +

+
+
jpeg
+

JPEG (full) range +

+
+
+ +
+
+ +
+
+

11.42 colortemperature

+

Adjust color temperature in video to simulate variations in ambient color temperature. +

+

The filter accepts the following options: +

+
+
temperature
+

Set the temperature in Kelvin. Allowed range is from 1000 to 40000. +Default value is 6500 K. +

+
+
mix
+

Set mixing with filtered output. Allowed range is from 0 to 1. +Default value is 1. +

+
+
pl
+

Set the amount of preserving lightness. Allowed range is from 0 to 1. +Default value is 0. +

+
+ + +
+

11.42.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

11.43 convolution

+ +

Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements. +

+

The filter accepts the following options: +

+
+
0m
+
1m
+
2m
+
3m
+

Set matrix for each plane. +Matrix is sequence of 9, 25 or 49 signed integers in square mode, +and from 1 to 49 odd number of signed integers in row mode. +

+
+
0rdiv
+
1rdiv
+
2rdiv
+
3rdiv
+

Set multiplier for calculated value for each plane. +If unset or 0, it will be sum of all matrix elements. +

+
+
0bias
+
1bias
+
2bias
+
3bias
+

Set bias for each plane. This value is added to the result of the multiplication. +Useful for making the overall image brighter or darker. Default is 0.0. +

+
+
0mode
+
1mode
+
2mode
+
3mode
+

Set matrix mode for each plane. Can be square, row or column. +Default is square. +

+
+ + +
+

11.43.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

11.43.2 Examples

+ +
    +
  • Apply sharpen: +
    +
    convolution="0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0"
    +
    + +
  • Apply blur: +
    +
    convolution="1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9"
    +
    + +
  • Apply edge enhance: +
    +
    convolution="0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128"
    +
    + +
  • Apply edge detect: +
    +
    convolution="0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128"
    +
    + +
  • Apply laplacian edge detector which includes diagonals: +
    +
    convolution="1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0"
    +
    + +
  • Apply emboss: +
    +
    convolution="-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2"
    +
    +
+ +
+
+
+

11.44 convolve

+ +

Apply 2D convolution of video stream in frequency domain using second stream +as impulse. +

+

The filter accepts the following options: +

+
+
planes
+

Set which planes to process. +

+
+
impulse
+

Set which impulse video frames will be processed, can be first +or all. Default is all. +

+
+ +

The convolve filter also supports the framesync options. +

+
+
+

11.45 copy

+ +

Copy the input video source unchanged to the output. This is mainly useful for +testing purposes. +

+
+
+

11.46 coreimage

+

Video filtering on GPU using Apple’s CoreImage API on OSX. +

+

Hardware acceleration is based on an OpenGL context. Usually, this means it is +processed by video hardware. However, software-based OpenGL implementations +exist which means there is no guarantee for hardware processing. It depends on +the respective OSX. +

+

There are many filters and image generators provided by Apple that come with a +large variety of options. The filter has to be referenced by its name along +with its options. +

+

The coreimage filter accepts the following options: +

+
list_filters
+

List all available filters and generators along with all their respective +options as well as possible minimum and maximum values along with the default +values. +

+
list_filters=true
+
+ +
+
filter
+

Specify all filters by their respective name and options. +Use list_filters to determine all valid filter names and options. +Numerical options are specified by a float value and are automatically clamped +to their respective value range. Vector and color options have to be specified +by a list of space separated float values. Character escaping has to be done. +A special option name default is available to use default options for a +filter. +

+

It is required to specify either default or at least one of the filter options. +All omitted options are used with their default values. +The syntax of the filter string is as follows: +

+
filter=<NAME>@<OPTION>=<VALUE>[@<OPTION>=<VALUE>][@...][#<NAME>@<OPTION>=<VALUE>[@<OPTION>=<VALUE>][@...]][#...]
+
+ +
+
output_rect
+

Specify a rectangle where the output of the filter chain is copied into the +input image. It is given by a list of space separated float values: +

+
output_rect=x\ y\ width\ height
+
+

If not given, the output rectangle equals the dimensions of the input image. +The output rectangle is automatically cropped at the borders of the input +image. Negative values are valid for each component. +

+
output_rect=25\ 25\ 100\ 100
+
+
+
+ +

Several filters can be chained for successive processing without GPU-HOST +transfers allowing for fast processing of complex filter chains. +Currently, only filters with zero (generators) or exactly one (filters) input +image and one output image are supported. Also, transition filters are not yet +usable as intended. +

+

Some filters generate output images with additional padding depending on the +respective filter kernel. The padding is automatically removed to ensure the +filter output has the same size as the input image. +

+

For image generators, the size of the output image is determined by the +previous output image of the filter chain or the input image of the whole +filterchain, respectively. The generators do not use the pixel information of +this image to generate their output. However, the generated output is +blended onto this image, resulting in partial or complete coverage of the +output image. +

+

The coreimagesrc video source can be used for generating input images +which are directly fed into the filter chain. By using it, providing input +images by another video source or an input video is not required. +

+ +
+

11.46.1 Examples

+ +
    +
  • List all filters available: +
    +
    coreimage=list_filters=true
    +
    + +
  • Use the CIBoxBlur filter with default options to blur an image: +
    +
    coreimage=filter=CIBoxBlur@default
    +
    + +
  • Use a filter chain with CISepiaTone at default values and CIVignetteEffect with +its center at 100x100 and a radius of 50 pixels: +
    +
    coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
    +
    + +
  • Use nullsrc and CIQRCodeGenerator to create a QR code for the FFmpeg homepage, +given as complete and escaped command-line for Apple’s standard bash shell: +
    +
    ffmpeg -f lavfi -i nullsrc=s=100x100,coreimage=filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
    +
    +
+ +
+
+
+

11.47 corr

+ +

Obtain the correlation between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained per component, average, min and max correlation is printed through +the logging system. +

+

The filter stores the calculated correlation of each frame in frame metadata. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi corr -f null -
+
+ +
+
+

11.48 cover_rect

+ +

Cover a rectangular object +

+

It accepts the following options: +

+
+
cover
+

Filepath of the optional cover image, needs to be in yuv420. +

+
+
mode
+

Set covering mode. +

+

It accepts the following values: +

+
cover
+

cover it by the supplied image +

+
blur
+

cover it by interpolating the surrounding pixels +

+
+ +

Default value is blur. +

+
+ + +
+

11.48.1 Examples

+ +
    +
  • Cover a rectangular object by the supplied image of a given video using ffmpeg: +
    +
    ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
    +
    +
+ +
+
+
+

11.49 crop

+ +

Crop the input video to given dimensions. +

+

It accepts the following parameters: +

+
+
w, out_w
+

The width of the output video. It defaults to iw. +This expression is evaluated only once during the filter +configuration, or when the ‘w’ or ‘out_w’ command is sent. +

+
+
h, out_h
+

The height of the output video. It defaults to ih. +This expression is evaluated only once during the filter +configuration, or when the ‘h’ or ‘out_h’ command is sent. +

+
+
x
+

The horizontal position, in the input video, of the left edge of the output +video. It defaults to (in_w-out_w)/2. +This expression is evaluated per-frame. +

+
+
y
+

The vertical position, in the input video, of the top edge of the output video. +It defaults to (in_h-out_h)/2. +This expression is evaluated per-frame. +

+
+
keep_aspect
+

If set to 1 will force the output display aspect ratio +to be the same of the input, by changing the output sample aspect +ratio. It defaults to 0. +

+
+
exact
+

Enable exact cropping. If enabled, subsampled videos will be cropped at exact +width/height/x/y as specified and will not be rounded to nearest smaller value. +It defaults to 0. +

+
+ +

The out_w, out_h, x, y parameters are +expressions containing the following constants: +

+
+
x
+
y
+

The computed values for x and y. They are evaluated for +each new frame. +

+
+
in_w
+
in_h
+

The input width and height. +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (cropped) width and height. +

+
+
ow
+
oh
+

These are the same as out_w and out_h. +

+
+
a
+

same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (iw / ih) * sar +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
n
+

The number of the input frame, starting from 0. +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, +do not use +

+
+
t
+

The timestamp expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
+ +

The expression for out_w may depend on the value of out_h, +and the expression for out_h may depend on out_w, but they +cannot depend on x and y, as x and y are +evaluated after out_w and out_h. +

+

The x and y parameters specify the expressions for the +position of the top-left corner of the output (non-cropped) area. They +are evaluated for each frame. If the evaluated value is not valid, it +is approximated to the nearest valid value. +

+

The expression for x may depend on y, and the expression +for y may depend on x. +

+ +
+

11.49.1 Examples

+ +
    +
  • Crop area with size 100x100 at position (12,34). +
    +
    crop=100:100:12:34
    +
    + +

    Using named options, the example above becomes: +

    +
    crop=w=100:h=100:x=12:y=34
    +
    + +
  • Crop the central input area with size 100x100: +
    +
    crop=100:100
    +
    + +
  • Crop the central input area with size 2/3 of the input video: +
    +
    crop=2/3*in_w:2/3*in_h
    +
    + +
  • Crop the input video central square: +
    +
    crop=out_w=in_h
    +crop=in_h
    +
    + +
  • Delimit the rectangle with the top-left corner placed at position +100:100 and the right-bottom corner corresponding to the right-bottom +corner of the input image. +
    +
    crop=in_w-100:in_h-100:100:100
    +
    + +
  • Crop 10 pixels from the left and right borders, and 20 pixels from +the top and bottom borders +
    +
    crop=in_w-2*10:in_h-2*20
    +
    + +
  • Keep only the bottom right quarter of the input image: +
    +
    crop=in_w/2:in_h/2:in_w/2:in_h/2
    +
    + +
  • Crop height for getting Greek harmony: +
    +
    crop=in_w:1/PHI*in_w
    +
    + +
  • Apply trembling effect: +
    +
    crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)
    +
    + +
  • Apply erratic camera effect depending on timestamp: +
    +
    crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)
    +
    + +
  • Set x depending on the value of y: +
    +
    crop=in_w/2:in_h/2:y:10+10*sin(n/10)
    +
    +
+ +
+
+

11.49.2 Commands

+ +

This filter supports the following commands: +

+
w, out_w
+
h, out_h
+
x
+
y
+

Set width/height of the output video and the horizontal/vertical position +in the input video. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

11.50 cropdetect

+ +

Auto-detect the crop size. +

+

It calculates the necessary cropping parameters and prints the +recommended parameters via the logging system. The detected dimensions +correspond to the non-black or video area of the input video according to mode. +

+

It accepts the following parameters: +

+
+
mode
+

Depending on mode crop detection is based on either the mere black value of surrounding pixels or a combination of motion vectors and edge pixels. +

+
+
black
+

Detect black pixels surrounding the playing video. For fine control use option limit. +

+
+
mvedges
+

Detect the playing video by the motion vectors inside the video and scanning for edge pixels typically forming the border of a playing video. +

+
+ +
+
limit
+

Set higher black value threshold, which can be optionally specified +from nothing (0) to everything (255 for 8-bit based formats). An intensity +value greater to the set value is considered non-black. It defaults to 24. +You can also specify a value between 0.0 and 1.0 which will be scaled depending +on the bitdepth of the pixel format. +

+
+
round
+

The value which the width/height should be divisible by. It defaults to +16. The offset is automatically adjusted to center the video. Use 2 to +get only even dimensions (needed for 4:2:2 video). 16 is best when +encoding to most video codecs. +

+
+
skip
+

Set the number of initial frames for which evaluation is skipped. +Default is 2. Range is 0 to INT_MAX. +

+
+
reset_count, reset
+

Set the counter that determines after how many frames cropdetect will +reset the previously detected largest video area and start over to +detect the current optimal crop area. Default value is 0. +

+

This can be useful when channel logos distort the video area. 0 +indicates ’never reset’, and returns the largest area encountered during +playback. +

+
+
mv_threshold
+

Set motion in pixel units as threshold for motion detection. It defaults to 8. +

+
+
low
+
high
+

Set low and high threshold values used by the Canny thresholding +algorithm. +

+

The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. +

+

low and high threshold values must be chosen in the range +[0,1], and low should be lesser or equal to high. +

+

Default value for low is 5/255, and default value for high +is 15/255. +

+
+ + +
+

11.50.1 Examples

+ +
    +
  • Find video area surrounded by black borders: +
    +
    ffmpeg -i file.mp4 -vf cropdetect,metadata=mode=print -f null -
    +
    + +
  • Find an embedded video area, generate motion vectors beforehand: +
    +
    ffmpeg -i file.mp4 -vf mestimate,cropdetect=mode=mvedges,metadata=mode=print -f null -
    +
    + +
  • Find an embedded video area, use motion vectors from decoder: +
    +
    ffmpeg -flags2 +export_mvs -i file.mp4 -vf cropdetect=mode=mvedges,metadata=mode=print -f null -
    +
    +
+ +
+
+

11.50.2 Commands

+ +

This filter supports the following commands: +

+
+
limit
+

The command accepts the same syntax of the corresponding option. +If the specified expression is not valid, it is kept at its current value. +

+
+ +
+
+
+

11.51 cue

+ +

Delay video filtering until a given wallclock timestamp. The filter first +passes on preroll amount of frames, then it buffers at most +buffer amount of frames and waits for the cue. After reaching the cue +it forwards the buffered frames and also any subsequent frames coming in its +input. +

+

The filter can be used synchronize the output of multiple ffmpeg processes for +realtime output devices like decklink. By putting the delay in the filtering +chain and pre-buffering frames the process can pass on data to output almost +immediately after the target wallclock timestamp is reached. +

+

Perfect frame accuracy cannot be guaranteed, but the result is good enough for +some use cases. +

+
+
cue
+

The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0. +

+
+
preroll
+

The duration of content to pass on as preroll expressed in seconds. Default is 0. +

+
+
buffer
+

The maximum duration of content to buffer before waiting for the cue expressed +in seconds. Default is 0. +

+
+
+ +
+
+

11.52 curves

+ +

Apply color adjustments using curves. +

+

This filter is similar to the Adobe Photoshop and GIMP curves tools. Each +component (red, green and blue) has its values defined by N key points +tied from each other using a smooth curve. The x-axis represents the pixel +values from the input frame, and the y-axis the new pixel values to be set for +the output frame. +

+

By default, a component curve is defined by the two points (0;0) and +(1;1). This creates a straight line where each original pixel value is +"adjusted" to its own value, which means no change to the image. +

+

The filter allows you to redefine these two points and add some more. A new +curve will be define to pass smoothly through all these new coordinates. The +new defined points needs to be strictly increasing over the x-axis, and their +x and y values must be in the [0;1] interval. The curve is +formed by using a natural or monotonic cubic spline interpolation, depending +on the interp option (default: natural). The natural +spline produces a smoother curve in general while the monotonic (pchip) +spline guarantees the transitions between the specified points to be +monotonic. If the computed curves happened to go outside the vector spaces, +the values will be clipped accordingly. +

+

The filter accepts the following options: +

+
+
preset
+

Select one of the available color presets. This option can be used in addition +to the r, g, b parameters; in this case, the later +options takes priority on the preset values. +Available presets are: +

+
none
+
color_negative
+
cross_process
+
darker
+
increase_contrast
+
lighter
+
linear_contrast
+
medium_contrast
+
negative
+
strong_contrast
+
vintage
+
+

Default is none. +

+
master, m
+

Set the master key points. These points will define a second pass mapping. It +is sometimes called a "luminance" or "value" mapping. It can be used with +r, g, b or all since it acts like a +post-processing LUT. +

+
red, r
+

Set the key points for the red component. +

+
green, g
+

Set the key points for the green component. +

+
blue, b
+

Set the key points for the blue component. +

+
all
+

Set the key points for all components (not including master). +Can be used in addition to the other key points component +options. In this case, the unset component(s) will fallback on this +all setting. +

+
psfile
+

Specify a Photoshop curves file (.acv) to import the settings from. +

+
plot
+

Save Gnuplot script of the curves in specified file. +

+
interp
+

Specify the kind of interpolation. Available algorithms are: +

+
natural
+

Natural cubic spline using a piece-wise cubic polynomial that is twice continuously differentiable. +

+
pchip
+

Monotonic cubic spline using a piecewise cubic Hermite interpolating polynomial (PCHIP). +

+
+ +
+
+ +

To avoid some filtergraph syntax conflicts, each key points list need to be +defined using the following syntax: x0/y0 x1/y1 x2/y2 .... +

+ +
+

11.52.1 Commands

+ +

This filter supports same commands as options. +

+
+
+

11.52.2 Examples

+ +
    +
  • Increase slightly the middle level of blue: +
    +
    curves=blue='0/0 0.5/0.58 1/1'
    +
    + +
  • Vintage effect: +
    +
    curves=r='0/0.11 .42/.51 1/0.95':g='0/0 0.50/0.48 1/1':b='0/0.22 .49/.44 1/0.8'
    +
    +

    Here we obtain the following coordinates for each components: +

    +
    red
    +

    (0;0.11) (0.42;0.51) (1;0.95) +

    +
    green
    +

    (0;0) (0.50;0.48) (1;1) +

    +
    blue
    +

    (0;0.22) (0.49;0.44) (1;0.80) +

    +
    + +
  • The previous example can also be achieved with the associated built-in preset: +
    +
    curves=preset=vintage
    +
    + +
  • Or simply: +
    +
    curves=vintage
    +
    + +
  • Use a Photoshop preset and redefine the points of the green component: +
    +
    curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
    +
    + +
  • Check out the curves of the cross_process profile using ffmpeg +and gnuplot: +
    +
    ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
    +gnuplot -p /tmp/curves.plt
    +
    +
+ +
+
+
+

11.53 datascope

+ +

Video data analysis filter. +

+

This filter shows hexadecimal pixel values of part of video. +

+

The filter accepts the following options: +

+
+
size, s
+

Set output video size. +

+
+
x
+

Set x offset from where to pick pixels. +

+
+
y
+

Set y offset from where to pick pixels. +

+
+
mode
+

Set scope mode, can be one of the following: +

+
mono
+

Draw hexadecimal pixel values with white color on black background. +

+
+
color
+

Draw hexadecimal pixel values with input video pixel color on black +background. +

+
+
color2
+

Draw hexadecimal pixel values on color background picked from input video, +the text color is picked in such way so its always visible. +

+
+ +
+
axis
+

Draw rows and columns numbers on left and top of video. +

+
+
opacity
+

Set background opacity. +

+
+
format
+

Set display number format. Can be hex, or dec. Default is hex. +

+
+
components
+

Set pixel components to display. By default all pixel components are displayed. +

+
+ + +
+

11.53.1 Commands

+ +

This filter supports same commands as options excluding size option. +

+
+
+
+

11.54 dblur

+

Apply Directional blur filter. +

+

The filter accepts the following options: +

+
+
angle
+

Set angle of directional blur. Default is 45. +

+
+
radius
+

Set radius of directional blur. Default is 5. +

+
+
planes
+

Set which planes to filter. By default all planes are filtered. +

+
+ + +
+

11.54.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

11.55 dctdnoiz

+ +

Denoise frames using 2D DCT (frequency domain filtering). +

+

This filter is not designed for real time. +

+

The filter accepts the following options: +

+
+
sigma, s
+

Set the noise sigma constant. +

+

This sigma defines a hard threshold of 3 * sigma; every DCT +coefficient (absolute value) below this threshold with be dropped. +

+

If you need a more advanced filtering, see expr. +

+

Default is 0. +

+
+
overlap
+

Set number overlapping pixels for each block. Since the filter can be slow, you +may want to reduce this value, at the cost of a less effective filter and the +risk of various artefacts. +

+

If the overlapping value doesn’t permit processing the whole input width or +height, a warning will be displayed and according borders won’t be denoised. +

+

Default value is blocksize-1, which is the best possible setting. +

+
+
expr, e
+

Set the coefficient factor expression. +

+

For each coefficient of a DCT block, this expression will be evaluated as a +multiplier value for the coefficient. +

+

If this is option is set, the sigma option will be ignored. +

+

The absolute value of the coefficient can be accessed through the c +variable. +

+
+
n
+

Set the blocksize using the number of bits. 1<<n defines the +blocksize, which is the width and height of the processed blocks. +

+

The default value is 3 (8x8) and can be raised to 4 for a +blocksize of 16x16. Note that changing this setting has huge consequences +on the speed processing. Also, a larger block size does not necessarily means a +better de-noising. +

+
+ + +
+

11.55.1 Examples

+ +

Apply a denoise with a sigma of 4.5: +

+
dctdnoiz=4.5
+
+ +

The same operation can be achieved using the expression system: +

+
dctdnoiz=e='gte(c, 4.5*3)'
+
+ +

Violent denoise using a block size of 16x16: +

+
dctdnoiz=15:n=4
+
+ +
+
+
+

11.56 deband

+ +

Remove banding artifacts from input video. +It works by replacing banded pixels with average value of referenced pixels. +

+

The filter accepts the following options: +

+
+
1thr
+
2thr
+
3thr
+
4thr
+

Set banding detection threshold for each plane. Default is 0.02. +Valid range is 0.00003 to 0.5. +If difference between current pixel and reference pixel is less than threshold, +it will be considered as banded. +

+
+
range, r
+

Banding detection range in pixels. Default is 16. If positive, random number +in range 0 to set value will be used. If negative, exact absolute value +will be used. +The range defines square of four pixels around current pixel. +

+
+
direction, d
+

Set direction in radians from which four pixel will be compared. If positive, +random direction from 0 to set direction will be picked. If negative, exact of +absolute value will be picked. For example direction 0, -PI or -2*PI radians +will pick only pixels on same row and -PI/2 will pick only pixels on same +column. +

+
+
blur, b
+

If enabled, current pixel is compared with average value of all four +surrounding pixels. The default is enabled. If disabled current pixel is +compared with all four surrounding pixels. The pixel is considered banded +if only all four differences with surrounding pixels are less than threshold. +

+
+
coupling, c
+

If enabled, current pixel is changed if and only if all pixel components are banded, +e.g. banding detection threshold is triggered for all color components. +The default is disabled. +

+
+ + +
+

11.56.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.57 deblock

+ +

Remove blocking artifacts from input video. +

+

The filter accepts the following options: +

+
+
filter
+

Set filter type, can be weak or strong. Default is strong. +This controls what kind of deblocking is applied. +

+
+
block
+

Set size of block, allowed range is from 4 to 512. Default is 8. +

+
+
alpha
+
beta
+
gamma
+
delta
+

Set blocking detection thresholds. Allowed range is 0 to 1. +Defaults are: 0.098 for alpha and 0.05 for the rest. +Using higher threshold gives more deblocking strength. +Setting alpha controls threshold detection at exact edge of block. +Remaining options controls threshold detection near the edge. Each one for +below/above or left/right. Setting any of those to 0 disables +deblocking. +

+
+
planes
+

Set planes to filter. Default is to filter all available planes. +

+
+ + +
+

11.57.1 Examples

+ +
    +
  • Deblock using weak filter and block size of 4 pixels. +
    +
    deblock=filter=weak:block=4
    +
    + +
  • Deblock using strong filter, block size of 4 pixels and custom thresholds for +deblocking more edges. +
    +
    deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
    +
    + +
  • Similar as above, but filter only first plane. +
    +
    deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
    +
    + +
  • Similar as above, but filter only second and third plane. +
    +
    deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
    +
    +
+ +
+
+

11.57.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.58 decimate

+ +

Drop duplicated frames at regular intervals. +

+

The filter accepts the following options: +

+
+
cycle
+

Set the number of frames from which one will be dropped. Setting this to +N means one frame in every batch of N frames will be dropped. +Default is 5. +

+
+
dupthresh
+

Set the threshold for duplicate detection. If the difference metric for a frame +is less than or equal to this value, then it is declared as duplicate. Default +is 1.1 +

+
+
scthresh
+

Set scene change threshold. Default is 15. +

+
+
blockx
+
blocky
+

Set the size of the x and y-axis blocks used during metric calculations. +Larger blocks give better noise suppression, but also give worse detection of +small movements. Must be a power of two. Default is 32. +

+
+
ppsrc
+

Mark main input as a pre-processed input and activate clean source input +stream. This allows the input to be pre-processed with various filters to help +the metrics calculation while keeping the frame selection lossless. When set to +1, the first stream is for the pre-processed input, and the second +stream is the clean source from where the kept frames are chosen. Default is +0. +

+
+
chroma
+

Set whether or not chroma is considered in the metric calculations. Default is +1. +

+
+
mixed
+

Set whether or not the input only partially contains content to be decimated. +Default is false. +If enabled video output stream will be in variable frame rate. +

+
+ +
+
+

11.59 deconvolve

+ +

Apply 2D deconvolution of video stream in frequency domain using second stream +as impulse. +

+

The filter accepts the following options: +

+
+
planes
+

Set which planes to process. +

+
+
impulse
+

Set which impulse video frames will be processed, can be first +or all. Default is all. +

+
+
noise
+

Set noise when doing divisions. Default is 0.0000001. Useful when width +and height are not same and not power of 2 or if stream prior to convolving +had noise. +

+
+ +

The deconvolve filter also supports the framesync options. +

+
+
+

11.60 dedot

+ +

Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video. +

+

It accepts the following options: +

+
+
m
+

Set mode of operation. Can be combination of dotcrawl for cross-luminance reduction and/or +rainbows for cross-color reduction. +

+
+
lt
+

Set spatial luma threshold. Lower values increases reduction of cross-luminance. +

+
+
tl
+

Set tolerance for temporal luma. Higher values increases reduction of cross-luminance. +

+
+
tc
+

Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color. +

+
+
ct
+

Set temporal chroma threshold. Lower values increases reduction of cross-color. +

+
+ +
+
+

11.61 deflate

+ +

Apply deflate effect to the video. +

+

This filter replaces the pixel by the local(3x3) average by taking into account +only values lower than the pixel. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+ + +
+

11.61.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.62 deflicker

+ +

Remove temporal frame luminance variations. +

+

It accepts the following options: +

+
+
size, s
+

Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129. +

+
+
mode, m
+

Set averaging mode to smooth temporal luminance variations. +

+

Available values are: +

+
am
+

Arithmetic mean +

+
+
gm
+

Geometric mean +

+
+
hm
+

Harmonic mean +

+
+
qm
+

Quadratic mean +

+
+
cm
+

Cubic mean +

+
+
pm
+

Power mean +

+
+
median
+

Median +

+
+ +
+
bypass
+

Do not actually modify frame. Useful when one only wants metadata. +

+
+ +
+
+

11.63 dejudder

+ +

Remove judder produced by partially interlaced telecined content. +

+

Judder can be introduced, for instance, by pullup filter. If the original +source was partially telecined content then the output of pullup,dejudder +will have a variable frame rate. May change the recorded frame rate of the +container. Aside from that change, this filter will not affect constant frame +rate video. +

+

The option available in this filter is: +

+
cycle
+

Specify the length of the window over which the judder repeats. +

+

Accepts any integer greater than 1. Useful values are: +

+
4
+

If the original was telecined from 24 to 30 fps (Film to NTSC). +

+
+
5
+

If the original was telecined from 25 to 30 fps (PAL to NTSC). +

+
+
20
+

If a mixture of the two. +

+
+ +

The default is ‘4’. +

+
+ +
+ +
+

11.65 derain

+ +

Remove the rain in the input image/video by applying the derain methods based on +convolutional neural networks. Supported models: +

+ + +

Training as well as model generation scripts are provided in +the repository at https://github.com/XueweiMeng/derain_filter.git. +

+

The filter accepts the following options: +

+
+
filter_type
+

Specify which filter to use. This option accepts the following values: +

+
+
derain
+

Derain filter. To conduct derain filter, you need to use a derain model. +

+
+
dehaze
+

Dehaze filter. To conduct dehaze filter, you need to use a dehaze model. +

+
+

Default value is ‘derain’. +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +the following values: +

+
+
tensorflow
+

TensorFlow backend. To enable this backend you +need to install the TensorFlow for C library (see +https://www.tensorflow.org/install/lang_c) and configure FFmpeg with +--enable-libtensorflow +

+
+ +
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. TensorFlow can load files for only its format. +

+
+ +

To get full functionality (such as async execution), please use the dnn_processing filter. +

+
+
+

11.66 deshake

+ +

Attempt to fix small changes in horizontal and/or vertical shift. This +filter helps remove camera shake from hand-holding a camera, bumping a +tripod, moving on a vehicle, etc. +

+

The filter accepts the following options: +

+
+
x
+
y
+
w
+
h
+

Specify a rectangular area where to limit the search for motion +vectors. +If desired the search for motion vectors can be limited to a +rectangular area of the frame defined by its top left corner, width +and height. These parameters have the same meaning as the drawbox +filter which can be used to visualise the position of the bounding +box. +

+

This is useful when simultaneous movement of subjects within the frame +might be confused for camera motion by the motion vector search. +

+

If any or all of x, y, w and h are set to -1 +then the full frame is used. This allows later options to be set +without specifying the bounding box for the motion vector search. +

+

Default - search the whole frame. +

+
+
rx
+
ry
+

Specify the maximum extent of movement in x and y directions in the +range 0-64 pixels. Default 16. +

+
+
edge
+

Specify how to generate pixels to fill blanks at the edge of the +frame. Available values are: +

+
blank, 0
+

Fill zeroes at blank locations +

+
original, 1
+

Original image at blank locations +

+
clamp, 2
+

Extruded edge value at blank locations +

+
mirror, 3
+

Mirrored edge at blank locations +

+
+

Default value is ‘mirror’. +

+
+
blocksize
+

Specify the blocksize to use for motion search. Range 4-128 pixels, +default 8. +

+
+
contrast
+

Specify the contrast threshold for blocks. Only blocks with more than +the specified contrast (difference between darkest and lightest +pixels) will be considered. Range 1-255, default 125. +

+
+
search
+

Specify the search strategy. Available values are: +

+
exhaustive, 0
+

Set exhaustive search +

+
less, 1
+

Set less exhaustive search. +

+
+

Default value is ‘exhaustive’. +

+
+
filename
+

If set then a detailed log of the motion search is written to the +specified file. +

+
+
+ +
+
+

11.67 despill

+ +

Remove unwanted contamination of foreground colors, caused by reflected color of +greenscreen or bluescreen. +

+

This filter accepts the following options: +

+
+
type
+

Set what type of despill to use. +

+
+
mix
+

Set how spillmap will be generated. +

+
+
expand
+

Set how much to get rid of still remaining spill. +

+
+
red
+

Controls amount of red in spill area. +

+
+
green
+

Controls amount of green in spill area. +Should be -1 for greenscreen. +

+
+
blue
+

Controls amount of blue in spill area. +Should be -1 for bluescreen. +

+
+
brightness
+

Controls brightness of spill area, preserving colors. +

+
+
alpha
+

Modify alpha from generated spillmap. +

+
+ + +
+

11.67.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.68 detelecine

+ +

Apply an exact inverse of the telecine operation. It requires a predefined +pattern specified using the pattern option which must be the same as that passed +to the telecine filter. +

+

This filter accepts the following options: +

+
+
first_field
+
+
top, t
+

top field first +

+
bottom, b
+

bottom field first +The default value is top. +

+
+ +
+
pattern
+

A string of numbers representing the pulldown pattern you wish to apply. +The default value is 23. +

+
+
start_frame
+

A number representing position of the first frame with respect to the telecine +pattern. This is to be used if the stream is cut. The default value is 0. +

+
+ +
+
+

11.69 dilation

+ +

Apply dilation effect to the video. +

+

This filter replaces the pixel by the local(3x3) maximum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. Default is 255 i.e. all eight +pixels are used. +

+

Flags to local 3x3 coordinates maps like this: +

+

1 2 3 + 4 5 + 6 7 8 +

+
+ + +
+

11.69.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.70 displace

+ +

Displace pixels as indicated by second and third input stream. +

+

It takes three input streams and outputs one stream, the first input is the +source, and second and third input are displacement maps. +

+

The second input specifies how much to displace pixels along the +x-axis, while the third input specifies how much to displace pixels +along the y-axis. +If one of displacement map streams terminates, last frame from that +displacement map will be used. +

+

Note that once generated, displacements maps can be reused over and over again. +

+

A description of the accepted options follows. +

+
+
edge
+

Set displace behavior for pixels that are out of range. +

+

Available values are: +

+
blank
+

Missing pixels are replaced by black pixels. +

+
+
smear
+

Adjacent pixels will spread out to replace missing pixels. +

+
+
wrap
+

Out of range pixels are wrapped so they point to pixels of other side. +

+
+
mirror
+

Out of range pixels will be replaced with mirrored pixels. +

+
+

Default is ‘smear’. +

+
+
+ + +
+

11.70.1 Examples

+ +
    +
  • Add ripple effect to rgb input of video size hd720: +
    +
    ffmpeg -i INPUT -f lavfi -i nullsrc=s=hd720,lutrgb=128:128:128 -f lavfi -i nullsrc=s=hd720,geq='r=128+30*sin(2*PI*X/400+T):g=128+30*sin(2*PI*X/400+T):b=128+30*sin(2*PI*X/400+T)' -lavfi '[0][1][2]displace' OUTPUT
    +
    + +
  • Add wave effect to rgb input of video size hd720: +
    +
    ffmpeg -i INPUT -f lavfi -i nullsrc=hd720,geq='r=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):g=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):b=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T))' -lavfi '[1]split[x][y],[0][x][y]displace' OUTPUT
    +
    +
+ +
+
+
+

11.71 dnn_classify

+ +

Do classification with deep neural networks based on bounding boxes. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +only openvino now, tensorflow backends will be added. +

+
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. +

+
+
input
+

Set the input name of the dnn network. +

+
+
output
+

Set the output name of the dnn network. +

+
+
confidence
+

Set the confidence threshold (default: 0.5). +

+
+
labels
+

Set path to label file specifying the mapping between label id and name. +Each label name is written in one line, tailing spaces and empty lines are skipped. +The first line is the name of label id 0, +and the second line is the name of label id 1, etc. +The label id is considered as name if the label file is not provided. +

+
+
backend_configs
+

Set the configs to be passed into backend +

+

For tensorflow backend, you can set its configs with sess_config options, +please use tools/python/tf_sess_config.py to get the configs for your system. +

+
+
+ +
+
+

11.72 dnn_detect

+ +

Do object detection with deep neural networks. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +only openvino now, tensorflow backends will be added. +

+
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. +

+
+
input
+

Set the input name of the dnn network. +

+
+
output
+

Set the output name of the dnn network. +

+
+
confidence
+

Set the confidence threshold (default: 0.5). +

+
+
labels
+

Set path to label file specifying the mapping between label id and name. +Each label name is written in one line, tailing spaces and empty lines are skipped. +The first line is the name of label id 0 (usually it is ’background’), +and the second line is the name of label id 1, etc. +The label id is considered as name if the label file is not provided. +

+
+
backend_configs
+

Set the configs to be passed into backend. To use async execution, set async (default: set). +Roll back to sync execution if the backend does not support async. +

+
+
+ +
+
+

11.73 dnn_processing

+ +

Do image processing with deep neural networks. It works together with another filter +which converts the pixel format of the Frame to what the dnn network requires. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +the following values: +

+
+
tensorflow
+

TensorFlow backend. To enable this backend you +need to install the TensorFlow for C library (see +https://www.tensorflow.org/install/lang_c) and configure FFmpeg with +--enable-libtensorflow +

+
+
openvino
+

OpenVINO backend. To enable this backend you +need to build and install the OpenVINO for C library (see +https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md) and configure FFmpeg with +--enable-libopenvino (–extra-cflags=-I... –extra-ldflags=-L... might +be needed if the header files and libraries are not installed into system path) +

+
+
+ +
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. TensorFlow, OpenVINO backend can load files for only its format. +

+
+
input
+

Set the input name of the dnn network. +

+
+
output
+

Set the output name of the dnn network. +

+
+
backend_configs
+

Set the configs to be passed into backend. To use async execution, set async (default: set). +Roll back to sync execution if the backend does not support async. +

+

For tensorflow backend, you can set its configs with sess_config options, +please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system. +

+
+
+ + +
+

11.73.1 Examples

+ +
    +
  • Remove rain in rgb24 frame with can.pb (see derain filter): +
    +
    ./ffmpeg -i rain.jpg -vf format=rgb24,dnn_processing=dnn_backend=tensorflow:model=can.pb:input=x:output=y derain.jpg
    +
    + +
  • Handle the Y channel with srcnn.pb (see sr filter) for frame with yuv420p (planar YUV formats supported): +
    +
    ./ffmpeg -i 480p.jpg -vf format=yuv420p,scale=w=iw*2:h=ih*2,dnn_processing=dnn_backend=tensorflow:model=srcnn.pb:input=x:output=y -y srcnn.jpg
    +
    + +
  • Handle the Y channel with espcn.pb (see sr filter), which changes frame size, for format yuv420p (planar YUV formats supported), +please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system. +
    +
    ./ffmpeg -i 480p.jpg -vf format=yuv420p,dnn_processing=dnn_backend=tensorflow:model=espcn.pb:input=x:output=y:backend_configs=sess_config=0x10022805320e09cdccccccccccec3f20012a01303801 -y tmp.espcn.jpg
    +
    + +
+ +
+
+
+

11.74 drawbox

+ +

Draw a colored box on the input image. +

+

It accepts the following parameters: +

+
+
x
+
y
+

The expressions which specify the top left corner coordinates of the box. It defaults to 0. +

+
+
width, w
+
height, h
+

The expressions which specify the width and height of the box; if 0 they are interpreted as +the input width and height. It defaults to 0. +

+
+
color, c
+

Specify the color of the box to write. For the general syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. If the special +value invert is used, the box edge color is the same as the +video with inverted luma. +

+
+
thickness, t
+

The expression which sets the thickness of the box edge. +A value of fill will create a filled box. Default value is 3. +

+

See below for the list of accepted constants. +

+
+
replace
+

Applicable if the input has alpha. With value 1, the pixels of the painted box +will overwrite the video’s color and alpha pixels. +Default is 0, which composites the box onto the input, leaving the video’s alpha intact. +

+
+ +

The parameters for x, y, w and h and t are expressions containing the +following constants: +

+
+
dar
+

The input display aspect ratio, it is the same as (w / h) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
in_h, ih
+
in_w, iw
+

The input width and height. +

+
+
sar
+

The input sample aspect ratio. +

+
+
x
+
y
+

The x and y offset coordinates where the box is drawn. +

+
+
w
+
h
+

The width and height of the drawn box. +

+
+
box_source
+

Box source can be set as side_data_detection_bboxes if you want to use box data in +detection bboxes of side data. +

+

If box_source is set, the x, y, width and height will be ignored and +still use box data in detection bboxes of side data. So please do not use this parameter if you were +not sure about the box source. +

+
+
t
+

The thickness of the drawn box. +

+

These constants allow the x, y, w, h and t expressions to refer to +each other, so you may for example specify y=x/dar or h=w/dar. +

+
+
+ + +
+

11.74.1 Examples

+ +
    +
  • Draw a black box around the edge of the input image: +
    +
    drawbox
    +
    + +
  • Draw a box with color red and an opacity of 50%: +
    +
    drawbox=10:20:200:60:red@0.5
    +
    + +

    The previous example can be specified as: +

    +
    drawbox=x=10:y=20:w=200:h=60:color=red@0.5
    +
    + +
  • Fill the box with pink color: +
    +
    drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
    +
    + +
  • Draw a 2-pixel red 2.40:1 mask: +
    +
    drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
    +
    +
+ +
+
+

11.74.2 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

11.75 drawgraph

+

Draw a graph using input video metadata. +

+

It accepts the following parameters: +

+
+
m1
+

Set 1st frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg1
+

Set 1st foreground color expression. +

+
+
m2
+

Set 2nd frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg2
+

Set 2nd foreground color expression. +

+
+
m3
+

Set 3rd frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg3
+

Set 3rd foreground color expression. +

+
+
m4
+

Set 4th frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg4
+

Set 4th foreground color expression. +

+
+
min
+

Set minimal value of metadata value. +

+
+
max
+

Set maximal value of metadata value. +

+
+
bg
+

Set graph background color. Default is white. +

+
+
mode
+

Set graph mode. +

+

Available values for mode is: +

+
bar
+
dot
+
line
+
+ +

Default is line. +

+
+
slide
+

Set slide mode. +

+

Available values for slide is: +

+
frame
+

Draw new frame when right border is reached. +

+
+
replace
+

Replace old columns with new ones. +

+
+
scroll
+

Scroll from right to left. +

+
+
rscroll
+

Scroll from left to right. +

+
+
picture
+

Draw single picture. +

+
+ +

Default is frame. +

+
+
size
+

Set size of graph video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +The default value is 900x256. +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+

The foreground color expressions can use the following variables: +

+
MIN
+

Minimal value of metadata value. +

+
+
MAX
+

Maximal value of metadata value. +

+
+
VAL
+

Current metadata key value. +

+
+ +

The color is defined as 0xAABBGGRR. +

+
+ +

Example using metadata from signalstats filter: +

+
signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
+
+ +

Example using metadata from ebur128 filter: +

+
ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
+
+ +
+
+

11.76 drawgrid

+ +

Draw a grid on the input image. +

+

It accepts the following parameters: +

+
+
x
+
y
+

The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0. +

+
+
width, w
+
height, h
+

The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the +input width and height, respectively, minus thickness, so image gets +framed. Default to 0. +

+
+
color, c
+

Specify the color of the grid. For the general syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. If the special +value invert is used, the grid color is the same as the +video with inverted luma. +

+
+
thickness, t
+

The expression which sets the thickness of the grid line. Default value is 1. +

+

See below for the list of accepted constants. +

+
+
replace
+

Applicable if the input has alpha. With 1 the pixels of the painted grid +will overwrite the video’s color and alpha pixels. +Default is 0, which composites the grid onto the input, leaving the video’s alpha intact. +

+
+ +

The parameters for x, y, w and h and t are expressions containing the +following constants: +

+
+
dar
+

The input display aspect ratio, it is the same as (w / h) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
in_h, ih
+
in_w, iw
+

The input grid cell width and height. +

+
+
sar
+

The input sample aspect ratio. +

+
+
x
+
y
+

The x and y coordinates of some point of grid intersection (meant to configure offset). +

+
+
w
+
h
+

The width and height of the drawn cell. +

+
+
t
+

The thickness of the drawn cell. +

+

These constants allow the x, y, w, h and t expressions to refer to +each other, so you may for example specify y=x/dar or h=w/dar. +

+
+
+ + +
+

11.76.1 Examples

+ +
    +
  • Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%: +
    +
    drawgrid=width=100:height=100:thickness=2:color=red@0.5
    +
    + +
  • Draw a white 3x3 grid with an opacity of 50%: +
    +
    drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
    +
    +
+ +
+
+

11.76.2 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

11.77 drawtext

+ +

Draw a text string or text from a specified file on top of a video, using the +libfreetype library. +

+

To enable compilation of this filter, you need to configure FFmpeg with +--enable-libfreetype. +To enable default font fallback and the font option you need to +configure FFmpeg with --enable-libfontconfig. +To enable the text_shaping option, you need to configure FFmpeg with +--enable-libfribidi. +

+ +
+

11.77.1 Syntax

+ +

It accepts the following parameters: +

+
+
box
+

Used to draw a box around text using the background color. +The value must be either 1 (enable) or 0 (disable). +The default value of box is 0. +

+
+
boxborderw
+

Set the width of the border to be drawn around the box using boxcolor. +The default value of boxborderw is 0. +

+
+
boxcolor
+

The color to be used for drawing box around text. For the syntax of this +option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+

The default value of boxcolor is "white". +

+
+
line_spacing
+

Set the line spacing in pixels of the border to be drawn around the box using box. +The default value of line_spacing is 0. +

+
+
borderw
+

Set the width of the border to be drawn around the text using bordercolor. +The default value of borderw is 0. +

+
+
bordercolor
+

Set the color to be used for drawing border around text. For the syntax of this +option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+

The default value of bordercolor is "black". +

+
+
expansion
+

Select how the text is expanded. Can be either none, +strftime (deprecated) or normal (default). See the +Text expansion section below for details. +

+
+
basetime
+

Set a start time for the count. Value is in microseconds. Only applied +in the deprecated strftime expansion mode. To emulate in normal expansion +mode use the pts function, supplying the start time (in seconds) +as the second argument. +

+
+
fix_bounds
+

If true, check and fix text coords to avoid clipping. +

+
+
fontcolor
+

The color to be used for drawing fonts. For the syntax of this option, check +the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+

The default value of fontcolor is "black". +

+
+
fontcolor_expr
+

String which is expanded the same way as text to obtain dynamic +fontcolor value. By default this option has empty value and is not +processed. When this option is set, it overrides fontcolor option. +

+
+
font
+

The font family to be used for drawing text. By default Sans. +

+
+
fontfile
+

The font file to be used for drawing text. The path must be included. +This parameter is mandatory if the fontconfig support is disabled. +

+
+
alpha
+

Draw the text applying alpha blending. The value can +be a number between 0.0 and 1.0. +The expression accepts the same variables x, y as well. +The default value is 1. +Please see fontcolor_expr. +

+
+
fontsize
+

The font size to be used for drawing text. +The default value of fontsize is 16. +

+
+
text_shaping
+

If set to 1, attempt to shape the text (for example, reverse the order of +right-to-left text and join Arabic characters) before drawing it. +Otherwise, just draw the text exactly as given. +By default 1 (if supported). +

+
+
ft_load_flags
+

The flags to be used for loading the fonts. +

+

The flags map the corresponding flags supported by libfreetype, and are +a combination of the following values: +

+
default
+
no_scale
+
no_hinting
+
render
+
no_bitmap
+
vertical_layout
+
force_autohint
+
crop_bitmap
+
pedantic
+
ignore_global_advance_width
+
no_recurse
+
ignore_transform
+
monochrome
+
linear_design
+
no_autohint
+
+ +

Default value is "default". +

+

For more information consult the documentation for the FT_LOAD_* +libfreetype flags. +

+
+
shadowcolor
+

The color to be used for drawing a shadow behind the drawn text. For the +syntax of this option, check the (ffmpeg-utils)"Color" section in the +ffmpeg-utils manual. +

+

The default value of shadowcolor is "black". +

+
+
shadowx
+
shadowy
+

The x and y offsets for the text shadow position with respect to the +position of the text. They can be either positive or negative +values. The default value for both is "0". +

+
+
start_number
+

The starting frame number for the n/frame_num variable. The default value +is "0". +

+
+
tabsize
+

The size in number of spaces to use for rendering the tab. +Default value is 4. +

+
+
timecode
+

Set the initial timecode representation in "hh:mm:ss[:;.]ff" +format. It can be used with or without text parameter. timecode_rate +option must be specified. +

+
+
timecode_rate, rate, r
+

Set the timecode frame rate (timecode only). Value will be rounded to nearest +integer. Minimum value is "1". +Drop-frame timecode is supported for frame rates 30 & 60. +

+
+
tc24hmax
+

If set to 1, the output of the timecode option will wrap around at 24 hours. +Default is 0 (disabled). +

+
+
text
+

The text string to be drawn. The text must be a sequence of UTF-8 +encoded characters. +This parameter is mandatory if no file is specified with the parameter +textfile. +

+
+
textfile
+

A text file containing text to be drawn. The text must be a sequence +of UTF-8 encoded characters. +

+

This parameter is mandatory if no text string is specified with the +parameter text. +

+

If both text and textfile are specified, an error is thrown. +

+
+
text_source
+

Text source should be set as side_data_detection_bboxes if you want to use text data in +detection bboxes of side data. +

+

If text source is set, text and textfile will be ignored and still use +text data in detection bboxes of side data. So please do not use this parameter +if you are not sure about the text source. +

+
+
reload
+

The textfile will be reloaded at specified frame interval. +Be sure to update textfile atomically, or it may be read partially, +or even fail. +Range is 0 to INT_MAX. Default is 0. +

+
+
x
+
y
+

The expressions which specify the offsets where text will be drawn +within the video frame. They are relative to the top/left border of the +output image. +

+

The default value of x and y is "0". +

+

See below for the list of accepted constants and functions. +

+
+ +

The parameters for x and y are expressions containing the +following constants and functions: +

+
+
dar
+

input display aspect ratio, it is the same as (w / h) * sar +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
line_h, lh
+

the height of each text line +

+
+
main_h, h, H
+

the input height +

+
+
main_w, w, W
+

the input width +

+
+
max_glyph_a, ascent
+

the maximum distance from the baseline to the highest/upper grid +coordinate used to place a glyph outline point, for all the rendered +glyphs. +It is a positive value, due to the grid’s orientation with the Y axis +upwards. +

+
+
max_glyph_d, descent
+

the maximum distance from the baseline to the lowest grid coordinate +used to place a glyph outline point, for all the rendered glyphs. +This is a negative value, due to the grid’s orientation, with the Y axis +upwards. +

+
+
max_glyph_h
+

maximum glyph height, that is the maximum height for all the glyphs +contained in the rendered text, it is equivalent to ascent - +descent. +

+
+
max_glyph_w
+

maximum glyph width, that is the maximum width for all the glyphs +contained in the rendered text +

+
+
n
+

the number of input frame, starting from 0 +

+
+
rand(min, max)
+

return a random number included between min and max +

+
+
sar
+

The input sample aspect ratio. +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
text_h, th
+

the height of the rendered text +

+
+
text_w, tw
+

the width of the rendered text +

+
+
x
+
y
+

the x and y offset coordinates where the text is drawn. +

+

These parameters allow the x and y expressions to refer +to each other, so you can for example specify y=x/dar. +

+
+
pict_type
+

A one character description of the current frame’s picture type. +

+
+
pkt_pos
+

The current packet’s position in the input file or stream +(in bytes, from the start of the input). A value of -1 indicates +this info is not available. +

+
+
duration
+

The current packet’s duration, in seconds. +

+
+
pkt_size
+

The current packet’s size (in bytes). +

+
+ +
+
+

11.77.2 Text expansion

+ +

If expansion is set to strftime, the filter recognizes +sequences accepted by the strftime C function in the provided +text and expands them accordingly. Check the documentation of +strftime. This feature is deprecated in favor of normal +expansion with the gmtime or localtime expansion +functions. +

+

If expansion is set to none, the text is printed verbatim. +

+

If expansion is set to normal (which is the default), +the following expansion mechanism is used. +

+

The backslash character ‘\’, followed by any character, always expands to +the second character. +

+

Sequences of the form %{...} are expanded. The text between the +braces is a function name, possibly followed by arguments separated by ’:’. +If the arguments contain special characters or delimiters (’:’ or ’}’), +they should be escaped. +

+

Note that they probably must also be escaped as the value for the text +option in the filter argument string and as the filter argument in the +filtergraph description, and possibly also for the shell, that makes up to four +levels of escaping; using a text file with the textfile option avoids +these problems. +

+

The following functions are available: +

+
+
expr, e
+

The expression evaluation result. +

+

It must take one argument specifying the expression to be evaluated, +which accepts the same constants and functions as the x and +y values. Note that not all constants should be used, for +example the text size is not known when evaluating the expression, so +the constants text_w and text_h will have an undefined +value. +

+
+
expr_int_format, eif
+

Evaluate the expression’s value and output as formatted integer. +

+

The first argument is the expression to be evaluated, just as for the expr function. +The second argument specifies the output format. Allowed values are ‘x’, +‘X’, ‘d’ and ‘u’. They are treated exactly as in the +printf function. +The third parameter is optional and sets the number of positions taken by the output. +It can be used to add padding with zeros from the left. +

+
+
gmtime
+

The time at which the filter is running, expressed in UTC. +It can accept an argument: a strftime C function format string. +The format string is extended to support the variable %[1-6]N +which prints fractions of the second with optionally specified number of digits. +

+
+
localtime
+

The time at which the filter is running, expressed in the local time zone. +It can accept an argument: a strftime C function format string. +The format string is extended to support the variable %[1-6]N +which prints fractions of the second with optionally specified number of digits. +

+
+
metadata
+

Frame metadata. Takes one or two arguments. +

+

The first argument is mandatory and specifies the metadata key. +

+

The second argument is optional and specifies a default value, used when the +metadata key is not found or empty. +

+

Available metadata can be identified by inspecting entries +starting with TAG included within each frame section +printed by running ffprobe -show_frames. +

+

String metadata generated in filters leading to +the drawtext filter are also available. +

+
+
n, frame_num
+

The frame number, starting from 0. +

+
+
pict_type
+

A one character description of the current picture type. +

+
+
pts
+

The timestamp of the current frame. +It can take up to three arguments. +

+

The first argument is the format of the timestamp; it defaults to flt +for seconds as a decimal number with microsecond accuracy; hms stands +for a formatted [-]HH:MM:SS.mmm timestamp with millisecond accuracy. +gmtime stands for the timestamp of the frame formatted as UTC time; +localtime stands for the timestamp of the frame formatted as +local time zone time. +

+

The second argument is an offset added to the timestamp. +

+

If the format is set to hms, a third argument 24HH may be +supplied to present the hour part of the formatted timestamp in 24h format +(00-23). +

+

If the format is set to localtime or gmtime, a third +argument may be supplied: a strftime C function format string. +By default, YYYY-MM-DD HH:MM:SS format will be used. +

+
+ +
+
+

11.77.3 Commands

+ +

This filter supports altering parameters via commands: +

+
reinit
+

Alter existing filter parameters. +

+

Syntax for the argument is the same as for filter invocation, e.g. +

+
+
fontsize=56:fontcolor=green:text='Hello World'
+
+ +

Full filter invocation with sendcmd would look like this: +

+
+
sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
+
+
+
+ +

If the entire argument can’t be parsed or applied as valid values then the filter will +continue with its existing parameters. +

+
+
+

11.77.4 Examples

+ +
    +
  • Draw "Test Text" with font FreeSerif, using the default values for the +optional parameters. + +
    +
    drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
    +
    + +
  • Draw ’Test Text’ with font FreeSerif of size 24 at position x=100 +and y=50 (counting from the top-left corner of the screen), text is +yellow with a red box around it. Both the text and the box have an +opacity of 20%. + +
    +
    drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
    +          x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
    +
    + +

    Note that the double quotes are not necessary if spaces are not used +within the parameter list. +

    +
  • Show the text at the center of the video frame: +
    +
    drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2"
    +
    + +
  • Show the text at a random position, switching to a new position every 30 seconds: +
    +
    drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=if(eq(mod(t\,30)\,0)\,rand(0\,(w-text_w))\,x):y=if(eq(mod(t\,30)\,0)\,rand(0\,(h-text_h))\,y)"
    +
    + +
  • Show a text line sliding from right to left in the last row of the video +frame. The file LONG_LINE is assumed to contain a single line +with no newlines. +
    +
    drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"
    +
    + +
  • Show the content of file CREDITS off the bottom of the frame and scroll up. +
    +
    drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t"
    +
    + +
  • Draw a single green letter "g", at the center of the input video. +The glyph baseline is placed at half screen height. +
    +
    drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent"
    +
    + +
  • Show text for 1 second every 3 seconds: +
    +
    drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'"
    +
    + +
  • Use fontconfig to set the font. Note that the colons need to be escaped. +
    +
    drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
    +
    + +
  • Draw "Test Text" with font size dependent on height of the video. +
    +
    drawtext="text='Test Text': fontsize=h/30: x=(w-text_w)/2: y=(h-text_h*2)"
    +
    + +
  • Print the date of a real-time encoding (see documentation for the +strftime C function): +
    +
    drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
    +
    + +
  • Show text fading in and out (appearing/disappearing): +
    +
    #!/bin/sh
    +DS=1.0 # display start
    +DE=10.0 # display end
    +FID=1.5 # fade in duration
    +FOD=5 # fade out duration
    +ffplay -f lavfi "color,drawtext=text=TEST:fontsize=50:fontfile=FreeSerif.ttf:fontcolor_expr=ff0000%{eif\\\\: clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - $DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE - $FOD\\, $DE) )\\, 0\\, 255) \\\\: x\\\\: 2 }"
    +
    + +
  • Horizontally align multiple separate texts. Note that max_glyph_a +and the fontsize value are included in the y offset. +
    +
    drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
    +drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
    +
    + +
  • Plot special lavf.image2dec.source_basename metadata onto each frame if +such metadata exists. Otherwise, plot the string "NA". Note that image2 demuxer +must have option -export_path_metadata 1 for the special metadata fields +to be available for filters. +
    +
    drawtext="fontsize=20:fontcolor=white:fontfile=FreeSans.ttf:text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=10:y=10"
    +
    + +
+ +

For more information about libfreetype, check: +http://www.freetype.org/. +

+

For more information about fontconfig, check: +http://freedesktop.org/software/fontconfig/fontconfig-user.html. +

+

For more information about libfribidi, check: +http://fribidi.org/. +

+
+
+
+

11.78 edgedetect

+ +

Detect and draw edges. The filter uses the Canny Edge Detection algorithm. +

+

The filter accepts the following options: +

+
+
low
+
high
+

Set low and high threshold values used by the Canny thresholding +algorithm. +

+

The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. +

+

low and high threshold values must be chosen in the range +[0,1], and low should be lesser or equal to high. +

+

Default value for low is 20/255, and default value for high +is 50/255. +

+
+
mode
+

Define the drawing mode. +

+
+
wires
+

Draw white/gray wires on black background. +

+
+
colormix
+

Mix the colors to create a paint/cartoon effect. +

+
+
canny
+

Apply Canny edge detector on all selected planes. +

+
+

Default value is wires. +

+
+
planes
+

Select planes for filtering. By default all available planes are filtered. +

+
+ + +
+

11.78.1 Examples

+ +
    +
  • Standard edge detection with custom values for the hysteresis thresholding: +
    +
    edgedetect=low=0.1:high=0.4
    +
    + +
  • Painting effect without thresholding: +
    +
    edgedetect=mode=colormix:high=0
    +
    +
+ +
+
+
+

11.79 elbg

+ +

Apply a posterize effect using the ELBG (Enhanced LBG) algorithm. +

+

For each input image, the filter will compute the optimal mapping from +the input to the output given the codebook length, that is the number +of distinct output colors. +

+

This filter accepts the following options. +

+
+
codebook_length, l
+

Set codebook length. The value must be a positive integer, and +represents the number of distinct output colors. Default value is 256. +

+
+
nb_steps, n
+

Set the maximum number of iterations to apply for computing the optimal +mapping. The higher the value the better the result and the higher the +computation time. Default value is 1. +

+
+
seed, s
+

Set a random seed, must be an integer included between 0 and +UINT32_MAX. If not specified, or if explicitly set to -1, the filter +will try to use a good random seed on a best effort basis. +

+
+
pal8
+

Set pal8 output pixel format. This option does not work with codebook +length greater than 256. Default is disabled. +

+
+
use_alpha
+

Include alpha values in the quantization calculation. Allows creating +palettized output images (e.g. PNG8) with multiple alpha smooth blending. +

+
+ +
+
+

11.80 entropy

+ +

Measure graylevel entropy in histogram of color channels of video frames. +

+

It accepts the following parameters: +

+
+
mode
+

Can be either normal or diff. Default is normal. +

+

diff mode measures entropy of histogram delta values, absolute differences +between neighbour histogram values. +

+
+ +
+
+

11.81 epx

+

Apply the EPX magnification filter which is designed for pixel art. +

+

It accepts the following option: +

+
+
n
+

Set the scaling dimension: 2 for 2xEPX, 3 for +3xEPX. +Default is 3. +

+
+ +
+
+

11.82 eq

+

Set brightness, contrast, saturation and approximate gamma adjustment. +

+

The filter accepts the following options: +

+
+
contrast
+

Set the contrast expression. The value must be a float value in range +-1000.0 to 1000.0. The default value is "1". +

+
+
brightness
+

Set the brightness expression. The value must be a float value in +range -1.0 to 1.0. The default value is "0". +

+
+
saturation
+

Set the saturation expression. The value must be a float in +range 0.0 to 3.0. The default value is "1". +

+
+
gamma
+

Set the gamma expression. The value must be a float in range +0.1 to 10.0. The default value is "1". +

+
+
gamma_r
+

Set the gamma expression for red. The value must be a float in +range 0.1 to 10.0. The default value is "1". +

+
+
gamma_g
+

Set the gamma expression for green. The value must be a float in range +0.1 to 10.0. The default value is "1". +

+
+
gamma_b
+

Set the gamma expression for blue. The value must be a float in range +0.1 to 10.0. The default value is "1". +

+
+
gamma_weight
+

Set the gamma weight expression. It can be used to reduce the effect +of a high gamma value on bright image areas, e.g. keep them from +getting overamplified and just plain white. The value must be a float +in range 0.0 to 1.0. A value of 0.0 turns the +gamma correction all the way down while 1.0 leaves it at its +full strength. Default is "1". +

+
+
eval
+

Set when the expressions for brightness, contrast, saturation and +gamma expressions are evaluated. +

+

It accepts the following values: +

+
init
+

only evaluate expressions once during the filter initialization or +when a command is processed +

+
+
frame
+

evaluate expressions for each incoming frame +

+
+ +

Default value is ‘init’. +

+
+ +

The expressions accept the following parameters: +

+
n
+

frame count of the input frame starting from 0 +

+
+
pos
+

byte position of the corresponding packet in the input file, NAN if +unspecified; deprecated, do not use +

+
+
r
+

frame rate of the input video, NAN if the input frame rate is unknown +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+ + +
+

11.82.1 Commands

+

The filter supports the following commands: +

+
+
contrast
+

Set the contrast expression. +

+
+
brightness
+

Set the brightness expression. +

+
+
saturation
+

Set the saturation expression. +

+
+
gamma
+

Set the gamma expression. +

+
+
gamma_r
+

Set the gamma_r expression. +

+
+
gamma_g
+

Set gamma_g expression. +

+
+
gamma_b
+

Set gamma_b expression. +

+
+
gamma_weight
+

Set gamma_weight expression. +

+

The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+ +
+
+
+

11.83 erosion

+ +

Apply erosion effect to the video. +

+

This filter replaces the pixel by the local(3x3) minimum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. Default is 255 i.e. all eight +pixels are used. +

+

Flags to local 3x3 coordinates maps like this: +

+

1 2 3 + 4 5 + 6 7 8 +

+
+ + +
+

11.83.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.84 estdif

+ +

Deinterlace the input video ("estdif" stands for "Edge Slope +Tracing Deinterlacing Filter"). +

+

Spatial only filter that uses edge slope tracing algorithm +to interpolate missing lines. +It accepts the following parameters: +

+
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
frame
+

Output one frame for each frame. +

+
field
+

Output one frame for each field. +

+
+ +

The default value is field. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
tff
+

Assume the top field is first. +

+
bff
+

Assume the bottom field is first. +

+
auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
all
+

Deinterlace all frames. +

+
interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+
rslope
+

Specify the search radius for edge slope tracing. Default value is 1. +Allowed range is from 1 to 15. +

+
+
redge
+

Specify the search radius for best edge matching. Default value is 2. +Allowed range is from 0 to 15. +

+
+
ecost
+

Specify the edge cost for edge matching. Default value is 2. +Allowed range is from 0 to 50. +

+
+
mcost
+

Specify the middle cost for edge matching. Default value is 1. +Allowed range is from 0 to 50. +

+
+
dcost
+

Specify the distance cost for edge matching. Default value is 1. +Allowed range is from 0 to 50. +

+
+
interp
+

Specify the interpolation used. Default is 4-point interpolation. It accepts one +of the following values: +

+
+
2p
+

Two-point interpolation. +

+
4p
+

Four-point interpolation. +

+
6p
+

Six-point interpolation. +

+
+
+
+ + +
+

11.84.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

11.85 exposure

+

Adjust exposure of the video stream. +

+

The filter accepts the following options: +

+
+
exposure
+

Set the exposure correction in EV. Allowed range is from -3.0 to 3.0 EV +Default value is 0 EV. +

+
+
black
+

Set the black level correction. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+ + +
+

11.85.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

11.86 extractplanes

+ +

Extract color channel components from input video stream into +separate grayscale video streams. +

+

The filter accepts the following option: +

+
+
planes
+

Set plane(s) to extract. +

+

Available values for planes are: +

+
y
+
u
+
v
+
a
+
r
+
g
+
b
+
+ +

Choosing planes not available in the input will result in an error. +That means you cannot select r, g, b planes +with y, u, v planes at same time. +

+
+ + +
+

11.86.1 Examples

+ +
    +
  • Extract luma, u and v color channel component from input video frame +into 3 grayscale outputs: +
    +
    ffmpeg -i video.avi -filter_complex 'extractplanes=y+u+v[y][u][v]' -map '[y]' y.avi -map '[u]' u.avi -map '[v]' v.avi
    +
    +
+ +
+
+
+

11.87 fade

+ +

Apply a fade-in/out effect to the input video. +

+

It accepts the following parameters: +

+
+
type, t
+

The effect type can be either "in" for a fade-in, or "out" for a fade-out +effect. +Default is in. +

+
+
start_frame, s
+

Specify the number of the frame to start applying the fade +effect at. Default is 0. +

+
+
nb_frames, n
+

The number of frames that the fade effect lasts. At the end of the +fade-in effect, the output video will have the same intensity as the input video. +At the end of the fade-out transition, the output video will be filled with the +selected color. +Default is 25. +

+
+
alpha
+

If set to 1, fade only alpha channel, if one exists on the input. +Default value is 0. +

+
+
start_time, st
+

Specify the timestamp (in seconds) of the frame to start to apply the fade +effect. If both start_frame and start_time are specified, the fade will start at +whichever comes last. Default is 0. +

+
+
duration, d
+

The number of seconds for which the fade effect has to last. At the end of the +fade-in effect the output video will have the same intensity as the input video, +at the end of the fade-out transition the output video will be filled with the +selected color. +If both duration and nb_frames are specified, duration is used. Default is 0 +(nb_frames is used by default). +

+
+
color, c
+

Specify the color of the fade. Default is "black". +

+
+ + +
+

11.87.1 Examples

+ +
    +
  • Fade in the first 30 frames of video: +
    +
    fade=in:0:30
    +
    + +

    The command above is equivalent to: +

    +
    fade=t=in:s=0:n=30
    +
    + +
  • Fade out the last 45 frames of a 200-frame video: +
    +
    fade=out:155:45
    +fade=type=out:start_frame=155:nb_frames=45
    +
    + +
  • Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video: +
    +
    fade=in:0:25, fade=out:975:25
    +
    + +
  • Make the first 5 frames yellow, then fade in from frame 5-24: +
    +
    fade=in:5:20:color=yellow
    +
    + +
  • Fade in alpha over first 25 frames of video: +
    +
    fade=in:0:25:alpha=1
    +
    + +
  • Make the first 5.5 seconds black, then fade in for 0.5 seconds: +
    +
    fade=t=in:st=5.5:d=0.5
    +
    + +
+ +
+
+
+

11.88 feedback

+

Apply feedback video filter. +

+

This filter pass cropped input frames to 2nd output. +From there it can be filtered with other video filters. +After filter receives frame from 2nd input, that frame +is combined on top of original frame from 1st input and passed +to 1st output. +

+

The typical usage is filter only part of frame. +

+

The filter accepts the following options: +

+
x
+
y
+

Set the top left crop position. +

+
+
w
+
h
+

Set the crop size. +

+
+ + +
+

11.88.1 Examples

+ +
    +
  • Blur only top left rectangular part of video frame size 100x100 with gblur filter. +
    +
    [in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]gblur=8[blurin]
    +
    + +
  • Draw black box on top left part of video frame of size 100x100 with drawbox filter. +
    +
    [in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]drawbox=x=0:y=0:w=100:h=100:t=100[blurin]
    +
    +
+ +
+
+
+

11.89 fftdnoiz

+

Denoise frames using 3D FFT (frequency domain filtering). +

+

The filter accepts the following options: +

+
+
sigma
+

Set the noise sigma constant. This sets denoising strength. +Default value is 1. Allowed range is from 0 to 30. +Using very high sigma with low overlap may give blocking artifacts. +

+
+
amount
+

Set amount of denoising. By default all detected noise is reduced. +Default value is 1. Allowed range is from 0 to 1. +

+
+
block
+

Set size of block in pixels, Default is 32, can be 8 to 256. +

+
+
overlap
+

Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8. +

+
+
method
+

Set denoising method. Default is wiener, can also be hard. +

+
+
prev
+

Set number of previous frames to use for denoising. By default is set to 0. +

+
+
next
+

Set number of next frames to to use for denoising. By default is set to 0. +

+
+
planes
+

Set planes which will be filtered, by default are all available filtered +except alpha. +

+
+ +
+
+

11.90 fftfilt

+

Apply arbitrary expressions to samples in frequency domain +

+
+
dc_Y
+

Adjust the dc value (gain) of the luma plane of the image. The filter +accepts an integer value in range 0 to 1000. The default +value is set to 0. +

+
+
dc_U
+

Adjust the dc value (gain) of the 1st chroma plane of the image. The +filter accepts an integer value in range 0 to 1000. The +default value is set to 0. +

+
+
dc_V
+

Adjust the dc value (gain) of the 2nd chroma plane of the image. The +filter accepts an integer value in range 0 to 1000. The +default value is set to 0. +

+
+
weight_Y
+

Set the frequency domain weight expression for the luma plane. +

+
+
weight_U
+

Set the frequency domain weight expression for the 1st chroma plane. +

+
+
weight_V
+

Set the frequency domain weight expression for the 2nd chroma plane. +

+
+
eval
+

Set when the expressions are evaluated. +

+

It accepts the following values: +

+
init
+

Only evaluate expressions once during the filter initialization. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+ +

Default value is ‘init’. +

+

The filter accepts the following variables: +

+
X
+
Y
+

The coordinates of the current sample. +

+
+
W
+
H
+

The width and height of the image. +

+
+
N
+

The number of input frame, starting from 0. +

+
+
WS
+
HS
+

The size of FFT array for horizontal and vertical processing. +

+
+ + +
+

11.90.1 Examples

+ +
    +
  • High-pass: +
    +
    fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
    +
    + +
  • Low-pass: +
    +
    fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
    +
    + +
  • Sharpen: +
    +
    fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
    +
    + +
  • Blur: +
    +
    fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
    +
    + +
+ +
+
+
+

11.91 field

+ +

Extract a single field from an interlaced image using stride +arithmetic to avoid wasting CPU time. The output frames are marked as +non-interlaced. +

+

The filter accepts the following options: +

+
+
type
+

Specify whether to extract the top (if the value is 0 or +top) or the bottom field (if the value is 1 or +bottom). +

+
+ +
+
+

11.92 fieldhint

+ +

Create new frames by copying the top and bottom fields from surrounding frames +supplied as numbers by the hint file. +

+
+
hint
+

Set file containing hints: absolute/relative frame numbers. +

+

There must be one line for each frame in a clip. Each line must contain two +numbers separated by the comma, optionally followed by - or +. +Numbers supplied on each line of file can not be out of [N-1,N+1] where N +is current frame number for absolute mode or out of [-1, 1] range +for relative mode. First number tells from which frame to pick up top +field and second number tells from which frame to pick up bottom field. +

+

If optionally followed by + output frame will be marked as interlaced, +else if followed by - output frame will be marked as progressive, else +it will be marked same as input frame. +If optionally followed by t output frame will use only top field, or in +case of b it will use only bottom field. +If line starts with # or ; that line is skipped. +

+
+
mode
+

Can be item absolute or relative or pattern. Default is absolute. +The pattern mode is same as relative mode, except at last entry of file if there +are more frames to process than hint file is seek back to start. +

+
+ +

Example of first several lines of hint file for relative mode: +

+
0,0 - # first frame
+1,0 - # second frame, use third's frame top field and second's frame bottom field
+1,0 - # third frame, use fourth's frame top field and third's frame bottom field
+1,0 -
+0,0 -
+0,0 -
+1,0 -
+1,0 -
+1,0 -
+0,0 -
+0,0 -
+1,0 -
+1,0 -
+1,0 -
+0,0 -
+
+ +
+
+

11.93 fieldmatch

+ +

Field matching filter for inverse telecine. It is meant to reconstruct the +progressive frames from a telecined stream. The filter does not drop duplicated +frames, so to achieve a complete inverse telecine fieldmatch needs to be +followed by a decimation filter such as decimate in the filtergraph. +

+

The separation of the field matching and the decimation is notably motivated by +the possibility of inserting a de-interlacing filter fallback between the two. +If the source has mixed telecined and real interlaced content, +fieldmatch will not be able to match fields for the interlaced parts. +But these remaining combed frames will be marked as interlaced, and thus can be +de-interlaced by a later filter such as yadif before decimation. +

+

In addition to the various configuration options, fieldmatch can take an +optional second stream, activated through the ppsrc option. If +enabled, the frames reconstruction will be based on the fields and frames from +this second stream. This allows the first input to be pre-processed in order to +help the various algorithms of the filter, while keeping the output lossless +(assuming the fields are matched properly). Typically, a field-aware denoiser, +or brightness/contrast adjustments can help. +

+

Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project) +and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from +which fieldmatch is based on. While the semantic and usage are very +close, some behaviour and options names can differ. +

+

The decimate filter currently only works for constant frame rate input. +If your input has mixed telecined (30fps) and progressive content with a lower +framerate like 24fps use the following filterchain to produce the necessary cfr +stream: dejudder,fps=30000/1001,fieldmatch,decimate. +

+

The filter accepts the following options: +

+
+
order
+

Specify the assumed field order of the input stream. Available values are: +

+
+
auto
+

Auto detect parity (use FFmpeg’s internal parity value). +

+
bff
+

Assume bottom field first. +

+
tff
+

Assume top field first. +

+
+ +

Note that it is sometimes recommended not to trust the parity announced by the +stream. +

+

Default value is auto. +

+
+
mode
+

Set the matching mode or strategy to use. pc mode is the safest in the +sense that it won’t risk creating jerkiness due to duplicate frames when +possible, but if there are bad edits or blended fields it will end up +outputting combed frames when a good match might actually exist. On the other +hand, pcn_ub mode is the most risky in terms of creating jerkiness, +but will almost always find a good frame if there is one. The other values are +all somewhere in between pc and pcn_ub in terms of risking +jerkiness and creating duplicate frames versus finding good matches in sections +with bad edits, orphaned fields, blended fields, etc. +

+

More details about p/c/n/u/b are available in p/c/n/u/b meaning section. +

+

Available values are: +

+
+
pc
+

2-way matching (p/c) +

+
pc_n
+

2-way matching, and trying 3rd match if still combed (p/c + n) +

+
pc_u
+

2-way matching, and trying 3rd match (same order) if still combed (p/c + u) +

+
pc_n_ub
+

2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if +still combed (p/c + n + u/b) +

+
pcn
+

3-way matching (p/c/n) +

+
pcn_ub
+

3-way matching, and trying 4th/5th matches if all 3 of the original matches are +detected as combed (p/c/n + u/b) +

+
+ +

The parenthesis at the end indicate the matches that would be used for that +mode assuming order=tff (and field on auto or +top). +

+

In terms of speed pc mode is by far the fastest and pcn_ub is +the slowest. +

+

Default value is pc_n. +

+
+
ppsrc
+

Mark the main input stream as a pre-processed input, and enable the secondary +input stream as the clean source to pick the fields from. See the filter +introduction for more details. It is similar to the clip2 feature from +VFM/TFM. +

+

Default value is 0 (disabled). +

+
+
field
+

Set the field to match from. It is recommended to set this to the same value as +order unless you experience matching failures with that setting. In +certain circumstances changing the field that is used to match from can have a +large impact on matching performance. Available values are: +

+
+
auto
+

Automatic (same value as order). +

+
bottom
+

Match from the bottom field. +

+
top
+

Match from the top field. +

+
+ +

Default value is auto. +

+
+
mchroma
+

Set whether or not chroma is included during the match comparisons. In most +cases it is recommended to leave this enabled. You should set this to 0 +only if your clip has bad chroma problems such as heavy rainbowing or other +artifacts. Setting this to 0 could also be used to speed things up at +the cost of some accuracy. +

+

Default value is 1. +

+
+
y0
+
y1
+

These define an exclusion band which excludes the lines between y0 and +y1 from being included in the field matching decision. An exclusion +band can be used to ignore subtitles, a logo, or other things that may +interfere with the matching. y0 sets the starting scan line and +y1 sets the ending line; all lines in between y0 and +y1 (including y0 and y1) will be ignored. Setting +y0 and y1 to the same value will disable the feature. +y0 and y1 defaults to 0. +

+
+
scthresh
+

Set the scene change detection threshold as a percentage of maximum change on +the luma plane. Good values are in the [8.0, 14.0] range. Scene change +detection is only relevant in case combmatch=sc. The range for +scthresh is [0.0, 100.0]. +

+

Default value is 12.0. +

+
+
combmatch
+

When combatch is not none, fieldmatch will take into +account the combed scores of matches when deciding what match to use as the +final match. Available values are: +

+
+
none
+

No final matching based on combed scores. +

+
sc
+

Combed scores are only used when a scene change is detected. +

+
full
+

Use combed scores all the time. +

+
+ +

Default is sc. +

+
+
combdbg
+

Force fieldmatch to calculate the combed metrics for certain matches and +print them. This setting is known as micout in TFM/VFM vocabulary. +Available values are: +

+
+
none
+

No forced calculation. +

+
pcn
+

Force p/c/n calculations. +

+
pcnub
+

Force p/c/n/u/b calculations. +

+
+ +

Default value is none. +

+
+
cthresh
+

This is the area combing threshold used for combed frame detection. This +essentially controls how "strong" or "visible" combing must be to be detected. +Larger values mean combing must be more visible and smaller values mean combing +can be less visible or strong and still be detected. Valid settings are from +-1 (every pixel will be detected as combed) to 255 (no pixel will +be detected as combed). This is basically a pixel difference value. A good +range is [8, 12]. +

+

Default value is 9. +

+
+
chroma
+

Sets whether or not chroma is considered in the combed frame decision. Only +disable this if your source has chroma problems (rainbowing, etc.) that are +causing problems for the combed frame detection with chroma enabled. Actually, +using chroma=0 is usually more reliable, except for the case +where there is chroma only combing in the source. +

+

Default value is 0. +

+
+
blockx
+
blocky
+

Respectively set the x-axis and y-axis size of the window used during combed +frame detection. This has to do with the size of the area in which +combpel pixels are required to be detected as combed for a frame to be +declared combed. See the combpel parameter description for more info. +Possible values are any number that is a power of 2 starting at 4 and going up +to 512. +

+

Default value is 16. +

+
+
combpel
+

The number of combed pixels inside any of the blocky by +blockx size blocks on the frame for the frame to be detected as +combed. While cthresh controls how "visible" the combing must be, this +setting controls "how much" combing there must be in any localized area (a +window defined by the blockx and blocky settings) on the +frame. Minimum value is 0 and maximum is blocky x blockx (at +which point no frames will ever be detected as combed). This setting is known +as MI in TFM/VFM vocabulary. +

+

Default value is 80. +

+
+ + +
+

11.93.1 p/c/n/u/b meaning

+ + +
+

11.93.1.1 p/c/n

+ +

We assume the following telecined stream: +

+
+
Top fields:     1 2 2 3 4
+Bottom fields:  1 2 3 4 4
+
+ +

The numbers correspond to the progressive frame the fields relate to. Here, the +first two frames are progressive, the 3rd and 4th are combed, and so on. +

+

When fieldmatch is configured to run a matching from bottom +(field=bottom) this is how this input stream get transformed: +

+
+
Input stream:
+                T     1 2 2 3 4
+                B     1 2 3 4 4   <-- matching reference
+
+Matches:              c c n n c
+
+Output stream:
+                T     1 2 3 4 4
+                B     1 2 3 4 4
+
+ +

As a result of the field matching, we can see that some frames get duplicated. +To perform a complete inverse telecine, you need to rely on a decimation filter +after this operation. See for instance the decimate filter. +

+

The same operation now matching from top fields (field=top) +looks like this: +

+
+
Input stream:
+                T     1 2 2 3 4   <-- matching reference
+                B     1 2 3 4 4
+
+Matches:              c c p p c
+
+Output stream:
+                T     1 2 2 3 4
+                B     1 2 2 3 4
+
+ +

In these examples, we can see what p, c and n mean; +basically, they refer to the frame and field of the opposite parity: +

+
    +
  • p matches the field of the opposite parity in the previous frame +
  • c matches the field of the opposite parity in the current frame +
  • n matches the field of the opposite parity in the next frame +
+ +
+
+

11.93.1.2 u/b

+ +

The u and b matching are a bit special in the sense that they match +from the opposite parity flag. In the following examples, we assume that we are +currently matching the 2nd frame (Top:2, bottom:2). According to the match, a +’x’ is placed above and below each matched fields. +

+

With bottom matching (field=bottom): +

+
Match:           c         p           n          b          u
+
+                 x       x               x        x          x
+  Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
+  Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
+                 x         x           x        x              x
+
+Output frames:
+                 2          1          2          2          2
+                 2          2          2          1          3
+
+ +

With top matching (field=top): +

+
Match:           c         p           n          b          u
+
+                 x         x           x        x              x
+  Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
+  Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
+                 x       x               x        x          x
+
+Output frames:
+                 2          2          2          1          2
+                 2          1          3          2          2
+
+ +
+
+
+

11.93.2 Examples

+ +

Simple IVTC of a top field first telecined stream: +

+
fieldmatch=order=tff:combmatch=none, decimate
+
+ +

Advanced IVTC, with fallback on yadif for still combed frames: +

+
fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
+
+ +
+
+
+

11.94 fieldorder

+ +

Transform the field order of the input video. +

+

It accepts the following parameters: +

+
+
order
+

The output field order. Valid values are tff for top field first or bff +for bottom field first. +

+
+ +

The default value is ‘tff’. +

+

The transformation is done by shifting the picture content up or down +by one line, and filling the remaining line with appropriate picture content. +This method is consistent with most broadcast field order converters. +

+

If the input video is not flagged as being interlaced, or it is already +flagged as being of the required output field order, then this filter does +not alter the incoming video. +

+

It is very useful when converting to or from PAL DV material, +which is bottom field first. +

+

For example: +

+
ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
+
+ +
+
+

11.95 fifo, afifo

+ +

Buffer input images and send them when they are requested. +

+

It is mainly useful when auto-inserted by the libavfilter +framework. +

+

It does not take parameters. +

+
+
+

11.96 fillborders

+ +

Fill borders of the input video, without changing video stream dimensions. +Sometimes video can have garbage at the four edges and you may not want to +crop video input to keep size multiple of some number. +

+

This filter accepts the following options: +

+
+
left
+

Number of pixels to fill from left border. +

+
+
right
+

Number of pixels to fill from right border. +

+
+
top
+

Number of pixels to fill from top border. +

+
+
bottom
+

Number of pixels to fill from bottom border. +

+
+
mode
+

Set fill mode. +

+

It accepts the following values: +

+
smear
+

fill pixels using outermost pixels +

+
+
mirror
+

fill pixels using mirroring (half sample symmetric) +

+
+
fixed
+

fill pixels with constant value +

+
+
reflect
+

fill pixels using reflecting (whole sample symmetric) +

+
+
wrap
+

fill pixels using wrapping +

+
+
fade
+

fade pixels to constant value +

+
+
margins
+

fill pixels at top and bottom with weighted averages pixels near borders +

+
+ +

Default is smear. +

+
+
color
+

Set color for pixels in fixed or fade mode. Default is black. +

+
+ + +
+

11.96.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

11.97 find_rect

+ +

Find a rectangular object in the input video. +

+

The object to search for must be specified as a gray8 image specified with the +object option. +

+

For each possible match, a score is computed. If the score reaches the specified +threshold, the object is considered found. +

+

If the input video contains multiple instances of the object, the filter will +find only one of them. +

+

When an object is found, the following metadata entries are set in the matching +frame: +

+
lavfi.rect.w
+

width of object +

+
+
lavfi.rect.h
+

height of object +

+
+
lavfi.rect.x
+

x position of object +

+
+
lavfi.rect.y
+

y position of object +

+
+
lavfi.rect.score
+

match score of the found object +

+
+ +

It accepts the following options: +

+
+
object
+

Filepath of the object image, needs to be in gray8. +

+
+
threshold
+

Detection threshold, expressed as a decimal number in the range 0-1. +

+

A threshold value of 0.01 means only exact matches, a threshold of 0.99 means +almost everything matches. +

+

Default value is 0.5. +

+
+
mipmaps
+

Number of mipmaps, default is 3. +

+
+
xmin, ymin, xmax, ymax
+

Specifies the rectangle in which to search. +

+
+
discard
+

Discard frames where object is not detected. Default is disabled. +

+
+ + +
+

11.97.1 Examples

+ +
    +
  • Cover a rectangular object by the supplied image of a given video using ffmpeg: +
    +
    ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
    +
    + +
  • Find the position of an object in each frame using ffprobe and write +it to a log file: +
    +
    ffprobe -f lavfi movie=test.mp4,find_rect=object=object.pgm:threshold=0.3 \
    +  -show_entries frame=pkt_pts_time:frame_tags=lavfi.rect.x,lavfi.rect.y \
    +  -of csv -o find_rect.csv
    +
    + +
+ +
+
+
+

11.98 floodfill

+ +

Flood area with values of same pixel components with another values. +

+

It accepts the following options: +

+
x
+

Set pixel x coordinate. +

+
+
y
+

Set pixel y coordinate. +

+
+
s0
+

Set source #0 component value. +

+
+
s1
+

Set source #1 component value. +

+
+
s2
+

Set source #2 component value. +

+
+
s3
+

Set source #3 component value. +

+
+
d0
+

Set destination #0 component value. +

+
+
d1
+

Set destination #1 component value. +

+
+
d2
+

Set destination #2 component value. +

+
+
d3
+

Set destination #3 component value. +

+
+ +
+
+

11.99 format

+ +

Convert the input video to one of the specified pixel formats. +Libavfilter will try to pick one that is suitable as input to +the next filter. +

+

It accepts the following parameters: +

+
pix_fmts
+

A ’|’-separated list of pixel format names, such as +"pix_fmts=yuv420p|monow|rgb24". +

+
+
+ + +
+

11.99.1 Examples

+ +
    +
  • Convert the input video to the yuv420p format +
    +
    format=pix_fmts=yuv420p
    +
    + +

    Convert the input video to any of the formats in the list +

    +
    format=pix_fmts=yuv420p|yuv444p|yuv410p
    +
    +
+ +
+
+
+

11.100 fps

+ +

Convert the video to specified constant frame rate by duplicating or dropping +frames as necessary. +

+

It accepts the following parameters: +

+
fps
+

The desired output frame rate. It accepts expressions containing the following +constants: +

+
+
source_fps
+

The input’s frame rate +

+
+
ntsc
+

NTSC frame rate of 30000/1001 +

+
+
pal
+

PAL frame rate of 25.0 +

+
+
film
+

Film frame rate of 24.0 +

+
+
ntsc_film
+

NTSC-film frame rate of 24000/1001 +

+
+ +

The default is 25. +

+
+
start_time
+

Assume the first PTS should be the given value, in seconds. This allows for +padding/trimming at the start of stream. By default, no assumption is made +about the first frame’s expected PTS, so no padding or trimming is done. +For example, this could be set to 0 to pad the beginning with duplicates of +the first frame if a video stream starts after the audio stream or to trim any +frames with a negative PTS. +

+
+
round
+

Timestamp (PTS) rounding method. +

+

Possible values are: +

+
zero
+

round towards 0 +

+
inf
+

round away from 0 +

+
down
+

round towards -infinity +

+
up
+

round towards +infinity +

+
near
+

round to nearest +

+
+

The default is near. +

+
+
eof_action
+

Action performed when reading the last frame. +

+

Possible values are: +

+
round
+

Use same timestamp rounding method as used for other frames. +

+
pass
+

Pass through last frame if input duration has not been reached yet. +

+
+

The default is round. +

+
+
+ +

Alternatively, the options can be specified as a flat string: +fps[:start_time[:round]]. +

+

See also the setpts filter. +

+ +
+

11.100.1 Examples

+ +
    +
  • A typical usage in order to set the fps to 25: +
    +
    fps=fps=25
    +
    + +
  • Sets the fps to 24, using abbreviation and rounding method to round to nearest: +
    +
    fps=fps=film:round=near
    +
    +
+ +
+
+
+

11.101 framepack

+ +

Pack two different video streams into a stereoscopic video, setting proper +metadata on supported codecs. The two views should have the same size and +framerate and processing will stop when the shorter video ends. Please note +that you may conveniently adjust view properties with the scale and +fps filters. +

+

It accepts the following parameters: +

+
format
+

The desired packing format. Supported values are: +

+
+
sbs
+

The views are next to each other (default). +

+
+
tab
+

The views are on top of each other. +

+
+
lines
+

The views are packed by line. +

+
+
columns
+

The views are packed by column. +

+
+
frameseq
+

The views are temporally interleaved. +

+
+
+ +
+
+ +

Some examples: +

+
+
# Convert left and right views into a frame-sequential video
+ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
+
+# Convert views into a side-by-side video with the same output resolution as the input
+ffmpeg -i LEFT -i RIGHT -filter_complex [0:v]scale=w=iw/2[left],[1:v]scale=w=iw/2[right],[left][right]framepack=sbs OUTPUT
+
+ +
+
+

11.102 framerate

+ +

Change the frame rate by interpolating new video output frames from the source +frames. +

+

This filter is not designed to function correctly with interlaced media. If +you wish to change the frame rate of interlaced media then you are required +to deinterlace before this filter and re-interlace after this filter. +

+

A description of the accepted options follows. +

+
+
fps
+

Specify the output frames per second. This option can also be specified +as a value alone. The default is 50. +

+
+
interp_start
+

Specify the start of a range where the output frame will be created as a +linear interpolation of two frames. The range is [0-255], +the default is 15. +

+
+
interp_end
+

Specify the end of a range where the output frame will be created as a +linear interpolation of two frames. The range is [0-255], +the default is 240. +

+
+
scene
+

Specify the level at which a scene change is detected as a value between +0 and 100 to indicate a new scene; a low value reflects a low +probability for the current frame to introduce a new scene, while a higher +value means the current frame is more likely to be one. +The default is 8.2. +

+
+
flags
+

Specify flags influencing the filter process. +

+

Available value for flags is: +

+
+
scene_change_detect, scd
+

Enable scene change detection using the value of the option scene. +This flag is enabled by default. +

+
+
+
+ +
+
+

11.103 framestep

+ +

Select one frame every N-th frame. +

+

This filter accepts the following option: +

+
step
+

Select frame after every step frames. +Allowed values are positive integers higher than 0. Default value is 1. +

+
+ +
+
+

11.104 freezedetect

+ +

Detect frozen video. +

+

This filter logs a message and sets frame metadata when it detects that the +input video has no significant change in content during a specified duration. +Video freeze detection calculates the mean average absolute difference of all +the components of video frames and compares it to a noise floor. +

+

The printed times and duration are expressed in seconds. The +lavfi.freezedetect.freeze_start metadata key is set on the first frame +whose timestamp equals or exceeds the detection duration and it contains the +timestamp of the first frame of the freeze. The +lavfi.freezedetect.freeze_duration and +lavfi.freezedetect.freeze_end metadata keys are set on the first frame +after the freeze. +

+

The filter accepts the following options: +

+
+
noise, n
+

Set noise tolerance. Can be specified in dB (in case "dB" is appended to the +specified value) or as a difference ratio between 0 and 1. Default is -60dB, or +0.001. +

+
+
duration, d
+

Set freeze duration until notification (default is 2 seconds). +

+
+ +
+
+

11.105 freezeframes

+ +

Freeze video frames. +

+

This filter freezes video frames using frame from 2nd input. +

+

The filter accepts the following options: +

+
+
first
+

Set number of first frame from which to start freeze. +

+
+
last
+

Set number of last frame from which to end freeze. +

+
+
replace
+

Set number of frame from 2nd input which will be used instead of replaced frames. +

+
+ +
+
+

11.106 frei0r

+ +

Apply a frei0r effect to the input video. +

+

To enable the compilation of this filter, you need to install the frei0r +header and configure FFmpeg with --enable-frei0r. +

+

It accepts the following parameters: +

+
+
filter_name
+

The name of the frei0r effect to load. If the environment variable +FREI0R_PATH is defined, the frei0r effect is searched for in each of the +directories specified by the colon-separated list in FREI0R_PATH. +Otherwise, the standard frei0r paths are searched, in this order: +HOME/.frei0r-1/lib/, /usr/local/lib/frei0r-1/, +/usr/lib/frei0r-1/. +

+
+
filter_params
+

A ’|’-separated list of parameters to pass to the frei0r effect. +

+
+
+ +

A frei0r effect parameter can be a boolean (its value is either +"y" or "n"), a double, a color (specified as +R/G/B, where R, G, and B are floating point +numbers between 0.0 and 1.0, inclusive) or a color description as specified in the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual, +a position (specified as X/Y, where +X and Y are floating point numbers) and/or a string. +

+

The number and types of parameters depend on the loaded effect. If an +effect parameter is not specified, the default value is set. +

+ +
+

11.106.1 Examples

+ +
    +
  • Apply the distort0r effect, setting the first two double parameters: +
    +
    frei0r=filter_name=distort0r:filter_params=0.5|0.01
    +
    + +
  • Apply the colordistance effect, taking a color as the first parameter: +
    +
    frei0r=colordistance:0.2/0.3/0.4
    +frei0r=colordistance:violet
    +frei0r=colordistance:0x112233
    +
    + +
  • Apply the perspective effect, specifying the top left and top right image +positions: +
    +
    frei0r=perspective:0.2/0.2|0.8/0.2
    +
    +
+ +

For more information, see +http://frei0r.dyne.org +

+
+
+

11.106.2 Commands

+ +

This filter supports the filter_params option as commands. +

+
+
+
+

11.107 fspp

+ +

Apply fast and simple postprocessing. It is a faster version of spp. +

+

It splits (I)DCT into horizontal/vertical passes. Unlike the simple post- +processing filter, one of them is performed once per block, not per pixel. +This allows for much higher speed. +

+

The filter accepts the following options: +

+
+
quality
+

Set quality. This option defines the number of levels for averaging. It accepts +an integer in the range 4-5. Default value is 4. +

+
+
qp
+

Force a constant quantization parameter. It accepts an integer in range 0-63. +If not set, the filter will use the QP from the video stream (if available). +

+
+
strength
+

Set filter strength. It accepts an integer in range -15 to 32. Lower values mean +more details but also more artifacts, while higher values make the image smoother +but also blurrier. Default value is 0 − PSNR optimal. +

+
+
use_bframe_qp
+

Enable the use of the QP from the B-Frames if set to 1. Using this +option may cause flicker since the B-Frames have often larger QP. Default is +0 (not enabled). +

+
+
+ +
+
+

11.108 gblur

+ +

Apply Gaussian blur filter. +

+

The filter accepts the following options: +

+
+
sigma
+

Set horizontal sigma, standard deviation of Gaussian blur. Default is 0.5. +

+
+
steps
+

Set number of steps for Gaussian approximation. Default is 1. +

+
+
planes
+

Set which planes to filter. By default all planes are filtered. +

+
+
sigmaV
+

Set vertical sigma, if negative it will be same as sigma. +Default is -1. +

+
+ + +
+

11.108.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

11.109 geq

+ +

Apply generic equation to each pixel. +

+

The filter accepts the following options: +

+
+
lum_expr, lum
+

Set the luminance expression. +

+
cb_expr, cb
+

Set the chrominance blue expression. +

+
cr_expr, cr
+

Set the chrominance red expression. +

+
alpha_expr, a
+

Set the alpha expression. +

+
red_expr, r
+

Set the red expression. +

+
green_expr, g
+

Set the green expression. +

+
blue_expr, b
+

Set the blue expression. +

+
+ +

The colorspace is selected according to the specified options. If one +of the lum_expr, cb_expr, or cr_expr +options is specified, the filter will automatically select a YCbCr +colorspace. If one of the red_expr, green_expr, or +blue_expr options is specified, it will select an RGB +colorspace. +

+

If one of the chrominance expression is not defined, it falls back on the other +one. If no alpha expression is specified it will evaluate to opaque value. +If none of chrominance expressions are specified, they will evaluate +to the luminance expression. +

+

The expressions can use the following variables and functions: +

+
+
N
+

The sequential number of the filtered frame, starting from 0. +

+
+
X
+
Y
+

The coordinates of the current sample. +

+
+
W
+
H
+

The width and height of the image. +

+
+
SW
+
SH
+

Width and height scale depending on the currently filtered plane. It is the +ratio between the corresponding luma plane number of pixels and the current +plane ones. E.g. for YUV4:2:0 the values are 1,1 for the luma plane, and +0.5,0.5 for chroma planes. +

+
+
T
+

Time of the current frame, expressed in seconds. +

+
+
p(x, y)
+

Return the value of the pixel at location (x,y) of the current +plane. +

+
+
lum(x, y)
+

Return the value of the pixel at location (x,y) of the luminance +plane. +

+
+
cb(x, y)
+

Return the value of the pixel at location (x,y) of the +blue-difference chroma plane. Return 0 if there is no such plane. +

+
+
cr(x, y)
+

Return the value of the pixel at location (x,y) of the +red-difference chroma plane. Return 0 if there is no such plane. +

+
+
r(x, y)
+
g(x, y)
+
b(x, y)
+

Return the value of the pixel at location (x,y) of the +red/green/blue component. Return 0 if there is no such component. +

+
+
alpha(x, y)
+

Return the value of the pixel at location (x,y) of the alpha +plane. Return 0 if there is no such plane. +

+
+
psum(x,y), lumsum(x, y), cbsum(x,y), crsum(x,y), rsum(x,y), gsum(x,y), bsum(x,y), alphasum(x,y)
+

Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining +sums of samples within a rectangle. See the functions without the sum postfix. +

+
+
interpolation
+

Set one of interpolation methods: +

+
nearest, n
+
bilinear, b
+
+

Default is bilinear. +

+
+ +

For functions, if x and y are outside the area, the value will be +automatically clipped to the closer edge. +

+

Please note that this filter can use multiple threads in which case each slice +will have its own expression state. If you want to use only a single expression +state because your expressions depend on previous state then you should limit +the number of filter threads to 1. +

+ +
+

11.109.1 Examples

+ +
    +
  • Flip the image horizontally: +
    +
    geq=p(W-X\,Y)
    +
    + +
  • Generate a bidimensional sine wave, with angle PI/3 and a +wavelength of 100 pixels: +
    +
    geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
    +
    + +
  • Generate a fancy enigmatic moving light: +
    +
    nullsrc=s=256x256,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128
    +
    + +
  • Generate a quick emboss effect: +
    +
    format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
    +
    + +
  • Modify RGB components depending on pixel position: +
    +
    geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
    +
    + +
  • Create a radial gradient that is the same size as the input (also see +the vignette filter): +
    +
    geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray
    +
    +
+ +
+
+
+

11.110 gradfun

+ +

Fix the banding artifacts that are sometimes introduced into nearly flat +regions by truncation to 8-bit color depth. +Interpolate the gradients that should go where the bands are, and +dither them. +

+

It is designed for playback only. Do not use it prior to +lossy compression, because compression tends to lose the dither and +bring back the bands. +

+

It accepts the following parameters: +

+
+
strength
+

The maximum amount by which the filter will change any one pixel. This is also +the threshold for detecting nearly flat regions. Acceptable values range from +.51 to 64; the default value is 1.2. Out-of-range values will be clipped to the +valid range. +

+
+
radius
+

The neighborhood to fit the gradient to. A larger radius makes for smoother +gradients, but also prevents the filter from modifying the pixels near detailed +regions. Acceptable values are 8-32; the default value is 16. Out-of-range +values will be clipped to the valid range. +

+
+
+ +

Alternatively, the options can be specified as a flat string: +strength[:radius] +

+ +
+

11.110.1 Examples

+ +
    +
  • Apply the filter with a 3.5 strength and radius of 8: +
    +
    gradfun=3.5:8
    +
    + +
  • Specify radius, omitting the strength (which will fall-back to the default +value): +
    +
    gradfun=radius=8
    +
    + +
+ +
+
+
+

11.111 graphmonitor

+

Show various filtergraph stats. +

+

With this filter one can debug complete filtergraph. +Especially issues with links filling with queued frames. +

+

The filter accepts the following options: +

+
+
size, s
+

Set video output size. Default is hd720. +

+
+
opacity, o
+

Set video opacity. Default is 0.9. Allowed range is from 0 to 1. +

+
+
mode, m
+

Set output mode flags. +

+

Available values for flags are: +

+
full
+

No any filtering. Default. +

+
compact
+

Show only filters with queued frames. +

+
nozero
+

Show only filters with non-zero stats. +

+
noeof
+

Show only filters with non-eof stat. +

+
nodisabled
+

Show only filters that are enabled in timeline. +

+
+ +
+
flags, f
+

Set flags which enable which stats are shown in video. +

+

Available values for flags are: +

+
none
+

All flags turned off. +

+
+
all
+

All flags turned on. +

+
+
queue
+

Display number of queued frames in each link. +

+
+
frame_count_in
+

Display number of frames taken from filter. +

+
+
frame_count_out
+

Display number of frames given out from filter. +

+
+
frame_count_delta
+

Display delta number of frames between above two values. +

+
+
pts
+

Display current filtered frame pts. +

+
+
pts_delta
+

Display pts delta between current and previous frame. +

+
+
time
+

Display current filtered frame time. +

+
+
time_delta
+

Display time delta between current and previous frame. +

+
+
timebase
+

Display time base for filter link. +

+
+
format
+

Display used format for filter link. +

+
+
size
+

Display video size or number of audio channels in case of audio used by filter link. +

+
+
rate
+

Display video frame rate or sample rate in case of audio used by filter link. +

+
+
eof
+

Display link output status. +

+
+
sample_count_in
+

Display number of samples taken from filter. +

+
+
sample_count_out
+

Display number of samples given out from filter. +

+
+
sample_count_delta
+

Display delta number of samples between above two values. +

+
+
disabled
+

Show the timeline filter status. +

+
+ +
+
rate, r
+

Set upper limit for video rate of output stream, Default value is 25. +This guarantee that output video frame rate will not be higher than this value. +

+
+ +
+
+

11.112 grayworld

+

A color constancy filter that applies color correction based on the grayworld assumption +

+

See: https://www.researchgate.net/publication/275213614_A_New_Color_Correction_Method_for_Underwater_Imaging +

+

The algorithm uses linear light, so input +data should be linearized beforehand (and possibly correctly tagged). +

+
+
ffmpeg -i INPUT -vf zscale=transfer=linear,grayworld,zscale=transfer=bt709,format=yuv420p OUTPUT
+
+ +
+
+

11.113 greyedge

+

A color constancy variation filter which estimates scene illumination via grey edge algorithm +and corrects the scene colors accordingly. +

+

See: https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf +

+

The filter accepts the following options: +

+
+
difford
+

The order of differentiation to be applied on the scene. Must be chosen in the range +[0,2] and default value is 1. +

+
+
minknorm
+

The Minkowski parameter to be used for calculating the Minkowski distance. Must +be chosen in the range [0,20] and default value is 1. Set to 0 for getting +max value instead of calculating Minkowski distance. +

+
+
sigma
+

The standard deviation of Gaussian blur to be applied on the scene. Must be +chosen in the range [0,1024.0] and default value = 1. floor( sigma * break_off_sigma(3) ) +can’t be equal to 0 if difford is greater than 0. +

+
+ + +
+

11.113.1 Examples

+
    +
  • Grey Edge: +
    +
    greyedge=difford=1:minknorm=5:sigma=2
    +
    + +
  • Max Edge: +
    +
    greyedge=difford=1:minknorm=0:sigma=2
    +
    + +
+ +
+
+
+

11.114 guided

+

Apply guided filter for edge-preserving smoothing, dehazing and so on. +

+

The filter accepts the following options: +

+
radius
+

Set the box radius in pixels. +Allowed range is 1 to 20. Default is 3. +

+
+
eps
+

Set regularization parameter (with square). +Allowed range is 0 to 1. Default is 0.01. +

+
+
mode
+

Set filter mode. Can be basic or fast. +Default is basic. +

+
+
sub
+

Set subsampling ratio for fast mode. +Range is 2 to 64. Default is 4. +No subsampling occurs in basic mode. +

+
+
guidance
+

Set guidance mode. Can be off or on. Default is off. +If off, single input is required. +If on, two inputs of the same resolution and pixel format are required. +The second input serves as the guidance. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

11.114.1 Commands

+

This filter supports the all above options as commands. +

+
+
+

11.114.2 Examples

+
    +
  • Edge-preserving smoothing with guided filter: +
    +
    ffmpeg -i in.png -vf guided out.png
    +
    + +
  • Dehazing, structure-transferring filtering, detail enhancement with guided filter. +For the generation of guidance image, refer to paper "Guided Image Filtering". +See: http://kaiminghe.com/publications/pami12guidedfilter.pdf. +
    +
    ffmpeg -i in.png -i guidance.png -filter_complex guided=guidance=on out.png
    +
    + +
+ +
+
+
+

11.115 haldclut

+ +

Apply a Hald CLUT to a video stream. +

+

First input is the video stream to process, and second one is the Hald CLUT. +The Hald CLUT input can be a simple picture or a complete video stream. +

+

The filter accepts the following options: +

+
+
clut
+

Set which CLUT video frames will be processed from second input stream, +can be first or all. Default is all. +

+
+
shortest
+

Force termination when the shortest input terminates. Default is 0. +

+
repeatlast
+

Continue applying the last CLUT after the end of the stream. A value of +0 disable the filter after the last frame of the CLUT is reached. +Default is 1. +

+
+ +

haldclut also has the same interpolation options as lut3d (both +filters share the same internals). +

+

This filter also supports the framesync options. +

+

More information about the Hald CLUT can be found on Eskil Steenberg’s website +(Hald CLUT author) at http://www.quelsolaar.com/technology/clut.html. +

+ +
+

11.115.1 Commands

+ +

This filter supports the interp option as commands. +

+
+
+

11.115.2 Workflow examples

+ + +
+

11.115.2.1 Hald CLUT video stream

+ +

Generate an identity Hald CLUT stream altered with various effects: +

+
ffmpeg -f lavfi -i haldclutsrc=8 -vf "hue=H=2*PI*t:s=sin(2*PI*t)+1, curves=cross_process" -t 10 -c:v ffv1 clut.nut
+
+ +

Note: make sure you use a lossless codec. +

+

Then use it with haldclut to apply it on some random stream: +

+
ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
+
+ +

The Hald CLUT will be applied to the 10 first seconds (duration of +clut.nut), then the latest picture of that CLUT stream will be applied +to the remaining frames of the mandelbrot stream. +

+
+
+

11.115.2.2 Hald CLUT with preview

+ +

A Hald CLUT is supposed to be a squared image of Level*Level*Level by +Level*Level*Level pixels. For a given Hald CLUT, FFmpeg will select the +biggest possible square starting at the top left of the picture. The remaining +padding pixels (bottom or right) will be ignored. This area can be used to add +a preview of the Hald CLUT. +

+

Typically, the following generated Hald CLUT will be supported by the +haldclut filter: +

+
+
ffmpeg -f lavfi -i haldclutsrc=8 -vf "
+   pad=iw+320 [padded_clut];
+   smptebars=s=320x256, split [a][b];
+   [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
+   [main][b] overlay=W-320" -frames:v 1 clut.png
+
+ +

It contains the original and a preview of the effect of the CLUT: SMPTE color +bars are displayed on the right-top, and below the same color bars processed by +the color changes. +

+

Then, the effect of this Hald CLUT can be visualized with: +

+
ffplay input.mkv -vf "movie=clut.png, [in] haldclut"
+
+ +
+
+
+
+

11.116 hflip

+ +

Flip the input video horizontally. +

+

For example, to horizontally flip the input video with ffmpeg: +

+
ffmpeg -i in.avi -vf "hflip" out.avi
+
+ +
+
+

11.117 histeq

+

This filter applies a global color histogram equalization on a +per-frame basis. +

+

It can be used to correct video that has a compressed range of pixel +intensities. The filter redistributes the pixel intensities to +equalize their distribution across the intensity range. It may be +viewed as an "automatically adjusting contrast filter". This filter is +useful only for correcting degraded or poorly captured source +video. +

+

The filter accepts the following options: +

+
+
strength
+

Determine the amount of equalization to be applied. As the strength +is reduced, the distribution of pixel intensities more-and-more +approaches that of the input frame. The value must be a float number +in the range [0,1] and defaults to 0.200. +

+
+
intensity
+

Set the maximum intensity that can generated and scale the output +values appropriately. The strength should be set as desired and then +the intensity can be limited if needed to avoid washing-out. The value +must be a float number in the range [0,1] and defaults to 0.210. +

+
+
antibanding
+

Set the antibanding level. If enabled the filter will randomly vary +the luminance of output pixels by a small amount to avoid banding of +the histogram. Possible values are none, weak or +strong. It defaults to none. +

+
+ +
+
+

11.118 histogram

+ +

Compute and draw a color distribution histogram for the input video. +

+

The computed histogram is a representation of the color component +distribution in an image. +

+

Standard histogram displays the color components distribution in an image. +Displays color graph for each color component. Shows distribution of +the Y, U, V, A or R, G, B components, depending on input format, in the +current frame. Below each graph a color component scale meter is shown. +

+

The filter accepts the following options: +

+
+
level_height
+

Set height of level. Default value is 200. +Allowed range is [50, 2048]. +

+
+
scale_height
+

Set height of color scale. Default value is 12. +Allowed range is [0, 40]. +

+
+
display_mode
+

Set display mode. +It accepts the following values: +

+
stack
+

Per color component graphs are placed below each other. +

+
+
parade
+

Per color component graphs are placed side by side. +

+
+
overlay
+

Presents information identical to that in the parade, except +that the graphs representing color components are superimposed directly +over one another. +

+
+

Default is stack. +

+
+
levels_mode
+

Set mode. Can be either linear, or logarithmic. +Default is linear. +

+
+
components
+

Set what color components to display. +Default is 7. +

+
+
fgopacity
+

Set foreground opacity. Default is 0.7. +

+
+
bgopacity
+

Set background opacity. Default is 0.5. +

+
+
colors_mode
+

Set colors mode. +It accepts the following values: +

+
whiteonblack
+
blackonwhite
+
whiteongray
+
blackongray
+
coloronblack
+
coloronwhite
+
colorongray
+
blackoncolor
+
whiteoncolor
+
grayoncolor
+
+

Default is whiteonblack. +

+
+ + +
+

11.118.1 Examples

+ +
    +
  • Calculate and draw histogram: +
    +
    ffplay -i input -vf histogram
    +
    + +
+ +
+
+
+

11.119 hqdn3d

+ +

This is a high precision/quality 3d denoise filter. It aims to reduce +image noise, producing smooth images and making still images really +still. It should enhance compressibility. +

+

It accepts the following optional parameters: +

+
+
luma_spatial
+

A non-negative floating point number which specifies spatial luma strength. +It defaults to 4.0. +

+
+
chroma_spatial
+

A non-negative floating point number which specifies spatial chroma strength. +It defaults to 3.0*luma_spatial/4.0. +

+
+
luma_tmp
+

A floating point number which specifies luma temporal strength. It defaults to +6.0*luma_spatial/4.0. +

+
+
chroma_tmp
+

A floating point number which specifies chroma temporal strength. It defaults to +luma_tmp*chroma_spatial/luma_spatial. +

+
+ + +
+

11.119.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

11.120 hwdownload

+ +

Download hardware frames to system memory. +

+

The input must be in hardware frames, and the output a non-hardware format. +Not all formats will be supported on the output - it may be necessary to insert +an additional format filter immediately following in the graph to get +the output in a supported format. +

+
+
+

11.121 hwmap

+ +

Map hardware frames to system memory or to another device. +

+

This filter has several different modes of operation; which one is used depends +on the input and output formats: +

    +
  • Hardware frame input, normal frame output + +

    Map the input frames to system memory and pass them to the output. If the +original hardware frame is later required (for example, after overlaying +something else on part of it), the hwmap filter can be used again +in the next mode to retrieve it. +

  • Normal frame input, hardware frame output + +

    If the input is actually a software-mapped hardware frame, then unmap it - +that is, return the original hardware frame. +

    +

    Otherwise, a device must be provided. Create new hardware surfaces on that +device for the output, then map them back to the software format at the input +and give those frames to the preceding filter. This will then act like the +hwupload filter, but may be able to avoid an additional copy when +the input is already in a compatible format. +

  • Hardware frame input and output + +

    A device must be supplied for the output, either directly or with the +derive_device option. The input and output devices must be of +different types and compatible - the exact meaning of this is +system-dependent, but typically it means that they must refer to the same +underlying hardware context (for example, refer to the same graphics card). +

    +

    If the input frames were originally created on the output device, then unmap +to retrieve the original frames. +

    +

    Otherwise, map the frames to the output device - create new hardware frames +on the output corresponding to the frames on the input. +

+ +

The following additional parameters are accepted: +

+
+
mode
+

Set the frame mapping mode. Some combination of: +

+
read
+

The mapped frame should be readable. +

+
write
+

The mapped frame should be writeable. +

+
overwrite
+

The mapping will always overwrite the entire frame. +

+

This may improve performance in some cases, as the original contents of the +frame need not be loaded. +

+
direct
+

The mapping must not involve any copying. +

+

Indirect mappings to copies of frames are created in some cases where either +direct mapping is not possible or it would have unexpected properties. +Setting this flag ensures that the mapping is direct and will fail if that is +not possible. +

+
+

Defaults to read+write if not specified. +

+
+
derive_device type
+

Rather than using the device supplied at initialisation, instead derive a new +device of type type from the device the input frames exist on. +

+
+
reverse
+

In a hardware to hardware mapping, map in reverse - create frames in the sink +and map them back to the source. This may be necessary in some cases where +a mapping in one direction is required but only the opposite direction is +supported by the devices being used. +

+

This option is dangerous - it may break the preceding filter in undefined +ways if there are any additional constraints on that filter’s output. +Do not use it without fully understanding the implications of its use. +

+
+ +
+
+

11.122 hwupload

+ +

Upload system memory frames to hardware surfaces. +

+

The device to upload to must be supplied when the filter is initialised. If +using ffmpeg, select the appropriate device with the -filter_hw_device +option or with the derive_device option. The input and output devices +must be of different types and compatible - the exact meaning of this is +system-dependent, but typically it means that they must refer to the same +underlying hardware context (for example, refer to the same graphics card). +

+

The following additional parameters are accepted: +

+
+
derive_device type
+

Rather than using the device supplied at initialisation, instead derive a new +device of type type from the device the input frames exist on. +

+
+ +
+
+

11.123 hwupload_cuda

+ +

Upload system memory frames to a CUDA device. +

+

It accepts the following optional parameters: +

+
+
device
+

The number of the CUDA device to use +

+
+ +
+
+

11.124 hqx

+ +

Apply a high-quality magnification filter designed for pixel art. This filter +was originally created by Maxim Stepin. +

+

It accepts the following option: +

+
+
n
+

Set the scaling dimension: 2 for hq2x, 3 for +hq3x and 4 for hq4x. +Default is 3. +

+
+ +
+
+

11.125 hstack

+

Stack input videos horizontally. +

+

All streams must be of same pixel format and of same height. +

+

Note that this filter is faster than using overlay and pad filter +to create same output. +

+

The filter accepts the following option: +

+
+
inputs
+

Set number of input streams. Default is 2. +

+
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+ +
+
+

11.126 hsvhold

+

Turns a certain HSV range into gray values. +

+

This filter measures color difference between set HSV color in options +and ones measured in video stream. Depending on options, output +colors can be changed to be gray or not. +

+

The filter accepts the following options: +

+
+
hue
+

Set the hue value which will be used in color difference calculation. +Allowed range is from -360 to 360. Default value is 0. +

+
+
sat
+

Set the saturation value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
val
+

Set the value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
similarity
+

Set similarity percentage with the key color. +Allowed range is from 0 to 1. Default value is 0.01. +

+

0.00001 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +Allowed range is from 0 to 1. Default value is 0. +

+

0.0 makes pixels either fully gray, or not gray at all. +

+

Higher values result in more gray pixels, with a higher gray pixel +the more similar the pixels color is to the key color. +

+
+ +
+
+

11.127 hsvkey

+

Turns a certain HSV range into transparency. +

+

This filter measures color difference between set HSV color in options +and ones measured in video stream. Depending on options, output +colors can be changed to transparent by adding alpha channel. +

+

The filter accepts the following options: +

+
+
hue
+

Set the hue value which will be used in color difference calculation. +Allowed range is from -360 to 360. Default value is 0. +

+
+
sat
+

Set the saturation value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
val
+

Set the value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
similarity
+

Set similarity percentage with the key color. +Allowed range is from 0 to 1. Default value is 0.01. +

+

0.00001 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +Allowed range is from 0 to 1. Default value is 0. +

+

0.0 makes pixels either fully transparent, or not transparent at all. +

+

Higher values result in semi-transparent pixels, with a higher transparency +the more similar the pixels color is to the key color. +

+
+ +
+
+

11.128 hue

+ +

Modify the hue and/or the saturation of the input. +

+

It accepts the following parameters: +

+
+
h
+

Specify the hue angle as a number of degrees. It accepts an expression, +and defaults to "0". +

+
+
s
+

Specify the saturation in the [-10,10] range. It accepts an expression and +defaults to "1". +

+
+
H
+

Specify the hue angle as a number of radians. It accepts an +expression, and defaults to "0". +

+
+
b
+

Specify the brightness in the [-10,10] range. It accepts an expression and +defaults to "0". +

+
+ +

h and H are mutually exclusive, and can’t be +specified at the same time. +

+

The b, h, H and s option values are +expressions containing the following constants: +

+
+
n
+

frame count of the input frame starting from 0 +

+
+
pts
+

presentation timestamp of the input frame expressed in time base units +

+
+
r
+

frame rate of the input video, NAN if the input frame rate is unknown +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
tb
+

time base of the input video +

+
+ + +
+

11.128.1 Examples

+ +
    +
  • Set the hue to 90 degrees and the saturation to 1.0: +
    +
    hue=h=90:s=1
    +
    + +
  • Same command but expressing the hue in radians: +
    +
    hue=H=PI/2:s=1
    +
    + +
  • Rotate hue and make the saturation swing between 0 +and 2 over a period of 1 second: +
    +
    hue="H=2*PI*t: s=sin(2*PI*t)+1"
    +
    + +
  • Apply a 3 seconds saturation fade-in effect starting at 0: +
    +
    hue="s=min(t/3\,1)"
    +
    + +

    The general fade-in expression can be written as: +

    +
    hue="s=min(0\, max((t-START)/DURATION\, 1))"
    +
    + +
  • Apply a 3 seconds saturation fade-out effect starting at 5 seconds: +
    +
    hue="s=max(0\, min(1\, (8-t)/3))"
    +
    + +

    The general fade-out expression can be written as: +

    +
    hue="s=max(0\, min(1\, (START+DURATION-t)/DURATION))"
    +
    + +
+ +
+
+

11.128.2 Commands

+ +

This filter supports the following commands: +

+
b
+
s
+
h
+
H
+

Modify the hue and/or the saturation and/or brightness of the input video. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

11.129 huesaturation

+

Apply hue-saturation-intensity adjustments to input video stream. +

+

This filter operates in RGB colorspace. +

+

This filter accepts the following options: +

+
+
hue
+

Set the hue shift in degrees to apply. Default is 0. +Allowed range is from -180 to 180. +

+
+
saturation
+

Set the saturation shift. Default is 0. +Allowed range is from -1 to 1. +

+
+
intensity
+

Set the intensity shift. Default is 0. +Allowed range is from -1 to 1. +

+
+
colors
+

Set which primary and complementary colors are going to be adjusted. +This options is set by providing one or multiple values. +This can select multiple colors at once. By default all colors are selected. +

+
r
+

Adjust reds. +

+
y
+

Adjust yellows. +

+
g
+

Adjust greens. +

+
c
+

Adjust cyans. +

+
b
+

Adjust blues. +

+
m
+

Adjust magentas. +

+
a
+

Adjust all colors. +

+
+ +
+
strength
+

Set strength of filtering. Allowed range is from 0 to 100. +Default value is 1. +

+
+
rw, gw, bw
+

Set weight for each RGB component. Allowed range is from 0 to 1. +By default is set to 0.333, 0.334, 0.333. +Those options are used in saturation and lightess processing. +

+
+
lightness
+

Set preserving lightness, by default is disabled. +Adjusting hues can change lightness from original RGB triplet, +with this option enabled lightness is kept at same value. +

+
+ +
+
+

11.130 hysteresis

+ +

Grow first stream into second stream by connecting components. +This makes it possible to build more robust edge masks. +

+

This filter accepts the following options: +

+
+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+
threshold
+

Set threshold which is used in filtering. If pixel component value is higher than +this value filter algorithm for connecting components is activated. +By default value is 0. +

+
+ +

The hysteresis filter also supports the framesync options. +

+
+
+

11.131 iccdetect

+ +

Detect the colorspace from an embedded ICC profile (if present), and update +the frame’s tags accordingly. +

+

This filter accepts the following options: +

+
+
force
+

If true, the frame’s existing colorspace tags will always be overridden by +values detected from an ICC profile. Otherwise, they will only be assigned if +they contain unknown. Enabled by default. +

+
+ +
+
+

11.132 iccgen

+ +

Generate ICC profiles and attach them to frames. +

+

This filter accepts the following options: +

+
+
color_primaries
+
color_trc
+

Configure the colorspace that the ICC profile will be generated for. The +default value of auto infers the value from the input frame’s metadata, +defaulting to BT.709/sRGB as appropriate. +

+

See the setparams filter for a list of possible values, but note that +unknown are not valid values for this filter. +

+
+
force
+

If true, an ICC profile will be generated even if it would overwrite an +already existing ICC profile. Disabled by default. +

+
+ +
+
+

11.133 identity

+ +

Obtain the identity score between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained per component, average, min and max identity score is printed through +the logging system. +

+

The filter stores the calculated identity scores of each frame in frame metadata. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi identity -f null -
+
+ +
+
+

11.134 idet

+ +

Detect video interlacing type. +

+

This filter tries to detect if the input frames are interlaced, progressive, +top or bottom field first. It will also try to detect fields that are +repeated between adjacent frames (a sign of telecine). +

+

Single frame detection considers only immediately adjacent frames when classifying each frame. +Multiple frame detection incorporates the classification history of previous frames. +

+

The filter will log these metadata values: +

+
+
single.current_frame
+

Detected type of current frame using single-frame detection. One of: +“tff” (top field first), “bff” (bottom field first), +“progressive”, or “undetermined” +

+
+
single.tff
+

Cumulative number of frames detected as top field first using single-frame detection. +

+
+
multiple.tff
+

Cumulative number of frames detected as top field first using multiple-frame detection. +

+
+
single.bff
+

Cumulative number of frames detected as bottom field first using single-frame detection. +

+
+
multiple.current_frame
+

Detected type of current frame using multiple-frame detection. One of: +“tff” (top field first), “bff” (bottom field first), +“progressive”, or “undetermined” +

+
+
multiple.bff
+

Cumulative number of frames detected as bottom field first using multiple-frame detection. +

+
+
single.progressive
+

Cumulative number of frames detected as progressive using single-frame detection. +

+
+
multiple.progressive
+

Cumulative number of frames detected as progressive using multiple-frame detection. +

+
+
single.undetermined
+

Cumulative number of frames that could not be classified using single-frame detection. +

+
+
multiple.undetermined
+

Cumulative number of frames that could not be classified using multiple-frame detection. +

+
+
repeated.current_frame
+

Which field in the current frame is repeated from the last. One of “neither”, “top”, or “bottom”. +

+
+
repeated.neither
+

Cumulative number of frames with no repeated field. +

+
+
repeated.top
+

Cumulative number of frames with the top field repeated from the previous frame’s top field. +

+
+
repeated.bottom
+

Cumulative number of frames with the bottom field repeated from the previous frame’s bottom field. +

+
+ +

The filter accepts the following options: +

+
+
intl_thres
+

Set interlacing threshold. +

+
prog_thres
+

Set progressive threshold. +

+
rep_thres
+

Threshold for repeated field detection. +

+
half_life
+

Number of frames after which a given frame’s contribution to the +statistics is halved (i.e., it contributes only 0.5 to its +classification). The default of 0 means that all frames seen are given +full weight of 1.0 forever. +

+
analyze_interlaced_flag
+

When this is not 0 then idet will use the specified number of frames to determine +if the interlaced flag is accurate, it will not count undetermined frames. +If the flag is found to be accurate it will be used without any further +computations, if it is found to be inaccurate it will be cleared without any +further computations. This allows inserting the idet filter as a low computational +method to clean up the interlaced flag +

+
+ +
+
+

11.135 il

+ +

Deinterleave or interleave fields. +

+

This filter allows one to process interlaced images fields without +deinterlacing them. Deinterleaving splits the input frame into 2 +fields (so called half pictures). Odd lines are moved to the top +half of the output image, even lines to the bottom half. +You can process (filter) them independently and then re-interleave them. +

+

The filter accepts the following options: +

+
+
luma_mode, l
+
chroma_mode, c
+
alpha_mode, a
+

Available values for luma_mode, chroma_mode and +alpha_mode are: +

+
+
none
+

Do nothing. +

+
+
deinterleave, d
+

Deinterleave fields, placing one above the other. +

+
+
interleave, i
+

Interleave fields. Reverse the effect of deinterleaving. +

+
+

Default value is none. +

+
+
luma_swap, ls
+
chroma_swap, cs
+
alpha_swap, as
+

Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is 0. +

+
+ + +
+

11.135.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.136 inflate

+ +

Apply inflate effect to the video. +

+

This filter replaces the pixel by the local(3x3) average by taking into account +only values higher than the pixel. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+ + +
+

11.136.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.137 interlace

+ +

Simple interlacing filter from progressive contents. This interleaves upper (or +lower) lines from odd frames with lower (or upper) lines from even frames, +halving the frame rate and preserving image height. +

+
+
   Original        Original             New Frame
+   Frame 'j'      Frame 'j+1'             (tff)
+  ==========      ===========       ==================
+    Line 0  -------------------->    Frame 'j' Line 0
+    Line 1          Line 1  ---->   Frame 'j+1' Line 1
+    Line 2 --------------------->    Frame 'j' Line 2
+    Line 3          Line 3  ---->   Frame 'j+1' Line 3
+     ...             ...                   ...
+New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
+
+ +

It accepts the following optional parameters: +

+
+
scan
+

This determines whether the interlaced frame is taken from the even +(tff - default) or odd (bff) lines of the progressive frame. +

+
+
lowpass
+

Vertical lowpass filter to avoid twitter interlacing and +reduce moire patterns. +

+
+
0, off
+

Disable vertical lowpass filter +

+
+
1, linear
+

Enable linear filter (default) +

+
+
2, complex
+

Enable complex filter. This will slightly less reduce twitter and moire +but better retain detail and subjective sharpness impression. +

+
+
+
+
+ +
+
+

11.138 kerndeint

+ +

Deinterlace input video by applying Donald Graft’s adaptive kernel +deinterling. Work on interlaced parts of a video to produce +progressive frames. +

+

The description of the accepted parameters follows. +

+
+
thresh
+

Set the threshold which affects the filter’s tolerance when +determining if a pixel line must be processed. It must be an integer +in the range [0,255] and defaults to 10. A value of 0 will result in +applying the process on every pixels. +

+
+
map
+

Paint pixels exceeding the threshold value to white if set to 1. +Default is 0. +

+
+
order
+

Set the fields order. Swap fields if set to 1, leave fields alone if +0. Default is 0. +

+
+
sharp
+

Enable additional sharpening if set to 1. Default is 0. +

+
+
twoway
+

Enable twoway sharpening if set to 1. Default is 0. +

+
+ + +
+

11.138.1 Examples

+ +
    +
  • Apply default values: +
    +
    kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
    +
    + +
  • Enable additional sharpening: +
    +
    kerndeint=sharp=1
    +
    + +
  • Paint processed pixels in white: +
    +
    kerndeint=map=1
    +
    +
+ +
+
+
+

11.139 kirsch

+

Apply kirsch operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

11.139.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.140 lagfun

+ +

Slowly update darker pixels. +

+

This filter makes short flashes of light appear longer. +This filter accepts the following options: +

+
+
decay
+

Set factor for decaying. Default is .95. Allowed range is from 0 to 1. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+ + +
+

11.140.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.141 lenscorrection

+ +

Correct radial lens distortion +

+

This filter can be used to correct for radial distortion as can result from the use +of wide angle lenses, and thereby re-rectify the image. To find the right parameters +one can use tools available for example as part of opencv or simply trial-and-error. +To use opencv use the calibration sample (under samples/cpp) from the opencv sources +and extract the k1 and k2 coefficients from the resulting matrix. +

+

Note that effectively the same filter is available in the open-source tools Krita and +Digikam from the KDE project. +

+

In contrast to the vignette filter, which can also be used to compensate lens errors, +this filter corrects the distortion of the image, whereas vignette corrects the +brightness distribution, so you may want to use both filters together in certain +cases, though you will have to take care of ordering, i.e. whether vignetting should +be applied before or after lens correction. +

+ +
+

11.141.1 Options

+ +

The filter accepts the following options: +

+
+
cx
+

Relative x-coordinate of the focal point of the image, and thereby the center of the +distortion. This value has a range [0,1] and is expressed as fractions of the image +width. Default is 0.5. +

+
cy
+

Relative y-coordinate of the focal point of the image, and thereby the center of the +distortion. This value has a range [0,1] and is expressed as fractions of the image +height. Default is 0.5. +

+
k1
+

Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means +no correction. Default is 0. +

+
k2
+

Coefficient of the double quadratic correction term. This value has a range [-1,1]. +0 means no correction. Default is 0. +

+
i
+

Set interpolation type. Can be nearest or bilinear. +Default is nearest. +

+
fc
+

Specify the color of the unmapped pixels. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Default color is black@0. +

+
+ +

The formula that generates the correction is: +

+

r_src = r_tgt * (1 + k1 * (r_tgt / r_0)^2 + k2 * (r_tgt / r_0)^4) +

+

where r_0 is halve of the image diagonal and r_src and r_tgt are the +distances from the focal point in the source and target images, respectively. +

+
+
+

11.141.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.142 lensfun

+ +

Apply lens correction via the lensfun library (http://lensfun.sourceforge.net/). +

+

The lensfun filter requires the camera make, camera model, and lens model +to apply the lens correction. The filter will load the lensfun database and +query it to find the corresponding camera and lens entries in the database. As +long as these entries can be found with the given options, the filter can +perform corrections on frames. Note that incomplete strings will result in the +filter choosing the best match with the given options, and the filter will +output the chosen camera and lens models (logged with level "info"). You must +provide the make, camera model, and lens model as they are required. +

+

To obtain a list of available makes and models, leave out one or both of make and +model options. The filter will send the full list to the log with level INFO. +The first column is the make and the second column is the model. +To obtain a list of available lenses, set any values for make and model and leave out the +lens_model option. The filter will send the full list of lenses in the log with level +INFO. The ffmpeg tool will exit after the list is printed. +

+

The filter accepts the following options: +

+
+
make
+

The make of the camera (for example, "Canon"). This option is required. +

+
+
model
+

The model of the camera (for example, "Canon EOS 100D"). This option is +required. +

+
+
lens_model
+

The model of the lens (for example, "Canon EF-S 18-55mm f/3.5-5.6 IS STM"). This +option is required. +

+
+
db_path
+

The full path to the lens database folder. If not set, the filter will attempt to +load the database from the install path when the library was built. Default is unset. +

+
+
mode
+

The type of correction to apply. The following values are valid options: +

+
+
vignetting
+

Enables fixing lens vignetting. +

+
+
geometry
+

Enables fixing lens geometry. This is the default. +

+
+
subpixel
+

Enables fixing chromatic aberrations. +

+
+
vig_geo
+

Enables fixing lens vignetting and lens geometry. +

+
+
vig_subpixel
+

Enables fixing lens vignetting and chromatic aberrations. +

+
+
distortion
+

Enables fixing both lens geometry and chromatic aberrations. +

+
+
all
+

Enables all possible corrections. +

+
+
+
+
focal_length
+

The focal length of the image/video (zoom; expected constant for video). For +example, a 18–55mm lens has focal length range of [18–55], so a value in that +range should be chosen when using that lens. Default 18. +

+
+
aperture
+

The aperture of the image/video (expected constant for video). Note that +aperture is only used for vignetting correction. Default 3.5. +

+
+
focus_distance
+

The focus distance of the image/video (expected constant for video). Note that +focus distance is only used for vignetting and only slightly affects the +vignetting correction process. If unknown, leave it at the default value (which +is 1000). +

+
+
scale
+

The scale factor which is applied after transformation. After correction the +video is no longer necessarily rectangular. This parameter controls how much of +the resulting image is visible. The value 0 means that a value will be chosen +automatically such that there is little or no unmapped area in the output +image. 1.0 means that no additional scaling is done. Lower values may result +in more of the corrected image being visible, while higher values may avoid +unmapped areas in the output. +

+
+
target_geometry
+

The target geometry of the output image/video. The following values are valid +options: +

+
+
rectilinear (default)
+
fisheye
+
panoramic
+
equirectangular
+
fisheye_orthographic
+
fisheye_stereographic
+
fisheye_equisolid
+
fisheye_thoby
+
+
+
reverse
+

Apply the reverse of image correction (instead of correcting distortion, apply +it). +

+
+
interpolation
+

The type of interpolation used when correcting distortion. The following values +are valid options: +

+
+
nearest
+
linear (default)
+
lanczos
+
+
+
+ + +
+

11.142.1 Examples

+ +
    +
  • Apply lens correction with make "Canon", camera model "Canon EOS 100D", and lens +model "Canon EF-S 18-55mm f/3.5-5.6 IS STM" with focal length of "18" and +aperture of "8.0". + +
    +
    ffmpeg -i input.mov -vf lensfun=make=Canon:model="Canon EOS 100D":lens_model="Canon EF-S 18-55mm f/3.5-5.6 IS STM":focal_length=18:aperture=8 -c:v h264 -b:v 8000k output.mov
    +
    + +
  • Apply the same as before, but only for the first 5 seconds of video. + +
    +
    ffmpeg -i input.mov -vf lensfun=make=Canon:model="Canon EOS 100D":lens_model="Canon EF-S 18-55mm f/3.5-5.6 IS STM":focal_length=18:aperture=8:enable='lte(t\,5)' -c:v h264 -b:v 8000k output.mov
    +
    + +
+ +
+
+
+

11.143 libplacebo

+ +

Flexible GPU-accelerated processing filter based on libplacebo +(https://code.videolan.org/videolan/libplacebo). +

+ +
+

11.143.1 Options

+ +

The options for this filter are divided into the following sections: +

+ +
+

11.143.1.1 Output mode

+

These options control the overall output mode. By default, libplacebo will try +to preserve the source colorimetry and size as best as it can, but it will +apply any embedded film grain, dolby vision metadata or anamorphic SAR present +in source frames. +

+
w
+
h
+

Set the output video dimension expression. Default values are iw and +ih. +

+

Allows for the same expressions as the scale filter. +

+
+
crop_x
+
crop_y
+

Set the input crop x/y expressions, default values are (iw-cw)/2 and +(ih-ch)/2. +

+
+
crop_w
+
crop_h
+

Set the input crop width/height expressions, default values are iw and +ih. +

+
+
pos_x
+
pos_y
+

Set the output placement x/y expressions, default values are (ow-pw)/2 +and (oh-ph)/2. +

+
+
pos_w
+
pos_h
+

Set the output placement width/height expressions, default values are ow +and oh. +

+
+
fps
+

Set the output frame rate. This can be rational, e.g. 60000/1001. If +set to the special string none (the default), input timestamps will +instead be passed through to the output unmodified. Otherwise, the input video +frames will be interpolated as necessary to rescale the video to the specified +target framerate, in a manner as determined by the frame_mixer option. +

+
+
format
+

Set the output format override. If unset (the default), frames will be output +in the same format as the respective input frames. Otherwise, format conversion +will be performed. +

+
+
force_original_aspect_ratio
+
force_divisible_by
+

Work the same as the identical scale filter options. +

+
+
normalize_sar
+

If enabled, output frames will always have a pixel aspect ratio of 1:1. This +will introduce additional padding/cropping as necessary. If disabled (the +default), any aspect ratio mismatches, including those from e.g. anamorphic +video sources, are forwarded to the output pixel aspect ratio. +

+
+
pad_crop_ratio
+

Specifies a ratio (between 0.0 and 1.0) between padding and +cropping when the input aspect ratio does not match the output aspect ratio and +normalize_sar is in effect. The default of 0.0 always pads the +content with black borders, while a value of 1.0 always crops off parts +of the content. Intermediate values are possible, leading to a mix of the two +approaches. +

+
+
fillcolor
+

Set the color used to fill the output area not covered by the output image, for +example as a result of normalize_sar. For the general syntax of this +option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Defaults to black. +

+
+
colorspace
+
color_primaries
+
color_trc
+
range
+

Configure the colorspace that output frames will be delivered in. The default +value of auto outputs frames in the same format as the input frames, +leading to no change. For any other value, conversion will be performed. +

+

See the setparams filter for a list of possible values. +

+
+
apply_filmgrain
+

Apply film grain (e.g. AV1 or H.274) if present in source frames, and strip +it from the output. Enabled by default. +

+
+
apply_dolbyvision
+

Apply Dolby Vision RPU metadata if present in source frames, and strip it from +the output. Enabled by default. Note that Dolby Vision will always output +BT.2020+PQ, overriding the usual input frame metadata. These will also be +picked as the values of auto for the respective frame output options. +

+
+ +

In addition to the expression constants documented for the scale filter, +the crop_w, crop_h, crop_x, crop_y, +pos_w, pos_h, pos_x and pos_y options can +also contain the following constants: +

+
+
crop_w, cw
+
crop_h, ch
+

The computed values of crop_w and crop_h. +

+
+
pos_w, pw
+
pos_h, ph
+

The computed values of pos_w and pos_h. +

+
+
in_t, t
+

The input frame timestamp, in seconds. NAN if input timestamp is unknown. +

+
+
out_t, ot
+

The input frame timestamp, in seconds. NAN if input timestamp is unknown. +

+
+
n
+

The input frame number, starting with 0. +

+
+ +
+
+

11.143.1.2 Scaling

+

The options in this section control how libplacebo performs upscaling and (if +necessary) downscaling. Note that libplacebo will always internally operate on +4:4:4 content, so any sub-sampled chroma formats such as yuv420p will +necessarily be upsampled and downsampled as part of the rendering process. That +means scaling might be in effect even if the source and destination resolution +are the same. +

+
upscaler
+
downscaler
+

Configure the filter kernel used for upscaling and downscaling. The respective +defaults are spline36 and mitchell. For a full list of possible +values, pass help to these options. The most important values are: +

+
none
+

Forces the use of built-in GPU texture sampling (typically bilinear). Extremely +fast but poor quality, especially when downscaling. +

+
+
bilinear
+

Bilinear interpolation. Can generally be done for free on GPUs, except when +doing so would lead to aliasing. Fast and low quality. +

+
+
nearest
+

Nearest-neighbour interpolation. Sharp but highly aliasing. +

+
+
oversample
+

Algorithm that looks visually similar to nearest-neighbour interpolation but +tries to preserve pixel aspect ratio. Good for pixel art, since it results in +minimal distortion of the artistic appearance. +

+
+
lanczos
+

Standard sinc-sinc interpolation kernel. +

+
+
spline36
+

Cubic spline approximation of lanczos. No difference in performance, but has +very slightly less ringing. +

+
+
ewa_lanczos
+

Elliptically weighted average version of lanczos, based on a jinc-sinc kernel. +This is also popularly referred to as just "Jinc scaling". Slow but very high +quality. +

+
+
gaussian
+

Gaussian kernel. Has certain ideal mathematical properties, but subjectively +very blurry. +

+
+
mitchell
+

Cubic BC spline with parameters recommended by Mitchell and Netravali. Very +little ringing. +

+
+ +
+
frame_mixer
+

Controls the kernel used for mixing frames temporally. The default value is +none, which disables frame mixing. For a full list of possible values, +pass help to this option. The most important values are: +

+
none
+

Disables frame mixing, giving a result equivalent to "nearest neighbour" +semantics. +

+
+
oversample
+

Oversamples the input video to create a "Smooth Motion"-type effect: if an +output frame would exactly fall on the transition between two video frames, it +is blended according to the relative overlap. This is the recommended option +whenever preserving the original subjective appearance is desired. +

+
+
mitchell_clamp
+

Larger filter kernel that smoothly interpolates multiple frames in a manner +designed to eliminate ringing and other artefacts as much as possible. This is +the recommended option wherever maximum visual smoothness is desired. +

+
+
linear
+

Linear blend/fade between frames. Especially useful for constructing e.g. +slideshows. +

+
+ +
+
lut_entries
+

Configures the size of scaler LUTs, ranging from 1 to 256. The +default of 0 will pick libplacebo’s internal default, typically +64. +

+
+
antiringing
+

Enables anti-ringing (for non-EWA filters). The value (between 0.0 and +1.0) configures the strength of the anti-ringing algorithm. May increase +aliasing if set too high. Disabled by default. +

+
+
sigmoid
+

Enable sigmoidal compression during upscaling. Reduces ringing slightly. +Enabled by default. +

+
+ +
+
+

11.143.1.3 Debanding

+

Libplacebo comes with a built-in debanding filter that is good at counteracting +many common sources of banding and blocking. Turning this on is highly +recommended whenever quality is desired. +

+
deband
+

Enable (fast) debanding algorithm. Disabled by default. +

+
+
deband_iterations
+

Number of deband iterations of the debanding algorithm. Each iteration is +performed with progressively increased radius (and diminished threshold). +Recommended values are in the range 1 to 4. Defaults to 1. +

+
+
deband_threshold
+

Debanding filter strength. Higher numbers lead to more aggressive debanding. +Defaults to 4.0. +

+
+
deband_radius
+

Debanding filter radius. A higher radius is better for slow gradients, while +a lower radius is better for steep gradients. Defaults to 16.0. +

+
+
deband_grain
+

Amount of extra output grain to add. Helps hide imperfections. Defaults to +6.0. +

+
+ +
+
+

11.143.1.4 Color adjustment

+

A collection of subjective color controls. Not very rigorous, so the exact +effect will vary somewhat depending on the input primaries and colorspace. +

+
brightness
+

Brightness boost, between -1.0 and 1.0. Defaults to 0.0. +

+
+
contrast
+

Contrast gain, between 0.0 and 16.0. Defaults to 1.0. +

+
+
saturation
+

Saturation gain, between 0.0 and 16.0. Defaults to 1.0. +

+
+
hue
+

Hue shift in radians, between -3.14 and 3.14. Defaults to +0.0. This will rotate the UV subvector, defaulting to BT.709 +coefficients for RGB inputs. +

+
+
gamma
+

Gamma adjustment, between 0.0 and 16.0. Defaults to 1.0. +

+
+
cones
+

Cone model to use for color blindness simulation. Accepts any combination of +l, m and s. Here are some examples: +

+
m
+

Deuteranomaly / deuteranopia (affecting 3%-4% of the population) +

+
l
+

Protanomaly / protanopia (affecting 1%-2% of the population) +

+
l+m
+

Monochromacy (very rare) +

+
l+m+s
+

Achromatopsy (complete loss of daytime vision, extremely rare) +

+
+ +
+
cone-strength
+

Gain factor for the cones specified by cones, between 0.0 and +10.0. A value of 1.0 results in no change to color vision. A +value of 0.0 (the default) simulates complete loss of those cones. Values +above 1.0 result in exaggerating the differences between cones, which +may help compensate for reduced color vision. +

+
+ +
+
+

11.143.1.5 Peak detection

+

To help deal with sources that only have static HDR10 metadata (or no tagging +whatsoever), libplacebo uses its own internal frame analysis compute shader to +analyze source frames and adapt the tone mapping function in realtime. If this +is too slow, or if exactly reproducible frame-perfect results are needed, it’s +recommended to turn this feature off. +

+
peak_detect
+

Enable HDR peak detection. Ignores static MaxCLL/MaxFALL values in favor of +dynamic detection from the input. Note that the detected values do not get +written back to the output frames, they merely guide the internal tone mapping +process. Enabled by default. +

+
+
smoothing_period
+

Peak detection smoothing period, between 0.0 and 1000.0. Higher +values result in peak detection becoming less responsive to changes in the +input. Defaults to 100.0. +

+
+
minimum_peak
+

Lower bound on the detected peak (relative to SDR white), between 0.0 +and 100.0. Defaults to 1.0. +

+
+
scene_threshold_low
+
scene_threshold_high
+

Lower and upper thresholds for scene change detection. Expressed in a +logarithmic scale between 0.0 and 100.0. Default to 5.5 +and 10.0, respectively. Setting either to a negative value disables +this functionality. +

+
+
percentile
+

Which percentile of the frame brightness histogram to use as the source peak +for tone-mapping. Defaults to 99.995, a fairly conservative value. +Setting this to 100.0 disables frame histogram measurement and instead +uses the true peak brightness for tone-mapping. +

+
+ +
+
+

11.143.1.6 Tone mapping

+

The options in this section control how libplacebo performs tone-mapping and +gamut-mapping when dealing with mismatches between wide-gamut or HDR content. +In general, libplacebo relies on accurate source tagging and mastering display +gamut information to produce the best results. +

+
gamut_mode
+

How to handle out-of-gamut colors that can occur as a result of colorimetric +gamut mapping. +

+
clip
+

Do nothing, simply clip out-of-range colors to the RGB volume. Low quality but +extremely fast. +

+
perceptual
+

Perceptually soft-clip colors to the gamut volume. This is the default. +

+
relative
+

Relative colorimetric hard-clip. Similar to perceptual but without +the soft knee. +

+
saturation
+

Saturation mapping, maps primaries directly to primaries in RGB space. +Not recommended except for artificial computer graphics for which a bright, +saturated display is desired. +

+
absolute
+

Absolute colorimetric hard-clip. Performs no adjustment of the white point. +

+
desaturate
+

Hard-desaturates out-of-gamut colors towards white, while preserving the +luminance. Has a tendency to distort the visual appearance of bright objects. +

+
darken
+

Linearly reduces content brightness to preserves saturated details, followed by +clipping the remaining out-of-gamut colors. +

+
warn
+

Highlight out-of-gamut pixels (by inverting/marking them). +

+
linear
+

Linearly reduces chromaticity of the entire image to make it fit within the +target color volume. Be careful when using this on BT.2020 sources without +proper mastering metadata, as doing so will lead to excessive desaturation. +

+
+ +
+
tonemapping
+

Tone-mapping algorithm to use. Available values are: +

+
auto
+

Automatic selection based on internal heuristics. This is the default. +

+
clip
+

Performs no tone-mapping, just clips out-of-range colors. Retains perfect color +accuracy for in-range colors but completely destroys out-of-range information. +Does not perform any black point adaptation. Not configurable. +

+
st2094-40
+

EETF from SMPTE ST 2094-40 Annex B, which applies the Bezier curves from HDR10+ +dynamic metadata based on Bezier curves to perform tone-mapping. The OOTF used +is adjusted based on the ratio between the targeted and actual display peak +luminances. +

+
st2094-10
+

EETF from SMPTE ST 2094-10 Annex B.2, which takes into account the input signal +average luminance in addition to the maximum/minimum. The configurable contrast +parameter influences the slope of the linear output segment, defaulting to +1.0 for no increase/decrease in contrast. Note that this does not +currently include the subjective gain/offset/gamma controls defined in Annex +B.3. +

+
bt.2390
+

EETF from the ITU-R Report BT.2390, a hermite spline roll-off with linear +segment. The knee point offset is configurable. Note that this parameter +defaults to 1.0, rather than the value of 0.5 from the ITU-R +spec. +

+
bt.2446a
+

EETF from ITU-R Report BT.2446, method A. Designed for well-mastered HDR +sources. Can be used for both forward and inverse tone mapping. Not +configurable. +

+
spline
+

Simple spline consisting of two polynomials, joined by a single pivot point. +The parameter gives the pivot point (in PQ space), defaulting to 0.30. +Can be used for both forward and inverse tone mapping. +

+
reinhard
+

Simple non-linear, global tone mapping algorithm. The parameter specifies the +local contrast coefficient at the display peak. Essentially, a parameter of +0.5 implies that the reference white will be about half as bright as +when clipping. Defaults to 0.5, which results in the simplest +formulation of this function. +

+
mobius
+

Generalization of the reinhard tone mapping algorithm to support an additional +linear slope near black. The tone mapping parameter indicates the trade-off +between the linear section and the non-linear section. Essentially, for a given +parameter x, every color value below x will be mapped linearly, +while higher values get non-linearly tone-mapped. Values near 1.0 make +this curve behave like clip, while values near 0.0 make this +curve behave like reinhard. The default value is 0.3, which +provides a good balance between colorimetric accuracy and preserving +out-of-gamut details. +

+
hable
+

Piece-wise, filmic tone-mapping algorithm developed by John Hable for use in +Uncharted 2, inspired by a similar tone-mapping algorithm used by Kodak. +Popularized by its use in video games with HDR rendering. Preserves both dark +and bright details very well, but comes with the drawback of changing the +average brightness quite significantly. This is sort of similar to +reinhard with parameter 0.24. +

+
gamma
+

Fits a gamma (power) function to transfer between the source and target color +spaces, effectively resulting in a perceptual hard-knee joining two roughly +linear sections. This preserves details at all scales fairly accurately, but +can result in an image with a muted or dull appearance. The parameter is used +as the cutoff point, defaulting to 0.5. +

+
linear
+

Linearly stretches the input range to the output range, in PQ space. This will +preserve all details accurately, but results in a significantly different +average brightness. Can be used for inverse tone-mapping in addition to regular +tone-mapping. The parameter can be used as an additional linear gain +coefficient (defaulting to 1.0). +

+
+ +
+
tonemapping_param
+

For tunable tone mapping functions, this parameter can be used to fine-tune the +curve behavior. Refer to the documentation of tonemapping. The default +value of 0.0 is replaced by the curve’s preferred default setting. +

+
+
inverse_tonemapping
+

If enabled, this filter will also attempt stretching SDR signals to fill HDR +output color volumes. Disabled by default. +

+
+
tonemapping_lut_size
+

Size of the tone-mapping LUT, between 2 and 1024. Defaults to +256. Note that this figure is squared when combined with +peak_detect. +

+
+
hybrid_mix
+

If nonzero, this much of the upper range of the tone-mapped result is smoothly +mixed with a per-channel (LMS) tone-mapped version. Helps avoid unnatural +blown-out highlights when tone-mapping very bright, strongly saturated colors. +Defaults to 0.2. +

+
+ +
+
+

11.143.1.7 Dithering

+

By default, libplacebo will dither whenever necessary, which includes rendering +to any integer format below 16-bit precision. It’s recommended to always leave +this on, since not doing so may result in visible banding in the output, even +if the debanding filter is enabled. If maximum performance is needed, +use ordered_fixed instead of disabling dithering. +

+
dithering
+

Dithering method to use. Accepts the following values: +

+
none
+

Disables dithering completely. May result in visible banding. +

+
blue
+

Dither with pseudo-blue noise. This is the default. +

+
ordered
+

Tunable ordered dither pattern. +

+
ordered_fixed
+

Faster ordered dither with a fixed size of 6. Texture-less. +

+
white
+

Dither with white noise. Texture-less. +

+
+ +
+
dither_lut_size
+

Dither LUT size, as log base2 between 1 and 8. Defaults to +6, corresponding to a LUT size of 64x64. +

+
+
dither_temporal
+

Enables temporal dithering. Disabled by default. +

+
+ +
+
+

11.143.1.8 Custom shaders

+

libplacebo supports a number of custom shaders based on the mpv .hook GLSL +syntax. A collection of such shaders can be found here: +https://github.com/mpv-player/mpv/wiki/User-Scripts#user-shaders +

+

A full description of the mpv shader format is beyond the scope of this +section, but a summary can be found here: +https://mpv.io/manual/master/#options-glsl-shader +

+
custom_shader_path
+

Specifies a path to a custom shader file to load at runtime. +

+
+
custom_shader_bin
+

Specifies a complete custom shader as a raw string. +

+
+ +
+
+

11.143.1.9 Debugging / performance

+

All of the options in this section default off. They may be of assistance when +attempting to squeeze the maximum performance at the cost of quality. +

+
skip_aa
+

Disable anti-aliasing when downscaling. +

+
+
polar_cutoff
+

Truncate polar (EWA) scaler kernels below this absolute magnitude, between +0.0 and 1.0. +

+
+
disable_linear
+

Disable linear light scaling. +

+
+
disable_builtin
+

Disable built-in GPU sampling (forces LUT). +

+
+
disable_fbos
+

Forcibly disable FBOs, resulting in loss of almost all functionality, but +offering the maximum possible speed. +

+
+ +
+
+
+

11.143.2 Commands

+

This filter supports almost all of the above options as commands. +

+
+
+

11.143.3 Examples

+
    +
  • Tone-map input to standard gamut BT.709 output: +
    +
    libplacebo=colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv
    +
    + +
  • Rescale input to fit into standard 1080p, with high quality scaling: +
    +
    libplacebo=w=1920:h=1080:force_original_aspect_ratio=decrease:normalize_sar=true:upscaler=ewa_lanczos:downscaler=ewa_lanczos
    +
    + +
  • Interpolate low FPS / VFR input to smoothed constant 60 fps output: +
    +
    libplacebo=fps=60:frame_mixer=mitchell_clamp
    +
    + +
  • Convert input to standard sRGB JPEG: +
    +
    libplacebo=format=yuv420p:colorspace=bt470bg:color_primaries=bt709:color_trc=iec61966-2-1:range=pc
    +
    + +
  • Use higher quality debanding settings: +
    +
    libplacebo=deband=true:deband_iterations=3:deband_radius=8:deband_threshold=6
    +
    + +
  • Run this filter on the CPU, on systems with Mesa installed (and with the most +expensive options disabled): +
    +
    ffmpeg ... -init_hw_device vulkan:llvmpipe ... -vf libplacebo=upscaler=none:downscaler=none:peak_detect=false
    +
    + +
  • Suppress CPU-based AV1/H.274 film grain application in the decoder, in favor of +doing it with this filter. Note that this is only a gain if the frames are +either already on the GPU, or if you’re using libplacebo for other purposes, +since otherwise the VRAM roundtrip will more than offset any expected speedup. +
    +
    ffmpeg -export_side_data +film_grain ... -vf libplacebo=apply_filmgrain=true
    +
    + +
  • Interop with VAAPI hwdec to avoid round-tripping through RAM: +
    +
    ffmpeg -init_hw_device vulkan -hwaccel vaapi -hwaccel_output_format vaapi ... -vf libplacebo
    +
    +
+ +
+
+
+

11.144 libvmaf

+ +

Calulate the VMAF (Video Multi-Method Assessment Fusion) score for a +reference/distorted pair of input videos. +

+

The first input is the distorted video, and the second input is the reference video. +

+

The obtained VMAF score is printed through the logging system. +

+

It requires Netflix’s vmaf library (libvmaf) as a pre-requisite. +After installing the library it can be enabled using: +./configure --enable-libvmaf. +

+

The filter has following options: +

+
+
model
+

A ‘|‘ delimited list of vmaf models. Each model can be configured with a number of parameters. +Default value: "version=vmaf_v0.6.1" +

+
+
model_path
+

Deprecated, use model=’path=...’. +

+
+
enable_transform
+

Deprecated, use model=’enable_transform=true’. +

+
+
phone_model
+

Deprecated, use model=’enable_transform=true’. +

+
+
enable_conf_interval
+

Deprecated, use model=’enable_conf_interval=true’. +

+
+
feature
+

A ‘|‘ delimited list of features. Each feature can be configured with a number of parameters. +

+
+
psnr
+

Deprecated, use feature=’name=psnr’. +

+
+
ssim
+

Deprecated, use feature=’name=ssim’. +

+
+
ms_ssim
+

Deprecated, use feature=’name=ms_ssim’. +

+
+
log_path
+

Set the file path to be used to store log files. +

+
+
log_fmt
+

Set the format of the log file (xml, json, csv, or sub). +

+
+
n_threads
+

Set number of threads to be used when initializing libvmaf. +Default value: 0, no threads. +

+
+
n_subsample
+

Set frame subsampling interval to be used. +

+
+ +

This filter also supports the framesync options. +

+ +
+

11.144.1 Examples

+
    +
  • In the examples below, a distorted video distorted.mpg is +compared with a reference file reference.mpg. + +
  • Basic usage: +
    +
    ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf=log_path=output.xml -f null -
    +
    + +
  • Example with multiple models: +
    +
    ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='model=version=vmaf_v0.6.1\\:name=vmaf|version=vmaf_v0.6.1neg\\:name=vmaf_neg' -f null -
    +
    + +
  • Example with multiple addtional features: +
    +
    ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='feature=name=psnr|name=ciede' -f null -
    +
    + +
  • Example with options and different containers: +
    +
    ffmpeg -i distorted.mpg -i reference.mkv -lavfi "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]libvmaf=log_fmt=json:log_path=output.json" -f null -
    +
    +
+ +
+
+
+

11.145 limitdiff

+

Apply limited difference filter using second and optionally third video stream. +

+

The filter accepts the following options: +

+
+
threshold
+

Set the threshold to use when allowing certain differences between video streams. +Any absolute difference value lower or exact than this threshold will pick pixel components from +first video stream. +

+
+
elasticity
+

Set the elasticity of soft thresholding when processing video streams. +This value multiplied with first one sets second threshold. +Any absolute difference value greater or exact than second threshold will pick pixel components +from second video stream. For values between those two threshold +linear interpolation between first and second video stream will be used. +

+
+
reference
+

Enable the reference (third) video stream processing. By default is disabled. +If set, this video stream will be used for calculating absolute difference with first video +stream. +

+
+
planes
+

Specify which planes will be processed. Defaults to all available. +

+
+ + +
+

11.145.1 Commands

+ +

This filter supports the all above options as commands except option ‘reference’. +

+
+
+
+

11.146 limiter

+ +

Limits the pixel components values to the specified range [min, max]. +

+

The filter accepts the following options: +

+
+
min
+

Lower bound. Defaults to the lowest allowed value for the input. +

+
+
max
+

Upper bound. Defaults to the highest allowed value for the input. +

+
+
planes
+

Specify which planes will be processed. Defaults to all available. +

+
+ + +
+

11.146.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.147 loop

+ +

Loop video frames. +

+

The filter accepts the following options: +

+
+
loop
+

Set the number of loops. Setting this value to -1 will result in infinite loops. +Default is 0. +

+
+
size
+

Set maximal size in number of frames. Default is 0. +

+
+
start
+

Set first frame of loop. Default is 0. +

+
+
time
+

Set the time of loop start in seconds. +Only used if option named start is set to -1. +

+
+ + +
+

11.147.1 Examples

+ +
    +
  • Loop single first frame infinitely: +
    +
    loop=loop=-1:size=1:start=0
    +
    + +
  • Loop single first frame 10 times: +
    +
    loop=loop=10:size=1:start=0
    +
    + +
  • Loop 10 first frames 5 times: +
    +
    loop=loop=5:size=10:start=0
    +
    +
+ +
+
+
+

11.148 lut1d

+ +

Apply a 1D LUT to an input video. +

+

The filter accepts the following options: +

+
+
file
+

Set the 1D LUT file name. +

+

Currently supported formats: +

+
cube
+

Iridas +

+
csp
+

cineSpace +

+
+ +
+
interp
+

Select interpolation mode. +

+

Available values are: +

+
+
nearest
+

Use values from the nearest defined point. +

+
linear
+

Interpolate values using the linear interpolation. +

+
cosine
+

Interpolate values using the cosine interpolation. +

+
cubic
+

Interpolate values using the cubic interpolation. +

+
spline
+

Interpolate values using the spline interpolation. +

+
+
+
+ + +
+

11.148.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.149 lut3d

+ +

Apply a 3D LUT to an input video. +

+

The filter accepts the following options: +

+
+
file
+

Set the 3D LUT file name. +

+

Currently supported formats: +

+
3dl
+

AfterEffects +

+
cube
+

Iridas +

+
dat
+

DaVinci +

+
m3d
+

Pandora +

+
csp
+

cineSpace +

+
+
+
interp
+

Select interpolation mode. +

+

Available values are: +

+
+
nearest
+

Use values from the nearest defined point. +

+
trilinear
+

Interpolate values using the 8 points defining a cube. +

+
tetrahedral
+

Interpolate values using a tetrahedron. +

+
pyramid
+

Interpolate values using a pyramid. +

+
prism
+

Interpolate values using a prism. +

+
+
+
+ + +
+

11.149.1 Commands

+ +

This filter supports the interp option as commands. +

+
+
+
+

11.150 lumakey

+ +

Turn certain luma values into transparency. +

+

The filter accepts the following options: +

+
+
threshold
+

Set the luma which will be used as base for transparency. +Default value is 0. +

+
+
tolerance
+

Set the range of luma values to be keyed out. +Default value is 0.01. +

+
+
softness
+

Set the range of softness. Default value is 0. +Use this to control gradual transition from zero to full transparency. +

+
+ + +
+

11.150.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

11.151 lut, lutrgb, lutyuv

+ +

Compute a look-up table for binding each pixel component input value +to an output value, and apply it to the input video. +

+

lutyuv applies a lookup table to a YUV input video, lutrgb +to an RGB input video. +

+

These filters accept the following parameters: +

+
c0
+

set first pixel component expression +

+
c1
+

set second pixel component expression +

+
c2
+

set third pixel component expression +

+
c3
+

set fourth pixel component expression, corresponds to the alpha component +

+
+
r
+

set red component expression +

+
g
+

set green component expression +

+
b
+

set blue component expression +

+
a
+

alpha component expression +

+
+
y
+

set Y/luminance component expression +

+
u
+

set U/Cb component expression +

+
v
+

set V/Cr component expression +

+
+ +

Each of them specifies the expression to use for computing the lookup table for +the corresponding pixel component values. +

+

The exact component associated to each of the c* options depends on the +format in input. +

+

The lut filter requires either YUV or RGB pixel formats in input, +lutrgb requires RGB pixel formats in input, and lutyuv requires YUV. +

+

The expressions can contain the following constants and functions: +

+
+
w
+
h
+

The input width and height. +

+
+
val
+

The input value for the pixel component. +

+
+
clipval
+

The input value, clipped to the minval-maxval range. +

+
+
maxval
+

The maximum value for the pixel component. +

+
+
minval
+

The minimum value for the pixel component. +

+
+
negval
+

The negated value for the pixel component value, clipped to the +minval-maxval range; it corresponds to the expression +"maxval-clipval+minval". +

+
+
clip(val)
+

The computed value in val, clipped to the +minval-maxval range. +

+
+
gammaval(gamma)
+

The computed gamma correction value of the pixel component value, +clipped to the minval-maxval range. It corresponds to the +expression +"pow((clipval-minval)/(maxval-minval)\,gamma)*(maxval-minval)+minval" +

+
+
+ +

All expressions default to "clipval". +

+ +
+

11.151.1 Commands

+ +

This filter supports same commands as options. +

+
+
+

11.151.2 Examples

+ +
    +
  • Negate input video: +
    +
    lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
    +lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
    +
    + +

    The above is the same as: +

    +
    lutrgb="r=negval:g=negval:b=negval"
    +lutyuv="y=negval:u=negval:v=negval"
    +
    + +
  • Negate luminance: +
    +
    lutyuv=y=negval
    +
    + +
  • Remove chroma components, turning the video into a graytone image: +
    +
    lutyuv="u=128:v=128"
    +
    + +
  • Apply a luma burning effect: +
    +
    lutyuv="y=2*val"
    +
    + +
  • Remove green and blue components: +
    +
    lutrgb="g=0:b=0"
    +
    + +
  • Set a constant alpha channel value on input: +
    +
    format=rgba,lutrgb=a="maxval-minval/2"
    +
    + +
  • Correct luminance gamma by a factor of 0.5: +
    +
    lutyuv=y=gammaval(0.5)
    +
    + +
  • Discard least significant bits of luma: +
    +
    lutyuv=y='bitand(val, 128+64+32)'
    +
    + +
  • Technicolor like effect: +
    +
    lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
    +
    +
+ +
+
+
+

11.152 lut2, tlut2

+ +

The lut2 filter takes two input streams and outputs one +stream. +

+

The tlut2 (time lut2) filter takes two consecutive frames +from one single stream. +

+

This filter accepts the following parameters: +

+
c0
+

set first pixel component expression +

+
c1
+

set second pixel component expression +

+
c2
+

set third pixel component expression +

+
c3
+

set fourth pixel component expression, corresponds to the alpha component +

+
+
d
+

set output bit depth, only available for lut2 filter. By default is 0, +which means bit depth is automatically picked from first input format. +

+
+ +

The lut2 filter also supports the framesync options. +

+

Each of them specifies the expression to use for computing the lookup table for +the corresponding pixel component values. +

+

The exact component associated to each of the c* options depends on the +format in inputs. +

+

The expressions can contain the following constants: +

+
+
w
+
h
+

The input width and height. +

+
+
x
+

The first input value for the pixel component. +

+
+
y
+

The second input value for the pixel component. +

+
+
bdx
+

The first input video bit depth. +

+
+
bdy
+

The second input video bit depth. +

+
+ +

All expressions default to "x". +

+ +
+

11.152.1 Commands

+ +

This filter supports the all above options as commands except option d. +

+
+
+

11.152.2 Examples

+ +
    +
  • Highlight differences between two RGB video streams: +
    +
    lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1)'
    +
    + +
  • Highlight differences between two YUV video streams: +
    +
    lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1)'
    +
    + +
  • Show max difference between two video streams: +
    +
    lut2='if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1)))'
    +
    +
+ +
+
+
+

11.153 maskedclamp

+ +

Clamp the first input stream with the second input and third input stream. +

+

Returns the value of first stream to be between second input +stream - undershoot and third input stream + overshoot. +

+

This filter accepts the following options: +

+
undershoot
+

Default value is 0. +

+
+
overshoot
+

Default value is 0. +

+
+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

11.153.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.154 maskedmax

+ +

Merge the second and third input stream into output stream using absolute differences +between second input stream and first input stream and absolute difference between +third input stream and first input stream. The picked value will be from second input +stream if second absolute difference is greater than first one or from third input stream +otherwise. +

+

This filter accepts the following options: +

+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

11.154.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.155 maskedmerge

+ +

Merge the first input stream with the second input stream using per pixel +weights in the third input stream. +

+

A value of 0 in the third stream pixel component means that pixel component +from first stream is returned unchanged, while maximum value (eg. 255 for +8-bit videos) means that pixel component from second stream is returned +unchanged. Intermediate values define the amount of merging between both +input stream’s pixel components. +

+

This filter accepts the following options: +

+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

11.155.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.156 maskedmin

+ +

Merge the second and third input stream into output stream using absolute differences +between second input stream and first input stream and absolute difference between +third input stream and first input stream. The picked value will be from second input +stream if second absolute difference is less than first one or from third input stream +otherwise. +

+

This filter accepts the following options: +

+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

11.156.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.157 maskedthreshold

+

Pick pixels comparing absolute difference of two video streams with fixed +threshold. +

+

If absolute difference between pixel component of first and second video +stream is equal or lower than user supplied threshold than pixel component +from first video stream is picked, otherwise pixel component from second +video stream is picked. +

+

This filter accepts the following options: +

+
threshold
+

Set threshold used when picking pixels from absolute difference from two input +video streams. +

+
+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from second stream. +By default value 0xf, all planes will be processed. +

+
+
mode
+

Set mode of filter operation. Can be abs or diff. +Default is abs. +

+
+ + +
+

11.157.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.158 maskfun

+

Create mask from input video. +

+

For example it is useful to create motion masks after tblend filter. +

+

This filter accepts the following options: +

+
+
low
+

Set low threshold. Any pixel component lower or exact than this value will be set to 0. +

+
+
high
+

Set high threshold. Any pixel component higher than this value will be set to max value +allowed for current pixel format. +

+
+
planes
+

Set planes to filter, by default all available planes are filtered. +

+
+
fill
+

Fill all frame pixels with this value. +

+
+
sum
+

Set max average pixel value for frame. If sum of all pixel components is higher that this +average, output frame will be completely filled with value set by fill option. +Typically useful for scene changes when used in combination with tblend filter. +

+
+ + +
+

11.158.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.159 mcdeint

+ +

Apply motion-compensation deinterlacing. +

+

It needs one field per frame as input and must thus be used together +with yadif=1/3 or equivalent. +

+

This filter accepts the following options: +

+
mode
+

Set the deinterlacing mode. +

+

It accepts one of the following values: +

+
fast
+
medium
+
slow
+

use iterative motion estimation +

+
extra_slow
+

like ‘slow’, but use multiple reference frames. +

+
+

Default value is ‘fast’. +

+
+
parity
+

Set the picture field parity assumed for the input video. It must be +one of the following values: +

+
+
0, tff
+

assume top field first +

+
1, bff
+

assume bottom field first +

+
+ +

Default value is ‘bff’. +

+
+
qp
+

Set per-block quantization parameter (QP) used by the internal +encoder. +

+

Higher values should result in a smoother motion vector field but less +optimal individual vectors. Default value is 1. +

+
+ +
+
+

11.160 median

+ +

Pick median pixel from certain rectangle defined by radius. +

+

This filter accepts the following options: +

+
+
radius
+

Set horizontal radius size. Default value is 1. +Allowed range is integer from 1 to 127. +

+
+
planes
+

Set which planes to process. Default is 15, which is all available planes. +

+
+
radiusV
+

Set vertical radius size. Default value is 0. +Allowed range is integer from 0 to 127. +If it is 0, value will be picked from horizontal radius option. +

+
+
percentile
+

Set median percentile. Default value is 0.5. +Default value of 0.5 will pick always median values, while 0 will pick +minimum values, and 1 maximum values. +

+
+ + +
+

11.160.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

11.161 mergeplanes

+ +

Merge color channel components from several video streams. +

+

The filter accepts up to 4 input streams, and merge selected input +planes to the output video. +

+

This filter accepts the following options: +

+
mapping
+

Set input to output plane mapping. Default is 0. +

+

The mappings is specified as a bitmap. It should be specified as a +hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. ’Aa’ describes the +mapping for the first plane of the output stream. ’A’ sets the number of +the input stream to use (from 0 to 3), and ’a’ the plane number of the +corresponding input to use (from 0 to 3). The rest of the mappings is +similar, ’Bb’ describes the mapping for the output stream second +plane, ’Cc’ describes the mapping for the output stream third plane and +’Dd’ describes the mapping for the output stream fourth plane. +

+
+
format
+

Set output pixel format. Default is yuva444p. +

+
+
map0s
+
map1s
+
map2s
+
map3s
+

Set input to output stream mapping for output Nth plane. Default is 0. +

+
+
map0p
+
map1p
+
map2p
+
map3p
+

Set input to output plane mapping for output Nth plane. Default is 0. +

+
+ + +
+

11.161.1 Examples

+ +
    +
  • Merge three gray video streams of same width and height into single video stream: +
    +
    [a0][a1][a2]mergeplanes=0x001020:yuv444p
    +
    + +
  • Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream: +
    +
    [a0][a1]mergeplanes=0x00010210:yuva444p
    +
    + +
  • Swap Y and A plane in yuva444p stream: +
    +
    format=yuva444p,mergeplanes=0x03010200:yuva444p
    +
    + +
  • Swap U and V plane in yuv420p stream: +
    +
    format=yuv420p,mergeplanes=0x000201:yuv420p
    +
    + +
  • Cast a rgb24 clip to yuv444p: +
    +
    format=rgb24,mergeplanes=0x000102:yuv444p
    +
    +
+ +
+
+
+

11.162 mestimate

+ +

Estimate and export motion vectors using block matching algorithms. +Motion vectors are stored in frame side data to be used by other filters. +

+

This filter accepts the following options: +

+
method
+

Specify the motion estimation method. Accepts one of the following values: +

+
+
esa
+

Exhaustive search algorithm. +

+
tss
+

Three step search algorithm. +

+
tdls
+

Two dimensional logarithmic search algorithm. +

+
ntss
+

New three step search algorithm. +

+
fss
+

Four step search algorithm. +

+
ds
+

Diamond search algorithm. +

+
hexbs
+

Hexagon-based search algorithm. +

+
epzs
+

Enhanced predictive zonal search algorithm. +

+
umh
+

Uneven multi-hexagon search algorithm. +

+
+

Default value is ‘esa’. +

+
+
mb_size
+

Macroblock size. Default 16. +

+
+
search_param
+

Search parameter. Default 7. +

+
+ +
+
+

11.163 midequalizer

+ +

Apply Midway Image Equalization effect using two video streams. +

+

Midway Image Equalization adjusts a pair of images to have the same +histogram, while maintaining their dynamics as much as possible. It’s +useful for e.g. matching exposures from a pair of stereo cameras. +

+

This filter has two inputs and one output, which must be of same pixel format, but +may be of different sizes. The output of filter is first input adjusted with +midway histogram of both inputs. +

+

This filter accepts the following option: +

+
+
planes
+

Set which planes to process. Default is 15, which is all available planes. +

+
+ +
+
+

11.164 minterpolate

+ +

Convert the video to specified frame rate using motion interpolation. +

+

This filter accepts the following options: +

+
fps
+

Specify the output frame rate. This can be rational e.g. 60000/1001. Frames are dropped if fps is lower than source fps. Default 60. +

+
+
mi_mode
+

Motion interpolation mode. Following values are accepted: +

+
dup
+

Duplicate previous or next frame for interpolating new ones. +

+
blend
+

Blend source frames. Interpolated frame is mean of previous and next frames. +

+
mci
+

Motion compensated interpolation. Following options are effective when this mode is selected: +

+
+
mc_mode
+

Motion compensation mode. Following values are accepted: +

+
obmc
+

Overlapped block motion compensation. +

+
aobmc
+

Adaptive overlapped block motion compensation. Window weighting coefficients are controlled adaptively according to the reliabilities of the neighboring motion vectors to reduce oversmoothing. +

+
+

Default mode is ‘obmc’. +

+
+
me_mode
+

Motion estimation mode. Following values are accepted: +

+
bidir
+

Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions. +

+
bilat
+

Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame. +

+
+

Default mode is ‘bilat’. +

+
+
me
+

The algorithm to be used for motion estimation. Following values are accepted: +

+
esa
+

Exhaustive search algorithm. +

+
tss
+

Three step search algorithm. +

+
tdls
+

Two dimensional logarithmic search algorithm. +

+
ntss
+

New three step search algorithm. +

+
fss
+

Four step search algorithm. +

+
ds
+

Diamond search algorithm. +

+
hexbs
+

Hexagon-based search algorithm. +

+
epzs
+

Enhanced predictive zonal search algorithm. +

+
umh
+

Uneven multi-hexagon search algorithm. +

+
+

Default algorithm is ‘epzs’. +

+
+
mb_size
+

Macroblock size. Default 16. +

+
+
search_param
+

Motion estimation search parameter. Default 32. +

+
+
vsbmc
+

Enable variable-size block motion compensation. Motion estimation is applied with smaller block sizes at object boundaries in order to make the them less blur. Default is 0 (disabled). +

+
+
+
+ +
+
scd
+

Scene change detection method. Scene change leads motion vectors to be in random direction. Scene change detection replace interpolated frames by duplicate ones. May not be needed for other modes. Following values are accepted: +

+
none
+

Disable scene change detection. +

+
fdiff
+

Frame difference. Corresponding pixel values are compared and if it satisfies scd_threshold scene change is detected. +

+
+

Default method is ‘fdiff’. +

+
+
scd_threshold
+

Scene change detection threshold. Default is 10.. +

+
+ +
+
+

11.165 mix

+ +

Mix several video input streams into one video stream. +

+

A description of the accepted options follows. +

+
+
inputs
+

The number of inputs. If unspecified, it defaults to 2. +

+
+
weights
+

Specify weight of each input video stream as sequence. +Each weight is separated by space. If number of weights +is smaller than number of frames last specified +weight will be used for all remaining unset weights. +

+
+
scale
+

Specify scale, if it is set it will be multiplied with sum +of each weight multiplied with pixel values to give final destination +pixel value. By default scale is auto scaled to sum of weights. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+
duration
+

Specify how end of stream is determined. +

+
longest
+

The duration of the longest input. (default) +

+
+
shortest
+

The duration of the shortest input. +

+
+
first
+

The duration of the first input. +

+
+
+
+ + +
+

11.165.1 Commands

+ +

This filter supports the following commands: +

+
weights
+
scale
+
planes
+

Syntax is same as option with same name. +

+
+ +
+
+
+

11.166 monochrome

+

Convert video to gray using custom color filter. +

+

A description of the accepted options follows. +

+
+
cb
+

Set the chroma blue spot. Allowed range is from -1 to 1. +Default value is 0. +

+
+
cr
+

Set the chroma red spot. Allowed range is from -1 to 1. +Default value is 0. +

+
+
size
+

Set the color filter size. Allowed range is from .1 to 10. +Default value is 1. +

+
+
high
+

Set the highlights strength. Allowed range is from 0 to 1. +Default value is 0. +

+
+ + +
+

11.166.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.167 morpho

+ +

This filter allows to apply main morphological grayscale transforms, +erode and dilate with arbitrary structures set in second input stream. +

+

Unlike naive implementation and much slower performance in erosion +and dilation filters, when speed is critical morpho filter +should be used instead. +

+

A description of accepted options follows, +

+
+
mode
+

Set morphological transform to apply, can be: +

+
+
erode
+
dilate
+
open
+
close
+
gradient
+
tophat
+
blackhat
+
+

Default is erode. +

+
+
planes
+

Set planes to filter, by default all planes except alpha are filtered. +

+
+
structure
+

Set which structure video frames will be processed from second input stream, +can be first or all. Default is all. +

+
+ +

The morpho filter also supports the framesync options. +

+ +
+

11.167.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

11.168 mpdecimate

+ +

Drop frames that do not differ greatly from the previous frame in +order to reduce frame rate. +

+

The main use of this filter is for very-low-bitrate encoding +(e.g. streaming over dialup modem), but it could in theory be used for +fixing movies that were inverse-telecined incorrectly. +

+

A description of the accepted options follows. +

+
+
max
+

Set the maximum number of consecutive frames which can be dropped (if +positive), or the minimum interval between dropped frames (if +negative). If the value is 0, the frame is dropped disregarding the +number of previous sequentially dropped frames. +

+

Default value is 0. +

+
+
keep
+

Set the maximum number of consecutive similar frames to ignore before to start dropping them. +If the value is 0, the frame is dropped disregarding the +number of previous sequentially similar frames. +

+

Default value is 0. +

+
+
hi
+
lo
+
frac
+

Set the dropping threshold values. +

+

Values for hi and lo are for 8x8 pixel blocks and +represent actual pixel value differences, so a threshold of 64 +corresponds to 1 unit of difference for each pixel, or the same spread +out differently over the block. +

+

A frame is a candidate for dropping if no 8x8 blocks differ by more +than a threshold of hi, and if no more than frac blocks (1 +meaning the whole image) differ by more than a threshold of lo. +

+

Default value for hi is 64*12, default value for lo is +64*5, and default value for frac is 0.33. +

+
+ +
+
+

11.169 msad

+ +

Obtain the MSAD (Mean Sum of Absolute Differences) between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained per component, average, min and max MSAD is printed through +the logging system. +

+

The filter stores the calculated MSAD of each frame in frame metadata. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi msad -f null -
+
+ +
+
+

11.170 multiply

+

Multiply first video stream pixels values with second video stream pixels values. +

+

The filter accepts the following options: +

+
+
scale
+

Set the scale applied to second video stream. By default is 1. +Allowed range is from 0 to 9. +

+
+
offset
+

Set the offset applied to second video stream. By default is 0.5. +Allowed range is from -1 to 1. +

+
+
planes
+

Specify planes from input video stream that will be processed. +By default all planes are processed. +

+
+ + +
+

11.170.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

11.171 negate

+ +

Negate (invert) the input video. +

+

It accepts the following option: +

+
+
components
+

Set components to negate. +

+

Available values for components are: +

+
y
+
u
+
v
+
a
+
r
+
g
+
b
+
+ +
+
negate_alpha
+

With value 1, it negates the alpha component, if present. Default value is 0. +

+
+ + +
+

11.171.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

11.172 nlmeans

+ +

Denoise frames using Non-Local Means algorithm. +

+

Each pixel is adjusted by looking for other pixels with similar contexts. This +context similarity is defined by comparing their surrounding patches of size +pxp. Patches are searched in an area of rxr +around the pixel. +

+

Note that the research area defines centers for patches, which means some +patches will be made of pixels outside that research area. +

+

The filter accepts the following options. +

+
+
s
+

Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0]. +

+
+
p
+

Set patch size. Default is 7. Must be odd number in range [0, 99]. +

+
+
pc
+

Same as p but for chroma planes. +

+

The default value is 0 and means automatic. +

+
+
r
+

Set research size. Default is 15. Must be odd number in range [0, 99]. +

+
+
rc
+

Same as r but for chroma planes. +

+

The default value is 0 and means automatic. +

+
+ +
+
+

11.173 nnedi

+ +

Deinterlace video using neural network edge directed interpolation. +

+

This filter accepts the following options: +

+
+
weights
+

Mandatory option, without binary file filter can not work. +Currently file can be found here: +https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin +

+
+
deint
+

Set which frames to deinterlace, by default it is all. +Can be all or interlaced. +

+
+
field
+

Set mode of operation. +

+

Can be one of the following: +

+
+
af
+

Use frame flags, both fields. +

+
a
+

Use frame flags, single field. +

+
t
+

Use top field only. +

+
b
+

Use bottom field only. +

+
tf
+

Use both fields, top first. +

+
bf
+

Use both fields, bottom first. +

+
+ +
+
planes
+

Set which planes to process, by default filter process all frames. +

+
+
nsize
+

Set size of local neighborhood around each pixel, used by the predictor neural +network. +

+

Can be one of the following: +

+
+
s8x6
+
s16x6
+
s32x6
+
s48x6
+
s8x4
+
s16x4
+
s32x4
+
+ +
+
nns
+

Set the number of neurons in predictor neural network. +Can be one of the following: +

+
+
n16
+
n32
+
n64
+
n128
+
n256
+
+ +
+
qual
+

Controls the number of different neural network predictions that are blended +together to compute the final output value. Can be fast, default or +slow. +

+
+
etype
+

Set which set of weights to use in the predictor. +Can be one of the following: +

+
+
a, abs
+

weights trained to minimize absolute error +

+
s, mse
+

weights trained to minimize squared error +

+
+ +
+
pscrn
+

Controls whether or not the prescreener neural network is used to decide +which pixels should be processed by the predictor neural network and which +can be handled by simple cubic interpolation. +The prescreener is trained to know whether cubic interpolation will be +sufficient for a pixel or whether it should be predicted by the predictor nn. +The computational complexity of the prescreener nn is much less than that of +the predictor nn. Since most pixels can be handled by cubic interpolation, +using the prescreener generally results in much faster processing. +The prescreener is pretty accurate, so the difference between using it and not +using it is almost always unnoticeable. +

+

Can be one of the following: +

+
+
none
+
original
+
new
+
new2
+
new3
+
+ +

Default is new. +

+
+ + +
+

11.173.1 Commands

+

This filter supports same commands as options, excluding weights option. +

+
+
+
+

11.174 noformat

+ +

Force libavfilter not to use any of the specified pixel formats for the +input to the next filter. +

+

It accepts the following parameters: +

+
pix_fmts
+

A ’|’-separated list of pixel format names, such as +pix_fmts=yuv420p|monow|rgb24". +

+
+
+ + +
+

11.174.1 Examples

+ +
    +
  • Force libavfilter to use a format different from yuv420p for the +input to the vflip filter: +
    +
    noformat=pix_fmts=yuv420p,vflip
    +
    + +
  • Convert the input video to any of the formats not contained in the list: +
    +
    noformat=yuv420p|yuv444p|yuv410p
    +
    +
+ +
+
+
+

11.175 noise

+ +

Add noise on video input frame. +

+

The filter accepts the following options: +

+
+
all_seed
+
c0_seed
+
c1_seed
+
c2_seed
+
c3_seed
+

Set noise seed for specific pixel component or all pixel components in case +of all_seed. Default value is 123457. +

+
+
all_strength, alls
+
c0_strength, c0s
+
c1_strength, c1s
+
c2_strength, c2s
+
c3_strength, c3s
+

Set noise strength for specific pixel component or all pixel components in case +all_strength. Default value is 0. Allowed range is [0, 100]. +

+
+
all_flags, allf
+
c0_flags, c0f
+
c1_flags, c1f
+
c2_flags, c2f
+
c3_flags, c3f
+

Set pixel component flags or set flags for all components if all_flags. +Available values for component flags are: +

+
a
+

averaged temporal noise (smoother) +

+
p
+

mix random noise with a (semi)regular pattern +

+
t
+

temporal noise (noise pattern changes between frames) +

+
u
+

uniform noise (gaussian otherwise) +

+
+
+
+ + +
+

11.175.1 Examples

+ +

Add temporal and uniform noise to input video: +

+
noise=alls=20:allf=t+u
+
+ +
+
+
+

11.176 normalize

+ +

Normalize RGB video (aka histogram stretching, contrast stretching). +See: https://en.wikipedia.org/wiki/Normalization_(image_processing) +

+

For each channel of each frame, the filter computes the input range and maps +it linearly to the user-specified output range. The output range defaults +to the full dynamic range from pure black to pure white. +

+

Temporal smoothing can be used on the input range to reduce flickering (rapid +changes in brightness) caused when small dark or bright objects enter or leave +the scene. This is similar to the auto-exposure (automatic gain control) on a +video camera, and, like a video camera, it may cause a period of over- or +under-exposure of the video. +

+

The R,G,B channels can be normalized independently, which may cause some +color shifting, or linked together as a single channel, which prevents +color shifting. Linked normalization preserves hue. Independent normalization +does not, so it can be used to remove some color casts. Independent and linked +normalization can be combined in any ratio. +

+

The normalize filter accepts the following options: +

+
+
blackpt
+
whitept
+

Colors which define the output range. The minimum input value is mapped to +the blackpt. The maximum input value is mapped to the whitept. +The defaults are black and white respectively. Specifying white for +blackpt and black for whitept will give color-inverted, +normalized video. Shades of grey can be used to reduce the dynamic range +(contrast). Specifying saturated colors here can create some interesting +effects. +

+
+
smoothing
+

The number of previous frames to use for temporal smoothing. The input range +of each channel is smoothed using a rolling average over the current frame +and the smoothing previous frames. The default is 0 (no temporal +smoothing). +

+
+
independence
+

Controls the ratio of independent (color shifting) channel normalization to +linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully +independent. Defaults to 1.0 (fully independent). +

+
+
strength
+

Overall strength of the filter. 1.0 is full strength. 0.0 is a rather +expensive no-op. Defaults to 1.0 (full strength). +

+
+
+ + +
+

11.176.1 Commands

+

This filter supports same commands as options, excluding smoothing option. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+

11.176.2 Examples

+ +

Stretch video contrast to use the full dynamic range, with no temporal +smoothing; may flicker depending on the source content: +

+
normalize=blackpt=black:whitept=white:smoothing=0
+
+ +

As above, but with 50 frames of temporal smoothing; flicker should be +reduced, depending on the source content: +

+
normalize=blackpt=black:whitept=white:smoothing=50
+
+ +

As above, but with hue-preserving linked channel normalization: +

+
normalize=blackpt=black:whitept=white:smoothing=50:independence=0
+
+ +

As above, but with half strength: +

+
normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
+
+ +

Map the darkest input color to red, the brightest input color to cyan: +

+
normalize=blackpt=red:whitept=cyan
+
+ +
+
+
+

11.177 null

+ +

Pass the video source unchanged to the output. +

+
+
+

11.178 ocr

+

Optical Character Recognition +

+

This filter uses Tesseract for optical character recognition. To enable +compilation of this filter, you need to configure FFmpeg with +--enable-libtesseract. +

+

It accepts the following options: +

+
+
datapath
+

Set datapath to tesseract data. Default is to use whatever was +set at installation. +

+
+
language
+

Set language, default is "eng". +

+
+
whitelist
+

Set character whitelist. +

+
+
blacklist
+

Set character blacklist. +

+
+ +

The filter exports recognized text as the frame metadata lavfi.ocr.text. +The filter exports confidence of recognized words as the frame metadata lavfi.ocr.confidence. +

+
+
+

11.179 ocv

+ +

Apply a video transform using libopencv. +

+

To enable this filter, install the libopencv library and headers and +configure FFmpeg with --enable-libopencv. +

+

It accepts the following parameters: +

+
+
filter_name
+

The name of the libopencv filter to apply. +

+
+
filter_params
+

The parameters to pass to the libopencv filter. If not specified, the default +values are assumed. +

+
+
+ +

Refer to the official libopencv documentation for more precise +information: +http://docs.opencv.org/master/modules/imgproc/doc/filtering.html +

+

Several libopencv filters are supported; see the following subsections. +

+ +
+

11.179.1 dilate

+ +

Dilate an image by using a specific structuring element. +It corresponds to the libopencv function cvDilate. +

+

It accepts the parameters: struct_el|nb_iterations. +

+

struct_el represents a structuring element, and has the syntax: +colsxrows+anchor_xxanchor_y/shape +

+

cols and rows represent the number of columns and rows of +the structuring element, anchor_x and anchor_y the anchor +point, and shape the shape for the structuring element. shape +must be "rect", "cross", "ellipse", or "custom". +

+

If the value for shape is "custom", it must be followed by a +string of the form "=filename". The file with name +filename is assumed to represent a binary image, with each +printable character corresponding to a bright pixel. When a custom +shape is used, cols and rows are ignored, the number +or columns and rows of the read file are assumed instead. +

+

The default value for struct_el is "3x3+0x0/rect". +

+

nb_iterations specifies the number of times the transform is +applied to the image, and defaults to 1. +

+

Some examples: +

+
# Use the default values
+ocv=dilate
+
+# Dilate using a structuring element with a 5x5 cross, iterating two times
+ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
+
+# Read the shape from the file diamond.shape, iterating two times.
+# The file diamond.shape may contain a pattern of characters like this
+#   *
+#  ***
+# *****
+#  ***
+#   *
+# The specified columns and rows are ignored
+# but the anchor point coordinates are not
+ocv=dilate:0x0+2x2/custom=diamond.shape|2
+
+ +
+
+

11.179.2 erode

+ +

Erode an image by using a specific structuring element. +It corresponds to the libopencv function cvErode. +

+

It accepts the parameters: struct_el:nb_iterations, +with the same syntax and semantics as the dilate filter. +

+
+
+

11.179.3 smooth

+ +

Smooth the input video. +

+

The filter takes the following parameters: +type|param1|param2|param3|param4. +

+

type is the type of smooth filter to apply, and must be one of +the following values: "blur", "blur_no_scale", "median", "gaussian", +or "bilateral". The default value is "gaussian". +

+

The meaning of param1, param2, param3, and param4 +depends on the smooth type. param1 and +param2 accept integer positive values or 0. param3 and +param4 accept floating point values. +

+

The default value for param1 is 3. The default value for the +other parameters is 0. +

+

These parameters correspond to the parameters assigned to the +libopencv function cvSmooth. +

+
+
+
+

11.180 oscilloscope

+ +

2D Video Oscilloscope. +

+

Useful to measure spatial impulse, step responses, chroma delays, etc. +

+

It accepts the following parameters: +

+
+
x
+

Set scope center x position. +

+
+
y
+

Set scope center y position. +

+
+
s
+

Set scope size, relative to frame diagonal. +

+
+
t
+

Set scope tilt/rotation. +

+
+
o
+

Set trace opacity. +

+
+
tx
+

Set trace center x position. +

+
+
ty
+

Set trace center y position. +

+
+
tw
+

Set trace width, relative to width of frame. +

+
+
th
+

Set trace height, relative to height of frame. +

+
+
c
+

Set which components to trace. By default it traces first three components. +

+
+
g
+

Draw trace grid. By default is enabled. +

+
+
st
+

Draw some statistics. By default is enabled. +

+
+
sc
+

Draw scope. By default is enabled. +

+
+ + +
+

11.180.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+

11.180.2 Examples

+ +
    +
  • Inspect full first row of video frame. +
    +
    oscilloscope=x=0.5:y=0:s=1
    +
    + +
  • Inspect full last row of video frame. +
    +
    oscilloscope=x=0.5:y=1:s=1
    +
    + +
  • Inspect full 5th line of video frame of height 1080. +
    +
    oscilloscope=x=0.5:y=5/1080:s=1
    +
    + +
  • Inspect full last column of video frame. +
    +
    oscilloscope=x=1:y=0.5:s=1:t=1
    +
    + +
+ +
+
+
+

11.181 overlay

+ +

Overlay one video on top of another. +

+

It takes two inputs and has one output. The first input is the "main" +video on which the second input is overlaid. +

+

It accepts the following parameters: +

+

A description of the accepted options follows. +

+
+
x
+
y
+

Set the expression for the x and y coordinates of the overlaid video +on the main video. Default value is "0" for both expressions. In case +the expression is invalid, it is set to a huge value (meaning that the +overlay will not be displayed within the output visible area). +

+
+
eof_action
+

See framesync. +

+
+
eval
+

Set when the expressions for x, and y are evaluated. +

+

It accepts the following values: +

+
init
+

only evaluate expressions once during the filter initialization or +when a command is processed +

+
+
frame
+

evaluate expressions for each incoming frame +

+
+ +

Default value is ‘frame’. +

+
+
shortest
+

See framesync. +

+
+
format
+

Set the format for the output video. +

+

It accepts the following values: +

+
yuv420
+

force YUV420 output +

+
+
yuv420p10
+

force YUV420p10 output +

+
+
yuv422
+

force YUV422 output +

+
+
yuv422p10
+

force YUV422p10 output +

+
+
yuv444
+

force YUV444 output +

+
+
rgb
+

force packed RGB output +

+
+
gbrp
+

force planar RGB output +

+
+
auto
+

automatically pick format +

+
+ +

Default value is ‘yuv420’. +

+
+
repeatlast
+

See framesync. +

+
+
alpha
+

Set format of alpha of the overlaid video, it can be straight or +premultiplied. Default is straight. +

+
+ +

The x, and y expressions can contain the following +parameters. +

+
+
main_w, W
+
main_h, H
+

The main input width and height. +

+
+
overlay_w, w
+
overlay_h, h
+

The overlay input width and height. +

+
+
x
+
y
+

The computed values for x and y. They are evaluated for +each new frame. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values of the output +format. For example for the pixel format "yuv422p" hsub is 2 and +vsub is 1. +

+
+
n
+

the number of input frame, starting from 0 +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, +do not use +

+
+
t
+

The timestamp, expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
+ +

This filter also supports the framesync options. +

+

Note that the n, t variables are available only +when evaluation is done per frame, and will evaluate to NAN +when eval is set to ‘init’. +

+

Be aware that frames are taken from each input video in timestamp +order, hence, if their initial timestamps differ, it is a good idea +to pass the two inputs through a setpts=PTS-STARTPTS filter to +have them begin in the same zero timestamp, as the example for +the movie filter does. +

+

You can chain together more overlays but you should test the +efficiency of such approach. +

+ +
+

11.181.1 Commands

+ +

This filter supports the following commands: +

+
x
+
y
+

Modify the x and y of the overlay input. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+

11.181.2 Examples

+ +
    +
  • Draw the overlay at 10 pixels from the bottom right corner of the main +video: +
    +
    overlay=main_w-overlay_w-10:main_h-overlay_h-10
    +
    + +

    Using named options the example above becomes: +

    +
    overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
    +
    + +
  • Insert a transparent PNG logo in the bottom left corner of the input, +using the ffmpeg tool with the -filter_complex option: +
    +
    ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
    +
    + +
  • Insert 2 different transparent PNG logos (second logo on bottom +right corner) using the ffmpeg tool: +
    +
    ffmpeg -i input -i logo1 -i logo2 -filter_complex 'overlay=x=10:y=H-h-10,overlay=x=W-w-10:y=H-h-10' output
    +
    + +
  • Add a transparent color layer on top of the main video; WxH +must specify the size of the main input to the overlay filter: +
    +
    color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
    +
    + +
  • Play an original video and a filtered version (here with the deshake +filter) side by side using the ffplay tool: +
    +
    ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
    +
    + +

    The above command is the same as: +

    +
    ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
    +
    + +
  • Make a sliding overlay appearing from the left to the right top part of the +screen starting since time 2: +
    +
    overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
    +
    + +
  • Compose output by putting two input videos side to side: +
    +
    ffmpeg -i left.avi -i right.avi -filter_complex "
    +nullsrc=size=200x100 [background];
    +[0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
    +[1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
    +[background][left]       overlay=shortest=1       [background+left];
    +[background+left][right] overlay=shortest=1:x=100 [left+right]
    +"
    +
    + +
  • Mask 10-20 seconds of a video by applying the delogo filter to a section +
    +
    ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
    +-vf '[in]split[split_main][split_delogo];[split_delogo]trim=start=360:end=371,delogo=0:0:640:480[delogoed];[split_main][delogoed]overlay=eof_action=pass[out]'
    +masked.avi
    +
    + +
  • Chain several overlays in cascade: +
    +
    nullsrc=s=200x200 [bg];
    +testsrc=s=100x100, split=4 [in0][in1][in2][in3];
    +[in0] lutrgb=r=0, [bg]   overlay=0:0     [mid0];
    +[in1] lutrgb=g=0, [mid0] overlay=100:0   [mid1];
    +[in2] lutrgb=b=0, [mid1] overlay=0:100   [mid2];
    +[in3] null,       [mid2] overlay=100:100 [out0]
    +
    + +
+ +
+
+
+

11.182 overlay_cuda

+ +

Overlay one video on top of another. +

+

This is the CUDA variant of the overlay filter. +It only accepts CUDA frames. The underlying input pixel formats have to match. +

+

It takes two inputs and has one output. The first input is the "main" +video on which the second input is overlaid. +

+

It accepts the following parameters: +

+
+
x
+
y
+

Set expressions for the x and y coordinates of the overlaid video +on the main video. +

+

They can contain the following parameters: +

+
+
main_w, W
+
main_h, H
+

The main input width and height. +

+
+
overlay_w, w
+
overlay_h, h
+

The overlay input width and height. +

+
+
x
+
y
+

The computed values for x and y. They are evaluated for +each new frame. +

+
+
n
+

The ordinal index of the main input frame, starting from 0. +

+
+
pos
+

The byte offset position in the file of the main input frame, NAN if unknown. +Deprecated, do not use. +

+
+
t
+

The timestamp of the main input frame, expressed in seconds, NAN if unknown. +

+
+
+ +

Default value is "0" for both expressions. +

+
+
eval
+

Set when the expressions for x and y are evaluated. +

+

It accepts the following values: +

+
init
+

Evaluate expressions once during filter initialization or +when a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame +

+
+ +

Default value is frame. +

+
+
eof_action
+

See framesync. +

+
+
shortest
+

See framesync. +

+
+
repeatlast
+

See framesync. +

+
+
+ +

This filter also supports the framesync options. +

+
+
+

11.183 owdenoise

+ +

Apply Overcomplete Wavelet denoiser. +

+

The filter accepts the following options: +

+
+
depth
+

Set depth. +

+

Larger depth values will denoise lower frequency components more, but +slow down filtering. +

+

Must be an int in the range 8-16, default is 8. +

+
+
luma_strength, ls
+

Set luma strength. +

+

Must be a double value in the range 0-1000, default is 1.0. +

+
+
chroma_strength, cs
+

Set chroma strength. +

+

Must be a double value in the range 0-1000, default is 1.0. +

+
+ +
+
+

11.184 pad

+ +

Add paddings to the input image, and place the original input at the +provided x, y coordinates. +

+

It accepts the following parameters: +

+
+
width, w
+
height, h
+

Specify an expression for the size of the output image with the +paddings added. If the value for width or height is 0, the +corresponding input size is used for the output. +

+

The width expression can reference the value set by the +height expression, and vice versa. +

+

The default value of width and height is 0. +

+
+
x
+
y
+

Specify the offsets to place the input image at within the padded area, +with respect to the top/left border of the output image. +

+

The x expression can reference the value set by the y +expression, and vice versa. +

+

The default value of x and y is 0. +

+

If x or y evaluate to a negative number, they’ll be changed +so the input image is centered on the padded area. +

+
+
color
+

Specify the color of the padded area. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. +

+

The default value of color is "black". +

+
+
eval
+

Specify when to evaluate width, height, x and y expression. +

+

It accepts the following values: +

+
+
init
+

Only evaluate expressions once during the filter initialization or when +a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+
+ +

Default value is ‘init’. +

+
+
aspect
+

Pad to aspect instead to a resolution. +

+
+
+ +

The value for the width, height, x, and y +options are expressions containing the following constants: +

+
+
in_w
+
in_h
+

The input video width and height. +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output width and height (the size of the padded area), as +specified by the width and height expressions. +

+
+
ow
+
oh
+

These are the same as out_w and out_h. +

+
+
x
+
y
+

The x and y offsets as specified by the x and y +expressions, or NAN if not yet specified. +

+
+
a
+

same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (iw / ih) * sar +

+
+
hsub
+
vsub
+

The horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ + +
+

11.184.1 Examples

+ +
    +
  • Add paddings with the color "violet" to the input video. The output video +size is 640x480, and the top-left corner of the input video is placed at +column 0, row 40 +
    +
    pad=640:480:0:40:violet
    +
    + +

    The example above is equivalent to the following command: +

    +
    pad=width=640:height=480:x=0:y=40:color=violet
    +
    + +
  • Pad the input to get an output with dimensions increased by 3/2, +and put the input video at the center of the padded area: +
    +
    pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • Pad the input to get a squared output with size equal to the maximum +value between the input width and height, and put the input video at +the center of the padded area: +
    +
    pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • Pad the input to get a final w/h ratio of 16:9: +
    +
    pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • In case of anamorphic video, in order to set the output display aspect +correctly, it is necessary to use sar in the expression, +according to the relation: +
    +
    (ih * X / ih) * sar = output_dar
    +X = output_dar / sar
    +
    + +

    Thus the previous example needs to be modified to: +

    +
    pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • Double the output size and put the input video in the bottom-right +corner of the output padded area: +
    +
    pad="2*iw:2*ih:ow-iw:oh-ih"
    +
    +
+ +
+
+
+

11.185 palettegen

+ +

Generate one palette for a whole video stream. +

+

It accepts the following options: +

+
+
max_colors
+

Set the maximum number of colors to quantize in the palette. +Note: the palette will still contain 256 colors; the unused palette entries +will be black. +

+
+
reserve_transparent
+

Create a palette of 255 colors maximum and reserve the last one for +transparency. Reserving the transparency color is useful for GIF optimization. +If not set, the maximum of colors in the palette will be 256. You probably want +to disable this option for a standalone image. +Set by default. +

+
+
transparency_color
+

Set the color that will be used as background for transparency. +

+
+
stats_mode
+

Set statistics mode. +

+

It accepts the following values: +

+
full
+

Compute full frame histograms. +

+
diff
+

Compute histograms only for the part that differs from previous frame. This +might be relevant to give more importance to the moving part of your input if +the background is static. +

+
single
+

Compute new histogram for each frame. +

+
+ +

Default value is full. +

+
+ +

The filter also exports the frame metadata lavfi.color_quant_ratio +(nb_color_in / nb_color_out) which you can use to evaluate the degree of +color quantization of the palette. This information is also visible at +info logging level. +

+ +
+

11.185.1 Examples

+ +
    +
  • Generate a representative palette of a given video using ffmpeg: +
    +
    ffmpeg -i input.mkv -vf palettegen palette.png
    +
    +
+ +
+
+
+

11.186 paletteuse

+ +

Use a palette to downsample an input video stream. +

+

The filter takes two inputs: one video stream and a palette. The palette must +be a 256 pixels image. +

+

It accepts the following options: +

+
+
dither
+

Select dithering mode. Available algorithms are: +

+
bayer
+

Ordered 8x8 bayer dithering (deterministic) +

+
heckbert
+

Dithering as defined by Paul Heckbert in 1982 (simple error diffusion). +Note: this dithering is sometimes considered "wrong" and is included as a +reference. +

+
floyd_steinberg
+

Floyd and Steingberg dithering (error diffusion) +

+
sierra2
+

Frankie Sierra dithering v2 (error diffusion) +

+
sierra2_4a
+

Frankie Sierra dithering v2 "Lite" (error diffusion) +

+
sierra3
+

Frankie Sierra dithering v3 (error diffusion) +

+
burkes
+

Burkes dithering (error diffusion) +

+
atkinson
+

Atkinson dithering by Bill Atkinson at Apple Computer (error diffusion) +

+
none
+

Disable dithering. +

+
+ +

Default is sierra2_4a. +

+
+
bayer_scale
+

When bayer dithering is selected, this option defines the scale of the +pattern (how much the crosshatch pattern is visible). A low value means more +visible pattern for less banding, and higher value means less visible pattern +at the cost of more banding. +

+

The option must be an integer value in the range [0,5]. Default is 2. +

+
+
diff_mode
+

If set, define the zone to process +

+
+
rectangle
+

Only the changing rectangle will be reprocessed. This is similar to GIF +cropping/offsetting compression mechanism. This option can be useful for speed +if only a part of the image is changing, and has use cases such as limiting the +scope of the error diffusal dither to the rectangle that bounds the +moving scene (it leads to more deterministic output if the scene doesn’t change +much, and as a result less moving noise and better GIF compression). +

+
+ +

Default is none. +

+
+
new
+

Take new palette for each output frame. +

+
+
alpha_threshold
+

Sets the alpha threshold for transparency. Alpha values above this threshold +will be treated as completely opaque, and values below this threshold will be +treated as completely transparent. +

+

The option must be an integer value in the range [0,255]. Default is 128. +

+
+ + +
+

11.186.1 Examples

+ +
    +
  • Use a palette (generated for example with palettegen) to encode a GIF +using ffmpeg: +
    +
    ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
    +
    +
+ +
+
+
+

11.187 perspective

+ +

Correct perspective of video not recorded perpendicular to the screen. +

+

A description of the accepted parameters follows. +

+
+
x0
+
y0
+
x1
+
y1
+
x2
+
y2
+
x3
+
y3
+

Set coordinates expression for top left, top right, bottom left and bottom right corners. +Default values are 0:0:W:0:0:H:W:H with which perspective will remain unchanged. +If the sense option is set to source, then the specified points will be sent +to the corners of the destination. If the sense option is set to destination, +then the corners of the source will be sent to the specified coordinates. +

+

The expressions can use the following variables: +

+
+
W
+
H
+

the width and height of video frame. +

+
in
+

Input frame count. +

+
on
+

Output frame count. +

+
+ +
+
interpolation
+

Set interpolation for perspective correction. +

+

It accepts the following values: +

+
linear
+
cubic
+
+ +

Default value is ‘linear’. +

+
+
sense
+

Set interpretation of coordinate options. +

+

It accepts the following values: +

+
0, source
+
+

Send point in the source specified by the given coordinates to +the corners of the destination. +

+
+
1, destination
+
+

Send the corners of the source to the point in the destination specified +by the given coordinates. +

+

Default value is ‘source’. +

+
+ +
+
eval
+

Set when the expressions for coordinates x0,y0,...x3,y3 are evaluated. +

+

It accepts the following values: +

+
init
+

only evaluate expressions once during the filter initialization or +when a command is processed +

+
+
frame
+

evaluate expressions for each incoming frame +

+
+ +

Default value is ‘init’. +

+
+ +
+
+

11.188 phase

+ +

Delay interlaced video by one field time so that the field order changes. +

+

The intended use is to fix PAL movies that have been captured with the +opposite field order to the film-to-video transfer. +

+

A description of the accepted parameters follows. +

+
+
mode
+

Set phase mode. +

+

It accepts the following values: +

+
t
+

Capture field order top-first, transfer bottom-first. +Filter will delay the bottom field. +

+
+
b
+

Capture field order bottom-first, transfer top-first. +Filter will delay the top field. +

+
+
p
+

Capture and transfer with the same field order. This mode only exists +for the documentation of the other options to refer to, but if you +actually select it, the filter will faithfully do nothing. +

+
+
a
+

Capture field order determined automatically by field flags, transfer +opposite. +Filter selects among ‘t’ and ‘b’ modes on a frame by frame +basis using field flags. If no field information is available, +then this works just like ‘u’. +

+
+
u
+

Capture unknown or varying, transfer opposite. +Filter selects among ‘t’ and ‘b’ on a frame by frame basis by +analyzing the images and selecting the alternative that produces best +match between the fields. +

+
+
T
+

Capture top-first, transfer unknown or varying. +Filter selects among ‘t’ and ‘p’ using image analysis. +

+
+
B
+

Capture bottom-first, transfer unknown or varying. +Filter selects among ‘b’ and ‘p’ using image analysis. +

+
+
A
+

Capture determined by field flags, transfer unknown or varying. +Filter selects among ‘t’, ‘b’ and ‘p’ using field flags and +image analysis. If no field information is available, then this works just +like ‘U’. This is the default mode. +

+
+
U
+

Both capture and transfer unknown or varying. +Filter selects among ‘t’, ‘b’ and ‘p’ using image analysis only. +

+
+
+
+ + +
+

11.188.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.189 photosensitivity

+

Reduce various flashes in video, so to help users with epilepsy. +

+

It accepts the following options: +

+
frames, f
+

Set how many frames to use when filtering. Default is 30. +

+
+
threshold, t
+

Set detection threshold factor. Default is 1. +Lower is stricter. +

+
+
skip
+

Set how many pixels to skip when sampling frames. Default is 1. +Allowed range is from 1 to 1024. +

+
+
bypass
+

Leave frames unchanged. Default is disabled. +

+
+ +
+
+

11.190 pixdesctest

+ +

Pixel format descriptor test filter, mainly useful for internal +testing. The output video should be equal to the input video. +

+

For example: +

+
format=monow, pixdesctest
+
+ +

can be used to test the monowhite pixel format descriptor definition. +

+
+
+

11.191 pixelize

+

Apply pixelization to video stream. +

+

The filter accepts the following options: +

+
width, w
+
height, h
+

Set block dimensions that will be used for pixelization. +Default value is 16. +

+
+
mode, m
+

Set the mode of pixelization used. +

+

Possible values are: +

+
avg
+
min
+
max
+
+

Default value is avg. +

+
+
planes, p
+

Set what planes to filter. Default is to filter all planes. +

+
+ + +
+

11.191.1 Commands

+ +

This filter supports all options as commands. +

+
+
+
+

11.192 pixscope

+ +

Display sample values of color channels. Mainly useful for checking color +and levels. Minimum supported resolution is 640x480. +

+

The filters accept the following options: +

+
+
x
+

Set scope X position, relative offset on X axis. +

+
+
y
+

Set scope Y position, relative offset on Y axis. +

+
+
w
+

Set scope width. +

+
+
h
+

Set scope height. +

+
+
o
+

Set window opacity. This window also holds statistics about pixel area. +

+
+
wx
+

Set window X position, relative offset on X axis. +

+
+
wy
+

Set window Y position, relative offset on Y axis. +

+
+ + +
+

11.192.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

11.193 pp

+ +

Enable the specified chain of postprocessing subfilters using libpostproc. This +library should be automatically selected with a GPL build (--enable-gpl). +Subfilters must be separated by ’/’ and can be disabled by prepending a ’-’. +Each subfilter and some options have a short and a long name that can be used +interchangeably, i.e. dr/dering are the same. +

+

The filters accept the following options: +

+
+
subfilters
+

Set postprocessing subfilters string. +

+
+ +

All subfilters share common options to determine their scope: +

+
+
a/autoq
+

Honor the quality commands for this subfilter. +

+
+
c/chrom
+

Do chrominance filtering, too (default). +

+
+
y/nochrom
+

Do luminance filtering only (no chrominance). +

+
+
n/noluma
+

Do chrominance filtering only (no luminance). +

+
+ +

These options can be appended after the subfilter name, separated by a ’|’. +

+

Available subfilters are: +

+
+
hb/hdeblock[|difference[|flatness]]
+

Horizontal deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+ +
+
vb/vdeblock[|difference[|flatness]]
+

Vertical deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+ +
+
ha/hadeblock[|difference[|flatness]]
+

Accurate horizontal deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+ +
+
va/vadeblock[|difference[|flatness]]
+

Accurate vertical deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+
+
+ +

The horizontal and vertical deblocking filters share the difference and +flatness values so you cannot set different horizontal and vertical +thresholds. +

+
+
h1/x1hdeblock
+

Experimental horizontal deblocking filter +

+
+
v1/x1vdeblock
+

Experimental vertical deblocking filter +

+
+
dr/dering
+

Deringing filter +

+
+
tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer
+
+
threshold1
+

larger -> stronger filtering +

+
threshold2
+

larger -> stronger filtering +

+
threshold3
+

larger -> stronger filtering +

+
+ +
+
al/autolevels[:f/fullyrange], automatic brightness / contrast correction
+
+
f/fullyrange
+

Stretch luminance to 0-255. +

+
+ +
+
lb/linblenddeint
+

Linear blend deinterlacing filter that deinterlaces the given block by +filtering all lines with a (1 2 1) filter. +

+
+
li/linipoldeint
+

Linear interpolating deinterlacing filter that deinterlaces the given block by +linearly interpolating every second line. +

+
+
ci/cubicipoldeint
+

Cubic interpolating deinterlacing filter deinterlaces the given block by +cubically interpolating every second line. +

+
+
md/mediandeint
+

Median deinterlacing filter that deinterlaces the given block by applying a +median filter to every second line. +

+
+
fd/ffmpegdeint
+

FFmpeg deinterlacing filter that deinterlaces the given block by filtering every +second line with a (-1 4 2 4 -1) filter. +

+
+
l5/lowpass5
+

Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given +block by filtering all lines with a (-1 2 6 2 -1) filter. +

+
+
fq/forceQuant[|quantizer]
+

Overrides the quantizer table from the input with the constant quantizer you +specify. +

+
quantizer
+

Quantizer to use +

+
+ +
+
de/default
+

Default pp filter combination (hb|a,vb|a,dr|a) +

+
+
fa/fast
+

Fast pp filter combination (h1|a,v1|a,dr|a) +

+
+
ac
+

High quality pp filter combination (ha|a|128|7,va|a,dr|a) +

+
+ + +
+

11.193.1 Examples

+ +
    +
  • Apply horizontal and vertical deblocking, deringing and automatic +brightness/contrast: +
    +
    pp=hb/vb/dr/al
    +
    + +
  • Apply default filters without brightness/contrast correction: +
    +
    pp=de/-al
    +
    + +
  • Apply default filters and temporal denoiser: +
    +
    pp=default/tmpnoise|1|2|3
    +
    + +
  • Apply deblocking on luminance only, and switch vertical deblocking on or off +automatically depending on available CPU time: +
    +
    pp=hb|y/vb|a
    +
    +
+ +
+
+
+

11.194 pp7

+

Apply Postprocessing filter 7. It is variant of the spp filter, +similar to spp = 6 with 7 point DCT, where only the center sample is +used after IDCT. +

+

The filter accepts the following options: +

+
+
qp
+

Force a constant quantization parameter. It accepts an integer in range +0 to 63. If not set, the filter will use the QP from the video stream +(if available). +

+
+
mode
+

Set thresholding mode. Available modes are: +

+
+
hard
+

Set hard thresholding. +

+
soft
+

Set soft thresholding (better de-ringing effect, but likely blurrier). +

+
medium
+

Set medium thresholding (good results, default). +

+
+
+
+ +
+
+

11.195 premultiply

+

Apply alpha premultiply effect to input video stream using first plane +of second stream as alpha. +

+

Both streams must have same dimensions and same pixel format. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
inplace
+

Do not require 2nd input for processing, instead use alpha plane from input stream. +

+
+ +
+
+

11.196 prewitt

+

Apply prewitt operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

11.196.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.197 pseudocolor

+ +

Alter frame colors in video with pseudocolors. +

+

This filter accepts the following options: +

+
+
c0
+

set pixel first component expression +

+
+
c1
+

set pixel second component expression +

+
+
c2
+

set pixel third component expression +

+
+
c3
+

set pixel fourth component expression, corresponds to the alpha component +

+
+
index, i
+

set component to use as base for altering colors +

+
+
preset, p
+

Pick one of built-in LUTs. By default is set to none. +

+

Available LUTs: +

+
magma
+
inferno
+
plasma
+
viridis
+
turbo
+
cividis
+
range1
+
range2
+
shadows
+
highlights
+
solar
+
nominal
+
preferred
+
total
+
spectral
+
+ +
+
opacity
+

Set opacity of output colors. Allowed range is from 0 to 1. +Default value is set to 1. +

+
+ +

Each of the expression options specifies the expression to use for computing +the lookup table for the corresponding pixel component values. +

+

The expressions can contain the following constants and functions: +

+
+
w
+
h
+

The input width and height. +

+
+
val
+

The input value for the pixel component. +

+
+
ymin, umin, vmin, amin
+

The minimum allowed component value. +

+
+
ymax, umax, vmax, amax
+

The maximum allowed component value. +

+
+ +

All expressions default to "val". +

+ +
+

11.197.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

11.197.2 Examples

+ +
    +
  • Change too high luma values to gradient: +
    +
    pseudocolor="'if(between(val,ymax,amax),lerp(ymin,ymax,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(umax,umin,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(vmin,vmax,(val-ymax)/(amax-ymax)),-1):-1'"
    +
    +
+ +
+
+
+

11.198 psnr

+ +

Obtain the average, maximum and minimum PSNR (Peak Signal to Noise +Ratio) between two input videos. +

+

This filter takes in input two input videos, the first input is +considered the "main" source and is passed unchanged to the +output. The second input is used as a "reference" video for computing +the PSNR. +

+

Both video inputs must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained average PSNR is printed through the logging system. +

+

The filter stores the accumulated MSE (mean squared error) of each +frame, and at the end of the processing it is averaged across all frames +equally, and the following formula is applied to obtain the PSNR: +

+
+
PSNR = 10*log10(MAX^2/MSE)
+
+ +

Where MAX is the average of the maximum values of each component of the +image. +

+

The description of the accepted parameters follows. +

+
+
stats_file, f
+

If specified the filter will use the named file to save the PSNR of +each individual frame. When filename equals "-" the data is sent to +standard output. +

+
+
stats_version
+

Specifies which version of the stats file format to use. Details of +each format are written below. +Default value is 1. +

+
+
stats_add_max
+

Determines whether the max value is output to the stats log. +Default value is 0. +Requires stats_version >= 2. If this is set and stats_version < 2, +the filter will return an error. +

+
+ +

This filter also supports the framesync options. +

+

The file printed if stats_file is selected, contains a sequence of +key/value pairs of the form key:value for each compared +couple of frames. +

+

If a stats_version greater than 1 is specified, a header line precedes +the list of per-frame-pair stats, with key value pairs following the frame +format with the following parameters: +

+
+
psnr_log_version
+

The version of the log file format. Will match stats_version. +

+
+
fields
+

A comma separated list of the per-frame-pair parameters included in +the log. +

+
+ +

A description of each shown per-frame-pair parameter follows: +

+
+
n
+

sequential number of the input frame, starting from 1 +

+
+
mse_avg
+

Mean Square Error pixel-by-pixel average difference of the compared +frames, averaged over all the image components. +

+
+
mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a
+

Mean Square Error pixel-by-pixel average difference of the compared +frames for the component specified by the suffix. +

+
+
psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a
+

Peak Signal to Noise ratio of the compared frames for the component +specified by the suffix. +

+
+
max_avg, max_y, max_u, max_v
+

Maximum allowed value for each channel, and average over all +channels. +

+
+ + +
+

11.198.1 Examples

+
    +
  • For example: +
    +
    movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
    +[main][ref] psnr="stats_file=stats.log" [out]
    +
    + +

    On this example the input file being processed is compared with the +reference file ref_movie.mpg. The PSNR of each individual frame +is stored in stats.log. +

    +
  • Another example with different containers: +
    +
    ffmpeg -i main.mpg -i ref.mkv -lavfi  "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]psnr" -f null -
    +
    +
+ +
+
+
+

11.199 pullup

+ +

Pulldown reversal (inverse telecine) filter, capable of handling mixed +hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive +content. +

+

The pullup filter is designed to take advantage of future context in making +its decisions. This filter is stateless in the sense that it does not lock +onto a pattern to follow, but it instead looks forward to the following +fields in order to identify matches and rebuild progressive frames. +

+

To produce content with an even framerate, insert the fps filter after +pullup, use fps=24000/1001 if the input frame rate is 29.97fps, +fps=24 for 30fps and the (rare) telecined 25fps input. +

+

The filter accepts the following options: +

+
+
jl
+
jr
+
jt
+
jb
+

These options set the amount of "junk" to ignore at the left, right, top, and +bottom of the image, respectively. Left and right are in units of 8 pixels, +while top and bottom are in units of 2 lines. +The default is 8 pixels on each side. +

+
+
sb
+

Set the strict breaks. Setting this option to 1 will reduce the chances of +filter generating an occasional mismatched frame, but it may also cause an +excessive number of frames to be dropped during high motion sequences. +Conversely, setting it to -1 will make filter match fields more easily. +This may help processing of video where there is slight blurring between +the fields, but may also cause there to be interlaced frames in the output. +Default value is 0. +

+
+
mp
+

Set the metric plane to use. It accepts the following values: +

+
l
+

Use luma plane. +

+
+
u
+

Use chroma blue plane. +

+
+
v
+

Use chroma red plane. +

+
+ +

This option may be set to use chroma plane instead of the default luma plane +for doing filter’s computations. This may improve accuracy on very clean +source material, but more likely will decrease accuracy, especially if there +is chroma noise (rainbow effect) or any grayscale video. +The main purpose of setting mp to a chroma plane is to reduce CPU +load and make pullup usable in realtime on slow machines. +

+
+ +

For best results (without duplicated frames in the output file) it is +necessary to change the output frame rate. For example, to inverse +telecine NTSC input: +

+
ffmpeg -i input -vf pullup -r 24000/1001 ...
+
+ +
+
+

11.200 qp

+ +

Change video quantization parameters (QP). +

+

The filter accepts the following option: +

+
+
qp
+

Set expression for quantization parameter. +

+
+ +

The expression is evaluated through the eval API and can contain, among others, +the following constants: +

+
+
known
+

1 if index is not 129, 0 otherwise. +

+
+
qp
+

Sequential index starting from -129 to 128. +

+
+ + +
+

11.200.1 Examples

+ +
    +
  • Some equation like: +
    +
    qp=2+2*sin(PI*qp)
    +
    +
+ +
+
+
+

11.201 random

+ +

Flush video frames from internal cache of frames into a random order. +No frame is discarded. +Inspired by frei0r nervous filter. +

+
+
frames
+

Set size in number of frames of internal cache, in range from 2 to +512. Default is 30. +

+
+
seed
+

Set seed for random number generator, must be an integer included between +0 and UINT32_MAX. If not specified, or if explicitly set to +less than 0, the filter will try to use a good random seed on a +best effort basis. +

+
+ +
+
+

11.202 readeia608

+ +

Read closed captioning (EIA-608) information from the top lines of a video frame. +

+

This filter adds frame metadata for lavfi.readeia608.X.cc and +lavfi.readeia608.X.line, where X is the number of the identified line +with EIA-608 data (starting from 0). A description of each metadata value follows: +

+
+
lavfi.readeia608.X.cc
+

The two bytes stored as EIA-608 data (printed in hexadecimal). +

+
+
lavfi.readeia608.X.line
+

The number of the line on which the EIA-608 data was identified and read. +

+
+ +

This filter accepts the following options: +

+
+
scan_min
+

Set the line to start scanning for EIA-608 data. Default is 0. +

+
+
scan_max
+

Set the line to end scanning for EIA-608 data. Default is 29. +

+
+
spw
+

Set the ratio of width reserved for sync code detection. +Default is 0.27. Allowed range is [0.1 - 0.7]. +

+
+
chp
+

Enable checking the parity bit. In the event of a parity error, the filter will output +0x00 for that character. Default is false. +

+
+
lp
+

Lowpass lines prior to further processing. Default is enabled. +

+
+ + +
+

11.202.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

11.202.2 Examples

+ +
    +
  • Output a csv with presentation time and the first two lines of identified EIA-608 captioning data. +
    +
    ffprobe -f lavfi -i movie=captioned_video.mov,readeia608 -show_entries frame=pts_time:frame_tags=lavfi.readeia608.0.cc,lavfi.readeia608.1.cc -of csv
    +
    +
+ +
+
+
+

11.203 readvitc

+ +

Read vertical interval timecode (VITC) information from the top lines of a +video frame. +

+

The filter adds frame metadata key lavfi.readvitc.tc_str with the +timecode value, if a valid timecode has been detected. Further metadata key +lavfi.readvitc.found is set to 0/1 depending on whether +timecode data has been found or not. +

+

This filter accepts the following options: +

+
+
scan_max
+

Set the maximum number of lines to scan for VITC data. If the value is set to +-1 the full video frame is scanned. Default is 45. +

+
+
thr_b
+

Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0], +default value is 0.2. The value must be equal or less than thr_w. +

+
+
thr_w
+

Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0], +default value is 0.6. The value must be equal or greater than thr_b. +

+
+ + +
+

11.203.1 Examples

+ +
    +
  • Detect and draw VITC data onto the video frame; if no valid VITC is detected, +draw --:--:--:-- as a placeholder: +
    +
    ffmpeg -i input.avi -filter:v 'readvitc,drawtext=fontfile=FreeMono.ttf:text=%{metadata\\:lavfi.readvitc.tc_str\\:--\\\\\\:--\\\\\\:--\\\\\\:--}:x=(w-tw)/2:y=400-ascent'
    +
    +
+ +
+
+
+

11.204 remap

+ +

Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream. +

+

Destination pixel at position (X, Y) will be picked from source (x, y) position +where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero +value for pixel will be used for destination pixel. +

+

Xmap and Ymap input video streams must be of same dimensions. Output video stream +will have Xmap/Ymap video stream dimensions. +Xmap and Ymap input video streams are 16bit depth, single channel. +

+
+
format
+

Specify pixel format of output from this filter. Can be color or gray. +Default is color. +

+
+
fill
+

Specify the color of the unmapped pixels. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Default color is black. +

+
+ +
+
+

11.205 removegrain

+ +

The removegrain filter is a spatial denoiser for progressive video. +

+
+
m0
+

Set mode for the first plane. +

+
+
m1
+

Set mode for the second plane. +

+
+
m2
+

Set mode for the third plane. +

+
+
m3
+

Set mode for the fourth plane. +

+
+ +

Range of mode is from 0 to 24. Description of each mode follows: +

+
+
0
+

Leave input plane unchanged. Default. +

+
+
1
+

Clips the pixel with the minimum and maximum of the 8 neighbour pixels. +

+
+
2
+

Clips the pixel with the second minimum and maximum of the 8 neighbour pixels. +

+
+
3
+

Clips the pixel with the third minimum and maximum of the 8 neighbour pixels. +

+
+
4
+

Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels. +This is equivalent to a median filter. +

+
+
5
+

Line-sensitive clipping giving the minimal change. +

+
+
6
+

Line-sensitive clipping, intermediate. +

+
+
7
+

Line-sensitive clipping, intermediate. +

+
+
8
+

Line-sensitive clipping, intermediate. +

+
+
9
+

Line-sensitive clipping on a line where the neighbours pixels are the closest. +

+
+
10
+

Replaces the target pixel with the closest neighbour. +

+
+
11
+

[1 2 1] horizontal and vertical kernel blur. +

+
+
12
+

Same as mode 11. +

+
+
13
+

Bob mode, interpolates top field from the line where the neighbours +pixels are the closest. +

+
+
14
+

Bob mode, interpolates bottom field from the line where the neighbours +pixels are the closest. +

+
+
15
+

Bob mode, interpolates top field. Same as 13 but with a more complicated +interpolation formula. +

+
+
16
+

Bob mode, interpolates bottom field. Same as 14 but with a more complicated +interpolation formula. +

+
+
17
+

Clips the pixel with the minimum and maximum of respectively the maximum and +minimum of each pair of opposite neighbour pixels. +

+
+
18
+

Line-sensitive clipping using opposite neighbours whose greatest distance from +the current pixel is minimal. +

+
+
19
+

Replaces the pixel with the average of its 8 neighbours. +

+
+
20
+

Averages the 9 pixels ([1 1 1] horizontal and vertical blur). +

+
+
21
+

Clips pixels using the averages of opposite neighbour. +

+
+
22
+

Same as mode 21 but simpler and faster. +

+
+
23
+

Small edge and halo removal, but reputed useless. +

+
+
24
+

Similar as 23. +

+
+ +
+ +
+

11.207 repeatfields

+ +

This filter uses the repeat_field flag from the Video ES headers and hard repeats +fields based on its value. +

+
+
+

11.208 reverse

+ +

Reverse a video clip. +

+

Warning: This filter requires memory to buffer the entire clip, so trimming +is suggested. +

+ +
+

11.208.1 Examples

+ +
    +
  • Take the first 5 seconds of a clip, and reverse it. +
    +
    trim=end=5,reverse
    +
    +
+ +
+
+
+

11.209 rgbashift

+

Shift R/G/B/A pixels horizontally and/or vertically. +

+

The filter accepts the following options: +

+
rh
+

Set amount to shift red horizontally. +

+
rv
+

Set amount to shift red vertically. +

+
gh
+

Set amount to shift green horizontally. +

+
gv
+

Set amount to shift green vertically. +

+
bh
+

Set amount to shift blue horizontally. +

+
bv
+

Set amount to shift blue vertically. +

+
ah
+

Set amount to shift alpha horizontally. +

+
av
+

Set amount to shift alpha vertically. +

+
edge
+

Set edge mode, can be smear, default, or warp. +

+
+ + +
+

11.209.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.210 roberts

+

Apply roberts cross operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

11.210.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.211 rotate

+ +

Rotate video by an arbitrary angle expressed in radians. +

+

The filter accepts the following options: +

+

A description of the optional parameters follows. +

+
angle, a
+

Set an expression for the angle by which to rotate the input video +clockwise, expressed as a number of radians. A negative value will +result in a counter-clockwise rotation. By default it is set to "0". +

+

This expression is evaluated for each frame. +

+
+
out_w, ow
+

Set the output width expression, default value is "iw". +This expression is evaluated just once during configuration. +

+
+
out_h, oh
+

Set the output height expression, default value is "ih". +This expression is evaluated just once during configuration. +

+
+
bilinear
+

Enable bilinear interpolation if set to 1, a value of 0 disables +it. Default value is 1. +

+
+
fillcolor, c
+

Set the color used to fill the output area not covered by the rotated +image. For the general syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +If the special value "none" is selected then no +background is printed (useful for example if the background is never shown). +

+

Default value is "black". +

+
+ +

The expressions for the angle and the output size can contain the +following constants and functions: +

+
+
n
+

sequential number of the input frame, starting from 0. It is always NAN +before the first frame is filtered. +

+
+
t
+

time in seconds of the input frame, it is set to 0 when the filter is +configured. It is always NAN before the first frame is filtered. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
in_w, iw
+
in_h, ih
+

the input video width and height +

+
+
out_w, ow
+
out_h, oh
+

the output width and height, that is the size of the padded area as +specified by the width and height expressions +

+
+
rotw(a)
+
roth(a)
+

the minimal width/height required for completely containing the input +video rotated by a radians. +

+

These are only available when computing the out_w and +out_h expressions. +

+
+ + +
+

11.211.1 Examples

+ +
    +
  • Rotate the input by PI/6 radians clockwise: +
    +
    rotate=PI/6
    +
    + +
  • Rotate the input by PI/6 radians counter-clockwise: +
    +
    rotate=-PI/6
    +
    + +
  • Rotate the input by 45 degrees clockwise: +
    +
    rotate=45*PI/180
    +
    + +
  • Apply a constant rotation with period T, starting from an angle of PI/3: +
    +
    rotate=PI/3+2*PI*t/T
    +
    + +
  • Make the input video rotation oscillating with a period of T +seconds and an amplitude of A radians: +
    +
    rotate=A*sin(2*PI/T*t)
    +
    + +
  • Rotate the video, output size is chosen so that the whole rotating +input video is always completely contained in the output: +
    +
    rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
    +
    + +
  • Rotate the video, reduce the output size so that no background is ever +shown: +
    +
    rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
    +
    +
+ +
+
+

11.211.2 Commands

+ +

The filter supports the following commands: +

+
+
a, angle
+

Set the angle expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

11.212 sab

+ +

Apply Shape Adaptive Blur. +

+

The filter accepts the following options: +

+
+
luma_radius, lr
+

Set luma blur filter strength, must be a value in range 0.1-4.0, default +value is 1.0. A greater value will result in a more blurred image, and +in slower processing. +

+
+
luma_pre_filter_radius, lpfr
+

Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default +value is 1.0. +

+
+
luma_strength, ls
+

Set luma maximum difference between pixels to still be considered, must +be a value in the 0.1-100.0 range, default value is 1.0. +

+
+
chroma_radius, cr
+

Set chroma blur filter strength, must be a value in range -0.9-4.0. A +greater value will result in a more blurred image, and in slower +processing. +

+
+
chroma_pre_filter_radius, cpfr
+

Set chroma pre-filter radius, must be a value in the -0.9-2.0 range. +

+
+
chroma_strength, cs
+

Set chroma maximum difference between pixels to still be considered, +must be a value in the -0.9-100.0 range. +

+
+ +

Each chroma option value, if not explicitly specified, is set to the +corresponding luma option value. +

+
+
+

11.213 scale

+ +

Scale (resize) the input video, using the libswscale library. +

+

The scale filter forces the output display aspect ratio to be the same +of the input, by changing the output sample aspect ratio. +

+

If the input image format is different from the format requested by +the next filter, the scale filter will convert the input to the +requested format. +

+ +
+

11.213.1 Options

+

The filter accepts the following options, or any of the options +supported by the libswscale scaler. +

+

See (ffmpeg-scaler)the ffmpeg-scaler manual for +the complete list of scaler options. +

+
+
width, w
+
height, h
+

Set the output video dimension expression. Default value is the input +dimension. +

+

If the width or w value is 0, the input width is used for +the output. If the height or h value is 0, the input height +is used for the output. +

+

If one and only one of the values is -n with n >= 1, the scale filter +will use a value that maintains the aspect ratio of the input image, +calculated from the other specified dimension. After that it will, +however, make sure that the calculated dimension is divisible by n and +adjust the value if necessary. +

+

If both values are -n with n >= 1, the behavior will be identical to +both values being set to 0 as previously detailed. +

+

See below for the list of accepted constants for use in the dimension +expression. +

+
+
eval
+

Specify when to evaluate width and height expression. It accepts the following values: +

+
+
init
+

Only evaluate expressions once during the filter initialization or when a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+
+ +

Default value is ‘init’. +

+ +
+
interl
+

Set the interlacing mode. It accepts the following values: +

+
+
1
+

Force interlaced aware scaling. +

+
+
0
+

Do not apply interlaced scaling. +

+
+
-1
+

Select interlaced aware scaling depending on whether the source frames +are flagged as interlaced or not. +

+
+ +

Default value is ‘0’. +

+
+
flags
+

Set libswscale scaling flags. See +(ffmpeg-scaler)the ffmpeg-scaler manual for the +complete list of values. If not explicitly specified the filter applies +the default flags. +

+ +
+
param0, param1
+

Set libswscale input parameters for scaling algorithms that need them. See +(ffmpeg-scaler)the ffmpeg-scaler manual for the +complete documentation. If not explicitly specified the filter applies +empty parameters. +

+ + +
+
size, s
+

Set the video size. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
in_color_matrix
+
out_color_matrix
+

Set in/output YCbCr color space type. +

+

This allows the autodetected value to be overridden as well as allows forcing +a specific value used for the output and encoder. +

+

If not specified, the color space type depends on the pixel format. +

+

Possible values: +

+
+
auto
+

Choose automatically. +

+
+
bt709
+

Format conforming to International Telecommunication Union (ITU) +Recommendation BT.709. +

+
+
fcc
+

Set color space conforming to the United States Federal Communications +Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a). +

+
+
bt601
+
bt470
+
smpte170m
+

Set color space conforming to: +

+
    +
  • ITU Radiocommunication Sector (ITU-R) Recommendation BT.601 + +
  • ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G + +
  • Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004 + +
+ +
+
smpte240m
+

Set color space conforming to SMPTE ST 240:1999. +

+
+
bt2020
+

Set color space conforming to ITU-R BT.2020 non-constant luminance system. +

+
+ +
+
in_range
+
out_range
+

Set in/output YCbCr sample range. +

+

This allows the autodetected value to be overridden as well as allows forcing +a specific value used for the output and encoder. If not specified, the +range depends on the pixel format. Possible values: +

+
+
auto/unknown
+

Choose automatically. +

+
+
jpeg/full/pc
+

Set full range (0-255 in case of 8-bit luma). +

+
+
mpeg/limited/tv
+

Set "MPEG" range (16-235 in case of 8-bit luma). +

+
+ +
+
force_original_aspect_ratio
+

Enable decreasing or increasing output video width or height if necessary to +keep the original aspect ratio. Possible values: +

+
+
disable
+

Scale the video as specified and disable this feature. +

+
+
decrease
+

The output video dimensions will automatically be decreased if needed. +

+
+
increase
+

The output video dimensions will automatically be increased if needed. +

+
+
+ +

One useful instance of this option is that when you know a specific device’s +maximum allowed resolution, you can use this to limit the output video to +that, while retaining the aspect ratio. For example, device A allows +1280x720 playback, and your video is 1920x800. Using this option (set it to +decrease) and specifying 1280x720 to the command line makes the output +1280x533. +

+

Please note that this is a different thing than specifying -1 for w +or h, you still need to specify the output resolution for this option +to work. +

+
+
force_divisible_by
+

Ensures that both the output dimensions, width and height, are divisible by the +given integer when used together with force_original_aspect_ratio. This +works similar to using -n in the w and h options. +

+

This option respects the value set for force_original_aspect_ratio, +increasing or decreasing the resolution accordingly. The video’s aspect ratio +may be slightly modified. +

+

This option can be handy if you need to have a video fit within or exceed +a defined resolution using force_original_aspect_ratio but also have +encoder restrictions on width or height divisibility. +

+
+
+ +

The values of the w and h options are expressions +containing the following constants: +

+
+
in_w
+
in_h
+

The input width and height +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (scaled) width and height +

+
+
ow
+
oh
+

These are the same as out_w and out_h +

+
+
a
+

The same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

The input display aspect ratio. Calculated from (iw / ih) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical input chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
ohsub
+
ovsub
+

horizontal and vertical output chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +Only available with eval=frame. +

+
+
t
+

The presentation timestamp of the input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
pos
+

The position (byte offset) of the frame in the input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +Deprecated, do not use. +

+
+ +
+
+

11.213.2 Examples

+ +
    +
  • Scale the input video to a size of 200x100 +
    +
    scale=w=200:h=100
    +
    + +

    This is equivalent to: +

    +
    scale=200:100
    +
    + +

    or: +

    +
    scale=200x100
    +
    + +
  • Specify a size abbreviation for the output size: +
    +
    scale=qcif
    +
    + +

    which can also be written as: +

    +
    scale=size=qcif
    +
    + +
  • Scale the input to 2x: +
    +
    scale=w=2*iw:h=2*ih
    +
    + +
  • The above is the same as: +
    +
    scale=2*in_w:2*in_h
    +
    + +
  • Scale the input to 2x with forced interlaced scaling: +
    +
    scale=2*iw:2*ih:interl=1
    +
    + +
  • Scale the input to half size: +
    +
    scale=w=iw/2:h=ih/2
    +
    + +
  • Increase the width, and set the height to the same size: +
    +
    scale=3/2*iw:ow
    +
    + +
  • Seek Greek harmony: +
    +
    scale=iw:1/PHI*iw
    +scale=ih*PHI:ih
    +
    + +
  • Increase the height, and set the width to 3/2 of the height: +
    +
    scale=w=3/2*oh:h=3/5*ih
    +
    + +
  • Increase the size, making the size a multiple of the chroma +subsample values: +
    +
    scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
    +
    + +
  • Increase the width to a maximum of 500 pixels, +keeping the same aspect ratio as the input: +
    +
    scale=w='min(500\, iw*3/2):h=-1'
    +
    + +
  • Make pixels square by combining scale and setsar: +
    +
    scale='trunc(ih*dar):ih',setsar=1/1
    +
    + +
  • Make pixels square by combining scale and setsar, +making sure the resulting resolution is even (required by some codecs): +
    +
    scale='trunc(ih*dar/2)*2:trunc(ih/2)*2',setsar=1/1
    +
    +
+ +
+
+

11.213.3 Commands

+ +

This filter supports the following commands: +

+
width, w
+
height, h
+

Set the output video dimension expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

11.214 scale_cuda

+ +

Scale (resize) and convert (pixel format) the input video, using accelerated CUDA kernels. +Setting the output width and height works in the same way as for the scale filter. +

+

The filter accepts the following options: +

+
w
+
h
+

Set the output video dimension expression. Default value is the input dimension. +

+

Allows for the same expressions as the scale filter. +

+
+
interp_algo
+

Sets the algorithm used for scaling: +

+
+
nearest
+

Nearest neighbour +

+

Used by default if input parameters match the desired output. +

+
+
bilinear
+

Bilinear +

+
+
bicubic
+

Bicubic +

+

This is the default. +

+
+
lanczos
+

Lanczos +

+
+
+ +
+
format
+

Controls the output pixel format. By default, or if none is specified, the input +pixel format is used. +

+

The filter does not support converting between YUV and RGB pixel formats. +

+
+
passthrough
+

If set to 0, every frame is processed, even if no conversion is neccesary. +This mode can be useful to use the filter as a buffer for a downstream +frame-consumer that exhausts the limited decoder frame pool. +

+

If set to 1, frames are passed through as-is if they match the desired output +parameters. This is the default behaviour. +

+
+
param
+

Algorithm-Specific parameter. +

+

Affects the curves of the bicubic algorithm. +

+
+
force_original_aspect_ratio
+
force_divisible_by
+

Work the same as the identical scale filter options. +

+
+
+ + +
+

11.214.1 Examples

+ +
    +
  • Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p. +
    +
    scale_cuda=-2:720:format=yuv420p
    +
    + +
  • Upscale to 4K using nearest neighbour algorithm. +
    +
    scale_cuda=4096:2160:interp_algo=nearest
    +
    + +
  • Don’t do any conversion or scaling, but copy all input frames into newly allocated ones. +This can be useful to deal with a filter and encode chain that otherwise exhausts the +decoders frame pool. +
    +
    scale_cuda=passthrough=0
    +
    +
+ +
+
+
+

11.215 scale_npp

+ +

Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel +format conversion on CUDA video frames. Setting the output width and height +works in the same way as for the scale filter. +

+

The following additional options are accepted: +

+
format
+

The pixel format of the output CUDA frames. If set to the string "same" (the +default), the input format will be kept. Note that automatic format negotiation +and conversion is not yet supported for hardware frames +

+
+
interp_algo
+

The interpolation algorithm used for resizing. One of the following: +

+
nn
+

Nearest neighbour. +

+
+
linear
+
cubic
+
cubic2p_bspline
+

2-parameter cubic (B=1, C=0) +

+
+
cubic2p_catmullrom
+

2-parameter cubic (B=0, C=1/2) +

+
+
cubic2p_b05c03
+

2-parameter cubic (B=1/2, C=3/10) +

+
+
super
+

Supersampling +

+
+
lanczos
+
+ +
+
force_original_aspect_ratio
+

Enable decreasing or increasing output video width or height if necessary to +keep the original aspect ratio. Possible values: +

+
+
disable
+

Scale the video as specified and disable this feature. +

+
+
decrease
+

The output video dimensions will automatically be decreased if needed. +

+
+
increase
+

The output video dimensions will automatically be increased if needed. +

+
+
+ +

One useful instance of this option is that when you know a specific device’s +maximum allowed resolution, you can use this to limit the output video to +that, while retaining the aspect ratio. For example, device A allows +1280x720 playback, and your video is 1920x800. Using this option (set it to +decrease) and specifying 1280x720 to the command line makes the output +1280x533. +

+

Please note that this is a different thing than specifying -1 for w +or h, you still need to specify the output resolution for this option +to work. +

+
+
force_divisible_by
+

Ensures that both the output dimensions, width and height, are divisible by the +given integer when used together with force_original_aspect_ratio. This +works similar to using -n in the w and h options. +

+

This option respects the value set for force_original_aspect_ratio, +increasing or decreasing the resolution accordingly. The video’s aspect ratio +may be slightly modified. +

+

This option can be handy if you need to have a video fit within or exceed +a defined resolution using force_original_aspect_ratio but also have +encoder restrictions on width or height divisibility. +

+
+
eval
+

Specify when to evaluate width and height expression. It accepts the following values: +

+
+
init
+

Only evaluate expressions once during the filter initialization or when a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+
+ +
+
+ +

The values of the w and h options are expressions +containing the following constants: +

+
+
in_w
+
in_h
+

The input width and height +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (scaled) width and height +

+
+
ow
+
oh
+

These are the same as out_w and out_h +

+
+
a
+

The same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

The input display aspect ratio. Calculated from (iw / ih) * sar. +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +Only available with eval=frame. +

+
+
t
+

The presentation timestamp of the input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
pos
+

The position (byte offset) of the frame in the input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +Deprecated, do not use. +

+
+ +
+
+

11.216 scale2ref

+ +

Scale (resize) the input video, based on a reference video. +

+

See the scale filter for available options, scale2ref supports the same but +uses the reference video instead of the main input as basis. scale2ref also +supports the following additional constants for the w and +h options: +

+
+
main_w
+
main_h
+

The main input video’s width and height +

+
+
main_a
+

The same as main_w / main_h +

+
+
main_sar
+

The main input video’s sample aspect ratio +

+
+
main_dar, mdar
+

The main input video’s display aspect ratio. Calculated from +(main_w / main_h) * main_sar. +

+
+
main_hsub
+
main_vsub
+

The main input video’s horizontal and vertical chroma subsample values. +For example for the pixel format "yuv422p" hsub is 2 and vsub +is 1. +

+
+
main_n
+

The (sequential) number of the main input frame, starting from 0. +Only available with eval=frame. +

+
+
main_t
+

The presentation timestamp of the main input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
main_pos
+

The position (byte offset) of the frame in the main input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +

+
+ + +
+

11.216.1 Examples

+ +
    +
  • Scale a subtitle stream (b) to match the main video (a) in size before overlaying +
    +
    'scale2ref[b][a];[a][b]overlay'
    +
    + +
  • Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio. +
    +
    [logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]
    +
    +
+ +
+
+

11.216.2 Commands

+ +

This filter supports the following commands: +

+
width, w
+
height, h
+

Set the output video dimension expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

11.217 scale2ref_npp

+ +

Use the NVIDIA Performance Primitives (libnpp) to scale (resize) the input +video, based on a reference video. +

+

See the scale_npp filter for available options, scale2ref_npp supports the same +but uses the reference video instead of the main input as basis. scale2ref_npp +also supports the following additional constants for the w and +h options: +

+
+
main_w
+
main_h
+

The main input video’s width and height +

+
+
main_a
+

The same as main_w / main_h +

+
+
main_sar
+

The main input video’s sample aspect ratio +

+
+
main_dar, mdar
+

The main input video’s display aspect ratio. Calculated from +(main_w / main_h) * main_sar. +

+
+
main_n
+

The (sequential) number of the main input frame, starting from 0. +Only available with eval=frame. +

+
+
main_t
+

The presentation timestamp of the main input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
main_pos
+

The position (byte offset) of the frame in the main input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +

+
+ + +
+

11.217.1 Examples

+ +
    +
  • Scale a subtitle stream (b) to match the main video (a) in size before overlaying +
    +
    'scale2ref_npp[b][a];[a][b]overlay_cuda'
    +
    + +
  • Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio. +
    +
    [logo-in][video-in]scale2ref_npp=w=oh*mdar:h=ih/10[logo-out][video-out]
    +
    +
+ +
+
+
+

11.218 scharr

+

Apply scharr operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

11.218.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.219 scroll

+

Scroll input video horizontally and/or vertically by constant speed. +

+

The filter accepts the following options: +

+
horizontal, h
+

Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1. +Negative values changes scrolling direction. +

+
+
vertical, v
+

Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1. +Negative values changes scrolling direction. +

+
+
hpos
+

Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1. +

+
+
vpos
+

Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1. +

+
+ + +
+

11.219.1 Commands

+ +

This filter supports the following commands: +

+
horizontal, h
+

Set the horizontal scrolling speed. +

+
vertical, v
+

Set the vertical scrolling speed. +

+
+ +
+
+
+

11.220 scdet

+ +

Detect video scene change. +

+

This filter sets frame metadata with mafd between frame, the scene score, and +forward the frame to the next filter, so they can use these metadata to detect +scene change or others. +

+

In addition, this filter logs a message and sets frame metadata when it detects +a scene change by threshold. +

+

lavfi.scd.mafd metadata keys are set with mafd for every frame. +

+

lavfi.scd.score metadata keys are set with scene change score for every frame +to detect scene change. +

+

lavfi.scd.time metadata keys are set with current filtered frame time which +detect scene change with threshold. +

+

The filter accepts the following options: +

+
+
threshold, t
+

Set the scene change detection threshold as a percentage of maximum change. Good +values are in the [8.0, 14.0] range. The range for threshold is +[0., 100.]. +

+

Default value is 10.. +

+
+
sc_pass, s
+

Set the flag to pass scene change frames to the next filter. Default value is 0 +You can enable it if you want to get snapshot of scene change frames only. +

+
+ +
+
+

11.221 selectivecolor

+ +

Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such +as "reds", "yellows", "greens", "cyans", ...). The adjustment range is defined +by the "purity" of the color (that is, how saturated it already is). +

+

This filter is similar to the Adobe Photoshop Selective Color tool. +

+

The filter accepts the following options: +

+
+
correction_method
+

Select color correction method. +

+

Available values are: +

+
absolute
+

Specified adjustments are applied "as-is" (added/subtracted to original pixel +component value). +

+
relative
+

Specified adjustments are relative to the original component value. +

+
+

Default is absolute. +

+
reds
+

Adjustments for red pixels (pixels where the red component is the maximum) +

+
yellows
+

Adjustments for yellow pixels (pixels where the blue component is the minimum) +

+
greens
+

Adjustments for green pixels (pixels where the green component is the maximum) +

+
cyans
+

Adjustments for cyan pixels (pixels where the red component is the minimum) +

+
blues
+

Adjustments for blue pixels (pixels where the blue component is the maximum) +

+
magentas
+

Adjustments for magenta pixels (pixels where the green component is the minimum) +

+
whites
+

Adjustments for white pixels (pixels where all components are greater than 128) +

+
neutrals
+

Adjustments for all pixels except pure black and pure white +

+
blacks
+

Adjustments for black pixels (pixels where all components are lesser than 128) +

+
psfile
+

Specify a Photoshop selective color file (.asv) to import the settings from. +

+
+ +

All the adjustment settings (reds, yellows, ...) accept up to +4 space separated floating point adjustment values in the [-1,1] range, +respectively to adjust the amount of cyan, magenta, yellow and black for the +pixels of its range. +

+ +
+

11.221.1 Examples

+ +
    +
  • Increase cyan by 50% and reduce yellow by 33% in every green areas, and +increase magenta by 27% in blue areas: +
    +
    selectivecolor=greens=.5 0 -.33 0:blues=0 .27
    +
    + +
  • Use a Photoshop selective color preset: +
    +
    selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
    +
    +
+ +
+
+
+

11.222 separatefields

+ +

The separatefields takes a frame-based video input and splits +each frame into its components fields, producing a new half height clip +with twice the frame rate and twice the frame count. +

+

This filter use field-dominance information in frame to decide which +of each pair of fields to place first in the output. +If it gets it wrong use setfield filter before separatefields filter. +

+
+
+

11.223 setdar, setsar

+ +

The setdar filter sets the Display Aspect Ratio for the filter +output video. +

+

This is done by changing the specified Sample (aka Pixel) Aspect +Ratio, according to the following equation: +

+
DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR
+
+ +

Keep in mind that the setdar filter does not modify the pixel +dimensions of the video frame. Also, the display aspect ratio set by +this filter may be changed by later filters in the filterchain, +e.g. in case of scaling or if another "setdar" or a "setsar" filter is +applied. +

+

The setsar filter sets the Sample (aka Pixel) Aspect Ratio for +the filter output video. +

+

Note that as a consequence of the application of this filter, the +output display aspect ratio will change according to the equation +above. +

+

Keep in mind that the sample aspect ratio set by the setsar +filter may be changed by later filters in the filterchain, e.g. if +another "setsar" or a "setdar" filter is applied. +

+

It accepts the following parameters: +

+
+
r, ratio, dar (setdar only), sar (setsar only)
+

Set the aspect ratio used by the filter. +

+

The parameter can be a floating point number string, or an expression. If the +parameter is not specified, the value "0" is assumed, meaning that the same +input value is used. +

+
+
max
+

Set the maximum integer value to use for expressing numerator and +denominator when reducing the expressed aspect ratio to a rational. +Default value is 100. +

+
+
+ +

The parameter sar is an expression containing the following constants: +

+
+
w, h
+

The input width and height. +

+
+
a
+

Same as w / h. +

+
+
sar
+

The input sample aspect ratio. +

+
+
dar
+

The input display aspect ratio. It is the same as +(w / h) * sar. +

+
+
hsub, vsub
+

Horizontal and vertical chroma subsample values. For example, for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ + +
+

11.223.1 Examples

+ +
    +
  • To change the display aspect ratio to 16:9, specify one of the following: +
    +
    setdar=dar=1.77777
    +setdar=dar=16/9
    +
    + +
  • To change the sample aspect ratio to 10:11, specify: +
    +
    setsar=sar=10/11
    +
    + +
  • To set a display aspect ratio of 16:9, and specify a maximum integer value of +1000 in the aspect ratio reduction, use the command: +
    +
    setdar=ratio=16/9:max=1000
    +
    + +
+ +
+
+
+

11.224 setfield

+ +

Force field for the output video frame. +

+

The setfield filter marks the interlace type field for the +output frames. It does not change the input frame, but only sets the +corresponding property, which affects how the frame is treated by +following filters (e.g. fieldorder or yadif). +

+

The filter accepts the following options: +

+
+
mode
+

Available values are: +

+
+
auto
+

Keep the same field property. +

+
+
bff
+

Mark the frame as bottom-field-first. +

+
+
tff
+

Mark the frame as top-field-first. +

+
+
prog
+

Mark the frame as progressive. +

+
+
+
+ +
+
+

11.225 setparams

+ +

Force frame parameter for the output video frame. +

+

The setparams filter marks interlace and color range for the +output frames. It does not change the input frame, but only sets the +corresponding property, which affects how the frame is treated by +filters/encoders. +

+
+
field_mode
+

Available values are: +

+
+
auto
+

Keep the same field property (default). +

+
+
bff
+

Mark the frame as bottom-field-first. +

+
+
tff
+

Mark the frame as top-field-first. +

+
+
prog
+

Mark the frame as progressive. +

+
+ +
+
range
+

Available values are: +

+
+
auto
+

Keep the same color range property (default). +

+
+
unspecified, unknown
+

Mark the frame as unspecified color range. +

+
+
limited, tv, mpeg
+

Mark the frame as limited range. +

+
+
full, pc, jpeg
+

Mark the frame as full range. +

+
+ +
+
color_primaries
+

Set the color primaries. +Available values are: +

+
+
auto
+

Keep the same color primaries property (default). +

+
+
bt709
+
unknown
+
bt470m
+
bt470bg
+
smpte170m
+
smpte240m
+
film
+
bt2020
+
smpte428
+
smpte431
+
smpte432
+
jedec-p22
+
+ +
+
color_trc
+

Set the color transfer. +Available values are: +

+
+
auto
+

Keep the same color trc property (default). +

+
+
bt709
+
unknown
+
bt470m
+
bt470bg
+
smpte170m
+
smpte240m
+
linear
+
log100
+
log316
+
iec61966-2-4
+
bt1361e
+
iec61966-2-1
+
bt2020-10
+
bt2020-12
+
smpte2084
+
smpte428
+
arib-std-b67
+
+ +
+
colorspace
+

Set the colorspace. +Available values are: +

+
+
auto
+

Keep the same colorspace property (default). +

+
+
gbr
+
bt709
+
unknown
+
fcc
+
bt470bg
+
smpte170m
+
smpte240m
+
ycgco
+
bt2020nc
+
bt2020c
+
smpte2085
+
chroma-derived-nc
+
chroma-derived-c
+
ictcp
+
+
+
+ +
+
+

11.226 sharpen_npp

+

Use the NVIDIA Performance Primitives (libnpp) to perform image sharpening with +border control. +

+

The following additional options are accepted: +

+
border_type
+

Type of sampling to be used ad frame borders. One of the following: +

+
replicate
+

Replicate pixel values. +

+
+
+
+
+ +
+
+

11.227 shear

+

Apply shear transform to input video. +

+

This filter supports the following options: +

+
+
shx
+

Shear factor in X-direction. Default value is 0. +Allowed range is from -2 to 2. +

+
+
shy
+

Shear factor in Y-direction. Default value is 0. +Allowed range is from -2 to 2. +

+
+
fillcolor, c
+

Set the color used to fill the output area not covered by the transformed +video. For the general syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +If the special value "none" is selected then no +background is printed (useful for example if the background is never shown). +

+

Default value is "black". +

+
+
interp
+

Set interpolation type. Can be bilinear or nearest. Default is bilinear. +

+
+ + +
+

11.227.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.228 showinfo

+ +

Show a line containing various information for each input video frame. +The input video is not modified. +

+

This filter supports the following options: +

+
+
checksum
+

Calculate checksums of each plane. By default enabled. +

+
+ +

The shown line contains a sequence of key/value pairs of the form +key:value. +

+

The following values are shown in the output: +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +

+
+
pts
+

The Presentation TimeStamp of the input frame, expressed as a number of +time base units. The time base unit depends on the filter input pad. +

+
+
pts_time
+

The Presentation TimeStamp of the input frame, expressed as a number of +seconds. +

+
+
fmt
+

The pixel format name. +

+
+
sar
+

The sample aspect ratio of the input frame, expressed in the form +num/den. +

+
+
s
+

The size of the input frame. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
i
+

The type of interlaced mode ("P" for "progressive", "T" for top field first, "B" +for bottom field first). +

+
+
iskey
+

This is 1 if the frame is a key frame, 0 otherwise. +

+
+
type
+

The picture type of the input frame ("I" for an I-frame, "P" for a +P-frame, "B" for a B-frame, or "?" for an unknown type). +Also refer to the documentation of the AVPictureType enum and of +the av_get_picture_type_char function defined in +libavutil/avutil.h. +

+
+
checksum
+

The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame. +

+
+
plane_checksum
+

The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame, +expressed in the form "[c0 c1 c2 c3]". +

+
+
mean
+

The mean value of pixels in each plane of the input frame, expressed in the form +"[mean0 mean1 mean2 mean3]". +

+
+
stdev
+

The standard deviation of pixel values in each plane of the input frame, expressed +in the form "[stdev0 stdev1 stdev2 stdev3]". +

+
+
+ +
+
+

11.229 showpalette

+ +

Displays the 256 colors palette of each frame. This filter is only relevant for +pal8 pixel format frames. +

+

It accepts the following option: +

+
+
s
+

Set the size of the box used to represent one palette color entry. Default is +30 (for a 30x30 pixel box). +

+
+ +
+
+

11.230 shuffleframes

+ +

Reorder and/or duplicate and/or drop video frames. +

+

It accepts the following parameters: +

+
+
mapping
+

Set the destination indexes of input frames. +This is space or ’|’ separated list of indexes that maps input frames to output +frames. Number of indexes also sets maximal value that each index may have. +’-1’ index have special meaning and that is to drop frame. +

+
+ +

The first frame has the index 0. The default is to keep the input unchanged. +

+ +
+

11.230.1 Examples

+ +
    +
  • Swap second and third frame of every three frames of the input: +
    +
    ffmpeg -i INPUT -vf "shuffleframes=0 2 1" OUTPUT
    +
    + +
  • Swap 10th and 1st frame of every ten frames of the input: +
    +
    ffmpeg -i INPUT -vf "shuffleframes=9 1 2 3 4 5 6 7 8 0" OUTPUT
    +
    +
+ +
+
+
+

11.231 shufflepixels

+ +

Reorder pixels in video frames. +

+

This filter accepts the following options: +

+
+
direction, d
+

Set shuffle direction. Can be forward or inverse direction. +Default direction is forward. +

+
+
mode, m
+

Set shuffle mode. Can be horizontal, vertical or block mode. +

+
+
width, w
+
height, h
+

Set shuffle block_size. In case of horizontal shuffle mode only width +part of size is used, and in case of vertical shuffle mode only height +part of size is used. +

+
+
seed, s
+

Set random seed used with shuffling pixels. Mainly useful to set to be able +to reverse filtering process to get original input. +For example, to reverse forward shuffle you need to use same parameters +and exact same seed and to set direction to inverse. +

+
+ +
+
+

11.232 shuffleplanes

+ +

Reorder and/or duplicate video planes. +

+

It accepts the following parameters: +

+
+
map0
+

The index of the input plane to be used as the first output plane. +

+
+
map1
+

The index of the input plane to be used as the second output plane. +

+
+
map2
+

The index of the input plane to be used as the third output plane. +

+
+
map3
+

The index of the input plane to be used as the fourth output plane. +

+
+
+ +

The first plane has the index 0. The default is to keep the input unchanged. +

+ +
+

11.232.1 Examples

+ +
    +
  • Swap the second and third planes of the input: +
    +
    ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
    +
    +
+ +
+
+
+

11.233 signalstats

+

Evaluate various visual metrics that assist in determining issues associated +with the digitization of analog video media. +

+

By default the filter will log these metadata values: +

+
+
YMIN
+

Display the minimal Y value contained within the input frame. Expressed in +range of [0-255]. +

+
+
YLOW
+

Display the Y value at the 10% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
YAVG
+

Display the average Y value within the input frame. Expressed in range of +[0-255]. +

+
+
YHIGH
+

Display the Y value at the 90% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
YMAX
+

Display the maximum Y value contained within the input frame. Expressed in +range of [0-255]. +

+
+
UMIN
+

Display the minimal U value contained within the input frame. Expressed in +range of [0-255]. +

+
+
ULOW
+

Display the U value at the 10% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
UAVG
+

Display the average U value within the input frame. Expressed in range of +[0-255]. +

+
+
UHIGH
+

Display the U value at the 90% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
UMAX
+

Display the maximum U value contained within the input frame. Expressed in +range of [0-255]. +

+
+
VMIN
+

Display the minimal V value contained within the input frame. Expressed in +range of [0-255]. +

+
+
VLOW
+

Display the V value at the 10% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
VAVG
+

Display the average V value within the input frame. Expressed in range of +[0-255]. +

+
+
VHIGH
+

Display the V value at the 90% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
VMAX
+

Display the maximum V value contained within the input frame. Expressed in +range of [0-255]. +

+
+
SATMIN
+

Display the minimal saturation value contained within the input frame. +Expressed in range of [0-~181.02]. +

+
+
SATLOW
+

Display the saturation value at the 10% percentile within the input frame. +Expressed in range of [0-~181.02]. +

+
+
SATAVG
+

Display the average saturation value within the input frame. Expressed in range +of [0-~181.02]. +

+
+
SATHIGH
+

Display the saturation value at the 90% percentile within the input frame. +Expressed in range of [0-~181.02]. +

+
+
SATMAX
+

Display the maximum saturation value contained within the input frame. +Expressed in range of [0-~181.02]. +

+
+
HUEMED
+

Display the median value for hue within the input frame. Expressed in range of +[0-360]. +

+
+
HUEAVG
+

Display the average value for hue within the input frame. Expressed in range of +[0-360]. +

+
+
YDIF
+

Display the average of sample value difference between all values of the Y +plane in the current frame and corresponding values of the previous input frame. +Expressed in range of [0-255]. +

+
+
UDIF
+

Display the average of sample value difference between all values of the U +plane in the current frame and corresponding values of the previous input frame. +Expressed in range of [0-255]. +

+
+
VDIF
+

Display the average of sample value difference between all values of the V +plane in the current frame and corresponding values of the previous input frame. +Expressed in range of [0-255]. +

+
+
YBITDEPTH
+

Display bit depth of Y plane in current frame. +Expressed in range of [0-16]. +

+
+
UBITDEPTH
+

Display bit depth of U plane in current frame. +Expressed in range of [0-16]. +

+
+
VBITDEPTH
+

Display bit depth of V plane in current frame. +Expressed in range of [0-16]. +

+
+ +

The filter accepts the following options: +

+
+
stat
+
out
+
+

stat specify an additional form of image analysis. +out output video with the specified type of pixel highlighted. +

+

Both options accept the following values: +

+
+
tout
+

Identify temporal outliers pixels. A temporal outlier is a pixel +unlike the neighboring pixels of the same field. Examples of temporal outliers +include the results of video dropouts, head clogs, or tape tracking issues. +

+
+
vrep
+

Identify vertical line repetition. Vertical line repetition includes +similar rows of pixels within a frame. In born-digital video vertical line +repetition is common, but this pattern is uncommon in video digitized from an +analog source. When it occurs in video that results from the digitization of an +analog source it can indicate concealment from a dropout compensator. +

+
+
brng
+

Identify pixels that fall outside of legal broadcast range. +

+
+ +
+
color, c
+

Set the highlight color for the out option. The default color is +yellow. +

+
+ + +
+

11.233.1 Examples

+ +
    +
  • Output data of various video metrics: +
    +
    ffprobe -f lavfi movie=example.mov,signalstats="stat=tout+vrep+brng" -show_frames
    +
    + +
  • Output specific data about the minimum and maximum values of the Y plane per frame: +
    +
    ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
    +
    + +
  • Playback video while highlighting pixels that are outside of broadcast range in red. +
    +
    ffplay example.mov -vf signalstats="out=brng:color=red"
    +
    + +
  • Playback video with signalstats metadata drawn over the frame. +
    +
    ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
    +
    + +

    The contents of signalstat_drawtext.txt used in the command are: +

    +
    time %{pts:hms}
    +Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
    +U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
    +V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
    +saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
    +
    +
    +
+ +
+
+
+

11.234 signature

+ +

Calculates the MPEG-7 Video Signature. The filter can handle more than one +input. In this case the matching between the inputs can be calculated additionally. +The filter always passes through the first input. The signature of each stream can +be written into a file. +

+

It accepts the following options: +

+
+
detectmode
+

Enable or disable the matching process. +

+

Available values are: +

+
+
off
+

Disable the calculation of a matching (default). +

+
full
+

Calculate the matching for the whole video and output whether the whole video +matches or only parts. +

+
fast
+

Calculate only until a matching is found or the video ends. Should be faster in +some cases. +

+
+ +
+
nb_inputs
+

Set the number of inputs. The option value must be a non negative integer. +Default value is 1. +

+
+
filename
+

Set the path to which the output is written. If there is more than one input, +the path must be a prototype, i.e. must contain %d or %0nd (where n is a positive +integer), that will be replaced with the input number. If no filename is +specified, no output will be written. This is the default. +

+
+
format
+

Choose the output format. +

+

Available values are: +

+
+
binary
+

Use the specified binary representation (default). +

+
xml
+

Use the specified xml representation. +

+
+ +
+
th_d
+

Set threshold to detect one word as similar. The option value must be an integer +greater than zero. The default value is 9000. +

+
+
th_dc
+

Set threshold to detect all words as similar. The option value must be an integer +greater than zero. The default value is 60000. +

+
+
th_xh
+

Set threshold to detect frames as similar. The option value must be an integer +greater than zero. The default value is 116. +

+
+
th_di
+

Set the minimum length of a sequence in frames to recognize it as matching +sequence. The option value must be a non negative integer value. +The default value is 0. +

+
+
th_it
+

Set the minimum relation, that matching frames to all frames must have. +The option value must be a double value between 0 and 1. The default value is 0.5. +

+
+ + +
+

11.234.1 Examples

+ +
    +
  • To calculate the signature of an input video and store it in signature.bin: +
    +
    ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
    +
    + +
  • To detect whether two videos match and store the signatures in XML format in +signature0.xml and signature1.xml: +
    +
    ffmpeg -i input1.mkv -i input2.mkv -filter_complex "[0:v][1:v] signature=nb_inputs=2:detectmode=full:format=xml:filename=signature%d.xml" -map :v -f null -
    +
    + +
+ +
+
+
+

11.235 siti

+ +

Calculate Spatial Information (SI) and Temporal Information (TI) scores for a video, +as defined in ITU-T Rec. P.910 (11/21): Subjective video quality assessment methods +for multimedia applications. Available PDF at https://www.itu.int/rec/T-REC-P.910-202111-S/en. +Note that this is a legacy implementation that corresponds to a superseded recommendation. +Refer to ITU-T Rec. P.910 (07/22) for the latest version: https://www.itu.int/rec/T-REC-P.910-202207-I/en +

+

It accepts the following option: +

+
+
print_summary
+

If set to 1, Summary statistics will be printed to the console. Default 0. +

+
+ + +
+

11.235.1 Examples

+
    +
  • To calculate SI/TI metrics and print summary: +
    +
    ffmpeg -i input.mp4 -vf siti=print_summary=1 -f null -
    +
    +
+ +
+
+
+

11.236 smartblur

+ +

Blur the input video without impacting the outlines. +

+

It accepts the following options: +

+
+
luma_radius, lr
+

Set the luma radius. The option value must be a float number in +the range [0.1,5.0] that specifies the variance of the gaussian filter +used to blur the image (slower if larger). Default value is 1.0. +

+
+
luma_strength, ls
+

Set the luma strength. The option value must be a float number +in the range [-1.0,1.0] that configures the blurring. A value included +in [0.0,1.0] will blur the image whereas a value included in +[-1.0,0.0] will sharpen the image. Default value is 1.0. +

+
+
luma_threshold, lt
+

Set the luma threshold used as a coefficient to determine +whether a pixel should be blurred or not. The option value must be an +integer in the range [-30,30]. A value of 0 will filter all the image, +a value included in [0,30] will filter flat areas and a value included +in [-30,0] will filter edges. Default value is 0. +

+
+
chroma_radius, cr
+

Set the chroma radius. The option value must be a float number in +the range [0.1,5.0] that specifies the variance of the gaussian filter +used to blur the image (slower if larger). Default value is luma_radius. +

+
+
chroma_strength, cs
+

Set the chroma strength. The option value must be a float number +in the range [-1.0,1.0] that configures the blurring. A value included +in [0.0,1.0] will blur the image whereas a value included in +[-1.0,0.0] will sharpen the image. Default value is luma_strength. +

+
+
chroma_threshold, ct
+

Set the chroma threshold used as a coefficient to determine +whether a pixel should be blurred or not. The option value must be an +integer in the range [-30,30]. A value of 0 will filter all the image, +a value included in [0,30] will filter flat areas and a value included +in [-30,0] will filter edges. Default value is luma_threshold. +

+
+ +

If a chroma option is not explicitly set, the corresponding luma value +is set. +

+
+
+

11.237 sobel

+

Apply sobel operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

11.237.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.238 spp

+ +

Apply a simple postprocessing filter that compresses and decompresses the image +at several (or - in the case of quality level 6 - all) shifts +and average the results. +

+

The filter accepts the following options: +

+
+
quality
+

Set quality. This option defines the number of levels for averaging. It accepts +an integer in the range 0-6. If set to 0, the filter will have no +effect. A value of 6 means the higher quality. For each increment of +that value the speed drops by a factor of approximately 2. Default value is +3. +

+
+
qp
+

Force a constant quantization parameter. If not set, the filter will use the QP +from the video stream (if available). +

+
+
mode
+

Set thresholding mode. Available modes are: +

+
+
hard
+

Set hard thresholding (default). +

+
soft
+

Set soft thresholding (better de-ringing effect, but likely blurrier). +

+
+ +
+
use_bframe_qp
+

Enable the use of the QP from the B-Frames if set to 1. Using this +option may cause flicker since the B-Frames have often larger QP. Default is +0 (not enabled). +

+
+ + +
+

11.238.1 Commands

+ +

This filter supports the following commands: +

+
quality, level
+

Set quality level. The value max can be used to set the maximum level, +currently 6. +

+
+ +
+
+
+

11.239 sr

+ +

Scale the input by applying one of the super-resolution methods based on +convolutional neural networks. Supported models: +

+ + +

Training scripts as well as scripts for model file (.pb) saving can be found at +https://github.com/XueweiMeng/sr/tree/sr_dnn_native. Original repository +is at https://github.com/HighVoltageRocknRoll/sr.git. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +the following values: +

+
+
tensorflow
+

TensorFlow backend. To enable this backend you +need to install the TensorFlow for C library (see +https://www.tensorflow.org/install/lang_c) and configure FFmpeg with +--enable-libtensorflow +

+
+ +
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. TensorFlow, OpenVINO backend +can load files for only its format. +

+
+
scale_factor
+

Set scale factor for SRCNN model. Allowed values are 2, 3 and 4. +Default value is 2. Scale factor is necessary for SRCNN model, because it accepts +input upscaled using bicubic upscaling with proper scale factor. +

+
+ +

To get full functionality (such as async execution), please use the dnn_processing filter. +

+
+
+

11.240 ssim

+ +

Obtain the SSIM (Structural SImilarity Metric) between two input videos. +

+

This filter takes in input two input videos, the first input is +considered the "main" source and is passed unchanged to the +output. The second input is used as a "reference" video for computing +the SSIM. +

+

Both video inputs must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The filter stores the calculated SSIM of each frame. +

+

The description of the accepted parameters follows. +

+
+
stats_file, f
+

If specified the filter will use the named file to save the SSIM of +each individual frame. When filename equals "-" the data is sent to +standard output. +

+
+ +

The file printed if stats_file is selected, contains a sequence of +key/value pairs of the form key:value for each compared +couple of frames. +

+

A description of each shown parameter follows: +

+
+
n
+

sequential number of the input frame, starting from 1 +

+
+
Y, U, V, R, G, B
+

SSIM of the compared frames for the component specified by the suffix. +

+
+
All
+

SSIM of the compared frames for the whole frame. +

+
+
dB
+

Same as above but in dB representation. +

+
+ +

This filter also supports the framesync options. +

+ +
+

11.240.1 Examples

+
    +
  • For example: +
    +
    movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
    +[main][ref] ssim="stats_file=stats.log" [out]
    +
    + +

    On this example the input file being processed is compared with the +reference file ref_movie.mpg. The SSIM of each individual frame +is stored in stats.log. +

    +
  • Another example with both psnr and ssim at same time: +
    +
    ffmpeg -i main.mpg -i ref.mpg -lavfi  "ssim;[0:v][1:v]psnr" -f null -
    +
    + +
  • Another example with different containers: +
    +
    ffmpeg -i main.mpg -i ref.mkv -lavfi  "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]ssim" -f null -
    +
    +
+ +
+
+
+

11.241 stereo3d

+ +

Convert between different stereoscopic image formats. +

+

The filters accept the following options: +

+
+
in
+

Set stereoscopic image format of input. +

+

Available values for input image formats are: +

+
sbsl
+

side by side parallel (left eye left, right eye right) +

+
+
sbsr
+

side by side crosseye (right eye left, left eye right) +

+
+
sbs2l
+

side by side parallel with half width resolution +(left eye left, right eye right) +

+
+
sbs2r
+

side by side crosseye with half width resolution +(right eye left, left eye right) +

+
+
abl
+
tbl
+

above-below (left eye above, right eye below) +

+
+
abr
+
tbr
+

above-below (right eye above, left eye below) +

+
+
ab2l
+
tb2l
+

above-below with half height resolution +(left eye above, right eye below) +

+
+
ab2r
+
tb2r
+

above-below with half height resolution +(right eye above, left eye below) +

+
+
al
+

alternating frames (left eye first, right eye second) +

+
+
ar
+

alternating frames (right eye first, left eye second) +

+
+
irl
+

interleaved rows (left eye has top row, right eye starts on next row) +

+
+
irr
+

interleaved rows (right eye has top row, left eye starts on next row) +

+
+
icl
+

interleaved columns, left eye first +

+
+
icr
+

interleaved columns, right eye first +

+

Default value is ‘sbsl’. +

+
+ +
+
out
+

Set stereoscopic image format of output. +

+
+
sbsl
+

side by side parallel (left eye left, right eye right) +

+
+
sbsr
+

side by side crosseye (right eye left, left eye right) +

+
+
sbs2l
+

side by side parallel with half width resolution +(left eye left, right eye right) +

+
+
sbs2r
+

side by side crosseye with half width resolution +(right eye left, left eye right) +

+
+
abl
+
tbl
+

above-below (left eye above, right eye below) +

+
+
abr
+
tbr
+

above-below (right eye above, left eye below) +

+
+
ab2l
+
tb2l
+

above-below with half height resolution +(left eye above, right eye below) +

+
+
ab2r
+
tb2r
+

above-below with half height resolution +(right eye above, left eye below) +

+
+
al
+

alternating frames (left eye first, right eye second) +

+
+
ar
+

alternating frames (right eye first, left eye second) +

+
+
irl
+

interleaved rows (left eye has top row, right eye starts on next row) +

+
+
irr
+

interleaved rows (right eye has top row, left eye starts on next row) +

+
+
arbg
+

anaglyph red/blue gray +(red filter on left eye, blue filter on right eye) +

+
+
argg
+

anaglyph red/green gray +(red filter on left eye, green filter on right eye) +

+
+
arcg
+

anaglyph red/cyan gray +(red filter on left eye, cyan filter on right eye) +

+
+
arch
+

anaglyph red/cyan half colored +(red filter on left eye, cyan filter on right eye) +

+
+
arcc
+

anaglyph red/cyan color +(red filter on left eye, cyan filter on right eye) +

+
+
arcd
+

anaglyph red/cyan color optimized with the least squares projection of dubois +(red filter on left eye, cyan filter on right eye) +

+
+
agmg
+

anaglyph green/magenta gray +(green filter on left eye, magenta filter on right eye) +

+
+
agmh
+

anaglyph green/magenta half colored +(green filter on left eye, magenta filter on right eye) +

+
+
agmc
+

anaglyph green/magenta colored +(green filter on left eye, magenta filter on right eye) +

+
+
agmd
+

anaglyph green/magenta color optimized with the least squares projection of dubois +(green filter on left eye, magenta filter on right eye) +

+
+
aybg
+

anaglyph yellow/blue gray +(yellow filter on left eye, blue filter on right eye) +

+
+
aybh
+

anaglyph yellow/blue half colored +(yellow filter on left eye, blue filter on right eye) +

+
+
aybc
+

anaglyph yellow/blue colored +(yellow filter on left eye, blue filter on right eye) +

+
+
aybd
+

anaglyph yellow/blue color optimized with the least squares projection of dubois +(yellow filter on left eye, blue filter on right eye) +

+
+
ml
+

mono output (left eye only) +

+
+
mr
+

mono output (right eye only) +

+
+
chl
+

checkerboard, left eye first +

+
+
chr
+

checkerboard, right eye first +

+
+
icl
+

interleaved columns, left eye first +

+
+
icr
+

interleaved columns, right eye first +

+
+
hdmi
+

HDMI frame pack +

+
+ +

Default value is ‘arcd’. +

+
+ + +
+

11.241.1 Examples

+ +
    +
  • Convert input video from side by side parallel to anaglyph yellow/blue dubois: +
    +
    stereo3d=sbsl:aybd
    +
    + +
  • Convert input video from above below (left eye above, right eye below) to side by side crosseye. +
    +
    stereo3d=abl:sbsr
    +
    +
+ +
+
+
+

11.242 streamselect, astreamselect

+

Select video or audio streams. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of inputs. Default is 2. +

+
+
map
+

Set input indexes to remap to outputs. +

+
+ + +
+

11.242.1 Commands

+ +

The streamselect and astreamselect filter supports the following +commands: +

+
+
map
+

Set input indexes to remap to outputs. +

+
+ +
+
+

11.242.2 Examples

+ +
    +
  • Select first 5 seconds 1st stream and rest of time 2nd stream: +
    +
    sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
    +
    + +
  • Same as above, but for audio: +
    +
    asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
    +
    +
+ +
+
+
+

11.243 subtitles

+ +

Draw subtitles on top of input video using the libass library. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libass. This filter also requires a build with libavcodec and +libavformat to convert the passed subtitles file to ASS (Advanced Substation +Alpha) subtitles format. +

+

The filter accepts the following options: +

+
+
filename, f
+

Set the filename of the subtitle file to read. It must be specified. +

+
+
original_size
+

Specify the size of the original video, the video for which the ASS file +was composed. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to +correctly scale the fonts if the aspect ratio has been changed. +

+
+
fontsdir
+

Set a directory path containing fonts that can be used by the filter. +These fonts will be used in addition to whatever the font provider uses. +

+
+
alpha
+

Process alpha channel, by default alpha channel is untouched. +

+
+
charenc
+

Set subtitles input character encoding. subtitles filter only. Only +useful if not UTF-8. +

+
+
stream_index, si
+

Set subtitles stream index. subtitles filter only. +

+
+
force_style
+

Override default style or script info parameters of the subtitles. It accepts a +string containing ASS style format KEY=VALUE couples separated by ",". +

+
+ +

If the first key is not specified, it is assumed that the first value +specifies the filename. +

+

For example, to render the file sub.srt on top of the input +video, use the command: +

+
subtitles=sub.srt
+
+ +

which is equivalent to: +

+
subtitles=filename=sub.srt
+
+ +

To render the default subtitles stream from file video.mkv, use: +

+
subtitles=video.mkv
+
+ +

To render the second subtitles stream from that file, use: +

+
subtitles=video.mkv:si=1
+
+ +

To make the subtitles stream from sub.srt appear in 80% transparent blue +DejaVu Serif, use: +

+
subtitles=sub.srt:force_style='Fontname=DejaVu Serif,PrimaryColour=&HCCFF0000'
+
+ +
+
+

11.244 super2xsai

+ +

Scale the input by 2x and smooth using the Super2xSaI (Scale and +Interpolate) pixel art scaling algorithm. +

+

Useful for enlarging pixel art images without reducing sharpness. +

+
+
+

11.245 swaprect

+ +

Swap two rectangular objects in video. +

+

This filter accepts the following options: +

+
+
w
+

Set object width. +

+
+
h
+

Set object height. +

+
+
x1
+

Set 1st rect x coordinate. +

+
+
y1
+

Set 1st rect y coordinate. +

+
+
x2
+

Set 2nd rect x coordinate. +

+
+
y2
+

Set 2nd rect y coordinate. +

+

All expressions are evaluated once for each frame. +

+
+ +

The all options are expressions containing the following constants: +

+
+
w
+
h
+

The input width and height. +

+
+
a
+

same as w / h +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (w / h) * sar +

+
+
n
+

The number of the input frame, starting from 0. +

+
+
t
+

The timestamp expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, +do not use +

+
+ + +
+

11.245.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.246 swapuv

+

Swap U & V plane. +

+
+
+

11.247 tblend

+

Blend successive video frames. +

+

See blend +

+
+
+

11.248 telecine

+ +

Apply telecine process to the video. +

+

This filter accepts the following options: +

+
+
first_field
+
+
top, t
+

top field first +

+
bottom, b
+

bottom field first +The default value is top. +

+
+ +
+
pattern
+

A string of numbers representing the pulldown pattern you wish to apply. +The default value is 23. +

+
+ +
+
Some typical patterns:
+
+NTSC output (30i):
+27.5p: 32222
+24p: 23 (classic)
+24p: 2332 (preferred)
+20p: 33
+18p: 334
+16p: 3444
+
+PAL output (25i):
+27.5p: 12222
+24p: 222222222223 ("Euro pulldown")
+16.67p: 33
+16p: 33333334
+
+ +
+
+

11.249 thistogram

+ +

Compute and draw a color distribution histogram for the input video across time. +

+

Unlike histogram video filter which only shows histogram of single input frame +at certain time, this filter shows also past histograms of number of frames defined +by width option. +

+

The computed histogram is a representation of the color component +distribution in an image. +

+

The filter accepts the following options: +

+
+
width, w
+

Set width of single color component output. Default value is 0. +Value of 0 means width will be picked from input video. +This also set number of passed histograms to keep. +Allowed range is [0, 8192]. +

+
+
display_mode, d
+

Set display mode. +It accepts the following values: +

+
stack
+

Per color component graphs are placed below each other. +

+
+
parade
+

Per color component graphs are placed side by side. +

+
+
overlay
+

Presents information identical to that in the parade, except +that the graphs representing color components are superimposed directly +over one another. +

+
+

Default is stack. +

+
+
levels_mode, m
+

Set mode. Can be either linear, or logarithmic. +Default is linear. +

+
+
components, c
+

Set what color components to display. +Default is 7. +

+
+
bgopacity, b
+

Set background opacity. Default is 0.9. +

+
+
envelope, e
+

Show envelope. Default is disabled. +

+
+
ecolor, ec
+

Set envelope color. Default is gold. +

+
+
slide
+

Set slide mode. +

+

Available values for slide is: +

+
frame
+

Draw new frame when right border is reached. +

+
+
replace
+

Replace old columns with new ones. +

+
+
scroll
+

Scroll from right to left. +

+
+
rscroll
+

Scroll from left to right. +

+
+
picture
+

Draw single picture. +

+
+ +

Default is replace. +

+
+ +
+
+

11.250 threshold

+ +

Apply threshold effect to video stream. +

+

This filter needs four video streams to perform thresholding. +First stream is stream we are filtering. +Second stream is holding threshold values, third stream is holding min values, +and last, fourth stream is holding max values. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+ +

For example if first stream pixel’s component value is less then threshold value +of pixel component from 2nd threshold stream, third stream value will picked, +otherwise fourth stream pixel component value will be picked. +

+

Using color source filter one can perform various types of thresholding: +

+ +
+

11.250.1 Commands

+ +

This filter supports the all options as commands. +

+
+
+

11.250.2 Examples

+ +
    +
  • Binary threshold, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=black -f lavfi -i color=white -lavfi threshold output.avi
    +
    + +
  • Inverted binary threshold, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -f lavfi -i color=black -lavfi threshold output.avi
    +
    + +
  • Truncate binary threshold, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=gray -lavfi threshold output.avi
    +
    + +
  • Threshold to zero, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -i 320x240.avi -lavfi threshold output.avi
    +
    + +
  • Inverted threshold to zero, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=white -lavfi threshold output.avi
    +
    +
+ +
+
+
+

11.251 thumbnail

+

Select the most representative frame in a given sequence of consecutive frames. +

+

The filter accepts the following options: +

+
+
n
+

Set the frames batch size to analyze; in a set of n frames, the filter +will pick one of them, and then handle the next batch of n frames until +the end. Default is 100. +

+
+
log
+

Set the log level to display picked frame stats. +Default is info. +

+
+ +

Since the filter keeps track of the whole frames sequence, a bigger n +value will result in a higher memory usage, so a high value is not recommended. +

+ +
+

11.251.1 Examples

+ +
    +
  • Extract one picture each 50 frames: +
    +
    thumbnail=50
    +
    + +
  • Complete example of a thumbnail creation with ffmpeg: +
    +
    ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
    +
    +
+ +
+
+
+

11.252 tile

+ +

Tile several successive frames together. +

+

The untile filter can do the reverse. +

+

The filter accepts the following options: +

+
+
layout
+

Set the grid size in the form COLUMNSxROWS. Range is upto UINT_MAX cells. +Default is 6x5. +

+
+
nb_frames
+

Set the maximum number of frames to render in the given area. It must be less +than or equal to wxh. The default value is 0, meaning all +the area will be used. +

+
+
margin
+

Set the outer border margin in pixels. Range is 0 to 1024. Default is 0. +

+
+
padding
+

Set the inner border thickness (i.e. the number of pixels between frames). For +more advanced padding options (such as having different values for the edges), +refer to the pad video filter. Range is 0 to 1024. Default is 0. +

+
+
color
+

Specify the color of the unused area. For the syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +The default value of color is "black". +

+
+
overlap
+

Set the number of frames to overlap when tiling several successive frames together. +The value must be between 0 and nb_frames - 1. Default is 0. +

+
+
init_padding
+

Set the number of frames to initially be empty before displaying first output frame. +This controls how soon will one get first output frame. +The value must be between 0 and nb_frames - 1. Default is 0. +

+
+ + +
+

11.252.1 Examples

+ +
    +
  • Produce 8x8 PNG tiles of all keyframes (-skip_frame nokey) in a movie: +
    +
    ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
    +
    +

    The -vsync 0 is necessary to prevent ffmpeg from +duplicating each output frame to accommodate the originally detected frame +rate. +

    +
  • Display 5 pictures in an area of 3x2 frames, +with 7 pixels between them, and 2 pixels of initial margin, using +mixed flat and named options: +
    +
    tile=3x2:nb_frames=5:padding=7:margin=2
    +
    +
+ +
+
+
+

11.253 tinterlace

+ +

Perform various types of temporal field interlacing. +

+

Frames are counted starting from 1, so the first input frame is +considered odd. +

+

The filter accepts the following options: +

+
+
mode
+

Specify the mode of the interlacing. This option can also be specified +as a value alone. See below for a list of values for this option. +

+

Available values are: +

+
+
merge, 0
+

Move odd frames into the upper field, even into the lower field, +generating a double height frame at half frame rate. +

+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+
+ +
+
drop_even, 1
+

Only output odd frames, even frames are dropped, generating a frame with +unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111                           33333
+11111                           33333
+11111                           33333
+11111                           33333
+
+ +
+
drop_odd, 2
+

Only output even frames, odd frames are dropped, generating a frame with +unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+                22222                           44444
+                22222                           44444
+                22222                           44444
+                22222                           44444
+
+ +
+
pad, 3
+

Expand each frame to full height, but pad alternate lines with black, +generating a frame with double height at the same input frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111           .....           33333           .....
+.....           22222           .....           44444
+11111           .....           33333           .....
+.....           22222           .....           44444
+11111           .....           33333           .....
+.....           22222           .....           44444
+11111           .....           33333           .....
+.....           22222           .....           44444
+
+ + +
+
interleave_top, 4
+

Interleave the upper field from odd frames with the lower field from +even frames, generating a frame with unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111<-         22222           33333<-         44444
+11111           22222<-         33333           44444<-
+11111<-         22222           33333<-         44444
+11111           22222<-         33333           44444<-
+
+Output:
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+
+ + +
+
interleave_bottom, 5
+

Interleave the lower field from odd frames with the upper field from +even frames, generating a frame with unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222<-         33333           44444<-
+11111<-         22222           33333<-         44444
+11111           22222<-         33333           44444<-
+11111<-         22222           33333<-         44444
+
+Output:
+22222                           44444
+11111                           33333
+22222                           44444
+11111                           33333
+
+ + +
+
interlacex2, 6
+

Double frame rate with unchanged height. Frames are inserted each +containing the second temporal field from the previous input frame and +the first temporal field from the next input frame. This mode relies on +the top_field_first flag. Useful for interlaced video displays with no +field synchronisation. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+ 11111           22222           33333           44444
+11111           22222           33333           44444
+ 11111           22222           33333           44444
+
+Output:
+11111   22222   22222   33333   33333   44444   44444
+ 11111   11111   22222   22222   33333   33333   44444
+11111   22222   22222   33333   33333   44444   44444
+ 11111   11111   22222   22222   33333   33333   44444
+
+ + +
+
mergex2, 7
+

Move odd frames into the upper field, even into the lower field, +generating a double height frame at same frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111           33333           33333           55555
+22222           22222           44444           44444
+11111           33333           33333           55555
+22222           22222           44444           44444
+11111           33333           33333           55555
+22222           22222           44444           44444
+11111           33333           33333           55555
+22222           22222           44444           44444
+
+ +
+
+ +

Numeric values are deprecated but are accepted for backward +compatibility reasons. +

+

Default mode is merge. +

+
+
flags
+

Specify flags influencing the filter process. +

+

Available value for flags is: +

+
+
low_pass_filter, vlpf
+

Enable linear vertical low-pass filtering in the filter. +Vertical low-pass filtering is required when creating an interlaced +destination from a progressive source which contains high-frequency +vertical detail. Filtering will reduce interlace ’twitter’ and Moire +patterning. +

+
+
complex_filter, cvlpf
+

Enable complex vertical low-pass filtering. +This will slightly less reduce interlace ’twitter’ and Moire +patterning but better retain detail and subjective sharpness impression. +

+
+
bypass_il
+

Bypass already interlaced frames, only adjust the frame rate. +

+
+ +

Vertical low-pass filtering and bypassing already interlaced frames can only be +enabled for mode interleave_top and interleave_bottom. +

+
+
+ +
+
+

11.254 tmedian

+

Pick median pixels from several successive input video frames. +

+

The filter accepts the following options: +

+
+
radius
+

Set radius of median filter. +Default is 1. Allowed range is from 1 to 127. +

+
+
planes
+

Set which planes to filter. Default value is 15, by which all planes are processed. +

+
+
percentile
+

Set median percentile. Default value is 0.5. +Default value of 0.5 will pick always median values, while 0 will pick +minimum values, and 1 maximum values. +

+
+ + +
+

11.254.1 Commands

+ +

This filter supports all above options as commands, excluding option radius. +

+
+
+
+

11.255 tmidequalizer

+ +

Apply Temporal Midway Video Equalization effect. +

+

Midway Video Equalization adjusts a sequence of video frames to have the same +histograms, while maintaining their dynamics as much as possible. It’s +useful for e.g. matching exposures from a video frames sequence. +

+

This filter accepts the following option: +

+
+
radius
+

Set filtering radius. Default is 5. Allowed range is from 1 to 127. +

+
+
sigma
+

Set filtering sigma. Default is 0.5. This controls strength of filtering. +Setting this option to 0 effectively does nothing. +

+
+
planes
+

Set which planes to process. Default is 15, which is all available planes. +

+
+ +
+
+

11.256 tmix

+ +

Mix successive video frames. +

+

A description of the accepted options follows. +

+
+
frames
+

The number of successive frames to mix. If unspecified, it defaults to 3. +

+
+
weights
+

Specify weight of each input video frame. +Each weight is separated by space. If number of weights is smaller than +number of frames last specified weight will be used for all remaining +unset weights. +

+
+
scale
+

Specify scale, if it is set it will be multiplied with sum +of each weight multiplied with pixel values to give final destination +pixel value. By default scale is auto scaled to sum of weights. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+ + +
+

11.256.1 Examples

+ +
    +
  • Average 7 successive frames: +
    +
    tmix=frames=7:weights="1 1 1 1 1 1 1"
    +
    + +
  • Apply simple temporal convolution: +
    +
    tmix=frames=3:weights="-1 3 -1"
    +
    + +
  • Similar as above but only showing temporal differences: +
    +
    tmix=frames=3:weights="-1 2 -1":scale=1
    +
    +
+ +
+
+

11.256.2 Commands

+ +

This filter supports the following commands: +

+
weights
+
scale
+
planes
+

Syntax is same as option with same name. +

+
+ +
+
+
+

11.257 tonemap

+

Tone map colors from different dynamic ranges. +

+

This filter expects data in single precision floating point, as it needs to +operate on (and can output) out-of-range values. Another filter, such as +zscale, is needed to convert the resulting frame to a usable format. +

+

The tonemapping algorithms implemented only work on linear light, so input +data should be linearized beforehand (and possibly correctly tagged). +

+
+
ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
+
+ + +
+

11.257.1 Options

+

The filter accepts the following options. +

+
+
tonemap
+

Set the tone map algorithm to use. +

+

Possible values are: +

+
none
+

Do not apply any tone map, only desaturate overbright pixels. +

+
+
clip
+

Hard-clip any out-of-range values. Use it for perfect color accuracy for +in-range values, while distorting out-of-range values. +

+
+
linear
+

Stretch the entire reference gamut to a linear multiple of the display. +

+
+
gamma
+

Fit a logarithmic transfer between the tone curves. +

+
+
reinhard
+

Preserve overall image brightness with a simple curve, using nonlinear +contrast, which results in flattening details and degrading color accuracy. +

+
+
hable
+

Preserve both dark and bright details better than reinhard, at the cost +of slightly darkening everything. Use it when detail preservation is more +important than color and brightness accuracy. +

+
+
mobius
+

Smoothly map out-of-range values, while retaining contrast and colors for +in-range material as much as possible. Use it when color accuracy is more +important than detail preservation. +

+
+ +

Default is none. +

+
+
param
+

Tune the tone mapping algorithm. +

+

This affects the following algorithms: +

+
none
+

Ignored. +

+
+
linear
+

Specifies the scale factor to use while stretching. +Default to 1.0. +

+
+
gamma
+

Specifies the exponent of the function. +Default to 1.8. +

+
+
clip
+

Specify an extra linear coefficient to multiply into the signal before clipping. +Default to 1.0. +

+
+
reinhard
+

Specify the local contrast coefficient at the display peak. +Default to 0.5, which means that in-gamut values will be about half as bright +as when clipping. +

+
+
hable
+

Ignored. +

+
+
mobius
+

Specify the transition point from linear to mobius transform. Every value +below this point is guaranteed to be mapped 1:1. The higher the value, the +more accurate the result will be, at the cost of losing bright details. +Default to 0.3, which due to the steep initial slope still preserves in-range +colors fairly accurately. +

+
+ +
+
desat
+

Apply desaturation for highlights that exceed this level of brightness. The +higher the parameter, the more color information will be preserved. This +setting helps prevent unnaturally blown-out colors for super-highlights, by +(smoothly) turning into white instead. This makes images feel more natural, +at the cost of reducing information about out-of-range colors. +

+

The default of 2.0 is somewhat conservative and will mostly just apply to +skies or directly sunlit surfaces. A setting of 0.0 disables this option. +

+

This option works only if the input frame has a supported color tag. +

+
+
peak
+

Override signal/nominal/reference peak with this value. Useful when the +embedded peak information in display metadata is not reliable or when tone +mapping from a lower range to a higher range. +

+
+ +
+
+
+

11.258 tpad

+ +

Temporarily pad video frames. +

+

The filter accepts the following options: +

+
+
start
+

Specify number of delay frames before input video stream. Default is 0. +

+
+
stop
+

Specify number of padding frames after input video stream. +Set to -1 to pad indefinitely. Default is 0. +

+
+
start_mode
+

Set kind of frames added to beginning of stream. +Can be either add or clone. +With add frames of solid-color are added. +With clone frames are clones of first frame. +Default is add. +

+
+
stop_mode
+

Set kind of frames added to end of stream. +Can be either add or clone. +With add frames of solid-color are added. +With clone frames are clones of last frame. +Default is add. +

+
+
start_duration, stop_duration
+

Specify the duration of the start/stop delay. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +These options override start and stop. Default is 0. +

+
+
color
+

Specify the color of the padded area. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. +

+

The default value of color is "black". +

+
+ +
+
+

11.259 transpose

+ +

Transpose rows with columns in the input video and optionally flip it. +

+

It accepts the following parameters: +

+
+
dir
+

Specify the transposition direction. +

+

Can assume the following values: +

+
0, 4, cclock_flip
+

Rotate by 90 degrees counterclockwise and vertically flip (default), that is: +

+
L.R     L.l
+. . ->  . .
+l.r     R.r
+
+ +
+
1, 5, clock
+

Rotate by 90 degrees clockwise, that is: +

+
L.R     l.L
+. . ->  . .
+l.r     r.R
+
+ +
+
2, 6, cclock
+

Rotate by 90 degrees counterclockwise, that is: +

+
L.R     R.r
+. . ->  . .
+l.r     L.l
+
+ +
+
3, 7, clock_flip
+

Rotate by 90 degrees clockwise and vertically flip, that is: +

+
L.R     r.R
+. . ->  . .
+l.r     l.L
+
+
+
+ +

For values between 4-7, the transposition is only done if the input +video geometry is portrait and not landscape. These values are +deprecated, the passthrough option should be used instead. +

+

Numerical values are deprecated, and should be dropped in favor of +symbolic constants. +

+
+
passthrough
+

Do not apply the transposition if the input geometry matches the one +specified by the specified value. It accepts the following values: +

+
none
+

Always apply transposition. +

+
portrait
+

Preserve portrait geometry (when height >= width). +

+
landscape
+

Preserve landscape geometry (when width >= height). +

+
+ +

Default value is none. +

+
+ +

For example to rotate by 90 degrees clockwise and preserve portrait +layout: +

+
transpose=dir=1:passthrough=portrait
+
+ +

The command above can also be specified as: +

+
transpose=1:portrait
+
+ +
+
+

11.260 transpose_npp

+ +

Transpose rows with columns in the input video and optionally flip it. +For more in depth examples see the transpose video filter, which shares mostly the same options. +

+

It accepts the following parameters: +

+
+
dir
+

Specify the transposition direction. +

+

Can assume the following values: +

+
cclock_flip
+

Rotate by 90 degrees counterclockwise and vertically flip. (default) +

+
+
clock
+

Rotate by 90 degrees clockwise. +

+
+
cclock
+

Rotate by 90 degrees counterclockwise. +

+
+
clock_flip
+

Rotate by 90 degrees clockwise and vertically flip. +

+
+ +
+
passthrough
+

Do not apply the transposition if the input geometry matches the one +specified by the specified value. It accepts the following values: +

+
none
+

Always apply transposition. (default) +

+
portrait
+

Preserve portrait geometry (when height >= width). +

+
landscape
+

Preserve landscape geometry (when width >= height). +

+
+ +
+
+ +
+
+

11.261 trim

+

Trim the input so that the output contains one continuous subpart of the input. +

+

It accepts the following parameters: +

+
start
+

Specify the time of the start of the kept section, i.e. the frame with the +timestamp start will be the first frame in the output. +

+
+
end
+

Specify the time of the first frame that will be dropped, i.e. the frame +immediately preceding the one with the timestamp end will be the last +frame in the output. +

+
+
start_pts
+

This is the same as start, except this option sets the start timestamp +in timebase units instead of seconds. +

+
+
end_pts
+

This is the same as end, except this option sets the end timestamp +in timebase units instead of seconds. +

+
+
duration
+

The maximum duration of the output in seconds. +

+
+
start_frame
+

The number of the first frame that should be passed to the output. +

+
+
end_frame
+

The number of the first frame that should be dropped. +

+
+ +

start, end, and duration are expressed as time +duration specifications; see +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

Note that the first two sets of the start/end options and the duration +option look at the frame timestamp, while the _frame variants simply count the +frames that pass through the filter. Also note that this filter does not modify +the timestamps. If you wish for the output timestamps to start at zero, insert a +setpts filter after the trim filter. +

+

If multiple start or end options are set, this filter tries to be greedy and +keep all the frames that match at least one of the specified constraints. To keep +only the part that matches all the constraints at once, chain multiple trim +filters. +

+

The defaults are such that all the input is kept. So it is possible to set e.g. +just the end values to keep everything before the specified time. +

+

Examples: +

    +
  • Drop everything except the second minute of input: +
    +
    ffmpeg -i INPUT -vf trim=60:120
    +
    + +
  • Keep only the first second: +
    +
    ffmpeg -i INPUT -vf trim=duration=1
    +
    + +
+ +
+
+

11.262 unpremultiply

+

Apply alpha unpremultiply effect to input video stream using first plane +of second stream as alpha. +

+

Both streams must have same dimensions and same pixel format. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+

If the format has 1 or 2 components, then luma is bit 0. +If the format has 3 or 4 components: +for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red; +for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V. +If present, the alpha channel is always the last bit. +

+
+
inplace
+

Do not require 2nd input for processing, instead use alpha plane from input stream. +

+
+ +
+
+

11.263 unsharp

+ +

Sharpen or blur the input video. +

+

It accepts the following parameters: +

+
+
luma_msize_x, lx
+

Set the luma matrix horizontal size. It must be an odd integer between +3 and 23. The default value is 5. +

+
+
luma_msize_y, ly
+

Set the luma matrix vertical size. It must be an odd integer between 3 +and 23. The default value is 5. +

+
+
luma_amount, la
+

Set the luma effect strength. It must be a floating point number, reasonable +values lay between -1.5 and 1.5. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+

Default value is 1.0. +

+
+
chroma_msize_x, cx
+

Set the chroma matrix horizontal size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
chroma_msize_y, cy
+

Set the chroma matrix vertical size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
chroma_amount, ca
+

Set the chroma effect strength. It must be a floating point number, reasonable +values lay between -1.5 and 1.5. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+

Default value is 0.0. +

+
+
alpha_msize_x, ax
+

Set the alpha matrix horizontal size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
alpha_msize_y, ay
+

Set the alpha matrix vertical size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
alpha_amount, aa
+

Set the alpha effect strength. It must be a floating point number, reasonable +values lay between -1.5 and 1.5. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+

Default value is 0.0. +

+
+
+ +

All parameters are optional and default to the equivalent of the +string ’5:5:1.0:5:5:0.0’. +

+ +
+

11.263.1 Examples

+ +
    +
  • Apply strong luma sharpen effect: +
    +
    unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
    +
    + +
  • Apply a strong blur of both luma and chroma parameters: +
    +
    unsharp=7:7:-2:7:7:-2
    +
    +
+ +
+
+
+

11.264 untile

+ +

Decompose a video made of tiled images into the individual images. +

+

The frame rate of the output video is the frame rate of the input video +multiplied by the number of tiles. +

+

This filter does the reverse of tile. +

+

The filter accepts the following options: +

+
+
layout
+

Set the grid size (i.e. the number of lines and columns). For the syntax of +this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+ + +
+

11.264.1 Examples

+ +
    +
  • Produce a 1-second video from a still image file made of 25 frames stacked +vertically, like an analogic film reel: +
    +
    ffmpeg -r 1 -i image.jpg -vf untile=1x25 movie.mkv
    +
    +
+ +
+
+
+

11.265 uspp

+ +

Apply ultra slow/simple postprocessing filter that compresses and decompresses +the image at several (or - in the case of quality level 8 - all) +shifts and average the results. +

+

The way this differs from the behavior of spp is that uspp actually encodes & +decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8 +DCT similar to MJPEG. +

+

This filter is only available in ffmpeg version 4.4 or earlier. +

+

The filter accepts the following options: +

+
+
quality
+

Set quality. This option defines the number of levels for averaging. It accepts +an integer in the range 0-8. If set to 0, the filter will have no +effect. A value of 8 means the higher quality. For each increment of +that value the speed drops by a factor of approximately 2. Default value is +3. +

+
+
qp
+

Force a constant quantization parameter. If not set, the filter will use the QP +from the video stream (if available). +

+
+
codec
+

Use specified codec instead of snow. +

+
+ +
+
+

11.266 v360

+ +

Convert 360 videos between various formats. +

+

The filter accepts the following options: +

+
+
input
+
output
+

Set format of the input/output video. +

+

Available formats: +

+
+
e
+
equirect
+

Equirectangular projection. +

+
+
c3x2
+
c6x1
+
c1x6
+

Cubemap with 3x2/6x1/1x6 layout. +

+

Format specific options: +

+
+
in_pad
+
out_pad
+

Set padding proportion for the input/output cubemap. Values in decimals. +

+

Example values: +

+
0
+

No padding. +

+
0.01
+

1% of face is padding. For example, with 1920x1280 resolution face size would be 640x640 and padding would be 3 pixels from each side. (640 * 0.01 = 6 pixels) +

+
+ +

Default value is 0. +Maximum value is 0.1. +

+
+
fin_pad
+
fout_pad
+

Set fixed padding for the input/output cubemap. Values in pixels. +

+

Default value is 0. If greater than zero it overrides other padding options. +

+
+
in_forder
+
out_forder
+

Set order of faces for the input/output cubemap. Choose one direction for each position. +

+

Designation of directions: +

+
r
+

right +

+
l
+

left +

+
u
+

up +

+
d
+

down +

+
f
+

forward +

+
b
+

back +

+
+ +

Default value is rludfb. +

+
+
in_frot
+
out_frot
+

Set rotation of faces for the input/output cubemap. Choose one angle for each position. +

+

Designation of angles: +

+
0
+

0 degrees clockwise +

+
1
+

90 degrees clockwise +

+
2
+

180 degrees clockwise +

+
3
+

270 degrees clockwise +

+
+ +

Default value is 000000. +

+
+ +
+
eac
+

Equi-Angular Cubemap. +

+
+
flat
+
gnomonic
+
rectilinear
+

Regular video. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
dfisheye
+

Dual fisheye. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
barrel
+
fb
+
barrelsplit
+

Facebook’s 360 formats. +

+
+
sg
+

Stereographic format. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
mercator
+

Mercator format. +

+
+
ball
+

Ball format, gives significant distortion toward the back. +

+
+
hammer
+

Hammer-Aitoff map projection format. +

+
+
sinusoidal
+

Sinusoidal map projection format. +

+
+
fisheye
+

Fisheye projection. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
pannini
+

Pannini projection. +

+

Format specific options: +

+
h_fov
+

Set output pannini parameter. +

+
+
ih_fov
+

Set input pannini parameter. +

+
+ +
+
cylindrical
+

Cylindrical projection. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
perspective
+

Perspective projection. (output only) +

+

Format specific options: +

+
v_fov
+

Set perspective parameter. +

+
+ +
+
tetrahedron
+

Tetrahedron projection. +

+
+
tsp
+

Truncated square pyramid projection. +

+
+
he
+
hequirect
+

Half equirectangular projection. +

+
+
equisolid
+

Equisolid format. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
og
+

Orthographic format. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
octahedron
+

Octahedron projection. +

+
+
cylindricalea
+

Cylindrical Equal Area projection. +

+
+ +
+
interp
+

Set interpolation method.
+Note: more complex interpolation methods require much more memory to run. +

+

Available methods: +

+
+
near
+
nearest
+

Nearest neighbour. +

+
line
+
linear
+

Bilinear interpolation. +

+
lagrange9
+

Lagrange9 interpolation. +

+
cube
+
cubic
+

Bicubic interpolation. +

+
lanc
+
lanczos
+

Lanczos interpolation. +

+
sp16
+
spline16
+

Spline16 interpolation. +

+
gauss
+
gaussian
+

Gaussian interpolation. +

+
mitchell
+

Mitchell interpolation. +

+
+ +

Default value is line. +

+
+
w
+
h
+

Set the output video resolution. +

+

Default resolution depends on formats. +

+
+
in_stereo
+
out_stereo
+

Set the input/output stereo format. +

+
+
2d
+

2D mono +

+
sbs
+

Side by side +

+
tb
+

Top bottom +

+
+ +

Default value is 2d for input and output format. +

+
+
yaw
+
pitch
+
roll
+

Set rotation for the output video. Values in degrees. +

+
+
rorder
+

Set rotation order for the output video. Choose one item for each position. +

+
+
y, Y
+

yaw +

+
p, P
+

pitch +

+
r, R
+

roll +

+
+ +

Default value is ypr. +

+
+
h_flip
+
v_flip
+
d_flip
+

Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values. +

+
+
ih_flip
+
iv_flip
+

Set if input video is flipped horizontally/vertically. Boolean values. +

+
+
in_trans
+

Set if input video is transposed. Boolean value, by default disabled. +

+
+
out_trans
+

Set if output video needs to be transposed. Boolean value, by default disabled. +

+
+
h_offset
+
v_offset
+

Set output horizontal/vertical off-axis offset. Default is set to 0. +Allowed range is from -1 to 1. +

+
+
alpha_mask
+

Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled. +

+
+
reset_rot
+

Reset rotation of output video. Boolean value, by default disabled. +

+
+ + +
+

11.266.1 Examples

+ +
    +
  • Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation: +
    +
    ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
    +
    +
  • Extract back view of Equi-Angular Cubemap: +
    +
    ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
    +
    +
  • Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format: +
    +
    v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
    +
    +
+ +
+
+

11.266.2 Commands

+ +

This filter supports subset of above options as commands. +

+
+
+
+

11.267 vaguedenoiser

+ +

Apply a wavelet based denoiser. +

+

It transforms each frame from the video input into the wavelet domain, +using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to +the obtained coefficients. It does an inverse wavelet transform after. +Due to wavelet properties, it should give a nice smoothed result, and +reduced noise, without blurring picture features. +

+

This filter accepts the following options: +

+
+
threshold
+

The filtering strength. The higher, the more filtered the video will be. +Hard thresholding can use a higher threshold than soft thresholding +before the video looks overfiltered. Default value is 2. +

+
+
method
+

The filtering method the filter will use. +

+

It accepts the following values: +

+
hard
+

All values under the threshold will be zeroed. +

+
+
soft
+

All values under the threshold will be zeroed. All values above will be +reduced by the threshold. +

+
+
garrote
+

Scales or nullifies coefficients - intermediary between (more) soft and +(less) hard thresholding. +

+
+ +

Default is garrote. +

+
+
nsteps
+

Number of times, the wavelet will decompose the picture. Picture can’t +be decomposed beyond a particular point (typically, 8 for a 640x480 +frame - as 2^9 = 512 > 480). Valid values are integers between 1 and 32. Default value is 6. +

+
+
percent
+

Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85. +

+
+
planes
+

A list of the planes to process. By default all planes are processed. +

+
+
type
+

The threshold type the filter will use. +

+

It accepts the following values: +

+
universal
+

Threshold used is same for all decompositions. +

+
+
bayes
+

Threshold used depends also on each decomposition coefficients. +

+
+ +

Default is universal. +

+
+ +
+
+

11.268 varblur

+

Apply variable blur filter by using 2nd video stream to set blur radius. +The 2nd stream must have the same dimensions. +

+

This filter accepts the following options: +

+
+
min_r
+

Set min allowed radius. Allowed range is from 0 to 254. Default is 0. +

+
max_r
+

Set max allowed radius. Allowed range is from 1 to 255. Default is 8. +

+
planes
+

Set which planes to process. By default, all are used. +

+
+ +

The varblur filter also supports the framesync options. +

+ +
+

11.268.1 Commands

+ +

This filter supports all the above options as commands. +

+
+
+
+

11.269 vectorscope

+ +

Display 2 color component values in the two dimensional graph (which is called +a vectorscope). +

+

This filter accepts the following options: +

+
+
mode, m
+

Set vectorscope mode. +

+

It accepts the following values: +

+
gray
+
tint
+

Gray values are displayed on graph, higher brightness means more pixels have +same component color value on location in graph. This is the default mode. +

+
+
color
+

Gray values are displayed on graph. Surrounding pixels values which are not +present in video frame are drawn in gradient of 2 color components which are +set by option x and y. The 3rd color component is static. +

+
+
color2
+

Actual color components values present in video frame are displayed on graph. +

+
+
color3
+

Similar as color2 but higher frequency of same values x and y +on graph increases value of another color component, which is luminance by +default values of x and y. +

+
+
color4
+

Actual colors present in video frame are displayed on graph. If two different +colors map to same position on graph then color with higher value of component +not present in graph is picked. +

+
+
color5
+

Gray values are displayed on graph. Similar to color but with 3rd color +component picked from radial gradient. +

+
+ +
+
x
+

Set which color component will be represented on X-axis. Default is 1. +

+
+
y
+

Set which color component will be represented on Y-axis. Default is 2. +

+
+
intensity, i
+

Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness +of color component which represents frequency of (X, Y) location in graph. +

+
+
envelope, e
+
+
none
+

No envelope, this is default. +

+
+
instant
+

Instant envelope, even darkest single pixel will be clearly highlighted. +

+
+
peak
+

Hold maximum and minimum values presented in graph over time. This way you +can still spot out of range values without constantly looking at vectorscope. +

+
+
peak+instant
+

Peak and instant envelope combined together. +

+
+ +
+
graticule, g
+

Set what kind of graticule to draw. +

+
none
+
green
+
color
+
invert
+
+ +
+
opacity, o
+

Set graticule opacity. +

+
+
flags, f
+

Set graticule flags. +

+
+
white
+

Draw graticule for white point. +

+
+
black
+

Draw graticule for black point. +

+
+
name
+

Draw color points short names. +

+
+ +
+
bgopacity, b
+

Set background opacity. +

+
+
lthreshold, l
+

Set low threshold for color component not represented on X or Y axis. +Values lower than this value will be ignored. Default is 0. +Note this value is multiplied with actual max possible value one pixel component +can have. So for 8-bit input and low threshold value of 0.1 actual threshold +is 0.1 * 255 = 25. +

+
+
hthreshold, h
+

Set high threshold for color component not represented on X or Y axis. +Values higher than this value will be ignored. Default is 1. +Note this value is multiplied with actual max possible value one pixel component +can have. So for 8-bit input and high threshold value of 0.9 actual threshold +is 0.9 * 255 = 230. +

+
+
colorspace, c
+

Set what kind of colorspace to use when drawing graticule. +

+
auto
+
601
+
709
+
+

Default is auto. +

+
+
tint0, t0
+
tint1, t1
+

Set color tint for gray/tint vectorscope mode. By default both options are zero. +This means no tint, and output will remain gray. +

+
+ +
+
+

11.270 vidstabdetect

+ +

Analyze video stabilization/deshaking. Perform pass 1 of 2, see +vidstabtransform for pass 2. +

+

This filter generates a file with relative translation and rotation +transform information about subsequent frames, which is then used by +the vidstabtransform filter. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libvidstab. +

+

This filter accepts the following options: +

+
+
result
+

Set the path to the file used to write the transforms information. +Default value is transforms.trf. +

+
+
shakiness
+

Set how shaky the video is and how quick the camera is. It accepts an +integer in the range 1-10, a value of 1 means little shakiness, a +value of 10 means strong shakiness. Default value is 5. +

+
+
accuracy
+

Set the accuracy of the detection process. It must be a value in the +range 1-15. A value of 1 means low accuracy, a value of 15 means high +accuracy. Default value is 15. +

+
+
stepsize
+

Set stepsize of the search process. The region around minimum is +scanned with 1 pixel resolution. Default value is 6. +

+
+
mincontrast
+

Set minimum contrast. Below this value a local measurement field is +discarded. Must be a floating point value in the range 0-1. Default +value is 0.3. +

+
+
tripod
+

Set reference frame number for tripod mode. +

+

If enabled, the motion of the frames is compared to a reference frame +in the filtered stream, identified by the specified number. The idea +is to compensate all movements in a more-or-less static scene and keep +the camera view absolutely still. +

+

If set to 0, it is disabled. The frames are counted starting from 1. +

+
+
show
+

Show fields and transforms in the resulting frames. It accepts an +integer in the range 0-2. Default value is 0, which disables any +visualization. +

+
+ + +
+

11.270.1 Examples

+ +
    +
  • Use default values: +
    +
    vidstabdetect
    +
    + +
  • Analyze strongly shaky movie and put the results in file +mytransforms.trf: +
    +
    vidstabdetect=shakiness=10:accuracy=15:result="mytransforms.trf"
    +
    + +
  • Visualize the result of internal transformations in the resulting +video: +
    +
    vidstabdetect=show=1
    +
    + +
  • Analyze a video with medium shakiness using ffmpeg: +
    +
    ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
    +
    +
+ +
+
+
+

11.271 vidstabtransform

+ +

Video stabilization/deshaking: pass 2 of 2, +see vidstabdetect for pass 1. +

+

Read a file with transform information for each frame and +apply/compensate them. Together with the vidstabdetect +filter this can be used to deshake videos. See also +http://public.hronopik.de/vid.stab. It is important to also use +the unsharp filter, see below. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libvidstab. +

+ +
+

11.271.1 Options

+ +
+
input
+

Set path to the file used to read the transforms. Default value is +transforms.trf. +

+
+
smoothing
+

Set the number of frames (value*2 + 1) used for lowpass filtering the +camera movements. Default value is 10. +

+

For example a number of 10 means that 21 frames are used (10 in the +past and 10 in the future) to smoothen the motion in the video. A +larger value leads to a smoother video, but limits the acceleration of +the camera (pan/tilt movements). 0 is a special case where a static +camera is simulated. +

+
+
optalgo
+

Set the camera path optimization algorithm. +

+

Accepted values are: +

+
gauss
+

gaussian kernel low-pass filter on camera motion (default) +

+
avg
+

averaging on transformations +

+
+ +
+
maxshift
+

Set maximal number of pixels to translate frames. Default value is -1, +meaning no limit. +

+
+
maxangle
+

Set maximal angle in radians (degree*PI/180) to rotate frames. Default +value is -1, meaning no limit. +

+
+
crop
+

Specify how to deal with borders that may be visible due to movement +compensation. +

+

Available values are: +

+
keep
+

keep image information from previous frame (default) +

+
black
+

fill the border black +

+
+ +
+
invert
+

Invert transforms if set to 1. Default value is 0. +

+
+
relative
+

Consider transforms as relative to previous frame if set to 1, +absolute if set to 0. Default value is 0. +

+
+
zoom
+

Set percentage to zoom. A positive value will result in a zoom-in +effect, a negative value in a zoom-out effect. Default value is 0 (no +zoom). +

+
+
optzoom
+

Set optimal zooming to avoid borders. +

+

Accepted values are: +

+
0
+

disabled +

+
1
+

optimal static zoom value is determined (only very strong movements +will lead to visible borders) (default) +

+
2
+

optimal adaptive zoom value is determined (no borders will be +visible), see zoomspeed +

+
+ +

Note that the value given at zoom is added to the one calculated here. +

+
+
zoomspeed
+

Set percent to zoom maximally each frame (enabled when +optzoom is set to 2). Range is from 0 to 5, default value is +0.25. +

+
+
interpol
+

Specify type of interpolation. +

+

Available values are: +

+
no
+

no interpolation +

+
linear
+

linear only horizontal +

+
bilinear
+

linear in both directions (default) +

+
bicubic
+

cubic in both directions (slow) +

+
+ +
+
tripod
+

Enable virtual tripod mode if set to 1, which is equivalent to +relative=0:smoothing=0. Default value is 0. +

+

Use also tripod option of vidstabdetect. +

+
+
debug
+

Increase log verbosity if set to 1. Also the detected global motions +are written to the temporary file global_motions.trf. Default +value is 0. +

+
+ +
+
+

11.271.2 Examples

+ +
    +
  • Use ffmpeg for a typical stabilization with default values: +
    +
    ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
    +
    + +

    Note the use of the unsharp filter which is always recommended. +

    +
  • Zoom in a bit more and load transform data from a given file: +
    +
    vidstabtransform=zoom=5:input="mytransforms.trf"
    +
    + +
  • Smoothen the video even more: +
    +
    vidstabtransform=smoothing=30
    +
    +
+ +
+
+
+

11.272 vflip

+ +

Flip the input video vertically. +

+

For example, to vertically flip a video with ffmpeg: +

+
ffmpeg -i in.avi -vf "vflip" out.avi
+
+ +
+
+

11.273 vfrdet

+ +

Detect variable frame rate video. +

+

This filter tries to detect if the input is variable or constant frame rate. +

+

At end it will output number of frames detected as having variable delta pts, +and ones with constant delta pts. +If there was frames with variable delta, than it will also show min, max and +average delta encountered. +

+
+
+

11.274 vibrance

+ +

Boost or alter saturation. +

+

The filter accepts the following options: +

+
intensity
+

Set strength of boost if positive value or strength of alter if negative value. +Default is 0. Allowed range is from -2 to 2. +

+
+
rbal
+

Set the red balance. Default is 1. Allowed range is from -10 to 10. +

+
+
gbal
+

Set the green balance. Default is 1. Allowed range is from -10 to 10. +

+
+
bbal
+

Set the blue balance. Default is 1. Allowed range is from -10 to 10. +

+
+
rlum
+

Set the red luma coefficient. +

+
+
glum
+

Set the green luma coefficient. +

+
+
blum
+

Set the blue luma coefficient. +

+
+
alternate
+

If intensity is negative and this is set to 1, colors will change, +otherwise colors will be less saturated, more towards gray. +

+
+ + +
+

11.274.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

11.275 vif

+ +

Obtain the average VIF (Visual Information Fidelity) between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained average VIF score is printed through the logging system. +

+

The filter stores the calculated VIF score of each frame. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi vif -f null -
+
+ +
+
+

11.276 vignette

+ +

Make or reverse a natural vignetting effect. +

+

The filter accepts the following options: +

+
+
angle, a
+

Set lens angle expression as a number of radians. +

+

The value is clipped in the [0,PI/2] range. +

+

Default value: "PI/5" +

+
+
x0
+
y0
+

Set center coordinates expressions. Respectively "w/2" and "h/2" +by default. +

+
+
mode
+

Set forward/backward mode. +

+

Available modes are: +

+
forward
+

The larger the distance from the central point, the darker the image becomes. +

+
+
backward
+

The larger the distance from the central point, the brighter the image becomes. +This can be used to reverse a vignette effect, though there is no automatic +detection to extract the lens angle and other settings (yet). It can +also be used to create a burning effect. +

+
+ +

Default value is ‘forward’. +

+
+
eval
+

Set evaluation mode for the expressions (angle, x0, y0). +

+

It accepts the following values: +

+
init
+

Evaluate expressions only once during the filter initialization. +

+
+
frame
+

Evaluate expressions for each incoming frame. This is way slower than the +‘init’ mode since it requires all the scalers to be re-computed, but it +allows advanced dynamic expressions. +

+
+ +

Default value is ‘init’. +

+
+
dither
+

Set dithering to reduce the circular banding effects. Default is 1 +(enabled). +

+
+
aspect
+

Set vignette aspect. This setting allows one to adjust the shape of the vignette. +Setting this value to the SAR of the input will make a rectangular vignetting +following the dimensions of the video. +

+

Default is 1/1. +

+
+ + +
+

11.276.1 Expressions

+ +

The alpha, x0 and y0 expressions can contain the +following parameters. +

+
+
w
+
h
+

input width and height +

+
+
n
+

the number of input frame, starting from 0 +

+
+
pts
+

the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in +TB units, NAN if undefined +

+
+
r
+

frame rate of the input video, NAN if the input frame rate is unknown +

+
+
t
+

the PTS (Presentation TimeStamp) of the filtered video frame, +expressed in seconds, NAN if undefined +

+
+
tb
+

time base of the input video +

+
+ + +
+
+

11.276.2 Examples

+ +
    +
  • Apply simple strong vignetting effect: +
    +
    vignette=PI/4
    +
    + +
  • Make a flickering vignetting: +
    +
    vignette='PI/4+random(1)*PI/50':eval=frame
    +
    + +
+ +
+
+
+

11.277 vmafmotion

+ +

Obtain the average VMAF motion score of a video. +It is one of the component metrics of VMAF. +

+

The obtained average motion score is printed through the logging system. +

+

The filter accepts the following options: +

+
+
stats_file
+

If specified, the filter will use the named file to save the motion score of +each frame with respect to the previous frame. +When filename equals "-" the data is sent to standard output. +

+
+ +

Example: +

+
ffmpeg -i ref.mpg -vf vmafmotion -f null -
+
+ +
+
+

11.278 vstack

+

Stack input videos vertically. +

+

All streams must be of same pixel format and of same width. +

+

Note that this filter is faster than using overlay and pad filter +to create same output. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of input streams. Default is 2. +

+
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+ +
+
+

11.279 w3fdif

+ +

Deinterlace the input video ("w3fdif" stands for "Weston 3 Field +Deinterlacing Filter"). +

+

Based on the process described by Martin Weston for BBC R&D, and +implemented based on the de-interlace algorithm written by Jim +Easterbrook for BBC R&D, the Weston 3 field deinterlacing filter +uses filter coefficients calculated by BBC R&D. +

+

This filter uses field-dominance information in frame to decide which +of each pair of fields to place first in the output. +If it gets it wrong use setfield filter before w3fdif filter. +

+

There are two sets of filter coefficients, so called "simple" +and "complex". Which set of filter coefficients is used can +be set by passing an optional parameter: +

+
+
filter
+

Set the interlacing filter coefficients. Accepts one of the following values: +

+
+
simple
+

Simple filter coefficient set. +

+
complex
+

More-complex filter coefficient set. +

+
+

Default value is ‘complex’. +

+
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
frame
+

Output one frame for each frame. +

+
field
+

Output one frame for each field. +

+
+ +

The default value is field. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
tff
+

Assume the top field is first. +

+
bff
+

Assume the bottom field is first. +

+
auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following values: +

+
+
all
+

Deinterlace all frames, +

+
interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

Default value is ‘all’. +

+
+ + +
+

11.279.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

11.280 waveform

+

Video waveform monitor. +

+

The waveform monitor plots color component intensity. By default luminance +only. Each column of the waveform corresponds to a column of pixels in the +source video. +

+

It accepts the following options: +

+
+
mode, m
+

Can be either row, or column. Default is column. +In row mode, the graph on the left side represents color component value 0 and +the right side represents value = 255. In column mode, the top side represents +color component value = 0 and bottom side represents value = 255. +

+
+
intensity, i
+

Set intensity. Smaller values are useful to find out how many values of the same +luminance are distributed across input rows/columns. +Default value is 0.04. Allowed range is [0, 1]. +

+
+
mirror, r
+

Set mirroring mode. 0 means unmirrored, 1 means mirrored. +In mirrored mode, higher values will be represented on the left +side for row mode and at the top for column mode. Default is +1 (mirrored). +

+
+
display, d
+

Set display mode. +It accepts the following values: +

+
overlay
+

Presents information identical to that in the parade, except +that the graphs representing color components are superimposed directly +over one another. +

+

This display mode makes it easier to spot relative differences or similarities +in overlapping areas of the color components that are supposed to be identical, +such as neutral whites, grays, or blacks. +

+
+
stack
+

Display separate graph for the color components side by side in +row mode or one below the other in column mode. +

+
+
parade
+

Display separate graph for the color components side by side in +column mode or one below the other in row mode. +

+

Using this display mode makes it easy to spot color casts in the highlights +and shadows of an image, by comparing the contours of the top and the bottom +graphs of each waveform. Since whites, grays, and blacks are characterized +by exactly equal amounts of red, green, and blue, neutral areas of the picture +should display three waveforms of roughly equal width/height. If not, the +correction is easy to perform by making level adjustments the three waveforms. +

+
+

Default is stack. +

+
+
components, c
+

Set which color components to display. Default is 1, which means only luminance +or red color component if input is in RGB colorspace. If is set for example to +7 it will display all 3 (if) available color components. +

+
+
envelope, e
+
+
none
+

No envelope, this is default. +

+
+
instant
+

Instant envelope, minimum and maximum values presented in graph will be easily +visible even with small step value. +

+
+
peak
+

Hold minimum and maximum values presented in graph across time. This way you +can still spot out of range values without constantly looking at waveforms. +

+
+
peak+instant
+

Peak and instant envelope combined together. +

+
+ +
+
filter, f
+
+
lowpass
+

No filtering, this is default. +

+
+
flat
+

Luma and chroma combined together. +

+
+
aflat
+

Similar as above, but shows difference between blue and red chroma. +

+
+
xflat
+

Similar as above, but use different colors. +

+
+
yflat
+

Similar as above, but again with different colors. +

+
+
chroma
+

Displays only chroma. +

+
+
color
+

Displays actual color value on waveform. +

+
+
acolor
+

Similar as above, but with luma showing frequency of chroma values. +

+
+ +
+
graticule, g
+

Set which graticule to display. +

+
+
none
+

Do not display graticule. +

+
+
green
+

Display green graticule showing legal broadcast ranges. +

+
+
orange
+

Display orange graticule showing legal broadcast ranges. +

+
+
invert
+

Display invert graticule showing legal broadcast ranges. +

+
+ +
+
opacity, o
+

Set graticule opacity. +

+
+
flags, fl
+

Set graticule flags. +

+
+
numbers
+

Draw numbers above lines. By default enabled. +

+
+
dots
+

Draw dots instead of lines. +

+
+ +
+
scale, s
+

Set scale used for displaying graticule. +

+
+
digital
+
millivolts
+
ire
+
+

Default is digital. +

+
+
bgopacity, b
+

Set background opacity. +

+
+
tint0, t0
+
tint1, t1
+

Set tint for output. +Only used with lowpass filter and when display is not overlay and input +pixel formats are not RGB. +

+
+
fitmode, fm
+

Set sample aspect ratio of video output frames. +Can be used to configure waveform so it is not +streched too much in one of directions. +

+
+
none
+

Set sample aspect ration to 1/1. +

+
size
+

Set sample aspect ratio to match input size of video +

+
+

Default is ‘none’. +

+
+
input
+

Set input formats for filter to pick from. +Can be ‘all’, for selecting from all available formats, +or ‘first’, for selecting first available format. +Default is ‘first’. +

+
+ +
+
+

11.281 weave, doubleweave

+ +

The weave takes a field-based video input and join +each two sequential fields into single frame, producing a new double +height clip with half the frame rate and half the frame count. +

+

The doubleweave works same as weave but without +halving frame rate and frame count. +

+

It accepts the following option: +

+
+
first_field
+

Set first field. Available values are: +

+
+
top, t
+

Set the frame as top-field-first. +

+
+
bottom, b
+

Set the frame as bottom-field-first. +

+
+
+
+ + +
+

11.281.1 Examples

+ +
    +
  • Interlace video using select and separatefields filter: +
    +
    separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
    +
    +
+ +
+
+
+

11.282 xbr

+

Apply the xBR high-quality magnification filter which is designed for pixel +art. It follows a set of edge-detection rules, see +https://forums.libretro.com/t/xbr-algorithm-tutorial/123. +

+

It accepts the following option: +

+
+
n
+

Set the scaling dimension: 2 for 2xBR, 3 for +3xBR and 4 for 4xBR. +Default is 3. +

+
+ +
+
+

11.283 xcorrelate

+

Apply normalized cross-correlation between first and second input video stream. +

+

Second input video stream dimensions must be lower than first input video stream. +

+

The filter accepts the following options: +

+
+
planes
+

Set which planes to process. +

+
+
secondary
+

Set which secondary video frames will be processed from second input video stream, +can be first or all. Default is all. +

+
+ +

The xcorrelate filter also supports the framesync options. +

+
+
+

11.284 xfade

+ +

Apply cross fade from one input video stream to another input video stream. +The cross fade is applied for specified duration. +

+

Both inputs must be constant frame-rate and have the same resolution, pixel format, +frame rate and timebase. +

+

The filter accepts the following options: +

+
+
transition
+

Set one of available transition effects: +

+
+
custom
+
fade
+
wipeleft
+
wiperight
+
wipeup
+
wipedown
+
slideleft
+
slideright
+
slideup
+
slidedown
+
circlecrop
+
rectcrop
+
distance
+
fadeblack
+
fadewhite
+
radial
+
smoothleft
+
smoothright
+
smoothup
+
smoothdown
+
circleopen
+
circleclose
+
vertopen
+
vertclose
+
horzopen
+
horzclose
+
dissolve
+
pixelize
+
diagtl
+
diagtr
+
diagbl
+
diagbr
+
hlslice
+
hrslice
+
vuslice
+
vdslice
+
hblur
+
fadegrays
+
wipetl
+
wipetr
+
wipebl
+
wipebr
+
squeezeh
+
squeezev
+
zoomin
+
fadefast
+
fadeslow
+
hlwind
+
hrwind
+
vuwind
+
vdwind
+
+

Default transition effect is fade. +

+
+
duration
+

Set cross fade duration in seconds. +Range is 0 to 60 seconds. +Default duration is 1 second. +

+
+
offset
+

Set cross fade start relative to first input stream in seconds. +Default offset is 0. +

+
+
expr
+

Set expression for custom transition effect. +

+

The expressions can use the following variables and functions: +

+
+
X
+
Y
+

The coordinates of the current sample. +

+
+
W
+
H
+

The width and height of the image. +

+
+
P
+

Progress of transition effect. +

+
+
PLANE
+

Currently processed plane. +

+
+
A
+

Return value of first input at current location and plane. +

+
+
B
+

Return value of second input at current location and plane. +

+
+
a0(x, y)
+
a1(x, y)
+
a2(x, y)
+
a3(x, y)
+

Return the value of the pixel at location (x,y) of the +first/second/third/fourth component of first input. +

+
+
b0(x, y)
+
b1(x, y)
+
b2(x, y)
+
b3(x, y)
+

Return the value of the pixel at location (x,y) of the +first/second/third/fourth component of second input. +

+
+
+
+ + +
+

11.284.1 Examples

+ +
    +
  • Cross fade from one input video to another input video, with fade transition and duration of transition +of 2 seconds starting at offset of 5 seconds: +
    +
    ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
    +
    +
+ +
+
+
+

11.285 xmedian

+

Pick median pixels from several input videos. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of inputs. +Default is 3. Allowed range is from 3 to 255. +If number of inputs is even number, than result will be mean value between two median values. +

+
+
planes
+

Set which planes to filter. Default value is 15, by which all planes are processed. +

+
+
percentile
+

Set median percentile. Default value is 0.5. +Default value of 0.5 will pick always median values, while 0 will pick +minimum values, and 1 maximum values. +

+
+ + +
+

11.285.1 Commands

+ +

This filter supports all above options as commands, excluding option inputs. +

+
+
+
+

11.286 xstack

+

Stack video inputs into custom layout. +

+

All streams must be of same pixel format. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of input streams. Default is 2. +

+
+
layout
+

Specify layout of inputs. +This option requires the desired layout configuration to be explicitly set by the user. +This sets position of each video input in output. Each input +is separated by ’|’. +The first number represents the column, and the second number represents the row. +Numbers start at 0 and are separated by ’_’. Optionally one can use wX and hX, +where X is video input from which to take width or height. +Multiple values can be used when separated by ’+’. In such +case values are summed together. +

+

Note that if inputs are of different sizes gaps may appear, as not all of +the output video frame will be filled. Similarly, videos can overlap each +other if their position doesn’t leave enough space for the full frame of +adjoining videos. +

+

For 2 inputs, a default layout of 0_0|w0_0 (equivalent to +grid=2x1) is set. In all other cases, a layout or a grid must be set by +the user. Either grid or layout can be specified at a time. +Specifying both will result in an error. +

+
+
grid
+

Specify a fixed size grid of inputs. +This option is used to create a fixed size grid of the input streams. Set the +grid size in the form COLUMNSxROWS. There must be ROWS * COLUMNS +input streams and they will be arranged as a grid with ROWS rows and +COLUMNS columns. When using this option, each input stream within a row +must have the same height and all the rows must have the same width. +

+

If grid is set, then inputs option is ignored and is implicitly +set to ROWS * COLUMNS. +

+

For 2 inputs, a default grid of 2x1 (equivalent to +layout=0_0|w0_0) is set. In all other cases, a layout or a grid must be +set by the user. Either grid or layout can be specified at a time. +Specifying both will result in an error. +

+
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+
fill
+

If set to valid color, all unused pixels will be filled with that color. +By default fill is set to none, so it is disabled. +

+
+ + +
+

11.286.1 Examples

+ +
    +
  • Display 4 inputs into 2x2 grid. + +

    Layout: +

    +
    input1(0, 0)  | input3(w0, 0)
    +input2(0, h0) | input4(w0, h0)
    +
    + +
    +
    xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
    +
    + +

    Note that if inputs are of different sizes, gaps or overlaps may occur. +

    +
  • Display 4 inputs into 1x4 grid. + +

    Layout: +

    +
    input1(0, 0)
    +input2(0, h0)
    +input3(0, h0+h1)
    +input4(0, h0+h1+h2)
    +
    + +
    +
    xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
    +
    + +

    Note that if inputs are of different widths, unused space will appear. +

    +
  • Display 9 inputs into 3x3 grid. + +

    Layout: +

    +
    input1(0, 0)       | input4(w0, 0)      | input7(w0+w3, 0)
    +input2(0, h0)      | input5(w0, h0)     | input8(w0+w3, h0)
    +input3(0, h0+h1)   | input6(w0, h0+h1)  | input9(w0+w3, h0+h1)
    +
    + +
    +
    xstack=inputs=9:layout=0_0|0_h0|0_h0+h1|w0_0|w0_h0|w0_h0+h1|w0+w3_0|w0+w3_h0|w0+w3_h0+h1
    +
    + +

    Note that if inputs are of different sizes, gaps or overlaps may occur. +

    +
  • Display 16 inputs into 4x4 grid. + +

    Layout: +

    +
    input1(0, 0)       | input5(w0, 0)       | input9 (w0+w4, 0)       | input13(w0+w4+w8, 0)
    +input2(0, h0)      | input6(w0, h0)      | input10(w0+w4, h0)      | input14(w0+w4+w8, h0)
    +input3(0, h0+h1)   | input7(w0, h0+h1)   | input11(w0+w4, h0+h1)   | input15(w0+w4+w8, h0+h1)
    +input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
    +
    + +
    +
    xstack=inputs=16:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0+w4_0|
    +w0+w4_h0|w0+w4_h0+h1|w0+w4_h0+h1+h2|w0+w4+w8_0|w0+w4+w8_h0|w0+w4+w8_h0+h1|w0+w4+w8_h0+h1+h2
    +
    + +

    Note that if inputs are of different sizes, gaps or overlaps may occur. +

    +
+ +
+
+
+

11.287 yadif

+ +

Deinterlace the input video ("yadif" means "yet another deinterlacing +filter"). +

+

It accepts the following parameters: +

+ +
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
0, send_frame
+

Output one frame for each frame. +

+
1, send_field
+

Output one frame for each field. +

+
2, send_frame_nospatial
+

Like send_frame, but it skips the spatial interlacing check. +

+
3, send_field_nospatial
+

Like send_field, but it skips the spatial interlacing check. +

+
+ +

The default value is send_frame. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
0, tff
+

Assume the top field is first. +

+
1, bff
+

Assume the bottom field is first. +

+
-1, auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
0, all
+

Deinterlace all frames. +

+
1, interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+ +
+
+

11.288 yadif_cuda

+ +

Deinterlace the input video using the yadif algorithm, but implemented +in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec +and/or nvenc. +

+

It accepts the following parameters: +

+ +
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
0, send_frame
+

Output one frame for each frame. +

+
1, send_field
+

Output one frame for each field. +

+
2, send_frame_nospatial
+

Like send_frame, but it skips the spatial interlacing check. +

+
3, send_field_nospatial
+

Like send_field, but it skips the spatial interlacing check. +

+
+ +

The default value is send_frame. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
0, tff
+

Assume the top field is first. +

+
1, bff
+

Assume the bottom field is first. +

+
-1, auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
0, all
+

Deinterlace all frames. +

+
1, interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+ +
+
+

11.289 yaepblur

+ +

Apply blur filter while preserving edges ("yaepblur" means "yet another edge preserving blur filter"). +The algorithm is described in +"J. S. Lee, Digital image enhancement and noise filtering by use of local statistics, IEEE Trans. Pattern Anal. Mach. Intell. PAMI-2, 1980." +

+

It accepts the following parameters: +

+
+
radius, r
+

Set the window radius. Default value is 3. +

+
+
planes, p
+

Set which planes to filter. Default is only the first plane. +

+
+
sigma, s
+

Set blur strength. Default value is 128. +

+
+ + +
+

11.289.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

11.290 zoompan

+ +

Apply Zoom & Pan effect. +

+

This filter accepts the following options: +

+
+
zoom, z
+

Set the zoom expression. Range is 1-10. Default is 1. +

+
+
x
+
y
+

Set the x and y expression. Default is 0. +

+
+
d
+

Set the duration expression in number of frames. +This sets for how many number of frames effect will last for +single input image. Default is 90. +

+
+
s
+

Set the output image size, default is ’hd720’. +

+
+
fps
+

Set the output frame rate, default is ’25’. +

+
+ +

Each expression can contain the following constants: +

+
+
in_w, iw
+

Input width. +

+
+
in_h, ih
+

Input height. +

+
+
out_w, ow
+

Output width. +

+
+
out_h, oh
+

Output height. +

+
+
in
+

Input frame count. +

+
+
on
+

Output frame count. +

+
+
in_time, it
+

The input timestamp expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
out_time, time, ot
+

The output timestamp expressed in seconds. +

+
+
x
+
y
+

Last calculated ’x’ and ’y’ position from ’x’ and ’y’ expression +for current input frame. +

+
+
px
+
py
+

’x’ and ’y’ of last output frame of previous input frame or 0 when there was +not yet such frame (first input frame). +

+
+
zoom
+

Last calculated zoom from ’z’ expression for current input frame. +

+
+
pzoom
+

Last calculated zoom of last output frame of previous input frame. +

+
+
duration
+

Number of output frames for current input frame. Calculated from ’d’ expression +for each input frame. +

+
+
pduration
+

number of output frames created for previous input frame +

+
+
a
+

Rational number: input width / input height +

+
+
sar
+

sample aspect ratio +

+
+
dar
+

display aspect ratio +

+
+
+ + +
+

11.290.1 Examples

+ +
    +
  • Zoom in up to 1.5x and pan at same time to some spot near center of picture: +
    +
    zoompan=z='min(zoom+0.0015,1.5)':d=700:x='if(gte(zoom,1.5),x,x+1/a)':y='if(gte(zoom,1.5),y,y+1)':s=640x360
    +
    + +
  • Zoom in up to 1.5x and pan always at center of picture: +
    +
    zoompan=z='min(zoom+0.0015,1.5)':d=700:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
    +
    + +
  • Same as above but without pausing: +
    +
    zoompan=z='min(max(zoom,pzoom)+0.0015,1.5)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
    +
    + +
  • Zoom in 2x into center of picture only for the first second of the input video: +
    +
    zoompan=z='if(between(in_time,0,1),2,1)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
    +
    + +
+ +
+
+
+

11.291 zscale

+

Scale (resize) the input video, using the z.lib library: +https://github.com/sekrit-twc/zimg. To enable compilation of this +filter, you need to configure FFmpeg with --enable-libzimg. +

+

The zscale filter forces the output display aspect ratio to be the same +as the input, by changing the output sample aspect ratio. +

+

If the input image format is different from the format requested by +the next filter, the zscale filter will convert the input to the +requested format. +

+ +
+

11.291.1 Options

+

The filter accepts the following options. +

+
+
width, w
+
height, h
+

Set the output video dimension expression. Default value is the input +dimension. +

+

If the width or w value is 0, the input width is used for +the output. If the height or h value is 0, the input height +is used for the output. +

+

If one and only one of the values is -n with n >= 1, the zscale filter +will use a value that maintains the aspect ratio of the input image, +calculated from the other specified dimension. After that it will, +however, make sure that the calculated dimension is divisible by n and +adjust the value if necessary. +

+

If both values are -n with n >= 1, the behavior will be identical to +both values being set to 0 as previously detailed. +

+

See below for the list of accepted constants for use in the dimension +expression. +

+
+
size, s
+

Set the video size. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
dither, d
+

Set the dither type. +

+

Possible values are: +

+
none
+
ordered
+
random
+
error_diffusion
+
+ +

Default is none. +

+
+
filter, f
+

Set the resize filter type. +

+

Possible values are: +

+
point
+
bilinear
+
bicubic
+
spline16
+
spline36
+
lanczos
+
+ +

Default is bilinear. +

+
+
range, r
+

Set the color range. +

+

Possible values are: +

+
input
+
limited
+
full
+
+ +

Default is same as input. +

+
+
primaries, p
+

Set the color primaries. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
170m
+
240m
+
2020
+
+ +

Default is same as input. +

+
+
transfer, t
+

Set the transfer characteristics. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
601
+
linear
+
2020_10
+
2020_12
+
smpte2084
+
iec61966-2-1
+
arib-std-b67
+
+ +

Default is same as input. +

+
+
matrix, m
+

Set the colorspace matrix. +

+

Possible value are: +

+
input
+
709
+
unspecified
+
470bg
+
170m
+
2020_ncl
+
2020_cl
+
+ +

Default is same as input. +

+
+
rangein, rin
+

Set the input color range. +

+

Possible values are: +

+
input
+
limited
+
full
+
+ +

Default is same as input. +

+
+
primariesin, pin
+

Set the input color primaries. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
170m
+
240m
+
2020
+
+ +

Default is same as input. +

+
+
transferin, tin
+

Set the input transfer characteristics. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
601
+
linear
+
2020_10
+
2020_12
+
+ +

Default is same as input. +

+
+
matrixin, min
+

Set the input colorspace matrix. +

+

Possible value are: +

+
input
+
709
+
unspecified
+
470bg
+
170m
+
2020_ncl
+
2020_cl
+
+ +
+
chromal, c
+

Set the output chroma location. +

+

Possible values are: +

+
input
+
left
+
center
+
topleft
+
top
+
bottomleft
+
bottom
+
+ +
+
chromalin, cin
+

Set the input chroma location. +

+

Possible values are: +

+
input
+
left
+
center
+
topleft
+
top
+
bottomleft
+
bottom
+
+ +
+
npl
+

Set the nominal peak luminance. +

+
+
param_a
+

Parameter A for scaling filters. Parameter "b" for bicubic, and the number of +filter taps for lanczos. +

+
+
param_b
+

Parameter B for scaling filters. Parameter "c" for bicubic. +

+
+ +

The values of the w and h options are expressions +containing the following constants: +

+
+
in_w
+
in_h
+

The input width and height +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (scaled) width and height +

+
+
ow
+
oh
+

These are the same as out_w and out_h +

+
+
a
+

The same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

The input display aspect ratio. Calculated from (iw / ih) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical input chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
ohsub
+
ovsub
+

horizontal and vertical output chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ +
+
+

11.291.2 Commands

+ +

This filter supports the following commands: +

+
width, w
+
height, h
+

Set the output video dimension expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ + +
+
+
+
+

12 OpenCL Video Filters

+ +

Below is a description of the currently available OpenCL video filters. +

+

To enable compilation of these filters you need to configure FFmpeg with +--enable-opencl. +

+

Running OpenCL filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph. +

+
-init_hw_device opencl[=name][:device[,key=value...]]
+

Initialise a new hardware device of type opencl called name, using the +given device parameters. +

+
+
-filter_hw_device name
+

Pass the hardware device called name to all filters in any filter graph. +

+
+
+ +

For more detailed information see https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options +

+
    +
  • Example of choosing the first device on the second platform and running avgblur_opencl filter with default parameters on it. +
    +
    -init_hw_device opencl=gpu:1.0 -filter_hw_device gpu -i INPUT -vf "hwupload, avgblur_opencl, hwdownload" OUTPUT
    +
    +
+ +

Since OpenCL filters are not able to access frame data in normal memory, all frame data needs to be uploaded(hwupload) to hardware surfaces connected to the appropriate device before being used and then downloaded(hwdownload) back to normal memory. Note that hwupload will upload to a surface with the same layout as the software frame, so it may be necessary to add a format filter immediately before to get the input into the right format and hwdownload does not support all formats on the output - it may be necessary to insert an additional format filter immediately following in the graph to get the output in a supported format. +

+ +
+

12.1 avgblur_opencl

+ +

Apply average blur filter. +

+

The filter accepts the following options: +

+
+
sizeX
+

Set horizontal radius size. +Range is [1, 1024] and default value is 1. +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
sizeY
+

Set vertical radius size. Range is [1, 1024] and default value is 0. If zero, sizeX value will be used. +

+
+ + +
+

12.1.1 Example

+ +
    +
  • Apply average blur filter with horizontal and vertical size of 3, setting each pixel of the output to the average value of the 7x7 region centered on it in the input. For pixels on the edges of the image, the region does not extend beyond the image boundaries, and so out-of-range coordinates are not used in the calculations. +
    +
    -i INPUT -vf "hwupload, avgblur_opencl=3, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

12.2 boxblur_opencl

+ +

Apply a boxblur algorithm to the input video. +

+

It accepts the following parameters: +

+
+
luma_radius, lr
+
luma_power, lp
+
chroma_radius, cr
+
chroma_power, cp
+
alpha_radius, ar
+
alpha_power, ap
+
+ +

A description of the accepted options follows. +

+
+
luma_radius, lr
+
chroma_radius, cr
+
alpha_radius, ar
+

Set an expression for the box radius in pixels used for blurring the +corresponding input plane. +

+

The radius value must be a non-negative number, and must not be +greater than the value of the expression min(w,h)/2 for the +luma and alpha planes, and of min(cw,ch)/2 for the chroma +planes. +

+

Default value for luma_radius is "2". If not specified, +chroma_radius and alpha_radius default to the +corresponding value set for luma_radius. +

+

The expressions can contain the following constants: +

+
w
+
h
+

The input width and height in pixels. +

+
+
cw
+
ch
+

The input chroma image width and height in pixels. +

+
+
hsub
+
vsub
+

The horizontal and vertical chroma subsample values. For example, for the +pixel format "yuv422p", hsub is 2 and vsub is 1. +

+
+ +
+
luma_power, lp
+
chroma_power, cp
+
alpha_power, ap
+

Specify how many times the boxblur filter is applied to the +corresponding plane. +

+

Default value for luma_power is 2. If not specified, +chroma_power and alpha_power default to the +corresponding value set for luma_power. +

+

A value of 0 will disable the effect. +

+
+ + +
+

12.2.1 Examples

+ +

Apply boxblur filter, setting each pixel of the output to the average value of box-radiuses luma_radius, chroma_radius, alpha_radius for each plane respectively. The filter will apply luma_power, chroma_power, alpha_power times onto the corresponding plane. For pixels on the edges of the image, the radius does not extend beyond the image boundaries, and so out-of-range coordinates are not used in the calculations. +

+
    +
  • Apply a boxblur filter with the luma, chroma, and alpha radius +set to 2 and luma, chroma, and alpha power set to 3. The filter will run 3 times with box-radius set to 2 for every plane of the image. +
    +
    -i INPUT -vf "hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload" OUTPUT
    +-i INPUT -vf "hwupload, boxblur_opencl=2:3, hwdownload" OUTPUT
    +
    + +
  • Apply a boxblur filter with luma radius set to 2, luma_power to 1, chroma_radius to 4, chroma_power to 5, alpha_radius to 3 and alpha_power to 7. + +

    For the luma plane, a 2x2 box radius will be run once. +

    +

    For the chroma plane, a 4x4 box radius will be run 5 times. +

    +

    For the alpha plane, a 3x3 box radius will be run 7 times. +

    +
    -i INPUT -vf "hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

12.3 colorkey_opencl

+

RGB colorspace color keying. +

+

The filter accepts the following options: +

+
+
color
+

The color which will be replaced with transparency. +

+
+
similarity
+

Similarity percentage with the key color. +

+

0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +

+

0.0 makes pixels either fully transparent, or not transparent at all. +

+

Higher values result in semi-transparent pixels, with a higher transparency +the more similar the pixels color is to the key color. +

+
+ + +
+

12.3.1 Examples

+ +
    +
  • Make every semi-green pixel in the input transparent with some slight blending: +
    +
    -i INPUT -vf "hwupload, colorkey_opencl=green:0.3:0.1, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

12.4 convolution_opencl

+ +

Apply convolution of 3x3, 5x5, 7x7 matrix. +

+

The filter accepts the following options: +

+
+
0m
+
1m
+
2m
+
3m
+

Set matrix for each plane. +Matrix is sequence of 9, 25 or 49 signed numbers. +Default value for each plane is 0 0 0 0 1 0 0 0 0. +

+
+
0rdiv
+
1rdiv
+
2rdiv
+
3rdiv
+

Set multiplier for calculated value for each plane. +If unset or 0, it will be sum of all matrix elements. +The option value must be a float number greater or equal to 0.0. Default value is 1.0. +

+
+
0bias
+
1bias
+
2bias
+
3bias
+

Set bias for each plane. This value is added to the result of the multiplication. +Useful for making the overall image brighter or darker. +The option value must be a float number greater or equal to 0.0. Default value is 0.0. +

+
+
+ + +
+

12.4.1 Examples

+ +
    +
  • Apply sharpen: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0, hwdownload" OUTPUT
    +
    + +
  • Apply blur: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9, hwdownload" OUTPUT
    +
    + +
  • Apply edge enhance: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128, hwdownload" OUTPUT
    +
    + +
  • Apply edge detect: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128, hwdownload" OUTPUT
    +
    + +
  • Apply laplacian edge detector which includes diagonals: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0, hwdownload" OUTPUT
    +
    + +
  • Apply emboss: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

12.5 erosion_opencl

+ +

Apply erosion effect to the video. +

+

This filter replaces the pixel by the local(3x3) minimum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane. Range is [0, 65535] and default value is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. +Range is [0, 255] and default value is 255, i.e. all eight pixels are used. +

+

Flags to local 3x3 coordinates region centered on x: +

+

1 2 3 +

+

4 x 5 +

+

6 7 8 +

+
+ + +
+

12.5.1 Example

+ +
    +
  • Apply erosion filter with threshold0 set to 30, threshold1 set 40, threshold2 set to 50 and coordinates set to 231, setting each pixel of the output to the local minimum between pixels: 1, 2, 3, 6, 7, 8 of the 3x3 region centered on it in the input. If the difference between input pixel and local minimum is more then threshold of the corresponding plane, output pixel will be set to input pixel - threshold of corresponding plane. +
    +
    -i INPUT -vf "hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

12.6 deshake_opencl

+

Feature-point based video stabilization filter. +

+

The filter accepts the following options: +

+
+
tripod
+

Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to 0. +

+
+
debug
+

Whether or not additional debug info should be displayed, both in the processed output and in the console. +

+

Note that in order to see console debug output you will also need to pass -v verbose to ffmpeg. +

+

Viewing point matches in the output video is only supported for RGB input. +

+

Defaults to 0. +

+
+
adaptive_crop
+

Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels. +

+

Defaults to 1. +

+
+
refine_features
+

Whether or not feature points should be refined at a sub-pixel level. +

+

This can be turned off for a slight performance gain at the cost of precision. +

+

Defaults to 1. +

+
+
smooth_strength
+

The strength of the smoothing applied to the camera path from 0.0 to 1.0. +

+

1.0 is the maximum smoothing strength while values less than that result in less smoothing. +

+

0.0 causes the filter to adaptively choose a smoothing strength on a per-frame basis. +

+

Defaults to 0.0. +

+
+
smooth_window_multiplier
+

Controls the size of the smoothing window (the number of frames buffered to determine motion information from). +

+

The size of the smoothing window is determined by multiplying the framerate of the video by this number. +

+

Acceptable values range from 0.1 to 10.0. +

+

Larger values increase the amount of motion data available for determining how to smooth the camera path, +potentially improving smoothness, but also increase latency and memory usage. +

+

Defaults to 2.0. +

+
+
+ + +
+

12.6.1 Examples

+ +
    +
  • Stabilize a video with a fixed, medium smoothing strength: +
    +
    -i INPUT -vf "hwupload, deshake_opencl=smooth_strength=0.5, hwdownload" OUTPUT
    +
    + +
  • Stabilize a video with debugging (both in console and in rendered video): +
    +
    -i INPUT -filter_complex "[0:v]format=rgba, hwupload, deshake_opencl=debug=1, hwdownload, format=rgba, format=yuv420p" -v verbose OUTPUT
    +
    +
+ +
+
+
+

12.7 dilation_opencl

+ +

Apply dilation effect to the video. +

+

This filter replaces the pixel by the local(3x3) maximum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane. Range is [0, 65535] and default value is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. +Range is [0, 255] and default value is 255, i.e. all eight pixels are used. +

+

Flags to local 3x3 coordinates region centered on x: +

+

1 2 3 +

+

4 x 5 +

+

6 7 8 +

+
+ + +
+

12.7.1 Example

+ +
    +
  • Apply dilation filter with threshold0 set to 30, threshold1 set 40, threshold2 set to 50 and coordinates set to 231, setting each pixel of the output to the local maximum between pixels: 1, 2, 3, 6, 7, 8 of the 3x3 region centered on it in the input. If the difference between input pixel and local maximum is more then threshold of the corresponding plane, output pixel will be set to input pixel + threshold of corresponding plane. +
    +
    -i INPUT -vf "hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

12.8 nlmeans_opencl

+ +

Non-local Means denoise filter through OpenCL, this filter accepts same options as nlmeans. +

+
+
+

12.9 overlay_opencl

+ +

Overlay one video on top of another. +

+

It takes two inputs and has one output. The first input is the "main" video on which the second input is overlaid. +This filter requires same memory layout for all the inputs. So, format conversion may be needed. +

+

The filter accepts the following options: +

+
+
x
+

Set the x coordinate of the overlaid video on the main video. +Default value is 0. +

+
+
y
+

Set the y coordinate of the overlaid video on the main video. +Default value is 0. +

+
+
+ + +
+

12.9.1 Examples

+ +
    +
  • Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs are yuv420p format. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_opencl, hwdownload" OUTPUT
    +
    +
  • The inputs have same memory layout for color channels , the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_opencl, hwdownload" OUTPUT
    +
    + +
+ +
+
+
+

12.10 pad_opencl

+ +

Add paddings to the input image, and place the original input at the +provided x, y coordinates. +

+

It accepts the following options: +

+
+
width, w
+
height, h
+

Specify an expression for the size of the output image with the +paddings added. If the value for width or height is 0, the +corresponding input size is used for the output. +

+

The width expression can reference the value set by the +height expression, and vice versa. +

+

The default value of width and height is 0. +

+
+
x
+
y
+

Specify the offsets to place the input image at within the padded area, +with respect to the top/left border of the output image. +

+

The x expression can reference the value set by the y +expression, and vice versa. +

+

The default value of x and y is 0. +

+

If x or y evaluate to a negative number, they’ll be changed +so the input image is centered on the padded area. +

+
+
color
+

Specify the color of the padded area. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. +

+
+
aspect
+

Pad to an aspect instead to a resolution. +

+
+ +

The value for the width, height, x, and y +options are expressions containing the following constants: +

+
+
in_w
+
in_h
+

The input video width and height. +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output width and height (the size of the padded area), as +specified by the width and height expressions. +

+
+
ow
+
oh
+

These are the same as out_w and out_h. +

+
+
x
+
y
+

The x and y offsets as specified by the x and y +expressions, or NAN if not yet specified. +

+
+
a
+

same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (iw / ih) * sar +

+
+ +
+
+

12.11 prewitt_opencl

+ +

Apply the Prewitt operator (https://en.wikipedia.org/wiki/Prewitt_operator) to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +Range is [0.0, 65535] and default value is 1.0. +

+
+
delta
+

Set value which will be added to filtered result. +Range is [-65535, 65535] and default value is 0.0. +

+
+ + +
+

12.11.1 Example

+ +
    +
  • Apply the Prewitt operator with scale set to 2 and delta set to 10. +
    +
    -i INPUT -vf "hwupload, prewitt_opencl=scale=2:delta=10, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

12.12 program_opencl

+ +

Filter video using an OpenCL program. +

+
+
source
+

OpenCL program source file. +

+
+
kernel
+

Kernel name in program. +

+
+
inputs
+

Number of inputs to the filter. Defaults to 1. +

+
+
size, s
+

Size of output frames. Defaults to the same as the first input. +

+
+
+ +

The program_opencl filter also supports the framesync options. +

+

The program source file must contain a kernel function with the given name, +which will be run once for each plane of the output. Each run on a plane +gets enqueued as a separate 2D global NDRange with one work-item for each +pixel to be generated. The global ID offset for each work-item is therefore +the coordinates of a pixel in the destination image. +

+

The kernel function needs to take the following arguments: +

    +
  • Destination image, __write_only image2d_t. + +

    This image will become the output; the kernel should write all of it. +

  • Frame index, unsigned int. + +

    This is a counter starting from zero and increasing by one for each frame. +

  • Source images, __read_only image2d_t. + +

    These are the most recent images on each input. The kernel may read from +them to generate the output, but they can’t be written to. +

+ +

Example programs: +

+
    +
  • Copy the input to the output (output must be the same size as the input). +
    __kernel void copy(__write_only image2d_t destination,
    +                   unsigned int index,
    +                   __read_only  image2d_t source)
    +{
    +    const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
    +
    +    int2 location = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float4 value = read_imagef(source, sampler, location);
    +
    +    write_imagef(destination, location, value);
    +}
    +
    +
  • Apply a simple transformation, rotating the input by an amount increasing +with the index counter. Pixel values are linearly interpolated by the +sampler, and the output need not have the same dimensions as the input. +
    __kernel void rotate_image(__write_only image2d_t dst,
    +                           unsigned int index,
    +                           __read_only  image2d_t src)
    +{
    +    const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
    +                               CLK_FILTER_LINEAR);
    +
    +    float angle = (float)index / 100.0f;
    +
    +    float2 dst_dim = convert_float2(get_image_dim(dst));
    +    float2 src_dim = convert_float2(get_image_dim(src));
    +
    +    float2 dst_cen = dst_dim / 2.0f;
    +    float2 src_cen = src_dim / 2.0f;
    +
    +    int2   dst_loc = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float2 dst_pos = convert_float2(dst_loc) - dst_cen;
    +    float2 src_pos = {
    +        cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
    +        sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
    +    };
    +    src_pos = src_pos * src_dim / dst_dim;
    +
    +    float2 src_loc = src_pos + src_cen;
    +
    +    if (src_loc.x < 0.0f      || src_loc.y < 0.0f ||
    +        src_loc.x > src_dim.x || src_loc.y > src_dim.y)
    +        write_imagef(dst, dst_loc, 0.5f);
    +    else
    +        write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
    +}
    +
    +
  • Blend two inputs together, with the amount of each input used varying +with the index counter. +
    __kernel void blend_images(__write_only image2d_t dst,
    +                           unsigned int index,
    +                           __read_only  image2d_t src1,
    +                           __read_only  image2d_t src2)
    +{
    +    const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
    +                               CLK_FILTER_LINEAR);
    +
    +    float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
    +
    +    int2  dst_loc = (int2)(get_global_id(0), get_global_id(1));
    +    int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
    +    int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
    +
    +    float4 val1 = read_imagef(src1, sampler, src1_loc);
    +    float4 val2 = read_imagef(src2, sampler, src2_loc);
    +
    +    write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
    +}
    +
    +
+ +
+
+

12.13 remap_opencl

+ +

Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream. +

+

Destination pixel at position (X, Y) will be picked from source (x, y) position +where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero +value for pixel will be used for destination pixel. +

+

Xmap and Ymap input video streams must be of same dimensions. Output video stream +will have Xmap/Ymap video stream dimensions. +Xmap and Ymap input video streams are 32bit float pixel format, single channel. +

+
+
interp
+

Specify interpolation used for remapping of pixels. +Allowed values are near and linear. +Default value is linear. +

+
+
fill
+

Specify the color of the unmapped pixels. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Default color is black. +

+
+ +
+
+

12.14 roberts_opencl

+

Apply the Roberts cross operator (https://en.wikipedia.org/wiki/Roberts_cross) to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +Range is [0.0, 65535] and default value is 1.0. +

+
+
delta
+

Set value which will be added to filtered result. +Range is [-65535, 65535] and default value is 0.0. +

+
+ + +
+

12.14.1 Example

+ +
    +
  • Apply the Roberts cross operator with scale set to 2 and delta set to 10 +
    +
    -i INPUT -vf "hwupload, roberts_opencl=scale=2:delta=10, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

12.15 sobel_opencl

+ +

Apply the Sobel operator (https://en.wikipedia.org/wiki/Sobel_operator) to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +Range is [0.0, 65535] and default value is 1.0. +

+
+
delta
+

Set value which will be added to filtered result. +Range is [-65535, 65535] and default value is 0.0. +

+
+ + +
+

12.15.1 Example

+ +
    +
  • Apply sobel operator with scale set to 2 and delta set to 10 +
    +
    -i INPUT -vf "hwupload, sobel_opencl=scale=2:delta=10, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

12.16 tonemap_opencl

+ +

Perform HDR(PQ/HLG) to SDR conversion with tone-mapping. +

+

It accepts the following parameters: +

+
+
tonemap
+

Specify the tone-mapping operator to be used. Same as tonemap option in tonemap. +

+
+
param
+

Tune the tone mapping algorithm. same as param option in tonemap. +

+
+
desat
+

Apply desaturation for highlights that exceed this level of brightness. The +higher the parameter, the more color information will be preserved. This +setting helps prevent unnaturally blown-out colors for super-highlights, by +(smoothly) turning into white instead. This makes images feel more natural, +at the cost of reducing information about out-of-range colors. +

+

The default value is 0.5, and the algorithm here is a little different from +the cpu version tonemap currently. A setting of 0.0 disables this option. +

+
+
threshold
+

The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold +is used to detect whether the scene has changed or not. If the distance between +the current frame average brightness and the current running average exceeds +a threshold value, we would re-calculate scene average and peak brightness. +The default value is 0.2. +

+
+
format
+

Specify the output pixel format. +

+

Currently supported formats are: +

+
p010
+
nv12
+
+ +
+
range, r
+

Set the output color range. +

+

Possible values are: +

+
tv/mpeg
+
pc/jpeg
+
+ +

Default is same as input. +

+
+
primaries, p
+

Set the output color primaries. +

+

Possible values are: +

+
bt709
+
bt2020
+
+ +

Default is same as input. +

+
+
transfer, t
+

Set the output transfer characteristics. +

+

Possible values are: +

+
bt709
+
bt2020
+
+ +

Default is bt709. +

+
+
matrix, m
+

Set the output colorspace matrix. +

+

Possible value are: +

+
bt709
+
bt2020
+
+ +

Default is same as input. +

+
+
+ + +
+

12.16.1 Example

+ +
    +
  • Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator. +
    +
    -i INPUT -vf "format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010" OUTPUT
    +
    +
+ +
+
+
+

12.17 unsharp_opencl

+ +

Sharpen or blur the input video. +

+

It accepts the following parameters: +

+
+
luma_msize_x, lx
+

Set the luma matrix horizontal size. +Range is [1, 23] and default value is 5. +

+
+
luma_msize_y, ly
+

Set the luma matrix vertical size. +Range is [1, 23] and default value is 5. +

+
+
luma_amount, la
+

Set the luma effect strength. +Range is [-10, 10] and default value is 1.0. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+
+
chroma_msize_x, cx
+

Set the chroma matrix horizontal size. +Range is [1, 23] and default value is 5. +

+
+
chroma_msize_y, cy
+

Set the chroma matrix vertical size. +Range is [1, 23] and default value is 5. +

+
+
chroma_amount, ca
+

Set the chroma effect strength. +Range is [-10, 10] and default value is 0.0. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+
+
+ +

All parameters are optional and default to the equivalent of the +string ’5:5:1.0:5:5:0.0’. +

+ +
+

12.17.1 Examples

+ +
    +
  • Apply strong luma sharpen effect: +
    +
    -i INPUT -vf "hwupload, unsharp_opencl=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5, hwdownload" OUTPUT
    +
    + +
  • Apply a strong blur of both luma and chroma parameters: +
    +
    -i INPUT -vf "hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

12.18 xfade_opencl

+ +

Cross fade two videos with custom transition effect by using OpenCL. +

+

It accepts the following options: +

+
+
transition
+

Set one of possible transition effects. +

+
+
custom
+

Select custom transition effect, the actual transition description +will be picked from source and kernel options. +

+
+
fade
+
wipeleft
+
wiperight
+
wipeup
+
wipedown
+
slideleft
+
slideright
+
slideup
+
slidedown
+
+

Default transition is fade. +

+
+ +
+
source
+

OpenCL program source file for custom transition. +

+
+
kernel
+

Set name of kernel to use for custom transition from program source file. +

+
+
duration
+

Set duration of video transition. +

+
+
offset
+

Set time of start of transition relative to first video. +

+
+ +

The program source file must contain a kernel function with the given name, +which will be run once for each plane of the output. Each run on a plane +gets enqueued as a separate 2D global NDRange with one work-item for each +pixel to be generated. The global ID offset for each work-item is therefore +the coordinates of a pixel in the destination image. +

+

The kernel function needs to take the following arguments: +

    +
  • Destination image, __write_only image2d_t. + +

    This image will become the output; the kernel should write all of it. +

    +
  • First Source image, __read_only image2d_t. +Second Source image, __read_only image2d_t. + +

    These are the most recent images on each input. The kernel may read from +them to generate the output, but they can’t be written to. +

    +
  • Transition progress, float. This value is always between 0 and 1 inclusive. +
+ +

Example programs: +

+
    +
  • Apply dots curtain transition effect: +
    __kernel void blend_images(__write_only image2d_t dst,
    +                           __read_only  image2d_t src1,
    +                           __read_only  image2d_t src2,
    +                           float progress)
    +{
    +    const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
    +                               CLK_FILTER_LINEAR);
    +    int2  p = (int2)(get_global_id(0), get_global_id(1));
    +    float2 rp = (float2)(get_global_id(0), get_global_id(1));
    +    float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
    +    rp = rp / dim;
    +
    +    float2 dots = (float2)(20.0, 20.0);
    +    float2 center = (float2)(0,0);
    +    float2 unused;
    +
    +    float4 val1 = read_imagef(src1, sampler, p);
    +    float4 val2 = read_imagef(src2, sampler, p);
    +    bool next = distance(fract(rp * dots, &unused), (float2)(0.5, 0.5)) < (progress / distance(rp, center));
    +
    +    write_imagef(dst, p, next ? val1 : val2);
    +}
    +
    +
+ + +
+
+
+

13 VAAPI Video Filters

+ +

VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters. +

+

To enable compilation of these filters you need to configure FFmpeg with +--enable-vaapi. +

+

To use vaapi filters, you need to setup the vaapi device correctly. For more information, please read https://trac.ffmpeg.org/wiki/Hardware/VAAPI +

+ +
+

13.1 overlay_vaapi

+ +

Overlay one video on the top of another. +

+

It takes two inputs and has one output. The first input is the "main" video on which the second input is overlaid. +

+

The filter accepts the following options: +

+
+
x
+
y
+

Set expressions for the x and y coordinates of the overlaid video +on the main video. +

+

Default value is "0" for both expressions. +

+
+
w
+
h
+

Set expressions for the width and height the overlaid video +on the main video. +

+

Default values are ’overlay_iw’ for ’w’ and ’overlay_ih*w/overlay_iw’ for ’h’. +

+

The expressions can contain the following parameters: +

+
+
main_w, W
+
main_h, H
+

The main input width and height. +

+
+
overlay_iw
+
overlay_ih
+

The overlay input width and height. +

+
+
overlay_w, w
+
overlay_h, h
+

The overlay output width and height. +

+
+
overlay_x, x
+
overlay_y, y
+

Position of the overlay layer inside of main +

+
+
+ +
+
alpha
+

Set transparency of overlaid video. Allowed range is 0.0 to 1.0. +Higher value means lower transparency. +Default value is 1.0. +

+
+
eof_action
+

See framesync. +

+
+
shortest
+

See framesync. +

+
+
repeatlast
+

See framesync. +

+
+
+ +

This filter also supports the framesync options. +

+
+

13.1.1 Examples

+ +
    +
  • Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs for this filter are yuv420p format. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_vaapi" OUTPUT
    +
    +
  • Overlay an image LOGO at the offset (200, 100) from the top-left corner of the INPUT video. +The inputs have same memory layout for color channels, the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_vaapi=x=200:y=100:w=400:h=300:alpha=1.0, hwdownload, format=nv12" OUTPUT
    +
    + +
+ +
+
+
+

13.2 tonemap_vaapi

+ +

Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping. +It maps the dynamic range of HDR10 content to the SDR content. +It currently only accepts HDR10 as input. +

+

It accepts the following parameters: +

+
+
format
+

Specify the output pixel format. +

+

Currently supported formats are: +

+
p010
+
nv12
+
+ +

Default is nv12. +

+
+
primaries, p
+

Set the output color primaries. +

+

Default is same as input. +

+
+
transfer, t
+

Set the output transfer characteristics. +

+

Default is bt709. +

+
+
matrix, m
+

Set the output colorspace matrix. +

+

Default is same as input. +

+
+
+ + +
+

13.2.1 Example

+ +
    +
  • Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format +
    +
    tonemap_vaapi=format=p010:t=bt2020-10
    +
    +
+ +
+
+
+

13.3 hstack_vaapi

+

Stack input videos horizontally. +

+

This is the VA-API variant of the hstack filter, each input stream may +have different height, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See hstack. +

+
+
shortest
+

See hstack. +

+
+
height
+

Set height of output. If set to 0, this filter will set height of output to +height of the first input stream. Default value is 0. +

+
+ +
+
+

13.4 vstack_vaapi

+

Stack input videos vertically. +

+

This is the VA-API variant of the vstack filter, each input stream may +have different width, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See vstack. +

+
+
shortest
+

See vstack. +

+
+
width
+

Set width of output. If set to 0, this filter will set width of output to +width of the first input stream. Default value is 0. +

+
+ +
+
+

13.5 xstack_vaapi

+

Stack video inputs into custom layout. +

+

This is the VA-API variant of the xstack filter, each input stream may +have different size, this filter will scale down/up each input stream to the +given output size, or the size of the first input stream. +

+

It accepts the following options: +

+
+
inputs
+

See xstack. +

+
+
shortest
+

See xstack. +

+
+
layout
+

See xstack. +Moreover, this permits the user to supply output size for each input stream. +

+
xstack_vaapi=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
+
+ +
+
grid
+

See xstack. +

+
+
grid_tile_size
+

Set output size for each input stream when grid is set. If this option +is not set, this filter will set output size by default to the size of the +first input stream. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
fill
+

See xstack. +

+
+ + +
+
+
+

14 QSV Video Filters

+ +

Below is a description of the currently available QSV video filters. +

+

To enable compilation of these filters you need to configure FFmpeg with +--enable-libmfx or --enable-libvpl. +

+

To use QSV filters, you need to setup the QSV device correctly. For more information, please read https://trac.ffmpeg.org/wiki/Hardware/QuickSync +

+ +
+

14.1 hstack_qsv

+

Stack input videos horizontally. +

+

This is the QSV variant of the hstack filter, each input stream may +have different height, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See hstack. +

+
+
shortest
+

See hstack. +

+
+
height
+

Set height of output. If set to 0, this filter will set height of output to +height of the first input stream. Default value is 0. +

+
+ +
+
+

14.2 vstack_qsv

+

Stack input videos vertically. +

+

This is the QSV variant of the vstack filter, each input stream may +have different width, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See vstack. +

+
+
shortest
+

See vstack. +

+
+
width
+

Set width of output. If set to 0, this filter will set width of output to +width of the first input stream. Default value is 0. +

+
+ +
+
+

14.3 xstack_qsv

+

Stack video inputs into custom layout. +

+

This is the QSV variant of the xstack filter. +

+

It accepts the following options: +

+
+
inputs
+

See xstack. +

+
+
shortest
+

See xstack. +

+
+
layout
+

See xstack. +Moreover, this permits the user to supply output size for each input stream. +

+
xstack_qsv=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
+
+ +
+
grid
+

See xstack. +

+
+
grid_tile_size
+

Set output size for each input stream when grid is set. If this option +is not set, this filter will set output size by default to the size of the +first input stream. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
fill
+

See xstack. +

+
+ + +
+
+
+

15 Video Sources

+ +

Below is a description of the currently available video sources. +

+ +
+

15.1 buffer

+ +

Buffer video frames, and make them available to the filter chain. +

+

This source is mainly intended for a programmatic use, in particular +through the interface defined in libavfilter/buffersrc.h. +

+

It accepts the following parameters: +

+
+
video_size
+

Specify the size (width and height) of the buffered video frames. For the +syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
width
+

The input video width. +

+
+
height
+

The input video height. +

+
+
pix_fmt
+

A string representing the pixel format of the buffered video frames. +It may be a number corresponding to a pixel format, or a pixel format +name. +

+
+
time_base
+

Specify the timebase assumed by the timestamps of the buffered frames. +

+
+
frame_rate
+

Specify the frame rate expected for the video stream. +

+
+
pixel_aspect, sar
+

The sample (pixel) aspect ratio of the input video. +

+
+
hw_frames_ctx
+

When using a hardware pixel format, this should be a reference to an +AVHWFramesContext describing input frames. +

+
+ +

For example: +

+
buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
+
+ +

will instruct the source to accept video frames with size 320x240 and +with format "yuv410p", assuming 1/24 as the timestamps timebase and +square pixels (1:1 sample aspect ratio). +Since the pixel format with name "yuv410p" corresponds to the number 6 +(check the enum AVPixelFormat definition in libavutil/pixfmt.h), +this example corresponds to: +

+
buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
+
+ +

Alternatively, the options can be specified as a flat string, but this +syntax is deprecated: +

+

width:height:pix_fmt:time_base.num:time_base.den:pixel_aspect.num:pixel_aspect.den +

+
+
+

15.2 cellauto

+ +

Create a pattern generated by an elementary cellular automaton. +

+

The initial state of the cellular automaton can be defined through the +filename and pattern options. If such options are +not specified an initial state is created randomly. +

+

At each new frame a new row in the video is filled with the result of +the cellular automaton next generation. The behavior when the whole +frame is filled is defined by the scroll option. +

+

This source accepts the following options: +

+
+
filename, f
+

Read the initial cellular automaton state, i.e. the starting row, from +the specified file. +In the file, each non-whitespace character is considered an alive +cell, a newline will terminate the row, and further characters in the +file will be ignored. +

+
+
pattern, p
+

Read the initial cellular automaton state, i.e. the starting row, from +the specified string. +

+

Each non-whitespace character in the string is considered an alive +cell, a newline will terminate the row, and further characters in the +string will be ignored. +

+
+
rate, r
+

Set the video rate, that is the number of frames generated per second. +Default is 25. +

+
+
random_fill_ratio, ratio
+

Set the random fill ratio for the initial cellular automaton row. It +is a floating point number value ranging from 0 to 1, defaults to +1/PHI. +

+

This option is ignored when a file or a pattern is specified. +

+
+
random_seed, seed
+

Set the seed for filling randomly the initial row, must be an integer +included between 0 and UINT32_MAX. If not specified, or if explicitly +set to -1, the filter will try to use a good random seed on a best +effort basis. +

+
+
rule
+

Set the cellular automaton rule, it is a number ranging from 0 to 255. +Default value is 110. +

+
+
size, s
+

Set the size of the output video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+

If filename or pattern is specified, the size is set +by default to the width of the specified initial state row, and the +height is set to width * PHI. +

+

If size is set, it must contain the width of the specified +pattern string, and the specified pattern will be centered in the +larger row. +

+

If a filename or a pattern string is not specified, the size value +defaults to "320x518" (used for a randomly generated initial state). +

+
+
scroll
+

If set to 1, scroll the output upward when all the rows in the output +have been already filled. If set to 0, the new generated row will be +written over the top row just after the bottom row is filled. +Defaults to 1. +

+
+
start_full, full
+

If set to 1, completely fill the output with generated rows before +outputting the first frame. +This is the default behavior, for disabling set the value to 0. +

+
+
stitch
+

If set to 1, stitch the left and right row edges together. +This is the default behavior, for disabling set the value to 0. +

+
+ + +
+

15.2.1 Examples

+ +
    +
  • Read the initial state from pattern, and specify an output of +size 200x400. +
    +
    cellauto=f=pattern:s=200x400
    +
    + +
  • Generate a random initial row with a width of 200 cells, with a fill +ratio of 2/3: +
    +
    cellauto=ratio=2/3:s=200x200
    +
    + +
  • Create a pattern generated by rule 18 starting by a single alive cell +centered on an initial row with width 100: +
    +
    cellauto=p=@:s=100x400:full=0:rule=18
    +
    + +
  • Specify a more elaborated initial pattern: +
    +
    cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
    +
    + +
+ +
+
+
+

15.3 coreimagesrc

+

Video source generated on GPU using Apple’s CoreImage API on OSX. +

+

This video source is a specialized version of the coreimage video filter. +Use a core image generator at the beginning of the applied filterchain to +generate the content. +

+

The coreimagesrc video source accepts the following options: +

+
list_generators
+

List all available generators along with all their respective options as well as +possible minimum and maximum values along with the default values. +

+
list_generators=true
+
+ +
+
size, s
+

Specify the size of the sourced video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +The default value is 320x240. +

+
+
rate, r
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a floating point +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
sar
+

Set the sample aspect ratio of the sourced video. +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+ +

Additionally, all options of the coreimage video filter are accepted. +A complete filterchain can be used for further processing of the +generated input without CPU-HOST transfer. See coreimage documentation +and examples for details. +

+ +
+

15.3.1 Examples

+ +
    +
  • Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage, +given as complete and escaped command-line for Apple’s standard bash shell: +
    +
    ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
    +
    +

    This example is equivalent to the QRCode example of coreimage without the +need for a nullsrc video source. +

+ + +
+
+
+

15.4 ddagrab

+ +

Captures the Windows Desktop via Desktop Duplication API. +

+

The filter exclusively returns D3D11 Hardware Frames, for on-gpu encoding +or processing. So an explicit hwdownload is needed for any kind of +software processing. +

+

It accepts the following options: +

+
+
output_idx
+

DXGI Output Index to capture. +

+

Usually corresponds to the index Windows has given the screen minus one, +so it’s starting at 0. +

+

Defaults to output 0. +

+
+
draw_mouse
+

Whether to draw the mouse cursor. +

+

Defaults to true. +

+

Only affects hardware cursors. If a game or application renders its own cursor, +it’ll always be captured. +

+
+
framerate
+

Framerate at which the desktop will be captured. +

+

Defaults to 30 FPS. +

+
+
video_size
+

Specify the size of the captured video. +

+

Defaults to the full size of the screen. +

+

Cropped from the bottom/right if smaller than screen size. +

+
+
offset_x
+

Horizontal offset of the captured video. +

+
+
offset_y
+

Vertical offset of the captured video. +

+
+
output_fmt
+

Desired filter output format. +Defaults to 8 Bit BGRA. +

+

It accepts the following values: +

+
auto
+

Passes all supported output formats to DDA and returns what DDA decides to use. +

+
8bit
+
bgra
+

8 Bit formats always work, and DDA will convert to them if neccesary. +

+
10bit
+
x2bgr10
+

Filter initialization will fail if 10 bit format is requested but unavailable. +

+
+ +
+
+ + +
+

15.4.1 Examples

+ +

Capture primary screen and encode using nvenc: +

+
ffmpeg -f lavfi -i ddagrab -c:v h264_nvenc -cq 18 output.mp4
+
+ +

You can also skip the lavfi device and directly use the filter. +Also demonstrates downloading the frame and encoding with libx264. +Explicit output format specification is required in this case: +

+
ffmpeg -filter_complex ddagrab=output_idx=1:framerate=60,hwdownload,format=bgra -c:v libx264 -crf 18 output.mp4
+
+ +

If you want to capture only a subsection of the desktop, this can be achieved +by specifying a smaller size and its offsets into the screen: +

+
ddagrab=video_size=800x600:offset_x=100:offset_y=100
+
+ + +
+
+
+

15.5 gradients

+

Generate several gradients. +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "640x480". +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
c0, c1, c2, c3, c4, c5, c6, c7
+

Set 8 colors. Default values for colors is to pick random one. +

+
+
x0, y0, y0, y1
+

Set gradient line source and destination points. If negative or out of range, random ones +are picked. +

+
+
nb_colors, n
+

Set number of colors to use at once. Allowed range is from 2 to 8. Default value is 2. +

+
+
seed
+

Set seed for picking gradient line points. +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+
speed
+

Set speed of gradients rotation. +

+
+
type, t
+

Set type of gradients, can be linear or radial or circular or spiral. +

+
+ + +
+
+

15.6 mandelbrot

+ +

Generate a Mandelbrot set fractal, and progressively zoom towards the +point specified with start_x and start_y. +

+

This source accepts the following options: +

+
+
end_pts
+

Set the terminal pts value. Default value is 400. +

+
+
end_scale
+

Set the terminal scale value. +Must be a floating point value. Default value is 0.3. +

+
+
inner
+

Set the inner coloring mode, that is the algorithm used to draw the +Mandelbrot fractal internal region. +

+

It shall assume one of the following values: +

+
black
+

Set black mode. +

+
convergence
+

Show time until convergence. +

+
mincol
+

Set color based on point closest to the origin of the iterations. +

+
period
+

Set period mode. +

+
+ +

Default value is mincol. +

+
+
bailout
+

Set the bailout value. Default value is 10.0. +

+
+
maxiter
+

Set the maximum of iterations performed by the rendering +algorithm. Default value is 7189. +

+
+
outer
+

Set outer coloring mode. +It shall assume one of following values: +

+
iteration_count
+

Set iteration count mode. +

+
normalized_iteration_count
+

set normalized iteration count mode. +

+
+

Default value is normalized_iteration_count. +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "640x480". +

+
+
start_scale
+

Set the initial scale value. Default value is 3.0. +

+
+
start_x
+

Set the initial x position. Must be a floating point value between +-100 and 100. Default value is -0.743643887037158704752191506114774. +

+
+
start_y
+

Set the initial y position. Must be a floating point value between +-100 and 100. Default value is -0.131825904205311970493132056385139. +

+
+ +
+
+

15.7 mptestsrc

+ +

Generate various test patterns, as generated by the MPlayer test filter. +

+

The size of the generated video is fixed, and is 256x256. +This source is useful in particular for testing encoding features. +

+

This source accepts the following options: +

+
+
rate, r
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a floating point +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+
test, t
+
+

Set the number or the name of the test to perform. Supported tests are: +

+
dc_luma
+
dc_chroma
+
freq_luma
+
freq_chroma
+
amp_luma
+
amp_chroma
+
cbp
+
mv
+
ring1
+
ring2
+
all
+
max_frames, m
+

Set the maximum number of frames generated for each test, default value is 30. +

+
+
+ +

Default value is "all", which will cycle through the list of all tests. +

+
+ +

Some examples: +

+
mptestsrc=t=dc_luma
+
+ +

will generate a "dc_luma" test pattern. +

+
+
+

15.8 frei0r_src

+ +

Provide a frei0r source. +

+

To enable compilation of this filter you need to install the frei0r +header and configure FFmpeg with --enable-frei0r. +

+

This source accepts the following parameters: +

+
+
size
+

The size of the video to generate. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
framerate
+

The framerate of the generated video. It may be a string of the form +num/den or a frame rate abbreviation. +

+
+
filter_name
+

The name to the frei0r source to load. For more information regarding frei0r and +how to set the parameters, read the frei0r section in the video filters +documentation. +

+
+
filter_params
+

A ’|’-separated list of parameters to pass to the frei0r source. +

+
+
+ +

For example, to generate a frei0r partik0l source with size 200x200 +and frame rate 10 which is overlaid on the overlay filter main input: +

+
frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
+
+ +
+
+

15.9 life

+ +

Generate a life pattern. +

+

This source is based on a generalization of John Conway’s life game. +

+

The sourced input represents a life grid, each pixel represents a cell +which can be in one of two possible states, alive or dead. Every cell +interacts with its eight neighbours, which are the cells that are +horizontally, vertically, or diagonally adjacent. +

+

At each interaction the grid evolves according to the adopted rule, +which specifies the number of neighbor alive cells which will make a +cell stay alive or born. The rule option allows one to specify +the rule to adopt. +

+

This source accepts the following options: +

+
+
filename, f
+

Set the file from which to read the initial grid state. In the file, +each non-whitespace character is considered an alive cell, and newline +is used to delimit the end of each row. +

+

If this option is not specified, the initial grid is generated +randomly. +

+
+
rate, r
+

Set the video rate, that is the number of frames generated per second. +Default is 25. +

+
+
random_fill_ratio, ratio
+

Set the random fill ratio for the initial random grid. It is a +floating point number value ranging from 0 to 1, defaults to 1/PHI. +It is ignored when a file is specified. +

+
+
random_seed, seed
+

Set the seed for filling the initial random grid, must be an integer +included between 0 and UINT32_MAX. If not specified, or if explicitly +set to -1, the filter will try to use a good random seed on a best +effort basis. +

+
+
rule
+

Set the life rule. +

+

A rule can be specified with a code of the kind "SNS/BNB", +where NS and NB are sequences of numbers in the range 0-8, +NS specifies the number of alive neighbor cells which make a +live cell stay alive, and NB the number of alive neighbor cells +which make a dead cell to become alive (i.e. to "born"). +"s" and "b" can be used in place of "S" and "B", respectively. +

+

Alternatively a rule can be specified by an 18-bits integer. The 9 +high order bits are used to encode the next cell state if it is alive +for each number of neighbor alive cells, the low order bits specify +the rule for "borning" new cells. Higher order bits encode for an +higher number of neighbor cells. +For example the number 6153 = (12<<9)+9 specifies a stay alive +rule of 12 and a born rule of 9, which corresponds to "S23/B03". +

+

Default value is "S23/B3", which is the original Conway’s game of life +rule, and will keep a cell alive if it has 2 or 3 neighbor alive +cells, and will born a new cell if there are three alive cells around +a dead cell. +

+
+
size, s
+

Set the size of the output video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+

If filename is specified, the size is set by default to the +same size of the input file. If size is set, it must contain +the size specified in the input file, and the initial grid defined in +that file is centered in the larger resulting area. +

+

If a filename is not specified, the size value defaults to "320x240" +(used for a randomly generated initial grid). +

+
+
stitch
+

If set to 1, stitch the left and right grid edges together, and the +top and bottom edges also. Defaults to 1. +

+
+
mold
+

Set cell mold speed. If set, a dead cell will go from death_color to +mold_color with a step of mold. mold can have a +value from 0 to 255. +

+
+
life_color
+

Set the color of living (or new born) cells. +

+
+
death_color
+

Set the color of dead cells. If mold is set, this is the first color +used to represent a dead cell. +

+
+
mold_color
+

Set mold color, for definitely dead and moldy cells. +

+

For the syntax of these 3 color options, check the (ffmpeg-utils)"Color" section in the +ffmpeg-utils manual. +

+
+ + +
+

15.9.1 Examples

+ +
    +
  • Read a grid from pattern, and center it on a grid of size +300x300 pixels: +
    +
    life=f=pattern:s=300x300
    +
    + +
  • Generate a random grid of size 200x200, with a fill ratio of 2/3: +
    +
    life=ratio=2/3:s=200x200
    +
    + +
  • Specify a custom rule for evolving a randomly generated grid: +
    +
    life=rule=S14/B34
    +
    + +
  • Full example with slow death effect (mold) using ffplay: +
    +
    ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
    +
    +
+ +
+
+
+

15.10 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc

+ +

The allrgb source returns frames of size 4096x4096 of all rgb colors. +

+

The allyuv source returns frames of size 4096x4096 of all yuv colors. +

+

The color source provides an uniformly colored input. +

+

The colorchart source provides a colors checker chart. +

+

The colorspectrum source provides a color spectrum input. +

+

The haldclutsrc source provides an identity Hald CLUT. See also +haldclut filter. +

+

The nullsrc source returns unprocessed video frames. It is +mainly useful to be employed in analysis / debugging tools, or as the +source for filters which ignore the input data. +

+

The pal75bars source generates a color bars pattern, based on +EBU PAL recommendations with 75% color levels. +

+

The pal100bars source generates a color bars pattern, based on +EBU PAL recommendations with 100% color levels. +

+

The rgbtestsrc source generates an RGB test pattern useful for +detecting RGB vs BGR issues. You should see a red, green and blue +stripe from top to bottom. +

+

The smptebars source generates a color bars pattern, based on +the SMPTE Engineering Guideline EG 1-1990. +

+

The smptehdbars source generates a color bars pattern, based on +the SMPTE RP 219-2002. +

+

The testsrc source generates a test video pattern, showing a +color pattern, a scrolling gradient and a timestamp. This is mainly +intended for testing purposes. +

+

The testsrc2 source is similar to testsrc, but supports more +pixel formats instead of just rgb24. This allows using it as an +input for other tests without requiring a format conversion. +

+

The yuvtestsrc source generates an YUV test pattern. You should +see a y, cb and cr stripe from top to bottom. +

+

The sources accept the following parameters: +

+
+
level
+

Specify the level of the Hald CLUT, only available in the haldclutsrc +source. A level of N generates a picture of N*N*N by N*N*N +pixels to be used as identity matrix for 3D lookup tables. Each component is +coded on a 1/(N*N) scale. +

+
+
color, c
+

Specify the color of the source, only available in the color +source. For the syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+
+
size, s
+

Specify the size of the sourced video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +The default value is 320x240. +

+

This option is not available with the allrgb, allyuv, and +haldclutsrc filters. +

+
+
rate, r
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a floating point +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+

Since the frame rate is used as time base, all frames including the last one +will have their full duration. If the specified duration is not a multiple +of the frame duration, it will be rounded up. +

+
+
sar
+

Set the sample aspect ratio of the sourced video. +

+
+
alpha
+

Specify the alpha (opacity) of the background, only available in the +testsrc2 source. The value must be between 0 (fully transparent) and +255 (fully opaque, the default). +

+
+
decimals, n
+

Set the number of decimals to show in the timestamp, only available in the +testsrc source. +

+

The displayed timestamp value will correspond to the original +timestamp value multiplied by the power of 10 of the specified +value. Default value is 0. +

+
+
type
+

Set the type of the color spectrum, only available in the +colorspectrum source. Can be one of the following: +

+
+
black
+
white
+
all
+
+ +
+
patch_size
+

Set patch size of single color patch, only available in the +colorchart source. Default is 64x64. +

+
+
preset
+

Set colorchecker colors preset, only available in the +colorchart source. +

+

Available values are: +

+
reference
+
skintones
+
+ +

Default value is reference. +

+
+ + +
+

15.10.1 Examples

+ +
    +
  • Generate a video with a duration of 5.3 seconds, with size +176x144 and a frame rate of 10 frames per second: +
    +
    testsrc=duration=5.3:size=qcif:rate=10
    +
    + +
  • The following graph description will generate a red source +with an opacity of 0.2, with size "qcif" and a frame rate of 10 +frames per second: +
    +
    color=c=red@0.2:s=qcif:r=10
    +
    + +
  • If the input content is to be ignored, nullsrc can be used. The +following command generates noise in the luminance plane by employing +the geq filter: +
    +
    nullsrc=s=256x256, geq=random(1)*255:128:128
    +
    +
+ +
+
+

15.10.2 Commands

+ +

The color source supports the following commands: +

+
+
c, color
+

Set the color of the created image. Accepts the same syntax of the +corresponding color option. +

+
+ +
+
+
+

15.11 openclsrc

+ +

Generate video using an OpenCL program. +

+
+
source
+

OpenCL program source file. +

+
+
kernel
+

Kernel name in program. +

+
+
size, s
+

Size of frames to generate. This must be set. +

+
+
format
+

Pixel format to use for the generated frames. This must be set. +

+
+
rate, r
+

Number of frames generated every second. Default value is ’25’. +

+
+
+ +

For details of how the program loading works, see the program_opencl +filter. +

+

Example programs: +

+
    +
  • Generate a colour ramp by setting pixel values from the position of the pixel +in the output image. (Note that this will work with all pixel formats, but +the generated output will not be the same.) +
    __kernel void ramp(__write_only image2d_t dst,
    +                   unsigned int index)
    +{
    +    int2 loc = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float4 val;
    +    val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
    +
    +    write_imagef(dst, loc, val);
    +}
    +
    +
  • Generate a Sierpinski carpet pattern, panning by a single pixel each frame. +
    __kernel void sierpinski_carpet(__write_only image2d_t dst,
    +                                unsigned int index)
    +{
    +    int2 loc = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float4 value = 0.0f;
    +    int x = loc.x + index;
    +    int y = loc.y + index;
    +    while (x > 0 || y > 0) {
    +        if (x % 3 == 1 && y % 3 == 1) {
    +            value = 1.0f;
    +            break;
    +        }
    +        x /= 3;
    +        y /= 3;
    +    }
    +
    +    write_imagef(dst, loc, value);
    +}
    +
    +
+ +
+
+

15.12 sierpinski

+ +

Generate a Sierpinski carpet/triangle fractal, and randomly pan around. +

+

This source accepts the following options: +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "640x480". +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
seed
+

Set seed which is used for random panning. +

+
+
jump
+

Set max jump for single pan destination. Allowed range is from 1 to 10000. +

+
+
type
+

Set fractal type, can be default carpet or triangle. +

+
+ +
+
+

15.13 zoneplate

+

Generate a zoneplate test video pattern. +

+

This source accepts the following options: +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "320x240". +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+
sar
+

Set the sample aspect ratio of the sourced video. +

+
+
precision
+

Set precision in bits for look-up table for sine calculations. Default value is 10. +Allowed range is from 4 to 16. +

+
+
xo
+

Set horizontal axis offset for output signal. Default value is 0. +

+
+
yo
+

Set vertical axis offset for output signal. Default value is 0. +

+
+
to
+

Set time axis offset for output signal. Default value is 0. +

+
+
k0
+

Set 0-order, constant added to signal phase. Default value is 0. +

+
+
kx
+

Set 1-order, phase factor multiplier for horizontal axis. Default value is 0. +

+
+
ky
+

Set 1-order, phase factor multiplier for vertical axis. Default value is 0. +

+
+
kt
+

Set 1-order, phase factor multiplier for time axis. Default value is 0. +

+
+
kxt, kyt, kxy
+

Set phase factor multipliers for combination of spatial and temporal axis. +Default value is 0. +

+
+
kx2
+

Set 2-order, phase factor multiplier for horizontal axis. Default value is 0. +

+
+
ky2
+

Set 2-order, phase factor multiplier for vertical axis. Default value is 0. +

+
+
kt2
+

Set 2-order, phase factor multiplier for time axis. Default value is 0. +

+
+
ku
+

Set the constant added to final phase to produce chroma-blue component of signal. +Default value is 0. +

+
+
kv
+

Set the constant added to final phase to produce chroma-red component of signal. +Default value is 0. +

+
+ + +
+

15.13.1 Commands

+ +

This source supports the some above options as commands. +

+
+
+

15.13.2 Examples

+ +
    +
  • Generate horizontal color sine sweep: +
    +
    zoneplate=ku=512:kv=0:kt2=0:kx2=256:s=wvga:xo=-426:kt=11
    +
    + +
  • Generate vertical color sine sweep: +
    +
    zoneplate=ku=512:kv=0:kt2=0:ky2=156:s=wvga:yo=-240:kt=11
    +
    + +
  • Generate circular zone-plate: +
    +
    zoneplate=ku=512:kv=100:kt2=0:ky2=256:kx2=556:s=wvga:yo=0:kt=11
    +
    +
+ + +
+
+
+
+

16 Video Sinks

+ +

Below is a description of the currently available video sinks. +

+ +
+

16.1 buffersink

+ +

Buffer video frames, and make them available to the end of the filter +graph. +

+

This sink is mainly intended for programmatic use, in particular +through the interface defined in libavfilter/buffersink.h +or the options system. +

+

It accepts a pointer to an AVBufferSinkContext structure, which +defines the incoming buffers’ formats, to be passed as the opaque +parameter to avfilter_init_filter for initialization. +

+
+
+

16.2 nullsink

+ +

Null video sink: do absolutely nothing with the input video. It is +mainly useful as a template and for use in analysis / debugging +tools. +

+ +
+
+
+

17 Multimedia Filters

+ +

Below is a description of the currently available multimedia filters. +

+ +
+

17.1 a3dscope

+ +

Convert input audio to 3d scope video output. +

+

The filter accepts the following options: +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is hd720. +

+
+
fov
+

Set the camera field of view. Default is 90 degrees. +Allowed range is from 40 to 150. +

+
+
roll
+

Set the camera roll. +

+
+
pitch
+

Set the camera pitch. +

+
+
yaw
+

Set the camera yaw. +

+
+
xzoom
+

Set the camera zoom on X-axis. +

+
+
yzoom
+

Set the camera zoom on Y-axis. +

+
+
zzoom
+

Set the camera zoom on Z-axis. +

+
+
xpos
+

Set the camera position on X-axis. +

+
+
ypos
+

Set the camera position on Y-axis. +

+
+
zpos
+

Set the camera position on Z-axis. +

+
+
length
+

Set the length of displayed audio waves in number of frames. +

+
+ + +
+

17.1.1 Commands

+ +

Filter supports the some above options as commands. +

+
+
+
+

17.2 abitscope

+ +

Convert input audio to a video output, displaying the audio bit scope. +

+

The filter accepts the following options: +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 1024x256. +

+
+
colors
+

Specify list of colors separated by space or by ’|’ which will be used to +draw channels. Unrecognized or missing colors will be replaced +by white color. +

+
+
mode, m
+

Set output mode. Can be bars or trace. Default is bars. +

+
+ +
+
+

17.3 adrawgraph

+

Draw a graph using input audio metadata. +

+

See drawgraph +

+
+
+

17.4 agraphmonitor

+ +

See graphmonitor. +

+
+
+

17.5 ahistogram

+ +

Convert input audio to a video output, displaying the volume histogram. +

+

The filter accepts the following options: +

+
+
dmode
+

Specify how histogram is calculated. +

+

It accepts the following values: +

+
single
+

Use single histogram for all channels. +

+
separate
+

Use separate histogram for each channel. +

+
+

Default is single. +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is hd720. +

+
+
scale
+

Set display scale. +

+

It accepts the following values: +

+
log
+

logarithmic +

+
sqrt
+

square root +

+
cbrt
+

cubic root +

+
lin
+

linear +

+
rlog
+

reverse logarithmic +

+
+

Default is log. +

+
+
ascale
+

Set amplitude scale. +

+

It accepts the following values: +

+
log
+

logarithmic +

+
lin
+

linear +

+
+

Default is log. +

+
+
acount
+

Set how much frames to accumulate in histogram. +Default is 1. Setting this to -1 accumulates all frames. +

+
+
rheight
+

Set histogram ratio of window height. +

+
+
slide
+

Set sonogram sliding. +

+

It accepts the following values: +

+
replace
+

replace old rows with new ones. +

+
scroll
+

scroll from top to bottom. +

+
+

Default is replace. +

+
+
hmode
+

Set histogram mode. +

+

It accepts the following values: +

+
abs
+

Use absolute values of samples. +

+
sign
+

Use untouched values of samples. +

+
+

Default is abs. +

+
+ +
+
+

17.6 aphasemeter

+ +

Measures phase of input audio, which is exported as metadata lavfi.aphasemeter.phase, +representing mean phase of current audio frame. A video output can also be produced and is +enabled by default. The audio is passed through as first output. +

+

Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in +range [-1, 1] where -1 means left and right channels are completely out of phase +and 1 means channels are in phase. +

+

The filter accepts the following options, all related to its video output: +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+
+
size, s
+

Set the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 800x400. +

+
+
rc
+
gc
+
bc
+

Specify the red, green, blue contrast. Default values are 2, +7 and 1. +Allowed range is [0, 255]. +

+
+
mpc
+

Set color which will be used for drawing median phase. If color is +none which is default, no median phase value will be drawn. +

+
+
video
+

Enable video output. Default is enabled. +

+
+ + +
+

17.6.1 phasing detection

+ +

The filter also detects out of phase and mono sequences in stereo streams. +It logs the sequence start, end and duration when it lasts longer or as long as the minimum set. +

+

The filter accepts the following options for this detection: +

+
+
phasing
+

Enable mono and out of phase detection. Default is disabled. +

+
+
tolerance, t
+

Set phase tolerance for mono detection, in amplitude ratio. Default is 0. +Allowed range is [0, 1]. +

+
+
angle, a
+

Set angle threshold for out of phase detection, in degree. Default is 170. +Allowed range is [90, 180]. +

+
+
duration, d
+

Set mono or out of phase duration until notification, expressed in seconds. Default is 2. +

+
+ +
+
+

17.6.2 Examples

+ +
    +
  • Complete example with ffmpeg to detect 1 second of mono with 0.001 phase tolerance: +
    +
    ffmpeg -i stereo.wav -af aphasemeter=video=0:phasing=1:duration=1:tolerance=0.001 -f null -
    +
    +
+ +
+
+
+

17.7 avectorscope

+ +

Convert input audio to a video output, representing the audio vector +scope. +

+

The filter is used to measure the difference between channels of stereo +audio stream. A monaural signal, consisting of identical left and right +signal, results in straight vertical line. Any stereo separation is visible +as a deviation from this line, creating a Lissajous figure. +If the straight (or deviation from it) but horizontal line appears this +indicates that the left and right channels are out of phase. +

+

The filter accepts the following options: +

+
+
mode, m
+

Set the vectorscope mode. +

+

Available values are: +

+
lissajous
+

Lissajous rotated by 45 degrees. +

+
+
lissajous_xy
+

Same as above but not rotated. +

+
+
polar
+

Shape resembling half of circle. +

+
+ +

Default value is ‘lissajous’. +

+
+
size, s
+

Set the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 400x400. +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+
+
rc
+
gc
+
bc
+
ac
+

Specify the red, green, blue and alpha contrast. Default values are 40, +160, 80 and 255. +Allowed range is [0, 255]. +

+
+
rf
+
gf
+
bf
+
af
+

Specify the red, green, blue and alpha fade. Default values are 15, +10, 5 and 5. +Allowed range is [0, 255]. +

+
+
zoom
+

Set the zoom factor. Default value is 1. Allowed range is [0, 10]. +Values lower than 1 will auto adjust zoom factor to maximal possible value. +

+
+
draw
+

Set the vectorscope drawing mode. +

+

Available values are: +

+
dot
+

Draw dot for each sample. +

+
+
line
+

Draw line between previous and current sample. +

+
+
aaline
+

Draw anti-aliased line between previous and current sample. +

+
+ +

Default value is ‘dot’. +

+
+
scale
+

Specify amplitude scale of audio samples. +

+

Available values are: +

+
lin
+

Linear. +

+
+
sqrt
+

Square root. +

+
+
cbrt
+

Cubic root. +

+
+
log
+

Logarithmic. +

+
+ +
+
swap
+

Swap left channel axis with right channel axis. +

+
+
mirror
+

Mirror axis. +

+
+
none
+

No mirror. +

+
+
x
+

Mirror only x axis. +

+
+
y
+

Mirror only y axis. +

+
+
xy
+

Mirror both axis. +

+
+ +
+
+ + +
+

17.7.1 Examples

+ +
    +
  • Complete example using ffplay: +
    +
    ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
    +             [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
    +
    +
+ +
+
+

17.7.2 Commands

+ +

This filter supports the all above options as commands except options size and rate. +

+
+
+
+

17.8 bench, abench

+ +

Benchmark part of a filtergraph. +

+

The filter accepts the following options: +

+
+
action
+

Start or stop a timer. +

+

Available values are: +

+
start
+

Get the current time, set it as frame metadata (using the key +lavfi.bench.start_time), and forward the frame to the next filter. +

+
+
stop
+

Get the current time and fetch the lavfi.bench.start_time metadata from +the input frame metadata to get the time difference. Time difference, average, +maximum and minimum time (respectively t, avg, max and +min) are then printed. The timestamps are expressed in seconds. +

+
+
+
+ + +
+

17.8.1 Examples

+ +
    +
  • Benchmark selectivecolor filter: +
    +
    bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
    +
    +
+ +
+
+
+

17.9 concat

+ +

Concatenate audio and video streams, joining them together one after the +other. +

+

The filter works on segments of synchronized video and audio streams. All +segments must have the same number of streams of each type, and that will +also be the number of streams at output. +

+

The filter accepts the following options: +

+
+
n
+

Set the number of segments. Default is 2. +

+
+
v
+

Set the number of output video streams, that is also the number of video +streams in each segment. Default is 1. +

+
+
a
+

Set the number of output audio streams, that is also the number of audio +streams in each segment. Default is 0. +

+
+
unsafe
+

Activate unsafe mode: do not fail if segments have a different format. +

+
+
+ +

The filter has v+a outputs: first v video outputs, then +a audio outputs. +

+

There are nx(v+a) inputs: first the inputs for the first +segment, in the same order as the outputs, then the inputs for the second +segment, etc. +

+

Related streams do not always have exactly the same duration, for various +reasons including codec frame size or sloppy authoring. For that reason, +related synchronized streams (e.g. a video and its audio track) should be +concatenated at once. The concat filter will use the duration of the longest +stream in each segment (except the last one), and if necessary pad shorter +audio streams with silence. +

+

For this filter to work correctly, all segments must start at timestamp 0. +

+

All corresponding streams must have the same parameters in all segments; the +filtering system will automatically select a common pixel format for video +streams, and a common sample format, sample rate and channel layout for +audio streams, but other settings, such as resolution, must be converted +explicitly by the user. +

+

Different frame rates are acceptable but will result in variable frame rate +at output; be sure to configure the output file to handle it. +

+ +
+

17.9.1 Examples

+ +
    +
  • Concatenate an opening, an episode and an ending, all in bilingual version +(video in stream 0, audio in streams 1 and 2): +
    +
    ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
    +  '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
    +   concat=n=3:v=1:a=2 [v] [a1] [a2]' \
    +  -map '[v]' -map '[a1]' -map '[a2]' output.mkv
    +
    + +
  • Concatenate two parts, handling audio and video separately, using the +(a)movie sources, and adjusting the resolution: +
    +
    movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
    +movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
    +[v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
    +
    +

    Note that a desync will happen at the stitch if the audio and video streams +do not have exactly the same duration in the first file. +

    +
+ +
+
+

17.9.2 Commands

+ +

This filter supports the following commands: +

+
next
+

Close the current segment and step to the next one +

+
+ +
+
+
+

17.10 ebur128

+ +

EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness +level. By default, it logs a message at a frequency of 10Hz with the +Momentary loudness (identified by M), Short-term loudness (S), +Integrated loudness (I) and Loudness Range (LRA). +

+

The filter can only analyze streams which have +sample format is double-precision floating point. The input stream will be converted to +this specification, if needed. Users may need to insert aformat and/or aresample filters +after this filter to obtain the original parameters. +

+

The filter also has a video output (see the video option) with a real +time graph to observe the loudness evolution. The graphic contains the logged +message mentioned above, so it is not printed anymore when this option is set, +unless the verbose logging is set. The main graphing area contains the +short-term loudness (3 seconds of analysis), and the gauge on the right is for +the momentary loudness (400 milliseconds), but can optionally be configured +to instead display short-term loudness (see gauge). +

+

The green area marks a +/- 1LU target range around the target loudness +(-23LUFS by default, unless modified through target). +

+

More information about the Loudness Recommendation EBU R128 on +http://tech.ebu.ch/loudness. +

+

The filter accepts the following options: +

+
+
video
+

Activate the video output. The audio stream is passed unchanged whether this +option is set or no. The video stream will be the first output stream if +activated. Default is 0. +

+
+
size
+

Set the video size. This option is for video only. For the syntax of this +option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default and minimum resolution is 640x480. +

+
+
meter
+

Set the EBU scale meter. Default is 9. Common values are 9 and +18, respectively for EBU scale meter +9 and EBU scale meter +18. Any +other integer value between this range is allowed. +

+
+
metadata
+

Set metadata injection. If set to 1, the audio input will be segmented +into 100ms output frames, each of them containing various loudness information +in metadata. All the metadata keys are prefixed with lavfi.r128.. +

+

Default is 0. +

+
+
framelog
+

Force the frame logging level. +

+

Available values are: +

+
quiet
+

logging disabled +

+
info
+

information logging level +

+
verbose
+

verbose logging level +

+
+ +

By default, the logging level is set to info. If the video or +the metadata options are set, it switches to verbose. +

+
+
peak
+

Set peak mode(s). +

+

Available modes can be cumulated (the option is a flag type). Possible +values are: +

+
none
+

Disable any peak mode (default). +

+
sample
+

Enable sample-peak mode. +

+

Simple peak mode looking for the higher sample value. It logs a message +for sample-peak (identified by SPK). +

+
true
+

Enable true-peak mode. +

+

If enabled, the peak lookup is done on an over-sampled version of the input +stream for better peak accuracy. It logs a message for true-peak. +(identified by TPK) and true-peak per frame (identified by FTPK). +This mode requires a build with libswresample. +

+
+ +
+
dualmono
+

Treat mono input files as "dual mono". If a mono file is intended for playback +on a stereo system, its EBU R128 measurement will be perceptually incorrect. +If set to true, this option will compensate for this effect. +Multi-channel input files are not affected by this option. +

+
+
panlaw
+

Set a specific pan law to be used for the measurement of dual mono files. +This parameter is optional, and has a default value of -3.01dB. +

+
+
target
+

Set a specific target level (in LUFS) used as relative zero in the visualization. +This parameter is optional and has a default value of -23LUFS as specified +by EBU R128. However, material published online may prefer a level of -16LUFS +(e.g. for use with podcasts or video platforms). +

+
+
gauge
+

Set the value displayed by the gauge. Valid values are momentary and s +shortterm. By default the momentary value will be used, but in certain +scenarios it may be more useful to observe the short term value instead (e.g. +live mixing). +

+
+
scale
+

Sets the display scale for the loudness. Valid parameters are absolute +(in LUFS) or relative (LU) relative to the target. This only affects the +video output, not the summary or continuous log output. +

+
+
integrated
+

Read-only exported value for measured integrated loudness, in LUFS. +

+
+
range
+

Read-only exported value for measured loudness range, in LU. +

+
+
lra_low
+

Read-only exported value for measured LRA low, in LUFS. +

+
+
lra_high
+

Read-only exported value for measured LRA high, in LUFS. +

+
+
sample_peak
+

Read-only exported value for measured sample peak, in dBFS. +

+
+
true_peak
+

Read-only exported value for measured true peak, in dBFS. +

+
+ + +
+

17.10.1 Examples

+ +
    +
  • Real-time graph using ffplay, with a EBU scale meter +18: +
    +
    ffplay -f lavfi -i "amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]"
    +
    + +
  • Run an analysis with ffmpeg: +
    +
    ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
    +
    +
+ +
+
+
+

17.11 interleave, ainterleave

+ +

Temporally interleave frames from several inputs. +

+

interleave works with video inputs, ainterleave with audio. +

+

These filters read frames from several inputs and send the oldest +queued frame to the output. +

+

Input streams must have well defined, monotonically increasing frame +timestamp values. +

+

In order to submit one frame to output, these filters need to enqueue +at least one frame for each input, so they cannot work in case one +input is not yet terminated and will not receive incoming frames. +

+

For example consider the case when one input is a select filter +which always drops input frames. The interleave filter will keep +reading from that input, but it will never be able to send new frames +to output until the input sends an end-of-stream signal. +

+

Also, depending on inputs synchronization, the filters will drop +frames in case one input receives more frames than the other ones, and +the queue is already filled. +

+

These filters accept the following options: +

+
+
nb_inputs, n
+

Set the number of different inputs, it is 2 by default. +

+
+
duration
+

How to determine the end-of-stream. +

+
+
longest
+

The duration of the longest input. (default) +

+
+
shortest
+

The duration of the shortest input. +

+
+
first
+

The duration of the first input. +

+
+ +
+
+ + +
+

17.11.1 Examples

+ +
    +
  • Interleave frames belonging to different streams using ffmpeg: +
    +
    ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex "[0:v][1:v] interleave" out.avi
    +
    + +
  • Add flickering blur effect: +
    +
    select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
    +
    +
+ +
+
+
+

17.12 latency, alatency

+

Measure filtering latency. +

+

Report previous filter filtering latency, delay in number of audio samples for audio filters +or number of video frames for video filters. +

+

On end of input stream, filter will report min and max measured latency for previous running filter +in filtergraph. +

+
+
+

17.13 metadata, ametadata

+ +

Manipulate frame metadata. +

+

This filter accepts the following options: +

+
+
mode
+

Set mode of operation of the filter. +

+

Can be one of the following: +

+
+
select
+

If both value and key is set, select frames +which have such metadata. If only key is set, select +every frame that has such key in metadata. +

+
+
add
+

Add new metadata key and value. If key is already available +do nothing. +

+
+
modify
+

Modify value of already present key. +

+
+
delete
+

If value is set, delete only keys that have such value. +Otherwise, delete key. If key is not set, delete all metadata values in +the frame. +

+
+
print
+

Print key and its value if metadata was found. If key is not set print all +metadata values available in frame. +

+
+ +
+
key
+

Set key used with all modes. Must be set for all modes except print and delete. +

+
+
value
+

Set metadata value which will be used. This option is mandatory for +modify and add mode. +

+
+
function
+

Which function to use when comparing metadata value and value. +

+

Can be one of following: +

+
+
same_str
+

Values are interpreted as strings, returns true if metadata value is same as value. +

+
+
starts_with
+

Values are interpreted as strings, returns true if metadata value starts with +the value option string. +

+
+
less
+

Values are interpreted as floats, returns true if metadata value is less than value. +

+
+
equal
+

Values are interpreted as floats, returns true if value is equal with metadata value. +

+
+
greater
+

Values are interpreted as floats, returns true if metadata value is greater than value. +

+
+
expr
+

Values are interpreted as floats, returns true if expression from option expr +evaluates to true. +

+
+
ends_with
+

Values are interpreted as strings, returns true if metadata value ends with +the value option string. +

+
+ +
+
expr
+

Set expression which is used when function is set to expr. +The expression is evaluated through the eval API and can contain the following +constants: +

+
+
VALUE1, FRAMEVAL
+

Float representation of value from metadata key. +

+
+
VALUE2, USERVAL
+

Float representation of value as supplied by user in value option. +

+
+ +
+
file
+

If specified in print mode, output is written to the named file. Instead of +plain filename any writable url can be specified. Filename “-” is a shorthand +for standard output. If file option is not set, output is written to the log +with AV_LOG_INFO loglevel. +

+
+
direct
+

Reduces buffering in print mode when output is written to a URL set using file. +

+
+
+ + +
+

17.13.1 Examples

+ +
    +
  • Print all metadata values for frames with key lavfi.signalstats.YDIF with values +between 0 and 1. +
    +
    signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
    +
    +
  • Print silencedetect output to file metadata.txt. +
    +
    silencedetect,ametadata=mode=print:file=metadata.txt
    +
    +
  • Direct all metadata to a pipe with file descriptor 4. +
    +
    metadata=mode=print:file='pipe\:4'
    +
    +
+ +
+
+
+

17.14 perms, aperms

+ +

Set read/write permissions for the output frames. +

+

These filters are mainly aimed at developers to test direct path in the +following filter in the filtergraph. +

+

The filters accept the following options: +

+
+
mode
+

Select the permissions mode. +

+

It accepts the following values: +

+
none
+

Do nothing. This is the default. +

+
ro
+

Set all the output frames read-only. +

+
rw
+

Set all the output frames directly writable. +

+
toggle
+

Make the frame read-only if writable, and writable if read-only. +

+
random
+

Set each output frame read-only or writable randomly. +

+
+ +
+
seed
+

Set the seed for the random mode, must be an integer included between +0 and UINT32_MAX. If not specified, or if explicitly set to +-1, the filter will try to use a good random seed on a best effort +basis. +

+
+ +

Note: in case of auto-inserted filter between the permission filter and the +following one, the permission might not be received as expected in that +following filter. Inserting a format or aformat filter before the +perms/aperms filter can avoid this problem. +

+
+
+

17.15 realtime, arealtime

+ +

Slow down filtering to match real time approximately. +

+

These filters will pause the filtering for a variable amount of time to +match the output rate with the input timestamps. +They are similar to the re option to ffmpeg. +

+

They accept the following options: +

+
+
limit
+

Time limit for the pauses. Any pause longer than that will be considered +a timestamp discontinuity and reset the timer. Default is 2 seconds. +

+
speed
+

Speed factor for processing. The value must be a float larger than zero. +Values larger than 1.0 will result in faster than realtime processing, +smaller will slow processing down. The limit is automatically adapted +accordingly. Default is 1.0. +

+

A processing speed faster than what is possible without these filters cannot +be achieved. +

+
+ + +
+

17.15.1 Commands

+ +

Both filters supports the all above options as commands. +

+
+
+
+

17.16 segment, asegment

+ +

Split single input stream into multiple streams. +

+

This filter does opposite of concat filters. +

+

segment works on video frames, asegment on audio samples. +

+

This filter accepts the following options: +

+
+
timestamps
+

Timestamps of output segments separated by ’|’. The first segment will run +from the beginning of the input stream. The last segment will run until +the end of the input stream +

+
+
frames, samples
+

Exact frame/sample count to split the segments. +

+
+ +

In all cases, prefixing an each segment with ’+’ will make it relative to the +previous segment. +

+ +
+

17.16.1 Examples

+ +
    +
  • Split input audio stream into three output audio streams, starting at start of input audio stream +and storing that in 1st output audio stream, then following at 60th second and storing than in 2nd +output audio stream, and last after 150th second of input audio stream store in 3rd output audio stream: +
    +
    asegment=timestamps="60|150"
    +
    + +
+ +
+
+
+

17.17 select, aselect

+ +

Select frames to pass in output. +

+

This filter accepts the following options: +

+
+
expr, e
+

Set expression, which is evaluated for each input frame. +

+

If the expression is evaluated to zero, the frame is discarded. +

+

If the evaluation result is negative or NaN, the frame is sent to the +first output; otherwise it is sent to the output with index +ceil(val)-1, assuming that the input index starts from 0. +

+

For example a value of 1.2 corresponds to the output with index +ceil(1.2)-1 = 2-1 = 1, that is the second output. +

+
+
outputs, n
+

Set the number of outputs. The output to which to send the selected +frame is based on the result of the evaluation. Default value is 1. +

+
+ +

The expression can contain the following constants: +

+
+
n
+

The (sequential) number of the filtered frame, starting from 0. +

+
+
selected_n
+

The (sequential) number of the selected frame, starting from 0. +

+
+
prev_selected_n
+

The sequential number of the last selected frame. It’s NAN if undefined. +

+
+
TB
+

The timebase of the input timestamps. +

+
+
pts
+

The PTS (Presentation TimeStamp) of the filtered frame, +expressed in TB units. It’s NAN if undefined. +

+
+
t
+

The PTS of the filtered frame, +expressed in seconds. It’s NAN if undefined. +

+
+
prev_pts
+

The PTS of the previously filtered frame. It’s NAN if undefined. +

+
+
prev_selected_pts
+

The PTS of the last previously filtered frame. It’s NAN if undefined. +

+
+
prev_selected_t
+

The PTS of the last previously selected frame, expressed in seconds. It’s NAN if undefined. +

+
+
start_pts
+

The first PTS in the stream which is not NAN. It remains NAN if not found. +

+
+
start_t
+

The first PTS, in seconds, in the stream which is not NAN. It remains NAN if not found. +

+
+
pict_type (video only)
+

The type of the filtered frame. It can assume one of the following +values: +

+
I
+
P
+
B
+
S
+
SI
+
SP
+
BI
+
+ +
+
interlace_type (video only)
+

The frame interlace type. It can assume one of the following values: +

+
PROGRESSIVE
+

The frame is progressive (not interlaced). +

+
TOPFIRST
+

The frame is top-field-first. +

+
BOTTOMFIRST
+

The frame is bottom-field-first. +

+
+ +
+
consumed_sample_n (audio only)
+

the number of selected samples before the current frame +

+
+
samples_n (audio only)
+

the number of samples in the current frame +

+
+
sample_rate (audio only)
+

the input sample rate +

+
+
key
+

This is 1 if the filtered frame is a key-frame, 0 otherwise. +

+
+
pos
+

the position in the file of the filtered frame, -1 if the information +is not available (e.g. for synthetic video); deprecated, do not use +

+
+
scene (video only)
+

value between 0 and 1 to indicate a new scene; a low value reflects a low +probability for the current frame to introduce a new scene, while a higher +value means the current frame is more likely to be one (see the example below) +

+
+
concatdec_select
+

The concat demuxer can select only part of a concat input file by setting an +inpoint and an outpoint, but the output packets may not be entirely contained +in the selected interval. By using this variable, it is possible to skip frames +generated by the concat demuxer which are not exactly contained in the selected +interval. +

+

This works by comparing the frame pts against the lavf.concat.start_time +and the lavf.concat.duration packet metadata values which are also +present in the decoded frames. +

+

The concatdec_select variable is -1 if the frame pts is at least +start_time and either the duration metadata is missing or the frame pts is less +than start_time + duration, 0 otherwise, and NaN if the start_time metadata is +missing. +

+

That basically means that an input frame is selected if its pts is within the +interval set by the concat demuxer. +

+
+
+ +

The default value of the select expression is "1". +

+ +
+

17.17.1 Examples

+ +
    +
  • Select all frames in input: +
    +
    select
    +
    + +

    The example above is the same as: +

    +
    select=1
    +
    + +
  • Skip all frames: +
    +
    select=0
    +
    + +
  • Select only I-frames: +
    +
    select='eq(pict_type\,I)'
    +
    + +
  • Select one frame every 100: +
    +
    select='not(mod(n\,100))'
    +
    + +
  • Select only frames contained in the 10-20 time interval: +
    +
    select=between(t\,10\,20)
    +
    + +
  • Select only I-frames contained in the 10-20 time interval: +
    +
    select=between(t\,10\,20)*eq(pict_type\,I)
    +
    + +
  • Select frames with a minimum distance of 10 seconds: +
    +
    select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
    +
    + +
  • Use aselect to select only audio frames with samples number > 100: +
    +
    aselect='gt(samples_n\,100)'
    +
    + +
  • Create a mosaic of the first scenes: +
    +
    ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
    +
    + +

    Comparing scene against a value between 0.3 and 0.5 is generally a sane +choice. +

    +
  • Send even and odd frames to separate outputs, and compose them: +
    +
    select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
    +
    + +
  • Select useful frames from an ffconcat file which is using inpoints and +outpoints but where the source files are not intra frame only. +
    +
    ffmpeg -copyts -vsync 0 -segment_time_metadata 1 -i input.ffconcat -vf select=concatdec_select -af aselect=concatdec_select output.avi
    +
    +
+ +
+
+
+

17.18 sendcmd, asendcmd

+ +

Send commands to filters in the filtergraph. +

+

These filters read commands to be sent to other filters in the +filtergraph. +

+

sendcmd must be inserted between two video filters, +asendcmd must be inserted between two audio filters, but apart +from that they act the same way. +

+

The specification of commands can be provided in the filter arguments +with the commands option, or in a file specified by the +filename option. +

+

These filters accept the following options: +

+
commands, c
+

Set the commands to be read and sent to the other filters. +

+
filename, f
+

Set the filename of the commands to be read and sent to the other +filters. +

+
+ + +
+

17.18.1 Commands syntax

+ +

A commands description consists of a sequence of interval +specifications, comprising a list of commands to be executed when a +particular event related to that interval occurs. The occurring event +is typically the current frame time entering or leaving a given time +interval. +

+

An interval is specified by the following syntax: +

+
START[-END] COMMANDS;
+
+ +

The time interval is specified by the START and END times. +END is optional and defaults to the maximum time. +

+

The current frame time is considered within the specified interval if +it is included in the interval [START, END), that is when +the time is greater or equal to START and is lesser than +END. +

+

COMMANDS consists of a sequence of one or more command +specifications, separated by ",", relating to that interval. The +syntax of a command specification is given by: +

+
[FLAGS] TARGET COMMAND ARG
+
+ +

FLAGS is optional and specifies the type of events relating to +the time interval which enable sending the specified command, and must +be a non-null sequence of identifier flags separated by "+" or "|" and +enclosed between "[" and "]". +

+

The following flags are recognized: +

+
enter
+

The command is sent when the current frame timestamp enters the +specified interval. In other words, the command is sent when the +previous frame timestamp was not in the given interval, and the +current is. +

+
+
leave
+

The command is sent when the current frame timestamp leaves the +specified interval. In other words, the command is sent when the +previous frame timestamp was in the given interval, and the +current is not. +

+
+
expr
+

The command ARG is interpreted as expression and result of +expression is passed as ARG. +

+

The expression is evaluated through the eval API and can contain the following +constants: +

+
+
POS
+

Original position in the file of the frame, or undefined if undefined +for the current frame. Deprecated, do not use. +

+
+
PTS
+

The presentation timestamp in input. +

+
+
N
+

The count of the input frame for video or audio, starting from 0. +

+
+
T
+

The time in seconds of the current frame. +

+
+
TS
+

The start time in seconds of the current command interval. +

+
+
TE
+

The end time in seconds of the current command interval. +

+
+
TI
+

The interpolated time of the current command interval, TI = (T - TS) / (TE - TS). +

+
+
W
+

The video frame width. +

+
+
H
+

The video frame height. +

+
+ +
+
+ +

If FLAGS is not specified, a default value of [enter] is +assumed. +

+

TARGET specifies the target of the command, usually the name of +the filter class or a specific filter instance name. +

+

COMMAND specifies the name of the command for the target filter. +

+

ARG is optional and specifies the optional list of argument for +the given COMMAND. +

+

Between one interval specification and another, whitespaces, or +sequences of characters starting with # until the end of line, +are ignored and can be used to annotate comments. +

+

A simplified BNF description of the commands specification syntax +follows: +

+
COMMAND_FLAG  ::= "enter" | "leave"
+COMMAND_FLAGS ::= COMMAND_FLAG [(+|"|")COMMAND_FLAG]
+COMMAND       ::= ["[" COMMAND_FLAGS "]"] TARGET COMMAND [ARG]
+COMMANDS      ::= COMMAND [,COMMANDS]
+INTERVAL      ::= START[-END] COMMANDS
+INTERVALS     ::= INTERVAL[;INTERVALS]
+
+ +
+
+

17.18.2 Examples

+ +
    +
  • Specify audio tempo change at second 4: +
    +
    asendcmd=c='4.0 atempo tempo 1.5',atempo
    +
    + +
  • Target a specific filter instance: +
    +
    asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
    +
    + +
  • Specify a list of drawtext and hue commands in a file. +
    +
    # show text in the interval 5-10
    +5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
    +         [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
    +
    +# desaturate the image in the interval 15-20
    +15.0-20.0 [enter] hue s 0,
    +          [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
    +          [leave] hue s 1,
    +          [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
    +
    +# apply an exponential saturation fade-out effect, starting from time 25
    +25 [enter] hue s exp(25-t)
    +
    + +

    A filtergraph allowing to read and process the above command list +stored in a file test.cmd, can be specified with: +

    +
    sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
    +
    +
+ +
+
+
+

17.19 setpts, asetpts

+ +

Change the PTS (presentation timestamp) of the input frames. +

+

setpts works on video frames, asetpts on audio frames. +

+

This filter accepts the following options: +

+
+
expr
+

The expression which is evaluated for each frame to construct its timestamp. +

+
+
+ +

The expression is evaluated through the eval API and can contain the following +constants: +

+
+
FRAME_RATE, FR
+

frame rate, only defined for constant frame-rate video +

+
+
PTS
+

The presentation timestamp in input +

+
+
N
+

The count of the input frame for video or the number of consumed samples, +not including the current frame for audio, starting from 0. +

+
+
NB_CONSUMED_SAMPLES
+

The number of consumed samples, not including the current frame (only +audio) +

+
+
NB_SAMPLES, S
+

The number of samples in the current frame (only audio) +

+
+
SAMPLE_RATE, SR
+

The audio sample rate. +

+
+
STARTPTS
+

The PTS of the first frame. +

+
+
STARTT
+

the time in seconds of the first frame +

+
+
INTERLACED
+

State whether the current frame is interlaced. +

+
+
T
+

the time in seconds of the current frame +

+
+
POS
+

original position in the file of the frame, or undefined if undefined +for the current frame; deprecated, do not use +

+
+
PREV_INPTS
+

The previous input PTS. +

+
+
PREV_INT
+

previous input time in seconds +

+
+
PREV_OUTPTS
+

The previous output PTS. +

+
+
PREV_OUTT
+

previous output time in seconds +

+
+
RTCTIME
+

The wallclock (RTC) time in microseconds. This is deprecated, use time(0) +instead. +

+
+
RTCSTART
+

The wallclock (RTC) time at the start of the movie in microseconds. +

+
+
TB
+

The timebase of the input timestamps. +

+
+
T_CHANGE
+

Time of the first frame after command was applied or time of the first frame if no commands. +

+
+
+ + +
+

17.19.1 Examples

+ +
    +
  • Start counting PTS from zero +
    +
    setpts=PTS-STARTPTS
    +
    + +
  • Apply fast motion effect: +
    +
    setpts=0.5*PTS
    +
    + +
  • Apply slow motion effect: +
    +
    setpts=2.0*PTS
    +
    + +
  • Set fixed rate of 25 frames per second: +
    +
    setpts=N/(25*TB)
    +
    + +
  • Set fixed rate 25 fps with some jitter: +
    +
    setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
    +
    + +
  • Apply an offset of 10 seconds to the input PTS: +
    +
    setpts=PTS+10/TB
    +
    + +
  • Generate timestamps from a "live source" and rebase onto the current timebase: +
    +
    setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
    +
    + +
  • Generate timestamps by counting samples: +
    +
    asetpts=N/SR/TB
    +
    + +
+ +
+
+

17.19.2 Commands

+ +

Both filters support all above options as commands. +

+
+
+
+

17.20 setrange

+ +

Force color range for the output video frame. +

+

The setrange filter marks the color range property for the +output frames. It does not change the input frame, but only sets the +corresponding property, which affects how the frame is treated by +following filters. +

+

The filter accepts the following options: +

+
+
range
+

Available values are: +

+
+
auto
+

Keep the same color range property. +

+
+
unspecified, unknown
+

Set the color range as unspecified. +

+
+
limited, tv, mpeg
+

Set the color range as limited. +

+
+
full, pc, jpeg
+

Set the color range as full. +

+
+
+
+ +
+
+

17.21 settb, asettb

+ +

Set the timebase to use for the output frames timestamps. +It is mainly useful for testing timebase configuration. +

+

It accepts the following parameters: +

+
+
expr, tb
+

The expression which is evaluated into the output timebase. +

+
+
+ +

The value for tb is an arithmetic expression representing a +rational. The expression can contain the constants "AVTB" (the default +timebase), "intb" (the input timebase) and "sr" (the sample rate, +audio only). Default value is "intb". +

+ +
+

17.21.1 Examples

+ +
    +
  • Set the timebase to 1/25: +
    +
    settb=expr=1/25
    +
    + +
  • Set the timebase to 1/10: +
    +
    settb=expr=0.1
    +
    + +
  • Set the timebase to 1001/1000: +
    +
    settb=1+0.001
    +
    + +
  • Set the timebase to 2*intb: +
    +
    settb=2*intb
    +
    + +
  • Set the default timebase value: +
    +
    settb=AVTB
    +
    +
+ +
+
+
+

17.22 showcqt

+

Convert input audio to a video output representing frequency spectrum +logarithmically using Brown-Puckette constant Q transform algorithm with +direct frequency domain coefficient calculation (but the transform itself +is not really constant Q, instead the Q factor is actually variable/clamped), +with musical tone scale, from E0 to D#10. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. It must be even. For the syntax of this option, +check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 1920x1080. +

+
+
fps, rate, r
+

Set the output frame rate. Default value is 25. +

+
+
bar_h
+

Set the bargraph height. It must be even. Default value is -1 which +computes the bargraph height automatically. +

+
+
axis_h
+

Set the axis height. It must be even. Default value is -1 which computes +the axis height automatically. +

+
+
sono_h
+

Set the sonogram height. It must be even. Default value is -1 which +computes the sonogram height automatically. +

+
+
fullhd
+

Set the fullhd resolution. This option is deprecated, use size, s +instead. Default value is 1. +

+
+
sono_v, volume
+

Specify the sonogram volume expression. It can contain variables: +

+
bar_v
+

the bar_v evaluated expression +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option +

+
+

and functions: +

+
a_weighting(f)
+

A-weighting of equal loudness +

+
b_weighting(f)
+

B-weighting of equal loudness +

+
c_weighting(f)
+

C-weighting of equal loudness. +

+
+

Default value is 16. +

+
+
bar_v, volume2
+

Specify the bargraph volume expression. It can contain variables: +

+
sono_v
+

the sono_v evaluated expression +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option +

+
+

and functions: +

+
a_weighting(f)
+

A-weighting of equal loudness +

+
b_weighting(f)
+

B-weighting of equal loudness +

+
c_weighting(f)
+

C-weighting of equal loudness. +

+
+

Default value is sono_v. +

+
+
sono_g, gamma
+

Specify the sonogram gamma. Lower gamma makes the spectrum more contrast, +higher gamma makes the spectrum having more range. Default value is 3. +Acceptable range is [1, 7]. +

+
+
bar_g, gamma2
+

Specify the bargraph gamma. Default value is 1. Acceptable range is +[1, 7]. +

+
+
bar_t
+

Specify the bargraph transparency level. Lower value makes the bargraph sharper. +Default value is 1. Acceptable range is [0, 1]. +

+
+
timeclamp, tc
+

Specify the transform timeclamp. At low frequency, there is trade-off between +accuracy in time domain and frequency domain. If timeclamp is lower, +event in time domain is represented more accurately (such as fast bass drum), +otherwise event in frequency domain is represented more accurately +(such as bass guitar). Acceptable range is [0.002, 1]. Default value is 0.17. +

+
+
attack
+

Set attack time in seconds. The default is 0 (disabled). Otherwise, it +limits future samples by applying asymmetric windowing in time domain, useful +when low latency is required. Accepted range is [0, 1]. +

+
+
basefreq
+

Specify the transform base frequency. Default value is 20.01523126408007475, +which is frequency 50 cents below E0. Acceptable range is [10, 100000]. +

+
+
endfreq
+

Specify the transform end frequency. Default value is 20495.59681441799654, +which is frequency 50 cents above D#10. Acceptable range is [10, 100000]. +

+
+
coeffclamp
+

This option is deprecated and ignored. +

+
+
tlength
+

Specify the transform length in time domain. Use this option to control accuracy +trade-off between time domain and frequency domain at every frequency sample. +It can contain variables: +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option. +

+
+

Default value is 384*tc/(384+tc*f). +

+
+
count
+

Specify the transform count for every video frame. Default value is 6. +Acceptable range is [1, 30]. +

+
+
fcount
+

Specify the transform count for every single pixel. Default value is 0, +which makes it computed automatically. Acceptable range is [0, 10]. +

+
+
fontfile
+

Specify font file for use with freetype to draw the axis. If not specified, +use embedded font. Note that drawing with font file or embedded font is not +implemented with custom basefreq and endfreq, use axisfile +option instead. +

+
+
font
+

Specify fontconfig pattern. This has lower priority than fontfile. The +: in the pattern may be replaced by | to avoid unnecessary +escaping. +

+
+
fontcolor
+

Specify font color expression. This is arithmetic expression that should return +integer value 0xRRGGBB. It can contain variables: +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option +

+
+

and functions: +

+
midi(f)
+

midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69) +

+
r(x), g(x), b(x)
+

red, green, and blue value of intensity x. +

+
+

Default value is st(0, (midi(f)-59.5)/12); +st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0)); +r(1-ld(1)) + b(ld(1)). +

+
+
axisfile
+

Specify image file to draw the axis. This option override fontfile and +fontcolor option. +

+
+
axis, text
+

Enable/disable drawing text to the axis. If it is set to 0, drawing to +the axis is disabled, ignoring fontfile and axisfile option. +Default value is 1. +

+
+
csp
+

Set colorspace. The accepted values are: +

+
unspecified
+

Unspecified (default) +

+
+
bt709
+

BT.709 +

+
+
fcc
+

FCC +

+
+
bt470bg
+

BT.470BG or BT.601-6 625 +

+
+
smpte170m
+

SMPTE-170M or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
bt2020ncl
+

BT.2020 with non-constant luminance +

+
+
+ +
+
cscheme
+

Set spectrogram color scheme. This is list of floating point values with format +left_r|left_g|left_b|right_r|right_g|right_b. +The default is 1|0.5|0|0|0.5|1. +

+
+
+ + +
+

17.22.1 Examples

+ +
    +
  • Playing audio while showing the spectrum: +
    +
    ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
    +
    + +
  • Same as above, but with frame rate 30 fps: +
    +
    ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
    +
    + +
  • Playing at 1280x720: +
    +
    ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
    +
    + +
  • Disable sonogram display: +
    +
    sono_h=0
    +
    + +
  • A1 and its harmonics: A1, A2, (near)E3, A3: +
    +
    ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
    +                 asplit[a][out1]; [a] showcqt [out0]'
    +
    + +
  • Same as above, but with more accuracy in frequency domain: +
    +
    ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
    +                 asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
    +
    + +
  • Custom volume: +
    +
    bar_v=10:sono_v=bar_v*a_weighting(f)
    +
    + +
  • Custom gamma, now spectrum is linear to the amplitude. +
    +
    bar_g=2:sono_g=2
    +
    + +
  • Custom tlength equation: +
    +
    tc=0.33:tlength='st(0,0.17); 384*tc / (384 / ld(0) + tc*f /(1-ld(0))) + 384*tc / (tc*f / ld(0) + 384 /(1-ld(0)))'
    +
    + +
  • Custom fontcolor and fontfile, C-note is colored green, others are colored blue: +
    +
    fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
    +
    + +
  • Custom font using fontconfig: +
    +
    font='Courier New,Monospace,mono|bold'
    +
    + +
  • Custom frequency range with custom axis using image file: +
    +
    axisfile=myaxis.png:basefreq=40:endfreq=10000
    +
    +
+ +
+
+
+

17.23 showcwt

+ +

Convert input audio to video output representing frequency spectrum +using Continuous Wavelet Transform and Morlet wavelet. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, +check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 640x512. +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+
+
scale
+

Set the frequency scale used. Allowed values are: +

+
+
linear
+
log2
+
bark
+
mel
+
erbs
+
+

Default value is linear. +

+
+
min
+

Set the minimum frequency that will be used in output. +Default is 20 Hz. +

+
+
max
+

Set the maximum frequency that will be used in output. +Default is 20000 Hz. The real frequency upper limit +depends on input audio’s sample rate and such will be enforced +on this value when it is set to value greater than Nyquist frequency. +

+
+
logb
+

Set the logarithmic basis for brightness strength when +mapping calculated magnitude values to pixel values. +Allowed range is from 0 to 1. +Default value is 0.0001. +

+
+
deviation
+

Set the frequency deviation. +Lower values than 1 are more frequency oriented, +while higher values than 1 are more time oriented. +Allowed range is from 0 to 10. +Default value is 1. +

+
+
pps
+

Set the number of pixel output per each second in one row. +Allowed range is from 1 to 1024. +Default value is 64. +

+
+
mode
+

Set the output visual mode. Allowed values are: +

+
+
magnitude
+

Show magnitude. +

+
phase
+

Show only phase. +

+
magphase
+

Show combination of magnitude and phase. +Magnitude is mapped to brightness and phase to color. +

+
channel
+

Show unique color per channel magnitude. +

+
stereo
+

Show unique color per stereo difference. +

+
+ +

Default value is magnitude. +

+
+
slide
+

Set the output slide method. Allowed values are: +

+
+
replace
+
scroll
+
frame
+
+ +
+
direction
+

Set the direction method for output slide method. Allowed values are: +

+
+
lr
+

Direction from left to right. +

+
rl
+

Direction from right to left. +

+
ud
+

Direction from up to down. +

+
du
+

Direction from down to up. +

+
+
+
+ +
+
+

17.24 showfreqs

+ +

Convert input audio to video output representing the audio power spectrum. +Audio amplitude is on Y-axis while frequency is on X-axis. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify size of video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default is 1024x512. +

+
+
rate, r
+

Set video rate. Default is 25. +

+
+
mode
+

Set display mode. +This set how each frequency bin will be represented. +

+

It accepts the following values: +

+
line
+
bar
+
dot
+
+

Default is bar. +

+
+
ascale
+

Set amplitude scale. +

+

It accepts the following values: +

+
lin
+

Linear scale. +

+
+
sqrt
+

Square root scale. +

+
+
cbrt
+

Cubic root scale. +

+
+
log
+

Logarithmic scale. +

+
+

Default is log. +

+
+
fscale
+

Set frequency scale. +

+

It accepts the following values: +

+
lin
+

Linear scale. +

+
+
log
+

Logarithmic scale. +

+
+
rlog
+

Reverse logarithmic scale. +

+
+

Default is lin. +

+
+
win_size
+

Set window size. Allowed range is from 16 to 65536. +

+

Default is 2048 +

+
+
win_func
+

Set windowing function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hanning. +

+
+
overlap
+

Set window overlap. In range [0, 1]. Default is 1, +which means optimal overlap for selected window function will be picked. +

+
+
averaging
+

Set time averaging. Setting this to 0 will display current maximal peaks. +Default is 1, which means time averaging is disabled. +

+
+
colors
+

Specify list of colors separated by space or by ’|’ which will be used to +draw channel frequencies. Unrecognized or missing colors will be replaced +by white color. +

+
+
cmode
+

Set channel display mode. +

+

It accepts the following values: +

+
combined
+
separate
+
+

Default is combined. +

+
+
minamp
+

Set minimum amplitude used in log amplitude scaler. +

+
+
data
+

Set data display mode. +

+

It accepts the following values: +

+
magnitude
+
phase
+
delay
+
+

Default is magnitude. +

+
+
channels
+

Set channels to use when processing audio. By default all are processed. +

+
+ +
+
+

17.25 showspatial

+ +

Convert stereo input audio to a video output, representing the spatial relationship +between two channels. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 512x512. +

+
+
win_size
+

Set window size. Allowed range is from 1024 to 65536. Default size is 4096. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+ +

Default value is hann. +

+
+
rate, r
+

Set output framerate. +

+
+ +
+
+

17.26 showspectrum

+ +

Convert input audio to a video output, representing the audio frequency +spectrum. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 640x512. +

+
+
slide
+

Specify how the spectrum should slide along the window. +

+

It accepts the following values: +

+
replace
+

the samples start again on the left when they reach the right +

+
scroll
+

the samples scroll from right to left +

+
fullframe
+

frames are only produced when the samples reach the right +

+
rscroll
+

the samples scroll from left to right +

+
lreplace
+

the samples start again on the right when they reach the left +

+
+ +

Default value is replace. +

+
+
mode
+

Specify display mode. +

+

It accepts the following values: +

+
combined
+

all channels are displayed in the same row +

+
separate
+

all channels are displayed in separate rows +

+
+ +

Default value is ‘combined’. +

+
+
color
+

Specify display color mode. +

+

It accepts the following values: +

+
channel
+

each channel is displayed in a separate color +

+
intensity
+

each channel is displayed using the same color scheme +

+
rainbow
+

each channel is displayed using the rainbow color scheme +

+
moreland
+

each channel is displayed using the moreland color scheme +

+
nebulae
+

each channel is displayed using the nebulae color scheme +

+
fire
+

each channel is displayed using the fire color scheme +

+
fiery
+

each channel is displayed using the fiery color scheme +

+
fruit
+

each channel is displayed using the fruit color scheme +

+
cool
+

each channel is displayed using the cool color scheme +

+
magma
+

each channel is displayed using the magma color scheme +

+
green
+

each channel is displayed using the green color scheme +

+
viridis
+

each channel is displayed using the viridis color scheme +

+
plasma
+

each channel is displayed using the plasma color scheme +

+
cividis
+

each channel is displayed using the cividis color scheme +

+
terrain
+

each channel is displayed using the terrain color scheme +

+
+ +

Default value is ‘channel’. +

+
+
scale
+

Specify scale used for calculating intensity color values. +

+

It accepts the following values: +

+
lin
+

linear +

+
sqrt
+

square root, default +

+
cbrt
+

cubic root +

+
log
+

logarithmic +

+
4thrt
+

4th root +

+
5thrt
+

5th root +

+
+ +

Default value is ‘sqrt’. +

+
+
fscale
+

Specify frequency scale. +

+

It accepts the following values: +

+
lin
+

linear +

+
log
+

logarithmic +

+
+ +

Default value is ‘lin’. +

+
+
saturation
+

Set saturation modifier for displayed colors. Negative values provide +alternative color scheme. 0 is no saturation at all. +Saturation must be in [-10.0, 10.0] range. +Default value is 1. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+ +

Default value is hann. +

+
+
orientation
+

Set orientation of time vs frequency axis. Can be vertical or +horizontal. Default is vertical. +

+
+
overlap
+

Set ratio of overlap window. Default value is 0. +When value is 1 overlap is set to recommended size for specific +window function currently used. +

+
+
gain
+

Set scale gain for calculating intensity color values. +Default value is 1. +

+
+
data
+

Set which data to display. Can be magnitude, default or phase, +or unwrapped phase: uphase. +

+
+
rotation
+

Set color rotation, must be in [-1.0, 1.0] range. +Default value is 0. +

+
+
start
+

Set start frequency from which to display spectrogram. Default is 0. +

+
+
stop
+

Set stop frequency to which to display spectrogram. Default is 0. +

+
+
fps
+

Set upper frame rate limit. Default is auto, unlimited. +

+
+
legend
+

Draw time and frequency axes and legends. Default is disabled. +

+
+
drange
+

Set dynamic range used to calculate intensity color values. Default is 120 dBFS. +Allowed range is from 10 to 200. +

+
+
limit
+

Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS. +Allowed range is from -100 to 100. +

+
+
opacity
+

Set opacity strength when using pixel format output with alpha component. +

+
+ +

The usage is very similar to the showwaves filter; see the examples in that +section. +

+ +
+

17.26.1 Examples

+ +
    +
  • Large window with logarithmic color scaling: +
    +
    showspectrum=s=1280x480:scale=log
    +
    + +
  • Complete example for a colored and sliding spectrum per channel using ffplay: +
    +
    ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
    +             [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
    +
    +
+ +
+
+
+

17.27 showspectrumpic

+ +

Convert input audio to a single video frame, representing the audio frequency +spectrum. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 4096x2048. +

+
+
mode
+

Specify display mode. +

+

It accepts the following values: +

+
combined
+

all channels are displayed in the same row +

+
separate
+

all channels are displayed in separate rows +

+
+

Default value is ‘combined’. +

+
+
color
+

Specify display color mode. +

+

It accepts the following values: +

+
channel
+

each channel is displayed in a separate color +

+
intensity
+

each channel is displayed using the same color scheme +

+
rainbow
+

each channel is displayed using the rainbow color scheme +

+
moreland
+

each channel is displayed using the moreland color scheme +

+
nebulae
+

each channel is displayed using the nebulae color scheme +

+
fire
+

each channel is displayed using the fire color scheme +

+
fiery
+

each channel is displayed using the fiery color scheme +

+
fruit
+

each channel is displayed using the fruit color scheme +

+
cool
+

each channel is displayed using the cool color scheme +

+
magma
+

each channel is displayed using the magma color scheme +

+
green
+

each channel is displayed using the green color scheme +

+
viridis
+

each channel is displayed using the viridis color scheme +

+
plasma
+

each channel is displayed using the plasma color scheme +

+
cividis
+

each channel is displayed using the cividis color scheme +

+
terrain
+

each channel is displayed using the terrain color scheme +

+
+

Default value is ‘intensity’. +

+
+
scale
+

Specify scale used for calculating intensity color values. +

+

It accepts the following values: +

+
lin
+

linear +

+
sqrt
+

square root, default +

+
cbrt
+

cubic root +

+
log
+

logarithmic +

+
4thrt
+

4th root +

+
5thrt
+

5th root +

+
+

Default value is ‘log’. +

+
+
fscale
+

Specify frequency scale. +

+

It accepts the following values: +

+
lin
+

linear +

+
log
+

logarithmic +

+
+ +

Default value is ‘lin’. +

+
+
saturation
+

Set saturation modifier for displayed colors. Negative values provide +alternative color scheme. 0 is no saturation at all. +Saturation must be in [-10.0, 10.0] range. +Default value is 1. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default value is hann. +

+
+
orientation
+

Set orientation of time vs frequency axis. Can be vertical or +horizontal. Default is vertical. +

+
+
gain
+

Set scale gain for calculating intensity color values. +Default value is 1. +

+
+
legend
+

Draw time and frequency axes and legends. Default is enabled. +

+
+
rotation
+

Set color rotation, must be in [-1.0, 1.0] range. +Default value is 0. +

+
+
start
+

Set start frequency from which to display spectrogram. Default is 0. +

+
+
stop
+

Set stop frequency to which to display spectrogram. Default is 0. +

+
+
drange
+

Set dynamic range used to calculate intensity color values. Default is 120 dBFS. +Allowed range is from 10 to 200. +

+
+
limit
+

Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS. +Allowed range is from -100 to 100. +

+
+
opacity
+

Set opacity strength when using pixel format output with alpha component. +

+
+ + +
+

17.27.1 Examples

+ +
    +
  • Extract an audio spectrogram of a whole audio track +in a 1024x1024 picture using ffmpeg: +
    +
    ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
    +
    +
+ +
+
+
+

17.28 showvolume

+ +

Convert input audio volume to a video output. +

+

The filter accepts the following options: +

+
+
rate, r
+

Set video rate. +

+
+
b
+

Set border width, allowed range is [0, 5]. Default is 1. +

+
+
w
+

Set channel width, allowed range is [80, 8192]. Default is 400. +

+
+
h
+

Set channel height, allowed range is [1, 900]. Default is 20. +

+
+
f
+

Set fade, allowed range is [0, 1]. Default is 0.95. +

+
+
c
+

Set volume color expression. +

+

The expression can use the following variables: +

+
+
VOLUME
+

Current max volume of channel in dB. +

+
+
PEAK
+

Current peak. +

+
+
CHANNEL
+

Current channel number, starting from 0. +

+
+ +
+
t
+

If set, displays channel names. Default is enabled. +

+
+
v
+

If set, displays volume values. Default is enabled. +

+
+
o
+

Set orientation, can be horizontal: h or vertical: v, +default is h. +

+
+
s
+

Set step size, allowed range is [0, 5]. Default is 0, which means +step is disabled. +

+
+
p
+

Set background opacity, allowed range is [0, 1]. Default is 0. +

+
+
m
+

Set metering mode, can be peak: p or rms: r, +default is p. +

+
+
ds
+

Set display scale, can be linear: lin or log: log, +default is lin. +

+
+
dm
+

In second. +If set to > 0., display a line for the max level +in the previous seconds. +default is disabled: 0. +

+
+
dmc
+

The color of the max line. Use when dm option is set to > 0. +default is: orange +

+
+ +
+
+

17.29 showwaves

+ +

Convert input audio to a video output, representing the samples waves. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 600x240. +

+
+
mode
+

Set display mode. +

+

Available values are: +

+
point
+

Draw a point for each sample. +

+
+
line
+

Draw a vertical line for each sample. +

+
+
p2p
+

Draw a point for each sample and a line between them. +

+
+
cline
+

Draw a centered vertical line for each sample. +

+
+ +

Default value is point. +

+
+
n
+

Set the number of samples which are printed on the same column. A +larger value will decrease the frame rate. Must be a positive +integer. This option can be set only if the value for rate +is not explicitly specified. +

+
+
rate, r
+

Set the (approximate) output frame rate. This is done by setting the +option n. Default value is "25". +

+
+
split_channels
+

Set if channels should be drawn separately or overlap. Default value is 0. +

+
+
colors
+

Set colors separated by ’|’ which are going to be used for drawing of each channel. +

+
+
scale
+

Set amplitude scale. +

+

Available values are: +

+
lin
+

Linear. +

+
+
log
+

Logarithmic. +

+
+
sqrt
+

Square root. +

+
+
cbrt
+

Cubic root. +

+
+ +

Default is linear. +

+
+
draw
+

Set the draw mode. This is mostly useful to set for high n. +

+

Available values are: +

+
scale
+

Scale pixel values for each drawn sample. +

+
+
full
+

Draw every sample directly. +

+
+ +

Default value is scale. +

+
+ + +
+

17.29.1 Examples

+ +
    +
  • Output the input file audio and the corresponding video representation +at the same time: +
    +
    amovie=a.mp3,asplit[out0],showwaves[out1]
    +
    + +
  • Create a synthetic signal and show it with showwaves, forcing a +frame rate of 30 frames per second: +
    +
    aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
    +
    +
+ +
+
+
+

17.30 showwavespic

+ +

Convert input audio to a single video frame, representing the samples waves. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 600x240. +

+
+
split_channels
+

Set if channels should be drawn separately or overlap. Default value is 0. +

+
+
colors
+

Set colors separated by ’|’ which are going to be used for drawing of each channel. +

+
+
scale
+

Set amplitude scale. +

+

Available values are: +

+
lin
+

Linear. +

+
+
log
+

Logarithmic. +

+
+
sqrt
+

Square root. +

+
+
cbrt
+

Cubic root. +

+
+ +

Default is linear. +

+
+
draw
+

Set the draw mode. +

+

Available values are: +

+
scale
+

Scale pixel values for each drawn sample. +

+
+
full
+

Draw every sample directly. +

+
+ +

Default value is scale. +

+
+
filter
+

Set the filter mode. +

+

Available values are: +

+
average
+

Use average samples values for each drawn sample. +

+
+
peak
+

Use peak samples values for each drawn sample. +

+
+ +

Default value is average. +

+
+ + +
+

17.30.1 Examples

+ +
    +
  • Extract a channel split representation of the wave form of a whole audio track +in a 1024x800 picture using ffmpeg: +
    +
    ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
    +
    +
+ +
+
+
+

17.31 sidedata, asidedata

+ +

Delete frame side data, or select frames based on it. +

+

This filter accepts the following options: +

+
+
mode
+

Set mode of operation of the filter. +

+

Can be one of the following: +

+
+
select
+

Select every frame with side data of type. +

+
+
delete
+

Delete side data of type. If type is not set, delete all side +data in the frame. +

+
+
+ +
+
type
+

Set side data type used with all modes. Must be set for select mode. For +the list of frame side data types, refer to the AVFrameSideDataType enum +in libavutil/frame.h. For example, to choose +AV_FRAME_DATA_PANSCAN side data, you must specify PANSCAN. +

+
+
+ +
+
+

17.32 spectrumsynth

+ +

Synthesize audio from 2 input video spectrums, first input stream represents +magnitude across time and second represents phase across time. +The filter will transform from frequency domain as displayed in videos back +to time domain as presented in audio output. +

+

This filter is primarily created for reversing processed showspectrum +filter outputs, but can synthesize sound from other spectrograms too. +But in such case results are going to be poor if the phase data is not +available, because in such cases phase data need to be recreated, usually +it’s just recreated from random noise. +For best results use gray only output (channel color mode in +showspectrum filter) and log scale for magnitude video and +lin scale for phase video. To produce phase, for 2nd video, use +data option. Inputs videos should generally use fullframe +slide mode as that saves resources needed for decoding video. +

+

The filter accepts the following options: +

+
+
sample_rate
+

Specify sample rate of output audio, the sample rate of audio from which +spectrum was generated may differ. +

+
+
channels
+

Set number of channels represented in input video spectrums. +

+
+
scale
+

Set scale which was used when generating magnitude input spectrum. +Can be lin or log. Default is log. +

+
+
slide
+

Set slide which was used when generating inputs spectrums. +Can be replace, scroll, fullframe or rscroll. +Default is fullframe. +

+
+
win_func
+

Set window function used for resynthesis. +

+
+
overlap
+

Set window overlap. In range [0, 1]. Default is 1, +which means optimal overlap for selected window function will be picked. +

+
+
orientation
+

Set orientation of input videos. Can be vertical or horizontal. +Default is vertical. +

+
+ + +
+

17.32.1 Examples

+ +
    +
  • First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate, +then resynthesize videos back to audio with spectrumsynth: +
    +
    ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=log:overlap=0.875:color=channel:slide=fullframe:data=magnitude -an -c:v rawvideo magnitude.nut
    +ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=lin:overlap=0.875:color=channel:slide=fullframe:data=phase -an -c:v rawvideo phase.nut
    +ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
    +
    +
+ +
+
+
+

17.33 split, asplit

+ +

Split input into several identical outputs. +

+

asplit works with audio input, split with video. +

+

The filter accepts a single parameter which specifies the number of outputs. If +unspecified, it defaults to 2. +

+ +
+

17.33.1 Examples

+ +
    +
  • Create two separate outputs from the same input: +
    +
    [in] split [out0][out1]
    +
    + +
  • To create 3 or more outputs, you need to specify the number of +outputs, like in: +
    +
    [in] asplit=3 [out0][out1][out2]
    +
    + +
  • Create two separate outputs from the same input, one cropped and +one padded: +
    +
    [in] split [splitout1][splitout2];
    +[splitout1] crop=100:100:0:0    [cropout];
    +[splitout2] pad=200:200:100:100 [padout];
    +
    + +
  • Create 5 copies of the input audio with ffmpeg: +
    +
    ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
    +
    +
+ +
+
+
+

17.34 zmq, azmq

+ +

Receive commands sent through a libzmq client, and forward them to +filters in the filtergraph. +

+

zmq and azmq work as a pass-through filters. zmq +must be inserted between two video filters, azmq between two +audio filters. Both are capable to send messages to any filter type. +

+

To enable these filters you need to install the libzmq library and +headers and configure FFmpeg with --enable-libzmq. +

+

For more information about libzmq see: +http://www.zeromq.org/ +

+

The zmq and azmq filters work as a libzmq server, which +receives messages sent through a network interface defined by the +bind_address (or the abbreviation "b") option. +Default value of this option is tcp://localhost:5555. You may +want to alter this value to your needs, but do not forget to escape any +’:’ signs (see filtergraph escaping). +

+

The received message must be in the form: +

+
TARGET COMMAND [ARG]
+
+ +

TARGET specifies the target of the command, usually the name of +the filter class or a specific filter instance name. The default +filter instance name uses the pattern ‘Parsed_<filter_name>_<index>’, +but you can override this by using the ‘filter_name@id’ syntax +(see Filtergraph syntax). +

+

COMMAND specifies the name of the command for the target filter. +

+

ARG is optional and specifies the optional argument list for the +given COMMAND. +

+

Upon reception, the message is processed and the corresponding command +is injected into the filtergraph. Depending on the result, the filter +will send a reply to the client, adopting the format: +

+
ERROR_CODE ERROR_REASON
+MESSAGE
+
+ +

MESSAGE is optional. +

+ +
+

17.34.1 Examples

+ +

Look at tools/zmqsend for an example of a zmq client which can +be used to send commands processed by these filters. +

+

Consider the following filtergraph generated by ffplay. +In this example the last overlay filter has an instance name. All other +filters will have default instance names. +

+
+
ffplay -dumpgraph 1 -f lavfi "
+color=s=100x100:c=red  [l];
+color=s=100x100:c=blue [r];
+nullsrc=s=200x100, zmq [bg];
+[bg][l]   overlay     [bg+l];
+[bg+l][r] overlay@my=x=100 "
+
+ +

To change the color of the left side of the video, the following +command can be used: +

+
echo Parsed_color_0 c yellow | tools/zmqsend
+
+ +

To change the right side: +

+
echo Parsed_color_1 c pink | tools/zmqsend
+
+ +

To change the position of the right side: +

+
echo overlay@my x 150 | tools/zmqsend
+
+ + + +
+
+
+
+

18 Multimedia Sources

+ +

Below is a description of the currently available multimedia sources. +

+ +
+

18.1 amovie

+ +

This is the same as movie source, except it selects an audio +stream by default. +

+
+
+

18.2 avsynctest

+

Generate an Audio/Video Sync Test. +

+

Generated stream periodically shows flash video frame and emits beep in audio. +Useful to inspect A/V sync issues. +

+

It accepts the following options: +

+
+
size, s
+

Set output video size. Default value is hd720. +

+
+
framerate, fr
+

Set output video frame rate. Default value is 30. +

+
+
samplerate, sr
+

Set output audio sample rate. Default value is 44100. +

+
+
amplitude, a
+

Set output audio beep amplitude. Default value is 0.7. +

+
+
period, p
+

Set output audio beep period in seconds. Default value is 3. +

+
+
delay, dl
+

Set output video flash delay in number of frames. Default value is 0. +

+
+
cycle, c
+

Enable cycling of video delays, by default is disabled. +

+
+
duration, d
+

Set stream output duration. By default duration is unlimited. +

+
+
fg, bg, ag
+

Set foreground/background/additional color. +

+
+ + +
+

18.2.1 Commands

+ +

This source supports the some above options as commands. +

+
+
+
+

18.3 movie

+ +

Read audio and/or video stream(s) from a movie container. +

+

It accepts the following parameters: +

+
+
filename
+

The name of the resource to read (not necessarily a file; it can also be a +device or a stream accessed through some protocol). +

+
+
format_name, f
+

Specifies the format assumed for the movie to read, and can be either +the name of a container or an input device. If not specified, the +format is guessed from movie_name or by probing. +

+
+
seek_point, sp
+

Specifies the seek point in seconds. The frames will be output +starting from this seek point. The parameter is evaluated with +av_strtod, so the numerical value may be suffixed by an IS +postfix. The default value is "0". +

+
+
streams, s
+

Specifies the streams to read. Several streams can be specified, +separated by "+". The source will then have as many outputs, in the +same order. The syntax is explained in the (ffmpeg)"Stream specifiers" +section in the ffmpeg manual. Two special names, "dv" and "da" specify +respectively the default (best suited) video and audio stream. Default +is "dv", or "da" if the filter is called as "amovie". +

+
+
stream_index, si
+

Specifies the index of the video stream to read. If the value is -1, +the most suitable video stream will be automatically selected. The default +value is "-1". Deprecated. If the filter is called "amovie", it will select +audio instead of video. +

+
+
loop
+

Specifies how many times to read the stream in sequence. +If the value is 0, the stream will be looped infinitely. +Default value is "1". +

+

Note that when the movie is looped the source timestamps are not +changed, so it will generate non monotonically increasing timestamps. +

+
+
discontinuity
+

Specifies the time difference between frames above which the point is +considered a timestamp discontinuity which is removed by adjusting the later +timestamps. +

+
+
dec_threads
+

Specifies the number of threads for decoding +

+
+
format_opts
+

Specify format options for the opened file. Format options can be specified +as a list of key=value pairs separated by ’:’. The following example +shows how to add protocol_whitelist and protocol_blacklist options: +

+
ffplay -f lavfi
+"movie=filename='1.sdp':format_opts='protocol_whitelist=file,rtp,udp\:protocol_blacklist=http'"
+
+
+
+ +

It allows overlaying a second video on top of the main input of +a filtergraph, as shown in this graph: +

+
input -----------> deltapts0 --> overlay --> output
+                                    ^
+                                    |
+movie --> scale--> deltapts1 -------+
+
+ +
+

18.3.1 Examples

+ +
    +
  • Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it +on top of the input labelled "in": +
    +
    movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
    +[in] setpts=PTS-STARTPTS [main];
    +[main][over] overlay=16:16 [out]
    +
    + +
  • Read from a video4linux2 device, and overlay it on top of the input +labelled "in": +
    +
    movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
    +[in] setpts=PTS-STARTPTS [main];
    +[main][over] overlay=16:16 [out]
    +
    + +
  • Read the first video stream and the audio stream with id 0x81 from +dvd.vob; the video is connected to the pad named "video" and the audio is +connected to the pad named "audio": +
    +
    movie=dvd.vob:s=v:0+#0x81 [video] [audio]
    +
    +
+ +
+
+

18.3.2 Commands

+ +

Both movie and amovie support the following commands: +

+
seek
+

Perform seek using "av_seek_frame". +The syntax is: seek stream_index|timestamp|flags +

    +
  • stream_index: If stream_index is -1, a default +stream is selected, and timestamp is automatically converted +from AV_TIME_BASE units to the stream specific time_base. +
  • timestamp: Timestamp in AVStream.time_base units +or, if no stream is specified, in AV_TIME_BASE units. +
  • flags: Flags which select direction and seeking mode. +
+ +
+
get_duration
+

Get movie duration in AV_TIME_BASE units. +

+
+
+ + +
+
+
+
+

19 See Also

+ +

ffmpeg, ffplay, ffprobe, +libavfilter +

+ +
+
+

20 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-formats.html b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-formats.html new file mode 100644 index 0000000000000000000000000000000000000000..cbd08bac8178558a5f6e3e4a7b8e2fc4a6b95931 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-formats.html @@ -0,0 +1,5229 @@ + + + + + +FFmpeg Formats Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ +
+ + +
+
+
+

1 Description

+ +

This document describes the supported formats (muxers and demuxers) +provided by the libavformat library. +

+ +
+
+

2 Format Options

+ +

The libavformat library provides some generic global options, which +can be set on all the muxers and demuxers. In addition each muxer or +demuxer may support so-called private options, which are specific for +that component. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the +AVFormatContext options or using the libavutil/opt.h API +for programmatic use. +

+

The list of supported options follows: +

+
+
avioflags flags (input/output)
+

Possible values: +

+
direct
+

Reduce buffering. +

+
+ +
+
probesize integer (input)
+

Set probing size in bytes, i.e. the size of the data to analyze to get +stream information. A higher value will enable detecting more +information in case it is dispersed into the stream, but will increase +latency. Must be an integer not lesser than 32. It is 5000000 by default. +

+
+
max_probe_packets integer (input)
+

Set the maximum number of buffered packets when probing a codec. +Default is 2500 packets. +

+
+
packetsize integer (output)
+

Set packet size. +

+
+
fflags flags
+

Set format flags. Some are implemented for a limited number of formats. +

+

Possible values for input files: +

+
discardcorrupt
+

Discard corrupted packets. +

+
fastseek
+

Enable fast, but inaccurate seeks for some formats. +

+
genpts
+

Generate missing PTS if DTS is present. +

+
igndts
+

Ignore DTS if PTS is set. Inert when nofillin is set. +

+
ignidx
+

Ignore index. +

+
nobuffer
+

Reduce the latency introduced by buffering during initial input streams analysis. +

+
nofillin
+

Do not fill in missing values in packet fields that can be exactly calculated. +

+
noparse
+

Disable AVParsers, this needs +nofillin too. +

+
sortdts
+

Try to interleave output packets by DTS. At present, available only for AVIs with an index. +

+
+ +

Possible values for output files: +

+
autobsf
+

Automatically apply bitstream filters as required by the output format. Enabled by default. +

+
bitexact
+

Only write platform-, build- and time-independent data. +This ensures that file and data checksums are reproducible and match between +platforms. Its primary use is for regression testing. +

+
flush_packets
+

Write out packets immediately. +

+
shortest
+

Stop muxing at the end of the shortest stream. +It may be needed to increase max_interleave_delta to avoid flushing the longer +streams before EOF. +

+
+ +
+
seek2any integer (input)
+

Allow seeking to non-keyframes on demuxer level when supported if set to 1. +Default is 0. +

+
+
analyzeduration integer (input)
+

Specify how many microseconds are analyzed to probe the input. A +higher value will enable detecting more accurate information, but will +increase latency. It defaults to 5,000,000 microseconds = 5 seconds. +

+
+
cryptokey hexadecimal string (input)
+

Set decryption key. +

+
+
indexmem integer (input)
+

Set max memory used for timestamp index (per stream). +

+
+
rtbufsize integer (input)
+

Set max memory used for buffering real-time frames. +

+
+
fdebug flags (input/output)
+

Print specific debug info. +

+

Possible values: +

+
ts
+
+ +
+
max_delay integer (input/output)
+

Set maximum muxing or demuxing delay in microseconds. +

+
+
fpsprobesize integer (input)
+

Set number of frames used to probe fps. +

+
+
audio_preload integer (output)
+

Set microseconds by which audio packets should be interleaved earlier. +

+
+
chunk_duration integer (output)
+

Set microseconds for each chunk. +

+
+
chunk_size integer (output)
+

Set size in bytes for each chunk. +

+
+
err_detect, f_err_detect flags (input)
+

Set error detection flags. f_err_detect is deprecated and +should be used only via the ffmpeg tool. +

+

Possible values: +

+
crccheck
+

Verify embedded CRCs. +

+
bitstream
+

Detect bitstream specification deviations. +

+
buffer
+

Detect improper bitstream length. +

+
explode
+

Abort decoding on minor error detection. +

+
careful
+

Consider things that violate the spec and have not been seen in the +wild as errors. +

+
compliant
+

Consider all spec non compliancies as errors. +

+
aggressive
+

Consider things that a sane encoder should not do as an error. +

+
+ +
+
max_interleave_delta integer (output)
+

Set maximum buffering duration for interleaving. The duration is +expressed in microseconds, and defaults to 10000000 (10 seconds). +

+

To ensure all the streams are interleaved correctly, libavformat will +wait until it has at least one packet for each stream before actually +writing any packets to the output file. When some streams are +"sparse" (i.e. there are large gaps between successive packets), this +can result in excessive buffering. +

+

This field specifies the maximum difference between the timestamps of the +first and the last packet in the muxing queue, above which libavformat +will output a packet regardless of whether it has queued a packet for all +the streams. +

+

If set to 0, libavformat will continue buffering packets until it has +a packet for each stream, regardless of the maximum timestamp +difference between the buffered packets. +

+
+
use_wallclock_as_timestamps integer (input)
+

Use wallclock as timestamps if set to 1. Default is 0. +

+
+
avoid_negative_ts integer (output)
+
+

Possible values: +

+
make_non_negative
+

Shift timestamps to make them non-negative. +Also note that this affects only leading negative timestamps, and not +non-monotonic negative timestamps. +

+
make_zero
+

Shift timestamps so that the first timestamp is 0. +

+
auto (default)
+

Enables shifting when required by the target format. +

+
disabled
+

Disables shifting of timestamp. +

+
+ +

When shifting is enabled, all output timestamps are shifted by the +same amount. Audio, video, and subtitles desynching and relative +timestamp differences are preserved compared to how they would have +been without shifting. +

+
+
skip_initial_bytes integer (input)
+

Set number of bytes to skip before reading header and frames if set to 1. +Default is 0. +

+
+
correct_ts_overflow integer (input)
+

Correct single timestamp overflows if set to 1. Default is 1. +

+
+
flush_packets integer (output)
+

Flush the underlying I/O stream after each packet. Default is -1 (auto), which +means that the underlying protocol will decide, 1 enables it, and has the +effect of reducing the latency, 0 disables it and may increase IO throughput in +some cases. +

+
+
output_ts_offset offset (output)
+

Set the output time offset. +

+

offset must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

The offset is added by the muxer to the output timestamps. +

+

Specifying a positive offset means that the corresponding streams are +delayed bt the time duration specified in offset. Default value +is 0 (meaning that no offset is applied). +

+
+
format_whitelist list (input)
+

"," separated list of allowed demuxers. By default all are allowed. +

+
+
dump_separator string (input)
+

Separator used to separate the fields printed on the command line about the +Stream parameters. +For example, to separate the fields with newlines and indentation: +

+
ffprobe -dump_separator "
+                          "  -i ~/videos/matrixbench_mpeg2.mpg
+
+ +
+
max_streams integer (input)
+

Specifies the maximum number of streams. This can be used to reject files that +would require too many resources due to a large number of streams. +

+
+
skip_estimate_duration_from_pts bool (input)
+

Skip estimation of input duration when calculated using PTS. +At present, applicable for MPEG-PS and MPEG-TS. +

+
+
strict, f_strict integer (input/output)
+

Specify how strictly to follow the standards. f_strict is deprecated and +should be used only via the ffmpeg tool. +

+

Possible values: +

+
very
+

strictly conform to an older more strict version of the spec or reference software +

+
strict
+

strictly conform to all the things in the spec no matter what consequences +

+
normal
+
unofficial
+

allow unofficial extensions +

+
experimental
+

allow non standardized experimental things, experimental +(unfinished/work in progress/not well tested) decoders and encoders. +Note: experimental decoders can pose a security risk, do not use this for +decoding untrusted input. +

+
+ +
+
+ + + +
+

2.1 Format stream specifiers

+ +

Format stream specifiers allow selection of one or more streams that +match specific properties. +

+

The exact semantics of stream specifiers is defined by the +avformat_match_stream_specifier() function declared in the +libavformat/avformat.h header and documented in the +(ffmpeg)Stream specifiers section in the ffmpeg(1) manual. +

+
+
+
+

3 Demuxers

+ +

Demuxers are configured elements in FFmpeg that can read the +multimedia streams from a particular type of file. +

+

When you configure your FFmpeg build, all the supported demuxers +are enabled by default. You can list all available ones using the +configure option --list-demuxers. +

+

You can disable all the demuxers using the configure option +--disable-demuxers, and selectively enable a single demuxer with +the option --enable-demuxer=DEMUXER, or disable it +with the option --disable-demuxer=DEMUXER. +

+

The option -demuxers of the ff* tools will display the list of +enabled demuxers. Use -formats to view a combined list of +enabled demuxers and muxers. +

+

The description of some of the currently available demuxers follows. +

+ +
+

3.1 aa

+ +

Audible Format 2, 3, and 4 demuxer. +

+

This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files. +

+
+
+

3.2 aac

+ +

Raw Audio Data Transport Stream AAC demuxer. +

+

This demuxer is used to demux an ADTS input containing a single AAC stream +alongwith any ID3v1/2 or APE tags in it. +

+
+
+

3.3 apng

+ +

Animated Portable Network Graphics demuxer. +

+

This demuxer is used to demux APNG files. +All headers, but the PNG signature, up to (but not including) the first +fcTL chunk are transmitted as extradata. +Frames are then split as being all the chunks between two fcTL ones, or +between the last fcTL and IEND chunks. +

+
+
-ignore_loop bool
+

Ignore the loop variable in the file if set. Default is enabled. +

+
+
-max_fps int
+

Maximum framerate in frames per second. Default of 0 imposes no limit. +

+
+
-default_fps int
+

Default framerate in frames per second when none is specified in the file +(0 meaning as fast as possible). Default is 15. +

+
+
+ +
+
+

3.4 asf

+ +

Advanced Systems Format demuxer. +

+

This demuxer is used to demux ASF files and MMS network streams. +

+
+
-no_resync_search bool
+

Do not try to resynchronize by looking for a certain optional start code. +

+
+ +
+
+

3.5 concat

+ +

Virtual concatenation script demuxer. +

+

This demuxer reads a list of files and other directives from a text file and +demuxes them one after the other, as if all their packets had been muxed +together. +

+

The timestamps in the files are adjusted so that the first file starts at 0 +and each next file starts where the previous one finishes. Note that it is +done globally and may cause gaps if all streams do not have exactly the same +length. +

+

All files must have the same streams (same codecs, same time base, etc.). +

+

The duration of each file is used to adjust the timestamps of the next file: +if the duration is incorrect (because it was computed using the bit-rate or +because the file is truncated, for example), it can cause artifacts. The +duration directive can be used to override the duration stored in +each file. +

+ +
+

3.5.1 Syntax

+ +

The script is a text file in extended-ASCII, with one directive per line. +Empty lines, leading spaces and lines starting with ’#’ are ignored. The +following directive is recognized: +

+
+
file path
+

Path to a file to read; special characters and spaces must be escaped with +backslash or single quotes. +

+

All subsequent file-related directives apply to that file. +

+
+
ffconcat version 1.0
+

Identify the script type and version. +

+

To make FFmpeg recognize the format automatically, this directive must +appear exactly as is (no extra space or byte-order-mark) on the very first +line of the script. +

+
+
duration dur
+

Duration of the file. This information can be specified from the file; +specifying it here may be more efficient or help if the information from the +file is not available or accurate. +

+

If the duration is set for all files, then it is possible to seek in the +whole concatenated video. +

+
+
inpoint timestamp
+

In point of the file. When the demuxer opens the file it instantly seeks to the +specified timestamp. Seeking is done so that all streams can be presented +successfully at In point. +

+

This directive works best with intra frame codecs, because for non-intra frame +ones you will usually get extra packets before the actual In point and the +decoded content will most likely contain frames before In point too. +

+

For each file, packets before the file In point will have timestamps less than +the calculated start timestamp of the file (negative in case of the first +file), and the duration of the files (if not specified by the duration +directive) will be reduced based on their specified In point. +

+

Because of potential packets before the specified In point, packet timestamps +may overlap between two concatenated files. +

+
+
outpoint timestamp
+

Out point of the file. When the demuxer reaches the specified decoding +timestamp in any of the streams, it handles it as an end of file condition and +skips the current and all the remaining packets from all streams. +

+

Out point is exclusive, which means that the demuxer will not output packets +with a decoding timestamp greater or equal to Out point. +

+

This directive works best with intra frame codecs and formats where all streams +are tightly interleaved. For non-intra frame codecs you will usually get +additional packets with presentation timestamp after Out point therefore the +decoded content will most likely contain frames after Out point too. If your +streams are not tightly interleaved you may not get all the packets from all +streams before Out point and you may only will be able to decode the earliest +stream until Out point. +

+

The duration of the files (if not specified by the duration +directive) will be reduced based on their specified Out point. +

+
+
file_packet_metadata key=value
+

Metadata of the packets of the file. The specified metadata will be set for +each file packet. You can specify this directive multiple times to add multiple +metadata entries. +This directive is deprecated, use file_packet_meta instead. +

+
+
file_packet_meta key value
+

Metadata of the packets of the file. The specified metadata will be set for +each file packet. You can specify this directive multiple times to add multiple +metadata entries. +

+
+
option key value
+

Option to access, open and probe the file. +Can be present multiple times. +

+
+
stream
+

Introduce a stream in the virtual file. +All subsequent stream-related directives apply to the last introduced +stream. +Some streams properties must be set in order to allow identifying the +matching streams in the subfiles. +If no streams are defined in the script, the streams from the first file are +copied. +

+
+
exact_stream_id id
+

Set the id of the stream. +If this directive is given, the string with the corresponding id in the +subfiles will be used. +This is especially useful for MPEG-PS (VOB) files, where the order of the +streams is not reliable. +

+
+
stream_meta key value
+

Metadata for the stream. +Can be present multiple times. +

+
+
stream_codec value
+

Codec for the stream. +

+
+
stream_extradata hex_string
+

Extradata for the string, encoded in hexadecimal. +

+
+
chapter id start end
+

Add a chapter. id is an unique identifier, possibly small and +consecutive. +

+
+
+ +
+
+

3.5.2 Options

+ +

This demuxer accepts the following option: +

+
+
safe
+

If set to 1, reject unsafe file paths and directives. +A file path is considered safe if it +does not contain a protocol specification and is relative and all components +only contain characters from the portable character set (letters, digits, +period, underscore and hyphen) and have no period at the beginning of a +component. +

+

If set to 0, any file name is accepted. +

+

The default is 1. +

+
+
auto_convert
+

If set to 1, try to perform automatic conversions on packet data to make the +streams concatenable. +The default is 1. +

+

Currently, the only conversion is adding the h264_mp4toannexb bitstream +filter to H.264 streams in MP4 format. This is necessary in particular if +there are resolution changes. +

+
+
segment_time_metadata
+

If set to 1, every packet will contain the lavf.concat.start_time and the +lavf.concat.duration packet metadata values which are the start_time and +the duration of the respective file segments in the concatenated output +expressed in microseconds. The duration metadata is only set if it is known +based on the concat file. +The default is 0. +

+
+
+ +
+
+

3.5.3 Examples

+ +
    +
  • Use absolute filenames and include some comments: +
    +
    # my first filename
    +file /mnt/share/file-1.wav
    +# my second filename including whitespace
    +file '/mnt/share/file 2.wav'
    +# my third filename including whitespace plus single quote
    +file '/mnt/share/file 3'\''.wav'
    +
    + +
  • Allow for input format auto-probing, use safe filenames and set the duration of +the first file: +
    +
    ffconcat version 1.0
    +
    +file file-1.wav
    +duration 20.0
    +
    +file subdir/file-2.wav
    +
    +
+ +
+
+
+

3.6 dash

+ +

Dynamic Adaptive Streaming over HTTP demuxer. +

+

This demuxer presents all AVStreams found in the manifest. +By setting the discard flags on AVStreams the caller can decide +which streams to actually receive. +Each stream mirrors the id and bandwidth properties from the +<Representation> as metadata keys named "id" and "variant_bitrate" respectively. +

+ +
+

3.6.1 Options

+ +

This demuxer accepts the following option: +

+
+
cenc_decryption_key
+

16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7). +

+
+
+ +
+
+
+

3.7 ea

+ +

Electronic Arts Multimedia format demuxer. +

+

This format is used by various Electronic Arts games. +

+ +
+

3.7.1 Options

+ +
+
merge_alpha bool
+
+

Normally the VP6 alpha channel (if exists) is returned as a secondary video +stream, by setting this option you can make the demuxer return a single video +stream which contains the alpha channel in addition to the ordinary video. +

+
+
+ +
+
+
+

3.8 imf

+ +

Interoperable Master Format demuxer. +

+

This demuxer presents audio and video streams found in an IMF Composition, as +specified in SMPTE ST 2067-2. +

+
+
ffmpeg [-assetmaps <path of ASSETMAP1>,<path of ASSETMAP2>,...] -i <path of CPL> ...
+
+ +

If -assetmaps is not specified, the demuxer looks for a file called +ASSETMAP.xml in the same directory as the CPL. +

+
+
+

3.9 flv, live_flv, kux

+ +

Adobe Flash Video Format demuxer. +

+

This demuxer is used to demux FLV files and RTMP network streams. In case of live network streams, if you force format, you may use live_flv option instead of flv to survive timestamp discontinuities. +KUX is a flv variant used on the Youku platform. +

+
+
ffmpeg -f flv -i myfile.flv ...
+ffmpeg -f live_flv -i rtmp://<any.server>/anything/key ....
+
+ + +
+
-flv_metadata bool
+

Allocate the streams according to the onMetaData array content. +

+
+
-flv_ignore_prevtag bool
+

Ignore the size of previous tag value. +

+
+
-flv_full_metadata bool
+

Output all context of the onMetadata. +

+
+ +
+
+

3.10 gif

+ +

Animated GIF demuxer. +

+

It accepts the following options: +

+
+
min_delay
+

Set the minimum valid delay between frames in hundredths of seconds. +Range is 0 to 6000. Default value is 2. +

+
+
max_gif_delay
+

Set the maximum valid delay between frames in hundredth of seconds. +Range is 0 to 65535. Default value is 65535 (nearly eleven minutes), +the maximum value allowed by the specification. +

+
+
default_delay
+

Set the default delay between frames in hundredths of seconds. +Range is 0 to 6000. Default value is 10. +

+
+
ignore_loop
+

GIF files can contain information to loop a certain number of times (or +infinitely). If ignore_loop is set to 1, then the loop setting +from the input will be ignored and looping will not occur. If set to 0, +then looping will occur and will cycle the number of times according to +the GIF. Default value is 1. +

+
+ +

For example, with the overlay filter, place an infinitely looping GIF +over another video: +

+
ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
+
+ +

Note that in the above example the shortest option for overlay filter is +used to end the output video at the length of the shortest input file, +which in this case is input.mp4 as the GIF in this example loops +infinitely. +

+
+
+

3.11 hls

+ +

HLS demuxer +

+

Apple HTTP Live Streaming demuxer. +

+

This demuxer presents all AVStreams from all variant streams. +The id field is set to the bitrate variant index number. By setting +the discard flags on AVStreams (by pressing ’a’ or ’v’ in ffplay), +the caller can decide which variant streams to actually receive. +The total bitrate of the variant that the stream belongs to is +available in a metadata key named "variant_bitrate". +

+

It accepts the following options: +

+
+
live_start_index
+

segment index to start live streams at (negative values are from the end). +

+
+
prefer_x_start
+

prefer to use #EXT-X-START if it’s in playlist instead of live_start_index. +

+
+
allowed_extensions
+

’,’ separated list of file extensions that hls is allowed to access. +

+
+
max_reload
+

Maximum number of times a insufficient list is attempted to be reloaded. +Default value is 1000. +

+
+
m3u8_hold_counters
+

The maximum number of times to load m3u8 when it refreshes without new segments. +Default value is 1000. +

+
+
http_persistent
+

Use persistent HTTP connections. Applicable only for HTTP streams. +Enabled by default. +

+
+
http_multiple
+

Use multiple HTTP connections for downloading HTTP segments. +Enabled by default for HTTP/1.1 servers. +

+
+
http_seekable
+

Use HTTP partial requests for downloading HTTP segments. +0 = disable, 1 = enable, -1 = auto, Default is auto. +

+
+
seg_format_options
+

Set options for the demuxer of media segments using a list of key=value pairs separated by :. +

+
+
seg_max_retry
+

Maximum number of times to reload a segment on error, useful when segment skip on network error is not desired. +Default value is 0. +

+
+ +
+
+

3.12 image2

+ +

Image file demuxer. +

+

This demuxer reads from a list of image files specified by a pattern. +The syntax and meaning of the pattern is specified by the +option pattern_type. +

+

The pattern may contain a suffix which is used to automatically +determine the format of the images contained in the files. +

+

The size, the pixel format, and the format of each image must be the +same for all the files in the sequence. +

+

This demuxer accepts the following options: +

+
framerate
+

Set the frame rate for the video stream. It defaults to 25. +

+
loop
+

If set to 1, loop over the input. Default value is 0. +

+
pattern_type
+

Select the pattern type used to interpret the provided filename. +

+

pattern_type accepts one of the following values. +

+
none
+

Disable pattern matching, therefore the video will only contain the specified +image. You should use this option if you do not want to create sequences from +multiple images and your filenames may contain special pattern characters. +

+
sequence
+

Select a sequence pattern type, used to specify a sequence of files +indexed by sequential numbers. +

+

A sequence pattern may contain the string "%d" or "%0Nd", which +specifies the position of the characters representing a sequential +number in each filename matched by the pattern. If the form +"%d0Nd" is used, the string representing the number in each +filename is 0-padded and N is the total number of 0-padded +digits representing the number. The literal character ’%’ can be +specified in the pattern with the string "%%". +

+

If the sequence pattern contains "%d" or "%0Nd", the first filename of +the file list specified by the pattern must contain a number +inclusively contained between start_number and +start_number+start_number_range-1, and all the following +numbers must be sequential. +

+

For example the pattern "img-%03d.bmp" will match a sequence of +filenames of the form img-001.bmp, img-002.bmp, ..., +img-010.bmp, etc.; the pattern "i%%m%%g-%d.jpg" will match a +sequence of filenames of the form i%m%g-1.jpg, +i%m%g-2.jpg, ..., i%m%g-10.jpg, etc. +

+

Note that the pattern must not necessarily contain "%d" or +"%0Nd", for example to convert a single image file +img.jpeg you can employ the command: +

+
ffmpeg -i img.jpeg img.png
+
+ +
+
glob
+

Select a glob wildcard pattern type. +

+

The pattern is interpreted like a glob() pattern. This is only +selectable if libavformat was compiled with globbing support. +

+
+
glob_sequence (deprecated, will be removed)
+

Select a mixed glob wildcard/sequence pattern. +

+

If your version of libavformat was compiled with globbing support, and +the provided pattern contains at least one glob meta character among +%*?[]{} that is preceded by an unescaped "%", the pattern is +interpreted like a glob() pattern, otherwise it is interpreted +like a sequence pattern. +

+

All glob special characters %*?[]{} must be prefixed +with "%". To escape a literal "%" you shall use "%%". +

+

For example the pattern foo-%*.jpeg will match all the +filenames prefixed by "foo-" and terminating with ".jpeg", and +foo-%?%?%?.jpeg will match all the filenames prefixed with +"foo-", followed by a sequence of three characters, and terminating +with ".jpeg". +

+

This pattern type is deprecated in favor of glob and +sequence. +

+
+ +

Default value is glob_sequence. +

+
pixel_format
+

Set the pixel format of the images to read. If not specified the pixel +format is guessed from the first image file in the sequence. +

+
start_number
+

Set the index of the file matched by the image file pattern to start +to read from. Default value is 0. +

+
start_number_range
+

Set the index interval range to check when looking for the first image +file in the sequence, starting from start_number. Default value +is 5. +

+
ts_from_file
+

If set to 1, will set frame timestamp to modification time of image file. Note +that monotonity of timestamps is not provided: images go in the same order as +without this option. Default value is 0. +If set to 2, will set frame timestamp to the modification time of the image file in +nanosecond precision. +

+
video_size
+

Set the video size of the images to read. If not specified the video +size is guessed from the first image file in the sequence. +

+
export_path_metadata
+

If set to 1, will add two extra fields to the metadata found in input, making them +also available for other filters (see drawtext filter for examples). Default +value is 0. The extra fields are described below: +

+
lavf.image2dec.source_path
+

Corresponds to the full path to the input file being read. +

+
lavf.image2dec.source_basename
+

Corresponds to the name of the file being read. +

+
+ +
+
+ + +
+

3.12.1 Examples

+ +
    +
  • Use ffmpeg for creating a video from the images in the file +sequence img-001.jpeg, img-002.jpeg, ..., assuming an +input frame rate of 10 frames per second: +
    +
    ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
    +
    + +
  • As above, but start by reading from a file with index 100 in the sequence: +
    +
    ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
    +
    + +
  • Read images matching the "*.png" glob pattern , that is all the files +terminating with the ".png" suffix: +
    +
    ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
    +
    +
+ +
+
+
+

3.13 libgme

+ +

The Game Music Emu library is a collection of video game music file emulators. +

+

See https://bitbucket.org/mpyne/game-music-emu/overview for more information. +

+

It accepts the following options: +

+
+
track_index
+

Set the index of which track to demux. The demuxer can only export one track. +Track indexes start at 0. Default is to pick the first track. Number of tracks +is exported as tracks metadata entry. +

+
+
sample_rate
+

Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100. +

+
+
max_size (bytes)
+

The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size, +which in turn, acts as a ceiling for the size of files that can be read. +Default is 50 MiB. +

+
+
+ +
+
+

3.14 libmodplug

+ +

ModPlug based module demuxer +

+

See https://github.com/Konstanty/libmodplug +

+

It will export one 2-channel 16-bit 44.1 kHz audio stream. +Optionally, a pal8 16-color video stream can be exported with or without printed metadata. +

+

It accepts the following options: +

+
+
noise_reduction
+

Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0. +

+
+
reverb_depth
+

Set amount of reverb. Range 0-100. Default is 0. +

+
+
reverb_delay
+

Set delay in ms, clamped to 40-250 ms. Default is 0. +

+
+
bass_amount
+

Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0. +

+
+
bass_range
+

Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0. +

+
+
surround_depth
+

Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0. +

+
+
surround_delay
+

Set surround delay in ms, clamped to 5-40 ms. Default is 0. +

+
+
max_size
+

The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size, +which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB. +0 removes buffer size limit (not recommended). Default is 5 MiB. +

+
+
video_stream_expr
+

String which is evaluated using the eval API to assign colors to the generated video stream. +Variables which can be used are x, y, w, h, t, speed, +tempo, order, pattern and row. +

+
+
video_stream
+

Generate video stream. Can be 1 (on) or 0 (off). Default is 0. +

+
+
video_stream_w
+

Set video frame width in ’chars’ where one char indicates 8 pixels. Range is 20-512. Default is 30. +

+
+
video_stream_h
+

Set video frame height in ’chars’ where one char indicates 8 pixels. Range is 20-512. Default is 30. +

+
+
video_stream_ptxt
+

Print metadata on video stream. Includes speed, tempo, order, pattern, +row and ts (time in ms). Can be 1 (on) or 0 (off). Default is 1. +

+
+
+ +
+
+

3.15 libopenmpt

+ +

libopenmpt based module demuxer +

+

See https://lib.openmpt.org/libopenmpt/ for more information. +

+

Some files have multiple subsongs (tracks) this can be set with the subsong +option. +

+

It accepts the following options: +

+
+
subsong
+

Set the subsong index. This can be either ’all’, ’auto’, or the index of the +subsong. Subsong indexes start at 0. The default is ’auto’. +

+

The default value is to let libopenmpt choose. +

+
+
layout
+

Set the channel layout. Valid values are 1, 2, and 4 channel layouts. +The default value is STEREO. +

+
+
sample_rate
+

Set the sample rate for libopenmpt to output. +Range is from 1000 to INT_MAX. The value default is 48000. +

+
+ +
+
+

3.16 mov/mp4/3gp

+ +

Demuxer for Quicktime File Format & ISO/IEC Base Media File Format (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12). +

+

Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v +

+ +
+

3.16.1 Options

+ +

This demuxer accepts the following options: +

+
enable_drefs
+

Enable loading of external tracks, disabled by default. +Enabling this can theoretically leak information in some use cases. +

+
+
use_absolute_path
+

Allows loading of external tracks via absolute paths, disabled by default. +Enabling this poses a security risk. It should only be enabled if the source +is known to be non-malicious. +

+
+
seek_streams_individually
+

When seeking, identify the closest point in each stream individually and demux packets in +that stream from identified point. This can lead to a different sequence of packets compared +to demuxing linearly from the beginning. Default is true. +

+
+
ignore_editlist
+

Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the +timeline described by the edit list. Default is false. +

+
+
advanced_editlist
+

Modify the stream index to reflect the timeline described by the edit list. ignore_editlist +must be set to false for this option to be effective. +If both ignore_editlist and this option are set to false, then only the +start of the stream index is modified to reflect initial dwell time or starting timestamp +described by the edit list. Default is true. +

+
+
ignore_chapters
+

Don’t parse chapters. This includes GoPro ’HiLight’ tags/moments. Note that chapters are +only parsed when input is seekable. Default is false. +

+
+
use_mfra_for
+

For seekable fragmented input, set fragment’s starting timestamp from media fragment random access box, if present. +

+

Following options are available: +

+
auto
+

Auto-detect whether to set mfra timestamps as PTS or DTS (default) +

+
+
dts
+

Set mfra timestamps as DTS +

+
+
pts
+

Set mfra timestamps as PTS +

+
+
0
+

Don’t use mfra box to set timestamps +

+
+ +
+
use_tfdt
+

For fragmented input, set fragment’s starting timestamp to baseMediaDecodeTime from the tfdt box. +Default is enabled, which will prefer to use the tfdt box to set DTS. Disable to use the earliest_presentation_time from the sidx box. +In either case, the timestamp from the mfra box will be used if it’s available and use_mfra_for is +set to pts or dts. +

+
+
export_all
+

Export unrecognized boxes within the udta box as metadata entries. The first four +characters of the box type are set as the key. Default is false. +

+
+
export_xmp
+

Export entire contents of XMP_ box and uuid box as a string with key xmp. Note that +if export_all is set and this option isn’t, the contents of XMP_ box are still exported +but with key XMP_. Default is false. +

+
+
activation_bytes
+

4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below. +

+
+
audible_fixed_key
+

Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to +specify. +

+
+
decryption_key
+

16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7). +

+
+
max_stts_delta
+

Very high sample deltas written in a trak’s stts box may occasionally be intended but usually they are written in +error or used to store a negative value for dts correction when treated as signed 32-bit integers. This option lets +the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when +cast to int32 are used to adjust onward dts. +

+

Unit is the track time scale. Range is 0 to UINT_MAX. Default is UINT_MAX - 48000*10 which allows upto +a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of uint32 range. +

+
+ +
+
+

3.16.2 Audible AAX

+ +

Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret. +

+
ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
+
+ +
+
+
+

3.17 mpegts

+ +

MPEG-2 transport stream demuxer. +

+

This demuxer accepts the following options: +

+
resync_size
+

Set size limit for looking up a new synchronization. Default value is +65536. +

+
+
skip_unknown_pmt
+

Skip PMTs for programs not defined in the PAT. Default value is 0. +

+
+
fix_teletext_pts
+

Override teletext packet PTS and DTS values with the timestamps calculated +from the PCR of the first program which the teletext stream is part of and is +not discarded. Default value is 1, set this option to 0 if you want your +teletext packet PTS and DTS values untouched. +

+
+
ts_packetsize
+

Output option carrying the raw packet size in bytes. +Show the detected raw packet size, cannot be set by the user. +

+
+
scan_all_pmts
+

Scan and combine all PMTs. The value is an integer with value from -1 +to 1 (-1 means automatic setting, 1 means enabled, 0 means +disabled). Default value is -1. +

+
+
merge_pmt_versions
+

Re-use existing streams when a PMT’s version is updated and elementary +streams move to different PIDs. Default value is 0. +

+
+
max_packet_size
+

Set maximum size, in bytes, of packet emitted by the demuxer. Payloads above this size +are split across multiple packets. Range is 1 to INT_MAX/2. Default is 204800 bytes. +

+
+ +
+
+

3.18 mpjpeg

+ +

MJPEG encapsulated in multi-part MIME demuxer. +

+

This demuxer allows reading of MJPEG, where each frame is represented as a part of +multipart/x-mixed-replace stream. +

+
strict_mime_boundary
+

Default implementation applies a relaxed standard to multi-part MIME boundary detection, +to prevent regression with numerous existing endpoints not generating a proper MIME +MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check +of the boundary value. +

+
+ +
+
+

3.19 rawvideo

+ +

Raw video demuxer. +

+

This demuxer allows one to read raw video data. Since there is no header +specifying the assumed video parameters, the user must specify them +in order to be able to decode the data correctly. +

+

This demuxer accepts the following options: +

+
framerate
+

Set input video frame rate. Default value is 25. +

+
+
pixel_format
+

Set the input video pixel format. Default value is yuv420p. +

+
+
video_size
+

Set the input video size. This value must be specified explicitly. +

+
+ +

For example to read a rawvideo file input.raw with +ffplay, assuming a pixel format of rgb24, a video +size of 320x240, and a frame rate of 10 images per second, use +the command: +

+
ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
+
+ +
+
+

3.20 sbg

+ +

SBaGen script demuxer. +

+

This demuxer reads the script language used by SBaGen +http://uazu.net/sbagen/ to generate binaural beats sessions. A SBG +script looks like that: +

+
-SE
+a: 300-2.5/3 440+4.5/0
+b: 300-2.5/0 440+4.5/3
+off: -
+NOW      == a
++0:07:00 == b
++0:14:00 == a
++0:21:00 == b
++0:30:00    off
+
+ +

A SBG script can mix absolute and relative timestamps. If the script uses +either only absolute timestamps (including the script start time) or only +relative ones, then its layout is fixed, and the conversion is +straightforward. On the other hand, if the script mixes both kind of +timestamps, then the NOW reference for relative timestamps will be +taken from the current time of day at the time the script is read, and the +script layout will be frozen according to that reference. That means that if +the script is directly played, the actual times will match the absolute +timestamps up to the sound controller’s clock accuracy, but if the user +somehow pauses the playback or seeks, all times will be shifted accordingly. +

+
+
+

3.21 tedcaptions

+ +

JSON captions used for TED Talks. +

+

TED does not provide links to the captions, but they can be guessed from the +page. The file tools/bookmarklets.html from the FFmpeg source tree +contains a bookmarklet to expose them. +

+

This demuxer accepts the following option: +

+
start_time
+

Set the start time of the TED talk, in milliseconds. The default is 15000 +(15s). It is used to sync the captions with the downloadable videos, because +they include a 15s intro. +

+
+ +

Example: convert the captions to a format most players understand: +

+
ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
+
+ +
+
+

3.22 vapoursynth

+ +

Vapoursynth wrapper. +

+

Due to security concerns, Vapoursynth scripts will not +be autodetected so the input format has to be forced. For ff* CLI tools, +add -f vapoursynth before the input -i yourscript.vpy. +

+

This demuxer accepts the following option: +

+
max_script_size
+

The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size, +which in turn, acts as a ceiling for the size of scripts that can be read. +Default is 1 MiB. +

+
+ +
+
+
+

4 Muxers

+ +

Muxers are configured elements in FFmpeg which allow writing +multimedia streams to a particular type of file. +

+

When you configure your FFmpeg build, all the supported muxers +are enabled by default. You can list all available muxers using the +configure option --list-muxers. +

+

You can disable all the muxers with the configure option +--disable-muxers and selectively enable / disable single muxers +with the options --enable-muxer=MUXER / +--disable-muxer=MUXER. +

+

The option -muxers of the ff* tools will display the list of +enabled muxers. Use -formats to view a combined list of +enabled demuxers and muxers. +

+

A description of some of the currently available muxers follows. +

+ +
+

4.1 a64

+ +

A64 muxer for Commodore 64 video. Accepts a single a64_multi or a64_multi5 codec video stream. +

+
+
+

4.2 adts

+ +

Audio Data Transport Stream muxer. It accepts a single AAC stream. +

+ +
+

4.2.1 Options

+ +

It accepts the following options: +

+
+
write_id3v2 bool
+

Enable to write ID3v2.4 tags at the start of the stream. Default is disabled. +

+
+
write_apetag bool
+

Enable to write APE tags at the end of the stream. Default is disabled. +

+
+
write_mpeg2 bool
+

Enable to set MPEG version bit in the ADTS frame header to 1 which indicates MPEG-2. Default is 0, which indicates MPEG-4. +

+
+
+ +
+
+
+

4.3 aiff

+ +

Audio Interchange File Format muxer. +

+ +
+

4.3.1 Options

+ +

It accepts the following options: +

+
+
write_id3v2
+

Enable ID3v2 tags writing when set to 1. Default is 0 (disabled). +

+
+
id3v2_version
+

Select ID3v2 version to write. Currently only version 3 and 4 (aka. +ID3v2.3 and ID3v2.4) are supported. The default is version 4. +

+
+
+ +
+
+
+

4.4 alp

+ +

Muxer for audio of High Voltage Software’s Lego Racers game. It accepts a single ADPCM_IMA_ALP stream +with no more than 2 channels nor a sample rate greater than 44100 Hz. +

+

Extensions: tun, pcm +

+ +
+

4.4.1 Options

+ +

It accepts the following options: +

+
+
type type
+

Set file type. +

+
+
tun
+

Set file type as music. Must have a sample rate of 22050 Hz. +

+
+
pcm
+

Set file type as sfx. +

+
+
auto
+

Set file type as per output file extension. .pcm results in type pcm else type tun is set. (default) +

+
+
+ +
+
+ +
+
+
+

4.5 asf

+ +

Advanced Systems Format muxer. +

+

Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this +muxer too. +

+ +
+

4.5.1 Options

+ +

It accepts the following options: +

+
+
packet_size
+

Set the muxer packet size. By tuning this setting you may reduce data +fragmentation or muxer overhead depending on your source. Default value is +3200, minimum is 100, maximum is 64k. +

+
+
+ +
+
+
+

4.6 avi

+ +

Audio Video Interleaved muxer. +

+ +
+

4.6.1 Options

+ +

It accepts the following options: +

+
+
reserve_index_space
+

Reserve the specified amount of bytes for the OpenDML master index of each +stream within the file header. By default additional master indexes are +embedded within the data packets if there is no space left in the first master +index and are linked together as a chain of indexes. This index structure can +cause problems for some use cases, e.g. third-party software strictly relying +on the OpenDML index specification or when file seeking is slow. Reserving +enough index space in the file header avoids these problems. +

+

The required index space depends on the output file size and should be about 16 +bytes per gigabyte. When this option is omitted or set to zero the necessary +index space is guessed. +

+
+
write_channel_mask
+

Write the channel layout mask into the audio stream header. +

+

This option is enabled by default. Disabling the channel mask can be useful in +specific scenarios, e.g. when merging multiple audio streams into one for +compatibility with software that only supports a single audio stream in AVI +(see (ffmpeg-filters)the "amerge" section in the ffmpeg-filters manual). +

+
+
flipped_raw_rgb
+

If set to true, store positive height for raw RGB bitmaps, which indicates +bitmap is stored bottom-up. Note that this option does not flip the bitmap +which has to be done manually beforehand, e.g. by using the vflip filter. +Default is false and indicates bitmap is stored top down. +

+
+
+ +
+
+
+

4.7 chromaprint

+ +

Chromaprint fingerprinter. +

+

This muxer feeds audio data to the Chromaprint library, +which generates a fingerprint for the provided audio data. See https://acoustid.org/chromaprint +

+

It takes a single signed native-endian 16-bit raw audio stream of at most 2 channels. +

+ +
+

4.7.1 Options

+ +
+
silence_threshold
+

Threshold for detecting silence. Range is from -1 to 32767, where -1 disables +silence detection. Silence detection can only be used with version 3 of the +algorithm. +Silence detection must be disabled for use with the AcoustID service. Default is -1. +

+
+
algorithm
+

Version of algorithm to fingerprint with. Range is 0 to 4. +Version 3 enables silence detection. Default is 1. +

+
+
fp_format
+

Format to output the fingerprint as. Accepts the following options: +

+
raw
+

Binary raw fingerprint +

+
+
compressed
+

Binary compressed fingerprint +

+
+
base64
+

Base64 compressed fingerprint (default) +

+
+
+ +
+
+ +
+
+
+

4.8 crc

+ +

CRC (Cyclic Redundancy Check) testing format. +

+

This muxer computes and prints the Adler-32 CRC of all the input audio +and video frames. By default audio frames are converted to signed +16-bit raw audio and video frames to raw video before computing the +CRC. +

+

The output of the muxer consists of a single line of the form: +CRC=0xCRC, where CRC is a hexadecimal number 0-padded to +8 digits containing the CRC for all the decoded input frames. +

+

See also the framecrc muxer. +

+ +
+

4.8.1 Examples

+ +

For example to compute the CRC of the input, and store it in the file +out.crc: +

+
ffmpeg -i INPUT -f crc out.crc
+
+ +

You can print the CRC to stdout with the command: +

+
ffmpeg -i INPUT -f crc -
+
+ +

You can select the output format of each frame with ffmpeg by +specifying the audio and video codec and format. For example to +compute the CRC of the input audio converted to PCM unsigned 8-bit +and the input video converted to MPEG-2 video, use the command: +

+
ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
+
+ +
+
+
+

4.9 dash

+ +

Dynamic Adaptive Streaming over HTTP (DASH) muxer that creates segments +and manifest files according to the MPEG-DASH standard ISO/IEC 23009-1:2014. +

+

For more information see: +

+ + +

It creates a MPD manifest file and segment files for each stream. +

+

The segment filename might contain pre-defined identifiers used with SegmentTemplate +as defined in section 5.3.9.4.4 of the standard. Available identifiers are "$RepresentationID$", +"$Number$", "$Bandwidth$" and "$Time$". +In addition to the standard identifiers, an ffmpeg-specific "$ext$" identifier is also supported. +When specified ffmpeg will replace $ext$ in the file name with muxing format’s extensions such as mp4, webm etc., +

+
+
ffmpeg -re -i <input> -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
+-b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline \
+-profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 \
+-b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 \
+-window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" \
+-f dash /path/to/out.mpd
+
+ +
+
seg_duration duration
+

Set the segment length in seconds (fractional value can be set). The value is +treated as average segment duration when use_template is enabled and +use_timeline is disabled and as minimum segment duration for all the other +use cases. +

+
frag_duration duration
+

Set the length in seconds of fragments within segments (fractional value can be set). +

+
frag_type type
+

Set the type of interval for fragmentation. +

+
window_size size
+

Set the maximum number of segments kept in the manifest. +

+
extra_window_size size
+

Set the maximum number of segments kept outside of the manifest before removing from disk. +

+
remove_at_exit remove
+

Enable (1) or disable (0) removal of all segments when finished. +

+
use_template template
+

Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList. +

+
use_timeline timeline
+

Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate. +

+
single_file single_file
+

Enable (1) or disable (0) storing all segments in one file, accessed using byte ranges. +

+
single_file_name file_name
+

DASH-templated name to be used for baseURL. Implies single_file set to "1". In the template, "$ext$" is replaced with the file name extension specific for the segment format. +

+
init_seg_name init_name
+

DASH-templated name to used for the initialization segment. Default is "init-stream$RepresentationID$.$ext$". "$ext$" is replaced with the file name extension specific for the segment format. +

+
media_seg_name segment_name
+

DASH-templated name to used for the media segments. Default is "chunk-stream$RepresentationID$-$Number%05d$.$ext$". "$ext$" is replaced with the file name extension specific for the segment format. +

+
utc_timing_url utc_url
+

URL of the page that will return the UTC timestamp in ISO format. Example: "https://time.akamai.com/?iso" +

+
method method
+

Use the given HTTP method to create output files. Generally set to PUT or POST. +

+
http_user_agent user_agent
+

Override User-Agent field in HTTP header. Applicable only for HTTP output. +

+
http_persistent http_persistent
+

Use persistent HTTP connections. Applicable only for HTTP output. +

+
hls_playlist hls_playlist
+

Generate HLS playlist files as well. The master playlist is generated with the filename hls_master_name. +One media playlist file is generated for each stream with filenames media_0.m3u8, media_1.m3u8, etc. +

+
hls_master_name file_name
+

HLS master playlist name. Default is "master.m3u8". +

+
streaming streaming
+

Enable (1) or disable (0) chunk streaming mode of output. In chunk streaming +mode, each frame will be a moof fragment which forms a chunk. +

+
adaptation_sets adaptation_sets
+

Assign streams to AdaptationSets. Syntax is "id=x,streams=a,b,c id=y,streams=d,e" with x and y being the IDs +of the adaptation sets and a,b,c,d and e are the indices of the mapped streams. +

+

To map all video (or audio) streams to an AdaptationSet, "v" (or "a") can be used as stream identifier instead of IDs. +

+

When no assignment is defined, this defaults to an AdaptationSet for each stream. +

+

Optional syntax is "id=x,seg_duration=x,frag_duration=x,frag_type=type,descriptor=descriptor_string,streams=a,b,c id=y,seg_duration=y,frag_type=type,streams=d,e" and so on, +descriptor is useful to the scheme defined by ISO/IEC 23009-1:2014/Amd.2:2015. +For example, -adaptation_sets "id=0,descriptor=<SupplementalProperty schemeIdUri=\"urn:mpeg:dash:srd:2014\" value=\"0,0,0,1,1,2,2\"/>,streams=v". +Please note that descriptor string should be a self-closing xml tag. +seg_duration, frag_duration and frag_type override the global option values for each adaptation set. +For example, -adaptation_sets "id=0,seg_duration=2,frag_duration=1,frag_type=duration,streams=v id=1,seg_duration=2,frag_type=none,streams=a" +type_id marks an adaptation set as containing streams meant to be used for Trick Mode for the referenced adaptation set. +For example, -adaptation_sets "id=0,seg_duration=2,frag_type=none,streams=0 id=1,seg_duration=10,frag_type=none,trick_id=0,streams=1" +

+
timeout timeout
+

Set timeout for socket I/O operations. Applicable only for HTTP output. +

+
index_correction index_correction
+

Enable (1) or Disable (0) segment index correction logic. Applicable only when +use_template is enabled and use_timeline is disabled. +

+

When enabled, the logic monitors the flow of segment indexes. If a streams’s +segment index value is not at the expected real time position, then the logic +corrects that index value. +

+

Typically this logic is needed in live streaming use cases. The network bandwidth +fluctuations are common during long run streaming. Each fluctuation can cause +the segment indexes fall behind the expected real time position. +

+
format_options options_list
+

Set container format (mp4/webm) options using a : separated list of +key=value parameters. Values containing : special characters must be +escaped. +

+
+
global_sidx global_sidx
+

Write global SIDX atom. Applicable only for single file, mp4 output, non-streaming mode. +

+
+
dash_segment_type dash_segment_type
+

Possible values: +

+
auto
+

If this flag is set, the dash segment files format will be selected based on the stream codec. This is the default mode. +

+
+
mp4
+

If this flag is set, the dash segment files will be in in ISOBMFF format. +

+
+
webm
+

If this flag is set, the dash segment files will be in in WebM format. +

+
+ +
+
ignore_io_errors ignore_io_errors
+

Ignore IO errors during open and write. Useful for long-duration runs with network output. +

+
+
lhls lhls
+

Enable Low-latency HLS(LHLS). Adds #EXT-X-PREFETCH tag with current segment’s URI. +hls.js player folks are trying to standardize an open LHLS spec. The draft spec is available in https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md +This option tries to comply with the above open spec. +It enables streaming and hls_playlist options automatically. +This is an experimental feature. +

+

Note: This is not Apple’s version LHLS. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis +

+
+
ldash ldash
+

Enable Low-latency Dash by constraining the presence and values of some elements. +

+
+
master_m3u8_publish_rate master_m3u8_publish_rate
+

Publish master playlist repeatedly every after specified number of segment intervals. +

+
+
write_prft write_prft
+

Write Producer Reference Time elements on supported streams. This also enables writing +prft boxes in the underlying muxer. Applicable only when the utc_url option is enabled. +It’s set to auto by default, in which case the muxer will attempt to enable it only in modes +that require it. +

+
+
mpd_profile mpd_profile
+

Set one or more manifest profiles. +

+
+
http_opts http_opts
+

A :-separated list of key=value options to pass to the underlying HTTP +protocol. Applicable only for HTTP output. +

+
+
target_latency target_latency
+

Set an intended target latency in seconds (fractional value can be set) for serving. Applicable only when streaming and write_prft options are enabled. +This is an informative fields clients can use to measure the latency of the service. +

+
+
min_playback_rate min_playback_rate
+

Set the minimum playback rate indicated as appropriate for the purposes of automatically +adjusting playback latency and buffer occupancy during normal playback by clients. +

+
+
max_playback_rate max_playback_rate
+

Set the maximum playback rate indicated as appropriate for the purposes of automatically +adjusting playback latency and buffer occupancy during normal playback by clients. +

+
+
update_period update_period
+

Set the mpd update period ,for dynamic content. + The unit is second. +

+
+
+ +
+
+

4.10 fifo

+ +

The fifo pseudo-muxer allows the separation of encoding and muxing by using +first-in-first-out queue and running the actual muxer in a separate thread. This +is especially useful in combination with the tee muxer and can be used to +send data to several destinations with different reliability/writing speed/latency. +

+

API users should be aware that callback functions (interrupt_callback, +io_open and io_close) used within its AVFormatContext must be thread-safe. +

+

The behavior of the fifo muxer if the queue fills up or if the output fails is +selectable, +

+
    +
  • output can be transparently restarted with configurable delay between retries +based on real time or time of the processed stream. + +
  • encoding can be blocked during temporary failure, or continue transparently +dropping packets in case fifo queue fills up. + +
+ +
+
fifo_format
+

Specify the format name. Useful if it cannot be guessed from the +output name suffix. +

+
+
queue_size
+

Specify size of the queue (number of packets). Default value is 60. +

+
+
format_opts
+

Specify format options for the underlying muxer. Muxer options can be specified +as a list of key=value pairs separated by ’:’. +

+
+
drop_pkts_on_overflow bool
+

If set to 1 (true), in case the fifo queue fills up, packets will be dropped +rather than blocking the encoder. This makes it possible to continue streaming without +delaying the input, at the cost of omitting part of the stream. By default +this option is set to 0 (false), so in such cases the encoder will be blocked +until the muxer processes some of the packets and none of them is lost. +

+
+
attempt_recovery bool
+

If failure occurs, attempt to recover the output. This is especially useful +when used with network output, since it makes it possible to restart streaming transparently. +By default this option is set to 0 (false). +

+
+
max_recovery_attempts
+

Sets maximum number of successive unsuccessful recovery attempts after which +the output fails permanently. By default this option is set to 0 (unlimited). +

+
+
recovery_wait_time duration
+

Waiting time before the next recovery attempt after previous unsuccessful +recovery attempt. Default value is 5 seconds. +

+
+
recovery_wait_streamtime bool
+

If set to 0 (false), the real time is used when waiting for the recovery +attempt (i.e. the recovery will be attempted after at least +recovery_wait_time seconds). +If set to 1 (true), the time of the processed stream is taken into account +instead (i.e. the recovery will be attempted after at least recovery_wait_time +seconds of the stream is omitted). +By default, this option is set to 0 (false). +

+
+
recover_any_error bool
+

If set to 1 (true), recovery will be attempted regardless of type of the error +causing the failure. By default this option is set to 0 (false) and in case of +certain (usually permanent) errors the recovery is not attempted even when +attempt_recovery is set to 1. +

+
+
restart_with_keyframe bool
+

Specify whether to wait for the keyframe after recovering from +queue overflow or failure. This option is set to 0 (false) by default. +

+
+
timeshift duration
+

Buffer the specified amount of packets and delay writing the output. Note that +queue_size must be big enough to store the packets for timeshift. At the +end of the input the fifo buffer is flushed at realtime speed. +

+
+
+ + +
+

4.10.1 Examples

+ +
    +
  • Stream something to rtmp server, continue processing the stream at real-time +rate even in case of temporary failure (network outage) and attempt to recover +streaming every second indefinitely. +
    +
    ffmpeg -re -i ... -c:v libx264 -c:a aac -f fifo -fifo_format flv -map 0:v -map 0:a
    +  -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 1 rtmp://example.com/live/stream_name
    +
    + +
+ +
+
+
+

4.11 flv

+ +

Adobe Flash Video Format muxer. +

+

This muxer accepts the following options: +

+
+
flvflags flags
+

Possible values: +

+
+
aac_seq_header_detect
+

Place AAC sequence header based on audio stream data. +

+
+
no_sequence_end
+

Disable sequence end tag. +

+
+
no_metadata
+

Disable metadata tag. +

+
+
no_duration_filesize
+

Disable duration and filesize in metadata when they are equal to zero +at the end of stream. (Be used to non-seekable living stream). +

+
+
add_keyframe_index
+

Used to facilitate seeking; particularly for HTTP pseudo streaming. +

+
+
+
+ +
+
+

4.12 framecrc

+ +

Per-packet CRC (Cyclic Redundancy Check) testing format. +

+

This muxer computes and prints the Adler-32 CRC for each audio +and video packet. By default audio frames are converted to signed +16-bit raw audio and video frames to raw video before computing the +CRC. +

+

The output of the muxer consists of a line for each audio and video +packet of the form: +

+
stream_index, packet_dts, packet_pts, packet_duration, packet_size, 0xCRC
+
+ +

CRC is a hexadecimal number 0-padded to 8 digits containing the +CRC of the packet. +

+ +
+

4.12.1 Examples

+ +

For example to compute the CRC of the audio and video frames in +INPUT, converted to raw audio and video packets, and store it +in the file out.crc: +

+
ffmpeg -i INPUT -f framecrc out.crc
+
+ +

To print the information to stdout, use the command: +

+
ffmpeg -i INPUT -f framecrc -
+
+ +

With ffmpeg, you can select the output format to which the +audio and video frames are encoded before computing the CRC for each +packet by specifying the audio and video codec. For example, to +compute the CRC of each decoded input audio frame converted to PCM +unsigned 8-bit and of each decoded input video frame converted to +MPEG-2 video, use the command: +

+
ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
+
+ +

See also the crc muxer. +

+
+
+
+

4.13 framehash

+ +

Per-packet hash testing format. +

+

This muxer computes and prints a cryptographic hash for each audio +and video packet. This can be used for packet-by-packet equality +checks without having to individually do a binary comparison on each. +

+

By default audio frames are converted to signed 16-bit raw audio and +video frames to raw video before computing the hash, but the output +of explicit conversions to other codecs can also be used. It uses the +SHA-256 cryptographic hash function by default, but supports several +other algorithms. +

+

The output of the muxer consists of a line for each audio and video +packet of the form: +

+
stream_index, packet_dts, packet_pts, packet_duration, packet_size, hash
+
+ +

hash is a hexadecimal number representing the computed hash +for the packet. +

+
+
hash algorithm
+

Use the cryptographic hash function specified by the string algorithm. +Supported values include MD5, murmur3, RIPEMD128, +RIPEMD160, RIPEMD256, RIPEMD320, SHA160, +SHA224, SHA256 (default), SHA512/224, SHA512/256, +SHA384, SHA512, CRC32 and adler32. +

+
+
+ + +
+

4.13.1 Examples

+ +

To compute the SHA-256 hash of the audio and video frames in INPUT, +converted to raw audio and video packets, and store it in the file +out.sha256: +

+
ffmpeg -i INPUT -f framehash out.sha256
+
+ +

To print the information to stdout, using the MD5 hash function, use +the command: +

+
ffmpeg -i INPUT -f framehash -hash md5 -
+
+ +

See also the hash muxer. +

+
+
+
+

4.14 framemd5

+ +

Per-packet MD5 testing format. +

+

This is a variant of the framehash muxer. Unlike that muxer, +it defaults to using the MD5 hash function. +

+ +
+

4.14.1 Examples

+ +

To compute the MD5 hash of the audio and video frames in INPUT, +converted to raw audio and video packets, and store it in the file +out.md5: +

+
ffmpeg -i INPUT -f framemd5 out.md5
+
+ +

To print the information to stdout, use the command: +

+
ffmpeg -i INPUT -f framemd5 -
+
+ +

See also the framehash and md5 muxers. +

+
+
+
+

4.15 gif

+ +

Animated GIF muxer. +

+

It accepts the following options: +

+
+
loop
+

Set the number of times to loop the output. Use -1 for no loop, 0 +for looping indefinitely (default). +

+
+
final_delay
+

Force the delay (expressed in centiseconds) after the last frame. Each frame +ends with a delay until the next frame. The default is -1, which is a +special value to tell the muxer to re-use the previous delay. In case of a +loop, you might want to customize this value to mark a pause for instance. +

+
+ +

For example, to encode a gif looping 10 times, with a 5 seconds delay between +the loops: +

+
ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
+
+ +

Note 1: if you wish to extract the frames into separate GIF files, you need to +force the image2 muxer: +

+
ffmpeg -i INPUT -c:v gif -f image2 "out%d.gif"
+
+ +

Note 2: the GIF format has a very large time base: the delay between two frames +can therefore not be smaller than one centi second. +

+
+
+

4.16 hash

+ +

Hash testing format. +

+

This muxer computes and prints a cryptographic hash of all the input +audio and video frames. This can be used for equality checks without +having to do a complete binary comparison. +

+

By default audio frames are converted to signed 16-bit raw audio and +video frames to raw video before computing the hash, but the output +of explicit conversions to other codecs can also be used. Timestamps +are ignored. It uses the SHA-256 cryptographic hash function by default, +but supports several other algorithms. +

+

The output of the muxer consists of a single line of the form: +algo=hash, where algo is a short string representing +the hash function used, and hash is a hexadecimal number +representing the computed hash. +

+
+
hash algorithm
+

Use the cryptographic hash function specified by the string algorithm. +Supported values include MD5, murmur3, RIPEMD128, +RIPEMD160, RIPEMD256, RIPEMD320, SHA160, +SHA224, SHA256 (default), SHA512/224, SHA512/256, +SHA384, SHA512, CRC32 and adler32. +

+
+
+ + +
+

4.16.1 Examples

+ +

To compute the SHA-256 hash of the input converted to raw audio and +video, and store it in the file out.sha256: +

+
ffmpeg -i INPUT -f hash out.sha256
+
+ +

To print an MD5 hash to stdout use the command: +

+
ffmpeg -i INPUT -f hash -hash md5 -
+
+ +

See also the framehash muxer. +

+
+
+
+

4.17 hls

+ +

Apple HTTP Live Streaming muxer that segments MPEG-TS according to +the HTTP Live Streaming (HLS) specification. +

+

It creates a playlist file, and one or more segment files. The output filename +specifies the playlist filename. +

+

By default, the muxer creates a file for each segment produced. These files +have the same name as the playlist, followed by a sequential number and a +.ts extension. +

+

Make sure to require a closed GOP when encoding and to set the GOP +size to fit your segment time constraint. +

+

For example, to convert an input file with ffmpeg: +

+
ffmpeg -i in.mkv -c:v h264 -flags +cgop -g 30 -hls_time 1 out.m3u8
+
+

This example will produce the playlist, out.m3u8, and segment files: +out0.ts, out1.ts, out2.ts, etc. +

+

See also the segment muxer, which provides a more generic and +flexible implementation of a segmenter, and can be used to perform HLS +segmentation. +

+ +
+

4.17.1 Options

+ +

This muxer supports the following options: +

+
+
hls_init_time duration
+

Set the initial target segment length. Default value is 0. +

+

duration must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

Segment will be cut on the next key frame after this time has passed on the first m3u8 list. +After the initial playlist is filled ffmpeg will cut segments +at duration equal to hls_time +

+
+
hls_time duration
+

Set the target segment length. Default value is 2. +

+

duration must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +Segment will be cut on the next key frame after this time has passed. +

+
+
hls_list_size size
+

Set the maximum number of playlist entries. If set to 0 the list file +will contain all the segments. Default value is 5. +

+
+
hls_delete_threshold size
+

Set the number of unreferenced segments to keep on disk before hls_flags delete_segments +deletes them. Increase this to allow continue clients to download segments which +were recently referenced in the playlist. Default value is 1, meaning segments older than +hls_list_size+1 will be deleted. +

+
+
hls_start_number_source
+

Start the playlist sequence number (#EXT-X-MEDIA-SEQUENCE) according to the specified source. +Unless hls_flags single_file is set, it also specifies source of starting sequence numbers of +segment and subtitle filenames. In any case, if hls_flags append_list +is set and read playlist sequence number is greater than the specified start sequence number, +then that value will be used as start value. +

+

It accepts the following values: +

+
+
generic (default)
+

Set the starting sequence numbers according to start_number option value. +

+
+
epoch
+

The start number will be the seconds since epoch (1970-01-01 00:00:00) +

+
+
epoch_us
+

The start number will be the microseconds since epoch (1970-01-01 00:00:00) +

+
+
datetime
+

The start number will be based on the current date/time as YYYYmmddHHMMSS. e.g. 20161231235759. +

+
+
+ +
+
start_number number
+

Start the playlist sequence number (#EXT-X-MEDIA-SEQUENCE) from the specified number +when hls_start_number_source value is generic. (This is the default case.) +Unless hls_flags single_file is set, it also specifies starting sequence numbers of segment and subtitle filenames. +Default value is 0. +

+
+
hls_allow_cache allowcache
+

Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments. +

+
+
hls_base_url baseurl
+

Append baseurl to every entry in the playlist. +Useful to generate playlists with absolute paths. +

+

Note that the playlist sequence number must be unique for each segment +and it is not to be confused with the segment filename sequence number +which can be cyclic, for example if the wrap option is +specified. +

+
+
hls_segment_filename filename
+

Set the segment filename. Unless hls_flags single_file is set, +filename is used as a string format with the segment number: +

+
ffmpeg -i in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
+
+

This example will produce the playlist, out.m3u8, and segment files: +file000.ts, file001.ts, file002.ts, etc. +

+

filename may contain full path or relative path specification, +but only the file name part without any path info will be contained in the m3u8 segment list. +Should a relative path be specified, the path of the created segment +files will be relative to the current working directory. +When strftime_mkdir is set, the whole expanded value of filename will be written into the m3u8 segment list. +

+

When var_stream_map is set with two or more variant streams, the +filename pattern must contain the string "%v", this string specifies +the position of variant stream index in the generated segment file names. +

+
ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
+  -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \
+  -hls_segment_filename 'file_%v_%03d.ts' out_%v.m3u8
+
+

This example will produce the playlists segment file sets: +file_0_000.ts, file_0_001.ts, file_0_002.ts, etc. and +file_1_000.ts, file_1_001.ts, file_1_002.ts, etc. +

+

The string "%v" may be present in the filename or in the last directory name +containing the file, but only in one of them. (Additionally, %v may appear multiple times in the last +sub-directory or filename.) If the string %v is present in the directory name, then +sub-directories are created after expanding the directory name pattern. This +enables creation of segments corresponding to different variant streams in +subdirectories. +

+
ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
+  -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \
+  -hls_segment_filename 'vs%v/file_%03d.ts' vs%v/out.m3u8
+
+

This example will produce the playlists segment file sets: +vs0/file_000.ts, vs0/file_001.ts, vs0/file_002.ts, etc. and +vs1/file_000.ts, vs1/file_001.ts, vs1/file_002.ts, etc. +

+
+
strftime
+

Use strftime() on filename to expand the segment filename with localtime. +The segment number is also available in this mode, but to use it, you need to specify second_level_segment_index +hls_flag and %%d will be the specifier. +

+
ffmpeg -i in.nut -strftime 1 -hls_segment_filename 'file-%Y%m%d-%s.ts' out.m3u8
+
+

This example will produce the playlist, out.m3u8, and segment files: +file-20160215-1455569023.ts, file-20160215-1455569024.ts, etc. +Note: On some systems/environments, the %s specifier is not available. See + strftime() documentation. +

+
ffmpeg -i in.nut -strftime 1 -hls_flags second_level_segment_index -hls_segment_filename 'file-%Y%m%d-%%04d.ts' out.m3u8
+
+

This example will produce the playlist, out.m3u8, and segment files: +file-20160215-0001.ts, file-20160215-0002.ts, etc. +

+
+
strftime_mkdir
+

Used together with -strftime_mkdir, it will create all subdirectories which +is expanded in filename. +

+
ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y%m%d/file-%Y%m%d-%s.ts' out.m3u8
+
+

This example will create a directory 201560215 (if it does not exist), and then +produce the playlist, out.m3u8, and segment files: +20160215/file-20160215-1455569023.ts, 20160215/file-20160215-1455569024.ts, etc. +

+
+
ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y/%m/%d/file-%Y%m%d-%s.ts' out.m3u8
+
+

This example will create a directory hierarchy 2016/02/15 (if any of them do not exist), and then +produce the playlist, out.m3u8, and segment files: +2016/02/15/file-20160215-1455569023.ts, 2016/02/15/file-20160215-1455569024.ts, etc. +

+
+
hls_segment_options options_list
+

Set output format options using a :-separated list of key=value +parameters. Values containing : special characters must be +escaped. +

+
+
hls_key_info_file key_info_file
+

Use the information in key_info_file for segment encryption. The first +line of key_info_file specifies the key URI written to the playlist. The +key URL is used to access the encryption key during playback. The second line +specifies the path to the key file used to obtain the key during the encryption +process. The key file is read as a single packed array of 16 octets in binary +format. The optional third line specifies the initialization vector (IV) as a +hexadecimal string to be used instead of the segment sequence number (default) +for encryption. Changes to key_info_file will result in segment +encryption with the new key/IV and an entry in the playlist for the new key +URI/IV if hls_flags periodic_rekey is enabled. +

+

Key info file format: +

+
key URI
+key file path
+IV (optional)
+
+ +

Example key URIs: +

+
http://server/file.key
+/path/to/file.key
+file.key
+
+ +

Example key file paths: +

+
file.key
+/path/to/file.key
+
+ +

Example IV: +

+
0123456789ABCDEF0123456789ABCDEF
+
+ +

Key info file example: +

+
http://server/file.key
+/path/to/file.key
+0123456789ABCDEF0123456789ABCDEF
+
+ +

Example shell script: +

+
#!/bin/sh
+BASE_URL=${1:-'.'}
+openssl rand 16 > file.key
+echo $BASE_URL/file.key > file.keyinfo
+echo file.key >> file.keyinfo
+echo $(openssl rand -hex 16) >> file.keyinfo
+ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
+  -hls_key_info_file file.keyinfo out.m3u8
+
+ +
+
-hls_enc enc
+

Enable (1) or disable (0) the AES128 encryption. +When enabled every segment generated is encrypted and the encryption key +is saved as playlist name.key. +

+
+
-hls_enc_key key
+

16-octet key to encrypt the segments, by default it +is randomly generated. +

+
+
-hls_enc_key_url keyurl
+

If set, keyurl is prepended instead of baseurl to the key filename +in the playlist. +

+
+
-hls_enc_iv iv
+

16-octet initialization vector for every segment instead +of the autogenerated ones. +

+
+
hls_segment_type flags
+

Possible values: +

+
+
mpegts
+

Output segment files in MPEG-2 Transport Stream format. This is +compatible with all HLS versions. +

+
+
fmp4
+

Output segment files in fragmented MP4 format, similar to MPEG-DASH. +fmp4 files may be used in HLS version 7 and above. +

+
+
+ +
+
hls_fmp4_init_filename filename
+

Set filename to the fragment files header file, default filename is init.mp4. +

+

Use -strftime 1 on filename to expand the segment filename with localtime. +

+
ffmpeg -i in.nut  -hls_segment_type fmp4 -strftime 1 -hls_fmp4_init_filename "%s_init.mp4" out.m3u8
+
+

This will produce init like this +1602678741_init.mp4 +

+
+
hls_fmp4_init_resend
+

Resend init file after m3u8 file refresh every time, default is 0. +

+

When var_stream_map is set with two or more variant streams, the +filename pattern must contain the string "%v", this string specifies +the position of variant stream index in the generated init file names. +The string "%v" may be present in the filename or in the last directory name +containing the file. If the string is present in the directory name, then +sub-directories are created after expanding the directory name pattern. This +enables creation of init files corresponding to different variant streams in +subdirectories. +

+
+
hls_flags flags
+

Possible values: +

+
+
single_file
+

If this flag is set, the muxer will store all segments in a single MPEG-TS +file, and will use byte ranges in the playlist. HLS playlists generated with +this way will have the version number 4. +For example: +

+
ffmpeg -i in.nut -hls_flags single_file out.m3u8
+
+

Will produce the playlist, out.m3u8, and a single segment file, +out.ts. +

+
+
delete_segments
+

Segment files removed from the playlist are deleted after a period of time +equal to the duration of the segment plus the duration of the playlist. +

+
+
append_list
+

Append new segments into the end of old segment list, +and remove the #EXT-X-ENDLIST from the old segment list. +

+
+
round_durations
+

Round the duration info in the playlist file segment info to integer +values, instead of using floating point. +If there are no other features requiring higher HLS versions be used, +then this will allow ffmpeg to output a HLS version 2 m3u8. +

+
+
discont_start
+

Add the #EXT-X-DISCONTINUITY tag to the playlist, before the +first segment’s information. +

+
+
omit_endlist
+

Do not append the EXT-X-ENDLIST tag at the end of the playlist. +

+
+
periodic_rekey
+

The file specified by hls_key_info_file will be checked periodically and +detect updates to the encryption info. Be sure to replace this file atomically, +including the file containing the AES encryption key. +

+
+
independent_segments
+

Add the #EXT-X-INDEPENDENT-SEGMENTS to playlists that has video segments +and when all the segments of that playlist are guaranteed to start with a Key frame. +

+
+
iframes_only
+

Add the #EXT-X-I-FRAMES-ONLY to playlists that has video segments +and can play only I-frames in the #EXT-X-BYTERANGE mode. +

+
+
split_by_time
+

Allow segments to start on frames other than keyframes. This improves +behavior on some players when the time between keyframes is inconsistent, +but may make things worse on others, and can cause some oddities during +seeking. This flag should be used with the hls_time option. +

+
+
program_date_time
+

Generate EXT-X-PROGRAM-DATE-TIME tags. +

+
+
second_level_segment_index
+

Makes it possible to use segment indexes as %%d in hls_segment_filename expression +besides date/time values when strftime is on. +To get fixed width numbers with trailing zeroes, %%0xd format is available where x is the required width. +

+
+
second_level_segment_size
+

Makes it possible to use segment sizes (counted in bytes) as %%s in hls_segment_filename +expression besides date/time values when strftime is on. +To get fixed width numbers with trailing zeroes, %%0xs format is available where x is the required width. +

+
+
second_level_segment_duration
+

Makes it possible to use segment duration (calculated in microseconds) as %%t in hls_segment_filename +expression besides date/time values when strftime is on. +To get fixed width numbers with trailing zeroes, %%0xt format is available where x is the required width. +

+
+
ffmpeg -i sample.mpeg \
+   -f hls -hls_time 3 -hls_list_size 5 \
+   -hls_flags second_level_segment_index+second_level_segment_size+second_level_segment_duration \
+   -strftime 1 -strftime_mkdir 1 -hls_segment_filename "segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts" stream.m3u8
+
+

This will produce segments like this: +segment_20170102194334_0003_00122200_0000003000000.ts, segment_20170102194334_0004_00120072_0000003000000.ts etc. +

+
+
temp_file
+

Write segment data to filename.tmp and rename to filename only once the segment is complete. A webserver +serving up segments can be configured to reject requests to *.tmp to prevent access to in-progress segments +before they have been added to the m3u8 playlist. This flag also affects how m3u8 playlist files are created. +If this flag is set, all playlist files will written into temporary file and renamed after they are complete, similarly as segments are handled. +But playlists with file protocol and with type (hls_playlist_type) other than vod +are always written into temporary file regardless of this flag. Master playlist files (master_pl_name), if any, with file protocol, +are always written into temporary file regardless of this flag if master_pl_publish_rate value is other than zero. +

+
+
+ +
+
hls_playlist_type event
+

Emit #EXT-X-PLAYLIST-TYPE:EVENT in the m3u8 header. Forces +hls_list_size to 0; the playlist can only be appended to. +

+
+
hls_playlist_type vod
+

Emit #EXT-X-PLAYLIST-TYPE:VOD in the m3u8 header. Forces +hls_list_size to 0; the playlist must not change. +

+
+
method
+

Use the given HTTP method to create the hls files. +

+
ffmpeg -re -i in.ts -f hls -method PUT http://example.com/live/out.m3u8
+
+

This example will upload all the mpegts segment files to the HTTP +server using the HTTP PUT method, and update the m3u8 files every +refresh times using the same method. +Note that the HTTP server must support the given method for uploading +files. +

+
+
http_user_agent
+

Override User-Agent field in HTTP header. Applicable only for HTTP output. +

+
+
var_stream_map
+

Map string which specifies how to group the audio, video and subtitle streams +into different variant streams. The variant stream groups are separated +by space. +Expected string format is like this "a:0,v:0 a:1,v:1 ....". Here a:, v:, s: are +the keys to specify audio, video and subtitle streams respectively. +Allowed values are 0 to 9 (limited just based on practical usage). +

+

When there are two or more variant streams, the output filename pattern must +contain the string "%v", this string specifies the position of variant stream +index in the output media playlist filenames. The string "%v" may be present in +the filename or in the last directory name containing the file. If the string is +present in the directory name, then sub-directories are created after expanding +the directory name pattern. This enables creation of variant streams in +subdirectories. +

+
+
ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
+  -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \
+  http://example.com/live/out_%v.m3u8
+
+

This example creates two hls variant streams. The first variant stream will +contain video stream of bitrate 1000k and audio stream of bitrate 64k and the +second variant stream will contain video stream of bitrate 256k and audio +stream of bitrate 32k. Here, two media playlist with file names out_0.m3u8 and +out_1.m3u8 will be created. If you want something meaningful text instead of indexes +in result names, you may specify names for each or some of the variants +as in the following example. +

+ +
+
ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
+  -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0,name:my_hd v:1,a:1,name:my_sd" \
+  http://example.com/live/out_%v.m3u8
+
+ +

This example creates two hls variant streams as in the previous one. +But here, the two media playlist with file names out_my_hd.m3u8 and +out_my_sd.m3u8 will be created. +

+
+
ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k \
+  -map 0:v -map 0:a -map 0:v -f hls -var_stream_map "v:0 a:0 v:1" \
+  http://example.com/live/out_%v.m3u8
+
+

This example creates three hls variant streams. The first variant stream will +be a video only stream with video bitrate 1000k, the second variant stream will +be an audio only stream with bitrate 64k and the third variant stream will be a +video only stream with bitrate 256k. Here, three media playlist with file names +out_0.m3u8, out_1.m3u8 and out_2.m3u8 will be created. +

+
ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
+  -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \
+  http://example.com/live/vs_%v/out.m3u8
+
+

This example creates the variant streams in subdirectories. Here, the first +media playlist is created at http://example.com/live/vs_0/out.m3u8 and +the second one at http://example.com/live/vs_1/out.m3u8. +

+
ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k -b:v:1 3000k  \
+  -map 0:a -map 0:a -map 0:v -map 0:v -f hls \
+  -var_stream_map "a:0,agroup:aud_low a:1,agroup:aud_high v:0,agroup:aud_low v:1,agroup:aud_high" \
+  -master_pl_name master.m3u8 \
+  http://example.com/live/out_%v.m3u8
+
+

This example creates two audio only and two video only variant streams. In +addition to the #EXT-X-STREAM-INF tag for each variant stream in the master +playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams +and they are mapped to the two video only variant streams with audio group names +’aud_low’ and ’aud_high’. +

+

By default, a single hls variant containing all the encoded streams is created. +

+
+
ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
+  -map 0:a -map 0:a -map 0:v -f hls \
+  -var_stream_map "a:0,agroup:aud_low,default:yes a:1,agroup:aud_low v:0,agroup:aud_low" \
+  -master_pl_name master.m3u8 \
+  http://example.com/live/out_%v.m3u8
+
+

This example creates two audio only and one video only variant streams. In +addition to the #EXT-X-STREAM-INF tag for each variant stream in the master +playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams +and they are mapped to the one video only variant streams with audio group name +’aud_low’, and the audio group have default stat is NO or YES. +

+

By default, a single hls variant containing all the encoded streams is created. +

+
+
ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
+  -map 0:a -map 0:a -map 0:v -f hls \
+  -var_stream_map "a:0,agroup:aud_low,default:yes,language:ENG a:1,agroup:aud_low,language:CHN v:0,agroup:aud_low" \
+  -master_pl_name master.m3u8 \
+  http://example.com/live/out_%v.m3u8
+
+

This example creates two audio only and one video only variant streams. In +addition to the #EXT-X-STREAM-INF tag for each variant stream in the master +playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams +and they are mapped to the one video only variant streams with audio group name +’aud_low’, and the audio group have default stat is NO or YES, and one audio +have and language is named ENG, the other audio language is named CHN. +

+

By default, a single hls variant containing all the encoded streams is created. +

+
+
ffmpeg -y -i input_with_subtitle.mkv \
+ -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
+ -b:a:0 256k \
+ -c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \
+ -f hls -var_stream_map "v:0,a:0,s:0,sgroup:subtitle" \
+ -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
+ 10 -master_pl_publish_rate 10  -hls_flags \
+ delete_segments+discont_start+split_by_time ./tmp/video.m3u8
+
+ +

This example adds #EXT-X-MEDIA tag with TYPE=SUBTITLES in +the master playlist with webvtt subtitle group name ’subtitle’. Please make sure +the input file has one text subtitle stream at least. +

+
+
cc_stream_map
+

Map string which specifies different closed captions groups and their +attributes. The closed captions stream groups are separated by space. +Expected string format is like this +"ccgroup:<group name>,instreamid:<INSTREAM-ID>,language:<language code> ....". +’ccgroup’ and ’instreamid’ are mandatory attributes. ’language’ is an optional +attribute. +The closed captions groups configured using this option are mapped to different +variant streams by providing the same ’ccgroup’ name in the +var_stream_map string. If var_stream_map is not set, then the +first available ccgroup in cc_stream_map is mapped to the output variant +stream. The examples for these two use cases are given below. +

+
+
ffmpeg -re -i in.ts -b:v 1000k -b:a 64k -a53cc 1 -f hls \
+  -cc_stream_map "ccgroup:cc,instreamid:CC1,language:en" \
+  -master_pl_name master.m3u8 \
+  http://example.com/live/out.m3u8
+
+

This example adds #EXT-X-MEDIA tag with TYPE=CLOSED-CAPTIONS in +the master playlist with group name ’cc’, language ’en’ (english) and +INSTREAM-ID ’CC1’. Also, it adds CLOSED-CAPTIONS attribute with group +name ’cc’ for the output variant stream. +

+
ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
+  -a53cc:0 1 -a53cc:1 1\
+  -map 0:v -map 0:a -map 0:v -map 0:a -f hls \
+  -cc_stream_map "ccgroup:cc,instreamid:CC1,language:en ccgroup:cc,instreamid:CC2,language:sp" \
+  -var_stream_map "v:0,a:0,ccgroup:cc v:1,a:1,ccgroup:cc" \
+  -master_pl_name master.m3u8 \
+  http://example.com/live/out_%v.m3u8
+
+

This example adds two #EXT-X-MEDIA tags with TYPE=CLOSED-CAPTIONS in +the master playlist for the INSTREAM-IDs ’CC1’ and ’CC2’. Also, it adds +CLOSED-CAPTIONS attribute with group name ’cc’ for the two output variant +streams. +

+
+
master_pl_name
+

Create HLS master playlist with the given name. +

+
+
ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 http://example.com/live/out.m3u8
+
+

This example creates HLS master playlist with name master.m3u8 and it is +published at http://example.com/live/ +

+
+
master_pl_publish_rate
+

Publish master play list repeatedly every after specified number of segment intervals. +

+
+
ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 \
+-hls_time 2 -master_pl_publish_rate 30 http://example.com/live/out.m3u8
+
+ +

This example creates HLS master playlist with name master.m3u8 and keep +publishing it repeatedly every after 30 segments i.e. every after 60s. +

+
+
http_persistent
+

Use persistent HTTP connections. Applicable only for HTTP output. +

+
+
timeout
+

Set timeout for socket I/O operations. Applicable only for HTTP output. +

+
+
-ignore_io_errors
+

Ignore IO errors during open, write and delete. Useful for long-duration runs with network output. +

+
+
headers
+

Set custom HTTP headers, can override built in default headers. Applicable only for HTTP output. +

+
+
+ +
+
+
+

4.18 ico

+ +

ICO file muxer. +

+

Microsoft’s icon file format (ICO) has some strict limitations that should be noted: +

+
    +
  • Size cannot exceed 256 pixels in any dimension + +
  • Only BMP and PNG images can be stored + +
  • If a BMP image is used, it must be one of the following pixel formats: +
    +
    BMP Bit Depth      FFmpeg Pixel Format
    +1bit               pal8
    +4bit               pal8
    +8bit               pal8
    +16bit              rgb555le
    +24bit              bgr24
    +32bit              bgra
    +
    + +
  • If a BMP image is used, it must use the BITMAPINFOHEADER DIB header + +
  • If a PNG image is used, it must use the rgba pixel format +
+ +
+
+

4.19 image2

+ +

Image file muxer. +

+

The image file muxer writes video frames to image files. +

+

The output filenames are specified by a pattern, which can be used to +produce sequentially numbered series of files. +The pattern may contain the string "%d" or "%0Nd", this string +specifies the position of the characters representing a numbering in +the filenames. If the form "%0Nd" is used, the string +representing the number in each filename is 0-padded to N +digits. The literal character ’%’ can be specified in the pattern with +the string "%%". +

+

If the pattern contains "%d" or "%0Nd", the first filename of +the file list specified will contain the number 1, all the following +numbers will be sequential. +

+

The pattern may contain a suffix which is used to automatically +determine the format of the image files to write. +

+

For example the pattern "img-%03d.bmp" will specify a sequence of +filenames of the form img-001.bmp, img-002.bmp, ..., +img-010.bmp, etc. +The pattern "img%%-%d.jpg" will specify a sequence of filenames of the +form img%-1.jpg, img%-2.jpg, ..., img%-10.jpg, +etc. +

+

The image muxer supports the .Y.U.V image file format. This format is +special in that that each image frame consists of three files, for +each of the YUV420P components. To read or write this image file format, +specify the name of the ’.Y’ file. The muxer will automatically open the +’.U’ and ’.V’ files as required. +

+ +
+

4.19.1 Options

+ +
+
frame_pts
+

If set to 1, expand the filename with pts from pkt->pts. +Default value is 0. +

+
+
start_number
+

Start the sequence from the specified number. Default value is 1. +

+
+
update
+

If set to 1, the filename will always be interpreted as just a +filename, not a pattern, and the corresponding file will be continuously +overwritten with new images. Default value is 0. +

+
+
strftime
+

If set to 1, expand the filename with date and time information from +strftime(). Default value is 0. +

+
+
atomic_writing
+

Write output to a temporary file, which is renamed to target filename once +writing is completed. Default is disabled. +

+
+
protocol_opts options_list
+

Set protocol options as a :-separated list of key=value parameters. Values +containing the : special character must be escaped. +

+
+
+ +
+
+

4.19.2 Examples

+ +

The following example shows how to use ffmpeg for creating a +sequence of files img-001.jpeg, img-002.jpeg, ..., +taking one image every second from the input video: +

+
ffmpeg -i in.avi -vsync cfr -r 1 -f image2 'img-%03d.jpeg'
+
+ +

Note that with ffmpeg, if the format is not specified with the +-f option and the output filename specifies an image file +format, the image2 muxer is automatically selected, so the previous +command can be written as: +

+
ffmpeg -i in.avi -vsync cfr -r 1 'img-%03d.jpeg'
+
+ +

Note also that the pattern must not necessarily contain "%d" or +"%0Nd", for example to create a single image file +img.jpeg from the start of the input video you can employ the command: +

+
ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
+
+ +

The strftime option allows you to expand the filename with +date and time information. Check the documentation of +the strftime() function for the syntax. +

+

For example to generate image files from the strftime() +"%Y-%m-%d_%H-%M-%S" pattern, the following ffmpeg command +can be used: +

+
ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 "%Y-%m-%d_%H-%M-%S.jpg"
+
+ +

You can set the file name with current frame’s PTS: +

+
ffmpeg -f v4l2 -r 1 -i /dev/video0 -copyts -f image2 -frame_pts true %d.jpg
+
+ +

A more complex example is to publish contents of your desktop directly to a +WebDAV server every second: +

+
ffmpeg -f x11grab -framerate 1 -i :0.0 -q:v 6 -update 1 -protocol_opts method=PUT http://example.com/desktop.jpg
+
+ +
+
+
+

4.20 matroska

+ +

Matroska container muxer. +

+

This muxer implements the matroska and webm container specs. +

+ +
+

4.20.1 Metadata

+ +

The recognized metadata settings in this muxer are: +

+
+
title
+

Set title name provided to a single track. This gets mapped to +the FileDescription element for a stream written as attachment. +

+
+
language
+

Specify the language of the track in the Matroska languages form. +

+

The language can be either the 3 letters bibliographic ISO-639-2 (ISO +639-2/B) form (like "fre" for French), or a language code mixed with a +country code for specialities in languages (like "fre-ca" for Canadian +French). +

+
+
stereo_mode
+

Set stereo 3D video layout of two views in a single video track. +

+

The following values are recognized: +

+
mono
+

video is not stereo +

+
left_right
+

Both views are arranged side by side, Left-eye view is on the left +

+
bottom_top
+

Both views are arranged in top-bottom orientation, Left-eye view is at bottom +

+
top_bottom
+

Both views are arranged in top-bottom orientation, Left-eye view is on top +

+
checkerboard_rl
+

Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first +

+
checkerboard_lr
+

Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first +

+
row_interleaved_rl
+

Each view is constituted by a row based interleaving, Right-eye view is first row +

+
row_interleaved_lr
+

Each view is constituted by a row based interleaving, Left-eye view is first row +

+
col_interleaved_rl
+

Both views are arranged in a column based interleaving manner, Right-eye view is first column +

+
col_interleaved_lr
+

Both views are arranged in a column based interleaving manner, Left-eye view is first column +

+
anaglyph_cyan_red
+

All frames are in anaglyph format viewable through red-cyan filters +

+
right_left
+

Both views are arranged side by side, Right-eye view is on the left +

+
anaglyph_green_magenta
+

All frames are in anaglyph format viewable through green-magenta filters +

+
block_lr
+

Both eyes laced in one Block, Left-eye view is first +

+
block_rl
+

Both eyes laced in one Block, Right-eye view is first +

+
+
+
+ +

For example a 3D WebM clip can be created using the following command line: +

+
ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
+
+ +
+
+

4.20.2 Options

+ +

This muxer supports the following options: +

+
+
reserve_index_space
+

By default, this muxer writes the index for seeking (called cues in Matroska +terms) at the end of the file, because it cannot know in advance how much space +to leave for the index at the beginning of the file. However for some use cases +– e.g. streaming where seeking is possible but slow – it is useful to put the +index at the beginning of the file. +

+

If this option is set to a non-zero value, the muxer will reserve a given amount +of space in the file header and then try to write the cues there when the muxing +finishes. If the reserved space does not suffice, no Cues will be written, the +file will be finalized and writing the trailer will return an error. +A safe size for most use cases should be about 50kB per hour of video. +

+

Note that cues are only written if the output is seekable and this option will +have no effect if it is not. +

+
+
cues_to_front
+

If set, the muxer will write the index at the beginning of the file +by shifting the main data if necessary. This can be combined with +reserve_index_space in which case the data is only shifted if +the initially reserved space turns out to be insufficient. +

+

This option is ignored if the output is unseekable. +

+
+
default_mode
+

This option controls how the FlagDefault of the output tracks will be set. +It influences which tracks players should play by default. The default mode +is ‘passthrough’. +

+
infer
+

Every track with disposition default will have the FlagDefault set. +Additionally, for each type of track (audio, video or subtitle), if no track +with disposition default of this type exists, then the first track of this type +will be marked as default (if existing). This ensures that the default flag +is set in a sensible way even if the input originated from containers that +lack the concept of default tracks. +

+
infer_no_subs
+

This mode is the same as infer except that if no subtitle track with +disposition default exists, no subtitle track will be marked as default. +

+
passthrough
+

In this mode the FlagDefault is set if and only if the AV_DISPOSITION_DEFAULT +flag is set in the disposition of the corresponding stream. +

+
+ +
+
flipped_raw_rgb
+

If set to true, store positive height for raw RGB bitmaps, which indicates +bitmap is stored bottom-up. Note that this option does not flip the bitmap +which has to be done manually beforehand, e.g. by using the vflip filter. +Default is false and indicates bitmap is stored top down. +

+
+
+ +
+
+
+

4.21 md5

+ +

MD5 testing format. +

+

This is a variant of the hash muxer. Unlike that muxer, it +defaults to using the MD5 hash function. +

+ +
+

4.21.1 Examples

+ +

To compute the MD5 hash of the input converted to raw +audio and video, and store it in the file out.md5: +

+
ffmpeg -i INPUT -f md5 out.md5
+
+ +

You can print the MD5 to stdout with the command: +

+
ffmpeg -i INPUT -f md5 -
+
+ +

See also the hash and framemd5 muxers. +

+
+
+
+

4.22 mov, mp4, ismv

+ +

MOV/MP4/ISMV (Smooth Streaming) muxer. +

+

The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4 +file has all the metadata about all packets stored in one location +(written at the end of the file, it can be moved to the start for +better playback by adding +faststart to the -movflags, or +using the qt-faststart tool). +

+

A fragmented +file consists of a number of fragments, where packets and metadata +about these packets are stored together. Writing a fragmented +file has the advantage that the file is decodable even if the +writing is interrupted (while a normal MOV/MP4 is undecodable if +it is not properly finished), and it requires less memory when writing +very long files (since writing normal MOV/MP4 files stores info about +every single packet in memory until the file is closed). The downside +is that it is less compatible with other applications. +

+

Fragmentation is enabled by setting one of the options that define +how to cut the file into fragments: -frag_duration, -frag_size, +-min_frag_duration, -movflags +frag_keyframe and +-movflags +frag_custom. If more than one condition is specified, +fragments are cut when one of the specified conditions is fulfilled. The +exception to this is -min_frag_duration, which has to be fulfilled for +any of the other conditions to apply. +

+ +
+

4.22.1 Options

+ +
+
frag_duration duration
+

Create fragments that are duration microseconds long. +

+
frag_size size
+

Create fragments that contain up to size bytes of payload data. +

+
min_frag_duration duration
+

Don’t create fragments that are shorter than duration microseconds long. +

+
movflags flags
+

Set various muxing switches. The following flags can be used: +

+
frag_keyframe
+

Start a new fragment at each video keyframe. +

+
frag_custom
+

Allow the caller to manually choose when to cut fragments, by +calling av_write_frame(ctx, NULL) to write a fragment with +the packets written so far. (This is only useful with other +applications integrating libavformat, not from ffmpeg.) +

+
empty_moov
+

Write an initial moov atom directly at the start of the file, without +describing any samples in it. Generally, an mdat/moov pair is written +at the start of the file, as a normal MOV/MP4 file, containing only +a short portion of the file. With this option set, there is no initial +mdat atom, and the moov atom only describes the tracks but has +a zero duration. +

+

This option is implicitly set when writing ismv (Smooth Streaming) files. +

+
separate_moof
+

Write a separate moof (movie fragment) atom for each track. Normally, +packets for all tracks are written in a moof atom (which is slightly +more efficient), but with this option set, the muxer writes one moof/mdat +pair for each track, making it easier to separate tracks. +

+

This option is implicitly set when writing ismv (Smooth Streaming) files. +

+
skip_sidx
+

Skip writing of sidx atom. When bitrate overhead due to sidx atom is high, +this option could be used for cases where sidx atom is not mandatory. +When global_sidx flag is enabled, this option will be ignored. +

+
faststart
+

Run a second pass moving the index (moov atom) to the beginning of the file. +This operation can take a while, and will not work in various situations such +as fragmented output, thus it is not enabled by default. +

+
rtphint
+

Add RTP hinting tracks to the output file. +

+
disable_chpl
+

Disable Nero chapter markers (chpl atom). Normally, both Nero chapters +and a QuickTime chapter track are written to the file. With this option +set, only the QuickTime chapter track will be written. Nero chapters can +cause failures when the file is reprocessed with certain tagging programs, like +mp3Tag 2.61a and iTunes 11.3, most likely other versions are affected as well. +

+
omit_tfhd_offset
+

Do not write any absolute base_data_offset in tfhd atoms. This avoids +tying fragments to absolute byte positions in the file/streams. +

+
default_base_moof
+

Similarly to the omit_tfhd_offset, this flag avoids writing the +absolute base_data_offset field in tfhd atoms, but does so by using +the new default-base-is-moof flag instead. This flag is new from +14496-12:2012. This may make the fragments easier to parse in certain +circumstances (avoiding basing track fragment location calculations +on the implicit end of the previous track fragment). +

+
negative_cts_offsets
+

Enables utilization of version 1 of the CTTS box, in which the CTS offsets can +be negative. This enables the initial sample to have DTS/CTS of zero, and +reduces the need for edit lists for some cases such as video tracks with +B-frames. Additionally, eases conformance with the DASH-IF interoperability +guidelines. +

+

This option is implicitly set when writing ismv (Smooth Streaming) files. +

+
+ +
+
moov_size bytes
+

Reserves space for the moov atom at the beginning of the file instead of placing the +moov atom at the end. If the space reserved is insufficient, muxing will fail. +

+
+
write_tmcd
+

Specify on to force writing a timecode track, off to disable it +and auto to write a timecode track only for mov and mp4 output (default). +

+
+
write_btrt bool
+

Force or disable writing bitrate box inside stsd box of a track. +The box contains decoding buffer size (in bytes), maximum bitrate and +average bitrate for the track. The box will be skipped if none of these values +can be computed. +Default is -1 or auto, which will write the box only in MP4 mode. +

+
+
write_prft
+

Write producer time reference box (PRFT) with a specified time source for the +NTP field in the PRFT box. Set value as ‘wallclock’ to specify timesource +as wallclock time and ‘pts’ to specify timesource as input packets’ PTS +values. +

+

Setting value to ‘pts’ is applicable only for a live encoding use case, +where PTS values are set as as wallclock time at the source. For example, an +encoding use case with decklink capture source where video_pts and +audio_pts are set to ‘abs_wallclock’. +

+
+
empty_hdlr_name bool
+

Enable to skip writing the name inside a hdlr box. +Default is false. +

+
+
movie_timescale scale
+

Set the timescale written in the movie header box (mvhd). +Range is 1 to INT_MAX. Default is 1000. +

+
+
video_track_timescale scale
+

Set the timescale used for video tracks. Range is 0 to INT_MAX. +If set to 0, the timescale is automatically set based on +the native stream time base. Default is 0. +

+
+ +
+
+

4.22.2 Example

+ +

Smooth Streaming content can be pushed in real time to a publishing +point on IIS with this muxer. Example: +

+
ffmpeg -re <normal input/transcoding options> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
+
+ +
+
+
+

4.23 mp3

+ +

The MP3 muxer writes a raw MP3 stream with the following optional features: +

    +
  • An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and +2.4 are supported, the id3v2_version private option controls which one is +used (3 or 4). Setting id3v2_version to 0 disables the ID3v2 header +completely. + +

    The muxer supports writing attached pictures (APIC frames) to the ID3v2 header. +The pictures are supplied to the muxer in form of a video stream with a single +packet. There can be any number of those streams, each will correspond to a +single APIC frame. The stream metadata tags title and comment map +to APIC description and picture type respectively. See +http://id3.org/id3v2.4.0-frames for allowed picture types. +

    +

    Note that the APIC frames must be written at the beginning, so the muxer will +buffer the audio frames until it gets all the pictures. It is therefore advised +to provide the pictures as soon as possible to avoid excessive buffering. +

    +
  • A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by +default, but will be written only if the output is seekable. The +write_xing private option can be used to disable it. The frame contains +various information that may be useful to the decoder, like the audio duration +or encoder delay. + +
  • A legacy ID3v1 tag at the end of the file (disabled by default). It may be +enabled with the write_id3v1 private option, but as its capabilities are +very limited, its usage is not recommended. +
+ +

Examples: +

+

Write an mp3 with an ID3v2.3 header and an ID3v1 footer: +

+
ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
+
+ +

To attach a picture to an mp3 file select both the audio and the picture stream +with map: +

+
ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
+-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
+
+ +

Write a "clean" MP3 without any extra features: +

+
ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
+
+ +
+
+

4.24 mpegts

+ +

MPEG transport stream muxer. +

+

This muxer implements ISO 13818-1 and part of ETSI EN 300 468. +

+

The recognized metadata settings in mpegts muxer are service_provider +and service_name. If they are not set the default for +service_provider is ‘FFmpeg’ and the default for +service_name is ‘Service01’. +

+ +
+

4.24.1 Options

+ +

The muxer options are: +

+
+
mpegts_transport_stream_id integer
+

Set the ‘transport_stream_id’. This identifies a transponder in DVB. +Default is 0x0001. +

+
+
mpegts_original_network_id integer
+

Set the ‘original_network_id’. This is unique identifier of a +network in DVB. Its main use is in the unique identification of a service +through the path ‘Original_Network_ID, Transport_Stream_ID’. Default +is 0x0001. +

+
+
mpegts_service_id integer
+

Set the ‘service_id’, also known as program in DVB. Default is +0x0001. +

+
+
mpegts_service_type integer
+

Set the program ‘service_type’. Default is digital_tv. +Accepts the following options: +

+
hex_value
+

Any hexadecimal value between 0x01 and 0xff as defined in +ETSI 300 468. +

+
digital_tv
+

Digital TV service. +

+
digital_radio
+

Digital Radio service. +

+
teletext
+

Teletext service. +

+
advanced_codec_digital_radio
+

Advanced Codec Digital Radio service. +

+
mpeg2_digital_hdtv
+

MPEG2 Digital HDTV service. +

+
advanced_codec_digital_sdtv
+

Advanced Codec Digital SDTV service. +

+
advanced_codec_digital_hdtv
+

Advanced Codec Digital HDTV service. +

+
+ +
+
mpegts_pmt_start_pid integer
+

Set the first PID for PMTs. Default is 0x1000, minimum is 0x0020, +maximum is 0x1ffa. This option has no effect in m2ts mode where the PMT +PID is fixed 0x0100. +

+
+
mpegts_start_pid integer
+

Set the first PID for elementary streams. Default is 0x0100, minimum is +0x0020, maximum is 0x1ffa. This option has no effect in m2ts mode +where the elementary stream PIDs are fixed. +

+
+
mpegts_m2ts_mode boolean
+

Enable m2ts mode if set to 1. Default value is -1 which +disables m2ts mode. +

+
+
muxrate integer
+

Set a constant muxrate. Default is VBR. +

+
+
pes_payload_size integer
+

Set minimum PES packet payload in bytes. Default is 2930. +

+
+
mpegts_flags flags
+

Set mpegts flags. Accepts the following options: +

+
resend_headers
+

Reemit PAT/PMT before writing the next packet. +

+
latm
+

Use LATM packetization for AAC. +

+
pat_pmt_at_frames
+

Reemit PAT and PMT at each video frame. +

+
system_b
+

Conform to System B (DVB) instead of System A (ATSC). +

+
initial_discontinuity
+

Mark the initial packet of each stream as discontinuity. +

+
nit
+

Emit NIT table. +

+
omit_rai
+

Disable writing of random access indicator. +

+
+ +
+
mpegts_copyts boolean
+

Preserve original timestamps, if value is set to 1. Default value +is -1, which results in shifting timestamps so that they start from 0. +

+
+
omit_video_pes_length boolean
+

Omit the PES packet length for video packets. Default is 1 (true). +

+
+
pcr_period integer
+

Override the default PCR retransmission time in milliseconds. Default is +-1 which means that the PCR interval will be determined automatically: +20 ms is used for CBR streams, the highest multiple of the frame duration which +is less than 100 ms is used for VBR streams. +

+
+
pat_period duration
+

Maximum time in seconds between PAT/PMT tables. Default is 0.1. +

+
+
sdt_period duration
+

Maximum time in seconds between SDT tables. Default is 0.5. +

+
+
nit_period duration
+

Maximum time in seconds between NIT tables. Default is 0.5. +

+
+
tables_version integer
+

Set PAT, PMT, SDT and NIT version (default 0, valid values are from 0 to 31, inclusively). +This option allows updating stream structure so that standard consumer may +detect the change. To do so, reopen output AVFormatContext (in case of API +usage) or restart ffmpeg instance, cyclically changing +tables_version value: +

+
+
ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
+ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
+...
+ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
+ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
+ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
+...
+
+
+
+ +
+
+

4.24.2 Example

+ +
+
ffmpeg -i file.mpg -c copy \
+     -mpegts_original_network_id 0x1122 \
+     -mpegts_transport_stream_id 0x3344 \
+     -mpegts_service_id 0x5566 \
+     -mpegts_pmt_start_pid 0x1500 \
+     -mpegts_start_pid 0x150 \
+     -metadata service_provider="Some provider" \
+     -metadata service_name="Some Channel" \
+     out.ts
+
+ +
+
+
+

4.25 mxf, mxf_d10, mxf_opatom

+ +

MXF muxer. +

+ +
+

4.25.1 Options

+ +

The muxer options are: +

+
+
store_user_comments bool
+

Set if user comments should be stored if available or never. +IRT D-10 does not allow user comments. The default is thus to write them for +mxf and mxf_opatom but not for mxf_d10 +

+
+ +
+
+
+

4.26 null

+ +

Null muxer. +

+

This muxer does not generate any output file, it is mainly useful for +testing or benchmarking purposes. +

+

For example to benchmark decoding with ffmpeg you can use the +command: +

+
ffmpeg -benchmark -i INPUT -f null out.null
+
+ +

Note that the above command does not read or write the out.null +file, but specifying the output file is required by the ffmpeg +syntax. +

+

Alternatively you can write the command as: +

+
ffmpeg -benchmark -i INPUT -f null -
+
+ +
+
+

4.27 nut

+ +
+
-syncpoints flags
+

Change the syncpoint usage in nut: +

+
default use the normal low-overhead seeking aids.
+
none do not use the syncpoints at all, reducing the overhead but making the stream non-seekable;
+

Use of this option is not recommended, as the resulting files are very damage + sensitive and seeking is not possible. Also in general the overhead from + syncpoints is negligible. Note, -write_index 0 can be used to disable + all growing data tables, allowing to mux endless streams with limited memory + and without these disadvantages. +

+
timestamped extend the syncpoint with a wallclock field.
+
+

The none and timestamped flags are experimental. +

+
-write_index bool
+

Write index at the end, the default is to write an index. +

+
+ +
+
ffmpeg -i INPUT -f_strict experimental -syncpoints none - | processor
+
+ +
+
+

4.28 ogg

+ +

Ogg container muxer. +

+
+
-page_duration duration
+

Preferred page duration, in microseconds. The muxer will attempt to create +pages that are approximately duration microseconds long. This allows the +user to compromise between seek granularity and container overhead. The default +is 1 second. A value of 0 will fill all segments, making pages as large as +possible. A value of 1 will effectively use 1 packet-per-page in most +situations, giving a small seek granularity at the cost of additional container +overhead. +

+
-serial_offset value
+

Serial value from which to set the streams serial number. +Setting it to different and sufficiently large values ensures that the produced +ogg files can be safely chained. +

+
+
+ +
+
+

4.29 raw muxers

+ +

Raw muxers accept a single stream matching the designated codec. They do not store timestamps or metadata. +The recognized extension is the same as the muxer name unless indicated otherwise. +

+ +
+

4.29.1 ac3

+ +

Dolby Digital, also known as AC-3, audio. +

+
+
+

4.29.2 adx

+ +

CRI Middleware ADX audio. +

+

This muxer will write out the total sample count near the start of the first packet +when the output is seekable and the count can be stored in 32 bits. +

+
+
+

4.29.3 aptx

+ +

aptX (Audio Processing Technology for Bluetooth) audio. +

+
+
+

4.29.4 aptx_hd

+ +

aptX HD (Audio Processing Technology for Bluetooth) audio. +

+

Extensions: aptxhd +

+
+
+

4.29.5 avs2

+ +

AVS2-P2/IEEE1857.4 video. +

+

Extensions: avs, avs2 +

+
+
+

4.29.6 cavsvideo

+ +

Chinese AVS (Audio Video Standard) video. +

+

Extensions: cavs +

+
+
+

4.29.7 codec2raw

+ +

Codec 2 audio. +

+

No extension is registered so format name has to be supplied e.g. with the ffmpeg CLI tool -f codec2raw. +

+
+
+

4.29.8 data

+ +

Data muxer accepts a single stream with any codec of any type. +The input stream has to be selected using the -map option with the ffmpeg CLI tool. +

+

No extension is registered so format name has to be supplied e.g. with the ffmpeg CLI tool -f data. +

+
+
+

4.29.9 dirac

+ +

BBC Dirac video. The Dirac Pro codec is a subset and is standardized as SMPTE VC-2. +

+

Extensions: drc, vc2 +

+
+
+

4.29.10 dnxhd

+ +

Avid DNxHD video. It is standardized as SMPTE VC-3. Accepts DNxHR streams. +

+

Extensions: dnxhd, dnxhr +

+
+
+

4.29.11 dts

+ +

DTS Coherent Acoustics (DCA) audio. +

+
+
+

4.29.12 eac3

+ +

Dolby Digital Plus, also known as Enhanced AC-3, audio. +

+
+
+

4.29.13 g722

+ +

ITU-T G.722 audio. +

+
+
+

4.29.14 g723_1

+ +

ITU-T G.723.1 audio. +

+

Extensions: tco, rco +

+
+
+

4.29.15 g726

+ +

ITU-T G.726 big-endian ("left-justified") audio. +

+

No extension is registered so format name has to be supplied e.g. with the ffmpeg CLI tool -f g726. +

+
+
+

4.29.16 g726le

+ +

ITU-T G.726 little-endian ("right-justified") audio. +

+

No extension is registered so format name has to be supplied e.g. with the ffmpeg CLI tool -f g726le. +

+
+
+

4.29.17 gsm

+ +

Global System for Mobile Communications audio. +

+
+
+

4.29.18 h261

+ +

ITU-T H.261 video. +

+
+
+

4.29.19 h263

+ +

ITU-T H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2 video. +

+
+
+

4.29.20 h264

+ +

ITU-T H.264 / MPEG-4 Part 10 AVC video. Bitstream shall be converted to Annex B syntax if it’s in length-prefixed mode. +

+

Extensions: h264, 264 +

+
+
+

4.29.21 hevc

+ +

ITU-T H.265 / MPEG-H Part 2 HEVC video. Bitstream shall be converted to Annex B syntax if it’s in length-prefixed mode. +

+

Extensions: hevc, h265, 265 +

+
+
+

4.29.22 m4v

+ +

MPEG-4 Part 2 video. +

+
+
+

4.29.23 mjpeg

+ +

Motion JPEG video. +

+

Extensions: mjpg, mjpeg +

+
+
+

4.29.24 mlp

+ +

Meridian Lossless Packing, also known as Packed PCM, audio. +

+
+
+

4.29.25 mp2

+ +

MPEG-1 Audio Layer II audio. +

+

Extensions: mp2, m2a, mpa +

+
+
+

4.29.26 mpeg1video

+ +

MPEG-1 Part 2 video. +

+

Extensions: mpg, mpeg, m1v +

+
+
+

4.29.27 mpeg2video

+ +

ITU-T H.262 / MPEG-2 Part 2 video. +

+

Extensions: m2v +

+
+
+

4.29.28 obu

+ +

AV1 low overhead Open Bitstream Units muxer. Temporal delimiter OBUs will be inserted in all temporal units of the stream. +

+
+
+

4.29.29 rawvideo

+ +

Raw uncompressed video. +

+

Extensions: yuv, rgb +

+
+
+

4.29.30 sbc

+ +

Bluetooth SIG low-complexity subband codec audio. +

+

Extensions: sbc, msbc +

+
+
+

4.29.31 truehd

+ +

Dolby TrueHD audio. +

+

Extensions: thd +

+
+
+

4.29.32 vc1

+ +

SMPTE 421M / VC-1 video. +

+
+
+
+

4.30 segment, stream_segment, ssegment

+ +

Basic stream segmenter. +

+

This muxer outputs streams to a number of separate files of nearly +fixed duration. Output filename pattern can be set in a fashion +similar to image2, or by using a strftime template if +the strftime option is enabled. +

+

stream_segment is a variant of the muxer used to write to +streaming output formats, i.e. which do not require global headers, +and is recommended for outputting e.g. to MPEG transport stream segments. +ssegment is a shorter alias for stream_segment. +

+

Every segment starts with a keyframe of the selected reference stream, +which is set through the reference_stream option. +

+

Note that if you want accurate splitting for a video file, you need to +make the input key frames correspond to the exact splitting times +expected by the segmenter, or the segment muxer will start the new +segment with the key frame found next after the specified start +time. +

+

The segment muxer works best with a single constant frame rate video. +

+

Optionally it can generate a list of the created segments, by setting +the option segment_list. The list type is specified by the +segment_list_type option. The entry filenames in the segment +list are set by default to the basename of the corresponding segment +files. +

+

See also the hls muxer, which provides a more specific +implementation for HLS segmentation. +

+ +
+

4.30.1 Options

+ +

The segment muxer supports the following options: +

+
+
increment_tc 1|0
+

if set to 1, increment timecode between each segment +If this is selected, the input need to have +a timecode in the first video stream. Default value is +0. +

+
+
reference_stream specifier
+

Set the reference stream, as specified by the string specifier. +If specifier is set to auto, the reference is chosen +automatically. Otherwise it must be a stream specifier (see the “Stream +specifiers” chapter in the ffmpeg manual) which specifies the +reference stream. The default value is auto. +

+
+
segment_format format
+

Override the inner container format, by default it is guessed by the filename +extension. +

+
+
segment_format_options options_list
+

Set output format options using a :-separated list of key=value +parameters. Values containing the : special character must be +escaped. +

+
+
segment_list name
+

Generate also a listfile named name. If not specified no +listfile is generated. +

+
+
segment_list_flags flags
+

Set flags affecting the segment list generation. +

+

It currently supports the following flags: +

+
cache
+

Allow caching (only affects M3U8 list files). +

+
+
live
+

Allow live-friendly file generation. +

+
+ +
+
segment_list_size size
+

Update the list file so that it contains at most size +segments. If 0 the list file will contain all the segments. Default +value is 0. +

+
+
segment_list_entry_prefix prefix
+

Prepend prefix to each entry. Useful to generate absolute paths. +By default no prefix is applied. +

+
+
segment_list_type type
+

Select the listing format. +

+

The following values are recognized: +

+
flat
+

Generate a flat list for the created segments, one segment per line. +

+
+
csv, ext
+

Generate a list for the created segments, one segment per line, +each line matching the format (comma-separated values): +

+
segment_filename,segment_start_time,segment_end_time
+
+ +

segment_filename is the name of the output file generated by the +muxer according to the provided pattern. CSV escaping (according to +RFC4180) is applied if required. +

+

segment_start_time and segment_end_time specify +the segment start and end time expressed in seconds. +

+

A list file with the suffix ".csv" or ".ext" will +auto-select this format. +

+

ext’ is deprecated in favor or ‘csv’. +

+
+
ffconcat
+

Generate an ffconcat file for the created segments. The resulting file +can be read using the FFmpeg concat demuxer. +

+

A list file with the suffix ".ffcat" or ".ffconcat" will +auto-select this format. +

+
+
m3u8
+

Generate an extended M3U8 file, version 3, compliant with +http://tools.ietf.org/id/draft-pantos-http-live-streaming. +

+

A list file with the suffix ".m3u8" will auto-select this format. +

+
+ +

If not specified the type is guessed from the list file name suffix. +

+
+
segment_time time
+

Set segment duration to time, the value must be a duration +specification. Default value is "2". See also the +segment_times option. +

+

Note that splitting may not be accurate, unless you force the +reference stream key-frames at the given time. See the introductory +notice and the examples below. +

+
+
min_seg_duration time
+

Set minimum segment duration to time, the value must be a duration +specification. This prevents the muxer ending segments at a duration below +this value. Only effective with segment_time. Default value is "0". +

+
+
segment_atclocktime 1|0
+

If set to "1" split at regular clock time intervals starting from 00:00 +o’clock. The time value specified in segment_time is +used for setting the length of the splitting interval. +

+

For example with segment_time set to "900" this makes it possible +to create files at 12:00 o’clock, 12:15, 12:30, etc. +

+

Default value is "0". +

+
+
segment_clocktime_offset duration
+

Delay the segment splitting times with the specified duration when using +segment_atclocktime. +

+

For example with segment_time set to "900" and +segment_clocktime_offset set to "300" this makes it possible to +create files at 12:05, 12:20, 12:35, etc. +

+

Default value is "0". +

+
+
segment_clocktime_wrap_duration duration
+

Force the segmenter to only start a new segment if a packet reaches the muxer +within the specified duration after the segmenting clock time. This way you +can make the segmenter more resilient to backward local time jumps, such as +leap seconds or transition to standard time from daylight savings time. +

+

Default is the maximum possible duration which means starting a new segment +regardless of the elapsed time since the last clock time. +

+
+
segment_time_delta delta
+

Specify the accuracy time when selecting the start time for a +segment, expressed as a duration specification. Default value is "0". +

+

When delta is specified a key-frame will start a new segment if its +PTS satisfies the relation: +

+
PTS >= start_time - time_delta
+
+ +

This option is useful when splitting video content, which is always +split at GOP boundaries, in case a key frame is found just before the +specified split time. +

+

In particular may be used in combination with the ffmpeg option +force_key_frames. The key frame times specified by +force_key_frames may not be set accurately because of rounding +issues, with the consequence that a key frame time may result set just +before the specified time. For constant frame rate videos a value of +1/(2*frame_rate) should address the worst case mismatch between +the specified time and the time set by force_key_frames. +

+
+
segment_times times
+

Specify a list of split points. times contains a list of comma +separated duration specifications, in increasing order. See also +the segment_time option. +

+
+
segment_frames frames
+

Specify a list of split video frame numbers. frames contains a +list of comma separated integer numbers, in increasing order. +

+

This option specifies to start a new segment whenever a reference +stream key frame is found and the sequential number (starting from 0) +of the frame is greater or equal to the next value in the list. +

+
+
segment_wrap limit
+

Wrap around segment index once it reaches limit. +

+
+
segment_start_number number
+

Set the sequence number of the first segment. Defaults to 0. +

+
+
strftime 1|0
+

Use the strftime function to define the name of the new +segments to write. If this is selected, the output segment name must +contain a strftime function template. Default value is +0. +

+
+
break_non_keyframes 1|0
+

If enabled, allow segments to start on frames other than keyframes. This +improves behavior on some players when the time between keyframes is +inconsistent, but may make things worse on others, and can cause some oddities +during seeking. Defaults to 0. +

+
+
reset_timestamps 1|0
+

Reset timestamps at the beginning of each segment, so that each segment +will start with near-zero timestamps. It is meant to ease the playback +of the generated segments. May not work with some combinations of +muxers/codecs. It is set to 0 by default. +

+
+
initial_offset offset
+

Specify timestamp offset to apply to the output packet timestamps. The +argument must be a time duration specification, and defaults to 0. +

+
+
write_empty_segments 1|0
+

If enabled, write an empty segment if there are no packets during the period a +segment would usually span. Otherwise, the segment will be filled with the next +packet written. Defaults to 0. +

+
+ +

Make sure to require a closed GOP when encoding and to set the GOP +size to fit your segment time constraint. +

+
+
+

4.30.2 Examples

+ +
    +
  • Remux the content of file in.mkv to a list of segments +out-000.nut, out-001.nut, etc., and write the list of +generated segments to out.list: +
    +
    ffmpeg -i in.mkv -codec hevc -flags +cgop -g 60 -map 0 -f segment -segment_list out.list out%03d.nut
    +
    + +
  • Segment input and set output format options for the output segments: +
    +
    ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags=+faststart out%03d.mp4
    +
    + +
  • Segment the input file according to the split points specified by the +segment_times option: +
    +
    ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 out%03d.nut
    +
    + +
  • Use the ffmpeg force_key_frames +option to force key frames in the input at the specified location, together +with the segment option segment_time_delta to account for +possible roundings operated when setting key frame times. +
    +
    ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \
    +-f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
    +
    +

    In order to force key frames on the input file, transcoding is +required. +

    +
  • Segment the input file by splitting the input file according to the +frame numbers sequence specified with the segment_frames option: +
    +
    ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut
    +
    + +
  • Convert the in.mkv to TS segments using the libx264 +and aac encoders: +
    +
    ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a aac -f ssegment -segment_list out.list out%03d.ts
    +
    + +
  • Segment the input file, and create an M3U8 live playlist (can be used +as live HLS source): +
    +
    ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
    +-segment_list_flags +live -segment_time 10 out%03d.mkv
    +
    +
+ +
+
+
+

4.31 smoothstreaming

+ +

Smooth Streaming muxer generates a set of files (Manifest, chunks) suitable for serving with conventional web server. +

+
+
window_size
+

Specify the number of fragments kept in the manifest. Default 0 (keep all). +

+
+
extra_window_size
+

Specify the number of fragments kept outside of the manifest before removing from disk. Default 5. +

+
+
lookahead_count
+

Specify the number of lookahead fragments. Default 2. +

+
+
min_frag_duration
+

Specify the minimum fragment duration (in microseconds). Default 5000000. +

+
+
remove_at_exit
+

Specify whether to remove all fragments when finished. Default 0 (do not remove). +

+
+
+ +
+
+

4.32 streamhash

+ +

Per stream hash testing format. +

+

This muxer computes and prints a cryptographic hash of all the input frames, +on a per-stream basis. This can be used for equality checks without having +to do a complete binary comparison. +

+

By default audio frames are converted to signed 16-bit raw audio and +video frames to raw video before computing the hash, but the output +of explicit conversions to other codecs can also be used. Timestamps +are ignored. It uses the SHA-256 cryptographic hash function by default, +but supports several other algorithms. +

+

The output of the muxer consists of one line per stream of the form: +streamindex,streamtype,algo=hash, where +streamindex is the index of the mapped stream, streamtype is a +single character indicating the type of stream, algo is a short string +representing the hash function used, and hash is a hexadecimal number +representing the computed hash. +

+
+
hash algorithm
+

Use the cryptographic hash function specified by the string algorithm. +Supported values include MD5, murmur3, RIPEMD128, +RIPEMD160, RIPEMD256, RIPEMD320, SHA160, +SHA224, SHA256 (default), SHA512/224, SHA512/256, +SHA384, SHA512, CRC32 and adler32. +

+
+
+ + +
+

4.32.1 Examples

+ +

To compute the SHA-256 hash of the input converted to raw audio and +video, and store it in the file out.sha256: +

+
ffmpeg -i INPUT -f streamhash out.sha256
+
+ +

To print an MD5 hash to stdout use the command: +

+
ffmpeg -i INPUT -f streamhash -hash md5 -
+
+ +

See also the hash and framehash muxers. +

+
+
+
+

4.33 tee

+ +

The tee muxer can be used to write the same data to several outputs, such as files or streams. +It can be used, for example, to stream a video over a network and save it to disk at the same time. +

+

It is different from specifying several outputs to the ffmpeg +command-line tool. With the tee muxer, the audio and video data will be encoded only once. +With conventional multiple outputs, multiple encoding operations in parallel are initiated, +which can be a very expensive process. The tee muxer is not useful when using the libavformat API +directly because it is then possible to feed the same packets to several muxers directly. +

+

Since the tee muxer does not represent any particular output format, ffmpeg cannot auto-select +output streams. So all streams intended for output must be specified using -map. See +the examples below. +

+

Some encoders may need different options depending on the output format; +the auto-detection of this can not work with the tee muxer, so they need to be explicitly specified. +The main example is the global_header flag. +

+

The slave outputs are specified in the file name given to the muxer, +separated by ’|’. If any of the slave name contains the ’|’ separator, +leading or trailing spaces or any special character, those must be +escaped (see (ffmpeg-utils)the "Quoting and escaping" +section in the ffmpeg-utils(1) manual). +

+ +
+

4.33.1 Options

+ +
+
use_fifo bool
+

If set to 1, slave outputs will be processed in separate threads using the fifo +muxer. This allows to compensate for different speed/latency/reliability of +outputs and setup transparent recovery. By default this feature is turned off. +

+
+
fifo_options
+

Options to pass to fifo pseudo-muxer instances. See fifo. +

+
+
+ +

Muxer options can be specified for each slave by prepending them as a list of +key=value pairs separated by ’:’, between square brackets. If +the options values contain a special character or the ’:’ separator, they +must be escaped; note that this is a second level escaping. +

+

The following special options are also recognized: +

+
f
+

Specify the format name. Required if it cannot be guessed from the +output URL. +

+
+
bsfs[/spec]
+

Specify a list of bitstream filters to apply to the specified +output. +

+

It is possible to specify to which streams a given bitstream filter +applies, by appending a stream specifier to the option separated by +/. spec must be a stream specifier (see Format stream specifiers). +

+

If the stream specifier is not specified, the bitstream filters will be +applied to all streams in the output. This will cause that output operation +to fail if the output contains streams to which the bitstream filter cannot +be applied e.g. h264_mp4toannexb being applied to an output containing an audio stream. +

+

Options for a bitstream filter must be specified in the form of opt=value. +

+

Several bitstream filters can be specified, separated by ",". +

+
+
use_fifo bool
+

This allows to override tee muxer use_fifo option for individual slave muxer. +

+
+
fifo_options
+

This allows to override tee muxer fifo_options for individual slave muxer. +See fifo. +

+
+
select
+

Select the streams that should be mapped to the slave output, +specified by a stream specifier. If not specified, this defaults to +all the mapped streams. This will cause that output operation to fail +if the output format does not accept all mapped streams. +

+

You may use multiple stream specifiers separated by commas (,) e.g.: a:0,v +

+
+
onfail
+

Specify behaviour on output failure. This can be set to either abort (which is +default) or ignore. abort will cause whole process to fail in case of failure +on this slave output. ignore will ignore failure on this output, so other outputs +will continue without being affected. +

+
+ +
+
+

4.33.2 Examples

+ +
    +
  • Encode something and both archive it in a WebM file and stream it +as MPEG-TS over UDP: +
    +
    ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
    +  "archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
    +
    + +
  • As above, but continue streaming even if output to local file fails +(for example local drive fills up): +
    +
    ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
    +  "[onfail=ignore]archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
    +
    + +
  • Use ffmpeg to encode the input, and send the output +to three different destinations. The dump_extra bitstream +filter is used to add extradata information to all the output video +keyframes packets, as requested by the MPEG-TS format. The select +option is applied to out.aac in order to make it contain only +audio packets. +
    +
    ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
    +       -f tee "[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac"
    +
    + +
  • As above, but select only stream a:1 for the audio output. Note +that a second level escaping must be performed, as ":" is a special +character used to separate options. +
    +
    ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
    +       -f tee "[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=\'a:1\']out.aac"
    +
    +
+ +
+
+
+

4.34 webm_chunk

+ +

WebM Live Chunk Muxer. +

+

This muxer writes out WebM headers and chunks as separate files which can be +consumed by clients that support WebM Live streams via DASH. +

+ +
+

4.34.1 Options

+ +

This muxer supports the following options: +

+
+
chunk_start_index
+

Index of the first chunk (defaults to 0). +

+
+
header
+

Filename of the header where the initialization data will be written. +

+
+
audio_chunk_duration
+

Duration of each audio chunk in milliseconds (defaults to 5000). +

+
+ +
+
+

4.34.2 Example

+
+
ffmpeg -f v4l2 -i /dev/video0 \
+       -f alsa -i hw:0 \
+       -map 0:0 \
+       -c:v libvpx-vp9 \
+       -s 640x360 -keyint_min 30 -g 30 \
+       -f webm_chunk \
+       -header webm_live_video_360.hdr \
+       -chunk_start_index 1 \
+       webm_live_video_360_%d.chk \
+       -map 1:0 \
+       -c:a libvorbis \
+       -b:a 128k \
+       -f webm_chunk \
+       -header webm_live_audio_128.hdr \
+       -chunk_start_index 1 \
+       -audio_chunk_duration 1000 \
+       webm_live_audio_128_%d.chk
+
+ +
+
+
+

4.35 webm_dash_manifest

+ +

WebM DASH Manifest muxer. +

+

This muxer implements the WebM DASH Manifest specification to generate the DASH +manifest XML. It also supports manifest generation for DASH live streams. +

+

For more information see: +

+ + + +
+

4.35.1 Options

+ +

This muxer supports the following options: +

+
+
adaptation_sets
+

This option has the following syntax: "id=x,streams=a,b,c id=y,streams=d,e" where x and y are the +unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding +audio and video streams. Any number of adaptation sets can be added using this option. +

+
+
live
+

Set this to 1 to create a live stream DASH Manifest. Default: 0. +

+
+
chunk_start_index
+

Start index of the first chunk. This will go in the ‘startNumber’ attribute +of the ‘SegmentTemplate’ element in the manifest. Default: 0. +

+
+
chunk_duration_ms
+

Duration of each chunk in milliseconds. This will go in the ‘duration’ +attribute of the ‘SegmentTemplate’ element in the manifest. Default: 1000. +

+
+
utc_timing_url
+

URL of the page that will return the UTC timestamp in ISO format. This will go +in the ‘value’ attribute of the ‘UTCTiming’ element in the manifest. +Default: None. +

+
+
time_shift_buffer_depth
+

Smallest time (in seconds) shifting buffer for which any Representation is +guaranteed to be available. This will go in the ‘timeShiftBufferDepth’ +attribute of the ‘MPD’ element. Default: 60. +

+
+
minimum_update_period
+

Minimum update period (in seconds) of the manifest. This will go in the +‘minimumUpdatePeriod’ attribute of the ‘MPD’ element. Default: 0. +

+
+
+ +
+
+

4.35.2 Example

+
+
ffmpeg -f webm_dash_manifest -i video1.webm \
+       -f webm_dash_manifest -i video2.webm \
+       -f webm_dash_manifest -i audio1.webm \
+       -f webm_dash_manifest -i audio2.webm \
+       -map 0 -map 1 -map 2 -map 3 \
+       -c copy \
+       -f webm_dash_manifest \
+       -adaptation_sets "id=0,streams=0,1 id=1,streams=2,3" \
+       manifest.xml
+
+ +
+
+
+
+

5 Metadata

+ +

FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded +INI-like text file and then load it back using the metadata muxer/demuxer. +

+

The file format is as follows: +

    +
  1. A file consists of a header and a number of metadata tags divided into sections, +each on its own line. + +
  2. The header is a ‘;FFMETADATA’ string, followed by a version number (now 1). + +
  3. Metadata tags are of the form ‘key=value’ + +
  4. Immediately after header follows global metadata + +
  5. After global metadata there may be sections with per-stream/per-chapter +metadata. + +
  6. A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in +brackets (‘[’, ‘]’) and ends with next section or end of file. + +
  7. At the beginning of a chapter section there may be an optional timebase to be +used for start/end values. It must be in form +‘TIMEBASE=num/den’, where num and den are +integers. If the timebase is missing then start/end times are assumed to +be in nanoseconds. + +

    Next a chapter section must contain chapter start and end times in form +‘START=num’, ‘END=num’, where num is a positive +integer. +

    +
  8. Empty lines and lines starting with ‘;’ or ‘#’ are ignored. + +
  9. Metadata keys or values containing special characters (‘=’, ‘;’, +‘#’, ‘\’ and a newline) must be escaped with a backslash ‘\’. + +
  10. Note that whitespace in metadata (e.g. ‘foo = bar’) is considered to be +a part of the tag (in the example above key is ‘foo ’, value is +‘ bar’). +
+ +

A ffmetadata file might look like this: +

+
;FFMETADATA1
+title=bike\\shed
+;this is a comment
+artist=FFmpeg troll team
+
+[CHAPTER]
+TIMEBASE=1/1000
+START=0
+#chapter ends at 0:01:00
+END=60000
+title=chapter \#1
+[STREAM]
+title=multi\
+line
+
+ +

By using the ffmetadata muxer and demuxer it is possible to extract +metadata from an input file to an ffmetadata file, and then transcode +the file into an output file with the edited ffmetadata file. +

+

Extracting an ffmetadata file with ffmpeg goes as follows: +

+
ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
+
+ +

Reinserting edited metadata information from the FFMETADATAFILE file can +be done as: +

+
ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
+
+ + +
+
+

6 See Also

+ +

ffmpeg, ffplay, ffprobe, +libavformat +

+ +
+
+

7 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-protocols.html b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-protocols.html new file mode 100644 index 0000000000000000000000000000000000000000..b89231882b342dbd395ceee5d1439ff40de89e86 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-protocols.html @@ -0,0 +1,2687 @@ + + + + + +FFmpeg Protocols Documentation + + + + + + + + + + + + + + + + + +
+ + + +
+

1 Description

+ +

This document describes the input and output protocols provided by the +libavformat library. +

+ +
+
+

2 Protocol Options

+ +

The libavformat library provides some generic global options, which +can be set on all the protocols. In addition each protocol may support +so-called private options, which are specific for that component. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the +AVFormatContext options or using the libavutil/opt.h API +for programmatic use. +

+

The list of supported options follows: +

+
+
protocol_whitelist list (input)
+

Set a ","-separated list of allowed protocols. "ALL" matches all protocols. Protocols +prefixed by "-" are disabled. +All protocols are allowed by default but protocols used by an another +protocol (nested protocols) are restricted to a per protocol subset. +

+
+ + +
+
+

3 Protocols

+ +

Protocols are configured elements in FFmpeg that enable access to +resources that require specific protocols. +

+

When you configure your FFmpeg build, all the supported protocols are +enabled by default. You can list all available ones using the +configure option "–list-protocols". +

+

You can disable all the protocols using the configure option +"–disable-protocols", and selectively enable a protocol using the +option "–enable-protocol=PROTOCOL", or you can disable a +particular protocol using the option +"–disable-protocol=PROTOCOL". +

+

The option "-protocols" of the ff* tools will display the list of +supported protocols. +

+

All protocols accept the following options: +

+
+
rw_timeout
+

Maximum time to wait for (network) read/write operations to complete, +in microseconds. +

+
+ +

A description of the currently available protocols follows. +

+ +
+

3.1 amqp

+ +

Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker based +publish-subscribe communication protocol. +

+

FFmpeg must be compiled with –enable-librabbitmq to support AMQP. A separate +AMQP broker must also be run. An example open-source AMQP broker is RabbitMQ. +

+

After starting the broker, an FFmpeg client may stream data to the broker using +the command: +

+
+
ffmpeg -re -i input -f mpegts amqp://[[user]:[password]@]hostname[:port][/vhost]
+
+ +

Where hostname and port (default is 5672) is the address of the broker. The +client may also set a user/password for authentication. The default for both +fields is "guest". Name of virtual host on broker can be set with vhost. The +default value is "/". +

+

Muliple subscribers may stream from the broker using the command: +

+
ffplay amqp://[[user]:[password]@]hostname[:port][/vhost]
+
+ +

In RabbitMQ all data published to the broker flows through a specific exchange, +and each subscribing client has an assigned queue/buffer. When a packet arrives +at an exchange, it may be copied to a client’s queue depending on the exchange +and routing_key fields. +

+

The following options are supported: +

+
+
exchange
+

Sets the exchange to use on the broker. RabbitMQ has several predefined +exchanges: "amq.direct" is the default exchange, where the publisher and +subscriber must have a matching routing_key; "amq.fanout" is the same as a +broadcast operation (i.e. the data is forwarded to all queues on the fanout +exchange independent of the routing_key); and "amq.topic" is similar to +"amq.direct", but allows for more complex pattern matching (refer to the RabbitMQ +documentation). +

+
+
routing_key
+

Sets the routing key. The default value is "amqp". The routing key is used on +the "amq.direct" and "amq.topic" exchanges to decide whether packets are written +to the queue of a subscriber. +

+
+
pkt_size
+

Maximum size of each packet sent/received to the broker. Default is 131072. +Minimum is 4096 and max is any large value (representable by an int). When +receiving packets, this sets an internal buffer size in FFmpeg. It should be +equal to or greater than the size of the published packets to the broker. Otherwise +the received message may be truncated causing decoding errors. +

+
+
connection_timeout
+

The timeout in seconds during the initial connection to the broker. The +default value is rw_timeout, or 5 seconds if rw_timeout is not set. +

+
+
delivery_mode mode
+

Sets the delivery mode of each message sent to broker. +The following values are accepted: +

+
persistent
+

Delivery mode set to "persistent" (2). This is the default value. +Messages may be written to the broker’s disk depending on its setup. +

+
+
non-persistent
+

Delivery mode set to "non-persistent" (1). +Messages will stay in broker’s memory unless the broker is under memory +pressure. +

+
+
+ +
+
+ +
+
+

3.2 async

+ +

Asynchronous data filling wrapper for input stream. +

+

Fill data in a background thread, to decouple I/O operation from demux thread. +

+
+
async:URL
+async:http://host/resource
+async:cache:http://host/resource
+
+ +
+
+

3.3 bluray

+ +

Read BluRay playlist. +

+

The accepted options are: +

+
angle
+

BluRay angle +

+
+
chapter
+

Start chapter (1...N) +

+
+
playlist
+

Playlist to read (BDMV/PLAYLIST/?????.mpls) +

+
+
+ +

Examples: +

+

Read longest playlist from BluRay mounted to /mnt/bluray: +

+
bluray:/mnt/bluray
+
+ +

Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2: +

+
-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
+
+ +
+
+

3.4 cache

+ +

Caching wrapper for input stream. +

+

Cache the input stream to temporary file. It brings seeking capability to live streams. +

+

The accepted options are: +

+
read_ahead_limit
+

Amount in bytes that may be read ahead when seeking isn’t supported. Range is -1 to INT_MAX. +-1 for unlimited. Default is 65536. +

+
+
+ +

URL Syntax is +

+
cache:URL
+
+ +
+
+

3.5 concat

+ +

Physical concatenation protocol. +

+

Read and seek from many resources in sequence as if they were +a unique resource. +

+

A URL accepted by this protocol has the syntax: +

+
concat:URL1|URL2|...|URLN
+
+ +

where URL1, URL2, ..., URLN are the urls of the +resource to be concatenated, each one possibly specifying a distinct +protocol. +

+

For example to read a sequence of files split1.mpeg, +split2.mpeg, split3.mpeg with ffplay use the +command: +

+
ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
+
+ +

Note that you may need to escape the character "|" which is special for +many shells. +

+
+
+

3.6 concatf

+ +

Physical concatenation protocol using a line break delimited list of +resources. +

+

Read and seek from many resources in sequence as if they were +a unique resource. +

+

A URL accepted by this protocol has the syntax: +

+
concatf:URL
+
+ +

where URL is the url containing a line break delimited list of +resources to be concatenated, each one possibly specifying a distinct +protocol. Special characters must be escaped with backslash or single +quotes. See (ffmpeg-utils)the "Quoting and escaping" +section in the ffmpeg-utils(1) manual. +

+

For example to read a sequence of files split1.mpeg, +split2.mpeg, split3.mpeg listed in separate lines within +a file split.txt with ffplay use the command: +

+
ffplay concatf:split.txt
+
+

Where split.txt contains the lines: +

+
split1.mpeg
+split2.mpeg
+split3.mpeg
+
+ +
+
+

3.7 crypto

+ +

AES-encrypted stream reading protocol. +

+

The accepted options are: +

+
key
+

Set the AES decryption key binary block from given hexadecimal representation. +

+
+
iv
+

Set the AES decryption initialization vector binary block from given hexadecimal representation. +

+
+ +

Accepted URL formats: +

+
crypto:URL
+crypto+URL
+
+ +
+
+

3.8 data

+ +

Data in-line in the URI. See http://en.wikipedia.org/wiki/Data_URI_scheme. +

+

For example, to convert a GIF file given inline with ffmpeg: +

+
ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
+
+ +
+
+

3.9 fd

+ +

File descriptor access protocol. +

+

The accepted syntax is: +

+
fd: -fd file_descriptor
+
+ +

If fd is not specified, by default the stdout file descriptor will be +used for writing, stdin for reading. Unlike the pipe protocol, fd protocol has +seek support if it corresponding to a regular file. fd protocol doesn’t support +pass file descriptor via URL for security. +

+

This protocol accepts the following options: +

+
+
blocksize
+

Set I/O operation maximum block size, in bytes. Default value is +INT_MAX, which results in not limiting the requested block size. +Setting this value reasonably low improves user termination request reaction +time, which is valuable if data transmission is slow. +

+
+
fd
+

Set file descriptor. +

+
+ +
+
+

3.10 file

+ +

File access protocol. +

+

Read from or write to a file. +

+

A file URL can have the form: +

+
file:filename
+
+ +

where filename is the path of the file to read. +

+

An URL that does not have a protocol prefix will be assumed to be a +file URL. Depending on the build, an URL that looks like a Windows +path with the drive letter at the beginning will also be assumed to be +a file URL (usually not the case in builds for unix-like systems). +

+

For example to read from a file input.mpeg with ffmpeg +use the command: +

+
ffmpeg -i file:input.mpeg output.mpeg
+
+ +

This protocol accepts the following options: +

+
+
truncate
+

Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. +

+
+
blocksize
+

Set I/O operation maximum block size, in bytes. Default value is +INT_MAX, which results in not limiting the requested block size. +Setting this value reasonably low improves user termination request reaction +time, which is valuable for files on slow medium. +

+
+
follow
+

If set to 1, the protocol will retry reading at the end of the file, allowing +reading files that still are being written. In order for this to terminate, +you either need to use the rw_timeout option, or use the interrupt callback +(for API users). +

+
+
seekable
+

Controls if seekability is advertised on the file. 0 means non-seekable, -1 +means auto (seekable for normal files, non-seekable for named pipes). +

+

Many demuxers handle seekable and non-seekable resources differently, +overriding this might speed up opening certain files at the cost of losing some +features (e.g. accurate seeking). +

+
+ +
+
+

3.11 ftp

+ +

FTP (File Transfer Protocol). +

+

Read from or write to remote resources using FTP protocol. +

+

Following syntax is required. +

+
ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
+
+ +

This protocol accepts the following options. +

+
+
timeout
+

Set timeout in microseconds of socket I/O operations used by the underlying low level +operation. By default it is set to -1, which means that the timeout is +not specified. +

+
+
ftp-user
+

Set a user to be used for authenticating to the FTP server. This is overridden by the +user in the FTP URL. +

+
+
ftp-password
+

Set a password to be used for authenticating to the FTP server. This is overridden by +the password in the FTP URL, or by ftp-anonymous-password if no user is set. +

+
+
ftp-anonymous-password
+

Password used when login as anonymous user. Typically an e-mail address +should be used. +

+
+
ftp-write-seekable
+

Control seekability of connection during encoding. If set to 1 the +resource is supposed to be seekable, if set to 0 it is assumed not +to be seekable. Default value is 0. +

+
+ +

NOTE: Protocol can be used as output, but it is recommended to not do +it, unless special care is taken (tests, customized server configuration +etc.). Different FTP servers behave in different way during seek +operation. ff* tools may produce incomplete content due to server limitations. +

+
+
+

3.12 gopher

+ +

Gopher protocol. +

+
+
+

3.13 gophers

+ +

Gophers protocol. +

+

The Gopher protocol with TLS encapsulation. +

+
+
+

3.14 hls

+ +

Read Apple HTTP Live Streaming compliant segmented stream as +a uniform one. The M3U8 playlists describing the segments can be +remote HTTP resources or local files, accessed using the standard +file protocol. +The nested protocol is declared by specifying +"+proto" after the hls URI scheme name, where proto +is either "file" or "http". +

+
+
hls+http://host/path/to/remote/resource.m3u8
+hls+file://path/to/local/resource.m3u8
+
+ +

Using this protocol is discouraged - the hls demuxer should work +just as well (if not, please report the issues) and is more complete. +To use the hls demuxer instead, simply use the direct URLs to the +m3u8 files. +

+
+
+

3.15 http

+ +

HTTP (Hyper Text Transfer Protocol). +

+

This protocol accepts the following options: +

+
+
seekable
+

Control seekability of connection. If set to 1 the resource is +supposed to be seekable, if set to 0 it is assumed not to be seekable, +if set to -1 it will try to autodetect if it is seekable. Default +value is -1. +

+
+
chunked_post
+

If set to 1 use chunked Transfer-Encoding for posts, default is 1. +

+
+
content_type
+

Set a specific content type for the POST messages or for listen mode. +

+
+
http_proxy
+

set HTTP proxy to tunnel through e.g. http://example.com:1234 +

+
+
headers
+

Set custom HTTP headers, can override built in default headers. The +value must be a string encoding the headers. +

+
+
multiple_requests
+

Use persistent connections if set to 1, default is 0. +

+
+
post_data
+

Set custom HTTP post data. +

+
+
referer
+

Set the Referer header. Include ’Referer: URL’ header in HTTP request. +

+
+
user_agent
+

Override the User-Agent header. If not specified the protocol will use a +string describing the libavformat build. ("Lavf/<version>") +

+
+
reconnect_at_eof
+

If set then eof is treated like an error and causes reconnection, this is useful +for live / endless streams. +

+
+
reconnect_streamed
+

If set then even streamed/non seekable streams will be reconnected on errors. +

+
+
reconnect_on_network_error
+

Reconnect automatically in case of TCP/TLS errors during connect. +

+
+
reconnect_on_http_error
+

A comma separated list of HTTP status codes to reconnect on. The list can +include specific status codes (e.g. ’503’) or the strings ’4xx’ / ’5xx’. +

+
+
reconnect_delay_max
+

Sets the maximum delay in seconds after which to give up reconnecting +

+
+
mime_type
+

Export the MIME type. +

+
+
http_version
+

Exports the HTTP response version number. Usually "1.0" or "1.1". +

+
+
icy
+

If set to 1 request ICY (SHOUTcast) metadata from the server. If the server +supports this, the metadata has to be retrieved by the application by reading +the icy_metadata_headers and icy_metadata_packet options. +The default is 1. +

+
+
icy_metadata_headers
+

If the server supports ICY metadata, this contains the ICY-specific HTTP reply +headers, separated by newline characters. +

+
+
icy_metadata_packet
+

If the server supports ICY metadata, and icy was set to 1, this +contains the last non-empty metadata packet sent by the server. It should be +polled in regular intervals by applications interested in mid-stream metadata +updates. +

+
+
cookies
+

Set the cookies to be sent in future requests. The format of each cookie is the +same as the value of a Set-Cookie HTTP response field. Multiple cookies can be +delimited by a newline character. +

+
+
offset
+

Set initial byte offset. +

+
+
end_offset
+

Try to limit the request to bytes preceding this offset. +

+
+
method
+

When used as a client option it sets the HTTP method for the request. +

+

When used as a server option it sets the HTTP method that is going to be +expected from the client(s). +If the expected and the received HTTP method do not match the client will +be given a Bad Request response. +When unset the HTTP method is not checked for now. This will be replaced by +autodetection in the future. +

+
+
listen
+

If set to 1 enables experimental HTTP server. This can be used to send data when +used as an output option, or read data from a client with HTTP POST when used as +an input option. +If set to 2 enables experimental multi-client HTTP server. This is not yet implemented +in ffmpeg.c and thus must not be used as a command line option. +

+
# Server side (sending):
+ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://server:port
+
+# Client side (receiving):
+ffmpeg -i http://server:port -c copy somefile.ogg
+
+# Client can also be done with wget:
+wget http://server:port -O somefile.ogg
+
+# Server side (receiving):
+ffmpeg -listen 1 -i http://server:port -c copy somefile.ogg
+
+# Client side (sending):
+ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://server:port
+
+# Client can also be done with wget:
+wget --post-file=somefile.ogg http://server:port
+
+ +
+
send_expect_100
+

Send an Expect: 100-continue header for POST. If set to 1 it will send, if set +to 0 it won’t, if set to -1 it will try to send if it is applicable. Default +value is -1. +

+
+
auth_type
+
+

Set HTTP authentication type. No option for Digest, since this method requires +getting nonce parameters from the server first and can’t be used straight away like +Basic. +

+
+
none
+

Choose the HTTP authentication type automatically. This is the default. +

+
basic
+
+

Choose the HTTP basic authentication. +

+

Basic authentication sends a Base64-encoded string that contains a user name and password +for the client. Base64 is not a form of encryption and should be considered the same as +sending the user name and password in clear text (Base64 is a reversible encoding). +If a resource needs to be protected, strongly consider using an authentication scheme +other than basic authentication. HTTPS/TLS should be used with basic authentication. +Without these additional security enhancements, basic authentication should not be used +to protect sensitive or valuable information. +

+
+ +
+
+ + +
+

3.15.1 HTTP Cookies

+ +

Some HTTP requests will be denied unless cookie values are passed in with the +request. The cookies option allows these cookies to be specified. At +the very least, each cookie must specify a value along with a path and domain. +HTTP requests that match both the domain and path will automatically include the +cookie value in the HTTP Cookie header field. Multiple cookies can be delimited +by a newline. +

+

The required syntax to play a stream specifying a cookie is: +

+
ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
+
+ +
+
+
+

3.16 Icecast

+ +

Icecast protocol (stream to Icecast servers) +

+

This protocol accepts the following options: +

+
+
ice_genre
+

Set the stream genre. +

+
+
ice_name
+

Set the stream name. +

+
+
ice_description
+

Set the stream description. +

+
+
ice_url
+

Set the stream website URL. +

+
+
ice_public
+

Set if the stream should be public. +The default is 0 (not public). +

+
+
user_agent
+

Override the User-Agent header. If not specified a string of the form +"Lavf/<version>" will be used. +

+
+
password
+

Set the Icecast mountpoint password. +

+
+
content_type
+

Set the stream content type. This must be set if it is different from +audio/mpeg. +

+
+
legacy_icecast
+

This enables support for Icecast versions < 2.4.0, that do not support the +HTTP PUT method but the SOURCE method. +

+
+
tls
+

Establish a TLS (HTTPS) connection to Icecast. +

+
+
+ +
+
icecast://[username[:password]@]server:port/mountpoint
+
+ +
+
+

3.17 ipfs

+ +

InterPlanetary File System (IPFS) protocol support. One can access files stored +on the IPFS network through so-called gateways. These are http(s) endpoints. +This protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be sent +to such a gateway. Users can (and should) host their own node which means this +protocol will use one’s local gateway to access files on the IPFS network. +

+

This protocol accepts the following options: +

+
+
gateway
+

Defines the gateway to use. When not set, the protocol will first try +locating the local gateway by looking at $IPFS_GATEWAY, $IPFS_PATH +and $HOME/.ipfs/, in that order. +

+
+
+ +

One can use this protocol in 2 ways. Using IPFS: +

+
ffplay ipfs://<hash>
+
+ +

Or the IPNS protocol (IPNS is mutable IPFS): +

+
ffplay ipns://<hash>
+
+ +
+
+

3.18 mmst

+ +

MMS (Microsoft Media Server) protocol over TCP. +

+
+
+

3.19 mmsh

+ +

MMS (Microsoft Media Server) protocol over HTTP. +

+

The required syntax is: +

+
mmsh://server[:port][/app][/playpath]
+
+ +
+
+

3.20 md5

+ +

MD5 output protocol. +

+

Computes the MD5 hash of the data to be written, and on close writes +this to the designated output or stdout if none is specified. It can +be used to test muxers without writing an actual file. +

+

Some examples follow. +

+
# Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
+ffmpeg -i input.flv -f avi -y md5:output.avi.md5
+
+# Write the MD5 hash of the encoded AVI file to stdout.
+ffmpeg -i input.flv -f avi -y md5:
+
+ +

Note that some formats (typically MOV) require the output protocol to +be seekable, so they will fail with the MD5 output protocol. +

+
+
+

3.21 pipe

+ +

UNIX pipe access protocol. +

+

Read and write from UNIX pipes. +

+

The accepted syntax is: +

+
pipe:[number]
+
+ +

If fd isn’t specified, number is the number corresponding to the file descriptor of the +pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If number +is not specified, by default the stdout file descriptor will be used +for writing, stdin for reading. +

+

For example to read from stdin with ffmpeg: +

+
cat test.wav | ffmpeg -i pipe:0
+# ...this is the same as...
+cat test.wav | ffmpeg -i pipe:
+
+ +

For writing to stdout with ffmpeg: +

+
ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
+# ...this is the same as...
+ffmpeg -i test.wav -f avi pipe: | cat > test.avi
+
+ +

This protocol accepts the following options: +

+
+
blocksize
+

Set I/O operation maximum block size, in bytes. Default value is +INT_MAX, which results in not limiting the requested block size. +Setting this value reasonably low improves user termination request reaction +time, which is valuable if data transmission is slow. +

+
fd
+

Set file descriptor. +

+
+ +

Note that some formats (typically MOV), require the output protocol to +be seekable, so they will fail with the pipe output protocol. +

+
+
+

3.22 prompeg

+ +

Pro-MPEG Code of Practice #3 Release 2 FEC protocol. +

+

The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism +for MPEG-2 Transport Streams sent over RTP. +

+

This protocol must be used in conjunction with the rtp_mpegts muxer and +the rtp protocol. +

+

The required syntax is: +

+
-f rtp_mpegts -fec prompeg=option=val... rtp://hostname:port
+
+ +

The destination UDP ports are port + 2 for the column FEC stream +and port + 4 for the row FEC stream. +

+

This protocol accepts the following options: +

+
l=n
+

The number of columns (4-20, LxD <= 100) +

+
+
d=n
+

The number of rows (4-20, LxD <= 100) +

+
+
+ +

Example usage: +

+
+
-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://hostname:port
+
+ +
+
+

3.23 rist

+ +

Reliable Internet Streaming Transport protocol +

+

The accepted options are: +

+
rist_profile
+

Supported values: +

+
simple
+
main
+

This one is default. +

+
advanced
+
+ +
+
buffer_size
+

Set internal RIST buffer size in milliseconds for retransmission of data. +Default value is 0 which means the librist default (1 sec). Maximum value is 30 +seconds. +

+
+
fifo_size
+

Size of the librist receiver output fifo in number of packets. This must be a +power of 2. +Defaults to 8192 (vs the librist default of 1024). +

+
+
overrun_nonfatal=1|0
+

Survive in case of librist fifo buffer overrun. Default value is 0. +

+
+
pkt_size
+

Set maximum packet size for sending data. 1316 by default. +

+
+
log_level
+

Set loglevel for RIST logging messages. You only need to set this if you +explicitly want to enable debug level messages or packet loss simulation, +otherwise the regular loglevel is respected. +

+
+
secret
+

Set override of encryption secret, by default is unset. +

+
+
encryption
+

Set encryption type, by default is disabled. +Acceptable values are 128 and 256. +

+
+ +
+
+

3.24 rtmp

+ +

Real-Time Messaging Protocol. +

+

The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia +content across a TCP/IP network. +

+

The required syntax is: +

+
rtmp://[username:password@]server[:port][/app][/instance][/playpath]
+
+ +

The accepted parameters are: +

+
username
+

An optional username (mostly for publishing). +

+
+
password
+

An optional password (mostly for publishing). +

+
+
server
+

The address of the RTMP server. +

+
+
port
+

The number of the TCP port to use (by default is 1935). +

+
+
app
+

It is the name of the application to access. It usually corresponds to +the path where the application is installed on the RTMP server +(e.g. /ondemand/, /flash/live/, etc.). You can override +the value parsed from the URI through the rtmp_app option, too. +

+
+
playpath
+

It is the path or name of the resource to play with reference to the +application specified in app, may be prefixed by "mp4:". You +can override the value parsed from the URI through the rtmp_playpath +option, too. +

+
+
listen
+

Act as a server, listening for an incoming connection. +

+
+
timeout
+

Maximum time to wait for the incoming connection. Implies listen. +

+
+ +

Additionally, the following parameters can be set via command line options +(or in code via AVOptions): +

+
rtmp_app
+

Name of application to connect on the RTMP server. This option +overrides the parameter specified in the URI. +

+
+
rtmp_buffer
+

Set the client buffer time in milliseconds. The default is 3000. +

+
+
rtmp_conn
+

Extra arbitrary AMF connection parameters, parsed from a string, +e.g. like B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0. +Each value is prefixed by a single character denoting the type, +B for Boolean, N for number, S for string, O for object, or Z for null, +followed by a colon. For Booleans the data must be either 0 or 1 for +FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or +1 to end or begin an object, respectively. Data items in subobjects may +be named, by prefixing the type with ’N’ and specifying the name before +the value (i.e. NB:myFlag:1). This option may be used multiple +times to construct arbitrary AMF sequences. +

+
+
rtmp_flashver
+

Version of the Flash plugin used to run the SWF player. The default +is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible; +<libavformat version>).) +

+
+
rtmp_flush_interval
+

Number of packets flushed in the same request (RTMPT only). The default +is 10. +

+
+
rtmp_live
+

Specify that the media is a live stream. No resuming or seeking in +live streams is possible. The default value is any, which means the +subscriber first tries to play the live stream specified in the +playpath. If a live stream of that name is not found, it plays the +recorded stream. The other possible values are live and +recorded. +

+
+
rtmp_pageurl
+

URL of the web page in which the media was embedded. By default no +value will be sent. +

+
+
rtmp_playpath
+

Stream identifier to play or to publish. This option overrides the +parameter specified in the URI. +

+
+
rtmp_subscribe
+

Name of live stream to subscribe to. By default no value will be sent. +It is only sent if the option is specified or if rtmp_live +is set to live. +

+
+
rtmp_swfhash
+

SHA256 hash of the decompressed SWF file (32 bytes). +

+
+
rtmp_swfsize
+

Size of the decompressed SWF file, required for SWFVerification. +

+
+
rtmp_swfurl
+

URL of the SWF player for the media. By default no value will be sent. +

+
+
rtmp_swfverify
+

URL to player swf file, compute hash/size automatically. +

+
+
rtmp_tcurl
+

URL of the target stream. Defaults to proto://host[:port]/app. +

+
+
tcp_nodelay=1|0
+

Set TCP_NODELAY to disable Nagle’s algorithm. Default value is 0. +

+

Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY. +

+
+
+ +

For example to read with ffplay a multimedia resource named +"sample" from the application "vod" from an RTMP server "myserver": +

+
ffplay rtmp://myserver/vod/sample
+
+ +

To publish to a password protected server, passing the playpath and +app names separately: +

+
ffmpeg -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@myserver/
+
+ +
+
+

3.25 rtmpe

+ +

Encrypted Real-Time Messaging Protocol. +

+

The Encrypted Real-Time Messaging Protocol (RTMPE) is used for +streaming multimedia content within standard cryptographic primitives, +consisting of Diffie-Hellman key exchange and HMACSHA256, generating +a pair of RC4 keys. +

+
+
+

3.26 rtmps

+ +

Real-Time Messaging Protocol over a secure SSL connection. +

+

The Real-Time Messaging Protocol (RTMPS) is used for streaming +multimedia content across an encrypted connection. +

+
+
+

3.27 rtmpt

+ +

Real-Time Messaging Protocol tunneled through HTTP. +

+

The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used +for streaming multimedia content within HTTP requests to traverse +firewalls. +

+
+
+

3.28 rtmpte

+ +

Encrypted Real-Time Messaging Protocol tunneled through HTTP. +

+

The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE) +is used for streaming multimedia content within HTTP requests to traverse +firewalls. +

+
+
+

3.29 rtmpts

+ +

Real-Time Messaging Protocol tunneled through HTTPS. +

+

The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used +for streaming multimedia content within HTTPS requests to traverse +firewalls. +

+
+
+

3.30 libsmbclient

+ +

libsmbclient permits one to manipulate CIFS/SMB network resources. +

+

Following syntax is required. +

+
+
smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
+
+ +

This protocol accepts the following options. +

+
+
timeout
+

Set timeout in milliseconds of socket I/O operations used by the underlying +low level operation. By default it is set to -1, which means that the timeout +is not specified. +

+
+
truncate
+

Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. +

+
+
workgroup
+

Set the workgroup used for making connections. By default workgroup is not specified. +

+
+
+ +

For more information see: http://www.samba.org/. +

+
+
+

3.31 libssh

+ +

Secure File Transfer Protocol via libssh +

+

Read from or write to remote resources using SFTP protocol. +

+

Following syntax is required. +

+
+
sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
+
+ +

This protocol accepts the following options. +

+
+
timeout
+

Set timeout of socket I/O operations used by the underlying low level +operation. By default it is set to -1, which means that the timeout +is not specified. +

+
+
truncate
+

Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. +

+
+
private_key
+

Specify the path of the file containing private key to use during authorization. +By default libssh searches for keys in the ~/.ssh/ directory. +

+
+
+ +

Example: Play a file stored on remote server. +

+
+
ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
+
+ +
+
+

3.32 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte

+ +

Real-Time Messaging Protocol and its variants supported through +librtmp. +

+

Requires the presence of the librtmp headers and library during +configuration. You need to explicitly configure the build with +"–enable-librtmp". If enabled this will replace the native RTMP +protocol. +

+

This protocol provides most client functions and a few server +functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT), +encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled +variants of these encrypted types (RTMPTE, RTMPTS). +

+

The required syntax is: +

+
rtmp_proto://server[:port][/app][/playpath] options
+
+ +

where rtmp_proto is one of the strings "rtmp", "rtmpt", "rtmpe", +"rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and +server, port, app and playpath have the same +meaning as specified for the RTMP native protocol. +options contains a list of space-separated options of the form +key=val. +

+

See the librtmp manual page (man 3 librtmp) for more information. +

+

For example, to stream a file in real-time to an RTMP server using +ffmpeg: +

+
ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
+
+ +

To play the same stream using ffplay: +

+
ffplay "rtmp://myserver/live/mystream live=1"
+
+ +
+
+

3.33 rtp

+ +

Real-time Transport Protocol. +

+

The required syntax for an RTP URL is: +rtp://hostname[:port][?option=val...] +

+

port specifies the RTP port to use. +

+

The following URL options are supported: +

+
+
ttl=n
+

Set the TTL (Time-To-Live) value (for multicast only). +

+
+
rtcpport=n
+

Set the remote RTCP port to n. +

+
+
localrtpport=n
+

Set the local RTP port to n. +

+
+
localrtcpport=n'
+

Set the local RTCP port to n. +

+
+
pkt_size=n
+

Set max packet size (in bytes) to n. +

+
+
buffer_size=size
+

Set the maximum UDP socket buffer size in bytes. +

+
+
connect=0|1
+

Do a connect() on the UDP socket (if set to 1) or not (if set +to 0). +

+
+
sources=ip[,ip]
+

List allowed source IP addresses. +

+
+
block=ip[,ip]
+

List disallowed (blocked) source IP addresses. +

+
+
write_to_source=0|1
+

Send packets to the source address of the latest received packet (if +set to 1) or to a default remote address (if set to 0). +

+
+
localport=n
+

Set the local RTP port to n. +

+
+
localaddr=addr
+

Local IP address of a network interface used for sending packets or joining +multicast groups. +

+
+
timeout=n
+

Set timeout (in microseconds) of socket I/O operations to n. +

+

This is a deprecated option. Instead, localrtpport should be +used. +

+
+
+ +

Important notes: +

+
    +
  1. If rtcpport is not set the RTCP port will be set to the RTP +port value plus 1. + +
  2. If localrtpport (the local RTP port) is not set any available +port will be used for the local RTP and RTCP ports. + +
  3. If localrtcpport (the local RTCP port) is not set it will be +set to the local RTP port value plus 1. +
+ +
+
+

3.34 rtsp

+ +

Real-Time Streaming Protocol. +

+

RTSP is not technically a protocol handler in libavformat, it is a demuxer +and muxer. The demuxer supports both normal RTSP (with data transferred +over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with +data transferred over RDT). +

+

The muxer can be used to send a stream using RTSP ANNOUNCE to a server +supporting it (currently Darwin Streaming Server and Mischa Spiegelmock’s +RTSP server). +

+

The required syntax for a RTSP url is: +

+
rtsp://hostname[:port]/path
+
+ +

Options can be set on the ffmpeg/ffplay command +line, or set in code via AVOptions or in +avformat_open_input. +

+ +
+

3.34.1 Muxer

+

The following options are supported. +

+
+
rtsp_transport
+

Set RTSP transport protocols. +

+

It accepts the following values: +

+
udp
+

Use UDP as lower transport protocol. +

+
+
tcp
+

Use TCP (interleaving within the RTSP control channel) as lower +transport protocol. +

+
+ +

Default value is ‘0’. +

+
+
rtsp_flags
+

Set RTSP flags. +

+

The following values are accepted: +

+
latm
+

Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC. +

+
rfc2190
+

Use RFC 2190 packetization instead of RFC 4629 for H.263. +

+
skip_rtcp
+

Don’t send RTCP sender reports. +

+
h264_mode0
+

Use mode 0 for H.264 in RTP. +

+
send_bye
+

Send RTCP BYE packets when finishing. +

+
+ +

Default value is ‘0’. +

+ +
+
min_port
+

Set minimum local UDP port. Default value is 5000. +

+
+
max_port
+

Set maximum local UDP port. Default value is 65000. +

+
+
buffer_size
+

Set the maximum socket buffer size in bytes. +

+
+
pkt_size
+

Set max send packet size (in bytes). Default value is 1472. +

+
+ +
+
+

3.34.2 Demuxer

+

The following options are supported. +

+
+
initial_pause
+

Do not start playing the stream immediately if set to 1. Default value +is 0. +

+
+
rtsp_transport
+

Set RTSP transport protocols. +

+

It accepts the following values: +

+
udp
+

Use UDP as lower transport protocol. +

+
+
tcp
+

Use TCP (interleaving within the RTSP control channel) as lower +transport protocol. +

+
+
udp_multicast
+

Use UDP multicast as lower transport protocol. +

+
+
http
+

Use HTTP tunneling as lower transport protocol, which is useful for +passing proxies. +

+
+
https
+

Use HTTPs tunneling as lower transport protocol, which is useful for +passing proxies and widely used for security consideration. +

+
+ +

Multiple lower transport protocols may be specified, in that case they are +tried one at a time (if the setup of one fails, the next one is tried). +For the muxer, only the ‘tcp’ and ‘udp’ options are supported. +

+
+
rtsp_flags
+

Set RTSP flags. +

+

The following values are accepted: +

+
filter_src
+

Accept packets only from negotiated peer address and port. +

+
listen
+

Act as a server, listening for an incoming connection. +

+
prefer_tcp
+

Try TCP for RTP transport first, if TCP is available as RTSP RTP transport. +

+
satip_raw
+

Export raw MPEG-TS stream instead of demuxing. The flag will simply write out +the raw stream, with the original PAT/PMT/PIDs intact. +

+
+ +

Default value is ‘none’. +

+
+
allowed_media_types
+

Set media types to accept from the server. +

+

The following flags are accepted: +

+
video
+
audio
+
data
+
subtitle
+
+ +

By default it accepts all media types. +

+
+
min_port
+

Set minimum local UDP port. Default value is 5000. +

+
+
max_port
+

Set maximum local UDP port. Default value is 65000. +

+
+
listen_timeout
+

Set maximum timeout (in seconds) to establish an initial connection. Setting +listen_timeout > 0 sets rtsp_flags to ‘listen’. Default is -1 +which means an infinite timeout when ‘listen’ mode is set. +

+
+
reorder_queue_size
+

Set number of packets to buffer for handling of reordered packets. +

+
+
timeout
+

Set socket TCP I/O timeout in microseconds. +

+
+
user_agent
+

Override User-Agent header. If not specified, it defaults to the +libavformat identifier string. +

+
+
buffer_size
+

Set the maximum socket buffer size in bytes. +

+
+ +

When receiving data over UDP, the demuxer tries to reorder received packets +(since they may arrive out of order, or packets may get lost totally). This +can be disabled by setting the maximum demuxing delay to zero (via +the max_delay field of AVFormatContext). +

+

When watching multi-bitrate Real-RTSP streams with ffplay, the +streams to display can be chosen with -vst n and +-ast n for video and audio respectively, and can be switched +on the fly by pressing v and a. +

+
+
+

3.34.3 Examples

+ +

The following examples all make use of the ffplay and +ffmpeg tools. +

+
    +
  • Watch a stream over UDP, with a max reordering delay of 0.5 seconds: +
    +
    ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
    +
    + +
  • Watch a stream tunneled over HTTP: +
    +
    ffplay -rtsp_transport http rtsp://server/video.mp4
    +
    + +
  • Send a stream in realtime to a RTSP server, for others to watch: +
    +
    ffmpeg -re -i input -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
    +
    + +
  • Receive a stream in realtime: +
    +
    ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp output
    +
    +
+ +
+
+
+

3.35 sap

+ +

Session Announcement Protocol (RFC 2974). This is not technically a +protocol handler in libavformat, it is a muxer and demuxer. +It is used for signalling of RTP streams, by announcing the SDP for the +streams regularly on a separate port. +

+ +
+

3.35.1 Muxer

+ +

The syntax for a SAP url given to the muxer is: +

+
sap://destination[:port][?options]
+
+ +

The RTP packets are sent to destination on port port, +or to port 5004 if no port is specified. +options is a &-separated list. The following options +are supported: +

+
+
announce_addr=address
+

Specify the destination IP address for sending the announcements to. +If omitted, the announcements are sent to the commonly used SAP +announcement multicast address 224.2.127.254 (sap.mcast.net), or +ff0e::2:7ffe if destination is an IPv6 address. +

+
+
announce_port=port
+

Specify the port to send the announcements on, defaults to +9875 if not specified. +

+
+
ttl=ttl
+

Specify the time to live value for the announcements and RTP packets, +defaults to 255. +

+
+
same_port=0|1
+

If set to 1, send all RTP streams on the same port pair. If zero (the +default), all streams are sent on unique ports, with each stream on a +port 2 numbers higher than the previous. +VLC/Live555 requires this to be set to 1, to be able to receive the stream. +The RTP stack in libavformat for receiving requires all streams to be sent +on unique ports. +

+
+ +

Example command lines follow. +

+

To broadcast a stream on the local subnet, for watching in VLC: +

+
+
ffmpeg -re -i input -f sap sap://224.0.0.255?same_port=1
+
+ +

Similarly, for watching in ffplay: +

+
+
ffmpeg -re -i input -f sap sap://224.0.0.255
+
+ +

And for watching in ffplay, over IPv6: +

+
+
ffmpeg -re -i input -f sap sap://[ff0e::1:2:3:4]
+
+ +
+
+

3.35.2 Demuxer

+ +

The syntax for a SAP url given to the demuxer is: +

+
sap://[address][:port]
+
+ +

address is the multicast address to listen for announcements on, +if omitted, the default 224.2.127.254 (sap.mcast.net) is used. port +is the port that is listened on, 9875 if omitted. +

+

The demuxers listens for announcements on the given address and port. +Once an announcement is received, it tries to receive that particular stream. +

+

Example command lines follow. +

+

To play back the first stream announced on the normal SAP multicast address: +

+
+
ffplay sap://
+
+ +

To play back the first stream announced on one the default IPv6 SAP multicast address: +

+
+
ffplay sap://[ff0e::2:7ffe]
+
+ +
+
+
+

3.36 sctp

+ +

Stream Control Transmission Protocol. +

+

The accepted URL syntax is: +

+
sctp://host:port[?options]
+
+ +

The protocol accepts the following options: +

+
listen
+

If set to any value, listen for an incoming connection. Outgoing connection is done by default. +

+
+
max_streams
+

Set the maximum number of streams. By default no limit is set. +

+
+ +
+
+

3.37 srt

+ +

Haivision Secure Reliable Transport Protocol via libsrt. +

+

The supported syntax for a SRT URL is: +

+
srt://hostname:port[?options]
+
+ +

options contains a list of &-separated options of the form +key=val. +

+

or +

+
+
options srt://hostname:port
+
+ +

options contains a list of ’-key val’ +options. +

+

This protocol accepts the following options. +

+
+
connect_timeout=milliseconds
+

Connection timeout; SRT cannot connect for RTT > 1500 msec +(2 handshake exchanges) with the default connect timeout of +3 seconds. This option applies to the caller and rendezvous +connection modes. The connect timeout is 10 times the value +set for the rendezvous mode (which can be used as a +workaround for this connection problem with earlier versions). +

+
+
ffs=bytes
+

Flight Flag Size (Window Size), in bytes. FFS is actually an +internal parameter and you should set it to not less than +recv_buffer_size and mss. The default value +is relatively large, therefore unless you set a very large receiver buffer, +you do not need to change this option. Default value is 25600. +

+
+
inputbw=bytes/seconds
+

Sender nominal input rate, in bytes per seconds. Used along with +oheadbw, when maxbw is set to relative (0), to +calculate maximum sending rate when recovery packets are sent +along with the main media stream: +inputbw * (100 + oheadbw) / 100 +if inputbw is not set while maxbw is set to +relative (0), the actual input rate is evaluated inside +the library. Default value is 0. +

+
+
iptos=tos
+

IP Type of Service. Applies to sender only. Default value is 0xB8. +

+
+
ipttl=ttl
+

IP Time To Live. Applies to sender only. Default value is 64. +

+
+
latency=microseconds
+

Timestamp-based Packet Delivery Delay. +Used to absorb bursts of missed packet retransmissions. +This flag sets both rcvlatency and peerlatency +to the same value. Note that prior to version 1.3.0 +this is the only flag to set the latency, however +this is effectively equivalent to setting peerlatency, +when side is sender and rcvlatency +when side is receiver, and the bidirectional stream +sending is not supported. +

+
+
listen_timeout=microseconds
+

Set socket listen timeout. +

+
+
maxbw=bytes/seconds
+

Maximum sending bandwidth, in bytes per seconds. +-1 infinite (CSRTCC limit is 30mbps) +0 relative to input rate (see inputbw) +>0 absolute limit value +Default value is 0 (relative) +

+
+
mode=caller|listener|rendezvous
+

Connection mode. +caller opens client connection. +listener starts server to listen for incoming connections. +rendezvous use Rendez-Vous connection mode. +Default value is caller. +

+
+
mss=bytes
+

Maximum Segment Size, in bytes. Used for buffer allocation +and rate calculation using a packet counter assuming fully +filled packets. The smallest MSS between the peers is +used. This is 1500 by default in the overall internet. +This is the maximum size of the UDP packet and can be +only decreased, unless you have some unusual dedicated +network settings. Default value is 1500. +

+
+
nakreport=1|0
+

If set to 1, Receiver will send ‘UMSG_LOSSREPORT‘ messages +periodically until a lost packet is retransmitted or +intentionally dropped. Default value is 1. +

+
+
oheadbw=percents
+

Recovery bandwidth overhead above input rate, in percents. +See inputbw. Default value is 25%. +

+
+
passphrase=string
+

HaiCrypt Encryption/Decryption Passphrase string, length +from 10 to 79 characters. The passphrase is the shared +secret between the sender and the receiver. It is used +to generate the Key Encrypting Key using PBKDF2 +(Password-Based Key Derivation Function). It is used +only if pbkeylen is non-zero. It is used on +the receiver only if the received data is encrypted. +The configured passphrase cannot be recovered (write-only). +

+
+
enforced_encryption=1|0
+

If true, both connection parties must have the same password +set (including empty, that is, with no encryption). If the +password doesn’t match or only one side is unencrypted, +the connection is rejected. Default is true. +

+
+
kmrefreshrate=packets
+

The number of packets to be transmitted after which the +encryption key is switched to a new key. Default is -1. +-1 means auto (0x1000000 in srt library). The range for +this option is integers in the 0 - INT_MAX. +

+
+
kmpreannounce=packets
+

The interval between when a new encryption key is sent and +when switchover occurs. This value also applies to the +subsequent interval between when switchover occurs and +when the old encryption key is decommissioned. Default is -1. +-1 means auto (0x1000 in srt library). The range for +this option is integers in the 0 - INT_MAX. +

+
+
snddropdelay=microseconds
+

The sender’s extra delay before dropping packets. This delay is +added to the default drop delay time interval value. +

+

Special value -1: Do not drop packets on the sender at all. +

+
+
payload_size=bytes
+

Sets the maximum declared size of a packet transferred +during the single call to the sending function in Live +mode. Use 0 if this value isn’t used (which is default in +file mode). +Default is -1 (automatic), which typically means MPEG-TS; +if you are going to use SRT +to send any different kind of payload, such as, for example, +wrapping a live stream in very small frames, then you can +use a bigger maximum frame size, though not greater than +1456 bytes. +

+
+
pkt_size=bytes
+

Alias for ‘payload_size’. +

+
+
peerlatency=microseconds
+

The latency value (as described in rcvlatency) that is +set by the sender side as a minimum value for the receiver. +

+
+
pbkeylen=bytes
+

Sender encryption key length, in bytes. +Only can be set to 0, 16, 24 and 32. +Enable sender encryption if not 0. +Not required on receiver (set to 0), +key size obtained from sender in HaiCrypt handshake. +Default value is 0. +

+
+
rcvlatency=microseconds
+

The time that should elapse since the moment when the +packet was sent and the moment when it’s delivered to +the receiver application in the receiving function. +This time should be a buffer time large enough to cover +the time spent for sending, unexpectedly extended RTT +time, and the time needed to retransmit the lost UDP +packet. The effective latency value will be the maximum +of this options’ value and the value of peerlatency +set by the peer side. Before version 1.3.0 this option +is only available as latency. +

+
+
recv_buffer_size=bytes
+

Set UDP receive buffer size, expressed in bytes. +

+
+
send_buffer_size=bytes
+

Set UDP send buffer size, expressed in bytes. +

+
+
timeout=microseconds
+

Set raise error timeouts for read, write and connect operations. Note that the +SRT library has internal timeouts which can be controlled separately, the +value set here is only a cap on those. +

+
+
tlpktdrop=1|0
+

Too-late Packet Drop. When enabled on receiver, it skips +missing packets that have not been delivered in time and +delivers the following packets to the application when +their time-to-play has come. It also sends a fake ACK to +the sender. When enabled on sender and enabled on the +receiving peer, the sender drops the older packets that +have no chance of being delivered in time. It was +automatically enabled in the sender if the receiver +supports it. +

+
+
sndbuf=bytes
+

Set send buffer size, expressed in bytes. +

+
+
rcvbuf=bytes
+

Set receive buffer size, expressed in bytes. +

+

Receive buffer must not be greater than ffs. +

+
+
lossmaxttl=packets
+

The value up to which the Reorder Tolerance may grow. When +Reorder Tolerance is > 0, then packet loss report is delayed +until that number of packets come in. Reorder Tolerance +increases every time a "belated" packet has come, but it +wasn’t due to retransmission (that is, when UDP packets tend +to come out of order), with the difference between the latest +sequence and this packet’s sequence, and not more than the +value of this option. By default it’s 0, which means that this +mechanism is turned off, and the loss report is always sent +immediately upon experiencing a "gap" in sequences. +

+
+
minversion
+

The minimum SRT version that is required from the peer. A connection +to a peer that does not satisfy the minimum version requirement +will be rejected. +

+

The version format in hex is 0xXXYYZZ for x.y.z in human readable +form. +

+
+
streamid=string
+

A string limited to 512 characters that can be set on the socket prior +to connecting. This stream ID will be able to be retrieved by the +listener side from the socket that is returned from srt_accept and +was connected by a socket with that set stream ID. SRT does not enforce +any special interpretation of the contents of this string. +This option doesn’t make sense in Rendezvous connection; the result +might be that simply one side will override the value from the other +side and it’s the matter of luck which one would win +

+
+
srt_streamid=string
+

Alias for ‘streamid’ to avoid conflict with ffmpeg command line option. +

+
+
smoother=live|file
+

The type of Smoother used for the transmission for that socket, which +is responsible for the transmission and congestion control. The Smoother +type must be exactly the same on both connecting parties, otherwise +the connection is rejected. +

+
+
messageapi=1|0
+

When set, this socket uses the Message API, otherwise it uses Buffer +API. Note that in live mode (see transtype) there’s only +message API available. In File mode you can chose to use one of two modes: +

+

Stream API (default, when this option is false). In this mode you may +send as many data as you wish with one sending instruction, or even use +dedicated functions that read directly from a file. The internal facility +will take care of any speed and congestion control. When receiving, you +can also receive as many data as desired, the data not extracted will be +waiting for the next call. There is no boundary between data portions in +the Stream mode. +

+

Message API. In this mode your single sending instruction passes exactly +one piece of data that has boundaries (a message). Contrary to Live mode, +this message may span across multiple UDP packets and the only size +limitation is that it shall fit as a whole in the sending buffer. The +receiver shall use as large buffer as necessary to receive the message, +otherwise the message will not be given up. When the message is not +complete (not all packets received or there was a packet loss) it will +not be given up. +

+
+
transtype=live|file
+

Sets the transmission type for the socket, in particular, setting this +option sets multiple other parameters to their default values as required +for a particular transmission type. +

+

live: Set options as for live transmission. In this mode, you should +send by one sending instruction only so many data that fit in one UDP packet, +and limited to the value defined first in payload_size (1316 is +default in this mode). There is no speed control in this mode, only the +bandwidth control, if configured, in order to not exceed the bandwidth with +the overhead transmission (retransmitted and control packets). +

+

file: Set options as for non-live transmission. See messageapi +for further explanations +

+
+
linger=seconds
+

The number of seconds that the socket waits for unsent data when closing. +Default is -1. -1 means auto (off with 0 seconds in live mode, on with 180 +seconds in file mode). The range for this option is integers in the +0 - INT_MAX. +

+
+
tsbpd=1|0
+

When true, use Timestamp-based Packet Delivery mode. The default behavior +depends on the transmission type: enabled in live mode, disabled in file +mode. +

+
+
+ +

For more information see: https://github.com/Haivision/srt. +

+
+
+

3.38 srtp

+ +

Secure Real-time Transport Protocol. +

+

The accepted options are: +

+
srtp_in_suite
+
srtp_out_suite
+

Select input and output encoding suites. +

+

Supported values: +

+
AES_CM_128_HMAC_SHA1_80
+
SRTP_AES128_CM_HMAC_SHA1_80
+
AES_CM_128_HMAC_SHA1_32
+
SRTP_AES128_CM_HMAC_SHA1_32
+
+ +
+
srtp_in_params
+
srtp_out_params
+

Set input and output encoding parameters, which are expressed by a +base64-encoded representation of a binary block. The first 16 bytes of +this binary block are used as master key, the following 14 bytes are +used as master salt. +

+
+ +
+
+

3.39 subfile

+ +

Virtually extract a segment of a file or another stream. +The underlying stream must be seekable. +

+

Accepted options: +

+
start
+

Start offset of the extracted segment, in bytes. +

+
end
+

End offset of the extracted segment, in bytes. +If set to 0, extract till end of file. +

+
+ +

Examples: +

+

Extract a chapter from a DVD VOB file (start and end sectors obtained +externally and multiplied by 2048): +

+
subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
+
+ +

Play an AVI file directly from a TAR archive: +

+
subfile,,start,183241728,end,366490624,,:archive.tar
+
+ +

Play a MPEG-TS file from start offset till end: +

+
subfile,,start,32815239,end,0,,:video.ts
+
+ +
+
+

3.40 tee

+ +

Writes the output to multiple protocols. The individual outputs are separated +by | +

+
+
tee:file://path/to/local/this.avi|file://path/to/local/that.avi
+
+ +
+
+

3.41 tcp

+ +

Transmission Control Protocol. +

+

The required syntax for a TCP url is: +

+
tcp://hostname:port[?options]
+
+ +

options contains a list of &-separated options of the form +key=val. +

+

The list of supported options follows. +

+
+
listen=2|1|0
+

Listen for an incoming connection. 0 disables listen, 1 enables listen in +single client mode, 2 enables listen in multi-client mode. Default value is 0. +

+
+
local_addr=addr
+

Local IP address of a network interface used for tcp socket connect. +

+
+
local_port=port
+

Local port used for tcp socket connect. +

+
+
timeout=microseconds
+

Set raise error timeout, expressed in microseconds. +

+

This option is only relevant in read mode: if no data arrived in more +than this time interval, raise error. +

+
+
listen_timeout=milliseconds
+

Set listen timeout, expressed in milliseconds. +

+
+
recv_buffer_size=bytes
+

Set receive buffer size, expressed bytes. +

+
+
send_buffer_size=bytes
+

Set send buffer size, expressed bytes. +

+
+
tcp_nodelay=1|0
+

Set TCP_NODELAY to disable Nagle’s algorithm. Default value is 0. +

+

Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY. +

+
+
tcp_mss=bytes
+

Set maximum segment size for outgoing TCP packets, expressed in bytes. +

+
+ +

The following example shows how to setup a listening TCP connection +with ffmpeg, which is then accessed with ffplay: +

+
ffmpeg -i input -f format tcp://hostname:port?listen
+ffplay tcp://hostname:port
+
+ +
+
+

3.42 tls

+ +

Transport Layer Security (TLS) / Secure Sockets Layer (SSL) +

+

The required syntax for a TLS/SSL url is: +

+
tls://hostname:port[?options]
+
+ +

The following parameters can be set via command line options +(or in code via AVOptions): +

+
+
ca_file, cafile=filename
+

A file containing certificate authority (CA) root certificates to treat +as trusted. If the linked TLS library contains a default this might not +need to be specified for verification to work, but not all libraries and +setups have defaults built in. +The file must be in OpenSSL PEM format. +

+
+
tls_verify=1|0
+

If enabled, try to verify the peer that we are communicating with. +Note, if using OpenSSL, this currently only makes sure that the +peer certificate is signed by one of the root certificates in the CA +database, but it does not validate that the certificate actually +matches the host name we are trying to connect to. (With other backends, +the host name is validated as well.) +

+

This is disabled by default since it requires a CA database to be +provided by the caller in many cases. +

+
+
cert_file, cert=filename
+

A file containing a certificate to use in the handshake with the peer. +(When operating as server, in listen mode, this is more often required +by the peer, while client certificates only are mandated in certain +setups.) +

+
+
key_file, key=filename
+

A file containing the private key for the certificate. +

+
+
listen=1|0
+

If enabled, listen for connections on the provided port, and assume +the server role in the handshake instead of the client role. +

+
+
http_proxy
+

The HTTP proxy to tunnel through, e.g. http://example.com:1234. +The proxy must support the CONNECT method. +

+
+
+ +

Example command lines: +

+

To create a TLS/SSL server that serves an input stream. +

+
+
ffmpeg -i input -f format tls://hostname:port?listen&cert=server.crt&key=server.key
+
+ +

To play back a stream from the TLS/SSL server using ffplay: +

+
+
ffplay tls://hostname:port
+
+ +
+
+

3.43 udp

+ +

User Datagram Protocol. +

+

The required syntax for an UDP URL is: +

+
udp://hostname:port[?options]
+
+ +

options contains a list of &-separated options of the form key=val. +

+

In case threading is enabled on the system, a circular buffer is used +to store the incoming data, which allows one to reduce loss of data due to +UDP socket buffer overruns. The fifo_size and +overrun_nonfatal options are related to this buffer. +

+

The list of supported options follows. +

+
+
buffer_size=size
+

Set the UDP maximum socket buffer size in bytes. This is used to set either +the receive or send buffer size, depending on what the socket is used for. +Default is 32 KB for output, 384 KB for input. See also fifo_size. +

+
+
bitrate=bitrate
+

If set to nonzero, the output will have the specified constant bitrate if the +input has enough packets to sustain it. +

+
+
burst_bits=bits
+

When using bitrate this specifies the maximum number of bits in +packet bursts. +

+
+
localport=port
+

Override the local UDP port to bind with. +

+
+
localaddr=addr
+

Local IP address of a network interface used for sending packets or joining +multicast groups. +

+
+
pkt_size=size
+

Set the size in bytes of UDP packets. +

+
+
reuse=1|0
+

Explicitly allow or disallow reusing UDP sockets. +

+
+
ttl=ttl
+

Set the time to live value (for multicast only). +

+
+
connect=1|0
+

Initialize the UDP socket with connect(). In this case, the +destination address can’t be changed with ff_udp_set_remote_url later. +If the destination address isn’t known at the start, this option can +be specified in ff_udp_set_remote_url, too. +This allows finding out the source address for the packets with getsockname, +and makes writes return with AVERROR(ECONNREFUSED) if "destination +unreachable" is received. +For receiving, this gives the benefit of only receiving packets from +the specified peer address/port. +

+
+
sources=address[,address]
+

Only receive packets sent from the specified addresses. In case of multicast, +also subscribe to multicast traffic coming from these addresses only. +

+
+
block=address[,address]
+

Ignore packets sent from the specified addresses. In case of multicast, also +exclude the source addresses in the multicast subscription. +

+
+
fifo_size=units
+

Set the UDP receiving circular buffer size, expressed as a number of +packets with size of 188 bytes. If not specified defaults to 7*4096. +

+
+
overrun_nonfatal=1|0
+

Survive in case of UDP receiving circular buffer overrun. Default +value is 0. +

+
+
timeout=microseconds
+

Set raise error timeout, expressed in microseconds. +

+

This option is only relevant in read mode: if no data arrived in more +than this time interval, raise error. +

+
+
broadcast=1|0
+

Explicitly allow or disallow UDP broadcasting. +

+

Note that broadcasting may not work properly on networks having +a broadcast storm protection. +

+
+ + +
+

3.43.1 Examples

+ +
    +
  • Use ffmpeg to stream over UDP to a remote endpoint: +
    +
    ffmpeg -i input -f format udp://hostname:port
    +
    + +
  • Use ffmpeg to stream in mpegts format over UDP using 188 +sized UDP packets, using a large input buffer: +
    +
    ffmpeg -i input -f mpegts udp://hostname:port?pkt_size=188&buffer_size=65535
    +
    + +
  • Use ffmpeg to receive over UDP from a remote endpoint: +
    +
    ffmpeg -i udp://[multicast-address]:port ...
    +
    +
+ +
+
+
+

3.44 unix

+ +

Unix local socket +

+

The required syntax for a Unix socket URL is: +

+
+
unix://filepath
+
+ +

The following parameters can be set via command line options +(or in code via AVOptions): +

+
+
timeout
+

Timeout in ms. +

+
listen
+

Create the Unix socket in listening mode. +

+
+ +
+
+

3.45 zmq

+ +

ZeroMQ asynchronous messaging using the libzmq library. +

+

This library supports unicast streaming to multiple clients without relying on +an external server. +

+

The required syntax for streaming or connecting to a stream is: +

+
zmq:tcp://ip-address:port
+
+ +

Example: +Create a localhost stream on port 5555: +

+
ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
+
+ +

Multiple clients may connect to the stream using: +

+
ffplay zmq:tcp://127.0.0.1:5555
+
+ +

Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern. +The server side binds to a port and publishes data. Clients connect to the +server (via IP address/port) and subscribe to the stream. The order in which +the server and client start generally does not matter. +

+

ffmpeg must be compiled with the –enable-libzmq option to support +this protocol. +

+

Options can be set on the ffmpeg/ffplay command +line. The following options are supported: +

+
+
pkt_size
+

Forces the maximum packet size for sending/receiving data. The default value is +131,072 bytes. On the server side, this sets the maximum size of sent packets +via ZeroMQ. On the clients, it sets an internal buffer size for receiving +packets. Note that pkt_size on the clients should be equal to or greater than +pkt_size on the server. Otherwise the received message may be truncated causing +decoding errors. +

+
+
+ + +
+
+
+

4 See Also

+ +

ffmpeg, ffplay, ffprobe, +libavformat +

+ +
+
+

5 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-resampler.html b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-resampler.html new file mode 100644 index 0000000000000000000000000000000000000000..f43c1fcff3ff7079ca6fccd95b9209d05c3d504a --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-resampler.html @@ -0,0 +1,362 @@ + + + + + +FFmpeg Resampler Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ + +
+
+

1 Description

+ +

The FFmpeg resampler provides a high-level interface to the +libswresample library audio resampling utilities. In particular it +allows one to perform audio resampling, audio channel layout rematrixing, +and convert audio format and packing layout. +

+ +
+
+

2 Resampler Options

+ +

The audio resampler supports the following named options. +

+

Options may be set by specifying -option value in the +FFmpeg tools, option=value for the aresample filter, +by setting the value explicitly in the +SwrContext options or using the libavutil/opt.h API for +programmatic use. +

+
+
uchl, used_chlayout
+

Set used input channel layout. Default is unset. This option is +only used for special remapping. +

+
+
isr, in_sample_rate
+

Set the input sample rate. Default value is 0. +

+
+
osr, out_sample_rate
+

Set the output sample rate. Default value is 0. +

+
+
isf, in_sample_fmt
+

Specify the input sample format. It is set by default to none. +

+
+
osf, out_sample_fmt
+

Specify the output sample format. It is set by default to none. +

+
+
tsf, internal_sample_fmt
+

Set the internal sample format. Default value is none. +This will automatically be chosen when it is not explicitly set. +

+
+
ichl, in_chlayout
+
ochl, out_chlayout
+

Set the input/output channel layout. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+
clev, center_mix_level
+

Set the center mix level. It is a value expressed in deciBel, and must be +in the interval [-32,32]. +

+
+
slev, surround_mix_level
+

Set the surround mix level. It is a value expressed in deciBel, and must +be in the interval [-32,32]. +

+
+
lfe_mix_level
+

Set LFE mix into non LFE level. It is used when there is a LFE input but no +LFE output. It is a value expressed in deciBel, and must +be in the interval [-32,32]. +

+
+
rmvol, rematrix_volume
+

Set rematrix volume. Default value is 1.0. +

+
+
rematrix_maxval
+

Set maximum output value for rematrixing. +This can be used to prevent clipping vs. preventing volume reduction. +A value of 1.0 prevents clipping. +

+
+
flags, swr_flags
+

Set flags used by the converter. Default value is 0. +

+

It supports the following individual flags: +

+
res
+

force resampling, this flag forces resampling to be used even when the +input and output sample rates match. +

+
+ +
+
dither_scale
+

Set the dither scale. Default value is 1. +

+
+
dither_method
+

Set dither method. Default value is 0. +

+

Supported values: +

+
rectangular
+

select rectangular dither +

+
triangular
+

select triangular dither +

+
triangular_hp
+

select triangular dither with high pass +

+
lipshitz
+

select Lipshitz noise shaping dither. +

+
shibata
+

select Shibata noise shaping dither. +

+
low_shibata
+

select low Shibata noise shaping dither. +

+
high_shibata
+

select high Shibata noise shaping dither. +

+
f_weighted
+

select f-weighted noise shaping dither +

+
modified_e_weighted
+

select modified-e-weighted noise shaping dither +

+
improved_e_weighted
+

select improved-e-weighted noise shaping dither +

+
+
+ +
+
resampler
+

Set resampling engine. Default value is swr. +

+

Supported values: +

+
swr
+

select the native SW Resampler; filter options precision and cheby are not +applicable in this case. +

+
soxr
+

select the SoX Resampler (where available); compensation, and filter options +filter_size, phase_shift, exact_rational, filter_type & kaiser_beta, are not +applicable in this case. +

+
+ +
+
filter_size
+

For swr only, set resampling filter size, default value is 32. +

+
+
phase_shift
+

For swr only, set resampling phase shift, default value is 10, and must be in +the interval [0,30]. +

+
+
linear_interp
+

Use linear interpolation when enabled (the default). Disable it if you want +to preserve speed instead of quality when exact_rational fails. +

+
+
exact_rational
+

For swr only, when enabled, try to use exact phase_count based on input and +output sample rate. However, if it is larger than 1 << phase_shift, +the phase_count will be 1 << phase_shift as fallback. Default is enabled. +

+
+
cutoff
+

Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float +value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr +(which, with a sample-rate of 44100, preserves the entire audio band to 20kHz). +

+
+
precision
+

For soxr only, the precision in bits to which the resampled signal will be +calculated. The default value of 20 (which, with suitable dithering, is +appropriate for a destination bit-depth of 16) gives SoX’s ’High Quality’; a +value of 28 gives SoX’s ’Very High Quality’. +

+
+
cheby
+

For soxr only, selects passband rolloff none (Chebyshev) & higher-precision +approximation for ’irrational’ ratios. Default value is 0. +

+
+
async
+

For swr only, simple 1 parameter audio sync to timestamps using stretching, +squeezing, filling and trimming. Setting this to 1 will enable filling and +trimming, larger values represent the maximum amount in samples that the data +may be stretched or squeezed for each second. +Default value is 0, thus no compensation is applied to make the samples match +the audio timestamps. +

+
+
first_pts
+

For swr only, assume the first pts should be this value. The time unit is 1 / sample rate. +This allows for padding/trimming at the start of stream. By default, no +assumption is made about the first frame’s expected pts, so no padding or +trimming is done. For example, this could be set to 0 to pad the beginning with +silence if an audio stream starts after the video stream or to trim any samples +with a negative pts due to encoder delay. +

+
+
min_comp
+

For swr only, set the minimum difference between timestamps and audio data (in +seconds) to trigger stretching/squeezing/filling or trimming of the +data to make it match the timestamps. The default is that +stretching/squeezing/filling and trimming is disabled +(min_comp = FLT_MAX). +

+
+
min_hard_comp
+

For swr only, set the minimum difference between timestamps and audio data (in +seconds) to trigger adding/dropping samples to make it match the +timestamps. This option effectively is a threshold to select between +hard (trim/fill) and soft (squeeze/stretch) compensation. Note that +all compensation is by default disabled through min_comp. +The default is 0.1. +

+
+
comp_duration
+

For swr only, set duration (in seconds) over which data is stretched/squeezed +to make it match the timestamps. Must be a non-negative double float value, +default value is 1.0. +

+
+
max_soft_comp
+

For swr only, set maximum factor by which data is stretched/squeezed to make it +match the timestamps. Must be a non-negative double float value, default value +is 0. +

+
+
matrix_encoding
+

Select matrixed stereo encoding. +

+

It accepts the following values: +

+
none
+

select none +

+
dolby
+

select Dolby +

+
dplii
+

select Dolby Pro Logic II +

+
+ +

Default value is none. +

+
+
filter_type
+

For swr only, select resampling filter type. This only affects resampling +operations. +

+

It accepts the following values: +

+
cubic
+

select cubic +

+
blackman_nuttall
+

select Blackman Nuttall windowed sinc +

+
kaiser
+

select Kaiser windowed sinc +

+
+ +
+
kaiser_beta
+

For swr only, set Kaiser window beta value. Must be a double float value in the +interval [2,16], default value is 9. +

+
+
output_sample_bits
+

For swr only, set number of used output sample bits for dithering. Must be an integer in the +interval [0,64], default value is 0, which means it’s not used. +

+
+
+ + +
+
+

3 See Also

+ +

ffmpeg, ffplay, ffprobe, +libswresample +

+ +
+
+

4 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-scaler.html b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-scaler.html new file mode 100644 index 0000000000000000000000000000000000000000..f9c719eac67bca6f5a03e06b886d5b949ca3073e --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-scaler.html @@ -0,0 +1,266 @@ + + + + + +FFmpeg Scaler Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ + +
+
+

1 Description

+ +

The FFmpeg rescaler provides a high-level interface to the libswscale +library image conversion utilities. In particular it allows one to perform +image rescaling and pixel format conversion. +

+ +
+
+

2 Scaler Options

+ +

The video scaler supports the following named options. +

+

Options may be set by specifying -option value in the +FFmpeg tools, with a few API-only exceptions noted below. +For programmatic use, they can be set explicitly in the +SwsContext options or through the libavutil/opt.h API. +

+
+
+
+
sws_flags
+

Set the scaler flags. This is also used to set the scaling +algorithm. Only a single algorithm should be selected. Default +value is ‘bicubic’. +

+

It accepts the following values: +

+
fast_bilinear
+

Select fast bilinear scaling algorithm. +

+
+
bilinear
+

Select bilinear scaling algorithm. +

+
+
bicubic
+

Select bicubic scaling algorithm. +

+
+
experimental
+

Select experimental scaling algorithm. +

+
+
neighbor
+

Select nearest neighbor rescaling algorithm. +

+
+
area
+

Select averaging area rescaling algorithm. +

+
+
bicublin
+

Select bicubic scaling algorithm for the luma component, bilinear for +chroma components. +

+
+
gauss
+

Select Gaussian rescaling algorithm. +

+
+
sinc
+

Select sinc rescaling algorithm. +

+
+
lanczos
+

Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be +changed by setting param0. +

+
+
spline
+

Select natural bicubic spline rescaling algorithm. +

+
+
print_info
+

Enable printing/debug logging. +

+
+
accurate_rnd
+

Enable accurate rounding. +

+
+
full_chroma_int
+

Enable full chroma interpolation. +

+
+
full_chroma_inp
+

Select full chroma input. +

+
+
bitexact
+

Enable bitexact output. +

+
+ +
+
srcw (API only)
+

Set source width. +

+
+
srch (API only)
+

Set source height. +

+
+
dstw (API only)
+

Set destination width. +

+
+
dsth (API only)
+

Set destination height. +

+
+
src_format (API only)
+

Set source pixel format (must be expressed as an integer). +

+
+
dst_format (API only)
+

Set destination pixel format (must be expressed as an integer). +

+
+
src_range (boolean)
+

If value is set to 1, indicates source is full range. Default value is +0, which indicates source is limited range. +

+
+
dst_range (boolean)
+

If value is set to 1, enable full range for destination. Default value +is 0, which enables limited range. +

+
+
param0, param1
+

Set scaling algorithm parameters. The specified values are specific of +some scaling algorithms and ignored by others. The specified values +are floating point number values. +

+
+
sws_dither
+

Set the dithering algorithm. Accepts one of the following +values. Default value is ‘auto’. +

+
+
auto
+

automatic choice +

+
+
none
+

no dithering +

+
+
bayer
+

bayer dither +

+
+
ed
+

error diffusion dither +

+
+
a_dither
+

arithmetic dither, based using addition +

+
+
x_dither
+

arithmetic dither, based using xor (more random/less apparent patterning that +a_dither). +

+
+
+ +
+
alphablend
+

Set the alpha blending to use when the input has alpha but the output does not. +Default value is ‘none’. +

+
+
uniform_color
+

Blend onto a uniform background color +

+
+
checkerboard
+

Blend onto a checkerboard +

+
+
none
+

No blending +

+
+
+ +
+
+ + +
+
+

3 See Also

+ +

ffmpeg, ffplay, ffprobe, +libswscale +

+ +
+
+

4 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-utils.html b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-utils.html new file mode 100644 index 0000000000000000000000000000000000000000..77ecc798e7421e14827fd890847b04ad0788cc16 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg-utils.html @@ -0,0 +1,1539 @@ + + + + + +FFmpeg Utilities Documentation + + + + + + + + + + + + + + + + + +
+ + + +
+

1 Description

+ +

This document describes some generic features and utilities provided +by the libavutil library. +

+ +
+
+

2 Syntax

+ +

This section documents the syntax and formats employed by the FFmpeg +libraries and tools. +

+ +
+

2.1 Quoting and escaping

+ +

FFmpeg adopts the following quoting and escaping mechanism, unless +explicitly specified. The following rules are applied: +

+
    +
  • '’ and ‘\’ are special characters (respectively used for +quoting and escaping). In addition to them, there might be other +special characters depending on the specific syntax where the escaping +and quoting are employed. + +
  • A special character is escaped by prefixing it with a ‘\’. + +
  • All characters enclosed between ‘''’ are included literally in the +parsed string. The quote character ‘'’ itself cannot be quoted, +so you may need to close the quote and escape it. + +
  • Leading and trailing whitespaces, unless escaped or quoted, are +removed from the parsed string. +
+ +

Note that you may need to add a second level of escaping when using +the command line or a script, which depends on the syntax of the +adopted shell language. +

+

The function av_get_token defined in +libavutil/avstring.h can be used to parse a token quoted or +escaped according to the rules defined above. +

+

The tool tools/ffescape in the FFmpeg source tree can be used +to automatically quote or escape a string in a script. +

+ +
+

2.1.1 Examples

+ +
    +
  • Escape the string Crime d'Amour containing the ' special +character: +
    +
    Crime d\'Amour
    +
    + +
  • The string above contains a quote, so the ' needs to be escaped +when quoting it: +
    +
    'Crime d'\''Amour'
    +
    + +
  • Include leading or trailing whitespaces using quoting: +
    +
    '  this string starts and ends with whitespaces  '
    +
    + +
  • Escaping and quoting can be mixed together: +
    +
    ' The string '\'string\'' is a string '
    +
    + +
  • To include a literal ‘\’ you can use either escaping or quoting: +
    +
    'c:\foo' can be written as c:\\foo
    +
    +
+ +
+
+
+

2.2 Date

+ +

The accepted syntax is: +

+
[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
+now
+
+ +

If the value is "now" it takes the current time. +

+

Time is local time unless Z is appended, in which case it is +interpreted as UTC. +If the year-month-day part is not specified it takes the current +year-month-day. +

+
+
+

2.3 Time duration

+ +

There are two accepted syntaxes for expressing time duration. +

+
+
[-][HH:]MM:SS[.m...]
+
+ +

HH expresses the number of hours, MM the number of minutes +for a maximum of 2 digits, and SS the number of seconds for a +maximum of 2 digits. The m at the end expresses decimal value for +SS. +

+

or +

+
+
[-]S+[.m...][s|ms|us]
+
+ +

S expresses the number of seconds, with the optional decimal part +m. The optional literal suffixes ‘s’, ‘ms’ or ‘us’ +indicate to interpret the value as seconds, milliseconds or microseconds, +respectively. +

+

In both expressions, the optional ‘-’ indicates negative duration. +

+ +
+

2.3.1 Examples

+ +

The following examples are all valid time duration: +

+
+
55
+

55 seconds +

+
+
0.2
+

0.2 seconds +

+
+
200ms
+

200 milliseconds, that’s 0.2s +

+
+
200000us
+

200000 microseconds, that’s 0.2s +

+
+
12:03:45
+

12 hours, 03 minutes and 45 seconds +

+
+
23.189
+

23.189 seconds +

+
+ +
+
+
+

2.4 Video size

+

Specify the size of the sourced video, it may be a string of the form +widthxheight, or the name of a size abbreviation. +

+

The following abbreviations are recognized: +

+
ntsc
+

720x480 +

+
pal
+

720x576 +

+
qntsc
+

352x240 +

+
qpal
+

352x288 +

+
sntsc
+

640x480 +

+
spal
+

768x576 +

+
film
+

352x240 +

+
ntsc-film
+

352x240 +

+
sqcif
+

128x96 +

+
qcif
+

176x144 +

+
cif
+

352x288 +

+
4cif
+

704x576 +

+
16cif
+

1408x1152 +

+
qqvga
+

160x120 +

+
qvga
+

320x240 +

+
vga
+

640x480 +

+
svga
+

800x600 +

+
xga
+

1024x768 +

+
uxga
+

1600x1200 +

+
qxga
+

2048x1536 +

+
sxga
+

1280x1024 +

+
qsxga
+

2560x2048 +

+
hsxga
+

5120x4096 +

+
wvga
+

852x480 +

+
wxga
+

1366x768 +

+
wsxga
+

1600x1024 +

+
wuxga
+

1920x1200 +

+
woxga
+

2560x1600 +

+
wqsxga
+

3200x2048 +

+
wquxga
+

3840x2400 +

+
whsxga
+

6400x4096 +

+
whuxga
+

7680x4800 +

+
cga
+

320x200 +

+
ega
+

640x350 +

+
hd480
+

852x480 +

+
hd720
+

1280x720 +

+
hd1080
+

1920x1080 +

+
2k
+

2048x1080 +

+
2kflat
+

1998x1080 +

+
2kscope
+

2048x858 +

+
4k
+

4096x2160 +

+
4kflat
+

3996x2160 +

+
4kscope
+

4096x1716 +

+
nhd
+

640x360 +

+
hqvga
+

240x160 +

+
wqvga
+

400x240 +

+
fwqvga
+

432x240 +

+
hvga
+

480x320 +

+
qhd
+

960x540 +

+
2kdci
+

2048x1080 +

+
4kdci
+

4096x2160 +

+
uhd2160
+

3840x2160 +

+
uhd4320
+

7680x4320 +

+
+ +
+
+

2.5 Video rate

+ +

Specify the frame rate of a video, expressed as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a float +number or a valid video frame rate abbreviation. +

+

The following abbreviations are recognized: +

+
ntsc
+

30000/1001 +

+
pal
+

25/1 +

+
qntsc
+

30000/1001 +

+
qpal
+

25/1 +

+
sntsc
+

30000/1001 +

+
spal
+

25/1 +

+
film
+

24/1 +

+
ntsc-film
+

24000/1001 +

+
+ +
+
+

2.6 Ratio

+ +

A ratio can be expressed as an expression, or in the form +numerator:denominator. +

+

Note that a ratio with infinite (1/0) or negative value is +considered valid, so you should check on the returned value if you +want to exclude those values. +

+

The undefined value can be expressed using the "0:0" string. +

+
+
+

2.7 Color

+ +

It can be the name of a color as defined below (case insensitive match) or a +[0x|#]RRGGBB[AA] sequence, possibly followed by @ and a string +representing the alpha component. +

+

The alpha component may be a string composed by "0x" followed by an +hexadecimal number or a decimal number between 0.0 and 1.0, which +represents the opacity value (‘0x00’ or ‘0.0’ means completely +transparent, ‘0xff’ or ‘1.0’ completely opaque). If the alpha +component is not specified then ‘0xff’ is assumed. +

+

The string ‘random’ will result in a random color. +

+

The following names of colors are recognized: +

+
AliceBlue
+

0xF0F8FF +

+
AntiqueWhite
+

0xFAEBD7 +

+
Aqua
+

0x00FFFF +

+
Aquamarine
+

0x7FFFD4 +

+
Azure
+

0xF0FFFF +

+
Beige
+

0xF5F5DC +

+
Bisque
+

0xFFE4C4 +

+
Black
+

0x000000 +

+
BlanchedAlmond
+

0xFFEBCD +

+
Blue
+

0x0000FF +

+
BlueViolet
+

0x8A2BE2 +

+
Brown
+

0xA52A2A +

+
BurlyWood
+

0xDEB887 +

+
CadetBlue
+

0x5F9EA0 +

+
Chartreuse
+

0x7FFF00 +

+
Chocolate
+

0xD2691E +

+
Coral
+

0xFF7F50 +

+
CornflowerBlue
+

0x6495ED +

+
Cornsilk
+

0xFFF8DC +

+
Crimson
+

0xDC143C +

+
Cyan
+

0x00FFFF +

+
DarkBlue
+

0x00008B +

+
DarkCyan
+

0x008B8B +

+
DarkGoldenRod
+

0xB8860B +

+
DarkGray
+

0xA9A9A9 +

+
DarkGreen
+

0x006400 +

+
DarkKhaki
+

0xBDB76B +

+
DarkMagenta
+

0x8B008B +

+
DarkOliveGreen
+

0x556B2F +

+
Darkorange
+

0xFF8C00 +

+
DarkOrchid
+

0x9932CC +

+
DarkRed
+

0x8B0000 +

+
DarkSalmon
+

0xE9967A +

+
DarkSeaGreen
+

0x8FBC8F +

+
DarkSlateBlue
+

0x483D8B +

+
DarkSlateGray
+

0x2F4F4F +

+
DarkTurquoise
+

0x00CED1 +

+
DarkViolet
+

0x9400D3 +

+
DeepPink
+

0xFF1493 +

+
DeepSkyBlue
+

0x00BFFF +

+
DimGray
+

0x696969 +

+
DodgerBlue
+

0x1E90FF +

+
FireBrick
+

0xB22222 +

+
FloralWhite
+

0xFFFAF0 +

+
ForestGreen
+

0x228B22 +

+
Fuchsia
+

0xFF00FF +

+
Gainsboro
+

0xDCDCDC +

+
GhostWhite
+

0xF8F8FF +

+
Gold
+

0xFFD700 +

+
GoldenRod
+

0xDAA520 +

+
Gray
+

0x808080 +

+
Green
+

0x008000 +

+
GreenYellow
+

0xADFF2F +

+
HoneyDew
+

0xF0FFF0 +

+
HotPink
+

0xFF69B4 +

+
IndianRed
+

0xCD5C5C +

+
Indigo
+

0x4B0082 +

+
Ivory
+

0xFFFFF0 +

+
Khaki
+

0xF0E68C +

+
Lavender
+

0xE6E6FA +

+
LavenderBlush
+

0xFFF0F5 +

+
LawnGreen
+

0x7CFC00 +

+
LemonChiffon
+

0xFFFACD +

+
LightBlue
+

0xADD8E6 +

+
LightCoral
+

0xF08080 +

+
LightCyan
+

0xE0FFFF +

+
LightGoldenRodYellow
+

0xFAFAD2 +

+
LightGreen
+

0x90EE90 +

+
LightGrey
+

0xD3D3D3 +

+
LightPink
+

0xFFB6C1 +

+
LightSalmon
+

0xFFA07A +

+
LightSeaGreen
+

0x20B2AA +

+
LightSkyBlue
+

0x87CEFA +

+
LightSlateGray
+

0x778899 +

+
LightSteelBlue
+

0xB0C4DE +

+
LightYellow
+

0xFFFFE0 +

+
Lime
+

0x00FF00 +

+
LimeGreen
+

0x32CD32 +

+
Linen
+

0xFAF0E6 +

+
Magenta
+

0xFF00FF +

+
Maroon
+

0x800000 +

+
MediumAquaMarine
+

0x66CDAA +

+
MediumBlue
+

0x0000CD +

+
MediumOrchid
+

0xBA55D3 +

+
MediumPurple
+

0x9370D8 +

+
MediumSeaGreen
+

0x3CB371 +

+
MediumSlateBlue
+

0x7B68EE +

+
MediumSpringGreen
+

0x00FA9A +

+
MediumTurquoise
+

0x48D1CC +

+
MediumVioletRed
+

0xC71585 +

+
MidnightBlue
+

0x191970 +

+
MintCream
+

0xF5FFFA +

+
MistyRose
+

0xFFE4E1 +

+
Moccasin
+

0xFFE4B5 +

+
NavajoWhite
+

0xFFDEAD +

+
Navy
+

0x000080 +

+
OldLace
+

0xFDF5E6 +

+
Olive
+

0x808000 +

+
OliveDrab
+

0x6B8E23 +

+
Orange
+

0xFFA500 +

+
OrangeRed
+

0xFF4500 +

+
Orchid
+

0xDA70D6 +

+
PaleGoldenRod
+

0xEEE8AA +

+
PaleGreen
+

0x98FB98 +

+
PaleTurquoise
+

0xAFEEEE +

+
PaleVioletRed
+

0xD87093 +

+
PapayaWhip
+

0xFFEFD5 +

+
PeachPuff
+

0xFFDAB9 +

+
Peru
+

0xCD853F +

+
Pink
+

0xFFC0CB +

+
Plum
+

0xDDA0DD +

+
PowderBlue
+

0xB0E0E6 +

+
Purple
+

0x800080 +

+
Red
+

0xFF0000 +

+
RosyBrown
+

0xBC8F8F +

+
RoyalBlue
+

0x4169E1 +

+
SaddleBrown
+

0x8B4513 +

+
Salmon
+

0xFA8072 +

+
SandyBrown
+

0xF4A460 +

+
SeaGreen
+

0x2E8B57 +

+
SeaShell
+

0xFFF5EE +

+
Sienna
+

0xA0522D +

+
Silver
+

0xC0C0C0 +

+
SkyBlue
+

0x87CEEB +

+
SlateBlue
+

0x6A5ACD +

+
SlateGray
+

0x708090 +

+
Snow
+

0xFFFAFA +

+
SpringGreen
+

0x00FF7F +

+
SteelBlue
+

0x4682B4 +

+
Tan
+

0xD2B48C +

+
Teal
+

0x008080 +

+
Thistle
+

0xD8BFD8 +

+
Tomato
+

0xFF6347 +

+
Turquoise
+

0x40E0D0 +

+
Violet
+

0xEE82EE +

+
Wheat
+

0xF5DEB3 +

+
White
+

0xFFFFFF +

+
WhiteSmoke
+

0xF5F5F5 +

+
Yellow
+

0xFFFF00 +

+
YellowGreen
+

0x9ACD32 +

+
+ +
+
+

2.8 Channel Layout

+ +

A channel layout specifies the spatial disposition of the channels in +a multi-channel audio stream. To specify a channel layout, FFmpeg +makes use of a special syntax. +

+

Individual channels are identified by an id, as given by the table +below: +

+
FL
+

front left +

+
FR
+

front right +

+
FC
+

front center +

+
LFE
+

low frequency +

+
BL
+

back left +

+
BR
+

back right +

+
FLC
+

front left-of-center +

+
FRC
+

front right-of-center +

+
BC
+

back center +

+
SL
+

side left +

+
SR
+

side right +

+
TC
+

top center +

+
TFL
+

top front left +

+
TFC
+

top front center +

+
TFR
+

top front right +

+
TBL
+

top back left +

+
TBC
+

top back center +

+
TBR
+

top back right +

+
DL
+

downmix left +

+
DR
+

downmix right +

+
WL
+

wide left +

+
WR
+

wide right +

+
SDL
+

surround direct left +

+
SDR
+

surround direct right +

+
LFE2
+

low frequency 2 +

+
+ +

Standard channel layout compositions can be specified by using the +following identifiers: +

+
mono
+

FC +

+
stereo
+

FL+FR +

+
2.1
+

FL+FR+LFE +

+
3.0
+

FL+FR+FC +

+
3.0(back)
+

FL+FR+BC +

+
4.0
+

FL+FR+FC+BC +

+
quad
+

FL+FR+BL+BR +

+
quad(side)
+

FL+FR+SL+SR +

+
3.1
+

FL+FR+FC+LFE +

+
5.0
+

FL+FR+FC+BL+BR +

+
5.0(side)
+

FL+FR+FC+SL+SR +

+
4.1
+

FL+FR+FC+LFE+BC +

+
5.1
+

FL+FR+FC+LFE+BL+BR +

+
5.1(side)
+

FL+FR+FC+LFE+SL+SR +

+
6.0
+

FL+FR+FC+BC+SL+SR +

+
6.0(front)
+

FL+FR+FLC+FRC+SL+SR +

+
hexagonal
+

FL+FR+FC+BL+BR+BC +

+
6.1
+

FL+FR+FC+LFE+BC+SL+SR +

+
6.1
+

FL+FR+FC+LFE+BL+BR+BC +

+
6.1(front)
+

FL+FR+LFE+FLC+FRC+SL+SR +

+
7.0
+

FL+FR+FC+BL+BR+SL+SR +

+
7.0(front)
+

FL+FR+FC+FLC+FRC+SL+SR +

+
7.1
+

FL+FR+FC+LFE+BL+BR+SL+SR +

+
7.1(wide)
+

FL+FR+FC+LFE+BL+BR+FLC+FRC +

+
7.1(wide-side)
+

FL+FR+FC+LFE+FLC+FRC+SL+SR +

+
7.1(top)
+

FL+FR+FC+LFE+BL+BR+TFL+TFR +

+
octagonal
+

FL+FR+FC+BL+BR+BC+SL+SR +

+
cube
+

FL+FR+BL+BR+TFL+TFR+TBL+TBR +

+
hexadecagonal
+

FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR +

+
downmix
+

DL+DR +

+
22.2
+

FL+FR+FC+LFE+BL+BR+FLC+FRC+BC+SL+SR+TC+TFL+TFC+TFR+TBL+TBC+TBR+LFE2+TSL+TSR+BFC+BFL+BFR +

+
+ +

A custom channel layout can be specified as a sequence of terms, separated by ’+’. +Each term can be: +

    +
  • the name of a single channel (e.g. ‘FL’, ‘FR’, ‘FC’, ‘LFE’, etc.), +each optionally containing a custom name after a ’@’, (e.g. ‘FL@Left’, +‘FR@Right’, ‘FC@Center’, ‘LFE@Low_Frequency’, etc.) +
+ +

A standard channel layout can be specified by the following: +

    +
  • the name of a single channel (e.g. ‘FL’, ‘FR’, ‘FC’, ‘LFE’, etc.) + +
  • the name of a standard channel layout (e.g. ‘mono’, +‘stereo’, ‘4.0’, ‘quad’, ‘5.0’, etc.) + +
  • a number of channels, in decimal, followed by ’c’, yielding the default channel +layout for that number of channels (see the function +av_channel_layout_default). Note that not all channel counts have a +default layout. + +
  • a number of channels, in decimal, followed by ’C’, yielding an unknown channel +layout with the specified number of channels. Note that not all channel layout +specification strings support unknown channel layouts. + +
  • a channel layout mask, in hexadecimal starting with "0x" (see the +AV_CH_* macros in libavutil/channel_layout.h. +
+ +

Before libavutil version 53 the trailing character "c" to specify a number of +channels was optional, but now it is required, while a channel layout mask can +also be specified as a decimal number (if and only if not followed by "c" or "C"). +

+

See also the function av_channel_layout_from_string defined in +libavutil/channel_layout.h. +

+
+
+
+

3 Expression Evaluation

+ +

When evaluating an arithmetic expression, FFmpeg uses an internal +formula evaluator, implemented through the libavutil/eval.h +interface. +

+

An expression may contain unary, binary operators, constants, and +functions. +

+

Two expressions expr1 and expr2 can be combined to form +another expression "expr1;expr2". +expr1 and expr2 are evaluated in turn, and the new +expression evaluates to the value of expr2. +

+

The following binary operators are available: +, -, +*, /, ^. +

+

The following unary operators are available: +, -. +

+

The following functions are available: +

+
abs(x)
+

Compute absolute value of x. +

+
+
acos(x)
+

Compute arccosine of x. +

+
+
asin(x)
+

Compute arcsine of x. +

+
+
atan(x)
+

Compute arctangent of x. +

+
+
atan2(x, y)
+

Compute principal value of the arc tangent of y/x. +

+
+
between(x, min, max)
+

Return 1 if x is greater than or equal to min and lesser than or +equal to max, 0 otherwise. +

+
+
bitand(x, y)
+
bitor(x, y)
+

Compute bitwise and/or operation on x and y. +

+

The results of the evaluation of x and y are converted to +integers before executing the bitwise operation. +

+

Note that both the conversion to integer and the conversion back to +floating point can lose precision. Beware of unexpected results for +large numbers (usually 2^53 and larger). +

+
+
ceil(expr)
+

Round the value of expression expr upwards to the nearest +integer. For example, "ceil(1.5)" is "2.0". +

+
+
clip(x, min, max)
+

Return the value of x clipped between min and max. +

+
+
cos(x)
+

Compute cosine of x. +

+
+
cosh(x)
+

Compute hyperbolic cosine of x. +

+
+
eq(x, y)
+

Return 1 if x and y are equivalent, 0 otherwise. +

+
+
exp(x)
+

Compute exponential of x (with base e, the Euler’s number). +

+
+
floor(expr)
+

Round the value of expression expr downwards to the nearest +integer. For example, "floor(-1.5)" is "-2.0". +

+
+
gauss(x)
+

Compute Gauss function of x, corresponding to +exp(-x*x/2) / sqrt(2*PI). +

+
+
gcd(x, y)
+

Return the greatest common divisor of x and y. If both x and +y are 0 or either or both are less than zero then behavior is undefined. +

+
+
gt(x, y)
+

Return 1 if x is greater than y, 0 otherwise. +

+
+
gte(x, y)
+

Return 1 if x is greater than or equal to y, 0 otherwise. +

+
+
hypot(x, y)
+

This function is similar to the C function with the same name; it returns +"sqrt(x*x + y*y)", the length of the hypotenuse of a +right triangle with sides of length x and y, or the distance of the +point (x, y) from the origin. +

+
+
if(x, y)
+

Evaluate x, and if the result is non-zero return the result of +the evaluation of y, return 0 otherwise. +

+
+
if(x, y, z)
+

Evaluate x, and if the result is non-zero return the evaluation +result of y, otherwise the evaluation result of z. +

+
+
ifnot(x, y)
+

Evaluate x, and if the result is zero return the result of the +evaluation of y, return 0 otherwise. +

+
+
ifnot(x, y, z)
+

Evaluate x, and if the result is zero return the evaluation +result of y, otherwise the evaluation result of z. +

+
+
isinf(x)
+

Return 1.0 if x is +/-INFINITY, 0.0 otherwise. +

+
+
isnan(x)
+

Return 1.0 if x is NAN, 0.0 otherwise. +

+
+
ld(var)
+

Load the value of the internal variable with number +var, which was previously stored with st(var, expr). +The function returns the loaded value. +

+
+
lerp(x, y, z)
+

Return linear interpolation between x and y by amount of z. +

+
+
log(x)
+

Compute natural logarithm of x. +

+
+
lt(x, y)
+

Return 1 if x is lesser than y, 0 otherwise. +

+
+
lte(x, y)
+

Return 1 if x is lesser than or equal to y, 0 otherwise. +

+
+
max(x, y)
+

Return the maximum between x and y. +

+
+
min(x, y)
+

Return the minimum between x and y. +

+
+
mod(x, y)
+

Compute the remainder of division of x by y. +

+
+
not(expr)
+

Return 1.0 if expr is zero, 0.0 otherwise. +

+
+
pow(x, y)
+

Compute the power of x elevated y, it is equivalent to +"(x)^(y)". +

+
+
print(t)
+
print(t, l)
+

Print the value of expression t with loglevel l. If +l is not specified then a default log level is used. +Returns the value of the expression printed. +

+

Prints t with loglevel l +

+
+
random(x)
+

Return a pseudo random value between 0.0 and 1.0. x is the index of the +internal variable which will be used to save the seed/state. +

+
+
root(expr, max)
+

Find an input value for which the function represented by expr +with argument ld(0) is 0 in the interval 0..max. +

+

The expression in expr must denote a continuous function or the +result is undefined. +

+

ld(0) is used to represent the function input value, which means +that the given expression will be evaluated multiple times with +various input values that the expression can access through +ld(0). When the expression evaluates to 0 then the +corresponding input value will be returned. +

+
+
round(expr)
+

Round the value of expression expr to the nearest integer. For example, "round(1.5)" is "2.0". +

+
+
sgn(x)
+

Compute sign of x. +

+
+
sin(x)
+

Compute sine of x. +

+
+
sinh(x)
+

Compute hyperbolic sine of x. +

+
+
sqrt(expr)
+

Compute the square root of expr. This is equivalent to +"(expr)^.5". +

+
+
squish(x)
+

Compute expression 1/(1 + exp(4*x)). +

+
+
st(var, expr)
+

Store the value of the expression expr in an internal +variable. var specifies the number of the variable where to +store the value, and it is a value ranging from 0 to 9. The function +returns the value stored in the internal variable. +Note, Variables are currently not shared between expressions. +

+
+
tan(x)
+

Compute tangent of x. +

+
+
tanh(x)
+

Compute hyperbolic tangent of x. +

+
+
taylor(expr, x)
+
taylor(expr, x, id)
+

Evaluate a Taylor series at x, given an expression representing +the ld(id)-th derivative of a function at 0. +

+

When the series does not converge the result is undefined. +

+

ld(id) is used to represent the derivative order in expr, +which means that the given expression will be evaluated multiple times +with various input values that the expression can access through +ld(id). If id is not specified then 0 is assumed. +

+

Note, when you have the derivatives at y instead of 0, +taylor(expr, x-y) can be used. +

+
+
time(0)
+

Return the current (wallclock) time in seconds. +

+
+
trunc(expr)
+

Round the value of expression expr towards zero to the nearest +integer. For example, "trunc(-1.5)" is "-1.0". +

+
+
while(cond, expr)
+

Evaluate expression expr while the expression cond is +non-zero, and returns the value of the last expr evaluation, or +NAN if cond was always false. +

+
+ +

The following constants are available: +

+
PI
+

area of the unit disc, approximately 3.14 +

+
E
+

exp(1) (Euler’s number), approximately 2.718 +

+
PHI
+

golden ratio (1+sqrt(5))/2, approximately 1.618 +

+
+ +

Assuming that an expression is considered "true" if it has a non-zero +value, note that: +

+

* works like AND +

+

+ works like OR +

+

For example the construct: +

+
if (A AND B) then C
+
+

is equivalent to: +

+
if(A*B, C)
+
+ +

In your C code, you can extend the list of unary and binary functions, +and define recognized constants, so that they are available for your +expressions. +

+

The evaluator also recognizes the International System unit prefixes. +If ’i’ is appended after the prefix, binary prefixes are used, which +are based on powers of 1024 instead of powers of 1000. +The ’B’ postfix multiplies the value by 8, and can be appended after a +unit prefix or used alone. This allows using for example ’KB’, ’MiB’, +’G’ and ’B’ as number postfix. +

+

The list of available International System prefixes follows, with +indication of the corresponding powers of 10 and of 2. +

+
y
+

10^-24 / 2^-80 +

+
z
+

10^-21 / 2^-70 +

+
a
+

10^-18 / 2^-60 +

+
f
+

10^-15 / 2^-50 +

+
p
+

10^-12 / 2^-40 +

+
n
+

10^-9 / 2^-30 +

+
u
+

10^-6 / 2^-20 +

+
m
+

10^-3 / 2^-10 +

+
c
+

10^-2 +

+
d
+

10^-1 +

+
h
+

10^2 +

+
k
+

10^3 / 2^10 +

+
K
+

10^3 / 2^10 +

+
M
+

10^6 / 2^20 +

+
G
+

10^9 / 2^30 +

+
T
+

10^12 / 2^40 +

+
P
+

10^15 / 2^50 +

+
E
+

10^18 / 2^60 +

+
Z
+

10^21 / 2^70 +

+
Y
+

10^24 / 2^80 +

+
+ + +
+
+

4 See Also

+ +

ffmpeg, ffplay, ffprobe, +libavutil +

+ +
+
+

5 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg.html b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg.html new file mode 100644 index 0000000000000000000000000000000000000000..fd50f808e87c5a2530840f48007992b476067d61 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffmpeg.html @@ -0,0 +1,3403 @@ + + + + + +ffmpeg Documentation + + + + + + + + + + + + + + + + + +
+ + + +
+

1 Synopsis

+ +

ffmpeg [global_options] {[input_file_options] -i input_url} ... {[output_file_options] output_url} ... +

+
+
+

2 Description

+ +

ffmpeg is a universal media converter. It can read a wide variety of +inputs - including live grabbing/recording devices - filter, and transcode them +into a plethora of output formats. +

+

ffmpeg reads from an arbitrary number of input "files" (which can be regular +files, pipes, network streams, grabbing devices, etc.), specified by the +-i option, and writes to an arbitrary number of output "files", which are +specified by a plain output url. Anything found on the command line which +cannot be interpreted as an option is considered to be an output url. +

+

Each input or output url can, in principle, contain any number of streams of +different types (video/audio/subtitle/attachment/data). The allowed number and/or +types of streams may be limited by the container format. Selecting which +streams from which inputs will go into which output is either done automatically +or with the -map option (see the Stream selection chapter). +

+

To refer to input files in options, you must use their indices (0-based). E.g. +the first input file is 0, the second is 1, etc. Similarly, streams +within a file are referred to by their indices. E.g. 2:3 refers to the +fourth stream in the third input file. Also see the Stream specifiers chapter. +

+

As a general rule, options are applied to the next specified +file. Therefore, order is important, and you can have the same +option on the command line multiple times. Each occurrence is +then applied to the next input or output file. +Exceptions from this rule are the global options (e.g. verbosity level), +which should be specified first. +

+

Do not mix input and output files – first specify all input files, then all +output files. Also do not mix options which belong to different files. All +options apply ONLY to the next input or output file and are reset between files. +

+

Some simple examples follow. +

+
    +
  • Convert an input media file to a different format, by re-encoding media streams: +
    +
    ffmpeg -i input.avi output.mp4
    +
    + +
  • Set the video bitrate of the output file to 64 kbit/s: +
    +
    ffmpeg -i input.avi -b:v 64k -bufsize 64k output.mp4
    +
    + +
  • Force the frame rate of the output file to 24 fps: +
    +
    ffmpeg -i input.avi -r 24 output.mp4
    +
    + +
  • Force the frame rate of the input file (valid for raw formats only) to 1 fps and +the frame rate of the output file to 24 fps: +
    +
    ffmpeg -r 1 -i input.m2v -r 24 output.mp4
    +
    +
+ +

The format option may be needed for raw input files. +

+ +
+
+

3 Detailed description

+ +

The transcoding process in ffmpeg for each output can be described by +the following diagram: +

+
 _______              ______________
+|       |            |              |
+| input |  demuxer   | encoded data |   decoder
+| file  | ---------> | packets      | -----+
+|_______|            |______________|      |
+                                           v
+                                       _________
+                                      |         |
+                                      | decoded |
+                                      | frames  |
+                                      |_________|
+ ________             ______________       |
+|        |           |              |      |
+| output | <-------- | encoded data | <----+
+| file   |   muxer   | packets      |   encoder
+|________|           |______________|
+
+
+
+

ffmpeg calls the libavformat library (containing demuxers) to read +input files and get packets containing encoded data from them. When there are +multiple input files, ffmpeg tries to keep them synchronized by +tracking lowest timestamp on any active input stream. +

+

Encoded packets are then passed to the decoder (unless streamcopy is selected +for the stream, see further for a description). The decoder produces +uncompressed frames (raw video/PCM audio/...) which can be processed further by +filtering (see next section). After filtering, the frames are passed to the +encoder, which encodes them and outputs encoded packets. Finally those are +passed to the muxer, which writes the encoded packets to the output file. +

+ +
+

3.1 Filtering

+

Before encoding, ffmpeg can process raw audio and video frames using +filters from the libavfilter library. Several chained filters form a filter +graph. ffmpeg distinguishes between two types of filtergraphs: +simple and complex. +

+ +
+

3.1.1 Simple filtergraphs

+

Simple filtergraphs are those that have exactly one input and output, both of +the same type. In the above diagram they can be represented by simply inserting +an additional step between decoding and encoding: +

+
 _________                        ______________
+|         |                      |              |
+| decoded |                      | encoded data |
+| frames  |\                   _ | packets      |
+|_________| \                  /||______________|
+             \   __________   /
+  simple     _\||          | /  encoder
+  filtergraph   | filtered |/
+                | frames   |
+                |__________|
+
+
+

Simple filtergraphs are configured with the per-stream -filter option +(with -vf and -af aliases for video and audio respectively). +A simple filtergraph for video can look for example like this: +

+
 _______        _____________        _______        ________
+|       |      |             |      |       |      |        |
+| input | ---> | deinterlace | ---> | scale | ---> | output |
+|_______|      |_____________|      |_______|      |________|
+
+
+

Note that some filters change frame properties but not frame contents. E.g. the +fps filter in the example above changes number of frames, but does not +touch the frame contents. Another example is the setpts filter, which +only sets timestamps and otherwise passes the frames unchanged. +

+
+
+

3.1.2 Complex filtergraphs

+

Complex filtergraphs are those which cannot be described as simply a linear +processing chain applied to one stream. This is the case, for example, when the graph has +more than one input and/or output, or when output stream type is different from +input. They can be represented with the following diagram: +

+
 _________
+|         |
+| input 0 |\                    __________
+|_________| \                  |          |
+             \   _________    /| output 0 |
+              \ |         |  / |__________|
+ _________     \| complex | /
+|         |     |         |/
+| input 1 |---->| filter  |\
+|_________|     |         | \   __________
+               /| graph   |  \ |          |
+              / |         |   \| output 1 |
+ _________   /  |_________|    |__________|
+|         | /
+| input 2 |/
+|_________|
+
+
+

Complex filtergraphs are configured with the -filter_complex option. +Note that this option is global, since a complex filtergraph, by its nature, +cannot be unambiguously associated with a single stream or file. +

+

The -lavfi option is equivalent to -filter_complex. +

+

A trivial example of a complex filtergraph is the overlay filter, which +has two video inputs and one video output, containing one video overlaid on top +of the other. Its audio counterpart is the amix filter. +

+
+
+
+

3.2 Stream copy

+

Stream copy is a mode selected by supplying the copy parameter to the +-codec option. It makes ffmpeg omit the decoding and encoding +step for the specified stream, so it does only demuxing and muxing. It is useful +for changing the container format or modifying container-level metadata. The +diagram above will, in this case, simplify to this: +

+
 _______              ______________            ________
+|       |            |              |          |        |
+| input |  demuxer   | encoded data |  muxer   | output |
+| file  | ---------> | packets      | -------> | file   |
+|_______|            |______________|          |________|
+
+
+

Since there is no decoding or encoding, it is very fast and there is no quality +loss. However, it might not work in some cases because of many factors. Applying +filters is obviously also impossible, since filters work on uncompressed data. +

+ +
+
+
+

4 Stream selection

+ +

ffmpeg provides the -map option for manual control of stream selection in each +output file. Users can skip -map and let ffmpeg perform automatic stream selection as +described below. The -vn / -an / -sn / -dn options can be used to skip inclusion of +video, audio, subtitle and data streams respectively, whether manually mapped or automatically +selected, except for those streams which are outputs of complex filtergraphs. +

+ +
+

4.1 Description

+

The sub-sections that follow describe the various rules that are involved in stream selection. +The examples that follow next show how these rules are applied in practice. +

+

While every effort is made to accurately reflect the behavior of the program, FFmpeg is under +continuous development and the code may have changed since the time of this writing. +

+ +
+

4.1.1 Automatic stream selection

+ +

In the absence of any map options for a particular output file, ffmpeg inspects the output +format to check which type of streams can be included in it, viz. video, audio and/or +subtitles. For each acceptable stream type, ffmpeg will pick one stream, when available, +from among all the inputs. +

+

It will select that stream based upon the following criteria: +

    +
  • for video, it is the stream with the highest resolution, +
  • for audio, it is the stream with the most channels, +
  • for subtitles, it is the first subtitle stream found but there’s a caveat. +The output format’s default subtitle encoder can be either text-based or image-based, +and only a subtitle stream of the same type will be chosen. +
+ +

In the case where several streams of the same type rate equally, the stream with the lowest +index is chosen. +

+

Data or attachment streams are not automatically selected and can only be included +using -map. +

+
+

4.1.2 Manual stream selection

+ +

When -map is used, only user-mapped streams are included in that output file, +with one possible exception for filtergraph outputs described below. +

+
+
+

4.1.3 Complex filtergraphs

+ +

If there are any complex filtergraph output streams with unlabeled pads, they will be added +to the first output file. This will lead to a fatal error if the stream type is not supported +by the output format. In the absence of the map option, the inclusion of these streams leads +to the automatic stream selection of their types being skipped. If map options are present, +these filtergraph streams are included in addition to the mapped streams. +

+

Complex filtergraph output streams with labeled pads must be mapped once and exactly once. +

+
+
+

4.1.4 Stream handling

+ +

Stream handling is independent of stream selection, with an exception for subtitles described +below. Stream handling is set via the -codec option addressed to streams within a +specific output file. In particular, codec options are applied by ffmpeg after the +stream selection process and thus do not influence the latter. If no -codec option is +specified for a stream type, ffmpeg will select the default encoder registered by the output +file muxer. +

+

An exception exists for subtitles. If a subtitle encoder is specified for an output file, the +first subtitle stream found of any type, text or image, will be included. ffmpeg does not validate +if the specified encoder can convert the selected stream or if the converted stream is acceptable +within the output format. This applies generally as well: when the user sets an encoder manually, +the stream selection process cannot check if the encoded stream can be muxed into the output file. +If it cannot, ffmpeg will abort and all output files will fail to be processed. +

+
+
+
+

4.2 Examples

+ +

The following examples illustrate the behavior, quirks and limitations of ffmpeg’s stream +selection methods. +

+

They assume the following three input files. +

+
+input file 'A.avi'
+      stream 0: video 640x360
+      stream 1: audio 2 channels
+
+input file 'B.mp4'
+      stream 0: video 1920x1080
+      stream 1: audio 2 channels
+      stream 2: subtitles (text)
+      stream 3: audio 5.1 channels
+      stream 4: subtitles (text)
+
+input file 'C.mkv'
+      stream 0: video 1280x720
+      stream 1: audio 2 channels
+      stream 2: subtitles (image)
+
+

Example: automatic stream selection

+
+
ffmpeg -i A.avi -i B.mp4 out1.mkv out2.wav -map 1:a -c:a copy out3.mov
+
+

There are three output files specified, and for the first two, no -map options +are set, so ffmpeg will select streams for these two files automatically. +

+

out1.mkv is a Matroska container file and accepts video, audio and subtitle streams, +so ffmpeg will try to select one of each type.
+For video, it will select stream 0 from B.mp4, which has the highest +resolution among all the input video streams.
+For audio, it will select stream 3 from B.mp4, since it has the greatest +number of channels.
+For subtitles, it will select stream 2 from B.mp4, which is the first subtitle +stream from among A.avi and B.mp4. +

+

out2.wav accepts only audio streams, so only stream 3 from B.mp4 is +selected. +

+

For out3.mov, since a -map option is set, no automatic stream selection will +occur. The -map 1:a option will select all audio streams from the second input +B.mp4. No other streams will be included in this output file. +

+

For the first two outputs, all included streams will be transcoded. The encoders chosen will +be the default ones registered by each output format, which may not match the codec of the +selected input streams. +

+

For the third output, codec option for audio streams has been set +to copy, so no decoding-filtering-encoding operations will occur, or can occur. +Packets of selected streams shall be conveyed from the input file and muxed within the output +file. +

+

Example: automatic subtitles selection

+
+
ffmpeg -i C.mkv out1.mkv -c:s dvdsub -an out2.mkv
+
+

Although out1.mkv is a Matroska container file which accepts subtitle streams, only a +video and audio stream shall be selected. The subtitle stream of C.mkv is image-based +and the default subtitle encoder of the Matroska muxer is text-based, so a transcode operation +for the subtitles is expected to fail and hence the stream isn’t selected. However, in +out2.mkv, a subtitle encoder is specified in the command and so, the subtitle stream is +selected, in addition to the video stream. The presence of -an disables audio stream +selection for out2.mkv. +

+

Example: unlabeled filtergraph outputs

+
+
ffmpeg -i A.avi -i C.mkv -i B.mp4 -filter_complex "overlay" out1.mp4 out2.srt
+
+

A filtergraph is setup here using the -filter_complex option and consists of a single +video filter. The overlay filter requires exactly two video inputs, but none are +specified, so the first two available video streams are used, those of A.avi and +C.mkv. The output pad of the filter has no label and so is sent to the first output file +out1.mp4. Due to this, automatic selection of the video stream is skipped, which would +have selected the stream in B.mp4. The audio stream with most channels viz. stream 3 +in B.mp4, is chosen automatically. No subtitle stream is chosen however, since the MP4 +format has no default subtitle encoder registered, and the user hasn’t specified a subtitle encoder. +

+

The 2nd output file, out2.srt, only accepts text-based subtitle streams. So, even though +the first subtitle stream available belongs to C.mkv, it is image-based and hence skipped. +The selected stream, stream 2 in B.mp4, is the first text-based subtitle stream. +

+

Example: labeled filtergraph outputs

+
+
ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex "[1:v]hue=s=0[outv];overlay;aresample" \
+       -map '[outv]' -an        out1.mp4 \
+                                out2.mkv \
+       -map '[outv]' -map 1:a:0 out3.mkv
+
+ +

The above command will fail, as the output pad labelled [outv] has been mapped twice. +None of the output files shall be processed. +

+
+
ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex "[1:v]hue=s=0[outv];overlay;aresample" \
+       -an        out1.mp4 \
+                  out2.mkv \
+       -map 1:a:0 out3.mkv
+
+ +

This command above will also fail as the hue filter output has a label, [outv], +and hasn’t been mapped anywhere. +

+

The command should be modified as follows, +

+
ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex "[1:v]hue=s=0,split=2[outv1][outv2];overlay;aresample" \
+        -map '[outv1]' -an        out1.mp4 \
+                                  out2.mkv \
+        -map '[outv2]' -map 1:a:0 out3.mkv
+
+

The video stream from B.mp4 is sent to the hue filter, whose output is cloned once using +the split filter, and both outputs labelled. Then a copy each is mapped to the first and third +output files. +

+

The overlay filter, requiring two video inputs, uses the first two unused video streams. Those +are the streams from A.avi and C.mkv. The overlay output isn’t labelled, so it is +sent to the first output file out1.mp4, regardless of the presence of the -map option. +

+

The aresample filter is sent the first unused audio stream, that of A.avi. Since this filter +output is also unlabelled, it too is mapped to the first output file. The presence of -an +only suppresses automatic or manual stream selection of audio streams, not outputs sent from +filtergraphs. Both these mapped streams shall be ordered before the mapped stream in out1.mp4. +

+

The video, audio and subtitle streams mapped to out2.mkv are entirely determined by +automatic stream selection. +

+

out3.mkv consists of the cloned video output from the hue filter and the first audio +stream from B.mp4. +
+

+ +
+
+
+

5 Options

+ +

All the numerical options, if not specified otherwise, accept a string +representing a number as input, which may be followed by one of the SI +unit prefixes, for example: ’K’, ’M’, or ’G’. +

+

If ’i’ is appended to the SI unit prefix, the complete prefix will be +interpreted as a unit prefix for binary multiples, which are based on +powers of 1024 instead of powers of 1000. Appending ’B’ to the SI unit +prefix multiplies the value by 8. This allows using, for example: +’KB’, ’MiB’, ’G’ and ’B’ as number suffixes. +

+

Options which do not take arguments are boolean options, and set the +corresponding value to true. They can be set to false by prefixing +the option name with "no". For example using "-nofoo" +will set the boolean option with name "foo" to false. +

+ +
+

5.1 Stream specifiers

+

Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers +are used to precisely specify which stream(s) a given option belongs to. +

+

A stream specifier is a string generally appended to the option name and +separated from it by a colon. E.g. -codec:a:1 ac3 contains the +a:1 stream specifier, which matches the second audio stream. Therefore, it +would select the ac3 codec for the second audio stream. +

+

A stream specifier can match several streams, so that the option is applied to all +of them. E.g. the stream specifier in -b:a 128k matches all audio +streams. +

+

An empty stream specifier matches all streams. For example, -codec copy +or -codec: copy would copy all the streams without reencoding. +

+

Possible forms of stream specifiers are: +

+
stream_index
+

Matches the stream with this index. E.g. -threads:1 4 would set the +thread count for the second stream to 4. If stream_index is used as an +additional stream specifier (see below), then it selects stream number +stream_index from the matching streams. Stream numbering is based on the +order of the streams as detected by libavformat except when a program ID is +also specified. In this case it is based on the ordering of the streams in the +program. +

+
stream_type[:additional_stream_specifier]
+

stream_type is one of following: ’v’ or ’V’ for video, ’a’ for audio, ’s’ +for subtitle, ’d’ for data, and ’t’ for attachments. ’v’ matches all video +streams, ’V’ only matches video streams which are not attached pictures, video +thumbnails or cover arts. If additional_stream_specifier is used, then +it matches streams which both have this type and match the +additional_stream_specifier. Otherwise, it matches all streams of the +specified type. +

+
p:program_id[:additional_stream_specifier]
+

Matches streams which are in the program with the id program_id. If +additional_stream_specifier is used, then it matches streams which both +are part of the program and match the additional_stream_specifier. +

+
+
#stream_id or i:stream_id
+

Match the stream by stream id (e.g. PID in MPEG-TS container). +

+
m:key[:value]
+

Matches streams with the metadata tag key having the specified value. If +value is not given, matches streams that contain the given tag with any +value. +

+
u
+

Matches streams with usable configuration, the codec must be defined and the +essential information such as video dimension or audio sample rate must be present. +

+

Note that in ffmpeg, matching by metadata will only work properly for +input files. +

+
+ +
+
+

5.2 Generic options

+ +

These options are shared amongst the ff* tools. +

+
+
-L
+

Show license. +

+
+
-h, -?, -help, --help [arg]
+

Show help. An optional parameter may be specified to print help about a specific +item. If no argument is specified, only basic (non advanced) tool +options are shown. +

+

Possible values of arg are: +

+
long
+

Print advanced tool options in addition to the basic tool options. +

+
+
full
+

Print complete list of options, including shared and private options +for encoders, decoders, demuxers, muxers, filters, etc. +

+
+
decoder=decoder_name
+

Print detailed information about the decoder named decoder_name. Use the +-decoders option to get a list of all decoders. +

+
+
encoder=encoder_name
+

Print detailed information about the encoder named encoder_name. Use the +-encoders option to get a list of all encoders. +

+
+
demuxer=demuxer_name
+

Print detailed information about the demuxer named demuxer_name. Use the +-formats option to get a list of all demuxers and muxers. +

+
+
muxer=muxer_name
+

Print detailed information about the muxer named muxer_name. Use the +-formats option to get a list of all muxers and demuxers. +

+
+
filter=filter_name
+

Print detailed information about the filter named filter_name. Use the +-filters option to get a list of all filters. +

+
+
bsf=bitstream_filter_name
+

Print detailed information about the bitstream filter named bitstream_filter_name. +Use the -bsfs option to get a list of all bitstream filters. +

+
+
protocol=protocol_name
+

Print detailed information about the protocol named protocol_name. +Use the -protocols option to get a list of all protocols. +

+
+ +
+
-version
+

Show version. +

+
+
-buildconf
+

Show the build configuration, one option per line. +

+
+
-formats
+

Show available formats (including devices). +

+
+
-demuxers
+

Show available demuxers. +

+
+
-muxers
+

Show available muxers. +

+
+
-devices
+

Show available devices. +

+
+
-codecs
+

Show all codecs known to libavcodec. +

+

Note that the term ’codec’ is used throughout this documentation as a shortcut +for what is more correctly called a media bitstream format. +

+
+
-decoders
+

Show available decoders. +

+
+
-encoders
+

Show all available encoders. +

+
+
-bsfs
+

Show available bitstream filters. +

+
+
-protocols
+

Show available protocols. +

+
+
-filters
+

Show available libavfilter filters. +

+
+
-pix_fmts
+

Show available pixel formats. +

+
+
-sample_fmts
+

Show available sample formats. +

+
+
-layouts
+

Show channel names and standard channel layouts. +

+
+
-dispositions
+

Show stream dispositions. +

+
+
-colors
+

Show recognized color names. +

+
+
-sources device[,opt1=val1[,opt2=val2]...]
+

Show autodetected sources of the input device. +Some devices may provide system-dependent source names that cannot be autodetected. +The returned list cannot be assumed to be always complete. +

+
ffmpeg -sources pulse,server=192.168.0.4
+
+ +
+
-sinks device[,opt1=val1[,opt2=val2]...]
+

Show autodetected sinks of the output device. +Some devices may provide system-dependent sink names that cannot be autodetected. +The returned list cannot be assumed to be always complete. +

+
ffmpeg -sinks pulse,server=192.168.0.4
+
+ +
+
-loglevel [flags+]loglevel | -v [flags+]loglevel
+

Set logging level and flags used by the library. +

+

The optional flags prefix can consist of the following values: +

+
repeat
+

Indicates that repeated log output should not be compressed to the first line +and the "Last message repeated n times" line will be omitted. +

+
level
+

Indicates that log output should add a [level] prefix to each message +line. This can be used as an alternative to log coloring, e.g. when dumping the +log to file. +

+
+

Flags can also be used alone by adding a ’+’/’-’ prefix to set/reset a single +flag without affecting other flags or changing loglevel. When +setting both flags and loglevel, a ’+’ separator is expected +between the last flags value and before loglevel. +

+

loglevel is a string or a number containing one of the following values: +

+
quiet, -8
+

Show nothing at all; be silent. +

+
panic, 0
+

Only show fatal errors which could lead the process to crash, such as +an assertion failure. This is not currently used for anything. +

+
fatal, 8
+

Only show fatal errors. These are errors after which the process absolutely +cannot continue. +

+
error, 16
+

Show all errors, including ones which can be recovered from. +

+
warning, 24
+

Show all warnings and errors. Any message related to possibly +incorrect or unexpected events will be shown. +

+
info, 32
+

Show informative messages during processing. This is in addition to +warnings and errors. This is the default value. +

+
verbose, 40
+

Same as info, except more verbose. +

+
debug, 48
+

Show everything, including debugging information. +

+
trace, 56
+
+ +

For example to enable repeated log output, add the level prefix, and set +loglevel to verbose: +

+
ffmpeg -loglevel repeat+level+verbose -i input output
+
+

Another example that enables repeated log output without affecting current +state of level prefix flag or loglevel: +

+
ffmpeg [...] -loglevel +repeat
+
+ +

By default the program logs to stderr. If coloring is supported by the +terminal, colors are used to mark errors and warnings. Log coloring +can be disabled setting the environment variable +AV_LOG_FORCE_NOCOLOR, or can be forced setting +the environment variable AV_LOG_FORCE_COLOR. +

+
+
-report
+

Dump full command line and log output to a file named +program-YYYYMMDD-HHMMSS.log in the current +directory. +This file can be useful for bug reports. +It also implies -loglevel debug. +

+

Setting the environment variable FFREPORT to any value has the +same effect. If the value is a ’:’-separated key=value sequence, these +options will affect the report; option values must be escaped if they +contain special characters or the options delimiter ’:’ (see the +“Quoting and escaping” section in the ffmpeg-utils manual). +

+

The following options are recognized: +

+
file
+

set the file name to use for the report; %p is expanded to the name +of the program, %t is expanded to a timestamp, %% is expanded +to a plain % +

+
level
+

set the log verbosity level using a numerical value (see -loglevel). +

+
+ +

For example, to output a report to a file named ffreport.log +using a log level of 32 (alias for log level info): +

+
+
FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
+
+ +

Errors in parsing the environment variable are not fatal, and will not +appear in the report. +

+
+
-hide_banner
+

Suppress printing banner. +

+

All FFmpeg tools will normally show a copyright notice, build options +and library versions. This option can be used to suppress printing +this information. +

+
+
-cpuflags flags (global)
+

Allows setting and clearing cpu flags. This option is intended +for testing. Do not use it unless you know what you’re doing. +

+
ffmpeg -cpuflags -sse+mmx ...
+ffmpeg -cpuflags mmx ...
+ffmpeg -cpuflags 0 ...
+
+

Possible flags for this option are: +

+
x86
+
+
mmx
+
mmxext
+
sse
+
sse2
+
sse2slow
+
sse3
+
sse3slow
+
ssse3
+
atom
+
sse4.1
+
sse4.2
+
avx
+
avx2
+
xop
+
fma3
+
fma4
+
3dnow
+
3dnowext
+
bmi1
+
bmi2
+
cmov
+
+
+
ARM
+
+
armv5te
+
armv6
+
armv6t2
+
vfp
+
vfpv3
+
neon
+
setend
+
+
+
AArch64
+
+
armv8
+
vfp
+
neon
+
+
+
PowerPC
+
+
altivec
+
+
+
Specific Processors
+
+
pentium2
+
pentium3
+
pentium4
+
k6
+
k62
+
athlon
+
athlonxp
+
k8
+
+
+
+ +
+
-cpucount count (global)
+

Override detection of CPU count. This option is intended +for testing. Do not use it unless you know what you’re doing. +

+
ffmpeg -cpucount 2
+
+ +
+
-max_alloc bytes
+

Set the maximum size limit for allocating a block on the heap by ffmpeg’s +family of malloc functions. Exercise extreme caution when using +this option. Don’t use if you do not understand the full consequence of doing so. +Default is INT_MAX. +

+
+ +
+
+

5.3 AVOptions

+ +

These options are provided directly by the libavformat, libavdevice and +libavcodec libraries. To see the list of available AVOptions, use the +-help option. They are separated into two categories: +

+
generic
+

These options can be set for any container, codec or device. Generic options +are listed under AVFormatContext options for containers/devices and under +AVCodecContext options for codecs. +

+
private
+

These options are specific to the given container, device or codec. Private +options are listed under their corresponding containers/devices/codecs. +

+
+ +

For example to write an ID3v2.3 header instead of a default ID3v2.4 to +an MP3 file, use the id3v2_version private option of the MP3 +muxer: +

+
ffmpeg -i input.flac -id3v2_version 3 out.mp3
+
+ +

All codec AVOptions are per-stream, and thus a stream specifier +should be attached to them: +

+
ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4
+
+ +

In the above example, a multichannel audio stream is mapped twice for output. +The first instance is encoded with codec ac3 and bitrate 640k. +The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using +absolute index of the output stream. +

+

Note: the -nooption syntax cannot be used for boolean +AVOptions, use -option 0/-option 1. +

+

Note: the old undocumented way of specifying per-stream AVOptions by +prepending v/a/s to the options name is now obsolete and will be +removed soon. +

+
+
+

5.4 Main options

+ +
+
-f fmt (input/output)
+

Force input or output file format. The format is normally auto detected for input +files and guessed from the file extension for output files, so this option is not +needed in most cases. +

+
+
-i url (input)
+

input file url +

+
+
-y (global)
+

Overwrite output files without asking. +

+
+
-n (global)
+

Do not overwrite output files, and exit immediately if a specified +output file already exists. +

+
+
-stream_loop number (input)
+

Set number of times input stream shall be looped. Loop 0 means no loop, +loop -1 means infinite loop. +

+
+
-recast_media (global)
+

Allow forcing a decoder of a different media type than the one +detected or designated by the demuxer. Useful for decoding media +data muxed as data streams. +

+
+
-c[:stream_specifier] codec (input/output,per-stream)
+
-codec[:stream_specifier] codec (input/output,per-stream)
+

Select an encoder (when used before an output file) or a decoder (when used +before an input file) for one or more streams. codec is the name of a +decoder/encoder or a special value copy (output only) to indicate that +the stream is not to be re-encoded. +

+

For example +

+
ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
+
+

encodes all video streams with libx264 and copies all audio streams. +

+

For each stream, the last matching c option is applied, so +

+
ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
+
+

will copy all the streams except the second video, which will be encoded with +libx264, and the 138th audio, which will be encoded with libvorbis. +

+
+
-t duration (input/output)
+

When used as an input option (before -i), limit the duration of +data read from the input file. +

+

When used as an output option (before an output url), stop writing the +output after its duration reaches duration. +

+

duration must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

-to and -t are mutually exclusive and -t has priority. +

+
+
-to position (input/output)
+

Stop writing the output or reading the input at position. +position must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

-to and -t are mutually exclusive and -t has priority. +

+
+
-fs limit_size (output)
+

Set the file size limit, expressed in bytes. No further chunk of bytes is written +after the limit is exceeded. The size of the output file is slightly more than the +requested file size. +

+
+
-ss position (input/output)
+

When used as an input option (before -i), seeks in this input file to +position. Note that in most formats it is not possible to seek exactly, +so ffmpeg will seek to the closest seek point before position. +When transcoding and -accurate_seek is enabled (the default), this +extra segment between the seek point and position will be decoded and +discarded. When doing stream copy or when -noaccurate_seek is used, it +will be preserved. +

+

When used as an output option (before an output url), decodes but discards +input until the timestamps reach position. +

+

position must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+
+
-sseof position (input)
+
+

Like the -ss option but relative to the "end of file". That is negative +values are earlier in the file, 0 is at EOF. +

+
+
-isync input_index (input)
+

Assign an input as a sync source. +

+

This will take the difference between the start times of the target and reference inputs and +offset the timestamps of the target file by that difference. The source timestamps of the two +inputs should derive from the same clock source for expected results. If copyts is set +then start_at_zero must also be set. If either of the inputs has no starting timestamp +then no sync adjustment is made. +

+

Acceptable values are those that refer to a valid ffmpeg input index. If the sync reference is +the target index itself or -1, then no adjustment is made to target timestamps. A sync +reference may not itself be synced to any other input. +

+

Default value is -1. +

+
+
-itsoffset offset (input)
+

Set the input time offset. +

+

offset must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

The offset is added to the timestamps of the input files. Specifying +a positive offset means that the corresponding streams are delayed by +the time duration specified in offset. +

+
+
-itsscale scale (input,per-stream)
+

Rescale input timestamps. scale should be a floating point number. +

+
+
-timestamp date (output)
+

Set the recording timestamp in the container. +

+

date must be a date specification, +see (ffmpeg-utils)the Date section in the ffmpeg-utils(1) manual. +

+
+
-metadata[:metadata_specifier] key=value (output,per-metadata)
+

Set a metadata key/value pair. +

+

An optional metadata_specifier may be given to set metadata +on streams, chapters or programs. See -map_metadata +documentation for details. +

+

This option overrides metadata set with -map_metadata. It is +also possible to delete metadata by using an empty value. +

+

For example, for setting the title in the output file: +

+
ffmpeg -i in.avi -metadata title="my title" out.flv
+
+ +

To set the language of the first audio stream: +

+
ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
+
+ +
+
-disposition[:stream_specifier] value (output,per-stream)
+

Sets the disposition for a stream. +

+

By default, the disposition is copied from the input stream, unless the output +stream this option applies to is fed by a complex filtergraph - in that case the +disposition is unset by default. +

+

value is a sequence of items separated by ’+’ or ’-’. The first item may +also be prefixed with ’+’ or ’-’, in which case this option modifies the default +value. Otherwise (the first item is not prefixed) this options overrides the +default value. A ’+’ prefix adds the given disposition, ’-’ removes it. It is +also possible to clear the disposition by setting it to 0. +

+

If no -disposition options were specified for an output file, ffmpeg will +automatically set the ’default’ disposition on the first stream of each type, +when there are multiple streams of this type in the output file and no stream of +that type is already marked as default. +

+

The -dispositions option lists the known dispositions. +

+

For example, to make the second audio stream the default stream: +

+
ffmpeg -i in.mkv -c copy -disposition:a:1 default out.mkv
+
+ +

To make the second subtitle stream the default stream and remove the default +disposition from the first subtitle stream: +

+
ffmpeg -i in.mkv -c copy -disposition:s:0 0 -disposition:s:1 default out.mkv
+
+ +

To add an embedded cover/thumbnail: +

+
ffmpeg -i in.mp4 -i IMAGE -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic out.mp4
+
+ +

Not all muxers support embedded thumbnails, and those who do, only support a few formats, like JPEG or PNG. +

+
+
-program [title=title:][program_num=program_num:]st=stream[:st=stream...] (output)
+
+

Creates a program with the specified title, program_num and adds the specified +stream(s) to it. +

+
+
-target type (output)
+

Specify target file type (vcd, svcd, dvd, dv, +dv50). type may be prefixed with pal-, ntsc- or +film- to use the corresponding standard. All the format options +(bitrate, codecs, buffer sizes) are then set automatically. You can just type: +

+
+
ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
+
+ +

Nevertheless you can specify additional options as long as you know +they do not conflict with the standard, as in: +

+
+
ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
+
+ +

The parameters set for each target are as follows. +

+

VCD +

+
pal:
+-f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
+-s 352x288 -r 25
+-codec:v mpeg1video -g 15 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
+-ar 44100 -ac 2
+-codec:a mp2 -b:a 224k
+
+ntsc:
+-f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
+-s 352x240 -r 30000/1001
+-codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
+-ar 44100 -ac 2
+-codec:a mp2 -b:a 224k
+
+film:
+-f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
+-s 352x240 -r 24000/1001
+-codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
+-ar 44100 -ac 2
+-codec:a mp2 -b:a 224k
+
+ +

SVCD +

+
pal:
+-f svcd -packetsize 2324
+-s 480x576 -pix_fmt yuv420p -r 25
+-codec:v mpeg2video -g 15 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
+-ar 44100
+-codec:a mp2 -b:a 224k
+
+ntsc:
+-f svcd -packetsize 2324
+-s 480x480 -pix_fmt yuv420p -r 30000/1001
+-codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
+-ar 44100
+-codec:a mp2 -b:a 224k
+
+film:
+-f svcd -packetsize 2324
+-s 480x480 -pix_fmt yuv420p -r 24000/1001
+-codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
+-ar 44100
+-codec:a mp2 -b:a 224k
+
+ +

DVD +

+
pal:
+-f dvd -muxrate 10080k -packetsize 2048
+-s 720x576 -pix_fmt yuv420p -r 25
+-codec:v mpeg2video -g 15 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
+-ar 48000
+-codec:a ac3 -b:a 448k
+
+ntsc:
+-f dvd -muxrate 10080k -packetsize 2048
+-s 720x480 -pix_fmt yuv420p -r 30000/1001
+-codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
+-ar 48000
+-codec:a ac3 -b:a 448k
+
+film:
+-f dvd -muxrate 10080k -packetsize 2048
+-s 720x480 -pix_fmt yuv420p -r 24000/1001
+-codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
+-ar 48000
+-codec:a ac3 -b:a 448k
+
+ +

DV +

+
pal:
+-f dv
+-s 720x576 -pix_fmt yuv420p -r 25
+-ar 48000 -ac 2
+
+ntsc:
+-f dv
+-s 720x480 -pix_fmt yuv411p -r 30000/1001
+-ar 48000 -ac 2
+
+film:
+-f dv
+-s 720x480 -pix_fmt yuv411p -r 24000/1001
+-ar 48000 -ac 2
+
+

The dv50 target is identical to the dv target except that the pixel format set is yuv422p for all three standards. +

+

Any user-set value for a parameter above will override the target preset value. In that case, the output may +not comply with the target standard. +

+
+
-dn (input/output)
+

As an input option, blocks all data streams of a file from being filtered or +being automatically selected or mapped for any output. See -discard +option to disable streams individually. +

+

As an output option, disables data recording i.e. automatic selection or +mapping of any data stream. For full manual control see the -map +option. +

+
+
-dframes number (output)
+

Set the number of data frames to output. This is an obsolete alias for +-frames:d, which you should use instead. +

+
+
-frames[:stream_specifier] framecount (output,per-stream)
+

Stop writing to the stream after framecount frames. +

+
+
-q[:stream_specifier] q (output,per-stream)
+
-qscale[:stream_specifier] q (output,per-stream)
+

Use fixed quality scale (VBR). The meaning of q/qscale is +codec-dependent. +If qscale is used without a stream_specifier then it applies only +to the video stream, this is to maintain compatibility with previous behavior +and as specifying the same codec specific value to 2 different codecs that is +audio and video generally is not what is intended when no stream_specifier is +used. +

+
+
-filter[:stream_specifier] filtergraph (output,per-stream)
+

Create the filtergraph specified by filtergraph and use it to +filter the stream. +

+

filtergraph is a description of the filtergraph to apply to +the stream, and must have a single input and a single output of the +same type of the stream. In the filtergraph, the input is associated +to the label in, and the output to the label out. See +the ffmpeg-filters manual for more information about the filtergraph +syntax. +

+

See the -filter_complex option if you +want to create filtergraphs with multiple inputs and/or outputs. +

+
+
-filter_script[:stream_specifier] filename (output,per-stream)
+

This option is similar to -filter, the only difference is that its +argument is the name of the file from which a filtergraph description is to be +read. +

+
+
-reinit_filter[:stream_specifier] integer (input,per-stream)
+

This boolean option determines if the filtergraph(s) to which this stream is fed gets +reinitialized when input frame parameters change mid-stream. This option is enabled by +default as most video and all audio filters cannot handle deviation in input frame properties. +Upon reinitialization, existing filter state is lost, like e.g. the frame count n +reference available in some filters. Any frames buffered at time of reinitialization are lost. +The properties where a change triggers reinitialization are, +for video, frame resolution or pixel format; +for audio, sample format, sample rate, channel count or channel layout. +

+
+
-filter_threads nb_threads (global)
+

Defines how many threads are used to process a filter pipeline. Each pipeline +will produce a thread pool with this many threads available for parallel processing. +The default is the number of available CPUs. +

+
+
-pre[:stream_specifier] preset_name (output,per-stream)
+

Specify the preset for matching stream(s). +

+
+
-stats (global)
+

Print encoding progress/statistics. It is on by default, to explicitly +disable it you need to specify -nostats. +

+
+
-stats_period time (global)
+

Set period at which encoding progress/statistics are updated. Default is 0.5 seconds. +

+
+
-progress url (global)
+

Send program-friendly progress information to url. +

+

Progress information is written periodically and at the end of +the encoding process. It is made of "key=value" lines. key +consists of only alphanumeric characters. The last key of a sequence of +progress information is always "progress". +

+

The update period is set using -stats_period. +

+
+
-stdin
+

Enable interaction on standard input. On by default unless standard input is +used as an input. To explicitly disable interaction you need to specify +-nostdin. +

+

Disabling interaction on standard input is useful, for example, if +ffmpeg is in the background process group. Roughly the same result can +be achieved with ffmpeg ... < /dev/null but it requires a +shell. +

+
+
-debug_ts (global)
+

Print timestamp information. It is off by default. This option is +mostly useful for testing and debugging purposes, and the output +format may change from one version to another, so it should not be +employed by portable scripts. +

+

See also the option -fdebug ts. +

+
+
-attach filename (output)
+

Add an attachment to the output file. This is supported by a few formats +like Matroska for e.g. fonts used in rendering subtitles. Attachments +are implemented as a specific type of stream, so this option will add +a new stream to the file. It is then possible to use per-stream options +on this stream in the usual way. Attachment streams created with this +option will be created after all the other streams (i.e. those created +with -map or automatic mappings). +

+

Note that for Matroska you also have to set the mimetype metadata tag: +

+
ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
+
+

(assuming that the attachment stream will be third in the output file). +

+
+
-dump_attachment[:stream_specifier] filename (input,per-stream)
+

Extract the matching attachment stream into a file named filename. If +filename is empty, then the value of the filename metadata tag +will be used. +

+

E.g. to extract the first attachment to a file named ’out.ttf’: +

+
ffmpeg -dump_attachment:t:0 out.ttf -i INPUT
+
+

To extract all attachments to files determined by the filename tag: +

+
ffmpeg -dump_attachment:t "" -i INPUT
+
+ +

Technical note – attachments are implemented as codec extradata, so this +option can actually be used to extract extradata from any stream, not just +attachments. +

+
+ +
+
+

5.5 Video Options

+ +
+
-vframes number (output)
+

Set the number of video frames to output. This is an obsolete alias for +-frames:v, which you should use instead. +

+
-r[:stream_specifier] fps (input/output,per-stream)
+

Set frame rate (Hz value, fraction or abbreviation). +

+

As an input option, ignore any timestamps stored in the file and instead +generate timestamps assuming constant frame rate fps. +This is not the same as the -framerate option used for some input formats +like image2 or v4l2 (it used to be the same in older versions of FFmpeg). +If in doubt use -framerate instead of the input option -r. +

+

As an output option: +

+
video encoding
+

Duplicate or drop frames right before encoding them to achieve constant output +frame rate fps. +

+
+
video streamcopy
+

Indicate to the muxer that fps is the stream frame rate. No data is +dropped or duplicated in this case. This may produce invalid files if fps +does not match the actual stream frame rate as determined by packet timestamps. +See also the setts bitstream filter. +

+
+
+ +
+
-fpsmax[:stream_specifier] fps (output,per-stream)
+

Set maximum frame rate (Hz value, fraction or abbreviation). +

+

Clamps output frame rate when output framerate is auto-set and is higher than this value. +Useful in batch processing or when input framerate is wrongly detected as very high. +It cannot be set together with -r. It is ignored during streamcopy. +

+
+
-s[:stream_specifier] size (input/output,per-stream)
+

Set frame size. +

+

As an input option, this is a shortcut for the video_size private +option, recognized by some demuxers for which the frame size is either not +stored in the file or is configurable – e.g. raw video or video grabbers. +

+

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). +

+
+
-aspect[:stream_specifier] aspect (output,per-stream)
+

Set the video display aspect ratio specified by aspect. +

+

aspect can be a floating point number string, or a string of the +form num:den, where num and den are the +numerator and denominator of the aspect ratio. For example "4:3", +"16:9", "1.3333", and "1.7777" are valid argument values. +

+

If used together with -vcodec copy, it will affect the aspect ratio +stored at container level, but not the aspect ratio stored in encoded +frames, if it exists. +

+
+
-display_rotation[:stream_specifier] rotation (input,per-stream)
+

Set video rotation metadata. +

+

rotation is a decimal number specifying the amount in degree by +which the video should be rotated counter-clockwise before being +displayed. +

+

This option overrides the rotation/display transform metadata stored in +the file, if any. When the video is being transcoded (rather than +copied) and -autorotate is enabled, the video will be rotated at +the filtering stage. Otherwise, the metadata will be written into the +output file if the muxer supports it. +

+

If the -display_hflip and/or -display_vflip options are +given, they are applied after the rotation specified by this option. +

+
+
-display_hflip[:stream_specifier] (input,per-stream)
+

Set whether on display the image should be horizontally flipped. +

+

See the -display_rotation option for more details. +

+
+
-display_vflip[:stream_specifier] (input,per-stream)
+

Set whether on display the image should be vertically flipped. +

+

See the -display_rotation option for more details. +

+
+
-vn (input/output)
+

As an input option, blocks all video streams of a file from being filtered or +being automatically selected or mapped for any output. See -discard +option to disable streams individually. +

+

As an output option, disables video recording i.e. automatic selection or +mapping of any video stream. For full manual control see the -map +option. +

+
+
-vcodec codec (output)
+

Set the video codec. This is an alias for -codec:v. +

+
+
-pass[:stream_specifier] n (output,per-stream)
+

Select the pass number (1 or 2). It is used to do two-pass +video encoding. The statistics of the video are recorded in the first +pass into a log file (see also the option -passlogfile), +and in the second pass that log file is used to generate the video +at the exact requested bitrate. +On pass 1, you may just deactivate audio and set output to null, +examples for Windows and Unix: +

+
ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
+ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
+
+ +
+
-passlogfile[:stream_specifier] prefix (output,per-stream)
+

Set two-pass log file name prefix to prefix, the default file name +prefix is “ffmpeg2pass”. The complete file name will be +PREFIX-N.log, where N is a number specific to the output +stream +

+
+
-vf filtergraph (output)
+

Create the filtergraph specified by filtergraph and use it to +filter the stream. +

+

This is an alias for -filter:v, see the -filter option. +

+
+
-autorotate
+

Automatically rotate the video according to file metadata. Enabled by +default, use -noautorotate to disable it. +

+
+
-autoscale
+

Automatically scale the video according to the resolution of first frame. +Enabled by default, use -noautoscale to disable it. When autoscale is +disabled, all output frames of filter graph might not be in the same resolution +and may be inadequate for some encoder/muxer. Therefore, it is not recommended +to disable it unless you really know what you are doing. +Disable autoscale at your own risk. +

+
+ +
+
+

5.6 Advanced Video options

+ +
+
-pix_fmt[:stream_specifier] format (input/output,per-stream)
+

Set pixel format. Use -pix_fmts to show all the supported +pixel formats. +If the selected pixel format can not be selected, ffmpeg will print a +warning and select the best pixel format supported by the encoder. +If pix_fmt is prefixed by a +, ffmpeg will exit with an error +if the requested pixel format can not be selected, and automatic conversions +inside filtergraphs are disabled. +If pix_fmt is a single +, ffmpeg selects the same pixel format +as the input (or graph output) and automatic conversions are disabled. +

+
+
-sws_flags flags (input/output)
+

Set default flags for the libswscale library. These flags are used by +automatically inserted scale filters and those within simple +filtergraphs, if not overridden within the filtergraph definition. +

+

See the (ffmpeg-scaler)ffmpeg-scaler manual for a list +of scaler options. +

+
+
-rc_override[:stream_specifier] override (output,per-stream)
+

Rate control override for specific intervals, formatted as "int,int,int" +list separated with slashes. Two first values are the beginning and +end frame numbers, last one is quantizer to use if positive, or quality +factor if negative. +

+
+
-psnr
+

Calculate PSNR of compressed frames. This option is deprecated, pass the +PSNR flag to the encoder instead, using -flags +psnr. +

+
+
-vstats
+

Dump video coding statistics to vstats_HHMMSS.log. See the +vstats file format section for the format description. +

+
+
-vstats_file file
+

Dump video coding statistics to file. See the +vstats file format section for the format description. +

+
+
-vstats_version file
+

Specify which version of the vstats format to use. Default is 2. See the +vstats file format section for the format description. +

+
+
-top[:stream_specifier] n (output,per-stream)
+

top=1/bottom=0/auto=-1 field first +

+
-vtag fourcc/tag (output)
+

Force video tag/fourcc. This is an alias for -tag:v. +

+
-vbsf bitstream_filter
+

Deprecated see -bsf +

+
+
-force_key_frames[:stream_specifier] time[,time...] (output,per-stream)
+
-force_key_frames[:stream_specifier] expr:expr (output,per-stream)
+
-force_key_frames[:stream_specifier] source (output,per-stream)
+
-force_key_frames[:stream_specifier] source_no_drop (output,per-stream)
+
+

force_key_frames can take arguments of the following form: +

+
+
time[,time...]
+

If the argument consists of timestamps, ffmpeg will round the specified times to the nearest +output timestamp as per the encoder time base and force a keyframe at the first frame having +timestamp equal or greater than the computed timestamp. Note that if the encoder time base is too +coarse, then the keyframes may be forced on frames with timestamps lower than the specified time. +The default encoder time base is the inverse of the output framerate but may be set otherwise +via -enc_time_base. +

+

If one of the times is "chapters[delta]", it is expanded into +the time of the beginning of all chapters in the file, shifted by +delta, expressed as a time in seconds. +This option can be useful to ensure that a seek point is present at a +chapter mark or any other designated place in the output file. +

+

For example, to insert a key frame at 5 minutes, plus key frames 0.1 second +before the beginning of every chapter: +

+
-force_key_frames 0:05:00,chapters-0.1
+
+ +
+
expr:expr
+

If the argument is prefixed with expr:, the string expr +is interpreted like an expression and is evaluated for each frame. A +key frame is forced in case the evaluation is non-zero. +

+

The expression in expr can contain the following constants: +

+
n
+

the number of current processed frame, starting from 0 +

+
n_forced
+

the number of forced frames +

+
prev_forced_n
+

the number of the previous forced frame, it is NAN when no +keyframe was forced yet +

+
prev_forced_t
+

the time of the previous forced frame, it is NAN when no +keyframe was forced yet +

+
t
+

the time of the current processed frame +

+
+ +

For example to force a key frame every 5 seconds, you can specify: +

+
-force_key_frames expr:gte(t,n_forced*5)
+
+ +

To force a key frame 5 seconds after the time of the last forced one, +starting from second 13: +

+
-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
+
+ +
+
source
+

If the argument is source, ffmpeg will force a key frame if +the current frame being encoded is marked as a key frame in its source. +

+
+
source_no_drop
+

If the argument is source_no_drop, ffmpeg will force a key frame if +the current frame being encoded is marked as a key frame in its source. +In cases where this particular source frame has to be dropped, +enforce the next available frame to become a key frame instead. +

+
+
+ +

Note that forcing too many keyframes is very harmful for the lookahead +algorithms of certain encoders: using fixed-GOP options or similar +would be more efficient. +

+
+
-copyinkf[:stream_specifier] (output,per-stream)
+

When doing stream copy, copy also non-key frames found at the +beginning. +

+
+
-init_hw_device type[=name][:device[,key=value...]]
+

Initialise a new hardware device of type type called name, using the +given device parameters. +If no name is specified it will receive a default name of the form "type%d". +

+

The meaning of device and the following arguments depends on the +device type: +

+
cuda
+

device is the number of the CUDA device. +

+

The following options are recognized: +

+
primary_ctx
+

If set to 1, uses the primary device context instead of creating a new one. +

+
+ +

Examples: +

+
-init_hw_device cuda:1
+

Choose the second device on the system. +

+
+
-init_hw_device cuda:0,primary_ctx=1
+

Choose the first device and use the primary device context. +

+
+ +
+
dxva2
+

device is the number of the Direct3D 9 display adapter. +

+
+
d3d11va
+

device is the number of the Direct3D 11 display adapter. +

+
+
vaapi
+

device is either an X11 display name, a DRM render node or a DirectX adapter index. +If not specified, it will attempt to open the default X11 display ($DISPLAY) +and then the first DRM render node (/dev/dri/renderD128), or the default +DirectX adapter on Windows. +

+
+
vdpau
+

device is an X11 display name. +If not specified, it will attempt to open the default X11 display ($DISPLAY). +

+
+
qsv
+

device selects a value in ‘MFX_IMPL_*’. Allowed values are: +

+
auto
+
sw
+
hw
+
auto_any
+
hw_any
+
hw2
+
hw3
+
hw4
+
+

If not specified, ‘auto_any’ is used. +(Note that it may be easier to achieve the desired result for QSV by creating the +platform-appropriate subdevice (‘dxva2’ or ‘d3d11va’ or ‘vaapi’) and then deriving a +QSV device from that.) +

+

Alternatively, ‘child_device_type’ helps to choose platform-appropriate subdevice type. +On Windows ‘d3d11va’ is used as default subdevice type. +

+

Examples: +

+
-init_hw_device qsv:hw,child_device_type=d3d11va
+

Choose the GPU subdevice with type ‘d3d11va’ and create QSV device with ‘MFX_IMPL_HARDWARE’. +

+
+
-init_hw_device qsv:hw,child_device_type=dxva2
+

Choose the GPU subdevice with type ‘dxva2’ and create QSV device with ‘MFX_IMPL_HARDWARE’. +

+
+ +
+
opencl
+

device selects the platform and device as platform_index.device_index. +

+

The set of devices can also be filtered using the key-value pairs to find only +devices matching particular platform or device strings. +

+

The strings usable as filters are: +

+
platform_profile
+
platform_version
+
platform_name
+
platform_vendor
+
platform_extensions
+
device_name
+
device_vendor
+
driver_version
+
device_version
+
device_profile
+
device_extensions
+
device_type
+
+ +

The indices and filters must together uniquely select a device. +

+

Examples: +

+
-init_hw_device opencl:0.1
+

Choose the second device on the first platform. +

+
+
-init_hw_device opencl:,device_name=Foo9000
+

Choose the device with a name containing the string Foo9000. +

+
+
-init_hw_device opencl:1,device_type=gpu,device_extensions=cl_khr_fp16
+

Choose the GPU device on the second platform supporting the cl_khr_fp16 +extension. +

+
+ +
+
vulkan
+

If device is an integer, it selects the device by its index in a +system-dependent list of devices. If device is any other string, it +selects the first device with a name containing that string as a substring. +

+

The following options are recognized: +

+
debug
+

If set to 1, enables the validation layer, if installed. +

+
linear_images
+

If set to 1, images allocated by the hwcontext will be linear and locally mappable. +

+
instance_extensions
+

A plus separated list of additional instance extensions to enable. +

+
device_extensions
+

A plus separated list of additional device extensions to enable. +

+
+ +

Examples: +

+
-init_hw_device vulkan:1
+

Choose the second device on the system. +

+
+
-init_hw_device vulkan:RADV
+

Choose the first device with a name containing the string RADV. +

+
+
-init_hw_device vulkan:0,instance_extensions=VK_KHR_wayland_surface+VK_KHR_xcb_surface
+

Choose the first device and enable the Wayland and XCB instance extensions. +

+
+ +
+
+ +
+
-init_hw_device type[=name]@source
+

Initialise a new hardware device of type type called name, +deriving it from the existing device with the name source. +

+
+
-init_hw_device list
+

List all hardware device types supported in this build of ffmpeg. +

+
+
-filter_hw_device name
+

Pass the hardware device called name to all filters in any filter graph. +This can be used to set the device to upload to with the hwupload filter, +or the device to map to with the hwmap filter. Other filters may also +make use of this parameter when they require a hardware device. Note that this +is typically only required when the input is not already in hardware frames - +when it is, filters will derive the device they require from the context of the +frames they receive as input. +

+

This is a global setting, so all filters will receive the same device. +

+
+
-hwaccel[:stream_specifier] hwaccel (input,per-stream)
+

Use hardware acceleration to decode the matching stream(s). The allowed values +of hwaccel are: +

+
none
+

Do not use any hardware acceleration (the default). +

+
+
auto
+

Automatically select the hardware acceleration method. +

+
+
vdpau
+

Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration. +

+
+
dxva2
+

Use DXVA2 (DirectX Video Acceleration) hardware acceleration. +

+
+
d3d11va
+

Use D3D11VA (DirectX Video Acceleration) hardware acceleration. +

+
+
vaapi
+

Use VAAPI (Video Acceleration API) hardware acceleration. +

+
+
qsv
+

Use the Intel QuickSync Video acceleration for video transcoding. +

+

Unlike most other values, this option does not enable accelerated decoding (that +is used automatically whenever a qsv decoder is selected), but accelerated +transcoding, without copying the frames into the system memory. +

+

For it to work, both the decoder and the encoder must support QSV acceleration +and no filters must be used. +

+
+ +

This option has no effect if the selected hwaccel is not available or not +supported by the chosen decoder. +

+

Note that most acceleration methods are intended for playback and will not be +faster than software decoding on modern CPUs. Additionally, ffmpeg +will usually need to copy the decoded frames from the GPU memory into the system +memory, resulting in further performance loss. This option is thus mainly +useful for testing. +

+
+
-hwaccel_device[:stream_specifier] hwaccel_device (input,per-stream)
+

Select a device to use for hardware acceleration. +

+

This option only makes sense when the -hwaccel option is also specified. +It can either refer to an existing device created with -init_hw_device +by name, or it can create a new device as if +‘-init_hw_devicetype:hwaccel_device +were called immediately before. +

+
+
-hwaccels
+

List all hardware acceleration components enabled in this build of ffmpeg. +Actual runtime availability depends on the hardware and its suitable driver +being installed. +

+
+
-fix_sub_duration_heartbeat[:stream_specifier]
+

Set a specific output video stream as the heartbeat stream according to which +to split and push through currently in-progress subtitle upon receipt of a +random access packet. +

+

This lowers the latency of subtitles for which the end packet or the following +subtitle has not yet been received. As a drawback, this will most likely lead +to duplication of subtitle events in order to cover the full duration, so +when dealing with use cases where latency of when the subtitle event is passed +on to output is not relevant this option should not be utilized. +

+

Requires -fix_sub_duration to be set for the relevant input subtitle +stream for this to have any effect, as well as for the input subtitle stream +having to be directly mapped to the same output in which the heartbeat stream +resides. +

+
+
+ +
+
+

5.7 Audio Options

+ +
+
-aframes number (output)
+

Set the number of audio frames to output. This is an obsolete alias for +-frames:a, which you should use instead. +

+
-ar[:stream_specifier] freq (input/output,per-stream)
+

Set the audio sampling frequency. For output streams it is set by +default to the frequency of the corresponding input stream. For input +streams this option only makes sense for audio grabbing devices and raw +demuxers and is mapped to the corresponding demuxer options. +

+
-aq q (output)
+

Set the audio quality (codec-specific, VBR). This is an alias for -q:a. +

+
-ac[:stream_specifier] channels (input/output,per-stream)
+

Set the number of audio channels. For output streams it is set by +default to the number of input audio channels. For input streams +this option only makes sense for audio grabbing devices and raw demuxers +and is mapped to the corresponding demuxer options. +

+
-an (input/output)
+

As an input option, blocks all audio streams of a file from being filtered or +being automatically selected or mapped for any output. See -discard +option to disable streams individually. +

+

As an output option, disables audio recording i.e. automatic selection or +mapping of any audio stream. For full manual control see the -map +option. +

+
-acodec codec (input/output)
+

Set the audio codec. This is an alias for -codec:a. +

+
-sample_fmt[:stream_specifier] sample_fmt (output,per-stream)
+

Set the audio sample format. Use -sample_fmts to get a list +of supported sample formats. +

+
+
-af filtergraph (output)
+

Create the filtergraph specified by filtergraph and use it to +filter the stream. +

+

This is an alias for -filter:a, see the -filter option. +

+
+ +
+
+

5.8 Advanced Audio options

+ +
+
-atag fourcc/tag (output)
+

Force audio tag/fourcc. This is an alias for -tag:a. +

+
-absf bitstream_filter
+

Deprecated, see -bsf +

+
-guess_layout_max channels (input,per-stream)
+

If some input channel layout is not known, try to guess only if it +corresponds to at most the specified number of channels. For example, 2 +tells to ffmpeg to recognize 1 channel as mono and 2 channels as +stereo but not 6 channels as 5.1. The default is to always try to guess. Use +0 to disable all guessing. +

+
+ +
+
+

5.9 Subtitle options

+ +
+
-scodec codec (input/output)
+

Set the subtitle codec. This is an alias for -codec:s. +

+
-sn (input/output)
+

As an input option, blocks all subtitle streams of a file from being filtered or +being automatically selected or mapped for any output. See -discard +option to disable streams individually. +

+

As an output option, disables subtitle recording i.e. automatic selection or +mapping of any subtitle stream. For full manual control see the -map +option. +

+
-sbsf bitstream_filter
+

Deprecated, see -bsf +

+
+ +
+
+

5.10 Advanced Subtitle options

+ +
+
-fix_sub_duration
+

Fix subtitles durations. For each subtitle, wait for the next packet in the +same stream and adjust the duration of the first to avoid overlap. This is +necessary with some subtitles codecs, especially DVB subtitles, because the +duration in the original packet is only a rough estimate and the end is +actually marked by an empty subtitle frame. Failing to use this option when +necessary can result in exaggerated durations or muxing failures due to +non-monotonic timestamps. +

+

Note that this option will delay the output of all data until the next +subtitle packet is decoded: it may increase memory consumption and latency a +lot. +

+
+
-canvas_size size
+

Set the size of the canvas used to render subtitles. +

+
+
+ +
+
+

5.11 Advanced options

+ +
+
-map [-]input_file_id[:stream_specifier][?] | [linklabel] (output)
+
+

Create one or more streams in the output file. This option has two forms for +specifying the data source(s): the first selects one or more streams from some +input file (specified with -i), the second takes an output from some +complex filtergraph (specified with -filter_complex or +-filter_complex_script). +

+

In the first form, an output stream is created for every stream from the input +file with the index input_file_id. If stream_specifier is given, +only those streams that match the specifier are used (see the +Stream specifiers section for the stream_specifier syntax). +

+

A - character before the stream identifier creates a "negative" mapping. +It disables matching streams from already created mappings. +

+

A trailing ? after the stream index will allow the map to be +optional: if the map matches no streams the map will be ignored instead +of failing. Note the map will still fail if an invalid input file index +is used; such as if the map refers to a non-existent input. +

+

An alternative [linklabel] form will map outputs from complex filter +graphs (see the -filter_complex option) to the output file. +linklabel must correspond to a defined output link label in the graph. +

+

This option may be specified multiple times, each adding more streams to the +output file. Any given input stream may also be mapped any number of times as a +source for different output streams, e.g. in order to use different encoding +options and/or filters. The streams are created in the output in the same order +in which the -map options are given on the commandline. +

+

Using this option disables the default mappings for this output file. +

+

Examples: +

+
+
map everything
+

To map ALL streams from the first input file to output +

+
ffmpeg -i INPUT -map 0 output
+
+ +
+
select specific stream
+

If you have two audio streams in the first input file, these streams are +identified by 0:0 and 0:1. You can use -map to select which +streams to place in an output file. For example: +

+
ffmpeg -i INPUT -map 0:1 out.wav
+
+

will map the second input stream in INPUT to the (single) output stream +in out.wav. +

+
+
create multiple streams
+

To select the stream with index 2 from input file a.mov (specified by the +identifier 0:2), and stream with index 6 from input b.mov +(specified by the identifier 1:6), and copy them to the output file +out.mov: +

+
ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
+
+ +
+
create multiple streams 2
+

To select all video and the third audio stream from an input file: +

+
ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT
+
+ +
+
negative map
+

To map all the streams except the second audio, use negative mappings +

+
ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
+
+ +
+
optional map
+

To map the video and audio streams from the first input, and using the +trailing ?, ignore the audio mapping if no audio streams exist in +the first input: +

+
ffmpeg -i INPUT -map 0:v -map 0:a? OUTPUT
+
+ +
+
map by language
+

To pick the English audio stream: +

+
ffmpeg -i INPUT -map 0:m:language:eng OUTPUT
+
+ +
+
+ +
+
-ignore_unknown
+

Ignore input streams with unknown type instead of failing if copying +such streams is attempted. +

+
+
-copy_unknown
+

Allow input streams with unknown type to be copied instead of failing if copying +such streams is attempted. +

+
+
-map_channel [input_file_id.stream_specifier.channel_id|-1][?][:output_file_id.stream_specifier]
+

This option is deprecated and will be removed. It can be replaced by the +pan filter. In some cases it may be easier to use some combination of the +channelsplit, channelmap, or amerge filters. +

+

Map an audio channel from a given input to an output. If +output_file_id.stream_specifier is not set, the audio channel will +be mapped on all the audio streams. +

+

Using "-1" instead of +input_file_id.stream_specifier.channel_id will map a muted +channel. +

+

A trailing ? will allow the map_channel to be +optional: if the map_channel matches no channel the map_channel will be ignored instead +of failing. +

+

For example, assuming INPUT is a stereo audio file, you can switch the +two audio channels with the following command: +

+
ffmpeg -i INPUT -map_channel 0.0.1 -map_channel 0.0.0 OUTPUT
+
+ +

If you want to mute the first channel and keep the second: +

+
ffmpeg -i INPUT -map_channel -1 -map_channel 0.0.1 OUTPUT
+
+ +

The order of the "-map_channel" option specifies the order of the channels in +the output stream. The output channel layout is guessed from the number of +channels mapped (mono if one "-map_channel", stereo if two, etc.). Using "-ac" +in combination of "-map_channel" makes the channel gain levels to be updated if +input and output channel layouts don’t match (for instance two "-map_channel" +options and "-ac 6"). +

+

You can also extract each channel of an input to specific outputs; the following +command extracts two channels of the INPUT audio stream (file 0, stream 0) +to the respective OUTPUT_CH0 and OUTPUT_CH1 outputs: +

+
ffmpeg -i INPUT -map_channel 0.0.0 OUTPUT_CH0 -map_channel 0.0.1 OUTPUT_CH1
+
+ +

The following example splits the channels of a stereo input into two separate +streams, which are put into the same output file: +

+
ffmpeg -i stereo.wav -map 0:0 -map 0:0 -map_channel 0.0.0:0.0 -map_channel 0.0.1:0.1 -y out.ogg
+
+ +

Note that currently each output stream can only contain channels from a single +input stream; you can’t for example use "-map_channel" to pick multiple input +audio channels contained in different streams (from the same or different files) +and merge them into a single output stream. It is therefore not currently +possible, for example, to turn two separate mono streams into a single stereo +stream. However splitting a stereo stream into two single channel mono streams +is possible. +

+

If you need this feature, a possible workaround is to use the amerge +filter. For example, if you need to merge a media (here input.mkv) with 2 +mono audio streams into one single stereo channel audio stream (and keep the +video stream), you can use the following command: +

+
ffmpeg -i input.mkv -filter_complex "[0:1] [0:2] amerge" -c:a pcm_s16le -c:v copy output.mkv
+
+ +

To map the first two audio channels from the first input, and using the +trailing ?, ignore the audio channel mapping if the first input is +mono instead of stereo: +

+
ffmpeg -i INPUT -map_channel 0.0.0 -map_channel 0.0.1? OUTPUT
+
+ +
+
-map_metadata[:metadata_spec_out] infile[:metadata_spec_in] (output,per-metadata)
+

Set metadata information of the next output file from infile. Note that +those are file indices (zero-based), not filenames. +Optional metadata_spec_in/out parameters specify, which metadata to copy. +A metadata specifier can have the following forms: +

+
g
+

global metadata, i.e. metadata that applies to the whole file +

+
+
s[:stream_spec]
+

per-stream metadata. stream_spec is a stream specifier as described +in the Stream specifiers chapter. In an input metadata specifier, the first +matching stream is copied from. In an output metadata specifier, all matching +streams are copied to. +

+
+
c:chapter_index
+

per-chapter metadata. chapter_index is the zero-based chapter index. +

+
+
p:program_index
+

per-program metadata. program_index is the zero-based program index. +

+
+

If metadata specifier is omitted, it defaults to global. +

+

By default, global metadata is copied from the first input file, +per-stream and per-chapter metadata is copied along with streams/chapters. These +default mappings are disabled by creating any mapping of the relevant type. A negative +file index can be used to create a dummy mapping that just disables automatic copying. +

+

For example to copy metadata from the first stream of the input file to global metadata +of the output file: +

+
ffmpeg -i in.ogg -map_metadata 0:s:0 out.mp3
+
+ +

To do the reverse, i.e. copy global metadata to all audio streams: +

+
ffmpeg -i in.mkv -map_metadata:s:a 0:g out.mkv
+
+

Note that simple 0 would work as well in this example, since global +metadata is assumed by default. +

+
+
-map_chapters input_file_index (output)
+

Copy chapters from input file with index input_file_index to the next +output file. If no chapter mapping is specified, then chapters are copied from +the first input file with at least one chapter. Use a negative file index to +disable any chapter copying. +

+
+
-benchmark (global)
+

Show benchmarking information at the end of an encode. +Shows real, system and user time used and maximum memory consumption. +Maximum memory consumption is not supported on all systems, +it will usually display as 0 if not supported. +

+
-benchmark_all (global)
+

Show benchmarking information during the encode. +Shows real, system and user time used in various steps (audio/video encode/decode). +

+
-timelimit duration (global)
+

Exit after ffmpeg has been running for duration seconds in CPU user time. +

+
-dump (global)
+

Dump each input packet to stderr. +

+
-hex (global)
+

When dumping packets, also dump the payload. +

+
-readrate speed (input)
+

Limit input read speed. +

+

Its value is a floating-point positive number which represents the maximum duration of +media, in seconds, that should be ingested in one second of wallclock time. +Default value is zero and represents no imposed limitation on speed of ingestion. +Value 1 represents real-time speed and is equivalent to -re. +

+

Mainly used to simulate a capture device or live input stream (e.g. when reading from a file). +Should not be used with a low value when input is an actual capture device or live stream as +it may cause packet loss. +

+

It is useful for when flow speed of output packets is important, such as live streaming. +

+
-re (input)
+

Read input at native frame rate. This is equivalent to setting -readrate 1. +

+
-readrate_initial_burst seconds
+

Set an initial read burst time, in seconds, after which -re/-readrate +will be enforced. +

+
-vsync parameter (global)
+
-fps_mode[:stream_specifier] parameter (output,per-stream)
+

Set video sync method / framerate mode. vsync is applied to all output video streams +but can be overridden for a stream by setting fps_mode. vsync is deprecated and will be +removed in the future. +

+

For compatibility reasons some of the values for vsync can be specified as numbers (shown +in parentheses in the following table). +

+
+
passthrough (0)
+

Each frame is passed with its timestamp from the demuxer to the muxer. +

+
cfr (1)
+

Frames will be duplicated and dropped to achieve exactly the requested +constant frame rate. +

+
vfr (2)
+

Frames are passed through with their timestamp or dropped so as to +prevent 2 frames from having the same timestamp. +

+
drop
+

As passthrough but destroys all timestamps, making the muxer generate +fresh timestamps based on frame-rate. +

+
auto (-1)
+

Chooses between cfr and vfr depending on muxer capabilities. This is the +default method. +

+
+ +

Note that the timestamps may be further modified by the muxer, after this. +For example, in the case that the format option avoid_negative_ts +is enabled. +

+

With -map you can select from which stream the timestamps should be +taken. You can leave either video or audio unchanged and sync the +remaining stream(s) to the unchanged one. +

+
+
-frame_drop_threshold parameter
+

Frame drop threshold, which specifies how much behind video frames can +be before they are dropped. In frame rate units, so 1.0 is one frame. +The default is -1.1. One possible usecase is to avoid framedrops in case +of noisy timestamps or to increase frame drop precision in case of exact +timestamps. +

+
+
-apad parameters (output,per-stream)
+

Pad the output audio stream(s). This is the same as applying -af apad. +Argument is a string of filter parameters composed the same as with the apad filter. +-shortest must be set for this output for the option to take effect. +

+
+
-copyts
+

Do not process input timestamps, but keep their values without trying +to sanitize them. In particular, do not remove the initial start time +offset value. +

+

Note that, depending on the vsync option or on specific muxer +processing (e.g. in case the format option avoid_negative_ts +is enabled) the output timestamps may mismatch with the input +timestamps even when this option is selected. +

+
+
-start_at_zero
+

When used with copyts, shift input timestamps so they start at zero. +

+

This means that using e.g. -ss 50 will make output timestamps start at +50 seconds, regardless of what timestamp the input file started at. +

+
+
-copytb mode
+

Specify how to set the encoder timebase when stream copying. mode is an +integer numeric value, and can assume one of the following values: +

+
+
1
+

Use the demuxer timebase. +

+

The time base is copied to the output encoder from the corresponding input +demuxer. This is sometimes required to avoid non monotonically increasing +timestamps when copying video streams with variable frame rate. +

+
+
0
+

Use the decoder timebase. +

+

The time base is copied to the output encoder from the corresponding input +decoder. +

+
+
-1
+

Try to make the choice automatically, in order to generate a sane output. +

+
+ +

Default value is -1. +

+
+
-enc_time_base[:stream_specifier] timebase (output,per-stream)
+

Set the encoder timebase. timebase is a floating point number, +and can assume one of the following values: +

+
+
0
+

Assign a default value according to the media type. +

+

For video - use 1/framerate, for audio - use 1/samplerate. +

+
+
-1
+

Use the input stream timebase when possible. +

+

If an input stream is not available, the default timebase will be used. +

+
+
>0
+

Use the provided number as the timebase. +

+

This field can be provided as a ratio of two integers (e.g. 1:24, 1:48000) +or as a floating point number (e.g. 0.04166, 2.0833e-5) +

+
+ +

Default value is 0. +

+
+
-bitexact (input/output)
+

Enable bitexact mode for (de)muxer and (de/en)coder +

+
-shortest (output)
+

Finish encoding when the shortest output stream ends. +

+

Note that this option may require buffering frames, which introduces extra +latency. The maximum amount of this latency may be controlled with the +-shortest_buf_duration option. +

+
+
-shortest_buf_duration duration (output)
+

The -shortest option may require buffering potentially large amounts +of data when at least one of the streams is "sparse" (i.e. has large gaps +between frames – this is typically the case for subtitles). +

+

This option controls the maximum duration of buffered frames in seconds. +Larger values may allow the -shortest option to produce more accurate +results, but increase memory use and latency. +

+

The default value is 10 seconds. +

+
+
-dts_delta_threshold threshold
+

Timestamp discontinuity delta threshold, expressed as a decimal number +of seconds. +

+

The timestamp discontinuity correction enabled by this option is only +applied to input formats accepting timestamp discontinuity (for which +the AV_FMT_DISCONT flag is enabled), e.g. MPEG-TS and HLS, and +is automatically disabled when employing the -copy_ts option +(unless wrapping is detected). +

+

If a timestamp discontinuity is detected whose absolute value is +greater than threshold, ffmpeg will remove the discontinuity by +decreasing/increasing the current DTS and PTS by the corresponding +delta value. +

+

The default value is 10. +

+
+
-dts_error_threshold threshold
+

Timestamp error delta threshold, expressed as a decimal number of +seconds. +

+

The timestamp correction enabled by this option is only applied to +input formats not accepting timestamp discontinuity (for which the +AV_FMT_DISCONT flag is not enabled). +

+

If a timestamp discontinuity is detected whose absolute value is +greater than threshold, ffmpeg will drop the PTS/DTS timestamp +value. +

+

The default value is 3600*30 (30 hours), which is arbitrarily +picked and quite conservative. +

+
+
-muxdelay seconds (output)
+

Set the maximum demux-decode delay. +

+
-muxpreload seconds (output)
+

Set the initial demux-decode delay. +

+
-streamid output-stream-index:new-value (output)
+

Assign a new stream-id value to an output stream. This option should be +specified prior to the output filename to which it applies. +For the situation where multiple output files exist, a streamid +may be reassigned to a different value. +

+

For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for +an output mpegts file: +

+
ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts
+
+ +
+
-bsf[:stream_specifier] bitstream_filters (output,per-stream)
+

Set bitstream filters for matching streams. bitstream_filters is +a comma-separated list of bitstream filters. Use the -bsfs option +to get the list of bitstream filters. +

+
ffmpeg -i h264.mp4 -c:v copy -bsf:v h264_mp4toannexb -an out.h264
+
+
+
ffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt
+
+ +
+
-tag[:stream_specifier] codec_tag (input/output,per-stream)
+

Force a tag/fourcc for matching streams. +

+
+
-timecode hh:mm:ssSEPff
+

Specify Timecode for writing. SEP is ’:’ for non drop timecode and ’;’ +(or ’.’) for drop. +

+
ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
+
+ +
+
-filter_complex filtergraph (global)
+

Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or +outputs. For simple graphs – those with one input and one output of the same +type – see the -filter options. filtergraph is a description of +the filtergraph, as described in the “Filtergraph syntax” section of the +ffmpeg-filters manual. +

+

Input link labels must refer to input streams using the +[file_index:stream_specifier] syntax (i.e. the same as -map +uses). If stream_specifier matches multiple streams, the first one will be +used. An unlabeled input will be connected to the first unused input stream of +the matching type. +

+

Output link labels are referred to with -map. Unlabeled outputs are +added to the first output file. +

+

Note that with this option it is possible to use only lavfi sources without +normal input files. +

+

For example, to overlay an image over video +

+
ffmpeg -i video.mkv -i image.png -filter_complex '[0:v][1:v]overlay[out]' -map
+'[out]' out.mkv
+
+

Here [0:v] refers to the first video stream in the first input file, +which is linked to the first (main) input of the overlay filter. Similarly the +first video stream in the second input is linked to the second (overlay) input +of overlay. +

+

Assuming there is only one video stream in each input file, we can omit input +labels, so the above is equivalent to +

+
ffmpeg -i video.mkv -i image.png -filter_complex 'overlay[out]' -map
+'[out]' out.mkv
+
+ +

Furthermore we can omit the output label and the single output from the filter +graph will be added to the output file automatically, so we can simply write +

+
ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
+
+ +

As a special exception, you can use a bitmap subtitle stream as input: it +will be converted into a video with the same size as the largest video in +the file, or 720x576 if no video is present. Note that this is an +experimental and temporary solution. It will be removed once libavfilter has +proper support for subtitles. +

+

For example, to hardcode subtitles on top of a DVB-T recording stored in +MPEG-TS format, delaying the subtitles by 1 second: +

+
ffmpeg -i input.ts -filter_complex \
+  '[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay' \
+  -sn -map '#0x2dc' output.mkv
+
+

(0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video, +audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too) +

+

To generate 5 seconds of pure red video using lavfi color source: +

+
ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
+
+ +
+
-filter_complex_threads nb_threads (global)
+

Defines how many threads are used to process a filter_complex graph. +Similar to filter_threads but used for -filter_complex graphs only. +The default is the number of available CPUs. +

+
+
-lavfi filtergraph (global)
+

Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or +outputs. Equivalent to -filter_complex. +

+
+
-filter_complex_script filename (global)
+

This option is similar to -filter_complex, the only difference is that +its argument is the name of the file from which a complex filtergraph +description is to be read. +

+
+
-accurate_seek (input)
+

This option enables or disables accurate seeking in input files with the +-ss option. It is enabled by default, so seeking is accurate when +transcoding. Use -noaccurate_seek to disable it, which may be useful +e.g. when copying some streams and transcoding the others. +

+
+
-seek_timestamp (input)
+

This option enables or disables seeking by timestamp in input files with the +-ss option. It is disabled by default. If enabled, the argument +to the -ss option is considered an actual timestamp, and is not +offset by the start time of the file. This matters only for files which do +not start from timestamp 0, such as transport streams. +

+
+
-thread_queue_size size (input/output)
+

For input, this option sets the maximum number of queued packets when reading +from the file or device. With low latency / high rate live streams, packets may +be discarded if they are not read in a timely manner; setting this value can +force ffmpeg to use a separate input thread and read packets as soon as they +arrive. By default ffmpeg only does this if multiple inputs are specified. +

+

For output, this option specified the maximum number of packets that may be +queued to each muxing thread. +

+
+
-sdp_file file (global)
+

Print sdp information for an output stream to file. +This allows dumping sdp information when at least one output isn’t an +rtp stream. (Requires at least one of the output formats to be rtp). +

+
+
-discard (input)
+

Allows discarding specific streams or frames from streams. +Any input stream can be fully discarded, using value all whereas +selective discarding of frames from a stream occurs at the demuxer +and is not supported by all demuxers. +

+
+
none
+

Discard no frame. +

+
+
default
+

Default, which discards no frames. +

+
+
noref
+

Discard all non-reference frames. +

+
+
bidir
+

Discard all bidirectional frames. +

+
+
nokey
+

Discard all frames excepts keyframes. +

+
+
all
+

Discard all frames. +

+
+ +
+
-abort_on flags (global)
+

Stop and abort on various conditions. The following flags are available: +

+
+
empty_output
+

No packets were passed to the muxer, the output is empty. +

+
empty_output_stream
+

No packets were passed to the muxer in some of the output streams. +

+
+ +
+
-max_error_rate (global)
+

Set fraction of decoding frame failures across all inputs which when crossed +ffmpeg will return exit code 69. Crossing this threshold does not terminate +processing. Range is a floating-point number between 0 to 1. Default is 2/3. +

+
+
-xerror (global)
+

Stop and exit on error +

+
+
-max_muxing_queue_size packets (output,per-stream)
+

When transcoding audio and/or video streams, ffmpeg will not begin writing into +the output until it has one packet for each such stream. While waiting for that +to happen, packets for other streams are buffered. This option sets the size of +this buffer, in packets, for the matching output stream. +

+

The default value of this option should be high enough for most uses, so only +touch this option if you are sure that you need it. +

+
+
-muxing_queue_data_threshold bytes (output,per-stream)
+

This is a minimum threshold until which the muxing queue size is not taken into +account. Defaults to 50 megabytes per stream, and is based on the overall size +of packets passed to the muxer. +

+
+
-auto_conversion_filters (global)
+

Enable automatically inserting format conversion filters in all filter +graphs, including those defined by -vf, -af, +-filter_complex and -lavfi. If filter format negotiation +requires a conversion, the initialization of the filters will fail. +Conversions can still be performed by inserting the relevant conversion +filter (scale, aresample) in the graph. +On by default, to explicitly disable it you need to specify +-noauto_conversion_filters. +

+
+
-bits_per_raw_sample[:stream_specifier] value (output,per-stream)
+

Declare the number of bits per raw sample in the given output stream to be +value. Note that this option sets the information provided to the +encoder/muxer, it does not change the stream to conform to this value. Setting +values that do not match the stream properties may result in encoding failures +or invalid output files. +

+
+
-stats_enc_pre[:stream_specifier] path (output,per-stream)
+
-stats_enc_post[:stream_specifier] path (output,per-stream)
+
-stats_mux_pre[:stream_specifier] path (output,per-stream)
+

Write per-frame encoding information about the matching streams into the file +given by path. +

+

-stats_enc_pre writes information about raw video or audio frames right +before they are sent for encoding, while -stats_enc_post writes +information about encoded packets as they are received from the encoder. +-stats_mux_pre writes information about packets just as they are about to +be sent to the muxer. Every frame or packet produces one line in the specified +file. The format of this line is controlled by -stats_enc_pre_fmt / +-stats_enc_post_fmt / -stats_mux_pre_fmt. +

+

When stats for multiple streams are written into a single file, the lines +corresponding to different streams will be interleaved. The precise order of +this interleaving is not specified and not guaranteed to remain stable between +different invocations of the program, even with the same options. +

+
+
-stats_enc_pre_fmt[:stream_specifier] format_spec (output,per-stream)
+
-stats_enc_post_fmt[:stream_specifier] format_spec (output,per-stream)
+
-stats_mux_pre_fmt[:stream_specifier] format_spec (output,per-stream)
+

Specify the format for the lines written with -stats_enc_pre / +-stats_enc_post / -stats_mux_pre. +

+

format_spec is a string that may contain directives of the form +{fmt}. format_spec is backslash-escaped — use \{, \}, and \\ +to write a literal {, }, or \, respectively, into the output. +

+

The directives given with fmt may be one of the following: +

+
fidx
+

Index of the output file. +

+
+
sidx
+

Index of the output stream in the file. +

+
+
n
+

Frame number. Pre-encoding: number of frames sent to the encoder so far. +Post-encoding: number of packets received from the encoder so far. +Muxing: number of packets submitted to the muxer for this stream so far. +

+
+
ni
+

Input frame number. Index of the input frame (i.e. output by a decoder) that +corresponds to this output frame or packet. -1 if unavailable. +

+
+
tb
+

Encoder timebase, as a rational number num/den. Note that this may be +different from the timebase used by the muxer. +

+
+
tbi
+

Timebase for ptsi, as a rational number num/den. Available when +ptsi is available, 0/1 otherwise. +

+
+
pts
+

Presentation timestamp of the frame or packet, as an integer. Should be +multiplied by the timebase to compute presentation time. +

+
+
ptsi
+

Presentation timestamp of the input frame (see ni), as an integer. Should +be multiplied by tbi to compute presentation time. Printed as +(2^63 - 1 = 9223372036854775807) when not available. +

+
+
t
+

Presentation time of the frame or packet, as a decimal number. Equal to +pts multiplied by tb. +

+
+
ti
+

Presentation time of the input frame (see ni), as a decimal number. Equal +to ptsi multiplied by tbi. Printed as inf when not available. +

+
+
dts
+

Decoding timestamp of the packet, as an integer. Should be multiplied by the +timebase to compute presentation time. Post-encoding only. +

+
+
dt
+

Decoding time of the frame or packet, as a decimal number. Equal to +dts multiplied by tb. +

+
+
sn
+

Number of audio samples sent to the encoder so far. Audio and pre-encoding only. +

+
+
samp
+

Number of audio samples in the frame. Audio and pre-encoding only. +

+
+
size
+

Size of the encoded packet in bytes. Post-encoding only. +

+
+
br
+

Current bitrate in bits per second. Post-encoding only. +

+
+
abr
+

Average bitrate for the whole stream so far, in bits per second, -1 if it cannot +be determined at this point. Post-encoding only. +

+
+ +

The default format strings are: +

+
pre-encoding
+

{fidx} {sidx} {n} {t} +

+
post-encoding
+

{fidx} {sidx} {n} {t} +

+
+

In the future, new items may be added to the end of the default formatting +strings. Users who depend on the format staying exactly the same, should +prescribe it manually. +

+

Note that stats for different streams written into the same file may have +different formats. +

+
+
+ +
+
+

5.12 Preset files

+

A preset file contains a sequence of option=value pairs, +one for each line, specifying a sequence of options which would be +awkward to specify on the command line. Lines starting with the hash +(’#’) character are ignored and are used to provide comments. Check +the presets directory in the FFmpeg source tree for examples. +

+

There are two types of preset files: ffpreset and avpreset files. +

+ +
+

5.12.1 ffpreset files

+

ffpreset files are specified with the vpre, apre, +spre, and fpre options. The fpre option takes the +filename of the preset instead of a preset name as input and can be +used for any kind of codec. For the vpre, apre, and +spre options, the options specified in a preset file are +applied to the currently selected codec of the same type as the preset +option. +

+

The argument passed to the vpre, apre, and spre +preset options identifies the preset file to use according to the +following rules: +

+

First ffmpeg searches for a file named arg.ffpreset in the +directories $FFMPEG_DATADIR (if set), and $HOME/.ffmpeg, and in +the datadir defined at configuration time (usually PREFIX/share/ffmpeg) +or in a ffpresets folder along the executable on win32, +in that order. For example, if the argument is libvpx-1080p, it will +search for the file libvpx-1080p.ffpreset. +

+

If no such file is found, then ffmpeg will search for a file named +codec_name-arg.ffpreset in the above-mentioned +directories, where codec_name is the name of the codec to which +the preset file options will be applied. For example, if you select +the video codec with -vcodec libvpx and use -vpre 1080p, +then it will search for the file libvpx-1080p.ffpreset. +

+
+
+

5.12.2 avpreset files

+

avpreset files are specified with the pre option. They work similar to +ffpreset files, but they only allow encoder- specific options. Therefore, an +option=value pair specifying an encoder cannot be used. +

+

When the pre option is specified, ffmpeg will look for files with the +suffix .avpreset in the directories $AVCONV_DATADIR (if set), and +$HOME/.avconv, and in the datadir defined at configuration time (usually +PREFIX/share/ffmpeg), in that order. +

+

First ffmpeg searches for a file named codec_name-arg.avpreset in +the above-mentioned directories, where codec_name is the name of the codec +to which the preset file options will be applied. For example, if you select the +video codec with -vcodec libvpx and use -pre 1080p, then it will +search for the file libvpx-1080p.avpreset. +

+

If no such file is found, then ffmpeg will search for a file named +arg.avpreset in the same directories. +

+
+
+
+

5.13 vstats file format

+

The -vstats and -vstats_file options enable generation of a file +containing statistics about the generated video outputs. +

+

The -vstats_version option controls the format version of the generated +file. +

+

With version 1 the format is: +

+
frame= FRAME q= FRAME_QUALITY PSNR= PSNR f_size= FRAME_SIZE s_size= STREAM_SIZEkB time= TIMESTAMP br= BITRATEkbits/s avg_br= AVERAGE_BITRATEkbits/s
+
+ +

With version 2 the format is: +

+
out= OUT_FILE_INDEX st= OUT_FILE_STREAM_INDEX frame= FRAME_NUMBER q= FRAME_QUALITYf PSNR= PSNR f_size= FRAME_SIZE s_size= STREAM_SIZEkB time= TIMESTAMP br= BITRATEkbits/s avg_br= AVERAGE_BITRATEkbits/s
+
+ +

The value corresponding to each key is described below: +

+
avg_br
+

average bitrate expressed in Kbits/s +

+
+
br
+

bitrate expressed in Kbits/s +

+
+
frame
+

number of encoded frame +

+
+
out
+

out file index +

+
+
PSNR
+

Peak Signal to Noise Ratio +

+
+
q
+

quality of the frame +

+
+
f_size
+

encoded packet size expressed as number of bytes +

+
+
s_size
+

stream size expressed in KiB +

+
+
st
+

out file stream index +

+
+
time
+

time of the packet +

+
+
type
+

picture type +

+
+ +

See also the -stats_enc options for an alternative way +to show encoding statistics. +

+ +
+
+
+

6 Examples

+ + +
+

6.1 Video and Audio grabbing

+ +

If you specify the input format and device then ffmpeg can grab video +and audio directly. +

+
+
ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
+
+ +

Or with an ALSA audio source (mono input, card id 1) instead of OSS: +

+
ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
+
+ +

Note that you must activate the right video source and channel before +launching ffmpeg with any TV viewer such as +xawtv by Gerd Knorr. You also +have to set the audio recording levels correctly with a +standard mixer. +

+
+
+

6.2 X11 grabbing

+ +

Grab the X11 display with ffmpeg via +

+
+
ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0 /tmp/out.mpg
+
+ +

0.0 is display.screen number of your X11 server, same as +the DISPLAY environment variable. +

+
+
ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg
+
+ +

0.0 is display.screen number of your X11 server, same as the DISPLAY environment +variable. 10 is the x-offset and 20 the y-offset for the grabbing. +

+
+
+

6.3 Video and Audio file format conversion

+ +

Any supported file format and protocol can serve as input to ffmpeg: +

+

Examples: +

    +
  • You can use YUV files as input: + +
    +
    ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
    +
    + +

    It will use the files: +

    +
    /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
    +/tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
    +
    + +

    The Y files use twice the resolution of the U and V files. They are +raw files, without header. They can be generated by all decent video +decoders. You must specify the size of the image with the -s option +if ffmpeg cannot guess it. +

    +
  • You can input from a raw YUV420P file: + +
    +
    ffmpeg -i /tmp/test.yuv /tmp/out.avi
    +
    + +

    test.yuv is a file containing raw YUV planar data. Each frame is composed +of the Y plane followed by the U and V planes at half vertical and +horizontal resolution. +

    +
  • You can output to a raw YUV420P file: + +
    +
    ffmpeg -i mydivx.avi hugefile.yuv
    +
    + +
  • You can set several input files and output files: + +
    +
    ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
    +
    + +

    Converts the audio file a.wav and the raw YUV video file a.yuv +to MPEG file a.mpg. +

    +
  • You can also do audio and video conversions at the same time: + +
    +
    ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
    +
    + +

    Converts a.wav to MPEG audio at 22050 Hz sample rate. +

    +
  • You can encode to several formats at the same time and define a +mapping from input stream to output streams: + +
    +
    ffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2
    +
    + +

    Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. ’-map +file:index’ specifies which input stream is used for each output +stream, in the order of the definition of output streams. +

    +
  • You can transcode decrypted VOBs: + +
    +
    ffmpeg -i snatch_1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi
    +
    + +

    This is a typical DVD ripping example; the input is a VOB file, the +output an AVI file with MPEG-4 video and MP3 audio. Note that in this +command we use B-frames so the MPEG-4 stream is DivX5 compatible, and +GOP size is 300 which means one intra frame every 10 seconds for 29.97fps +input video. Furthermore, the audio stream is MP3-encoded so you need +to enable LAME support by passing --enable-libmp3lame to configure. +The mapping is particularly useful for DVD transcoding +to get the desired audio language. +

    +

    NOTE: To see the supported input formats, use ffmpeg -demuxers. +

    +
  • You can extract images from a video, or create a video from many images: + +

    For extracting images from a video: +

    +
    ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
    +
    + +

    This will extract one video frame per second from the video and will +output them in files named foo-001.jpeg, foo-002.jpeg, +etc. Images will be rescaled to fit the new WxH values. +

    +

    If you want to extract just a limited number of frames, you can use the +above command in combination with the -frames:v or -t option, +or in combination with -ss to start extracting from a certain point in time. +

    +

    For creating a video from many images: +

    +
    ffmpeg -f image2 -framerate 12 -i foo-%03d.jpeg -s WxH foo.avi
    +
    + +

    The syntax foo-%03d.jpeg specifies to use a decimal number +composed of three digits padded with zeroes to express the sequence +number. It is the same syntax supported by the C printf function, but +only formats accepting a normal integer are suitable. +

    +

    When importing an image sequence, -i also supports expanding +shell-like wildcard patterns (globbing) internally, by selecting the +image2-specific -pattern_type glob option. +

    +

    For example, for creating a video from filenames matching the glob pattern +foo-*.jpeg: +

    +
    ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi
    +
    + +
  • You can put many streams of the same type in the output: + +
    +
    ffmpeg -i test1.avi -i test2.avi -map 1:1 -map 1:0 -map 0:1 -map 0:0 -c copy -y test12.nut
    +
    + +

    The resulting output file test12.nut will contain the first four streams +from the input files in reverse order. +

    +
  • To force CBR video output: +
    +
    ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
    +
    + +
  • The four options lmin, lmax, mblmin and mblmax use ’lambda’ units, +but you may use the QP2LAMBDA constant to easily convert from ’q’ units: +
    +
    ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
    +
    + +
+ + +
+
+ +
+

8 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffplay-all.html b/mm_avh_working_space/bin/ffmpeg/doc/ffplay-all.html new file mode 100644 index 0000000000000000000000000000000000000000..fd0d922076e1568d9576abdcd51c2d2df1d91b4e --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffplay-all.html @@ -0,0 +1,53487 @@ + + + + + +ffplay Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ +
+ + +
+
+
+

1 Synopsis

+ +

ffplay [options] [input_url] +

+
+
+

2 Description

+ +

FFplay is a very simple and portable media player using the FFmpeg +libraries and the SDL library. It is mostly used as a testbed for the +various FFmpeg APIs. +

+
+
+

3 Options

+ +

All the numerical options, if not specified otherwise, accept a string +representing a number as input, which may be followed by one of the SI +unit prefixes, for example: ’K’, ’M’, or ’G’. +

+

If ’i’ is appended to the SI unit prefix, the complete prefix will be +interpreted as a unit prefix for binary multiples, which are based on +powers of 1024 instead of powers of 1000. Appending ’B’ to the SI unit +prefix multiplies the value by 8. This allows using, for example: +’KB’, ’MiB’, ’G’ and ’B’ as number suffixes. +

+

Options which do not take arguments are boolean options, and set the +corresponding value to true. They can be set to false by prefixing +the option name with "no". For example using "-nofoo" +will set the boolean option with name "foo" to false. +

+ +
+

3.1 Stream specifiers

+

Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers +are used to precisely specify which stream(s) a given option belongs to. +

+

A stream specifier is a string generally appended to the option name and +separated from it by a colon. E.g. -codec:a:1 ac3 contains the +a:1 stream specifier, which matches the second audio stream. Therefore, it +would select the ac3 codec for the second audio stream. +

+

A stream specifier can match several streams, so that the option is applied to all +of them. E.g. the stream specifier in -b:a 128k matches all audio +streams. +

+

An empty stream specifier matches all streams. For example, -codec copy +or -codec: copy would copy all the streams without reencoding. +

+

Possible forms of stream specifiers are: +

+
stream_index
+

Matches the stream with this index. E.g. -threads:1 4 would set the +thread count for the second stream to 4. If stream_index is used as an +additional stream specifier (see below), then it selects stream number +stream_index from the matching streams. Stream numbering is based on the +order of the streams as detected by libavformat except when a program ID is +also specified. In this case it is based on the ordering of the streams in the +program. +

+
stream_type[:additional_stream_specifier]
+

stream_type is one of following: ’v’ or ’V’ for video, ’a’ for audio, ’s’ +for subtitle, ’d’ for data, and ’t’ for attachments. ’v’ matches all video +streams, ’V’ only matches video streams which are not attached pictures, video +thumbnails or cover arts. If additional_stream_specifier is used, then +it matches streams which both have this type and match the +additional_stream_specifier. Otherwise, it matches all streams of the +specified type. +

+
p:program_id[:additional_stream_specifier]
+

Matches streams which are in the program with the id program_id. If +additional_stream_specifier is used, then it matches streams which both +are part of the program and match the additional_stream_specifier. +

+
+
#stream_id or i:stream_id
+

Match the stream by stream id (e.g. PID in MPEG-TS container). +

+
m:key[:value]
+

Matches streams with the metadata tag key having the specified value. If +value is not given, matches streams that contain the given tag with any +value. +

+
u
+

Matches streams with usable configuration, the codec must be defined and the +essential information such as video dimension or audio sample rate must be present. +

+

Note that in ffmpeg, matching by metadata will only work properly for +input files. +

+
+ +
+
+

3.2 Generic options

+ +

These options are shared amongst the ff* tools. +

+
+
-L
+

Show license. +

+
+
-h, -?, -help, --help [arg]
+

Show help. An optional parameter may be specified to print help about a specific +item. If no argument is specified, only basic (non advanced) tool +options are shown. +

+

Possible values of arg are: +

+
long
+

Print advanced tool options in addition to the basic tool options. +

+
+
full
+

Print complete list of options, including shared and private options +for encoders, decoders, demuxers, muxers, filters, etc. +

+
+
decoder=decoder_name
+

Print detailed information about the decoder named decoder_name. Use the +-decoders option to get a list of all decoders. +

+
+
encoder=encoder_name
+

Print detailed information about the encoder named encoder_name. Use the +-encoders option to get a list of all encoders. +

+
+
demuxer=demuxer_name
+

Print detailed information about the demuxer named demuxer_name. Use the +-formats option to get a list of all demuxers and muxers. +

+
+
muxer=muxer_name
+

Print detailed information about the muxer named muxer_name. Use the +-formats option to get a list of all muxers and demuxers. +

+
+
filter=filter_name
+

Print detailed information about the filter named filter_name. Use the +-filters option to get a list of all filters. +

+
+
bsf=bitstream_filter_name
+

Print detailed information about the bitstream filter named bitstream_filter_name. +Use the -bsfs option to get a list of all bitstream filters. +

+
+
protocol=protocol_name
+

Print detailed information about the protocol named protocol_name. +Use the -protocols option to get a list of all protocols. +

+
+ +
+
-version
+

Show version. +

+
+
-buildconf
+

Show the build configuration, one option per line. +

+
+
-formats
+

Show available formats (including devices). +

+
+
-demuxers
+

Show available demuxers. +

+
+
-muxers
+

Show available muxers. +

+
+
-devices
+

Show available devices. +

+
+
-codecs
+

Show all codecs known to libavcodec. +

+

Note that the term ’codec’ is used throughout this documentation as a shortcut +for what is more correctly called a media bitstream format. +

+
+
-decoders
+

Show available decoders. +

+
+
-encoders
+

Show all available encoders. +

+
+
-bsfs
+

Show available bitstream filters. +

+
+
-protocols
+

Show available protocols. +

+
+
-filters
+

Show available libavfilter filters. +

+
+
-pix_fmts
+

Show available pixel formats. +

+
+
-sample_fmts
+

Show available sample formats. +

+
+
-layouts
+

Show channel names and standard channel layouts. +

+
+
-dispositions
+

Show stream dispositions. +

+
+
-colors
+

Show recognized color names. +

+
+
-sources device[,opt1=val1[,opt2=val2]...]
+

Show autodetected sources of the input device. +Some devices may provide system-dependent source names that cannot be autodetected. +The returned list cannot be assumed to be always complete. +

+
ffmpeg -sources pulse,server=192.168.0.4
+
+ +
+
-sinks device[,opt1=val1[,opt2=val2]...]
+

Show autodetected sinks of the output device. +Some devices may provide system-dependent sink names that cannot be autodetected. +The returned list cannot be assumed to be always complete. +

+
ffmpeg -sinks pulse,server=192.168.0.4
+
+ +
+
-loglevel [flags+]loglevel | -v [flags+]loglevel
+

Set logging level and flags used by the library. +

+

The optional flags prefix can consist of the following values: +

+
repeat
+

Indicates that repeated log output should not be compressed to the first line +and the "Last message repeated n times" line will be omitted. +

+
level
+

Indicates that log output should add a [level] prefix to each message +line. This can be used as an alternative to log coloring, e.g. when dumping the +log to file. +

+
+

Flags can also be used alone by adding a ’+’/’-’ prefix to set/reset a single +flag without affecting other flags or changing loglevel. When +setting both flags and loglevel, a ’+’ separator is expected +between the last flags value and before loglevel. +

+

loglevel is a string or a number containing one of the following values: +

+
quiet, -8
+

Show nothing at all; be silent. +

+
panic, 0
+

Only show fatal errors which could lead the process to crash, such as +an assertion failure. This is not currently used for anything. +

+
fatal, 8
+

Only show fatal errors. These are errors after which the process absolutely +cannot continue. +

+
error, 16
+

Show all errors, including ones which can be recovered from. +

+
warning, 24
+

Show all warnings and errors. Any message related to possibly +incorrect or unexpected events will be shown. +

+
info, 32
+

Show informative messages during processing. This is in addition to +warnings and errors. This is the default value. +

+
verbose, 40
+

Same as info, except more verbose. +

+
debug, 48
+

Show everything, including debugging information. +

+
trace, 56
+
+ +

For example to enable repeated log output, add the level prefix, and set +loglevel to verbose: +

+
ffmpeg -loglevel repeat+level+verbose -i input output
+
+

Another example that enables repeated log output without affecting current +state of level prefix flag or loglevel: +

+
ffmpeg [...] -loglevel +repeat
+
+ +

By default the program logs to stderr. If coloring is supported by the +terminal, colors are used to mark errors and warnings. Log coloring +can be disabled setting the environment variable +AV_LOG_FORCE_NOCOLOR, or can be forced setting +the environment variable AV_LOG_FORCE_COLOR. +

+
+
-report
+

Dump full command line and log output to a file named +program-YYYYMMDD-HHMMSS.log in the current +directory. +This file can be useful for bug reports. +It also implies -loglevel debug. +

+

Setting the environment variable FFREPORT to any value has the +same effect. If the value is a ’:’-separated key=value sequence, these +options will affect the report; option values must be escaped if they +contain special characters or the options delimiter ’:’ (see the +“Quoting and escaping” section in the ffmpeg-utils manual). +

+

The following options are recognized: +

+
file
+

set the file name to use for the report; %p is expanded to the name +of the program, %t is expanded to a timestamp, %% is expanded +to a plain % +

+
level
+

set the log verbosity level using a numerical value (see -loglevel). +

+
+ +

For example, to output a report to a file named ffreport.log +using a log level of 32 (alias for log level info): +

+
+
FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
+
+ +

Errors in parsing the environment variable are not fatal, and will not +appear in the report. +

+
+
-hide_banner
+

Suppress printing banner. +

+

All FFmpeg tools will normally show a copyright notice, build options +and library versions. This option can be used to suppress printing +this information. +

+
+
-cpuflags flags (global)
+

Allows setting and clearing cpu flags. This option is intended +for testing. Do not use it unless you know what you’re doing. +

+
ffmpeg -cpuflags -sse+mmx ...
+ffmpeg -cpuflags mmx ...
+ffmpeg -cpuflags 0 ...
+
+

Possible flags for this option are: +

+
x86
+
+
mmx
+
mmxext
+
sse
+
sse2
+
sse2slow
+
sse3
+
sse3slow
+
ssse3
+
atom
+
sse4.1
+
sse4.2
+
avx
+
avx2
+
xop
+
fma3
+
fma4
+
3dnow
+
3dnowext
+
bmi1
+
bmi2
+
cmov
+
+
+
ARM
+
+
armv5te
+
armv6
+
armv6t2
+
vfp
+
vfpv3
+
neon
+
setend
+
+
+
AArch64
+
+
armv8
+
vfp
+
neon
+
+
+
PowerPC
+
+
altivec
+
+
+
Specific Processors
+
+
pentium2
+
pentium3
+
pentium4
+
k6
+
k62
+
athlon
+
athlonxp
+
k8
+
+
+
+ +
+
-cpucount count (global)
+

Override detection of CPU count. This option is intended +for testing. Do not use it unless you know what you’re doing. +

+
ffmpeg -cpucount 2
+
+ +
+
-max_alloc bytes
+

Set the maximum size limit for allocating a block on the heap by ffmpeg’s +family of malloc functions. Exercise extreme caution when using +this option. Don’t use if you do not understand the full consequence of doing so. +Default is INT_MAX. +

+
+ +
+
+

3.3 AVOptions

+ +

These options are provided directly by the libavformat, libavdevice and +libavcodec libraries. To see the list of available AVOptions, use the +-help option. They are separated into two categories: +

+
generic
+

These options can be set for any container, codec or device. Generic options +are listed under AVFormatContext options for containers/devices and under +AVCodecContext options for codecs. +

+
private
+

These options are specific to the given container, device or codec. Private +options are listed under their corresponding containers/devices/codecs. +

+
+ +

For example to write an ID3v2.3 header instead of a default ID3v2.4 to +an MP3 file, use the id3v2_version private option of the MP3 +muxer: +

+
ffmpeg -i input.flac -id3v2_version 3 out.mp3
+
+ +

All codec AVOptions are per-stream, and thus a stream specifier +should be attached to them: +

+
ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4
+
+ +

In the above example, a multichannel audio stream is mapped twice for output. +The first instance is encoded with codec ac3 and bitrate 640k. +The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using +absolute index of the output stream. +

+

Note: the -nooption syntax cannot be used for boolean +AVOptions, use -option 0/-option 1. +

+

Note: the old undocumented way of specifying per-stream AVOptions by +prepending v/a/s to the options name is now obsolete and will be +removed soon. +

+
+
+

3.4 Main options

+ +
+
-x width
+

Force displayed width. +

+
-y height
+

Force displayed height. +

+
-fs
+

Start in fullscreen mode. +

+
-an
+

Disable audio. +

+
-vn
+

Disable video. +

+
-sn
+

Disable subtitles. +

+
-ss pos
+

Seek to pos. Note that in most formats it is not possible to seek +exactly, so ffplay will seek to the nearest seek point to +pos. +

+

pos must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+
-t duration
+

Play duration seconds of audio/video. +

+

duration must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+
-bytes
+

Seek by bytes. +

+
-seek_interval
+

Set custom interval, in seconds, for seeking using left/right keys. Default is 10 seconds. +

+
-nodisp
+

Disable graphical display. +

+
-noborder
+

Borderless window. +

+
-alwaysontop
+

Window always on top. Available on: X11 with SDL >= 2.0.5, Windows SDL >= 2.0.6. +

+
-volume
+

Set the startup volume. 0 means silence, 100 means no volume reduction or +amplification. Negative values are treated as 0, values above 100 are treated +as 100. +

+
-f fmt
+

Force format. +

+
-window_title title
+

Set window title (default is the input filename). +

+
-left title
+

Set the x position for the left of the window (default is a centered window). +

+
-top title
+

Set the y position for the top of the window (default is a centered window). +

+
-loop number
+

Loops movie playback <number> times. 0 means forever. +

+
-showmode mode
+

Set the show mode to use. +Available values for mode are: +

+
0, video
+

show video +

+
1, waves
+

show audio waves +

+
2, rdft
+

show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform) +

+
+ +

Default value is "video", if video is not present or cannot be played +"rdft" is automatically selected. +

+

You can interactively cycle through the available show modes by +pressing the key w. +

+
+
-vf filtergraph
+

Create the filtergraph specified by filtergraph and use it to +filter the video stream. +

+

filtergraph is a description of the filtergraph to apply to +the stream, and must have a single video input and a single video +output. In the filtergraph, the input is associated to the label +in, and the output to the label out. See the +ffmpeg-filters manual for more information about the filtergraph +syntax. +

+

You can specify this parameter multiple times and cycle through the specified +filtergraphs along with the show modes by pressing the key w. +

+
+
-af filtergraph
+

filtergraph is a description of the filtergraph to apply to +the input audio. +Use the option "-filters" to show all the available filters (including +sources and sinks). +

+
+
-i input_url
+

Read input_url. +

+
+ +
+
+

3.5 Advanced options

+
+
-stats
+

Print several playback statistics, in particular show the stream +duration, the codec parameters, the current position in the stream and +the audio/video synchronisation drift. It is shown by default, unless the +log level is lower than info. Its display can be forced by manually +specifying this option. To disable it, you need to specify -nostats. +

+
+
-fast
+

Non-spec-compliant optimizations. +

+
-genpts
+

Generate pts. +

+
-sync type
+

Set the master clock to audio (type=audio), video +(type=video) or external (type=ext). Default is audio. The +master clock is used to control audio-video synchronization. Most media +players use audio as master clock, but in some cases (streaming or high +quality broadcast) it is necessary to change that. This option is mainly +used for debugging purposes. +

+
-ast audio_stream_specifier
+

Select the desired audio stream using the given stream specifier. The stream +specifiers are described in the Stream specifiers chapter. If this option +is not specified, the "best" audio stream is selected in the program of the +already selected video stream. +

+
-vst video_stream_specifier
+

Select the desired video stream using the given stream specifier. The stream +specifiers are described in the Stream specifiers chapter. If this option +is not specified, the "best" video stream is selected. +

+
-sst subtitle_stream_specifier
+

Select the desired subtitle stream using the given stream specifier. The stream +specifiers are described in the Stream specifiers chapter. If this option +is not specified, the "best" subtitle stream is selected in the program of the +already selected video or audio stream. +

+
-autoexit
+

Exit when video is done playing. +

+
-exitonkeydown
+

Exit if any key is pressed. +

+
-exitonmousedown
+

Exit if any mouse button is pressed. +

+
+
-codec:media_specifier codec_name
+

Force a specific decoder implementation for the stream identified by +media_specifier, which can assume the values a (audio), +v (video), and s subtitle. +

+
+
-acodec codec_name
+

Force a specific audio decoder. +

+
+
-vcodec codec_name
+

Force a specific video decoder. +

+
+
-scodec codec_name
+

Force a specific subtitle decoder. +

+
+
-autorotate
+

Automatically rotate the video according to file metadata. Enabled by +default, use -noautorotate to disable it. +

+
+
-framedrop
+

Drop video frames if video is out of sync. Enabled by default if the master +clock is not set to video. Use this option to enable frame dropping for all +master clock sources, use -noframedrop to disable it. +

+
+
-infbuf
+

Do not limit the input buffer size, read as much data as possible from the +input as soon as possible. Enabled by default for realtime streams, where data +may be dropped if not read in time. Use this option to enable infinite buffers +for all inputs, use -noinfbuf to disable it. +

+
+
-filter_threads nb_threads
+

Defines how many threads are used to process a filter pipeline. Each pipeline +will produce a thread pool with this many threads available for parallel +processing. The default is 0 which means that the thread count will be +determined by the number of available CPUs. +

+
+
+ +
+
+

3.6 While playing

+ +
+
q, ESC
+

Quit. +

+
+
f
+

Toggle full screen. +

+
+
p, SPC
+

Pause. +

+
+
m
+

Toggle mute. +

+
+
9, 0
+
/, *
+

Decrease and increase volume respectively. +

+
+
a
+

Cycle audio channel in the current program. +

+
+
v
+

Cycle video channel. +

+
+
t
+

Cycle subtitle channel in the current program. +

+
+
c
+

Cycle program. +

+
+
w
+

Cycle video filters or show modes. +

+
+
s
+

Step to the next frame. +

+

Pause if the stream is not already paused, step to the next video +frame, and pause. +

+
+
left/right
+

Seek backward/forward 10 seconds. +

+
+
down/up
+

Seek backward/forward 1 minute. +

+
+
page down/page up
+

Seek to the previous/next chapter. +or if there are no chapters +Seek backward/forward 10 minutes. +

+
+
right mouse click
+

Seek to percentage in file corresponding to fraction of width. +

+
+
left mouse double-click
+

Toggle full screen. +

+
+
+ + +
+
+
+

4 Syntax

+ +

This section documents the syntax and formats employed by the FFmpeg +libraries and tools. +

+ +
+

4.1 Quoting and escaping

+ +

FFmpeg adopts the following quoting and escaping mechanism, unless +explicitly specified. The following rules are applied: +

+
    +
  • '’ and ‘\’ are special characters (respectively used for +quoting and escaping). In addition to them, there might be other +special characters depending on the specific syntax where the escaping +and quoting are employed. + +
  • A special character is escaped by prefixing it with a ‘\’. + +
  • All characters enclosed between ‘''’ are included literally in the +parsed string. The quote character ‘'’ itself cannot be quoted, +so you may need to close the quote and escape it. + +
  • Leading and trailing whitespaces, unless escaped or quoted, are +removed from the parsed string. +
+ +

Note that you may need to add a second level of escaping when using +the command line or a script, which depends on the syntax of the +adopted shell language. +

+

The function av_get_token defined in +libavutil/avstring.h can be used to parse a token quoted or +escaped according to the rules defined above. +

+

The tool tools/ffescape in the FFmpeg source tree can be used +to automatically quote or escape a string in a script. +

+ +
+

4.1.1 Examples

+ +
    +
  • Escape the string Crime d'Amour containing the ' special +character: +
    +
    Crime d\'Amour
    +
    + +
  • The string above contains a quote, so the ' needs to be escaped +when quoting it: +
    +
    'Crime d'\''Amour'
    +
    + +
  • Include leading or trailing whitespaces using quoting: +
    +
    '  this string starts and ends with whitespaces  '
    +
    + +
  • Escaping and quoting can be mixed together: +
    +
    ' The string '\'string\'' is a string '
    +
    + +
  • To include a literal ‘\’ you can use either escaping or quoting: +
    +
    'c:\foo' can be written as c:\\foo
    +
    +
+ +
+
+
+

4.2 Date

+ +

The accepted syntax is: +

+
[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
+now
+
+ +

If the value is "now" it takes the current time. +

+

Time is local time unless Z is appended, in which case it is +interpreted as UTC. +If the year-month-day part is not specified it takes the current +year-month-day. +

+
+
+

4.3 Time duration

+ +

There are two accepted syntaxes for expressing time duration. +

+
+
[-][HH:]MM:SS[.m...]
+
+ +

HH expresses the number of hours, MM the number of minutes +for a maximum of 2 digits, and SS the number of seconds for a +maximum of 2 digits. The m at the end expresses decimal value for +SS. +

+

or +

+
+
[-]S+[.m...][s|ms|us]
+
+ +

S expresses the number of seconds, with the optional decimal part +m. The optional literal suffixes ‘s’, ‘ms’ or ‘us’ +indicate to interpret the value as seconds, milliseconds or microseconds, +respectively. +

+

In both expressions, the optional ‘-’ indicates negative duration. +

+ +
+

4.3.1 Examples

+ +

The following examples are all valid time duration: +

+
+
55
+

55 seconds +

+
+
0.2
+

0.2 seconds +

+
+
200ms
+

200 milliseconds, that’s 0.2s +

+
+
200000us
+

200000 microseconds, that’s 0.2s +

+
+
12:03:45
+

12 hours, 03 minutes and 45 seconds +

+
+
23.189
+

23.189 seconds +

+
+ +
+
+
+

4.4 Video size

+

Specify the size of the sourced video, it may be a string of the form +widthxheight, or the name of a size abbreviation. +

+

The following abbreviations are recognized: +

+
ntsc
+

720x480 +

+
pal
+

720x576 +

+
qntsc
+

352x240 +

+
qpal
+

352x288 +

+
sntsc
+

640x480 +

+
spal
+

768x576 +

+
film
+

352x240 +

+
ntsc-film
+

352x240 +

+
sqcif
+

128x96 +

+
qcif
+

176x144 +

+
cif
+

352x288 +

+
4cif
+

704x576 +

+
16cif
+

1408x1152 +

+
qqvga
+

160x120 +

+
qvga
+

320x240 +

+
vga
+

640x480 +

+
svga
+

800x600 +

+
xga
+

1024x768 +

+
uxga
+

1600x1200 +

+
qxga
+

2048x1536 +

+
sxga
+

1280x1024 +

+
qsxga
+

2560x2048 +

+
hsxga
+

5120x4096 +

+
wvga
+

852x480 +

+
wxga
+

1366x768 +

+
wsxga
+

1600x1024 +

+
wuxga
+

1920x1200 +

+
woxga
+

2560x1600 +

+
wqsxga
+

3200x2048 +

+
wquxga
+

3840x2400 +

+
whsxga
+

6400x4096 +

+
whuxga
+

7680x4800 +

+
cga
+

320x200 +

+
ega
+

640x350 +

+
hd480
+

852x480 +

+
hd720
+

1280x720 +

+
hd1080
+

1920x1080 +

+
2k
+

2048x1080 +

+
2kflat
+

1998x1080 +

+
2kscope
+

2048x858 +

+
4k
+

4096x2160 +

+
4kflat
+

3996x2160 +

+
4kscope
+

4096x1716 +

+
nhd
+

640x360 +

+
hqvga
+

240x160 +

+
wqvga
+

400x240 +

+
fwqvga
+

432x240 +

+
hvga
+

480x320 +

+
qhd
+

960x540 +

+
2kdci
+

2048x1080 +

+
4kdci
+

4096x2160 +

+
uhd2160
+

3840x2160 +

+
uhd4320
+

7680x4320 +

+
+ +
+
+

4.5 Video rate

+ +

Specify the frame rate of a video, expressed as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a float +number or a valid video frame rate abbreviation. +

+

The following abbreviations are recognized: +

+
ntsc
+

30000/1001 +

+
pal
+

25/1 +

+
qntsc
+

30000/1001 +

+
qpal
+

25/1 +

+
sntsc
+

30000/1001 +

+
spal
+

25/1 +

+
film
+

24/1 +

+
ntsc-film
+

24000/1001 +

+
+ +
+
+

4.6 Ratio

+ +

A ratio can be expressed as an expression, or in the form +numerator:denominator. +

+

Note that a ratio with infinite (1/0) or negative value is +considered valid, so you should check on the returned value if you +want to exclude those values. +

+

The undefined value can be expressed using the "0:0" string. +

+
+
+

4.7 Color

+ +

It can be the name of a color as defined below (case insensitive match) or a +[0x|#]RRGGBB[AA] sequence, possibly followed by @ and a string +representing the alpha component. +

+

The alpha component may be a string composed by "0x" followed by an +hexadecimal number or a decimal number between 0.0 and 1.0, which +represents the opacity value (‘0x00’ or ‘0.0’ means completely +transparent, ‘0xff’ or ‘1.0’ completely opaque). If the alpha +component is not specified then ‘0xff’ is assumed. +

+

The string ‘random’ will result in a random color. +

+

The following names of colors are recognized: +

+
AliceBlue
+

0xF0F8FF +

+
AntiqueWhite
+

0xFAEBD7 +

+
Aqua
+

0x00FFFF +

+
Aquamarine
+

0x7FFFD4 +

+
Azure
+

0xF0FFFF +

+
Beige
+

0xF5F5DC +

+
Bisque
+

0xFFE4C4 +

+
Black
+

0x000000 +

+
BlanchedAlmond
+

0xFFEBCD +

+
Blue
+

0x0000FF +

+
BlueViolet
+

0x8A2BE2 +

+
Brown
+

0xA52A2A +

+
BurlyWood
+

0xDEB887 +

+
CadetBlue
+

0x5F9EA0 +

+
Chartreuse
+

0x7FFF00 +

+
Chocolate
+

0xD2691E +

+
Coral
+

0xFF7F50 +

+
CornflowerBlue
+

0x6495ED +

+
Cornsilk
+

0xFFF8DC +

+
Crimson
+

0xDC143C +

+
Cyan
+

0x00FFFF +

+
DarkBlue
+

0x00008B +

+
DarkCyan
+

0x008B8B +

+
DarkGoldenRod
+

0xB8860B +

+
DarkGray
+

0xA9A9A9 +

+
DarkGreen
+

0x006400 +

+
DarkKhaki
+

0xBDB76B +

+
DarkMagenta
+

0x8B008B +

+
DarkOliveGreen
+

0x556B2F +

+
Darkorange
+

0xFF8C00 +

+
DarkOrchid
+

0x9932CC +

+
DarkRed
+

0x8B0000 +

+
DarkSalmon
+

0xE9967A +

+
DarkSeaGreen
+

0x8FBC8F +

+
DarkSlateBlue
+

0x483D8B +

+
DarkSlateGray
+

0x2F4F4F +

+
DarkTurquoise
+

0x00CED1 +

+
DarkViolet
+

0x9400D3 +

+
DeepPink
+

0xFF1493 +

+
DeepSkyBlue
+

0x00BFFF +

+
DimGray
+

0x696969 +

+
DodgerBlue
+

0x1E90FF +

+
FireBrick
+

0xB22222 +

+
FloralWhite
+

0xFFFAF0 +

+
ForestGreen
+

0x228B22 +

+
Fuchsia
+

0xFF00FF +

+
Gainsboro
+

0xDCDCDC +

+
GhostWhite
+

0xF8F8FF +

+
Gold
+

0xFFD700 +

+
GoldenRod
+

0xDAA520 +

+
Gray
+

0x808080 +

+
Green
+

0x008000 +

+
GreenYellow
+

0xADFF2F +

+
HoneyDew
+

0xF0FFF0 +

+
HotPink
+

0xFF69B4 +

+
IndianRed
+

0xCD5C5C +

+
Indigo
+

0x4B0082 +

+
Ivory
+

0xFFFFF0 +

+
Khaki
+

0xF0E68C +

+
Lavender
+

0xE6E6FA +

+
LavenderBlush
+

0xFFF0F5 +

+
LawnGreen
+

0x7CFC00 +

+
LemonChiffon
+

0xFFFACD +

+
LightBlue
+

0xADD8E6 +

+
LightCoral
+

0xF08080 +

+
LightCyan
+

0xE0FFFF +

+
LightGoldenRodYellow
+

0xFAFAD2 +

+
LightGreen
+

0x90EE90 +

+
LightGrey
+

0xD3D3D3 +

+
LightPink
+

0xFFB6C1 +

+
LightSalmon
+

0xFFA07A +

+
LightSeaGreen
+

0x20B2AA +

+
LightSkyBlue
+

0x87CEFA +

+
LightSlateGray
+

0x778899 +

+
LightSteelBlue
+

0xB0C4DE +

+
LightYellow
+

0xFFFFE0 +

+
Lime
+

0x00FF00 +

+
LimeGreen
+

0x32CD32 +

+
Linen
+

0xFAF0E6 +

+
Magenta
+

0xFF00FF +

+
Maroon
+

0x800000 +

+
MediumAquaMarine
+

0x66CDAA +

+
MediumBlue
+

0x0000CD +

+
MediumOrchid
+

0xBA55D3 +

+
MediumPurple
+

0x9370D8 +

+
MediumSeaGreen
+

0x3CB371 +

+
MediumSlateBlue
+

0x7B68EE +

+
MediumSpringGreen
+

0x00FA9A +

+
MediumTurquoise
+

0x48D1CC +

+
MediumVioletRed
+

0xC71585 +

+
MidnightBlue
+

0x191970 +

+
MintCream
+

0xF5FFFA +

+
MistyRose
+

0xFFE4E1 +

+
Moccasin
+

0xFFE4B5 +

+
NavajoWhite
+

0xFFDEAD +

+
Navy
+

0x000080 +

+
OldLace
+

0xFDF5E6 +

+
Olive
+

0x808000 +

+
OliveDrab
+

0x6B8E23 +

+
Orange
+

0xFFA500 +

+
OrangeRed
+

0xFF4500 +

+
Orchid
+

0xDA70D6 +

+
PaleGoldenRod
+

0xEEE8AA +

+
PaleGreen
+

0x98FB98 +

+
PaleTurquoise
+

0xAFEEEE +

+
PaleVioletRed
+

0xD87093 +

+
PapayaWhip
+

0xFFEFD5 +

+
PeachPuff
+

0xFFDAB9 +

+
Peru
+

0xCD853F +

+
Pink
+

0xFFC0CB +

+
Plum
+

0xDDA0DD +

+
PowderBlue
+

0xB0E0E6 +

+
Purple
+

0x800080 +

+
Red
+

0xFF0000 +

+
RosyBrown
+

0xBC8F8F +

+
RoyalBlue
+

0x4169E1 +

+
SaddleBrown
+

0x8B4513 +

+
Salmon
+

0xFA8072 +

+
SandyBrown
+

0xF4A460 +

+
SeaGreen
+

0x2E8B57 +

+
SeaShell
+

0xFFF5EE +

+
Sienna
+

0xA0522D +

+
Silver
+

0xC0C0C0 +

+
SkyBlue
+

0x87CEEB +

+
SlateBlue
+

0x6A5ACD +

+
SlateGray
+

0x708090 +

+
Snow
+

0xFFFAFA +

+
SpringGreen
+

0x00FF7F +

+
SteelBlue
+

0x4682B4 +

+
Tan
+

0xD2B48C +

+
Teal
+

0x008080 +

+
Thistle
+

0xD8BFD8 +

+
Tomato
+

0xFF6347 +

+
Turquoise
+

0x40E0D0 +

+
Violet
+

0xEE82EE +

+
Wheat
+

0xF5DEB3 +

+
White
+

0xFFFFFF +

+
WhiteSmoke
+

0xF5F5F5 +

+
Yellow
+

0xFFFF00 +

+
YellowGreen
+

0x9ACD32 +

+
+ +
+
+

4.8 Channel Layout

+ +

A channel layout specifies the spatial disposition of the channels in +a multi-channel audio stream. To specify a channel layout, FFmpeg +makes use of a special syntax. +

+

Individual channels are identified by an id, as given by the table +below: +

+
FL
+

front left +

+
FR
+

front right +

+
FC
+

front center +

+
LFE
+

low frequency +

+
BL
+

back left +

+
BR
+

back right +

+
FLC
+

front left-of-center +

+
FRC
+

front right-of-center +

+
BC
+

back center +

+
SL
+

side left +

+
SR
+

side right +

+
TC
+

top center +

+
TFL
+

top front left +

+
TFC
+

top front center +

+
TFR
+

top front right +

+
TBL
+

top back left +

+
TBC
+

top back center +

+
TBR
+

top back right +

+
DL
+

downmix left +

+
DR
+

downmix right +

+
WL
+

wide left +

+
WR
+

wide right +

+
SDL
+

surround direct left +

+
SDR
+

surround direct right +

+
LFE2
+

low frequency 2 +

+
+ +

Standard channel layout compositions can be specified by using the +following identifiers: +

+
mono
+

FC +

+
stereo
+

FL+FR +

+
2.1
+

FL+FR+LFE +

+
3.0
+

FL+FR+FC +

+
3.0(back)
+

FL+FR+BC +

+
4.0
+

FL+FR+FC+BC +

+
quad
+

FL+FR+BL+BR +

+
quad(side)
+

FL+FR+SL+SR +

+
3.1
+

FL+FR+FC+LFE +

+
5.0
+

FL+FR+FC+BL+BR +

+
5.0(side)
+

FL+FR+FC+SL+SR +

+
4.1
+

FL+FR+FC+LFE+BC +

+
5.1
+

FL+FR+FC+LFE+BL+BR +

+
5.1(side)
+

FL+FR+FC+LFE+SL+SR +

+
6.0
+

FL+FR+FC+BC+SL+SR +

+
6.0(front)
+

FL+FR+FLC+FRC+SL+SR +

+
hexagonal
+

FL+FR+FC+BL+BR+BC +

+
6.1
+

FL+FR+FC+LFE+BC+SL+SR +

+
6.1
+

FL+FR+FC+LFE+BL+BR+BC +

+
6.1(front)
+

FL+FR+LFE+FLC+FRC+SL+SR +

+
7.0
+

FL+FR+FC+BL+BR+SL+SR +

+
7.0(front)
+

FL+FR+FC+FLC+FRC+SL+SR +

+
7.1
+

FL+FR+FC+LFE+BL+BR+SL+SR +

+
7.1(wide)
+

FL+FR+FC+LFE+BL+BR+FLC+FRC +

+
7.1(wide-side)
+

FL+FR+FC+LFE+FLC+FRC+SL+SR +

+
7.1(top)
+

FL+FR+FC+LFE+BL+BR+TFL+TFR +

+
octagonal
+

FL+FR+FC+BL+BR+BC+SL+SR +

+
cube
+

FL+FR+BL+BR+TFL+TFR+TBL+TBR +

+
hexadecagonal
+

FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR +

+
downmix
+

DL+DR +

+
22.2
+

FL+FR+FC+LFE+BL+BR+FLC+FRC+BC+SL+SR+TC+TFL+TFC+TFR+TBL+TBC+TBR+LFE2+TSL+TSR+BFC+BFL+BFR +

+
+ +

A custom channel layout can be specified as a sequence of terms, separated by ’+’. +Each term can be: +

    +
  • the name of a single channel (e.g. ‘FL’, ‘FR’, ‘FC’, ‘LFE’, etc.), +each optionally containing a custom name after a ’@’, (e.g. ‘FL@Left’, +‘FR@Right’, ‘FC@Center’, ‘LFE@Low_Frequency’, etc.) +
+ +

A standard channel layout can be specified by the following: +

    +
  • the name of a single channel (e.g. ‘FL’, ‘FR’, ‘FC’, ‘LFE’, etc.) + +
  • the name of a standard channel layout (e.g. ‘mono’, +‘stereo’, ‘4.0’, ‘quad’, ‘5.0’, etc.) + +
  • a number of channels, in decimal, followed by ’c’, yielding the default channel +layout for that number of channels (see the function +av_channel_layout_default). Note that not all channel counts have a +default layout. + +
  • a number of channels, in decimal, followed by ’C’, yielding an unknown channel +layout with the specified number of channels. Note that not all channel layout +specification strings support unknown channel layouts. + +
  • a channel layout mask, in hexadecimal starting with "0x" (see the +AV_CH_* macros in libavutil/channel_layout.h. +
+ +

Before libavutil version 53 the trailing character "c" to specify a number of +channels was optional, but now it is required, while a channel layout mask can +also be specified as a decimal number (if and only if not followed by "c" or "C"). +

+

See also the function av_channel_layout_from_string defined in +libavutil/channel_layout.h. +

+
+
+
+

5 Expression Evaluation

+ +

When evaluating an arithmetic expression, FFmpeg uses an internal +formula evaluator, implemented through the libavutil/eval.h +interface. +

+

An expression may contain unary, binary operators, constants, and +functions. +

+

Two expressions expr1 and expr2 can be combined to form +another expression "expr1;expr2". +expr1 and expr2 are evaluated in turn, and the new +expression evaluates to the value of expr2. +

+

The following binary operators are available: +, -, +*, /, ^. +

+

The following unary operators are available: +, -. +

+

The following functions are available: +

+
abs(x)
+

Compute absolute value of x. +

+
+
acos(x)
+

Compute arccosine of x. +

+
+
asin(x)
+

Compute arcsine of x. +

+
+
atan(x)
+

Compute arctangent of x. +

+
+
atan2(x, y)
+

Compute principal value of the arc tangent of y/x. +

+
+
between(x, min, max)
+

Return 1 if x is greater than or equal to min and lesser than or +equal to max, 0 otherwise. +

+
+
bitand(x, y)
+
bitor(x, y)
+

Compute bitwise and/or operation on x and y. +

+

The results of the evaluation of x and y are converted to +integers before executing the bitwise operation. +

+

Note that both the conversion to integer and the conversion back to +floating point can lose precision. Beware of unexpected results for +large numbers (usually 2^53 and larger). +

+
+
ceil(expr)
+

Round the value of expression expr upwards to the nearest +integer. For example, "ceil(1.5)" is "2.0". +

+
+
clip(x, min, max)
+

Return the value of x clipped between min and max. +

+
+
cos(x)
+

Compute cosine of x. +

+
+
cosh(x)
+

Compute hyperbolic cosine of x. +

+
+
eq(x, y)
+

Return 1 if x and y are equivalent, 0 otherwise. +

+
+
exp(x)
+

Compute exponential of x (with base e, the Euler’s number). +

+
+
floor(expr)
+

Round the value of expression expr downwards to the nearest +integer. For example, "floor(-1.5)" is "-2.0". +

+
+
gauss(x)
+

Compute Gauss function of x, corresponding to +exp(-x*x/2) / sqrt(2*PI). +

+
+
gcd(x, y)
+

Return the greatest common divisor of x and y. If both x and +y are 0 or either or both are less than zero then behavior is undefined. +

+
+
gt(x, y)
+

Return 1 if x is greater than y, 0 otherwise. +

+
+
gte(x, y)
+

Return 1 if x is greater than or equal to y, 0 otherwise. +

+
+
hypot(x, y)
+

This function is similar to the C function with the same name; it returns +"sqrt(x*x + y*y)", the length of the hypotenuse of a +right triangle with sides of length x and y, or the distance of the +point (x, y) from the origin. +

+
+
if(x, y)
+

Evaluate x, and if the result is non-zero return the result of +the evaluation of y, return 0 otherwise. +

+
+
if(x, y, z)
+

Evaluate x, and if the result is non-zero return the evaluation +result of y, otherwise the evaluation result of z. +

+
+
ifnot(x, y)
+

Evaluate x, and if the result is zero return the result of the +evaluation of y, return 0 otherwise. +

+
+
ifnot(x, y, z)
+

Evaluate x, and if the result is zero return the evaluation +result of y, otherwise the evaluation result of z. +

+
+
isinf(x)
+

Return 1.0 if x is +/-INFINITY, 0.0 otherwise. +

+
+
isnan(x)
+

Return 1.0 if x is NAN, 0.0 otherwise. +

+
+
ld(var)
+

Load the value of the internal variable with number +var, which was previously stored with st(var, expr). +The function returns the loaded value. +

+
+
lerp(x, y, z)
+

Return linear interpolation between x and y by amount of z. +

+
+
log(x)
+

Compute natural logarithm of x. +

+
+
lt(x, y)
+

Return 1 if x is lesser than y, 0 otherwise. +

+
+
lte(x, y)
+

Return 1 if x is lesser than or equal to y, 0 otherwise. +

+
+
max(x, y)
+

Return the maximum between x and y. +

+
+
min(x, y)
+

Return the minimum between x and y. +

+
+
mod(x, y)
+

Compute the remainder of division of x by y. +

+
+
not(expr)
+

Return 1.0 if expr is zero, 0.0 otherwise. +

+
+
pow(x, y)
+

Compute the power of x elevated y, it is equivalent to +"(x)^(y)". +

+
+
print(t)
+
print(t, l)
+

Print the value of expression t with loglevel l. If +l is not specified then a default log level is used. +Returns the value of the expression printed. +

+

Prints t with loglevel l +

+
+
random(x)
+

Return a pseudo random value between 0.0 and 1.0. x is the index of the +internal variable which will be used to save the seed/state. +

+
+
root(expr, max)
+

Find an input value for which the function represented by expr +with argument ld(0) is 0 in the interval 0..max. +

+

The expression in expr must denote a continuous function or the +result is undefined. +

+

ld(0) is used to represent the function input value, which means +that the given expression will be evaluated multiple times with +various input values that the expression can access through +ld(0). When the expression evaluates to 0 then the +corresponding input value will be returned. +

+
+
round(expr)
+

Round the value of expression expr to the nearest integer. For example, "round(1.5)" is "2.0". +

+
+
sgn(x)
+

Compute sign of x. +

+
+
sin(x)
+

Compute sine of x. +

+
+
sinh(x)
+

Compute hyperbolic sine of x. +

+
+
sqrt(expr)
+

Compute the square root of expr. This is equivalent to +"(expr)^.5". +

+
+
squish(x)
+

Compute expression 1/(1 + exp(4*x)). +

+
+
st(var, expr)
+

Store the value of the expression expr in an internal +variable. var specifies the number of the variable where to +store the value, and it is a value ranging from 0 to 9. The function +returns the value stored in the internal variable. +Note, Variables are currently not shared between expressions. +

+
+
tan(x)
+

Compute tangent of x. +

+
+
tanh(x)
+

Compute hyperbolic tangent of x. +

+
+
taylor(expr, x)
+
taylor(expr, x, id)
+

Evaluate a Taylor series at x, given an expression representing +the ld(id)-th derivative of a function at 0. +

+

When the series does not converge the result is undefined. +

+

ld(id) is used to represent the derivative order in expr, +which means that the given expression will be evaluated multiple times +with various input values that the expression can access through +ld(id). If id is not specified then 0 is assumed. +

+

Note, when you have the derivatives at y instead of 0, +taylor(expr, x-y) can be used. +

+
+
time(0)
+

Return the current (wallclock) time in seconds. +

+
+
trunc(expr)
+

Round the value of expression expr towards zero to the nearest +integer. For example, "trunc(-1.5)" is "-1.0". +

+
+
while(cond, expr)
+

Evaluate expression expr while the expression cond is +non-zero, and returns the value of the last expr evaluation, or +NAN if cond was always false. +

+
+ +

The following constants are available: +

+
PI
+

area of the unit disc, approximately 3.14 +

+
E
+

exp(1) (Euler’s number), approximately 2.718 +

+
PHI
+

golden ratio (1+sqrt(5))/2, approximately 1.618 +

+
+ +

Assuming that an expression is considered "true" if it has a non-zero +value, note that: +

+

* works like AND +

+

+ works like OR +

+

For example the construct: +

+
if (A AND B) then C
+
+

is equivalent to: +

+
if(A*B, C)
+
+ +

In your C code, you can extend the list of unary and binary functions, +and define recognized constants, so that they are available for your +expressions. +

+

The evaluator also recognizes the International System unit prefixes. +If ’i’ is appended after the prefix, binary prefixes are used, which +are based on powers of 1024 instead of powers of 1000. +The ’B’ postfix multiplies the value by 8, and can be appended after a +unit prefix or used alone. This allows using for example ’KB’, ’MiB’, +’G’ and ’B’ as number postfix. +

+

The list of available International System prefixes follows, with +indication of the corresponding powers of 10 and of 2. +

+
y
+

10^-24 / 2^-80 +

+
z
+

10^-21 / 2^-70 +

+
a
+

10^-18 / 2^-60 +

+
f
+

10^-15 / 2^-50 +

+
p
+

10^-12 / 2^-40 +

+
n
+

10^-9 / 2^-30 +

+
u
+

10^-6 / 2^-20 +

+
m
+

10^-3 / 2^-10 +

+
c
+

10^-2 +

+
d
+

10^-1 +

+
h
+

10^2 +

+
k
+

10^3 / 2^10 +

+
K
+

10^3 / 2^10 +

+
M
+

10^6 / 2^20 +

+
G
+

10^9 / 2^30 +

+
T
+

10^12 / 2^40 +

+
P
+

10^15 / 2^50 +

+
E
+

10^18 / 2^60 +

+
Z
+

10^21 / 2^70 +

+
Y
+

10^24 / 2^80 +

+
+ +
+
+

6 Codec Options

+ +

libavcodec provides some generic global options, which can be set on +all the encoders and decoders. In addition each codec may support +so-called private options, which are specific for a given codec. +

+

Sometimes, a global option may only affect a specific kind of codec, +and may be nonsensical or ignored by another, so you need to be aware +of the meaning of the specified options. Also some options are +meant only for decoding or encoding. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the +AVCodecContext options or using the libavutil/opt.h API +for programmatic use. +

+

The list of supported options follow: +

+
+
b integer (encoding,audio,video)
+

Set bitrate in bits/s. Default value is 200K. +

+
+
ab integer (encoding,audio)
+

Set audio bitrate (in bits/s). Default value is 128K. +

+
+
bt integer (encoding,video)
+

Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate +tolerance specifies how far ratecontrol is willing to deviate from the +target average bitrate value. This is not related to min/max +bitrate. Lowering tolerance too much has an adverse effect on quality. +

+
+
flags flags (decoding/encoding,audio,video,subtitles)
+

Set generic flags. +

+

Possible values: +

+
mv4
+

Use four motion vector by macroblock (mpeg4). +

+
qpel
+

Use 1/4 pel motion compensation. +

+
loop
+

Use loop filter. +

+
qscale
+

Use fixed qscale. +

+
pass1
+

Use internal 2pass ratecontrol in first pass mode. +

+
pass2
+

Use internal 2pass ratecontrol in second pass mode. +

+
gray
+

Only decode/encode grayscale. +

+
psnr
+

Set error[?] variables during encoding. +

+
truncated
+

Input bitstream might be randomly truncated. +

+
drop_changed
+

Don’t output frames whose parameters differ from first decoded frame in stream. +Error AVERROR_INPUT_CHANGED is returned when a frame is dropped. +

+
+
ildct
+

Use interlaced DCT. +

+
low_delay
+

Force low delay. +

+
global_header
+

Place global headers in extradata instead of every keyframe. +

+
bitexact
+

Only write platform-, build- and time-independent data. (except (I)DCT). +This ensures that file and data checksums are reproducible and match between +platforms. Its primary use is for regression testing. +

+
aic
+

Apply H263 advanced intra coding / mpeg4 ac prediction. +

+
ilme
+

Apply interlaced motion estimation. +

+
cgop
+

Use closed gop. +

+
output_corrupt
+

Output even potentially corrupted frames. +

+
+ +
+
time_base rational number
+

Set codec time base. +

+

It is the fundamental unit of time (in seconds) in terms of which +frame timestamps are represented. For fixed-fps content, timebase +should be 1 / frame_rate and timestamp increments should be +identically 1. +

+
+
g integer (encoding,video)
+

Set the group of picture (GOP) size. Default value is 12. +

+
+
ar integer (decoding/encoding,audio)
+

Set audio sampling rate (in Hz). +

+
+
ac integer (decoding/encoding,audio)
+

Set number of audio channels. +

+
+
cutoff integer (encoding,audio)
+

Set cutoff bandwidth. (Supported only by selected encoders, see +their respective documentation sections.) +

+
+
frame_size integer (encoding,audio)
+

Set audio frame size. +

+

Each submitted frame except the last must contain exactly frame_size +samples per channel. May be 0 when the codec has +CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not +restricted. It is set by some decoders to indicate constant frame +size. +

+
+
frame_number integer
+

Set the frame number. +

+
+
delay integer
+
qcomp float (encoding,video)
+

Set video quantizer scale compression (VBR). It is used as a constant +in the ratecontrol equation. Recommended range for default rc_eq: +0.0-1.0. +

+
+
qblur float (encoding,video)
+

Set video quantizer scale blur (VBR). +

+
+
qmin integer (encoding,video)
+

Set min video quantizer scale (VBR). Must be included between -1 and +69, default value is 2. +

+
+
qmax integer (encoding,video)
+

Set max video quantizer scale (VBR). Must be included between -1 and +1024, default value is 31. +

+
+
qdiff integer (encoding,video)
+

Set max difference between the quantizer scale (VBR). +

+
+
bf integer (encoding,video)
+

Set max number of B frames between non-B-frames. +

+

Must be an integer between -1 and 16. 0 means that B-frames are +disabled. If a value of -1 is used, it will choose an automatic value +depending on the encoder. +

+

Default value is 0. +

+
+
b_qfactor float (encoding,video)
+

Set qp factor between P and B frames. +

+
+
codec_tag integer
+
bug flags (decoding,video)
+

Workaround not auto detected encoder bugs. +

+

Possible values: +

+
autodetect
+
xvid_ilace
+

Xvid interlacing bug (autodetected if fourcc==XVIX) +

+
ump4
+

(autodetected if fourcc==UMP4) +

+
no_padding
+

padding bug (autodetected) +

+
amv
+
qpel_chroma
+
std_qpel
+

old standard qpel (autodetected per fourcc/version) +

+
qpel_chroma2
+
direct_blocksize
+

direct-qpel-blocksize bug (autodetected per fourcc/version) +

+
edge
+

edge padding bug (autodetected per fourcc/version) +

+
hpel_chroma
+
dc_clip
+
ms
+

Workaround various bugs in microsoft broken decoders. +

+
trunc
+

trancated frames +

+
+ +
+
strict integer (decoding/encoding,audio,video)
+

Specify how strictly to follow the standards. +

+

Possible values: +

+
very
+

strictly conform to an older more strict version of the spec or reference software +

+
strict
+

strictly conform to all the things in the spec no matter what consequences +

+
normal
+
unofficial
+

allow unofficial extensions +

+
experimental
+

allow non standardized experimental things, experimental +(unfinished/work in progress/not well tested) decoders and encoders. +Note: experimental decoders can pose a security risk, do not use this for +decoding untrusted input. +

+
+ +
+
b_qoffset float (encoding,video)
+

Set QP offset between P and B frames. +

+
+
err_detect flags (decoding,audio,video)
+

Set error detection flags. +

+

Possible values: +

+
crccheck
+

verify embedded CRCs +

+
bitstream
+

detect bitstream specification deviations +

+
buffer
+

detect improper bitstream length +

+
explode
+

abort decoding on minor error detection +

+
ignore_err
+

ignore decoding errors, and continue decoding. +This is useful if you want to analyze the content of a video and thus want +everything to be decoded no matter what. This option will not result in a video +that is pleasing to watch in case of errors. +

+
careful
+

consider things that violate the spec and have not been seen in the wild as errors +

+
compliant
+

consider all spec non compliancies as errors +

+
aggressive
+

consider things that a sane encoder should not do as an error +

+
+ +
+
has_b_frames integer
+
block_align integer
+
rc_override_count integer
+
maxrate integer (encoding,audio,video)
+

Set max bitrate tolerance (in bits/s). Requires bufsize to be set. +

+
+
minrate integer (encoding,audio,video)
+

Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR +encode. It is of little use elsewise. +

+
+
bufsize integer (encoding,audio,video)
+

Set ratecontrol buffer size (in bits). +

+
+
i_qfactor float (encoding,video)
+

Set QP factor between P and I frames. +

+
+
i_qoffset float (encoding,video)
+

Set QP offset between P and I frames. +

+
+
dct integer (encoding,video)
+

Set DCT algorithm. +

+

Possible values: +

+
auto
+

autoselect a good one (default) +

+
fastint
+

fast integer +

+
int
+

accurate integer +

+
mmx
+
altivec
+
faan
+

floating point AAN DCT +

+
+ +
+
lumi_mask float (encoding,video)
+

Compress bright areas stronger than medium ones. +

+
+
tcplx_mask float (encoding,video)
+

Set temporal complexity masking. +

+
+
scplx_mask float (encoding,video)
+

Set spatial complexity masking. +

+
+
p_mask float (encoding,video)
+

Set inter masking. +

+
+
dark_mask float (encoding,video)
+

Compress dark areas stronger than medium ones. +

+
+
idct integer (decoding/encoding,video)
+

Select IDCT implementation. +

+

Possible values: +

+
auto
+
int
+
simple
+
simplemmx
+
simpleauto
+

Automatically pick a IDCT compatible with the simple one +

+
+
arm
+
altivec
+
sh4
+
simplearm
+
simplearmv5te
+
simplearmv6
+
simpleneon
+
xvid
+
faani
+

floating point AAN IDCT +

+
+ +
+
slice_count integer
+
ec flags (decoding,video)
+

Set error concealment strategy. +

+

Possible values: +

+
guess_mvs
+

iterative motion vector (MV) search (slow) +

+
deblock
+

use strong deblock filter for damaged MBs +

+
favor_inter
+

favor predicting from the previous frame instead of the current +

+
+ +
+
bits_per_coded_sample integer
+
aspect rational number (encoding,video)
+

Set sample aspect ratio. +

+
+
sar rational number (encoding,video)
+

Set sample aspect ratio. Alias to aspect. +

+
+
debug flags (decoding/encoding,audio,video,subtitles)
+

Print specific debug info. +

+

Possible values: +

+
pict
+

picture info +

+
rc
+

rate control +

+
bitstream
+
mb_type
+

macroblock (MB) type +

+
qp
+

per-block quantization parameter (QP) +

+
dct_coeff
+
green_metadata
+

display complexity metadata for the upcoming frame, GoP or for a given duration. +

+
+
skip
+
startcode
+
er
+

error recognition +

+
mmco
+

memory management control operations (H.264) +

+
bugs
+
buffers
+

picture buffer allocations +

+
thread_ops
+

threading operations +

+
nomc
+

skip motion compensation +

+
+ +
+
cmp integer (encoding,video)
+

Set full pel me compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
subcmp integer (encoding,video)
+

Set sub pel me compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
mbcmp integer (encoding,video)
+

Set macroblock compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
ildctcmp integer (encoding,video)
+

Set interlaced dct compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
dia_size integer (encoding,video)
+

Set diamond type & size for motion estimation. +

+
(1024, INT_MAX)
+

full motion estimation(slowest) +

+
(768, 1024]
+

umh motion estimation +

+
(512, 768]
+

hex motion estimation +

+
(256, 512]
+

l2s diamond motion estimation +

+
[2,256]
+

var diamond motion estimation +

+
(-1, 2)
+

small diamond motion estimation +

+
-1
+

funny diamond motion estimation +

+
(INT_MIN, -1)
+

sab diamond motion estimation +

+
+ +
+
last_pred integer (encoding,video)
+

Set amount of motion predictors from the previous frame. +

+
+
precmp integer (encoding,video)
+

Set pre motion estimation compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
pre_dia_size integer (encoding,video)
+

Set diamond type & size for motion estimation pre-pass. +

+
+
subq integer (encoding,video)
+

Set sub pel motion estimation quality. +

+
+
me_range integer (encoding,video)
+

Set limit motion vectors range (1023 for DivX player). +

+
+
global_quality integer (encoding,audio,video)
+
slice_flags integer
+
mbd integer (encoding,video)
+

Set macroblock decision algorithm (high quality mode). +

+

Possible values: +

+
simple
+

use mbcmp (default) +

+
bits
+

use fewest bits +

+
rd
+

use best rate distortion +

+
+ +
+
rc_init_occupancy integer (encoding,video)
+

Set number of bits which should be loaded into the rc buffer before +decoding starts. +

+
+
flags2 flags (decoding/encoding,audio,video,subtitles)
+
+

Possible values: +

+
fast
+

Allow non spec compliant speedup tricks. +

+
noout
+

Skip bitstream encoding. +

+
ignorecrop
+

Ignore cropping information from sps. +

+
local_header
+

Place global headers at every keyframe instead of in extradata. +

+
chunks
+

Frame data might be split into multiple chunks. +

+
showall
+

Show all frames before the first keyframe. +

+
export_mvs
+

Export motion vectors into frame side-data (see AV_FRAME_DATA_MOTION_VECTORS) +for codecs that support it. See also doc/examples/export_mvs.c. +

+
skip_manual
+

Do not skip samples and export skip information as frame side data. +

+
ass_ro_flush_noop
+

Do not reset ASS ReadOrder field on flush. +

+
icc_profiles
+

Generate/parse embedded ICC profiles from/to colorimetry tags. +

+
+ +
+
export_side_data flags (decoding/encoding,audio,video,subtitles)
+
+

Possible values: +

+
mvs
+

Export motion vectors into frame side-data (see AV_FRAME_DATA_MOTION_VECTORS) +for codecs that support it. See also doc/examples/export_mvs.c. +

+
prft
+

Export encoder Producer Reference Time into packet side-data (see AV_PKT_DATA_PRFT) +for codecs that support it. +

+
venc_params
+

Export video encoding parameters through frame side data (see AV_FRAME_DATA_VIDEO_ENC_PARAMS) +for codecs that support it. At present, those are H.264 and VP9. +

+
film_grain
+

Export film grain parameters through frame side data (see AV_FRAME_DATA_FILM_GRAIN_PARAMS). +Supported at present by AV1 decoders. +

+
+ +
+
threads integer (decoding/encoding,video)
+

Set the number of threads to be used, in case the selected codec +implementation supports multi-threading. +

+

Possible values: +

+
auto, 0
+

automatically select the number of threads to set +

+
+ +

Default value is ‘auto’. +

+
+
dc integer (encoding,video)
+

Set intra_dc_precision. +

+
+
nssew integer (encoding,video)
+

Set nsse weight. +

+
+
skip_top integer (decoding,video)
+

Set number of macroblock rows at the top which are skipped. +

+
+
skip_bottom integer (decoding,video)
+

Set number of macroblock rows at the bottom which are skipped. +

+
+
profile integer (encoding,audio,video)
+
+

Set encoder codec profile. Default value is ‘unknown’. Encoder specific +profiles are documented in the relevant encoder documentation. +

+
+
level integer (encoding,audio,video)
+
+

Possible values: +

+
unknown
+
+ +
+
lowres integer (decoding,audio,video)
+

Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions. +

+
+
mblmin integer (encoding,video)
+

Set min macroblock lagrange factor (VBR). +

+
+
mblmax integer (encoding,video)
+

Set max macroblock lagrange factor (VBR). +

+
+
skip_loop_filter integer (decoding,video)
+
skip_idct integer (decoding,video)
+
skip_frame integer (decoding,video)
+
+

Make decoder discard processing depending on the frame type selected +by the option value. +

+

skip_loop_filter skips frame loop filtering, skip_idct +skips frame IDCT/dequantization, skip_frame skips decoding. +

+

Possible values: +

+
none
+

Discard no frame. +

+
+
default
+

Discard useless frames like 0-sized frames. +

+
+
noref
+

Discard all non-reference frames. +

+
+
bidir
+

Discard all bidirectional frames. +

+
+
nokey
+

Discard all frames excepts keyframes. +

+
+
nointra
+

Discard all frames except I frames. +

+
+
all
+

Discard all frames. +

+
+ +

Default value is ‘default’. +

+
+
bidir_refine integer (encoding,video)
+

Refine the two motion vectors used in bidirectional macroblocks. +

+
+
keyint_min integer (encoding,video)
+

Set minimum interval between IDR-frames. +

+
+
refs integer (encoding,video)
+

Set reference frames to consider for motion compensation. +

+
+
trellis integer (encoding,audio,video)
+

Set rate-distortion optimal quantization. +

+
+
mv0_threshold integer (encoding,video)
+
compression_level integer (encoding,audio,video)
+
bits_per_raw_sample integer
+
channel_layout integer (decoding/encoding,audio)
+
+

Possible values: +

+
request_channel_layout integer (decoding,audio)
+
+

Possible values: +

+
rc_max_vbv_use float (encoding,video)
+
rc_min_vbv_use float (encoding,video)
+
color_primaries integer (decoding/encoding,video)
+

Possible values: +

+
bt709
+

BT.709 +

+
bt470m
+

BT.470 M +

+
bt470bg
+

BT.470 BG +

+
smpte170m
+

SMPTE 170 M +

+
smpte240m
+

SMPTE 240 M +

+
film
+

Film +

+
bt2020
+

BT.2020 +

+
smpte428
+
smpte428_1
+

SMPTE ST 428-1 +

+
smpte431
+

SMPTE 431-2 +

+
smpte432
+

SMPTE 432-1 +

+
jedec-p22
+

JEDEC P22 +

+
+ +
+
color_trc integer (decoding/encoding,video)
+

Possible values: +

+
bt709
+

BT.709 +

+
gamma22
+

BT.470 M +

+
gamma28
+

BT.470 BG +

+
smpte170m
+

SMPTE 170 M +

+
smpte240m
+

SMPTE 240 M +

+
linear
+

Linear +

+
log
+
log100
+

Log +

+
log_sqrt
+
log316
+

Log square root +

+
iec61966_2_4
+
iec61966-2-4
+

IEC 61966-2-4 +

+
bt1361
+
bt1361e
+

BT.1361 +

+
iec61966_2_1
+
iec61966-2-1
+

IEC 61966-2-1 +

+
bt2020_10
+
bt2020_10bit
+

BT.2020 - 10 bit +

+
bt2020_12
+
bt2020_12bit
+

BT.2020 - 12 bit +

+
smpte2084
+

SMPTE ST 2084 +

+
smpte428
+
smpte428_1
+

SMPTE ST 428-1 +

+
arib-std-b67
+

ARIB STD-B67 +

+
+ +
+
colorspace integer (decoding/encoding,video)
+

Possible values: +

+
rgb
+

RGB +

+
bt709
+

BT.709 +

+
fcc
+

FCC +

+
bt470bg
+

BT.470 BG +

+
smpte170m
+

SMPTE 170 M +

+
smpte240m
+

SMPTE 240 M +

+
ycocg
+

YCOCG +

+
bt2020nc
+
bt2020_ncl
+

BT.2020 NCL +

+
bt2020c
+
bt2020_cl
+

BT.2020 CL +

+
smpte2085
+

SMPTE 2085 +

+
chroma-derived-nc
+

Chroma-derived NCL +

+
chroma-derived-c
+

Chroma-derived CL +

+
ictcp
+

ICtCp +

+
+ +
+
color_range integer (decoding/encoding,video)
+

If used as input parameter, it serves as a hint to the decoder, which +color_range the input has. +Possible values: +

+
tv
+
mpeg
+

MPEG (219*2^(n-8)) +

+
pc
+
jpeg
+

JPEG (2^n-1) +

+
+ +
+
chroma_sample_location integer (decoding/encoding,video)
+

Possible values: +

+
left
+
center
+
topleft
+
top
+
bottomleft
+
bottom
+
+ +
+
log_level_offset integer
+

Set the log level offset. +

+
+
slices integer (encoding,video)
+

Number of slices, used in parallelized encoding. +

+
+
thread_type flags (decoding/encoding,video)
+

Select which multithreading methods to use. +

+

Use of ‘frame’ will increase decoding delay by one frame per +thread, so clients which cannot provide future frames should not use +it. +

+

Possible values: +

+
slice
+

Decode more than one part of a single frame at once. +

+

Multithreading using slices works only when the video was encoded with +slices. +

+
+
frame
+

Decode more than one frame at once. +

+
+ +

Default value is ‘slice+frame’. +

+
+
audio_service_type integer (encoding,audio)
+

Set audio service type. +

+

Possible values: +

+
ma
+

Main Audio Service +

+
ef
+

Effects +

+
vi
+

Visually Impaired +

+
hi
+

Hearing Impaired +

+
di
+

Dialogue +

+
co
+

Commentary +

+
em
+

Emergency +

+
vo
+

Voice Over +

+
ka
+

Karaoke +

+
+ +
+
request_sample_fmt sample_fmt (decoding,audio)
+

Set sample format audio decoders should prefer. Default value is +none. +

+
+
pkt_timebase rational number
+
sub_charenc encoding (decoding,subtitles)
+

Set the input subtitles character encoding. +

+
+
field_order field_order (video)
+

Set/override the field order of the video. +Possible values: +

+
progressive
+

Progressive video +

+
tt
+

Interlaced video, top field coded and displayed first +

+
bb
+

Interlaced video, bottom field coded and displayed first +

+
tb
+

Interlaced video, top coded first, bottom displayed first +

+
bt
+

Interlaced video, bottom coded first, top displayed first +

+
+ +
+
skip_alpha bool (decoding,video)
+

Set to 1 to disable processing alpha (transparency). This works like the +‘gray’ flag in the flags option which skips chroma information +instead of alpha. Default is 0. +

+
+
codec_whitelist list (input)
+

"," separated list of allowed decoders. By default all are allowed. +

+
+
dump_separator string (input)
+

Separator used to separate the fields printed on the command line about the +Stream parameters. +For example, to separate the fields with newlines and indentation: +

+
ffprobe -dump_separator "
+                          "  -i ~/videos/matrixbench_mpeg2.mpg
+
+ +
+
max_pixels integer (decoding/encoding,video)
+

Maximum number of pixels per image. This value can be used to avoid out of +memory failures due to large images. +

+
+
apply_cropping bool (decoding,video)
+

Enable cropping if cropping parameters are multiples of the required +alignment for the left and top parameters. If the alignment is not met the +cropping will be partially applied to maintain alignment. +Default is 1 (enabled). +Note: The required alignment depends on if AV_CODEC_FLAG_UNALIGNED is set and the +CPU. AV_CODEC_FLAG_UNALIGNED cannot be changed from the command line. Also hardware +decoders will not apply left/top Cropping. +

+ +
+
+ + +
+
+

7 Decoders

+ +

Decoders are configured elements in FFmpeg which allow the decoding of +multimedia streams. +

+

When you configure your FFmpeg build, all the supported native decoders +are enabled by default. Decoders requiring an external library must be enabled +manually via the corresponding --enable-lib option. You can list all +available decoders using the configure option --list-decoders. +

+

You can disable all the decoders with the configure option +--disable-decoders and selectively enable / disable single decoders +with the options --enable-decoder=DECODER / +--disable-decoder=DECODER. +

+

The option -decoders of the ff* tools will display the list of +enabled decoders. +

+ +
+
+

8 Video Decoders

+ +

A description of some of the currently available video decoders +follows. +

+ +
+

8.1 av1

+ +

AOMedia Video 1 (AV1) decoder. +

+ +
+

8.1.1 Options

+ +
+
operating_point
+

Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0. +

+
+
+ +
+
+
+

8.2 rawvideo

+ +

Raw video decoder. +

+

This decoder decodes rawvideo streams. +

+ +
+

8.2.1 Options

+ +
+
top top_field_first
+

Specify the assumed field type of the input video. +

+
-1
+

the video is assumed to be progressive (default) +

+
0
+

bottom-field-first is assumed +

+
1
+

top-field-first is assumed +

+
+ +
+
+ +
+
+
+

8.3 libdav1d

+ +

dav1d AV1 decoder. +

+

libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec. +Requires the presence of the libdav1d headers and library during configuration. +You need to explicitly configure the build with --enable-libdav1d. +

+ +
+

8.3.1 Options

+ +

The following options are supported by the libdav1d wrapper. +

+
+
framethreads
+

Set amount of frame threads to use during decoding. The default value is 0 (autodetect). +This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the +option max_frame_delay and the global option threads instead. +

+
+
tilethreads
+

Set amount of tile threads to use during decoding. The default value is 0 (autodetect). +This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the +global option threads instead. +

+
+
max_frame_delay
+

Set max amount of frames the decoder may buffer internally. The default value is 0 +(autodetect). +

+
+
filmgrain
+

Apply film grain to the decoded video if present in the bitstream. Defaults to the +internal default of the library. +This option is deprecated and will be removed in the future. See the global option +export_side_data to export Film Grain parameters instead of applying it. +

+
+
oppoint
+

Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the +internal default of the library. +

+
+
alllayers
+

Output all spatial layers of a scalable AV1 bitstream. The default value is false. +

+
+
+ +
+
+
+

8.4 libdavs2

+ +

AVS2-P2/IEEE1857.4 video decoder wrapper. +

+

This decoder allows libavcodec to decode AVS2 streams with davs2 library. +

+ +
+
+

8.5 libuavs3d

+ +

AVS3-P2/IEEE1857.10 video decoder. +

+

libuavs3d allows libavcodec to decode AVS3 streams. +Requires the presence of the libuavs3d headers and library during configuration. +You need to explicitly configure the build with --enable-libuavs3d. +

+ +
+

8.5.1 Options

+ +

The following option is supported by the libuavs3d wrapper. +

+
+
frame_threads
+

Set amount of frame threads to use during decoding. The default value is 0 (autodetect). +

+
+
+ +
+
+
+

8.6 QSV Decoders

+ +

The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC, +JPEG/MJPEG, VP8, VP9, AV1). +

+ +
+

8.6.1 Common Options

+ +

The following options are supported by all qsv decoders. +

+
+
async_depth
+

Internal parallelization depth, the higher the value the higher the latency. +

+
+
gpu_copy
+

A GPU-accelerated copy between video and system memory +

+
default
+
on
+
off
+
+ +
+
+ +
+
+

8.6.2 HEVC Options

+

Extra options for hevc_qsv. +

+
+
load_plugin
+

A user plugin to load in an internal session +

+
none
+
hevc_sw
+
hevc_hw
+
+ +
+
load_plugins
+

A :-separate list of hexadecimal plugin UIDs to load in an internal session +

+
+
+ +
+
+
+

8.7 v210

+ +

Uncompressed 4:2:2 10-bit decoder. +

+ +
+

8.7.1 Options

+ +
+
custom_stride
+

Set the line size of the v210 data in bytes. The default value is 0 +(autodetect). You can use the special -1 value for a strideless v210 as seen in +BOXX files. +

+
+
+ + +
+
+
+
+

9 Audio Decoders

+ +

A description of some of the currently available audio decoders +follows. +

+ +
+

9.1 ac3

+ +

AC-3 audio decoder. +

+

This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as +the undocumented RealAudio 3 (a.k.a. dnet). +

+ +
+

9.1.1 AC-3 Decoder Options

+ +
+
-drc_scale value
+

Dynamic Range Scale Factor. The factor to apply to dynamic range values +from the AC-3 stream. This factor is applied exponentially. The default value is 1. +There are 3 notable scale factor ranges: +

+
drc_scale == 0
+

DRC disabled. Produces full range audio. +

+
0 < drc_scale <= 1
+

DRC enabled. Applies a fraction of the stream DRC value. +Audio reproduction is between full range and full compression. +

+
drc_scale > 1
+

DRC enabled. Applies drc_scale asymmetrically. +Loud sounds are fully compressed. Soft sounds are enhanced. +

+
+ +
+
+ +
+
+
+

9.2 flac

+ +

FLAC audio decoder. +

+

This decoder aims to implement the complete FLAC specification from Xiph. +

+ +
+

9.2.1 FLAC Decoder options

+ +
+
-use_buggy_lpc
+

The lavc FLAC encoder used to produce buggy streams with high lpc values +(like the default value). This option makes it possible to decode such streams +correctly by using lavc’s old buggy lpc logic for decoding. +

+
+
+ +
+
+
+

9.3 ffwavesynth

+ +

Internal wave synthesizer. +

+

This decoder generates wave patterns according to predefined sequences. Its +use is purely internal and the format of the data it accepts is not publicly +documented. +

+
+
+

9.4 libcelt

+ +

libcelt decoder wrapper. +

+

libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec. +Requires the presence of the libcelt headers and library during configuration. +You need to explicitly configure the build with --enable-libcelt. +

+
+
+

9.5 libgsm

+ +

libgsm decoder wrapper. +

+

libgsm allows libavcodec to decode the GSM full rate audio codec. Requires +the presence of the libgsm headers and library during configuration. You need +to explicitly configure the build with --enable-libgsm. +

+

This decoder supports both the ordinary GSM and the Microsoft variant. +

+
+
+

9.6 libilbc

+ +

libilbc decoder wrapper. +

+

libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC) +audio codec. Requires the presence of the libilbc headers and library during +configuration. You need to explicitly configure the build with +--enable-libilbc. +

+ +
+

9.6.1 Options

+ +

The following option is supported by the libilbc wrapper. +

+
+
enhance
+
+

Enable the enhancement of the decoded audio when set to 1. The default +value is 0 (disabled). +

+
+
+ +
+
+
+

9.7 libopencore-amrnb

+ +

libopencore-amrnb decoder wrapper. +

+

libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate +Narrowband audio codec. Using it requires the presence of the +libopencore-amrnb headers and library during configuration. You need to +explicitly configure the build with --enable-libopencore-amrnb. +

+

An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB +without this library. +

+
+
+

9.8 libopencore-amrwb

+ +

libopencore-amrwb decoder wrapper. +

+

libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate +Wideband audio codec. Using it requires the presence of the +libopencore-amrwb headers and library during configuration. You need to +explicitly configure the build with --enable-libopencore-amrwb. +

+

An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB +without this library. +

+
+
+

9.9 libopus

+ +

libopus decoder wrapper. +

+

libopus allows libavcodec to decode the Opus Interactive Audio Codec. +Requires the presence of the libopus headers and library during +configuration. You need to explicitly configure the build with +--enable-libopus. +

+

An FFmpeg native decoder for Opus exists, so users can decode Opus +without this library. +

+ +
+
+
+

10 Subtitles Decoders

+ + +
+

10.1 libaribb24

+ +

ARIB STD-B24 caption decoder. +

+

Implements profiles A and C of the ARIB STD-B24 standard. +

+ +
+

10.1.1 libaribb24 Decoder Options

+ +
+
-aribb24-base-path path
+

Sets the base path for the libaribb24 library. This is utilized for reading of +configuration files (for custom unicode conversions), and for dumping of +non-text symbols as images under that location. +

+

Unset by default. +

+
+
-aribb24-skip-ruby-text boolean
+

Tells the decoder wrapper to skip text blocks that contain half-height ruby +text. +

+

Enabled by default. +

+
+
+ +
+
+
+

10.2 libaribcaption

+ +

Yet another ARIB STD-B24 caption decoder using external libaribcaption +library. +

+

Implements profiles A and C of the Japanse ARIB STD-B24 standard, +Brazilian ABNT NBR 15606-1, and Philippines version of ISDB-T. +

+

Requires the presence of the libaribcaption headers and library +(https://github.com/xqq/libaribcaption) during configuration. +You need to explicitly configure the build with --enable-libaribcaption. +If both libaribb24 and libaribcaption are enabled, libaribcaption +decoder precedes. +

+ +
+

10.2.1 libaribcaption Decoder Options

+ +
+
-sub_type subtitle_type
+

Specifies the format of the decoded subtitles. +

+
+
bitmap
+

Graphical image. +

+
ass
+

ASS formatted text. +

+
text
+

Simple text based output without formatting. +

+
+ +

The default is ass as same as libaribb24 decoder. +Some present players (e.g., mpv) expect ASS format for ARIB caption. +

+
+
-caption_encoding encoding_scheme
+

Specifies the encoding scheme of input subtitle text. +

+
+
auto
+

Automatically detect text encoding. +

+
jis
+

8bit-char JIS encoding defined in ARIB STD B24. +This encoding used in Japan for ISDB captions. +

+
utf8
+

UTF-8 encoding defined in ARIB STD B24. +This encoding is used in Philippines for ISDB-T captions. +

+
latin
+

Latin character encoding defined in ABNT NBR 15606-1. +This encoding is used in South America for SBTVD / ISDB-Tb captions. +

+
+ +

The default is ass as same as libaribb24 decoder. +Some present players (e.g., mpv) expect ASS format for ARIB caption. +

+
+
-font font_name[,font_name2,...]
+

Specify comma-separated list of font family names to be used for bitmap +or ass type subtitle rendering. +Only first font name is used for ass type subtitle. +

+

If not specified, use internaly defined default font family. +

+
+
-ass_single_rect boolean
+

ARIB STD-B24 specifies that some captions may be displayed at different +positions at a time (multi-rectangle subtitle). +Since some players (e.g., old mpv) can’t handle multiple ASS rectangles +in a single AVSubtitle, or multiple ASS rectangles of indeterminate duration +with the same start timestamp, this option can change the behavior so that +all the texts are displayed in a single ASS rectangle. +

+

The default is false. +

+

If your player cannot handle AVSubtitles with multiple ASS rectangles properly, +set this option to true or define ASS_SINGLE_RECT=1 to change +default behavior at compilation. +

+
+
-replace_fullwidth_ascii boolean
+

Specify whether to replace MSZ (Middle Size, half width) fullwidth +alphanumerics with halfwidth alphanumerics. +

+

The default is true. +

+
+
-force_outline_text boolean
+

Specify whether always render outline text for all characters regardless of +the indication by charactor style. +

+

The default is false. +

+
+
-outline_width number (0.0 - 3.0)
+

Specify width for outline text, in dots (relative). +

+

The default is 1.5. +

+
+
-ignore_background boolean
+

Specify whether to ignore background color rendering. +

+

The default is false. +

+
+
-ignore_ruby boolean
+

Specify whether to ignore rendering for ruby-like (furigana) characters. +

+

The default is false. +

+
+
-replace_drcs boolean
+

Specify whether to render replaced DRCS characters as Unicode characters. +

+

The default is true. +

+
+
-canvas_size image_size
+

Specify the resolution of the canvas to render subtitles to; usually, this +should be frame size of input video. +This only applies when -subtitle_type is set to bitmap. +

+

The libaribcaption decoder assumes input frame size for bitmap rendering as below: +

    +
  1. PROFILE_A : 1440 x 1080 with SAR (PAR) 4:3 +
  2. PROFILE_C : 320 x 180 with SAR (PAR) 1:1 +
+ +

If actual frame size of input video does not match above assumption, +the rendered captions may be distorted. +To make the captions undistorted, add -canvas_size option to specify +actual input video size. +

+

Note that the -canvas_size option is not required for video with +different size but same aspect ratio. +In such cases, the caption will be stretched or shrunk to actual video size +if -canvas_size option is not specified. +If -canvas_size option is specified with different size, +the caption will be stretched or shrunk as specified size with calculated SAR. +

+
+
+ +
+
+

10.2.2 libaribcaption decoder usage examples

+ +

Display MPEG-TS file with ARIB subtitle by ffplay tool: +

+
ffplay -sub_type bitmap MPEG.TS
+
+ +

Display MPEG-TS file with input frame size 1920x1080 by ffplay tool: +

+
ffplay -sub_type bitmap -canvas_size 1920x1080 MPEG.TS
+
+ +

Embed ARIB subtitle in transcoded video: +

+
ffmpeg -sub_type bitmap -i src.m2t -filter_complex "[0:v][0:s]overlay" -vcodec h264 dest.mp4
+
+ +
+
+
+

10.3 dvbsub

+ + +
+

10.3.1 Options

+ +
+
compute_clut
+
+
-2
+

Compute clut once if no matching CLUT is in the stream. +

+
-1
+

Compute clut if no matching CLUT is in the stream. +

+
0
+

Never compute CLUT +

+
1
+

Always compute CLUT and override the one provided in the stream. +

+
+
+
dvb_substream
+

Selects the dvb substream, or all substreams if -1 which is default. +

+
+
+ +
+
+
+

10.4 dvdsub

+ +

This codec decodes the bitmap subtitles used in DVDs; the same subtitles can +also be found in VobSub file pairs and in some Matroska files. +

+ +
+

10.4.1 Options

+ +
+
palette
+

Specify the global palette used by the bitmaps. When stored in VobSub, the +palette is normally specified in the index file; in Matroska, the palette is +stored in the codec extra-data in the same format as in VobSub. In DVDs, the +palette is stored in the IFO file, and therefore not available when reading +from dumped VOB files. +

+

The format for this option is a string containing 16 24-bits hexadecimal +numbers (without 0x prefix) separated by commas, for example 0d00ee, +ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1, +7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b. +

+
+
ifo_palette
+

Specify the IFO file from which the global palette is obtained. +(experimental) +

+
+
forced_subs_only
+

Only decode subtitle entries marked as forced. Some titles have forced +and non-forced subtitles in the same track. Setting this flag to 1 +will only keep the forced subtitles. Default value is 0. +

+
+ +
+
+
+

10.5 libzvbi-teletext

+ +

Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext +subtitles. Requires the presence of the libzvbi headers and library during +configuration. You need to explicitly configure the build with +--enable-libzvbi. +

+ +
+

10.5.1 Options

+ +
+
txt_page
+

List of teletext page numbers to decode. Pages that do not match the specified +list are dropped. You may use the special * string to match all pages, +or subtitle to match all subtitle pages. +Default value is *. +

+
txt_default_region
+

Set default character set used for decoding, a value between 0 and 87 (see +ETS 300 706, Section 15, Table 32). Default value is -1, which does not +override the libzvbi default. This option is needed for some legacy level 1.0 +transmissions which cannot signal the proper charset. +

+
txt_chop_top
+

Discards the top teletext line. Default value is 1. +

+
txt_format
+

Specifies the format of the decoded subtitles. +

+
bitmap
+

The default format, you should use this for teletext pages, because certain +graphics and colors cannot be expressed in simple text or even ASS. +

+
text
+

Simple text based output without formatting. +

+
ass
+

Formatted ASS output, subtitle pages and teletext pages are returned in +different styles, subtitle pages are stripped down to text, but an effort is +made to keep the text alignment and the formatting. +

+
+
+
txt_left
+

X offset of generated bitmaps, default is 0. +

+
txt_top
+

Y offset of generated bitmaps, default is 0. +

+
txt_chop_spaces
+

Chops leading and trailing spaces and removes empty lines from the generated +text. This option is useful for teletext based subtitles where empty spaces may +be present at the start or at the end of the lines or empty lines may be +present between the subtitle lines because of double-sized teletext characters. +Default value is 1. +

+
txt_duration
+

Sets the display duration of the decoded teletext pages or subtitles in +milliseconds. Default value is -1 which means infinity or until the next +subtitle event comes. +

+
txt_transparent
+

Force transparent background of the generated teletext bitmaps. Default value +is 0 which means an opaque background. +

+
txt_opacity
+

Sets the opacity (0-255) of the teletext background. If +txt_transparent is not set, it only affects characters between a start +box and an end box, typically subtitles. Default value is 0 if +txt_transparent is set, 255 otherwise. +

+
+
+ +
+
+
+
+

11 Bitstream Filters

+ +

When you configure your FFmpeg build, all the supported bitstream +filters are enabled by default. You can list all available ones using +the configure option --list-bsfs. +

+

You can disable all the bitstream filters using the configure option +--disable-bsfs, and selectively enable any bitstream filter using +the option --enable-bsf=BSF, or you can disable a particular +bitstream filter using the option --disable-bsf=BSF. +

+

The option -bsfs of the ff* tools will display the list of +all the supported bitstream filters included in your build. +

+

The ff* tools have a -bsf option applied per stream, taking a +comma-separated list of filters, whose parameters follow the filter +name after a ’=’. +

+
+
ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
+
+ +

Below is a description of the currently available bitstream filters, +with their parameters, if any. +

+ +
+

11.1 aac_adtstoasc

+ +

Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration +bitstream. +

+

This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4 +ADTS header and removes the ADTS header. +

+

This filter is required for example when copying an AAC stream from a +raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or +to MOV/MP4 files and related formats such as 3GP or M4A. Please note +that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats. +

+
+
+

11.2 av1_metadata

+ +

Modify metadata embedded in an AV1 stream. +

+
+
td
+

Insert or remove temporal delimiter OBUs in all temporal units of the +stream. +

+
+
insert
+

Insert a TD at the beginning of every TU which does not already have one. +

+
remove
+

Remove the TD from the beginning of every TU which has one. +

+
+ +
+
color_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the color description fields in the stream (see AV1 section 6.4.2). +

+
+
color_range
+

Set the color range in the stream (see AV1 section 6.4.2; note that +this cannot be set for streams using BT.709 primaries, sRGB transfer +characteristic and identity (RGB) matrix coefficients). +

+
tv
+

Limited range. +

+
pc
+

Full range. +

+
+ +
+
chroma_sample_position
+

Set the chroma sample location in the stream (see AV1 section 6.4.2). +This can only be set for 4:2:0 streams. +

+
+
vertical
+

Left position (matching the default in MPEG-2 and H.264). +

+
colocated
+

Top-left position. +

+
+ +
+
tick_rate
+

Set the tick rate (time_scale / num_units_in_display_tick) in +the timing info in the sequence header. +

+
num_ticks_per_picture
+

Set the number of ticks in each picture, to indicate that the stream +has a fixed framerate. Ignored if tick_rate is not also set. +

+
+
delete_padding
+

Deletes Padding OBUs. +

+
+
+ +
+
+

11.3 chomp

+ +

Remove zero padding at the end of a packet. +

+
+
+

11.4 dca_core

+ +

Extract the core from a DCA/DTS stream, dropping extensions such as +DTS-HD. +

+
+
+

11.5 dump_extra

+ +

Add extradata to the beginning of the filtered packets except when +said packets already exactly begin with the extradata that is intended +to be added. +

+
+
freq
+

The additional argument specifies which packets should be filtered. +It accepts the values: +

+
k
+
keyframe
+

add extradata to all key packets +

+
+
e
+
all
+

add extradata to all packets +

+
+
+
+ +

If not specified it is assumed ‘k’. +

+

For example the following ffmpeg command forces a global +header (thus disabling individual packet headers) in the H.264 packets +generated by the libx264 encoder, but corrects them by adding +the header stored in extradata to the key packets: +

+
ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
+
+ +
+
+

11.6 dv_error_marker

+ +

Blocks in DV which are marked as damaged are replaced by blocks of the specified color. +

+
+
color
+

The color to replace damaged blocks by +

+
sta
+

A 16 bit mask which specifies which of the 16 possible error status values are +to be replaced by colored blocks. 0xFFFE is the default which replaces all non 0 +error status values. +

+
ok
+

No error, no concealment +

+
err
+

Error, No concealment +

+
res
+

Reserved +

+
notok
+

Error or concealment +

+
notres
+

Not reserved +

+
Aa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru
+

The specific error status code +

+
+

see page 44-46 or section 5.5 of +http://web.archive.org/web/20060927044735/http://www.smpte.org/smpte_store/standards/pdf/s314m.pdf +

+
+
+ +
+
+

11.7 eac3_core

+ +

Extract the core from a E-AC-3 stream, dropping extra channels. +

+
+
+

11.8 extract_extradata

+ +

Extract the in-band extradata. +

+

Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers, +or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either "in-band" (i.e. as a part +of the bitstream containing the coded frames) or "out of band" (e.g. on the +container level). This latter form is called "extradata" in FFmpeg terminology. +

+

This bitstream filter detects the in-band headers and makes them available as +extradata. +

+
+
remove
+

When this option is enabled, the long-term headers are removed from the +bitstream after extraction. +

+
+ +
+
+

11.9 filter_units

+ +

Remove units with types in or not in a given set from the stream. +

+
+
pass_types
+

List of unit types or ranges of unit types to pass through while removing +all others. This is specified as a ’|’-separated list of unit type values +or ranges of values with ’-’. +

+
+
remove_types
+

Identical to pass_types, except the units in the given set +removed and all others passed through. +

+
+ +

Extradata is unchanged by this transformation, but note that if the stream +contains inline parameter sets then the output may be unusable if they are +removed. +

+

For example, to remove all non-VCL NAL units from an H.264 stream: +

+
ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
+
+ +

To remove all AUDs, SEI and filler from an H.265 stream: +

+
ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
+
+ +
+
+

11.10 hapqa_extract

+ +

Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file. +

+
+
texture
+

Specifies the texture to keep. +

+
+
color
+
alpha
+
+ +
+
+ +

Convert HAPQA to HAPQ +

+
ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=color -tag:v HapY -metadata:s:v:0 encoder="HAPQ" hapq_file.mov
+
+ +

Convert HAPQA to HAPAlphaOnly +

+
ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=alpha -tag:v HapA -metadata:s:v:0 encoder="HAPAlpha Only" hapalphaonly_file.mov
+
+ +
+
+

11.11 h264_metadata

+ +

Modify metadata embedded in an H.264 stream. +

+
+
aud
+

Insert or remove AUD NAL units in all access units of the stream. +

+
+
pass
+
insert
+
remove
+
+ +

Default is pass. +

+
+
sample_aspect_ratio
+

Set the sample aspect ratio of the stream in the VUI parameters. +See H.264 table E-1. +

+
+
overscan_appropriate_flag
+

Set whether the stream is suitable for display using overscan +or not (see H.264 section E.2.1). +

+
+
video_format
+
video_full_range_flag
+

Set the video format in the stream (see H.264 section E.2.1 and +table E-2). +

+
+
colour_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the colour description in the stream (see H.264 section E.2.1 +and tables E-3, E-4 and E-5). +

+
+
chroma_sample_loc_type
+

Set the chroma sample location in the stream (see H.264 section +E.2.1 and figure E-1). +

+
+
tick_rate
+

Set the tick rate (time_scale / num_units_in_tick) in the VUI +parameters. This is the smallest time unit representable in the +stream, and in many cases represents the field rate of the stream +(double the frame rate). +

+
fixed_frame_rate_flag
+

Set whether the stream has fixed framerate - typically this indicates +that the framerate is exactly half the tick rate, but the exact +meaning is dependent on interlacing and the picture structure (see +H.264 section E.2.1 and table E-6). +

+
zero_new_constraint_set_flags
+

Zero constraint_set4_flag and constraint_set5_flag in the SPS. These +bits were reserved in a previous version of the H.264 spec, and thus +some hardware decoders require these to be zero. The result of zeroing +this is still a valid bitstream. +

+
+
crop_left
+
crop_right
+
crop_top
+
crop_bottom
+

Set the frame cropping offsets in the SPS. These values will replace +the current ones if the stream is already cropped. +

+

These fields are set in pixels. Note that some sizes may not be +representable if the chroma is subsampled or the stream is interlaced +(see H.264 section 7.4.2.1.1). +

+
+
sei_user_data
+

Insert a string as SEI unregistered user data. The argument must +be of the form UUID+string, where the UUID is as hex digits +possibly separated by hyphens, and the string can be anything. +

+

For example, ‘086f3693-b7b3-4f2c-9653-21492feee5b8+hello’ will +insert the string “hello” associated with the given UUID. +

+
+
delete_filler
+

Deletes both filler NAL units and filler SEI messages. +

+
+
display_orientation
+

Insert, extract or remove Display orientation SEI messages. +See H.264 section D.1.27 and D.2.27 for syntax and semantics. +

+
+
pass
+
insert
+
remove
+
extract
+
+ +

Default is pass. +

+

Insert mode works in conjunction with rotate and flip options. +Any pre-existing Display orientation messages will be removed in insert or remove mode. +Extract mode attaches the display matrix to the packet as side data. +

+
+
rotate
+

Set rotation in display orientation SEI (anticlockwise angle in degrees). +Range is -360 to +360. Default is NaN. +

+
+
flip
+

Set flip in display orientation SEI. +

+
+
horizontal
+
vertical
+
+ +

Default is unset. +

+
+
level
+

Set the level in the SPS. Refer to H.264 section A.3 and tables A-1 +to A-5. +

+

The argument must be the name of a level (for example, ‘4.2’), a +level_idc value (for example, ‘42’), or the special name ‘auto’ +indicating that the filter should attempt to guess the level from the +input stream properties. +

+
+
+ +
+
+

11.12 h264_mp4toannexb

+ +

Convert an H.264 bitstream from length prefixed mode to start code +prefixed mode (as defined in the Annex B of the ITU-T H.264 +specification). +

+

This is required by some streaming formats, typically the MPEG-2 +transport stream format (muxer mpegts). +

+

For example to remux an MP4 file containing an H.264 stream to mpegts +format with ffmpeg, you can use the command: +

+
+
ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
+
+ +

Please note that this filter is auto-inserted for MPEG-TS (muxer +mpegts) and raw H.264 (muxer h264) output formats. +

+
+
+

11.13 h264_redundant_pps

+ +

This applies a specific fixup to some Blu-ray streams which contain +redundant PPSs modifying irrelevant parameters of the stream which +confuse other transformations which require correct extradata. +

+
+
+

11.14 hevc_metadata

+ +

Modify metadata embedded in an HEVC stream. +

+
+
aud
+

Insert or remove AUD NAL units in all access units of the stream. +

+
+
insert
+
remove
+
+ +
+
sample_aspect_ratio
+

Set the sample aspect ratio in the stream in the VUI parameters. +

+
+
video_format
+
video_full_range_flag
+

Set the video format in the stream (see H.265 section E.3.1 and +table E.2). +

+
+
colour_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the colour description in the stream (see H.265 section E.3.1 +and tables E.3, E.4 and E.5). +

+
+
chroma_sample_loc_type
+

Set the chroma sample location in the stream (see H.265 section +E.3.1 and figure E.1). +

+
+
tick_rate
+

Set the tick rate in the VPS and VUI parameters (time_scale / +num_units_in_tick). Combined with num_ticks_poc_diff_one, this can +set a constant framerate in the stream. Note that it is likely to be +overridden by container parameters when the stream is in a container. +

+
+
num_ticks_poc_diff_one
+

Set poc_proportional_to_timing_flag in VPS and VUI and use this value +to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and +E.3.1). Ignored if tick_rate is not also set. +

+
+
crop_left
+
crop_right
+
crop_top
+
crop_bottom
+

Set the conformance window cropping offsets in the SPS. These values +will replace the current ones if the stream is already cropped. +

+

These fields are set in pixels. Note that some sizes may not be +representable if the chroma is subsampled (H.265 section 7.4.3.2.1). +

+
+
level
+

Set the level in the VPS and SPS. See H.265 section A.4 and tables +A.6 and A.7. +

+

The argument must be the name of a level (for example, ‘5.1’), a +general_level_idc value (for example, ‘153’ for level 5.1), +or the special name ‘auto’ indicating that the filter should +attempt to guess the level from the input stream properties. +

+
+
+ +
+
+

11.15 hevc_mp4toannexb

+ +

Convert an HEVC/H.265 bitstream from length prefixed mode to start code +prefixed mode (as defined in the Annex B of the ITU-T H.265 +specification). +

+

This is required by some streaming formats, typically the MPEG-2 +transport stream format (muxer mpegts). +

+

For example to remux an MP4 file containing an HEVC stream to mpegts +format with ffmpeg, you can use the command: +

+
+
ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
+
+ +

Please note that this filter is auto-inserted for MPEG-TS (muxer +mpegts) and raw HEVC/H.265 (muxer h265 or +hevc) output formats. +

+
+
+

11.16 imxdump

+ +

Modifies the bitstream to fit in MOV and to be usable by the Final Cut +Pro decoder. This filter only applies to the mpeg2video codec, and is +likely not needed for Final Cut Pro 7 and newer with the appropriate +-tag:v. +

+

For example, to remux 30 MB/sec NTSC IMX to MOV: +

+
+
ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
+
+ +
+
+

11.17 mjpeg2jpeg

+ +

Convert MJPEG/AVI1 packets to full JPEG/JFIF packets. +

+

MJPEG is a video codec wherein each video frame is essentially a +JPEG image. The individual frames can be extracted without loss, +e.g. by +

+
+
ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
+
+ +

Unfortunately, these chunks are incomplete JPEG images, because +they lack the DHT segment required for decoding. Quoting from +http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml: +

+

Avery Lee, writing in the rec.video.desktop newsgroup in 2001, +commented that "MJPEG, or at least the MJPEG in AVIs having the +MJPG fourcc, is restricted JPEG with a fixed – and *omitted* – +Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2, +and it must use basic Huffman encoding, not arithmetic or +progressive. . . . You can indeed extract the MJPEG frames and +decode them with a regular JPEG decoder, but you have to prepend +the DHT segment to them, or else the decoder won’t have any idea +how to decompress the data. The exact table necessary is given in +the OpenDML spec." +

+

This bitstream filter patches the header of frames extracted from an MJPEG +stream (carrying the AVI1 header ID and lacking a DHT segment) to +produce fully qualified JPEG images. +

+
+
ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
+exiftran -i -9 frame*.jpg
+ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
+
+ +
+
+

11.18 mjpegadump

+ +

Add an MJPEG A header to the bitstream, to enable decoding by +Quicktime. +

+
+
+

11.19 mov2textsub

+ +

Extract a representable text file from MOV subtitles, stripping the +metadata header from each subtitle packet. +

+

See also the text2movsub filter. +

+
+
+

11.20 mp3decomp

+ +

Decompress non-standard compressed MP3 audio headers. +

+
+
+

11.21 mpeg2_metadata

+ +

Modify metadata embedded in an MPEG-2 stream. +

+
+
display_aspect_ratio
+

Set the display aspect ratio in the stream. +

+

The following fixed values are supported: +

+
4/3
+
16/9
+
221/100
+
+

Any other value will result in square pixels being signalled instead +(see H.262 section 6.3.3 and table 6-3). +

+
+
frame_rate
+

Set the frame rate in the stream. This is constructed from a table +of known values combined with a small multiplier and divisor - if +the supplied value is not exactly representable, the nearest +representable value will be used instead (see H.262 section 6.3.3 +and table 6-4). +

+
+
video_format
+

Set the video format in the stream (see H.262 section 6.3.6 and +table 6-6). +

+
+
colour_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the colour description in the stream (see H.262 section 6.3.6 +and tables 6-7, 6-8 and 6-9). +

+
+
+ +
+
+

11.22 mpeg4_unpack_bframes

+ +

Unpack DivX-style packed B-frames. +

+

DivX-style packed B-frames are not valid MPEG-4 and were only a +workaround for the broken Video for Windows subsystem. +They use more space, can cause minor AV sync issues, require more +CPU power to decode (unless the player has some decoded picture queue +to compensate the 2,0,2,0 frame per packet style) and cause +trouble if copied into a standard container like mp4 or mpeg-ps/ts, +because MPEG-4 decoders may not be able to decode them, since they are +not valid MPEG-4. +

+

For example to fix an AVI file containing an MPEG-4 stream with +DivX-style packed B-frames using ffmpeg, you can use the command: +

+
+
ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
+
+ +
+
+

11.23 noise

+ +

Damages the contents of packets or simply drops them without damaging the +container. Can be used for fuzzing or testing error resilience/concealment. +

+

Parameters: +

+
amount
+

Accepts an expression whose evaluation per-packet determines how often bytes in that +packet will be modified. A value below 0 will result in a variable frequency. +Default is 0 which results in no modification. However, if neither amount nor drop is specified, +amount will be set to -1. See below for accepted variables. +

+
drop
+

Accepts an expression evaluated per-packet whose value determines whether that packet is dropped. +Evaluation to a positive value results in the packet being dropped. Evaluation to a negative +value results in a variable chance of it being dropped, roughly inverse in proportion to the magnitude +of the value. Default is 0 which results in no drops. See below for accepted variables. +

+
dropamount
+

Accepts a non-negative integer, which assigns a variable chance of it being dropped, roughly inverse +in proportion to the value. Default is 0 which results in no drops. This option is kept for backwards +compatibility and is equivalent to setting drop to a negative value with the same magnitude +i.e. dropamount=4 is the same as drop=-4. Ignored if drop is also specified. +

+
+ +

Both amount and drop accept expressions containing the following variables: +

+
+
n
+

The index of the packet, starting from zero. +

+
tb
+

The timebase for packet timestamps. +

+
pts
+

Packet presentation timestamp. +

+
dts
+

Packet decoding timestamp. +

+
nopts
+

Constant representing AV_NOPTS_VALUE. +

+
startpts
+

First non-AV_NOPTS_VALUE PTS seen in the stream. +

+
startdts
+

First non-AV_NOPTS_VALUE DTS seen in the stream. +

+
duration
+
d
+

Packet duration, in timebase units. +

+
pos
+

Packet position in input; may be -1 when unknown or not set. +

+
size
+

Packet size, in bytes. +

+
key
+

Whether packet is marked as a keyframe. +

+
state
+

A pseudo random integer, primarily derived from the content of packet payload. +

+
+ + +
+

11.23.1 Examples

+

Apply modification to every byte but don’t drop any packets. +

+
ffmpeg -i INPUT -c copy -bsf noise=1 output.mkv
+
+ +

Drop every video packet not marked as a keyframe after timestamp 30s but do not +modify any of the remaining packets. +

+
ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(t\,30)*not(key)' output.mkv
+
+ +

Drop one second of audio every 10 seconds and add some random noise to the rest. +

+
ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(t\,10)\,9\,10)' output.mkv
+
+ +
+
+
+

11.24 null

+

This bitstream filter passes the packets through unchanged. +

+
+
+

11.25 pcm_rechunk

+ +

Repacketize PCM audio to a fixed number of samples per packet or a fixed packet +rate per second. This is similar to the (ffmpeg-filters)asetnsamples audio +filter but works on audio packets instead of audio frames. +

+
+
nb_out_samples, n
+

Set the number of samples per each output audio packet. The number is intended +as the number of samples per each channel. Default value is 1024. +

+
+
pad, p
+

If set to 1, the filter will pad the last audio packet with silence, so that it +will contain the same number of samples (or roughly the same number of samples, +see frame_rate) as the previous ones. Default value is 1. +

+
+
frame_rate, r
+

This option makes the filter output a fixed number of packets per second instead +of a fixed number of samples per packet. If the audio sample rate is not +divisible by the frame rate then the number of samples will not be constant but +will vary slightly so that each packet will start as close to the frame +boundary as possible. Using this option has precedence over nb_out_samples. +

+
+ +

You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio +for NTSC frame rate using the frame_rate option. +

+
ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
+
+ +
+
+

11.26 pgs_frame_merge

+ +

Merge a sequence of PGS Subtitle segments ending with an "end of display set" +segment into a single packet. +

+

This is required by some containers that support PGS subtitles +(muxer matroska). +

+
+
+

11.27 prores_metadata

+ +

Modify color property metadata embedded in prores stream. +

+
+
color_primaries
+

Set the color primaries. +Available values are: +

+
+
auto
+

Keep the same color primaries property (default). +

+
+
unknown
+
bt709
+
bt470bg
+

BT601 625 +

+
+
smpte170m
+

BT601 525 +

+
+
bt2020
+
smpte431
+

DCI P3 +

+
+
smpte432
+

P3 D65 +

+
+
+ +
+
transfer_characteristics
+

Set the color transfer. +Available values are: +

+
+
auto
+

Keep the same transfer characteristics property (default). +

+
+
unknown
+
bt709
+

BT 601, BT 709, BT 2020 +

+
smpte2084
+

SMPTE ST 2084 +

+
arib-std-b67
+

ARIB STD-B67 +

+
+ + +
+
matrix_coefficients
+

Set the matrix coefficient. +Available values are: +

+
+
auto
+

Keep the same colorspace property (default). +

+
+
unknown
+
bt709
+
smpte170m
+

BT 601 +

+
+
bt2020nc
+
+
+
+ +

Set Rec709 colorspace for each frame of the file +

+
ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
+
+ +

Set Hybrid Log-Gamma parameters for each frame of the file +

+
ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc output.mov
+
+ +
+
+

11.28 remove_extra

+ +

Remove extradata from packets. +

+

It accepts the following parameter: +

+
freq
+

Set which frame types to remove extradata from. +

+
+
k
+

Remove extradata from non-keyframes only. +

+
+
keyframe
+

Remove extradata from keyframes only. +

+
+
e, all
+

Remove extradata from all frames. +

+
+
+
+
+ +
+
+

11.29 setts

+

Set PTS and DTS in packets. +

+

It accepts the following parameters: +

+
ts
+
pts
+
dts
+

Set expressions for PTS, DTS or both. +

+
duration
+

Set expression for duration. +

+
time_base
+

Set output time base. +

+
+ +

The expressions are evaluated through the eval API and can contain the following +constants: +

+
+
N
+

The count of the input packet. Starting from 0. +

+
+
TS
+

The demux timestamp in input in case of ts or dts option or presentation +timestamp in case of pts option. +

+
+
POS
+

The original position in the file of the packet, or undefined if undefined +for the current packet +

+
+
DTS
+

The demux timestamp in input. +

+
+
PTS
+

The presentation timestamp in input. +

+
+
DURATION
+

The duration in input. +

+
+
STARTDTS
+

The DTS of the first packet. +

+
+
STARTPTS
+

The PTS of the first packet. +

+
+
PREV_INDTS
+

The previous input DTS. +

+
+
PREV_INPTS
+

The previous input PTS. +

+
+
PREV_INDURATION
+

The previous input duration. +

+
+
PREV_OUTDTS
+

The previous output DTS. +

+
+
PREV_OUTPTS
+

The previous output PTS. +

+
+
PREV_OUTDURATION
+

The previous output duration. +

+
+
NEXT_DTS
+

The next input DTS. +

+
+
NEXT_PTS
+

The next input PTS. +

+
+
NEXT_DURATION
+

The next input duration. +

+
+
TB
+

The timebase of stream packet belongs. +

+
+
TB_OUT
+

The output timebase. +

+
+
SR
+

The sample rate of stream packet belongs. +

+
+
NOPTS
+

The AV_NOPTS_VALUE constant. +

+
+ +
+
+

11.30 text2movsub

+ +

Convert text subtitles to MOV subtitles (as used by the mov_text +codec) with metadata headers. +

+

See also the mov2textsub filter. +

+
+
+

11.31 trace_headers

+ +

Log trace output containing all syntax elements in the coded stream +headers (everything above the level of individual coded blocks). +This can be useful for debugging low-level stream issues. +

+

Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending +on the build only a subset of these may be available. +

+
+
+

11.32 truehd_core

+ +

Extract the core from a TrueHD stream, dropping ATMOS data. +

+
+
+

11.33 vp9_metadata

+ +

Modify metadata embedded in a VP9 stream. +

+
+
color_space
+

Set the color space value in the frame header. Note that any frame +set to RGB will be implicitly set to PC range and that RGB is +incompatible with profiles 0 and 2. +

+
unknown
+
bt601
+
bt709
+
smpte170
+
smpte240
+
bt2020
+
rgb
+
+ +
+
color_range
+

Set the color range value in the frame header. Note that any value +imposed by the color space will take precedence over this value. +

+
tv
+
pc
+
+
+
+ +
+
+

11.34 vp9_superframe

+ +

Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This +fixes merging of split/segmented VP9 streams where the alt-ref frame +was split from its visible counterpart. +

+
+
+

11.35 vp9_superframe_split

+ +

Split VP9 superframes into single frames. +

+
+
+

11.36 vp9_raw_reorder

+ +

Given a VP9 stream with correct timestamps but possibly out of order, +insert additional show-existing-frame packets to correct the ordering. +

+
+
+
+

12 Format Options

+ +

The libavformat library provides some generic global options, which +can be set on all the muxers and demuxers. In addition each muxer or +demuxer may support so-called private options, which are specific for +that component. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the +AVFormatContext options or using the libavutil/opt.h API +for programmatic use. +

+

The list of supported options follows: +

+
+
avioflags flags (input/output)
+

Possible values: +

+
direct
+

Reduce buffering. +

+
+ +
+
probesize integer (input)
+

Set probing size in bytes, i.e. the size of the data to analyze to get +stream information. A higher value will enable detecting more +information in case it is dispersed into the stream, but will increase +latency. Must be an integer not lesser than 32. It is 5000000 by default. +

+
+
max_probe_packets integer (input)
+

Set the maximum number of buffered packets when probing a codec. +Default is 2500 packets. +

+
+
packetsize integer (output)
+

Set packet size. +

+
+
fflags flags
+

Set format flags. Some are implemented for a limited number of formats. +

+

Possible values for input files: +

+
discardcorrupt
+

Discard corrupted packets. +

+
fastseek
+

Enable fast, but inaccurate seeks for some formats. +

+
genpts
+

Generate missing PTS if DTS is present. +

+
igndts
+

Ignore DTS if PTS is set. Inert when nofillin is set. +

+
ignidx
+

Ignore index. +

+
nobuffer
+

Reduce the latency introduced by buffering during initial input streams analysis. +

+
nofillin
+

Do not fill in missing values in packet fields that can be exactly calculated. +

+
noparse
+

Disable AVParsers, this needs +nofillin too. +

+
sortdts
+

Try to interleave output packets by DTS. At present, available only for AVIs with an index. +

+
+ +

Possible values for output files: +

+
autobsf
+

Automatically apply bitstream filters as required by the output format. Enabled by default. +

+
bitexact
+

Only write platform-, build- and time-independent data. +This ensures that file and data checksums are reproducible and match between +platforms. Its primary use is for regression testing. +

+
flush_packets
+

Write out packets immediately. +

+
shortest
+

Stop muxing at the end of the shortest stream. +It may be needed to increase max_interleave_delta to avoid flushing the longer +streams before EOF. +

+
+ +
+
seek2any integer (input)
+

Allow seeking to non-keyframes on demuxer level when supported if set to 1. +Default is 0. +

+
+
analyzeduration integer (input)
+

Specify how many microseconds are analyzed to probe the input. A +higher value will enable detecting more accurate information, but will +increase latency. It defaults to 5,000,000 microseconds = 5 seconds. +

+
+
cryptokey hexadecimal string (input)
+

Set decryption key. +

+
+
indexmem integer (input)
+

Set max memory used for timestamp index (per stream). +

+
+
rtbufsize integer (input)
+

Set max memory used for buffering real-time frames. +

+
+
fdebug flags (input/output)
+

Print specific debug info. +

+

Possible values: +

+
ts
+
+ +
+
max_delay integer (input/output)
+

Set maximum muxing or demuxing delay in microseconds. +

+
+
fpsprobesize integer (input)
+

Set number of frames used to probe fps. +

+
+
audio_preload integer (output)
+

Set microseconds by which audio packets should be interleaved earlier. +

+
+
chunk_duration integer (output)
+

Set microseconds for each chunk. +

+
+
chunk_size integer (output)
+

Set size in bytes for each chunk. +

+
+
err_detect, f_err_detect flags (input)
+

Set error detection flags. f_err_detect is deprecated and +should be used only via the ffmpeg tool. +

+

Possible values: +

+
crccheck
+

Verify embedded CRCs. +

+
bitstream
+

Detect bitstream specification deviations. +

+
buffer
+

Detect improper bitstream length. +

+
explode
+

Abort decoding on minor error detection. +

+
careful
+

Consider things that violate the spec and have not been seen in the +wild as errors. +

+
compliant
+

Consider all spec non compliancies as errors. +

+
aggressive
+

Consider things that a sane encoder should not do as an error. +

+
+ +
+
max_interleave_delta integer (output)
+

Set maximum buffering duration for interleaving. The duration is +expressed in microseconds, and defaults to 10000000 (10 seconds). +

+

To ensure all the streams are interleaved correctly, libavformat will +wait until it has at least one packet for each stream before actually +writing any packets to the output file. When some streams are +"sparse" (i.e. there are large gaps between successive packets), this +can result in excessive buffering. +

+

This field specifies the maximum difference between the timestamps of the +first and the last packet in the muxing queue, above which libavformat +will output a packet regardless of whether it has queued a packet for all +the streams. +

+

If set to 0, libavformat will continue buffering packets until it has +a packet for each stream, regardless of the maximum timestamp +difference between the buffered packets. +

+
+
use_wallclock_as_timestamps integer (input)
+

Use wallclock as timestamps if set to 1. Default is 0. +

+
+
avoid_negative_ts integer (output)
+
+

Possible values: +

+
make_non_negative
+

Shift timestamps to make them non-negative. +Also note that this affects only leading negative timestamps, and not +non-monotonic negative timestamps. +

+
make_zero
+

Shift timestamps so that the first timestamp is 0. +

+
auto (default)
+

Enables shifting when required by the target format. +

+
disabled
+

Disables shifting of timestamp. +

+
+ +

When shifting is enabled, all output timestamps are shifted by the +same amount. Audio, video, and subtitles desynching and relative +timestamp differences are preserved compared to how they would have +been without shifting. +

+
+
skip_initial_bytes integer (input)
+

Set number of bytes to skip before reading header and frames if set to 1. +Default is 0. +

+
+
correct_ts_overflow integer (input)
+

Correct single timestamp overflows if set to 1. Default is 1. +

+
+
flush_packets integer (output)
+

Flush the underlying I/O stream after each packet. Default is -1 (auto), which +means that the underlying protocol will decide, 1 enables it, and has the +effect of reducing the latency, 0 disables it and may increase IO throughput in +some cases. +

+
+
output_ts_offset offset (output)
+

Set the output time offset. +

+

offset must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

The offset is added by the muxer to the output timestamps. +

+

Specifying a positive offset means that the corresponding streams are +delayed bt the time duration specified in offset. Default value +is 0 (meaning that no offset is applied). +

+
+
format_whitelist list (input)
+

"," separated list of allowed demuxers. By default all are allowed. +

+
+
dump_separator string (input)
+

Separator used to separate the fields printed on the command line about the +Stream parameters. +For example, to separate the fields with newlines and indentation: +

+
ffprobe -dump_separator "
+                          "  -i ~/videos/matrixbench_mpeg2.mpg
+
+ +
+
max_streams integer (input)
+

Specifies the maximum number of streams. This can be used to reject files that +would require too many resources due to a large number of streams. +

+
+
skip_estimate_duration_from_pts bool (input)
+

Skip estimation of input duration when calculated using PTS. +At present, applicable for MPEG-PS and MPEG-TS. +

+
+
strict, f_strict integer (input/output)
+

Specify how strictly to follow the standards. f_strict is deprecated and +should be used only via the ffmpeg tool. +

+

Possible values: +

+
very
+

strictly conform to an older more strict version of the spec or reference software +

+
strict
+

strictly conform to all the things in the spec no matter what consequences +

+
normal
+
unofficial
+

allow unofficial extensions +

+
experimental
+

allow non standardized experimental things, experimental +(unfinished/work in progress/not well tested) decoders and encoders. +Note: experimental decoders can pose a security risk, do not use this for +decoding untrusted input. +

+
+ +
+
+ + + +
+

12.1 Format stream specifiers

+ +

Format stream specifiers allow selection of one or more streams that +match specific properties. +

+

The exact semantics of stream specifiers is defined by the +avformat_match_stream_specifier() function declared in the +libavformat/avformat.h header and documented in the +(ffmpeg)Stream specifiers section in the ffmpeg(1) manual. +

+
+
+
+

13 Demuxers

+ +

Demuxers are configured elements in FFmpeg that can read the +multimedia streams from a particular type of file. +

+

When you configure your FFmpeg build, all the supported demuxers +are enabled by default. You can list all available ones using the +configure option --list-demuxers. +

+

You can disable all the demuxers using the configure option +--disable-demuxers, and selectively enable a single demuxer with +the option --enable-demuxer=DEMUXER, or disable it +with the option --disable-demuxer=DEMUXER. +

+

The option -demuxers of the ff* tools will display the list of +enabled demuxers. Use -formats to view a combined list of +enabled demuxers and muxers. +

+

The description of some of the currently available demuxers follows. +

+ +
+

13.1 aa

+ +

Audible Format 2, 3, and 4 demuxer. +

+

This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files. +

+
+
+

13.2 aac

+ +

Raw Audio Data Transport Stream AAC demuxer. +

+

This demuxer is used to demux an ADTS input containing a single AAC stream +alongwith any ID3v1/2 or APE tags in it. +

+
+
+

13.3 apng

+ +

Animated Portable Network Graphics demuxer. +

+

This demuxer is used to demux APNG files. +All headers, but the PNG signature, up to (but not including) the first +fcTL chunk are transmitted as extradata. +Frames are then split as being all the chunks between two fcTL ones, or +between the last fcTL and IEND chunks. +

+
+
-ignore_loop bool
+

Ignore the loop variable in the file if set. Default is enabled. +

+
+
-max_fps int
+

Maximum framerate in frames per second. Default of 0 imposes no limit. +

+
+
-default_fps int
+

Default framerate in frames per second when none is specified in the file +(0 meaning as fast as possible). Default is 15. +

+
+
+ +
+
+

13.4 asf

+ +

Advanced Systems Format demuxer. +

+

This demuxer is used to demux ASF files and MMS network streams. +

+
+
-no_resync_search bool
+

Do not try to resynchronize by looking for a certain optional start code. +

+
+ +
+
+

13.5 concat

+ +

Virtual concatenation script demuxer. +

+

This demuxer reads a list of files and other directives from a text file and +demuxes them one after the other, as if all their packets had been muxed +together. +

+

The timestamps in the files are adjusted so that the first file starts at 0 +and each next file starts where the previous one finishes. Note that it is +done globally and may cause gaps if all streams do not have exactly the same +length. +

+

All files must have the same streams (same codecs, same time base, etc.). +

+

The duration of each file is used to adjust the timestamps of the next file: +if the duration is incorrect (because it was computed using the bit-rate or +because the file is truncated, for example), it can cause artifacts. The +duration directive can be used to override the duration stored in +each file. +

+ +
+

13.5.1 Syntax

+ +

The script is a text file in extended-ASCII, with one directive per line. +Empty lines, leading spaces and lines starting with ’#’ are ignored. The +following directive is recognized: +

+
+
file path
+

Path to a file to read; special characters and spaces must be escaped with +backslash or single quotes. +

+

All subsequent file-related directives apply to that file. +

+
+
ffconcat version 1.0
+

Identify the script type and version. +

+

To make FFmpeg recognize the format automatically, this directive must +appear exactly as is (no extra space or byte-order-mark) on the very first +line of the script. +

+
+
duration dur
+

Duration of the file. This information can be specified from the file; +specifying it here may be more efficient or help if the information from the +file is not available or accurate. +

+

If the duration is set for all files, then it is possible to seek in the +whole concatenated video. +

+
+
inpoint timestamp
+

In point of the file. When the demuxer opens the file it instantly seeks to the +specified timestamp. Seeking is done so that all streams can be presented +successfully at In point. +

+

This directive works best with intra frame codecs, because for non-intra frame +ones you will usually get extra packets before the actual In point and the +decoded content will most likely contain frames before In point too. +

+

For each file, packets before the file In point will have timestamps less than +the calculated start timestamp of the file (negative in case of the first +file), and the duration of the files (if not specified by the duration +directive) will be reduced based on their specified In point. +

+

Because of potential packets before the specified In point, packet timestamps +may overlap between two concatenated files. +

+
+
outpoint timestamp
+

Out point of the file. When the demuxer reaches the specified decoding +timestamp in any of the streams, it handles it as an end of file condition and +skips the current and all the remaining packets from all streams. +

+

Out point is exclusive, which means that the demuxer will not output packets +with a decoding timestamp greater or equal to Out point. +

+

This directive works best with intra frame codecs and formats where all streams +are tightly interleaved. For non-intra frame codecs you will usually get +additional packets with presentation timestamp after Out point therefore the +decoded content will most likely contain frames after Out point too. If your +streams are not tightly interleaved you may not get all the packets from all +streams before Out point and you may only will be able to decode the earliest +stream until Out point. +

+

The duration of the files (if not specified by the duration +directive) will be reduced based on their specified Out point. +

+
+
file_packet_metadata key=value
+

Metadata of the packets of the file. The specified metadata will be set for +each file packet. You can specify this directive multiple times to add multiple +metadata entries. +This directive is deprecated, use file_packet_meta instead. +

+
+
file_packet_meta key value
+

Metadata of the packets of the file. The specified metadata will be set for +each file packet. You can specify this directive multiple times to add multiple +metadata entries. +

+
+
option key value
+

Option to access, open and probe the file. +Can be present multiple times. +

+
+
stream
+

Introduce a stream in the virtual file. +All subsequent stream-related directives apply to the last introduced +stream. +Some streams properties must be set in order to allow identifying the +matching streams in the subfiles. +If no streams are defined in the script, the streams from the first file are +copied. +

+
+
exact_stream_id id
+

Set the id of the stream. +If this directive is given, the string with the corresponding id in the +subfiles will be used. +This is especially useful for MPEG-PS (VOB) files, where the order of the +streams is not reliable. +

+
+
stream_meta key value
+

Metadata for the stream. +Can be present multiple times. +

+
+
stream_codec value
+

Codec for the stream. +

+
+
stream_extradata hex_string
+

Extradata for the string, encoded in hexadecimal. +

+
+
chapter id start end
+

Add a chapter. id is an unique identifier, possibly small and +consecutive. +

+
+
+ +
+
+

13.5.2 Options

+ +

This demuxer accepts the following option: +

+
+
safe
+

If set to 1, reject unsafe file paths and directives. +A file path is considered safe if it +does not contain a protocol specification and is relative and all components +only contain characters from the portable character set (letters, digits, +period, underscore and hyphen) and have no period at the beginning of a +component. +

+

If set to 0, any file name is accepted. +

+

The default is 1. +

+
+
auto_convert
+

If set to 1, try to perform automatic conversions on packet data to make the +streams concatenable. +The default is 1. +

+

Currently, the only conversion is adding the h264_mp4toannexb bitstream +filter to H.264 streams in MP4 format. This is necessary in particular if +there are resolution changes. +

+
+
segment_time_metadata
+

If set to 1, every packet will contain the lavf.concat.start_time and the +lavf.concat.duration packet metadata values which are the start_time and +the duration of the respective file segments in the concatenated output +expressed in microseconds. The duration metadata is only set if it is known +based on the concat file. +The default is 0. +

+
+
+ +
+
+

13.5.3 Examples

+ +
    +
  • Use absolute filenames and include some comments: +
    +
    # my first filename
    +file /mnt/share/file-1.wav
    +# my second filename including whitespace
    +file '/mnt/share/file 2.wav'
    +# my third filename including whitespace plus single quote
    +file '/mnt/share/file 3'\''.wav'
    +
    + +
  • Allow for input format auto-probing, use safe filenames and set the duration of +the first file: +
    +
    ffconcat version 1.0
    +
    +file file-1.wav
    +duration 20.0
    +
    +file subdir/file-2.wav
    +
    +
+ +
+
+
+

13.6 dash

+ +

Dynamic Adaptive Streaming over HTTP demuxer. +

+

This demuxer presents all AVStreams found in the manifest. +By setting the discard flags on AVStreams the caller can decide +which streams to actually receive. +Each stream mirrors the id and bandwidth properties from the +<Representation> as metadata keys named "id" and "variant_bitrate" respectively. +

+ +
+

13.6.1 Options

+ +

This demuxer accepts the following option: +

+
+
cenc_decryption_key
+

16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7). +

+
+
+ +
+
+
+

13.7 ea

+ +

Electronic Arts Multimedia format demuxer. +

+

This format is used by various Electronic Arts games. +

+ +
+

13.7.1 Options

+ +
+
merge_alpha bool
+
+

Normally the VP6 alpha channel (if exists) is returned as a secondary video +stream, by setting this option you can make the demuxer return a single video +stream which contains the alpha channel in addition to the ordinary video. +

+
+
+ +
+
+
+

13.8 imf

+ +

Interoperable Master Format demuxer. +

+

This demuxer presents audio and video streams found in an IMF Composition, as +specified in SMPTE ST 2067-2. +

+
+
ffmpeg [-assetmaps <path of ASSETMAP1>,<path of ASSETMAP2>,...] -i <path of CPL> ...
+
+ +

If -assetmaps is not specified, the demuxer looks for a file called +ASSETMAP.xml in the same directory as the CPL. +

+
+
+

13.9 flv, live_flv, kux

+ +

Adobe Flash Video Format demuxer. +

+

This demuxer is used to demux FLV files and RTMP network streams. In case of live network streams, if you force format, you may use live_flv option instead of flv to survive timestamp discontinuities. +KUX is a flv variant used on the Youku platform. +

+
+
ffmpeg -f flv -i myfile.flv ...
+ffmpeg -f live_flv -i rtmp://<any.server>/anything/key ....
+
+ + +
+
-flv_metadata bool
+

Allocate the streams according to the onMetaData array content. +

+
+
-flv_ignore_prevtag bool
+

Ignore the size of previous tag value. +

+
+
-flv_full_metadata bool
+

Output all context of the onMetadata. +

+
+ +
+
+

13.10 gif

+ +

Animated GIF demuxer. +

+

It accepts the following options: +

+
+
min_delay
+

Set the minimum valid delay between frames in hundredths of seconds. +Range is 0 to 6000. Default value is 2. +

+
+
max_gif_delay
+

Set the maximum valid delay between frames in hundredth of seconds. +Range is 0 to 65535. Default value is 65535 (nearly eleven minutes), +the maximum value allowed by the specification. +

+
+
default_delay
+

Set the default delay between frames in hundredths of seconds. +Range is 0 to 6000. Default value is 10. +

+
+
ignore_loop
+

GIF files can contain information to loop a certain number of times (or +infinitely). If ignore_loop is set to 1, then the loop setting +from the input will be ignored and looping will not occur. If set to 0, +then looping will occur and will cycle the number of times according to +the GIF. Default value is 1. +

+
+ +

For example, with the overlay filter, place an infinitely looping GIF +over another video: +

+
ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
+
+ +

Note that in the above example the shortest option for overlay filter is +used to end the output video at the length of the shortest input file, +which in this case is input.mp4 as the GIF in this example loops +infinitely. +

+
+
+

13.11 hls

+ +

HLS demuxer +

+

Apple HTTP Live Streaming demuxer. +

+

This demuxer presents all AVStreams from all variant streams. +The id field is set to the bitrate variant index number. By setting +the discard flags on AVStreams (by pressing ’a’ or ’v’ in ffplay), +the caller can decide which variant streams to actually receive. +The total bitrate of the variant that the stream belongs to is +available in a metadata key named "variant_bitrate". +

+

It accepts the following options: +

+
+
live_start_index
+

segment index to start live streams at (negative values are from the end). +

+
+
prefer_x_start
+

prefer to use #EXT-X-START if it’s in playlist instead of live_start_index. +

+
+
allowed_extensions
+

’,’ separated list of file extensions that hls is allowed to access. +

+
+
max_reload
+

Maximum number of times a insufficient list is attempted to be reloaded. +Default value is 1000. +

+
+
m3u8_hold_counters
+

The maximum number of times to load m3u8 when it refreshes without new segments. +Default value is 1000. +

+
+
http_persistent
+

Use persistent HTTP connections. Applicable only for HTTP streams. +Enabled by default. +

+
+
http_multiple
+

Use multiple HTTP connections for downloading HTTP segments. +Enabled by default for HTTP/1.1 servers. +

+
+
http_seekable
+

Use HTTP partial requests for downloading HTTP segments. +0 = disable, 1 = enable, -1 = auto, Default is auto. +

+
+
seg_format_options
+

Set options for the demuxer of media segments using a list of key=value pairs separated by :. +

+
+
seg_max_retry
+

Maximum number of times to reload a segment on error, useful when segment skip on network error is not desired. +Default value is 0. +

+
+ +
+
+

13.12 image2

+ +

Image file demuxer. +

+

This demuxer reads from a list of image files specified by a pattern. +The syntax and meaning of the pattern is specified by the +option pattern_type. +

+

The pattern may contain a suffix which is used to automatically +determine the format of the images contained in the files. +

+

The size, the pixel format, and the format of each image must be the +same for all the files in the sequence. +

+

This demuxer accepts the following options: +

+
framerate
+

Set the frame rate for the video stream. It defaults to 25. +

+
loop
+

If set to 1, loop over the input. Default value is 0. +

+
pattern_type
+

Select the pattern type used to interpret the provided filename. +

+

pattern_type accepts one of the following values. +

+
none
+

Disable pattern matching, therefore the video will only contain the specified +image. You should use this option if you do not want to create sequences from +multiple images and your filenames may contain special pattern characters. +

+
sequence
+

Select a sequence pattern type, used to specify a sequence of files +indexed by sequential numbers. +

+

A sequence pattern may contain the string "%d" or "%0Nd", which +specifies the position of the characters representing a sequential +number in each filename matched by the pattern. If the form +"%d0Nd" is used, the string representing the number in each +filename is 0-padded and N is the total number of 0-padded +digits representing the number. The literal character ’%’ can be +specified in the pattern with the string "%%". +

+

If the sequence pattern contains "%d" or "%0Nd", the first filename of +the file list specified by the pattern must contain a number +inclusively contained between start_number and +start_number+start_number_range-1, and all the following +numbers must be sequential. +

+

For example the pattern "img-%03d.bmp" will match a sequence of +filenames of the form img-001.bmp, img-002.bmp, ..., +img-010.bmp, etc.; the pattern "i%%m%%g-%d.jpg" will match a +sequence of filenames of the form i%m%g-1.jpg, +i%m%g-2.jpg, ..., i%m%g-10.jpg, etc. +

+

Note that the pattern must not necessarily contain "%d" or +"%0Nd", for example to convert a single image file +img.jpeg you can employ the command: +

+
ffmpeg -i img.jpeg img.png
+
+ +
+
glob
+

Select a glob wildcard pattern type. +

+

The pattern is interpreted like a glob() pattern. This is only +selectable if libavformat was compiled with globbing support. +

+
+
glob_sequence (deprecated, will be removed)
+

Select a mixed glob wildcard/sequence pattern. +

+

If your version of libavformat was compiled with globbing support, and +the provided pattern contains at least one glob meta character among +%*?[]{} that is preceded by an unescaped "%", the pattern is +interpreted like a glob() pattern, otherwise it is interpreted +like a sequence pattern. +

+

All glob special characters %*?[]{} must be prefixed +with "%". To escape a literal "%" you shall use "%%". +

+

For example the pattern foo-%*.jpeg will match all the +filenames prefixed by "foo-" and terminating with ".jpeg", and +foo-%?%?%?.jpeg will match all the filenames prefixed with +"foo-", followed by a sequence of three characters, and terminating +with ".jpeg". +

+

This pattern type is deprecated in favor of glob and +sequence. +

+
+ +

Default value is glob_sequence. +

+
pixel_format
+

Set the pixel format of the images to read. If not specified the pixel +format is guessed from the first image file in the sequence. +

+
start_number
+

Set the index of the file matched by the image file pattern to start +to read from. Default value is 0. +

+
start_number_range
+

Set the index interval range to check when looking for the first image +file in the sequence, starting from start_number. Default value +is 5. +

+
ts_from_file
+

If set to 1, will set frame timestamp to modification time of image file. Note +that monotonity of timestamps is not provided: images go in the same order as +without this option. Default value is 0. +If set to 2, will set frame timestamp to the modification time of the image file in +nanosecond precision. +

+
video_size
+

Set the video size of the images to read. If not specified the video +size is guessed from the first image file in the sequence. +

+
export_path_metadata
+

If set to 1, will add two extra fields to the metadata found in input, making them +also available for other filters (see drawtext filter for examples). Default +value is 0. The extra fields are described below: +

+
lavf.image2dec.source_path
+

Corresponds to the full path to the input file being read. +

+
lavf.image2dec.source_basename
+

Corresponds to the name of the file being read. +

+
+ +
+
+ + +
+

13.12.1 Examples

+ +
    +
  • Use ffmpeg for creating a video from the images in the file +sequence img-001.jpeg, img-002.jpeg, ..., assuming an +input frame rate of 10 frames per second: +
    +
    ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
    +
    + +
  • As above, but start by reading from a file with index 100 in the sequence: +
    +
    ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
    +
    + +
  • Read images matching the "*.png" glob pattern , that is all the files +terminating with the ".png" suffix: +
    +
    ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
    +
    +
+ +
+
+
+

13.13 libgme

+ +

The Game Music Emu library is a collection of video game music file emulators. +

+

See https://bitbucket.org/mpyne/game-music-emu/overview for more information. +

+

It accepts the following options: +

+
+
track_index
+

Set the index of which track to demux. The demuxer can only export one track. +Track indexes start at 0. Default is to pick the first track. Number of tracks +is exported as tracks metadata entry. +

+
+
sample_rate
+

Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100. +

+
+
max_size (bytes)
+

The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size, +which in turn, acts as a ceiling for the size of files that can be read. +Default is 50 MiB. +

+
+
+ +
+
+

13.14 libmodplug

+ +

ModPlug based module demuxer +

+

See https://github.com/Konstanty/libmodplug +

+

It will export one 2-channel 16-bit 44.1 kHz audio stream. +Optionally, a pal8 16-color video stream can be exported with or without printed metadata. +

+

It accepts the following options: +

+
+
noise_reduction
+

Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0. +

+
+
reverb_depth
+

Set amount of reverb. Range 0-100. Default is 0. +

+
+
reverb_delay
+

Set delay in ms, clamped to 40-250 ms. Default is 0. +

+
+
bass_amount
+

Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0. +

+
+
bass_range
+

Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0. +

+
+
surround_depth
+

Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0. +

+
+
surround_delay
+

Set surround delay in ms, clamped to 5-40 ms. Default is 0. +

+
+
max_size
+

The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size, +which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB. +0 removes buffer size limit (not recommended). Default is 5 MiB. +

+
+
video_stream_expr
+

String which is evaluated using the eval API to assign colors to the generated video stream. +Variables which can be used are x, y, w, h, t, speed, +tempo, order, pattern and row. +

+
+
video_stream
+

Generate video stream. Can be 1 (on) or 0 (off). Default is 0. +

+
+
video_stream_w
+

Set video frame width in ’chars’ where one char indicates 8 pixels. Range is 20-512. Default is 30. +

+
+
video_stream_h
+

Set video frame height in ’chars’ where one char indicates 8 pixels. Range is 20-512. Default is 30. +

+
+
video_stream_ptxt
+

Print metadata on video stream. Includes speed, tempo, order, pattern, +row and ts (time in ms). Can be 1 (on) or 0 (off). Default is 1. +

+
+
+ +
+
+

13.15 libopenmpt

+ +

libopenmpt based module demuxer +

+

See https://lib.openmpt.org/libopenmpt/ for more information. +

+

Some files have multiple subsongs (tracks) this can be set with the subsong +option. +

+

It accepts the following options: +

+
+
subsong
+

Set the subsong index. This can be either ’all’, ’auto’, or the index of the +subsong. Subsong indexes start at 0. The default is ’auto’. +

+

The default value is to let libopenmpt choose. +

+
+
layout
+

Set the channel layout. Valid values are 1, 2, and 4 channel layouts. +The default value is STEREO. +

+
+
sample_rate
+

Set the sample rate for libopenmpt to output. +Range is from 1000 to INT_MAX. The value default is 48000. +

+
+ +
+
+

13.16 mov/mp4/3gp

+ +

Demuxer for Quicktime File Format & ISO/IEC Base Media File Format (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12). +

+

Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v +

+ +
+

13.16.1 Options

+ +

This demuxer accepts the following options: +

+
enable_drefs
+

Enable loading of external tracks, disabled by default. +Enabling this can theoretically leak information in some use cases. +

+
+
use_absolute_path
+

Allows loading of external tracks via absolute paths, disabled by default. +Enabling this poses a security risk. It should only be enabled if the source +is known to be non-malicious. +

+
+
seek_streams_individually
+

When seeking, identify the closest point in each stream individually and demux packets in +that stream from identified point. This can lead to a different sequence of packets compared +to demuxing linearly from the beginning. Default is true. +

+
+
ignore_editlist
+

Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the +timeline described by the edit list. Default is false. +

+
+
advanced_editlist
+

Modify the stream index to reflect the timeline described by the edit list. ignore_editlist +must be set to false for this option to be effective. +If both ignore_editlist and this option are set to false, then only the +start of the stream index is modified to reflect initial dwell time or starting timestamp +described by the edit list. Default is true. +

+
+
ignore_chapters
+

Don’t parse chapters. This includes GoPro ’HiLight’ tags/moments. Note that chapters are +only parsed when input is seekable. Default is false. +

+
+
use_mfra_for
+

For seekable fragmented input, set fragment’s starting timestamp from media fragment random access box, if present. +

+

Following options are available: +

+
auto
+

Auto-detect whether to set mfra timestamps as PTS or DTS (default) +

+
+
dts
+

Set mfra timestamps as DTS +

+
+
pts
+

Set mfra timestamps as PTS +

+
+
0
+

Don’t use mfra box to set timestamps +

+
+ +
+
use_tfdt
+

For fragmented input, set fragment’s starting timestamp to baseMediaDecodeTime from the tfdt box. +Default is enabled, which will prefer to use the tfdt box to set DTS. Disable to use the earliest_presentation_time from the sidx box. +In either case, the timestamp from the mfra box will be used if it’s available and use_mfra_for is +set to pts or dts. +

+
+
export_all
+

Export unrecognized boxes within the udta box as metadata entries. The first four +characters of the box type are set as the key. Default is false. +

+
+
export_xmp
+

Export entire contents of XMP_ box and uuid box as a string with key xmp. Note that +if export_all is set and this option isn’t, the contents of XMP_ box are still exported +but with key XMP_. Default is false. +

+
+
activation_bytes
+

4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below. +

+
+
audible_fixed_key
+

Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to +specify. +

+
+
decryption_key
+

16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7). +

+
+
max_stts_delta
+

Very high sample deltas written in a trak’s stts box may occasionally be intended but usually they are written in +error or used to store a negative value for dts correction when treated as signed 32-bit integers. This option lets +the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when +cast to int32 are used to adjust onward dts. +

+

Unit is the track time scale. Range is 0 to UINT_MAX. Default is UINT_MAX - 48000*10 which allows upto +a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of uint32 range. +

+
+ +
+
+

13.16.2 Audible AAX

+ +

Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret. +

+
ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
+
+ +
+
+
+

13.17 mpegts

+ +

MPEG-2 transport stream demuxer. +

+

This demuxer accepts the following options: +

+
resync_size
+

Set size limit for looking up a new synchronization. Default value is +65536. +

+
+
skip_unknown_pmt
+

Skip PMTs for programs not defined in the PAT. Default value is 0. +

+
+
fix_teletext_pts
+

Override teletext packet PTS and DTS values with the timestamps calculated +from the PCR of the first program which the teletext stream is part of and is +not discarded. Default value is 1, set this option to 0 if you want your +teletext packet PTS and DTS values untouched. +

+
+
ts_packetsize
+

Output option carrying the raw packet size in bytes. +Show the detected raw packet size, cannot be set by the user. +

+
+
scan_all_pmts
+

Scan and combine all PMTs. The value is an integer with value from -1 +to 1 (-1 means automatic setting, 1 means enabled, 0 means +disabled). Default value is -1. +

+
+
merge_pmt_versions
+

Re-use existing streams when a PMT’s version is updated and elementary +streams move to different PIDs. Default value is 0. +

+
+
max_packet_size
+

Set maximum size, in bytes, of packet emitted by the demuxer. Payloads above this size +are split across multiple packets. Range is 1 to INT_MAX/2. Default is 204800 bytes. +

+
+ +
+
+

13.18 mpjpeg

+ +

MJPEG encapsulated in multi-part MIME demuxer. +

+

This demuxer allows reading of MJPEG, where each frame is represented as a part of +multipart/x-mixed-replace stream. +

+
strict_mime_boundary
+

Default implementation applies a relaxed standard to multi-part MIME boundary detection, +to prevent regression with numerous existing endpoints not generating a proper MIME +MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check +of the boundary value. +

+
+ +
+
+

13.19 rawvideo

+ +

Raw video demuxer. +

+

This demuxer allows one to read raw video data. Since there is no header +specifying the assumed video parameters, the user must specify them +in order to be able to decode the data correctly. +

+

This demuxer accepts the following options: +

+
framerate
+

Set input video frame rate. Default value is 25. +

+
+
pixel_format
+

Set the input video pixel format. Default value is yuv420p. +

+
+
video_size
+

Set the input video size. This value must be specified explicitly. +

+
+ +

For example to read a rawvideo file input.raw with +ffplay, assuming a pixel format of rgb24, a video +size of 320x240, and a frame rate of 10 images per second, use +the command: +

+
ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
+
+ +
+
+

13.20 sbg

+ +

SBaGen script demuxer. +

+

This demuxer reads the script language used by SBaGen +http://uazu.net/sbagen/ to generate binaural beats sessions. A SBG +script looks like that: +

+
-SE
+a: 300-2.5/3 440+4.5/0
+b: 300-2.5/0 440+4.5/3
+off: -
+NOW      == a
++0:07:00 == b
++0:14:00 == a
++0:21:00 == b
++0:30:00    off
+
+ +

A SBG script can mix absolute and relative timestamps. If the script uses +either only absolute timestamps (including the script start time) or only +relative ones, then its layout is fixed, and the conversion is +straightforward. On the other hand, if the script mixes both kind of +timestamps, then the NOW reference for relative timestamps will be +taken from the current time of day at the time the script is read, and the +script layout will be frozen according to that reference. That means that if +the script is directly played, the actual times will match the absolute +timestamps up to the sound controller’s clock accuracy, but if the user +somehow pauses the playback or seeks, all times will be shifted accordingly. +

+
+
+

13.21 tedcaptions

+ +

JSON captions used for TED Talks. +

+

TED does not provide links to the captions, but they can be guessed from the +page. The file tools/bookmarklets.html from the FFmpeg source tree +contains a bookmarklet to expose them. +

+

This demuxer accepts the following option: +

+
start_time
+

Set the start time of the TED talk, in milliseconds. The default is 15000 +(15s). It is used to sync the captions with the downloadable videos, because +they include a 15s intro. +

+
+ +

Example: convert the captions to a format most players understand: +

+
ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
+
+ +
+
+

13.22 vapoursynth

+ +

Vapoursynth wrapper. +

+

Due to security concerns, Vapoursynth scripts will not +be autodetected so the input format has to be forced. For ff* CLI tools, +add -f vapoursynth before the input -i yourscript.vpy. +

+

This demuxer accepts the following option: +

+
max_script_size
+

The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size, +which in turn, acts as a ceiling for the size of scripts that can be read. +Default is 1 MiB. +

+
+ +
+
+
+

14 Metadata

+ +

FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded +INI-like text file and then load it back using the metadata muxer/demuxer. +

+

The file format is as follows: +

    +
  1. A file consists of a header and a number of metadata tags divided into sections, +each on its own line. + +
  2. The header is a ‘;FFMETADATA’ string, followed by a version number (now 1). + +
  3. Metadata tags are of the form ‘key=value’ + +
  4. Immediately after header follows global metadata + +
  5. After global metadata there may be sections with per-stream/per-chapter +metadata. + +
  6. A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in +brackets (‘[’, ‘]’) and ends with next section or end of file. + +
  7. At the beginning of a chapter section there may be an optional timebase to be +used for start/end values. It must be in form +‘TIMEBASE=num/den’, where num and den are +integers. If the timebase is missing then start/end times are assumed to +be in nanoseconds. + +

    Next a chapter section must contain chapter start and end times in form +‘START=num’, ‘END=num’, where num is a positive +integer. +

    +
  8. Empty lines and lines starting with ‘;’ or ‘#’ are ignored. + +
  9. Metadata keys or values containing special characters (‘=’, ‘;’, +‘#’, ‘\’ and a newline) must be escaped with a backslash ‘\’. + +
  10. Note that whitespace in metadata (e.g. ‘foo = bar’) is considered to be +a part of the tag (in the example above key is ‘foo ’, value is +‘ bar’). +
+ +

A ffmetadata file might look like this: +

+
;FFMETADATA1
+title=bike\\shed
+;this is a comment
+artist=FFmpeg troll team
+
+[CHAPTER]
+TIMEBASE=1/1000
+START=0
+#chapter ends at 0:01:00
+END=60000
+title=chapter \#1
+[STREAM]
+title=multi\
+line
+
+ +

By using the ffmetadata muxer and demuxer it is possible to extract +metadata from an input file to an ffmetadata file, and then transcode +the file into an output file with the edited ffmetadata file. +

+

Extracting an ffmetadata file with ffmpeg goes as follows: +

+
ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
+
+ +

Reinserting edited metadata information from the FFMETADATAFILE file can +be done as: +

+
ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
+
+ +
+
+

15 Protocol Options

+ +

The libavformat library provides some generic global options, which +can be set on all the protocols. In addition each protocol may support +so-called private options, which are specific for that component. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the +AVFormatContext options or using the libavutil/opt.h API +for programmatic use. +

+

The list of supported options follows: +

+
+
protocol_whitelist list (input)
+

Set a ","-separated list of allowed protocols. "ALL" matches all protocols. Protocols +prefixed by "-" are disabled. +All protocols are allowed by default but protocols used by an another +protocol (nested protocols) are restricted to a per protocol subset. +

+
+ + +
+
+

16 Protocols

+ +

Protocols are configured elements in FFmpeg that enable access to +resources that require specific protocols. +

+

When you configure your FFmpeg build, all the supported protocols are +enabled by default. You can list all available ones using the +configure option "–list-protocols". +

+

You can disable all the protocols using the configure option +"–disable-protocols", and selectively enable a protocol using the +option "–enable-protocol=PROTOCOL", or you can disable a +particular protocol using the option +"–disable-protocol=PROTOCOL". +

+

The option "-protocols" of the ff* tools will display the list of +supported protocols. +

+

All protocols accept the following options: +

+
+
rw_timeout
+

Maximum time to wait for (network) read/write operations to complete, +in microseconds. +

+
+ +

A description of the currently available protocols follows. +

+ +
+

16.1 amqp

+ +

Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker based +publish-subscribe communication protocol. +

+

FFmpeg must be compiled with –enable-librabbitmq to support AMQP. A separate +AMQP broker must also be run. An example open-source AMQP broker is RabbitMQ. +

+

After starting the broker, an FFmpeg client may stream data to the broker using +the command: +

+
+
ffmpeg -re -i input -f mpegts amqp://[[user]:[password]@]hostname[:port][/vhost]
+
+ +

Where hostname and port (default is 5672) is the address of the broker. The +client may also set a user/password for authentication. The default for both +fields is "guest". Name of virtual host on broker can be set with vhost. The +default value is "/". +

+

Muliple subscribers may stream from the broker using the command: +

+
ffplay amqp://[[user]:[password]@]hostname[:port][/vhost]
+
+ +

In RabbitMQ all data published to the broker flows through a specific exchange, +and each subscribing client has an assigned queue/buffer. When a packet arrives +at an exchange, it may be copied to a client’s queue depending on the exchange +and routing_key fields. +

+

The following options are supported: +

+
+
exchange
+

Sets the exchange to use on the broker. RabbitMQ has several predefined +exchanges: "amq.direct" is the default exchange, where the publisher and +subscriber must have a matching routing_key; "amq.fanout" is the same as a +broadcast operation (i.e. the data is forwarded to all queues on the fanout +exchange independent of the routing_key); and "amq.topic" is similar to +"amq.direct", but allows for more complex pattern matching (refer to the RabbitMQ +documentation). +

+
+
routing_key
+

Sets the routing key. The default value is "amqp". The routing key is used on +the "amq.direct" and "amq.topic" exchanges to decide whether packets are written +to the queue of a subscriber. +

+
+
pkt_size
+

Maximum size of each packet sent/received to the broker. Default is 131072. +Minimum is 4096 and max is any large value (representable by an int). When +receiving packets, this sets an internal buffer size in FFmpeg. It should be +equal to or greater than the size of the published packets to the broker. Otherwise +the received message may be truncated causing decoding errors. +

+
+
connection_timeout
+

The timeout in seconds during the initial connection to the broker. The +default value is rw_timeout, or 5 seconds if rw_timeout is not set. +

+
+
delivery_mode mode
+

Sets the delivery mode of each message sent to broker. +The following values are accepted: +

+
persistent
+

Delivery mode set to "persistent" (2). This is the default value. +Messages may be written to the broker’s disk depending on its setup. +

+
+
non-persistent
+

Delivery mode set to "non-persistent" (1). +Messages will stay in broker’s memory unless the broker is under memory +pressure. +

+
+
+ +
+
+ +
+
+

16.2 async

+ +

Asynchronous data filling wrapper for input stream. +

+

Fill data in a background thread, to decouple I/O operation from demux thread. +

+
+
async:URL
+async:http://host/resource
+async:cache:http://host/resource
+
+ +
+
+

16.3 bluray

+ +

Read BluRay playlist. +

+

The accepted options are: +

+
angle
+

BluRay angle +

+
+
chapter
+

Start chapter (1...N) +

+
+
playlist
+

Playlist to read (BDMV/PLAYLIST/?????.mpls) +

+
+
+ +

Examples: +

+

Read longest playlist from BluRay mounted to /mnt/bluray: +

+
bluray:/mnt/bluray
+
+ +

Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2: +

+
-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
+
+ +
+
+

16.4 cache

+ +

Caching wrapper for input stream. +

+

Cache the input stream to temporary file. It brings seeking capability to live streams. +

+

The accepted options are: +

+
read_ahead_limit
+

Amount in bytes that may be read ahead when seeking isn’t supported. Range is -1 to INT_MAX. +-1 for unlimited. Default is 65536. +

+
+
+ +

URL Syntax is +

+
cache:URL
+
+ +
+
+

16.5 concat

+ +

Physical concatenation protocol. +

+

Read and seek from many resources in sequence as if they were +a unique resource. +

+

A URL accepted by this protocol has the syntax: +

+
concat:URL1|URL2|...|URLN
+
+ +

where URL1, URL2, ..., URLN are the urls of the +resource to be concatenated, each one possibly specifying a distinct +protocol. +

+

For example to read a sequence of files split1.mpeg, +split2.mpeg, split3.mpeg with ffplay use the +command: +

+
ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
+
+ +

Note that you may need to escape the character "|" which is special for +many shells. +

+
+
+

16.6 concatf

+ +

Physical concatenation protocol using a line break delimited list of +resources. +

+

Read and seek from many resources in sequence as if they were +a unique resource. +

+

A URL accepted by this protocol has the syntax: +

+
concatf:URL
+
+ +

where URL is the url containing a line break delimited list of +resources to be concatenated, each one possibly specifying a distinct +protocol. Special characters must be escaped with backslash or single +quotes. See (ffmpeg-utils)the "Quoting and escaping" +section in the ffmpeg-utils(1) manual. +

+

For example to read a sequence of files split1.mpeg, +split2.mpeg, split3.mpeg listed in separate lines within +a file split.txt with ffplay use the command: +

+
ffplay concatf:split.txt
+
+

Where split.txt contains the lines: +

+
split1.mpeg
+split2.mpeg
+split3.mpeg
+
+ +
+
+

16.7 crypto

+ +

AES-encrypted stream reading protocol. +

+

The accepted options are: +

+
key
+

Set the AES decryption key binary block from given hexadecimal representation. +

+
+
iv
+

Set the AES decryption initialization vector binary block from given hexadecimal representation. +

+
+ +

Accepted URL formats: +

+
crypto:URL
+crypto+URL
+
+ +
+
+

16.8 data

+ +

Data in-line in the URI. See http://en.wikipedia.org/wiki/Data_URI_scheme. +

+

For example, to convert a GIF file given inline with ffmpeg: +

+
ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
+
+ +
+
+

16.9 fd

+ +

File descriptor access protocol. +

+

The accepted syntax is: +

+
fd: -fd file_descriptor
+
+ +

If fd is not specified, by default the stdout file descriptor will be +used for writing, stdin for reading. Unlike the pipe protocol, fd protocol has +seek support if it corresponding to a regular file. fd protocol doesn’t support +pass file descriptor via URL for security. +

+

This protocol accepts the following options: +

+
+
blocksize
+

Set I/O operation maximum block size, in bytes. Default value is +INT_MAX, which results in not limiting the requested block size. +Setting this value reasonably low improves user termination request reaction +time, which is valuable if data transmission is slow. +

+
+
fd
+

Set file descriptor. +

+
+ +
+
+

16.10 file

+ +

File access protocol. +

+

Read from or write to a file. +

+

A file URL can have the form: +

+
file:filename
+
+ +

where filename is the path of the file to read. +

+

An URL that does not have a protocol prefix will be assumed to be a +file URL. Depending on the build, an URL that looks like a Windows +path with the drive letter at the beginning will also be assumed to be +a file URL (usually not the case in builds for unix-like systems). +

+

For example to read from a file input.mpeg with ffmpeg +use the command: +

+
ffmpeg -i file:input.mpeg output.mpeg
+
+ +

This protocol accepts the following options: +

+
+
truncate
+

Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. +

+
+
blocksize
+

Set I/O operation maximum block size, in bytes. Default value is +INT_MAX, which results in not limiting the requested block size. +Setting this value reasonably low improves user termination request reaction +time, which is valuable for files on slow medium. +

+
+
follow
+

If set to 1, the protocol will retry reading at the end of the file, allowing +reading files that still are being written. In order for this to terminate, +you either need to use the rw_timeout option, or use the interrupt callback +(for API users). +

+
+
seekable
+

Controls if seekability is advertised on the file. 0 means non-seekable, -1 +means auto (seekable for normal files, non-seekable for named pipes). +

+

Many demuxers handle seekable and non-seekable resources differently, +overriding this might speed up opening certain files at the cost of losing some +features (e.g. accurate seeking). +

+
+ +
+
+

16.11 ftp

+ +

FTP (File Transfer Protocol). +

+

Read from or write to remote resources using FTP protocol. +

+

Following syntax is required. +

+
ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
+
+ +

This protocol accepts the following options. +

+
+
timeout
+

Set timeout in microseconds of socket I/O operations used by the underlying low level +operation. By default it is set to -1, which means that the timeout is +not specified. +

+
+
ftp-user
+

Set a user to be used for authenticating to the FTP server. This is overridden by the +user in the FTP URL. +

+
+
ftp-password
+

Set a password to be used for authenticating to the FTP server. This is overridden by +the password in the FTP URL, or by ftp-anonymous-password if no user is set. +

+
+
ftp-anonymous-password
+

Password used when login as anonymous user. Typically an e-mail address +should be used. +

+
+
ftp-write-seekable
+

Control seekability of connection during encoding. If set to 1 the +resource is supposed to be seekable, if set to 0 it is assumed not +to be seekable. Default value is 0. +

+
+ +

NOTE: Protocol can be used as output, but it is recommended to not do +it, unless special care is taken (tests, customized server configuration +etc.). Different FTP servers behave in different way during seek +operation. ff* tools may produce incomplete content due to server limitations. +

+
+
+

16.12 gopher

+ +

Gopher protocol. +

+
+
+

16.13 gophers

+ +

Gophers protocol. +

+

The Gopher protocol with TLS encapsulation. +

+
+
+

16.14 hls

+ +

Read Apple HTTP Live Streaming compliant segmented stream as +a uniform one. The M3U8 playlists describing the segments can be +remote HTTP resources or local files, accessed using the standard +file protocol. +The nested protocol is declared by specifying +"+proto" after the hls URI scheme name, where proto +is either "file" or "http". +

+
+
hls+http://host/path/to/remote/resource.m3u8
+hls+file://path/to/local/resource.m3u8
+
+ +

Using this protocol is discouraged - the hls demuxer should work +just as well (if not, please report the issues) and is more complete. +To use the hls demuxer instead, simply use the direct URLs to the +m3u8 files. +

+
+
+

16.15 http

+ +

HTTP (Hyper Text Transfer Protocol). +

+

This protocol accepts the following options: +

+
+
seekable
+

Control seekability of connection. If set to 1 the resource is +supposed to be seekable, if set to 0 it is assumed not to be seekable, +if set to -1 it will try to autodetect if it is seekable. Default +value is -1. +

+
+
chunked_post
+

If set to 1 use chunked Transfer-Encoding for posts, default is 1. +

+
+
content_type
+

Set a specific content type for the POST messages or for listen mode. +

+
+
http_proxy
+

set HTTP proxy to tunnel through e.g. http://example.com:1234 +

+
+
headers
+

Set custom HTTP headers, can override built in default headers. The +value must be a string encoding the headers. +

+
+
multiple_requests
+

Use persistent connections if set to 1, default is 0. +

+
+
post_data
+

Set custom HTTP post data. +

+
+
referer
+

Set the Referer header. Include ’Referer: URL’ header in HTTP request. +

+
+
user_agent
+

Override the User-Agent header. If not specified the protocol will use a +string describing the libavformat build. ("Lavf/<version>") +

+
+
reconnect_at_eof
+

If set then eof is treated like an error and causes reconnection, this is useful +for live / endless streams. +

+
+
reconnect_streamed
+

If set then even streamed/non seekable streams will be reconnected on errors. +

+
+
reconnect_on_network_error
+

Reconnect automatically in case of TCP/TLS errors during connect. +

+
+
reconnect_on_http_error
+

A comma separated list of HTTP status codes to reconnect on. The list can +include specific status codes (e.g. ’503’) or the strings ’4xx’ / ’5xx’. +

+
+
reconnect_delay_max
+

Sets the maximum delay in seconds after which to give up reconnecting +

+
+
mime_type
+

Export the MIME type. +

+
+
http_version
+

Exports the HTTP response version number. Usually "1.0" or "1.1". +

+
+
icy
+

If set to 1 request ICY (SHOUTcast) metadata from the server. If the server +supports this, the metadata has to be retrieved by the application by reading +the icy_metadata_headers and icy_metadata_packet options. +The default is 1. +

+
+
icy_metadata_headers
+

If the server supports ICY metadata, this contains the ICY-specific HTTP reply +headers, separated by newline characters. +

+
+
icy_metadata_packet
+

If the server supports ICY metadata, and icy was set to 1, this +contains the last non-empty metadata packet sent by the server. It should be +polled in regular intervals by applications interested in mid-stream metadata +updates. +

+
+
cookies
+

Set the cookies to be sent in future requests. The format of each cookie is the +same as the value of a Set-Cookie HTTP response field. Multiple cookies can be +delimited by a newline character. +

+
+
offset
+

Set initial byte offset. +

+
+
end_offset
+

Try to limit the request to bytes preceding this offset. +

+
+
method
+

When used as a client option it sets the HTTP method for the request. +

+

When used as a server option it sets the HTTP method that is going to be +expected from the client(s). +If the expected and the received HTTP method do not match the client will +be given a Bad Request response. +When unset the HTTP method is not checked for now. This will be replaced by +autodetection in the future. +

+
+
listen
+

If set to 1 enables experimental HTTP server. This can be used to send data when +used as an output option, or read data from a client with HTTP POST when used as +an input option. +If set to 2 enables experimental multi-client HTTP server. This is not yet implemented +in ffmpeg.c and thus must not be used as a command line option. +

+
# Server side (sending):
+ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://server:port
+
+# Client side (receiving):
+ffmpeg -i http://server:port -c copy somefile.ogg
+
+# Client can also be done with wget:
+wget http://server:port -O somefile.ogg
+
+# Server side (receiving):
+ffmpeg -listen 1 -i http://server:port -c copy somefile.ogg
+
+# Client side (sending):
+ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://server:port
+
+# Client can also be done with wget:
+wget --post-file=somefile.ogg http://server:port
+
+ +
+
send_expect_100
+

Send an Expect: 100-continue header for POST. If set to 1 it will send, if set +to 0 it won’t, if set to -1 it will try to send if it is applicable. Default +value is -1. +

+
+
auth_type
+
+

Set HTTP authentication type. No option for Digest, since this method requires +getting nonce parameters from the server first and can’t be used straight away like +Basic. +

+
+
none
+

Choose the HTTP authentication type automatically. This is the default. +

+
basic
+
+

Choose the HTTP basic authentication. +

+

Basic authentication sends a Base64-encoded string that contains a user name and password +for the client. Base64 is not a form of encryption and should be considered the same as +sending the user name and password in clear text (Base64 is a reversible encoding). +If a resource needs to be protected, strongly consider using an authentication scheme +other than basic authentication. HTTPS/TLS should be used with basic authentication. +Without these additional security enhancements, basic authentication should not be used +to protect sensitive or valuable information. +

+
+ +
+
+ + +
+

16.15.1 HTTP Cookies

+ +

Some HTTP requests will be denied unless cookie values are passed in with the +request. The cookies option allows these cookies to be specified. At +the very least, each cookie must specify a value along with a path and domain. +HTTP requests that match both the domain and path will automatically include the +cookie value in the HTTP Cookie header field. Multiple cookies can be delimited +by a newline. +

+

The required syntax to play a stream specifying a cookie is: +

+
ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
+
+ +
+
+
+

16.16 Icecast

+ +

Icecast protocol (stream to Icecast servers) +

+

This protocol accepts the following options: +

+
+
ice_genre
+

Set the stream genre. +

+
+
ice_name
+

Set the stream name. +

+
+
ice_description
+

Set the stream description. +

+
+
ice_url
+

Set the stream website URL. +

+
+
ice_public
+

Set if the stream should be public. +The default is 0 (not public). +

+
+
user_agent
+

Override the User-Agent header. If not specified a string of the form +"Lavf/<version>" will be used. +

+
+
password
+

Set the Icecast mountpoint password. +

+
+
content_type
+

Set the stream content type. This must be set if it is different from +audio/mpeg. +

+
+
legacy_icecast
+

This enables support for Icecast versions < 2.4.0, that do not support the +HTTP PUT method but the SOURCE method. +

+
+
tls
+

Establish a TLS (HTTPS) connection to Icecast. +

+
+
+ +
+
icecast://[username[:password]@]server:port/mountpoint
+
+ +
+
+

16.17 ipfs

+ +

InterPlanetary File System (IPFS) protocol support. One can access files stored +on the IPFS network through so-called gateways. These are http(s) endpoints. +This protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be sent +to such a gateway. Users can (and should) host their own node which means this +protocol will use one’s local gateway to access files on the IPFS network. +

+

This protocol accepts the following options: +

+
+
gateway
+

Defines the gateway to use. When not set, the protocol will first try +locating the local gateway by looking at $IPFS_GATEWAY, $IPFS_PATH +and $HOME/.ipfs/, in that order. +

+
+
+ +

One can use this protocol in 2 ways. Using IPFS: +

+
ffplay ipfs://<hash>
+
+ +

Or the IPNS protocol (IPNS is mutable IPFS): +

+
ffplay ipns://<hash>
+
+ +
+
+

16.18 mmst

+ +

MMS (Microsoft Media Server) protocol over TCP. +

+
+
+

16.19 mmsh

+ +

MMS (Microsoft Media Server) protocol over HTTP. +

+

The required syntax is: +

+
mmsh://server[:port][/app][/playpath]
+
+ +
+
+

16.20 md5

+ +

MD5 output protocol. +

+

Computes the MD5 hash of the data to be written, and on close writes +this to the designated output or stdout if none is specified. It can +be used to test muxers without writing an actual file. +

+

Some examples follow. +

+
# Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
+ffmpeg -i input.flv -f avi -y md5:output.avi.md5
+
+# Write the MD5 hash of the encoded AVI file to stdout.
+ffmpeg -i input.flv -f avi -y md5:
+
+ +

Note that some formats (typically MOV) require the output protocol to +be seekable, so they will fail with the MD5 output protocol. +

+
+
+

16.21 pipe

+ +

UNIX pipe access protocol. +

+

Read and write from UNIX pipes. +

+

The accepted syntax is: +

+
pipe:[number]
+
+ +

If fd isn’t specified, number is the number corresponding to the file descriptor of the +pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If number +is not specified, by default the stdout file descriptor will be used +for writing, stdin for reading. +

+

For example to read from stdin with ffmpeg: +

+
cat test.wav | ffmpeg -i pipe:0
+# ...this is the same as...
+cat test.wav | ffmpeg -i pipe:
+
+ +

For writing to stdout with ffmpeg: +

+
ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
+# ...this is the same as...
+ffmpeg -i test.wav -f avi pipe: | cat > test.avi
+
+ +

This protocol accepts the following options: +

+
+
blocksize
+

Set I/O operation maximum block size, in bytes. Default value is +INT_MAX, which results in not limiting the requested block size. +Setting this value reasonably low improves user termination request reaction +time, which is valuable if data transmission is slow. +

+
fd
+

Set file descriptor. +

+
+ +

Note that some formats (typically MOV), require the output protocol to +be seekable, so they will fail with the pipe output protocol. +

+
+
+

16.22 prompeg

+ +

Pro-MPEG Code of Practice #3 Release 2 FEC protocol. +

+

The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism +for MPEG-2 Transport Streams sent over RTP. +

+

This protocol must be used in conjunction with the rtp_mpegts muxer and +the rtp protocol. +

+

The required syntax is: +

+
-f rtp_mpegts -fec prompeg=option=val... rtp://hostname:port
+
+ +

The destination UDP ports are port + 2 for the column FEC stream +and port + 4 for the row FEC stream. +

+

This protocol accepts the following options: +

+
l=n
+

The number of columns (4-20, LxD <= 100) +

+
+
d=n
+

The number of rows (4-20, LxD <= 100) +

+
+
+ +

Example usage: +

+
+
-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://hostname:port
+
+ +
+
+

16.23 rist

+ +

Reliable Internet Streaming Transport protocol +

+

The accepted options are: +

+
rist_profile
+

Supported values: +

+
simple
+
main
+

This one is default. +

+
advanced
+
+ +
+
buffer_size
+

Set internal RIST buffer size in milliseconds for retransmission of data. +Default value is 0 which means the librist default (1 sec). Maximum value is 30 +seconds. +

+
+
fifo_size
+

Size of the librist receiver output fifo in number of packets. This must be a +power of 2. +Defaults to 8192 (vs the librist default of 1024). +

+
+
overrun_nonfatal=1|0
+

Survive in case of librist fifo buffer overrun. Default value is 0. +

+
+
pkt_size
+

Set maximum packet size for sending data. 1316 by default. +

+
+
log_level
+

Set loglevel for RIST logging messages. You only need to set this if you +explicitly want to enable debug level messages or packet loss simulation, +otherwise the regular loglevel is respected. +

+
+
secret
+

Set override of encryption secret, by default is unset. +

+
+
encryption
+

Set encryption type, by default is disabled. +Acceptable values are 128 and 256. +

+
+ +
+
+

16.24 rtmp

+ +

Real-Time Messaging Protocol. +

+

The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia +content across a TCP/IP network. +

+

The required syntax is: +

+
rtmp://[username:password@]server[:port][/app][/instance][/playpath]
+
+ +

The accepted parameters are: +

+
username
+

An optional username (mostly for publishing). +

+
+
password
+

An optional password (mostly for publishing). +

+
+
server
+

The address of the RTMP server. +

+
+
port
+

The number of the TCP port to use (by default is 1935). +

+
+
app
+

It is the name of the application to access. It usually corresponds to +the path where the application is installed on the RTMP server +(e.g. /ondemand/, /flash/live/, etc.). You can override +the value parsed from the URI through the rtmp_app option, too. +

+
+
playpath
+

It is the path or name of the resource to play with reference to the +application specified in app, may be prefixed by "mp4:". You +can override the value parsed from the URI through the rtmp_playpath +option, too. +

+
+
listen
+

Act as a server, listening for an incoming connection. +

+
+
timeout
+

Maximum time to wait for the incoming connection. Implies listen. +

+
+ +

Additionally, the following parameters can be set via command line options +(or in code via AVOptions): +

+
rtmp_app
+

Name of application to connect on the RTMP server. This option +overrides the parameter specified in the URI. +

+
+
rtmp_buffer
+

Set the client buffer time in milliseconds. The default is 3000. +

+
+
rtmp_conn
+

Extra arbitrary AMF connection parameters, parsed from a string, +e.g. like B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0. +Each value is prefixed by a single character denoting the type, +B for Boolean, N for number, S for string, O for object, or Z for null, +followed by a colon. For Booleans the data must be either 0 or 1 for +FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or +1 to end or begin an object, respectively. Data items in subobjects may +be named, by prefixing the type with ’N’ and specifying the name before +the value (i.e. NB:myFlag:1). This option may be used multiple +times to construct arbitrary AMF sequences. +

+
+
rtmp_flashver
+

Version of the Flash plugin used to run the SWF player. The default +is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible; +<libavformat version>).) +

+
+
rtmp_flush_interval
+

Number of packets flushed in the same request (RTMPT only). The default +is 10. +

+
+
rtmp_live
+

Specify that the media is a live stream. No resuming or seeking in +live streams is possible. The default value is any, which means the +subscriber first tries to play the live stream specified in the +playpath. If a live stream of that name is not found, it plays the +recorded stream. The other possible values are live and +recorded. +

+
+
rtmp_pageurl
+

URL of the web page in which the media was embedded. By default no +value will be sent. +

+
+
rtmp_playpath
+

Stream identifier to play or to publish. This option overrides the +parameter specified in the URI. +

+
+
rtmp_subscribe
+

Name of live stream to subscribe to. By default no value will be sent. +It is only sent if the option is specified or if rtmp_live +is set to live. +

+
+
rtmp_swfhash
+

SHA256 hash of the decompressed SWF file (32 bytes). +

+
+
rtmp_swfsize
+

Size of the decompressed SWF file, required for SWFVerification. +

+
+
rtmp_swfurl
+

URL of the SWF player for the media. By default no value will be sent. +

+
+
rtmp_swfverify
+

URL to player swf file, compute hash/size automatically. +

+
+
rtmp_tcurl
+

URL of the target stream. Defaults to proto://host[:port]/app. +

+
+
tcp_nodelay=1|0
+

Set TCP_NODELAY to disable Nagle’s algorithm. Default value is 0. +

+

Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY. +

+
+
+ +

For example to read with ffplay a multimedia resource named +"sample" from the application "vod" from an RTMP server "myserver": +

+
ffplay rtmp://myserver/vod/sample
+
+ +

To publish to a password protected server, passing the playpath and +app names separately: +

+
ffmpeg -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@myserver/
+
+ +
+
+

16.25 rtmpe

+ +

Encrypted Real-Time Messaging Protocol. +

+

The Encrypted Real-Time Messaging Protocol (RTMPE) is used for +streaming multimedia content within standard cryptographic primitives, +consisting of Diffie-Hellman key exchange and HMACSHA256, generating +a pair of RC4 keys. +

+
+
+

16.26 rtmps

+ +

Real-Time Messaging Protocol over a secure SSL connection. +

+

The Real-Time Messaging Protocol (RTMPS) is used for streaming +multimedia content across an encrypted connection. +

+
+
+

16.27 rtmpt

+ +

Real-Time Messaging Protocol tunneled through HTTP. +

+

The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used +for streaming multimedia content within HTTP requests to traverse +firewalls. +

+
+
+

16.28 rtmpte

+ +

Encrypted Real-Time Messaging Protocol tunneled through HTTP. +

+

The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE) +is used for streaming multimedia content within HTTP requests to traverse +firewalls. +

+
+
+

16.29 rtmpts

+ +

Real-Time Messaging Protocol tunneled through HTTPS. +

+

The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used +for streaming multimedia content within HTTPS requests to traverse +firewalls. +

+
+
+

16.30 libsmbclient

+ +

libsmbclient permits one to manipulate CIFS/SMB network resources. +

+

Following syntax is required. +

+
+
smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
+
+ +

This protocol accepts the following options. +

+
+
timeout
+

Set timeout in milliseconds of socket I/O operations used by the underlying +low level operation. By default it is set to -1, which means that the timeout +is not specified. +

+
+
truncate
+

Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. +

+
+
workgroup
+

Set the workgroup used for making connections. By default workgroup is not specified. +

+
+
+ +

For more information see: http://www.samba.org/. +

+
+
+

16.31 libssh

+ +

Secure File Transfer Protocol via libssh +

+

Read from or write to remote resources using SFTP protocol. +

+

Following syntax is required. +

+
+
sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
+
+ +

This protocol accepts the following options. +

+
+
timeout
+

Set timeout of socket I/O operations used by the underlying low level +operation. By default it is set to -1, which means that the timeout +is not specified. +

+
+
truncate
+

Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. +

+
+
private_key
+

Specify the path of the file containing private key to use during authorization. +By default libssh searches for keys in the ~/.ssh/ directory. +

+
+
+ +

Example: Play a file stored on remote server. +

+
+
ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
+
+ +
+
+

16.32 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte

+ +

Real-Time Messaging Protocol and its variants supported through +librtmp. +

+

Requires the presence of the librtmp headers and library during +configuration. You need to explicitly configure the build with +"–enable-librtmp". If enabled this will replace the native RTMP +protocol. +

+

This protocol provides most client functions and a few server +functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT), +encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled +variants of these encrypted types (RTMPTE, RTMPTS). +

+

The required syntax is: +

+
rtmp_proto://server[:port][/app][/playpath] options
+
+ +

where rtmp_proto is one of the strings "rtmp", "rtmpt", "rtmpe", +"rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and +server, port, app and playpath have the same +meaning as specified for the RTMP native protocol. +options contains a list of space-separated options of the form +key=val. +

+

See the librtmp manual page (man 3 librtmp) for more information. +

+

For example, to stream a file in real-time to an RTMP server using +ffmpeg: +

+
ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
+
+ +

To play the same stream using ffplay: +

+
ffplay "rtmp://myserver/live/mystream live=1"
+
+ +
+
+

16.33 rtp

+ +

Real-time Transport Protocol. +

+

The required syntax for an RTP URL is: +rtp://hostname[:port][?option=val...] +

+

port specifies the RTP port to use. +

+

The following URL options are supported: +

+
+
ttl=n
+

Set the TTL (Time-To-Live) value (for multicast only). +

+
+
rtcpport=n
+

Set the remote RTCP port to n. +

+
+
localrtpport=n
+

Set the local RTP port to n. +

+
+
localrtcpport=n'
+

Set the local RTCP port to n. +

+
+
pkt_size=n
+

Set max packet size (in bytes) to n. +

+
+
buffer_size=size
+

Set the maximum UDP socket buffer size in bytes. +

+
+
connect=0|1
+

Do a connect() on the UDP socket (if set to 1) or not (if set +to 0). +

+
+
sources=ip[,ip]
+

List allowed source IP addresses. +

+
+
block=ip[,ip]
+

List disallowed (blocked) source IP addresses. +

+
+
write_to_source=0|1
+

Send packets to the source address of the latest received packet (if +set to 1) or to a default remote address (if set to 0). +

+
+
localport=n
+

Set the local RTP port to n. +

+
+
localaddr=addr
+

Local IP address of a network interface used for sending packets or joining +multicast groups. +

+
+
timeout=n
+

Set timeout (in microseconds) of socket I/O operations to n. +

+

This is a deprecated option. Instead, localrtpport should be +used. +

+
+
+ +

Important notes: +

+
    +
  1. If rtcpport is not set the RTCP port will be set to the RTP +port value plus 1. + +
  2. If localrtpport (the local RTP port) is not set any available +port will be used for the local RTP and RTCP ports. + +
  3. If localrtcpport (the local RTCP port) is not set it will be +set to the local RTP port value plus 1. +
+ +
+
+

16.34 rtsp

+ +

Real-Time Streaming Protocol. +

+

RTSP is not technically a protocol handler in libavformat, it is a demuxer +and muxer. The demuxer supports both normal RTSP (with data transferred +over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with +data transferred over RDT). +

+

The muxer can be used to send a stream using RTSP ANNOUNCE to a server +supporting it (currently Darwin Streaming Server and Mischa Spiegelmock’s +RTSP server). +

+

The required syntax for a RTSP url is: +

+
rtsp://hostname[:port]/path
+
+ +

Options can be set on the ffmpeg/ffplay command +line, or set in code via AVOptions or in +avformat_open_input. +

+ +
+

16.34.1 Muxer

+

The following options are supported. +

+
+
rtsp_transport
+

Set RTSP transport protocols. +

+

It accepts the following values: +

+
udp
+

Use UDP as lower transport protocol. +

+
+
tcp
+

Use TCP (interleaving within the RTSP control channel) as lower +transport protocol. +

+
+ +

Default value is ‘0’. +

+
+
rtsp_flags
+

Set RTSP flags. +

+

The following values are accepted: +

+
latm
+

Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC. +

+
rfc2190
+

Use RFC 2190 packetization instead of RFC 4629 for H.263. +

+
skip_rtcp
+

Don’t send RTCP sender reports. +

+
h264_mode0
+

Use mode 0 for H.264 in RTP. +

+
send_bye
+

Send RTCP BYE packets when finishing. +

+
+ +

Default value is ‘0’. +

+ +
+
min_port
+

Set minimum local UDP port. Default value is 5000. +

+
+
max_port
+

Set maximum local UDP port. Default value is 65000. +

+
+
buffer_size
+

Set the maximum socket buffer size in bytes. +

+
+
pkt_size
+

Set max send packet size (in bytes). Default value is 1472. +

+
+ +
+
+

16.34.2 Demuxer

+

The following options are supported. +

+
+
initial_pause
+

Do not start playing the stream immediately if set to 1. Default value +is 0. +

+
+
rtsp_transport
+

Set RTSP transport protocols. +

+

It accepts the following values: +

+
udp
+

Use UDP as lower transport protocol. +

+
+
tcp
+

Use TCP (interleaving within the RTSP control channel) as lower +transport protocol. +

+
+
udp_multicast
+

Use UDP multicast as lower transport protocol. +

+
+
http
+

Use HTTP tunneling as lower transport protocol, which is useful for +passing proxies. +

+
+
https
+

Use HTTPs tunneling as lower transport protocol, which is useful for +passing proxies and widely used for security consideration. +

+
+ +

Multiple lower transport protocols may be specified, in that case they are +tried one at a time (if the setup of one fails, the next one is tried). +For the muxer, only the ‘tcp’ and ‘udp’ options are supported. +

+
+
rtsp_flags
+

Set RTSP flags. +

+

The following values are accepted: +

+
filter_src
+

Accept packets only from negotiated peer address and port. +

+
listen
+

Act as a server, listening for an incoming connection. +

+
prefer_tcp
+

Try TCP for RTP transport first, if TCP is available as RTSP RTP transport. +

+
satip_raw
+

Export raw MPEG-TS stream instead of demuxing. The flag will simply write out +the raw stream, with the original PAT/PMT/PIDs intact. +

+
+ +

Default value is ‘none’. +

+
+
allowed_media_types
+

Set media types to accept from the server. +

+

The following flags are accepted: +

+
video
+
audio
+
data
+
subtitle
+
+ +

By default it accepts all media types. +

+
+
min_port
+

Set minimum local UDP port. Default value is 5000. +

+
+
max_port
+

Set maximum local UDP port. Default value is 65000. +

+
+
listen_timeout
+

Set maximum timeout (in seconds) to establish an initial connection. Setting +listen_timeout > 0 sets rtsp_flags to ‘listen’. Default is -1 +which means an infinite timeout when ‘listen’ mode is set. +

+
+
reorder_queue_size
+

Set number of packets to buffer for handling of reordered packets. +

+
+
timeout
+

Set socket TCP I/O timeout in microseconds. +

+
+
user_agent
+

Override User-Agent header. If not specified, it defaults to the +libavformat identifier string. +

+
+
buffer_size
+

Set the maximum socket buffer size in bytes. +

+
+ +

When receiving data over UDP, the demuxer tries to reorder received packets +(since they may arrive out of order, or packets may get lost totally). This +can be disabled by setting the maximum demuxing delay to zero (via +the max_delay field of AVFormatContext). +

+

When watching multi-bitrate Real-RTSP streams with ffplay, the +streams to display can be chosen with -vst n and +-ast n for video and audio respectively, and can be switched +on the fly by pressing v and a. +

+
+
+

16.34.3 Examples

+ +

The following examples all make use of the ffplay and +ffmpeg tools. +

+
    +
  • Watch a stream over UDP, with a max reordering delay of 0.5 seconds: +
    +
    ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
    +
    + +
  • Watch a stream tunneled over HTTP: +
    +
    ffplay -rtsp_transport http rtsp://server/video.mp4
    +
    + +
  • Send a stream in realtime to a RTSP server, for others to watch: +
    +
    ffmpeg -re -i input -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
    +
    + +
  • Receive a stream in realtime: +
    +
    ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp output
    +
    +
+ +
+
+
+

16.35 sap

+ +

Session Announcement Protocol (RFC 2974). This is not technically a +protocol handler in libavformat, it is a muxer and demuxer. +It is used for signalling of RTP streams, by announcing the SDP for the +streams regularly on a separate port. +

+ +
+

16.35.1 Muxer

+ +

The syntax for a SAP url given to the muxer is: +

+
sap://destination[:port][?options]
+
+ +

The RTP packets are sent to destination on port port, +or to port 5004 if no port is specified. +options is a &-separated list. The following options +are supported: +

+
+
announce_addr=address
+

Specify the destination IP address for sending the announcements to. +If omitted, the announcements are sent to the commonly used SAP +announcement multicast address 224.2.127.254 (sap.mcast.net), or +ff0e::2:7ffe if destination is an IPv6 address. +

+
+
announce_port=port
+

Specify the port to send the announcements on, defaults to +9875 if not specified. +

+
+
ttl=ttl
+

Specify the time to live value for the announcements and RTP packets, +defaults to 255. +

+
+
same_port=0|1
+

If set to 1, send all RTP streams on the same port pair. If zero (the +default), all streams are sent on unique ports, with each stream on a +port 2 numbers higher than the previous. +VLC/Live555 requires this to be set to 1, to be able to receive the stream. +The RTP stack in libavformat for receiving requires all streams to be sent +on unique ports. +

+
+ +

Example command lines follow. +

+

To broadcast a stream on the local subnet, for watching in VLC: +

+
+
ffmpeg -re -i input -f sap sap://224.0.0.255?same_port=1
+
+ +

Similarly, for watching in ffplay: +

+
+
ffmpeg -re -i input -f sap sap://224.0.0.255
+
+ +

And for watching in ffplay, over IPv6: +

+
+
ffmpeg -re -i input -f sap sap://[ff0e::1:2:3:4]
+
+ +
+
+

16.35.2 Demuxer

+ +

The syntax for a SAP url given to the demuxer is: +

+
sap://[address][:port]
+
+ +

address is the multicast address to listen for announcements on, +if omitted, the default 224.2.127.254 (sap.mcast.net) is used. port +is the port that is listened on, 9875 if omitted. +

+

The demuxers listens for announcements on the given address and port. +Once an announcement is received, it tries to receive that particular stream. +

+

Example command lines follow. +

+

To play back the first stream announced on the normal SAP multicast address: +

+
+
ffplay sap://
+
+ +

To play back the first stream announced on one the default IPv6 SAP multicast address: +

+
+
ffplay sap://[ff0e::2:7ffe]
+
+ +
+
+
+

16.36 sctp

+ +

Stream Control Transmission Protocol. +

+

The accepted URL syntax is: +

+
sctp://host:port[?options]
+
+ +

The protocol accepts the following options: +

+
listen
+

If set to any value, listen for an incoming connection. Outgoing connection is done by default. +

+
+
max_streams
+

Set the maximum number of streams. By default no limit is set. +

+
+ +
+
+

16.37 srt

+ +

Haivision Secure Reliable Transport Protocol via libsrt. +

+

The supported syntax for a SRT URL is: +

+
srt://hostname:port[?options]
+
+ +

options contains a list of &-separated options of the form +key=val. +

+

or +

+
+
options srt://hostname:port
+
+ +

options contains a list of ’-key val’ +options. +

+

This protocol accepts the following options. +

+
+
connect_timeout=milliseconds
+

Connection timeout; SRT cannot connect for RTT > 1500 msec +(2 handshake exchanges) with the default connect timeout of +3 seconds. This option applies to the caller and rendezvous +connection modes. The connect timeout is 10 times the value +set for the rendezvous mode (which can be used as a +workaround for this connection problem with earlier versions). +

+
+
ffs=bytes
+

Flight Flag Size (Window Size), in bytes. FFS is actually an +internal parameter and you should set it to not less than +recv_buffer_size and mss. The default value +is relatively large, therefore unless you set a very large receiver buffer, +you do not need to change this option. Default value is 25600. +

+
+
inputbw=bytes/seconds
+

Sender nominal input rate, in bytes per seconds. Used along with +oheadbw, when maxbw is set to relative (0), to +calculate maximum sending rate when recovery packets are sent +along with the main media stream: +inputbw * (100 + oheadbw) / 100 +if inputbw is not set while maxbw is set to +relative (0), the actual input rate is evaluated inside +the library. Default value is 0. +

+
+
iptos=tos
+

IP Type of Service. Applies to sender only. Default value is 0xB8. +

+
+
ipttl=ttl
+

IP Time To Live. Applies to sender only. Default value is 64. +

+
+
latency=microseconds
+

Timestamp-based Packet Delivery Delay. +Used to absorb bursts of missed packet retransmissions. +This flag sets both rcvlatency and peerlatency +to the same value. Note that prior to version 1.3.0 +this is the only flag to set the latency, however +this is effectively equivalent to setting peerlatency, +when side is sender and rcvlatency +when side is receiver, and the bidirectional stream +sending is not supported. +

+
+
listen_timeout=microseconds
+

Set socket listen timeout. +

+
+
maxbw=bytes/seconds
+

Maximum sending bandwidth, in bytes per seconds. +-1 infinite (CSRTCC limit is 30mbps) +0 relative to input rate (see inputbw) +>0 absolute limit value +Default value is 0 (relative) +

+
+
mode=caller|listener|rendezvous
+

Connection mode. +caller opens client connection. +listener starts server to listen for incoming connections. +rendezvous use Rendez-Vous connection mode. +Default value is caller. +

+
+
mss=bytes
+

Maximum Segment Size, in bytes. Used for buffer allocation +and rate calculation using a packet counter assuming fully +filled packets. The smallest MSS between the peers is +used. This is 1500 by default in the overall internet. +This is the maximum size of the UDP packet and can be +only decreased, unless you have some unusual dedicated +network settings. Default value is 1500. +

+
+
nakreport=1|0
+

If set to 1, Receiver will send ‘UMSG_LOSSREPORT‘ messages +periodically until a lost packet is retransmitted or +intentionally dropped. Default value is 1. +

+
+
oheadbw=percents
+

Recovery bandwidth overhead above input rate, in percents. +See inputbw. Default value is 25%. +

+
+
passphrase=string
+

HaiCrypt Encryption/Decryption Passphrase string, length +from 10 to 79 characters. The passphrase is the shared +secret between the sender and the receiver. It is used +to generate the Key Encrypting Key using PBKDF2 +(Password-Based Key Derivation Function). It is used +only if pbkeylen is non-zero. It is used on +the receiver only if the received data is encrypted. +The configured passphrase cannot be recovered (write-only). +

+
+
enforced_encryption=1|0
+

If true, both connection parties must have the same password +set (including empty, that is, with no encryption). If the +password doesn’t match or only one side is unencrypted, +the connection is rejected. Default is true. +

+
+
kmrefreshrate=packets
+

The number of packets to be transmitted after which the +encryption key is switched to a new key. Default is -1. +-1 means auto (0x1000000 in srt library). The range for +this option is integers in the 0 - INT_MAX. +

+
+
kmpreannounce=packets
+

The interval between when a new encryption key is sent and +when switchover occurs. This value also applies to the +subsequent interval between when switchover occurs and +when the old encryption key is decommissioned. Default is -1. +-1 means auto (0x1000 in srt library). The range for +this option is integers in the 0 - INT_MAX. +

+
+
snddropdelay=microseconds
+

The sender’s extra delay before dropping packets. This delay is +added to the default drop delay time interval value. +

+

Special value -1: Do not drop packets on the sender at all. +

+
+
payload_size=bytes
+

Sets the maximum declared size of a packet transferred +during the single call to the sending function in Live +mode. Use 0 if this value isn’t used (which is default in +file mode). +Default is -1 (automatic), which typically means MPEG-TS; +if you are going to use SRT +to send any different kind of payload, such as, for example, +wrapping a live stream in very small frames, then you can +use a bigger maximum frame size, though not greater than +1456 bytes. +

+
+
pkt_size=bytes
+

Alias for ‘payload_size’. +

+
+
peerlatency=microseconds
+

The latency value (as described in rcvlatency) that is +set by the sender side as a minimum value for the receiver. +

+
+
pbkeylen=bytes
+

Sender encryption key length, in bytes. +Only can be set to 0, 16, 24 and 32. +Enable sender encryption if not 0. +Not required on receiver (set to 0), +key size obtained from sender in HaiCrypt handshake. +Default value is 0. +

+
+
rcvlatency=microseconds
+

The time that should elapse since the moment when the +packet was sent and the moment when it’s delivered to +the receiver application in the receiving function. +This time should be a buffer time large enough to cover +the time spent for sending, unexpectedly extended RTT +time, and the time needed to retransmit the lost UDP +packet. The effective latency value will be the maximum +of this options’ value and the value of peerlatency +set by the peer side. Before version 1.3.0 this option +is only available as latency. +

+
+
recv_buffer_size=bytes
+

Set UDP receive buffer size, expressed in bytes. +

+
+
send_buffer_size=bytes
+

Set UDP send buffer size, expressed in bytes. +

+
+
timeout=microseconds
+

Set raise error timeouts for read, write and connect operations. Note that the +SRT library has internal timeouts which can be controlled separately, the +value set here is only a cap on those. +

+
+
tlpktdrop=1|0
+

Too-late Packet Drop. When enabled on receiver, it skips +missing packets that have not been delivered in time and +delivers the following packets to the application when +their time-to-play has come. It also sends a fake ACK to +the sender. When enabled on sender and enabled on the +receiving peer, the sender drops the older packets that +have no chance of being delivered in time. It was +automatically enabled in the sender if the receiver +supports it. +

+
+
sndbuf=bytes
+

Set send buffer size, expressed in bytes. +

+
+
rcvbuf=bytes
+

Set receive buffer size, expressed in bytes. +

+

Receive buffer must not be greater than ffs. +

+
+
lossmaxttl=packets
+

The value up to which the Reorder Tolerance may grow. When +Reorder Tolerance is > 0, then packet loss report is delayed +until that number of packets come in. Reorder Tolerance +increases every time a "belated" packet has come, but it +wasn’t due to retransmission (that is, when UDP packets tend +to come out of order), with the difference between the latest +sequence and this packet’s sequence, and not more than the +value of this option. By default it’s 0, which means that this +mechanism is turned off, and the loss report is always sent +immediately upon experiencing a "gap" in sequences. +

+
+
minversion
+

The minimum SRT version that is required from the peer. A connection +to a peer that does not satisfy the minimum version requirement +will be rejected. +

+

The version format in hex is 0xXXYYZZ for x.y.z in human readable +form. +

+
+
streamid=string
+

A string limited to 512 characters that can be set on the socket prior +to connecting. This stream ID will be able to be retrieved by the +listener side from the socket that is returned from srt_accept and +was connected by a socket with that set stream ID. SRT does not enforce +any special interpretation of the contents of this string. +This option doesn’t make sense in Rendezvous connection; the result +might be that simply one side will override the value from the other +side and it’s the matter of luck which one would win +

+
+
srt_streamid=string
+

Alias for ‘streamid’ to avoid conflict with ffmpeg command line option. +

+
+
smoother=live|file
+

The type of Smoother used for the transmission for that socket, which +is responsible for the transmission and congestion control. The Smoother +type must be exactly the same on both connecting parties, otherwise +the connection is rejected. +

+
+
messageapi=1|0
+

When set, this socket uses the Message API, otherwise it uses Buffer +API. Note that in live mode (see transtype) there’s only +message API available. In File mode you can chose to use one of two modes: +

+

Stream API (default, when this option is false). In this mode you may +send as many data as you wish with one sending instruction, or even use +dedicated functions that read directly from a file. The internal facility +will take care of any speed and congestion control. When receiving, you +can also receive as many data as desired, the data not extracted will be +waiting for the next call. There is no boundary between data portions in +the Stream mode. +

+

Message API. In this mode your single sending instruction passes exactly +one piece of data that has boundaries (a message). Contrary to Live mode, +this message may span across multiple UDP packets and the only size +limitation is that it shall fit as a whole in the sending buffer. The +receiver shall use as large buffer as necessary to receive the message, +otherwise the message will not be given up. When the message is not +complete (not all packets received or there was a packet loss) it will +not be given up. +

+
+
transtype=live|file
+

Sets the transmission type for the socket, in particular, setting this +option sets multiple other parameters to their default values as required +for a particular transmission type. +

+

live: Set options as for live transmission. In this mode, you should +send by one sending instruction only so many data that fit in one UDP packet, +and limited to the value defined first in payload_size (1316 is +default in this mode). There is no speed control in this mode, only the +bandwidth control, if configured, in order to not exceed the bandwidth with +the overhead transmission (retransmitted and control packets). +

+

file: Set options as for non-live transmission. See messageapi +for further explanations +

+
+
linger=seconds
+

The number of seconds that the socket waits for unsent data when closing. +Default is -1. -1 means auto (off with 0 seconds in live mode, on with 180 +seconds in file mode). The range for this option is integers in the +0 - INT_MAX. +

+
+
tsbpd=1|0
+

When true, use Timestamp-based Packet Delivery mode. The default behavior +depends on the transmission type: enabled in live mode, disabled in file +mode. +

+
+
+ +

For more information see: https://github.com/Haivision/srt. +

+
+
+

16.38 srtp

+ +

Secure Real-time Transport Protocol. +

+

The accepted options are: +

+
srtp_in_suite
+
srtp_out_suite
+

Select input and output encoding suites. +

+

Supported values: +

+
AES_CM_128_HMAC_SHA1_80
+
SRTP_AES128_CM_HMAC_SHA1_80
+
AES_CM_128_HMAC_SHA1_32
+
SRTP_AES128_CM_HMAC_SHA1_32
+
+ +
+
srtp_in_params
+
srtp_out_params
+

Set input and output encoding parameters, which are expressed by a +base64-encoded representation of a binary block. The first 16 bytes of +this binary block are used as master key, the following 14 bytes are +used as master salt. +

+
+ +
+
+

16.39 subfile

+ +

Virtually extract a segment of a file or another stream. +The underlying stream must be seekable. +

+

Accepted options: +

+
start
+

Start offset of the extracted segment, in bytes. +

+
end
+

End offset of the extracted segment, in bytes. +If set to 0, extract till end of file. +

+
+ +

Examples: +

+

Extract a chapter from a DVD VOB file (start and end sectors obtained +externally and multiplied by 2048): +

+
subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
+
+ +

Play an AVI file directly from a TAR archive: +

+
subfile,,start,183241728,end,366490624,,:archive.tar
+
+ +

Play a MPEG-TS file from start offset till end: +

+
subfile,,start,32815239,end,0,,:video.ts
+
+ +
+
+

16.40 tee

+ +

Writes the output to multiple protocols. The individual outputs are separated +by | +

+
+
tee:file://path/to/local/this.avi|file://path/to/local/that.avi
+
+ +
+
+

16.41 tcp

+ +

Transmission Control Protocol. +

+

The required syntax for a TCP url is: +

+
tcp://hostname:port[?options]
+
+ +

options contains a list of &-separated options of the form +key=val. +

+

The list of supported options follows. +

+
+
listen=2|1|0
+

Listen for an incoming connection. 0 disables listen, 1 enables listen in +single client mode, 2 enables listen in multi-client mode. Default value is 0. +

+
+
local_addr=addr
+

Local IP address of a network interface used for tcp socket connect. +

+
+
local_port=port
+

Local port used for tcp socket connect. +

+
+
timeout=microseconds
+

Set raise error timeout, expressed in microseconds. +

+

This option is only relevant in read mode: if no data arrived in more +than this time interval, raise error. +

+
+
listen_timeout=milliseconds
+

Set listen timeout, expressed in milliseconds. +

+
+
recv_buffer_size=bytes
+

Set receive buffer size, expressed bytes. +

+
+
send_buffer_size=bytes
+

Set send buffer size, expressed bytes. +

+
+
tcp_nodelay=1|0
+

Set TCP_NODELAY to disable Nagle’s algorithm. Default value is 0. +

+

Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY. +

+
+
tcp_mss=bytes
+

Set maximum segment size for outgoing TCP packets, expressed in bytes. +

+
+ +

The following example shows how to setup a listening TCP connection +with ffmpeg, which is then accessed with ffplay: +

+
ffmpeg -i input -f format tcp://hostname:port?listen
+ffplay tcp://hostname:port
+
+ +
+
+

16.42 tls

+ +

Transport Layer Security (TLS) / Secure Sockets Layer (SSL) +

+

The required syntax for a TLS/SSL url is: +

+
tls://hostname:port[?options]
+
+ +

The following parameters can be set via command line options +(or in code via AVOptions): +

+
+
ca_file, cafile=filename
+

A file containing certificate authority (CA) root certificates to treat +as trusted. If the linked TLS library contains a default this might not +need to be specified for verification to work, but not all libraries and +setups have defaults built in. +The file must be in OpenSSL PEM format. +

+
+
tls_verify=1|0
+

If enabled, try to verify the peer that we are communicating with. +Note, if using OpenSSL, this currently only makes sure that the +peer certificate is signed by one of the root certificates in the CA +database, but it does not validate that the certificate actually +matches the host name we are trying to connect to. (With other backends, +the host name is validated as well.) +

+

This is disabled by default since it requires a CA database to be +provided by the caller in many cases. +

+
+
cert_file, cert=filename
+

A file containing a certificate to use in the handshake with the peer. +(When operating as server, in listen mode, this is more often required +by the peer, while client certificates only are mandated in certain +setups.) +

+
+
key_file, key=filename
+

A file containing the private key for the certificate. +

+
+
listen=1|0
+

If enabled, listen for connections on the provided port, and assume +the server role in the handshake instead of the client role. +

+
+
http_proxy
+

The HTTP proxy to tunnel through, e.g. http://example.com:1234. +The proxy must support the CONNECT method. +

+
+
+ +

Example command lines: +

+

To create a TLS/SSL server that serves an input stream. +

+
+
ffmpeg -i input -f format tls://hostname:port?listen&cert=server.crt&key=server.key
+
+ +

To play back a stream from the TLS/SSL server using ffplay: +

+
+
ffplay tls://hostname:port
+
+ +
+
+

16.43 udp

+ +

User Datagram Protocol. +

+

The required syntax for an UDP URL is: +

+
udp://hostname:port[?options]
+
+ +

options contains a list of &-separated options of the form key=val. +

+

In case threading is enabled on the system, a circular buffer is used +to store the incoming data, which allows one to reduce loss of data due to +UDP socket buffer overruns. The fifo_size and +overrun_nonfatal options are related to this buffer. +

+

The list of supported options follows. +

+
+
buffer_size=size
+

Set the UDP maximum socket buffer size in bytes. This is used to set either +the receive or send buffer size, depending on what the socket is used for. +Default is 32 KB for output, 384 KB for input. See also fifo_size. +

+
+
bitrate=bitrate
+

If set to nonzero, the output will have the specified constant bitrate if the +input has enough packets to sustain it. +

+
+
burst_bits=bits
+

When using bitrate this specifies the maximum number of bits in +packet bursts. +

+
+
localport=port
+

Override the local UDP port to bind with. +

+
+
localaddr=addr
+

Local IP address of a network interface used for sending packets or joining +multicast groups. +

+
+
pkt_size=size
+

Set the size in bytes of UDP packets. +

+
+
reuse=1|0
+

Explicitly allow or disallow reusing UDP sockets. +

+
+
ttl=ttl
+

Set the time to live value (for multicast only). +

+
+
connect=1|0
+

Initialize the UDP socket with connect(). In this case, the +destination address can’t be changed with ff_udp_set_remote_url later. +If the destination address isn’t known at the start, this option can +be specified in ff_udp_set_remote_url, too. +This allows finding out the source address for the packets with getsockname, +and makes writes return with AVERROR(ECONNREFUSED) if "destination +unreachable" is received. +For receiving, this gives the benefit of only receiving packets from +the specified peer address/port. +

+
+
sources=address[,address]
+

Only receive packets sent from the specified addresses. In case of multicast, +also subscribe to multicast traffic coming from these addresses only. +

+
+
block=address[,address]
+

Ignore packets sent from the specified addresses. In case of multicast, also +exclude the source addresses in the multicast subscription. +

+
+
fifo_size=units
+

Set the UDP receiving circular buffer size, expressed as a number of +packets with size of 188 bytes. If not specified defaults to 7*4096. +

+
+
overrun_nonfatal=1|0
+

Survive in case of UDP receiving circular buffer overrun. Default +value is 0. +

+
+
timeout=microseconds
+

Set raise error timeout, expressed in microseconds. +

+

This option is only relevant in read mode: if no data arrived in more +than this time interval, raise error. +

+
+
broadcast=1|0
+

Explicitly allow or disallow UDP broadcasting. +

+

Note that broadcasting may not work properly on networks having +a broadcast storm protection. +

+
+ + +
+

16.43.1 Examples

+ +
    +
  • Use ffmpeg to stream over UDP to a remote endpoint: +
    +
    ffmpeg -i input -f format udp://hostname:port
    +
    + +
  • Use ffmpeg to stream in mpegts format over UDP using 188 +sized UDP packets, using a large input buffer: +
    +
    ffmpeg -i input -f mpegts udp://hostname:port?pkt_size=188&buffer_size=65535
    +
    + +
  • Use ffmpeg to receive over UDP from a remote endpoint: +
    +
    ffmpeg -i udp://[multicast-address]:port ...
    +
    +
+ +
+
+
+

16.44 unix

+ +

Unix local socket +

+

The required syntax for a Unix socket URL is: +

+
+
unix://filepath
+
+ +

The following parameters can be set via command line options +(or in code via AVOptions): +

+
+
timeout
+

Timeout in ms. +

+
listen
+

Create the Unix socket in listening mode. +

+
+ +
+
+

16.45 zmq

+ +

ZeroMQ asynchronous messaging using the libzmq library. +

+

This library supports unicast streaming to multiple clients without relying on +an external server. +

+

The required syntax for streaming or connecting to a stream is: +

+
zmq:tcp://ip-address:port
+
+ +

Example: +Create a localhost stream on port 5555: +

+
ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
+
+ +

Multiple clients may connect to the stream using: +

+
ffplay zmq:tcp://127.0.0.1:5555
+
+ +

Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern. +The server side binds to a port and publishes data. Clients connect to the +server (via IP address/port) and subscribe to the stream. The order in which +the server and client start generally does not matter. +

+

ffmpeg must be compiled with the –enable-libzmq option to support +this protocol. +

+

Options can be set on the ffmpeg/ffplay command +line. The following options are supported: +

+
+
pkt_size
+

Forces the maximum packet size for sending/receiving data. The default value is +131,072 bytes. On the server side, this sets the maximum size of sent packets +via ZeroMQ. On the clients, it sets an internal buffer size for receiving +packets. Note that pkt_size on the clients should be equal to or greater than +pkt_size on the server. Otherwise the received message may be truncated causing +decoding errors. +

+
+
+ +
+
+
+

17 Device Options

+ +

The libavdevice library provides the same interface as +libavformat. Namely, an input device is considered like a demuxer, and +an output device like a muxer, and the interface and generic device +options are the same provided by libavformat (see the ffmpeg-formats +manual). +

+

In addition each input or output device may support so-called private +options, which are specific for that component. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the device +AVFormatContext options or using the libavutil/opt.h API +for programmatic use. +

+ +
+
+

18 Input Devices

+ +

Input devices are configured elements in FFmpeg which enable accessing +the data coming from a multimedia device attached to your system. +

+

When you configure your FFmpeg build, all the supported input devices +are enabled by default. You can list all available ones using the +configure option "–list-indevs". +

+

You can disable all the input devices using the configure option +"–disable-indevs", and selectively enable an input device using the +option "–enable-indev=INDEV", or you can disable a particular +input device using the option "–disable-indev=INDEV". +

+

The option "-devices" of the ff* tools will display the list of +supported input devices. +

+

A description of the currently available input devices follows. +

+ +
+

18.1 alsa

+ +

ALSA (Advanced Linux Sound Architecture) input device. +

+

To enable this input device during configuration you need libasound +installed on your system. +

+

This device allows capturing from an ALSA device. The name of the +device to capture has to be an ALSA card identifier. +

+

An ALSA identifier has the syntax: +

+
hw:CARD[,DEV[,SUBDEV]]
+
+ +

where the DEV and SUBDEV components are optional. +

+

The three arguments (in order: CARD,DEV,SUBDEV) +specify card number or identifier, device number and subdevice number +(-1 means any). +

+

To see the list of cards currently recognized by your system check the +files /proc/asound/cards and /proc/asound/devices. +

+

For example to capture with ffmpeg from an ALSA device with +card id 0, you may run the command: +

+
ffmpeg -f alsa -i hw:0 alsaout.wav
+
+ +

For more information see: +http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html +

+ +
+

18.1.1 Options

+ +
+
sample_rate
+

Set the sample rate in Hz. Default is 48000. +

+
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

18.2 android_camera

+ +

Android camera input device. +

+

This input devices uses the Android Camera2 NDK API which is +available on devices with API level 24+. The availability of +android_camera is autodetected during configuration. +

+

This device allows capturing from all cameras on an Android device, +which are integrated into the Camera2 NDK API. +

+

The available cameras are enumerated internally and can be selected +with the camera_index parameter. The input file string is +discarded. +

+

Generally the back facing camera has index 0 while the front facing +camera has index 1. +

+ +
+

18.2.1 Options

+ +
+
video_size
+

Set the video size given as a string such as 640x480 or hd720. +Falls back to the first available configuration reported by +Android if requested video size is not available or by default. +

+
+
framerate
+

Set the video framerate. +Falls back to the first available configuration reported by +Android if requested framerate is not available or by default (-1). +

+
+
camera_index
+

Set the index of the camera to use. Default is 0. +

+
+
input_queue_size
+

Set the maximum number of frames to buffer. Default is 5. +

+
+
+ +
+
+
+

18.3 avfoundation

+ +

AVFoundation input device. +

+

AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX >= 10.7 as well as on iOS. +

+

The input filename has to be given in the following syntax: +

+
-i "[[VIDEO]:[AUDIO]]"
+
+

The first entry selects the video input while the latter selects the audio input. +The stream has to be specified by the device name or the device index as shown by the device list. +Alternatively, the video and/or audio input device can be chosen by index using the + + -video_device_index <INDEX> + +and/or + + -audio_device_index <INDEX> + +, overriding any +device name or index given in the input filename. +

+

All available devices can be enumerated by using -list_devices true, listing +all device names and corresponding indices. +

+

There are two device name aliases: +

+
default
+

Select the AVFoundation default device of the corresponding type. +

+
+
none
+

Do not record the corresponding media type. +This is equivalent to specifying an empty device name or index. +

+
+
+ + +
+

18.3.1 Options

+ +

AVFoundation supports the following options: +

+
+
-list_devices <TRUE|FALSE>
+

If set to true, a list of all available input devices is given showing all +device names and indices. +

+
+
-video_device_index <INDEX>
+

Specify the video device by its index. Overrides anything given in the input filename. +

+
+
-audio_device_index <INDEX>
+

Specify the audio device by its index. Overrides anything given in the input filename. +

+
+
-pixel_format <FORMAT>
+

Request the video device to use a specific pixel format. +If the specified format is not supported, a list of available formats is given +and the first one in this list is used instead. Available pixel formats are: +monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0, + bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10, + yuv420p, nv12, yuyv422, gray +

+
+
-framerate
+

Set the grabbing frame rate. Default is ntsc, corresponding to a +frame rate of 30000/1001. +

+
+
-video_size
+

Set the video frame size. +

+
+
-capture_cursor
+

Capture the mouse pointer. Default is 0. +

+
+
-capture_mouse_clicks
+

Capture the screen mouse clicks. Default is 0. +

+
+
-capture_raw_data
+

Capture the raw device data. Default is 0. +Using this option may result in receiving the underlying data delivered to the AVFoundation framework. E.g. for muxed devices that sends raw DV data to the framework (like tape-based camcorders), setting this option to false results in extracted video frames captured in the designated pixel format only. Setting this option to true results in receiving the raw DV stream untouched. +

+
+ +
+
+

18.3.2 Examples

+ +
    +
  • Print the list of AVFoundation supported devices and exit: +
    +
    $ ffmpeg -f avfoundation -list_devices true -i ""
    +
    + +
  • Record video from video device 0 and audio from audio device 0 into out.avi: +
    +
    $ ffmpeg -f avfoundation -i "0:0" out.avi
    +
    + +
  • Record video from video device 2 and audio from audio device 1 into out.avi: +
    +
    $ ffmpeg -f avfoundation -video_device_index 2 -i ":1" out.avi
    +
    + +
  • Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi: +
    +
    $ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
    +
    + +
  • Record raw DV data from a suitable input device and write the output into out.dv: +
    +
    $ ffmpeg -f avfoundation -capture_raw_data true -i "zr100:none" out.dv
    +
    + + +
+ +
+
+
+

18.4 bktr

+ +

BSD video input device. +

+ +
+

18.4.1 Options

+ +
+
framerate
+

Set the frame rate. +

+
+
video_size
+

Set the video frame size. Default is vga. +

+
+
standard
+
+

Available values are: +

+
pal
+
ntsc
+
secam
+
paln
+
palm
+
ntscj
+
+ +
+
+ +
+
+ +
+

18.6 dshow

+ +

Windows DirectShow input device. +

+

DirectShow support is enabled when FFmpeg is built with the mingw-w64 project. +Currently only audio and video devices are supported. +

+

Multiple devices may be opened as separate inputs, but they may also be +opened on the same input, which should improve synchronism between them. +

+

The input name should be in the format: +

+
+
TYPE=NAME[:TYPE=NAME]
+
+ +

where TYPE can be either audio or video, +and NAME is the device’s name or alternative name.. +

+ +
+

18.6.1 Options

+ +

If no options are specified, the device’s defaults are used. +If the device does not support the requested options, it will +fail to open. +

+
+
video_size
+

Set the video size in the captured video. +

+
+
framerate
+

Set the frame rate in the captured video. +

+
+
sample_rate
+

Set the sample rate (in Hz) of the captured audio. +

+
+
sample_size
+

Set the sample size (in bits) of the captured audio. +

+
+
channels
+

Set the number of channels in the captured audio. +

+
+
list_devices
+

If set to true, print a list of devices and exit. +

+
+
list_options
+

If set to true, print a list of selected device’s options +and exit. +

+
+
video_device_number
+

Set video device number for devices with the same name (starts at 0, +defaults to 0). +

+
+
audio_device_number
+

Set audio device number for devices with the same name (starts at 0, +defaults to 0). +

+
+
pixel_format
+

Select pixel format to be used by DirectShow. This may only be set when +the video codec is not set or set to rawvideo. +

+
+
audio_buffer_size
+

Set audio device buffer size in milliseconds (which can directly +impact latency, depending on the device). +Defaults to using the audio device’s +default buffer size (typically some multiple of 500ms). +Setting this value too low can degrade performance. +See also +http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx +

+
+
video_pin_name
+

Select video capture pin to use by name or alternative name. +

+
+
audio_pin_name
+

Select audio capture pin to use by name or alternative name. +

+
+
crossbar_video_input_pin_number
+

Select video input pin number for crossbar device. This will be +routed to the crossbar device’s Video Decoder output pin. +Note that changing this value can affect future invocations +(sets a new default) until system reboot occurs. +

+
+
crossbar_audio_input_pin_number
+

Select audio input pin number for crossbar device. This will be +routed to the crossbar device’s Audio Decoder output pin. +Note that changing this value can affect future invocations +(sets a new default) until system reboot occurs. +

+
+
show_video_device_dialog
+

If set to true, before capture starts, popup a display dialog +to the end user, allowing them to change video filter properties +and configurations manually. +Note that for crossbar devices, adjusting values in this dialog +may be needed at times to toggle between PAL (25 fps) and NTSC (29.97) +input frame rates, sizes, interlacing, etc. Changing these values can +enable different scan rates/frame rates and avoiding green bars at +the bottom, flickering scan lines, etc. +Note that with some devices, changing these properties can also affect future +invocations (sets new defaults) until system reboot occurs. +

+
+
show_audio_device_dialog
+

If set to true, before capture starts, popup a display dialog +to the end user, allowing them to change audio filter properties +and configurations manually. +

+
+
show_video_crossbar_connection_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify crossbar pin routings, when it opens a video device. +

+
+
show_audio_crossbar_connection_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify crossbar pin routings, when it opens an audio device. +

+
+
show_analog_tv_tuner_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify TV channels and frequencies. +

+
+
show_analog_tv_tuner_audio_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify TV audio (like mono vs. stereo, Language A,B or C). +

+
+
audio_device_load
+

Load an audio capture filter device from file instead of searching +it by name. It may load additional parameters too, if the filter +supports the serialization of its properties to. +To use this an audio capture source has to be specified, but it can +be anything even fake one. +

+
+
audio_device_save
+

Save the currently used audio capture filter device and its +parameters (if the filter supports it) to a file. +If a file with the same name exists it will be overwritten. +

+
+
video_device_load
+

Load a video capture filter device from file instead of searching +it by name. It may load additional parameters too, if the filter +supports the serialization of its properties to. +To use this a video capture source has to be specified, but it can +be anything even fake one. +

+
+
video_device_save
+

Save the currently used video capture filter device and its +parameters (if the filter supports it) to a file. +If a file with the same name exists it will be overwritten. +

+
+
use_video_device_timestamps
+

If set to false, the timestamp for video frames will be +derived from the wallclock instead of the timestamp provided by +the capture device. This allows working around devices that +provide unreliable timestamps. +

+
+
+ +
+
+

18.6.2 Examples

+ +
    +
  • Print the list of DirectShow supported devices and exit: +
    +
    $ ffmpeg -list_devices true -f dshow -i dummy
    +
    + +
  • Open video device Camera: +
    +
    $ ffmpeg -f dshow -i video="Camera"
    +
    + +
  • Open second video device with name Camera: +
    +
    $ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
    +
    + +
  • Open video device Camera and audio device Microphone: +
    +
    $ ffmpeg -f dshow -i video="Camera":audio="Microphone"
    +
    + +
  • Print the list of supported options in selected device and exit: +
    +
    $ ffmpeg -list_options true -f dshow -i video="Camera"
    +
    + +
  • Specify pin names to capture by name or alternative name, specify alternative device name: +
    +
    $ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i video=video="@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}":audio="Microphone"
    +
    + +
  • Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup: +
    +
    $ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
    +     -crossbar_audio_input_pin_number 3 -i video="AVerMedia BDA Analog Capture":audio="AVerMedia BDA Analog Capture"
    +
    + +
+ +
+
+
+

18.7 fbdev

+ +

Linux framebuffer input device. +

+

The Linux framebuffer is a graphic hardware-independent abstraction +layer to show graphics on a computer monitor, typically on the +console. It is accessed through a file device node, usually +/dev/fb0. +

+

For more detailed information read the file +Documentation/fb/framebuffer.txt included in the Linux source tree. +

+

See also http://linux-fbdev.sourceforge.net/, and fbset(1). +

+

To record from the framebuffer device /dev/fb0 with +ffmpeg: +

+
ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
+
+ +

You can take a single screenshot image with the command: +

+
ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
+
+ + +
+

18.7.1 Options

+ +
+
framerate
+

Set the frame rate. Default is 25. +

+
+
+ +
+
+
+

18.8 gdigrab

+ +

Win32 GDI-based screen capture device. +

+

This device allows you to capture a region of the display on Windows. +

+

There are two options for the input filename: +

+
desktop
+
+

or +

+
title=window_title
+
+ +

The first option will capture the entire desktop, or a fixed region of the +desktop. The second option will instead capture the contents of a single +window, regardless of its position on the screen. +

+

For example, to grab the entire desktop using ffmpeg: +

+
ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
+
+ +

Grab a 640x480 region at position 10,20: +

+
ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
+
+ +

Grab the contents of the window named "Calculator" +

+
ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
+
+ + +
+

18.8.1 Options

+ +
+
draw_mouse
+

Specify whether to draw the mouse pointer. Use the value 0 to +not draw the pointer. Default value is 1. +

+
+
framerate
+

Set the grabbing frame rate. Default value is ntsc, +corresponding to a frame rate of 30000/1001. +

+
+
show_region
+

Show grabbed region on screen. +

+

If show_region is specified with 1, then the grabbing +region will be indicated on screen. With this option, it is easy to +know what is being grabbed if only a portion of the screen is grabbed. +

+

Note that show_region is incompatible with grabbing the contents +of a single window. +

+

For example: +

+
ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
+
+ +
+
video_size
+

Set the video frame size. The default is to capture the full screen if desktop is selected, or the full window size if title=window_title is selected. +

+
+
offset_x
+

When capturing a region with video_size, set the distance from the left edge of the screen or desktop. +

+

Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned to the left of your primary monitor, you will need to use a negative offset_x value to move the region to that monitor. +

+
+
offset_y
+

When capturing a region with video_size, set the distance from the top edge of the screen or desktop. +

+

Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned above your primary monitor, you will need to use a negative offset_y value to move the region to that monitor. +

+
+
+ +
+
+
+

18.9 iec61883

+ +

FireWire DV/HDV input device using libiec61883. +

+

To enable this input device, you need libiec61883, libraw1394 and +libavc1394 installed on your system. Use the configure option +--enable-libiec61883 to compile with the device enabled. +

+

The iec61883 capture device supports capturing from a video device +connected via IEEE1394 (FireWire), using libiec61883 and the new Linux +FireWire stack (juju). This is the default DV/HDV input method in Linux +Kernel 2.6.37 and later, since the old FireWire stack was removed. +

+

Specify the FireWire port to be used as input file, or "auto" +to choose the first port connected. +

+ +
+

18.9.1 Options

+ +
+
dvtype
+

Override autodetection of DV/HDV. This should only be used if auto +detection does not work, or if usage of a different device type +should be prohibited. Treating a DV device as HDV (or vice versa) will +not work and result in undefined behavior. +The values auto, dv and hdv are supported. +

+
+
dvbuffer
+

Set maximum size of buffer for incoming data, in frames. For DV, this +is an exact value. For HDV, it is not frame exact, since HDV does +not have a fixed frame size. +

+
+
dvguid
+

Select the capture device by specifying its GUID. Capturing will only +be performed from the specified device and fails if no device with the +given GUID is found. This is useful to select the input if multiple +devices are connected at the same time. +Look at /sys/bus/firewire/devices to find out the GUIDs. +

+
+
+ +
+
+

18.9.2 Examples

+ +
    +
  • Grab and show the input of a FireWire DV/HDV device. +
    +
    ffplay -f iec61883 -i auto
    +
    + +
  • Grab and record the input of a FireWire DV/HDV device, +using a packet buffer of 100000 packets if the source is HDV. +
    +
    ffmpeg -f iec61883 -i auto -dvbuffer 100000 out.mpg
    +
    + +
+ +
+
+
+

18.10 jack

+ +

JACK input device. +

+

To enable this input device during configuration you need libjack +installed on your system. +

+

A JACK input device creates one or more JACK writable clients, one for +each audio channel, with name client_name:input_N, where +client_name is the name provided by the application, and N +is a number which identifies the channel. +Each writable client will send the acquired data to the FFmpeg input +device. +

+

Once you have created one or more JACK readable clients, you need to +connect them to one or more JACK writable clients. +

+

To connect or disconnect JACK clients you can use the jack_connect +and jack_disconnect programs, or do it through a graphical interface, +for example with qjackctl. +

+

To list the JACK clients and their properties you can invoke the command +jack_lsp. +

+

Follows an example which shows how to capture a JACK readable client +with ffmpeg. +

+
# Create a JACK writable client with name "ffmpeg".
+$ ffmpeg -f jack -i ffmpeg -y out.wav
+
+# Start the sample jack_metro readable client.
+$ jack_metro -b 120 -d 0.2 -f 4000
+
+# List the current JACK clients.
+$ jack_lsp -c
+system:capture_1
+system:capture_2
+system:playback_1
+system:playback_2
+ffmpeg:input_1
+metro:120_bpm
+
+# Connect metro to the ffmpeg writable client.
+$ jack_connect metro:120_bpm ffmpeg:input_1
+
+ +

For more information read: +http://jackaudio.org/ +

+ +
+

18.10.1 Options

+ +
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

18.11 kmsgrab

+ +

KMS video input device. +

+

Captures the KMS scanout framebuffer associated with a specified CRTC or plane as a +DRM object that can be passed to other hardware functions. +

+

Requires either DRM master or CAP_SYS_ADMIN to run. +

+

If you don’t understand what all of that means, you probably don’t want this. Look at +x11grab instead. +

+ +
+

18.11.1 Options

+ +
+
device
+

DRM device to capture on. Defaults to /dev/dri/card0. +

+
+
format
+

Pixel format of the framebuffer. This can be autodetected if you are running Linux 5.7 +or later, but needs to be provided for earlier versions. Defaults to bgr0, +which is the most common format used by the Linux console and Xorg X server. +

+
+
format_modifier
+

Format modifier to signal on output frames. This is necessary to import correctly into +some APIs. It can be autodetected if you are running Linux 5.7 or later, but will need +to be provided explicitly when needed in earlier versions. See the libdrm documentation +for possible values. +

+
+
crtc_id
+

KMS CRTC ID to define the capture source. The first active plane on the given CRTC +will be used. +

+
+
plane_id
+

KMS plane ID to define the capture source. Defaults to the first active plane found if +neither crtc_id nor plane_id are specified. +

+
+
framerate
+

Framerate to capture at. This is not synchronised to any page flipping or framebuffer +changes - it just defines the interval at which the framebuffer is sampled. Sampling +faster than the framebuffer update rate will generate independent frames with the same +content. Defaults to 30. +

+
+
+ +
+
+

18.11.2 Examples

+ +
    +
  • Capture from the first active plane, download the result to normal frames and encode. +This will only work if the framebuffer is both linear and mappable - if not, the result +may be scrambled or fail to download. +
    +
    ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4
    +
    + +
  • Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert to NV12 and encode as H.264. +
    +
    ffmpeg -crtc_id 42 -framerate 60 -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' -c:v h264_vaapi output.mp4
    +
    + +
  • To capture only part of a plane the output can be cropped - this can be used to capture +a single window, as long as it has a known absolute position and size. For example, to +capture and encode the middle quarter of a 1920x1080 plane: +
    +
    ffmpeg -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,crop=960:540:480:270,scale_vaapi=960:540:nv12' -c:v h264_vaapi output.mp4
    +
    + +
+ +
+
+
+

18.12 lavfi

+ +

Libavfilter input virtual device. +

+

This input device reads data from the open output pads of a libavfilter +filtergraph. +

+

For each filtergraph open output, the input device will create a +corresponding stream which is mapped to the generated output. +The filtergraph is specified through the option graph. +

+ +
+

18.12.1 Options

+ +
+
graph
+

Specify the filtergraph to use as input. Each video open output must be +labelled by a unique string of the form "outN", where N is a +number starting from 0 corresponding to the mapped input stream +generated by the device. +The first unlabelled output is automatically assigned to the "out0" +label, but all the others need to be specified explicitly. +

+

The suffix "+subcc" can be appended to the output label to create an extra +stream with the closed captions packets attached to that output +(experimental; only for EIA-608 / CEA-708 for now). +The subcc streams are created after all the normal streams, in the order of +the corresponding stream. +For example, if there is "out19+subcc", "out7+subcc" and up to "out42", the +stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19. +

+

If not specified defaults to the filename specified for the input +device. +

+
+
graph_file
+

Set the filename of the filtergraph to be read and sent to the other +filters. Syntax of the filtergraph is the same as the one specified by +the option graph. +

+
+
dumpgraph
+

Dump graph to stderr. +

+
+
+ +
+
+

18.12.2 Examples

+ +
    +
  • Create a color video stream and play it back with ffplay: +
    +
    ffplay -f lavfi -graph "color=c=pink [out0]" dummy
    +
    + +
  • As the previous example, but use filename for specifying the graph +description, and omit the "out0" label: +
    +
    ffplay -f lavfi color=c=pink
    +
    + +
  • Create three different video test filtered sources and play them: +
    +
    ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
    +
    + +
  • Read an audio stream from a file using the amovie source and play it +back with ffplay: +
    +
    ffplay -f lavfi "amovie=test.wav"
    +
    + +
  • Read an audio stream and a video stream and play it back with +ffplay: +
    +
    ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
    +
    + +
  • Dump decoded frames to images and closed captions to a file (experimental): +
    +
    ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
    +
    + +
+ +
+
+
+

18.13 libcdio

+ +

Audio-CD input device based on libcdio. +

+

To enable this input device during configuration you need libcdio +installed on your system. It requires the configure option +--enable-libcdio. +

+

This device allows playing and grabbing from an Audio-CD. +

+

For example to copy with ffmpeg the entire Audio-CD in /dev/sr0, +you may run the command: +

+
ffmpeg -f libcdio -i /dev/sr0 cd.wav
+
+ + +
+

18.13.1 Options

+
+
speed
+

Set drive reading speed. Default value is 0. +

+

The speed is specified CD-ROM speed units. The speed is set through +the libcdio cdio_cddap_speed_set function. On many CD-ROM +drives, specifying a value too large will result in using the fastest +speed. +

+
+
paranoia_mode
+

Set paranoia recovery mode flags. It accepts one of the following values: +

+
+
disable
+
verify
+
overlap
+
neverskip
+
full
+
+ +

Default value is ‘disable’. +

+

For more information about the available recovery modes, consult the +paranoia project documentation. +

+
+ +
+
+
+

18.14 libdc1394

+ +

IIDC1394 input device, based on libdc1394 and libraw1394. +

+

Requires the configure option --enable-libdc1394. +

+ +
+

18.14.1 Options

+
+
framerate
+

Set the frame rate. Default is ntsc, corresponding to a frame +rate of 30000/1001. +

+
+
pixel_format
+

Select the pixel format. Default is uyvy422. +

+
+
video_size
+

Set the video size given as a string such as 640x480 or hd720. +Default is qvga. +

+
+ +
+
+
+

18.15 openal

+ +

The OpenAL input device provides audio capture on all systems with a +working OpenAL 1.1 implementation. +

+

To enable this input device during configuration, you need OpenAL +headers and libraries installed on your system, and need to configure +FFmpeg with --enable-openal. +

+

OpenAL headers and libraries should be provided as part of your OpenAL +implementation, or as an additional download (an SDK). Depending on your +installation you may need to specify additional flags via the +--extra-cflags and --extra-ldflags for allowing the build +system to locate the OpenAL headers and libraries. +

+

An incomplete list of OpenAL implementations follows: +

+
+
Creative
+

The official Windows implementation, providing hardware acceleration +with supported devices and software fallback. +See http://openal.org/. +

+
OpenAL Soft
+

Portable, open source (LGPL) software implementation. Includes +backends for the most common sound APIs on the Windows, Linux, +Solaris, and BSD operating systems. +See http://kcat.strangesoft.net/openal.html. +

+
Apple
+

OpenAL is part of Core Audio, the official Mac OS X Audio interface. +See http://developer.apple.com/technologies/mac/audio-and-video.html +

+
+ +

This device allows one to capture from an audio input device handled +through OpenAL. +

+

You need to specify the name of the device to capture in the provided +filename. If the empty string is provided, the device will +automatically select the default device. You can get the list of the +supported devices by using the option list_devices. +

+ +
+

18.15.1 Options

+ +
+
channels
+

Set the number of channels in the captured audio. Only the values +1 (monaural) and 2 (stereo) are currently supported. +Defaults to 2. +

+
+
sample_size
+

Set the sample size (in bits) of the captured audio. Only the values +8 and 16 are currently supported. Defaults to +16. +

+
+
sample_rate
+

Set the sample rate (in Hz) of the captured audio. +Defaults to 44.1k. +

+
+
list_devices
+

If set to true, print a list of devices and exit. +Defaults to false. +

+
+
+ +
+
+

18.15.2 Examples

+ +

Print the list of OpenAL supported devices and exit: +

+
$ ffmpeg -list_devices true -f openal -i dummy out.ogg
+
+ +

Capture from the OpenAL device DR-BT101 via PulseAudio: +

+
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
+
+ +

Capture from the default device (note the empty string ” as filename): +

+
$ ffmpeg -f openal -i '' out.ogg
+
+ +

Capture from two devices simultaneously, writing to two different files, +within the same ffmpeg command: +

+
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
+
+

Note: not all OpenAL implementations support multiple simultaneous capture - +try the latest OpenAL Soft if the above does not work. +

+
+
+
+

18.16 oss

+ +

Open Sound System input device. +

+

The filename to provide to the input device is the device node +representing the OSS input device, and is usually set to +/dev/dsp. +

+

For example to grab from /dev/dsp using ffmpeg use the +command: +

+
ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
+
+ +

For more information about OSS see: +http://manuals.opensound.com/usersguide/dsp.html +

+ +
+

18.16.1 Options

+ +
+
sample_rate
+

Set the sample rate in Hz. Default is 48000. +

+
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

18.17 pulse

+ +

PulseAudio input device. +

+

To enable this output device you need to configure FFmpeg with --enable-libpulse. +

+

The filename to provide to the input device is a source device or the +string "default" +

+

To list the PulseAudio source devices and their properties you can invoke +the command pactl list sources. +

+

More information about PulseAudio can be found on http://www.pulseaudio.org. +

+ +
+

18.17.1 Options

+
+
server
+

Connect to a specific PulseAudio server, specified by an IP address. +Default server is used when not provided. +

+
+
name
+

Specify the application name PulseAudio will use when showing active clients, +by default it is the LIBAVFORMAT_IDENT string. +

+
+
stream_name
+

Specify the stream name PulseAudio will use when showing active streams, +by default it is "record". +

+
+
sample_rate
+

Specify the samplerate in Hz, by default 48kHz is used. +

+
+
channels
+

Specify the channels in use, by default 2 (stereo) is set. +

+
+
frame_size
+

This option does nothing and is deprecated. +

+
+
fragment_size
+

Specify the size in bytes of the minimal buffering fragment in PulseAudio, it +will affect the audio latency. By default it is set to 50 ms amount of data. +

+
+
wallclock
+

Set the initial PTS using the current time. Default is 1. +

+
+
+ +
+
+

18.17.2 Examples

+

Record a stream from default device: +

+
ffmpeg -f pulse -i default /tmp/pulse.wav
+
+ +
+
+
+

18.18 sndio

+ +

sndio input device. +

+

To enable this input device during configuration you need libsndio +installed on your system. +

+

The filename to provide to the input device is the device node +representing the sndio input device, and is usually set to +/dev/audio0. +

+

For example to grab from /dev/audio0 using ffmpeg use the +command: +

+
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
+
+ + +
+

18.18.1 Options

+ +
+
sample_rate
+

Set the sample rate in Hz. Default is 48000. +

+
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

18.19 video4linux2, v4l2

+ +

Video4Linux2 input video device. +

+

"v4l2" can be used as alias for "video4linux2". +

+

If FFmpeg is built with v4l-utils support (by using the +--enable-libv4l2 configure option), it is possible to use it with the +-use_libv4l2 input device option. +

+

The name of the device to grab is a file device node, usually Linux +systems tend to automatically create such nodes when the device +(e.g. an USB webcam) is plugged into the system, and has a name of the +kind /dev/videoN, where N is a number associated to +the device. +

+

Video4Linux2 devices usually support a limited set of +widthxheight sizes and frame rates. You can check which are +supported using -list_formats all for Video4Linux2 devices. +Some devices, like TV cards, support one or more standards. It is possible +to list all the supported standards using -list_standards all. +

+

The time base for the timestamps is 1 microsecond. Depending on the kernel +version and configuration, the timestamps may be derived from the real time +clock (origin at the Unix Epoch) or the monotonic clock (origin usually at +boot time, unaffected by NTP or manual changes to the clock). The +-timestamps abs or -ts abs option can be used to force +conversion into the real time clock. +

+

Some usage examples of the video4linux2 device with ffmpeg +and ffplay: +

    +
  • List supported formats for a video4linux2 device: +
    +
    ffplay -f video4linux2 -list_formats all /dev/video0
    +
    + +
  • Grab and show the input of a video4linux2 device: +
    +
    ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
    +
    + +
  • Grab and record the input of a video4linux2 device, leave the +frame rate and size as previously set: +
    +
    ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
    +
    +
+ +

For more information about Video4Linux, check http://linuxtv.org/. +

+ +
+

18.19.1 Options

+ +
+
standard
+

Set the standard. Must be the name of a supported standard. To get a +list of the supported standards, use the list_standards +option. +

+
+
channel
+

Set the input channel number. Default to -1, which means using the +previously selected channel. +

+
+
video_size
+

Set the video frame size. The argument must be a string in the form +WIDTHxHEIGHT or a valid size abbreviation. +

+
+
pixel_format
+

Select the pixel format (only valid for raw video input). +

+
+
input_format
+

Set the preferred pixel format (for raw video) or a codec name. +This option allows one to select the input format, when several are +available. +

+
+
framerate
+

Set the preferred video frame rate. +

+
+
list_formats
+

List available formats (supported pixel formats, codecs, and frame +sizes) and exit. +

+

Available values are: +

+
all
+

Show all available (compressed and non-compressed) formats. +

+
+
raw
+

Show only raw video (non-compressed) formats. +

+
+
compressed
+

Show only compressed formats. +

+
+ +
+
list_standards
+

List supported standards and exit. +

+

Available values are: +

+
all
+

Show all supported standards. +

+
+ +
+
timestamps, ts
+

Set type of timestamps for grabbed frames. +

+

Available values are: +

+
default
+

Use timestamps from the kernel. +

+
+
abs
+

Use absolute timestamps (wall clock). +

+
+
mono2abs
+

Force conversion from monotonic to absolute timestamps. +

+
+ +

Default value is default. +

+
+
use_libv4l2
+

Use libv4l2 (v4l-utils) conversion functions. Default is 0. +

+
+
+ +
+
+
+

18.20 vfwcap

+ +

VfW (Video for Windows) capture input device. +

+

The filename passed as input is the capture driver number, ranging from +0 to 9. You may use "list" as filename to print a list of drivers. Any +other filename will be interpreted as device number 0. +

+ +
+

18.20.1 Options

+ +
+
video_size
+

Set the video frame size. +

+
+
framerate
+

Set the grabbing frame rate. Default value is ntsc, +corresponding to a frame rate of 30000/1001. +

+
+
+ +
+
+
+

18.21 x11grab

+ +

X11 video input device. +

+

To enable this input device during configuration you need libxcb +installed on your system. It will be automatically detected during +configuration. +

+

This device allows one to capture a region of an X11 display. +

+

The filename passed as input has the syntax: +

+
[hostname]:display_number.screen_number[+x_offset,y_offset]
+
+ +

hostname:display_number.screen_number specifies the +X11 display name of the screen to grab from. hostname can be +omitted, and defaults to "localhost". The environment variable +DISPLAY contains the default display name. +

+

x_offset and y_offset specify the offsets of the grabbed +area with respect to the top-left border of the X11 screen. They +default to 0. +

+

Check the X11 documentation (e.g. man X) for more detailed +information. +

+

Use the xdpyinfo program for getting basic information about +the properties of your X11 display (e.g. grep for "name" or +"dimensions"). +

+

For example to grab from :0.0 using ffmpeg: +

+
ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +

Grab at position 10,20: +

+
ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
+
+ + +
+

18.21.1 Options

+ +
+
select_region
+

Specify whether to select the grabbing area graphically using the pointer. +A value of 1 prompts the user to select the grabbing area graphically +by clicking and dragging. A single click with no dragging will select the +whole screen. A region with zero width or height will also select the whole +screen. This option overwrites the video_size, grab_x, and +grab_y options. Default value is 0. +

+
+
draw_mouse
+

Specify whether to draw the mouse pointer. A value of 0 specifies +not to draw the pointer. Default value is 1. +

+
+
follow_mouse
+

Make the grabbed area follow the mouse. The argument can be +centered or a number of pixels PIXELS. +

+

When it is specified with "centered", the grabbing region follows the mouse +pointer and keeps the pointer at the center of region; otherwise, the region +follows only when the mouse pointer reaches within PIXELS (greater than +zero) to the edge of region. +

+

For example: +

+
ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +

To follow only when the mouse pointer reaches within 100 pixels to edge: +

+
ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +
+
framerate
+

Set the grabbing frame rate. Default value is ntsc, +corresponding to a frame rate of 30000/1001. +

+
+
show_region
+

Show grabbed region on screen. +

+

If show_region is specified with 1, then the grabbing +region will be indicated on screen. With this option, it is easy to +know what is being grabbed if only a portion of the screen is grabbed. +

+
+
region_border
+

Set the region border thickness if -show_region 1 is used. +Range is 1 to 128 and default is 3 (XCB-based x11grab only). +

+

For example: +

+
ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
+
+ +

With follow_mouse: +

+
ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +
+
window_id
+

Grab this window, instead of the whole screen. Default value is 0, which maps to +the whole screen (root window). +

+

The id of a window can be found using the xwininfo program, possibly with options -tree and +-root. +

+

If the window is later enlarged, the new area is not recorded. Video ends when +the window is closed, unmapped (i.e., iconified) or shrunk beyond the video +size (which defaults to the initial window size). +

+

This option disables options follow_mouse and select_region. +

+
+
video_size
+

Set the video frame size. Default is the full desktop or window. +

+
+
grab_x
+
grab_y
+

Set the grabbing region coordinates. They are expressed as offset from +the top left corner of the X11 window and correspond to the +x_offset and y_offset parameters in the device name. The +default value for both options is 0. +

+
+ +
+
+
+
+

19 Resampler Options

+ +

The audio resampler supports the following named options. +

+

Options may be set by specifying -option value in the +FFmpeg tools, option=value for the aresample filter, +by setting the value explicitly in the +SwrContext options or using the libavutil/opt.h API for +programmatic use. +

+
+
uchl, used_chlayout
+

Set used input channel layout. Default is unset. This option is +only used for special remapping. +

+
+
isr, in_sample_rate
+

Set the input sample rate. Default value is 0. +

+
+
osr, out_sample_rate
+

Set the output sample rate. Default value is 0. +

+
+
isf, in_sample_fmt
+

Specify the input sample format. It is set by default to none. +

+
+
osf, out_sample_fmt
+

Specify the output sample format. It is set by default to none. +

+
+
tsf, internal_sample_fmt
+

Set the internal sample format. Default value is none. +This will automatically be chosen when it is not explicitly set. +

+
+
ichl, in_chlayout
+
ochl, out_chlayout
+

Set the input/output channel layout. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+
clev, center_mix_level
+

Set the center mix level. It is a value expressed in deciBel, and must be +in the interval [-32,32]. +

+
+
slev, surround_mix_level
+

Set the surround mix level. It is a value expressed in deciBel, and must +be in the interval [-32,32]. +

+
+
lfe_mix_level
+

Set LFE mix into non LFE level. It is used when there is a LFE input but no +LFE output. It is a value expressed in deciBel, and must +be in the interval [-32,32]. +

+
+
rmvol, rematrix_volume
+

Set rematrix volume. Default value is 1.0. +

+
+
rematrix_maxval
+

Set maximum output value for rematrixing. +This can be used to prevent clipping vs. preventing volume reduction. +A value of 1.0 prevents clipping. +

+
+
flags, swr_flags
+

Set flags used by the converter. Default value is 0. +

+

It supports the following individual flags: +

+
res
+

force resampling, this flag forces resampling to be used even when the +input and output sample rates match. +

+
+ +
+
dither_scale
+

Set the dither scale. Default value is 1. +

+
+
dither_method
+

Set dither method. Default value is 0. +

+

Supported values: +

+
rectangular
+

select rectangular dither +

+
triangular
+

select triangular dither +

+
triangular_hp
+

select triangular dither with high pass +

+
lipshitz
+

select Lipshitz noise shaping dither. +

+
shibata
+

select Shibata noise shaping dither. +

+
low_shibata
+

select low Shibata noise shaping dither. +

+
high_shibata
+

select high Shibata noise shaping dither. +

+
f_weighted
+

select f-weighted noise shaping dither +

+
modified_e_weighted
+

select modified-e-weighted noise shaping dither +

+
improved_e_weighted
+

select improved-e-weighted noise shaping dither +

+
+
+ +
+
resampler
+

Set resampling engine. Default value is swr. +

+

Supported values: +

+
swr
+

select the native SW Resampler; filter options precision and cheby are not +applicable in this case. +

+
soxr
+

select the SoX Resampler (where available); compensation, and filter options +filter_size, phase_shift, exact_rational, filter_type & kaiser_beta, are not +applicable in this case. +

+
+ +
+
filter_size
+

For swr only, set resampling filter size, default value is 32. +

+
+
phase_shift
+

For swr only, set resampling phase shift, default value is 10, and must be in +the interval [0,30]. +

+
+
linear_interp
+

Use linear interpolation when enabled (the default). Disable it if you want +to preserve speed instead of quality when exact_rational fails. +

+
+
exact_rational
+

For swr only, when enabled, try to use exact phase_count based on input and +output sample rate. However, if it is larger than 1 << phase_shift, +the phase_count will be 1 << phase_shift as fallback. Default is enabled. +

+
+
cutoff
+

Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float +value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr +(which, with a sample-rate of 44100, preserves the entire audio band to 20kHz). +

+
+
precision
+

For soxr only, the precision in bits to which the resampled signal will be +calculated. The default value of 20 (which, with suitable dithering, is +appropriate for a destination bit-depth of 16) gives SoX’s ’High Quality’; a +value of 28 gives SoX’s ’Very High Quality’. +

+
+
cheby
+

For soxr only, selects passband rolloff none (Chebyshev) & higher-precision +approximation for ’irrational’ ratios. Default value is 0. +

+
+
async
+

For swr only, simple 1 parameter audio sync to timestamps using stretching, +squeezing, filling and trimming. Setting this to 1 will enable filling and +trimming, larger values represent the maximum amount in samples that the data +may be stretched or squeezed for each second. +Default value is 0, thus no compensation is applied to make the samples match +the audio timestamps. +

+
+
first_pts
+

For swr only, assume the first pts should be this value. The time unit is 1 / sample rate. +This allows for padding/trimming at the start of stream. By default, no +assumption is made about the first frame’s expected pts, so no padding or +trimming is done. For example, this could be set to 0 to pad the beginning with +silence if an audio stream starts after the video stream or to trim any samples +with a negative pts due to encoder delay. +

+
+
min_comp
+

For swr only, set the minimum difference between timestamps and audio data (in +seconds) to trigger stretching/squeezing/filling or trimming of the +data to make it match the timestamps. The default is that +stretching/squeezing/filling and trimming is disabled +(min_comp = FLT_MAX). +

+
+
min_hard_comp
+

For swr only, set the minimum difference between timestamps and audio data (in +seconds) to trigger adding/dropping samples to make it match the +timestamps. This option effectively is a threshold to select between +hard (trim/fill) and soft (squeeze/stretch) compensation. Note that +all compensation is by default disabled through min_comp. +The default is 0.1. +

+
+
comp_duration
+

For swr only, set duration (in seconds) over which data is stretched/squeezed +to make it match the timestamps. Must be a non-negative double float value, +default value is 1.0. +

+
+
max_soft_comp
+

For swr only, set maximum factor by which data is stretched/squeezed to make it +match the timestamps. Must be a non-negative double float value, default value +is 0. +

+
+
matrix_encoding
+

Select matrixed stereo encoding. +

+

It accepts the following values: +

+
none
+

select none +

+
dolby
+

select Dolby +

+
dplii
+

select Dolby Pro Logic II +

+
+ +

Default value is none. +

+
+
filter_type
+

For swr only, select resampling filter type. This only affects resampling +operations. +

+

It accepts the following values: +

+
cubic
+

select cubic +

+
blackman_nuttall
+

select Blackman Nuttall windowed sinc +

+
kaiser
+

select Kaiser windowed sinc +

+
+ +
+
kaiser_beta
+

For swr only, set Kaiser window beta value. Must be a double float value in the +interval [2,16], default value is 9. +

+
+
output_sample_bits
+

For swr only, set number of used output sample bits for dithering. Must be an integer in the +interval [0,64], default value is 0, which means it’s not used. +

+
+
+ +
+
+

20 Scaler Options

+ +

The video scaler supports the following named options. +

+

Options may be set by specifying -option value in the +FFmpeg tools, with a few API-only exceptions noted below. +For programmatic use, they can be set explicitly in the +SwsContext options or through the libavutil/opt.h API. +

+
+
+
+
sws_flags
+

Set the scaler flags. This is also used to set the scaling +algorithm. Only a single algorithm should be selected. Default +value is ‘bicubic’. +

+

It accepts the following values: +

+
fast_bilinear
+

Select fast bilinear scaling algorithm. +

+
+
bilinear
+

Select bilinear scaling algorithm. +

+
+
bicubic
+

Select bicubic scaling algorithm. +

+
+
experimental
+

Select experimental scaling algorithm. +

+
+
neighbor
+

Select nearest neighbor rescaling algorithm. +

+
+
area
+

Select averaging area rescaling algorithm. +

+
+
bicublin
+

Select bicubic scaling algorithm for the luma component, bilinear for +chroma components. +

+
+
gauss
+

Select Gaussian rescaling algorithm. +

+
+
sinc
+

Select sinc rescaling algorithm. +

+
+
lanczos
+

Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be +changed by setting param0. +

+
+
spline
+

Select natural bicubic spline rescaling algorithm. +

+
+
print_info
+

Enable printing/debug logging. +

+
+
accurate_rnd
+

Enable accurate rounding. +

+
+
full_chroma_int
+

Enable full chroma interpolation. +

+
+
full_chroma_inp
+

Select full chroma input. +

+
+
bitexact
+

Enable bitexact output. +

+
+ +
+
srcw (API only)
+

Set source width. +

+
+
srch (API only)
+

Set source height. +

+
+
dstw (API only)
+

Set destination width. +

+
+
dsth (API only)
+

Set destination height. +

+
+
src_format (API only)
+

Set source pixel format (must be expressed as an integer). +

+
+
dst_format (API only)
+

Set destination pixel format (must be expressed as an integer). +

+
+
src_range (boolean)
+

If value is set to 1, indicates source is full range. Default value is +0, which indicates source is limited range. +

+
+
dst_range (boolean)
+

If value is set to 1, enable full range for destination. Default value +is 0, which enables limited range. +

+
+
param0, param1
+

Set scaling algorithm parameters. The specified values are specific of +some scaling algorithms and ignored by others. The specified values +are floating point number values. +

+
+
sws_dither
+

Set the dithering algorithm. Accepts one of the following +values. Default value is ‘auto’. +

+
+
auto
+

automatic choice +

+
+
none
+

no dithering +

+
+
bayer
+

bayer dither +

+
+
ed
+

error diffusion dither +

+
+
a_dither
+

arithmetic dither, based using addition +

+
+
x_dither
+

arithmetic dither, based using xor (more random/less apparent patterning that +a_dither). +

+
+
+ +
+
alphablend
+

Set the alpha blending to use when the input has alpha but the output does not. +Default value is ‘none’. +

+
+
uniform_color
+

Blend onto a uniform background color +

+
+
checkerboard
+

Blend onto a checkerboard +

+
+
none
+

No blending +

+
+
+ +
+
+ +
+
+

21 Filtering Introduction

+ +

Filtering in FFmpeg is enabled through the libavfilter library. +

+

In libavfilter, a filter can have multiple inputs and multiple +outputs. +To illustrate the sorts of things that are possible, we consider the +following filtergraph. +

+
                [main]
+input --> split ---------------------> overlay --> output
+            |                             ^
+            |[tmp]                  [flip]|
+            +-----> crop --> vflip -------+
+
+

This filtergraph splits the input stream in two streams, then sends one +stream through the crop filter and the vflip filter, before merging it +back with the other stream by overlaying it on top. You can use the +following command to achieve this: +

+
+
ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT
+
+ +

The result will be that the top half of the video is mirrored +onto the bottom half of the output video. +

+

Filters in the same linear chain are separated by commas, and distinct +linear chains of filters are separated by semicolons. In our example, +crop,vflip are in one linear chain, split and +overlay are separately in another. The points where the linear +chains join are labelled by names enclosed in square brackets. In the +example, the split filter generates two outputs that are associated to +the labels [main] and [tmp]. +

+

The stream sent to the second output of split, labelled as +[tmp], is processed through the crop filter, which crops +away the lower half part of the video, and then vertically flipped. The +overlay filter takes in input the first unchanged output of the +split filter (which was labelled as [main]), and overlay on its +lower half the output generated by the crop,vflip filterchain. +

+

Some filters take in input a list of parameters: they are specified +after the filter name and an equal sign, and are separated from each other +by a colon. +

+

There exist so-called source filters that do not have an +audio/video input, and sink filters that will not have audio/video +output. +

+ +
+
+

22 graph2dot

+ +

The graph2dot program included in the FFmpeg tools +directory can be used to parse a filtergraph description and issue a +corresponding textual representation in the dot language. +

+

Invoke the command: +

+
graph2dot -h
+
+ +

to see how to use graph2dot. +

+

You can then pass the dot description to the dot program (from +the graphviz suite of programs) and obtain a graphical representation +of the filtergraph. +

+

For example the sequence of commands: +

+
echo GRAPH_DESCRIPTION | \
+tools/graph2dot -o graph.tmp && \
+dot -Tpng graph.tmp -o graph.png && \
+display graph.png
+
+ +

can be used to create and display an image representing the graph +described by the GRAPH_DESCRIPTION string. Note that this string must be +a complete self-contained graph, with its inputs and outputs explicitly defined. +For example if your command line is of the form: +

+
ffmpeg -i infile -vf scale=640:360 outfile
+
+

your GRAPH_DESCRIPTION string will need to be of the form: +

+
nullsrc,scale=640:360,nullsink
+
+

you may also need to set the nullsrc parameters and add a format +filter in order to simulate a specific input file. +

+ +
+
+

23 Filtergraph description

+ +

A filtergraph is a directed graph of connected filters. It can contain +cycles, and there can be multiple links between a pair of +filters. Each link has one input pad on one side connecting it to one +filter from which it takes its input, and one output pad on the other +side connecting it to one filter accepting its output. +

+

Each filter in a filtergraph is an instance of a filter class +registered in the application, which defines the features and the +number of input and output pads of the filter. +

+

A filter with no input pads is called a "source", and a filter with no +output pads is called a "sink". +

+ +
+

23.1 Filtergraph syntax

+ +

A filtergraph has a textual representation, which is recognized by the +-filter/-vf/-af and +-filter_complex options in ffmpeg and +-vf/-af in ffplay, and by the +avfilter_graph_parse_ptr() function defined in +libavfilter/avfilter.h. +

+

A filterchain consists of a sequence of connected filters, each one +connected to the previous one in the sequence. A filterchain is +represented by a list of ","-separated filter descriptions. +

+

A filtergraph consists of a sequence of filterchains. A sequence of +filterchains is represented by a list of ";"-separated filterchain +descriptions. +

+

A filter is represented by a string of the form: +[in_link_1]...[in_link_N]filter_name@id=arguments[out_link_1]...[out_link_M] +

+

filter_name is the name of the filter class of which the +described filter is an instance of, and has to be the name of one of +the filter classes registered in the program optionally followed by "@id". +The name of the filter class is optionally followed by a string +"=arguments". +

+

arguments is a string which contains the parameters used to +initialize the filter instance. It may have one of two forms: +

    +
  • A ’:’-separated list of key=value pairs. + +
  • A ’:’-separated list of value. In this case, the keys are assumed to be +the option names in the order they are declared. E.g. the fade filter +declares three options in this order – type, start_frame and +nb_frames. Then the parameter list in:0:30 means that the value +in is assigned to the option type, 0 to +start_frame and 30 to nb_frames. + +
  • A ’:’-separated list of mixed direct value and long key=value +pairs. The direct value must precede the key=value pairs, and +follow the same constraints order of the previous point. The following +key=value pairs can be set in any preferred order. + +
+ +

If the option value itself is a list of items (e.g. the format filter +takes a list of pixel formats), the items in the list are usually separated by +‘|’. +

+

The list of arguments can be quoted using the character ‘'’ as initial +and ending mark, and the character ‘\’ for escaping the characters +within the quoted text; otherwise the argument string is considered +terminated when the next special character (belonging to the set +‘[]=;,’) is encountered. +

+

A special syntax implemented in the ffmpeg CLI tool allows loading +option values from files. This is done be prepending a slash ’/’ to the option +name, then the supplied value is interpreted as a path from which the actual +value is loaded. E.g. +

+
ffmpeg -i <INPUT> -vf drawtext=/text=/tmp/some_text <OUTPUT>
+
+

will load the text to be drawn from /tmp/some_text. API users wishing to +implement a similar feature should use the avfilter_graph_segment_*() +functions together with custom IO code. +

+

The name and arguments of the filter are optionally preceded and +followed by a list of link labels. +A link label allows one to name a link and associate it to a filter output +or input pad. The preceding labels in_link_1 +... in_link_N, are associated to the filter input pads, +the following labels out_link_1 ... out_link_M, are +associated to the output pads. +

+

When two link labels with the same name are found in the +filtergraph, a link between the corresponding input and output pad is +created. +

+

If an output pad is not labelled, it is linked by default to the first +unlabelled input pad of the next filter in the filterchain. +For example in the filterchain +

+
nullsrc, split[L1], [L2]overlay, nullsink
+
+

the split filter instance has two output pads, and the overlay filter +instance two input pads. The first output pad of split is labelled +"L1", the first input pad of overlay is labelled "L2", and the second +output pad of split is linked to the second input pad of overlay, +which are both unlabelled. +

+

In a filter description, if the input label of the first filter is not +specified, "in" is assumed; if the output label of the last filter is not +specified, "out" is assumed. +

+

In a complete filterchain all the unlabelled filter input and output +pads must be connected. A filtergraph is considered valid if all the +filter input and output pads of all the filterchains are connected. +

+

Leading and trailing whitespaces (space, tabs, or line feeds) separating tokens +in the filtergraph specification are ignored. This means that the filtergraph +can be expressed using empty lines and spaces to improve redability. +

+

For example, the filtergraph: +

+
testsrc,split[L1],hflip[L2];[L1][L2] hstack
+
+ +

can be represented as: +

+
testsrc,
+split [L1], hflip [L2];
+
+[L1][L2] hstack
+
+ +

Libavfilter will automatically insert scale filters where format +conversion is required. It is possible to specify swscale flags +for those automatically inserted scalers by prepending +sws_flags=flags; +to the filtergraph description. +

+

Here is a BNF description of the filtergraph syntax: +

+
NAME             ::= sequence of alphanumeric characters and '_'
+FILTER_NAME      ::= NAME["@"NAME]
+LINKLABEL        ::= "[" NAME "]"
+LINKLABELS       ::= LINKLABEL [LINKLABELS]
+FILTER_ARGUMENTS ::= sequence of chars (possibly quoted)
+FILTER           ::= [LINKLABELS] FILTER_NAME ["=" FILTER_ARGUMENTS] [LINKLABELS]
+FILTERCHAIN      ::= FILTER [,FILTERCHAIN]
+FILTERGRAPH      ::= [sws_flags=flags;] FILTERCHAIN [;FILTERGRAPH]
+
+ +
+
+

23.2 Notes on filtergraph escaping

+ +

Filtergraph description composition entails several levels of +escaping. See (ffmpeg-utils)the "Quoting and escaping" +section in the ffmpeg-utils(1) manual for more +information about the employed escaping procedure. +

+

A first level escaping affects the content of each filter option +value, which may contain the special character : used to +separate values, or one of the escaping characters \'. +

+

A second level escaping affects the whole filter description, which +may contain the escaping characters \' or the special +characters [],; used by the filtergraph description. +

+

Finally, when you specify a filtergraph on a shell commandline, you +need to perform a third level escaping for the shell special +characters contained within it. +

+

For example, consider the following string to be embedded in +the drawtext filter description text value: +

+
this is a 'string': may contain one, or more, special characters
+
+ +

This string contains the ' special escaping character, and the +: special character, so it needs to be escaped in this way: +

+
text=this is a \'string\'\: may contain one, or more, special characters
+
+ +

A second level of escaping is required when embedding the filter +description in a filtergraph description, in order to escape all the +filtergraph special characters. Thus the example above becomes: +

+
drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
+
+

(note that in addition to the \' escaping special characters, +also , needs to be escaped). +

+

Finally an additional level of escaping is needed when writing the +filtergraph description in a shell command, which depends on the +escaping rules of the adopted shell. For example, assuming that +\ is special and needs to be escaped with another \, the +previous string will finally result in: +

+
-vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
+
+ +

In order to avoid cumbersome escaping when using a commandline tool accepting a +filter specification as input, it is advisable to avoid direct inclusion of the +filter or options specification in the shell. +

+

For example, in case of the drawtext filter, you might prefer to +use the textfile option in place of text to specify the text +to render. +

+

When using the ffmpeg tool, you might consider to use the +(ffmpeg)-filter_script option or +(ffmpeg)-filter_complex_script option. +

+
+
+
+

24 Timeline editing

+ +

Some filters support a generic enable option. For the filters +supporting timeline editing, this option can be set to an expression which is +evaluated before sending a frame to the filter. If the evaluation is non-zero, +the filter will be enabled, otherwise the frame will be sent unchanged to the +next filter in the filtergraph. +

+

The expression accepts the following values: +

+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
n
+

sequential number of the input frame, starting from 0 +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, do +not use +

+
+
w
+
h
+

width and height of the input frame if video +

+
+ +

Additionally, these filters support an enable command that can be used +to re-define the expression. +

+

Like any other filtering option, the enable option follows the same +rules. +

+

For example, to enable a blur filter (smartblur) from 10 seconds to 3 +minutes, and a curves filter starting at 3 seconds: +

+
smartblur = enable='between(t,10,3*60)',
+curves    = enable='gte(t,3)' : preset=cross_process
+
+ +

See ffmpeg -filters to view which filters have timeline support. +

+ +
+
+

25 Changing options at runtime with a command

+ +

Some options can be changed during the operation of the filter using +a command. These options are marked ’T’ on the output of +ffmpeg -h filter=<name of filter>. +The name of the command is the name of the option and the argument is +the new value. +

+
+
+

26 Options for filters with several inputs (framesync)

+ +

Some filters with several inputs support a common set of options. +These options can only be set by name, not with the short notation. +

+
+
eof_action
+

The action to take when EOF is encountered on the secondary input; it accepts +one of the following values: +

+
+
repeat
+

Repeat the last frame (the default). +

+
endall
+

End both streams. +

+
pass
+

Pass the main input through. +

+
+ +
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+
repeatlast
+

If set to 1, force the filter to extend the last frame of secondary streams +until the end of the primary stream. A value of 0 disables this behavior. +Default value is 1. +

+
+
ts_sync_mode
+

How strictly to sync streams based on secondary input timestamps; it accepts +one of the following values: +

+
+
default
+

Frame from secondary input with the nearest lower or equal timestamp to the +primary input frame. +

+
nearest
+

Frame from secondary input with the absolute nearest timestamp to the primary +input frame. +

+
+
+
+ + +
+
+

27 Audio Filters

+ +

When you configure your FFmpeg build, you can disable any of the +existing filters using --disable-filters. +The configure output will show the audio filters included in your +build. +

+

Below is a description of the currently available audio filters. +

+ +
+

27.1 acompressor

+ +

A compressor is mainly used to reduce the dynamic range of a signal. +Especially modern music is mostly compressed at a high ratio to +improve the overall loudness. It’s done to get the highest attention +of a listener, "fatten" the sound and bring more "power" to the track. +If a signal is compressed too much it may sound dull or "dead" +afterwards or it may start to "pump" (which could be a powerful effect +but can also destroy a track completely). +The right compression is the key to reach a professional sound and is +the high art of mixing and mastering. Because of its complex settings +it may take a long time to get the right feeling for this kind of effect. +

+

Compression is done by detecting the volume above a chosen level +threshold and dividing it by the factor set with ratio. +So if you set the threshold to -12dB and your signal reaches -6dB a ratio +of 2:1 will result in a signal at -9dB. Because an exact manipulation of +the signal would cause distortion of the waveform the reduction can be +levelled over the time. This is done by setting "Attack" and "Release". +attack determines how long the signal has to rise above the threshold +before any reduction will occur and release sets the time the signal +has to fall below the threshold to reduce the reduction again. Shorter signals +than the chosen attack time will be left untouched. +The overall reduction of the signal can be made up afterwards with the +makeup setting. So compressing the peaks of a signal about 6dB and +raising the makeup to this level results in a signal twice as loud than the +source. To gain a softer entry in the compression the knee flattens the +hard edge at the threshold in the range of the chosen decibels. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. Default is 1. Range is between 0.015625 and 64. +

+
+
mode
+

Set mode of compressor operation. Can be upward or downward. +Default is downward. +

+
+
threshold
+

If a signal of stream rises above this level it will affect the gain +reduction. +By default it is 0.125. Range is between 0.00097563 and 1. +

+
+
ratio
+

Set a ratio by which the signal is reduced. 1:2 means that if the level +rose 4dB above the threshold, it will be only 2dB above after the reduction. +Default is 2. Range is between 1 and 20. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction starts. Default is 20. Range is between 0.01 and 2000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before +reduction is decreased again. Default is 250. Range is between 0.01 and 9000. +

+
+
makeup
+

Set the amount by how much signal will be amplified after processing. +Default is 1. Range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.82843. Range is between 1 and 8. +

+
+
link
+

Choose if the average level between all channels of input stream +or the louder(maximum) channel of input stream affects the +reduction. Default is average. +

+
+
detection
+

Should the exact signal be taken in case of peak or an RMS one in case +of rms. Default is rms which is mostly smoother. +

+
+
mix
+

How much to use compressed signal in output. Default is 1. +Range is between 0 and 1. +

+
+ + +
+

27.1.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.2 acontrast

+

Simple audio dynamic range compression/expansion filter. +

+

The filter accepts the following options: +

+
+
contrast
+

Set contrast. Default is 33. Allowed range is between 0 and 100. +

+
+ +
+
+

27.3 acopy

+ +

Copy the input audio source unchanged to the output. This is mainly useful for +testing purposes. +

+
+
+

27.4 acrossfade

+ +

Apply cross fade from one input audio stream to another input audio stream. +The cross fade is applied for specified duration near the end of first stream. +

+

The filter accepts the following options: +

+
+
nb_samples, ns
+

Specify the number of samples for which the cross fade effect has to last. +At the end of the cross fade effect the first input audio will be completely +silent. Default is 44100. +

+
+
duration, d
+

Specify the duration of the cross fade effect. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +By default the duration is determined by nb_samples. +If set this option is used instead of nb_samples. +

+
+
overlap, o
+

Should first stream end overlap with second stream start. Default is enabled. +

+
+
curve1
+

Set curve for cross fade transition for first stream. +

+
+
curve2
+

Set curve for cross fade transition for second stream. +

+

For description of available curve types see afade filter description. +

+
+ + +
+

27.4.1 Examples

+ +
    +
  • Cross fade from one input to another: +
    +
    ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
    +
    + +
  • Cross fade from one input to another but without overlapping: +
    +
    ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
    +
    +
+ +
+
+
+

27.5 acrossover

+

Split audio stream into several bands. +

+

This filter splits audio stream into two or more frequency ranges. +Summing all streams back will give flat output. +

+

The filter accepts the following options: +

+
+
split
+

Set split frequencies. Those must be positive and increasing. +

+
+
order
+

Set filter order for each band split. This controls filter roll-off or steepness +of filter transfer function. +Available values are: +

+
+
2nd
+

12 dB per octave. +

+
4th
+

24 dB per octave. +

+
6th
+

36 dB per octave. +

+
8th
+

48 dB per octave. +

+
10th
+

60 dB per octave. +

+
12th
+

72 dB per octave. +

+
14th
+

84 dB per octave. +

+
16th
+

96 dB per octave. +

+
18th
+

108 dB per octave. +

+
20th
+

120 dB per octave. +

+
+ +

Default is 4th. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 1. Default value is 1. +

+
+
gains
+

Set output gain for each band. Default value is 1 for all bands. +

+
+
precision
+

Set which precision to use when processing samples. +

+
+
auto
+

Auto pick internal sample format depending on other filters. +

+
+
float
+

Always use single-floating point precision sample format. +

+
+
double
+

Always use double-floating point precision sample format. +

+
+ +

Default value is auto. +

+
+ + +
+

27.5.1 Examples

+ +
    +
  • Split input audio stream into two bands (low and high) with split frequency of 1500 Hz, +each band will be in separate stream: +
    +
    ffmpeg -i in.flac -filter_complex 'acrossover=split=1500[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
    +
    + +
  • Same as above, but with higher filter order: +
    +
    ffmpeg -i in.flac -filter_complex 'acrossover=split=1500:order=8th[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
    +
    + +
  • Same as above, but also with additional middle band (frequencies between 1500 and 8000): +
    +
    ffmpeg -i in.flac -filter_complex 'acrossover=split=1500 8000:order=8th[LOW][MID][HIGH]' -map '[LOW]' low.wav -map '[MID]' mid.wav -map '[HIGH]' high.wav
    +
    +
+ +
+
+
+

27.6 acrusher

+ +

Reduce audio bit resolution. +

+

This filter is bit crusher with enhanced functionality. A bit crusher +is used to audibly reduce number of bits an audio signal is sampled +with. This doesn’t change the bit depth at all, it just produces the +effect. Material reduced in bit depth sounds more harsh and "digital". +This filter is able to even round to continuous values instead of discrete +bit depths. +Additionally it has a D/C offset which results in different crushing of +the lower and the upper half of the signal. +An Anti-Aliasing setting is able to produce "softer" crushing sounds. +

+

Another feature of this filter is the logarithmic mode. +This setting switches from linear distances between bits to logarithmic ones. +The result is a much more "natural" sounding crusher which doesn’t gate low +signals for example. The human ear has a logarithmic perception, +so this kind of crushing is much more pleasant. +Logarithmic crushing is also able to get anti-aliased. +

+

The filter accepts the following options: +

+
+
level_in
+

Set level in. +

+
+
level_out
+

Set level out. +

+
+
bits
+

Set bit reduction. +

+
+
mix
+

Set mixing amount. +

+
+
mode
+

Can be linear: lin or logarithmic: log. +

+
+
dc
+

Set DC. +

+
+
aa
+

Set anti-aliasing. +

+
+
samples
+

Set sample reduction. +

+
+
lfo
+

Enable LFO. By default disabled. +

+
+
lforange
+

Set LFO range. +

+
+
lforate
+

Set LFO rate. +

+
+ + +
+

27.6.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.7 acue

+ +

Delay audio filtering until a given wallclock timestamp. See the cue +filter. +

+
+
+

27.8 adeclick

+

Remove impulsive noise from input audio. +

+

Samples detected as impulsive noise are replaced by interpolated samples using +autoregressive modelling. +

+
+
window, w
+

Set window size, in milliseconds. Allowed range is from 10 to +100. Default value is 55 milliseconds. +This sets size of window which will be processed at once. +

+
+
overlap, o
+

Set window overlap, in percentage of window size. Allowed range is from +50 to 95. Default value is 75 percent. +Setting this to a very high value increases impulsive noise removal but makes +whole process much slower. +

+
+
arorder, a
+

Set autoregression order, in percentage of window size. Allowed range is from +0 to 25. Default value is 2 percent. This option also +controls quality of interpolated samples using neighbour good samples. +

+
+
threshold, t
+

Set threshold value. Allowed range is from 1 to 100. +Default value is 2. +This controls the strength of impulsive noise which is going to be removed. +The lower value, the more samples will be detected as impulsive noise. +

+
+
burst, b
+

Set burst fusion, in percentage of window size. Allowed range is 0 to +10. Default value is 2. +If any two samples detected as noise are spaced less than this value then any +sample between those two samples will be also detected as noise. +

+
+
method, m
+

Set overlap method. +

+

It accepts the following values: +

+
add, a
+

Select overlap-add method. Even not interpolated samples are slightly +changed with this method. +

+
+
save, s
+

Select overlap-save method. Not interpolated samples remain unchanged. +

+
+ +

Default value is a. +

+
+ +
+
+

27.9 adeclip

+

Remove clipped samples from input audio. +

+

Samples detected as clipped are replaced by interpolated samples using +autoregressive modelling. +

+
+
window, w
+

Set window size, in milliseconds. Allowed range is from 10 to 100. +Default value is 55 milliseconds. +This sets size of window which will be processed at once. +

+
+
overlap, o
+

Set window overlap, in percentage of window size. Allowed range is from 50 +to 95. Default value is 75 percent. +

+
+
arorder, a
+

Set autoregression order, in percentage of window size. Allowed range is from +0 to 25. Default value is 8 percent. This option also controls +quality of interpolated samples using neighbour good samples. +

+
+
threshold, t
+

Set threshold value. Allowed range is from 1 to 100. +Default value is 10. Higher values make clip detection less aggressive. +

+
+
hsize, n
+

Set size of histogram used to detect clips. Allowed range is from 100 to 9999. +Default value is 1000. Higher values make clip detection less aggressive. +

+
+
method, m
+

Set overlap method. +

+

It accepts the following values: +

+
add, a
+

Select overlap-add method. Even not interpolated samples are slightly changed +with this method. +

+
+
save, s
+

Select overlap-save method. Not interpolated samples remain unchanged. +

+
+ +

Default value is a. +

+
+ +
+
+

27.10 adecorrelate

+

Apply decorrelation to input audio stream. +

+

The filter accepts the following options: +

+
+
stages
+

Set decorrelation stages of filtering. Allowed +range is from 1 to 16. Default value is 6. +

+
+
seed
+

Set random seed used for setting delay in samples across channels. +

+
+ +
+
+

27.11 adelay

+ +

Delay one or more audio channels. +

+

Samples in delayed channel are filled with silence. +

+

The filter accepts the following option: +

+
+
delays
+

Set list of delays in milliseconds for each channel separated by ’|’. +Unused delays will be silently ignored. If number of given delays is +smaller than number of channels all remaining channels will not be delayed. +If you want to delay exact number of samples, append ’S’ to number. +If you want instead to delay in seconds, append ’s’ to number. +

+
+
all
+

Use last set delay for all remaining channels. By default is disabled. +This option if enabled changes how option delays is interpreted. +

+
+ + +
+

27.11.1 Examples

+ +
    +
  • Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave +the second channel (and any other channels that may be present) unchanged. +
    +
    adelay=1500|0|500
    +
    + +
  • Delay second channel by 500 samples, the third channel by 700 samples and leave +the first channel (and any other channels that may be present) unchanged. +
    +
    adelay=0|500S|700S
    +
    + +
  • Delay all channels by same number of samples: +
    +
    adelay=delays=64S:all=1
    +
    +
+ +
+
+
+

27.12 adenorm

+

Remedy denormals in audio by adding extremely low-level noise. +

+

This filter shall be placed before any filter that can produce denormals. +

+

A description of the accepted parameters follows. +

+
+
level
+

Set level of added noise in dB. Default is -351. +Allowed range is from -451 to -90. +

+
+
type
+

Set type of added noise. +

+
+
dc
+

Add DC signal. +

+
ac
+

Add AC signal. +

+
square
+

Add square signal. +

+
pulse
+

Add pulse signal. +

+
+ +

Default is dc. +

+
+ + +
+

27.12.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.13 aderivative, aintegral

+ +

Compute derivative/integral of audio stream. +

+

Applying both filters one after another produces original audio. +

+
+
+

27.14 adrc

+ +

Apply spectral dynamic range controller filter to input audio stream. +

+

A description of the accepted options follows. +

+
+
transfer
+

Set the transfer expression. +

+

The expression can contain the following constants: +

+
+
ch
+

current channel number +

+
+
sn
+

current sample number +

+
+
nb_channels
+

number of channels +

+
+
t
+

timestamp expressed in seconds +

+
+
sr
+

sample rate +

+
+
p
+

current frequency power value, in dB +

+
+
f
+

current frequency in Hz +

+
+ +

Default value is p. +

+
+
attack
+

Set the attack in milliseconds. Default is 50 milliseconds. +Allowed range is from 1 to 1000 milliseconds. +

+
release
+

Set the release in milliseconds. Default is 100 milliseconds. +Allowed range is from 5 to 2000 milliseconds. +

+
channels
+

Set which channels to filter, by default all channels in audio stream are filtered. +

+
+ + +
+

27.14.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

27.14.2 Examples

+ +
    +
  • Apply spectral compression to all frequencies with threshold of -50 dB and 1:6 ratio: +
    +
    adrc=transfer='if(gt(p,-50),-50+(p-(-50))/6,p)':attack=50:release=100
    +
    + +
  • Similar to above but with 1:2 ratio and filtering only front center channel: +
    +
    adrc=transfer='if(gt(p,-50),-50+(p-(-50))/2,p)':attack=50:release=100:channels=FC
    +
    + +
  • Apply spectral noise gate to all frequencies with threshold of -85 dB and with short attack time and short release time: +
    +
    adrc=transfer='if(lte(p,-85),p-800,p)':attack=1:release=5
    +
    + +
  • Apply spectral expansion to all frequencies with threshold of -10 dB and 1:2 ratio: +
    +
    adrc=transfer='if(lt(p,-10),-10+(p-(-10))*2,p)':attack=50:release=100
    +
    + +
  • Apply limiter to max -60 dB to all frequencies, with attack of 2 ms and release of 10 ms: +
    +
    adrc=transfer='min(p,-60)':attack=2:release=10
    +
    +
+ +
+
+
+

27.15 adynamicequalizer

+ +

Apply dynamic equalization to input audio stream. +

+

A description of the accepted options follows. +

+
+
threshold
+

Set the detection threshold used to trigger equalization. +Threshold detection is using detection filter. +Default value is 0. Allowed range is from 0 to 100. +

+
+
dfrequency
+

Set the detection frequency in Hz used for detection filter used to trigger equalization. +Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz. +

+
+
dqfactor
+

Set the detection resonance factor for detection filter used to trigger equalization. +Default value is 1. Allowed range is from 0.001 to 1000. +

+
+
tfrequency
+

Set the target frequency of equalization filter. +Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz. +

+
+
tqfactor
+

Set the target resonance factor for target equalization filter. +Default value is 1. Allowed range is from 0.001 to 1000. +

+
+
attack
+

Set the amount of milliseconds the signal from detection has to rise above +the detection threshold before equalization starts. +Default is 20. Allowed range is between 1 and 2000. +

+
+
release
+

Set the amount of milliseconds the signal from detection has to fall below the +detection threshold before equalization ends. +Default is 200. Allowed range is between 1 and 2000. +

+
+
ratio
+

Set the ratio by which the equalization gain is raised. +Default is 1. Allowed range is between 0 and 30. +

+
+
makeup
+

Set the makeup offset by which the equalization gain is raised. +Default is 0. Allowed range is between 0 and 100. +

+
+
range
+

Set the max allowed cut/boost amount. Default is 50. +Allowed range is from 1 to 200. +

+
+
mode
+

Set the mode of filter operation, can be one of the following: +

+
+
listen
+

Output only isolated detection signal. +

+
cut
+

Cut frequencies above detection threshold. +

+
boost
+

Boost frequencies bellow detection threshold. +

+
+

Default mode is ‘cut’. +

+
+
dftype
+

Set the type of detection filter, can be one of the following: +

+
+
bandpass
+
lowpass
+
highpass
+
peak
+
+

Default type is ‘bandpass’. +

+
+
tftype
+

Set the type of target filter, can be one of the following: +

+
+
bell
+
lowshelf
+
highshelf
+
+

Default type is ‘bell’. +

+
+
direction
+

Set processing direction relative to threshold. +

+
downward
+

Boost/Cut if threshold is higher/lower than detected volume. +

+
upward
+

Boost/Cut if threshold is lower/higher than detected volume. +

+
+

Default direction is ‘downward’. +

+
+
auto
+

Automatically gather threshold from detection filter. By default +is ‘disabled’. +This option is useful to detect threshold in certain time frame of +input audio stream, in such case option value is changed at runtime. +

+

Available values are: +

+
disabled
+

Disable using automatically gathered threshold value. +

+
off
+

Stop picking threshold value. +

+
on
+

Start picking threshold value. +

+
+ +
+
precision
+

Set which precision to use when processing samples. +

+
+
auto
+

Auto pick internal sample format depending on other filters. +

+
+
float
+

Always use single-floating point precision sample format. +

+
+
double
+

Always use double-floating point precision sample format. +

+
+
+
+ + +
+

27.15.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.16 adynamicsmooth

+ +

Apply dynamic smoothing to input audio stream. +

+

A description of the accepted options follows. +

+
+
sensitivity
+

Set an amount of sensitivity to frequency fluctations. Default is 2. +Allowed range is from 0 to 1e+06. +

+
+
basefreq
+

Set a base frequency for smoothing. Default value is 22050. +Allowed range is from 2 to 1e+06. +

+
+ + +
+

27.16.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.17 aecho

+ +

Apply echoing to the input audio. +

+

Echoes are reflected sound and can occur naturally amongst mountains +(and sometimes large buildings) when talking or shouting; digital echo +effects emulate this behaviour and are often used to help fill out the +sound of a single instrument or vocal. The time difference between the +original signal and the reflection is the delay, and the +loudness of the reflected signal is the decay. +Multiple echoes can have different delays and decays. +

+

A description of the accepted parameters follows. +

+
+
in_gain
+

Set input gain of reflected signal. Default is 0.6. +

+
+
out_gain
+

Set output gain of reflected signal. Default is 0.3. +

+
+
delays
+

Set list of time intervals in milliseconds between original signal and reflections +separated by ’|’. Allowed range for each delay is (0 - 90000.0]. +Default is 1000. +

+
+
decays
+

Set list of loudness of reflected signals separated by ’|’. +Allowed range for each decay is (0 - 1.0]. +Default is 0.5. +

+
+ + +
+

27.17.1 Examples

+ +
    +
  • Make it sound as if there are twice as many instruments as are actually playing: +
    +
    aecho=0.8:0.88:60:0.4
    +
    + +
  • If delay is very short, then it sounds like a (metallic) robot playing music: +
    +
    aecho=0.8:0.88:6:0.4
    +
    + +
  • A longer delay will sound like an open air concert in the mountains: +
    +
    aecho=0.8:0.9:1000:0.3
    +
    + +
  • Same as above but with one more mountain: +
    +
    aecho=0.8:0.9:1000|1800:0.3|0.25
    +
    +
+ +
+
+
+

27.18 aemphasis

+

Audio emphasis filter creates or restores material directly taken from LPs or +emphased CDs with different filter curves. E.g. to store music on vinyl the +signal has to be altered by a filter first to even out the disadvantages of +this recording medium. +Once the material is played back the inverse filter has to be applied to +restore the distortion of the frequency response. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. +

+
+
level_out
+

Set output gain. +

+
+
mode
+

Set filter mode. For restoring material use reproduction mode, otherwise +use production mode. Default is reproduction mode. +

+
+
type
+

Set filter type. Selects medium. Can be one of the following: +

+
+
col
+

select Columbia. +

+
emi
+

select EMI. +

+
bsi
+

select BSI (78RPM). +

+
riaa
+

select RIAA. +

+
cd
+

select Compact Disc (CD). +

+
50fm
+

select 50µs (FM). +

+
75fm
+

select 75µs (FM). +

+
50kf
+

select 50µs (FM-KF). +

+
75kf
+

select 75µs (FM-KF). +

+
+
+
+ + +
+

27.18.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.19 aeval

+ +

Modify an audio signal according to the specified expressions. +

+

This filter accepts one or more expressions (one for each channel), +which are evaluated and used to modify a corresponding audio signal. +

+

It accepts the following parameters: +

+
+
exprs
+

Set the ’|’-separated expressions list for each separate channel. If +the number of input channels is greater than the number of +expressions, the last specified expression is used for the remaining +output channels. +

+
+
channel_layout, c
+

Set output channel layout. If not specified, the channel layout is +specified by the number of expressions. If set to ‘same’, it will +use by default the same input channel layout. +

+
+ +

Each expression in exprs can contain the following constants and functions: +

+
+
ch
+

channel number of the current expression +

+
+
n
+

number of the evaluated sample, starting from 0 +

+
+
s
+

sample rate +

+
+
t
+

time of the evaluated sample expressed in seconds +

+
+
nb_in_channels
+
nb_out_channels
+

input and output number of channels +

+
+
val(CH)
+

the value of input channel with number CH +

+
+ +

Note: this filter is slow. For faster processing you should use a +dedicated filter. +

+ +
+

27.19.1 Examples

+ +
    +
  • Half volume: +
    +
    aeval=val(ch)/2:c=same
    +
    + +
  • Invert phase of the second channel: +
    +
    aeval=val(0)|-val(1)
    +
    +
+ +
+
+
+

27.20 aexciter

+ +

An exciter is used to produce high sound that is not present in the +original signal. This is done by creating harmonic distortions of the +signal which are restricted in range and added to the original signal. +An Exciter raises the upper end of an audio signal without simply raising +the higher frequencies like an equalizer would do to create a more +"crisp" or "brilliant" sound. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level prior processing of signal. +Allowed range is from 0 to 64. +Default value is 1. +

+
+
level_out
+

Set output level after processing of signal. +Allowed range is from 0 to 64. +Default value is 1. +

+
+
amount
+

Set the amount of harmonics added to original signal. +Allowed range is from 0 to 64. +Default value is 1. +

+
+
drive
+

Set the amount of newly created harmonics. +Allowed range is from 0.1 to 10. +Default value is 8.5. +

+
+
blend
+

Set the octave of newly created harmonics. +Allowed range is from -10 to 10. +Default value is 0. +

+
+
freq
+

Set the lower frequency limit of producing harmonics in Hz. +Allowed range is from 2000 to 12000 Hz. +Default is 7500 Hz. +

+
+
ceil
+

Set the upper frequency limit of producing harmonics. +Allowed range is from 9999 to 20000 Hz. +If value is lower than 10000 Hz no limit is applied. +

+
+
listen
+

Mute the original signal and output only added harmonics. +By default is disabled. +

+
+ + +
+

27.20.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.21 afade

+ +

Apply fade-in/out effect to input audio. +

+

A description of the accepted parameters follows. +

+
+
type, t
+

Specify the effect type, can be either in for fade-in, or +out for a fade-out effect. Default is in. +

+
+
start_sample, ss
+

Specify the number of the start sample for starting to apply the fade +effect. Default is 0. +

+
+
nb_samples, ns
+

Specify the number of samples for which the fade effect has to last. At +the end of the fade-in effect the output audio will have the same +volume as the input audio, at the end of the fade-out transition +the output audio will be silence. Default is 44100. +

+
+
start_time, st
+

Specify the start time of the fade effect. Default is 0. +The value must be specified as a time duration; see +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +If set this option is used instead of start_sample. +

+
+
duration, d
+

Specify the duration of the fade effect. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +At the end of the fade-in effect the output audio will have the same +volume as the input audio, at the end of the fade-out transition +the output audio will be silence. +By default the duration is determined by nb_samples. +If set this option is used instead of nb_samples. +

+
+
curve
+

Set curve for fade transition. +

+

It accepts the following values: +

+
tri
+

select triangular, linear slope (default) +

+
qsin
+

select quarter of sine wave +

+
hsin
+

select half of sine wave +

+
esin
+

select exponential sine wave +

+
log
+

select logarithmic +

+
ipar
+

select inverted parabola +

+
qua
+

select quadratic +

+
cub
+

select cubic +

+
squ
+

select square root +

+
cbr
+

select cubic root +

+
par
+

select parabola +

+
exp
+

select exponential +

+
iqsin
+

select inverted quarter of sine wave +

+
ihsin
+

select inverted half of sine wave +

+
dese
+

select double-exponential seat +

+
desi
+

select double-exponential sigmoid +

+
losi
+

select logistic sigmoid +

+
sinc
+

select sine cardinal function +

+
isinc
+

select inverted sine cardinal function +

+
nofade
+

no fade applied +

+
+ +
+
silence
+

Set the initial gain for fade-in or final gain for fade-out. +Default value is 0.0. +

+
+
unity
+

Set the initial gain for fade-out or final gain for fade-in. +Default value is 1.0. +

+
+ + +
+

27.21.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

27.21.2 Examples

+ +
    +
  • Fade in first 15 seconds of audio: +
    +
    afade=t=in:ss=0:d=15
    +
    + +
  • Fade out last 25 seconds of a 900 seconds audio: +
    +
    afade=t=out:st=875:d=25
    +
    +
+ +
+
+
+

27.22 afftdn

+

Denoise audio samples with FFT. +

+

A description of the accepted parameters follows. +

+
+
noise_reduction, nr
+

Set the noise reduction in dB, allowed range is 0.01 to 97. +Default value is 12 dB. +

+
+
noise_floor, nf
+

Set the noise floor in dB, allowed range is -80 to -20. +Default value is -50 dB. +

+
+
noise_type, nt
+

Set the noise type. +

+

It accepts the following values: +

+
white, w
+

Select white noise. +

+
+
vinyl, v
+

Select vinyl noise. +

+
+
shellac, s
+

Select shellac noise. +

+
+
custom, c
+

Select custom noise, defined in bn option. +

+

Default value is white noise. +

+
+ +
+
band_noise, bn
+

Set custom band noise profile for every one of 15 bands. +Bands are separated by ’ ’ or ’|’. +

+
+
residual_floor, rf
+

Set the residual floor in dB, allowed range is -80 to -20. +Default value is -38 dB. +

+
+
track_noise, tn
+

Enable noise floor tracking. By default is disabled. +With this enabled, noise floor is automatically adjusted. +

+
+
track_residual, tr
+

Enable residual tracking. By default is disabled. +

+
+
output_mode, om
+

Set the output mode. +

+

It accepts the following values: +

+
input, i
+

Pass input unchanged. +

+
+
output, o
+

Pass noise filtered out. +

+
+
noise, n
+

Pass only noise. +

+

Default value is output. +

+
+ +
+
adaptivity, ad
+

Set the adaptivity factor, used how fast to adapt gains adjustments per +each frequency bin. Value 0 enables instant adaptation, while higher values +react much slower. +Allowed range is from 0 to 1. Default value is 0.5. +

+
+
floor_offset, fo
+

Set the noise floor offset factor. This option is used to adjust offset applied to measured +noise floor. It is only effective when noise floor tracking is enabled. +Allowed range is from -2.0 to 2.0. Default value is 1.0. +

+
+
noise_link, nl
+

Set the noise link used for multichannel audio. +

+

It accepts the following values: +

+
none
+

Use unchanged channel’s noise floor. +

+
+
min
+

Use measured min noise floor of all channels. +

+
+
max
+

Use measured max noise floor of all channels. +

+
+
average
+

Use measured average noise floor of all channels. +

+

Default value is min. +

+
+ +
+
band_multiplier, bm
+

Set the band multiplier factor, used how much to spread bands across frequency bins. +Allowed range is from 0.2 to 5. Default value is 1.25. +

+
+
sample_noise, sn
+

Toggle capturing and measurement of noise profile from input audio. +

+

It accepts the following values: +

+
start, begin
+

Start sample noise capture. +

+
+
stop, end
+

Stop sample noise capture and measure new noise band profile. +

+

Default value is none. +

+
+ +
+
gain_smooth, gs
+

Set gain smooth spatial radius, used to smooth gains applied to each frequency bin. +Useful to reduce random music noise artefacts. +Higher values increases smoothing of gains. +Allowed range is from 0 to 50. +Default value is 0. +

+
+ + +
+

27.22.1 Commands

+ +

This filter supports the some above mentioned options as commands. +

+
+
+

27.22.2 Examples

+ +
    +
  • Reduce white noise by 10dB, and use previously measured noise floor of -40dB: +
    +
    afftdn=nr=10:nf=-40
    +
    + +
  • Reduce white noise by 10dB, also set initial noise floor to -80dB and enable automatic +tracking of noise floor so noise floor will gradually change during processing: +
    +
    afftdn=nr=10:nf=-80:tn=1
    +
    + +
  • Reduce noise by 20dB, using noise floor of -40dB and using commands to take noise profile +of first 0.4 seconds of input audio: +
    +
    asendcmd=0.0 afftdn sn start,asendcmd=0.4 afftdn sn stop,afftdn=nr=20:nf=-40
    +
    +
+ +
+
+
+

27.23 afftfilt

+

Apply arbitrary expressions to samples in frequency domain. +

+
+
real
+

Set frequency domain real expression for each separate channel separated +by ’|’. Default is "re". +If the number of input channels is greater than the number of +expressions, the last specified expression is used for the remaining +output channels. +

+
+
imag
+

Set frequency domain imaginary expression for each separate channel +separated by ’|’. Default is "im". +

+

Each expression in real and imag can contain the following +constants and functions: +

+
+
sr
+

sample rate +

+
+
b
+

current frequency bin number +

+
+
nb
+

number of available bins +

+
+
ch
+

channel number of the current expression +

+
+
chs
+

number of channels +

+
+
pts
+

current frame pts +

+
+
re
+

current real part of frequency bin of current channel +

+
+
im
+

current imaginary part of frequency bin of current channel +

+
+
real(b, ch)
+

Return the value of real part of frequency bin at location (bin,channel) +

+
+
imag(b, ch)
+

Return the value of imaginary part of frequency bin at location (bin,channel) +

+
+ +
+
win_size
+

Set window size. Allowed range is from 16 to 131072. +Default is 4096 +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann, hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hann. +

+
+
overlap
+

Set window overlap. If set to 1, the recommended overlap for selected +window function will be picked. Default is 0.75. +

+
+ + +
+

27.23.1 Examples

+ +
    +
  • Leave almost only low frequencies in audio: +
    +
    afftfilt="'real=re * (1-clip((b/nb)*b,0,1))':imag='im * (1-clip((b/nb)*b,0,1))'"
    +
    + +
  • Apply robotize effect: +
    +
    afftfilt="real='hypot(re,im)*sin(0)':imag='hypot(re,im)*cos(0)':win_size=512:overlap=0.75"
    +
    + +
  • Apply whisper effect: +
    +
    afftfilt="real='hypot(re,im)*cos((random(0)*2-1)*2*3.14)':imag='hypot(re,im)*sin((random(1)*2-1)*2*3.14)':win_size=128:overlap=0.8"
    +
    + +
  • Apply phase shift: +
    +
    afftfilt="real=re*cos(1)-im*sin(1):imag=re*sin(1)+im*cos(1)"
    +
    +
+ +
+
+
+

27.24 afir

+ +

Apply an arbitrary Finite Impulse Response filter. +

+

This filter is designed for applying long FIR filters, +up to 60 seconds long. +

+

It can be used as component for digital crossover filters, +room equalization, cross talk cancellation, wavefield synthesis, +auralization, ambiophonics, ambisonics and spatialization. +

+

This filter uses the streams higher than first one as FIR coefficients. +If the non-first stream holds a single channel, it will be used +for all input channels in the first stream, otherwise +the number of channels in the non-first stream must be same as +the number of channels in the first stream. +

+

It accepts the following parameters: +

+
+
dry
+

Set dry gain. This sets input gain. +

+
+
wet
+

Set wet gain. This sets final output gain. +

+
+
length
+

Set Impulse Response filter length. Default is 1, which means whole IR is processed. +

+
+
gtype
+

Enable applying gain measured from power of IR. +

+

Set which approach to use for auto gain measurement. +

+
+
none
+

Do not apply any gain. +

+
+
peak
+

select peak gain, very conservative approach. This is default value. +

+
+
dc
+

select DC gain, limited application. +

+
+
gn
+

select gain to noise approach, this is most popular one. +

+
+
ac
+

select AC gain. +

+
+
rms
+

select RMS gain. +

+
+ +
+
irgain
+

Set gain to be applied to IR coefficients before filtering. +Allowed range is 0 to 1. This gain is applied after any gain applied with gtype option. +

+
+
irfmt
+

Set format of IR stream. Can be mono or input. +Default is input. +

+
+
maxir
+

Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds. +Allowed range is 0.1 to 60 seconds. +

+
+
response
+

Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream. +By default it is disabled. +

+
+
channel
+

Set for which IR channel to display frequency response. By default is first channel +displayed. This option is used only when response is enabled. +

+
+
size
+

Set video stream size. This option is used only when response is enabled. +

+
+
rate
+

Set video stream frame rate. This option is used only when response is enabled. +

+
+
minp
+

Set minimal partition size used for convolution. Default is 8192. +Allowed range is from 1 to 65536. +Lower values decreases latency at cost of higher CPU usage. +

+
+
maxp
+

Set maximal partition size used for convolution. Default is 8192. +Allowed range is from 8 to 65536. +Lower values may increase CPU usage. +

+
+
nbirs
+

Set number of input impulse responses streams which will be switchable at runtime. +Allowed range is from 1 to 32. Default is 1. +

+
+
ir
+

Set IR stream which will be used for convolution, starting from 0, should always be +lower than supplied value by nbirs option. Default is 0. +This option can be changed at runtime via commands. +

+
+
precision
+

Set which precision to use when processing samples. +

+
+
auto
+

Auto pick internal sample format depending on other filters. +

+
+
float
+

Always use single-floating point precision sample format. +

+
+
double
+

Always use double-floating point precision sample format. +

+
+ +

Default value is auto. +

+
+
irload
+

Set when to load IR stream. Can be init or access. +First one load and prepares all IRs on initialization, second one +once on first access of specific IR. +Default is init. +

+
+ + +
+

27.24.1 Examples

+ +
    +
  • Apply reverb to stream using mono IR file as second input, complete command using ffmpeg: +
    +
    ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
    +
    + +
  • Apply true stereo processing given input stereo stream, and two stereo impulse responses for left and right channel, +the impulse response files are files with names l_ir.wav and r_ir.wav: +
    +
    "pan=4C|c0=FL|c1=FL|c2=FR|c3=FR[a];amovie=l_ir.wav[LIR];amovie=r_ir.wav[RIR];[LIR][RIR]amerge[ir];[a][ir]afir=irfmt=input:gtype=gn:irgain=-5dB,pan=stereo|FL<c0+c2|FR<c1+c3"
    +
    +
+ +
+
+
+

27.25 aformat

+ +

Set output format constraints for the input audio. The framework will +negotiate the most appropriate format to minimize conversions. +

+

It accepts the following parameters: +

+
sample_fmts, f
+

A ’|’-separated list of requested sample formats. +

+
+
sample_rates, r
+

A ’|’-separated list of requested sample rates. +

+
+
channel_layouts, cl
+

A ’|’-separated list of requested channel layouts. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+ +

If a parameter is omitted, all values are allowed. +

+

Force the output to either unsigned 8-bit or signed 16-bit stereo +

+
aformat=sample_fmts=u8|s16:channel_layouts=stereo
+
+ +
+
+

27.26 afreqshift

+

Apply frequency shift to input audio samples. +

+

The filter accepts the following options: +

+
+
shift
+

Specify frequency shift. Allowed range is -INT_MAX to INT_MAX. +Default value is 0.0. +

+
+
level
+

Set output gain applied to final output. Allowed range is from 0.0 to 1.0. +Default value is 1.0. +

+
+
order
+

Set filter order used for filtering. Allowed range is from 1 to 16. +Default value is 8. +

+
+ + +
+

27.26.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.27 afwtdn

+

Reduce broadband noise from input samples using Wavelets. +

+

A description of the accepted options follows. +

+
+
sigma
+

Set the noise sigma, allowed range is from 0 to 1. +Default value is 0. +This option controls strength of denoising applied to input samples. +Most useful way to set this option is via decibels, eg. -45dB. +

+
+
levels
+

Set the number of wavelet levels of decomposition. +Allowed range is from 1 to 12. +Default value is 10. +Setting this too low make denoising performance very poor. +

+
+
wavet
+

Set wavelet type for decomposition of input frame. +They are sorted by number of coefficients, from lowest to highest. +More coefficients means worse filtering speed, but overall better quality. +Available wavelets are: +

+
+
sym2
+
sym4
+
rbior68
+
deb10
+
sym10
+
coif5
+
bl3
+
+ +
+
percent
+

Set percent of full denoising. Allowed range is from 0 to 100 percent. +Default value is 85 percent or partial denoising. +

+
+
profile
+

If enabled, first input frame will be used as noise profile. +If first frame samples contain non-noise performance will be very poor. +

+
+
adaptive
+

If enabled, input frames are analyzed for presence of noise. +If noise is detected with high possibility then input frame profile will be +used for processing following frames, until new noise frame is detected. +

+
+
samples
+

Set size of single frame in number of samples. Allowed range is from 512 to +65536. Default frame size is 8192 samples. +

+
+
softness
+

Set softness applied inside thresholding function. Allowed range is from 0 to +10. Default softness is 1. +

+
+ + +
+

27.27.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.28 agate

+ +

A gate is mainly used to reduce lower parts of a signal. This kind of signal +processing reduces disturbing noise between useful signals. +

+

Gating is done by detecting the volume below a chosen level threshold +and dividing it by the factor set with ratio. The bottom of the noise +floor is set via range. Because an exact manipulation of the signal +would cause distortion of the waveform the reduction can be levelled over +time. This is done by setting attack and release. +

+

attack determines how long the signal has to fall below the threshold +before any reduction will occur and release sets the time the signal +has to rise above the threshold to reduce the reduction again. +Shorter signals than the chosen attack time will be left untouched. +

+
+
level_in
+

Set input level before filtering. +Default is 1. Allowed range is from 0.015625 to 64. +

+
+
mode
+

Set the mode of operation. Can be upward or downward. +Default is downward. If set to upward mode, higher parts of signal +will be amplified, expanding dynamic range in upward direction. +Otherwise, in case of downward lower parts of signal will be reduced. +

+
+
range
+

Set the level of gain reduction when the signal is below the threshold. +Default is 0.06125. Allowed range is from 0 to 1. +Setting this to 0 disables reduction and then filter behaves like expander. +

+
+
threshold
+

If a signal rises above this level the gain reduction is released. +Default is 0.125. Allowed range is from 0 to 1. +

+
+
ratio
+

Set a ratio by which the signal is reduced. +Default is 2. Allowed range is from 1 to 9000. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction stops. +Default is 20 milliseconds. Allowed range is from 0.01 to 9000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before the +reduction is increased again. Default is 250 milliseconds. +Allowed range is from 0.01 to 9000. +

+
+
makeup
+

Set amount of amplification of signal after processing. +Default is 1. Allowed range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.828427125. Allowed range is from 1 to 8. +

+
+
detection
+

Choose if exact signal should be taken for detection or an RMS like one. +Default is rms. Can be peak or rms. +

+
+
link
+

Choose if the average level between all channels or the louder channel affects +the reduction. +Default is average. Can be average or maximum. +

+
+ + +
+

27.28.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.29 aiir

+ +

Apply an arbitrary Infinite Impulse Response filter. +

+

It accepts the following parameters: +

+
+
zeros, z
+

Set B/numerator/zeros/reflection coefficients. +

+
+
poles, p
+

Set A/denominator/poles/ladder coefficients. +

+
+
gains, k
+

Set channels gains. +

+
+
dry_gain
+

Set input gain. +

+
+
wet_gain
+

Set output gain. +

+
+
format, f
+

Set coefficients format. +

+
+
ll
+

lattice-ladder function +

+
sf
+

analog transfer function +

+
tf
+

digital transfer function +

+
zp
+

Z-plane zeros/poles, cartesian (default) +

+
pr
+

Z-plane zeros/poles, polar radians +

+
pd
+

Z-plane zeros/poles, polar degrees +

+
sp
+

S-plane zeros/poles +

+
+ +
+
process, r
+

Set type of processing. +

+
+
d
+

direct processing +

+
s
+

serial processing +

+
p
+

parallel processing +

+
+ +
+
precision, e
+

Set filtering precision. +

+
+
dbl
+

double-precision floating-point (default) +

+
flt
+

single-precision floating-point +

+
i32
+

32-bit integers +

+
i16
+

16-bit integers +

+
+ +
+
normalize, n
+

Normalize filter coefficients, by default is enabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
mix
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
response
+

Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream. +By default it is disabled. +

+
+
channel
+

Set for which IR channel to display frequency response. By default is first channel +displayed. This option is used only when response is enabled. +

+
+
size
+

Set video stream size. This option is used only when response is enabled. +

+
+ +

Coefficients in tf and sf format are separated by spaces and are in ascending +order. +

+

Coefficients in zp format are separated by spaces and order of coefficients +doesn’t matter. Coefficients in zp format are complex numbers with i +imaginary unit. +

+

Different coefficients and gains can be provided for every channel, in such case +use ’|’ to separate coefficients or gains. Last provided coefficients will be +used for all remaining channels. +

+ +
+

27.29.1 Examples

+ +
    +
  • Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate: +
    +
    aiir=k=1:z=7.957584807809675810E-1 -2.575128568908332300 3.674839853930788710 -2.57512875289799137 7.957586296317130880E-1:p=1 -2.86950072432325953 3.63022088054647218 -2.28075678147272232 6.361362326477423500E-1:f=tf:r=d
    +
    + +
  • Same as above but in zp format: +
    +
    aiir=k=0.79575848078096756:z=0.80918701+0.58773007i 0.80918701-0.58773007i 0.80884700+0.58784055i 0.80884700-0.58784055i:p=0.63892345+0.59951235i 0.63892345-0.59951235i 0.79582691+0.44198673i 0.79582691-0.44198673i:f=zp:r=s
    +
    + +
  • Apply 3-rd order analog normalized Butterworth low-pass filter, using analog transfer function format: +
    +
    aiir=z=1.3057 0 0 0:p=1.3057 2.3892 2.1860 1:f=sf:r=d
    +
    +
+ +
+
+
+

27.30 alimiter

+ +

The limiter prevents an input signal from rising over a desired threshold. +This limiter uses lookahead technology to prevent your signal from distorting. +It means that there is a small delay after the signal is processed. Keep in mind +that the delay it produces is the attack time you set. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. Default is 1. +

+
+
level_out
+

Set output gain. Default is 1. +

+
+
limit
+

Don’t let signals above this level pass the limiter. Default is 1. +

+
+
attack
+

The limiter will reach its attenuation level in this amount of time in +milliseconds. Default is 5 milliseconds. +

+
+
release
+

Come back from limiting to attenuation 1.0 in this amount of milliseconds. +Default is 50 milliseconds. +

+
+
asc
+

When gain reduction is always needed ASC takes care of releasing to an +average reduction level rather than reaching a reduction of 0 in the release +time. +

+
+
asc_level
+

Select how much the release time is affected by ASC, 0 means nearly no changes +in release time while 1 produces higher release times. +

+
+
level
+

Auto level output signal. Default is enabled. +This normalizes audio back to 0dB if enabled. +

+
+
latency
+

Compensate the delay introduced by using the lookahead buffer set with attack +parameter. Also flush the valid audio data in the lookahead buffer when the +stream hits EOF. +

+
+ +

Depending on picked setting it is recommended to upsample input 2x or 4x times +with aresample before applying this filter. +

+
+
+

27.31 allpass

+ +

Apply a two-pole all-pass filter with central frequency (in Hz) +frequency, and filter-width width. +An all-pass filter changes the audio’s frequency to phase relationship +without changing its frequency to amplitude relationship. +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set frequency in Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
order, o
+

Set the filter order, can be 1 or 2. Default is 2. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+
+
+ + +
+

27.31.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change allpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change allpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change allpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change allpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

27.32 aloop

+ +

Loop audio samples. +

+

The filter accepts the following options: +

+
+
loop
+

Set the number of loops. Setting this value to -1 will result in infinite loops. +Default is 0. +

+
+
size
+

Set maximal number of samples. Default is 0. +

+
+
start
+

Set first sample of loop. Default is 0. +

+
+
time
+

Set the time of loop start in seconds. +Only used if option named start is set to -1. +

+
+ +
+
+

27.33 amerge

+ +

Merge two or more audio streams into a single multi-channel stream. +

+

The filter accepts the following options: +

+
+
inputs
+

Set the number of inputs. Default is 2. +

+
+
+ +

If the channel layouts of the inputs are disjoint, and therefore compatible, +the channel layout of the output will be set accordingly and the channels +will be reordered as necessary. If the channel layouts of the inputs are not +disjoint, the output will have all the channels of the first input then all +the channels of the second input, in that order, and the channel layout of +the output will be the default value corresponding to the total number of +channels. +

+

For example, if the first input is in 2.1 (FL+FR+LF) and the second input +is FC+BL+BR, then the output will be in 5.1, with the channels in the +following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the +first input, b1 is the first channel of the second input). +

+

On the other hand, if both input are in stereo, the output channels will be +in the default order: a1, a2, b1, b2, and the channel layout will be +arbitrarily set to 4.0, which may or may not be the expected value. +

+

All inputs must have the same sample rate, and format. +

+

If inputs do not have the same duration, the output will stop with the +shortest. +

+ +
+

27.33.1 Examples

+ +
    +
  • Merge two mono files into a stereo stream: +
    +
    amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
    +
    + +
  • Multiple merges assuming 1 video stream and 6 audio streams in input.mkv: +
    +
    ffmpeg -i input.mkv -filter_complex "[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6" -c:a pcm_s16le output.mkv
    +
    +
+ +
+
+
+

27.34 amix

+ +

Mixes multiple audio inputs into a single output. +

+

Note that this filter only supports float samples (the amerge +and pan audio filters support many formats). If the amix +input has integer samples then aresample will be automatically +inserted to perform the conversion to float samples. +

+

It accepts the following parameters: +

+
inputs
+

The number of inputs. If unspecified, it defaults to 2. +

+
+
duration
+

How to determine the end-of-stream. +

+
longest
+

The duration of the longest input. (default) +

+
+
shortest
+

The duration of the shortest input. +

+
+
first
+

The duration of the first input. +

+
+
+ +
+
dropout_transition
+

The transition time, in seconds, for volume renormalization when an input +stream ends. The default value is 2 seconds. +

+
+
weights
+

Specify weight of each input audio stream as a sequence of numbers separated +by a space. If fewer weights are specified compared to number of inputs, the +last weight is assigned to the remaining inputs. +Default weight for each input is 1. +

+
+
normalize
+

Always scale inputs instead of only doing summation of samples. +Beware of heavy clipping if inputs are not normalized prior or after filtering +by this filter if this option is disabled. By default is enabled. +

+
+ + +
+

27.34.1 Examples

+ +
    +
  • This will mix 3 input audio streams to a single output with the same duration as the +first input and a dropout transition time of 3 seconds: +
    +
    ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
    +
    + +
  • This will mix one vocal and one music input audio stream to a single output with the same duration as the +longest input. The music will have quarter the weight as the vocals, and the inputs are not normalized: +
    +
    ffmpeg -i VOCALS -i MUSIC -filter_complex amix=inputs=2:duration=longest:dropout_transition=0:weights="1 0.25":normalize=0 OUTPUT
    +
    + +
+ +
+
+

27.34.2 Commands

+ +

This filter supports the following commands: +

+
weights
+
normalize
+

Syntax is same as option with same name. +

+
+ +
+
+
+

27.35 amultiply

+ +

Multiply first audio stream with second audio stream and store result +in output audio stream. Multiplication is done by multiplying each +sample from first stream with sample at same position from second stream. +

+

With this element-wise multiplication one can create amplitude fades and +amplitude modulations. +

+
+
+

27.36 anequalizer

+ +

High-order parametric multiband equalizer for each channel. +

+

It accepts the following parameters: +

+
params
+
+

This option string is in format: +"cchn f=cf w=w g=g t=f | ..." +Each equalizer band is separated by ’|’. +

+
+
chn
+

Set channel number to which equalization will be applied. +If input doesn’t have that channel the entry is ignored. +

+
+
f
+

Set central frequency for band. +If input doesn’t have that frequency the entry is ignored. +

+
+
w
+

Set band width in Hertz. +

+
+
g
+

Set band gain in dB. +

+
+
t
+

Set filter type for band, optional, can be: +

+
+
0
+

Butterworth, this is default. +

+
+
1
+

Chebyshev type 1. +

+
+
2
+

Chebyshev type 2. +

+
+
+
+ +
+
curves
+

With this option activated frequency response of anequalizer is displayed +in video stream. +

+
+
size
+

Set video stream size. Only useful if curves option is activated. +

+
+
mgain
+

Set max gain that will be displayed. Only useful if curves option is activated. +Setting this to a reasonable value makes it possible to display gain which is derived from +neighbour bands which are too close to each other and thus produce higher gain +when both are activated. +

+
+
fscale
+

Set frequency scale used to draw frequency response in video output. +Can be linear or logarithmic. Default is logarithmic. +

+
+
colors
+

Set color for each channel curve which is going to be displayed in video stream. +This is list of color names separated by space or by ’|’. +Unrecognised or missing colors will be replaced by white color. +

+
+ + +
+

27.36.1 Examples

+ +
    +
  • Lower gain by 10 of central frequency 200Hz and width 100 Hz +for first 2 channels using Chebyshev type 1 filter: +
    +
    anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
    +
    +
+ +
+
+

27.36.2 Commands

+ +

This filter supports the following commands: +

+
change
+

Alter existing filter parameters. +Syntax for the commands is : "fN|f=freq|w=width|g=gain" +

+

fN is existing filter number, starting from 0, if no such filter is available +error is returned. +freq set new frequency parameter. +width set new width parameter in Hertz. +gain set new gain parameter in dB. +

+

Full filter invocation with asendcmd may look like this: +asendcmd=c=’4.0 anequalizer change 0|f=200|w=50|g=1’,anequalizer=... +

+
+ +
+
+
+

27.37 anlmdn

+ +

Reduce broadband noise in audio samples using Non-Local Means algorithm. +

+

Each sample is adjusted by looking for other samples with similar contexts. This +context similarity is defined by comparing their surrounding patches of size +p. Patches are searched in an area of r around the sample. +

+

The filter accepts the following options: +

+
+
strength, s
+

Set denoising strength. Allowed range is from 0.00001 to 10000. Default value is 0.00001. +

+
+
patch, p
+

Set patch radius duration. Allowed range is from 1 to 100 milliseconds. +Default value is 2 milliseconds. +

+
+
research, r
+

Set research radius duration. Allowed range is from 2 to 300 milliseconds. +Default value is 6 milliseconds. +

+
+
output, o
+

Set the output mode. +

+

It accepts the following values: +

+
i
+

Pass input unchanged. +

+
+
o
+

Pass noise filtered out. +

+
+
n
+

Pass only noise. +

+

Default value is o. +

+
+ +
+
smooth, m
+

Set smooth factor. Default value is 11. Allowed range is from 1 to 1000. +

+
+ + +
+

27.37.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.38 anlmf, anlms

+

Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first audio stream using the second audio stream. +

+

This adaptive filter is used to mimic a desired filter by finding the filter coefficients that +relate to producing the least mean square of the error signal (difference between the desired, +2nd input audio stream and the actual signal, the 1st input audio stream). +

+

A description of the accepted options follows. +

+
+
order
+

Set filter order. +

+
+
mu
+

Set filter mu. +

+
+
eps
+

Set the filter eps. +

+
+
leakage
+

Set the filter leakage. +

+
+
out_mode
+

It accepts the following values: +

+
i
+

Pass the 1st input. +

+
+
d
+

Pass the 2nd input. +

+
+
o
+

Pass difference between desired, 2nd input and error signal estimate. +

+
+
n
+

Pass difference between input, 1st input and error signal estimate. +

+
+
e
+

Pass error signal estimated samples. +

+

Default value is o. +

+
+
+
+ + +
+

27.38.1 Examples

+ +
    +
  • One of many usages of this filter is noise reduction, input audio is filtered +with same samples that are delayed by fixed amount, one such example for stereo audio is: +
    +
    asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
    +
    +
+ +
+
+

27.38.2 Commands

+ +

This filter supports the same commands as options, excluding option order. +

+
+
+
+

27.39 anull

+ +

Pass the audio source unchanged to the output. +

+
+
+

27.40 apad

+ +

Pad the end of an audio stream with silence. +

+

This can be used together with ffmpeg -shortest to +extend audio streams to the same length as the video stream. +

+

A description of the accepted options follows. +

+
+
packet_size
+

Set silence packet size. Default value is 4096. +

+
+
pad_len
+

Set the number of samples of silence to add to the end. After the +value is reached, the stream is terminated. This option is mutually +exclusive with whole_len. +

+
+
whole_len
+

Set the minimum total number of samples in the output audio stream. If +the value is longer than the input audio length, silence is added to +the end, until the value is reached. This option is mutually exclusive +with pad_len. +

+
+
pad_dur
+

Specify the duration of samples of silence to add. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. Used only if set to non-negative value. +

+
+
whole_dur
+

Specify the minimum total duration in the output audio stream. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. Used only if set to non-negative value. If the value is longer than +the input audio length, silence is added to the end, until the value is reached. +This option is mutually exclusive with pad_dur +

+
+ +

If neither the pad_len nor the whole_len nor pad_dur +nor whole_dur option is set, the filter will add silence to the end of +the input stream indefinitely. +

+

Note that for ffmpeg 4.4 and earlier a zero pad_dur or +whole_dur also caused the filter to add silence indefinitely. +

+ +
+

27.40.1 Examples

+ +
    +
  • Add 1024 samples of silence to the end of the input: +
    +
    apad=pad_len=1024
    +
    + +
  • Make sure the audio output will contain at least 10000 samples, pad +the input with silence if required: +
    +
    apad=whole_len=10000
    +
    + +
  • Use ffmpeg to pad the audio input with silence, so that the +video stream will always result the shortest and will be converted +until the end in the output file when using the shortest +option: +
    +
    ffmpeg -i VIDEO -i AUDIO -filter_complex "[1:0]apad" -shortest OUTPUT
    +
    +
+ +
+
+
+

27.41 aphaser

+

Add a phasing effect to the input audio. +

+

A phaser filter creates series of peaks and troughs in the frequency spectrum. +The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect. +

+

A description of the accepted parameters follows. +

+
+
in_gain
+

Set input gain. Default is 0.4. +

+
+
out_gain
+

Set output gain. Default is 0.74 +

+
+
delay
+

Set delay in milliseconds. Default is 3.0. +

+
+
decay
+

Set decay. Default is 0.4. +

+
+
speed
+

Set modulation speed in Hz. Default is 0.5. +

+
+
type
+

Set modulation type. Default is triangular. +

+

It accepts the following values: +

+
triangular, t
+
sinusoidal, s
+
+
+
+ +
+
+

27.42 aphaseshift

+

Apply phase shift to input audio samples. +

+

The filter accepts the following options: +

+
+
shift
+

Specify phase shift. Allowed range is from -1.0 to 1.0. +Default value is 0.0. +

+
+
level
+

Set output gain applied to final output. Allowed range is from 0.0 to 1.0. +Default value is 1.0. +

+
+
order
+

Set filter order used for filtering. Allowed range is from 1 to 16. +Default value is 8. +

+
+ + +
+

27.42.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.43 apsyclip

+

Apply Psychoacoustic clipper to input audio stream. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
level_out
+

Set output gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
clip
+

Set the clipping start value. Default value is 0dBFS or 1. +

+
+
diff
+

Output only difference samples, useful to hear introduced distortions. +By default is disabled. +

+
+
adaptive
+

Set strength of adaptive distortion applied. Default value is 0.5. +Allowed range is from 0 to 1. +

+
+
iterations
+

Set number of iterations of psychoacoustic clipper. +Allowed range is from 1 to 20. Default value is 10. +

+
+
level
+

Auto level output signal. Default is disabled. +This normalizes audio back to 0dBFS if enabled. +

+
+ + +
+

27.43.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.44 apulsator

+ +

Audio pulsator is something between an autopanner and a tremolo. +But it can produce funny stereo effects as well. Pulsator changes the volume +of the left and right channel based on a LFO (low frequency oscillator) with +different waveforms and shifted phases. +This filter have the ability to define an offset between left and right +channel. An offset of 0 means that both LFO shapes match each other. +The left and right channel are altered equally - a conventional tremolo. +An offset of 50% means that the shape of the right channel is exactly shifted +in phase (or moved backwards about half of the frequency) - pulsator acts as +an autopanner. At 1 both curves match again. Every setting in between moves the +phase shift gapless between all stages and produces some "bypassing" sounds with +sine and triangle waveforms. The more you set the offset near 1 (starting from +the 0.5) the faster the signal passes from the left to the right speaker. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
level_out
+

Set output gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
mode
+

Set waveform shape the LFO will use. Can be one of: sine, triangle, square, +sawup or sawdown. Default is sine. +

+
+
amount
+

Set modulation. Define how much of original signal is affected by the LFO. +

+
+
offset_l
+

Set left channel offset. Default is 0. Allowed range is [0 - 1]. +

+
+
offset_r
+

Set right channel offset. Default is 0.5. Allowed range is [0 - 1]. +

+
+
width
+

Set pulse width. Default is 1. Allowed range is [0 - 2]. +

+
+
timing
+

Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz. +

+
+
bpm
+

Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing +is set to bpm. +

+
+
ms
+

Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing +is set to ms. +

+
+
hz
+

Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used +if timing is set to hz. +

+
+ +
+
+

27.45 aresample

+ +

Resample the input audio to the specified parameters, using the +libswresample library. If none are specified then the filter will +automatically convert between its input and output. +

+

This filter is also able to stretch/squeeze the audio data to make it match +the timestamps or to inject silence / cut out audio to make it match the +timestamps, do a combination of both or do neither. +

+

The filter accepts the syntax +[sample_rate:]resampler_options, where sample_rate +expresses a sample rate and resampler_options is a list of +key=value pairs, separated by ":". See the +(ffmpeg-resampler)"Resampler Options" section in the +ffmpeg-resampler(1) manual +for the complete list of supported options. +

+ +
+

27.45.1 Examples

+ +
    +
  • Resample the input audio to 44100Hz: +
    +
    aresample=44100
    +
    + +
  • Stretch/squeeze samples to the given timestamps, with a maximum of 1000 +samples per second compensation: +
    +
    aresample=async=1000
    +
    +
+ +
+
+
+

27.46 areverse

+ +

Reverse an audio clip. +

+

Warning: This filter requires memory to buffer the entire clip, so trimming +is suggested. +

+ +
+

27.46.1 Examples

+ +
    +
  • Take the first 5 seconds of a clip, and reverse it. +
    +
    atrim=end=5,areverse
    +
    +
+ +
+
+
+

27.47 arls

+

Apply Recursive Least Squares algorithm to the first audio stream using the second audio stream. +

+

This adaptive filter is used to mimic a desired filter by recursively finding the filter coefficients that +relate to producing the minimal weighted linear least squares cost function of the error signal (difference +between the desired, 2nd input audio stream and the actual signal, the 1st input audio stream). +

+

A description of the accepted options follows. +

+
+
order
+

Set the filter order. +

+
+
lambda
+

Set the forgetting factor. +

+
+
delta
+

Set the coefficient to initialize internal covariance matrix. +

+
+
out_mode
+

Set the filter output samples. It accepts the following values: +

+
i
+

Pass the 1st input. +

+
+
d
+

Pass the 2nd input. +

+
+
o
+

Pass difference between desired, 2nd input and error signal estimate. +

+
+
n
+

Pass difference between input, 1st input and error signal estimate. +

+
+
e
+

Pass error signal estimated samples. +

+

Default value is o. +

+
+
+
+ +
+
+

27.48 arnndn

+ +

Reduce noise from speech using Recurrent Neural Networks. +

+

This filter accepts the following options: +

+
+
model, m
+

Set train model file to load. This option is always required. +

+
+
mix
+

Set how much to mix filtered samples into final output. +Allowed range is from -1 to 1. Default value is 1. +Negative values are special, they set how much to keep filtered noise +in the final filter output. Set this option to -1 to hear actual +noise removed from input signal. +

+
+ + +
+

27.48.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.49 asdr

+

Measure Audio Signal-to-Distortion Ratio. +

+

This filter takes two audio streams for input, and outputs first +audio stream. +Results are in dB per channel at end of either input. +

+
+
+

27.50 asetnsamples

+ +

Set the number of samples per each output audio frame. +

+

The last output packet may contain a different number of samples, as +the filter will flush all the remaining samples when the input audio +signals its end. +

+

The filter accepts the following options: +

+
+
nb_out_samples, n
+

Set the number of frames per each output audio frame. The number is +intended as the number of samples per each channel. +Default value is 1024. +

+
+
pad, p
+

If set to 1, the filter will pad the last audio frame with zeroes, so +that the last frame will contain the same number of samples as the +previous ones. Default value is 1. +

+
+ +

For example, to set the number of per-frame samples to 1234 and +disable padding for the last frame, use: +

+
asetnsamples=n=1234:p=0
+
+ +
+
+

27.51 asetrate

+ +

Set the sample rate without altering the PCM data. +This will result in a change of speed and pitch. +

+

The filter accepts the following options: +

+
+
sample_rate, r
+

Set the output sample rate. Default is 44100 Hz. +

+
+ +
+
+

27.52 ashowinfo

+ +

Show a line containing various information for each input audio frame. +The input audio is not modified. +

+

The shown line contains a sequence of key/value pairs of the form +key:value. +

+

The following values are shown in the output: +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +

+
+
pts
+

The presentation timestamp of the input frame, in time base units; the time base +depends on the filter input pad, and is usually 1/sample_rate. +

+
+
pts_time
+

The presentation timestamp of the input frame in seconds. +

+
+
fmt
+

The sample format. +

+
+
chlayout
+

The channel layout. +

+
+
rate
+

The sample rate for the audio frame. +

+
+
nb_samples
+

The number of samples (per channel) in the frame. +

+
+
checksum
+

The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar +audio, the data is treated as if all the planes were concatenated. +

+
+
plane_checksums
+

A list of Adler-32 checksums for each data plane. +

+
+ +
+
+

27.53 asoftclip

+

Apply audio soft clipping. +

+

Soft clipping is a type of distortion effect where the amplitude of a signal is saturated +along a smooth curve, rather than the abrupt shape of hard-clipping. +

+

This filter accepts the following options: +

+
+
type
+

Set type of soft-clipping. +

+

It accepts the following values: +

+
hard
+
tanh
+
atan
+
cubic
+
exp
+
alg
+
quintic
+
sin
+
erf
+
+ +
+
threshold
+

Set threshold from where to start clipping. Default value is 0dB or 1. +

+
+
output
+

Set gain applied to output. Default value is 0dB or 1. +

+
+
param
+

Set additional parameter which controls sigmoid function. +

+
+
oversample
+

Set oversampling factor. +

+
+ + +
+

27.53.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.54 aspectralstats

+ +

Display frequency domain statistical information about the audio channels. +Statistics are calculated and stored as metadata for each audio channel and for each audio frame. +

+

It accepts the following option: +

+
win_size
+

Set the window length in samples. Default value is 2048. +Allowed range is from 32 to 65536. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann, hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hann. +

+
+
overlap
+

Set window overlap. Allowed range is from 0 +to 1. Default value is 0.5. +

+
+
measure
+

Select the parameters which are measured. The metadata keys can +be used as flags, default is all which measures everything. +none disables all measurement. +

+
+ +

A list of each metadata key follows: +

+
+
mean
+
variance
+
centroid
+
spread
+
skewness
+
kurtosis
+
entropy
+
flatness
+
crest
+
flux
+
slope
+
decrease
+
rolloff
+
+ +
+
+

27.55 asr

+

Automatic Speech Recognition +

+

This filter uses PocketSphinx for speech recognition. To enable +compilation of this filter, you need to configure FFmpeg with +--enable-pocketsphinx. +

+

It accepts the following options: +

+
+
rate
+

Set sampling rate of input audio. Defaults is 16000. +This need to match speech models, otherwise one will get poor results. +

+
+
hmm
+

Set dictionary containing acoustic model files. +

+
+
dict
+

Set pronunciation dictionary. +

+
+
lm
+

Set language model file. +

+
+
lmctl
+

Set language model set. +

+
+
lmname
+

Set which language model to use. +

+
+
logfn
+

Set output for log messages. +

+
+ +

The filter exports recognized speech as the frame metadata lavfi.asr.text. +

+
+
+

27.56 astats

+ +

Display time domain statistical information about the audio channels. +Statistics are calculated and displayed for each audio channel and, +where applicable, an overall figure is also given. +

+

It accepts the following option: +

+
length
+

Short window length in seconds, used for peak and trough RMS measurement. +Default is 0.05 (50 milliseconds). Allowed range is [0 - 10]. +

+
+
metadata
+
+

Set metadata injection. All the metadata keys are prefixed with lavfi.astats.X, +where X is channel number starting from 1 or string Overall. Default is +disabled. +

+

Available keys for each channel are: +Bit_depth +Crest_factor +DC_offset +Dynamic_range +Entropy +Flat_factor +Max_difference +Max_level +Mean_difference +Min_difference +Min_level +Noise_floor +Noise_floor_count +Number_of_Infs +Number_of_NaNs +Number_of_denormals +Peak_count +Peak_level +RMS_difference +RMS_peak +RMS_trough +Zero_crossings +Zero_crossings_rate +

+

and for Overall: +Bit_depth +DC_offset +Entropy +Flat_factor +Max_difference +Max_level +Mean_difference +Min_difference +Min_level +Noise_floor +Noise_floor_count +Number_of_Infs +Number_of_NaNs +Number_of_denormals +Number_of_samples +Peak_count +Peak_level +RMS_difference +RMS_level +RMS_peak +RMS_trough +

+

For example, a full key looks like lavfi.astats.1.DC_offset or +lavfi.astats.Overall.Peak_count. +

+

Read below for the description of the keys. +

+
+
reset
+

Set the number of frames over which cumulative stats are calculated before +being reset. Default is disabled. +

+
+
measure_perchannel
+

Select the parameters which are measured per channel. The metadata keys can +be used as flags, default is all which measures everything. +none disables all per channel measurement. +

+
+
measure_overall
+

Select the parameters which are measured overall. The metadata keys can +be used as flags, default is all which measures everything. +none disables all overall measurement. +

+
+
+ +

A description of the measure keys follow: +

+
+
none
+

no measures +

+
+
all
+

all measures +

+
+
Bit_depth
+

overall bit depth of audio, i.e. number of bits used for each sample +

+
+
Crest_factor
+

standard ratio of peak to RMS level (note: not in dB) +

+
+
DC_offset
+

mean amplitude displacement from zero +

+
+
Dynamic_range
+

measured dynamic range of audio in dB +

+
+
Entropy
+

entropy measured across whole audio, entropy of value near 1.0 is typically measured for white noise +

+
+
Flat_factor
+

flatness (i.e. consecutive samples with the same value) of the signal at its peak levels +(i.e. either Min_level or Max_level) +

+
+
Max_difference
+

maximal difference between two consecutive samples +

+
+
Max_level
+

maximal sample level +

+
+
Mean_difference
+

mean difference between two consecutive samples, i.e. the average of each difference between two consecutive samples +

+
+
Min_difference
+

minimal difference between two consecutive samples +

+
+
Min_level
+

minimal sample level +

+
+
Noise_floor
+

minimum local peak measured in dBFS over a short window +

+
+
Noise_floor_count
+

number of occasions (not the number of samples) that the signal attained +Noise floor +

+
+
Number_of_Infs
+

number of samples with an infinite value +

+
+
Number_of_NaNs
+

number of samples with a NaN (not a number) value +

+
+
Number_of_denormals
+

number of samples with a subnormal value +

+
+
Number_of_samples
+

number of samples +

+
+
Peak_count
+

number of occasions (not the number of samples) that the signal attained either +Min_level or Max_level +

+
+
Peak_level
+

standard peak level measured in dBFS +

+
+
RMS_difference
+

Root Mean Square difference between two consecutive samples +

+
+
RMS_level
+

standard RMS level measured in dBFS +

+
+
RMS_peak
+
RMS_trough
+

peak and trough values for RMS level measured over a short window, +measured in dBFS. +

+
+
Zero crossings
+

number of points where the waveform crosses the zero level axis +

+
+
Zero crossings rate
+

rate of Zero crossings and number of audio samples +

+
+ +
+
+

27.57 asubboost

+

Boost subwoofer frequencies. +

+

The filter accepts the following options: +

+
+
dry
+

Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1. +Default value is 1.0. +

+
+
wet
+

Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1. +Default value is 1.0. +

+
+
boost
+

Set max boost factor. Allowed range is from 1 to 12. Default value is 2. +

+
+
decay
+

Set delay line decay gain value. Allowed range is from 0 to 1. +Default value is 0.0. +

+
+
feedback
+

Set delay line feedback gain value. Allowed range is from 0 to 1. +Default value is 0.9. +

+
+
cutoff
+

Set cutoff frequency in Hertz. Allowed range is 50 to 900. +Default value is 100. +

+
+
slope
+

Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1. +Default value is 0.5. +

+
+
delay
+

Set delay. Allowed range is from 1 to 100. +Default value is 20. +

+
+
channels
+

Set the channels to process. Default value is all available. +

+
+ + +
+

27.57.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.58 asubcut

+

Cut subwoofer frequencies. +

+

This filter allows to set custom, steeper +roll off than highpass filter, and thus is able to more attenuate +frequency content in stop-band. +

+

The filter accepts the following options: +

+
+
cutoff
+

Set cutoff frequency in Hertz. Allowed range is 2 to 200. +Default value is 20. +

+
+
order
+

Set filter order. Available values are from 3 to 20. +Default value is 10. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 1. Default value is 1. +

+
+ + +
+

27.58.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.59 asupercut

+

Cut super frequencies. +

+

The filter accepts the following options: +

+
+
cutoff
+

Set cutoff frequency in Hertz. Allowed range is 20000 to 192000. +Default value is 20000. +

+
+
order
+

Set filter order. Available values are from 3 to 20. +Default value is 10. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 1. Default value is 1. +

+
+ + +
+

27.59.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.60 asuperpass

+

Apply high order Butterworth band-pass filter. +

+

The filter accepts the following options: +

+
+
centerf
+

Set center frequency in Hertz. Allowed range is 2 to 999999. +Default value is 1000. +

+
+
order
+

Set filter order. Available values are from 4 to 20. +Default value is 4. +

+
+
qfactor
+

Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 2. Default value is 1. +

+
+ + +
+

27.60.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.61 asuperstop

+

Apply high order Butterworth band-stop filter. +

+

The filter accepts the following options: +

+
+
centerf
+

Set center frequency in Hertz. Allowed range is 2 to 999999. +Default value is 1000. +

+
+
order
+

Set filter order. Available values are from 4 to 20. +Default value is 4. +

+
+
qfactor
+

Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 2. Default value is 1. +

+
+ + +
+

27.61.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.62 atempo

+ +

Adjust audio tempo. +

+

The filter accepts exactly one parameter, the audio tempo. If not +specified then the filter will assume nominal 1.0 tempo. Tempo must +be in the [0.5, 100.0] range. +

+

Note that tempo greater than 2 will skip some samples rather than +blend them in. If for any reason this is a concern it is always +possible to daisy-chain several instances of atempo to achieve the +desired product tempo. +

+ +
+

27.62.1 Examples

+ +
    +
  • Slow down audio to 80% tempo: +
    +
    atempo=0.8
    +
    + +
  • To speed up audio to 300% tempo: +
    +
    atempo=3
    +
    + +
  • To speed up audio to 300% tempo by daisy-chaining two atempo instances: +
    +
    atempo=sqrt(3),atempo=sqrt(3)
    +
    +
+ +
+
+

27.62.2 Commands

+ +

This filter supports the following commands: +

+
tempo
+

Change filter tempo scale factor. +Syntax for the command is : "tempo" +

+
+ +
+
+
+

27.63 atilt

+

Apply spectral tilt filter to audio stream. +

+

This filter apply any spectral roll-off slope over any specified frequency band. +

+

The filter accepts the following options: +

+
+
freq
+

Set central frequency of tilt in Hz. Default is 10000 Hz. +

+
+
slope
+

Set slope direction of tilt. Default is 0. Allowed range is from -1 to 1. +

+
+
width
+

Set width of tilt. Default is 1000. Allowed range is from 100 to 10000. +

+
+
order
+

Set order of tilt filter. +

+
+
level
+

Set input volume level. Allowed range is from 0 to 4. +Defalt is 1. +

+
+ + +
+

27.63.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.64 atrim

+ +

Trim the input so that the output contains one continuous subpart of the input. +

+

It accepts the following parameters: +

+
start
+

Timestamp (in seconds) of the start of the section to keep. I.e. the audio +sample with the timestamp start will be the first sample in the output. +

+
+
end
+

Specify time of the first audio sample that will be dropped, i.e. the +audio sample immediately preceding the one with the timestamp end will be +the last sample in the output. +

+
+
start_pts
+

Same as start, except this option sets the start timestamp in samples +instead of seconds. +

+
+
end_pts
+

Same as end, except this option sets the end timestamp in samples instead +of seconds. +

+
+
duration
+

The maximum duration of the output in seconds. +

+
+
start_sample
+

The number of the first sample that should be output. +

+
+
end_sample
+

The number of the first sample that should be dropped. +

+
+ +

start, end, and duration are expressed as time +duration specifications; see +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

Note that the first two sets of the start/end options and the duration +option look at the frame timestamp, while the _sample options simply count the +samples that pass through the filter. So start/end_pts and start/end_sample will +give different results when the timestamps are wrong, inexact or do not start at +zero. Also note that this filter does not modify the timestamps. If you wish +to have the output timestamps start at zero, insert the asetpts filter after the +atrim filter. +

+

If multiple start or end options are set, this filter tries to be greedy and +keep all samples that match at least one of the specified constraints. To keep +only the part that matches all the constraints at once, chain multiple atrim +filters. +

+

The defaults are such that all the input is kept. So it is possible to set e.g. +just the end values to keep everything before the specified time. +

+

Examples: +

    +
  • Drop everything except the second minute of input: +
    +
    ffmpeg -i INPUT -af atrim=60:120
    +
    + +
  • Keep only the first 1000 samples: +
    +
    ffmpeg -i INPUT -af atrim=end_sample=1000
    +
    + +
+ +
+
+

27.65 axcorrelate

+

Calculate normalized windowed cross-correlation between two input audio streams. +

+

Resulted samples are always between -1 and 1 inclusive. +If result is 1 it means two input samples are highly correlated in that selected segment. +Result 0 means they are not correlated at all. +If result is -1 it means two input samples are out of phase, which means they cancel each +other. +

+

The filter accepts the following options: +

+
+
size
+

Set size of segment over which cross-correlation is calculated. +Default is 256. Allowed range is from 2 to 131072. +

+
+
algo
+

Set algorithm for cross-correlation. Can be slow or fast. +Default is slow. Fast algorithm assumes mean values over any given segment +are always zero and thus need much less calculations to make. +This is generally not true, but is valid for typical audio streams. +

+
+ + +
+

27.65.1 Examples

+ +
    +
  • Calculate correlation between channels in stereo audio stream: +
    +
    ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
    +
    +
+ +
+
+
+

27.66 bandpass

+ +

Apply a two-pole Butterworth band-pass filter with central +frequency frequency, and (3dB-point) band-width width. +The csg option selects a constant skirt gain (peak gain = Q) +instead of the default: constant 0dB peak gain. +The filter roll off at 6dB per octave (20dB per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the filter’s central frequency. Default is 3000. +

+
+
csg
+

Constant skirt gain if set to 1. Defaults to 0. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

27.66.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change bandpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change bandpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change bandpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change bandpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

27.67 bandreject

+ +

Apply a two-pole Butterworth band-reject filter with central +frequency frequency, and (3dB-point) band-width width. +The filter roll off at 6dB per octave (20dB per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the filter’s central frequency. Default is 3000. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

27.67.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change bandreject frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change bandreject width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change bandreject width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change bandreject mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

27.68 bass, lowshelf

+ +

Boost or cut the bass (lower) frequencies of the audio using a two-pole +shelving filter with a response similar to that of a standard +hi-fi’s tone-controls. This is also known as shelving equalisation (EQ). +

+

The filter accepts the following options: +

+
+
gain, g
+

Give the gain at 0 Hz. Its useful range is about -20 +(for a large cut) to +20 (for a large boost). +Beware of clipping when using a positive gain. +

+
+
frequency, f
+

Set the filter’s central frequency and so can be used +to extend or reduce the frequency range to be boosted or cut. +The default value is 100 Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Determine how steep is the filter’s shelf transition. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

27.68.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change bass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change bass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change bass width. +Syntax for the command is : "width" +

+
+
gain, g
+

Change bass gain. +Syntax for the command is : "gain" +

+
+
mix, m
+

Change bass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

27.69 biquad

+ +

Apply a biquad IIR filter with the given coefficients. +Where b0, b1, b2 and a0, a1, a2 +are the numerator and denominator coefficients respectively. +and channels, c specify which channels to filter, by default all +available are filtered. +

+ +
+

27.69.1 Commands

+ +

This filter supports the following commands: +

+
a0
+
a1
+
a2
+
b0
+
b1
+
b2
+

Change biquad parameter. +Syntax for the command is : "value" +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ +
+
+
+

27.70 bs2b

+

Bauer stereo to binaural transformation, which improves headphone listening of +stereo audio records. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libbs2b. +

+

It accepts the following parameters: +

+
profile
+

Pre-defined crossfeed level. +

+
default
+

Default level (fcut=700, feed=50). +

+
+
cmoy
+

Chu Moy circuit (fcut=700, feed=60). +

+
+
jmeier
+

Jan Meier circuit (fcut=650, feed=95). +

+
+
+ +
+
fcut
+

Cut frequency (in Hz). +

+
+
feed
+

Feed level (in Hz). +

+
+
+ +
+
+

27.71 channelmap

+ +

Remap input channels to new locations. +

+

It accepts the following parameters: +

+
map
+

Map channels from input to output. The argument is a ’|’-separated list of +mappings, each in the in_channel-out_channel or +in_channel form. in_channel can be either the name of the input +channel (e.g. FL for front left) or its index in the input channel layout. +out_channel is the name of the output channel or its index in the output +channel layout. If out_channel is not given then it is implicitly an +index, starting with zero and increasing by one for each mapping. +

+
+
channel_layout
+

The channel layout of the output stream. +

+
+ +

If no mapping is present, the filter will implicitly map input channels to +output channels, preserving indices. +

+ +
+

27.71.1 Examples

+ +
    +
  • For example, assuming a 5.1+downmix input MOV file, +
    +
    ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
    +
    +

    will create an output WAV file tagged as stereo from the downmix channels of +the input. +

    +
  • To fix a 5.1 WAV improperly encoded in AAC’s native channel order +
    +
    ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
    +
    +
+ +
+
+
+

27.72 channelsplit

+ +

Split each channel from an input audio stream into a separate output stream. +

+

It accepts the following parameters: +

+
channel_layout
+

The channel layout of the input stream. The default is "stereo". +

+
channels
+

A channel layout describing the channels to be extracted as separate output streams +or "all" to extract each input channel as a separate stream. The default is "all". +

+

Choosing channels not present in channel layout in the input will result in an error. +

+
+ + +
+

27.72.1 Examples

+ +
    +
  • For example, assuming a stereo input MP3 file, +
    +
    ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
    +
    +

    will create an output Matroska file with two audio streams, one containing only +the left channel and the other the right channel. +

    +
  • Split a 5.1 WAV file into per-channel files: +
    +
    ffmpeg -i in.wav -filter_complex
    +'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
    +-map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
    +front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
    +side_right.wav
    +
    + +
  • Extract only LFE from a 5.1 WAV file: +
    +
    ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
    +-map '[LFE]' lfe.wav
    +
    +
+ +
+
+
+

27.73 chorus

+

Add a chorus effect to the audio. +

+

Can make a single vocal sound like a chorus, but can also be applied to instrumentation. +

+

Chorus resembles an echo effect with a short delay, but whereas with echo the delay is +constant, with chorus, it is varied using using sinusoidal or triangular modulation. +The modulation depth defines the range the modulated delay is played before or after +the delay. Hence the delayed sound will sound slower or faster, that is the delayed +sound tuned around the original one, like in a chorus where some vocals are slightly +off key. +

+

It accepts the following parameters: +

+
in_gain
+

Set input gain. Default is 0.4. +

+
+
out_gain
+

Set output gain. Default is 0.4. +

+
+
delays
+

Set delays. A typical delay is around 40ms to 60ms. +

+
+
decays
+

Set decays. +

+
+
speeds
+

Set speeds. +

+
+
depths
+

Set depths. +

+
+ + +
+

27.73.1 Examples

+ +
    +
  • A single delay: +
    +
    chorus=0.7:0.9:55:0.4:0.25:2
    +
    + +
  • Two delays: +
    +
    chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
    +
    + +
  • Fuller sounding chorus with three delays: +
    +
    chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3
    +
    +
+ +
+
+
+

27.74 compand

+

Compress or expand the audio’s dynamic range. +

+

It accepts the following parameters: +

+
+
attacks
+
decays
+

A list of times in seconds for each channel over which the instantaneous level +of the input signal is averaged to determine its volume. attacks refers to +increase of volume and decays refers to decrease of volume. For most +situations, the attack time (response to the audio getting louder) should be +shorter than the decay time, because the human ear is more sensitive to sudden +loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and +a typical value for decay is 0.8 seconds. +If specified number of attacks & decays is lower than number of channels, the last +set attack/decay will be used for all remaining channels. +

+
+
points
+

A list of points for the transfer function, specified in dB relative to the +maximum possible signal amplitude. Each key points list must be defined using +the following syntax: x0/y0|x1/y1|x2/y2|.... or +x0/y0 x1/y1 x2/y2 .... +

+

The input values must be in strictly increasing order but the transfer function +does not have to be monotonically rising. The point 0/0 is assumed but +may be overridden (by 0/out-dBn). Typical values for the transfer +function are -70/-70|-60/-20|1/0. +

+
+
soft-knee
+

Set the curve radius in dB for all joints. It defaults to 0.01. +

+
+
gain
+

Set the additional gain in dB to be applied at all points on the transfer +function. This allows for easy adjustment of the overall gain. +It defaults to 0. +

+
+
volume
+

Set an initial volume, in dB, to be assumed for each channel when filtering +starts. This permits the user to supply a nominal level initially, so that, for +example, a very large gain is not applied to initial signal levels before the +companding has begun to operate. A typical value for audio which is initially +quiet is -90 dB. It defaults to 0. +

+
+
delay
+

Set a delay, in seconds. The input audio is analyzed immediately, but audio is +delayed before being fed to the volume adjuster. Specifying a delay +approximately equal to the attack/decay times allows the filter to effectively +operate in predictive rather than reactive mode. It defaults to 0. +

+
+
+ + +
+

27.74.1 Examples

+ +
    +
  • Make music with both quiet and loud passages suitable for listening to in a +noisy environment: +
    +
    compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
    +
    + +

    Another example for audio with whisper and explosion parts: +

    +
    compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
    +
    + +
  • A noise gate for when the noise is at a lower level than the signal: +
    +
    compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
    +
    + +
  • Here is another noise gate, this time for when the noise is at a higher level +than the signal (making it, in some ways, similar to squelch): +
    +
    compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
    +
    + +
  • 2:1 compression starting at -6dB: +
    +
    compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
    +
    + +
  • 2:1 compression starting at -9dB: +
    +
    compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
    +
    + +
  • 2:1 compression starting at -12dB: +
    +
    compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
    +
    + +
  • 2:1 compression starting at -18dB: +
    +
    compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
    +
    + +
  • 3:1 compression starting at -15dB: +
    +
    compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
    +
    + +
  • Compressor/Gate: +
    +
    compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
    +
    + +
  • Expander: +
    +
    compand=attacks=0:points=-80/-169|-54/-80|-49.5/-64.6|-41.1/-41.1|-25.8/-15|-10.8/-4.5|0/0|20/8.3
    +
    + +
  • Hard limiter at -6dB: +
    +
    compand=attacks=0:points=-80/-80|-6/-6|20/-6
    +
    + +
  • Hard limiter at -12dB: +
    +
    compand=attacks=0:points=-80/-80|-12/-12|20/-12
    +
    + +
  • Hard noise gate at -35 dB: +
    +
    compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
    +
    + +
  • Soft limiter: +
    +
    compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
    +
    +
+ +
+
+
+

27.75 compensationdelay

+ +

Compensation Delay Line is a metric based delay to compensate differing +positions of microphones or speakers. +

+

For example, you have recorded guitar with two microphones placed in +different locations. Because the front of sound wave has fixed speed in +normal conditions, the phasing of microphones can vary and depends on +their location and interposition. The best sound mix can be achieved when +these microphones are in phase (synchronized). Note that a distance of +~30 cm between microphones makes one microphone capture the signal in +antiphase to the other microphone. That makes the final mix sound moody. +This filter helps to solve phasing problems by adding different delays +to each microphone track and make them synchronized. +

+

The best result can be reached when you take one track as base and +synchronize other tracks one by one with it. +Remember that synchronization/delay tolerance depends on sample rate, too. +Higher sample rates will give more tolerance. +

+

The filter accepts the following parameters: +

+
+
mm
+

Set millimeters distance. This is compensation distance for fine tuning. +Default is 0. +

+
+
cm
+

Set cm distance. This is compensation distance for tightening distance setup. +Default is 0. +

+
+
m
+

Set meters distance. This is compensation distance for hard distance setup. +Default is 0. +

+
+
dry
+

Set dry amount. Amount of unprocessed (dry) signal. +Default is 0. +

+
+
wet
+

Set wet amount. Amount of processed (wet) signal. +Default is 1. +

+
+
temp
+

Set temperature in degrees Celsius. This is the temperature of the environment. +Default is 20. +

+
+ + +
+

27.75.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.76 crossfeed

+

Apply headphone crossfeed filter. +

+

Crossfeed is the process of blending the left and right channels of stereo +audio recording. +It is mainly used to reduce extreme stereo separation of low frequencies. +

+

The intent is to produce more speaker like sound to the listener. +

+

The filter accepts the following options: +

+
+
strength
+

Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1. +This sets gain of low shelf filter for side part of stereo image. +Default is -6dB. Max allowed is -30db when strength is set to 1. +

+
+
range
+

Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1. +This sets cut off frequency of low shelf filter. Default is cut off near +1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz. +

+
+
slope
+

Set curve slope of low shelf filter. Default is 0.5. +Allowed range is from 0.01 to 1. +

+
+
level_in
+

Set input gain. Default is 0.9. +

+
+
level_out
+

Set output gain. Default is 1. +

+
+
block_size
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

27.76.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.77 crystalizer

+

Simple algorithm for audio noise sharpening. +

+

This filter linearly increases differences betweeen each audio sample. +

+

The filter accepts the following options: +

+
+
i
+

Sets the intensity of effect (default: 2.0). Must be in range between -10.0 to 0 +(unchanged sound) to 10.0 (maximum effect). +To inverse filtering use negative value. +

+
+
c
+

Enable clipping. By default is enabled. +

+
+ + +
+

27.77.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.78 dcshift

+

Apply a DC shift to the audio. +

+

This can be useful to remove a DC offset (caused perhaps by a hardware problem +in the recording chain) from the audio. The effect of a DC offset is reduced +headroom and hence volume. The astats filter can be used to determine if +a signal has a DC offset. +

+
+
shift
+

Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift +the audio. +

+
+
limitergain
+

Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is +used to prevent clipping. +

+
+ +
+
+

27.79 deesser

+ +

Apply de-essing to the audio samples. +

+
+
i
+

Set intensity for triggering de-essing. Allowed range is from 0 to 1. +Default is 0. +

+
+
m
+

Set amount of ducking on treble part of sound. Allowed range is from 0 to 1. +Default is 0.5. +

+
+
f
+

How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1. +Default is 0.5. +

+
+
s
+

Set the output mode. +

+

It accepts the following values: +

+
i
+

Pass input unchanged. +

+
+
o
+

Pass ess filtered out. +

+
+
e
+

Pass only ess. +

+

Default value is o. +

+
+ +
+
+ +
+
+

27.80 dialoguenhance

+

Enhance dialogue in stereo audio. +

+

This filter accepts stereo input and produce surround (3.0) channels output. +The newly produced front center channel have enhanced speech dialogue originally +available in both stereo channels. +This filter outputs front left and front right channels same as available in stereo input. +

+

The filter accepts the following options: +

+
+
original
+

Set the original center factor to keep in front center channel output. +Allowed range is from 0 to 1. Default value is 1. +

+
+
enhance
+

Set the dialogue enhance factor to put in front center channel output. +Allowed range is from 0 to 3. Default value is 1. +

+
+
voice
+

Set the voice detection factor. +Allowed range is from 2 to 32. Default value is 2. +

+
+ + +
+

27.80.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.81 drmeter

+

Measure audio dynamic range. +

+

DR values of 14 and higher is found in very dynamic material. DR of 8 to 13 +is found in transition material. And anything less that 8 have very poor dynamics +and is very compressed. +

+

The filter accepts the following options: +

+
+
length
+

Set window length in seconds used to split audio into segments of equal length. +Default is 3 seconds. +

+
+ +
+
+

27.82 dynaudnorm

+

Dynamic Audio Normalizer. +

+

This filter applies a certain amount of gain to the input audio in order +to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in +contrast to more "simple" normalization algorithms, the Dynamic Audio +Normalizer *dynamically* re-adjusts the gain factor to the input audio. +This allows for applying extra gain to the "quiet" sections of the audio +while avoiding distortions or clipping the "loud" sections. In other words: +The Dynamic Audio Normalizer will "even out" the volume of quiet and loud +sections, in the sense that the volume of each section is brought to the +same target level. Note, however, that the Dynamic Audio Normalizer achieves +this goal *without* applying "dynamic range compressing". It will retain 100% +of the dynamic range *within* each section of the audio file. +

+
+
framelen, f
+

Set the frame length in milliseconds. In range from 10 to 8000 milliseconds. +Default is 500 milliseconds. +The Dynamic Audio Normalizer processes the input audio in small chunks, +referred to as frames. This is required, because a peak magnitude has no +meaning for just a single sample value. Instead, we need to determine the +peak magnitude for a contiguous sequence of sample values. While a "standard" +normalizer would simply use the peak magnitude of the complete file, the +Dynamic Audio Normalizer determines the peak magnitude individually for each +frame. The length of a frame is specified in milliseconds. By default, the +Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has +been found to give good results with most files. +Note that the exact frame length, in number of samples, will be determined +automatically, based on the sampling rate of the individual input audio file. +

+
+
gausssize, g
+

Set the Gaussian filter window size. In range from 3 to 301, must be odd +number. Default is 31. +Probably the most important parameter of the Dynamic Audio Normalizer is the +window size of the Gaussian smoothing filter. The filter’s window size +is specified in frames, centered around the current frame. For the sake of +simplicity, this must be an odd number. Consequently, the default value of 31 +takes into account the current frame, as well as the 15 preceding frames and +the 15 subsequent frames. Using a larger window results in a stronger +smoothing effect and thus in less gain variation, i.e. slower gain +adaptation. Conversely, using a smaller window results in a weaker smoothing +effect and thus in more gain variation, i.e. faster gain adaptation. +In other words, the more you increase this value, the more the Dynamic Audio +Normalizer will behave like a "traditional" normalization filter. On the +contrary, the more you decrease this value, the more the Dynamic Audio +Normalizer will behave like a dynamic range compressor. +

+
+
peak, p
+

Set the target peak value. This specifies the highest permissible magnitude +level for the normalized audio input. This filter will try to approach the +target peak magnitude as closely as possible, but at the same time it also +makes sure that the normalized signal will never exceed the peak magnitude. +A frame’s maximum local gain factor is imposed directly by the target peak +magnitude. The default value is 0.95 and thus leaves a headroom of 5%*. +It is not recommended to go above this value. +

+
+
maxgain, m
+

Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0. +The Dynamic Audio Normalizer determines the maximum possible (local) gain +factor for each input frame, i.e. the maximum gain factor that does not +result in clipping or distortion. The maximum gain factor is determined by +the frame’s highest magnitude sample. However, the Dynamic Audio Normalizer +additionally bounds the frame’s maximum gain factor by a predetermined +(global) maximum gain factor. This is done in order to avoid excessive gain +factors in "silent" or almost silent frames. By default, the maximum gain +factor is 10.0, For most inputs the default value should be sufficient and +it usually is not recommended to increase this value. Though, for input +with an extremely low overall volume level, it may be necessary to allow even +higher gain factors. Note, however, that the Dynamic Audio Normalizer does +not simply apply a "hard" threshold (i.e. cut off values above the threshold). +Instead, a "sigmoid" threshold function will be applied. This way, the +gain factors will smoothly approach the threshold value, but never exceed that +value. +

+
+
targetrms, r
+

Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled. +By default, the Dynamic Audio Normalizer performs "peak" normalization. +This means that the maximum local gain factor for each frame is defined +(only) by the frame’s highest magnitude sample. This way, the samples can +be amplified as much as possible without exceeding the maximum signal +level, i.e. without clipping. Optionally, however, the Dynamic Audio +Normalizer can also take into account the frame’s root mean square, +abbreviated RMS. In electrical engineering, the RMS is commonly used to +determine the power of a time-varying signal. It is therefore considered +that the RMS is a better approximation of the "perceived loudness" than +just looking at the signal’s peak magnitude. Consequently, by adjusting all +frames to a constant RMS value, a uniform "perceived loudness" can be +established. If a target RMS value has been specified, a frame’s local gain +factor is defined as the factor that would result in exactly that RMS value. +Note, however, that the maximum local gain factor is still restricted by the +frame’s highest magnitude sample, in order to prevent clipping. +

+
+
coupling, n
+

Enable channels coupling. By default is enabled. +By default, the Dynamic Audio Normalizer will amplify all channels by the same +amount. This means the same gain factor will be applied to all channels, i.e. +the maximum possible gain factor is determined by the "loudest" channel. +However, in some recordings, it may happen that the volume of the different +channels is uneven, e.g. one channel may be "quieter" than the other one(s). +In this case, this option can be used to disable the channel coupling. This way, +the gain factor will be determined independently for each channel, depending +only on the individual channel’s highest magnitude sample. This allows for +harmonizing the volume of the different channels. +

+
+
correctdc, c
+

Enable DC bias correction. By default is disabled. +An audio signal (in the time domain) is a sequence of sample values. +In the Dynamic Audio Normalizer these sample values are represented in the +-1.0 to 1.0 range, regardless of the original input format. Normally, the +audio signal, or "waveform", should be centered around the zero point. +That means if we calculate the mean value of all samples in a file, or in a +single frame, then the result should be 0.0 or at least very close to that +value. If, however, there is a significant deviation of the mean value from +0.0, in either positive or negative direction, this is referred to as a +DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic +Audio Normalizer provides optional DC bias correction. +With DC bias correction enabled, the Dynamic Audio Normalizer will determine +the mean value, or "DC correction" offset, of each input frame and subtract +that value from all of the frame’s sample values which ensures those samples +are centered around 0.0 again. Also, in order to avoid "gaps" at the frame +boundaries, the DC correction offset values will be interpolated smoothly +between neighbouring frames. +

+
+
altboundary, b
+

Enable alternative boundary mode. By default is disabled. +The Dynamic Audio Normalizer takes into account a certain neighbourhood +around each frame. This includes the preceding frames as well as the +subsequent frames. However, for the "boundary" frames, located at the very +beginning and at the very end of the audio file, not all neighbouring +frames are available. In particular, for the first few frames in the audio +file, the preceding frames are not known. And, similarly, for the last few +frames in the audio file, the subsequent frames are not known. Thus, the +question arises which gain factors should be assumed for the missing frames +in the "boundary" region. The Dynamic Audio Normalizer implements two modes +to deal with this situation. The default boundary mode assumes a gain factor +of exactly 1.0 for the missing frames, resulting in a smooth "fade in" and +"fade out" at the beginning and at the end of the input, respectively. +

+
+
compress, s
+

Set the compress factor. In range from 0.0 to 30.0. Default is 0.0. +By default, the Dynamic Audio Normalizer does not apply "traditional" +compression. This means that signal peaks will not be pruned and thus the +full dynamic range will be retained within each local neighbourhood. However, +in some cases it may be desirable to combine the Dynamic Audio Normalizer’s +normalization algorithm with a more "traditional" compression. +For this purpose, the Dynamic Audio Normalizer provides an optional compression +(thresholding) function. If (and only if) the compression feature is enabled, +all input frames will be processed by a soft knee thresholding function prior +to the actual normalization process. Put simply, the thresholding function is +going to prune all samples whose magnitude exceeds a certain threshold value. +However, the Dynamic Audio Normalizer does not simply apply a fixed threshold +value. Instead, the threshold value will be adjusted for each individual +frame. +In general, smaller parameters result in stronger compression, and vice versa. +Values below 3.0 are not recommended, because audible distortion may appear. +

+
+
threshold, t
+

Set the target threshold value. This specifies the lowest permissible +magnitude level for the audio input which will be normalized. +If input frame volume is above this value frame will be normalized. +Otherwise frame may not be normalized at all. The default value is set +to 0, which means all input frames will be normalized. +This option is mostly useful if digital noise is not wanted to be amplified. +

+
+
channels, h
+

Specify which channels to filter, by default all available channels are filtered. +

+
+
overlap, o
+

Specify overlap for frames. If set to 0 (default) no frame overlapping is done. +Using >0 and <1 values will make less conservative gain adjustments, like +when framelen option is set to smaller value, if framelen option value is +compensated for non-zero overlap then gain adjustments will be smoother across time +compared to zero overlap case. +

+
+
curve, v
+

Specify the peak mapping curve expression which is going to be used when calculating +gain applied to frames. The max output frame gain will still be limited by other +options mentioned previously for this filter. +

+

The expression can contain the following constants: +

+
+
ch
+

current channel number +

+
+
sn
+

current sample number +

+
+
nb_channels
+

number of channels +

+
+
t
+

timestamp expressed in seconds +

+
+
sr
+

sample rate +

+
+
p
+

current frame peak value +

+
+
+
+ + +
+

27.82.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.83 earwax

+ +

Make audio easier to listen to on headphones. +

+

This filter adds ‘cues’ to 44.1kHz stereo (i.e. audio CD format) audio +so that when listened to on headphones the stereo image is moved from +inside your head (standard for headphones) to outside and in front of +the listener (standard for speakers). +

+

Ported from SoX. +

+
+
+

27.84 equalizer

+ +

Apply a two-pole peaking equalisation (EQ) filter. With this +filter, the signal-level at and around a selected frequency can +be increased or decreased, whilst (unlike bandpass and bandreject +filters) that at all other frequencies is unchanged. +

+

In order to produce complex equalisation curves, this filter can +be given several times, each with a different central frequency. +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the filter’s central frequency in Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
gain, g
+

Set the required gain or attenuation in dB. +Beware of clipping when using a positive gain. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

27.84.1 Examples

+
    +
  • Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz: +
    +
    equalizer=f=1000:t=h:width=200:g=-10
    +
    + +
  • Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2: +
    +
    equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
    +
    +
+ +
+
+

27.84.2 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change equalizer frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change equalizer width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change equalizer width. +Syntax for the command is : "width" +

+
+
gain, g
+

Change equalizer gain. +Syntax for the command is : "gain" +

+
+
mix, m
+

Change equalizer mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

27.85 extrastereo

+ +

Linearly increases the difference between left and right channels which +adds some sort of "live" effect to playback. +

+

The filter accepts the following options: +

+
+
m
+

Sets the difference coefficient (default: 2.5). 0.0 means mono sound +(average of both channels), with 1.0 sound will be unchanged, with +-1.0 left and right channels will be swapped. +

+
+
c
+

Enable clipping. By default is enabled. +

+
+ + +
+

27.85.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.86 firequalizer

+

Apply FIR Equalization using arbitrary frequency response. +

+

The filter accepts the following option: +

+
+
gain
+

Set gain curve equation (in dB). The expression can contain variables: +

+
f
+

the evaluated frequency +

+
sr
+

sample rate +

+
ch
+

channel number, set to 0 when multichannels evaluation is disabled +

+
chid
+

channel id, see libavutil/channel_layout.h, set to the first channel id when +multichannels evaluation is disabled +

+
chs
+

number of channels +

+
chlayout
+

channel_layout, see libavutil/channel_layout.h +

+
+
+

and functions: +

+
gain_interpolate(f)
+

interpolate gain on frequency f based on gain_entry +

+
cubic_interpolate(f)
+

same as gain_interpolate, but smoother +

+
+

This option is also available as command. Default is gain_interpolate(f). +

+
+
gain_entry
+

Set gain entry for gain_interpolate function. The expression can +contain functions: +

+
entry(f, g)
+

store gain entry at frequency f with value g +

+
+

This option is also available as command. +

+
+
delay
+

Set filter delay in seconds. Higher value means more accurate. +Default is 0.01. +

+
+
accuracy
+

Set filter accuracy in Hz. Lower value means more accurate. +Default is 5. +

+
+
wfunc
+

Set window function. Acceptable values are: +

+
rectangular
+

rectangular window, useful when gain curve is already smooth +

+
hann
+

hann window (default) +

+
hamming
+

hamming window +

+
blackman
+

blackman window +

+
nuttall3
+

3-terms continuous 1st derivative nuttall window +

+
mnuttall3
+

minimum 3-terms discontinuous nuttall window +

+
nuttall
+

4-terms continuous 1st derivative nuttall window +

+
bnuttall
+

minimum 4-terms discontinuous nuttall (blackman-nuttall) window +

+
bharris
+

blackman-harris window +

+
tukey
+

tukey window +

+
+ +
+
fixed
+

If enabled, use fixed number of audio samples. This improves speed when +filtering with large delay. Default is disabled. +

+
+
multi
+

Enable multichannels evaluation on gain. Default is disabled. +

+
+
zero_phase
+

Enable zero phase mode by subtracting timestamp to compensate delay. +Default is disabled. +

+
+
scale
+

Set scale used by gain. Acceptable values are: +

+
linlin
+

linear frequency, linear gain +

+
linlog
+

linear frequency, logarithmic (in dB) gain (default) +

+
loglin
+

logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain +

+
loglog
+

logarithmic frequency, logarithmic gain +

+
+ +
+
dumpfile
+

Set file for dumping, suitable for gnuplot. +

+
+
dumpscale
+

Set scale for dumpfile. Acceptable values are same with scale option. +Default is linlog. +

+
+
fft2
+

Enable 2-channel convolution using complex FFT. This improves speed significantly. +Default is disabled. +

+
+
min_phase
+

Enable minimum phase impulse response. Default is disabled. +

+
+ + +
+

27.86.1 Examples

+
    +
  • lowpass at 1000 Hz: +
    +
    firequalizer=gain='if(lt(f,1000), 0, -INF)'
    +
    +
  • lowpass at 1000 Hz with gain_entry: +
    +
    firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
    +
    +
  • custom equalization: +
    +
    firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
    +
    +
  • higher delay with zero phase to compensate delay: +
    +
    firequalizer=delay=0.1:fixed=on:zero_phase=on
    +
    +
  • lowpass on left channel, highpass on right channel: +
    +
    firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
    +:gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
    +
    +
+ +
+
+
+

27.87 flanger

+

Apply a flanging effect to the audio. +

+

The filter accepts the following options: +

+
+
delay
+

Set base delay in milliseconds. Range from 0 to 30. Default value is 0. +

+
+
depth
+

Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2. +

+
+
regen
+

Set percentage regeneration (delayed signal feedback). Range from -95 to 95. +Default value is 0. +

+
+
width
+

Set percentage of delayed signal mixed with original. Range from 0 to 100. +Default value is 71. +

+
+
speed
+

Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5. +

+
+
shape
+

Set swept wave shape, can be triangular or sinusoidal. +Default value is sinusoidal. +

+
+
phase
+

Set swept wave percentage-shift for multi channel. Range from 0 to 100. +Default value is 25. +

+
+
interp
+

Set delay-line interpolation, linear or quadratic. +Default is linear. +

+
+ +
+
+

27.88 haas

+

Apply Haas effect to audio. +

+

Note that this makes most sense to apply on mono signals. +With this filter applied to mono signals it give some directionality and +stretches its stereo image. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level. By default is 1, or 0dB +

+
+
level_out
+

Set output level. By default is 1, or 0dB. +

+
+
side_gain
+

Set gain applied to side part of signal. By default is 1. +

+
+
middle_source
+

Set kind of middle source. Can be one of the following: +

+
+
left
+

Pick left channel. +

+
+
right
+

Pick right channel. +

+
+
mid
+

Pick middle part signal of stereo image. +

+
+
side
+

Pick side part signal of stereo image. +

+
+ +
+
middle_phase
+

Change middle phase. By default is disabled. +

+
+
left_delay
+

Set left channel delay. By default is 2.05 milliseconds. +

+
+
left_balance
+

Set left channel balance. By default is -1. +

+
+
left_gain
+

Set left channel gain. By default is 1. +

+
+
left_phase
+

Change left phase. By default is disabled. +

+
+
right_delay
+

Set right channel delay. By defaults is 2.12 milliseconds. +

+
+
right_balance
+

Set right channel balance. By default is 1. +

+
+
right_gain
+

Set right channel gain. By default is 1. +

+
+
right_phase
+

Change right phase. By default is enabled. +

+
+ +
+
+

27.89 hdcd

+ +

Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with +embedded HDCD codes is expanded into a 20-bit PCM stream. +

+

The filter supports the Peak Extend and Low-level Gain Adjustment features +of HDCD, and detects the Transient Filter flag. +

+
+
ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
+
+ +

When using the filter with wav, note the default encoding for wav is 16-bit, +so the resulting 20-bit stream will be truncated back to 16-bit. Use something +like -acodec pcm_s24le after the filter to get 24-bit PCM output. +

+
ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
+ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
+
+ +

The filter accepts the following options: +

+
+
disable_autoconvert
+

Disable any automatic format conversion or resampling in the filter graph. +

+
+
process_stereo
+

Process the stereo channels together. If target_gain does not match between +channels, consider it invalid and use the last valid target_gain. +

+
+
cdt_ms
+

Set the code detect timer period in ms. +

+
+
force_pe
+

Always extend peaks above -3dBFS even if PE isn’t signaled. +

+
+
analyze_mode
+

Replace audio with a solid tone and adjust the amplitude to signal some +specific aspect of the decoding process. The output file can be loaded in +an audio editor alongside the original to aid analysis. +

+

analyze_mode=pe:force_pe=true can be used to see all samples above the PE level. +

+

Modes are: +

+
0, off
+

Disabled +

+
1, lle
+

Gain adjustment level at each sample +

+
2, pe
+

Samples where peak extend occurs +

+
3, cdt
+

Samples where the code detect timer is active +

+
4, tgm
+

Samples where the target gain does not match between channels +

+
+
+
+ +
+
+

27.90 headphone

+ +

Apply head-related transfer functions (HRTFs) to create virtual +loudspeakers around the user for binaural listening via headphones. +The HRIRs are provided via additional streams, for each channel +one stereo input stream is needed. +

+

The filter accepts the following options: +

+
+
map
+

Set mapping of input streams for convolution. +The argument is a ’|’-separated list of channel names in order as they +are given as additional stream inputs for filter. +This also specify number of input streams. Number of input streams +must be not less than number of channels in first stream plus one. +

+
+
gain
+

Set gain applied to audio. Value is in dB. Default is 0. +

+
+
type
+

Set processing type. Can be time or freq. time is +processing audio in time domain which is slow. +freq is processing audio in frequency domain which is fast. +Default is freq. +

+
+
lfe
+

Set custom gain for LFE channels. Value is in dB. Default is 0. +

+
+
size
+

Set size of frame in number of samples which will be processed at once. +Default value is 1024. Allowed range is from 1024 to 96000. +

+
+
hrir
+

Set format of hrir stream. +Default value is stereo. Alternative value is multich. +If value is set to stereo, number of additional streams should +be greater or equal to number of input channels in first input stream. +Also each additional stream should have stereo number of channels. +If value is set to multich, number of additional streams should +be exactly one. Also number of input channels of additional stream +should be equal or greater than twice number of channels of first input +stream. +

+
+ + +
+

27.90.1 Examples

+ +
    +
  • Full example using wav files as coefficients with amovie filters for 7.1 downmix, +each amovie filter use stereo file with IR coefficients as input. +The files give coefficients for each position of virtual loudspeaker: +
    +
    ffmpeg -i input.wav
    +-filter_complex "amovie=azi_270_ele_0_DFC.wav[sr];amovie=azi_90_ele_0_DFC.wav[sl];amovie=azi_225_ele_0_DFC.wav[br];amovie=azi_135_ele_0_DFC.wav[bl];amovie=azi_0_ele_0_DFC.wav,asplit[fc][lfe];amovie=azi_35_ele_0_DFC.wav[fl];amovie=azi_325_ele_0_DFC.wav[fr];[0:a][fl][fr][fc][lfe][bl][br][sl][sr]headphone=FL|FR|FC|LFE|BL|BR|SL|SR"
    +output.wav
    +
    + +
  • Full example using wav files as coefficients with amovie filters for 7.1 downmix, +but now in multich hrir format. +
    +
    ffmpeg -i input.wav -filter_complex "amovie=minp.wav[hrirs];[0:a][hrirs]headphone=map=FL|FR|FC|LFE|BL|BR|SL|SR:hrir=multich"
    +output.wav
    +
    +
+ +
+
+
+

27.91 highpass

+ +

Apply a high-pass filter with 3dB point frequency. +The filter can be either single-pole, or double-pole (the default). +The filter roll off at 6dB per pole per octave (20dB per pole per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set frequency in Hz. Default is 3000. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +Applies only to double-pole filter. +The default is 0.707q and gives a Butterworth response. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

27.91.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change highpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change highpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change highpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change highpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

27.92 join

+ +

Join multiple input streams into one multi-channel stream. +

+

It accepts the following parameters: +

+
inputs
+

The number of input streams. It defaults to 2. +

+
+
channel_layout
+

The desired output channel layout. It defaults to stereo. +

+
+
map
+

Map channels from inputs to output. The argument is a ’|’-separated list of +mappings, each in the input_idx.in_channel-out_channel +form. input_idx is the 0-based index of the input stream. in_channel +can be either the name of the input channel (e.g. FL for front left) or its +index in the specified input stream. out_channel is the name of the output +channel. +

+
+ +

The filter will attempt to guess the mappings when they are not specified +explicitly. It does so by first trying to find an unused matching input channel +and if that fails it picks the first unused input channel. +

+

Join 3 inputs (with properly set channel layouts): +

+
ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
+
+ +

Build a 5.1 output from 6 single-channel streams: +

+
ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
+'join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-SL|4.0-SR|5.0-LFE'
+out
+
+ +
+
+

27.93 ladspa

+ +

Load a LADSPA (Linux Audio Developer’s Simple Plugin API) plugin. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-ladspa. +

+
+
file, f
+

Specifies the name of LADSPA plugin library to load. If the environment +variable LADSPA_PATH is defined, the LADSPA plugin is searched in +each one of the directories specified by the colon separated list in +LADSPA_PATH, otherwise in the standard LADSPA paths, which are in +this order: HOME/.ladspa/lib/, /usr/local/lib/ladspa/, +/usr/lib/ladspa/. +

+
+
plugin, p
+

Specifies the plugin within the library. Some libraries contain only +one plugin, but others contain many of them. If this is not set filter +will list all available plugins within the specified library. +

+
+
controls, c
+

Set the ’|’ separated list of controls which are zero or more floating point +values that determine the behavior of the loaded plugin (for example delay, +threshold or gain). +Controls need to be defined using the following syntax: +c0=value0|c1=value1|c2=value2|..., where +valuei is the value set on the i-th control. +Alternatively they can be also defined using the following syntax: +value0|value1|value2|..., where +valuei is the value set on the i-th control. +If controls is set to help, all available controls and +their valid ranges are printed. +

+
+
sample_rate, s
+

Specify the sample rate, default to 44100. Only used if plugin have +zero inputs. +

+
+
nb_samples, n
+

Set the number of samples per channel per each output frame, default +is 1024. Only used if plugin have zero inputs. +

+
+
duration, d
+

Set the minimum duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +Note that the resulting duration may be greater than the specified duration, +as the generated audio is always cut at the end of a complete frame. +If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +Only used if plugin have zero inputs. +

+
+
latency, l
+

Enable latency compensation, by default is disabled. +Only used if plugin have inputs. +

+
+ + +
+

27.93.1 Examples

+ +
    +
  • List all available plugins within amp (LADSPA example plugin) library: +
    +
    ladspa=file=amp
    +
    + +
  • List all available controls and their valid ranges for vcf_notch +plugin from VCF library: +
    +
    ladspa=f=vcf:p=vcf_notch:c=help
    +
    + +
  • Simulate low quality audio equipment using Computer Music Toolkit (CMT) +plugin library: +
    +
    ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
    +
    + +
  • Add reverberation to the audio using TAP-plugins +(Tom’s Audio Processing plugins): +
    +
    ladspa=file=tap_reverb:tap_reverb
    +
    + +
  • Generate white noise, with 0.2 amplitude: +
    +
    ladspa=file=cmt:noise_source_white:c=c0=.2
    +
    + +
  • Generate 20 bpm clicks using plugin C* Click - Metronome from the +C* Audio Plugin Suite (CAPS) library: +
    +
    ladspa=file=caps:Click:c=c1=20'
    +
    + +
  • Apply C* Eq10X2 - Stereo 10-band equaliser effect: +
    +
    ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
    +
    + +
  • Increase volume by 20dB using fast lookahead limiter from Steve Harris +SWH Plugins collection: +
    +
    ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
    +
    + +
  • Attenuate low frequencies using Multiband EQ from Steve Harris +SWH Plugins collection: +
    +
    ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
    +
    + +
  • Reduce stereo image using Narrower from the C* Audio Plugin Suite +(CAPS) library: +
    +
    ladspa=caps:Narrower
    +
    + +
  • Another white noise, now using C* Audio Plugin Suite (CAPS) library: +
    +
    ladspa=caps:White:.2
    +
    + +
  • Some fractal noise, using C* Audio Plugin Suite (CAPS) library: +
    +
    ladspa=caps:Fractal:c=c1=1
    +
    + +
  • Dynamic volume normalization using VLevel plugin: +
    +
    ladspa=vlevel-ladspa:vlevel_mono
    +
    +
+ +
+
+

27.93.2 Commands

+ +

This filter supports the following commands: +

+
cN
+

Modify the N-th control value. +

+

If the specified value is not valid, it is ignored and prior one is kept. +

+
+ +
+
+
+

27.94 loudnorm

+ +

EBU R128 loudness normalization. Includes both dynamic and linear normalization modes. +Support for both single pass (livestreams, files) and double pass (files) modes. +This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately +detect true peaks, the audio stream will be upsampled to 192 kHz. +Use the -ar option or aresample filter to explicitly set an output sample rate. +

+

The filter accepts the following options: +

+
+
I, i
+

Set integrated loudness target. +Range is -70.0 - -5.0. Default value is -24.0. +

+
+
LRA, lra
+

Set loudness range target. +Range is 1.0 - 50.0. Default value is 7.0. +

+
+
TP, tp
+

Set maximum true peak. +Range is -9.0 - +0.0. Default value is -2.0. +

+
+
measured_I, measured_i
+

Measured IL of input file. +Range is -99.0 - +0.0. +

+
+
measured_LRA, measured_lra
+

Measured LRA of input file. +Range is 0.0 - 99.0. +

+
+
measured_TP, measured_tp
+

Measured true peak of input file. +Range is -99.0 - +99.0. +

+
+
measured_thresh
+

Measured threshold of input file. +Range is -99.0 - +0.0. +

+
+
offset
+

Set offset gain. Gain is applied before the true-peak limiter. +Range is -99.0 - +99.0. Default is +0.0. +

+
+
linear
+

Normalize by linearly scaling the source audio. +measured_I, measured_LRA, measured_TP, +and measured_thresh must all be specified. Target LRA shouldn’t +be lower than source LRA and the change in integrated loudness shouldn’t +result in a true peak which exceeds the target TP. If any of these +conditions aren’t met, normalization mode will revert to dynamic. +Options are true or false. Default is true. +

+
+
dual_mono
+

Treat mono input files as "dual-mono". If a mono file is intended for playback +on a stereo system, its EBU R128 measurement will be perceptually incorrect. +If set to true, this option will compensate for this effect. +Multi-channel input files are not affected by this option. +Options are true or false. Default is false. +

+
+
print_format
+

Set print format for stats. Options are summary, json, or none. +Default value is none. +

+
+ +
+
+

27.95 lowpass

+ +

Apply a low-pass filter with 3dB point frequency. +The filter can be either single-pole or double-pole (the default). +The filter roll off at 6dB per pole per octave (20dB per pole per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set frequency in Hz. Default is 500. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +Applies only to double-pole filter. +The default is 0.707q and gives a Butterworth response. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

27.95.1 Examples

+
    +
  • Lowpass only LFE channel, it LFE is not present it does nothing: +
    +
    lowpass=c=LFE
    +
    +
+ +
+
+

27.95.2 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change lowpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change lowpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change lowpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change lowpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

27.96 lv2

+ +

Load a LV2 (LADSPA Version 2) plugin. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-lv2. +

+
+
plugin, p
+

Specifies the plugin URI. You may need to escape ’:’. +

+
+
controls, c
+

Set the ’|’ separated list of controls which are zero or more floating point +values that determine the behavior of the loaded plugin (for example delay, +threshold or gain). +If controls is set to help, all available controls and +their valid ranges are printed. +

+
+
sample_rate, s
+

Specify the sample rate, default to 44100. Only used if plugin have +zero inputs. +

+
+
nb_samples, n
+

Set the number of samples per channel per each output frame, default +is 1024. Only used if plugin have zero inputs. +

+
+
duration, d
+

Set the minimum duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +Note that the resulting duration may be greater than the specified duration, +as the generated audio is always cut at the end of a complete frame. +If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +Only used if plugin have zero inputs. +

+
+ + +
+

27.96.1 Examples

+ +
    +
  • Apply bass enhancer plugin from Calf: +
    +
    lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
    +
    + +
  • Apply vinyl plugin from Calf: +
    +
    lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
    +
    + +
  • Apply bit crusher plugin from ArtyFX: +
    +
    lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
    +
    +
+ +
+
+

27.96.2 Commands

+ +

This filter supports all options that are exported by plugin as commands. +

+
+
+
+

27.97 mcompand

+

Multiband Compress or expand the audio’s dynamic range. +

+

The input audio is divided into bands using 4th order Linkwitz-Riley IIRs. +This is akin to the crossover of a loudspeaker, and results in flat frequency +response when absent compander action. +

+

It accepts the following parameters: +

+
+
args
+

This option syntax is: +attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ... +For explanation of each item refer to compand filter documentation. +

+
+ +
+
+

27.98 pan

+ +

Mix channels with specific gain levels. The filter accepts the output +channel layout followed by a set of channels definitions. +

+

This filter is also designed to efficiently remap the channels of an audio +stream. +

+

The filter accepts parameters of the form: +"l|outdef|outdef|..." +

+
+
l
+

output channel layout or number of channels +

+
+
outdef
+

output channel specification, of the form: +"out_name=[gain*]in_name[(+-)[gain*]in_name...]" +

+
+
out_name
+

output channel to define, either a channel name (FL, FR, etc.) or a channel +number (c0, c1, etc.) +

+
+
gain
+

multiplicative coefficient for the channel, 1 leaving the volume unchanged +

+
+
in_name
+

input channel to use, see out_name for details; it is not possible to mix +named and numbered input channels +

+
+ +

If the ‘=’ in a channel specification is replaced by ‘<’, then the gains for +that specification will be renormalized so that the total is 1, thus +avoiding clipping noise. +

+ +
+

27.98.1 Mixing examples

+ +

For example, if you want to down-mix from stereo to mono, but with a bigger +factor for the left channel: +

+
pan=1c|c0=0.9*c0+0.1*c1
+
+ +

A customized down-mix to stereo that works automatically for 3-, 4-, 5- and +7-channels surround: +

+
pan=stereo| FL < FL + 0.5*FC + 0.6*BL + 0.6*SL | FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
+
+ +

Note that ffmpeg integrates a default down-mix (and up-mix) system +that should be preferred (see "-ac" option) unless you have very specific +needs. +

+
+
+

27.98.2 Remapping examples

+ +

The channel remapping will be effective if, and only if: +

+
    +
  • gain coefficients are zeroes or ones, +
  • only one input per channel output, +
+ +

If all these conditions are satisfied, the filter will notify the user ("Pure +channel mapping detected"), and use an optimized and lossless method to do the +remapping. +

+

For example, if you have a 5.1 source and want a stereo audio stream by +dropping the extra channels: +

+
pan="stereo| c0=FL | c1=FR"
+
+ +

Given the same source, you can also switch front left and front right channels +and keep the input channel layout: +

+
pan="5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5"
+
+ +

If the input is a stereo audio stream, you can mute the front left channel (and +still keep the stereo channel layout) with: +

+
pan="stereo|c1=c1"
+
+ +

Still with a stereo audio stream input, you can copy the right channel in both +front left and right: +

+
pan="stereo| c0=FR | c1=FR"
+
+ +
+
+
+

27.99 replaygain

+ +

ReplayGain scanner filter. This filter takes an audio stream as an input and +outputs it unchanged. +At end of filtering it displays track_gain and track_peak. +

+

The filter accepts the following exported read-only options: +

+
+
track_gain
+

Exported track gain in dB at end of stream. +

+
+
track_peak
+

Exported track peak at end of stream. +

+
+ +
+
+

27.100 resample

+ +

Convert the audio sample format, sample rate and channel layout. It is +not meant to be used directly. +

+
+
+

27.101 rubberband

+

Apply time-stretching and pitch-shifting with librubberband. +

+

To enable compilation of this filter, you need to configure FFmpeg with +--enable-librubberband. +

+

The filter accepts the following options: +

+
+
tempo
+

Set tempo scale factor. +

+
+
pitch
+

Set pitch scale factor. +

+
+
transients
+

Set transients detector. +Possible values are: +

+
crisp
+
mixed
+
smooth
+
+ +
+
detector
+

Set detector. +Possible values are: +

+
compound
+
percussive
+
soft
+
+ +
+
phase
+

Set phase. +Possible values are: +

+
laminar
+
independent
+
+ +
+
window
+

Set processing window size. +Possible values are: +

+
standard
+
short
+
long
+
+ +
+
smoothing
+

Set smoothing. +Possible values are: +

+
off
+
on
+
+ +
+
formant
+

Enable formant preservation when shift pitching. +Possible values are: +

+
shifted
+
preserved
+
+ +
+
pitchq
+

Set pitch quality. +Possible values are: +

+
quality
+
speed
+
consistency
+
+ +
+
channels
+

Set channels. +Possible values are: +

+
apart
+
together
+
+
+
+ + +
+

27.101.1 Commands

+ +

This filter supports the following commands: +

+
tempo
+

Change filter tempo scale factor. +Syntax for the command is : "tempo" +

+
+
pitch
+

Change filter pitch scale factor. +Syntax for the command is : "pitch" +

+
+ +
+
+
+

27.102 sidechaincompress

+ +

This filter acts like normal compressor but has the ability to compress +detected signal using second input signal. +It needs two input streams and returns one output stream. +First input stream will be processed depending on second stream signal. +The filtered signal then can be filtered with other filters in later stages of +processing. See pan and amerge filter. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. Default is 1. Range is between 0.015625 and 64. +

+
+
mode
+

Set mode of compressor operation. Can be upward or downward. +Default is downward. +

+
+
threshold
+

If a signal of second stream raises above this level it will affect the gain +reduction of first stream. +By default is 0.125. Range is between 0.00097563 and 1. +

+
+
ratio
+

Set a ratio about which the signal is reduced. 1:2 means that if the level +raised 4dB above the threshold, it will be only 2dB above after the reduction. +Default is 2. Range is between 1 and 20. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction starts. Default is 20. Range is between 0.01 and 2000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before +reduction is decreased again. Default is 250. Range is between 0.01 and 9000. +

+
+
makeup
+

Set the amount by how much signal will be amplified after processing. +Default is 1. Range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.82843. Range is between 1 and 8. +

+
+
link
+

Choose if the average level between all channels of side-chain stream +or the louder(maximum) channel of side-chain stream affects the +reduction. Default is average. +

+
+
detection
+

Should the exact signal be taken in case of peak or an RMS one in case +of rms. Default is rms which is mainly smoother. +

+
+
level_sc
+

Set sidechain gain. Default is 1. Range is between 0.015625 and 64. +

+
+
mix
+

How much to use compressed signal in output. Default is 1. +Range is between 0 and 1. +

+
+ + +
+

27.102.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

27.102.2 Examples

+ +
    +
  • Full ffmpeg example taking 2 audio inputs, 1st input to be compressed +depending on the signal of 2nd input and later compressed signal to be +merged with 2nd input: +
    +
    ffmpeg -i main.flac -i sidechain.flac -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge"
    +
    +
+ +
+
+
+

27.103 sidechaingate

+ +

A sidechain gate acts like a normal (wideband) gate but has the ability to +filter the detected signal before sending it to the gain reduction stage. +Normally a gate uses the full range signal to detect a level above the +threshold. +For example: If you cut all lower frequencies from your sidechain signal +the gate will decrease the volume of your track only if not enough highs +appear. With this technique you are able to reduce the resonation of a +natural drum or remove "rumbling" of muted strokes from a heavily distorted +guitar. +It needs two input streams and returns one output stream. +First input stream will be processed depending on second stream signal. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level before filtering. +Default is 1. Allowed range is from 0.015625 to 64. +

+
+
mode
+

Set the mode of operation. Can be upward or downward. +Default is downward. If set to upward mode, higher parts of signal +will be amplified, expanding dynamic range in upward direction. +Otherwise, in case of downward lower parts of signal will be reduced. +

+
+
range
+

Set the level of gain reduction when the signal is below the threshold. +Default is 0.06125. Allowed range is from 0 to 1. +Setting this to 0 disables reduction and then filter behaves like expander. +

+
+
threshold
+

If a signal rises above this level the gain reduction is released. +Default is 0.125. Allowed range is from 0 to 1. +

+
+
ratio
+

Set a ratio about which the signal is reduced. +Default is 2. Allowed range is from 1 to 9000. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction stops. +Default is 20 milliseconds. Allowed range is from 0.01 to 9000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before the +reduction is increased again. Default is 250 milliseconds. +Allowed range is from 0.01 to 9000. +

+
+
makeup
+

Set amount of amplification of signal after processing. +Default is 1. Allowed range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.828427125. Allowed range is from 1 to 8. +

+
+
detection
+

Choose if exact signal should be taken for detection or an RMS like one. +Default is rms. Can be peak or rms. +

+
+
link
+

Choose if the average level between all channels or the louder channel affects +the reduction. +Default is average. Can be average or maximum. +

+
+
level_sc
+

Set sidechain gain. Default is 1. Range is from 0.015625 to 64. +

+
+ + +
+

27.103.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

27.104 silencedetect

+ +

Detect silence in an audio stream. +

+

This filter logs a message when it detects that the input audio volume is less +or equal to a noise tolerance value for a duration greater or equal to the +minimum detected noise duration. +

+

The printed times and duration are expressed in seconds. The +lavfi.silence_start or lavfi.silence_start.X metadata key +is set on the first frame whose timestamp equals or exceeds the detection +duration and it contains the timestamp of the first frame of the silence. +

+

The lavfi.silence_duration or lavfi.silence_duration.X +and lavfi.silence_end or lavfi.silence_end.X metadata +keys are set on the first frame after the silence. If mono is +enabled, and each channel is evaluated separately, the .X +suffixed keys are used, and X corresponds to the channel number. +

+

The filter accepts the following options: +

+
+
noise, n
+

Set noise tolerance. Can be specified in dB (in case "dB" is appended to the +specified value) or amplitude ratio. Default is -60dB, or 0.001. +

+
+
duration, d
+

Set silence duration until notification (default is 2 seconds). See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+
+
mono, m
+

Process each channel separately, instead of combined. By default is disabled. +

+
+ + +
+

27.104.1 Examples

+ +
    +
  • Detect 5 seconds of silence with -50dB noise tolerance: +
    +
    silencedetect=n=-50dB:d=5
    +
    + +
  • Complete example with ffmpeg to detect silence with 0.0001 noise +tolerance in silence.mp3: +
    +
    ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
    +
    +
+ +
+
+
+

27.105 silenceremove

+ +

Remove silence from the beginning, middle or end of the audio. +

+

The filter accepts the following options: +

+
+
start_periods
+

This value is used to indicate if audio should be trimmed at beginning of +the audio. A value of zero indicates no silence should be trimmed from the +beginning. When specifying a non-zero value, it trims audio up until it +finds non-silence. Normally, when trimming silence from beginning of audio +the start_periods will be 1 but it can be increased to higher +values to trim all audio up to specific count of non-silence periods. +Default value is 0. +

+
+
start_duration
+

Specify the amount of time that non-silence must be detected before it stops +trimming audio. By increasing the duration, bursts of noises can be treated +as silence and trimmed off. Default value is 0. +

+
+
start_threshold
+

This indicates what sample value should be treated as silence. For digital +audio, a value of 0 may be fine but for audio recorded from analog, +you may wish to increase the value to account for background noise. +Can be specified in dB (in case "dB" is appended to the specified value) +or amplitude ratio. Default value is 0. +

+
+
start_silence
+

Specify max duration of silence at beginning that will be kept after +trimming. Default is 0, which is equal to trimming all samples detected +as silence. +

+
+
start_mode
+

Specify mode of detection of silence end in start of multi-channel audio. +Can be any or all. Default is any. +With any, any sample that is detected as non-silence will cause +stopped trimming of silence. +With all, only if all channels are detected as non-silence will cause +stopped trimming of silence. +

+
+
stop_periods
+

Set the count for trimming silence from the end of audio. +To remove silence from the middle of a file, specify a stop_periods +that is negative. This value is then treated as a positive value and is +used to indicate the effect should restart processing as specified by +start_periods, making it suitable for removing periods of silence +in the middle of the audio. +Default value is 0. +

+
+
stop_duration
+

Specify a duration of silence that must exist before audio is not copied any +more. By specifying a higher duration, silence that is wanted can be left in +the audio. +Default value is 0. +

+
+
stop_threshold
+

This is the same as start_threshold but for trimming silence from +the end of audio. +Can be specified in dB (in case "dB" is appended to the specified value) +or amplitude ratio. Default value is 0. +

+
+
stop_silence
+

Specify max duration of silence at end that will be kept after +trimming. Default is 0, which is equal to trimming all samples detected +as silence. +

+
+
stop_mode
+

Specify mode of detection of silence start in end of multi-channel audio. +Can be any or all. Default is any. +With any, any sample that is detected as non-silence will cause +stopped trimming of silence. +With all, only if all channels are detected as non-silence will cause +stopped trimming of silence. +

+
+
detection
+

Set how is silence detected. Can be rms or peak. Second is faster +and works better with digital silence which is exactly 0. +Default value is rms. +

+
+
window
+

Set duration in number of seconds used to calculate size of window in number +of samples for detecting silence. +Default value is 0.02. Allowed range is from 0 to 10. +

+
+ + +
+

27.105.1 Examples

+ +
    +
  • The following example shows how this filter can be used to start a recording +that does not contain the delay at the start which usually occurs between +pressing the record button and the start of the performance: +
    +
    silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
    +
    + +
  • Trim all silence encountered from beginning to end where there is more than 1 +second of silence in audio: +
    +
    silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
    +
    + +
  • Trim all digital silence samples, using peak detection, from beginning to end +where there is more than 0 samples of digital silence in audio and digital +silence is detected in all channels at same positions in stream: +
    +
    silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
    +
    +
+ +
+
+
+

27.106 sofalizer

+ +

SOFAlizer uses head-related transfer functions (HRTFs) to create virtual +loudspeakers around the user for binaural listening via headphones (audio +formats up to 9 channels supported). +The HRTFs are stored in SOFA files (see http://www.sofacoustics.org/ for a database). +SOFAlizer is developed at the Acoustics Research Institute (ARI) of the +Austrian Academy of Sciences. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libmysofa. +

+

The filter accepts the following options: +

+
+
sofa
+

Set the SOFA file used for rendering. +

+
+
gain
+

Set gain applied to audio. Value is in dB. Default is 0. +

+
+
rotation
+

Set rotation of virtual loudspeakers in deg. Default is 0. +

+
+
elevation
+

Set elevation of virtual speakers in deg. Default is 0. +

+
+
radius
+

Set distance in meters between loudspeakers and the listener with near-field +HRTFs. Default is 1. +

+
+
type
+

Set processing type. Can be time or freq. time is +processing audio in time domain which is slow. +freq is processing audio in frequency domain which is fast. +Default is freq. +

+
+
speakers
+

Set custom positions of virtual loudspeakers. Syntax for this option is: +<CH> <AZIM> <ELEV>[|<CH> <AZIM> <ELEV>|...]. +Each virtual loudspeaker is described with short channel name following with +azimuth and elevation in degrees. +Each virtual loudspeaker description is separated by ’|’. +For example to override front left and front right channel positions use: +’speakers=FL 45 15|FR 345 15’. +Descriptions with unrecognised channel names are ignored. +

+
+
lfegain
+

Set custom gain for LFE channels. Value is in dB. Default is 0. +

+
+
framesize
+

Set custom frame size in number of samples. Default is 1024. +Allowed range is from 1024 to 96000. Only used if option ‘type’ +is set to freq. +

+
+
normalize
+

Should all IRs be normalized upon importing SOFA file. +By default is enabled. +

+
+
interpolate
+

Should nearest IRs be interpolated with neighbor IRs if exact position +does not match. By default is disabled. +

+
+
minphase
+

Minphase all IRs upon loading of SOFA file. By default is disabled. +

+
+
anglestep
+

Set neighbor search angle step. Only used if option interpolate is enabled. +

+
+
radstep
+

Set neighbor search radius step. Only used if option interpolate is enabled. +

+
+ + +
+

27.106.1 Examples

+ +
    +
  • Using ClubFritz6 sofa file: +
    +
    sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
    +
    + +
  • Using ClubFritz12 sofa file and bigger radius with small rotation: +
    +
    sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
    +
    + +
  • Similar as above but with custom speaker positions for front left, front right, back left and back right +and also with custom gain: +
    +
    "sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|BL 135|BR 225:gain=28"
    +
    +
+ +
+
+
+

27.107 speechnorm

+

Speech Normalizer. +

+

This filter expands or compresses each half-cycle of audio samples +(local set of samples all above or all below zero and between two nearest zero crossings) depending +on threshold value, so audio reaches target peak value under conditions controlled by below options. +

+

The filter accepts the following options: +

+
+
peak, p
+

Set the expansion target peak value. This specifies the highest allowed absolute amplitude +level for the normalized audio input. Default value is 0.95. Allowed range is from 0.0 to 1.0. +

+
+
expansion, e
+

Set the maximum expansion factor. Allowed range is from 1.0 to 50.0. Default value is 2.0. +This option controls maximum local half-cycle of samples expansion. The maximum expansion +would be such that local peak value reaches target peak value but never to surpass it and that +ratio between new and previous peak value does not surpass this option value. +

+
+
compression, c
+

Set the maximum compression factor. Allowed range is from 1.0 to 50.0. Default value is 2.0. +This option controls maximum local half-cycle of samples compression. This option is used +only if threshold option is set to value greater than 0.0, then in such cases +when local peak is lower or same as value set by threshold all samples belonging to +that peak’s half-cycle will be compressed by current compression factor. +

+
+
threshold, t
+

Set the threshold value. Default value is 0.0. Allowed range is from 0.0 to 1.0. +This option specifies which half-cycles of samples will be compressed and which will be expanded. +Any half-cycle samples with their local peak value below or same as this option value will be +compressed by current compression factor, otherwise, if greater than threshold value they will be +expanded with expansion factor so that it could reach peak target value but never surpass it. +

+
+
raise, r
+

Set the expansion raising amount per each half-cycle of samples. Default value is 0.001. +Allowed range is from 0.0 to 1.0. This controls how fast expansion factor is raised per +each new half-cycle until it reaches expansion value. +Setting this options too high may lead to distortions. +

+
+
fall, f
+

Set the compression raising amount per each half-cycle of samples. Default value is 0.001. +Allowed range is from 0.0 to 1.0. This controls how fast compression factor is raised per +each new half-cycle until it reaches compression value. +

+
+
channels, h
+

Specify which channels to filter, by default all available channels are filtered. +

+
+
invert, i
+

Enable inverted filtering, by default is disabled. This inverts interpretation of threshold +option. When enabled any half-cycle of samples with their local peak value below or same as +threshold option will be expanded otherwise it will be compressed. +

+
+
link, l
+

Link channels when calculating gain applied to each filtered channel sample, by default is disabled. +When disabled each filtered channel gain calculation is independent, otherwise when this option +is enabled the minimum of all possible gains for each filtered channel is used. +

+
+
rms, m
+

Set the expansion target RMS value. This specifies the highest allowed RMS level for the normalized +audio input. Default value is 0.0, thus disabled. Allowed range is from 0.0 to 1.0. +

+
+ + +
+

27.107.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

27.107.2 Examples

+ +
    +
  • Weak and slow amplification: +
    +
    speechnorm=e=3:r=0.00001:l=1
    +
    + +
  • Moderate and slow amplification: +
    +
    speechnorm=e=6.25:r=0.00001:l=1
    +
    + +
  • Strong and fast amplification: +
    +
    speechnorm=e=12.5:r=0.0001:l=1
    +
    + +
  • Very strong and fast amplification: +
    +
    speechnorm=e=25:r=0.0001:l=1
    +
    + +
  • Extreme and fast amplification: +
    +
    speechnorm=e=50:r=0.0001:l=1
    +
    +
+ +
+
+
+

27.108 stereotools

+ +

This filter has some handy utilities to manage stereo signals, for converting +M/S stereo recordings to L/R signal while having control over the parameters +or spreading the stereo image of master track. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level before filtering for both channels. Defaults is 1. +Allowed range is from 0.015625 to 64. +

+
+
level_out
+

Set output level after filtering for both channels. Defaults is 1. +Allowed range is from 0.015625 to 64. +

+
+
balance_in
+

Set input balance between both channels. Default is 0. +Allowed range is from -1 to 1. +

+
+
balance_out
+

Set output balance between both channels. Default is 0. +Allowed range is from -1 to 1. +

+
+
softclip
+

Enable softclipping. Results in analog distortion instead of harsh digital 0dB +clipping. Disabled by default. +

+
+
mutel
+

Mute the left channel. Disabled by default. +

+
+
muter
+

Mute the right channel. Disabled by default. +

+
+
phasel
+

Change the phase of the left channel. Disabled by default. +

+
+
phaser
+

Change the phase of the right channel. Disabled by default. +

+
+
mode
+

Set stereo mode. Available values are: +

+
+
lr>lr
+

Left/Right to Left/Right, this is default. +

+
+
lr>ms
+

Left/Right to Mid/Side. +

+
+
ms>lr
+

Mid/Side to Left/Right. +

+
+
lr>ll
+

Left/Right to Left/Left. +

+
+
lr>rr
+

Left/Right to Right/Right. +

+
+
lr>l+r
+

Left/Right to Left + Right. +

+
+
lr>rl
+

Left/Right to Right/Left. +

+
+
ms>ll
+

Mid/Side to Left/Left. +

+
+
ms>rr
+

Mid/Side to Right/Right. +

+
+
ms>rl
+

Mid/Side to Right/Left. +

+
+
lr>l-r
+

Left/Right to Left - Right. +

+
+ +
+
slev
+

Set level of side signal. Default is 1. +Allowed range is from 0.015625 to 64. +

+
+
sbal
+

Set balance of side signal. Default is 0. +Allowed range is from -1 to 1. +

+
+
mlev
+

Set level of the middle signal. Default is 1. +Allowed range is from 0.015625 to 64. +

+
+
mpan
+

Set middle signal pan. Default is 0. Allowed range is from -1 to 1. +

+
+
base
+

Set stereo base between mono and inversed channels. Default is 0. +Allowed range is from -1 to 1. +

+
+
delay
+

Set delay in milliseconds how much to delay left from right channel and +vice versa. Default is 0. Allowed range is from -20 to 20. +

+
+
sclevel
+

Set S/C level. Default is 1. Allowed range is from 1 to 100. +

+
+
phase
+

Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360. +

+
+
bmode_in, bmode_out
+

Set balance mode for balance_in/balance_out option. +

+

Can be one of the following: +

+
+
balance
+

Classic balance mode. Attenuate one channel at time. +Gain is raised up to 1. +

+
+
amplitude
+

Similar as classic mode above but gain is raised up to 2. +

+
+
power
+

Equal power distribution, from -6dB to +6dB range. +

+
+
+
+ + +
+

27.108.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

27.108.2 Examples

+ +
    +
  • Apply karaoke like effect: +
    +
    stereotools=mlev=0.015625
    +
    + +
  • Convert M/S signal to L/R: +
    +
    "stereotools=mode=ms>lr"
    +
    +
+ +
+
+
+

27.109 stereowiden

+ +

This filter enhance the stereo effect by suppressing signal common to both +channels and by delaying the signal of left into right and vice versa, +thereby widening the stereo effect. +

+

The filter accepts the following options: +

+
+
delay
+

Time in milliseconds of the delay of left signal into right and vice versa. +Default is 20 milliseconds. +

+
+
feedback
+

Amount of gain in delayed signal into right and vice versa. Gives a delay +effect of left signal in right output and vice versa which gives widening +effect. Default is 0.3. +

+
+
crossfeed
+

Cross feed of left into right with inverted phase. This helps in suppressing +the mono. If the value is 1 it will cancel all the signal common to both +channels. Default is 0.3. +

+
+
drymix
+

Set level of input signal of original channel. Default is 0.8. +

+
+ + +
+

27.109.1 Commands

+ +

This filter supports the all above options except delay as commands. +

+
+
+
+

27.110 superequalizer

+

Apply 18 band equalizer. +

+

The filter accepts the following options: +

+
1b
+

Set 65Hz band gain. +

+
2b
+

Set 92Hz band gain. +

+
3b
+

Set 131Hz band gain. +

+
4b
+

Set 185Hz band gain. +

+
5b
+

Set 262Hz band gain. +

+
6b
+

Set 370Hz band gain. +

+
7b
+

Set 523Hz band gain. +

+
8b
+

Set 740Hz band gain. +

+
9b
+

Set 1047Hz band gain. +

+
10b
+

Set 1480Hz band gain. +

+
11b
+

Set 2093Hz band gain. +

+
12b
+

Set 2960Hz band gain. +

+
13b
+

Set 4186Hz band gain. +

+
14b
+

Set 5920Hz band gain. +

+
15b
+

Set 8372Hz band gain. +

+
16b
+

Set 11840Hz band gain. +

+
17b
+

Set 16744Hz band gain. +

+
18b
+

Set 20000Hz band gain. +

+
+ +
+
+

27.111 surround

+

Apply audio surround upmix filter. +

+

This filter allows to produce multichannel output from audio stream. +

+

The filter accepts the following options: +

+
+
chl_out
+

Set output channel layout. By default, this is 5.1. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+
chl_in
+

Set input channel layout. By default, this is stereo. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+
level_in
+

Set input volume level. By default, this is 1. +

+
+
level_out
+

Set output volume level. By default, this is 1. +

+
+
lfe
+

Enable LFE channel output if output channel layout has it. By default, this is enabled. +

+
+
lfe_low
+

Set LFE low cut off frequency. By default, this is 128 Hz. +

+
+
lfe_high
+

Set LFE high cut off frequency. By default, this is 256 Hz. +

+
+
lfe_mode
+

Set LFE mode, can be add or sub. Default is add. +In add mode, LFE channel is created from input audio and added to output. +In sub mode, LFE channel is created from input audio and added to output but +also all non-LFE output channels are subtracted with output LFE channel. +

+
+
smooth
+

Set temporal smoothness strength, used to gradually change factors when transforming +stereo sound in time. Allowed range is from 0.0 to 1.0. +Useful to improve output quality with focus option values greater than 0.0. +Default is 0.0. Only values inside this range and without edges are effective. +

+
+
angle
+

Set angle of stereo surround transform, Allowed range is from 0 to 360. +Default is 90. +

+
+
focus
+

Set focus of stereo surround transform, Allowed range is from -1 to 1. +Default is 0. +

+
+
fc_in
+

Set front center input volume. By default, this is 1. +

+
+
fc_out
+

Set front center output volume. By default, this is 1. +

+
+
fl_in
+

Set front left input volume. By default, this is 1. +

+
+
fl_out
+

Set front left output volume. By default, this is 1. +

+
+
fr_in
+

Set front right input volume. By default, this is 1. +

+
+
fr_out
+

Set front right output volume. By default, this is 1. +

+
+
sl_in
+

Set side left input volume. By default, this is 1. +

+
+
sl_out
+

Set side left output volume. By default, this is 1. +

+
+
sr_in
+

Set side right input volume. By default, this is 1. +

+
+
sr_out
+

Set side right output volume. By default, this is 1. +

+
+
bl_in
+

Set back left input volume. By default, this is 1. +

+
+
bl_out
+

Set back left output volume. By default, this is 1. +

+
+
br_in
+

Set back right input volume. By default, this is 1. +

+
+
br_out
+

Set back right output volume. By default, this is 1. +

+
+
bc_in
+

Set back center input volume. By default, this is 1. +

+
+
bc_out
+

Set back center output volume. By default, this is 1. +

+
+
lfe_in
+

Set LFE input volume. By default, this is 1. +

+
+
lfe_out
+

Set LFE output volume. By default, this is 1. +

+
+
allx
+

Set spread usage of stereo image across X axis for all channels. +Allowed range is from -1 to 15. +By default this value is negative -1, and thus unused. +

+
+
ally
+

Set spread usage of stereo image across Y axis for all channels. +Allowed range is from -1 to 15. +By default this value is negative -1, and thus unused. +

+
+
fcx, flx, frx, blx, brx, slx, srx, bcx
+

Set spread usage of stereo image across X axis for each channel. +Allowed range is from 0.06 to 15. +By default this value is 0.5. +

+
+
fcy, fly, fry, bly, bry, sly, sry, bcy
+

Set spread usage of stereo image across Y axis for each channel. +Allowed range is from 0.06 to 15. +By default this value is 0.5. +

+
+
win_size
+

Set window size. Allowed range is from 1024 to 65536. Default size is 4096. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann, hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hann. +

+
+
overlap
+

Set window overlap. If set to 1, the recommended overlap for selected +window function will be picked. Default is 0.5. +

+
+ +
+
+

27.112 tiltshelf

+ +

Boost or cut the lower frequencies and cut or boost higher frequencies +of the audio using a two-pole shelving filter with a response similar to +that of a standard hi-fi’s tone-controls. +This is also known as shelving equalisation (EQ). +

+

The filter accepts the following options: +

+
+
gain, g
+

Give the gain at 0 Hz. Its useful range is about -20 +(for a large cut) to +20 (for a large boost). +Beware of clipping when using a positive gain. +

+
+
frequency, f
+

Set the filter’s central frequency and so can be used +to extend or reduce the frequency range to be boosted or cut. +The default value is 3000 Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Determine how steep is the filter’s shelf transition. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

27.112.1 Commands

+ +

This filter supports some options as commands. +

+
+
+
+

27.113 treble, highshelf

+ +

Boost or cut treble (upper) frequencies of the audio using a two-pole +shelving filter with a response similar to that of a standard +hi-fi’s tone-controls. This is also known as shelving equalisation (EQ). +

+

The filter accepts the following options: +

+
+
gain, g
+

Give the gain at whichever is the lower of ~22 kHz and the +Nyquist frequency. Its useful range is about -20 (for a large cut) +to +20 (for a large boost). Beware of clipping when using a positive gain. +

+
+
frequency, f
+

Set the filter’s central frequency and so can be used +to extend or reduce the frequency range to be boosted or cut. +The default value is 3000 Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Determine how steep is the filter’s shelf transition. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

27.113.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change treble frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change treble width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change treble width. +Syntax for the command is : "width" +

+
+
gain, g
+

Change treble gain. +Syntax for the command is : "gain" +

+
+
mix, m
+

Change treble mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

27.114 tremolo

+ +

Sinusoidal amplitude modulation. +

+

The filter accepts the following options: +

+
+
f
+

Modulation frequency in Hertz. Modulation frequencies in the subharmonic range +(20 Hz or lower) will result in a tremolo effect. +This filter may also be used as a ring modulator by specifying +a modulation frequency higher than 20 Hz. +Range is 0.1 - 20000.0. Default value is 5.0 Hz. +

+
+
d
+

Depth of modulation as a percentage. Range is 0.0 - 1.0. +Default value is 0.5. +

+
+ +
+
+

27.115 vibrato

+ +

Sinusoidal phase modulation. +

+

The filter accepts the following options: +

+
+
f
+

Modulation frequency in Hertz. +Range is 0.1 - 20000.0. Default value is 5.0 Hz. +

+
+
d
+

Depth of modulation as a percentage. Range is 0.0 - 1.0. +Default value is 0.5. +

+
+ +
+
+

27.116 virtualbass

+ +

Apply audio Virtual Bass filter. +

+

This filter accepts stereo input and produce stereo with LFE (2.1) channels output. +The newly produced LFE channel have enhanced virtual bass originally obtained from both stereo channels. +This filter outputs front left and front right channels unchanged as available in stereo input. +

+

The filter accepts the following options: +

+
+
cutoff
+

Set the virtual bass cutoff frequency. Default value is 250 Hz. +Allowed range is from 100 to 500 Hz. +

+
+
strength
+

Set the virtual bass strength. Allowed range is from 0.5 to 3. +Default value is 3. +

+
+ +
+
+

27.117 volume

+ +

Adjust the input audio volume. +

+

It accepts the following parameters: +

+
volume
+

Set audio volume expression. +

+

Output values are clipped to the maximum value. +

+

The output audio volume is given by the relation: +

+
output_volume = volume * input_volume
+
+ +

The default value for volume is "1.0". +

+
+
precision
+

This parameter represents the mathematical precision. +

+

It determines which input sample formats will be allowed, which affects the +precision of the volume scaling. +

+
+
fixed
+

8-bit fixed-point; this limits input sample format to U8, S16, and S32. +

+
float
+

32-bit floating-point; this limits input sample format to FLT. (default) +

+
double
+

64-bit floating-point; this limits input sample format to DBL. +

+
+ +
+
replaygain
+

Choose the behaviour on encountering ReplayGain side data in input frames. +

+
+
drop
+

Remove ReplayGain side data, ignoring its contents (the default). +

+
+
ignore
+

Ignore ReplayGain side data, but leave it in the frame. +

+
+
track
+

Prefer the track gain, if present. +

+
+
album
+

Prefer the album gain, if present. +

+
+ +
+
replaygain_preamp
+

Pre-amplification gain in dB to apply to the selected replaygain gain. +

+

Default value for replaygain_preamp is 0.0. +

+
+
replaygain_noclip
+

Prevent clipping by limiting the gain applied. +

+

Default value for replaygain_noclip is 1. +

+
+
eval
+

Set when the volume expression is evaluated. +

+

It accepts the following values: +

+
once
+

only evaluate expression once during the filter initialization, or +when the ‘volume’ command is sent +

+
+
frame
+

evaluate expression for each incoming frame +

+
+ +

Default value is ‘once’. +

+
+ +

The volume expression can contain the following parameters. +

+
+
n
+

frame number (starting at zero) +

+
nb_channels
+

number of channels +

+
nb_consumed_samples
+

number of samples consumed by the filter +

+
nb_samples
+

number of samples in the current frame +

+
pos
+

original frame position in the file; deprecated, do not use +

+
pts
+

frame PTS +

+
sample_rate
+

sample rate +

+
startpts
+

PTS at start of stream +

+
startt
+

time at start of stream +

+
t
+

frame time +

+
tb
+

timestamp timebase +

+
volume
+

last set volume value +

+
+ +

Note that when eval is set to ‘once’ only the +sample_rate and tb variables are available, all other +variables will evaluate to NAN. +

+ +
+

27.117.1 Commands

+ +

This filter supports the following commands: +

+
volume
+

Modify the volume expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+

27.117.2 Examples

+ +
    +
  • Halve the input audio volume: +
    +
    volume=volume=0.5
    +volume=volume=1/2
    +volume=volume=-6.0206dB
    +
    + +

    In all the above example the named key for volume can be +omitted, for example like in: +

    +
    volume=0.5
    +
    + +
  • Increase input audio power by 6 decibels using fixed-point precision: +
    +
    volume=volume=6dB:precision=fixed
    +
    + +
  • Fade volume after time 10 with an annihilation period of 5 seconds: +
    +
    volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
    +
    +
+ +
+
+
+

27.118 volumedetect

+ +

Detect the volume of the input video. +

+

The filter has no parameters. It supports only 16-bit signed integer samples, +so the input will be converted when needed. Statistics about the volume will +be printed in the log when the input stream end is reached. +

+

In particular it will show the mean volume (root mean square), maximum +volume (on a per-sample basis), and the beginning of a histogram of the +registered volume values (from the maximum value to a cumulated 1/1000 of +the samples). +

+

All volumes are in decibels relative to the maximum PCM value. +

+ +
+

27.118.1 Examples

+ +

Here is an excerpt of the output: +

+
[Parsed_volumedetect_0  0xa23120] mean_volume: -27 dB
+[Parsed_volumedetect_0  0xa23120] max_volume: -4 dB
+[Parsed_volumedetect_0  0xa23120] histogram_4db: 6
+[Parsed_volumedetect_0  0xa23120] histogram_5db: 62
+[Parsed_volumedetect_0  0xa23120] histogram_6db: 286
+[Parsed_volumedetect_0  0xa23120] histogram_7db: 1042
+[Parsed_volumedetect_0  0xa23120] histogram_8db: 2551
+[Parsed_volumedetect_0  0xa23120] histogram_9db: 4609
+[Parsed_volumedetect_0  0xa23120] histogram_10db: 8409
+
+ +

It means that: +

    +
  • The mean square energy is approximately -27 dB, or 10^-2.7. +
  • The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB. +
  • There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc. +
+ +

In other words, raising the volume by +4 dB does not cause any clipping, +raising it by +5 dB causes clipping for 6 samples, etc. +

+ +
+
+
+
+

28 Audio Sources

+ +

Below is a description of the currently available audio sources. +

+ +
+

28.1 abuffer

+ +

Buffer audio frames, and make them available to the filter chain. +

+

This source is mainly intended for a programmatic use, in particular +through the interface defined in libavfilter/buffersrc.h. +

+

It accepts the following parameters: +

+
time_base
+

The timebase which will be used for timestamps of submitted frames. It must be +either a floating-point number or in numerator/denominator form. +

+
+
sample_rate
+

The sample rate of the incoming audio buffers. +

+
+
sample_fmt
+

The sample format of the incoming audio buffers. +Either a sample format name or its corresponding integer representation from +the enum AVSampleFormat in libavutil/samplefmt.h +

+
+
channel_layout
+

The channel layout of the incoming audio buffers. +Either a channel layout name from channel_layout_map in +libavutil/channel_layout.c or its corresponding integer representation +from the AV_CH_LAYOUT_* macros in libavutil/channel_layout.h +

+
+
channels
+

The number of channels of the incoming audio buffers. +If both channels and channel_layout are specified, then they +must be consistent. +

+
+
+ + +
+

28.1.1 Examples

+ +
+
abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
+
+ +

will instruct the source to accept planar 16bit signed stereo at 44100Hz. +Since the sample format with name "s16p" corresponds to the number +6 and the "stereo" channel layout corresponds to the value 0x3, this is +equivalent to: +

+
abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
+
+ +
+
+
+

28.2 aevalsrc

+ +

Generate an audio signal specified by an expression. +

+

This source accepts in input one or more expressions (one for each +channel), which are evaluated and used to generate a corresponding +audio signal. +

+

This source accepts the following options: +

+
+
exprs
+

Set the ’|’-separated expressions list for each separate channel. In case the +channel_layout option is not specified, the selected channel layout +depends on the number of provided expressions. Otherwise the last +specified expression is applied to the remaining output channels. +

+
+
channel_layout, c
+

Set the channel layout. The number of channels in the specified layout +must be equal to the number of specified expressions. +

+
+
duration, d
+

Set the minimum duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +Note that the resulting duration may be greater than the specified +duration, as the generated audio is always cut at the end of a +complete frame. +

+

If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +

+
+
nb_samples, n
+

Set the number of samples per channel per each output frame, +default to 1024. +

+
+
sample_rate, s
+

Specify the sample rate, default to 44100. +

+
+ +

Each expression in exprs can contain the following constants: +

+
+
n
+

number of the evaluated sample, starting from 0 +

+
+
t
+

time of the evaluated sample expressed in seconds, starting from 0 +

+
+
s
+

sample rate +

+
+
+ + +
+

28.2.1 Examples

+ +
    +
  • Generate silence: +
    +
    aevalsrc=0
    +
    + +
  • Generate a sin signal with frequency of 440 Hz, set sample rate to +8000 Hz: +
    +
    aevalsrc="sin(440*2*PI*t):s=8000"
    +
    + +
  • Generate a two channels signal, specify the channel layout (Front +Center + Back Center) explicitly: +
    +
    aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
    +
    + +
  • Generate white noise: +
    +
    aevalsrc="-2+random(0)"
    +
    + +
  • Generate an amplitude modulated signal: +
    +
    aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
    +
    + +
  • Generate 2.5 Hz binaural beats on a 360 Hz carrier: +
    +
    aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
    +
    + +
+ +
+
+
+

28.3 afdelaysrc

+ +

Generate a fractional delay FIR coefficients. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
delay, d
+

Set the fractional delay. Default is 0. +

+
+
sample_rate, r
+

Set the sample rate, default is 44100. +

+
+
nb_samples, n
+

Set the number of samples per each frame. Default is 1024. +

+
+
taps, t
+

Set the number of filter coefficents in output audio stream. +Default value is 0. +

+
+
channel_layout, c
+

Specifies the channel layout, and can be a string representing a channel layout. +The default value of channel_layout is "stereo". +

+
+ +
+
+

28.4 afireqsrc

+ +

Generate a FIR equalizer coefficients. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
preset, p
+

Set equalizer preset. +Default preset is flat. +

+

Available presets are: +

+
custom
+
flat
+
acoustic
+
bass
+
beats
+
classic
+
clear
+
deep bass
+
dubstep
+
electronic
+
hard-style
+
hip-hop
+
jazz
+
metal
+
movie
+
pop
+
r&b
+
rock
+
vocal booster
+
+ +
+
gains, g
+

Set custom gains for each band. Only used if the preset option is set to custom. +Gains are separated by white spaces and each gain is set in dBFS. +Default is 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0. +

+
+
bands, b
+

Set the custom bands from where custon equalizer gains are set. +This must be in strictly increasing order. Only used if the preset option is set to custom. +Bands are separated by white spaces and each band represent frequency in Hz. +Default is 25 40 63 100 160 250 400 630 1000 1600 2500 4000 6300 10000 16000 24000. +

+
+
taps, t
+

Set number of filter coefficents in output audio stream. +Default value is 4096. +

+
+
sample_rate, r
+

Set sample rate of output audio stream, default is 44100. +

+
+
nb_samples, n
+

Set number of samples per each frame in output audio stream. Default is 1024. +

+
+
interp, i
+

Set interpolation method for FIR equalizer coefficients. Can be linear or cubic. +

+
+
phase, h
+

Set phase type of FIR filter. Can be linear or min: minimum-phase. +Default is minimum-phase filter. +

+
+ +
+
+

28.5 afirsrc

+ +

Generate a FIR coefficients using frequency sampling method. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
taps, t
+

Set number of filter coefficents in output audio stream. +Default value is 1025. +

+
+
frequency, f
+

Set frequency points from where magnitude and phase are set. +This must be in non decreasing order, and first element must be 0, while last element +must be 1. Elements are separated by white spaces. +

+
+
magnitude, m
+

Set magnitude value for every frequency point set by frequency. +Number of values must be same as number of frequency points. +Values are separated by white spaces. +

+
+
phase, p
+

Set phase value for every frequency point set by frequency. +Number of values must be same as number of frequency points. +Values are separated by white spaces. +

+
+
sample_rate, r
+

Set sample rate, default is 44100. +

+
+
nb_samples, n
+

Set number of samples per each frame. Default is 1024. +

+
+
win_func, w
+

Set window function. Default is blackman. +

+
+ +
+
+

28.6 anullsrc

+ +

The null audio source, return unprocessed audio frames. It is mainly useful +as a template and to be employed in analysis / debugging tools, or as +the source for filters which ignore the input data (for example the sox +synth filter). +

+

This source accepts the following options: +

+
+
channel_layout, cl
+
+

Specifies the channel layout, and can be either an integer or a string +representing a channel layout. The default value of channel_layout +is "stereo". +

+

Check the channel_layout_map definition in +libavutil/channel_layout.c for the mapping between strings and +channel layout values. +

+
+
sample_rate, r
+

Specifies the sample rate, and defaults to 44100. +

+
+
nb_samples, n
+

Set the number of samples per requested frames. +

+
+
duration, d
+

Set the duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +

+
+ + +
+

28.6.1 Examples

+ +
    +
  • Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO. +
    +
    anullsrc=r=48000:cl=4
    +
    + +
  • Do the same operation with a more obvious syntax: +
    +
    anullsrc=r=48000:cl=mono
    +
    +
+ +

All the parameters need to be explicitly defined. +

+
+
+
+

28.7 flite

+ +

Synthesize a voice utterance using the libflite library. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libflite. +

+

Note that versions of the flite library prior to 2.0 are not thread-safe. +

+

The filter accepts the following options: +

+
+
list_voices
+

If set to 1, list the names of the available voices and exit +immediately. Default value is 0. +

+
+
nb_samples, n
+

Set the maximum number of samples per frame. Default value is 512. +

+
+
textfile
+

Set the filename containing the text to speak. +

+
+
text
+

Set the text to speak. +

+
+
voice, v
+

Set the voice to use for the speech synthesis. Default value is +kal. See also the list_voices option. +

+
+ + +
+

28.7.1 Examples

+ +
    +
  • Read from file speech.txt, and synthesize the text using the +standard flite voice: +
    +
    flite=textfile=speech.txt
    +
    + +
  • Read the specified text selecting the slt voice: +
    +
    flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
    +
    + +
  • Input text to ffmpeg: +
    +
    ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
    +
    + +
  • Make ffplay speak the specified text, using flite and +the lavfi device: +
    +
    ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
    +
    +
+ +

For more information about libflite, check: +http://www.festvox.org/flite/ +

+
+
+
+

28.8 anoisesrc

+ +

Generate a noise audio signal. +

+

The filter accepts the following options: +

+
+
sample_rate, r
+

Specify the sample rate. Default value is 48000 Hz. +

+
+
amplitude, a
+

Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value +is 1.0. +

+
+
duration, d
+

Specify the duration of the generated audio stream. Not specifying this option +results in noise with an infinite length. +

+
+
color, colour, c
+

Specify the color of noise. Available noise colors are white, pink, brown, +blue, violet and velvet. Default color is white. +

+
+
seed, s
+

Specify a value used to seed the PRNG. +

+
+
nb_samples, n
+

Set the number of samples per each output frame, default is 1024. +

+
+
density
+

Set the density (0.0 - 1.0) for the velvet noise generator, default is 0.05. +

+
+ + +
+

28.8.1 Examples

+ +
    +
  • Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5: +
    +
    anoisesrc=d=60:c=pink:r=44100:a=0.5
    +
    +
+ +
+
+
+

28.9 hilbert

+ +

Generate odd-tap Hilbert transform FIR coefficients. +

+

The resulting stream can be used with afir filter for phase-shifting +the signal by 90 degrees. +

+

This is used in many matrix coding schemes and for analytic signal generation. +The process is often written as a multiplication by i (or j), the imaginary unit. +

+

The filter accepts the following options: +

+
+
sample_rate, s
+

Set sample rate, default is 44100. +

+
+
taps, t
+

Set length of FIR filter, default is 22051. +

+
+
nb_samples, n
+

Set number of samples per each frame. +

+
+
win_func, w
+

Set window function to be used when generating FIR coefficients. +

+
+ +
+
+

28.10 sinc

+ +

Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
sample_rate, r
+

Set sample rate, default is 44100. +

+
+
nb_samples, n
+

Set number of samples per each frame. Default is 1024. +

+
+
hp
+

Set high-pass frequency. Default is 0. +

+
+
lp
+

Set low-pass frequency. Default is 0. +If high-pass frequency is lower than low-pass frequency and low-pass frequency +is higher than 0 then filter will create band-pass filter coefficients, +otherwise band-reject filter coefficients. +

+
+
phase
+

Set filter phase response. Default is 50. Allowed range is from 0 to 100. +

+
+
beta
+

Set Kaiser window beta. +

+
+
att
+

Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB. +

+
+
round
+

Enable rounding, by default is disabled. +

+
+
hptaps
+

Set number of taps for high-pass filter. +

+
+
lptaps
+

Set number of taps for low-pass filter. +

+
+ +
+
+

28.11 sine

+ +

Generate an audio signal made of a sine wave with amplitude 1/8. +

+

The audio signal is bit-exact. +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the carrier frequency. Default is 440 Hz. +

+
+
beep_factor, b
+

Enable a periodic beep every second with frequency beep_factor times +the carrier frequency. Default is 0, meaning the beep is disabled. +

+
+
sample_rate, r
+

Specify the sample rate, default is 44100. +

+
+
duration, d
+

Specify the duration of the generated audio stream. +

+
+
samples_per_frame
+

Set the number of samples per output frame. +

+

The expression can contain the following constants: +

+
+
n
+

The (sequential) number of the output audio frame, starting from 0. +

+
+
pts
+

The PTS (Presentation TimeStamp) of the output audio frame, +expressed in TB units. +

+
+
t
+

The PTS of the output audio frame, expressed in seconds. +

+
+
TB
+

The timebase of the output audio frames. +

+
+ +

Default is 1024. +

+
+ + +
+

28.11.1 Examples

+ +
    +
  • Generate a simple 440 Hz sine wave: +
    +
    sine
    +
    + +
  • Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds: +
    +
    sine=220:4:d=5
    +sine=f=220:b=4:d=5
    +sine=frequency=220:beep_factor=4:duration=5
    +
    + +
  • Generate a 1 kHz sine wave following 1602,1601,1602,1601,1602 NTSC +pattern: +
    +
    sine=1000:samples_per_frame='st(0,mod(n,5)); 1602-not(not(eq(ld(0),1)+eq(ld(0),3)))'
    +
    +
+ + +
+
+
+
+

29 Audio Sinks

+ +

Below is a description of the currently available audio sinks. +

+ +
+

29.1 abuffersink

+ +

Buffer audio frames, and make them available to the end of filter chain. +

+

This sink is mainly intended for programmatic use, in particular +through the interface defined in libavfilter/buffersink.h +or the options system. +

+

It accepts a pointer to an AVABufferSinkContext structure, which +defines the incoming buffers’ formats, to be passed as the opaque +parameter to avfilter_init_filter for initialization. +

+
+

29.2 anullsink

+ +

Null audio sink; do absolutely nothing with the input audio. It is +mainly useful as a template and for use in analysis / debugging +tools. +

+ +
+
+
+

30 Video Filters

+ +

When you configure your FFmpeg build, you can disable any of the +existing filters using --disable-filters. +The configure output will show the video filters included in your +build. +

+

Below is a description of the currently available video filters. +

+ +
+

30.1 addroi

+ +

Mark a region of interest in a video frame. +

+

The frame data is passed through unchanged, but metadata is attached +to the frame indicating regions of interest which can affect the +behaviour of later encoding. Multiple regions can be marked by +applying the filter multiple times. +

+
+
x
+

Region distance in pixels from the left edge of the frame. +

+
y
+

Region distance in pixels from the top edge of the frame. +

+
w
+

Region width in pixels. +

+
h
+

Region height in pixels. +

+

The parameters x, y, w and h are expressions, +and may contain the following variables: +

+
iw
+

Width of the input frame. +

+
ih
+

Height of the input frame. +

+
+ +
+
qoffset
+

Quantisation offset to apply within the region. +

+

This must be a real value in the range -1 to +1. A value of zero +indicates no quality change. A negative value asks for better quality +(less quantisation), while a positive value asks for worse quality +(greater quantisation). +

+

The range is calibrated so that the extreme values indicate the +largest possible offset - if the rest of the frame is encoded with the +worst possible quality, an offset of -1 indicates that this region +should be encoded with the best possible quality anyway. Intermediate +values are then interpolated in some codec-dependent way. +

+

For example, in 10-bit H.264 the quantisation parameter varies between +-12 and 51. A typical qoffset value of -1/10 therefore indicates that +this region should be encoded with a QP around one-tenth of the full +range better than the rest of the frame. So, if most of the frame +were to be encoded with a QP of around 30, this region would get a QP +of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3). +An extreme value of -1 would indicate that this region should be +encoded with the best possible quality regardless of the treatment of +the rest of the frame - that is, should be encoded at a QP of -12. +

+
clear
+

If set to true, remove any existing regions of interest marked on the +frame before adding the new one. +

+
+ + +
+

30.1.1 Examples

+ +
    +
  • Mark the centre quarter of the frame as interesting. +
    +
    addroi=iw/4:ih/4:iw/2:ih/2:-1/10
    +
    +
  • Mark the 100-pixel-wide region on the left edge of the frame as very +uninteresting (to be encoded at much lower quality than the rest of +the frame). +
    +
    addroi=0:0:100:ih:+1/5
    +
    +
+ +
+
+
+

30.2 alphaextract

+ +

Extract the alpha component from the input as a grayscale video. This +is especially useful with the alphamerge filter. +

+
+
+

30.3 alphamerge

+ +

Add or replace the alpha component of the primary input with the +grayscale value of a second input. This is intended for use with +alphaextract to allow the transmission or storage of frame +sequences that have alpha in a format that doesn’t support an alpha +channel. +

+

For example, to reconstruct full frames from a normal YUV-encoded video +and a separate video created with alphaextract, you might use: +

+
movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
+
+ +
+
+

30.4 amplify

+ +

Amplify differences between current pixel and pixels of adjacent frames in +same pixel location. +

+

This filter accepts the following options: +

+
+
radius
+

Set frame radius. Default is 2. Allowed range is from 1 to 63. +For example radius of 3 will instruct filter to calculate average of 7 frames. +

+
+
factor
+

Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535. +

+
+
threshold
+

Set threshold for difference amplification. Any difference greater or equal to +this value will not alter source pixel. Default is 10. +Allowed range is from 0 to 65535. +

+
+
tolerance
+

Set tolerance for difference amplification. Any difference lower to +this value will not alter source pixel. Default is 0. +Allowed range is from 0 to 65535. +

+
+
low
+

Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535. +This option controls maximum possible value that will decrease source pixel value. +

+
+
high
+

Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535. +This option controls maximum possible value that will increase source pixel value. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+ + +
+

30.4.1 Commands

+ +

This filter supports the following commands that corresponds to option of same name: +

+
factor
+
threshold
+
tolerance
+
low
+
high
+
planes
+
+ +
+
+
+

30.5 ass

+ +

Same as the subtitles filter, except that it doesn’t require libavcodec +and libavformat to work. On the other hand, it is limited to ASS (Advanced +Substation Alpha) subtitles files. +

+

This filter accepts the following option in addition to the common options from +the subtitles filter: +

+
+
shaping
+

Set the shaping engine +

+

Available values are: +

+
auto
+

The default libass shaping engine, which is the best available. +

+
simple
+

Fast, font-agnostic shaper that can do only substitutions +

+
complex
+

Slower shaper using OpenType for substitutions and positioning +

+
+ +

The default is auto. +

+
+ +
+
+

30.6 atadenoise

+

Apply an Adaptive Temporal Averaging Denoiser to the video input. +

+

The filter accepts the following options: +

+
+
0a
+

Set threshold A for 1st plane. Default is 0.02. +Valid range is 0 to 0.3. +

+
+
0b
+

Set threshold B for 1st plane. Default is 0.04. +Valid range is 0 to 5. +

+
+
1a
+

Set threshold A for 2nd plane. Default is 0.02. +Valid range is 0 to 0.3. +

+
+
1b
+

Set threshold B for 2nd plane. Default is 0.04. +Valid range is 0 to 5. +

+
+
2a
+

Set threshold A for 3rd plane. Default is 0.02. +Valid range is 0 to 0.3. +

+
+
2b
+

Set threshold B for 3rd plane. Default is 0.04. +Valid range is 0 to 5. +

+

Threshold A is designed to react on abrupt changes in the input signal and +threshold B is designed to react on continuous changes in the input signal. +

+
+
s
+

Set number of frames filter will use for averaging. Default is 9. Must be odd +number in range [5, 129]. +

+
+
p
+

Set what planes of frame filter will use for averaging. Default is all. +

+
+
a
+

Set what variant of algorithm filter will use for averaging. Default is p parallel. +Alternatively can be set to s serial. +

+

Parallel can be faster then serial, while other way around is never true. +Parallel will abort early on first change being greater then thresholds, while serial +will continue processing other side of frames if they are equal or below thresholds. +

+
+
0s
+
1s
+
2s
+

Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767. +Valid range is from 0 to 32767. +This options controls weight for each pixel in radius defined by size. +Default value means every pixel have same weight. +Setting this option to 0 effectively disables filtering. +

+
+ + +
+

30.6.1 Commands

+

This filter supports same commands as options except option s. +The command accepts the same syntax of the corresponding option. +

+
+
+
+

30.7 avgblur

+ +

Apply average blur filter. +

+

The filter accepts the following options: +

+
+
sizeX
+

Set horizontal radius size. +

+
+
planes
+

Set which planes to filter. By default all planes are filtered. +

+
+
sizeY
+

Set vertical radius size, if zero it will be same as sizeX. +Default is 0. +

+
+ + +
+

30.7.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

30.8 backgroundkey

+ +

Turns a static background into transparency. +

+

The filter accepts the following option: +

+
+
threshold
+

Threshold for scene change detection. +

+
similarity
+

Similarity percentage with the background. +

+
blend
+

Set the blend amount for pixels that are not similar. +

+
+ + +
+

30.8.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.9 bbox

+ +

Compute the bounding box for the non-black pixels in the input frame +luminance plane. +

+

This filter computes the bounding box containing all the pixels with a +luminance value greater than the minimum allowed value. +The parameters describing the bounding box are printed on the filter +log. +

+

The filter accepts the following option: +

+
+
min_val
+

Set the minimal luminance value. Default is 16. +

+
+ + +
+

30.9.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.10 bilateral

+

Apply bilateral filter, spatial smoothing while preserving edges. +

+

The filter accepts the following options: +

+
sigmaS
+

Set sigma of gaussian function to calculate spatial weight. +Allowed range is 0 to 512. Default is 0.1. +

+
+
sigmaR
+

Set sigma of gaussian function to calculate range weight. +Allowed range is 0 to 1. Default is 0.1. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

30.10.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.11 bilateral_cuda

+

CUDA accelerated bilateral filter, an edge preserving filter. +This filter is mathematically accurate thanks to the use of GPU acceleration. +For best output quality, use one to one chroma subsampling, i.e. yuv444p format. +

+

The filter accepts the following options: +

+
sigmaS
+

Set sigma of gaussian function to calculate spatial weight, also called sigma space. +Allowed range is 0.1 to 512. Default is 0.1. +

+
+
sigmaR
+

Set sigma of gaussian function to calculate color range weight, also called sigma color. +Allowed range is 0.1 to 512. Default is 0.1. +

+
+
window_size
+

Set window size of the bilateral function to determine the number of neighbours to loop on. +If the number entered is even, one will be added automatically. +Allowed range is 1 to 255. Default is 1. +

+
+ +
+

30.11.1 Examples

+ +
    +
  • Apply the bilateral filter on a video. + +
    +
    ./ffmpeg -v verbose \
    +-hwaccel cuda -hwaccel_output_format cuda -i input.mp4  \
    +-init_hw_device cuda \
    +-filter_complex \
    +" \
    +[0:v]scale_cuda=format=yuv444p[scaled_video];
    +[scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0" \
    +-an -sn -c:v h264_nvenc -cq 20 out.mp4
    +
    + +
+ +
+
+
+

30.12 bitplanenoise

+ +

Show and measure bit plane noise. +

+

The filter accepts the following options: +

+
+
bitplane
+

Set which plane to analyze. Default is 1. +

+
+
filter
+

Filter out noisy pixels from bitplane set above. +Default is disabled. +

+
+ +
+
+

30.13 blackdetect

+ +

Detect video intervals that are (almost) completely black. Can be +useful to detect chapter transitions, commercials, or invalid +recordings. +

+

The filter outputs its detection analysis to both the log as well as +frame metadata. If a black segment of at least the specified minimum +duration is found, a line with the start and end timestamps as well +as duration is printed to the log with level info. In addition, +a log line with level debug is printed per frame showing the +black amount detected for that frame. +

+

The filter also attaches metadata to the first frame of a black +segment with key lavfi.black_start and to the first frame +after the black segment ends with key lavfi.black_end. The +value is the frame’s timestamp. This metadata is added regardless +of the minimum duration specified. +

+

The filter accepts the following options: +

+
+
black_min_duration, d
+

Set the minimum detected black duration expressed in seconds. It must +be a non-negative floating point number. +

+

Default value is 2.0. +

+
+
picture_black_ratio_th, pic_th
+

Set the threshold for considering a picture "black". +Express the minimum value for the ratio: +

+
nb_black_pixels / nb_pixels
+
+ +

for which a picture is considered black. +Default value is 0.98. +

+
+
pixel_black_th, pix_th
+

Set the threshold for considering a pixel "black". +

+

The threshold expresses the maximum pixel luminance value for which a +pixel is considered "black". The provided value is scaled according to +the following equation: +

+
absolute_threshold = luminance_minimum_value + pixel_black_th * luminance_range_size
+
+ +

luminance_range_size and luminance_minimum_value depend on +the input video format, the range is [0-255] for YUV full-range +formats and [16-235] for YUV non full-range formats. +

+

Default value is 0.10. +

+
+ +

The following example sets the maximum pixel threshold to the minimum +value, and detects only black intervals of 2 or more seconds: +

+
blackdetect=d=2:pix_th=0.00
+
+ +
+
+

30.14 blackframe

+ +

Detect frames that are (almost) completely black. Can be useful to +detect chapter transitions or commercials. Output lines consist of +the frame number of the detected frame, the percentage of blackness, +the position in the file if known or -1 and the timestamp in seconds. +

+

In order to display the output lines, you need to set the loglevel at +least to the AV_LOG_INFO value. +

+

This filter exports frame metadata lavfi.blackframe.pblack. +The value represents the percentage of pixels in the picture that +are below the threshold value. +

+

It accepts the following parameters: +

+
+
amount
+

The percentage of the pixels that have to be below the threshold; it defaults to +98. +

+
+
threshold, thresh
+

The threshold below which a pixel value is considered black; it defaults to +32. +

+
+
+ +
+
+

30.15 blend

+ +

Blend two video frames into each other. +

+

The blend filter takes two input streams and outputs one +stream, the first input is the "top" layer and second input is +"bottom" layer. By default, the output terminates when the longest input terminates. +

+

The tblend (time blend) filter takes two consecutive frames +from one single stream, and outputs the result obtained by blending +the new frame on top of the old frame. +

+

A description of the accepted options follows. +

+
+
c0_mode
+
c1_mode
+
c2_mode
+
c3_mode
+
all_mode
+

Set blend mode for specific pixel component or all pixel components in case +of all_mode. Default value is normal. +

+

Available values for component modes are: +

+
addition
+
and
+
average
+
bleach
+
burn
+
darken
+
difference
+
divide
+
dodge
+
exclusion
+
extremity
+
freeze
+
geometric
+
glow
+
grainextract
+
grainmerge
+
hardlight
+
hardmix
+
hardoverlay
+
harmonic
+
heat
+
interpolate
+
lighten
+
linearlight
+
multiply
+
multiply128
+
negation
+
normal
+
or
+
overlay
+
phoenix
+
pinlight
+
reflect
+
screen
+
softdifference
+
softlight
+
stain
+
subtract
+
vividlight
+
xor
+
+ +
+
c0_opacity
+
c1_opacity
+
c2_opacity
+
c3_opacity
+
all_opacity
+

Set blend opacity for specific pixel component or all pixel components in case +of all_opacity. Only used in combination with pixel component blend modes. +

+
+
c0_expr
+
c1_expr
+
c2_expr
+
c3_expr
+
all_expr
+

Set blend expression for specific pixel component or all pixel components in case +of all_expr. Note that related mode options will be ignored if those are set. +

+

The expressions can use the following variables: +

+
+
N
+

The sequential number of the filtered frame, starting from 0. +

+
+
X
+
Y
+

the coordinates of the current sample +

+
+
W
+
H
+

the width and height of currently filtered plane +

+
+
SW
+
SH
+

Width and height scale for the plane being filtered. It is the +ratio between the dimensions of the current plane to the luma plane, +e.g. for a yuv420p frame, the values are 1,1 for +the luma plane and 0.5,0.5 for the chroma planes. +

+
+
T
+

Time of the current frame, expressed in seconds. +

+
+
TOP, A
+

Value of pixel component at current location for first video frame (top layer). +

+
+
BOTTOM, B
+

Value of pixel component at current location for second video frame (bottom layer). +

+
+
+
+ +

The blend filter also supports the framesync options. +

+ +
+

30.15.1 Examples

+ +
    +
  • Apply transition from bottom layer to top layer in first 10 seconds: +
    +
    blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
    +
    + +
  • Apply linear horizontal transition from top layer to bottom layer: +
    +
    blend=all_expr='A*(X/W)+B*(1-X/W)'
    +
    + +
  • Apply 1x1 checkerboard effect: +
    +
    blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
    +
    + +
  • Apply uncover left effect: +
    +
    blend=all_expr='if(gte(N*SW+X,W),A,B)'
    +
    + +
  • Apply uncover down effect: +
    +
    blend=all_expr='if(gte(Y-N*SH,0),A,B)'
    +
    + +
  • Apply uncover up-left effect: +
    +
    blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
    +
    + +
  • Split diagonally video and shows top and bottom layer on each side: +
    +
    blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
    +
    + +
  • Display differences between the current and the previous frame: +
    +
    tblend=all_mode=grainextract
    +
    +
+ +
+
+

30.15.2 Commands

+

This filter supports same commands as options. +

+
+
+
+

30.16 blockdetect

+ +

Determines blockiness of frames without altering the input frames. +

+

Based on Remco Muijs and Ihor Kirenko: "A no-reference blocking artifact measure for adaptive video processing." 2005 13th European signal processing conference. +

+

The filter accepts the following options: +

+
+
period_min
+
period_max
+

Set minimum and maximum values for determining pixel grids (periods). +Default values are [3,24]. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

30.16.1 Examples

+ +
    +
  • Determine blockiness for the first plane and search for periods within [8,32]: +
    +
    blockdetect=period_min=8:period_max=32:planes=1
    +
    +
+ +
+
+
+

30.17 blurdetect

+ +

Determines blurriness of frames without altering the input frames. +

+

Based on Marziliano, Pina, et al. "A no-reference perceptual blur metric." +Allows for a block-based abbreviation. +

+

The filter accepts the following options: +

+
+
low
+
high
+

Set low and high threshold values used by the Canny thresholding +algorithm. +

+

The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. +

+

low and high threshold values must be chosen in the range +[0,1], and low should be lesser or equal to high. +

+

Default value for low is 20/255, and default value for high +is 50/255. +

+
+
radius
+

Define the radius to search around an edge pixel for local maxima. +

+
+
block_pct
+

Determine blurriness only for the most significant blocks, given in percentage. +

+
+
block_width
+

Determine blurriness for blocks of width block_width. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of block_height. +

+
+
block_height
+

Determine blurriness for blocks of height block_height. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of block_width. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

30.17.1 Examples

+ +
    +
  • Determine blur for 80% of most significant 32x32 blocks: +
    +
    blurdetect=block_width=32:block_height=32:block_pct=80
    +
    +
+ +
+
+
+

30.18 bm3d

+ +

Denoise frames using Block-Matching 3D algorithm. +

+

The filter accepts the following options. +

+
+
sigma
+

Set denoising strength. Default value is 1. +Allowed range is from 0 to 999.9. +The denoising algorithm is very sensitive to sigma, so adjust it +according to the source. +

+
+
block
+

Set local patch size. This sets dimensions in 2D. +

+
+
bstep
+

Set sliding step for processing blocks. Default value is 4. +Allowed range is from 1 to 64. +Smaller values allows processing more reference blocks and is slower. +

+
+
group
+

Set maximal number of similar blocks for 3rd dimension. Default value is 1. +When set to 1, no block matching is done. Larger values allows more blocks +in single group. +Allowed range is from 1 to 256. +

+
+
range
+

Set radius for search block matching. Default is 9. +Allowed range is from 1 to INT32_MAX. +

+
+
mstep
+

Set step between two search locations for block matching. Default is 1. +Allowed range is from 1 to 64. Smaller is slower. +

+
+
thmse
+

Set threshold of mean square error for block matching. Valid range is 0 to +INT32_MAX. +

+
+
hdthr
+

Set thresholding parameter for hard thresholding in 3D transformed domain. +Larger values results in stronger hard-thresholding filtering in frequency +domain. +

+
+
estim
+

Set filtering estimation mode. Can be basic or final. +Default is basic. +

+
+
ref
+

If enabled, filter will use 2nd stream for block matching. +Default is disabled for basic value of estim option, +and always enabled if value of estim is final. +

+
+
planes
+

Set planes to filter. Default is all available except alpha. +

+
+ + +
+

30.18.1 Examples

+ +
    +
  • Basic filtering with bm3d: +
    +
    bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
    +
    + +
  • Same as above, but filtering only luma: +
    +
    bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
    +
    + +
  • Same as above, but with both estimation modes: +
    +
    split[a][b],[a]bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
    +
    + +
  • Same as above, but prefilter with nlmeans filter instead: +
    +
    split[a][b],[a]nlmeans=s=3:r=7:p=3[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
    +
    +
+ +
+
+
+

30.19 boxblur

+ +

Apply a boxblur algorithm to the input video. +

+

It accepts the following parameters: +

+
+
luma_radius, lr
+
luma_power, lp
+
chroma_radius, cr
+
chroma_power, cp
+
alpha_radius, ar
+
alpha_power, ap
+
+ +

A description of the accepted options follows. +

+
+
luma_radius, lr
+
chroma_radius, cr
+
alpha_radius, ar
+

Set an expression for the box radius in pixels used for blurring the +corresponding input plane. +

+

The radius value must be a non-negative number, and must not be +greater than the value of the expression min(w,h)/2 for the +luma and alpha planes, and of min(cw,ch)/2 for the chroma +planes. +

+

Default value for luma_radius is "2". If not specified, +chroma_radius and alpha_radius default to the +corresponding value set for luma_radius. +

+

The expressions can contain the following constants: +

+
w
+
h
+

The input width and height in pixels. +

+
+
cw
+
ch
+

The input chroma image width and height in pixels. +

+
+
hsub
+
vsub
+

The horizontal and vertical chroma subsample values. For example, for the +pixel format "yuv422p", hsub is 2 and vsub is 1. +

+
+ +
+
luma_power, lp
+
chroma_power, cp
+
alpha_power, ap
+

Specify how many times the boxblur filter is applied to the +corresponding plane. +

+

Default value for luma_power is 2. If not specified, +chroma_power and alpha_power default to the +corresponding value set for luma_power. +

+

A value of 0 will disable the effect. +

+
+ + +
+

30.19.1 Examples

+ +
    +
  • Apply a boxblur filter with the luma, chroma, and alpha radii +set to 2: +
    +
    boxblur=luma_radius=2:luma_power=1
    +boxblur=2:1
    +
    + +
  • Set the luma radius to 2, and alpha and chroma radius to 0: +
    +
    boxblur=2:1:cr=0:ar=0
    +
    + +
  • Set the luma and chroma radii to a fraction of the video dimension: +
    +
    boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
    +
    +
+ +
+
+
+

30.20 bwdif

+ +

Deinterlace the input video ("bwdif" stands for "Bob Weaver +Deinterlacing Filter"). +

+

Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic +interpolation algorithms. +It accepts the following parameters: +

+
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
0, send_frame
+

Output one frame for each frame. +

+
1, send_field
+

Output one frame for each field. +

+
+ +

The default value is send_field. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
0, tff
+

Assume the top field is first. +

+
1, bff
+

Assume the bottom field is first. +

+
-1, auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
0, all
+

Deinterlace all frames. +

+
1, interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+ +
+
+

30.21 ccrepack

+ +

Repack CEA-708 closed captioning side data +

+

This filter fixes various issues seen with commerical encoders +related to upstream malformed CEA-708 payloads, specifically +incorrect number of tuples (wrong cc_count for the target FPS), +and incorrect ordering of tuples (i.e. the CEA-608 tuples are not at +the first entries in the payload). +

+
+
+

30.22 cas

+ +

Apply Contrast Adaptive Sharpen filter to video stream. +

+

The filter accepts the following options: +

+
+
strength
+

Set the sharpening strength. Default value is 0. +

+
+
planes
+

Set planes to filter. Default value is to filter all +planes except alpha plane. +

+
+ + +
+

30.22.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

30.23 chromahold

+

Remove all color information for all colors except for certain one. +

+

The filter accepts the following options: +

+
+
color
+

The color which will not be replaced with neutral chroma. +

+
+
similarity
+

Similarity percentage with the above color. +0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +0.0 makes pixels either fully gray, or not gray at all. +Higher values result in more preserved color. +

+
+
yuv
+

Signals that the color passed is already in YUV instead of RGB. +

+

Literal colors like "green" or "red" don’t make sense with this enabled anymore. +This can be used to pass exact YUV values as hexadecimal numbers. +

+
+ + +
+

30.23.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

30.24 chromakey

+

YUV colorspace color/chroma keying. +

+

The filter accepts the following options: +

+
+
color
+

The color which will be replaced with transparency. +

+
+
similarity
+

Similarity percentage with the key color. +

+

0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +

+

0.0 makes pixels either fully transparent, or not transparent at all. +

+

Higher values result in semi-transparent pixels, with a higher transparency +the more similar the pixels color is to the key color. +

+
+
yuv
+

Signals that the color passed is already in YUV instead of RGB. +

+

Literal colors like "green" or "red" don’t make sense with this enabled anymore. +This can be used to pass exact YUV values as hexadecimal numbers. +

+
+ + +
+

30.24.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+

30.24.2 Examples

+ +
    +
  • Make every green pixel in the input image transparent: +
    +
    ffmpeg -i input.png -vf chromakey=green out.png
    +
    + +
  • Overlay a greenscreen-video on top of a static black background. +
    +
    ffmpeg -f lavfi -i color=c=black:s=1280x720 -i video.mp4 -shortest -filter_complex "[1:v]chromakey=0x70de77:0.1:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.mkv
    +
    +
+ +
+
+
+

30.25 chromakey_cuda

+

CUDA accelerated YUV colorspace color/chroma keying. +

+

This filter works like normal chromakey filter but operates on CUDA frames. +for more details and parameters see chromakey. +

+ +
+

30.25.1 Examples

+ +
    +
  • Make all the green pixels in the input video transparent and use it as an overlay for another video: + +
    +
    ./ffmpeg \
    +    -hwaccel cuda -hwaccel_output_format cuda -i input_green.mp4  \
    +    -hwaccel cuda -hwaccel_output_format cuda -i base_video.mp4 \
    +    -init_hw_device cuda \
    +    -filter_complex \
    +    " \
    +        [0:v]chromakey_cuda=0x25302D:0.1:0.12:1[overlay_video]; \
    +        [1:v]scale_cuda=format=yuv420p[base]; \
    +        [base][overlay_video]overlay_cuda" \
    +    -an -sn -c:v h264_nvenc -cq 20 output.mp4
    +
    + +
  • Process two software sources, explicitly uploading the frames: + +
    +
    ./ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda \
    +    -f lavfi -i color=size=800x600:color=white,format=yuv420p \
    +    -f lavfi -i yuvtestsrc=size=200x200,format=yuv420p \
    +    -filter_complex \
    +    " \
    +        [0]hwupload[under]; \
    +        [1]hwupload,chromakey_cuda=green:0.1:0.12[over]; \
    +        [under][over]overlay_cuda" \
    +    -c:v hevc_nvenc -cq 18 -preset slow output.mp4
    +
    + +
+ +
+
+
+

30.26 chromanr

+

Reduce chrominance noise. +

+

The filter accepts the following options: +

+
+
thres
+

Set threshold for averaging chrominance values. +Sum of absolute difference of Y, U and V pixel components of current +pixel and neighbour pixels lower than this threshold will be used in +averaging. Luma component is left unchanged and is copied to output. +Default value is 30. Allowed range is from 1 to 200. +

+
+
sizew
+

Set horizontal radius of rectangle used for averaging. +Allowed range is from 1 to 100. Default value is 5. +

+
+
sizeh
+

Set vertical radius of rectangle used for averaging. +Allowed range is from 1 to 100. Default value is 5. +

+
+
stepw
+

Set horizontal step when averaging. Default value is 1. +Allowed range is from 1 to 50. +Mostly useful to speed-up filtering. +

+
+
steph
+

Set vertical step when averaging. Default value is 1. +Allowed range is from 1 to 50. +Mostly useful to speed-up filtering. +

+
+
threy
+

Set Y threshold for averaging chrominance values. +Set finer control for max allowed difference between Y components +of current pixel and neigbour pixels. +Default value is 200. Allowed range is from 1 to 200. +

+
+
threu
+

Set U threshold for averaging chrominance values. +Set finer control for max allowed difference between U components +of current pixel and neigbour pixels. +Default value is 200. Allowed range is from 1 to 200. +

+
+
threv
+

Set V threshold for averaging chrominance values. +Set finer control for max allowed difference between V components +of current pixel and neigbour pixels. +Default value is 200. Allowed range is from 1 to 200. +

+
+
distance
+

Set distance type used in calculations. +

+
+
manhattan
+

Absolute difference. +

+
euclidean
+

Difference squared. +

+
+ +

Default distance type is manhattan. +

+
+ + +
+

30.26.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+
+
+
+

30.27 chromashift

+

Shift chroma pixels horizontally and/or vertically. +

+

The filter accepts the following options: +

+
cbh
+

Set amount to shift chroma-blue horizontally. +

+
cbv
+

Set amount to shift chroma-blue vertically. +

+
crh
+

Set amount to shift chroma-red horizontally. +

+
crv
+

Set amount to shift chroma-red vertically. +

+
edge
+

Set edge mode, can be smear, default, or warp. +

+
+ + +
+

30.27.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.28 ciescope

+ +

Display CIE color diagram with pixels overlaid onto it. +

+

The filter accepts the following options: +

+
+
system
+

Set color system. +

+
+
ntsc, 470m
+
ebu, 470bg
+
smpte
+
240m
+
apple
+
widergb
+
cie1931
+
rec709, hdtv
+
uhdtv, rec2020
+
dcip3
+
+ +
+
cie
+

Set CIE system. +

+
+
xyy
+
ucs
+
luv
+
+ +
+
gamuts
+

Set what gamuts to draw. +

+

See system option for available values. +

+
+
size, s
+

Set ciescope size, by default set to 512. +

+
+
intensity, i
+

Set intensity used to map input pixel values to CIE diagram. +

+
+
contrast
+

Set contrast used to draw tongue colors that are out of active color system gamut. +

+
+
corrgamma
+

Correct gamma displayed on scope, by default enabled. +

+
+
showwhite
+

Show white point on CIE diagram, by default disabled. +

+
+
gamma
+

Set input gamma. Used only with XYZ input color space. +

+
+
fill
+

Fill with CIE colors. By default is enabled. +

+
+ +
+
+

30.29 codecview

+ +

Visualize information exported by some codecs. +

+

Some codecs can export information through frames using side-data or other +means. For example, some MPEG based codecs export motion vectors through the +export_mvs flag in the codec flags2 option. +

+

The filter accepts the following option: +

+
+
block
+

Display block partition structure using the luma plane. +

+
+
mv
+

Set motion vectors to visualize. +

+

Available flags for mv are: +

+
+
pf
+

forward predicted MVs of P-frames +

+
bf
+

forward predicted MVs of B-frames +

+
bb
+

backward predicted MVs of B-frames +

+
+ +
+
qp
+

Display quantization parameters using the chroma planes. +

+
+
mv_type, mvt
+

Set motion vectors type to visualize. Includes MVs from all frames unless specified by frame_type option. +

+

Available flags for mv_type are: +

+
+
fp
+

forward predicted MVs +

+
bp
+

backward predicted MVs +

+
+ +
+
frame_type, ft
+

Set frame type to visualize motion vectors of. +

+

Available flags for frame_type are: +

+
+
if
+

intra-coded frames (I-frames) +

+
pf
+

predicted frames (P-frames) +

+
bf
+

bi-directionally predicted frames (B-frames) +

+
+
+
+ + +
+

30.29.1 Examples

+ +
    +
  • Visualize forward predicted MVs of all frames using ffplay: +
    +
    ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
    +
    + +
  • Visualize multi-directionals MVs of P and B-Frames using ffplay: +
    +
    ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
    +
    +
+ +
+
+
+

30.30 colorbalance

+

Modify intensity of primary colors (red, green and blue) of input frames. +

+

The filter allows an input frame to be adjusted in the shadows, midtones or highlights +regions for the red-cyan, green-magenta or blue-yellow balance. +

+

A positive adjustment value shifts the balance towards the primary color, a negative +value towards the complementary color. +

+

The filter accepts the following options: +

+
+
rs
+
gs
+
bs
+

Adjust red, green and blue shadows (darkest pixels). +

+
+
rm
+
gm
+
bm
+

Adjust red, green and blue midtones (medium pixels). +

+
+
rh
+
gh
+
bh
+

Adjust red, green and blue highlights (brightest pixels). +

+

Allowed ranges for options are [-1.0, 1.0]. Defaults are 0. +

+
+
pl
+

Preserve lightness when changing color balance. Default is disabled. +

+
+ + +
+

30.30.1 Examples

+ +
    +
  • Add red color cast to shadows: +
    +
    colorbalance=rs=.3
    +
    +
+ +
+
+

30.30.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.31 colorcontrast

+ +

Adjust color contrast between RGB components. +

+

The filter accepts the following options: +

+
+
rc
+

Set the red-cyan contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. +

+
+
gm
+

Set the green-magenta contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. +

+
+
by
+

Set the blue-yellow contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. +

+
+
rcw
+
gmw
+
byw
+

Set the weight of each rc, gm, by option value. Default value is 0.0. +Allowed range is from 0.0 to 1.0. If all weights are 0.0 filtering is disabled. +

+
+
pl
+

Set the amount of preserving lightness. Default value is 0.0. Allowed range is from 0.0 to 1.0. +

+
+ + +
+

30.31.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.32 colorcorrect

+ +

Adjust color white balance selectively for blacks and whites. +This filter operates in YUV colorspace. +

+

The filter accepts the following options: +

+
+
rl
+

Set the red shadow spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
bl
+

Set the blue shadow spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
rh
+

Set the red highlight spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
bh
+

Set the blue highlight spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
saturation
+

Set the amount of saturation. Allowed range is from -3.0 to 3.0. +Default value is 1. +

+
+
analyze
+

If set to anything other than manual it will analyze every frame and use derived +parameters for filtering output frame. +

+

Possible values are: +

+
manual
+
average
+
minmax
+
median
+
+

Default value is manual. +

+
+ + +
+

30.32.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.33 colorchannelmixer

+ +

Adjust video input frames by re-mixing color channels. +

+

This filter modifies a color channel by adding the values associated to +the other channels of the same pixels. For example if the value to +modify is red, the output value will be: +

+
red=red*rr + blue*rb + green*rg + alpha*ra
+
+ +

The filter accepts the following options: +

+
+
rr
+
rg
+
rb
+
ra
+

Adjust contribution of input red, green, blue and alpha channels for output red channel. +Default is 1 for rr, and 0 for rg, rb and ra. +

+
+
gr
+
gg
+
gb
+
ga
+

Adjust contribution of input red, green, blue and alpha channels for output green channel. +Default is 1 for gg, and 0 for gr, gb and ga. +

+
+
br
+
bg
+
bb
+
ba
+

Adjust contribution of input red, green, blue and alpha channels for output blue channel. +Default is 1 for bb, and 0 for br, bg and ba. +

+
+
ar
+
ag
+
ab
+
aa
+

Adjust contribution of input red, green, blue and alpha channels for output alpha channel. +Default is 1 for aa, and 0 for ar, ag and ab. +

+

Allowed ranges for options are [-2.0, 2.0]. +

+
+
pc
+

Set preserve color mode. The accepted values are: +

+
none
+

Disable color preserving, this is default. +

+
lum
+

Preserve luminance. +

+
max
+

Preserve max value of RGB triplet. +

+
avg
+

Preserve average value of RGB triplet. +

+
sum
+

Preserve sum value of RGB triplet. +

+
nrm
+

Preserve normalized value of RGB triplet. +

+
pwr
+

Preserve power value of RGB triplet. +

+
+ +
+
pa
+

Set the preserve color amount when changing colors. Allowed range is from [0.0, 1.0]. +Default is 0.0, thus disabled. +

+
+ + +
+

30.33.1 Examples

+ +
    +
  • Convert source to grayscale: +
    +
    colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
    +
    +
  • Simulate sepia tones: +
    +
    colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
    +
    +
+ +
+
+

30.33.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.34 colorize

+

Overlay a solid color on the video stream. +

+

The filter accepts the following options: +

+
+
hue
+

Set the color hue. Allowed range is from 0 to 360. +Default value is 0. +

+
+
saturation
+

Set the color saturation. Allowed range is from 0 to 1. +Default value is 0.5. +

+
+
lightness
+

Set the color lightness. Allowed range is from 0 to 1. +Default value is 0.5. +

+
+
mix
+

Set the mix of source lightness. By default is set to 1.0. +Allowed range is from 0.0 to 1.0. +

+
+ + +
+

30.34.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.35 colorkey

+

RGB colorspace color keying. +This filter operates on 8-bit RGB format frames by setting the alpha component of each pixel +which falls within the similarity radius of the key color to 0. The alpha value for pixels outside +the similarity radius depends on the value of the blend option. +

+

The filter accepts the following options: +

+
+
color
+

Set the color for which alpha will be set to 0 (full transparency). +See (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +Default is black. +

+
+
similarity
+

Set the radius from the key color within which other colors also have full transparency. +The computed distance is related to the unit fractional distance in 3D space between the RGB values +of the key color and the pixel’s color. Range is 0.01 to 1.0. 0.01 matches within a very small radius +around the exact key color, while 1.0 matches everything. +Default is 0.01. +

+
+
blend
+

Set how the alpha value for pixels that fall outside the similarity radius is computed. +0.0 makes pixels either fully transparent or fully opaque. +Higher values result in semi-transparent pixels, with greater transparency +the more similar the pixel color is to the key color. +Range is 0.0 to 1.0. Default is 0.0. +

+
+ + +
+

30.35.1 Examples

+ +
    +
  • Make every green pixel in the input image transparent: +
    +
    ffmpeg -i input.png -vf colorkey=green out.png
    +
    + +
  • Overlay a greenscreen-video on top of a static background image. +
    +
    ffmpeg -i background.png -i video.mp4 -filter_complex "[1:v]colorkey=0x3BBD1E:0.3:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.flv
    +
    +
+ +
+
+

30.35.2 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

30.36 colorhold

+

Remove all color information for all RGB colors except for certain one. +

+

The filter accepts the following options: +

+
+
color
+

The color which will not be replaced with neutral gray. +

+
+
similarity
+

Similarity percentage with the above color. +0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. 0.0 makes pixels fully gray. +Higher values result in more preserved color. +

+
+ + +
+

30.36.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

30.37 colorlevels

+ +

Adjust video input frames using levels. +

+

The filter accepts the following options: +

+
+
rimin
+
gimin
+
bimin
+
aimin
+

Adjust red, green, blue and alpha input black point. +Allowed ranges for options are [-1.0, 1.0]. Defaults are 0. +

+
+
rimax
+
gimax
+
bimax
+
aimax
+

Adjust red, green, blue and alpha input white point. +Allowed ranges for options are [-1.0, 1.0]. Defaults are 1. +

+

Input levels are used to lighten highlights (bright tones), darken shadows +(dark tones), change the balance of bright and dark tones. +

+
+
romin
+
gomin
+
bomin
+
aomin
+

Adjust red, green, blue and alpha output black point. +Allowed ranges for options are [0, 1.0]. Defaults are 0. +

+
+
romax
+
gomax
+
bomax
+
aomax
+

Adjust red, green, blue and alpha output white point. +Allowed ranges for options are [0, 1.0]. Defaults are 1. +

+

Output levels allows manual selection of a constrained output level range. +

+
+
preserve
+

Set preserve color mode. The accepted values are: +

+
none
+

Disable color preserving, this is default. +

+
lum
+

Preserve luminance. +

+
max
+

Preserve max value of RGB triplet. +

+
avg
+

Preserve average value of RGB triplet. +

+
sum
+

Preserve sum value of RGB triplet. +

+
nrm
+

Preserve normalized value of RGB triplet. +

+
pwr
+

Preserve power value of RGB triplet. +

+
+
+
+ + +
+

30.37.1 Examples

+ +
    +
  • Make video output darker: +
    +
    colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
    +
    + +
  • Increase contrast: +
    +
    colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
    +
    + +
  • Make video output lighter: +
    +
    colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
    +
    + +
  • Increase brightness: +
    +
    colorlevels=romin=0.5:gomin=0.5:bomin=0.5
    +
    +
+ +
+
+

30.37.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.38 colormap

+

Apply custom color maps to video stream. +

+

This filter needs three input video streams. +First stream is video stream that is going to be filtered out. +Second and third video stream specify color patches for source +color to target color mapping. +

+

The filter accepts the following options: +

+
+
patch_size
+

Set the source and target video stream patch size in pixels. +

+
+
nb_patches
+

Set the max number of used patches from source and target video stream. +Default value is number of patches available in additional video streams. +Max allowed number of patches is 64. +

+
+
type
+

Set the adjustments used for target colors. Can be relative or absolute. +Defaults is absolute. +

+
+
kernel
+

Set the kernel used to measure color differences between mapped colors. +

+

The accepted values are: +

+
euclidean
+
weuclidean
+
+ +

Default is euclidean. +

+
+ +
+
+

30.39 colormatrix

+ +

Convert color matrix. +

+

The filter accepts the following options: +

+
+
src
+
dst
+

Specify the source and destination color matrix. Both values must be +specified. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
fcc
+

FCC +

+
+
bt601
+

BT.601 +

+
+
bt470
+

BT.470 +

+
+
bt470bg
+

BT.470BG +

+
+
smpte170m
+

SMPTE-170M +

+
+
smpte240m
+

SMPTE-240M +

+
+
bt2020
+

BT.2020 +

+
+
+
+ +

For example to convert from BT.601 to SMPTE-240M, use the command: +

+
colormatrix=bt601:smpte240m
+
+ +
+
+

30.40 colorspace

+ +

Convert colorspace, transfer characteristics or color primaries. +Input video needs to have an even size. +

+

The filter accepts the following options: +

+
+
+
all
+

Specify all color properties at once. +

+

The accepted values are: +

+
bt470m
+

BT.470M +

+
+
bt470bg
+

BT.470BG +

+
+
bt601-6-525
+

BT.601-6 525 +

+
+
bt601-6-625
+

BT.601-6 625 +

+
+
bt709
+

BT.709 +

+
+
smpte170m
+

SMPTE-170M +

+
+
smpte240m
+

SMPTE-240M +

+
+
bt2020
+

BT.2020 +

+
+
+ +
+
space
+

Specify output colorspace. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
fcc
+

FCC +

+
+
bt470bg
+

BT.470BG or BT.601-6 625 +

+
+
smpte170m
+

SMPTE-170M or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
ycgco
+

YCgCo +

+
+
bt2020ncl
+

BT.2020 with non-constant luminance +

+
+
+ +
+
trc
+

Specify output transfer characteristics. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
bt470m
+

BT.470M +

+
+
bt470bg
+

BT.470BG +

+
+
gamma22
+

Constant gamma of 2.2 +

+
+
gamma28
+

Constant gamma of 2.8 +

+
+
smpte170m
+

SMPTE-170M, BT.601-6 625 or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
srgb
+

SRGB +

+
+
iec61966-2-1
+

iec61966-2-1 +

+
+
iec61966-2-4
+

iec61966-2-4 +

+
+
xvycc
+

xvycc +

+
+
bt2020-10
+

BT.2020 for 10-bits content +

+
+
bt2020-12
+

BT.2020 for 12-bits content +

+
+
+ +
+
primaries
+

Specify output color primaries. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
bt470m
+

BT.470M +

+
+
bt470bg
+

BT.470BG or BT.601-6 625 +

+
+
smpte170m
+

SMPTE-170M or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
film
+

film +

+
+
smpte431
+

SMPTE-431 +

+
+
smpte432
+

SMPTE-432 +

+
+
bt2020
+

BT.2020 +

+
+
jedec-p22
+

JEDEC P22 phosphors +

+
+
+ +
+
range
+

Specify output color range. +

+

The accepted values are: +

+
tv
+

TV (restricted) range +

+
+
mpeg
+

MPEG (restricted) range +

+
+
pc
+

PC (full) range +

+
+
jpeg
+

JPEG (full) range +

+
+
+ +
+
format
+

Specify output color format. +

+

The accepted values are: +

+
yuv420p
+

YUV 4:2:0 planar 8-bits +

+
+
yuv420p10
+

YUV 4:2:0 planar 10-bits +

+
+
yuv420p12
+

YUV 4:2:0 planar 12-bits +

+
+
yuv422p
+

YUV 4:2:2 planar 8-bits +

+
+
yuv422p10
+

YUV 4:2:2 planar 10-bits +

+
+
yuv422p12
+

YUV 4:2:2 planar 12-bits +

+
+
yuv444p
+

YUV 4:4:4 planar 8-bits +

+
+
yuv444p10
+

YUV 4:4:4 planar 10-bits +

+
+
yuv444p12
+

YUV 4:4:4 planar 12-bits +

+
+
+ +
+
fast
+

Do a fast conversion, which skips gamma/primary correction. This will take +significantly less CPU, but will be mathematically incorrect. To get output +compatible with that produced by the colormatrix filter, use fast=1. +

+
+
dither
+

Specify dithering mode. +

+

The accepted values are: +

+
none
+

No dithering +

+
+
fsb
+

Floyd-Steinberg dithering +

+
+ +
+
wpadapt
+

Whitepoint adaptation mode. +

+

The accepted values are: +

+
bradford
+

Bradford whitepoint adaptation +

+
+
vonkries
+

von Kries whitepoint adaptation +

+
+
identity
+

identity whitepoint adaptation (i.e. no whitepoint adaptation) +

+
+ +
+
iall
+

Override all input properties at once. Same accepted values as all. +

+
+
ispace
+

Override input colorspace. Same accepted values as space. +

+
+
iprimaries
+

Override input color primaries. Same accepted values as primaries. +

+
+
itrc
+

Override input transfer characteristics. Same accepted values as trc. +

+
+
irange
+

Override input color range. Same accepted values as range. +

+
+
+ +

The filter converts the transfer characteristics, color space and color +primaries to the specified user values. The output value, if not specified, +is set to a default value based on the "all" property. If that property is +also not specified, the filter will log an error. The output color range and +format default to the same value as the input color range and format. The +input transfer characteristics, color space, color primaries and color range +should be set on the input data. If any of these are missing, the filter will +log an error and no conversion will take place. +

+

For example to convert the input to SMPTE-240M, use the command: +

+
colorspace=smpte240m
+
+ +
+
+

30.41 colorspace_cuda

+ +

CUDA accelerated implementation of the colorspace filter. +

+

It is by no means feature complete compared to the software colorspace filter, +and at the current time only supports color range conversion between jpeg/full +and mpeg/limited range. +

+

The filter accepts the following options: +

+
+
range
+

Specify output color range. +

+

The accepted values are: +

+
tv
+

TV (restricted) range +

+
+
mpeg
+

MPEG (restricted) range +

+
+
pc
+

PC (full) range +

+
+
jpeg
+

JPEG (full) range +

+
+
+ +
+
+ +
+
+

30.42 colortemperature

+

Adjust color temperature in video to simulate variations in ambient color temperature. +

+

The filter accepts the following options: +

+
+
temperature
+

Set the temperature in Kelvin. Allowed range is from 1000 to 40000. +Default value is 6500 K. +

+
+
mix
+

Set mixing with filtered output. Allowed range is from 0 to 1. +Default value is 1. +

+
+
pl
+

Set the amount of preserving lightness. Allowed range is from 0 to 1. +Default value is 0. +

+
+ + +
+

30.42.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

30.43 convolution

+ +

Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements. +

+

The filter accepts the following options: +

+
+
0m
+
1m
+
2m
+
3m
+

Set matrix for each plane. +Matrix is sequence of 9, 25 or 49 signed integers in square mode, +and from 1 to 49 odd number of signed integers in row mode. +

+
+
0rdiv
+
1rdiv
+
2rdiv
+
3rdiv
+

Set multiplier for calculated value for each plane. +If unset or 0, it will be sum of all matrix elements. +

+
+
0bias
+
1bias
+
2bias
+
3bias
+

Set bias for each plane. This value is added to the result of the multiplication. +Useful for making the overall image brighter or darker. Default is 0.0. +

+
+
0mode
+
1mode
+
2mode
+
3mode
+

Set matrix mode for each plane. Can be square, row or column. +Default is square. +

+
+ + +
+

30.43.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

30.43.2 Examples

+ +
    +
  • Apply sharpen: +
    +
    convolution="0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0"
    +
    + +
  • Apply blur: +
    +
    convolution="1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9"
    +
    + +
  • Apply edge enhance: +
    +
    convolution="0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128"
    +
    + +
  • Apply edge detect: +
    +
    convolution="0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128"
    +
    + +
  • Apply laplacian edge detector which includes diagonals: +
    +
    convolution="1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0"
    +
    + +
  • Apply emboss: +
    +
    convolution="-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2"
    +
    +
+ +
+
+
+

30.44 convolve

+ +

Apply 2D convolution of video stream in frequency domain using second stream +as impulse. +

+

The filter accepts the following options: +

+
+
planes
+

Set which planes to process. +

+
+
impulse
+

Set which impulse video frames will be processed, can be first +or all. Default is all. +

+
+ +

The convolve filter also supports the framesync options. +

+
+
+

30.45 copy

+ +

Copy the input video source unchanged to the output. This is mainly useful for +testing purposes. +

+
+
+

30.46 coreimage

+

Video filtering on GPU using Apple’s CoreImage API on OSX. +

+

Hardware acceleration is based on an OpenGL context. Usually, this means it is +processed by video hardware. However, software-based OpenGL implementations +exist which means there is no guarantee for hardware processing. It depends on +the respective OSX. +

+

There are many filters and image generators provided by Apple that come with a +large variety of options. The filter has to be referenced by its name along +with its options. +

+

The coreimage filter accepts the following options: +

+
list_filters
+

List all available filters and generators along with all their respective +options as well as possible minimum and maximum values along with the default +values. +

+
list_filters=true
+
+ +
+
filter
+

Specify all filters by their respective name and options. +Use list_filters to determine all valid filter names and options. +Numerical options are specified by a float value and are automatically clamped +to their respective value range. Vector and color options have to be specified +by a list of space separated float values. Character escaping has to be done. +A special option name default is available to use default options for a +filter. +

+

It is required to specify either default or at least one of the filter options. +All omitted options are used with their default values. +The syntax of the filter string is as follows: +

+
filter=<NAME>@<OPTION>=<VALUE>[@<OPTION>=<VALUE>][@...][#<NAME>@<OPTION>=<VALUE>[@<OPTION>=<VALUE>][@...]][#...]
+
+ +
+
output_rect
+

Specify a rectangle where the output of the filter chain is copied into the +input image. It is given by a list of space separated float values: +

+
output_rect=x\ y\ width\ height
+
+

If not given, the output rectangle equals the dimensions of the input image. +The output rectangle is automatically cropped at the borders of the input +image. Negative values are valid for each component. +

+
output_rect=25\ 25\ 100\ 100
+
+
+
+ +

Several filters can be chained for successive processing without GPU-HOST +transfers allowing for fast processing of complex filter chains. +Currently, only filters with zero (generators) or exactly one (filters) input +image and one output image are supported. Also, transition filters are not yet +usable as intended. +

+

Some filters generate output images with additional padding depending on the +respective filter kernel. The padding is automatically removed to ensure the +filter output has the same size as the input image. +

+

For image generators, the size of the output image is determined by the +previous output image of the filter chain or the input image of the whole +filterchain, respectively. The generators do not use the pixel information of +this image to generate their output. However, the generated output is +blended onto this image, resulting in partial or complete coverage of the +output image. +

+

The coreimagesrc video source can be used for generating input images +which are directly fed into the filter chain. By using it, providing input +images by another video source or an input video is not required. +

+ +
+

30.46.1 Examples

+ +
    +
  • List all filters available: +
    +
    coreimage=list_filters=true
    +
    + +
  • Use the CIBoxBlur filter with default options to blur an image: +
    +
    coreimage=filter=CIBoxBlur@default
    +
    + +
  • Use a filter chain with CISepiaTone at default values and CIVignetteEffect with +its center at 100x100 and a radius of 50 pixels: +
    +
    coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
    +
    + +
  • Use nullsrc and CIQRCodeGenerator to create a QR code for the FFmpeg homepage, +given as complete and escaped command-line for Apple’s standard bash shell: +
    +
    ffmpeg -f lavfi -i nullsrc=s=100x100,coreimage=filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
    +
    +
+ +
+
+
+

30.47 corr

+ +

Obtain the correlation between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained per component, average, min and max correlation is printed through +the logging system. +

+

The filter stores the calculated correlation of each frame in frame metadata. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi corr -f null -
+
+ +
+
+

30.48 cover_rect

+ +

Cover a rectangular object +

+

It accepts the following options: +

+
+
cover
+

Filepath of the optional cover image, needs to be in yuv420. +

+
+
mode
+

Set covering mode. +

+

It accepts the following values: +

+
cover
+

cover it by the supplied image +

+
blur
+

cover it by interpolating the surrounding pixels +

+
+ +

Default value is blur. +

+
+ + +
+

30.48.1 Examples

+ +
    +
  • Cover a rectangular object by the supplied image of a given video using ffmpeg: +
    +
    ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
    +
    +
+ +
+
+
+

30.49 crop

+ +

Crop the input video to given dimensions. +

+

It accepts the following parameters: +

+
+
w, out_w
+

The width of the output video. It defaults to iw. +This expression is evaluated only once during the filter +configuration, or when the ‘w’ or ‘out_w’ command is sent. +

+
+
h, out_h
+

The height of the output video. It defaults to ih. +This expression is evaluated only once during the filter +configuration, or when the ‘h’ or ‘out_h’ command is sent. +

+
+
x
+

The horizontal position, in the input video, of the left edge of the output +video. It defaults to (in_w-out_w)/2. +This expression is evaluated per-frame. +

+
+
y
+

The vertical position, in the input video, of the top edge of the output video. +It defaults to (in_h-out_h)/2. +This expression is evaluated per-frame. +

+
+
keep_aspect
+

If set to 1 will force the output display aspect ratio +to be the same of the input, by changing the output sample aspect +ratio. It defaults to 0. +

+
+
exact
+

Enable exact cropping. If enabled, subsampled videos will be cropped at exact +width/height/x/y as specified and will not be rounded to nearest smaller value. +It defaults to 0. +

+
+ +

The out_w, out_h, x, y parameters are +expressions containing the following constants: +

+
+
x
+
y
+

The computed values for x and y. They are evaluated for +each new frame. +

+
+
in_w
+
in_h
+

The input width and height. +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (cropped) width and height. +

+
+
ow
+
oh
+

These are the same as out_w and out_h. +

+
+
a
+

same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (iw / ih) * sar +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
n
+

The number of the input frame, starting from 0. +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, +do not use +

+
+
t
+

The timestamp expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
+ +

The expression for out_w may depend on the value of out_h, +and the expression for out_h may depend on out_w, but they +cannot depend on x and y, as x and y are +evaluated after out_w and out_h. +

+

The x and y parameters specify the expressions for the +position of the top-left corner of the output (non-cropped) area. They +are evaluated for each frame. If the evaluated value is not valid, it +is approximated to the nearest valid value. +

+

The expression for x may depend on y, and the expression +for y may depend on x. +

+ +
+

30.49.1 Examples

+ +
    +
  • Crop area with size 100x100 at position (12,34). +
    +
    crop=100:100:12:34
    +
    + +

    Using named options, the example above becomes: +

    +
    crop=w=100:h=100:x=12:y=34
    +
    + +
  • Crop the central input area with size 100x100: +
    +
    crop=100:100
    +
    + +
  • Crop the central input area with size 2/3 of the input video: +
    +
    crop=2/3*in_w:2/3*in_h
    +
    + +
  • Crop the input video central square: +
    +
    crop=out_w=in_h
    +crop=in_h
    +
    + +
  • Delimit the rectangle with the top-left corner placed at position +100:100 and the right-bottom corner corresponding to the right-bottom +corner of the input image. +
    +
    crop=in_w-100:in_h-100:100:100
    +
    + +
  • Crop 10 pixels from the left and right borders, and 20 pixels from +the top and bottom borders +
    +
    crop=in_w-2*10:in_h-2*20
    +
    + +
  • Keep only the bottom right quarter of the input image: +
    +
    crop=in_w/2:in_h/2:in_w/2:in_h/2
    +
    + +
  • Crop height for getting Greek harmony: +
    +
    crop=in_w:1/PHI*in_w
    +
    + +
  • Apply trembling effect: +
    +
    crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)
    +
    + +
  • Apply erratic camera effect depending on timestamp: +
    +
    crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)
    +
    + +
  • Set x depending on the value of y: +
    +
    crop=in_w/2:in_h/2:y:10+10*sin(n/10)
    +
    +
+ +
+
+

30.49.2 Commands

+ +

This filter supports the following commands: +

+
w, out_w
+
h, out_h
+
x
+
y
+

Set width/height of the output video and the horizontal/vertical position +in the input video. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

30.50 cropdetect

+ +

Auto-detect the crop size. +

+

It calculates the necessary cropping parameters and prints the +recommended parameters via the logging system. The detected dimensions +correspond to the non-black or video area of the input video according to mode. +

+

It accepts the following parameters: +

+
+
mode
+

Depending on mode crop detection is based on either the mere black value of surrounding pixels or a combination of motion vectors and edge pixels. +

+
+
black
+

Detect black pixels surrounding the playing video. For fine control use option limit. +

+
+
mvedges
+

Detect the playing video by the motion vectors inside the video and scanning for edge pixels typically forming the border of a playing video. +

+
+ +
+
limit
+

Set higher black value threshold, which can be optionally specified +from nothing (0) to everything (255 for 8-bit based formats). An intensity +value greater to the set value is considered non-black. It defaults to 24. +You can also specify a value between 0.0 and 1.0 which will be scaled depending +on the bitdepth of the pixel format. +

+
+
round
+

The value which the width/height should be divisible by. It defaults to +16. The offset is automatically adjusted to center the video. Use 2 to +get only even dimensions (needed for 4:2:2 video). 16 is best when +encoding to most video codecs. +

+
+
skip
+

Set the number of initial frames for which evaluation is skipped. +Default is 2. Range is 0 to INT_MAX. +

+
+
reset_count, reset
+

Set the counter that determines after how many frames cropdetect will +reset the previously detected largest video area and start over to +detect the current optimal crop area. Default value is 0. +

+

This can be useful when channel logos distort the video area. 0 +indicates ’never reset’, and returns the largest area encountered during +playback. +

+
+
mv_threshold
+

Set motion in pixel units as threshold for motion detection. It defaults to 8. +

+
+
low
+
high
+

Set low and high threshold values used by the Canny thresholding +algorithm. +

+

The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. +

+

low and high threshold values must be chosen in the range +[0,1], and low should be lesser or equal to high. +

+

Default value for low is 5/255, and default value for high +is 15/255. +

+
+ + +
+

30.50.1 Examples

+ +
    +
  • Find video area surrounded by black borders: +
    +
    ffmpeg -i file.mp4 -vf cropdetect,metadata=mode=print -f null -
    +
    + +
  • Find an embedded video area, generate motion vectors beforehand: +
    +
    ffmpeg -i file.mp4 -vf mestimate,cropdetect=mode=mvedges,metadata=mode=print -f null -
    +
    + +
  • Find an embedded video area, use motion vectors from decoder: +
    +
    ffmpeg -flags2 +export_mvs -i file.mp4 -vf cropdetect=mode=mvedges,metadata=mode=print -f null -
    +
    +
+ +
+
+

30.50.2 Commands

+ +

This filter supports the following commands: +

+
+
limit
+

The command accepts the same syntax of the corresponding option. +If the specified expression is not valid, it is kept at its current value. +

+
+ +
+
+
+

30.51 cue

+ +

Delay video filtering until a given wallclock timestamp. The filter first +passes on preroll amount of frames, then it buffers at most +buffer amount of frames and waits for the cue. After reaching the cue +it forwards the buffered frames and also any subsequent frames coming in its +input. +

+

The filter can be used synchronize the output of multiple ffmpeg processes for +realtime output devices like decklink. By putting the delay in the filtering +chain and pre-buffering frames the process can pass on data to output almost +immediately after the target wallclock timestamp is reached. +

+

Perfect frame accuracy cannot be guaranteed, but the result is good enough for +some use cases. +

+
+
cue
+

The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0. +

+
+
preroll
+

The duration of content to pass on as preroll expressed in seconds. Default is 0. +

+
+
buffer
+

The maximum duration of content to buffer before waiting for the cue expressed +in seconds. Default is 0. +

+
+
+ +
+
+

30.52 curves

+ +

Apply color adjustments using curves. +

+

This filter is similar to the Adobe Photoshop and GIMP curves tools. Each +component (red, green and blue) has its values defined by N key points +tied from each other using a smooth curve. The x-axis represents the pixel +values from the input frame, and the y-axis the new pixel values to be set for +the output frame. +

+

By default, a component curve is defined by the two points (0;0) and +(1;1). This creates a straight line where each original pixel value is +"adjusted" to its own value, which means no change to the image. +

+

The filter allows you to redefine these two points and add some more. A new +curve will be define to pass smoothly through all these new coordinates. The +new defined points needs to be strictly increasing over the x-axis, and their +x and y values must be in the [0;1] interval. The curve is +formed by using a natural or monotonic cubic spline interpolation, depending +on the interp option (default: natural). The natural +spline produces a smoother curve in general while the monotonic (pchip) +spline guarantees the transitions between the specified points to be +monotonic. If the computed curves happened to go outside the vector spaces, +the values will be clipped accordingly. +

+

The filter accepts the following options: +

+
+
preset
+

Select one of the available color presets. This option can be used in addition +to the r, g, b parameters; in this case, the later +options takes priority on the preset values. +Available presets are: +

+
none
+
color_negative
+
cross_process
+
darker
+
increase_contrast
+
lighter
+
linear_contrast
+
medium_contrast
+
negative
+
strong_contrast
+
vintage
+
+

Default is none. +

+
master, m
+

Set the master key points. These points will define a second pass mapping. It +is sometimes called a "luminance" or "value" mapping. It can be used with +r, g, b or all since it acts like a +post-processing LUT. +

+
red, r
+

Set the key points for the red component. +

+
green, g
+

Set the key points for the green component. +

+
blue, b
+

Set the key points for the blue component. +

+
all
+

Set the key points for all components (not including master). +Can be used in addition to the other key points component +options. In this case, the unset component(s) will fallback on this +all setting. +

+
psfile
+

Specify a Photoshop curves file (.acv) to import the settings from. +

+
plot
+

Save Gnuplot script of the curves in specified file. +

+
interp
+

Specify the kind of interpolation. Available algorithms are: +

+
natural
+

Natural cubic spline using a piece-wise cubic polynomial that is twice continuously differentiable. +

+
pchip
+

Monotonic cubic spline using a piecewise cubic Hermite interpolating polynomial (PCHIP). +

+
+ +
+
+ +

To avoid some filtergraph syntax conflicts, each key points list need to be +defined using the following syntax: x0/y0 x1/y1 x2/y2 .... +

+ +
+

30.52.1 Commands

+ +

This filter supports same commands as options. +

+
+
+

30.52.2 Examples

+ +
    +
  • Increase slightly the middle level of blue: +
    +
    curves=blue='0/0 0.5/0.58 1/1'
    +
    + +
  • Vintage effect: +
    +
    curves=r='0/0.11 .42/.51 1/0.95':g='0/0 0.50/0.48 1/1':b='0/0.22 .49/.44 1/0.8'
    +
    +

    Here we obtain the following coordinates for each components: +

    +
    red
    +

    (0;0.11) (0.42;0.51) (1;0.95) +

    +
    green
    +

    (0;0) (0.50;0.48) (1;1) +

    +
    blue
    +

    (0;0.22) (0.49;0.44) (1;0.80) +

    +
    + +
  • The previous example can also be achieved with the associated built-in preset: +
    +
    curves=preset=vintage
    +
    + +
  • Or simply: +
    +
    curves=vintage
    +
    + +
  • Use a Photoshop preset and redefine the points of the green component: +
    +
    curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
    +
    + +
  • Check out the curves of the cross_process profile using ffmpeg +and gnuplot: +
    +
    ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
    +gnuplot -p /tmp/curves.plt
    +
    +
+ +
+
+
+

30.53 datascope

+ +

Video data analysis filter. +

+

This filter shows hexadecimal pixel values of part of video. +

+

The filter accepts the following options: +

+
+
size, s
+

Set output video size. +

+
+
x
+

Set x offset from where to pick pixels. +

+
+
y
+

Set y offset from where to pick pixels. +

+
+
mode
+

Set scope mode, can be one of the following: +

+
mono
+

Draw hexadecimal pixel values with white color on black background. +

+
+
color
+

Draw hexadecimal pixel values with input video pixel color on black +background. +

+
+
color2
+

Draw hexadecimal pixel values on color background picked from input video, +the text color is picked in such way so its always visible. +

+
+ +
+
axis
+

Draw rows and columns numbers on left and top of video. +

+
+
opacity
+

Set background opacity. +

+
+
format
+

Set display number format. Can be hex, or dec. Default is hex. +

+
+
components
+

Set pixel components to display. By default all pixel components are displayed. +

+
+ + +
+

30.53.1 Commands

+ +

This filter supports same commands as options excluding size option. +

+
+
+
+

30.54 dblur

+

Apply Directional blur filter. +

+

The filter accepts the following options: +

+
+
angle
+

Set angle of directional blur. Default is 45. +

+
+
radius
+

Set radius of directional blur. Default is 5. +

+
+
planes
+

Set which planes to filter. By default all planes are filtered. +

+
+ + +
+

30.54.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

30.55 dctdnoiz

+ +

Denoise frames using 2D DCT (frequency domain filtering). +

+

This filter is not designed for real time. +

+

The filter accepts the following options: +

+
+
sigma, s
+

Set the noise sigma constant. +

+

This sigma defines a hard threshold of 3 * sigma; every DCT +coefficient (absolute value) below this threshold with be dropped. +

+

If you need a more advanced filtering, see expr. +

+

Default is 0. +

+
+
overlap
+

Set number overlapping pixels for each block. Since the filter can be slow, you +may want to reduce this value, at the cost of a less effective filter and the +risk of various artefacts. +

+

If the overlapping value doesn’t permit processing the whole input width or +height, a warning will be displayed and according borders won’t be denoised. +

+

Default value is blocksize-1, which is the best possible setting. +

+
+
expr, e
+

Set the coefficient factor expression. +

+

For each coefficient of a DCT block, this expression will be evaluated as a +multiplier value for the coefficient. +

+

If this is option is set, the sigma option will be ignored. +

+

The absolute value of the coefficient can be accessed through the c +variable. +

+
+
n
+

Set the blocksize using the number of bits. 1<<n defines the +blocksize, which is the width and height of the processed blocks. +

+

The default value is 3 (8x8) and can be raised to 4 for a +blocksize of 16x16. Note that changing this setting has huge consequences +on the speed processing. Also, a larger block size does not necessarily means a +better de-noising. +

+
+ + +
+

30.55.1 Examples

+ +

Apply a denoise with a sigma of 4.5: +

+
dctdnoiz=4.5
+
+ +

The same operation can be achieved using the expression system: +

+
dctdnoiz=e='gte(c, 4.5*3)'
+
+ +

Violent denoise using a block size of 16x16: +

+
dctdnoiz=15:n=4
+
+ +
+
+
+

30.56 deband

+ +

Remove banding artifacts from input video. +It works by replacing banded pixels with average value of referenced pixels. +

+

The filter accepts the following options: +

+
+
1thr
+
2thr
+
3thr
+
4thr
+

Set banding detection threshold for each plane. Default is 0.02. +Valid range is 0.00003 to 0.5. +If difference between current pixel and reference pixel is less than threshold, +it will be considered as banded. +

+
+
range, r
+

Banding detection range in pixels. Default is 16. If positive, random number +in range 0 to set value will be used. If negative, exact absolute value +will be used. +The range defines square of four pixels around current pixel. +

+
+
direction, d
+

Set direction in radians from which four pixel will be compared. If positive, +random direction from 0 to set direction will be picked. If negative, exact of +absolute value will be picked. For example direction 0, -PI or -2*PI radians +will pick only pixels on same row and -PI/2 will pick only pixels on same +column. +

+
+
blur, b
+

If enabled, current pixel is compared with average value of all four +surrounding pixels. The default is enabled. If disabled current pixel is +compared with all four surrounding pixels. The pixel is considered banded +if only all four differences with surrounding pixels are less than threshold. +

+
+
coupling, c
+

If enabled, current pixel is changed if and only if all pixel components are banded, +e.g. banding detection threshold is triggered for all color components. +The default is disabled. +

+
+ + +
+

30.56.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.57 deblock

+ +

Remove blocking artifacts from input video. +

+

The filter accepts the following options: +

+
+
filter
+

Set filter type, can be weak or strong. Default is strong. +This controls what kind of deblocking is applied. +

+
+
block
+

Set size of block, allowed range is from 4 to 512. Default is 8. +

+
+
alpha
+
beta
+
gamma
+
delta
+

Set blocking detection thresholds. Allowed range is 0 to 1. +Defaults are: 0.098 for alpha and 0.05 for the rest. +Using higher threshold gives more deblocking strength. +Setting alpha controls threshold detection at exact edge of block. +Remaining options controls threshold detection near the edge. Each one for +below/above or left/right. Setting any of those to 0 disables +deblocking. +

+
+
planes
+

Set planes to filter. Default is to filter all available planes. +

+
+ + +
+

30.57.1 Examples

+ +
    +
  • Deblock using weak filter and block size of 4 pixels. +
    +
    deblock=filter=weak:block=4
    +
    + +
  • Deblock using strong filter, block size of 4 pixels and custom thresholds for +deblocking more edges. +
    +
    deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
    +
    + +
  • Similar as above, but filter only first plane. +
    +
    deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
    +
    + +
  • Similar as above, but filter only second and third plane. +
    +
    deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
    +
    +
+ +
+
+

30.57.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.58 decimate

+ +

Drop duplicated frames at regular intervals. +

+

The filter accepts the following options: +

+
+
cycle
+

Set the number of frames from which one will be dropped. Setting this to +N means one frame in every batch of N frames will be dropped. +Default is 5. +

+
+
dupthresh
+

Set the threshold for duplicate detection. If the difference metric for a frame +is less than or equal to this value, then it is declared as duplicate. Default +is 1.1 +

+
+
scthresh
+

Set scene change threshold. Default is 15. +

+
+
blockx
+
blocky
+

Set the size of the x and y-axis blocks used during metric calculations. +Larger blocks give better noise suppression, but also give worse detection of +small movements. Must be a power of two. Default is 32. +

+
+
ppsrc
+

Mark main input as a pre-processed input and activate clean source input +stream. This allows the input to be pre-processed with various filters to help +the metrics calculation while keeping the frame selection lossless. When set to +1, the first stream is for the pre-processed input, and the second +stream is the clean source from where the kept frames are chosen. Default is +0. +

+
+
chroma
+

Set whether or not chroma is considered in the metric calculations. Default is +1. +

+
+
mixed
+

Set whether or not the input only partially contains content to be decimated. +Default is false. +If enabled video output stream will be in variable frame rate. +

+
+ +
+
+

30.59 deconvolve

+ +

Apply 2D deconvolution of video stream in frequency domain using second stream +as impulse. +

+

The filter accepts the following options: +

+
+
planes
+

Set which planes to process. +

+
+
impulse
+

Set which impulse video frames will be processed, can be first +or all. Default is all. +

+
+
noise
+

Set noise when doing divisions. Default is 0.0000001. Useful when width +and height are not same and not power of 2 or if stream prior to convolving +had noise. +

+
+ +

The deconvolve filter also supports the framesync options. +

+
+
+

30.60 dedot

+ +

Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video. +

+

It accepts the following options: +

+
+
m
+

Set mode of operation. Can be combination of dotcrawl for cross-luminance reduction and/or +rainbows for cross-color reduction. +

+
+
lt
+

Set spatial luma threshold. Lower values increases reduction of cross-luminance. +

+
+
tl
+

Set tolerance for temporal luma. Higher values increases reduction of cross-luminance. +

+
+
tc
+

Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color. +

+
+
ct
+

Set temporal chroma threshold. Lower values increases reduction of cross-color. +

+
+ +
+
+

30.61 deflate

+ +

Apply deflate effect to the video. +

+

This filter replaces the pixel by the local(3x3) average by taking into account +only values lower than the pixel. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+ + +
+

30.61.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.62 deflicker

+ +

Remove temporal frame luminance variations. +

+

It accepts the following options: +

+
+
size, s
+

Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129. +

+
+
mode, m
+

Set averaging mode to smooth temporal luminance variations. +

+

Available values are: +

+
am
+

Arithmetic mean +

+
+
gm
+

Geometric mean +

+
+
hm
+

Harmonic mean +

+
+
qm
+

Quadratic mean +

+
+
cm
+

Cubic mean +

+
+
pm
+

Power mean +

+
+
median
+

Median +

+
+ +
+
bypass
+

Do not actually modify frame. Useful when one only wants metadata. +

+
+ +
+
+

30.63 dejudder

+ +

Remove judder produced by partially interlaced telecined content. +

+

Judder can be introduced, for instance, by pullup filter. If the original +source was partially telecined content then the output of pullup,dejudder +will have a variable frame rate. May change the recorded frame rate of the +container. Aside from that change, this filter will not affect constant frame +rate video. +

+

The option available in this filter is: +

+
cycle
+

Specify the length of the window over which the judder repeats. +

+

Accepts any integer greater than 1. Useful values are: +

+
4
+

If the original was telecined from 24 to 30 fps (Film to NTSC). +

+
+
5
+

If the original was telecined from 25 to 30 fps (PAL to NTSC). +

+
+
20
+

If a mixture of the two. +

+
+ +

The default is ‘4’. +

+
+ +
+ +
+

30.65 derain

+ +

Remove the rain in the input image/video by applying the derain methods based on +convolutional neural networks. Supported models: +

+ + +

Training as well as model generation scripts are provided in +the repository at https://github.com/XueweiMeng/derain_filter.git. +

+

The filter accepts the following options: +

+
+
filter_type
+

Specify which filter to use. This option accepts the following values: +

+
+
derain
+

Derain filter. To conduct derain filter, you need to use a derain model. +

+
+
dehaze
+

Dehaze filter. To conduct dehaze filter, you need to use a dehaze model. +

+
+

Default value is ‘derain’. +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +the following values: +

+
+
tensorflow
+

TensorFlow backend. To enable this backend you +need to install the TensorFlow for C library (see +https://www.tensorflow.org/install/lang_c) and configure FFmpeg with +--enable-libtensorflow +

+
+ +
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. TensorFlow can load files for only its format. +

+
+ +

To get full functionality (such as async execution), please use the dnn_processing filter. +

+
+
+

30.66 deshake

+ +

Attempt to fix small changes in horizontal and/or vertical shift. This +filter helps remove camera shake from hand-holding a camera, bumping a +tripod, moving on a vehicle, etc. +

+

The filter accepts the following options: +

+
+
x
+
y
+
w
+
h
+

Specify a rectangular area where to limit the search for motion +vectors. +If desired the search for motion vectors can be limited to a +rectangular area of the frame defined by its top left corner, width +and height. These parameters have the same meaning as the drawbox +filter which can be used to visualise the position of the bounding +box. +

+

This is useful when simultaneous movement of subjects within the frame +might be confused for camera motion by the motion vector search. +

+

If any or all of x, y, w and h are set to -1 +then the full frame is used. This allows later options to be set +without specifying the bounding box for the motion vector search. +

+

Default - search the whole frame. +

+
+
rx
+
ry
+

Specify the maximum extent of movement in x and y directions in the +range 0-64 pixels. Default 16. +

+
+
edge
+

Specify how to generate pixels to fill blanks at the edge of the +frame. Available values are: +

+
blank, 0
+

Fill zeroes at blank locations +

+
original, 1
+

Original image at blank locations +

+
clamp, 2
+

Extruded edge value at blank locations +

+
mirror, 3
+

Mirrored edge at blank locations +

+
+

Default value is ‘mirror’. +

+
+
blocksize
+

Specify the blocksize to use for motion search. Range 4-128 pixels, +default 8. +

+
+
contrast
+

Specify the contrast threshold for blocks. Only blocks with more than +the specified contrast (difference between darkest and lightest +pixels) will be considered. Range 1-255, default 125. +

+
+
search
+

Specify the search strategy. Available values are: +

+
exhaustive, 0
+

Set exhaustive search +

+
less, 1
+

Set less exhaustive search. +

+
+

Default value is ‘exhaustive’. +

+
+
filename
+

If set then a detailed log of the motion search is written to the +specified file. +

+
+
+ +
+
+

30.67 despill

+ +

Remove unwanted contamination of foreground colors, caused by reflected color of +greenscreen or bluescreen. +

+

This filter accepts the following options: +

+
+
type
+

Set what type of despill to use. +

+
+
mix
+

Set how spillmap will be generated. +

+
+
expand
+

Set how much to get rid of still remaining spill. +

+
+
red
+

Controls amount of red in spill area. +

+
+
green
+

Controls amount of green in spill area. +Should be -1 for greenscreen. +

+
+
blue
+

Controls amount of blue in spill area. +Should be -1 for bluescreen. +

+
+
brightness
+

Controls brightness of spill area, preserving colors. +

+
+
alpha
+

Modify alpha from generated spillmap. +

+
+ + +
+

30.67.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.68 detelecine

+ +

Apply an exact inverse of the telecine operation. It requires a predefined +pattern specified using the pattern option which must be the same as that passed +to the telecine filter. +

+

This filter accepts the following options: +

+
+
first_field
+
+
top, t
+

top field first +

+
bottom, b
+

bottom field first +The default value is top. +

+
+ +
+
pattern
+

A string of numbers representing the pulldown pattern you wish to apply. +The default value is 23. +

+
+
start_frame
+

A number representing position of the first frame with respect to the telecine +pattern. This is to be used if the stream is cut. The default value is 0. +

+
+ +
+
+

30.69 dilation

+ +

Apply dilation effect to the video. +

+

This filter replaces the pixel by the local(3x3) maximum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. Default is 255 i.e. all eight +pixels are used. +

+

Flags to local 3x3 coordinates maps like this: +

+

1 2 3 + 4 5 + 6 7 8 +

+
+ + +
+

30.69.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.70 displace

+ +

Displace pixels as indicated by second and third input stream. +

+

It takes three input streams and outputs one stream, the first input is the +source, and second and third input are displacement maps. +

+

The second input specifies how much to displace pixels along the +x-axis, while the third input specifies how much to displace pixels +along the y-axis. +If one of displacement map streams terminates, last frame from that +displacement map will be used. +

+

Note that once generated, displacements maps can be reused over and over again. +

+

A description of the accepted options follows. +

+
+
edge
+

Set displace behavior for pixels that are out of range. +

+

Available values are: +

+
blank
+

Missing pixels are replaced by black pixels. +

+
+
smear
+

Adjacent pixels will spread out to replace missing pixels. +

+
+
wrap
+

Out of range pixels are wrapped so they point to pixels of other side. +

+
+
mirror
+

Out of range pixels will be replaced with mirrored pixels. +

+
+

Default is ‘smear’. +

+
+
+ + +
+

30.70.1 Examples

+ +
    +
  • Add ripple effect to rgb input of video size hd720: +
    +
    ffmpeg -i INPUT -f lavfi -i nullsrc=s=hd720,lutrgb=128:128:128 -f lavfi -i nullsrc=s=hd720,geq='r=128+30*sin(2*PI*X/400+T):g=128+30*sin(2*PI*X/400+T):b=128+30*sin(2*PI*X/400+T)' -lavfi '[0][1][2]displace' OUTPUT
    +
    + +
  • Add wave effect to rgb input of video size hd720: +
    +
    ffmpeg -i INPUT -f lavfi -i nullsrc=hd720,geq='r=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):g=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):b=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T))' -lavfi '[1]split[x][y],[0][x][y]displace' OUTPUT
    +
    +
+ +
+
+
+

30.71 dnn_classify

+ +

Do classification with deep neural networks based on bounding boxes. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +only openvino now, tensorflow backends will be added. +

+
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. +

+
+
input
+

Set the input name of the dnn network. +

+
+
output
+

Set the output name of the dnn network. +

+
+
confidence
+

Set the confidence threshold (default: 0.5). +

+
+
labels
+

Set path to label file specifying the mapping between label id and name. +Each label name is written in one line, tailing spaces and empty lines are skipped. +The first line is the name of label id 0, +and the second line is the name of label id 1, etc. +The label id is considered as name if the label file is not provided. +

+
+
backend_configs
+

Set the configs to be passed into backend +

+

For tensorflow backend, you can set its configs with sess_config options, +please use tools/python/tf_sess_config.py to get the configs for your system. +

+
+
+ +
+
+

30.72 dnn_detect

+ +

Do object detection with deep neural networks. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +only openvino now, tensorflow backends will be added. +

+
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. +

+
+
input
+

Set the input name of the dnn network. +

+
+
output
+

Set the output name of the dnn network. +

+
+
confidence
+

Set the confidence threshold (default: 0.5). +

+
+
labels
+

Set path to label file specifying the mapping between label id and name. +Each label name is written in one line, tailing spaces and empty lines are skipped. +The first line is the name of label id 0 (usually it is ’background’), +and the second line is the name of label id 1, etc. +The label id is considered as name if the label file is not provided. +

+
+
backend_configs
+

Set the configs to be passed into backend. To use async execution, set async (default: set). +Roll back to sync execution if the backend does not support async. +

+
+
+ +
+
+

30.73 dnn_processing

+ +

Do image processing with deep neural networks. It works together with another filter +which converts the pixel format of the Frame to what the dnn network requires. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +the following values: +

+
+
tensorflow
+

TensorFlow backend. To enable this backend you +need to install the TensorFlow for C library (see +https://www.tensorflow.org/install/lang_c) and configure FFmpeg with +--enable-libtensorflow +

+
+
openvino
+

OpenVINO backend. To enable this backend you +need to build and install the OpenVINO for C library (see +https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md) and configure FFmpeg with +--enable-libopenvino (–extra-cflags=-I... –extra-ldflags=-L... might +be needed if the header files and libraries are not installed into system path) +

+
+
+ +
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. TensorFlow, OpenVINO backend can load files for only its format. +

+
+
input
+

Set the input name of the dnn network. +

+
+
output
+

Set the output name of the dnn network. +

+
+
backend_configs
+

Set the configs to be passed into backend. To use async execution, set async (default: set). +Roll back to sync execution if the backend does not support async. +

+

For tensorflow backend, you can set its configs with sess_config options, +please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system. +

+
+
+ + +
+

30.73.1 Examples

+ +
    +
  • Remove rain in rgb24 frame with can.pb (see derain filter): +
    +
    ./ffmpeg -i rain.jpg -vf format=rgb24,dnn_processing=dnn_backend=tensorflow:model=can.pb:input=x:output=y derain.jpg
    +
    + +
  • Handle the Y channel with srcnn.pb (see sr filter) for frame with yuv420p (planar YUV formats supported): +
    +
    ./ffmpeg -i 480p.jpg -vf format=yuv420p,scale=w=iw*2:h=ih*2,dnn_processing=dnn_backend=tensorflow:model=srcnn.pb:input=x:output=y -y srcnn.jpg
    +
    + +
  • Handle the Y channel with espcn.pb (see sr filter), which changes frame size, for format yuv420p (planar YUV formats supported), +please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system. +
    +
    ./ffmpeg -i 480p.jpg -vf format=yuv420p,dnn_processing=dnn_backend=tensorflow:model=espcn.pb:input=x:output=y:backend_configs=sess_config=0x10022805320e09cdccccccccccec3f20012a01303801 -y tmp.espcn.jpg
    +
    + +
+ +
+
+
+

30.74 drawbox

+ +

Draw a colored box on the input image. +

+

It accepts the following parameters: +

+
+
x
+
y
+

The expressions which specify the top left corner coordinates of the box. It defaults to 0. +

+
+
width, w
+
height, h
+

The expressions which specify the width and height of the box; if 0 they are interpreted as +the input width and height. It defaults to 0. +

+
+
color, c
+

Specify the color of the box to write. For the general syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. If the special +value invert is used, the box edge color is the same as the +video with inverted luma. +

+
+
thickness, t
+

The expression which sets the thickness of the box edge. +A value of fill will create a filled box. Default value is 3. +

+

See below for the list of accepted constants. +

+
+
replace
+

Applicable if the input has alpha. With value 1, the pixels of the painted box +will overwrite the video’s color and alpha pixels. +Default is 0, which composites the box onto the input, leaving the video’s alpha intact. +

+
+ +

The parameters for x, y, w and h and t are expressions containing the +following constants: +

+
+
dar
+

The input display aspect ratio, it is the same as (w / h) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
in_h, ih
+
in_w, iw
+

The input width and height. +

+
+
sar
+

The input sample aspect ratio. +

+
+
x
+
y
+

The x and y offset coordinates where the box is drawn. +

+
+
w
+
h
+

The width and height of the drawn box. +

+
+
box_source
+

Box source can be set as side_data_detection_bboxes if you want to use box data in +detection bboxes of side data. +

+

If box_source is set, the x, y, width and height will be ignored and +still use box data in detection bboxes of side data. So please do not use this parameter if you were +not sure about the box source. +

+
+
t
+

The thickness of the drawn box. +

+

These constants allow the x, y, w, h and t expressions to refer to +each other, so you may for example specify y=x/dar or h=w/dar. +

+
+
+ + +
+

30.74.1 Examples

+ +
    +
  • Draw a black box around the edge of the input image: +
    +
    drawbox
    +
    + +
  • Draw a box with color red and an opacity of 50%: +
    +
    drawbox=10:20:200:60:red@0.5
    +
    + +

    The previous example can be specified as: +

    +
    drawbox=x=10:y=20:w=200:h=60:color=red@0.5
    +
    + +
  • Fill the box with pink color: +
    +
    drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
    +
    + +
  • Draw a 2-pixel red 2.40:1 mask: +
    +
    drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
    +
    +
+ +
+
+

30.74.2 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

30.75 drawgraph

+

Draw a graph using input video metadata. +

+

It accepts the following parameters: +

+
+
m1
+

Set 1st frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg1
+

Set 1st foreground color expression. +

+
+
m2
+

Set 2nd frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg2
+

Set 2nd foreground color expression. +

+
+
m3
+

Set 3rd frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg3
+

Set 3rd foreground color expression. +

+
+
m4
+

Set 4th frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg4
+

Set 4th foreground color expression. +

+
+
min
+

Set minimal value of metadata value. +

+
+
max
+

Set maximal value of metadata value. +

+
+
bg
+

Set graph background color. Default is white. +

+
+
mode
+

Set graph mode. +

+

Available values for mode is: +

+
bar
+
dot
+
line
+
+ +

Default is line. +

+
+
slide
+

Set slide mode. +

+

Available values for slide is: +

+
frame
+

Draw new frame when right border is reached. +

+
+
replace
+

Replace old columns with new ones. +

+
+
scroll
+

Scroll from right to left. +

+
+
rscroll
+

Scroll from left to right. +

+
+
picture
+

Draw single picture. +

+
+ +

Default is frame. +

+
+
size
+

Set size of graph video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +The default value is 900x256. +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+

The foreground color expressions can use the following variables: +

+
MIN
+

Minimal value of metadata value. +

+
+
MAX
+

Maximal value of metadata value. +

+
+
VAL
+

Current metadata key value. +

+
+ +

The color is defined as 0xAABBGGRR. +

+
+ +

Example using metadata from signalstats filter: +

+
signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
+
+ +

Example using metadata from ebur128 filter: +

+
ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
+
+ +
+
+

30.76 drawgrid

+ +

Draw a grid on the input image. +

+

It accepts the following parameters: +

+
+
x
+
y
+

The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0. +

+
+
width, w
+
height, h
+

The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the +input width and height, respectively, minus thickness, so image gets +framed. Default to 0. +

+
+
color, c
+

Specify the color of the grid. For the general syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. If the special +value invert is used, the grid color is the same as the +video with inverted luma. +

+
+
thickness, t
+

The expression which sets the thickness of the grid line. Default value is 1. +

+

See below for the list of accepted constants. +

+
+
replace
+

Applicable if the input has alpha. With 1 the pixels of the painted grid +will overwrite the video’s color and alpha pixels. +Default is 0, which composites the grid onto the input, leaving the video’s alpha intact. +

+
+ +

The parameters for x, y, w and h and t are expressions containing the +following constants: +

+
+
dar
+

The input display aspect ratio, it is the same as (w / h) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
in_h, ih
+
in_w, iw
+

The input grid cell width and height. +

+
+
sar
+

The input sample aspect ratio. +

+
+
x
+
y
+

The x and y coordinates of some point of grid intersection (meant to configure offset). +

+
+
w
+
h
+

The width and height of the drawn cell. +

+
+
t
+

The thickness of the drawn cell. +

+

These constants allow the x, y, w, h and t expressions to refer to +each other, so you may for example specify y=x/dar or h=w/dar. +

+
+
+ + +
+

30.76.1 Examples

+ +
    +
  • Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%: +
    +
    drawgrid=width=100:height=100:thickness=2:color=red@0.5
    +
    + +
  • Draw a white 3x3 grid with an opacity of 50%: +
    +
    drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
    +
    +
+ +
+
+

30.76.2 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

30.77 drawtext

+ +

Draw a text string or text from a specified file on top of a video, using the +libfreetype library. +

+

To enable compilation of this filter, you need to configure FFmpeg with +--enable-libfreetype. +To enable default font fallback and the font option you need to +configure FFmpeg with --enable-libfontconfig. +To enable the text_shaping option, you need to configure FFmpeg with +--enable-libfribidi. +

+ +
+

30.77.1 Syntax

+ +

It accepts the following parameters: +

+
+
box
+

Used to draw a box around text using the background color. +The value must be either 1 (enable) or 0 (disable). +The default value of box is 0. +

+
+
boxborderw
+

Set the width of the border to be drawn around the box using boxcolor. +The default value of boxborderw is 0. +

+
+
boxcolor
+

The color to be used for drawing box around text. For the syntax of this +option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+

The default value of boxcolor is "white". +

+
+
line_spacing
+

Set the line spacing in pixels of the border to be drawn around the box using box. +The default value of line_spacing is 0. +

+
+
borderw
+

Set the width of the border to be drawn around the text using bordercolor. +The default value of borderw is 0. +

+
+
bordercolor
+

Set the color to be used for drawing border around text. For the syntax of this +option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+

The default value of bordercolor is "black". +

+
+
expansion
+

Select how the text is expanded. Can be either none, +strftime (deprecated) or normal (default). See the +Text expansion section below for details. +

+
+
basetime
+

Set a start time for the count. Value is in microseconds. Only applied +in the deprecated strftime expansion mode. To emulate in normal expansion +mode use the pts function, supplying the start time (in seconds) +as the second argument. +

+
+
fix_bounds
+

If true, check and fix text coords to avoid clipping. +

+
+
fontcolor
+

The color to be used for drawing fonts. For the syntax of this option, check +the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+

The default value of fontcolor is "black". +

+
+
fontcolor_expr
+

String which is expanded the same way as text to obtain dynamic +fontcolor value. By default this option has empty value and is not +processed. When this option is set, it overrides fontcolor option. +

+
+
font
+

The font family to be used for drawing text. By default Sans. +

+
+
fontfile
+

The font file to be used for drawing text. The path must be included. +This parameter is mandatory if the fontconfig support is disabled. +

+
+
alpha
+

Draw the text applying alpha blending. The value can +be a number between 0.0 and 1.0. +The expression accepts the same variables x, y as well. +The default value is 1. +Please see fontcolor_expr. +

+
+
fontsize
+

The font size to be used for drawing text. +The default value of fontsize is 16. +

+
+
text_shaping
+

If set to 1, attempt to shape the text (for example, reverse the order of +right-to-left text and join Arabic characters) before drawing it. +Otherwise, just draw the text exactly as given. +By default 1 (if supported). +

+
+
ft_load_flags
+

The flags to be used for loading the fonts. +

+

The flags map the corresponding flags supported by libfreetype, and are +a combination of the following values: +

+
default
+
no_scale
+
no_hinting
+
render
+
no_bitmap
+
vertical_layout
+
force_autohint
+
crop_bitmap
+
pedantic
+
ignore_global_advance_width
+
no_recurse
+
ignore_transform
+
monochrome
+
linear_design
+
no_autohint
+
+ +

Default value is "default". +

+

For more information consult the documentation for the FT_LOAD_* +libfreetype flags. +

+
+
shadowcolor
+

The color to be used for drawing a shadow behind the drawn text. For the +syntax of this option, check the (ffmpeg-utils)"Color" section in the +ffmpeg-utils manual. +

+

The default value of shadowcolor is "black". +

+
+
shadowx
+
shadowy
+

The x and y offsets for the text shadow position with respect to the +position of the text. They can be either positive or negative +values. The default value for both is "0". +

+
+
start_number
+

The starting frame number for the n/frame_num variable. The default value +is "0". +

+
+
tabsize
+

The size in number of spaces to use for rendering the tab. +Default value is 4. +

+
+
timecode
+

Set the initial timecode representation in "hh:mm:ss[:;.]ff" +format. It can be used with or without text parameter. timecode_rate +option must be specified. +

+
+
timecode_rate, rate, r
+

Set the timecode frame rate (timecode only). Value will be rounded to nearest +integer. Minimum value is "1". +Drop-frame timecode is supported for frame rates 30 & 60. +

+
+
tc24hmax
+

If set to 1, the output of the timecode option will wrap around at 24 hours. +Default is 0 (disabled). +

+
+
text
+

The text string to be drawn. The text must be a sequence of UTF-8 +encoded characters. +This parameter is mandatory if no file is specified with the parameter +textfile. +

+
+
textfile
+

A text file containing text to be drawn. The text must be a sequence +of UTF-8 encoded characters. +

+

This parameter is mandatory if no text string is specified with the +parameter text. +

+

If both text and textfile are specified, an error is thrown. +

+
+
text_source
+

Text source should be set as side_data_detection_bboxes if you want to use text data in +detection bboxes of side data. +

+

If text source is set, text and textfile will be ignored and still use +text data in detection bboxes of side data. So please do not use this parameter +if you are not sure about the text source. +

+
+
reload
+

The textfile will be reloaded at specified frame interval. +Be sure to update textfile atomically, or it may be read partially, +or even fail. +Range is 0 to INT_MAX. Default is 0. +

+
+
x
+
y
+

The expressions which specify the offsets where text will be drawn +within the video frame. They are relative to the top/left border of the +output image. +

+

The default value of x and y is "0". +

+

See below for the list of accepted constants and functions. +

+
+ +

The parameters for x and y are expressions containing the +following constants and functions: +

+
+
dar
+

input display aspect ratio, it is the same as (w / h) * sar +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
line_h, lh
+

the height of each text line +

+
+
main_h, h, H
+

the input height +

+
+
main_w, w, W
+

the input width +

+
+
max_glyph_a, ascent
+

the maximum distance from the baseline to the highest/upper grid +coordinate used to place a glyph outline point, for all the rendered +glyphs. +It is a positive value, due to the grid’s orientation with the Y axis +upwards. +

+
+
max_glyph_d, descent
+

the maximum distance from the baseline to the lowest grid coordinate +used to place a glyph outline point, for all the rendered glyphs. +This is a negative value, due to the grid’s orientation, with the Y axis +upwards. +

+
+
max_glyph_h
+

maximum glyph height, that is the maximum height for all the glyphs +contained in the rendered text, it is equivalent to ascent - +descent. +

+
+
max_glyph_w
+

maximum glyph width, that is the maximum width for all the glyphs +contained in the rendered text +

+
+
n
+

the number of input frame, starting from 0 +

+
+
rand(min, max)
+

return a random number included between min and max +

+
+
sar
+

The input sample aspect ratio. +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
text_h, th
+

the height of the rendered text +

+
+
text_w, tw
+

the width of the rendered text +

+
+
x
+
y
+

the x and y offset coordinates where the text is drawn. +

+

These parameters allow the x and y expressions to refer +to each other, so you can for example specify y=x/dar. +

+
+
pict_type
+

A one character description of the current frame’s picture type. +

+
+
pkt_pos
+

The current packet’s position in the input file or stream +(in bytes, from the start of the input). A value of -1 indicates +this info is not available. +

+
+
duration
+

The current packet’s duration, in seconds. +

+
+
pkt_size
+

The current packet’s size (in bytes). +

+
+ +
+
+

30.77.2 Text expansion

+ +

If expansion is set to strftime, the filter recognizes +sequences accepted by the strftime C function in the provided +text and expands them accordingly. Check the documentation of +strftime. This feature is deprecated in favor of normal +expansion with the gmtime or localtime expansion +functions. +

+

If expansion is set to none, the text is printed verbatim. +

+

If expansion is set to normal (which is the default), +the following expansion mechanism is used. +

+

The backslash character ‘\’, followed by any character, always expands to +the second character. +

+

Sequences of the form %{...} are expanded. The text between the +braces is a function name, possibly followed by arguments separated by ’:’. +If the arguments contain special characters or delimiters (’:’ or ’}’), +they should be escaped. +

+

Note that they probably must also be escaped as the value for the text +option in the filter argument string and as the filter argument in the +filtergraph description, and possibly also for the shell, that makes up to four +levels of escaping; using a text file with the textfile option avoids +these problems. +

+

The following functions are available: +

+
+
expr, e
+

The expression evaluation result. +

+

It must take one argument specifying the expression to be evaluated, +which accepts the same constants and functions as the x and +y values. Note that not all constants should be used, for +example the text size is not known when evaluating the expression, so +the constants text_w and text_h will have an undefined +value. +

+
+
expr_int_format, eif
+

Evaluate the expression’s value and output as formatted integer. +

+

The first argument is the expression to be evaluated, just as for the expr function. +The second argument specifies the output format. Allowed values are ‘x’, +‘X’, ‘d’ and ‘u’. They are treated exactly as in the +printf function. +The third parameter is optional and sets the number of positions taken by the output. +It can be used to add padding with zeros from the left. +

+
+
gmtime
+

The time at which the filter is running, expressed in UTC. +It can accept an argument: a strftime C function format string. +The format string is extended to support the variable %[1-6]N +which prints fractions of the second with optionally specified number of digits. +

+
+
localtime
+

The time at which the filter is running, expressed in the local time zone. +It can accept an argument: a strftime C function format string. +The format string is extended to support the variable %[1-6]N +which prints fractions of the second with optionally specified number of digits. +

+
+
metadata
+

Frame metadata. Takes one or two arguments. +

+

The first argument is mandatory and specifies the metadata key. +

+

The second argument is optional and specifies a default value, used when the +metadata key is not found or empty. +

+

Available metadata can be identified by inspecting entries +starting with TAG included within each frame section +printed by running ffprobe -show_frames. +

+

String metadata generated in filters leading to +the drawtext filter are also available. +

+
+
n, frame_num
+

The frame number, starting from 0. +

+
+
pict_type
+

A one character description of the current picture type. +

+
+
pts
+

The timestamp of the current frame. +It can take up to three arguments. +

+

The first argument is the format of the timestamp; it defaults to flt +for seconds as a decimal number with microsecond accuracy; hms stands +for a formatted [-]HH:MM:SS.mmm timestamp with millisecond accuracy. +gmtime stands for the timestamp of the frame formatted as UTC time; +localtime stands for the timestamp of the frame formatted as +local time zone time. +

+

The second argument is an offset added to the timestamp. +

+

If the format is set to hms, a third argument 24HH may be +supplied to present the hour part of the formatted timestamp in 24h format +(00-23). +

+

If the format is set to localtime or gmtime, a third +argument may be supplied: a strftime C function format string. +By default, YYYY-MM-DD HH:MM:SS format will be used. +

+
+ +
+
+

30.77.3 Commands

+ +

This filter supports altering parameters via commands: +

+
reinit
+

Alter existing filter parameters. +

+

Syntax for the argument is the same as for filter invocation, e.g. +

+
+
fontsize=56:fontcolor=green:text='Hello World'
+
+ +

Full filter invocation with sendcmd would look like this: +

+
+
sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
+
+
+
+ +

If the entire argument can’t be parsed or applied as valid values then the filter will +continue with its existing parameters. +

+
+
+

30.77.4 Examples

+ +
    +
  • Draw "Test Text" with font FreeSerif, using the default values for the +optional parameters. + +
    +
    drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
    +
    + +
  • Draw ’Test Text’ with font FreeSerif of size 24 at position x=100 +and y=50 (counting from the top-left corner of the screen), text is +yellow with a red box around it. Both the text and the box have an +opacity of 20%. + +
    +
    drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
    +          x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
    +
    + +

    Note that the double quotes are not necessary if spaces are not used +within the parameter list. +

    +
  • Show the text at the center of the video frame: +
    +
    drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2"
    +
    + +
  • Show the text at a random position, switching to a new position every 30 seconds: +
    +
    drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=if(eq(mod(t\,30)\,0)\,rand(0\,(w-text_w))\,x):y=if(eq(mod(t\,30)\,0)\,rand(0\,(h-text_h))\,y)"
    +
    + +
  • Show a text line sliding from right to left in the last row of the video +frame. The file LONG_LINE is assumed to contain a single line +with no newlines. +
    +
    drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"
    +
    + +
  • Show the content of file CREDITS off the bottom of the frame and scroll up. +
    +
    drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t"
    +
    + +
  • Draw a single green letter "g", at the center of the input video. +The glyph baseline is placed at half screen height. +
    +
    drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent"
    +
    + +
  • Show text for 1 second every 3 seconds: +
    +
    drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'"
    +
    + +
  • Use fontconfig to set the font. Note that the colons need to be escaped. +
    +
    drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
    +
    + +
  • Draw "Test Text" with font size dependent on height of the video. +
    +
    drawtext="text='Test Text': fontsize=h/30: x=(w-text_w)/2: y=(h-text_h*2)"
    +
    + +
  • Print the date of a real-time encoding (see documentation for the +strftime C function): +
    +
    drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
    +
    + +
  • Show text fading in and out (appearing/disappearing): +
    +
    #!/bin/sh
    +DS=1.0 # display start
    +DE=10.0 # display end
    +FID=1.5 # fade in duration
    +FOD=5 # fade out duration
    +ffplay -f lavfi "color,drawtext=text=TEST:fontsize=50:fontfile=FreeSerif.ttf:fontcolor_expr=ff0000%{eif\\\\: clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - $DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE - $FOD\\, $DE) )\\, 0\\, 255) \\\\: x\\\\: 2 }"
    +
    + +
  • Horizontally align multiple separate texts. Note that max_glyph_a +and the fontsize value are included in the y offset. +
    +
    drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
    +drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
    +
    + +
  • Plot special lavf.image2dec.source_basename metadata onto each frame if +such metadata exists. Otherwise, plot the string "NA". Note that image2 demuxer +must have option -export_path_metadata 1 for the special metadata fields +to be available for filters. +
    +
    drawtext="fontsize=20:fontcolor=white:fontfile=FreeSans.ttf:text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=10:y=10"
    +
    + +
+ +

For more information about libfreetype, check: +http://www.freetype.org/. +

+

For more information about fontconfig, check: +http://freedesktop.org/software/fontconfig/fontconfig-user.html. +

+

For more information about libfribidi, check: +http://fribidi.org/. +

+
+
+
+

30.78 edgedetect

+ +

Detect and draw edges. The filter uses the Canny Edge Detection algorithm. +

+

The filter accepts the following options: +

+
+
low
+
high
+

Set low and high threshold values used by the Canny thresholding +algorithm. +

+

The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. +

+

low and high threshold values must be chosen in the range +[0,1], and low should be lesser or equal to high. +

+

Default value for low is 20/255, and default value for high +is 50/255. +

+
+
mode
+

Define the drawing mode. +

+
+
wires
+

Draw white/gray wires on black background. +

+
+
colormix
+

Mix the colors to create a paint/cartoon effect. +

+
+
canny
+

Apply Canny edge detector on all selected planes. +

+
+

Default value is wires. +

+
+
planes
+

Select planes for filtering. By default all available planes are filtered. +

+
+ + +
+

30.78.1 Examples

+ +
    +
  • Standard edge detection with custom values for the hysteresis thresholding: +
    +
    edgedetect=low=0.1:high=0.4
    +
    + +
  • Painting effect without thresholding: +
    +
    edgedetect=mode=colormix:high=0
    +
    +
+ +
+
+
+

30.79 elbg

+ +

Apply a posterize effect using the ELBG (Enhanced LBG) algorithm. +

+

For each input image, the filter will compute the optimal mapping from +the input to the output given the codebook length, that is the number +of distinct output colors. +

+

This filter accepts the following options. +

+
+
codebook_length, l
+

Set codebook length. The value must be a positive integer, and +represents the number of distinct output colors. Default value is 256. +

+
+
nb_steps, n
+

Set the maximum number of iterations to apply for computing the optimal +mapping. The higher the value the better the result and the higher the +computation time. Default value is 1. +

+
+
seed, s
+

Set a random seed, must be an integer included between 0 and +UINT32_MAX. If not specified, or if explicitly set to -1, the filter +will try to use a good random seed on a best effort basis. +

+
+
pal8
+

Set pal8 output pixel format. This option does not work with codebook +length greater than 256. Default is disabled. +

+
+
use_alpha
+

Include alpha values in the quantization calculation. Allows creating +palettized output images (e.g. PNG8) with multiple alpha smooth blending. +

+
+ +
+
+

30.80 entropy

+ +

Measure graylevel entropy in histogram of color channels of video frames. +

+

It accepts the following parameters: +

+
+
mode
+

Can be either normal or diff. Default is normal. +

+

diff mode measures entropy of histogram delta values, absolute differences +between neighbour histogram values. +

+
+ +
+
+

30.81 epx

+

Apply the EPX magnification filter which is designed for pixel art. +

+

It accepts the following option: +

+
+
n
+

Set the scaling dimension: 2 for 2xEPX, 3 for +3xEPX. +Default is 3. +

+
+ +
+
+

30.82 eq

+

Set brightness, contrast, saturation and approximate gamma adjustment. +

+

The filter accepts the following options: +

+
+
contrast
+

Set the contrast expression. The value must be a float value in range +-1000.0 to 1000.0. The default value is "1". +

+
+
brightness
+

Set the brightness expression. The value must be a float value in +range -1.0 to 1.0. The default value is "0". +

+
+
saturation
+

Set the saturation expression. The value must be a float in +range 0.0 to 3.0. The default value is "1". +

+
+
gamma
+

Set the gamma expression. The value must be a float in range +0.1 to 10.0. The default value is "1". +

+
+
gamma_r
+

Set the gamma expression for red. The value must be a float in +range 0.1 to 10.0. The default value is "1". +

+
+
gamma_g
+

Set the gamma expression for green. The value must be a float in range +0.1 to 10.0. The default value is "1". +

+
+
gamma_b
+

Set the gamma expression for blue. The value must be a float in range +0.1 to 10.0. The default value is "1". +

+
+
gamma_weight
+

Set the gamma weight expression. It can be used to reduce the effect +of a high gamma value on bright image areas, e.g. keep them from +getting overamplified and just plain white. The value must be a float +in range 0.0 to 1.0. A value of 0.0 turns the +gamma correction all the way down while 1.0 leaves it at its +full strength. Default is "1". +

+
+
eval
+

Set when the expressions for brightness, contrast, saturation and +gamma expressions are evaluated. +

+

It accepts the following values: +

+
init
+

only evaluate expressions once during the filter initialization or +when a command is processed +

+
+
frame
+

evaluate expressions for each incoming frame +

+
+ +

Default value is ‘init’. +

+
+ +

The expressions accept the following parameters: +

+
n
+

frame count of the input frame starting from 0 +

+
+
pos
+

byte position of the corresponding packet in the input file, NAN if +unspecified; deprecated, do not use +

+
+
r
+

frame rate of the input video, NAN if the input frame rate is unknown +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+ + +
+

30.82.1 Commands

+

The filter supports the following commands: +

+
+
contrast
+

Set the contrast expression. +

+
+
brightness
+

Set the brightness expression. +

+
+
saturation
+

Set the saturation expression. +

+
+
gamma
+

Set the gamma expression. +

+
+
gamma_r
+

Set the gamma_r expression. +

+
+
gamma_g
+

Set gamma_g expression. +

+
+
gamma_b
+

Set gamma_b expression. +

+
+
gamma_weight
+

Set gamma_weight expression. +

+

The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+ +
+
+
+

30.83 erosion

+ +

Apply erosion effect to the video. +

+

This filter replaces the pixel by the local(3x3) minimum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. Default is 255 i.e. all eight +pixels are used. +

+

Flags to local 3x3 coordinates maps like this: +

+

1 2 3 + 4 5 + 6 7 8 +

+
+ + +
+

30.83.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.84 estdif

+ +

Deinterlace the input video ("estdif" stands for "Edge Slope +Tracing Deinterlacing Filter"). +

+

Spatial only filter that uses edge slope tracing algorithm +to interpolate missing lines. +It accepts the following parameters: +

+
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
frame
+

Output one frame for each frame. +

+
field
+

Output one frame for each field. +

+
+ +

The default value is field. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
tff
+

Assume the top field is first. +

+
bff
+

Assume the bottom field is first. +

+
auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
all
+

Deinterlace all frames. +

+
interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+
rslope
+

Specify the search radius for edge slope tracing. Default value is 1. +Allowed range is from 1 to 15. +

+
+
redge
+

Specify the search radius for best edge matching. Default value is 2. +Allowed range is from 0 to 15. +

+
+
ecost
+

Specify the edge cost for edge matching. Default value is 2. +Allowed range is from 0 to 50. +

+
+
mcost
+

Specify the middle cost for edge matching. Default value is 1. +Allowed range is from 0 to 50. +

+
+
dcost
+

Specify the distance cost for edge matching. Default value is 1. +Allowed range is from 0 to 50. +

+
+
interp
+

Specify the interpolation used. Default is 4-point interpolation. It accepts one +of the following values: +

+
+
2p
+

Two-point interpolation. +

+
4p
+

Four-point interpolation. +

+
6p
+

Six-point interpolation. +

+
+
+
+ + +
+

30.84.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

30.85 exposure

+

Adjust exposure of the video stream. +

+

The filter accepts the following options: +

+
+
exposure
+

Set the exposure correction in EV. Allowed range is from -3.0 to 3.0 EV +Default value is 0 EV. +

+
+
black
+

Set the black level correction. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+ + +
+

30.85.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

30.86 extractplanes

+ +

Extract color channel components from input video stream into +separate grayscale video streams. +

+

The filter accepts the following option: +

+
+
planes
+

Set plane(s) to extract. +

+

Available values for planes are: +

+
y
+
u
+
v
+
a
+
r
+
g
+
b
+
+ +

Choosing planes not available in the input will result in an error. +That means you cannot select r, g, b planes +with y, u, v planes at same time. +

+
+ + +
+

30.86.1 Examples

+ +
    +
  • Extract luma, u and v color channel component from input video frame +into 3 grayscale outputs: +
    +
    ffmpeg -i video.avi -filter_complex 'extractplanes=y+u+v[y][u][v]' -map '[y]' y.avi -map '[u]' u.avi -map '[v]' v.avi
    +
    +
+ +
+
+
+

30.87 fade

+ +

Apply a fade-in/out effect to the input video. +

+

It accepts the following parameters: +

+
+
type, t
+

The effect type can be either "in" for a fade-in, or "out" for a fade-out +effect. +Default is in. +

+
+
start_frame, s
+

Specify the number of the frame to start applying the fade +effect at. Default is 0. +

+
+
nb_frames, n
+

The number of frames that the fade effect lasts. At the end of the +fade-in effect, the output video will have the same intensity as the input video. +At the end of the fade-out transition, the output video will be filled with the +selected color. +Default is 25. +

+
+
alpha
+

If set to 1, fade only alpha channel, if one exists on the input. +Default value is 0. +

+
+
start_time, st
+

Specify the timestamp (in seconds) of the frame to start to apply the fade +effect. If both start_frame and start_time are specified, the fade will start at +whichever comes last. Default is 0. +

+
+
duration, d
+

The number of seconds for which the fade effect has to last. At the end of the +fade-in effect the output video will have the same intensity as the input video, +at the end of the fade-out transition the output video will be filled with the +selected color. +If both duration and nb_frames are specified, duration is used. Default is 0 +(nb_frames is used by default). +

+
+
color, c
+

Specify the color of the fade. Default is "black". +

+
+ + +
+

30.87.1 Examples

+ +
    +
  • Fade in the first 30 frames of video: +
    +
    fade=in:0:30
    +
    + +

    The command above is equivalent to: +

    +
    fade=t=in:s=0:n=30
    +
    + +
  • Fade out the last 45 frames of a 200-frame video: +
    +
    fade=out:155:45
    +fade=type=out:start_frame=155:nb_frames=45
    +
    + +
  • Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video: +
    +
    fade=in:0:25, fade=out:975:25
    +
    + +
  • Make the first 5 frames yellow, then fade in from frame 5-24: +
    +
    fade=in:5:20:color=yellow
    +
    + +
  • Fade in alpha over first 25 frames of video: +
    +
    fade=in:0:25:alpha=1
    +
    + +
  • Make the first 5.5 seconds black, then fade in for 0.5 seconds: +
    +
    fade=t=in:st=5.5:d=0.5
    +
    + +
+ +
+
+
+

30.88 feedback

+

Apply feedback video filter. +

+

This filter pass cropped input frames to 2nd output. +From there it can be filtered with other video filters. +After filter receives frame from 2nd input, that frame +is combined on top of original frame from 1st input and passed +to 1st output. +

+

The typical usage is filter only part of frame. +

+

The filter accepts the following options: +

+
x
+
y
+

Set the top left crop position. +

+
+
w
+
h
+

Set the crop size. +

+
+ + +
+

30.88.1 Examples

+ +
    +
  • Blur only top left rectangular part of video frame size 100x100 with gblur filter. +
    +
    [in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]gblur=8[blurin]
    +
    + +
  • Draw black box on top left part of video frame of size 100x100 with drawbox filter. +
    +
    [in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]drawbox=x=0:y=0:w=100:h=100:t=100[blurin]
    +
    +
+ +
+
+
+

30.89 fftdnoiz

+

Denoise frames using 3D FFT (frequency domain filtering). +

+

The filter accepts the following options: +

+
+
sigma
+

Set the noise sigma constant. This sets denoising strength. +Default value is 1. Allowed range is from 0 to 30. +Using very high sigma with low overlap may give blocking artifacts. +

+
+
amount
+

Set amount of denoising. By default all detected noise is reduced. +Default value is 1. Allowed range is from 0 to 1. +

+
+
block
+

Set size of block in pixels, Default is 32, can be 8 to 256. +

+
+
overlap
+

Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8. +

+
+
method
+

Set denoising method. Default is wiener, can also be hard. +

+
+
prev
+

Set number of previous frames to use for denoising. By default is set to 0. +

+
+
next
+

Set number of next frames to to use for denoising. By default is set to 0. +

+
+
planes
+

Set planes which will be filtered, by default are all available filtered +except alpha. +

+
+ +
+
+

30.90 fftfilt

+

Apply arbitrary expressions to samples in frequency domain +

+
+
dc_Y
+

Adjust the dc value (gain) of the luma plane of the image. The filter +accepts an integer value in range 0 to 1000. The default +value is set to 0. +

+
+
dc_U
+

Adjust the dc value (gain) of the 1st chroma plane of the image. The +filter accepts an integer value in range 0 to 1000. The +default value is set to 0. +

+
+
dc_V
+

Adjust the dc value (gain) of the 2nd chroma plane of the image. The +filter accepts an integer value in range 0 to 1000. The +default value is set to 0. +

+
+
weight_Y
+

Set the frequency domain weight expression for the luma plane. +

+
+
weight_U
+

Set the frequency domain weight expression for the 1st chroma plane. +

+
+
weight_V
+

Set the frequency domain weight expression for the 2nd chroma plane. +

+
+
eval
+

Set when the expressions are evaluated. +

+

It accepts the following values: +

+
init
+

Only evaluate expressions once during the filter initialization. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+ +

Default value is ‘init’. +

+

The filter accepts the following variables: +

+
X
+
Y
+

The coordinates of the current sample. +

+
+
W
+
H
+

The width and height of the image. +

+
+
N
+

The number of input frame, starting from 0. +

+
+
WS
+
HS
+

The size of FFT array for horizontal and vertical processing. +

+
+ + +
+

30.90.1 Examples

+ +
    +
  • High-pass: +
    +
    fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
    +
    + +
  • Low-pass: +
    +
    fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
    +
    + +
  • Sharpen: +
    +
    fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
    +
    + +
  • Blur: +
    +
    fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
    +
    + +
+ +
+
+
+

30.91 field

+ +

Extract a single field from an interlaced image using stride +arithmetic to avoid wasting CPU time. The output frames are marked as +non-interlaced. +

+

The filter accepts the following options: +

+
+
type
+

Specify whether to extract the top (if the value is 0 or +top) or the bottom field (if the value is 1 or +bottom). +

+
+ +
+
+

30.92 fieldhint

+ +

Create new frames by copying the top and bottom fields from surrounding frames +supplied as numbers by the hint file. +

+
+
hint
+

Set file containing hints: absolute/relative frame numbers. +

+

There must be one line for each frame in a clip. Each line must contain two +numbers separated by the comma, optionally followed by - or +. +Numbers supplied on each line of file can not be out of [N-1,N+1] where N +is current frame number for absolute mode or out of [-1, 1] range +for relative mode. First number tells from which frame to pick up top +field and second number tells from which frame to pick up bottom field. +

+

If optionally followed by + output frame will be marked as interlaced, +else if followed by - output frame will be marked as progressive, else +it will be marked same as input frame. +If optionally followed by t output frame will use only top field, or in +case of b it will use only bottom field. +If line starts with # or ; that line is skipped. +

+
+
mode
+

Can be item absolute or relative or pattern. Default is absolute. +The pattern mode is same as relative mode, except at last entry of file if there +are more frames to process than hint file is seek back to start. +

+
+ +

Example of first several lines of hint file for relative mode: +

+
0,0 - # first frame
+1,0 - # second frame, use third's frame top field and second's frame bottom field
+1,0 - # third frame, use fourth's frame top field and third's frame bottom field
+1,0 -
+0,0 -
+0,0 -
+1,0 -
+1,0 -
+1,0 -
+0,0 -
+0,0 -
+1,0 -
+1,0 -
+1,0 -
+0,0 -
+
+ +
+
+

30.93 fieldmatch

+ +

Field matching filter for inverse telecine. It is meant to reconstruct the +progressive frames from a telecined stream. The filter does not drop duplicated +frames, so to achieve a complete inverse telecine fieldmatch needs to be +followed by a decimation filter such as decimate in the filtergraph. +

+

The separation of the field matching and the decimation is notably motivated by +the possibility of inserting a de-interlacing filter fallback between the two. +If the source has mixed telecined and real interlaced content, +fieldmatch will not be able to match fields for the interlaced parts. +But these remaining combed frames will be marked as interlaced, and thus can be +de-interlaced by a later filter such as yadif before decimation. +

+

In addition to the various configuration options, fieldmatch can take an +optional second stream, activated through the ppsrc option. If +enabled, the frames reconstruction will be based on the fields and frames from +this second stream. This allows the first input to be pre-processed in order to +help the various algorithms of the filter, while keeping the output lossless +(assuming the fields are matched properly). Typically, a field-aware denoiser, +or brightness/contrast adjustments can help. +

+

Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project) +and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from +which fieldmatch is based on. While the semantic and usage are very +close, some behaviour and options names can differ. +

+

The decimate filter currently only works for constant frame rate input. +If your input has mixed telecined (30fps) and progressive content with a lower +framerate like 24fps use the following filterchain to produce the necessary cfr +stream: dejudder,fps=30000/1001,fieldmatch,decimate. +

+

The filter accepts the following options: +

+
+
order
+

Specify the assumed field order of the input stream. Available values are: +

+
+
auto
+

Auto detect parity (use FFmpeg’s internal parity value). +

+
bff
+

Assume bottom field first. +

+
tff
+

Assume top field first. +

+
+ +

Note that it is sometimes recommended not to trust the parity announced by the +stream. +

+

Default value is auto. +

+
+
mode
+

Set the matching mode or strategy to use. pc mode is the safest in the +sense that it won’t risk creating jerkiness due to duplicate frames when +possible, but if there are bad edits or blended fields it will end up +outputting combed frames when a good match might actually exist. On the other +hand, pcn_ub mode is the most risky in terms of creating jerkiness, +but will almost always find a good frame if there is one. The other values are +all somewhere in between pc and pcn_ub in terms of risking +jerkiness and creating duplicate frames versus finding good matches in sections +with bad edits, orphaned fields, blended fields, etc. +

+

More details about p/c/n/u/b are available in p/c/n/u/b meaning section. +

+

Available values are: +

+
+
pc
+

2-way matching (p/c) +

+
pc_n
+

2-way matching, and trying 3rd match if still combed (p/c + n) +

+
pc_u
+

2-way matching, and trying 3rd match (same order) if still combed (p/c + u) +

+
pc_n_ub
+

2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if +still combed (p/c + n + u/b) +

+
pcn
+

3-way matching (p/c/n) +

+
pcn_ub
+

3-way matching, and trying 4th/5th matches if all 3 of the original matches are +detected as combed (p/c/n + u/b) +

+
+ +

The parenthesis at the end indicate the matches that would be used for that +mode assuming order=tff (and field on auto or +top). +

+

In terms of speed pc mode is by far the fastest and pcn_ub is +the slowest. +

+

Default value is pc_n. +

+
+
ppsrc
+

Mark the main input stream as a pre-processed input, and enable the secondary +input stream as the clean source to pick the fields from. See the filter +introduction for more details. It is similar to the clip2 feature from +VFM/TFM. +

+

Default value is 0 (disabled). +

+
+
field
+

Set the field to match from. It is recommended to set this to the same value as +order unless you experience matching failures with that setting. In +certain circumstances changing the field that is used to match from can have a +large impact on matching performance. Available values are: +

+
+
auto
+

Automatic (same value as order). +

+
bottom
+

Match from the bottom field. +

+
top
+

Match from the top field. +

+
+ +

Default value is auto. +

+
+
mchroma
+

Set whether or not chroma is included during the match comparisons. In most +cases it is recommended to leave this enabled. You should set this to 0 +only if your clip has bad chroma problems such as heavy rainbowing or other +artifacts. Setting this to 0 could also be used to speed things up at +the cost of some accuracy. +

+

Default value is 1. +

+
+
y0
+
y1
+

These define an exclusion band which excludes the lines between y0 and +y1 from being included in the field matching decision. An exclusion +band can be used to ignore subtitles, a logo, or other things that may +interfere with the matching. y0 sets the starting scan line and +y1 sets the ending line; all lines in between y0 and +y1 (including y0 and y1) will be ignored. Setting +y0 and y1 to the same value will disable the feature. +y0 and y1 defaults to 0. +

+
+
scthresh
+

Set the scene change detection threshold as a percentage of maximum change on +the luma plane. Good values are in the [8.0, 14.0] range. Scene change +detection is only relevant in case combmatch=sc. The range for +scthresh is [0.0, 100.0]. +

+

Default value is 12.0. +

+
+
combmatch
+

When combatch is not none, fieldmatch will take into +account the combed scores of matches when deciding what match to use as the +final match. Available values are: +

+
+
none
+

No final matching based on combed scores. +

+
sc
+

Combed scores are only used when a scene change is detected. +

+
full
+

Use combed scores all the time. +

+
+ +

Default is sc. +

+
+
combdbg
+

Force fieldmatch to calculate the combed metrics for certain matches and +print them. This setting is known as micout in TFM/VFM vocabulary. +Available values are: +

+
+
none
+

No forced calculation. +

+
pcn
+

Force p/c/n calculations. +

+
pcnub
+

Force p/c/n/u/b calculations. +

+
+ +

Default value is none. +

+
+
cthresh
+

This is the area combing threshold used for combed frame detection. This +essentially controls how "strong" or "visible" combing must be to be detected. +Larger values mean combing must be more visible and smaller values mean combing +can be less visible or strong and still be detected. Valid settings are from +-1 (every pixel will be detected as combed) to 255 (no pixel will +be detected as combed). This is basically a pixel difference value. A good +range is [8, 12]. +

+

Default value is 9. +

+
+
chroma
+

Sets whether or not chroma is considered in the combed frame decision. Only +disable this if your source has chroma problems (rainbowing, etc.) that are +causing problems for the combed frame detection with chroma enabled. Actually, +using chroma=0 is usually more reliable, except for the case +where there is chroma only combing in the source. +

+

Default value is 0. +

+
+
blockx
+
blocky
+

Respectively set the x-axis and y-axis size of the window used during combed +frame detection. This has to do with the size of the area in which +combpel pixels are required to be detected as combed for a frame to be +declared combed. See the combpel parameter description for more info. +Possible values are any number that is a power of 2 starting at 4 and going up +to 512. +

+

Default value is 16. +

+
+
combpel
+

The number of combed pixels inside any of the blocky by +blockx size blocks on the frame for the frame to be detected as +combed. While cthresh controls how "visible" the combing must be, this +setting controls "how much" combing there must be in any localized area (a +window defined by the blockx and blocky settings) on the +frame. Minimum value is 0 and maximum is blocky x blockx (at +which point no frames will ever be detected as combed). This setting is known +as MI in TFM/VFM vocabulary. +

+

Default value is 80. +

+
+ + +
+

30.93.1 p/c/n/u/b meaning

+ + +
+

30.93.1.1 p/c/n

+ +

We assume the following telecined stream: +

+
+
Top fields:     1 2 2 3 4
+Bottom fields:  1 2 3 4 4
+
+ +

The numbers correspond to the progressive frame the fields relate to. Here, the +first two frames are progressive, the 3rd and 4th are combed, and so on. +

+

When fieldmatch is configured to run a matching from bottom +(field=bottom) this is how this input stream get transformed: +

+
+
Input stream:
+                T     1 2 2 3 4
+                B     1 2 3 4 4   <-- matching reference
+
+Matches:              c c n n c
+
+Output stream:
+                T     1 2 3 4 4
+                B     1 2 3 4 4
+
+ +

As a result of the field matching, we can see that some frames get duplicated. +To perform a complete inverse telecine, you need to rely on a decimation filter +after this operation. See for instance the decimate filter. +

+

The same operation now matching from top fields (field=top) +looks like this: +

+
+
Input stream:
+                T     1 2 2 3 4   <-- matching reference
+                B     1 2 3 4 4
+
+Matches:              c c p p c
+
+Output stream:
+                T     1 2 2 3 4
+                B     1 2 2 3 4
+
+ +

In these examples, we can see what p, c and n mean; +basically, they refer to the frame and field of the opposite parity: +

+
    +
  • p matches the field of the opposite parity in the previous frame +
  • c matches the field of the opposite parity in the current frame +
  • n matches the field of the opposite parity in the next frame +
+ +
+
+

30.93.1.2 u/b

+ +

The u and b matching are a bit special in the sense that they match +from the opposite parity flag. In the following examples, we assume that we are +currently matching the 2nd frame (Top:2, bottom:2). According to the match, a +’x’ is placed above and below each matched fields. +

+

With bottom matching (field=bottom): +

+
Match:           c         p           n          b          u
+
+                 x       x               x        x          x
+  Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
+  Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
+                 x         x           x        x              x
+
+Output frames:
+                 2          1          2          2          2
+                 2          2          2          1          3
+
+ +

With top matching (field=top): +

+
Match:           c         p           n          b          u
+
+                 x         x           x        x              x
+  Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
+  Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
+                 x       x               x        x          x
+
+Output frames:
+                 2          2          2          1          2
+                 2          1          3          2          2
+
+ +
+
+
+

30.93.2 Examples

+ +

Simple IVTC of a top field first telecined stream: +

+
fieldmatch=order=tff:combmatch=none, decimate
+
+ +

Advanced IVTC, with fallback on yadif for still combed frames: +

+
fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
+
+ +
+
+
+

30.94 fieldorder

+ +

Transform the field order of the input video. +

+

It accepts the following parameters: +

+
+
order
+

The output field order. Valid values are tff for top field first or bff +for bottom field first. +

+
+ +

The default value is ‘tff’. +

+

The transformation is done by shifting the picture content up or down +by one line, and filling the remaining line with appropriate picture content. +This method is consistent with most broadcast field order converters. +

+

If the input video is not flagged as being interlaced, or it is already +flagged as being of the required output field order, then this filter does +not alter the incoming video. +

+

It is very useful when converting to or from PAL DV material, +which is bottom field first. +

+

For example: +

+
ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
+
+ +
+
+

30.95 fifo, afifo

+ +

Buffer input images and send them when they are requested. +

+

It is mainly useful when auto-inserted by the libavfilter +framework. +

+

It does not take parameters. +

+
+
+

30.96 fillborders

+ +

Fill borders of the input video, without changing video stream dimensions. +Sometimes video can have garbage at the four edges and you may not want to +crop video input to keep size multiple of some number. +

+

This filter accepts the following options: +

+
+
left
+

Number of pixels to fill from left border. +

+
+
right
+

Number of pixels to fill from right border. +

+
+
top
+

Number of pixels to fill from top border. +

+
+
bottom
+

Number of pixels to fill from bottom border. +

+
+
mode
+

Set fill mode. +

+

It accepts the following values: +

+
smear
+

fill pixels using outermost pixels +

+
+
mirror
+

fill pixels using mirroring (half sample symmetric) +

+
+
fixed
+

fill pixels with constant value +

+
+
reflect
+

fill pixels using reflecting (whole sample symmetric) +

+
+
wrap
+

fill pixels using wrapping +

+
+
fade
+

fade pixels to constant value +

+
+
margins
+

fill pixels at top and bottom with weighted averages pixels near borders +

+
+ +

Default is smear. +

+
+
color
+

Set color for pixels in fixed or fade mode. Default is black. +

+
+ + +
+

30.96.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

30.97 find_rect

+ +

Find a rectangular object in the input video. +

+

The object to search for must be specified as a gray8 image specified with the +object option. +

+

For each possible match, a score is computed. If the score reaches the specified +threshold, the object is considered found. +

+

If the input video contains multiple instances of the object, the filter will +find only one of them. +

+

When an object is found, the following metadata entries are set in the matching +frame: +

+
lavfi.rect.w
+

width of object +

+
+
lavfi.rect.h
+

height of object +

+
+
lavfi.rect.x
+

x position of object +

+
+
lavfi.rect.y
+

y position of object +

+
+
lavfi.rect.score
+

match score of the found object +

+
+ +

It accepts the following options: +

+
+
object
+

Filepath of the object image, needs to be in gray8. +

+
+
threshold
+

Detection threshold, expressed as a decimal number in the range 0-1. +

+

A threshold value of 0.01 means only exact matches, a threshold of 0.99 means +almost everything matches. +

+

Default value is 0.5. +

+
+
mipmaps
+

Number of mipmaps, default is 3. +

+
+
xmin, ymin, xmax, ymax
+

Specifies the rectangle in which to search. +

+
+
discard
+

Discard frames where object is not detected. Default is disabled. +

+
+ + +
+

30.97.1 Examples

+ +
    +
  • Cover a rectangular object by the supplied image of a given video using ffmpeg: +
    +
    ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
    +
    + +
  • Find the position of an object in each frame using ffprobe and write +it to a log file: +
    +
    ffprobe -f lavfi movie=test.mp4,find_rect=object=object.pgm:threshold=0.3 \
    +  -show_entries frame=pkt_pts_time:frame_tags=lavfi.rect.x,lavfi.rect.y \
    +  -of csv -o find_rect.csv
    +
    + +
+ +
+
+
+

30.98 floodfill

+ +

Flood area with values of same pixel components with another values. +

+

It accepts the following options: +

+
x
+

Set pixel x coordinate. +

+
+
y
+

Set pixel y coordinate. +

+
+
s0
+

Set source #0 component value. +

+
+
s1
+

Set source #1 component value. +

+
+
s2
+

Set source #2 component value. +

+
+
s3
+

Set source #3 component value. +

+
+
d0
+

Set destination #0 component value. +

+
+
d1
+

Set destination #1 component value. +

+
+
d2
+

Set destination #2 component value. +

+
+
d3
+

Set destination #3 component value. +

+
+ +
+
+

30.99 format

+ +

Convert the input video to one of the specified pixel formats. +Libavfilter will try to pick one that is suitable as input to +the next filter. +

+

It accepts the following parameters: +

+
pix_fmts
+

A ’|’-separated list of pixel format names, such as +"pix_fmts=yuv420p|monow|rgb24". +

+
+
+ + +
+

30.99.1 Examples

+ +
    +
  • Convert the input video to the yuv420p format +
    +
    format=pix_fmts=yuv420p
    +
    + +

    Convert the input video to any of the formats in the list +

    +
    format=pix_fmts=yuv420p|yuv444p|yuv410p
    +
    +
+ +
+
+
+

30.100 fps

+ +

Convert the video to specified constant frame rate by duplicating or dropping +frames as necessary. +

+

It accepts the following parameters: +

+
fps
+

The desired output frame rate. It accepts expressions containing the following +constants: +

+
+
source_fps
+

The input’s frame rate +

+
+
ntsc
+

NTSC frame rate of 30000/1001 +

+
+
pal
+

PAL frame rate of 25.0 +

+
+
film
+

Film frame rate of 24.0 +

+
+
ntsc_film
+

NTSC-film frame rate of 24000/1001 +

+
+ +

The default is 25. +

+
+
start_time
+

Assume the first PTS should be the given value, in seconds. This allows for +padding/trimming at the start of stream. By default, no assumption is made +about the first frame’s expected PTS, so no padding or trimming is done. +For example, this could be set to 0 to pad the beginning with duplicates of +the first frame if a video stream starts after the audio stream or to trim any +frames with a negative PTS. +

+
+
round
+

Timestamp (PTS) rounding method. +

+

Possible values are: +

+
zero
+

round towards 0 +

+
inf
+

round away from 0 +

+
down
+

round towards -infinity +

+
up
+

round towards +infinity +

+
near
+

round to nearest +

+
+

The default is near. +

+
+
eof_action
+

Action performed when reading the last frame. +

+

Possible values are: +

+
round
+

Use same timestamp rounding method as used for other frames. +

+
pass
+

Pass through last frame if input duration has not been reached yet. +

+
+

The default is round. +

+
+
+ +

Alternatively, the options can be specified as a flat string: +fps[:start_time[:round]]. +

+

See also the setpts filter. +

+ +
+

30.100.1 Examples

+ +
    +
  • A typical usage in order to set the fps to 25: +
    +
    fps=fps=25
    +
    + +
  • Sets the fps to 24, using abbreviation and rounding method to round to nearest: +
    +
    fps=fps=film:round=near
    +
    +
+ +
+
+
+

30.101 framepack

+ +

Pack two different video streams into a stereoscopic video, setting proper +metadata on supported codecs. The two views should have the same size and +framerate and processing will stop when the shorter video ends. Please note +that you may conveniently adjust view properties with the scale and +fps filters. +

+

It accepts the following parameters: +

+
format
+

The desired packing format. Supported values are: +

+
+
sbs
+

The views are next to each other (default). +

+
+
tab
+

The views are on top of each other. +

+
+
lines
+

The views are packed by line. +

+
+
columns
+

The views are packed by column. +

+
+
frameseq
+

The views are temporally interleaved. +

+
+
+ +
+
+ +

Some examples: +

+
+
# Convert left and right views into a frame-sequential video
+ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
+
+# Convert views into a side-by-side video with the same output resolution as the input
+ffmpeg -i LEFT -i RIGHT -filter_complex [0:v]scale=w=iw/2[left],[1:v]scale=w=iw/2[right],[left][right]framepack=sbs OUTPUT
+
+ +
+
+

30.102 framerate

+ +

Change the frame rate by interpolating new video output frames from the source +frames. +

+

This filter is not designed to function correctly with interlaced media. If +you wish to change the frame rate of interlaced media then you are required +to deinterlace before this filter and re-interlace after this filter. +

+

A description of the accepted options follows. +

+
+
fps
+

Specify the output frames per second. This option can also be specified +as a value alone. The default is 50. +

+
+
interp_start
+

Specify the start of a range where the output frame will be created as a +linear interpolation of two frames. The range is [0-255], +the default is 15. +

+
+
interp_end
+

Specify the end of a range where the output frame will be created as a +linear interpolation of two frames. The range is [0-255], +the default is 240. +

+
+
scene
+

Specify the level at which a scene change is detected as a value between +0 and 100 to indicate a new scene; a low value reflects a low +probability for the current frame to introduce a new scene, while a higher +value means the current frame is more likely to be one. +The default is 8.2. +

+
+
flags
+

Specify flags influencing the filter process. +

+

Available value for flags is: +

+
+
scene_change_detect, scd
+

Enable scene change detection using the value of the option scene. +This flag is enabled by default. +

+
+
+
+ +
+
+

30.103 framestep

+ +

Select one frame every N-th frame. +

+

This filter accepts the following option: +

+
step
+

Select frame after every step frames. +Allowed values are positive integers higher than 0. Default value is 1. +

+
+ +
+
+

30.104 freezedetect

+ +

Detect frozen video. +

+

This filter logs a message and sets frame metadata when it detects that the +input video has no significant change in content during a specified duration. +Video freeze detection calculates the mean average absolute difference of all +the components of video frames and compares it to a noise floor. +

+

The printed times and duration are expressed in seconds. The +lavfi.freezedetect.freeze_start metadata key is set on the first frame +whose timestamp equals or exceeds the detection duration and it contains the +timestamp of the first frame of the freeze. The +lavfi.freezedetect.freeze_duration and +lavfi.freezedetect.freeze_end metadata keys are set on the first frame +after the freeze. +

+

The filter accepts the following options: +

+
+
noise, n
+

Set noise tolerance. Can be specified in dB (in case "dB" is appended to the +specified value) or as a difference ratio between 0 and 1. Default is -60dB, or +0.001. +

+
+
duration, d
+

Set freeze duration until notification (default is 2 seconds). +

+
+ +
+
+

30.105 freezeframes

+ +

Freeze video frames. +

+

This filter freezes video frames using frame from 2nd input. +

+

The filter accepts the following options: +

+
+
first
+

Set number of first frame from which to start freeze. +

+
+
last
+

Set number of last frame from which to end freeze. +

+
+
replace
+

Set number of frame from 2nd input which will be used instead of replaced frames. +

+
+ +
+
+

30.106 frei0r

+ +

Apply a frei0r effect to the input video. +

+

To enable the compilation of this filter, you need to install the frei0r +header and configure FFmpeg with --enable-frei0r. +

+

It accepts the following parameters: +

+
+
filter_name
+

The name of the frei0r effect to load. If the environment variable +FREI0R_PATH is defined, the frei0r effect is searched for in each of the +directories specified by the colon-separated list in FREI0R_PATH. +Otherwise, the standard frei0r paths are searched, in this order: +HOME/.frei0r-1/lib/, /usr/local/lib/frei0r-1/, +/usr/lib/frei0r-1/. +

+
+
filter_params
+

A ’|’-separated list of parameters to pass to the frei0r effect. +

+
+
+ +

A frei0r effect parameter can be a boolean (its value is either +"y" or "n"), a double, a color (specified as +R/G/B, where R, G, and B are floating point +numbers between 0.0 and 1.0, inclusive) or a color description as specified in the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual, +a position (specified as X/Y, where +X and Y are floating point numbers) and/or a string. +

+

The number and types of parameters depend on the loaded effect. If an +effect parameter is not specified, the default value is set. +

+ +
+

30.106.1 Examples

+ +
    +
  • Apply the distort0r effect, setting the first two double parameters: +
    +
    frei0r=filter_name=distort0r:filter_params=0.5|0.01
    +
    + +
  • Apply the colordistance effect, taking a color as the first parameter: +
    +
    frei0r=colordistance:0.2/0.3/0.4
    +frei0r=colordistance:violet
    +frei0r=colordistance:0x112233
    +
    + +
  • Apply the perspective effect, specifying the top left and top right image +positions: +
    +
    frei0r=perspective:0.2/0.2|0.8/0.2
    +
    +
+ +

For more information, see +http://frei0r.dyne.org +

+
+
+

30.106.2 Commands

+ +

This filter supports the filter_params option as commands. +

+
+
+
+

30.107 fspp

+ +

Apply fast and simple postprocessing. It is a faster version of spp. +

+

It splits (I)DCT into horizontal/vertical passes. Unlike the simple post- +processing filter, one of them is performed once per block, not per pixel. +This allows for much higher speed. +

+

The filter accepts the following options: +

+
+
quality
+

Set quality. This option defines the number of levels for averaging. It accepts +an integer in the range 4-5. Default value is 4. +

+
+
qp
+

Force a constant quantization parameter. It accepts an integer in range 0-63. +If not set, the filter will use the QP from the video stream (if available). +

+
+
strength
+

Set filter strength. It accepts an integer in range -15 to 32. Lower values mean +more details but also more artifacts, while higher values make the image smoother +but also blurrier. Default value is 0 − PSNR optimal. +

+
+
use_bframe_qp
+

Enable the use of the QP from the B-Frames if set to 1. Using this +option may cause flicker since the B-Frames have often larger QP. Default is +0 (not enabled). +

+
+
+ +
+
+

30.108 gblur

+ +

Apply Gaussian blur filter. +

+

The filter accepts the following options: +

+
+
sigma
+

Set horizontal sigma, standard deviation of Gaussian blur. Default is 0.5. +

+
+
steps
+

Set number of steps for Gaussian approximation. Default is 1. +

+
+
planes
+

Set which planes to filter. By default all planes are filtered. +

+
+
sigmaV
+

Set vertical sigma, if negative it will be same as sigma. +Default is -1. +

+
+ + +
+

30.108.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

30.109 geq

+ +

Apply generic equation to each pixel. +

+

The filter accepts the following options: +

+
+
lum_expr, lum
+

Set the luminance expression. +

+
cb_expr, cb
+

Set the chrominance blue expression. +

+
cr_expr, cr
+

Set the chrominance red expression. +

+
alpha_expr, a
+

Set the alpha expression. +

+
red_expr, r
+

Set the red expression. +

+
green_expr, g
+

Set the green expression. +

+
blue_expr, b
+

Set the blue expression. +

+
+ +

The colorspace is selected according to the specified options. If one +of the lum_expr, cb_expr, or cr_expr +options is specified, the filter will automatically select a YCbCr +colorspace. If one of the red_expr, green_expr, or +blue_expr options is specified, it will select an RGB +colorspace. +

+

If one of the chrominance expression is not defined, it falls back on the other +one. If no alpha expression is specified it will evaluate to opaque value. +If none of chrominance expressions are specified, they will evaluate +to the luminance expression. +

+

The expressions can use the following variables and functions: +

+
+
N
+

The sequential number of the filtered frame, starting from 0. +

+
+
X
+
Y
+

The coordinates of the current sample. +

+
+
W
+
H
+

The width and height of the image. +

+
+
SW
+
SH
+

Width and height scale depending on the currently filtered plane. It is the +ratio between the corresponding luma plane number of pixels and the current +plane ones. E.g. for YUV4:2:0 the values are 1,1 for the luma plane, and +0.5,0.5 for chroma planes. +

+
+
T
+

Time of the current frame, expressed in seconds. +

+
+
p(x, y)
+

Return the value of the pixel at location (x,y) of the current +plane. +

+
+
lum(x, y)
+

Return the value of the pixel at location (x,y) of the luminance +plane. +

+
+
cb(x, y)
+

Return the value of the pixel at location (x,y) of the +blue-difference chroma plane. Return 0 if there is no such plane. +

+
+
cr(x, y)
+

Return the value of the pixel at location (x,y) of the +red-difference chroma plane. Return 0 if there is no such plane. +

+
+
r(x, y)
+
g(x, y)
+
b(x, y)
+

Return the value of the pixel at location (x,y) of the +red/green/blue component. Return 0 if there is no such component. +

+
+
alpha(x, y)
+

Return the value of the pixel at location (x,y) of the alpha +plane. Return 0 if there is no such plane. +

+
+
psum(x,y), lumsum(x, y), cbsum(x,y), crsum(x,y), rsum(x,y), gsum(x,y), bsum(x,y), alphasum(x,y)
+

Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining +sums of samples within a rectangle. See the functions without the sum postfix. +

+
+
interpolation
+

Set one of interpolation methods: +

+
nearest, n
+
bilinear, b
+
+

Default is bilinear. +

+
+ +

For functions, if x and y are outside the area, the value will be +automatically clipped to the closer edge. +

+

Please note that this filter can use multiple threads in which case each slice +will have its own expression state. If you want to use only a single expression +state because your expressions depend on previous state then you should limit +the number of filter threads to 1. +

+ +
+

30.109.1 Examples

+ +
    +
  • Flip the image horizontally: +
    +
    geq=p(W-X\,Y)
    +
    + +
  • Generate a bidimensional sine wave, with angle PI/3 and a +wavelength of 100 pixels: +
    +
    geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
    +
    + +
  • Generate a fancy enigmatic moving light: +
    +
    nullsrc=s=256x256,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128
    +
    + +
  • Generate a quick emboss effect: +
    +
    format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
    +
    + +
  • Modify RGB components depending on pixel position: +
    +
    geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
    +
    + +
  • Create a radial gradient that is the same size as the input (also see +the vignette filter): +
    +
    geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray
    +
    +
+ +
+
+
+

30.110 gradfun

+ +

Fix the banding artifacts that are sometimes introduced into nearly flat +regions by truncation to 8-bit color depth. +Interpolate the gradients that should go where the bands are, and +dither them. +

+

It is designed for playback only. Do not use it prior to +lossy compression, because compression tends to lose the dither and +bring back the bands. +

+

It accepts the following parameters: +

+
+
strength
+

The maximum amount by which the filter will change any one pixel. This is also +the threshold for detecting nearly flat regions. Acceptable values range from +.51 to 64; the default value is 1.2. Out-of-range values will be clipped to the +valid range. +

+
+
radius
+

The neighborhood to fit the gradient to. A larger radius makes for smoother +gradients, but also prevents the filter from modifying the pixels near detailed +regions. Acceptable values are 8-32; the default value is 16. Out-of-range +values will be clipped to the valid range. +

+
+
+ +

Alternatively, the options can be specified as a flat string: +strength[:radius] +

+ +
+

30.110.1 Examples

+ +
    +
  • Apply the filter with a 3.5 strength and radius of 8: +
    +
    gradfun=3.5:8
    +
    + +
  • Specify radius, omitting the strength (which will fall-back to the default +value): +
    +
    gradfun=radius=8
    +
    + +
+ +
+
+
+

30.111 graphmonitor

+

Show various filtergraph stats. +

+

With this filter one can debug complete filtergraph. +Especially issues with links filling with queued frames. +

+

The filter accepts the following options: +

+
+
size, s
+

Set video output size. Default is hd720. +

+
+
opacity, o
+

Set video opacity. Default is 0.9. Allowed range is from 0 to 1. +

+
+
mode, m
+

Set output mode flags. +

+

Available values for flags are: +

+
full
+

No any filtering. Default. +

+
compact
+

Show only filters with queued frames. +

+
nozero
+

Show only filters with non-zero stats. +

+
noeof
+

Show only filters with non-eof stat. +

+
nodisabled
+

Show only filters that are enabled in timeline. +

+
+ +
+
flags, f
+

Set flags which enable which stats are shown in video. +

+

Available values for flags are: +

+
none
+

All flags turned off. +

+
+
all
+

All flags turned on. +

+
+
queue
+

Display number of queued frames in each link. +

+
+
frame_count_in
+

Display number of frames taken from filter. +

+
+
frame_count_out
+

Display number of frames given out from filter. +

+
+
frame_count_delta
+

Display delta number of frames between above two values. +

+
+
pts
+

Display current filtered frame pts. +

+
+
pts_delta
+

Display pts delta between current and previous frame. +

+
+
time
+

Display current filtered frame time. +

+
+
time_delta
+

Display time delta between current and previous frame. +

+
+
timebase
+

Display time base for filter link. +

+
+
format
+

Display used format for filter link. +

+
+
size
+

Display video size or number of audio channels in case of audio used by filter link. +

+
+
rate
+

Display video frame rate or sample rate in case of audio used by filter link. +

+
+
eof
+

Display link output status. +

+
+
sample_count_in
+

Display number of samples taken from filter. +

+
+
sample_count_out
+

Display number of samples given out from filter. +

+
+
sample_count_delta
+

Display delta number of samples between above two values. +

+
+
disabled
+

Show the timeline filter status. +

+
+ +
+
rate, r
+

Set upper limit for video rate of output stream, Default value is 25. +This guarantee that output video frame rate will not be higher than this value. +

+
+ +
+
+

30.112 grayworld

+

A color constancy filter that applies color correction based on the grayworld assumption +

+

See: https://www.researchgate.net/publication/275213614_A_New_Color_Correction_Method_for_Underwater_Imaging +

+

The algorithm uses linear light, so input +data should be linearized beforehand (and possibly correctly tagged). +

+
+
ffmpeg -i INPUT -vf zscale=transfer=linear,grayworld,zscale=transfer=bt709,format=yuv420p OUTPUT
+
+ +
+
+

30.113 greyedge

+

A color constancy variation filter which estimates scene illumination via grey edge algorithm +and corrects the scene colors accordingly. +

+

See: https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf +

+

The filter accepts the following options: +

+
+
difford
+

The order of differentiation to be applied on the scene. Must be chosen in the range +[0,2] and default value is 1. +

+
+
minknorm
+

The Minkowski parameter to be used for calculating the Minkowski distance. Must +be chosen in the range [0,20] and default value is 1. Set to 0 for getting +max value instead of calculating Minkowski distance. +

+
+
sigma
+

The standard deviation of Gaussian blur to be applied on the scene. Must be +chosen in the range [0,1024.0] and default value = 1. floor( sigma * break_off_sigma(3) ) +can’t be equal to 0 if difford is greater than 0. +

+
+ + +
+

30.113.1 Examples

+
    +
  • Grey Edge: +
    +
    greyedge=difford=1:minknorm=5:sigma=2
    +
    + +
  • Max Edge: +
    +
    greyedge=difford=1:minknorm=0:sigma=2
    +
    + +
+ +
+
+
+

30.114 guided

+

Apply guided filter for edge-preserving smoothing, dehazing and so on. +

+

The filter accepts the following options: +

+
radius
+

Set the box radius in pixels. +Allowed range is 1 to 20. Default is 3. +

+
+
eps
+

Set regularization parameter (with square). +Allowed range is 0 to 1. Default is 0.01. +

+
+
mode
+

Set filter mode. Can be basic or fast. +Default is basic. +

+
+
sub
+

Set subsampling ratio for fast mode. +Range is 2 to 64. Default is 4. +No subsampling occurs in basic mode. +

+
+
guidance
+

Set guidance mode. Can be off or on. Default is off. +If off, single input is required. +If on, two inputs of the same resolution and pixel format are required. +The second input serves as the guidance. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

30.114.1 Commands

+

This filter supports the all above options as commands. +

+
+
+

30.114.2 Examples

+
    +
  • Edge-preserving smoothing with guided filter: +
    +
    ffmpeg -i in.png -vf guided out.png
    +
    + +
  • Dehazing, structure-transferring filtering, detail enhancement with guided filter. +For the generation of guidance image, refer to paper "Guided Image Filtering". +See: http://kaiminghe.com/publications/pami12guidedfilter.pdf. +
    +
    ffmpeg -i in.png -i guidance.png -filter_complex guided=guidance=on out.png
    +
    + +
+ +
+
+
+

30.115 haldclut

+ +

Apply a Hald CLUT to a video stream. +

+

First input is the video stream to process, and second one is the Hald CLUT. +The Hald CLUT input can be a simple picture or a complete video stream. +

+

The filter accepts the following options: +

+
+
clut
+

Set which CLUT video frames will be processed from second input stream, +can be first or all. Default is all. +

+
+
shortest
+

Force termination when the shortest input terminates. Default is 0. +

+
repeatlast
+

Continue applying the last CLUT after the end of the stream. A value of +0 disable the filter after the last frame of the CLUT is reached. +Default is 1. +

+
+ +

haldclut also has the same interpolation options as lut3d (both +filters share the same internals). +

+

This filter also supports the framesync options. +

+

More information about the Hald CLUT can be found on Eskil Steenberg’s website +(Hald CLUT author) at http://www.quelsolaar.com/technology/clut.html. +

+ +
+

30.115.1 Commands

+ +

This filter supports the interp option as commands. +

+
+
+

30.115.2 Workflow examples

+ + +
+

30.115.2.1 Hald CLUT video stream

+ +

Generate an identity Hald CLUT stream altered with various effects: +

+
ffmpeg -f lavfi -i haldclutsrc=8 -vf "hue=H=2*PI*t:s=sin(2*PI*t)+1, curves=cross_process" -t 10 -c:v ffv1 clut.nut
+
+ +

Note: make sure you use a lossless codec. +

+

Then use it with haldclut to apply it on some random stream: +

+
ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
+
+ +

The Hald CLUT will be applied to the 10 first seconds (duration of +clut.nut), then the latest picture of that CLUT stream will be applied +to the remaining frames of the mandelbrot stream. +

+
+
+

30.115.2.2 Hald CLUT with preview

+ +

A Hald CLUT is supposed to be a squared image of Level*Level*Level by +Level*Level*Level pixels. For a given Hald CLUT, FFmpeg will select the +biggest possible square starting at the top left of the picture. The remaining +padding pixels (bottom or right) will be ignored. This area can be used to add +a preview of the Hald CLUT. +

+

Typically, the following generated Hald CLUT will be supported by the +haldclut filter: +

+
+
ffmpeg -f lavfi -i haldclutsrc=8 -vf "
+   pad=iw+320 [padded_clut];
+   smptebars=s=320x256, split [a][b];
+   [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
+   [main][b] overlay=W-320" -frames:v 1 clut.png
+
+ +

It contains the original and a preview of the effect of the CLUT: SMPTE color +bars are displayed on the right-top, and below the same color bars processed by +the color changes. +

+

Then, the effect of this Hald CLUT can be visualized with: +

+
ffplay input.mkv -vf "movie=clut.png, [in] haldclut"
+
+ +
+
+
+
+

30.116 hflip

+ +

Flip the input video horizontally. +

+

For example, to horizontally flip the input video with ffmpeg: +

+
ffmpeg -i in.avi -vf "hflip" out.avi
+
+ +
+
+

30.117 histeq

+

This filter applies a global color histogram equalization on a +per-frame basis. +

+

It can be used to correct video that has a compressed range of pixel +intensities. The filter redistributes the pixel intensities to +equalize their distribution across the intensity range. It may be +viewed as an "automatically adjusting contrast filter". This filter is +useful only for correcting degraded or poorly captured source +video. +

+

The filter accepts the following options: +

+
+
strength
+

Determine the amount of equalization to be applied. As the strength +is reduced, the distribution of pixel intensities more-and-more +approaches that of the input frame. The value must be a float number +in the range [0,1] and defaults to 0.200. +

+
+
intensity
+

Set the maximum intensity that can generated and scale the output +values appropriately. The strength should be set as desired and then +the intensity can be limited if needed to avoid washing-out. The value +must be a float number in the range [0,1] and defaults to 0.210. +

+
+
antibanding
+

Set the antibanding level. If enabled the filter will randomly vary +the luminance of output pixels by a small amount to avoid banding of +the histogram. Possible values are none, weak or +strong. It defaults to none. +

+
+ +
+
+

30.118 histogram

+ +

Compute and draw a color distribution histogram for the input video. +

+

The computed histogram is a representation of the color component +distribution in an image. +

+

Standard histogram displays the color components distribution in an image. +Displays color graph for each color component. Shows distribution of +the Y, U, V, A or R, G, B components, depending on input format, in the +current frame. Below each graph a color component scale meter is shown. +

+

The filter accepts the following options: +

+
+
level_height
+

Set height of level. Default value is 200. +Allowed range is [50, 2048]. +

+
+
scale_height
+

Set height of color scale. Default value is 12. +Allowed range is [0, 40]. +

+
+
display_mode
+

Set display mode. +It accepts the following values: +

+
stack
+

Per color component graphs are placed below each other. +

+
+
parade
+

Per color component graphs are placed side by side. +

+
+
overlay
+

Presents information identical to that in the parade, except +that the graphs representing color components are superimposed directly +over one another. +

+
+

Default is stack. +

+
+
levels_mode
+

Set mode. Can be either linear, or logarithmic. +Default is linear. +

+
+
components
+

Set what color components to display. +Default is 7. +

+
+
fgopacity
+

Set foreground opacity. Default is 0.7. +

+
+
bgopacity
+

Set background opacity. Default is 0.5. +

+
+
colors_mode
+

Set colors mode. +It accepts the following values: +

+
whiteonblack
+
blackonwhite
+
whiteongray
+
blackongray
+
coloronblack
+
coloronwhite
+
colorongray
+
blackoncolor
+
whiteoncolor
+
grayoncolor
+
+

Default is whiteonblack. +

+
+ + +
+

30.118.1 Examples

+ +
    +
  • Calculate and draw histogram: +
    +
    ffplay -i input -vf histogram
    +
    + +
+ +
+
+
+

30.119 hqdn3d

+ +

This is a high precision/quality 3d denoise filter. It aims to reduce +image noise, producing smooth images and making still images really +still. It should enhance compressibility. +

+

It accepts the following optional parameters: +

+
+
luma_spatial
+

A non-negative floating point number which specifies spatial luma strength. +It defaults to 4.0. +

+
+
chroma_spatial
+

A non-negative floating point number which specifies spatial chroma strength. +It defaults to 3.0*luma_spatial/4.0. +

+
+
luma_tmp
+

A floating point number which specifies luma temporal strength. It defaults to +6.0*luma_spatial/4.0. +

+
+
chroma_tmp
+

A floating point number which specifies chroma temporal strength. It defaults to +luma_tmp*chroma_spatial/luma_spatial. +

+
+ + +
+

30.119.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

30.120 hwdownload

+ +

Download hardware frames to system memory. +

+

The input must be in hardware frames, and the output a non-hardware format. +Not all formats will be supported on the output - it may be necessary to insert +an additional format filter immediately following in the graph to get +the output in a supported format. +

+
+
+

30.121 hwmap

+ +

Map hardware frames to system memory or to another device. +

+

This filter has several different modes of operation; which one is used depends +on the input and output formats: +

    +
  • Hardware frame input, normal frame output + +

    Map the input frames to system memory and pass them to the output. If the +original hardware frame is later required (for example, after overlaying +something else on part of it), the hwmap filter can be used again +in the next mode to retrieve it. +

  • Normal frame input, hardware frame output + +

    If the input is actually a software-mapped hardware frame, then unmap it - +that is, return the original hardware frame. +

    +

    Otherwise, a device must be provided. Create new hardware surfaces on that +device for the output, then map them back to the software format at the input +and give those frames to the preceding filter. This will then act like the +hwupload filter, but may be able to avoid an additional copy when +the input is already in a compatible format. +

  • Hardware frame input and output + +

    A device must be supplied for the output, either directly or with the +derive_device option. The input and output devices must be of +different types and compatible - the exact meaning of this is +system-dependent, but typically it means that they must refer to the same +underlying hardware context (for example, refer to the same graphics card). +

    +

    If the input frames were originally created on the output device, then unmap +to retrieve the original frames. +

    +

    Otherwise, map the frames to the output device - create new hardware frames +on the output corresponding to the frames on the input. +

+ +

The following additional parameters are accepted: +

+
+
mode
+

Set the frame mapping mode. Some combination of: +

+
read
+

The mapped frame should be readable. +

+
write
+

The mapped frame should be writeable. +

+
overwrite
+

The mapping will always overwrite the entire frame. +

+

This may improve performance in some cases, as the original contents of the +frame need not be loaded. +

+
direct
+

The mapping must not involve any copying. +

+

Indirect mappings to copies of frames are created in some cases where either +direct mapping is not possible or it would have unexpected properties. +Setting this flag ensures that the mapping is direct and will fail if that is +not possible. +

+
+

Defaults to read+write if not specified. +

+
+
derive_device type
+

Rather than using the device supplied at initialisation, instead derive a new +device of type type from the device the input frames exist on. +

+
+
reverse
+

In a hardware to hardware mapping, map in reverse - create frames in the sink +and map them back to the source. This may be necessary in some cases where +a mapping in one direction is required but only the opposite direction is +supported by the devices being used. +

+

This option is dangerous - it may break the preceding filter in undefined +ways if there are any additional constraints on that filter’s output. +Do not use it without fully understanding the implications of its use. +

+
+ +
+
+

30.122 hwupload

+ +

Upload system memory frames to hardware surfaces. +

+

The device to upload to must be supplied when the filter is initialised. If +using ffmpeg, select the appropriate device with the -filter_hw_device +option or with the derive_device option. The input and output devices +must be of different types and compatible - the exact meaning of this is +system-dependent, but typically it means that they must refer to the same +underlying hardware context (for example, refer to the same graphics card). +

+

The following additional parameters are accepted: +

+
+
derive_device type
+

Rather than using the device supplied at initialisation, instead derive a new +device of type type from the device the input frames exist on. +

+
+ +
+
+

30.123 hwupload_cuda

+ +

Upload system memory frames to a CUDA device. +

+

It accepts the following optional parameters: +

+
+
device
+

The number of the CUDA device to use +

+
+ +
+
+

30.124 hqx

+ +

Apply a high-quality magnification filter designed for pixel art. This filter +was originally created by Maxim Stepin. +

+

It accepts the following option: +

+
+
n
+

Set the scaling dimension: 2 for hq2x, 3 for +hq3x and 4 for hq4x. +Default is 3. +

+
+ +
+
+

30.125 hstack

+

Stack input videos horizontally. +

+

All streams must be of same pixel format and of same height. +

+

Note that this filter is faster than using overlay and pad filter +to create same output. +

+

The filter accepts the following option: +

+
+
inputs
+

Set number of input streams. Default is 2. +

+
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+ +
+
+

30.126 hsvhold

+

Turns a certain HSV range into gray values. +

+

This filter measures color difference between set HSV color in options +and ones measured in video stream. Depending on options, output +colors can be changed to be gray or not. +

+

The filter accepts the following options: +

+
+
hue
+

Set the hue value which will be used in color difference calculation. +Allowed range is from -360 to 360. Default value is 0. +

+
+
sat
+

Set the saturation value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
val
+

Set the value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
similarity
+

Set similarity percentage with the key color. +Allowed range is from 0 to 1. Default value is 0.01. +

+

0.00001 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +Allowed range is from 0 to 1. Default value is 0. +

+

0.0 makes pixels either fully gray, or not gray at all. +

+

Higher values result in more gray pixels, with a higher gray pixel +the more similar the pixels color is to the key color. +

+
+ +
+
+

30.127 hsvkey

+

Turns a certain HSV range into transparency. +

+

This filter measures color difference between set HSV color in options +and ones measured in video stream. Depending on options, output +colors can be changed to transparent by adding alpha channel. +

+

The filter accepts the following options: +

+
+
hue
+

Set the hue value which will be used in color difference calculation. +Allowed range is from -360 to 360. Default value is 0. +

+
+
sat
+

Set the saturation value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
val
+

Set the value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
similarity
+

Set similarity percentage with the key color. +Allowed range is from 0 to 1. Default value is 0.01. +

+

0.00001 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +Allowed range is from 0 to 1. Default value is 0. +

+

0.0 makes pixels either fully transparent, or not transparent at all. +

+

Higher values result in semi-transparent pixels, with a higher transparency +the more similar the pixels color is to the key color. +

+
+ +
+
+

30.128 hue

+ +

Modify the hue and/or the saturation of the input. +

+

It accepts the following parameters: +

+
+
h
+

Specify the hue angle as a number of degrees. It accepts an expression, +and defaults to "0". +

+
+
s
+

Specify the saturation in the [-10,10] range. It accepts an expression and +defaults to "1". +

+
+
H
+

Specify the hue angle as a number of radians. It accepts an +expression, and defaults to "0". +

+
+
b
+

Specify the brightness in the [-10,10] range. It accepts an expression and +defaults to "0". +

+
+ +

h and H are mutually exclusive, and can’t be +specified at the same time. +

+

The b, h, H and s option values are +expressions containing the following constants: +

+
+
n
+

frame count of the input frame starting from 0 +

+
+
pts
+

presentation timestamp of the input frame expressed in time base units +

+
+
r
+

frame rate of the input video, NAN if the input frame rate is unknown +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
tb
+

time base of the input video +

+
+ + +
+

30.128.1 Examples

+ +
    +
  • Set the hue to 90 degrees and the saturation to 1.0: +
    +
    hue=h=90:s=1
    +
    + +
  • Same command but expressing the hue in radians: +
    +
    hue=H=PI/2:s=1
    +
    + +
  • Rotate hue and make the saturation swing between 0 +and 2 over a period of 1 second: +
    +
    hue="H=2*PI*t: s=sin(2*PI*t)+1"
    +
    + +
  • Apply a 3 seconds saturation fade-in effect starting at 0: +
    +
    hue="s=min(t/3\,1)"
    +
    + +

    The general fade-in expression can be written as: +

    +
    hue="s=min(0\, max((t-START)/DURATION\, 1))"
    +
    + +
  • Apply a 3 seconds saturation fade-out effect starting at 5 seconds: +
    +
    hue="s=max(0\, min(1\, (8-t)/3))"
    +
    + +

    The general fade-out expression can be written as: +

    +
    hue="s=max(0\, min(1\, (START+DURATION-t)/DURATION))"
    +
    + +
+ +
+
+

30.128.2 Commands

+ +

This filter supports the following commands: +

+
b
+
s
+
h
+
H
+

Modify the hue and/or the saturation and/or brightness of the input video. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

30.129 huesaturation

+

Apply hue-saturation-intensity adjustments to input video stream. +

+

This filter operates in RGB colorspace. +

+

This filter accepts the following options: +

+
+
hue
+

Set the hue shift in degrees to apply. Default is 0. +Allowed range is from -180 to 180. +

+
+
saturation
+

Set the saturation shift. Default is 0. +Allowed range is from -1 to 1. +

+
+
intensity
+

Set the intensity shift. Default is 0. +Allowed range is from -1 to 1. +

+
+
colors
+

Set which primary and complementary colors are going to be adjusted. +This options is set by providing one or multiple values. +This can select multiple colors at once. By default all colors are selected. +

+
r
+

Adjust reds. +

+
y
+

Adjust yellows. +

+
g
+

Adjust greens. +

+
c
+

Adjust cyans. +

+
b
+

Adjust blues. +

+
m
+

Adjust magentas. +

+
a
+

Adjust all colors. +

+
+ +
+
strength
+

Set strength of filtering. Allowed range is from 0 to 100. +Default value is 1. +

+
+
rw, gw, bw
+

Set weight for each RGB component. Allowed range is from 0 to 1. +By default is set to 0.333, 0.334, 0.333. +Those options are used in saturation and lightess processing. +

+
+
lightness
+

Set preserving lightness, by default is disabled. +Adjusting hues can change lightness from original RGB triplet, +with this option enabled lightness is kept at same value. +

+
+ +
+
+

30.130 hysteresis

+ +

Grow first stream into second stream by connecting components. +This makes it possible to build more robust edge masks. +

+

This filter accepts the following options: +

+
+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+
threshold
+

Set threshold which is used in filtering. If pixel component value is higher than +this value filter algorithm for connecting components is activated. +By default value is 0. +

+
+ +

The hysteresis filter also supports the framesync options. +

+
+
+

30.131 iccdetect

+ +

Detect the colorspace from an embedded ICC profile (if present), and update +the frame’s tags accordingly. +

+

This filter accepts the following options: +

+
+
force
+

If true, the frame’s existing colorspace tags will always be overridden by +values detected from an ICC profile. Otherwise, they will only be assigned if +they contain unknown. Enabled by default. +

+
+ +
+
+

30.132 iccgen

+ +

Generate ICC profiles and attach them to frames. +

+

This filter accepts the following options: +

+
+
color_primaries
+
color_trc
+

Configure the colorspace that the ICC profile will be generated for. The +default value of auto infers the value from the input frame’s metadata, +defaulting to BT.709/sRGB as appropriate. +

+

See the setparams filter for a list of possible values, but note that +unknown are not valid values for this filter. +

+
+
force
+

If true, an ICC profile will be generated even if it would overwrite an +already existing ICC profile. Disabled by default. +

+
+ +
+
+

30.133 identity

+ +

Obtain the identity score between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained per component, average, min and max identity score is printed through +the logging system. +

+

The filter stores the calculated identity scores of each frame in frame metadata. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi identity -f null -
+
+ +
+
+

30.134 idet

+ +

Detect video interlacing type. +

+

This filter tries to detect if the input frames are interlaced, progressive, +top or bottom field first. It will also try to detect fields that are +repeated between adjacent frames (a sign of telecine). +

+

Single frame detection considers only immediately adjacent frames when classifying each frame. +Multiple frame detection incorporates the classification history of previous frames. +

+

The filter will log these metadata values: +

+
+
single.current_frame
+

Detected type of current frame using single-frame detection. One of: +“tff” (top field first), “bff” (bottom field first), +“progressive”, or “undetermined” +

+
+
single.tff
+

Cumulative number of frames detected as top field first using single-frame detection. +

+
+
multiple.tff
+

Cumulative number of frames detected as top field first using multiple-frame detection. +

+
+
single.bff
+

Cumulative number of frames detected as bottom field first using single-frame detection. +

+
+
multiple.current_frame
+

Detected type of current frame using multiple-frame detection. One of: +“tff” (top field first), “bff” (bottom field first), +“progressive”, or “undetermined” +

+
+
multiple.bff
+

Cumulative number of frames detected as bottom field first using multiple-frame detection. +

+
+
single.progressive
+

Cumulative number of frames detected as progressive using single-frame detection. +

+
+
multiple.progressive
+

Cumulative number of frames detected as progressive using multiple-frame detection. +

+
+
single.undetermined
+

Cumulative number of frames that could not be classified using single-frame detection. +

+
+
multiple.undetermined
+

Cumulative number of frames that could not be classified using multiple-frame detection. +

+
+
repeated.current_frame
+

Which field in the current frame is repeated from the last. One of “neither”, “top”, or “bottom”. +

+
+
repeated.neither
+

Cumulative number of frames with no repeated field. +

+
+
repeated.top
+

Cumulative number of frames with the top field repeated from the previous frame’s top field. +

+
+
repeated.bottom
+

Cumulative number of frames with the bottom field repeated from the previous frame’s bottom field. +

+
+ +

The filter accepts the following options: +

+
+
intl_thres
+

Set interlacing threshold. +

+
prog_thres
+

Set progressive threshold. +

+
rep_thres
+

Threshold for repeated field detection. +

+
half_life
+

Number of frames after which a given frame’s contribution to the +statistics is halved (i.e., it contributes only 0.5 to its +classification). The default of 0 means that all frames seen are given +full weight of 1.0 forever. +

+
analyze_interlaced_flag
+

When this is not 0 then idet will use the specified number of frames to determine +if the interlaced flag is accurate, it will not count undetermined frames. +If the flag is found to be accurate it will be used without any further +computations, if it is found to be inaccurate it will be cleared without any +further computations. This allows inserting the idet filter as a low computational +method to clean up the interlaced flag +

+
+ +
+
+

30.135 il

+ +

Deinterleave or interleave fields. +

+

This filter allows one to process interlaced images fields without +deinterlacing them. Deinterleaving splits the input frame into 2 +fields (so called half pictures). Odd lines are moved to the top +half of the output image, even lines to the bottom half. +You can process (filter) them independently and then re-interleave them. +

+

The filter accepts the following options: +

+
+
luma_mode, l
+
chroma_mode, c
+
alpha_mode, a
+

Available values for luma_mode, chroma_mode and +alpha_mode are: +

+
+
none
+

Do nothing. +

+
+
deinterleave, d
+

Deinterleave fields, placing one above the other. +

+
+
interleave, i
+

Interleave fields. Reverse the effect of deinterleaving. +

+
+

Default value is none. +

+
+
luma_swap, ls
+
chroma_swap, cs
+
alpha_swap, as
+

Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is 0. +

+
+ + +
+

30.135.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.136 inflate

+ +

Apply inflate effect to the video. +

+

This filter replaces the pixel by the local(3x3) average by taking into account +only values higher than the pixel. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+ + +
+

30.136.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.137 interlace

+ +

Simple interlacing filter from progressive contents. This interleaves upper (or +lower) lines from odd frames with lower (or upper) lines from even frames, +halving the frame rate and preserving image height. +

+
+
   Original        Original             New Frame
+   Frame 'j'      Frame 'j+1'             (tff)
+  ==========      ===========       ==================
+    Line 0  -------------------->    Frame 'j' Line 0
+    Line 1          Line 1  ---->   Frame 'j+1' Line 1
+    Line 2 --------------------->    Frame 'j' Line 2
+    Line 3          Line 3  ---->   Frame 'j+1' Line 3
+     ...             ...                   ...
+New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
+
+ +

It accepts the following optional parameters: +

+
+
scan
+

This determines whether the interlaced frame is taken from the even +(tff - default) or odd (bff) lines of the progressive frame. +

+
+
lowpass
+

Vertical lowpass filter to avoid twitter interlacing and +reduce moire patterns. +

+
+
0, off
+

Disable vertical lowpass filter +

+
+
1, linear
+

Enable linear filter (default) +

+
+
2, complex
+

Enable complex filter. This will slightly less reduce twitter and moire +but better retain detail and subjective sharpness impression. +

+
+
+
+
+ +
+
+

30.138 kerndeint

+ +

Deinterlace input video by applying Donald Graft’s adaptive kernel +deinterling. Work on interlaced parts of a video to produce +progressive frames. +

+

The description of the accepted parameters follows. +

+
+
thresh
+

Set the threshold which affects the filter’s tolerance when +determining if a pixel line must be processed. It must be an integer +in the range [0,255] and defaults to 10. A value of 0 will result in +applying the process on every pixels. +

+
+
map
+

Paint pixels exceeding the threshold value to white if set to 1. +Default is 0. +

+
+
order
+

Set the fields order. Swap fields if set to 1, leave fields alone if +0. Default is 0. +

+
+
sharp
+

Enable additional sharpening if set to 1. Default is 0. +

+
+
twoway
+

Enable twoway sharpening if set to 1. Default is 0. +

+
+ + +
+

30.138.1 Examples

+ +
    +
  • Apply default values: +
    +
    kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
    +
    + +
  • Enable additional sharpening: +
    +
    kerndeint=sharp=1
    +
    + +
  • Paint processed pixels in white: +
    +
    kerndeint=map=1
    +
    +
+ +
+
+
+

30.139 kirsch

+

Apply kirsch operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

30.139.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.140 lagfun

+ +

Slowly update darker pixels. +

+

This filter makes short flashes of light appear longer. +This filter accepts the following options: +

+
+
decay
+

Set factor for decaying. Default is .95. Allowed range is from 0 to 1. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+ + +
+

30.140.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.141 lenscorrection

+ +

Correct radial lens distortion +

+

This filter can be used to correct for radial distortion as can result from the use +of wide angle lenses, and thereby re-rectify the image. To find the right parameters +one can use tools available for example as part of opencv or simply trial-and-error. +To use opencv use the calibration sample (under samples/cpp) from the opencv sources +and extract the k1 and k2 coefficients from the resulting matrix. +

+

Note that effectively the same filter is available in the open-source tools Krita and +Digikam from the KDE project. +

+

In contrast to the vignette filter, which can also be used to compensate lens errors, +this filter corrects the distortion of the image, whereas vignette corrects the +brightness distribution, so you may want to use both filters together in certain +cases, though you will have to take care of ordering, i.e. whether vignetting should +be applied before or after lens correction. +

+ +
+

30.141.1 Options

+ +

The filter accepts the following options: +

+
+
cx
+

Relative x-coordinate of the focal point of the image, and thereby the center of the +distortion. This value has a range [0,1] and is expressed as fractions of the image +width. Default is 0.5. +

+
cy
+

Relative y-coordinate of the focal point of the image, and thereby the center of the +distortion. This value has a range [0,1] and is expressed as fractions of the image +height. Default is 0.5. +

+
k1
+

Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means +no correction. Default is 0. +

+
k2
+

Coefficient of the double quadratic correction term. This value has a range [-1,1]. +0 means no correction. Default is 0. +

+
i
+

Set interpolation type. Can be nearest or bilinear. +Default is nearest. +

+
fc
+

Specify the color of the unmapped pixels. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Default color is black@0. +

+
+ +

The formula that generates the correction is: +

+

r_src = r_tgt * (1 + k1 * (r_tgt / r_0)^2 + k2 * (r_tgt / r_0)^4) +

+

where r_0 is halve of the image diagonal and r_src and r_tgt are the +distances from the focal point in the source and target images, respectively. +

+
+
+

30.141.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.142 lensfun

+ +

Apply lens correction via the lensfun library (http://lensfun.sourceforge.net/). +

+

The lensfun filter requires the camera make, camera model, and lens model +to apply the lens correction. The filter will load the lensfun database and +query it to find the corresponding camera and lens entries in the database. As +long as these entries can be found with the given options, the filter can +perform corrections on frames. Note that incomplete strings will result in the +filter choosing the best match with the given options, and the filter will +output the chosen camera and lens models (logged with level "info"). You must +provide the make, camera model, and lens model as they are required. +

+

To obtain a list of available makes and models, leave out one or both of make and +model options. The filter will send the full list to the log with level INFO. +The first column is the make and the second column is the model. +To obtain a list of available lenses, set any values for make and model and leave out the +lens_model option. The filter will send the full list of lenses in the log with level +INFO. The ffmpeg tool will exit after the list is printed. +

+

The filter accepts the following options: +

+
+
make
+

The make of the camera (for example, "Canon"). This option is required. +

+
+
model
+

The model of the camera (for example, "Canon EOS 100D"). This option is +required. +

+
+
lens_model
+

The model of the lens (for example, "Canon EF-S 18-55mm f/3.5-5.6 IS STM"). This +option is required. +

+
+
db_path
+

The full path to the lens database folder. If not set, the filter will attempt to +load the database from the install path when the library was built. Default is unset. +

+
+
mode
+

The type of correction to apply. The following values are valid options: +

+
+
vignetting
+

Enables fixing lens vignetting. +

+
+
geometry
+

Enables fixing lens geometry. This is the default. +

+
+
subpixel
+

Enables fixing chromatic aberrations. +

+
+
vig_geo
+

Enables fixing lens vignetting and lens geometry. +

+
+
vig_subpixel
+

Enables fixing lens vignetting and chromatic aberrations. +

+
+
distortion
+

Enables fixing both lens geometry and chromatic aberrations. +

+
+
all
+

Enables all possible corrections. +

+
+
+
+
focal_length
+

The focal length of the image/video (zoom; expected constant for video). For +example, a 18–55mm lens has focal length range of [18–55], so a value in that +range should be chosen when using that lens. Default 18. +

+
+
aperture
+

The aperture of the image/video (expected constant for video). Note that +aperture is only used for vignetting correction. Default 3.5. +

+
+
focus_distance
+

The focus distance of the image/video (expected constant for video). Note that +focus distance is only used for vignetting and only slightly affects the +vignetting correction process. If unknown, leave it at the default value (which +is 1000). +

+
+
scale
+

The scale factor which is applied after transformation. After correction the +video is no longer necessarily rectangular. This parameter controls how much of +the resulting image is visible. The value 0 means that a value will be chosen +automatically such that there is little or no unmapped area in the output +image. 1.0 means that no additional scaling is done. Lower values may result +in more of the corrected image being visible, while higher values may avoid +unmapped areas in the output. +

+
+
target_geometry
+

The target geometry of the output image/video. The following values are valid +options: +

+
+
rectilinear (default)
+
fisheye
+
panoramic
+
equirectangular
+
fisheye_orthographic
+
fisheye_stereographic
+
fisheye_equisolid
+
fisheye_thoby
+
+
+
reverse
+

Apply the reverse of image correction (instead of correcting distortion, apply +it). +

+
+
interpolation
+

The type of interpolation used when correcting distortion. The following values +are valid options: +

+
+
nearest
+
linear (default)
+
lanczos
+
+
+
+ + +
+

30.142.1 Examples

+ +
    +
  • Apply lens correction with make "Canon", camera model "Canon EOS 100D", and lens +model "Canon EF-S 18-55mm f/3.5-5.6 IS STM" with focal length of "18" and +aperture of "8.0". + +
    +
    ffmpeg -i input.mov -vf lensfun=make=Canon:model="Canon EOS 100D":lens_model="Canon EF-S 18-55mm f/3.5-5.6 IS STM":focal_length=18:aperture=8 -c:v h264 -b:v 8000k output.mov
    +
    + +
  • Apply the same as before, but only for the first 5 seconds of video. + +
    +
    ffmpeg -i input.mov -vf lensfun=make=Canon:model="Canon EOS 100D":lens_model="Canon EF-S 18-55mm f/3.5-5.6 IS STM":focal_length=18:aperture=8:enable='lte(t\,5)' -c:v h264 -b:v 8000k output.mov
    +
    + +
+ +
+
+
+

30.143 libplacebo

+ +

Flexible GPU-accelerated processing filter based on libplacebo +(https://code.videolan.org/videolan/libplacebo). +

+ +
+

30.143.1 Options

+ +

The options for this filter are divided into the following sections: +

+ +
+

30.143.1.1 Output mode

+

These options control the overall output mode. By default, libplacebo will try +to preserve the source colorimetry and size as best as it can, but it will +apply any embedded film grain, dolby vision metadata or anamorphic SAR present +in source frames. +

+
w
+
h
+

Set the output video dimension expression. Default values are iw and +ih. +

+

Allows for the same expressions as the scale filter. +

+
+
crop_x
+
crop_y
+

Set the input crop x/y expressions, default values are (iw-cw)/2 and +(ih-ch)/2. +

+
+
crop_w
+
crop_h
+

Set the input crop width/height expressions, default values are iw and +ih. +

+
+
pos_x
+
pos_y
+

Set the output placement x/y expressions, default values are (ow-pw)/2 +and (oh-ph)/2. +

+
+
pos_w
+
pos_h
+

Set the output placement width/height expressions, default values are ow +and oh. +

+
+
fps
+

Set the output frame rate. This can be rational, e.g. 60000/1001. If +set to the special string none (the default), input timestamps will +instead be passed through to the output unmodified. Otherwise, the input video +frames will be interpolated as necessary to rescale the video to the specified +target framerate, in a manner as determined by the frame_mixer option. +

+
+
format
+

Set the output format override. If unset (the default), frames will be output +in the same format as the respective input frames. Otherwise, format conversion +will be performed. +

+
+
force_original_aspect_ratio
+
force_divisible_by
+

Work the same as the identical scale filter options. +

+
+
normalize_sar
+

If enabled, output frames will always have a pixel aspect ratio of 1:1. This +will introduce additional padding/cropping as necessary. If disabled (the +default), any aspect ratio mismatches, including those from e.g. anamorphic +video sources, are forwarded to the output pixel aspect ratio. +

+
+
pad_crop_ratio
+

Specifies a ratio (between 0.0 and 1.0) between padding and +cropping when the input aspect ratio does not match the output aspect ratio and +normalize_sar is in effect. The default of 0.0 always pads the +content with black borders, while a value of 1.0 always crops off parts +of the content. Intermediate values are possible, leading to a mix of the two +approaches. +

+
+
fillcolor
+

Set the color used to fill the output area not covered by the output image, for +example as a result of normalize_sar. For the general syntax of this +option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Defaults to black. +

+
+
colorspace
+
color_primaries
+
color_trc
+
range
+

Configure the colorspace that output frames will be delivered in. The default +value of auto outputs frames in the same format as the input frames, +leading to no change. For any other value, conversion will be performed. +

+

See the setparams filter for a list of possible values. +

+
+
apply_filmgrain
+

Apply film grain (e.g. AV1 or H.274) if present in source frames, and strip +it from the output. Enabled by default. +

+
+
apply_dolbyvision
+

Apply Dolby Vision RPU metadata if present in source frames, and strip it from +the output. Enabled by default. Note that Dolby Vision will always output +BT.2020+PQ, overriding the usual input frame metadata. These will also be +picked as the values of auto for the respective frame output options. +

+
+ +

In addition to the expression constants documented for the scale filter, +the crop_w, crop_h, crop_x, crop_y, +pos_w, pos_h, pos_x and pos_y options can +also contain the following constants: +

+
+
crop_w, cw
+
crop_h, ch
+

The computed values of crop_w and crop_h. +

+
+
pos_w, pw
+
pos_h, ph
+

The computed values of pos_w and pos_h. +

+
+
in_t, t
+

The input frame timestamp, in seconds. NAN if input timestamp is unknown. +

+
+
out_t, ot
+

The input frame timestamp, in seconds. NAN if input timestamp is unknown. +

+
+
n
+

The input frame number, starting with 0. +

+
+ +
+
+

30.143.1.2 Scaling

+

The options in this section control how libplacebo performs upscaling and (if +necessary) downscaling. Note that libplacebo will always internally operate on +4:4:4 content, so any sub-sampled chroma formats such as yuv420p will +necessarily be upsampled and downsampled as part of the rendering process. That +means scaling might be in effect even if the source and destination resolution +are the same. +

+
upscaler
+
downscaler
+

Configure the filter kernel used for upscaling and downscaling. The respective +defaults are spline36 and mitchell. For a full list of possible +values, pass help to these options. The most important values are: +

+
none
+

Forces the use of built-in GPU texture sampling (typically bilinear). Extremely +fast but poor quality, especially when downscaling. +

+
+
bilinear
+

Bilinear interpolation. Can generally be done for free on GPUs, except when +doing so would lead to aliasing. Fast and low quality. +

+
+
nearest
+

Nearest-neighbour interpolation. Sharp but highly aliasing. +

+
+
oversample
+

Algorithm that looks visually similar to nearest-neighbour interpolation but +tries to preserve pixel aspect ratio. Good for pixel art, since it results in +minimal distortion of the artistic appearance. +

+
+
lanczos
+

Standard sinc-sinc interpolation kernel. +

+
+
spline36
+

Cubic spline approximation of lanczos. No difference in performance, but has +very slightly less ringing. +

+
+
ewa_lanczos
+

Elliptically weighted average version of lanczos, based on a jinc-sinc kernel. +This is also popularly referred to as just "Jinc scaling". Slow but very high +quality. +

+
+
gaussian
+

Gaussian kernel. Has certain ideal mathematical properties, but subjectively +very blurry. +

+
+
mitchell
+

Cubic BC spline with parameters recommended by Mitchell and Netravali. Very +little ringing. +

+
+ +
+
frame_mixer
+

Controls the kernel used for mixing frames temporally. The default value is +none, which disables frame mixing. For a full list of possible values, +pass help to this option. The most important values are: +

+
none
+

Disables frame mixing, giving a result equivalent to "nearest neighbour" +semantics. +

+
+
oversample
+

Oversamples the input video to create a "Smooth Motion"-type effect: if an +output frame would exactly fall on the transition between two video frames, it +is blended according to the relative overlap. This is the recommended option +whenever preserving the original subjective appearance is desired. +

+
+
mitchell_clamp
+

Larger filter kernel that smoothly interpolates multiple frames in a manner +designed to eliminate ringing and other artefacts as much as possible. This is +the recommended option wherever maximum visual smoothness is desired. +

+
+
linear
+

Linear blend/fade between frames. Especially useful for constructing e.g. +slideshows. +

+
+ +
+
lut_entries
+

Configures the size of scaler LUTs, ranging from 1 to 256. The +default of 0 will pick libplacebo’s internal default, typically +64. +

+
+
antiringing
+

Enables anti-ringing (for non-EWA filters). The value (between 0.0 and +1.0) configures the strength of the anti-ringing algorithm. May increase +aliasing if set too high. Disabled by default. +

+
+
sigmoid
+

Enable sigmoidal compression during upscaling. Reduces ringing slightly. +Enabled by default. +

+
+ +
+
+

30.143.1.3 Debanding

+

Libplacebo comes with a built-in debanding filter that is good at counteracting +many common sources of banding and blocking. Turning this on is highly +recommended whenever quality is desired. +

+
deband
+

Enable (fast) debanding algorithm. Disabled by default. +

+
+
deband_iterations
+

Number of deband iterations of the debanding algorithm. Each iteration is +performed with progressively increased radius (and diminished threshold). +Recommended values are in the range 1 to 4. Defaults to 1. +

+
+
deband_threshold
+

Debanding filter strength. Higher numbers lead to more aggressive debanding. +Defaults to 4.0. +

+
+
deband_radius
+

Debanding filter radius. A higher radius is better for slow gradients, while +a lower radius is better for steep gradients. Defaults to 16.0. +

+
+
deband_grain
+

Amount of extra output grain to add. Helps hide imperfections. Defaults to +6.0. +

+
+ +
+
+

30.143.1.4 Color adjustment

+

A collection of subjective color controls. Not very rigorous, so the exact +effect will vary somewhat depending on the input primaries and colorspace. +

+
brightness
+

Brightness boost, between -1.0 and 1.0. Defaults to 0.0. +

+
+
contrast
+

Contrast gain, between 0.0 and 16.0. Defaults to 1.0. +

+
+
saturation
+

Saturation gain, between 0.0 and 16.0. Defaults to 1.0. +

+
+
hue
+

Hue shift in radians, between -3.14 and 3.14. Defaults to +0.0. This will rotate the UV subvector, defaulting to BT.709 +coefficients for RGB inputs. +

+
+
gamma
+

Gamma adjustment, between 0.0 and 16.0. Defaults to 1.0. +

+
+
cones
+

Cone model to use for color blindness simulation. Accepts any combination of +l, m and s. Here are some examples: +

+
m
+

Deuteranomaly / deuteranopia (affecting 3%-4% of the population) +

+
l
+

Protanomaly / protanopia (affecting 1%-2% of the population) +

+
l+m
+

Monochromacy (very rare) +

+
l+m+s
+

Achromatopsy (complete loss of daytime vision, extremely rare) +

+
+ +
+
cone-strength
+

Gain factor for the cones specified by cones, between 0.0 and +10.0. A value of 1.0 results in no change to color vision. A +value of 0.0 (the default) simulates complete loss of those cones. Values +above 1.0 result in exaggerating the differences between cones, which +may help compensate for reduced color vision. +

+
+ +
+
+

30.143.1.5 Peak detection

+

To help deal with sources that only have static HDR10 metadata (or no tagging +whatsoever), libplacebo uses its own internal frame analysis compute shader to +analyze source frames and adapt the tone mapping function in realtime. If this +is too slow, or if exactly reproducible frame-perfect results are needed, it’s +recommended to turn this feature off. +

+
peak_detect
+

Enable HDR peak detection. Ignores static MaxCLL/MaxFALL values in favor of +dynamic detection from the input. Note that the detected values do not get +written back to the output frames, they merely guide the internal tone mapping +process. Enabled by default. +

+
+
smoothing_period
+

Peak detection smoothing period, between 0.0 and 1000.0. Higher +values result in peak detection becoming less responsive to changes in the +input. Defaults to 100.0. +

+
+
minimum_peak
+

Lower bound on the detected peak (relative to SDR white), between 0.0 +and 100.0. Defaults to 1.0. +

+
+
scene_threshold_low
+
scene_threshold_high
+

Lower and upper thresholds for scene change detection. Expressed in a +logarithmic scale between 0.0 and 100.0. Default to 5.5 +and 10.0, respectively. Setting either to a negative value disables +this functionality. +

+
+
percentile
+

Which percentile of the frame brightness histogram to use as the source peak +for tone-mapping. Defaults to 99.995, a fairly conservative value. +Setting this to 100.0 disables frame histogram measurement and instead +uses the true peak brightness for tone-mapping. +

+
+ +
+
+

30.143.1.6 Tone mapping

+

The options in this section control how libplacebo performs tone-mapping and +gamut-mapping when dealing with mismatches between wide-gamut or HDR content. +In general, libplacebo relies on accurate source tagging and mastering display +gamut information to produce the best results. +

+
gamut_mode
+

How to handle out-of-gamut colors that can occur as a result of colorimetric +gamut mapping. +

+
clip
+

Do nothing, simply clip out-of-range colors to the RGB volume. Low quality but +extremely fast. +

+
perceptual
+

Perceptually soft-clip colors to the gamut volume. This is the default. +

+
relative
+

Relative colorimetric hard-clip. Similar to perceptual but without +the soft knee. +

+
saturation
+

Saturation mapping, maps primaries directly to primaries in RGB space. +Not recommended except for artificial computer graphics for which a bright, +saturated display is desired. +

+
absolute
+

Absolute colorimetric hard-clip. Performs no adjustment of the white point. +

+
desaturate
+

Hard-desaturates out-of-gamut colors towards white, while preserving the +luminance. Has a tendency to distort the visual appearance of bright objects. +

+
darken
+

Linearly reduces content brightness to preserves saturated details, followed by +clipping the remaining out-of-gamut colors. +

+
warn
+

Highlight out-of-gamut pixels (by inverting/marking them). +

+
linear
+

Linearly reduces chromaticity of the entire image to make it fit within the +target color volume. Be careful when using this on BT.2020 sources without +proper mastering metadata, as doing so will lead to excessive desaturation. +

+
+ +
+
tonemapping
+

Tone-mapping algorithm to use. Available values are: +

+
auto
+

Automatic selection based on internal heuristics. This is the default. +

+
clip
+

Performs no tone-mapping, just clips out-of-range colors. Retains perfect color +accuracy for in-range colors but completely destroys out-of-range information. +Does not perform any black point adaptation. Not configurable. +

+
st2094-40
+

EETF from SMPTE ST 2094-40 Annex B, which applies the Bezier curves from HDR10+ +dynamic metadata based on Bezier curves to perform tone-mapping. The OOTF used +is adjusted based on the ratio between the targeted and actual display peak +luminances. +

+
st2094-10
+

EETF from SMPTE ST 2094-10 Annex B.2, which takes into account the input signal +average luminance in addition to the maximum/minimum. The configurable contrast +parameter influences the slope of the linear output segment, defaulting to +1.0 for no increase/decrease in contrast. Note that this does not +currently include the subjective gain/offset/gamma controls defined in Annex +B.3. +

+
bt.2390
+

EETF from the ITU-R Report BT.2390, a hermite spline roll-off with linear +segment. The knee point offset is configurable. Note that this parameter +defaults to 1.0, rather than the value of 0.5 from the ITU-R +spec. +

+
bt.2446a
+

EETF from ITU-R Report BT.2446, method A. Designed for well-mastered HDR +sources. Can be used for both forward and inverse tone mapping. Not +configurable. +

+
spline
+

Simple spline consisting of two polynomials, joined by a single pivot point. +The parameter gives the pivot point (in PQ space), defaulting to 0.30. +Can be used for both forward and inverse tone mapping. +

+
reinhard
+

Simple non-linear, global tone mapping algorithm. The parameter specifies the +local contrast coefficient at the display peak. Essentially, a parameter of +0.5 implies that the reference white will be about half as bright as +when clipping. Defaults to 0.5, which results in the simplest +formulation of this function. +

+
mobius
+

Generalization of the reinhard tone mapping algorithm to support an additional +linear slope near black. The tone mapping parameter indicates the trade-off +between the linear section and the non-linear section. Essentially, for a given +parameter x, every color value below x will be mapped linearly, +while higher values get non-linearly tone-mapped. Values near 1.0 make +this curve behave like clip, while values near 0.0 make this +curve behave like reinhard. The default value is 0.3, which +provides a good balance between colorimetric accuracy and preserving +out-of-gamut details. +

+
hable
+

Piece-wise, filmic tone-mapping algorithm developed by John Hable for use in +Uncharted 2, inspired by a similar tone-mapping algorithm used by Kodak. +Popularized by its use in video games with HDR rendering. Preserves both dark +and bright details very well, but comes with the drawback of changing the +average brightness quite significantly. This is sort of similar to +reinhard with parameter 0.24. +

+
gamma
+

Fits a gamma (power) function to transfer between the source and target color +spaces, effectively resulting in a perceptual hard-knee joining two roughly +linear sections. This preserves details at all scales fairly accurately, but +can result in an image with a muted or dull appearance. The parameter is used +as the cutoff point, defaulting to 0.5. +

+
linear
+

Linearly stretches the input range to the output range, in PQ space. This will +preserve all details accurately, but results in a significantly different +average brightness. Can be used for inverse tone-mapping in addition to regular +tone-mapping. The parameter can be used as an additional linear gain +coefficient (defaulting to 1.0). +

+
+ +
+
tonemapping_param
+

For tunable tone mapping functions, this parameter can be used to fine-tune the +curve behavior. Refer to the documentation of tonemapping. The default +value of 0.0 is replaced by the curve’s preferred default setting. +

+
+
inverse_tonemapping
+

If enabled, this filter will also attempt stretching SDR signals to fill HDR +output color volumes. Disabled by default. +

+
+
tonemapping_lut_size
+

Size of the tone-mapping LUT, between 2 and 1024. Defaults to +256. Note that this figure is squared when combined with +peak_detect. +

+
+
hybrid_mix
+

If nonzero, this much of the upper range of the tone-mapped result is smoothly +mixed with a per-channel (LMS) tone-mapped version. Helps avoid unnatural +blown-out highlights when tone-mapping very bright, strongly saturated colors. +Defaults to 0.2. +

+
+ +
+
+

30.143.1.7 Dithering

+

By default, libplacebo will dither whenever necessary, which includes rendering +to any integer format below 16-bit precision. It’s recommended to always leave +this on, since not doing so may result in visible banding in the output, even +if the debanding filter is enabled. If maximum performance is needed, +use ordered_fixed instead of disabling dithering. +

+
dithering
+

Dithering method to use. Accepts the following values: +

+
none
+

Disables dithering completely. May result in visible banding. +

+
blue
+

Dither with pseudo-blue noise. This is the default. +

+
ordered
+

Tunable ordered dither pattern. +

+
ordered_fixed
+

Faster ordered dither with a fixed size of 6. Texture-less. +

+
white
+

Dither with white noise. Texture-less. +

+
+ +
+
dither_lut_size
+

Dither LUT size, as log base2 between 1 and 8. Defaults to +6, corresponding to a LUT size of 64x64. +

+
+
dither_temporal
+

Enables temporal dithering. Disabled by default. +

+
+ +
+
+

30.143.1.8 Custom shaders

+

libplacebo supports a number of custom shaders based on the mpv .hook GLSL +syntax. A collection of such shaders can be found here: +https://github.com/mpv-player/mpv/wiki/User-Scripts#user-shaders +

+

A full description of the mpv shader format is beyond the scope of this +section, but a summary can be found here: +https://mpv.io/manual/master/#options-glsl-shader +

+
custom_shader_path
+

Specifies a path to a custom shader file to load at runtime. +

+
+
custom_shader_bin
+

Specifies a complete custom shader as a raw string. +

+
+ +
+
+

30.143.1.9 Debugging / performance

+

All of the options in this section default off. They may be of assistance when +attempting to squeeze the maximum performance at the cost of quality. +

+
skip_aa
+

Disable anti-aliasing when downscaling. +

+
+
polar_cutoff
+

Truncate polar (EWA) scaler kernels below this absolute magnitude, between +0.0 and 1.0. +

+
+
disable_linear
+

Disable linear light scaling. +

+
+
disable_builtin
+

Disable built-in GPU sampling (forces LUT). +

+
+
disable_fbos
+

Forcibly disable FBOs, resulting in loss of almost all functionality, but +offering the maximum possible speed. +

+
+ +
+
+
+

30.143.2 Commands

+

This filter supports almost all of the above options as commands. +

+
+
+

30.143.3 Examples

+
    +
  • Tone-map input to standard gamut BT.709 output: +
    +
    libplacebo=colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv
    +
    + +
  • Rescale input to fit into standard 1080p, with high quality scaling: +
    +
    libplacebo=w=1920:h=1080:force_original_aspect_ratio=decrease:normalize_sar=true:upscaler=ewa_lanczos:downscaler=ewa_lanczos
    +
    + +
  • Interpolate low FPS / VFR input to smoothed constant 60 fps output: +
    +
    libplacebo=fps=60:frame_mixer=mitchell_clamp
    +
    + +
  • Convert input to standard sRGB JPEG: +
    +
    libplacebo=format=yuv420p:colorspace=bt470bg:color_primaries=bt709:color_trc=iec61966-2-1:range=pc
    +
    + +
  • Use higher quality debanding settings: +
    +
    libplacebo=deband=true:deband_iterations=3:deband_radius=8:deband_threshold=6
    +
    + +
  • Run this filter on the CPU, on systems with Mesa installed (and with the most +expensive options disabled): +
    +
    ffmpeg ... -init_hw_device vulkan:llvmpipe ... -vf libplacebo=upscaler=none:downscaler=none:peak_detect=false
    +
    + +
  • Suppress CPU-based AV1/H.274 film grain application in the decoder, in favor of +doing it with this filter. Note that this is only a gain if the frames are +either already on the GPU, or if you’re using libplacebo for other purposes, +since otherwise the VRAM roundtrip will more than offset any expected speedup. +
    +
    ffmpeg -export_side_data +film_grain ... -vf libplacebo=apply_filmgrain=true
    +
    + +
  • Interop with VAAPI hwdec to avoid round-tripping through RAM: +
    +
    ffmpeg -init_hw_device vulkan -hwaccel vaapi -hwaccel_output_format vaapi ... -vf libplacebo
    +
    +
+ +
+
+
+

30.144 libvmaf

+ +

Calulate the VMAF (Video Multi-Method Assessment Fusion) score for a +reference/distorted pair of input videos. +

+

The first input is the distorted video, and the second input is the reference video. +

+

The obtained VMAF score is printed through the logging system. +

+

It requires Netflix’s vmaf library (libvmaf) as a pre-requisite. +After installing the library it can be enabled using: +./configure --enable-libvmaf. +

+

The filter has following options: +

+
+
model
+

A ‘|‘ delimited list of vmaf models. Each model can be configured with a number of parameters. +Default value: "version=vmaf_v0.6.1" +

+
+
model_path
+

Deprecated, use model=’path=...’. +

+
+
enable_transform
+

Deprecated, use model=’enable_transform=true’. +

+
+
phone_model
+

Deprecated, use model=’enable_transform=true’. +

+
+
enable_conf_interval
+

Deprecated, use model=’enable_conf_interval=true’. +

+
+
feature
+

A ‘|‘ delimited list of features. Each feature can be configured with a number of parameters. +

+
+
psnr
+

Deprecated, use feature=’name=psnr’. +

+
+
ssim
+

Deprecated, use feature=’name=ssim’. +

+
+
ms_ssim
+

Deprecated, use feature=’name=ms_ssim’. +

+
+
log_path
+

Set the file path to be used to store log files. +

+
+
log_fmt
+

Set the format of the log file (xml, json, csv, or sub). +

+
+
n_threads
+

Set number of threads to be used when initializing libvmaf. +Default value: 0, no threads. +

+
+
n_subsample
+

Set frame subsampling interval to be used. +

+
+ +

This filter also supports the framesync options. +

+ +
+

30.144.1 Examples

+
    +
  • In the examples below, a distorted video distorted.mpg is +compared with a reference file reference.mpg. + +
  • Basic usage: +
    +
    ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf=log_path=output.xml -f null -
    +
    + +
  • Example with multiple models: +
    +
    ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='model=version=vmaf_v0.6.1\\:name=vmaf|version=vmaf_v0.6.1neg\\:name=vmaf_neg' -f null -
    +
    + +
  • Example with multiple addtional features: +
    +
    ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='feature=name=psnr|name=ciede' -f null -
    +
    + +
  • Example with options and different containers: +
    +
    ffmpeg -i distorted.mpg -i reference.mkv -lavfi "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]libvmaf=log_fmt=json:log_path=output.json" -f null -
    +
    +
+ +
+
+
+

30.145 limitdiff

+

Apply limited difference filter using second and optionally third video stream. +

+

The filter accepts the following options: +

+
+
threshold
+

Set the threshold to use when allowing certain differences between video streams. +Any absolute difference value lower or exact than this threshold will pick pixel components from +first video stream. +

+
+
elasticity
+

Set the elasticity of soft thresholding when processing video streams. +This value multiplied with first one sets second threshold. +Any absolute difference value greater or exact than second threshold will pick pixel components +from second video stream. For values between those two threshold +linear interpolation between first and second video stream will be used. +

+
+
reference
+

Enable the reference (third) video stream processing. By default is disabled. +If set, this video stream will be used for calculating absolute difference with first video +stream. +

+
+
planes
+

Specify which planes will be processed. Defaults to all available. +

+
+ + +
+

30.145.1 Commands

+ +

This filter supports the all above options as commands except option ‘reference’. +

+
+
+
+

30.146 limiter

+ +

Limits the pixel components values to the specified range [min, max]. +

+

The filter accepts the following options: +

+
+
min
+

Lower bound. Defaults to the lowest allowed value for the input. +

+
+
max
+

Upper bound. Defaults to the highest allowed value for the input. +

+
+
planes
+

Specify which planes will be processed. Defaults to all available. +

+
+ + +
+

30.146.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.147 loop

+ +

Loop video frames. +

+

The filter accepts the following options: +

+
+
loop
+

Set the number of loops. Setting this value to -1 will result in infinite loops. +Default is 0. +

+
+
size
+

Set maximal size in number of frames. Default is 0. +

+
+
start
+

Set first frame of loop. Default is 0. +

+
+
time
+

Set the time of loop start in seconds. +Only used if option named start is set to -1. +

+
+ + +
+

30.147.1 Examples

+ +
    +
  • Loop single first frame infinitely: +
    +
    loop=loop=-1:size=1:start=0
    +
    + +
  • Loop single first frame 10 times: +
    +
    loop=loop=10:size=1:start=0
    +
    + +
  • Loop 10 first frames 5 times: +
    +
    loop=loop=5:size=10:start=0
    +
    +
+ +
+
+
+

30.148 lut1d

+ +

Apply a 1D LUT to an input video. +

+

The filter accepts the following options: +

+
+
file
+

Set the 1D LUT file name. +

+

Currently supported formats: +

+
cube
+

Iridas +

+
csp
+

cineSpace +

+
+ +
+
interp
+

Select interpolation mode. +

+

Available values are: +

+
+
nearest
+

Use values from the nearest defined point. +

+
linear
+

Interpolate values using the linear interpolation. +

+
cosine
+

Interpolate values using the cosine interpolation. +

+
cubic
+

Interpolate values using the cubic interpolation. +

+
spline
+

Interpolate values using the spline interpolation. +

+
+
+
+ + +
+

30.148.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.149 lut3d

+ +

Apply a 3D LUT to an input video. +

+

The filter accepts the following options: +

+
+
file
+

Set the 3D LUT file name. +

+

Currently supported formats: +

+
3dl
+

AfterEffects +

+
cube
+

Iridas +

+
dat
+

DaVinci +

+
m3d
+

Pandora +

+
csp
+

cineSpace +

+
+
+
interp
+

Select interpolation mode. +

+

Available values are: +

+
+
nearest
+

Use values from the nearest defined point. +

+
trilinear
+

Interpolate values using the 8 points defining a cube. +

+
tetrahedral
+

Interpolate values using a tetrahedron. +

+
pyramid
+

Interpolate values using a pyramid. +

+
prism
+

Interpolate values using a prism. +

+
+
+
+ + +
+

30.149.1 Commands

+ +

This filter supports the interp option as commands. +

+
+
+
+

30.150 lumakey

+ +

Turn certain luma values into transparency. +

+

The filter accepts the following options: +

+
+
threshold
+

Set the luma which will be used as base for transparency. +Default value is 0. +

+
+
tolerance
+

Set the range of luma values to be keyed out. +Default value is 0.01. +

+
+
softness
+

Set the range of softness. Default value is 0. +Use this to control gradual transition from zero to full transparency. +

+
+ + +
+

30.150.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

30.151 lut, lutrgb, lutyuv

+ +

Compute a look-up table for binding each pixel component input value +to an output value, and apply it to the input video. +

+

lutyuv applies a lookup table to a YUV input video, lutrgb +to an RGB input video. +

+

These filters accept the following parameters: +

+
c0
+

set first pixel component expression +

+
c1
+

set second pixel component expression +

+
c2
+

set third pixel component expression +

+
c3
+

set fourth pixel component expression, corresponds to the alpha component +

+
+
r
+

set red component expression +

+
g
+

set green component expression +

+
b
+

set blue component expression +

+
a
+

alpha component expression +

+
+
y
+

set Y/luminance component expression +

+
u
+

set U/Cb component expression +

+
v
+

set V/Cr component expression +

+
+ +

Each of them specifies the expression to use for computing the lookup table for +the corresponding pixel component values. +

+

The exact component associated to each of the c* options depends on the +format in input. +

+

The lut filter requires either YUV or RGB pixel formats in input, +lutrgb requires RGB pixel formats in input, and lutyuv requires YUV. +

+

The expressions can contain the following constants and functions: +

+
+
w
+
h
+

The input width and height. +

+
+
val
+

The input value for the pixel component. +

+
+
clipval
+

The input value, clipped to the minval-maxval range. +

+
+
maxval
+

The maximum value for the pixel component. +

+
+
minval
+

The minimum value for the pixel component. +

+
+
negval
+

The negated value for the pixel component value, clipped to the +minval-maxval range; it corresponds to the expression +"maxval-clipval+minval". +

+
+
clip(val)
+

The computed value in val, clipped to the +minval-maxval range. +

+
+
gammaval(gamma)
+

The computed gamma correction value of the pixel component value, +clipped to the minval-maxval range. It corresponds to the +expression +"pow((clipval-minval)/(maxval-minval)\,gamma)*(maxval-minval)+minval" +

+
+
+ +

All expressions default to "clipval". +

+ +
+

30.151.1 Commands

+ +

This filter supports same commands as options. +

+
+
+

30.151.2 Examples

+ +
    +
  • Negate input video: +
    +
    lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
    +lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
    +
    + +

    The above is the same as: +

    +
    lutrgb="r=negval:g=negval:b=negval"
    +lutyuv="y=negval:u=negval:v=negval"
    +
    + +
  • Negate luminance: +
    +
    lutyuv=y=negval
    +
    + +
  • Remove chroma components, turning the video into a graytone image: +
    +
    lutyuv="u=128:v=128"
    +
    + +
  • Apply a luma burning effect: +
    +
    lutyuv="y=2*val"
    +
    + +
  • Remove green and blue components: +
    +
    lutrgb="g=0:b=0"
    +
    + +
  • Set a constant alpha channel value on input: +
    +
    format=rgba,lutrgb=a="maxval-minval/2"
    +
    + +
  • Correct luminance gamma by a factor of 0.5: +
    +
    lutyuv=y=gammaval(0.5)
    +
    + +
  • Discard least significant bits of luma: +
    +
    lutyuv=y='bitand(val, 128+64+32)'
    +
    + +
  • Technicolor like effect: +
    +
    lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
    +
    +
+ +
+
+
+

30.152 lut2, tlut2

+ +

The lut2 filter takes two input streams and outputs one +stream. +

+

The tlut2 (time lut2) filter takes two consecutive frames +from one single stream. +

+

This filter accepts the following parameters: +

+
c0
+

set first pixel component expression +

+
c1
+

set second pixel component expression +

+
c2
+

set third pixel component expression +

+
c3
+

set fourth pixel component expression, corresponds to the alpha component +

+
+
d
+

set output bit depth, only available for lut2 filter. By default is 0, +which means bit depth is automatically picked from first input format. +

+
+ +

The lut2 filter also supports the framesync options. +

+

Each of them specifies the expression to use for computing the lookup table for +the corresponding pixel component values. +

+

The exact component associated to each of the c* options depends on the +format in inputs. +

+

The expressions can contain the following constants: +

+
+
w
+
h
+

The input width and height. +

+
+
x
+

The first input value for the pixel component. +

+
+
y
+

The second input value for the pixel component. +

+
+
bdx
+

The first input video bit depth. +

+
+
bdy
+

The second input video bit depth. +

+
+ +

All expressions default to "x". +

+ +
+

30.152.1 Commands

+ +

This filter supports the all above options as commands except option d. +

+
+
+

30.152.2 Examples

+ +
    +
  • Highlight differences between two RGB video streams: +
    +
    lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1)'
    +
    + +
  • Highlight differences between two YUV video streams: +
    +
    lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1)'
    +
    + +
  • Show max difference between two video streams: +
    +
    lut2='if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1)))'
    +
    +
+ +
+
+
+

30.153 maskedclamp

+ +

Clamp the first input stream with the second input and third input stream. +

+

Returns the value of first stream to be between second input +stream - undershoot and third input stream + overshoot. +

+

This filter accepts the following options: +

+
undershoot
+

Default value is 0. +

+
+
overshoot
+

Default value is 0. +

+
+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

30.153.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.154 maskedmax

+ +

Merge the second and third input stream into output stream using absolute differences +between second input stream and first input stream and absolute difference between +third input stream and first input stream. The picked value will be from second input +stream if second absolute difference is greater than first one or from third input stream +otherwise. +

+

This filter accepts the following options: +

+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

30.154.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.155 maskedmerge

+ +

Merge the first input stream with the second input stream using per pixel +weights in the third input stream. +

+

A value of 0 in the third stream pixel component means that pixel component +from first stream is returned unchanged, while maximum value (eg. 255 for +8-bit videos) means that pixel component from second stream is returned +unchanged. Intermediate values define the amount of merging between both +input stream’s pixel components. +

+

This filter accepts the following options: +

+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

30.155.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.156 maskedmin

+ +

Merge the second and third input stream into output stream using absolute differences +between second input stream and first input stream and absolute difference between +third input stream and first input stream. The picked value will be from second input +stream if second absolute difference is less than first one or from third input stream +otherwise. +

+

This filter accepts the following options: +

+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

30.156.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.157 maskedthreshold

+

Pick pixels comparing absolute difference of two video streams with fixed +threshold. +

+

If absolute difference between pixel component of first and second video +stream is equal or lower than user supplied threshold than pixel component +from first video stream is picked, otherwise pixel component from second +video stream is picked. +

+

This filter accepts the following options: +

+
threshold
+

Set threshold used when picking pixels from absolute difference from two input +video streams. +

+
+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from second stream. +By default value 0xf, all planes will be processed. +

+
+
mode
+

Set mode of filter operation. Can be abs or diff. +Default is abs. +

+
+ + +
+

30.157.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.158 maskfun

+

Create mask from input video. +

+

For example it is useful to create motion masks after tblend filter. +

+

This filter accepts the following options: +

+
+
low
+

Set low threshold. Any pixel component lower or exact than this value will be set to 0. +

+
+
high
+

Set high threshold. Any pixel component higher than this value will be set to max value +allowed for current pixel format. +

+
+
planes
+

Set planes to filter, by default all available planes are filtered. +

+
+
fill
+

Fill all frame pixels with this value. +

+
+
sum
+

Set max average pixel value for frame. If sum of all pixel components is higher that this +average, output frame will be completely filled with value set by fill option. +Typically useful for scene changes when used in combination with tblend filter. +

+
+ + +
+

30.158.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.159 mcdeint

+ +

Apply motion-compensation deinterlacing. +

+

It needs one field per frame as input and must thus be used together +with yadif=1/3 or equivalent. +

+

This filter accepts the following options: +

+
mode
+

Set the deinterlacing mode. +

+

It accepts one of the following values: +

+
fast
+
medium
+
slow
+

use iterative motion estimation +

+
extra_slow
+

like ‘slow’, but use multiple reference frames. +

+
+

Default value is ‘fast’. +

+
+
parity
+

Set the picture field parity assumed for the input video. It must be +one of the following values: +

+
+
0, tff
+

assume top field first +

+
1, bff
+

assume bottom field first +

+
+ +

Default value is ‘bff’. +

+
+
qp
+

Set per-block quantization parameter (QP) used by the internal +encoder. +

+

Higher values should result in a smoother motion vector field but less +optimal individual vectors. Default value is 1. +

+
+ +
+
+

30.160 median

+ +

Pick median pixel from certain rectangle defined by radius. +

+

This filter accepts the following options: +

+
+
radius
+

Set horizontal radius size. Default value is 1. +Allowed range is integer from 1 to 127. +

+
+
planes
+

Set which planes to process. Default is 15, which is all available planes. +

+
+
radiusV
+

Set vertical radius size. Default value is 0. +Allowed range is integer from 0 to 127. +If it is 0, value will be picked from horizontal radius option. +

+
+
percentile
+

Set median percentile. Default value is 0.5. +Default value of 0.5 will pick always median values, while 0 will pick +minimum values, and 1 maximum values. +

+
+ + +
+

30.160.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

30.161 mergeplanes

+ +

Merge color channel components from several video streams. +

+

The filter accepts up to 4 input streams, and merge selected input +planes to the output video. +

+

This filter accepts the following options: +

+
mapping
+

Set input to output plane mapping. Default is 0. +

+

The mappings is specified as a bitmap. It should be specified as a +hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. ’Aa’ describes the +mapping for the first plane of the output stream. ’A’ sets the number of +the input stream to use (from 0 to 3), and ’a’ the plane number of the +corresponding input to use (from 0 to 3). The rest of the mappings is +similar, ’Bb’ describes the mapping for the output stream second +plane, ’Cc’ describes the mapping for the output stream third plane and +’Dd’ describes the mapping for the output stream fourth plane. +

+
+
format
+

Set output pixel format. Default is yuva444p. +

+
+
map0s
+
map1s
+
map2s
+
map3s
+

Set input to output stream mapping for output Nth plane. Default is 0. +

+
+
map0p
+
map1p
+
map2p
+
map3p
+

Set input to output plane mapping for output Nth plane. Default is 0. +

+
+ + +
+

30.161.1 Examples

+ +
    +
  • Merge three gray video streams of same width and height into single video stream: +
    +
    [a0][a1][a2]mergeplanes=0x001020:yuv444p
    +
    + +
  • Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream: +
    +
    [a0][a1]mergeplanes=0x00010210:yuva444p
    +
    + +
  • Swap Y and A plane in yuva444p stream: +
    +
    format=yuva444p,mergeplanes=0x03010200:yuva444p
    +
    + +
  • Swap U and V plane in yuv420p stream: +
    +
    format=yuv420p,mergeplanes=0x000201:yuv420p
    +
    + +
  • Cast a rgb24 clip to yuv444p: +
    +
    format=rgb24,mergeplanes=0x000102:yuv444p
    +
    +
+ +
+
+
+

30.162 mestimate

+ +

Estimate and export motion vectors using block matching algorithms. +Motion vectors are stored in frame side data to be used by other filters. +

+

This filter accepts the following options: +

+
method
+

Specify the motion estimation method. Accepts one of the following values: +

+
+
esa
+

Exhaustive search algorithm. +

+
tss
+

Three step search algorithm. +

+
tdls
+

Two dimensional logarithmic search algorithm. +

+
ntss
+

New three step search algorithm. +

+
fss
+

Four step search algorithm. +

+
ds
+

Diamond search algorithm. +

+
hexbs
+

Hexagon-based search algorithm. +

+
epzs
+

Enhanced predictive zonal search algorithm. +

+
umh
+

Uneven multi-hexagon search algorithm. +

+
+

Default value is ‘esa’. +

+
+
mb_size
+

Macroblock size. Default 16. +

+
+
search_param
+

Search parameter. Default 7. +

+
+ +
+
+

30.163 midequalizer

+ +

Apply Midway Image Equalization effect using two video streams. +

+

Midway Image Equalization adjusts a pair of images to have the same +histogram, while maintaining their dynamics as much as possible. It’s +useful for e.g. matching exposures from a pair of stereo cameras. +

+

This filter has two inputs and one output, which must be of same pixel format, but +may be of different sizes. The output of filter is first input adjusted with +midway histogram of both inputs. +

+

This filter accepts the following option: +

+
+
planes
+

Set which planes to process. Default is 15, which is all available planes. +

+
+ +
+
+

30.164 minterpolate

+ +

Convert the video to specified frame rate using motion interpolation. +

+

This filter accepts the following options: +

+
fps
+

Specify the output frame rate. This can be rational e.g. 60000/1001. Frames are dropped if fps is lower than source fps. Default 60. +

+
+
mi_mode
+

Motion interpolation mode. Following values are accepted: +

+
dup
+

Duplicate previous or next frame for interpolating new ones. +

+
blend
+

Blend source frames. Interpolated frame is mean of previous and next frames. +

+
mci
+

Motion compensated interpolation. Following options are effective when this mode is selected: +

+
+
mc_mode
+

Motion compensation mode. Following values are accepted: +

+
obmc
+

Overlapped block motion compensation. +

+
aobmc
+

Adaptive overlapped block motion compensation. Window weighting coefficients are controlled adaptively according to the reliabilities of the neighboring motion vectors to reduce oversmoothing. +

+
+

Default mode is ‘obmc’. +

+
+
me_mode
+

Motion estimation mode. Following values are accepted: +

+
bidir
+

Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions. +

+
bilat
+

Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame. +

+
+

Default mode is ‘bilat’. +

+
+
me
+

The algorithm to be used for motion estimation. Following values are accepted: +

+
esa
+

Exhaustive search algorithm. +

+
tss
+

Three step search algorithm. +

+
tdls
+

Two dimensional logarithmic search algorithm. +

+
ntss
+

New three step search algorithm. +

+
fss
+

Four step search algorithm. +

+
ds
+

Diamond search algorithm. +

+
hexbs
+

Hexagon-based search algorithm. +

+
epzs
+

Enhanced predictive zonal search algorithm. +

+
umh
+

Uneven multi-hexagon search algorithm. +

+
+

Default algorithm is ‘epzs’. +

+
+
mb_size
+

Macroblock size. Default 16. +

+
+
search_param
+

Motion estimation search parameter. Default 32. +

+
+
vsbmc
+

Enable variable-size block motion compensation. Motion estimation is applied with smaller block sizes at object boundaries in order to make the them less blur. Default is 0 (disabled). +

+
+
+
+ +
+
scd
+

Scene change detection method. Scene change leads motion vectors to be in random direction. Scene change detection replace interpolated frames by duplicate ones. May not be needed for other modes. Following values are accepted: +

+
none
+

Disable scene change detection. +

+
fdiff
+

Frame difference. Corresponding pixel values are compared and if it satisfies scd_threshold scene change is detected. +

+
+

Default method is ‘fdiff’. +

+
+
scd_threshold
+

Scene change detection threshold. Default is 10.. +

+
+ +
+
+

30.165 mix

+ +

Mix several video input streams into one video stream. +

+

A description of the accepted options follows. +

+
+
inputs
+

The number of inputs. If unspecified, it defaults to 2. +

+
+
weights
+

Specify weight of each input video stream as sequence. +Each weight is separated by space. If number of weights +is smaller than number of frames last specified +weight will be used for all remaining unset weights. +

+
+
scale
+

Specify scale, if it is set it will be multiplied with sum +of each weight multiplied with pixel values to give final destination +pixel value. By default scale is auto scaled to sum of weights. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+
duration
+

Specify how end of stream is determined. +

+
longest
+

The duration of the longest input. (default) +

+
+
shortest
+

The duration of the shortest input. +

+
+
first
+

The duration of the first input. +

+
+
+
+ + +
+

30.165.1 Commands

+ +

This filter supports the following commands: +

+
weights
+
scale
+
planes
+

Syntax is same as option with same name. +

+
+ +
+
+
+

30.166 monochrome

+

Convert video to gray using custom color filter. +

+

A description of the accepted options follows. +

+
+
cb
+

Set the chroma blue spot. Allowed range is from -1 to 1. +Default value is 0. +

+
+
cr
+

Set the chroma red spot. Allowed range is from -1 to 1. +Default value is 0. +

+
+
size
+

Set the color filter size. Allowed range is from .1 to 10. +Default value is 1. +

+
+
high
+

Set the highlights strength. Allowed range is from 0 to 1. +Default value is 0. +

+
+ + +
+

30.166.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.167 morpho

+ +

This filter allows to apply main morphological grayscale transforms, +erode and dilate with arbitrary structures set in second input stream. +

+

Unlike naive implementation and much slower performance in erosion +and dilation filters, when speed is critical morpho filter +should be used instead. +

+

A description of accepted options follows, +

+
+
mode
+

Set morphological transform to apply, can be: +

+
+
erode
+
dilate
+
open
+
close
+
gradient
+
tophat
+
blackhat
+
+

Default is erode. +

+
+
planes
+

Set planes to filter, by default all planes except alpha are filtered. +

+
+
structure
+

Set which structure video frames will be processed from second input stream, +can be first or all. Default is all. +

+
+ +

The morpho filter also supports the framesync options. +

+ +
+

30.167.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

30.168 mpdecimate

+ +

Drop frames that do not differ greatly from the previous frame in +order to reduce frame rate. +

+

The main use of this filter is for very-low-bitrate encoding +(e.g. streaming over dialup modem), but it could in theory be used for +fixing movies that were inverse-telecined incorrectly. +

+

A description of the accepted options follows. +

+
+
max
+

Set the maximum number of consecutive frames which can be dropped (if +positive), or the minimum interval between dropped frames (if +negative). If the value is 0, the frame is dropped disregarding the +number of previous sequentially dropped frames. +

+

Default value is 0. +

+
+
keep
+

Set the maximum number of consecutive similar frames to ignore before to start dropping them. +If the value is 0, the frame is dropped disregarding the +number of previous sequentially similar frames. +

+

Default value is 0. +

+
+
hi
+
lo
+
frac
+

Set the dropping threshold values. +

+

Values for hi and lo are for 8x8 pixel blocks and +represent actual pixel value differences, so a threshold of 64 +corresponds to 1 unit of difference for each pixel, or the same spread +out differently over the block. +

+

A frame is a candidate for dropping if no 8x8 blocks differ by more +than a threshold of hi, and if no more than frac blocks (1 +meaning the whole image) differ by more than a threshold of lo. +

+

Default value for hi is 64*12, default value for lo is +64*5, and default value for frac is 0.33. +

+
+ +
+
+

30.169 msad

+ +

Obtain the MSAD (Mean Sum of Absolute Differences) between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained per component, average, min and max MSAD is printed through +the logging system. +

+

The filter stores the calculated MSAD of each frame in frame metadata. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi msad -f null -
+
+ +
+
+

30.170 multiply

+

Multiply first video stream pixels values with second video stream pixels values. +

+

The filter accepts the following options: +

+
+
scale
+

Set the scale applied to second video stream. By default is 1. +Allowed range is from 0 to 9. +

+
+
offset
+

Set the offset applied to second video stream. By default is 0.5. +Allowed range is from -1 to 1. +

+
+
planes
+

Specify planes from input video stream that will be processed. +By default all planes are processed. +

+
+ + +
+

30.170.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

30.171 negate

+ +

Negate (invert) the input video. +

+

It accepts the following option: +

+
+
components
+

Set components to negate. +

+

Available values for components are: +

+
y
+
u
+
v
+
a
+
r
+
g
+
b
+
+ +
+
negate_alpha
+

With value 1, it negates the alpha component, if present. Default value is 0. +

+
+ + +
+

30.171.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

30.172 nlmeans

+ +

Denoise frames using Non-Local Means algorithm. +

+

Each pixel is adjusted by looking for other pixels with similar contexts. This +context similarity is defined by comparing their surrounding patches of size +pxp. Patches are searched in an area of rxr +around the pixel. +

+

Note that the research area defines centers for patches, which means some +patches will be made of pixels outside that research area. +

+

The filter accepts the following options. +

+
+
s
+

Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0]. +

+
+
p
+

Set patch size. Default is 7. Must be odd number in range [0, 99]. +

+
+
pc
+

Same as p but for chroma planes. +

+

The default value is 0 and means automatic. +

+
+
r
+

Set research size. Default is 15. Must be odd number in range [0, 99]. +

+
+
rc
+

Same as r but for chroma planes. +

+

The default value is 0 and means automatic. +

+
+ +
+
+

30.173 nnedi

+ +

Deinterlace video using neural network edge directed interpolation. +

+

This filter accepts the following options: +

+
+
weights
+

Mandatory option, without binary file filter can not work. +Currently file can be found here: +https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin +

+
+
deint
+

Set which frames to deinterlace, by default it is all. +Can be all or interlaced. +

+
+
field
+

Set mode of operation. +

+

Can be one of the following: +

+
+
af
+

Use frame flags, both fields. +

+
a
+

Use frame flags, single field. +

+
t
+

Use top field only. +

+
b
+

Use bottom field only. +

+
tf
+

Use both fields, top first. +

+
bf
+

Use both fields, bottom first. +

+
+ +
+
planes
+

Set which planes to process, by default filter process all frames. +

+
+
nsize
+

Set size of local neighborhood around each pixel, used by the predictor neural +network. +

+

Can be one of the following: +

+
+
s8x6
+
s16x6
+
s32x6
+
s48x6
+
s8x4
+
s16x4
+
s32x4
+
+ +
+
nns
+

Set the number of neurons in predictor neural network. +Can be one of the following: +

+
+
n16
+
n32
+
n64
+
n128
+
n256
+
+ +
+
qual
+

Controls the number of different neural network predictions that are blended +together to compute the final output value. Can be fast, default or +slow. +

+
+
etype
+

Set which set of weights to use in the predictor. +Can be one of the following: +

+
+
a, abs
+

weights trained to minimize absolute error +

+
s, mse
+

weights trained to minimize squared error +

+
+ +
+
pscrn
+

Controls whether or not the prescreener neural network is used to decide +which pixels should be processed by the predictor neural network and which +can be handled by simple cubic interpolation. +The prescreener is trained to know whether cubic interpolation will be +sufficient for a pixel or whether it should be predicted by the predictor nn. +The computational complexity of the prescreener nn is much less than that of +the predictor nn. Since most pixels can be handled by cubic interpolation, +using the prescreener generally results in much faster processing. +The prescreener is pretty accurate, so the difference between using it and not +using it is almost always unnoticeable. +

+

Can be one of the following: +

+
+
none
+
original
+
new
+
new2
+
new3
+
+ +

Default is new. +

+
+ + +
+

30.173.1 Commands

+

This filter supports same commands as options, excluding weights option. +

+
+
+
+

30.174 noformat

+ +

Force libavfilter not to use any of the specified pixel formats for the +input to the next filter. +

+

It accepts the following parameters: +

+
pix_fmts
+

A ’|’-separated list of pixel format names, such as +pix_fmts=yuv420p|monow|rgb24". +

+
+
+ + +
+

30.174.1 Examples

+ +
    +
  • Force libavfilter to use a format different from yuv420p for the +input to the vflip filter: +
    +
    noformat=pix_fmts=yuv420p,vflip
    +
    + +
  • Convert the input video to any of the formats not contained in the list: +
    +
    noformat=yuv420p|yuv444p|yuv410p
    +
    +
+ +
+
+
+

30.175 noise

+ +

Add noise on video input frame. +

+

The filter accepts the following options: +

+
+
all_seed
+
c0_seed
+
c1_seed
+
c2_seed
+
c3_seed
+

Set noise seed for specific pixel component or all pixel components in case +of all_seed. Default value is 123457. +

+
+
all_strength, alls
+
c0_strength, c0s
+
c1_strength, c1s
+
c2_strength, c2s
+
c3_strength, c3s
+

Set noise strength for specific pixel component or all pixel components in case +all_strength. Default value is 0. Allowed range is [0, 100]. +

+
+
all_flags, allf
+
c0_flags, c0f
+
c1_flags, c1f
+
c2_flags, c2f
+
c3_flags, c3f
+

Set pixel component flags or set flags for all components if all_flags. +Available values for component flags are: +

+
a
+

averaged temporal noise (smoother) +

+
p
+

mix random noise with a (semi)regular pattern +

+
t
+

temporal noise (noise pattern changes between frames) +

+
u
+

uniform noise (gaussian otherwise) +

+
+
+
+ + +
+

30.175.1 Examples

+ +

Add temporal and uniform noise to input video: +

+
noise=alls=20:allf=t+u
+
+ +
+
+
+

30.176 normalize

+ +

Normalize RGB video (aka histogram stretching, contrast stretching). +See: https://en.wikipedia.org/wiki/Normalization_(image_processing) +

+

For each channel of each frame, the filter computes the input range and maps +it linearly to the user-specified output range. The output range defaults +to the full dynamic range from pure black to pure white. +

+

Temporal smoothing can be used on the input range to reduce flickering (rapid +changes in brightness) caused when small dark or bright objects enter or leave +the scene. This is similar to the auto-exposure (automatic gain control) on a +video camera, and, like a video camera, it may cause a period of over- or +under-exposure of the video. +

+

The R,G,B channels can be normalized independently, which may cause some +color shifting, or linked together as a single channel, which prevents +color shifting. Linked normalization preserves hue. Independent normalization +does not, so it can be used to remove some color casts. Independent and linked +normalization can be combined in any ratio. +

+

The normalize filter accepts the following options: +

+
+
blackpt
+
whitept
+

Colors which define the output range. The minimum input value is mapped to +the blackpt. The maximum input value is mapped to the whitept. +The defaults are black and white respectively. Specifying white for +blackpt and black for whitept will give color-inverted, +normalized video. Shades of grey can be used to reduce the dynamic range +(contrast). Specifying saturated colors here can create some interesting +effects. +

+
+
smoothing
+

The number of previous frames to use for temporal smoothing. The input range +of each channel is smoothed using a rolling average over the current frame +and the smoothing previous frames. The default is 0 (no temporal +smoothing). +

+
+
independence
+

Controls the ratio of independent (color shifting) channel normalization to +linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully +independent. Defaults to 1.0 (fully independent). +

+
+
strength
+

Overall strength of the filter. 1.0 is full strength. 0.0 is a rather +expensive no-op. Defaults to 1.0 (full strength). +

+
+
+ + +
+

30.176.1 Commands

+

This filter supports same commands as options, excluding smoothing option. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+

30.176.2 Examples

+ +

Stretch video contrast to use the full dynamic range, with no temporal +smoothing; may flicker depending on the source content: +

+
normalize=blackpt=black:whitept=white:smoothing=0
+
+ +

As above, but with 50 frames of temporal smoothing; flicker should be +reduced, depending on the source content: +

+
normalize=blackpt=black:whitept=white:smoothing=50
+
+ +

As above, but with hue-preserving linked channel normalization: +

+
normalize=blackpt=black:whitept=white:smoothing=50:independence=0
+
+ +

As above, but with half strength: +

+
normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
+
+ +

Map the darkest input color to red, the brightest input color to cyan: +

+
normalize=blackpt=red:whitept=cyan
+
+ +
+
+
+

30.177 null

+ +

Pass the video source unchanged to the output. +

+
+
+

30.178 ocr

+

Optical Character Recognition +

+

This filter uses Tesseract for optical character recognition. To enable +compilation of this filter, you need to configure FFmpeg with +--enable-libtesseract. +

+

It accepts the following options: +

+
+
datapath
+

Set datapath to tesseract data. Default is to use whatever was +set at installation. +

+
+
language
+

Set language, default is "eng". +

+
+
whitelist
+

Set character whitelist. +

+
+
blacklist
+

Set character blacklist. +

+
+ +

The filter exports recognized text as the frame metadata lavfi.ocr.text. +The filter exports confidence of recognized words as the frame metadata lavfi.ocr.confidence. +

+
+
+

30.179 ocv

+ +

Apply a video transform using libopencv. +

+

To enable this filter, install the libopencv library and headers and +configure FFmpeg with --enable-libopencv. +

+

It accepts the following parameters: +

+
+
filter_name
+

The name of the libopencv filter to apply. +

+
+
filter_params
+

The parameters to pass to the libopencv filter. If not specified, the default +values are assumed. +

+
+
+ +

Refer to the official libopencv documentation for more precise +information: +http://docs.opencv.org/master/modules/imgproc/doc/filtering.html +

+

Several libopencv filters are supported; see the following subsections. +

+ +
+

30.179.1 dilate

+ +

Dilate an image by using a specific structuring element. +It corresponds to the libopencv function cvDilate. +

+

It accepts the parameters: struct_el|nb_iterations. +

+

struct_el represents a structuring element, and has the syntax: +colsxrows+anchor_xxanchor_y/shape +

+

cols and rows represent the number of columns and rows of +the structuring element, anchor_x and anchor_y the anchor +point, and shape the shape for the structuring element. shape +must be "rect", "cross", "ellipse", or "custom". +

+

If the value for shape is "custom", it must be followed by a +string of the form "=filename". The file with name +filename is assumed to represent a binary image, with each +printable character corresponding to a bright pixel. When a custom +shape is used, cols and rows are ignored, the number +or columns and rows of the read file are assumed instead. +

+

The default value for struct_el is "3x3+0x0/rect". +

+

nb_iterations specifies the number of times the transform is +applied to the image, and defaults to 1. +

+

Some examples: +

+
# Use the default values
+ocv=dilate
+
+# Dilate using a structuring element with a 5x5 cross, iterating two times
+ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
+
+# Read the shape from the file diamond.shape, iterating two times.
+# The file diamond.shape may contain a pattern of characters like this
+#   *
+#  ***
+# *****
+#  ***
+#   *
+# The specified columns and rows are ignored
+# but the anchor point coordinates are not
+ocv=dilate:0x0+2x2/custom=diamond.shape|2
+
+ +
+
+

30.179.2 erode

+ +

Erode an image by using a specific structuring element. +It corresponds to the libopencv function cvErode. +

+

It accepts the parameters: struct_el:nb_iterations, +with the same syntax and semantics as the dilate filter. +

+
+
+

30.179.3 smooth

+ +

Smooth the input video. +

+

The filter takes the following parameters: +type|param1|param2|param3|param4. +

+

type is the type of smooth filter to apply, and must be one of +the following values: "blur", "blur_no_scale", "median", "gaussian", +or "bilateral". The default value is "gaussian". +

+

The meaning of param1, param2, param3, and param4 +depends on the smooth type. param1 and +param2 accept integer positive values or 0. param3 and +param4 accept floating point values. +

+

The default value for param1 is 3. The default value for the +other parameters is 0. +

+

These parameters correspond to the parameters assigned to the +libopencv function cvSmooth. +

+
+
+
+

30.180 oscilloscope

+ +

2D Video Oscilloscope. +

+

Useful to measure spatial impulse, step responses, chroma delays, etc. +

+

It accepts the following parameters: +

+
+
x
+

Set scope center x position. +

+
+
y
+

Set scope center y position. +

+
+
s
+

Set scope size, relative to frame diagonal. +

+
+
t
+

Set scope tilt/rotation. +

+
+
o
+

Set trace opacity. +

+
+
tx
+

Set trace center x position. +

+
+
ty
+

Set trace center y position. +

+
+
tw
+

Set trace width, relative to width of frame. +

+
+
th
+

Set trace height, relative to height of frame. +

+
+
c
+

Set which components to trace. By default it traces first three components. +

+
+
g
+

Draw trace grid. By default is enabled. +

+
+
st
+

Draw some statistics. By default is enabled. +

+
+
sc
+

Draw scope. By default is enabled. +

+
+ + +
+

30.180.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+

30.180.2 Examples

+ +
    +
  • Inspect full first row of video frame. +
    +
    oscilloscope=x=0.5:y=0:s=1
    +
    + +
  • Inspect full last row of video frame. +
    +
    oscilloscope=x=0.5:y=1:s=1
    +
    + +
  • Inspect full 5th line of video frame of height 1080. +
    +
    oscilloscope=x=0.5:y=5/1080:s=1
    +
    + +
  • Inspect full last column of video frame. +
    +
    oscilloscope=x=1:y=0.5:s=1:t=1
    +
    + +
+ +
+
+
+

30.181 overlay

+ +

Overlay one video on top of another. +

+

It takes two inputs and has one output. The first input is the "main" +video on which the second input is overlaid. +

+

It accepts the following parameters: +

+

A description of the accepted options follows. +

+
+
x
+
y
+

Set the expression for the x and y coordinates of the overlaid video +on the main video. Default value is "0" for both expressions. In case +the expression is invalid, it is set to a huge value (meaning that the +overlay will not be displayed within the output visible area). +

+
+
eof_action
+

See framesync. +

+
+
eval
+

Set when the expressions for x, and y are evaluated. +

+

It accepts the following values: +

+
init
+

only evaluate expressions once during the filter initialization or +when a command is processed +

+
+
frame
+

evaluate expressions for each incoming frame +

+
+ +

Default value is ‘frame’. +

+
+
shortest
+

See framesync. +

+
+
format
+

Set the format for the output video. +

+

It accepts the following values: +

+
yuv420
+

force YUV420 output +

+
+
yuv420p10
+

force YUV420p10 output +

+
+
yuv422
+

force YUV422 output +

+
+
yuv422p10
+

force YUV422p10 output +

+
+
yuv444
+

force YUV444 output +

+
+
rgb
+

force packed RGB output +

+
+
gbrp
+

force planar RGB output +

+
+
auto
+

automatically pick format +

+
+ +

Default value is ‘yuv420’. +

+
+
repeatlast
+

See framesync. +

+
+
alpha
+

Set format of alpha of the overlaid video, it can be straight or +premultiplied. Default is straight. +

+
+ +

The x, and y expressions can contain the following +parameters. +

+
+
main_w, W
+
main_h, H
+

The main input width and height. +

+
+
overlay_w, w
+
overlay_h, h
+

The overlay input width and height. +

+
+
x
+
y
+

The computed values for x and y. They are evaluated for +each new frame. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values of the output +format. For example for the pixel format "yuv422p" hsub is 2 and +vsub is 1. +

+
+
n
+

the number of input frame, starting from 0 +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, +do not use +

+
+
t
+

The timestamp, expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
+ +

This filter also supports the framesync options. +

+

Note that the n, t variables are available only +when evaluation is done per frame, and will evaluate to NAN +when eval is set to ‘init’. +

+

Be aware that frames are taken from each input video in timestamp +order, hence, if their initial timestamps differ, it is a good idea +to pass the two inputs through a setpts=PTS-STARTPTS filter to +have them begin in the same zero timestamp, as the example for +the movie filter does. +

+

You can chain together more overlays but you should test the +efficiency of such approach. +

+ +
+

30.181.1 Commands

+ +

This filter supports the following commands: +

+
x
+
y
+

Modify the x and y of the overlay input. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+

30.181.2 Examples

+ +
    +
  • Draw the overlay at 10 pixels from the bottom right corner of the main +video: +
    +
    overlay=main_w-overlay_w-10:main_h-overlay_h-10
    +
    + +

    Using named options the example above becomes: +

    +
    overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
    +
    + +
  • Insert a transparent PNG logo in the bottom left corner of the input, +using the ffmpeg tool with the -filter_complex option: +
    +
    ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
    +
    + +
  • Insert 2 different transparent PNG logos (second logo on bottom +right corner) using the ffmpeg tool: +
    +
    ffmpeg -i input -i logo1 -i logo2 -filter_complex 'overlay=x=10:y=H-h-10,overlay=x=W-w-10:y=H-h-10' output
    +
    + +
  • Add a transparent color layer on top of the main video; WxH +must specify the size of the main input to the overlay filter: +
    +
    color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
    +
    + +
  • Play an original video and a filtered version (here with the deshake +filter) side by side using the ffplay tool: +
    +
    ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
    +
    + +

    The above command is the same as: +

    +
    ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
    +
    + +
  • Make a sliding overlay appearing from the left to the right top part of the +screen starting since time 2: +
    +
    overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
    +
    + +
  • Compose output by putting two input videos side to side: +
    +
    ffmpeg -i left.avi -i right.avi -filter_complex "
    +nullsrc=size=200x100 [background];
    +[0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
    +[1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
    +[background][left]       overlay=shortest=1       [background+left];
    +[background+left][right] overlay=shortest=1:x=100 [left+right]
    +"
    +
    + +
  • Mask 10-20 seconds of a video by applying the delogo filter to a section +
    +
    ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
    +-vf '[in]split[split_main][split_delogo];[split_delogo]trim=start=360:end=371,delogo=0:0:640:480[delogoed];[split_main][delogoed]overlay=eof_action=pass[out]'
    +masked.avi
    +
    + +
  • Chain several overlays in cascade: +
    +
    nullsrc=s=200x200 [bg];
    +testsrc=s=100x100, split=4 [in0][in1][in2][in3];
    +[in0] lutrgb=r=0, [bg]   overlay=0:0     [mid0];
    +[in1] lutrgb=g=0, [mid0] overlay=100:0   [mid1];
    +[in2] lutrgb=b=0, [mid1] overlay=0:100   [mid2];
    +[in3] null,       [mid2] overlay=100:100 [out0]
    +
    + +
+ +
+
+
+

30.182 overlay_cuda

+ +

Overlay one video on top of another. +

+

This is the CUDA variant of the overlay filter. +It only accepts CUDA frames. The underlying input pixel formats have to match. +

+

It takes two inputs and has one output. The first input is the "main" +video on which the second input is overlaid. +

+

It accepts the following parameters: +

+
+
x
+
y
+

Set expressions for the x and y coordinates of the overlaid video +on the main video. +

+

They can contain the following parameters: +

+
+
main_w, W
+
main_h, H
+

The main input width and height. +

+
+
overlay_w, w
+
overlay_h, h
+

The overlay input width and height. +

+
+
x
+
y
+

The computed values for x and y. They are evaluated for +each new frame. +

+
+
n
+

The ordinal index of the main input frame, starting from 0. +

+
+
pos
+

The byte offset position in the file of the main input frame, NAN if unknown. +Deprecated, do not use. +

+
+
t
+

The timestamp of the main input frame, expressed in seconds, NAN if unknown. +

+
+
+ +

Default value is "0" for both expressions. +

+
+
eval
+

Set when the expressions for x and y are evaluated. +

+

It accepts the following values: +

+
init
+

Evaluate expressions once during filter initialization or +when a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame +

+
+ +

Default value is frame. +

+
+
eof_action
+

See framesync. +

+
+
shortest
+

See framesync. +

+
+
repeatlast
+

See framesync. +

+
+
+ +

This filter also supports the framesync options. +

+
+
+

30.183 owdenoise

+ +

Apply Overcomplete Wavelet denoiser. +

+

The filter accepts the following options: +

+
+
depth
+

Set depth. +

+

Larger depth values will denoise lower frequency components more, but +slow down filtering. +

+

Must be an int in the range 8-16, default is 8. +

+
+
luma_strength, ls
+

Set luma strength. +

+

Must be a double value in the range 0-1000, default is 1.0. +

+
+
chroma_strength, cs
+

Set chroma strength. +

+

Must be a double value in the range 0-1000, default is 1.0. +

+
+ +
+
+

30.184 pad

+ +

Add paddings to the input image, and place the original input at the +provided x, y coordinates. +

+

It accepts the following parameters: +

+
+
width, w
+
height, h
+

Specify an expression for the size of the output image with the +paddings added. If the value for width or height is 0, the +corresponding input size is used for the output. +

+

The width expression can reference the value set by the +height expression, and vice versa. +

+

The default value of width and height is 0. +

+
+
x
+
y
+

Specify the offsets to place the input image at within the padded area, +with respect to the top/left border of the output image. +

+

The x expression can reference the value set by the y +expression, and vice versa. +

+

The default value of x and y is 0. +

+

If x or y evaluate to a negative number, they’ll be changed +so the input image is centered on the padded area. +

+
+
color
+

Specify the color of the padded area. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. +

+

The default value of color is "black". +

+
+
eval
+

Specify when to evaluate width, height, x and y expression. +

+

It accepts the following values: +

+
+
init
+

Only evaluate expressions once during the filter initialization or when +a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+
+ +

Default value is ‘init’. +

+
+
aspect
+

Pad to aspect instead to a resolution. +

+
+
+ +

The value for the width, height, x, and y +options are expressions containing the following constants: +

+
+
in_w
+
in_h
+

The input video width and height. +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output width and height (the size of the padded area), as +specified by the width and height expressions. +

+
+
ow
+
oh
+

These are the same as out_w and out_h. +

+
+
x
+
y
+

The x and y offsets as specified by the x and y +expressions, or NAN if not yet specified. +

+
+
a
+

same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (iw / ih) * sar +

+
+
hsub
+
vsub
+

The horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ + +
+

30.184.1 Examples

+ +
    +
  • Add paddings with the color "violet" to the input video. The output video +size is 640x480, and the top-left corner of the input video is placed at +column 0, row 40 +
    +
    pad=640:480:0:40:violet
    +
    + +

    The example above is equivalent to the following command: +

    +
    pad=width=640:height=480:x=0:y=40:color=violet
    +
    + +
  • Pad the input to get an output with dimensions increased by 3/2, +and put the input video at the center of the padded area: +
    +
    pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • Pad the input to get a squared output with size equal to the maximum +value between the input width and height, and put the input video at +the center of the padded area: +
    +
    pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • Pad the input to get a final w/h ratio of 16:9: +
    +
    pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • In case of anamorphic video, in order to set the output display aspect +correctly, it is necessary to use sar in the expression, +according to the relation: +
    +
    (ih * X / ih) * sar = output_dar
    +X = output_dar / sar
    +
    + +

    Thus the previous example needs to be modified to: +

    +
    pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • Double the output size and put the input video in the bottom-right +corner of the output padded area: +
    +
    pad="2*iw:2*ih:ow-iw:oh-ih"
    +
    +
+ +
+
+
+

30.185 palettegen

+ +

Generate one palette for a whole video stream. +

+

It accepts the following options: +

+
+
max_colors
+

Set the maximum number of colors to quantize in the palette. +Note: the palette will still contain 256 colors; the unused palette entries +will be black. +

+
+
reserve_transparent
+

Create a palette of 255 colors maximum and reserve the last one for +transparency. Reserving the transparency color is useful for GIF optimization. +If not set, the maximum of colors in the palette will be 256. You probably want +to disable this option for a standalone image. +Set by default. +

+
+
transparency_color
+

Set the color that will be used as background for transparency. +

+
+
stats_mode
+

Set statistics mode. +

+

It accepts the following values: +

+
full
+

Compute full frame histograms. +

+
diff
+

Compute histograms only for the part that differs from previous frame. This +might be relevant to give more importance to the moving part of your input if +the background is static. +

+
single
+

Compute new histogram for each frame. +

+
+ +

Default value is full. +

+
+ +

The filter also exports the frame metadata lavfi.color_quant_ratio +(nb_color_in / nb_color_out) which you can use to evaluate the degree of +color quantization of the palette. This information is also visible at +info logging level. +

+ +
+

30.185.1 Examples

+ +
    +
  • Generate a representative palette of a given video using ffmpeg: +
    +
    ffmpeg -i input.mkv -vf palettegen palette.png
    +
    +
+ +
+
+
+

30.186 paletteuse

+ +

Use a palette to downsample an input video stream. +

+

The filter takes two inputs: one video stream and a palette. The palette must +be a 256 pixels image. +

+

It accepts the following options: +

+
+
dither
+

Select dithering mode. Available algorithms are: +

+
bayer
+

Ordered 8x8 bayer dithering (deterministic) +

+
heckbert
+

Dithering as defined by Paul Heckbert in 1982 (simple error diffusion). +Note: this dithering is sometimes considered "wrong" and is included as a +reference. +

+
floyd_steinberg
+

Floyd and Steingberg dithering (error diffusion) +

+
sierra2
+

Frankie Sierra dithering v2 (error diffusion) +

+
sierra2_4a
+

Frankie Sierra dithering v2 "Lite" (error diffusion) +

+
sierra3
+

Frankie Sierra dithering v3 (error diffusion) +

+
burkes
+

Burkes dithering (error diffusion) +

+
atkinson
+

Atkinson dithering by Bill Atkinson at Apple Computer (error diffusion) +

+
none
+

Disable dithering. +

+
+ +

Default is sierra2_4a. +

+
+
bayer_scale
+

When bayer dithering is selected, this option defines the scale of the +pattern (how much the crosshatch pattern is visible). A low value means more +visible pattern for less banding, and higher value means less visible pattern +at the cost of more banding. +

+

The option must be an integer value in the range [0,5]. Default is 2. +

+
+
diff_mode
+

If set, define the zone to process +

+
+
rectangle
+

Only the changing rectangle will be reprocessed. This is similar to GIF +cropping/offsetting compression mechanism. This option can be useful for speed +if only a part of the image is changing, and has use cases such as limiting the +scope of the error diffusal dither to the rectangle that bounds the +moving scene (it leads to more deterministic output if the scene doesn’t change +much, and as a result less moving noise and better GIF compression). +

+
+ +

Default is none. +

+
+
new
+

Take new palette for each output frame. +

+
+
alpha_threshold
+

Sets the alpha threshold for transparency. Alpha values above this threshold +will be treated as completely opaque, and values below this threshold will be +treated as completely transparent. +

+

The option must be an integer value in the range [0,255]. Default is 128. +

+
+ + +
+

30.186.1 Examples

+ +
    +
  • Use a palette (generated for example with palettegen) to encode a GIF +using ffmpeg: +
    +
    ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
    +
    +
+ +
+
+
+

30.187 perspective

+ +

Correct perspective of video not recorded perpendicular to the screen. +

+

A description of the accepted parameters follows. +

+
+
x0
+
y0
+
x1
+
y1
+
x2
+
y2
+
x3
+
y3
+

Set coordinates expression for top left, top right, bottom left and bottom right corners. +Default values are 0:0:W:0:0:H:W:H with which perspective will remain unchanged. +If the sense option is set to source, then the specified points will be sent +to the corners of the destination. If the sense option is set to destination, +then the corners of the source will be sent to the specified coordinates. +

+

The expressions can use the following variables: +

+
+
W
+
H
+

the width and height of video frame. +

+
in
+

Input frame count. +

+
on
+

Output frame count. +

+
+ +
+
interpolation
+

Set interpolation for perspective correction. +

+

It accepts the following values: +

+
linear
+
cubic
+
+ +

Default value is ‘linear’. +

+
+
sense
+

Set interpretation of coordinate options. +

+

It accepts the following values: +

+
0, source
+
+

Send point in the source specified by the given coordinates to +the corners of the destination. +

+
+
1, destination
+
+

Send the corners of the source to the point in the destination specified +by the given coordinates. +

+

Default value is ‘source’. +

+
+ +
+
eval
+

Set when the expressions for coordinates x0,y0,...x3,y3 are evaluated. +

+

It accepts the following values: +

+
init
+

only evaluate expressions once during the filter initialization or +when a command is processed +

+
+
frame
+

evaluate expressions for each incoming frame +

+
+ +

Default value is ‘init’. +

+
+ +
+
+

30.188 phase

+ +

Delay interlaced video by one field time so that the field order changes. +

+

The intended use is to fix PAL movies that have been captured with the +opposite field order to the film-to-video transfer. +

+

A description of the accepted parameters follows. +

+
+
mode
+

Set phase mode. +

+

It accepts the following values: +

+
t
+

Capture field order top-first, transfer bottom-first. +Filter will delay the bottom field. +

+
+
b
+

Capture field order bottom-first, transfer top-first. +Filter will delay the top field. +

+
+
p
+

Capture and transfer with the same field order. This mode only exists +for the documentation of the other options to refer to, but if you +actually select it, the filter will faithfully do nothing. +

+
+
a
+

Capture field order determined automatically by field flags, transfer +opposite. +Filter selects among ‘t’ and ‘b’ modes on a frame by frame +basis using field flags. If no field information is available, +then this works just like ‘u’. +

+
+
u
+

Capture unknown or varying, transfer opposite. +Filter selects among ‘t’ and ‘b’ on a frame by frame basis by +analyzing the images and selecting the alternative that produces best +match between the fields. +

+
+
T
+

Capture top-first, transfer unknown or varying. +Filter selects among ‘t’ and ‘p’ using image analysis. +

+
+
B
+

Capture bottom-first, transfer unknown or varying. +Filter selects among ‘b’ and ‘p’ using image analysis. +

+
+
A
+

Capture determined by field flags, transfer unknown or varying. +Filter selects among ‘t’, ‘b’ and ‘p’ using field flags and +image analysis. If no field information is available, then this works just +like ‘U’. This is the default mode. +

+
+
U
+

Both capture and transfer unknown or varying. +Filter selects among ‘t’, ‘b’ and ‘p’ using image analysis only. +

+
+
+
+ + +
+

30.188.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.189 photosensitivity

+

Reduce various flashes in video, so to help users with epilepsy. +

+

It accepts the following options: +

+
frames, f
+

Set how many frames to use when filtering. Default is 30. +

+
+
threshold, t
+

Set detection threshold factor. Default is 1. +Lower is stricter. +

+
+
skip
+

Set how many pixels to skip when sampling frames. Default is 1. +Allowed range is from 1 to 1024. +

+
+
bypass
+

Leave frames unchanged. Default is disabled. +

+
+ +
+
+

30.190 pixdesctest

+ +

Pixel format descriptor test filter, mainly useful for internal +testing. The output video should be equal to the input video. +

+

For example: +

+
format=monow, pixdesctest
+
+ +

can be used to test the monowhite pixel format descriptor definition. +

+
+
+

30.191 pixelize

+

Apply pixelization to video stream. +

+

The filter accepts the following options: +

+
width, w
+
height, h
+

Set block dimensions that will be used for pixelization. +Default value is 16. +

+
+
mode, m
+

Set the mode of pixelization used. +

+

Possible values are: +

+
avg
+
min
+
max
+
+

Default value is avg. +

+
+
planes, p
+

Set what planes to filter. Default is to filter all planes. +

+
+ + +
+

30.191.1 Commands

+ +

This filter supports all options as commands. +

+
+
+
+

30.192 pixscope

+ +

Display sample values of color channels. Mainly useful for checking color +and levels. Minimum supported resolution is 640x480. +

+

The filters accept the following options: +

+
+
x
+

Set scope X position, relative offset on X axis. +

+
+
y
+

Set scope Y position, relative offset on Y axis. +

+
+
w
+

Set scope width. +

+
+
h
+

Set scope height. +

+
+
o
+

Set window opacity. This window also holds statistics about pixel area. +

+
+
wx
+

Set window X position, relative offset on X axis. +

+
+
wy
+

Set window Y position, relative offset on Y axis. +

+
+ + +
+

30.192.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

30.193 pp

+ +

Enable the specified chain of postprocessing subfilters using libpostproc. This +library should be automatically selected with a GPL build (--enable-gpl). +Subfilters must be separated by ’/’ and can be disabled by prepending a ’-’. +Each subfilter and some options have a short and a long name that can be used +interchangeably, i.e. dr/dering are the same. +

+

The filters accept the following options: +

+
+
subfilters
+

Set postprocessing subfilters string. +

+
+ +

All subfilters share common options to determine their scope: +

+
+
a/autoq
+

Honor the quality commands for this subfilter. +

+
+
c/chrom
+

Do chrominance filtering, too (default). +

+
+
y/nochrom
+

Do luminance filtering only (no chrominance). +

+
+
n/noluma
+

Do chrominance filtering only (no luminance). +

+
+ +

These options can be appended after the subfilter name, separated by a ’|’. +

+

Available subfilters are: +

+
+
hb/hdeblock[|difference[|flatness]]
+

Horizontal deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+ +
+
vb/vdeblock[|difference[|flatness]]
+

Vertical deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+ +
+
ha/hadeblock[|difference[|flatness]]
+

Accurate horizontal deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+ +
+
va/vadeblock[|difference[|flatness]]
+

Accurate vertical deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+
+
+ +

The horizontal and vertical deblocking filters share the difference and +flatness values so you cannot set different horizontal and vertical +thresholds. +

+
+
h1/x1hdeblock
+

Experimental horizontal deblocking filter +

+
+
v1/x1vdeblock
+

Experimental vertical deblocking filter +

+
+
dr/dering
+

Deringing filter +

+
+
tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer
+
+
threshold1
+

larger -> stronger filtering +

+
threshold2
+

larger -> stronger filtering +

+
threshold3
+

larger -> stronger filtering +

+
+ +
+
al/autolevels[:f/fullyrange], automatic brightness / contrast correction
+
+
f/fullyrange
+

Stretch luminance to 0-255. +

+
+ +
+
lb/linblenddeint
+

Linear blend deinterlacing filter that deinterlaces the given block by +filtering all lines with a (1 2 1) filter. +

+
+
li/linipoldeint
+

Linear interpolating deinterlacing filter that deinterlaces the given block by +linearly interpolating every second line. +

+
+
ci/cubicipoldeint
+

Cubic interpolating deinterlacing filter deinterlaces the given block by +cubically interpolating every second line. +

+
+
md/mediandeint
+

Median deinterlacing filter that deinterlaces the given block by applying a +median filter to every second line. +

+
+
fd/ffmpegdeint
+

FFmpeg deinterlacing filter that deinterlaces the given block by filtering every +second line with a (-1 4 2 4 -1) filter. +

+
+
l5/lowpass5
+

Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given +block by filtering all lines with a (-1 2 6 2 -1) filter. +

+
+
fq/forceQuant[|quantizer]
+

Overrides the quantizer table from the input with the constant quantizer you +specify. +

+
quantizer
+

Quantizer to use +

+
+ +
+
de/default
+

Default pp filter combination (hb|a,vb|a,dr|a) +

+
+
fa/fast
+

Fast pp filter combination (h1|a,v1|a,dr|a) +

+
+
ac
+

High quality pp filter combination (ha|a|128|7,va|a,dr|a) +

+
+ + +
+

30.193.1 Examples

+ +
    +
  • Apply horizontal and vertical deblocking, deringing and automatic +brightness/contrast: +
    +
    pp=hb/vb/dr/al
    +
    + +
  • Apply default filters without brightness/contrast correction: +
    +
    pp=de/-al
    +
    + +
  • Apply default filters and temporal denoiser: +
    +
    pp=default/tmpnoise|1|2|3
    +
    + +
  • Apply deblocking on luminance only, and switch vertical deblocking on or off +automatically depending on available CPU time: +
    +
    pp=hb|y/vb|a
    +
    +
+ +
+
+
+

30.194 pp7

+

Apply Postprocessing filter 7. It is variant of the spp filter, +similar to spp = 6 with 7 point DCT, where only the center sample is +used after IDCT. +

+

The filter accepts the following options: +

+
+
qp
+

Force a constant quantization parameter. It accepts an integer in range +0 to 63. If not set, the filter will use the QP from the video stream +(if available). +

+
+
mode
+

Set thresholding mode. Available modes are: +

+
+
hard
+

Set hard thresholding. +

+
soft
+

Set soft thresholding (better de-ringing effect, but likely blurrier). +

+
medium
+

Set medium thresholding (good results, default). +

+
+
+
+ +
+
+

30.195 premultiply

+

Apply alpha premultiply effect to input video stream using first plane +of second stream as alpha. +

+

Both streams must have same dimensions and same pixel format. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
inplace
+

Do not require 2nd input for processing, instead use alpha plane from input stream. +

+
+ +
+
+

30.196 prewitt

+

Apply prewitt operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

30.196.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.197 pseudocolor

+ +

Alter frame colors in video with pseudocolors. +

+

This filter accepts the following options: +

+
+
c0
+

set pixel first component expression +

+
+
c1
+

set pixel second component expression +

+
+
c2
+

set pixel third component expression +

+
+
c3
+

set pixel fourth component expression, corresponds to the alpha component +

+
+
index, i
+

set component to use as base for altering colors +

+
+
preset, p
+

Pick one of built-in LUTs. By default is set to none. +

+

Available LUTs: +

+
magma
+
inferno
+
plasma
+
viridis
+
turbo
+
cividis
+
range1
+
range2
+
shadows
+
highlights
+
solar
+
nominal
+
preferred
+
total
+
spectral
+
+ +
+
opacity
+

Set opacity of output colors. Allowed range is from 0 to 1. +Default value is set to 1. +

+
+ +

Each of the expression options specifies the expression to use for computing +the lookup table for the corresponding pixel component values. +

+

The expressions can contain the following constants and functions: +

+
+
w
+
h
+

The input width and height. +

+
+
val
+

The input value for the pixel component. +

+
+
ymin, umin, vmin, amin
+

The minimum allowed component value. +

+
+
ymax, umax, vmax, amax
+

The maximum allowed component value. +

+
+ +

All expressions default to "val". +

+ +
+

30.197.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

30.197.2 Examples

+ +
    +
  • Change too high luma values to gradient: +
    +
    pseudocolor="'if(between(val,ymax,amax),lerp(ymin,ymax,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(umax,umin,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(vmin,vmax,(val-ymax)/(amax-ymax)),-1):-1'"
    +
    +
+ +
+
+
+

30.198 psnr

+ +

Obtain the average, maximum and minimum PSNR (Peak Signal to Noise +Ratio) between two input videos. +

+

This filter takes in input two input videos, the first input is +considered the "main" source and is passed unchanged to the +output. The second input is used as a "reference" video for computing +the PSNR. +

+

Both video inputs must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained average PSNR is printed through the logging system. +

+

The filter stores the accumulated MSE (mean squared error) of each +frame, and at the end of the processing it is averaged across all frames +equally, and the following formula is applied to obtain the PSNR: +

+
+
PSNR = 10*log10(MAX^2/MSE)
+
+ +

Where MAX is the average of the maximum values of each component of the +image. +

+

The description of the accepted parameters follows. +

+
+
stats_file, f
+

If specified the filter will use the named file to save the PSNR of +each individual frame. When filename equals "-" the data is sent to +standard output. +

+
+
stats_version
+

Specifies which version of the stats file format to use. Details of +each format are written below. +Default value is 1. +

+
+
stats_add_max
+

Determines whether the max value is output to the stats log. +Default value is 0. +Requires stats_version >= 2. If this is set and stats_version < 2, +the filter will return an error. +

+
+ +

This filter also supports the framesync options. +

+

The file printed if stats_file is selected, contains a sequence of +key/value pairs of the form key:value for each compared +couple of frames. +

+

If a stats_version greater than 1 is specified, a header line precedes +the list of per-frame-pair stats, with key value pairs following the frame +format with the following parameters: +

+
+
psnr_log_version
+

The version of the log file format. Will match stats_version. +

+
+
fields
+

A comma separated list of the per-frame-pair parameters included in +the log. +

+
+ +

A description of each shown per-frame-pair parameter follows: +

+
+
n
+

sequential number of the input frame, starting from 1 +

+
+
mse_avg
+

Mean Square Error pixel-by-pixel average difference of the compared +frames, averaged over all the image components. +

+
+
mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a
+

Mean Square Error pixel-by-pixel average difference of the compared +frames for the component specified by the suffix. +

+
+
psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a
+

Peak Signal to Noise ratio of the compared frames for the component +specified by the suffix. +

+
+
max_avg, max_y, max_u, max_v
+

Maximum allowed value for each channel, and average over all +channels. +

+
+ + +
+

30.198.1 Examples

+
    +
  • For example: +
    +
    movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
    +[main][ref] psnr="stats_file=stats.log" [out]
    +
    + +

    On this example the input file being processed is compared with the +reference file ref_movie.mpg. The PSNR of each individual frame +is stored in stats.log. +

    +
  • Another example with different containers: +
    +
    ffmpeg -i main.mpg -i ref.mkv -lavfi  "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]psnr" -f null -
    +
    +
+ +
+
+
+

30.199 pullup

+ +

Pulldown reversal (inverse telecine) filter, capable of handling mixed +hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive +content. +

+

The pullup filter is designed to take advantage of future context in making +its decisions. This filter is stateless in the sense that it does not lock +onto a pattern to follow, but it instead looks forward to the following +fields in order to identify matches and rebuild progressive frames. +

+

To produce content with an even framerate, insert the fps filter after +pullup, use fps=24000/1001 if the input frame rate is 29.97fps, +fps=24 for 30fps and the (rare) telecined 25fps input. +

+

The filter accepts the following options: +

+
+
jl
+
jr
+
jt
+
jb
+

These options set the amount of "junk" to ignore at the left, right, top, and +bottom of the image, respectively. Left and right are in units of 8 pixels, +while top and bottom are in units of 2 lines. +The default is 8 pixels on each side. +

+
+
sb
+

Set the strict breaks. Setting this option to 1 will reduce the chances of +filter generating an occasional mismatched frame, but it may also cause an +excessive number of frames to be dropped during high motion sequences. +Conversely, setting it to -1 will make filter match fields more easily. +This may help processing of video where there is slight blurring between +the fields, but may also cause there to be interlaced frames in the output. +Default value is 0. +

+
+
mp
+

Set the metric plane to use. It accepts the following values: +

+
l
+

Use luma plane. +

+
+
u
+

Use chroma blue plane. +

+
+
v
+

Use chroma red plane. +

+
+ +

This option may be set to use chroma plane instead of the default luma plane +for doing filter’s computations. This may improve accuracy on very clean +source material, but more likely will decrease accuracy, especially if there +is chroma noise (rainbow effect) or any grayscale video. +The main purpose of setting mp to a chroma plane is to reduce CPU +load and make pullup usable in realtime on slow machines. +

+
+ +

For best results (without duplicated frames in the output file) it is +necessary to change the output frame rate. For example, to inverse +telecine NTSC input: +

+
ffmpeg -i input -vf pullup -r 24000/1001 ...
+
+ +
+
+

30.200 qp

+ +

Change video quantization parameters (QP). +

+

The filter accepts the following option: +

+
+
qp
+

Set expression for quantization parameter. +

+
+ +

The expression is evaluated through the eval API and can contain, among others, +the following constants: +

+
+
known
+

1 if index is not 129, 0 otherwise. +

+
+
qp
+

Sequential index starting from -129 to 128. +

+
+ + +
+

30.200.1 Examples

+ +
    +
  • Some equation like: +
    +
    qp=2+2*sin(PI*qp)
    +
    +
+ +
+
+
+

30.201 random

+ +

Flush video frames from internal cache of frames into a random order. +No frame is discarded. +Inspired by frei0r nervous filter. +

+
+
frames
+

Set size in number of frames of internal cache, in range from 2 to +512. Default is 30. +

+
+
seed
+

Set seed for random number generator, must be an integer included between +0 and UINT32_MAX. If not specified, or if explicitly set to +less than 0, the filter will try to use a good random seed on a +best effort basis. +

+
+ +
+
+

30.202 readeia608

+ +

Read closed captioning (EIA-608) information from the top lines of a video frame. +

+

This filter adds frame metadata for lavfi.readeia608.X.cc and +lavfi.readeia608.X.line, where X is the number of the identified line +with EIA-608 data (starting from 0). A description of each metadata value follows: +

+
+
lavfi.readeia608.X.cc
+

The two bytes stored as EIA-608 data (printed in hexadecimal). +

+
+
lavfi.readeia608.X.line
+

The number of the line on which the EIA-608 data was identified and read. +

+
+ +

This filter accepts the following options: +

+
+
scan_min
+

Set the line to start scanning for EIA-608 data. Default is 0. +

+
+
scan_max
+

Set the line to end scanning for EIA-608 data. Default is 29. +

+
+
spw
+

Set the ratio of width reserved for sync code detection. +Default is 0.27. Allowed range is [0.1 - 0.7]. +

+
+
chp
+

Enable checking the parity bit. In the event of a parity error, the filter will output +0x00 for that character. Default is false. +

+
+
lp
+

Lowpass lines prior to further processing. Default is enabled. +

+
+ + +
+

30.202.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

30.202.2 Examples

+ +
    +
  • Output a csv with presentation time and the first two lines of identified EIA-608 captioning data. +
    +
    ffprobe -f lavfi -i movie=captioned_video.mov,readeia608 -show_entries frame=pts_time:frame_tags=lavfi.readeia608.0.cc,lavfi.readeia608.1.cc -of csv
    +
    +
+ +
+
+
+

30.203 readvitc

+ +

Read vertical interval timecode (VITC) information from the top lines of a +video frame. +

+

The filter adds frame metadata key lavfi.readvitc.tc_str with the +timecode value, if a valid timecode has been detected. Further metadata key +lavfi.readvitc.found is set to 0/1 depending on whether +timecode data has been found or not. +

+

This filter accepts the following options: +

+
+
scan_max
+

Set the maximum number of lines to scan for VITC data. If the value is set to +-1 the full video frame is scanned. Default is 45. +

+
+
thr_b
+

Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0], +default value is 0.2. The value must be equal or less than thr_w. +

+
+
thr_w
+

Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0], +default value is 0.6. The value must be equal or greater than thr_b. +

+
+ + +
+

30.203.1 Examples

+ +
    +
  • Detect and draw VITC data onto the video frame; if no valid VITC is detected, +draw --:--:--:-- as a placeholder: +
    +
    ffmpeg -i input.avi -filter:v 'readvitc,drawtext=fontfile=FreeMono.ttf:text=%{metadata\\:lavfi.readvitc.tc_str\\:--\\\\\\:--\\\\\\:--\\\\\\:--}:x=(w-tw)/2:y=400-ascent'
    +
    +
+ +
+
+
+

30.204 remap

+ +

Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream. +

+

Destination pixel at position (X, Y) will be picked from source (x, y) position +where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero +value for pixel will be used for destination pixel. +

+

Xmap and Ymap input video streams must be of same dimensions. Output video stream +will have Xmap/Ymap video stream dimensions. +Xmap and Ymap input video streams are 16bit depth, single channel. +

+
+
format
+

Specify pixel format of output from this filter. Can be color or gray. +Default is color. +

+
+
fill
+

Specify the color of the unmapped pixels. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Default color is black. +

+
+ +
+
+

30.205 removegrain

+ +

The removegrain filter is a spatial denoiser for progressive video. +

+
+
m0
+

Set mode for the first plane. +

+
+
m1
+

Set mode for the second plane. +

+
+
m2
+

Set mode for the third plane. +

+
+
m3
+

Set mode for the fourth plane. +

+
+ +

Range of mode is from 0 to 24. Description of each mode follows: +

+
+
0
+

Leave input plane unchanged. Default. +

+
+
1
+

Clips the pixel with the minimum and maximum of the 8 neighbour pixels. +

+
+
2
+

Clips the pixel with the second minimum and maximum of the 8 neighbour pixels. +

+
+
3
+

Clips the pixel with the third minimum and maximum of the 8 neighbour pixels. +

+
+
4
+

Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels. +This is equivalent to a median filter. +

+
+
5
+

Line-sensitive clipping giving the minimal change. +

+
+
6
+

Line-sensitive clipping, intermediate. +

+
+
7
+

Line-sensitive clipping, intermediate. +

+
+
8
+

Line-sensitive clipping, intermediate. +

+
+
9
+

Line-sensitive clipping on a line where the neighbours pixels are the closest. +

+
+
10
+

Replaces the target pixel with the closest neighbour. +

+
+
11
+

[1 2 1] horizontal and vertical kernel blur. +

+
+
12
+

Same as mode 11. +

+
+
13
+

Bob mode, interpolates top field from the line where the neighbours +pixels are the closest. +

+
+
14
+

Bob mode, interpolates bottom field from the line where the neighbours +pixels are the closest. +

+
+
15
+

Bob mode, interpolates top field. Same as 13 but with a more complicated +interpolation formula. +

+
+
16
+

Bob mode, interpolates bottom field. Same as 14 but with a more complicated +interpolation formula. +

+
+
17
+

Clips the pixel with the minimum and maximum of respectively the maximum and +minimum of each pair of opposite neighbour pixels. +

+
+
18
+

Line-sensitive clipping using opposite neighbours whose greatest distance from +the current pixel is minimal. +

+
+
19
+

Replaces the pixel with the average of its 8 neighbours. +

+
+
20
+

Averages the 9 pixels ([1 1 1] horizontal and vertical blur). +

+
+
21
+

Clips pixels using the averages of opposite neighbour. +

+
+
22
+

Same as mode 21 but simpler and faster. +

+
+
23
+

Small edge and halo removal, but reputed useless. +

+
+
24
+

Similar as 23. +

+
+ +
+ +
+

30.207 repeatfields

+ +

This filter uses the repeat_field flag from the Video ES headers and hard repeats +fields based on its value. +

+
+
+

30.208 reverse

+ +

Reverse a video clip. +

+

Warning: This filter requires memory to buffer the entire clip, so trimming +is suggested. +

+ +
+

30.208.1 Examples

+ +
    +
  • Take the first 5 seconds of a clip, and reverse it. +
    +
    trim=end=5,reverse
    +
    +
+ +
+
+
+

30.209 rgbashift

+

Shift R/G/B/A pixels horizontally and/or vertically. +

+

The filter accepts the following options: +

+
rh
+

Set amount to shift red horizontally. +

+
rv
+

Set amount to shift red vertically. +

+
gh
+

Set amount to shift green horizontally. +

+
gv
+

Set amount to shift green vertically. +

+
bh
+

Set amount to shift blue horizontally. +

+
bv
+

Set amount to shift blue vertically. +

+
ah
+

Set amount to shift alpha horizontally. +

+
av
+

Set amount to shift alpha vertically. +

+
edge
+

Set edge mode, can be smear, default, or warp. +

+
+ + +
+

30.209.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.210 roberts

+

Apply roberts cross operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

30.210.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.211 rotate

+ +

Rotate video by an arbitrary angle expressed in radians. +

+

The filter accepts the following options: +

+

A description of the optional parameters follows. +

+
angle, a
+

Set an expression for the angle by which to rotate the input video +clockwise, expressed as a number of radians. A negative value will +result in a counter-clockwise rotation. By default it is set to "0". +

+

This expression is evaluated for each frame. +

+
+
out_w, ow
+

Set the output width expression, default value is "iw". +This expression is evaluated just once during configuration. +

+
+
out_h, oh
+

Set the output height expression, default value is "ih". +This expression is evaluated just once during configuration. +

+
+
bilinear
+

Enable bilinear interpolation if set to 1, a value of 0 disables +it. Default value is 1. +

+
+
fillcolor, c
+

Set the color used to fill the output area not covered by the rotated +image. For the general syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +If the special value "none" is selected then no +background is printed (useful for example if the background is never shown). +

+

Default value is "black". +

+
+ +

The expressions for the angle and the output size can contain the +following constants and functions: +

+
+
n
+

sequential number of the input frame, starting from 0. It is always NAN +before the first frame is filtered. +

+
+
t
+

time in seconds of the input frame, it is set to 0 when the filter is +configured. It is always NAN before the first frame is filtered. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
in_w, iw
+
in_h, ih
+

the input video width and height +

+
+
out_w, ow
+
out_h, oh
+

the output width and height, that is the size of the padded area as +specified by the width and height expressions +

+
+
rotw(a)
+
roth(a)
+

the minimal width/height required for completely containing the input +video rotated by a radians. +

+

These are only available when computing the out_w and +out_h expressions. +

+
+ + +
+

30.211.1 Examples

+ +
    +
  • Rotate the input by PI/6 radians clockwise: +
    +
    rotate=PI/6
    +
    + +
  • Rotate the input by PI/6 radians counter-clockwise: +
    +
    rotate=-PI/6
    +
    + +
  • Rotate the input by 45 degrees clockwise: +
    +
    rotate=45*PI/180
    +
    + +
  • Apply a constant rotation with period T, starting from an angle of PI/3: +
    +
    rotate=PI/3+2*PI*t/T
    +
    + +
  • Make the input video rotation oscillating with a period of T +seconds and an amplitude of A radians: +
    +
    rotate=A*sin(2*PI/T*t)
    +
    + +
  • Rotate the video, output size is chosen so that the whole rotating +input video is always completely contained in the output: +
    +
    rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
    +
    + +
  • Rotate the video, reduce the output size so that no background is ever +shown: +
    +
    rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
    +
    +
+ +
+
+

30.211.2 Commands

+ +

The filter supports the following commands: +

+
+
a, angle
+

Set the angle expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

30.212 sab

+ +

Apply Shape Adaptive Blur. +

+

The filter accepts the following options: +

+
+
luma_radius, lr
+

Set luma blur filter strength, must be a value in range 0.1-4.0, default +value is 1.0. A greater value will result in a more blurred image, and +in slower processing. +

+
+
luma_pre_filter_radius, lpfr
+

Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default +value is 1.0. +

+
+
luma_strength, ls
+

Set luma maximum difference between pixels to still be considered, must +be a value in the 0.1-100.0 range, default value is 1.0. +

+
+
chroma_radius, cr
+

Set chroma blur filter strength, must be a value in range -0.9-4.0. A +greater value will result in a more blurred image, and in slower +processing. +

+
+
chroma_pre_filter_radius, cpfr
+

Set chroma pre-filter radius, must be a value in the -0.9-2.0 range. +

+
+
chroma_strength, cs
+

Set chroma maximum difference between pixels to still be considered, +must be a value in the -0.9-100.0 range. +

+
+ +

Each chroma option value, if not explicitly specified, is set to the +corresponding luma option value. +

+
+
+

30.213 scale

+ +

Scale (resize) the input video, using the libswscale library. +

+

The scale filter forces the output display aspect ratio to be the same +of the input, by changing the output sample aspect ratio. +

+

If the input image format is different from the format requested by +the next filter, the scale filter will convert the input to the +requested format. +

+ +
+

30.213.1 Options

+

The filter accepts the following options, or any of the options +supported by the libswscale scaler. +

+

See (ffmpeg-scaler)the ffmpeg-scaler manual for +the complete list of scaler options. +

+
+
width, w
+
height, h
+

Set the output video dimension expression. Default value is the input +dimension. +

+

If the width or w value is 0, the input width is used for +the output. If the height or h value is 0, the input height +is used for the output. +

+

If one and only one of the values is -n with n >= 1, the scale filter +will use a value that maintains the aspect ratio of the input image, +calculated from the other specified dimension. After that it will, +however, make sure that the calculated dimension is divisible by n and +adjust the value if necessary. +

+

If both values are -n with n >= 1, the behavior will be identical to +both values being set to 0 as previously detailed. +

+

See below for the list of accepted constants for use in the dimension +expression. +

+
+
eval
+

Specify when to evaluate width and height expression. It accepts the following values: +

+
+
init
+

Only evaluate expressions once during the filter initialization or when a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+
+ +

Default value is ‘init’. +

+ +
+
interl
+

Set the interlacing mode. It accepts the following values: +

+
+
1
+

Force interlaced aware scaling. +

+
+
0
+

Do not apply interlaced scaling. +

+
+
-1
+

Select interlaced aware scaling depending on whether the source frames +are flagged as interlaced or not. +

+
+ +

Default value is ‘0’. +

+
+
flags
+

Set libswscale scaling flags. See +(ffmpeg-scaler)the ffmpeg-scaler manual for the +complete list of values. If not explicitly specified the filter applies +the default flags. +

+ +
+
param0, param1
+

Set libswscale input parameters for scaling algorithms that need them. See +(ffmpeg-scaler)the ffmpeg-scaler manual for the +complete documentation. If not explicitly specified the filter applies +empty parameters. +

+ + +
+
size, s
+

Set the video size. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
in_color_matrix
+
out_color_matrix
+

Set in/output YCbCr color space type. +

+

This allows the autodetected value to be overridden as well as allows forcing +a specific value used for the output and encoder. +

+

If not specified, the color space type depends on the pixel format. +

+

Possible values: +

+
+
auto
+

Choose automatically. +

+
+
bt709
+

Format conforming to International Telecommunication Union (ITU) +Recommendation BT.709. +

+
+
fcc
+

Set color space conforming to the United States Federal Communications +Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a). +

+
+
bt601
+
bt470
+
smpte170m
+

Set color space conforming to: +

+
    +
  • ITU Radiocommunication Sector (ITU-R) Recommendation BT.601 + +
  • ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G + +
  • Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004 + +
+ +
+
smpte240m
+

Set color space conforming to SMPTE ST 240:1999. +

+
+
bt2020
+

Set color space conforming to ITU-R BT.2020 non-constant luminance system. +

+
+ +
+
in_range
+
out_range
+

Set in/output YCbCr sample range. +

+

This allows the autodetected value to be overridden as well as allows forcing +a specific value used for the output and encoder. If not specified, the +range depends on the pixel format. Possible values: +

+
+
auto/unknown
+

Choose automatically. +

+
+
jpeg/full/pc
+

Set full range (0-255 in case of 8-bit luma). +

+
+
mpeg/limited/tv
+

Set "MPEG" range (16-235 in case of 8-bit luma). +

+
+ +
+
force_original_aspect_ratio
+

Enable decreasing or increasing output video width or height if necessary to +keep the original aspect ratio. Possible values: +

+
+
disable
+

Scale the video as specified and disable this feature. +

+
+
decrease
+

The output video dimensions will automatically be decreased if needed. +

+
+
increase
+

The output video dimensions will automatically be increased if needed. +

+
+
+ +

One useful instance of this option is that when you know a specific device’s +maximum allowed resolution, you can use this to limit the output video to +that, while retaining the aspect ratio. For example, device A allows +1280x720 playback, and your video is 1920x800. Using this option (set it to +decrease) and specifying 1280x720 to the command line makes the output +1280x533. +

+

Please note that this is a different thing than specifying -1 for w +or h, you still need to specify the output resolution for this option +to work. +

+
+
force_divisible_by
+

Ensures that both the output dimensions, width and height, are divisible by the +given integer when used together with force_original_aspect_ratio. This +works similar to using -n in the w and h options. +

+

This option respects the value set for force_original_aspect_ratio, +increasing or decreasing the resolution accordingly. The video’s aspect ratio +may be slightly modified. +

+

This option can be handy if you need to have a video fit within or exceed +a defined resolution using force_original_aspect_ratio but also have +encoder restrictions on width or height divisibility. +

+
+
+ +

The values of the w and h options are expressions +containing the following constants: +

+
+
in_w
+
in_h
+

The input width and height +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (scaled) width and height +

+
+
ow
+
oh
+

These are the same as out_w and out_h +

+
+
a
+

The same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

The input display aspect ratio. Calculated from (iw / ih) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical input chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
ohsub
+
ovsub
+

horizontal and vertical output chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +Only available with eval=frame. +

+
+
t
+

The presentation timestamp of the input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
pos
+

The position (byte offset) of the frame in the input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +Deprecated, do not use. +

+
+ +
+
+

30.213.2 Examples

+ +
    +
  • Scale the input video to a size of 200x100 +
    +
    scale=w=200:h=100
    +
    + +

    This is equivalent to: +

    +
    scale=200:100
    +
    + +

    or: +

    +
    scale=200x100
    +
    + +
  • Specify a size abbreviation for the output size: +
    +
    scale=qcif
    +
    + +

    which can also be written as: +

    +
    scale=size=qcif
    +
    + +
  • Scale the input to 2x: +
    +
    scale=w=2*iw:h=2*ih
    +
    + +
  • The above is the same as: +
    +
    scale=2*in_w:2*in_h
    +
    + +
  • Scale the input to 2x with forced interlaced scaling: +
    +
    scale=2*iw:2*ih:interl=1
    +
    + +
  • Scale the input to half size: +
    +
    scale=w=iw/2:h=ih/2
    +
    + +
  • Increase the width, and set the height to the same size: +
    +
    scale=3/2*iw:ow
    +
    + +
  • Seek Greek harmony: +
    +
    scale=iw:1/PHI*iw
    +scale=ih*PHI:ih
    +
    + +
  • Increase the height, and set the width to 3/2 of the height: +
    +
    scale=w=3/2*oh:h=3/5*ih
    +
    + +
  • Increase the size, making the size a multiple of the chroma +subsample values: +
    +
    scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
    +
    + +
  • Increase the width to a maximum of 500 pixels, +keeping the same aspect ratio as the input: +
    +
    scale=w='min(500\, iw*3/2):h=-1'
    +
    + +
  • Make pixels square by combining scale and setsar: +
    +
    scale='trunc(ih*dar):ih',setsar=1/1
    +
    + +
  • Make pixels square by combining scale and setsar, +making sure the resulting resolution is even (required by some codecs): +
    +
    scale='trunc(ih*dar/2)*2:trunc(ih/2)*2',setsar=1/1
    +
    +
+ +
+
+

30.213.3 Commands

+ +

This filter supports the following commands: +

+
width, w
+
height, h
+

Set the output video dimension expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

30.214 scale_cuda

+ +

Scale (resize) and convert (pixel format) the input video, using accelerated CUDA kernels. +Setting the output width and height works in the same way as for the scale filter. +

+

The filter accepts the following options: +

+
w
+
h
+

Set the output video dimension expression. Default value is the input dimension. +

+

Allows for the same expressions as the scale filter. +

+
+
interp_algo
+

Sets the algorithm used for scaling: +

+
+
nearest
+

Nearest neighbour +

+

Used by default if input parameters match the desired output. +

+
+
bilinear
+

Bilinear +

+
+
bicubic
+

Bicubic +

+

This is the default. +

+
+
lanczos
+

Lanczos +

+
+
+ +
+
format
+

Controls the output pixel format. By default, or if none is specified, the input +pixel format is used. +

+

The filter does not support converting between YUV and RGB pixel formats. +

+
+
passthrough
+

If set to 0, every frame is processed, even if no conversion is neccesary. +This mode can be useful to use the filter as a buffer for a downstream +frame-consumer that exhausts the limited decoder frame pool. +

+

If set to 1, frames are passed through as-is if they match the desired output +parameters. This is the default behaviour. +

+
+
param
+

Algorithm-Specific parameter. +

+

Affects the curves of the bicubic algorithm. +

+
+
force_original_aspect_ratio
+
force_divisible_by
+

Work the same as the identical scale filter options. +

+
+
+ + +
+

30.214.1 Examples

+ +
    +
  • Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p. +
    +
    scale_cuda=-2:720:format=yuv420p
    +
    + +
  • Upscale to 4K using nearest neighbour algorithm. +
    +
    scale_cuda=4096:2160:interp_algo=nearest
    +
    + +
  • Don’t do any conversion or scaling, but copy all input frames into newly allocated ones. +This can be useful to deal with a filter and encode chain that otherwise exhausts the +decoders frame pool. +
    +
    scale_cuda=passthrough=0
    +
    +
+ +
+
+
+

30.215 scale_npp

+ +

Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel +format conversion on CUDA video frames. Setting the output width and height +works in the same way as for the scale filter. +

+

The following additional options are accepted: +

+
format
+

The pixel format of the output CUDA frames. If set to the string "same" (the +default), the input format will be kept. Note that automatic format negotiation +and conversion is not yet supported for hardware frames +

+
+
interp_algo
+

The interpolation algorithm used for resizing. One of the following: +

+
nn
+

Nearest neighbour. +

+
+
linear
+
cubic
+
cubic2p_bspline
+

2-parameter cubic (B=1, C=0) +

+
+
cubic2p_catmullrom
+

2-parameter cubic (B=0, C=1/2) +

+
+
cubic2p_b05c03
+

2-parameter cubic (B=1/2, C=3/10) +

+
+
super
+

Supersampling +

+
+
lanczos
+
+ +
+
force_original_aspect_ratio
+

Enable decreasing or increasing output video width or height if necessary to +keep the original aspect ratio. Possible values: +

+
+
disable
+

Scale the video as specified and disable this feature. +

+
+
decrease
+

The output video dimensions will automatically be decreased if needed. +

+
+
increase
+

The output video dimensions will automatically be increased if needed. +

+
+
+ +

One useful instance of this option is that when you know a specific device’s +maximum allowed resolution, you can use this to limit the output video to +that, while retaining the aspect ratio. For example, device A allows +1280x720 playback, and your video is 1920x800. Using this option (set it to +decrease) and specifying 1280x720 to the command line makes the output +1280x533. +

+

Please note that this is a different thing than specifying -1 for w +or h, you still need to specify the output resolution for this option +to work. +

+
+
force_divisible_by
+

Ensures that both the output dimensions, width and height, are divisible by the +given integer when used together with force_original_aspect_ratio. This +works similar to using -n in the w and h options. +

+

This option respects the value set for force_original_aspect_ratio, +increasing or decreasing the resolution accordingly. The video’s aspect ratio +may be slightly modified. +

+

This option can be handy if you need to have a video fit within or exceed +a defined resolution using force_original_aspect_ratio but also have +encoder restrictions on width or height divisibility. +

+
+
eval
+

Specify when to evaluate width and height expression. It accepts the following values: +

+
+
init
+

Only evaluate expressions once during the filter initialization or when a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+
+ +
+
+ +

The values of the w and h options are expressions +containing the following constants: +

+
+
in_w
+
in_h
+

The input width and height +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (scaled) width and height +

+
+
ow
+
oh
+

These are the same as out_w and out_h +

+
+
a
+

The same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

The input display aspect ratio. Calculated from (iw / ih) * sar. +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +Only available with eval=frame. +

+
+
t
+

The presentation timestamp of the input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
pos
+

The position (byte offset) of the frame in the input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +Deprecated, do not use. +

+
+ +
+
+

30.216 scale2ref

+ +

Scale (resize) the input video, based on a reference video. +

+

See the scale filter for available options, scale2ref supports the same but +uses the reference video instead of the main input as basis. scale2ref also +supports the following additional constants for the w and +h options: +

+
+
main_w
+
main_h
+

The main input video’s width and height +

+
+
main_a
+

The same as main_w / main_h +

+
+
main_sar
+

The main input video’s sample aspect ratio +

+
+
main_dar, mdar
+

The main input video’s display aspect ratio. Calculated from +(main_w / main_h) * main_sar. +

+
+
main_hsub
+
main_vsub
+

The main input video’s horizontal and vertical chroma subsample values. +For example for the pixel format "yuv422p" hsub is 2 and vsub +is 1. +

+
+
main_n
+

The (sequential) number of the main input frame, starting from 0. +Only available with eval=frame. +

+
+
main_t
+

The presentation timestamp of the main input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
main_pos
+

The position (byte offset) of the frame in the main input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +

+
+ + +
+

30.216.1 Examples

+ +
    +
  • Scale a subtitle stream (b) to match the main video (a) in size before overlaying +
    +
    'scale2ref[b][a];[a][b]overlay'
    +
    + +
  • Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio. +
    +
    [logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]
    +
    +
+ +
+
+

30.216.2 Commands

+ +

This filter supports the following commands: +

+
width, w
+
height, h
+

Set the output video dimension expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

30.217 scale2ref_npp

+ +

Use the NVIDIA Performance Primitives (libnpp) to scale (resize) the input +video, based on a reference video. +

+

See the scale_npp filter for available options, scale2ref_npp supports the same +but uses the reference video instead of the main input as basis. scale2ref_npp +also supports the following additional constants for the w and +h options: +

+
+
main_w
+
main_h
+

The main input video’s width and height +

+
+
main_a
+

The same as main_w / main_h +

+
+
main_sar
+

The main input video’s sample aspect ratio +

+
+
main_dar, mdar
+

The main input video’s display aspect ratio. Calculated from +(main_w / main_h) * main_sar. +

+
+
main_n
+

The (sequential) number of the main input frame, starting from 0. +Only available with eval=frame. +

+
+
main_t
+

The presentation timestamp of the main input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
main_pos
+

The position (byte offset) of the frame in the main input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +

+
+ + +
+

30.217.1 Examples

+ +
    +
  • Scale a subtitle stream (b) to match the main video (a) in size before overlaying +
    +
    'scale2ref_npp[b][a];[a][b]overlay_cuda'
    +
    + +
  • Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio. +
    +
    [logo-in][video-in]scale2ref_npp=w=oh*mdar:h=ih/10[logo-out][video-out]
    +
    +
+ +
+
+
+

30.218 scharr

+

Apply scharr operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

30.218.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.219 scroll

+

Scroll input video horizontally and/or vertically by constant speed. +

+

The filter accepts the following options: +

+
horizontal, h
+

Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1. +Negative values changes scrolling direction. +

+
+
vertical, v
+

Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1. +Negative values changes scrolling direction. +

+
+
hpos
+

Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1. +

+
+
vpos
+

Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1. +

+
+ + +
+

30.219.1 Commands

+ +

This filter supports the following commands: +

+
horizontal, h
+

Set the horizontal scrolling speed. +

+
vertical, v
+

Set the vertical scrolling speed. +

+
+ +
+
+
+

30.220 scdet

+ +

Detect video scene change. +

+

This filter sets frame metadata with mafd between frame, the scene score, and +forward the frame to the next filter, so they can use these metadata to detect +scene change or others. +

+

In addition, this filter logs a message and sets frame metadata when it detects +a scene change by threshold. +

+

lavfi.scd.mafd metadata keys are set with mafd for every frame. +

+

lavfi.scd.score metadata keys are set with scene change score for every frame +to detect scene change. +

+

lavfi.scd.time metadata keys are set with current filtered frame time which +detect scene change with threshold. +

+

The filter accepts the following options: +

+
+
threshold, t
+

Set the scene change detection threshold as a percentage of maximum change. Good +values are in the [8.0, 14.0] range. The range for threshold is +[0., 100.]. +

+

Default value is 10.. +

+
+
sc_pass, s
+

Set the flag to pass scene change frames to the next filter. Default value is 0 +You can enable it if you want to get snapshot of scene change frames only. +

+
+ +
+
+

30.221 selectivecolor

+ +

Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such +as "reds", "yellows", "greens", "cyans", ...). The adjustment range is defined +by the "purity" of the color (that is, how saturated it already is). +

+

This filter is similar to the Adobe Photoshop Selective Color tool. +

+

The filter accepts the following options: +

+
+
correction_method
+

Select color correction method. +

+

Available values are: +

+
absolute
+

Specified adjustments are applied "as-is" (added/subtracted to original pixel +component value). +

+
relative
+

Specified adjustments are relative to the original component value. +

+
+

Default is absolute. +

+
reds
+

Adjustments for red pixels (pixels where the red component is the maximum) +

+
yellows
+

Adjustments for yellow pixels (pixels where the blue component is the minimum) +

+
greens
+

Adjustments for green pixels (pixels where the green component is the maximum) +

+
cyans
+

Adjustments for cyan pixels (pixels where the red component is the minimum) +

+
blues
+

Adjustments for blue pixels (pixels where the blue component is the maximum) +

+
magentas
+

Adjustments for magenta pixels (pixels where the green component is the minimum) +

+
whites
+

Adjustments for white pixels (pixels where all components are greater than 128) +

+
neutrals
+

Adjustments for all pixels except pure black and pure white +

+
blacks
+

Adjustments for black pixels (pixels where all components are lesser than 128) +

+
psfile
+

Specify a Photoshop selective color file (.asv) to import the settings from. +

+
+ +

All the adjustment settings (reds, yellows, ...) accept up to +4 space separated floating point adjustment values in the [-1,1] range, +respectively to adjust the amount of cyan, magenta, yellow and black for the +pixels of its range. +

+ +
+

30.221.1 Examples

+ +
    +
  • Increase cyan by 50% and reduce yellow by 33% in every green areas, and +increase magenta by 27% in blue areas: +
    +
    selectivecolor=greens=.5 0 -.33 0:blues=0 .27
    +
    + +
  • Use a Photoshop selective color preset: +
    +
    selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
    +
    +
+ +
+
+
+

30.222 separatefields

+ +

The separatefields takes a frame-based video input and splits +each frame into its components fields, producing a new half height clip +with twice the frame rate and twice the frame count. +

+

This filter use field-dominance information in frame to decide which +of each pair of fields to place first in the output. +If it gets it wrong use setfield filter before separatefields filter. +

+
+
+

30.223 setdar, setsar

+ +

The setdar filter sets the Display Aspect Ratio for the filter +output video. +

+

This is done by changing the specified Sample (aka Pixel) Aspect +Ratio, according to the following equation: +

+
DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR
+
+ +

Keep in mind that the setdar filter does not modify the pixel +dimensions of the video frame. Also, the display aspect ratio set by +this filter may be changed by later filters in the filterchain, +e.g. in case of scaling or if another "setdar" or a "setsar" filter is +applied. +

+

The setsar filter sets the Sample (aka Pixel) Aspect Ratio for +the filter output video. +

+

Note that as a consequence of the application of this filter, the +output display aspect ratio will change according to the equation +above. +

+

Keep in mind that the sample aspect ratio set by the setsar +filter may be changed by later filters in the filterchain, e.g. if +another "setsar" or a "setdar" filter is applied. +

+

It accepts the following parameters: +

+
+
r, ratio, dar (setdar only), sar (setsar only)
+

Set the aspect ratio used by the filter. +

+

The parameter can be a floating point number string, or an expression. If the +parameter is not specified, the value "0" is assumed, meaning that the same +input value is used. +

+
+
max
+

Set the maximum integer value to use for expressing numerator and +denominator when reducing the expressed aspect ratio to a rational. +Default value is 100. +

+
+
+ +

The parameter sar is an expression containing the following constants: +

+
+
w, h
+

The input width and height. +

+
+
a
+

Same as w / h. +

+
+
sar
+

The input sample aspect ratio. +

+
+
dar
+

The input display aspect ratio. It is the same as +(w / h) * sar. +

+
+
hsub, vsub
+

Horizontal and vertical chroma subsample values. For example, for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ + +
+

30.223.1 Examples

+ +
    +
  • To change the display aspect ratio to 16:9, specify one of the following: +
    +
    setdar=dar=1.77777
    +setdar=dar=16/9
    +
    + +
  • To change the sample aspect ratio to 10:11, specify: +
    +
    setsar=sar=10/11
    +
    + +
  • To set a display aspect ratio of 16:9, and specify a maximum integer value of +1000 in the aspect ratio reduction, use the command: +
    +
    setdar=ratio=16/9:max=1000
    +
    + +
+ +
+
+
+

30.224 setfield

+ +

Force field for the output video frame. +

+

The setfield filter marks the interlace type field for the +output frames. It does not change the input frame, but only sets the +corresponding property, which affects how the frame is treated by +following filters (e.g. fieldorder or yadif). +

+

The filter accepts the following options: +

+
+
mode
+

Available values are: +

+
+
auto
+

Keep the same field property. +

+
+
bff
+

Mark the frame as bottom-field-first. +

+
+
tff
+

Mark the frame as top-field-first. +

+
+
prog
+

Mark the frame as progressive. +

+
+
+
+ +
+
+

30.225 setparams

+ +

Force frame parameter for the output video frame. +

+

The setparams filter marks interlace and color range for the +output frames. It does not change the input frame, but only sets the +corresponding property, which affects how the frame is treated by +filters/encoders. +

+
+
field_mode
+

Available values are: +

+
+
auto
+

Keep the same field property (default). +

+
+
bff
+

Mark the frame as bottom-field-first. +

+
+
tff
+

Mark the frame as top-field-first. +

+
+
prog
+

Mark the frame as progressive. +

+
+ +
+
range
+

Available values are: +

+
+
auto
+

Keep the same color range property (default). +

+
+
unspecified, unknown
+

Mark the frame as unspecified color range. +

+
+
limited, tv, mpeg
+

Mark the frame as limited range. +

+
+
full, pc, jpeg
+

Mark the frame as full range. +

+
+ +
+
color_primaries
+

Set the color primaries. +Available values are: +

+
+
auto
+

Keep the same color primaries property (default). +

+
+
bt709
+
unknown
+
bt470m
+
bt470bg
+
smpte170m
+
smpte240m
+
film
+
bt2020
+
smpte428
+
smpte431
+
smpte432
+
jedec-p22
+
+ +
+
color_trc
+

Set the color transfer. +Available values are: +

+
+
auto
+

Keep the same color trc property (default). +

+
+
bt709
+
unknown
+
bt470m
+
bt470bg
+
smpte170m
+
smpte240m
+
linear
+
log100
+
log316
+
iec61966-2-4
+
bt1361e
+
iec61966-2-1
+
bt2020-10
+
bt2020-12
+
smpte2084
+
smpte428
+
arib-std-b67
+
+ +
+
colorspace
+

Set the colorspace. +Available values are: +

+
+
auto
+

Keep the same colorspace property (default). +

+
+
gbr
+
bt709
+
unknown
+
fcc
+
bt470bg
+
smpte170m
+
smpte240m
+
ycgco
+
bt2020nc
+
bt2020c
+
smpte2085
+
chroma-derived-nc
+
chroma-derived-c
+
ictcp
+
+
+
+ +
+
+

30.226 sharpen_npp

+

Use the NVIDIA Performance Primitives (libnpp) to perform image sharpening with +border control. +

+

The following additional options are accepted: +

+
border_type
+

Type of sampling to be used ad frame borders. One of the following: +

+
replicate
+

Replicate pixel values. +

+
+
+
+
+ +
+
+

30.227 shear

+

Apply shear transform to input video. +

+

This filter supports the following options: +

+
+
shx
+

Shear factor in X-direction. Default value is 0. +Allowed range is from -2 to 2. +

+
+
shy
+

Shear factor in Y-direction. Default value is 0. +Allowed range is from -2 to 2. +

+
+
fillcolor, c
+

Set the color used to fill the output area not covered by the transformed +video. For the general syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +If the special value "none" is selected then no +background is printed (useful for example if the background is never shown). +

+

Default value is "black". +

+
+
interp
+

Set interpolation type. Can be bilinear or nearest. Default is bilinear. +

+
+ + +
+

30.227.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.228 showinfo

+ +

Show a line containing various information for each input video frame. +The input video is not modified. +

+

This filter supports the following options: +

+
+
checksum
+

Calculate checksums of each plane. By default enabled. +

+
+ +

The shown line contains a sequence of key/value pairs of the form +key:value. +

+

The following values are shown in the output: +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +

+
+
pts
+

The Presentation TimeStamp of the input frame, expressed as a number of +time base units. The time base unit depends on the filter input pad. +

+
+
pts_time
+

The Presentation TimeStamp of the input frame, expressed as a number of +seconds. +

+
+
fmt
+

The pixel format name. +

+
+
sar
+

The sample aspect ratio of the input frame, expressed in the form +num/den. +

+
+
s
+

The size of the input frame. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
i
+

The type of interlaced mode ("P" for "progressive", "T" for top field first, "B" +for bottom field first). +

+
+
iskey
+

This is 1 if the frame is a key frame, 0 otherwise. +

+
+
type
+

The picture type of the input frame ("I" for an I-frame, "P" for a +P-frame, "B" for a B-frame, or "?" for an unknown type). +Also refer to the documentation of the AVPictureType enum and of +the av_get_picture_type_char function defined in +libavutil/avutil.h. +

+
+
checksum
+

The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame. +

+
+
plane_checksum
+

The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame, +expressed in the form "[c0 c1 c2 c3]". +

+
+
mean
+

The mean value of pixels in each plane of the input frame, expressed in the form +"[mean0 mean1 mean2 mean3]". +

+
+
stdev
+

The standard deviation of pixel values in each plane of the input frame, expressed +in the form "[stdev0 stdev1 stdev2 stdev3]". +

+
+
+ +
+
+

30.229 showpalette

+ +

Displays the 256 colors palette of each frame. This filter is only relevant for +pal8 pixel format frames. +

+

It accepts the following option: +

+
+
s
+

Set the size of the box used to represent one palette color entry. Default is +30 (for a 30x30 pixel box). +

+
+ +
+
+

30.230 shuffleframes

+ +

Reorder and/or duplicate and/or drop video frames. +

+

It accepts the following parameters: +

+
+
mapping
+

Set the destination indexes of input frames. +This is space or ’|’ separated list of indexes that maps input frames to output +frames. Number of indexes also sets maximal value that each index may have. +’-1’ index have special meaning and that is to drop frame. +

+
+ +

The first frame has the index 0. The default is to keep the input unchanged. +

+ +
+

30.230.1 Examples

+ +
    +
  • Swap second and third frame of every three frames of the input: +
    +
    ffmpeg -i INPUT -vf "shuffleframes=0 2 1" OUTPUT
    +
    + +
  • Swap 10th and 1st frame of every ten frames of the input: +
    +
    ffmpeg -i INPUT -vf "shuffleframes=9 1 2 3 4 5 6 7 8 0" OUTPUT
    +
    +
+ +
+
+
+

30.231 shufflepixels

+ +

Reorder pixels in video frames. +

+

This filter accepts the following options: +

+
+
direction, d
+

Set shuffle direction. Can be forward or inverse direction. +Default direction is forward. +

+
+
mode, m
+

Set shuffle mode. Can be horizontal, vertical or block mode. +

+
+
width, w
+
height, h
+

Set shuffle block_size. In case of horizontal shuffle mode only width +part of size is used, and in case of vertical shuffle mode only height +part of size is used. +

+
+
seed, s
+

Set random seed used with shuffling pixels. Mainly useful to set to be able +to reverse filtering process to get original input. +For example, to reverse forward shuffle you need to use same parameters +and exact same seed and to set direction to inverse. +

+
+ +
+
+

30.232 shuffleplanes

+ +

Reorder and/or duplicate video planes. +

+

It accepts the following parameters: +

+
+
map0
+

The index of the input plane to be used as the first output plane. +

+
+
map1
+

The index of the input plane to be used as the second output plane. +

+
+
map2
+

The index of the input plane to be used as the third output plane. +

+
+
map3
+

The index of the input plane to be used as the fourth output plane. +

+
+
+ +

The first plane has the index 0. The default is to keep the input unchanged. +

+ +
+

30.232.1 Examples

+ +
    +
  • Swap the second and third planes of the input: +
    +
    ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
    +
    +
+ +
+
+
+

30.233 signalstats

+

Evaluate various visual metrics that assist in determining issues associated +with the digitization of analog video media. +

+

By default the filter will log these metadata values: +

+
+
YMIN
+

Display the minimal Y value contained within the input frame. Expressed in +range of [0-255]. +

+
+
YLOW
+

Display the Y value at the 10% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
YAVG
+

Display the average Y value within the input frame. Expressed in range of +[0-255]. +

+
+
YHIGH
+

Display the Y value at the 90% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
YMAX
+

Display the maximum Y value contained within the input frame. Expressed in +range of [0-255]. +

+
+
UMIN
+

Display the minimal U value contained within the input frame. Expressed in +range of [0-255]. +

+
+
ULOW
+

Display the U value at the 10% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
UAVG
+

Display the average U value within the input frame. Expressed in range of +[0-255]. +

+
+
UHIGH
+

Display the U value at the 90% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
UMAX
+

Display the maximum U value contained within the input frame. Expressed in +range of [0-255]. +

+
+
VMIN
+

Display the minimal V value contained within the input frame. Expressed in +range of [0-255]. +

+
+
VLOW
+

Display the V value at the 10% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
VAVG
+

Display the average V value within the input frame. Expressed in range of +[0-255]. +

+
+
VHIGH
+

Display the V value at the 90% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
VMAX
+

Display the maximum V value contained within the input frame. Expressed in +range of [0-255]. +

+
+
SATMIN
+

Display the minimal saturation value contained within the input frame. +Expressed in range of [0-~181.02]. +

+
+
SATLOW
+

Display the saturation value at the 10% percentile within the input frame. +Expressed in range of [0-~181.02]. +

+
+
SATAVG
+

Display the average saturation value within the input frame. Expressed in range +of [0-~181.02]. +

+
+
SATHIGH
+

Display the saturation value at the 90% percentile within the input frame. +Expressed in range of [0-~181.02]. +

+
+
SATMAX
+

Display the maximum saturation value contained within the input frame. +Expressed in range of [0-~181.02]. +

+
+
HUEMED
+

Display the median value for hue within the input frame. Expressed in range of +[0-360]. +

+
+
HUEAVG
+

Display the average value for hue within the input frame. Expressed in range of +[0-360]. +

+
+
YDIF
+

Display the average of sample value difference between all values of the Y +plane in the current frame and corresponding values of the previous input frame. +Expressed in range of [0-255]. +

+
+
UDIF
+

Display the average of sample value difference between all values of the U +plane in the current frame and corresponding values of the previous input frame. +Expressed in range of [0-255]. +

+
+
VDIF
+

Display the average of sample value difference between all values of the V +plane in the current frame and corresponding values of the previous input frame. +Expressed in range of [0-255]. +

+
+
YBITDEPTH
+

Display bit depth of Y plane in current frame. +Expressed in range of [0-16]. +

+
+
UBITDEPTH
+

Display bit depth of U plane in current frame. +Expressed in range of [0-16]. +

+
+
VBITDEPTH
+

Display bit depth of V plane in current frame. +Expressed in range of [0-16]. +

+
+ +

The filter accepts the following options: +

+
+
stat
+
out
+
+

stat specify an additional form of image analysis. +out output video with the specified type of pixel highlighted. +

+

Both options accept the following values: +

+
+
tout
+

Identify temporal outliers pixels. A temporal outlier is a pixel +unlike the neighboring pixels of the same field. Examples of temporal outliers +include the results of video dropouts, head clogs, or tape tracking issues. +

+
+
vrep
+

Identify vertical line repetition. Vertical line repetition includes +similar rows of pixels within a frame. In born-digital video vertical line +repetition is common, but this pattern is uncommon in video digitized from an +analog source. When it occurs in video that results from the digitization of an +analog source it can indicate concealment from a dropout compensator. +

+
+
brng
+

Identify pixels that fall outside of legal broadcast range. +

+
+ +
+
color, c
+

Set the highlight color for the out option. The default color is +yellow. +

+
+ + +
+

30.233.1 Examples

+ +
    +
  • Output data of various video metrics: +
    +
    ffprobe -f lavfi movie=example.mov,signalstats="stat=tout+vrep+brng" -show_frames
    +
    + +
  • Output specific data about the minimum and maximum values of the Y plane per frame: +
    +
    ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
    +
    + +
  • Playback video while highlighting pixels that are outside of broadcast range in red. +
    +
    ffplay example.mov -vf signalstats="out=brng:color=red"
    +
    + +
  • Playback video with signalstats metadata drawn over the frame. +
    +
    ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
    +
    + +

    The contents of signalstat_drawtext.txt used in the command are: +

    +
    time %{pts:hms}
    +Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
    +U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
    +V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
    +saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
    +
    +
    +
+ +
+
+
+

30.234 signature

+ +

Calculates the MPEG-7 Video Signature. The filter can handle more than one +input. In this case the matching between the inputs can be calculated additionally. +The filter always passes through the first input. The signature of each stream can +be written into a file. +

+

It accepts the following options: +

+
+
detectmode
+

Enable or disable the matching process. +

+

Available values are: +

+
+
off
+

Disable the calculation of a matching (default). +

+
full
+

Calculate the matching for the whole video and output whether the whole video +matches or only parts. +

+
fast
+

Calculate only until a matching is found or the video ends. Should be faster in +some cases. +

+
+ +
+
nb_inputs
+

Set the number of inputs. The option value must be a non negative integer. +Default value is 1. +

+
+
filename
+

Set the path to which the output is written. If there is more than one input, +the path must be a prototype, i.e. must contain %d or %0nd (where n is a positive +integer), that will be replaced with the input number. If no filename is +specified, no output will be written. This is the default. +

+
+
format
+

Choose the output format. +

+

Available values are: +

+
+
binary
+

Use the specified binary representation (default). +

+
xml
+

Use the specified xml representation. +

+
+ +
+
th_d
+

Set threshold to detect one word as similar. The option value must be an integer +greater than zero. The default value is 9000. +

+
+
th_dc
+

Set threshold to detect all words as similar. The option value must be an integer +greater than zero. The default value is 60000. +

+
+
th_xh
+

Set threshold to detect frames as similar. The option value must be an integer +greater than zero. The default value is 116. +

+
+
th_di
+

Set the minimum length of a sequence in frames to recognize it as matching +sequence. The option value must be a non negative integer value. +The default value is 0. +

+
+
th_it
+

Set the minimum relation, that matching frames to all frames must have. +The option value must be a double value between 0 and 1. The default value is 0.5. +

+
+ + +
+

30.234.1 Examples

+ +
    +
  • To calculate the signature of an input video and store it in signature.bin: +
    +
    ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
    +
    + +
  • To detect whether two videos match and store the signatures in XML format in +signature0.xml and signature1.xml: +
    +
    ffmpeg -i input1.mkv -i input2.mkv -filter_complex "[0:v][1:v] signature=nb_inputs=2:detectmode=full:format=xml:filename=signature%d.xml" -map :v -f null -
    +
    + +
+ +
+
+
+

30.235 siti

+ +

Calculate Spatial Information (SI) and Temporal Information (TI) scores for a video, +as defined in ITU-T Rec. P.910 (11/21): Subjective video quality assessment methods +for multimedia applications. Available PDF at https://www.itu.int/rec/T-REC-P.910-202111-S/en. +Note that this is a legacy implementation that corresponds to a superseded recommendation. +Refer to ITU-T Rec. P.910 (07/22) for the latest version: https://www.itu.int/rec/T-REC-P.910-202207-I/en +

+

It accepts the following option: +

+
+
print_summary
+

If set to 1, Summary statistics will be printed to the console. Default 0. +

+
+ + +
+

30.235.1 Examples

+
    +
  • To calculate SI/TI metrics and print summary: +
    +
    ffmpeg -i input.mp4 -vf siti=print_summary=1 -f null -
    +
    +
+ +
+
+
+

30.236 smartblur

+ +

Blur the input video without impacting the outlines. +

+

It accepts the following options: +

+
+
luma_radius, lr
+

Set the luma radius. The option value must be a float number in +the range [0.1,5.0] that specifies the variance of the gaussian filter +used to blur the image (slower if larger). Default value is 1.0. +

+
+
luma_strength, ls
+

Set the luma strength. The option value must be a float number +in the range [-1.0,1.0] that configures the blurring. A value included +in [0.0,1.0] will blur the image whereas a value included in +[-1.0,0.0] will sharpen the image. Default value is 1.0. +

+
+
luma_threshold, lt
+

Set the luma threshold used as a coefficient to determine +whether a pixel should be blurred or not. The option value must be an +integer in the range [-30,30]. A value of 0 will filter all the image, +a value included in [0,30] will filter flat areas and a value included +in [-30,0] will filter edges. Default value is 0. +

+
+
chroma_radius, cr
+

Set the chroma radius. The option value must be a float number in +the range [0.1,5.0] that specifies the variance of the gaussian filter +used to blur the image (slower if larger). Default value is luma_radius. +

+
+
chroma_strength, cs
+

Set the chroma strength. The option value must be a float number +in the range [-1.0,1.0] that configures the blurring. A value included +in [0.0,1.0] will blur the image whereas a value included in +[-1.0,0.0] will sharpen the image. Default value is luma_strength. +

+
+
chroma_threshold, ct
+

Set the chroma threshold used as a coefficient to determine +whether a pixel should be blurred or not. The option value must be an +integer in the range [-30,30]. A value of 0 will filter all the image, +a value included in [0,30] will filter flat areas and a value included +in [-30,0] will filter edges. Default value is luma_threshold. +

+
+ +

If a chroma option is not explicitly set, the corresponding luma value +is set. +

+
+
+

30.237 sobel

+

Apply sobel operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

30.237.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.238 spp

+ +

Apply a simple postprocessing filter that compresses and decompresses the image +at several (or - in the case of quality level 6 - all) shifts +and average the results. +

+

The filter accepts the following options: +

+
+
quality
+

Set quality. This option defines the number of levels for averaging. It accepts +an integer in the range 0-6. If set to 0, the filter will have no +effect. A value of 6 means the higher quality. For each increment of +that value the speed drops by a factor of approximately 2. Default value is +3. +

+
+
qp
+

Force a constant quantization parameter. If not set, the filter will use the QP +from the video stream (if available). +

+
+
mode
+

Set thresholding mode. Available modes are: +

+
+
hard
+

Set hard thresholding (default). +

+
soft
+

Set soft thresholding (better de-ringing effect, but likely blurrier). +

+
+ +
+
use_bframe_qp
+

Enable the use of the QP from the B-Frames if set to 1. Using this +option may cause flicker since the B-Frames have often larger QP. Default is +0 (not enabled). +

+
+ + +
+

30.238.1 Commands

+ +

This filter supports the following commands: +

+
quality, level
+

Set quality level. The value max can be used to set the maximum level, +currently 6. +

+
+ +
+
+
+

30.239 sr

+ +

Scale the input by applying one of the super-resolution methods based on +convolutional neural networks. Supported models: +

+ + +

Training scripts as well as scripts for model file (.pb) saving can be found at +https://github.com/XueweiMeng/sr/tree/sr_dnn_native. Original repository +is at https://github.com/HighVoltageRocknRoll/sr.git. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +the following values: +

+
+
tensorflow
+

TensorFlow backend. To enable this backend you +need to install the TensorFlow for C library (see +https://www.tensorflow.org/install/lang_c) and configure FFmpeg with +--enable-libtensorflow +

+
+ +
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. TensorFlow, OpenVINO backend +can load files for only its format. +

+
+
scale_factor
+

Set scale factor for SRCNN model. Allowed values are 2, 3 and 4. +Default value is 2. Scale factor is necessary for SRCNN model, because it accepts +input upscaled using bicubic upscaling with proper scale factor. +

+
+ +

To get full functionality (such as async execution), please use the dnn_processing filter. +

+
+
+

30.240 ssim

+ +

Obtain the SSIM (Structural SImilarity Metric) between two input videos. +

+

This filter takes in input two input videos, the first input is +considered the "main" source and is passed unchanged to the +output. The second input is used as a "reference" video for computing +the SSIM. +

+

Both video inputs must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The filter stores the calculated SSIM of each frame. +

+

The description of the accepted parameters follows. +

+
+
stats_file, f
+

If specified the filter will use the named file to save the SSIM of +each individual frame. When filename equals "-" the data is sent to +standard output. +

+
+ +

The file printed if stats_file is selected, contains a sequence of +key/value pairs of the form key:value for each compared +couple of frames. +

+

A description of each shown parameter follows: +

+
+
n
+

sequential number of the input frame, starting from 1 +

+
+
Y, U, V, R, G, B
+

SSIM of the compared frames for the component specified by the suffix. +

+
+
All
+

SSIM of the compared frames for the whole frame. +

+
+
dB
+

Same as above but in dB representation. +

+
+ +

This filter also supports the framesync options. +

+ +
+

30.240.1 Examples

+
    +
  • For example: +
    +
    movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
    +[main][ref] ssim="stats_file=stats.log" [out]
    +
    + +

    On this example the input file being processed is compared with the +reference file ref_movie.mpg. The SSIM of each individual frame +is stored in stats.log. +

    +
  • Another example with both psnr and ssim at same time: +
    +
    ffmpeg -i main.mpg -i ref.mpg -lavfi  "ssim;[0:v][1:v]psnr" -f null -
    +
    + +
  • Another example with different containers: +
    +
    ffmpeg -i main.mpg -i ref.mkv -lavfi  "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]ssim" -f null -
    +
    +
+ +
+
+
+

30.241 stereo3d

+ +

Convert between different stereoscopic image formats. +

+

The filters accept the following options: +

+
+
in
+

Set stereoscopic image format of input. +

+

Available values for input image formats are: +

+
sbsl
+

side by side parallel (left eye left, right eye right) +

+
+
sbsr
+

side by side crosseye (right eye left, left eye right) +

+
+
sbs2l
+

side by side parallel with half width resolution +(left eye left, right eye right) +

+
+
sbs2r
+

side by side crosseye with half width resolution +(right eye left, left eye right) +

+
+
abl
+
tbl
+

above-below (left eye above, right eye below) +

+
+
abr
+
tbr
+

above-below (right eye above, left eye below) +

+
+
ab2l
+
tb2l
+

above-below with half height resolution +(left eye above, right eye below) +

+
+
ab2r
+
tb2r
+

above-below with half height resolution +(right eye above, left eye below) +

+
+
al
+

alternating frames (left eye first, right eye second) +

+
+
ar
+

alternating frames (right eye first, left eye second) +

+
+
irl
+

interleaved rows (left eye has top row, right eye starts on next row) +

+
+
irr
+

interleaved rows (right eye has top row, left eye starts on next row) +

+
+
icl
+

interleaved columns, left eye first +

+
+
icr
+

interleaved columns, right eye first +

+

Default value is ‘sbsl’. +

+
+ +
+
out
+

Set stereoscopic image format of output. +

+
+
sbsl
+

side by side parallel (left eye left, right eye right) +

+
+
sbsr
+

side by side crosseye (right eye left, left eye right) +

+
+
sbs2l
+

side by side parallel with half width resolution +(left eye left, right eye right) +

+
+
sbs2r
+

side by side crosseye with half width resolution +(right eye left, left eye right) +

+
+
abl
+
tbl
+

above-below (left eye above, right eye below) +

+
+
abr
+
tbr
+

above-below (right eye above, left eye below) +

+
+
ab2l
+
tb2l
+

above-below with half height resolution +(left eye above, right eye below) +

+
+
ab2r
+
tb2r
+

above-below with half height resolution +(right eye above, left eye below) +

+
+
al
+

alternating frames (left eye first, right eye second) +

+
+
ar
+

alternating frames (right eye first, left eye second) +

+
+
irl
+

interleaved rows (left eye has top row, right eye starts on next row) +

+
+
irr
+

interleaved rows (right eye has top row, left eye starts on next row) +

+
+
arbg
+

anaglyph red/blue gray +(red filter on left eye, blue filter on right eye) +

+
+
argg
+

anaglyph red/green gray +(red filter on left eye, green filter on right eye) +

+
+
arcg
+

anaglyph red/cyan gray +(red filter on left eye, cyan filter on right eye) +

+
+
arch
+

anaglyph red/cyan half colored +(red filter on left eye, cyan filter on right eye) +

+
+
arcc
+

anaglyph red/cyan color +(red filter on left eye, cyan filter on right eye) +

+
+
arcd
+

anaglyph red/cyan color optimized with the least squares projection of dubois +(red filter on left eye, cyan filter on right eye) +

+
+
agmg
+

anaglyph green/magenta gray +(green filter on left eye, magenta filter on right eye) +

+
+
agmh
+

anaglyph green/magenta half colored +(green filter on left eye, magenta filter on right eye) +

+
+
agmc
+

anaglyph green/magenta colored +(green filter on left eye, magenta filter on right eye) +

+
+
agmd
+

anaglyph green/magenta color optimized with the least squares projection of dubois +(green filter on left eye, magenta filter on right eye) +

+
+
aybg
+

anaglyph yellow/blue gray +(yellow filter on left eye, blue filter on right eye) +

+
+
aybh
+

anaglyph yellow/blue half colored +(yellow filter on left eye, blue filter on right eye) +

+
+
aybc
+

anaglyph yellow/blue colored +(yellow filter on left eye, blue filter on right eye) +

+
+
aybd
+

anaglyph yellow/blue color optimized with the least squares projection of dubois +(yellow filter on left eye, blue filter on right eye) +

+
+
ml
+

mono output (left eye only) +

+
+
mr
+

mono output (right eye only) +

+
+
chl
+

checkerboard, left eye first +

+
+
chr
+

checkerboard, right eye first +

+
+
icl
+

interleaved columns, left eye first +

+
+
icr
+

interleaved columns, right eye first +

+
+
hdmi
+

HDMI frame pack +

+
+ +

Default value is ‘arcd’. +

+
+ + +
+

30.241.1 Examples

+ +
    +
  • Convert input video from side by side parallel to anaglyph yellow/blue dubois: +
    +
    stereo3d=sbsl:aybd
    +
    + +
  • Convert input video from above below (left eye above, right eye below) to side by side crosseye. +
    +
    stereo3d=abl:sbsr
    +
    +
+ +
+
+
+

30.242 streamselect, astreamselect

+

Select video or audio streams. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of inputs. Default is 2. +

+
+
map
+

Set input indexes to remap to outputs. +

+
+ + +
+

30.242.1 Commands

+ +

The streamselect and astreamselect filter supports the following +commands: +

+
+
map
+

Set input indexes to remap to outputs. +

+
+ +
+
+

30.242.2 Examples

+ +
    +
  • Select first 5 seconds 1st stream and rest of time 2nd stream: +
    +
    sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
    +
    + +
  • Same as above, but for audio: +
    +
    asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
    +
    +
+ +
+
+
+

30.243 subtitles

+ +

Draw subtitles on top of input video using the libass library. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libass. This filter also requires a build with libavcodec and +libavformat to convert the passed subtitles file to ASS (Advanced Substation +Alpha) subtitles format. +

+

The filter accepts the following options: +

+
+
filename, f
+

Set the filename of the subtitle file to read. It must be specified. +

+
+
original_size
+

Specify the size of the original video, the video for which the ASS file +was composed. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to +correctly scale the fonts if the aspect ratio has been changed. +

+
+
fontsdir
+

Set a directory path containing fonts that can be used by the filter. +These fonts will be used in addition to whatever the font provider uses. +

+
+
alpha
+

Process alpha channel, by default alpha channel is untouched. +

+
+
charenc
+

Set subtitles input character encoding. subtitles filter only. Only +useful if not UTF-8. +

+
+
stream_index, si
+

Set subtitles stream index. subtitles filter only. +

+
+
force_style
+

Override default style or script info parameters of the subtitles. It accepts a +string containing ASS style format KEY=VALUE couples separated by ",". +

+
+ +

If the first key is not specified, it is assumed that the first value +specifies the filename. +

+

For example, to render the file sub.srt on top of the input +video, use the command: +

+
subtitles=sub.srt
+
+ +

which is equivalent to: +

+
subtitles=filename=sub.srt
+
+ +

To render the default subtitles stream from file video.mkv, use: +

+
subtitles=video.mkv
+
+ +

To render the second subtitles stream from that file, use: +

+
subtitles=video.mkv:si=1
+
+ +

To make the subtitles stream from sub.srt appear in 80% transparent blue +DejaVu Serif, use: +

+
subtitles=sub.srt:force_style='Fontname=DejaVu Serif,PrimaryColour=&HCCFF0000'
+
+ +
+
+

30.244 super2xsai

+ +

Scale the input by 2x and smooth using the Super2xSaI (Scale and +Interpolate) pixel art scaling algorithm. +

+

Useful for enlarging pixel art images without reducing sharpness. +

+
+
+

30.245 swaprect

+ +

Swap two rectangular objects in video. +

+

This filter accepts the following options: +

+
+
w
+

Set object width. +

+
+
h
+

Set object height. +

+
+
x1
+

Set 1st rect x coordinate. +

+
+
y1
+

Set 1st rect y coordinate. +

+
+
x2
+

Set 2nd rect x coordinate. +

+
+
y2
+

Set 2nd rect y coordinate. +

+

All expressions are evaluated once for each frame. +

+
+ +

The all options are expressions containing the following constants: +

+
+
w
+
h
+

The input width and height. +

+
+
a
+

same as w / h +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (w / h) * sar +

+
+
n
+

The number of the input frame, starting from 0. +

+
+
t
+

The timestamp expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, +do not use +

+
+ + +
+

30.245.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.246 swapuv

+

Swap U & V plane. +

+
+
+

30.247 tblend

+

Blend successive video frames. +

+

See blend +

+
+
+

30.248 telecine

+ +

Apply telecine process to the video. +

+

This filter accepts the following options: +

+
+
first_field
+
+
top, t
+

top field first +

+
bottom, b
+

bottom field first +The default value is top. +

+
+ +
+
pattern
+

A string of numbers representing the pulldown pattern you wish to apply. +The default value is 23. +

+
+ +
+
Some typical patterns:
+
+NTSC output (30i):
+27.5p: 32222
+24p: 23 (classic)
+24p: 2332 (preferred)
+20p: 33
+18p: 334
+16p: 3444
+
+PAL output (25i):
+27.5p: 12222
+24p: 222222222223 ("Euro pulldown")
+16.67p: 33
+16p: 33333334
+
+ +
+
+

30.249 thistogram

+ +

Compute and draw a color distribution histogram for the input video across time. +

+

Unlike histogram video filter which only shows histogram of single input frame +at certain time, this filter shows also past histograms of number of frames defined +by width option. +

+

The computed histogram is a representation of the color component +distribution in an image. +

+

The filter accepts the following options: +

+
+
width, w
+

Set width of single color component output. Default value is 0. +Value of 0 means width will be picked from input video. +This also set number of passed histograms to keep. +Allowed range is [0, 8192]. +

+
+
display_mode, d
+

Set display mode. +It accepts the following values: +

+
stack
+

Per color component graphs are placed below each other. +

+
+
parade
+

Per color component graphs are placed side by side. +

+
+
overlay
+

Presents information identical to that in the parade, except +that the graphs representing color components are superimposed directly +over one another. +

+
+

Default is stack. +

+
+
levels_mode, m
+

Set mode. Can be either linear, or logarithmic. +Default is linear. +

+
+
components, c
+

Set what color components to display. +Default is 7. +

+
+
bgopacity, b
+

Set background opacity. Default is 0.9. +

+
+
envelope, e
+

Show envelope. Default is disabled. +

+
+
ecolor, ec
+

Set envelope color. Default is gold. +

+
+
slide
+

Set slide mode. +

+

Available values for slide is: +

+
frame
+

Draw new frame when right border is reached. +

+
+
replace
+

Replace old columns with new ones. +

+
+
scroll
+

Scroll from right to left. +

+
+
rscroll
+

Scroll from left to right. +

+
+
picture
+

Draw single picture. +

+
+ +

Default is replace. +

+
+ +
+
+

30.250 threshold

+ +

Apply threshold effect to video stream. +

+

This filter needs four video streams to perform thresholding. +First stream is stream we are filtering. +Second stream is holding threshold values, third stream is holding min values, +and last, fourth stream is holding max values. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+ +

For example if first stream pixel’s component value is less then threshold value +of pixel component from 2nd threshold stream, third stream value will picked, +otherwise fourth stream pixel component value will be picked. +

+

Using color source filter one can perform various types of thresholding: +

+ +
+

30.250.1 Commands

+ +

This filter supports the all options as commands. +

+
+
+

30.250.2 Examples

+ +
    +
  • Binary threshold, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=black -f lavfi -i color=white -lavfi threshold output.avi
    +
    + +
  • Inverted binary threshold, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -f lavfi -i color=black -lavfi threshold output.avi
    +
    + +
  • Truncate binary threshold, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=gray -lavfi threshold output.avi
    +
    + +
  • Threshold to zero, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -i 320x240.avi -lavfi threshold output.avi
    +
    + +
  • Inverted threshold to zero, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=white -lavfi threshold output.avi
    +
    +
+ +
+
+
+

30.251 thumbnail

+

Select the most representative frame in a given sequence of consecutive frames. +

+

The filter accepts the following options: +

+
+
n
+

Set the frames batch size to analyze; in a set of n frames, the filter +will pick one of them, and then handle the next batch of n frames until +the end. Default is 100. +

+
+
log
+

Set the log level to display picked frame stats. +Default is info. +

+
+ +

Since the filter keeps track of the whole frames sequence, a bigger n +value will result in a higher memory usage, so a high value is not recommended. +

+ +
+

30.251.1 Examples

+ +
    +
  • Extract one picture each 50 frames: +
    +
    thumbnail=50
    +
    + +
  • Complete example of a thumbnail creation with ffmpeg: +
    +
    ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
    +
    +
+ +
+
+
+

30.252 tile

+ +

Tile several successive frames together. +

+

The untile filter can do the reverse. +

+

The filter accepts the following options: +

+
+
layout
+

Set the grid size in the form COLUMNSxROWS. Range is upto UINT_MAX cells. +Default is 6x5. +

+
+
nb_frames
+

Set the maximum number of frames to render in the given area. It must be less +than or equal to wxh. The default value is 0, meaning all +the area will be used. +

+
+
margin
+

Set the outer border margin in pixels. Range is 0 to 1024. Default is 0. +

+
+
padding
+

Set the inner border thickness (i.e. the number of pixels between frames). For +more advanced padding options (such as having different values for the edges), +refer to the pad video filter. Range is 0 to 1024. Default is 0. +

+
+
color
+

Specify the color of the unused area. For the syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +The default value of color is "black". +

+
+
overlap
+

Set the number of frames to overlap when tiling several successive frames together. +The value must be between 0 and nb_frames - 1. Default is 0. +

+
+
init_padding
+

Set the number of frames to initially be empty before displaying first output frame. +This controls how soon will one get first output frame. +The value must be between 0 and nb_frames - 1. Default is 0. +

+
+ + +
+

30.252.1 Examples

+ +
    +
  • Produce 8x8 PNG tiles of all keyframes (-skip_frame nokey) in a movie: +
    +
    ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
    +
    +

    The -vsync 0 is necessary to prevent ffmpeg from +duplicating each output frame to accommodate the originally detected frame +rate. +

    +
  • Display 5 pictures in an area of 3x2 frames, +with 7 pixels between them, and 2 pixels of initial margin, using +mixed flat and named options: +
    +
    tile=3x2:nb_frames=5:padding=7:margin=2
    +
    +
+ +
+
+
+

30.253 tinterlace

+ +

Perform various types of temporal field interlacing. +

+

Frames are counted starting from 1, so the first input frame is +considered odd. +

+

The filter accepts the following options: +

+
+
mode
+

Specify the mode of the interlacing. This option can also be specified +as a value alone. See below for a list of values for this option. +

+

Available values are: +

+
+
merge, 0
+

Move odd frames into the upper field, even into the lower field, +generating a double height frame at half frame rate. +

+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+
+ +
+
drop_even, 1
+

Only output odd frames, even frames are dropped, generating a frame with +unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111                           33333
+11111                           33333
+11111                           33333
+11111                           33333
+
+ +
+
drop_odd, 2
+

Only output even frames, odd frames are dropped, generating a frame with +unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+                22222                           44444
+                22222                           44444
+                22222                           44444
+                22222                           44444
+
+ +
+
pad, 3
+

Expand each frame to full height, but pad alternate lines with black, +generating a frame with double height at the same input frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111           .....           33333           .....
+.....           22222           .....           44444
+11111           .....           33333           .....
+.....           22222           .....           44444
+11111           .....           33333           .....
+.....           22222           .....           44444
+11111           .....           33333           .....
+.....           22222           .....           44444
+
+ + +
+
interleave_top, 4
+

Interleave the upper field from odd frames with the lower field from +even frames, generating a frame with unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111<-         22222           33333<-         44444
+11111           22222<-         33333           44444<-
+11111<-         22222           33333<-         44444
+11111           22222<-         33333           44444<-
+
+Output:
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+
+ + +
+
interleave_bottom, 5
+

Interleave the lower field from odd frames with the upper field from +even frames, generating a frame with unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222<-         33333           44444<-
+11111<-         22222           33333<-         44444
+11111           22222<-         33333           44444<-
+11111<-         22222           33333<-         44444
+
+Output:
+22222                           44444
+11111                           33333
+22222                           44444
+11111                           33333
+
+ + +
+
interlacex2, 6
+

Double frame rate with unchanged height. Frames are inserted each +containing the second temporal field from the previous input frame and +the first temporal field from the next input frame. This mode relies on +the top_field_first flag. Useful for interlaced video displays with no +field synchronisation. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+ 11111           22222           33333           44444
+11111           22222           33333           44444
+ 11111           22222           33333           44444
+
+Output:
+11111   22222   22222   33333   33333   44444   44444
+ 11111   11111   22222   22222   33333   33333   44444
+11111   22222   22222   33333   33333   44444   44444
+ 11111   11111   22222   22222   33333   33333   44444
+
+ + +
+
mergex2, 7
+

Move odd frames into the upper field, even into the lower field, +generating a double height frame at same frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111           33333           33333           55555
+22222           22222           44444           44444
+11111           33333           33333           55555
+22222           22222           44444           44444
+11111           33333           33333           55555
+22222           22222           44444           44444
+11111           33333           33333           55555
+22222           22222           44444           44444
+
+ +
+
+ +

Numeric values are deprecated but are accepted for backward +compatibility reasons. +

+

Default mode is merge. +

+
+
flags
+

Specify flags influencing the filter process. +

+

Available value for flags is: +

+
+
low_pass_filter, vlpf
+

Enable linear vertical low-pass filtering in the filter. +Vertical low-pass filtering is required when creating an interlaced +destination from a progressive source which contains high-frequency +vertical detail. Filtering will reduce interlace ’twitter’ and Moire +patterning. +

+
+
complex_filter, cvlpf
+

Enable complex vertical low-pass filtering. +This will slightly less reduce interlace ’twitter’ and Moire +patterning but better retain detail and subjective sharpness impression. +

+
+
bypass_il
+

Bypass already interlaced frames, only adjust the frame rate. +

+
+ +

Vertical low-pass filtering and bypassing already interlaced frames can only be +enabled for mode interleave_top and interleave_bottom. +

+
+
+ +
+
+

30.254 tmedian

+

Pick median pixels from several successive input video frames. +

+

The filter accepts the following options: +

+
+
radius
+

Set radius of median filter. +Default is 1. Allowed range is from 1 to 127. +

+
+
planes
+

Set which planes to filter. Default value is 15, by which all planes are processed. +

+
+
percentile
+

Set median percentile. Default value is 0.5. +Default value of 0.5 will pick always median values, while 0 will pick +minimum values, and 1 maximum values. +

+
+ + +
+

30.254.1 Commands

+ +

This filter supports all above options as commands, excluding option radius. +

+
+
+
+

30.255 tmidequalizer

+ +

Apply Temporal Midway Video Equalization effect. +

+

Midway Video Equalization adjusts a sequence of video frames to have the same +histograms, while maintaining their dynamics as much as possible. It’s +useful for e.g. matching exposures from a video frames sequence. +

+

This filter accepts the following option: +

+
+
radius
+

Set filtering radius. Default is 5. Allowed range is from 1 to 127. +

+
+
sigma
+

Set filtering sigma. Default is 0.5. This controls strength of filtering. +Setting this option to 0 effectively does nothing. +

+
+
planes
+

Set which planes to process. Default is 15, which is all available planes. +

+
+ +
+
+

30.256 tmix

+ +

Mix successive video frames. +

+

A description of the accepted options follows. +

+
+
frames
+

The number of successive frames to mix. If unspecified, it defaults to 3. +

+
+
weights
+

Specify weight of each input video frame. +Each weight is separated by space. If number of weights is smaller than +number of frames last specified weight will be used for all remaining +unset weights. +

+
+
scale
+

Specify scale, if it is set it will be multiplied with sum +of each weight multiplied with pixel values to give final destination +pixel value. By default scale is auto scaled to sum of weights. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+ + +
+

30.256.1 Examples

+ +
    +
  • Average 7 successive frames: +
    +
    tmix=frames=7:weights="1 1 1 1 1 1 1"
    +
    + +
  • Apply simple temporal convolution: +
    +
    tmix=frames=3:weights="-1 3 -1"
    +
    + +
  • Similar as above but only showing temporal differences: +
    +
    tmix=frames=3:weights="-1 2 -1":scale=1
    +
    +
+ +
+
+

30.256.2 Commands

+ +

This filter supports the following commands: +

+
weights
+
scale
+
planes
+

Syntax is same as option with same name. +

+
+ +
+
+
+

30.257 tonemap

+

Tone map colors from different dynamic ranges. +

+

This filter expects data in single precision floating point, as it needs to +operate on (and can output) out-of-range values. Another filter, such as +zscale, is needed to convert the resulting frame to a usable format. +

+

The tonemapping algorithms implemented only work on linear light, so input +data should be linearized beforehand (and possibly correctly tagged). +

+
+
ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
+
+ + +
+

30.257.1 Options

+

The filter accepts the following options. +

+
+
tonemap
+

Set the tone map algorithm to use. +

+

Possible values are: +

+
none
+

Do not apply any tone map, only desaturate overbright pixels. +

+
+
clip
+

Hard-clip any out-of-range values. Use it for perfect color accuracy for +in-range values, while distorting out-of-range values. +

+
+
linear
+

Stretch the entire reference gamut to a linear multiple of the display. +

+
+
gamma
+

Fit a logarithmic transfer between the tone curves. +

+
+
reinhard
+

Preserve overall image brightness with a simple curve, using nonlinear +contrast, which results in flattening details and degrading color accuracy. +

+
+
hable
+

Preserve both dark and bright details better than reinhard, at the cost +of slightly darkening everything. Use it when detail preservation is more +important than color and brightness accuracy. +

+
+
mobius
+

Smoothly map out-of-range values, while retaining contrast and colors for +in-range material as much as possible. Use it when color accuracy is more +important than detail preservation. +

+
+ +

Default is none. +

+
+
param
+

Tune the tone mapping algorithm. +

+

This affects the following algorithms: +

+
none
+

Ignored. +

+
+
linear
+

Specifies the scale factor to use while stretching. +Default to 1.0. +

+
+
gamma
+

Specifies the exponent of the function. +Default to 1.8. +

+
+
clip
+

Specify an extra linear coefficient to multiply into the signal before clipping. +Default to 1.0. +

+
+
reinhard
+

Specify the local contrast coefficient at the display peak. +Default to 0.5, which means that in-gamut values will be about half as bright +as when clipping. +

+
+
hable
+

Ignored. +

+
+
mobius
+

Specify the transition point from linear to mobius transform. Every value +below this point is guaranteed to be mapped 1:1. The higher the value, the +more accurate the result will be, at the cost of losing bright details. +Default to 0.3, which due to the steep initial slope still preserves in-range +colors fairly accurately. +

+
+ +
+
desat
+

Apply desaturation for highlights that exceed this level of brightness. The +higher the parameter, the more color information will be preserved. This +setting helps prevent unnaturally blown-out colors for super-highlights, by +(smoothly) turning into white instead. This makes images feel more natural, +at the cost of reducing information about out-of-range colors. +

+

The default of 2.0 is somewhat conservative and will mostly just apply to +skies or directly sunlit surfaces. A setting of 0.0 disables this option. +

+

This option works only if the input frame has a supported color tag. +

+
+
peak
+

Override signal/nominal/reference peak with this value. Useful when the +embedded peak information in display metadata is not reliable or when tone +mapping from a lower range to a higher range. +

+
+ +
+
+
+

30.258 tpad

+ +

Temporarily pad video frames. +

+

The filter accepts the following options: +

+
+
start
+

Specify number of delay frames before input video stream. Default is 0. +

+
+
stop
+

Specify number of padding frames after input video stream. +Set to -1 to pad indefinitely. Default is 0. +

+
+
start_mode
+

Set kind of frames added to beginning of stream. +Can be either add or clone. +With add frames of solid-color are added. +With clone frames are clones of first frame. +Default is add. +

+
+
stop_mode
+

Set kind of frames added to end of stream. +Can be either add or clone. +With add frames of solid-color are added. +With clone frames are clones of last frame. +Default is add. +

+
+
start_duration, stop_duration
+

Specify the duration of the start/stop delay. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +These options override start and stop. Default is 0. +

+
+
color
+

Specify the color of the padded area. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. +

+

The default value of color is "black". +

+
+ +
+
+

30.259 transpose

+ +

Transpose rows with columns in the input video and optionally flip it. +

+

It accepts the following parameters: +

+
+
dir
+

Specify the transposition direction. +

+

Can assume the following values: +

+
0, 4, cclock_flip
+

Rotate by 90 degrees counterclockwise and vertically flip (default), that is: +

+
L.R     L.l
+. . ->  . .
+l.r     R.r
+
+ +
+
1, 5, clock
+

Rotate by 90 degrees clockwise, that is: +

+
L.R     l.L
+. . ->  . .
+l.r     r.R
+
+ +
+
2, 6, cclock
+

Rotate by 90 degrees counterclockwise, that is: +

+
L.R     R.r
+. . ->  . .
+l.r     L.l
+
+ +
+
3, 7, clock_flip
+

Rotate by 90 degrees clockwise and vertically flip, that is: +

+
L.R     r.R
+. . ->  . .
+l.r     l.L
+
+
+
+ +

For values between 4-7, the transposition is only done if the input +video geometry is portrait and not landscape. These values are +deprecated, the passthrough option should be used instead. +

+

Numerical values are deprecated, and should be dropped in favor of +symbolic constants. +

+
+
passthrough
+

Do not apply the transposition if the input geometry matches the one +specified by the specified value. It accepts the following values: +

+
none
+

Always apply transposition. +

+
portrait
+

Preserve portrait geometry (when height >= width). +

+
landscape
+

Preserve landscape geometry (when width >= height). +

+
+ +

Default value is none. +

+
+ +

For example to rotate by 90 degrees clockwise and preserve portrait +layout: +

+
transpose=dir=1:passthrough=portrait
+
+ +

The command above can also be specified as: +

+
transpose=1:portrait
+
+ +
+
+

30.260 transpose_npp

+ +

Transpose rows with columns in the input video and optionally flip it. +For more in depth examples see the transpose video filter, which shares mostly the same options. +

+

It accepts the following parameters: +

+
+
dir
+

Specify the transposition direction. +

+

Can assume the following values: +

+
cclock_flip
+

Rotate by 90 degrees counterclockwise and vertically flip. (default) +

+
+
clock
+

Rotate by 90 degrees clockwise. +

+
+
cclock
+

Rotate by 90 degrees counterclockwise. +

+
+
clock_flip
+

Rotate by 90 degrees clockwise and vertically flip. +

+
+ +
+
passthrough
+

Do not apply the transposition if the input geometry matches the one +specified by the specified value. It accepts the following values: +

+
none
+

Always apply transposition. (default) +

+
portrait
+

Preserve portrait geometry (when height >= width). +

+
landscape
+

Preserve landscape geometry (when width >= height). +

+
+ +
+
+ +
+
+

30.261 trim

+

Trim the input so that the output contains one continuous subpart of the input. +

+

It accepts the following parameters: +

+
start
+

Specify the time of the start of the kept section, i.e. the frame with the +timestamp start will be the first frame in the output. +

+
+
end
+

Specify the time of the first frame that will be dropped, i.e. the frame +immediately preceding the one with the timestamp end will be the last +frame in the output. +

+
+
start_pts
+

This is the same as start, except this option sets the start timestamp +in timebase units instead of seconds. +

+
+
end_pts
+

This is the same as end, except this option sets the end timestamp +in timebase units instead of seconds. +

+
+
duration
+

The maximum duration of the output in seconds. +

+
+
start_frame
+

The number of the first frame that should be passed to the output. +

+
+
end_frame
+

The number of the first frame that should be dropped. +

+
+ +

start, end, and duration are expressed as time +duration specifications; see +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

Note that the first two sets of the start/end options and the duration +option look at the frame timestamp, while the _frame variants simply count the +frames that pass through the filter. Also note that this filter does not modify +the timestamps. If you wish for the output timestamps to start at zero, insert a +setpts filter after the trim filter. +

+

If multiple start or end options are set, this filter tries to be greedy and +keep all the frames that match at least one of the specified constraints. To keep +only the part that matches all the constraints at once, chain multiple trim +filters. +

+

The defaults are such that all the input is kept. So it is possible to set e.g. +just the end values to keep everything before the specified time. +

+

Examples: +

    +
  • Drop everything except the second minute of input: +
    +
    ffmpeg -i INPUT -vf trim=60:120
    +
    + +
  • Keep only the first second: +
    +
    ffmpeg -i INPUT -vf trim=duration=1
    +
    + +
+ +
+
+

30.262 unpremultiply

+

Apply alpha unpremultiply effect to input video stream using first plane +of second stream as alpha. +

+

Both streams must have same dimensions and same pixel format. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+

If the format has 1 or 2 components, then luma is bit 0. +If the format has 3 or 4 components: +for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red; +for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V. +If present, the alpha channel is always the last bit. +

+
+
inplace
+

Do not require 2nd input for processing, instead use alpha plane from input stream. +

+
+ +
+
+

30.263 unsharp

+ +

Sharpen or blur the input video. +

+

It accepts the following parameters: +

+
+
luma_msize_x, lx
+

Set the luma matrix horizontal size. It must be an odd integer between +3 and 23. The default value is 5. +

+
+
luma_msize_y, ly
+

Set the luma matrix vertical size. It must be an odd integer between 3 +and 23. The default value is 5. +

+
+
luma_amount, la
+

Set the luma effect strength. It must be a floating point number, reasonable +values lay between -1.5 and 1.5. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+

Default value is 1.0. +

+
+
chroma_msize_x, cx
+

Set the chroma matrix horizontal size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
chroma_msize_y, cy
+

Set the chroma matrix vertical size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
chroma_amount, ca
+

Set the chroma effect strength. It must be a floating point number, reasonable +values lay between -1.5 and 1.5. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+

Default value is 0.0. +

+
+
alpha_msize_x, ax
+

Set the alpha matrix horizontal size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
alpha_msize_y, ay
+

Set the alpha matrix vertical size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
alpha_amount, aa
+

Set the alpha effect strength. It must be a floating point number, reasonable +values lay between -1.5 and 1.5. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+

Default value is 0.0. +

+
+
+ +

All parameters are optional and default to the equivalent of the +string ’5:5:1.0:5:5:0.0’. +

+ +
+

30.263.1 Examples

+ +
    +
  • Apply strong luma sharpen effect: +
    +
    unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
    +
    + +
  • Apply a strong blur of both luma and chroma parameters: +
    +
    unsharp=7:7:-2:7:7:-2
    +
    +
+ +
+
+
+

30.264 untile

+ +

Decompose a video made of tiled images into the individual images. +

+

The frame rate of the output video is the frame rate of the input video +multiplied by the number of tiles. +

+

This filter does the reverse of tile. +

+

The filter accepts the following options: +

+
+
layout
+

Set the grid size (i.e. the number of lines and columns). For the syntax of +this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+ + +
+

30.264.1 Examples

+ +
    +
  • Produce a 1-second video from a still image file made of 25 frames stacked +vertically, like an analogic film reel: +
    +
    ffmpeg -r 1 -i image.jpg -vf untile=1x25 movie.mkv
    +
    +
+ +
+
+
+

30.265 uspp

+ +

Apply ultra slow/simple postprocessing filter that compresses and decompresses +the image at several (or - in the case of quality level 8 - all) +shifts and average the results. +

+

The way this differs from the behavior of spp is that uspp actually encodes & +decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8 +DCT similar to MJPEG. +

+

This filter is only available in ffmpeg version 4.4 or earlier. +

+

The filter accepts the following options: +

+
+
quality
+

Set quality. This option defines the number of levels for averaging. It accepts +an integer in the range 0-8. If set to 0, the filter will have no +effect. A value of 8 means the higher quality. For each increment of +that value the speed drops by a factor of approximately 2. Default value is +3. +

+
+
qp
+

Force a constant quantization parameter. If not set, the filter will use the QP +from the video stream (if available). +

+
+
codec
+

Use specified codec instead of snow. +

+
+ +
+
+

30.266 v360

+ +

Convert 360 videos between various formats. +

+

The filter accepts the following options: +

+
+
input
+
output
+

Set format of the input/output video. +

+

Available formats: +

+
+
e
+
equirect
+

Equirectangular projection. +

+
+
c3x2
+
c6x1
+
c1x6
+

Cubemap with 3x2/6x1/1x6 layout. +

+

Format specific options: +

+
+
in_pad
+
out_pad
+

Set padding proportion for the input/output cubemap. Values in decimals. +

+

Example values: +

+
0
+

No padding. +

+
0.01
+

1% of face is padding. For example, with 1920x1280 resolution face size would be 640x640 and padding would be 3 pixels from each side. (640 * 0.01 = 6 pixels) +

+
+ +

Default value is 0. +Maximum value is 0.1. +

+
+
fin_pad
+
fout_pad
+

Set fixed padding for the input/output cubemap. Values in pixels. +

+

Default value is 0. If greater than zero it overrides other padding options. +

+
+
in_forder
+
out_forder
+

Set order of faces for the input/output cubemap. Choose one direction for each position. +

+

Designation of directions: +

+
r
+

right +

+
l
+

left +

+
u
+

up +

+
d
+

down +

+
f
+

forward +

+
b
+

back +

+
+ +

Default value is rludfb. +

+
+
in_frot
+
out_frot
+

Set rotation of faces for the input/output cubemap. Choose one angle for each position. +

+

Designation of angles: +

+
0
+

0 degrees clockwise +

+
1
+

90 degrees clockwise +

+
2
+

180 degrees clockwise +

+
3
+

270 degrees clockwise +

+
+ +

Default value is 000000. +

+
+ +
+
eac
+

Equi-Angular Cubemap. +

+
+
flat
+
gnomonic
+
rectilinear
+

Regular video. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
dfisheye
+

Dual fisheye. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
barrel
+
fb
+
barrelsplit
+

Facebook’s 360 formats. +

+
+
sg
+

Stereographic format. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
mercator
+

Mercator format. +

+
+
ball
+

Ball format, gives significant distortion toward the back. +

+
+
hammer
+

Hammer-Aitoff map projection format. +

+
+
sinusoidal
+

Sinusoidal map projection format. +

+
+
fisheye
+

Fisheye projection. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
pannini
+

Pannini projection. +

+

Format specific options: +

+
h_fov
+

Set output pannini parameter. +

+
+
ih_fov
+

Set input pannini parameter. +

+
+ +
+
cylindrical
+

Cylindrical projection. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
perspective
+

Perspective projection. (output only) +

+

Format specific options: +

+
v_fov
+

Set perspective parameter. +

+
+ +
+
tetrahedron
+

Tetrahedron projection. +

+
+
tsp
+

Truncated square pyramid projection. +

+
+
he
+
hequirect
+

Half equirectangular projection. +

+
+
equisolid
+

Equisolid format. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
og
+

Orthographic format. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
octahedron
+

Octahedron projection. +

+
+
cylindricalea
+

Cylindrical Equal Area projection. +

+
+ +
+
interp
+

Set interpolation method.
+Note: more complex interpolation methods require much more memory to run. +

+

Available methods: +

+
+
near
+
nearest
+

Nearest neighbour. +

+
line
+
linear
+

Bilinear interpolation. +

+
lagrange9
+

Lagrange9 interpolation. +

+
cube
+
cubic
+

Bicubic interpolation. +

+
lanc
+
lanczos
+

Lanczos interpolation. +

+
sp16
+
spline16
+

Spline16 interpolation. +

+
gauss
+
gaussian
+

Gaussian interpolation. +

+
mitchell
+

Mitchell interpolation. +

+
+ +

Default value is line. +

+
+
w
+
h
+

Set the output video resolution. +

+

Default resolution depends on formats. +

+
+
in_stereo
+
out_stereo
+

Set the input/output stereo format. +

+
+
2d
+

2D mono +

+
sbs
+

Side by side +

+
tb
+

Top bottom +

+
+ +

Default value is 2d for input and output format. +

+
+
yaw
+
pitch
+
roll
+

Set rotation for the output video. Values in degrees. +

+
+
rorder
+

Set rotation order for the output video. Choose one item for each position. +

+
+
y, Y
+

yaw +

+
p, P
+

pitch +

+
r, R
+

roll +

+
+ +

Default value is ypr. +

+
+
h_flip
+
v_flip
+
d_flip
+

Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values. +

+
+
ih_flip
+
iv_flip
+

Set if input video is flipped horizontally/vertically. Boolean values. +

+
+
in_trans
+

Set if input video is transposed. Boolean value, by default disabled. +

+
+
out_trans
+

Set if output video needs to be transposed. Boolean value, by default disabled. +

+
+
h_offset
+
v_offset
+

Set output horizontal/vertical off-axis offset. Default is set to 0. +Allowed range is from -1 to 1. +

+
+
alpha_mask
+

Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled. +

+
+
reset_rot
+

Reset rotation of output video. Boolean value, by default disabled. +

+
+ + +
+

30.266.1 Examples

+ +
    +
  • Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation: +
    +
    ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
    +
    +
  • Extract back view of Equi-Angular Cubemap: +
    +
    ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
    +
    +
  • Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format: +
    +
    v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
    +
    +
+ +
+
+

30.266.2 Commands

+ +

This filter supports subset of above options as commands. +

+
+
+
+

30.267 vaguedenoiser

+ +

Apply a wavelet based denoiser. +

+

It transforms each frame from the video input into the wavelet domain, +using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to +the obtained coefficients. It does an inverse wavelet transform after. +Due to wavelet properties, it should give a nice smoothed result, and +reduced noise, without blurring picture features. +

+

This filter accepts the following options: +

+
+
threshold
+

The filtering strength. The higher, the more filtered the video will be. +Hard thresholding can use a higher threshold than soft thresholding +before the video looks overfiltered. Default value is 2. +

+
+
method
+

The filtering method the filter will use. +

+

It accepts the following values: +

+
hard
+

All values under the threshold will be zeroed. +

+
+
soft
+

All values under the threshold will be zeroed. All values above will be +reduced by the threshold. +

+
+
garrote
+

Scales or nullifies coefficients - intermediary between (more) soft and +(less) hard thresholding. +

+
+ +

Default is garrote. +

+
+
nsteps
+

Number of times, the wavelet will decompose the picture. Picture can’t +be decomposed beyond a particular point (typically, 8 for a 640x480 +frame - as 2^9 = 512 > 480). Valid values are integers between 1 and 32. Default value is 6. +

+
+
percent
+

Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85. +

+
+
planes
+

A list of the planes to process. By default all planes are processed. +

+
+
type
+

The threshold type the filter will use. +

+

It accepts the following values: +

+
universal
+

Threshold used is same for all decompositions. +

+
+
bayes
+

Threshold used depends also on each decomposition coefficients. +

+
+ +

Default is universal. +

+
+ +
+
+

30.268 varblur

+

Apply variable blur filter by using 2nd video stream to set blur radius. +The 2nd stream must have the same dimensions. +

+

This filter accepts the following options: +

+
+
min_r
+

Set min allowed radius. Allowed range is from 0 to 254. Default is 0. +

+
max_r
+

Set max allowed radius. Allowed range is from 1 to 255. Default is 8. +

+
planes
+

Set which planes to process. By default, all are used. +

+
+ +

The varblur filter also supports the framesync options. +

+ +
+

30.268.1 Commands

+ +

This filter supports all the above options as commands. +

+
+
+
+

30.269 vectorscope

+ +

Display 2 color component values in the two dimensional graph (which is called +a vectorscope). +

+

This filter accepts the following options: +

+
+
mode, m
+

Set vectorscope mode. +

+

It accepts the following values: +

+
gray
+
tint
+

Gray values are displayed on graph, higher brightness means more pixels have +same component color value on location in graph. This is the default mode. +

+
+
color
+

Gray values are displayed on graph. Surrounding pixels values which are not +present in video frame are drawn in gradient of 2 color components which are +set by option x and y. The 3rd color component is static. +

+
+
color2
+

Actual color components values present in video frame are displayed on graph. +

+
+
color3
+

Similar as color2 but higher frequency of same values x and y +on graph increases value of another color component, which is luminance by +default values of x and y. +

+
+
color4
+

Actual colors present in video frame are displayed on graph. If two different +colors map to same position on graph then color with higher value of component +not present in graph is picked. +

+
+
color5
+

Gray values are displayed on graph. Similar to color but with 3rd color +component picked from radial gradient. +

+
+ +
+
x
+

Set which color component will be represented on X-axis. Default is 1. +

+
+
y
+

Set which color component will be represented on Y-axis. Default is 2. +

+
+
intensity, i
+

Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness +of color component which represents frequency of (X, Y) location in graph. +

+
+
envelope, e
+
+
none
+

No envelope, this is default. +

+
+
instant
+

Instant envelope, even darkest single pixel will be clearly highlighted. +

+
+
peak
+

Hold maximum and minimum values presented in graph over time. This way you +can still spot out of range values without constantly looking at vectorscope. +

+
+
peak+instant
+

Peak and instant envelope combined together. +

+
+ +
+
graticule, g
+

Set what kind of graticule to draw. +

+
none
+
green
+
color
+
invert
+
+ +
+
opacity, o
+

Set graticule opacity. +

+
+
flags, f
+

Set graticule flags. +

+
+
white
+

Draw graticule for white point. +

+
+
black
+

Draw graticule for black point. +

+
+
name
+

Draw color points short names. +

+
+ +
+
bgopacity, b
+

Set background opacity. +

+
+
lthreshold, l
+

Set low threshold for color component not represented on X or Y axis. +Values lower than this value will be ignored. Default is 0. +Note this value is multiplied with actual max possible value one pixel component +can have. So for 8-bit input and low threshold value of 0.1 actual threshold +is 0.1 * 255 = 25. +

+
+
hthreshold, h
+

Set high threshold for color component not represented on X or Y axis. +Values higher than this value will be ignored. Default is 1. +Note this value is multiplied with actual max possible value one pixel component +can have. So for 8-bit input and high threshold value of 0.9 actual threshold +is 0.9 * 255 = 230. +

+
+
colorspace, c
+

Set what kind of colorspace to use when drawing graticule. +

+
auto
+
601
+
709
+
+

Default is auto. +

+
+
tint0, t0
+
tint1, t1
+

Set color tint for gray/tint vectorscope mode. By default both options are zero. +This means no tint, and output will remain gray. +

+
+ +
+
+

30.270 vidstabdetect

+ +

Analyze video stabilization/deshaking. Perform pass 1 of 2, see +vidstabtransform for pass 2. +

+

This filter generates a file with relative translation and rotation +transform information about subsequent frames, which is then used by +the vidstabtransform filter. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libvidstab. +

+

This filter accepts the following options: +

+
+
result
+

Set the path to the file used to write the transforms information. +Default value is transforms.trf. +

+
+
shakiness
+

Set how shaky the video is and how quick the camera is. It accepts an +integer in the range 1-10, a value of 1 means little shakiness, a +value of 10 means strong shakiness. Default value is 5. +

+
+
accuracy
+

Set the accuracy of the detection process. It must be a value in the +range 1-15. A value of 1 means low accuracy, a value of 15 means high +accuracy. Default value is 15. +

+
+
stepsize
+

Set stepsize of the search process. The region around minimum is +scanned with 1 pixel resolution. Default value is 6. +

+
+
mincontrast
+

Set minimum contrast. Below this value a local measurement field is +discarded. Must be a floating point value in the range 0-1. Default +value is 0.3. +

+
+
tripod
+

Set reference frame number for tripod mode. +

+

If enabled, the motion of the frames is compared to a reference frame +in the filtered stream, identified by the specified number. The idea +is to compensate all movements in a more-or-less static scene and keep +the camera view absolutely still. +

+

If set to 0, it is disabled. The frames are counted starting from 1. +

+
+
show
+

Show fields and transforms in the resulting frames. It accepts an +integer in the range 0-2. Default value is 0, which disables any +visualization. +

+
+ + +
+

30.270.1 Examples

+ +
    +
  • Use default values: +
    +
    vidstabdetect
    +
    + +
  • Analyze strongly shaky movie and put the results in file +mytransforms.trf: +
    +
    vidstabdetect=shakiness=10:accuracy=15:result="mytransforms.trf"
    +
    + +
  • Visualize the result of internal transformations in the resulting +video: +
    +
    vidstabdetect=show=1
    +
    + +
  • Analyze a video with medium shakiness using ffmpeg: +
    +
    ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
    +
    +
+ +
+
+
+

30.271 vidstabtransform

+ +

Video stabilization/deshaking: pass 2 of 2, +see vidstabdetect for pass 1. +

+

Read a file with transform information for each frame and +apply/compensate them. Together with the vidstabdetect +filter this can be used to deshake videos. See also +http://public.hronopik.de/vid.stab. It is important to also use +the unsharp filter, see below. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libvidstab. +

+ +
+

30.271.1 Options

+ +
+
input
+

Set path to the file used to read the transforms. Default value is +transforms.trf. +

+
+
smoothing
+

Set the number of frames (value*2 + 1) used for lowpass filtering the +camera movements. Default value is 10. +

+

For example a number of 10 means that 21 frames are used (10 in the +past and 10 in the future) to smoothen the motion in the video. A +larger value leads to a smoother video, but limits the acceleration of +the camera (pan/tilt movements). 0 is a special case where a static +camera is simulated. +

+
+
optalgo
+

Set the camera path optimization algorithm. +

+

Accepted values are: +

+
gauss
+

gaussian kernel low-pass filter on camera motion (default) +

+
avg
+

averaging on transformations +

+
+ +
+
maxshift
+

Set maximal number of pixels to translate frames. Default value is -1, +meaning no limit. +

+
+
maxangle
+

Set maximal angle in radians (degree*PI/180) to rotate frames. Default +value is -1, meaning no limit. +

+
+
crop
+

Specify how to deal with borders that may be visible due to movement +compensation. +

+

Available values are: +

+
keep
+

keep image information from previous frame (default) +

+
black
+

fill the border black +

+
+ +
+
invert
+

Invert transforms if set to 1. Default value is 0. +

+
+
relative
+

Consider transforms as relative to previous frame if set to 1, +absolute if set to 0. Default value is 0. +

+
+
zoom
+

Set percentage to zoom. A positive value will result in a zoom-in +effect, a negative value in a zoom-out effect. Default value is 0 (no +zoom). +

+
+
optzoom
+

Set optimal zooming to avoid borders. +

+

Accepted values are: +

+
0
+

disabled +

+
1
+

optimal static zoom value is determined (only very strong movements +will lead to visible borders) (default) +

+
2
+

optimal adaptive zoom value is determined (no borders will be +visible), see zoomspeed +

+
+ +

Note that the value given at zoom is added to the one calculated here. +

+
+
zoomspeed
+

Set percent to zoom maximally each frame (enabled when +optzoom is set to 2). Range is from 0 to 5, default value is +0.25. +

+
+
interpol
+

Specify type of interpolation. +

+

Available values are: +

+
no
+

no interpolation +

+
linear
+

linear only horizontal +

+
bilinear
+

linear in both directions (default) +

+
bicubic
+

cubic in both directions (slow) +

+
+ +
+
tripod
+

Enable virtual tripod mode if set to 1, which is equivalent to +relative=0:smoothing=0. Default value is 0. +

+

Use also tripod option of vidstabdetect. +

+
+
debug
+

Increase log verbosity if set to 1. Also the detected global motions +are written to the temporary file global_motions.trf. Default +value is 0. +

+
+ +
+
+

30.271.2 Examples

+ +
    +
  • Use ffmpeg for a typical stabilization with default values: +
    +
    ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
    +
    + +

    Note the use of the unsharp filter which is always recommended. +

    +
  • Zoom in a bit more and load transform data from a given file: +
    +
    vidstabtransform=zoom=5:input="mytransforms.trf"
    +
    + +
  • Smoothen the video even more: +
    +
    vidstabtransform=smoothing=30
    +
    +
+ +
+
+
+

30.272 vflip

+ +

Flip the input video vertically. +

+

For example, to vertically flip a video with ffmpeg: +

+
ffmpeg -i in.avi -vf "vflip" out.avi
+
+ +
+
+

30.273 vfrdet

+ +

Detect variable frame rate video. +

+

This filter tries to detect if the input is variable or constant frame rate. +

+

At end it will output number of frames detected as having variable delta pts, +and ones with constant delta pts. +If there was frames with variable delta, than it will also show min, max and +average delta encountered. +

+
+
+

30.274 vibrance

+ +

Boost or alter saturation. +

+

The filter accepts the following options: +

+
intensity
+

Set strength of boost if positive value or strength of alter if negative value. +Default is 0. Allowed range is from -2 to 2. +

+
+
rbal
+

Set the red balance. Default is 1. Allowed range is from -10 to 10. +

+
+
gbal
+

Set the green balance. Default is 1. Allowed range is from -10 to 10. +

+
+
bbal
+

Set the blue balance. Default is 1. Allowed range is from -10 to 10. +

+
+
rlum
+

Set the red luma coefficient. +

+
+
glum
+

Set the green luma coefficient. +

+
+
blum
+

Set the blue luma coefficient. +

+
+
alternate
+

If intensity is negative and this is set to 1, colors will change, +otherwise colors will be less saturated, more towards gray. +

+
+ + +
+

30.274.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

30.275 vif

+ +

Obtain the average VIF (Visual Information Fidelity) between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained average VIF score is printed through the logging system. +

+

The filter stores the calculated VIF score of each frame. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi vif -f null -
+
+ +
+
+

30.276 vignette

+ +

Make or reverse a natural vignetting effect. +

+

The filter accepts the following options: +

+
+
angle, a
+

Set lens angle expression as a number of radians. +

+

The value is clipped in the [0,PI/2] range. +

+

Default value: "PI/5" +

+
+
x0
+
y0
+

Set center coordinates expressions. Respectively "w/2" and "h/2" +by default. +

+
+
mode
+

Set forward/backward mode. +

+

Available modes are: +

+
forward
+

The larger the distance from the central point, the darker the image becomes. +

+
+
backward
+

The larger the distance from the central point, the brighter the image becomes. +This can be used to reverse a vignette effect, though there is no automatic +detection to extract the lens angle and other settings (yet). It can +also be used to create a burning effect. +

+
+ +

Default value is ‘forward’. +

+
+
eval
+

Set evaluation mode for the expressions (angle, x0, y0). +

+

It accepts the following values: +

+
init
+

Evaluate expressions only once during the filter initialization. +

+
+
frame
+

Evaluate expressions for each incoming frame. This is way slower than the +‘init’ mode since it requires all the scalers to be re-computed, but it +allows advanced dynamic expressions. +

+
+ +

Default value is ‘init’. +

+
+
dither
+

Set dithering to reduce the circular banding effects. Default is 1 +(enabled). +

+
+
aspect
+

Set vignette aspect. This setting allows one to adjust the shape of the vignette. +Setting this value to the SAR of the input will make a rectangular vignetting +following the dimensions of the video. +

+

Default is 1/1. +

+
+ + +
+

30.276.1 Expressions

+ +

The alpha, x0 and y0 expressions can contain the +following parameters. +

+
+
w
+
h
+

input width and height +

+
+
n
+

the number of input frame, starting from 0 +

+
+
pts
+

the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in +TB units, NAN if undefined +

+
+
r
+

frame rate of the input video, NAN if the input frame rate is unknown +

+
+
t
+

the PTS (Presentation TimeStamp) of the filtered video frame, +expressed in seconds, NAN if undefined +

+
+
tb
+

time base of the input video +

+
+ + +
+
+

30.276.2 Examples

+ +
    +
  • Apply simple strong vignetting effect: +
    +
    vignette=PI/4
    +
    + +
  • Make a flickering vignetting: +
    +
    vignette='PI/4+random(1)*PI/50':eval=frame
    +
    + +
+ +
+
+
+

30.277 vmafmotion

+ +

Obtain the average VMAF motion score of a video. +It is one of the component metrics of VMAF. +

+

The obtained average motion score is printed through the logging system. +

+

The filter accepts the following options: +

+
+
stats_file
+

If specified, the filter will use the named file to save the motion score of +each frame with respect to the previous frame. +When filename equals "-" the data is sent to standard output. +

+
+ +

Example: +

+
ffmpeg -i ref.mpg -vf vmafmotion -f null -
+
+ +
+
+

30.278 vstack

+

Stack input videos vertically. +

+

All streams must be of same pixel format and of same width. +

+

Note that this filter is faster than using overlay and pad filter +to create same output. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of input streams. Default is 2. +

+
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+ +
+
+

30.279 w3fdif

+ +

Deinterlace the input video ("w3fdif" stands for "Weston 3 Field +Deinterlacing Filter"). +

+

Based on the process described by Martin Weston for BBC R&D, and +implemented based on the de-interlace algorithm written by Jim +Easterbrook for BBC R&D, the Weston 3 field deinterlacing filter +uses filter coefficients calculated by BBC R&D. +

+

This filter uses field-dominance information in frame to decide which +of each pair of fields to place first in the output. +If it gets it wrong use setfield filter before w3fdif filter. +

+

There are two sets of filter coefficients, so called "simple" +and "complex". Which set of filter coefficients is used can +be set by passing an optional parameter: +

+
+
filter
+

Set the interlacing filter coefficients. Accepts one of the following values: +

+
+
simple
+

Simple filter coefficient set. +

+
complex
+

More-complex filter coefficient set. +

+
+

Default value is ‘complex’. +

+
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
frame
+

Output one frame for each frame. +

+
field
+

Output one frame for each field. +

+
+ +

The default value is field. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
tff
+

Assume the top field is first. +

+
bff
+

Assume the bottom field is first. +

+
auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following values: +

+
+
all
+

Deinterlace all frames, +

+
interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

Default value is ‘all’. +

+
+ + +
+

30.279.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

30.280 waveform

+

Video waveform monitor. +

+

The waveform monitor plots color component intensity. By default luminance +only. Each column of the waveform corresponds to a column of pixels in the +source video. +

+

It accepts the following options: +

+
+
mode, m
+

Can be either row, or column. Default is column. +In row mode, the graph on the left side represents color component value 0 and +the right side represents value = 255. In column mode, the top side represents +color component value = 0 and bottom side represents value = 255. +

+
+
intensity, i
+

Set intensity. Smaller values are useful to find out how many values of the same +luminance are distributed across input rows/columns. +Default value is 0.04. Allowed range is [0, 1]. +

+
+
mirror, r
+

Set mirroring mode. 0 means unmirrored, 1 means mirrored. +In mirrored mode, higher values will be represented on the left +side for row mode and at the top for column mode. Default is +1 (mirrored). +

+
+
display, d
+

Set display mode. +It accepts the following values: +

+
overlay
+

Presents information identical to that in the parade, except +that the graphs representing color components are superimposed directly +over one another. +

+

This display mode makes it easier to spot relative differences or similarities +in overlapping areas of the color components that are supposed to be identical, +such as neutral whites, grays, or blacks. +

+
+
stack
+

Display separate graph for the color components side by side in +row mode or one below the other in column mode. +

+
+
parade
+

Display separate graph for the color components side by side in +column mode or one below the other in row mode. +

+

Using this display mode makes it easy to spot color casts in the highlights +and shadows of an image, by comparing the contours of the top and the bottom +graphs of each waveform. Since whites, grays, and blacks are characterized +by exactly equal amounts of red, green, and blue, neutral areas of the picture +should display three waveforms of roughly equal width/height. If not, the +correction is easy to perform by making level adjustments the three waveforms. +

+
+

Default is stack. +

+
+
components, c
+

Set which color components to display. Default is 1, which means only luminance +or red color component if input is in RGB colorspace. If is set for example to +7 it will display all 3 (if) available color components. +

+
+
envelope, e
+
+
none
+

No envelope, this is default. +

+
+
instant
+

Instant envelope, minimum and maximum values presented in graph will be easily +visible even with small step value. +

+
+
peak
+

Hold minimum and maximum values presented in graph across time. This way you +can still spot out of range values without constantly looking at waveforms. +

+
+
peak+instant
+

Peak and instant envelope combined together. +

+
+ +
+
filter, f
+
+
lowpass
+

No filtering, this is default. +

+
+
flat
+

Luma and chroma combined together. +

+
+
aflat
+

Similar as above, but shows difference between blue and red chroma. +

+
+
xflat
+

Similar as above, but use different colors. +

+
+
yflat
+

Similar as above, but again with different colors. +

+
+
chroma
+

Displays only chroma. +

+
+
color
+

Displays actual color value on waveform. +

+
+
acolor
+

Similar as above, but with luma showing frequency of chroma values. +

+
+ +
+
graticule, g
+

Set which graticule to display. +

+
+
none
+

Do not display graticule. +

+
+
green
+

Display green graticule showing legal broadcast ranges. +

+
+
orange
+

Display orange graticule showing legal broadcast ranges. +

+
+
invert
+

Display invert graticule showing legal broadcast ranges. +

+
+ +
+
opacity, o
+

Set graticule opacity. +

+
+
flags, fl
+

Set graticule flags. +

+
+
numbers
+

Draw numbers above lines. By default enabled. +

+
+
dots
+

Draw dots instead of lines. +

+
+ +
+
scale, s
+

Set scale used for displaying graticule. +

+
+
digital
+
millivolts
+
ire
+
+

Default is digital. +

+
+
bgopacity, b
+

Set background opacity. +

+
+
tint0, t0
+
tint1, t1
+

Set tint for output. +Only used with lowpass filter and when display is not overlay and input +pixel formats are not RGB. +

+
+
fitmode, fm
+

Set sample aspect ratio of video output frames. +Can be used to configure waveform so it is not +streched too much in one of directions. +

+
+
none
+

Set sample aspect ration to 1/1. +

+
size
+

Set sample aspect ratio to match input size of video +

+
+

Default is ‘none’. +

+
+
input
+

Set input formats for filter to pick from. +Can be ‘all’, for selecting from all available formats, +or ‘first’, for selecting first available format. +Default is ‘first’. +

+
+ +
+
+

30.281 weave, doubleweave

+ +

The weave takes a field-based video input and join +each two sequential fields into single frame, producing a new double +height clip with half the frame rate and half the frame count. +

+

The doubleweave works same as weave but without +halving frame rate and frame count. +

+

It accepts the following option: +

+
+
first_field
+

Set first field. Available values are: +

+
+
top, t
+

Set the frame as top-field-first. +

+
+
bottom, b
+

Set the frame as bottom-field-first. +

+
+
+
+ + +
+

30.281.1 Examples

+ +
    +
  • Interlace video using select and separatefields filter: +
    +
    separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
    +
    +
+ +
+
+
+

30.282 xbr

+

Apply the xBR high-quality magnification filter which is designed for pixel +art. It follows a set of edge-detection rules, see +https://forums.libretro.com/t/xbr-algorithm-tutorial/123. +

+

It accepts the following option: +

+
+
n
+

Set the scaling dimension: 2 for 2xBR, 3 for +3xBR and 4 for 4xBR. +Default is 3. +

+
+ +
+
+

30.283 xcorrelate

+

Apply normalized cross-correlation between first and second input video stream. +

+

Second input video stream dimensions must be lower than first input video stream. +

+

The filter accepts the following options: +

+
+
planes
+

Set which planes to process. +

+
+
secondary
+

Set which secondary video frames will be processed from second input video stream, +can be first or all. Default is all. +

+
+ +

The xcorrelate filter also supports the framesync options. +

+
+
+

30.284 xfade

+ +

Apply cross fade from one input video stream to another input video stream. +The cross fade is applied for specified duration. +

+

Both inputs must be constant frame-rate and have the same resolution, pixel format, +frame rate and timebase. +

+

The filter accepts the following options: +

+
+
transition
+

Set one of available transition effects: +

+
+
custom
+
fade
+
wipeleft
+
wiperight
+
wipeup
+
wipedown
+
slideleft
+
slideright
+
slideup
+
slidedown
+
circlecrop
+
rectcrop
+
distance
+
fadeblack
+
fadewhite
+
radial
+
smoothleft
+
smoothright
+
smoothup
+
smoothdown
+
circleopen
+
circleclose
+
vertopen
+
vertclose
+
horzopen
+
horzclose
+
dissolve
+
pixelize
+
diagtl
+
diagtr
+
diagbl
+
diagbr
+
hlslice
+
hrslice
+
vuslice
+
vdslice
+
hblur
+
fadegrays
+
wipetl
+
wipetr
+
wipebl
+
wipebr
+
squeezeh
+
squeezev
+
zoomin
+
fadefast
+
fadeslow
+
hlwind
+
hrwind
+
vuwind
+
vdwind
+
+

Default transition effect is fade. +

+
+
duration
+

Set cross fade duration in seconds. +Range is 0 to 60 seconds. +Default duration is 1 second. +

+
+
offset
+

Set cross fade start relative to first input stream in seconds. +Default offset is 0. +

+
+
expr
+

Set expression for custom transition effect. +

+

The expressions can use the following variables and functions: +

+
+
X
+
Y
+

The coordinates of the current sample. +

+
+
W
+
H
+

The width and height of the image. +

+
+
P
+

Progress of transition effect. +

+
+
PLANE
+

Currently processed plane. +

+
+
A
+

Return value of first input at current location and plane. +

+
+
B
+

Return value of second input at current location and plane. +

+
+
a0(x, y)
+
a1(x, y)
+
a2(x, y)
+
a3(x, y)
+

Return the value of the pixel at location (x,y) of the +first/second/third/fourth component of first input. +

+
+
b0(x, y)
+
b1(x, y)
+
b2(x, y)
+
b3(x, y)
+

Return the value of the pixel at location (x,y) of the +first/second/third/fourth component of second input. +

+
+
+
+ + +
+

30.284.1 Examples

+ +
    +
  • Cross fade from one input video to another input video, with fade transition and duration of transition +of 2 seconds starting at offset of 5 seconds: +
    +
    ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
    +
    +
+ +
+
+
+

30.285 xmedian

+

Pick median pixels from several input videos. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of inputs. +Default is 3. Allowed range is from 3 to 255. +If number of inputs is even number, than result will be mean value between two median values. +

+
+
planes
+

Set which planes to filter. Default value is 15, by which all planes are processed. +

+
+
percentile
+

Set median percentile. Default value is 0.5. +Default value of 0.5 will pick always median values, while 0 will pick +minimum values, and 1 maximum values. +

+
+ + +
+

30.285.1 Commands

+ +

This filter supports all above options as commands, excluding option inputs. +

+
+
+
+

30.286 xstack

+

Stack video inputs into custom layout. +

+

All streams must be of same pixel format. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of input streams. Default is 2. +

+
+
layout
+

Specify layout of inputs. +This option requires the desired layout configuration to be explicitly set by the user. +This sets position of each video input in output. Each input +is separated by ’|’. +The first number represents the column, and the second number represents the row. +Numbers start at 0 and are separated by ’_’. Optionally one can use wX and hX, +where X is video input from which to take width or height. +Multiple values can be used when separated by ’+’. In such +case values are summed together. +

+

Note that if inputs are of different sizes gaps may appear, as not all of +the output video frame will be filled. Similarly, videos can overlap each +other if their position doesn’t leave enough space for the full frame of +adjoining videos. +

+

For 2 inputs, a default layout of 0_0|w0_0 (equivalent to +grid=2x1) is set. In all other cases, a layout or a grid must be set by +the user. Either grid or layout can be specified at a time. +Specifying both will result in an error. +

+
+
grid
+

Specify a fixed size grid of inputs. +This option is used to create a fixed size grid of the input streams. Set the +grid size in the form COLUMNSxROWS. There must be ROWS * COLUMNS +input streams and they will be arranged as a grid with ROWS rows and +COLUMNS columns. When using this option, each input stream within a row +must have the same height and all the rows must have the same width. +

+

If grid is set, then inputs option is ignored and is implicitly +set to ROWS * COLUMNS. +

+

For 2 inputs, a default grid of 2x1 (equivalent to +layout=0_0|w0_0) is set. In all other cases, a layout or a grid must be +set by the user. Either grid or layout can be specified at a time. +Specifying both will result in an error. +

+
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+
fill
+

If set to valid color, all unused pixels will be filled with that color. +By default fill is set to none, so it is disabled. +

+
+ + +
+

30.286.1 Examples

+ +
    +
  • Display 4 inputs into 2x2 grid. + +

    Layout: +

    +
    input1(0, 0)  | input3(w0, 0)
    +input2(0, h0) | input4(w0, h0)
    +
    + +
    +
    xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
    +
    + +

    Note that if inputs are of different sizes, gaps or overlaps may occur. +

    +
  • Display 4 inputs into 1x4 grid. + +

    Layout: +

    +
    input1(0, 0)
    +input2(0, h0)
    +input3(0, h0+h1)
    +input4(0, h0+h1+h2)
    +
    + +
    +
    xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
    +
    + +

    Note that if inputs are of different widths, unused space will appear. +

    +
  • Display 9 inputs into 3x3 grid. + +

    Layout: +

    +
    input1(0, 0)       | input4(w0, 0)      | input7(w0+w3, 0)
    +input2(0, h0)      | input5(w0, h0)     | input8(w0+w3, h0)
    +input3(0, h0+h1)   | input6(w0, h0+h1)  | input9(w0+w3, h0+h1)
    +
    + +
    +
    xstack=inputs=9:layout=0_0|0_h0|0_h0+h1|w0_0|w0_h0|w0_h0+h1|w0+w3_0|w0+w3_h0|w0+w3_h0+h1
    +
    + +

    Note that if inputs are of different sizes, gaps or overlaps may occur. +

    +
  • Display 16 inputs into 4x4 grid. + +

    Layout: +

    +
    input1(0, 0)       | input5(w0, 0)       | input9 (w0+w4, 0)       | input13(w0+w4+w8, 0)
    +input2(0, h0)      | input6(w0, h0)      | input10(w0+w4, h0)      | input14(w0+w4+w8, h0)
    +input3(0, h0+h1)   | input7(w0, h0+h1)   | input11(w0+w4, h0+h1)   | input15(w0+w4+w8, h0+h1)
    +input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
    +
    + +
    +
    xstack=inputs=16:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0+w4_0|
    +w0+w4_h0|w0+w4_h0+h1|w0+w4_h0+h1+h2|w0+w4+w8_0|w0+w4+w8_h0|w0+w4+w8_h0+h1|w0+w4+w8_h0+h1+h2
    +
    + +

    Note that if inputs are of different sizes, gaps or overlaps may occur. +

    +
+ +
+
+
+

30.287 yadif

+ +

Deinterlace the input video ("yadif" means "yet another deinterlacing +filter"). +

+

It accepts the following parameters: +

+ +
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
0, send_frame
+

Output one frame for each frame. +

+
1, send_field
+

Output one frame for each field. +

+
2, send_frame_nospatial
+

Like send_frame, but it skips the spatial interlacing check. +

+
3, send_field_nospatial
+

Like send_field, but it skips the spatial interlacing check. +

+
+ +

The default value is send_frame. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
0, tff
+

Assume the top field is first. +

+
1, bff
+

Assume the bottom field is first. +

+
-1, auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
0, all
+

Deinterlace all frames. +

+
1, interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+ +
+
+

30.288 yadif_cuda

+ +

Deinterlace the input video using the yadif algorithm, but implemented +in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec +and/or nvenc. +

+

It accepts the following parameters: +

+ +
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
0, send_frame
+

Output one frame for each frame. +

+
1, send_field
+

Output one frame for each field. +

+
2, send_frame_nospatial
+

Like send_frame, but it skips the spatial interlacing check. +

+
3, send_field_nospatial
+

Like send_field, but it skips the spatial interlacing check. +

+
+ +

The default value is send_frame. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
0, tff
+

Assume the top field is first. +

+
1, bff
+

Assume the bottom field is first. +

+
-1, auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
0, all
+

Deinterlace all frames. +

+
1, interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+ +
+
+

30.289 yaepblur

+ +

Apply blur filter while preserving edges ("yaepblur" means "yet another edge preserving blur filter"). +The algorithm is described in +"J. S. Lee, Digital image enhancement and noise filtering by use of local statistics, IEEE Trans. Pattern Anal. Mach. Intell. PAMI-2, 1980." +

+

It accepts the following parameters: +

+
+
radius, r
+

Set the window radius. Default value is 3. +

+
+
planes, p
+

Set which planes to filter. Default is only the first plane. +

+
+
sigma, s
+

Set blur strength. Default value is 128. +

+
+ + +
+

30.289.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

30.290 zoompan

+ +

Apply Zoom & Pan effect. +

+

This filter accepts the following options: +

+
+
zoom, z
+

Set the zoom expression. Range is 1-10. Default is 1. +

+
+
x
+
y
+

Set the x and y expression. Default is 0. +

+
+
d
+

Set the duration expression in number of frames. +This sets for how many number of frames effect will last for +single input image. Default is 90. +

+
+
s
+

Set the output image size, default is ’hd720’. +

+
+
fps
+

Set the output frame rate, default is ’25’. +

+
+ +

Each expression can contain the following constants: +

+
+
in_w, iw
+

Input width. +

+
+
in_h, ih
+

Input height. +

+
+
out_w, ow
+

Output width. +

+
+
out_h, oh
+

Output height. +

+
+
in
+

Input frame count. +

+
+
on
+

Output frame count. +

+
+
in_time, it
+

The input timestamp expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
out_time, time, ot
+

The output timestamp expressed in seconds. +

+
+
x
+
y
+

Last calculated ’x’ and ’y’ position from ’x’ and ’y’ expression +for current input frame. +

+
+
px
+
py
+

’x’ and ’y’ of last output frame of previous input frame or 0 when there was +not yet such frame (first input frame). +

+
+
zoom
+

Last calculated zoom from ’z’ expression for current input frame. +

+
+
pzoom
+

Last calculated zoom of last output frame of previous input frame. +

+
+
duration
+

Number of output frames for current input frame. Calculated from ’d’ expression +for each input frame. +

+
+
pduration
+

number of output frames created for previous input frame +

+
+
a
+

Rational number: input width / input height +

+
+
sar
+

sample aspect ratio +

+
+
dar
+

display aspect ratio +

+
+
+ + +
+

30.290.1 Examples

+ +
    +
  • Zoom in up to 1.5x and pan at same time to some spot near center of picture: +
    +
    zoompan=z='min(zoom+0.0015,1.5)':d=700:x='if(gte(zoom,1.5),x,x+1/a)':y='if(gte(zoom,1.5),y,y+1)':s=640x360
    +
    + +
  • Zoom in up to 1.5x and pan always at center of picture: +
    +
    zoompan=z='min(zoom+0.0015,1.5)':d=700:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
    +
    + +
  • Same as above but without pausing: +
    +
    zoompan=z='min(max(zoom,pzoom)+0.0015,1.5)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
    +
    + +
  • Zoom in 2x into center of picture only for the first second of the input video: +
    +
    zoompan=z='if(between(in_time,0,1),2,1)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
    +
    + +
+ +
+
+
+

30.291 zscale

+

Scale (resize) the input video, using the z.lib library: +https://github.com/sekrit-twc/zimg. To enable compilation of this +filter, you need to configure FFmpeg with --enable-libzimg. +

+

The zscale filter forces the output display aspect ratio to be the same +as the input, by changing the output sample aspect ratio. +

+

If the input image format is different from the format requested by +the next filter, the zscale filter will convert the input to the +requested format. +

+ +
+

30.291.1 Options

+

The filter accepts the following options. +

+
+
width, w
+
height, h
+

Set the output video dimension expression. Default value is the input +dimension. +

+

If the width or w value is 0, the input width is used for +the output. If the height or h value is 0, the input height +is used for the output. +

+

If one and only one of the values is -n with n >= 1, the zscale filter +will use a value that maintains the aspect ratio of the input image, +calculated from the other specified dimension. After that it will, +however, make sure that the calculated dimension is divisible by n and +adjust the value if necessary. +

+

If both values are -n with n >= 1, the behavior will be identical to +both values being set to 0 as previously detailed. +

+

See below for the list of accepted constants for use in the dimension +expression. +

+
+
size, s
+

Set the video size. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
dither, d
+

Set the dither type. +

+

Possible values are: +

+
none
+
ordered
+
random
+
error_diffusion
+
+ +

Default is none. +

+
+
filter, f
+

Set the resize filter type. +

+

Possible values are: +

+
point
+
bilinear
+
bicubic
+
spline16
+
spline36
+
lanczos
+
+ +

Default is bilinear. +

+
+
range, r
+

Set the color range. +

+

Possible values are: +

+
input
+
limited
+
full
+
+ +

Default is same as input. +

+
+
primaries, p
+

Set the color primaries. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
170m
+
240m
+
2020
+
+ +

Default is same as input. +

+
+
transfer, t
+

Set the transfer characteristics. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
601
+
linear
+
2020_10
+
2020_12
+
smpte2084
+
iec61966-2-1
+
arib-std-b67
+
+ +

Default is same as input. +

+
+
matrix, m
+

Set the colorspace matrix. +

+

Possible value are: +

+
input
+
709
+
unspecified
+
470bg
+
170m
+
2020_ncl
+
2020_cl
+
+ +

Default is same as input. +

+
+
rangein, rin
+

Set the input color range. +

+

Possible values are: +

+
input
+
limited
+
full
+
+ +

Default is same as input. +

+
+
primariesin, pin
+

Set the input color primaries. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
170m
+
240m
+
2020
+
+ +

Default is same as input. +

+
+
transferin, tin
+

Set the input transfer characteristics. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
601
+
linear
+
2020_10
+
2020_12
+
+ +

Default is same as input. +

+
+
matrixin, min
+

Set the input colorspace matrix. +

+

Possible value are: +

+
input
+
709
+
unspecified
+
470bg
+
170m
+
2020_ncl
+
2020_cl
+
+ +
+
chromal, c
+

Set the output chroma location. +

+

Possible values are: +

+
input
+
left
+
center
+
topleft
+
top
+
bottomleft
+
bottom
+
+ +
+
chromalin, cin
+

Set the input chroma location. +

+

Possible values are: +

+
input
+
left
+
center
+
topleft
+
top
+
bottomleft
+
bottom
+
+ +
+
npl
+

Set the nominal peak luminance. +

+
+
param_a
+

Parameter A for scaling filters. Parameter "b" for bicubic, and the number of +filter taps for lanczos. +

+
+
param_b
+

Parameter B for scaling filters. Parameter "c" for bicubic. +

+
+ +

The values of the w and h options are expressions +containing the following constants: +

+
+
in_w
+
in_h
+

The input width and height +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (scaled) width and height +

+
+
ow
+
oh
+

These are the same as out_w and out_h +

+
+
a
+

The same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

The input display aspect ratio. Calculated from (iw / ih) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical input chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
ohsub
+
ovsub
+

horizontal and vertical output chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ +
+
+

30.291.2 Commands

+ +

This filter supports the following commands: +

+
width, w
+
height, h
+

Set the output video dimension expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ + +
+
+
+
+

31 OpenCL Video Filters

+ +

Below is a description of the currently available OpenCL video filters. +

+

To enable compilation of these filters you need to configure FFmpeg with +--enable-opencl. +

+

Running OpenCL filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph. +

+
-init_hw_device opencl[=name][:device[,key=value...]]
+

Initialise a new hardware device of type opencl called name, using the +given device parameters. +

+
+
-filter_hw_device name
+

Pass the hardware device called name to all filters in any filter graph. +

+
+
+ +

For more detailed information see https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options +

+
    +
  • Example of choosing the first device on the second platform and running avgblur_opencl filter with default parameters on it. +
    +
    -init_hw_device opencl=gpu:1.0 -filter_hw_device gpu -i INPUT -vf "hwupload, avgblur_opencl, hwdownload" OUTPUT
    +
    +
+ +

Since OpenCL filters are not able to access frame data in normal memory, all frame data needs to be uploaded(hwupload) to hardware surfaces connected to the appropriate device before being used and then downloaded(hwdownload) back to normal memory. Note that hwupload will upload to a surface with the same layout as the software frame, so it may be necessary to add a format filter immediately before to get the input into the right format and hwdownload does not support all formats on the output - it may be necessary to insert an additional format filter immediately following in the graph to get the output in a supported format. +

+ +
+

31.1 avgblur_opencl

+ +

Apply average blur filter. +

+

The filter accepts the following options: +

+
+
sizeX
+

Set horizontal radius size. +Range is [1, 1024] and default value is 1. +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
sizeY
+

Set vertical radius size. Range is [1, 1024] and default value is 0. If zero, sizeX value will be used. +

+
+ + +
+

31.1.1 Example

+ +
    +
  • Apply average blur filter with horizontal and vertical size of 3, setting each pixel of the output to the average value of the 7x7 region centered on it in the input. For pixels on the edges of the image, the region does not extend beyond the image boundaries, and so out-of-range coordinates are not used in the calculations. +
    +
    -i INPUT -vf "hwupload, avgblur_opencl=3, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

31.2 boxblur_opencl

+ +

Apply a boxblur algorithm to the input video. +

+

It accepts the following parameters: +

+
+
luma_radius, lr
+
luma_power, lp
+
chroma_radius, cr
+
chroma_power, cp
+
alpha_radius, ar
+
alpha_power, ap
+
+ +

A description of the accepted options follows. +

+
+
luma_radius, lr
+
chroma_radius, cr
+
alpha_radius, ar
+

Set an expression for the box radius in pixels used for blurring the +corresponding input plane. +

+

The radius value must be a non-negative number, and must not be +greater than the value of the expression min(w,h)/2 for the +luma and alpha planes, and of min(cw,ch)/2 for the chroma +planes. +

+

Default value for luma_radius is "2". If not specified, +chroma_radius and alpha_radius default to the +corresponding value set for luma_radius. +

+

The expressions can contain the following constants: +

+
w
+
h
+

The input width and height in pixels. +

+
+
cw
+
ch
+

The input chroma image width and height in pixels. +

+
+
hsub
+
vsub
+

The horizontal and vertical chroma subsample values. For example, for the +pixel format "yuv422p", hsub is 2 and vsub is 1. +

+
+ +
+
luma_power, lp
+
chroma_power, cp
+
alpha_power, ap
+

Specify how many times the boxblur filter is applied to the +corresponding plane. +

+

Default value for luma_power is 2. If not specified, +chroma_power and alpha_power default to the +corresponding value set for luma_power. +

+

A value of 0 will disable the effect. +

+
+ + +
+

31.2.1 Examples

+ +

Apply boxblur filter, setting each pixel of the output to the average value of box-radiuses luma_radius, chroma_radius, alpha_radius for each plane respectively. The filter will apply luma_power, chroma_power, alpha_power times onto the corresponding plane. For pixels on the edges of the image, the radius does not extend beyond the image boundaries, and so out-of-range coordinates are not used in the calculations. +

+
    +
  • Apply a boxblur filter with the luma, chroma, and alpha radius +set to 2 and luma, chroma, and alpha power set to 3. The filter will run 3 times with box-radius set to 2 for every plane of the image. +
    +
    -i INPUT -vf "hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload" OUTPUT
    +-i INPUT -vf "hwupload, boxblur_opencl=2:3, hwdownload" OUTPUT
    +
    + +
  • Apply a boxblur filter with luma radius set to 2, luma_power to 1, chroma_radius to 4, chroma_power to 5, alpha_radius to 3 and alpha_power to 7. + +

    For the luma plane, a 2x2 box radius will be run once. +

    +

    For the chroma plane, a 4x4 box radius will be run 5 times. +

    +

    For the alpha plane, a 3x3 box radius will be run 7 times. +

    +
    -i INPUT -vf "hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

31.3 colorkey_opencl

+

RGB colorspace color keying. +

+

The filter accepts the following options: +

+
+
color
+

The color which will be replaced with transparency. +

+
+
similarity
+

Similarity percentage with the key color. +

+

0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +

+

0.0 makes pixels either fully transparent, or not transparent at all. +

+

Higher values result in semi-transparent pixels, with a higher transparency +the more similar the pixels color is to the key color. +

+
+ + +
+

31.3.1 Examples

+ +
    +
  • Make every semi-green pixel in the input transparent with some slight blending: +
    +
    -i INPUT -vf "hwupload, colorkey_opencl=green:0.3:0.1, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

31.4 convolution_opencl

+ +

Apply convolution of 3x3, 5x5, 7x7 matrix. +

+

The filter accepts the following options: +

+
+
0m
+
1m
+
2m
+
3m
+

Set matrix for each plane. +Matrix is sequence of 9, 25 or 49 signed numbers. +Default value for each plane is 0 0 0 0 1 0 0 0 0. +

+
+
0rdiv
+
1rdiv
+
2rdiv
+
3rdiv
+

Set multiplier for calculated value for each plane. +If unset or 0, it will be sum of all matrix elements. +The option value must be a float number greater or equal to 0.0. Default value is 1.0. +

+
+
0bias
+
1bias
+
2bias
+
3bias
+

Set bias for each plane. This value is added to the result of the multiplication. +Useful for making the overall image brighter or darker. +The option value must be a float number greater or equal to 0.0. Default value is 0.0. +

+
+
+ + +
+

31.4.1 Examples

+ +
    +
  • Apply sharpen: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0, hwdownload" OUTPUT
    +
    + +
  • Apply blur: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9, hwdownload" OUTPUT
    +
    + +
  • Apply edge enhance: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128, hwdownload" OUTPUT
    +
    + +
  • Apply edge detect: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128, hwdownload" OUTPUT
    +
    + +
  • Apply laplacian edge detector which includes diagonals: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0, hwdownload" OUTPUT
    +
    + +
  • Apply emboss: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

31.5 erosion_opencl

+ +

Apply erosion effect to the video. +

+

This filter replaces the pixel by the local(3x3) minimum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane. Range is [0, 65535] and default value is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. +Range is [0, 255] and default value is 255, i.e. all eight pixels are used. +

+

Flags to local 3x3 coordinates region centered on x: +

+

1 2 3 +

+

4 x 5 +

+

6 7 8 +

+
+ + +
+

31.5.1 Example

+ +
    +
  • Apply erosion filter with threshold0 set to 30, threshold1 set 40, threshold2 set to 50 and coordinates set to 231, setting each pixel of the output to the local minimum between pixels: 1, 2, 3, 6, 7, 8 of the 3x3 region centered on it in the input. If the difference between input pixel and local minimum is more then threshold of the corresponding plane, output pixel will be set to input pixel - threshold of corresponding plane. +
    +
    -i INPUT -vf "hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

31.6 deshake_opencl

+

Feature-point based video stabilization filter. +

+

The filter accepts the following options: +

+
+
tripod
+

Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to 0. +

+
+
debug
+

Whether or not additional debug info should be displayed, both in the processed output and in the console. +

+

Note that in order to see console debug output you will also need to pass -v verbose to ffmpeg. +

+

Viewing point matches in the output video is only supported for RGB input. +

+

Defaults to 0. +

+
+
adaptive_crop
+

Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels. +

+

Defaults to 1. +

+
+
refine_features
+

Whether or not feature points should be refined at a sub-pixel level. +

+

This can be turned off for a slight performance gain at the cost of precision. +

+

Defaults to 1. +

+
+
smooth_strength
+

The strength of the smoothing applied to the camera path from 0.0 to 1.0. +

+

1.0 is the maximum smoothing strength while values less than that result in less smoothing. +

+

0.0 causes the filter to adaptively choose a smoothing strength on a per-frame basis. +

+

Defaults to 0.0. +

+
+
smooth_window_multiplier
+

Controls the size of the smoothing window (the number of frames buffered to determine motion information from). +

+

The size of the smoothing window is determined by multiplying the framerate of the video by this number. +

+

Acceptable values range from 0.1 to 10.0. +

+

Larger values increase the amount of motion data available for determining how to smooth the camera path, +potentially improving smoothness, but also increase latency and memory usage. +

+

Defaults to 2.0. +

+
+
+ + +
+

31.6.1 Examples

+ +
    +
  • Stabilize a video with a fixed, medium smoothing strength: +
    +
    -i INPUT -vf "hwupload, deshake_opencl=smooth_strength=0.5, hwdownload" OUTPUT
    +
    + +
  • Stabilize a video with debugging (both in console and in rendered video): +
    +
    -i INPUT -filter_complex "[0:v]format=rgba, hwupload, deshake_opencl=debug=1, hwdownload, format=rgba, format=yuv420p" -v verbose OUTPUT
    +
    +
+ +
+
+
+

31.7 dilation_opencl

+ +

Apply dilation effect to the video. +

+

This filter replaces the pixel by the local(3x3) maximum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane. Range is [0, 65535] and default value is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. +Range is [0, 255] and default value is 255, i.e. all eight pixels are used. +

+

Flags to local 3x3 coordinates region centered on x: +

+

1 2 3 +

+

4 x 5 +

+

6 7 8 +

+
+ + +
+

31.7.1 Example

+ +
    +
  • Apply dilation filter with threshold0 set to 30, threshold1 set 40, threshold2 set to 50 and coordinates set to 231, setting each pixel of the output to the local maximum between pixels: 1, 2, 3, 6, 7, 8 of the 3x3 region centered on it in the input. If the difference between input pixel and local maximum is more then threshold of the corresponding plane, output pixel will be set to input pixel + threshold of corresponding plane. +
    +
    -i INPUT -vf "hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

31.8 nlmeans_opencl

+ +

Non-local Means denoise filter through OpenCL, this filter accepts same options as nlmeans. +

+
+
+

31.9 overlay_opencl

+ +

Overlay one video on top of another. +

+

It takes two inputs and has one output. The first input is the "main" video on which the second input is overlaid. +This filter requires same memory layout for all the inputs. So, format conversion may be needed. +

+

The filter accepts the following options: +

+
+
x
+

Set the x coordinate of the overlaid video on the main video. +Default value is 0. +

+
+
y
+

Set the y coordinate of the overlaid video on the main video. +Default value is 0. +

+
+
+ + +
+

31.9.1 Examples

+ +
    +
  • Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs are yuv420p format. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_opencl, hwdownload" OUTPUT
    +
    +
  • The inputs have same memory layout for color channels , the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_opencl, hwdownload" OUTPUT
    +
    + +
+ +
+
+
+

31.10 pad_opencl

+ +

Add paddings to the input image, and place the original input at the +provided x, y coordinates. +

+

It accepts the following options: +

+
+
width, w
+
height, h
+

Specify an expression for the size of the output image with the +paddings added. If the value for width or height is 0, the +corresponding input size is used for the output. +

+

The width expression can reference the value set by the +height expression, and vice versa. +

+

The default value of width and height is 0. +

+
+
x
+
y
+

Specify the offsets to place the input image at within the padded area, +with respect to the top/left border of the output image. +

+

The x expression can reference the value set by the y +expression, and vice versa. +

+

The default value of x and y is 0. +

+

If x or y evaluate to a negative number, they’ll be changed +so the input image is centered on the padded area. +

+
+
color
+

Specify the color of the padded area. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. +

+
+
aspect
+

Pad to an aspect instead to a resolution. +

+
+ +

The value for the width, height, x, and y +options are expressions containing the following constants: +

+
+
in_w
+
in_h
+

The input video width and height. +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output width and height (the size of the padded area), as +specified by the width and height expressions. +

+
+
ow
+
oh
+

These are the same as out_w and out_h. +

+
+
x
+
y
+

The x and y offsets as specified by the x and y +expressions, or NAN if not yet specified. +

+
+
a
+

same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (iw / ih) * sar +

+
+ +
+
+

31.11 prewitt_opencl

+ +

Apply the Prewitt operator (https://en.wikipedia.org/wiki/Prewitt_operator) to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +Range is [0.0, 65535] and default value is 1.0. +

+
+
delta
+

Set value which will be added to filtered result. +Range is [-65535, 65535] and default value is 0.0. +

+
+ + +
+

31.11.1 Example

+ +
    +
  • Apply the Prewitt operator with scale set to 2 and delta set to 10. +
    +
    -i INPUT -vf "hwupload, prewitt_opencl=scale=2:delta=10, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

31.12 program_opencl

+ +

Filter video using an OpenCL program. +

+
+
source
+

OpenCL program source file. +

+
+
kernel
+

Kernel name in program. +

+
+
inputs
+

Number of inputs to the filter. Defaults to 1. +

+
+
size, s
+

Size of output frames. Defaults to the same as the first input. +

+
+
+ +

The program_opencl filter also supports the framesync options. +

+

The program source file must contain a kernel function with the given name, +which will be run once for each plane of the output. Each run on a plane +gets enqueued as a separate 2D global NDRange with one work-item for each +pixel to be generated. The global ID offset for each work-item is therefore +the coordinates of a pixel in the destination image. +

+

The kernel function needs to take the following arguments: +

    +
  • Destination image, __write_only image2d_t. + +

    This image will become the output; the kernel should write all of it. +

  • Frame index, unsigned int. + +

    This is a counter starting from zero and increasing by one for each frame. +

  • Source images, __read_only image2d_t. + +

    These are the most recent images on each input. The kernel may read from +them to generate the output, but they can’t be written to. +

+ +

Example programs: +

+
    +
  • Copy the input to the output (output must be the same size as the input). +
    __kernel void copy(__write_only image2d_t destination,
    +                   unsigned int index,
    +                   __read_only  image2d_t source)
    +{
    +    const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
    +
    +    int2 location = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float4 value = read_imagef(source, sampler, location);
    +
    +    write_imagef(destination, location, value);
    +}
    +
    +
  • Apply a simple transformation, rotating the input by an amount increasing +with the index counter. Pixel values are linearly interpolated by the +sampler, and the output need not have the same dimensions as the input. +
    __kernel void rotate_image(__write_only image2d_t dst,
    +                           unsigned int index,
    +                           __read_only  image2d_t src)
    +{
    +    const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
    +                               CLK_FILTER_LINEAR);
    +
    +    float angle = (float)index / 100.0f;
    +
    +    float2 dst_dim = convert_float2(get_image_dim(dst));
    +    float2 src_dim = convert_float2(get_image_dim(src));
    +
    +    float2 dst_cen = dst_dim / 2.0f;
    +    float2 src_cen = src_dim / 2.0f;
    +
    +    int2   dst_loc = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float2 dst_pos = convert_float2(dst_loc) - dst_cen;
    +    float2 src_pos = {
    +        cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
    +        sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
    +    };
    +    src_pos = src_pos * src_dim / dst_dim;
    +
    +    float2 src_loc = src_pos + src_cen;
    +
    +    if (src_loc.x < 0.0f      || src_loc.y < 0.0f ||
    +        src_loc.x > src_dim.x || src_loc.y > src_dim.y)
    +        write_imagef(dst, dst_loc, 0.5f);
    +    else
    +        write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
    +}
    +
    +
  • Blend two inputs together, with the amount of each input used varying +with the index counter. +
    __kernel void blend_images(__write_only image2d_t dst,
    +                           unsigned int index,
    +                           __read_only  image2d_t src1,
    +                           __read_only  image2d_t src2)
    +{
    +    const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
    +                               CLK_FILTER_LINEAR);
    +
    +    float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
    +
    +    int2  dst_loc = (int2)(get_global_id(0), get_global_id(1));
    +    int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
    +    int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
    +
    +    float4 val1 = read_imagef(src1, sampler, src1_loc);
    +    float4 val2 = read_imagef(src2, sampler, src2_loc);
    +
    +    write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
    +}
    +
    +
+ +
+
+

31.13 remap_opencl

+ +

Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream. +

+

Destination pixel at position (X, Y) will be picked from source (x, y) position +where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero +value for pixel will be used for destination pixel. +

+

Xmap and Ymap input video streams must be of same dimensions. Output video stream +will have Xmap/Ymap video stream dimensions. +Xmap and Ymap input video streams are 32bit float pixel format, single channel. +

+
+
interp
+

Specify interpolation used for remapping of pixels. +Allowed values are near and linear. +Default value is linear. +

+
+
fill
+

Specify the color of the unmapped pixels. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Default color is black. +

+
+ +
+
+

31.14 roberts_opencl

+

Apply the Roberts cross operator (https://en.wikipedia.org/wiki/Roberts_cross) to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +Range is [0.0, 65535] and default value is 1.0. +

+
+
delta
+

Set value which will be added to filtered result. +Range is [-65535, 65535] and default value is 0.0. +

+
+ + +
+

31.14.1 Example

+ +
    +
  • Apply the Roberts cross operator with scale set to 2 and delta set to 10 +
    +
    -i INPUT -vf "hwupload, roberts_opencl=scale=2:delta=10, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

31.15 sobel_opencl

+ +

Apply the Sobel operator (https://en.wikipedia.org/wiki/Sobel_operator) to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +Range is [0.0, 65535] and default value is 1.0. +

+
+
delta
+

Set value which will be added to filtered result. +Range is [-65535, 65535] and default value is 0.0. +

+
+ + +
+

31.15.1 Example

+ +
    +
  • Apply sobel operator with scale set to 2 and delta set to 10 +
    +
    -i INPUT -vf "hwupload, sobel_opencl=scale=2:delta=10, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

31.16 tonemap_opencl

+ +

Perform HDR(PQ/HLG) to SDR conversion with tone-mapping. +

+

It accepts the following parameters: +

+
+
tonemap
+

Specify the tone-mapping operator to be used. Same as tonemap option in tonemap. +

+
+
param
+

Tune the tone mapping algorithm. same as param option in tonemap. +

+
+
desat
+

Apply desaturation for highlights that exceed this level of brightness. The +higher the parameter, the more color information will be preserved. This +setting helps prevent unnaturally blown-out colors for super-highlights, by +(smoothly) turning into white instead. This makes images feel more natural, +at the cost of reducing information about out-of-range colors. +

+

The default value is 0.5, and the algorithm here is a little different from +the cpu version tonemap currently. A setting of 0.0 disables this option. +

+
+
threshold
+

The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold +is used to detect whether the scene has changed or not. If the distance between +the current frame average brightness and the current running average exceeds +a threshold value, we would re-calculate scene average and peak brightness. +The default value is 0.2. +

+
+
format
+

Specify the output pixel format. +

+

Currently supported formats are: +

+
p010
+
nv12
+
+ +
+
range, r
+

Set the output color range. +

+

Possible values are: +

+
tv/mpeg
+
pc/jpeg
+
+ +

Default is same as input. +

+
+
primaries, p
+

Set the output color primaries. +

+

Possible values are: +

+
bt709
+
bt2020
+
+ +

Default is same as input. +

+
+
transfer, t
+

Set the output transfer characteristics. +

+

Possible values are: +

+
bt709
+
bt2020
+
+ +

Default is bt709. +

+
+
matrix, m
+

Set the output colorspace matrix. +

+

Possible value are: +

+
bt709
+
bt2020
+
+ +

Default is same as input. +

+
+
+ + +
+

31.16.1 Example

+ +
    +
  • Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator. +
    +
    -i INPUT -vf "format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010" OUTPUT
    +
    +
+ +
+
+
+

31.17 unsharp_opencl

+ +

Sharpen or blur the input video. +

+

It accepts the following parameters: +

+
+
luma_msize_x, lx
+

Set the luma matrix horizontal size. +Range is [1, 23] and default value is 5. +

+
+
luma_msize_y, ly
+

Set the luma matrix vertical size. +Range is [1, 23] and default value is 5. +

+
+
luma_amount, la
+

Set the luma effect strength. +Range is [-10, 10] and default value is 1.0. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+
+
chroma_msize_x, cx
+

Set the chroma matrix horizontal size. +Range is [1, 23] and default value is 5. +

+
+
chroma_msize_y, cy
+

Set the chroma matrix vertical size. +Range is [1, 23] and default value is 5. +

+
+
chroma_amount, ca
+

Set the chroma effect strength. +Range is [-10, 10] and default value is 0.0. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+
+
+ +

All parameters are optional and default to the equivalent of the +string ’5:5:1.0:5:5:0.0’. +

+ +
+

31.17.1 Examples

+ +
    +
  • Apply strong luma sharpen effect: +
    +
    -i INPUT -vf "hwupload, unsharp_opencl=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5, hwdownload" OUTPUT
    +
    + +
  • Apply a strong blur of both luma and chroma parameters: +
    +
    -i INPUT -vf "hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

31.18 xfade_opencl

+ +

Cross fade two videos with custom transition effect by using OpenCL. +

+

It accepts the following options: +

+
+
transition
+

Set one of possible transition effects. +

+
+
custom
+

Select custom transition effect, the actual transition description +will be picked from source and kernel options. +

+
+
fade
+
wipeleft
+
wiperight
+
wipeup
+
wipedown
+
slideleft
+
slideright
+
slideup
+
slidedown
+
+

Default transition is fade. +

+
+ +
+
source
+

OpenCL program source file for custom transition. +

+
+
kernel
+

Set name of kernel to use for custom transition from program source file. +

+
+
duration
+

Set duration of video transition. +

+
+
offset
+

Set time of start of transition relative to first video. +

+
+ +

The program source file must contain a kernel function with the given name, +which will be run once for each plane of the output. Each run on a plane +gets enqueued as a separate 2D global NDRange with one work-item for each +pixel to be generated. The global ID offset for each work-item is therefore +the coordinates of a pixel in the destination image. +

+

The kernel function needs to take the following arguments: +

    +
  • Destination image, __write_only image2d_t. + +

    This image will become the output; the kernel should write all of it. +

    +
  • First Source image, __read_only image2d_t. +Second Source image, __read_only image2d_t. + +

    These are the most recent images on each input. The kernel may read from +them to generate the output, but they can’t be written to. +

    +
  • Transition progress, float. This value is always between 0 and 1 inclusive. +
+ +

Example programs: +

+
    +
  • Apply dots curtain transition effect: +
    __kernel void blend_images(__write_only image2d_t dst,
    +                           __read_only  image2d_t src1,
    +                           __read_only  image2d_t src2,
    +                           float progress)
    +{
    +    const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
    +                               CLK_FILTER_LINEAR);
    +    int2  p = (int2)(get_global_id(0), get_global_id(1));
    +    float2 rp = (float2)(get_global_id(0), get_global_id(1));
    +    float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
    +    rp = rp / dim;
    +
    +    float2 dots = (float2)(20.0, 20.0);
    +    float2 center = (float2)(0,0);
    +    float2 unused;
    +
    +    float4 val1 = read_imagef(src1, sampler, p);
    +    float4 val2 = read_imagef(src2, sampler, p);
    +    bool next = distance(fract(rp * dots, &unused), (float2)(0.5, 0.5)) < (progress / distance(rp, center));
    +
    +    write_imagef(dst, p, next ? val1 : val2);
    +}
    +
    +
+ + +
+
+
+

32 VAAPI Video Filters

+ +

VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters. +

+

To enable compilation of these filters you need to configure FFmpeg with +--enable-vaapi. +

+

To use vaapi filters, you need to setup the vaapi device correctly. For more information, please read https://trac.ffmpeg.org/wiki/Hardware/VAAPI +

+ +
+

32.1 overlay_vaapi

+ +

Overlay one video on the top of another. +

+

It takes two inputs and has one output. The first input is the "main" video on which the second input is overlaid. +

+

The filter accepts the following options: +

+
+
x
+
y
+

Set expressions for the x and y coordinates of the overlaid video +on the main video. +

+

Default value is "0" for both expressions. +

+
+
w
+
h
+

Set expressions for the width and height the overlaid video +on the main video. +

+

Default values are ’overlay_iw’ for ’w’ and ’overlay_ih*w/overlay_iw’ for ’h’. +

+

The expressions can contain the following parameters: +

+
+
main_w, W
+
main_h, H
+

The main input width and height. +

+
+
overlay_iw
+
overlay_ih
+

The overlay input width and height. +

+
+
overlay_w, w
+
overlay_h, h
+

The overlay output width and height. +

+
+
overlay_x, x
+
overlay_y, y
+

Position of the overlay layer inside of main +

+
+
+ +
+
alpha
+

Set transparency of overlaid video. Allowed range is 0.0 to 1.0. +Higher value means lower transparency. +Default value is 1.0. +

+
+
eof_action
+

See framesync. +

+
+
shortest
+

See framesync. +

+
+
repeatlast
+

See framesync. +

+
+
+ +

This filter also supports the framesync options. +

+
+

32.1.1 Examples

+ +
    +
  • Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs for this filter are yuv420p format. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_vaapi" OUTPUT
    +
    +
  • Overlay an image LOGO at the offset (200, 100) from the top-left corner of the INPUT video. +The inputs have same memory layout for color channels, the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_vaapi=x=200:y=100:w=400:h=300:alpha=1.0, hwdownload, format=nv12" OUTPUT
    +
    + +
+ +
+
+
+

32.2 tonemap_vaapi

+ +

Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping. +It maps the dynamic range of HDR10 content to the SDR content. +It currently only accepts HDR10 as input. +

+

It accepts the following parameters: +

+
+
format
+

Specify the output pixel format. +

+

Currently supported formats are: +

+
p010
+
nv12
+
+ +

Default is nv12. +

+
+
primaries, p
+

Set the output color primaries. +

+

Default is same as input. +

+
+
transfer, t
+

Set the output transfer characteristics. +

+

Default is bt709. +

+
+
matrix, m
+

Set the output colorspace matrix. +

+

Default is same as input. +

+
+
+ + +
+

32.2.1 Example

+ +
    +
  • Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format +
    +
    tonemap_vaapi=format=p010:t=bt2020-10
    +
    +
+ +
+
+
+

32.3 hstack_vaapi

+

Stack input videos horizontally. +

+

This is the VA-API variant of the hstack filter, each input stream may +have different height, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See hstack. +

+
+
shortest
+

See hstack. +

+
+
height
+

Set height of output. If set to 0, this filter will set height of output to +height of the first input stream. Default value is 0. +

+
+ +
+
+

32.4 vstack_vaapi

+

Stack input videos vertically. +

+

This is the VA-API variant of the vstack filter, each input stream may +have different width, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See vstack. +

+
+
shortest
+

See vstack. +

+
+
width
+

Set width of output. If set to 0, this filter will set width of output to +width of the first input stream. Default value is 0. +

+
+ +
+
+

32.5 xstack_vaapi

+

Stack video inputs into custom layout. +

+

This is the VA-API variant of the xstack filter, each input stream may +have different size, this filter will scale down/up each input stream to the +given output size, or the size of the first input stream. +

+

It accepts the following options: +

+
+
inputs
+

See xstack. +

+
+
shortest
+

See xstack. +

+
+
layout
+

See xstack. +Moreover, this permits the user to supply output size for each input stream. +

+
xstack_vaapi=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
+
+ +
+
grid
+

See xstack. +

+
+
grid_tile_size
+

Set output size for each input stream when grid is set. If this option +is not set, this filter will set output size by default to the size of the +first input stream. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
fill
+

See xstack. +

+
+ + +
+
+
+

33 QSV Video Filters

+ +

Below is a description of the currently available QSV video filters. +

+

To enable compilation of these filters you need to configure FFmpeg with +--enable-libmfx or --enable-libvpl. +

+

To use QSV filters, you need to setup the QSV device correctly. For more information, please read https://trac.ffmpeg.org/wiki/Hardware/QuickSync +

+ +
+

33.1 hstack_qsv

+

Stack input videos horizontally. +

+

This is the QSV variant of the hstack filter, each input stream may +have different height, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See hstack. +

+
+
shortest
+

See hstack. +

+
+
height
+

Set height of output. If set to 0, this filter will set height of output to +height of the first input stream. Default value is 0. +

+
+ +
+
+

33.2 vstack_qsv

+

Stack input videos vertically. +

+

This is the QSV variant of the vstack filter, each input stream may +have different width, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See vstack. +

+
+
shortest
+

See vstack. +

+
+
width
+

Set width of output. If set to 0, this filter will set width of output to +width of the first input stream. Default value is 0. +

+
+ +
+
+

33.3 xstack_qsv

+

Stack video inputs into custom layout. +

+

This is the QSV variant of the xstack filter. +

+

It accepts the following options: +

+
+
inputs
+

See xstack. +

+
+
shortest
+

See xstack. +

+
+
layout
+

See xstack. +Moreover, this permits the user to supply output size for each input stream. +

+
xstack_qsv=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
+
+ +
+
grid
+

See xstack. +

+
+
grid_tile_size
+

Set output size for each input stream when grid is set. If this option +is not set, this filter will set output size by default to the size of the +first input stream. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
fill
+

See xstack. +

+
+ + +
+
+
+

34 Video Sources

+ +

Below is a description of the currently available video sources. +

+ +
+

34.1 buffer

+ +

Buffer video frames, and make them available to the filter chain. +

+

This source is mainly intended for a programmatic use, in particular +through the interface defined in libavfilter/buffersrc.h. +

+

It accepts the following parameters: +

+
+
video_size
+

Specify the size (width and height) of the buffered video frames. For the +syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
width
+

The input video width. +

+
+
height
+

The input video height. +

+
+
pix_fmt
+

A string representing the pixel format of the buffered video frames. +It may be a number corresponding to a pixel format, or a pixel format +name. +

+
+
time_base
+

Specify the timebase assumed by the timestamps of the buffered frames. +

+
+
frame_rate
+

Specify the frame rate expected for the video stream. +

+
+
pixel_aspect, sar
+

The sample (pixel) aspect ratio of the input video. +

+
+
hw_frames_ctx
+

When using a hardware pixel format, this should be a reference to an +AVHWFramesContext describing input frames. +

+
+ +

For example: +

+
buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
+
+ +

will instruct the source to accept video frames with size 320x240 and +with format "yuv410p", assuming 1/24 as the timestamps timebase and +square pixels (1:1 sample aspect ratio). +Since the pixel format with name "yuv410p" corresponds to the number 6 +(check the enum AVPixelFormat definition in libavutil/pixfmt.h), +this example corresponds to: +

+
buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
+
+ +

Alternatively, the options can be specified as a flat string, but this +syntax is deprecated: +

+

width:height:pix_fmt:time_base.num:time_base.den:pixel_aspect.num:pixel_aspect.den +

+
+
+

34.2 cellauto

+ +

Create a pattern generated by an elementary cellular automaton. +

+

The initial state of the cellular automaton can be defined through the +filename and pattern options. If such options are +not specified an initial state is created randomly. +

+

At each new frame a new row in the video is filled with the result of +the cellular automaton next generation. The behavior when the whole +frame is filled is defined by the scroll option. +

+

This source accepts the following options: +

+
+
filename, f
+

Read the initial cellular automaton state, i.e. the starting row, from +the specified file. +In the file, each non-whitespace character is considered an alive +cell, a newline will terminate the row, and further characters in the +file will be ignored. +

+
+
pattern, p
+

Read the initial cellular automaton state, i.e. the starting row, from +the specified string. +

+

Each non-whitespace character in the string is considered an alive +cell, a newline will terminate the row, and further characters in the +string will be ignored. +

+
+
rate, r
+

Set the video rate, that is the number of frames generated per second. +Default is 25. +

+
+
random_fill_ratio, ratio
+

Set the random fill ratio for the initial cellular automaton row. It +is a floating point number value ranging from 0 to 1, defaults to +1/PHI. +

+

This option is ignored when a file or a pattern is specified. +

+
+
random_seed, seed
+

Set the seed for filling randomly the initial row, must be an integer +included between 0 and UINT32_MAX. If not specified, or if explicitly +set to -1, the filter will try to use a good random seed on a best +effort basis. +

+
+
rule
+

Set the cellular automaton rule, it is a number ranging from 0 to 255. +Default value is 110. +

+
+
size, s
+

Set the size of the output video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+

If filename or pattern is specified, the size is set +by default to the width of the specified initial state row, and the +height is set to width * PHI. +

+

If size is set, it must contain the width of the specified +pattern string, and the specified pattern will be centered in the +larger row. +

+

If a filename or a pattern string is not specified, the size value +defaults to "320x518" (used for a randomly generated initial state). +

+
+
scroll
+

If set to 1, scroll the output upward when all the rows in the output +have been already filled. If set to 0, the new generated row will be +written over the top row just after the bottom row is filled. +Defaults to 1. +

+
+
start_full, full
+

If set to 1, completely fill the output with generated rows before +outputting the first frame. +This is the default behavior, for disabling set the value to 0. +

+
+
stitch
+

If set to 1, stitch the left and right row edges together. +This is the default behavior, for disabling set the value to 0. +

+
+ + +
+

34.2.1 Examples

+ +
    +
  • Read the initial state from pattern, and specify an output of +size 200x400. +
    +
    cellauto=f=pattern:s=200x400
    +
    + +
  • Generate a random initial row with a width of 200 cells, with a fill +ratio of 2/3: +
    +
    cellauto=ratio=2/3:s=200x200
    +
    + +
  • Create a pattern generated by rule 18 starting by a single alive cell +centered on an initial row with width 100: +
    +
    cellauto=p=@:s=100x400:full=0:rule=18
    +
    + +
  • Specify a more elaborated initial pattern: +
    +
    cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
    +
    + +
+ +
+
+
+

34.3 coreimagesrc

+

Video source generated on GPU using Apple’s CoreImage API on OSX. +

+

This video source is a specialized version of the coreimage video filter. +Use a core image generator at the beginning of the applied filterchain to +generate the content. +

+

The coreimagesrc video source accepts the following options: +

+
list_generators
+

List all available generators along with all their respective options as well as +possible minimum and maximum values along with the default values. +

+
list_generators=true
+
+ +
+
size, s
+

Specify the size of the sourced video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +The default value is 320x240. +

+
+
rate, r
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a floating point +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
sar
+

Set the sample aspect ratio of the sourced video. +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+ +

Additionally, all options of the coreimage video filter are accepted. +A complete filterchain can be used for further processing of the +generated input without CPU-HOST transfer. See coreimage documentation +and examples for details. +

+ +
+

34.3.1 Examples

+ +
    +
  • Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage, +given as complete and escaped command-line for Apple’s standard bash shell: +
    +
    ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
    +
    +

    This example is equivalent to the QRCode example of coreimage without the +need for a nullsrc video source. +

+ + +
+
+
+

34.4 ddagrab

+ +

Captures the Windows Desktop via Desktop Duplication API. +

+

The filter exclusively returns D3D11 Hardware Frames, for on-gpu encoding +or processing. So an explicit hwdownload is needed for any kind of +software processing. +

+

It accepts the following options: +

+
+
output_idx
+

DXGI Output Index to capture. +

+

Usually corresponds to the index Windows has given the screen minus one, +so it’s starting at 0. +

+

Defaults to output 0. +

+
+
draw_mouse
+

Whether to draw the mouse cursor. +

+

Defaults to true. +

+

Only affects hardware cursors. If a game or application renders its own cursor, +it’ll always be captured. +

+
+
framerate
+

Framerate at which the desktop will be captured. +

+

Defaults to 30 FPS. +

+
+
video_size
+

Specify the size of the captured video. +

+

Defaults to the full size of the screen. +

+

Cropped from the bottom/right if smaller than screen size. +

+
+
offset_x
+

Horizontal offset of the captured video. +

+
+
offset_y
+

Vertical offset of the captured video. +

+
+
output_fmt
+

Desired filter output format. +Defaults to 8 Bit BGRA. +

+

It accepts the following values: +

+
auto
+

Passes all supported output formats to DDA and returns what DDA decides to use. +

+
8bit
+
bgra
+

8 Bit formats always work, and DDA will convert to them if neccesary. +

+
10bit
+
x2bgr10
+

Filter initialization will fail if 10 bit format is requested but unavailable. +

+
+ +
+
+ + +
+

34.4.1 Examples

+ +

Capture primary screen and encode using nvenc: +

+
ffmpeg -f lavfi -i ddagrab -c:v h264_nvenc -cq 18 output.mp4
+
+ +

You can also skip the lavfi device and directly use the filter. +Also demonstrates downloading the frame and encoding with libx264. +Explicit output format specification is required in this case: +

+
ffmpeg -filter_complex ddagrab=output_idx=1:framerate=60,hwdownload,format=bgra -c:v libx264 -crf 18 output.mp4
+
+ +

If you want to capture only a subsection of the desktop, this can be achieved +by specifying a smaller size and its offsets into the screen: +

+
ddagrab=video_size=800x600:offset_x=100:offset_y=100
+
+ + +
+
+
+

34.5 gradients

+

Generate several gradients. +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "640x480". +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
c0, c1, c2, c3, c4, c5, c6, c7
+

Set 8 colors. Default values for colors is to pick random one. +

+
+
x0, y0, y0, y1
+

Set gradient line source and destination points. If negative or out of range, random ones +are picked. +

+
+
nb_colors, n
+

Set number of colors to use at once. Allowed range is from 2 to 8. Default value is 2. +

+
+
seed
+

Set seed for picking gradient line points. +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+
speed
+

Set speed of gradients rotation. +

+
+
type, t
+

Set type of gradients, can be linear or radial or circular or spiral. +

+
+ + +
+
+

34.6 mandelbrot

+ +

Generate a Mandelbrot set fractal, and progressively zoom towards the +point specified with start_x and start_y. +

+

This source accepts the following options: +

+
+
end_pts
+

Set the terminal pts value. Default value is 400. +

+
+
end_scale
+

Set the terminal scale value. +Must be a floating point value. Default value is 0.3. +

+
+
inner
+

Set the inner coloring mode, that is the algorithm used to draw the +Mandelbrot fractal internal region. +

+

It shall assume one of the following values: +

+
black
+

Set black mode. +

+
convergence
+

Show time until convergence. +

+
mincol
+

Set color based on point closest to the origin of the iterations. +

+
period
+

Set period mode. +

+
+ +

Default value is mincol. +

+
+
bailout
+

Set the bailout value. Default value is 10.0. +

+
+
maxiter
+

Set the maximum of iterations performed by the rendering +algorithm. Default value is 7189. +

+
+
outer
+

Set outer coloring mode. +It shall assume one of following values: +

+
iteration_count
+

Set iteration count mode. +

+
normalized_iteration_count
+

set normalized iteration count mode. +

+
+

Default value is normalized_iteration_count. +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "640x480". +

+
+
start_scale
+

Set the initial scale value. Default value is 3.0. +

+
+
start_x
+

Set the initial x position. Must be a floating point value between +-100 and 100. Default value is -0.743643887037158704752191506114774. +

+
+
start_y
+

Set the initial y position. Must be a floating point value between +-100 and 100. Default value is -0.131825904205311970493132056385139. +

+
+ +
+
+

34.7 mptestsrc

+ +

Generate various test patterns, as generated by the MPlayer test filter. +

+

The size of the generated video is fixed, and is 256x256. +This source is useful in particular for testing encoding features. +

+

This source accepts the following options: +

+
+
rate, r
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a floating point +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+
test, t
+
+

Set the number or the name of the test to perform. Supported tests are: +

+
dc_luma
+
dc_chroma
+
freq_luma
+
freq_chroma
+
amp_luma
+
amp_chroma
+
cbp
+
mv
+
ring1
+
ring2
+
all
+
max_frames, m
+

Set the maximum number of frames generated for each test, default value is 30. +

+
+
+ +

Default value is "all", which will cycle through the list of all tests. +

+
+ +

Some examples: +

+
mptestsrc=t=dc_luma
+
+ +

will generate a "dc_luma" test pattern. +

+
+
+

34.8 frei0r_src

+ +

Provide a frei0r source. +

+

To enable compilation of this filter you need to install the frei0r +header and configure FFmpeg with --enable-frei0r. +

+

This source accepts the following parameters: +

+
+
size
+

The size of the video to generate. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
framerate
+

The framerate of the generated video. It may be a string of the form +num/den or a frame rate abbreviation. +

+
+
filter_name
+

The name to the frei0r source to load. For more information regarding frei0r and +how to set the parameters, read the frei0r section in the video filters +documentation. +

+
+
filter_params
+

A ’|’-separated list of parameters to pass to the frei0r source. +

+
+
+ +

For example, to generate a frei0r partik0l source with size 200x200 +and frame rate 10 which is overlaid on the overlay filter main input: +

+
frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
+
+ +
+
+

34.9 life

+ +

Generate a life pattern. +

+

This source is based on a generalization of John Conway’s life game. +

+

The sourced input represents a life grid, each pixel represents a cell +which can be in one of two possible states, alive or dead. Every cell +interacts with its eight neighbours, which are the cells that are +horizontally, vertically, or diagonally adjacent. +

+

At each interaction the grid evolves according to the adopted rule, +which specifies the number of neighbor alive cells which will make a +cell stay alive or born. The rule option allows one to specify +the rule to adopt. +

+

This source accepts the following options: +

+
+
filename, f
+

Set the file from which to read the initial grid state. In the file, +each non-whitespace character is considered an alive cell, and newline +is used to delimit the end of each row. +

+

If this option is not specified, the initial grid is generated +randomly. +

+
+
rate, r
+

Set the video rate, that is the number of frames generated per second. +Default is 25. +

+
+
random_fill_ratio, ratio
+

Set the random fill ratio for the initial random grid. It is a +floating point number value ranging from 0 to 1, defaults to 1/PHI. +It is ignored when a file is specified. +

+
+
random_seed, seed
+

Set the seed for filling the initial random grid, must be an integer +included between 0 and UINT32_MAX. If not specified, or if explicitly +set to -1, the filter will try to use a good random seed on a best +effort basis. +

+
+
rule
+

Set the life rule. +

+

A rule can be specified with a code of the kind "SNS/BNB", +where NS and NB are sequences of numbers in the range 0-8, +NS specifies the number of alive neighbor cells which make a +live cell stay alive, and NB the number of alive neighbor cells +which make a dead cell to become alive (i.e. to "born"). +"s" and "b" can be used in place of "S" and "B", respectively. +

+

Alternatively a rule can be specified by an 18-bits integer. The 9 +high order bits are used to encode the next cell state if it is alive +for each number of neighbor alive cells, the low order bits specify +the rule for "borning" new cells. Higher order bits encode for an +higher number of neighbor cells. +For example the number 6153 = (12<<9)+9 specifies a stay alive +rule of 12 and a born rule of 9, which corresponds to "S23/B03". +

+

Default value is "S23/B3", which is the original Conway’s game of life +rule, and will keep a cell alive if it has 2 or 3 neighbor alive +cells, and will born a new cell if there are three alive cells around +a dead cell. +

+
+
size, s
+

Set the size of the output video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+

If filename is specified, the size is set by default to the +same size of the input file. If size is set, it must contain +the size specified in the input file, and the initial grid defined in +that file is centered in the larger resulting area. +

+

If a filename is not specified, the size value defaults to "320x240" +(used for a randomly generated initial grid). +

+
+
stitch
+

If set to 1, stitch the left and right grid edges together, and the +top and bottom edges also. Defaults to 1. +

+
+
mold
+

Set cell mold speed. If set, a dead cell will go from death_color to +mold_color with a step of mold. mold can have a +value from 0 to 255. +

+
+
life_color
+

Set the color of living (or new born) cells. +

+
+
death_color
+

Set the color of dead cells. If mold is set, this is the first color +used to represent a dead cell. +

+
+
mold_color
+

Set mold color, for definitely dead and moldy cells. +

+

For the syntax of these 3 color options, check the (ffmpeg-utils)"Color" section in the +ffmpeg-utils manual. +

+
+ + +
+

34.9.1 Examples

+ +
    +
  • Read a grid from pattern, and center it on a grid of size +300x300 pixels: +
    +
    life=f=pattern:s=300x300
    +
    + +
  • Generate a random grid of size 200x200, with a fill ratio of 2/3: +
    +
    life=ratio=2/3:s=200x200
    +
    + +
  • Specify a custom rule for evolving a randomly generated grid: +
    +
    life=rule=S14/B34
    +
    + +
  • Full example with slow death effect (mold) using ffplay: +
    +
    ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
    +
    +
+ +
+
+
+

34.10 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc

+ +

The allrgb source returns frames of size 4096x4096 of all rgb colors. +

+

The allyuv source returns frames of size 4096x4096 of all yuv colors. +

+

The color source provides an uniformly colored input. +

+

The colorchart source provides a colors checker chart. +

+

The colorspectrum source provides a color spectrum input. +

+

The haldclutsrc source provides an identity Hald CLUT. See also +haldclut filter. +

+

The nullsrc source returns unprocessed video frames. It is +mainly useful to be employed in analysis / debugging tools, or as the +source for filters which ignore the input data. +

+

The pal75bars source generates a color bars pattern, based on +EBU PAL recommendations with 75% color levels. +

+

The pal100bars source generates a color bars pattern, based on +EBU PAL recommendations with 100% color levels. +

+

The rgbtestsrc source generates an RGB test pattern useful for +detecting RGB vs BGR issues. You should see a red, green and blue +stripe from top to bottom. +

+

The smptebars source generates a color bars pattern, based on +the SMPTE Engineering Guideline EG 1-1990. +

+

The smptehdbars source generates a color bars pattern, based on +the SMPTE RP 219-2002. +

+

The testsrc source generates a test video pattern, showing a +color pattern, a scrolling gradient and a timestamp. This is mainly +intended for testing purposes. +

+

The testsrc2 source is similar to testsrc, but supports more +pixel formats instead of just rgb24. This allows using it as an +input for other tests without requiring a format conversion. +

+

The yuvtestsrc source generates an YUV test pattern. You should +see a y, cb and cr stripe from top to bottom. +

+

The sources accept the following parameters: +

+
+
level
+

Specify the level of the Hald CLUT, only available in the haldclutsrc +source. A level of N generates a picture of N*N*N by N*N*N +pixels to be used as identity matrix for 3D lookup tables. Each component is +coded on a 1/(N*N) scale. +

+
+
color, c
+

Specify the color of the source, only available in the color +source. For the syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+
+
size, s
+

Specify the size of the sourced video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +The default value is 320x240. +

+

This option is not available with the allrgb, allyuv, and +haldclutsrc filters. +

+
+
rate, r
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a floating point +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+

Since the frame rate is used as time base, all frames including the last one +will have their full duration. If the specified duration is not a multiple +of the frame duration, it will be rounded up. +

+
+
sar
+

Set the sample aspect ratio of the sourced video. +

+
+
alpha
+

Specify the alpha (opacity) of the background, only available in the +testsrc2 source. The value must be between 0 (fully transparent) and +255 (fully opaque, the default). +

+
+
decimals, n
+

Set the number of decimals to show in the timestamp, only available in the +testsrc source. +

+

The displayed timestamp value will correspond to the original +timestamp value multiplied by the power of 10 of the specified +value. Default value is 0. +

+
+
type
+

Set the type of the color spectrum, only available in the +colorspectrum source. Can be one of the following: +

+
+
black
+
white
+
all
+
+ +
+
patch_size
+

Set patch size of single color patch, only available in the +colorchart source. Default is 64x64. +

+
+
preset
+

Set colorchecker colors preset, only available in the +colorchart source. +

+

Available values are: +

+
reference
+
skintones
+
+ +

Default value is reference. +

+
+ + +
+

34.10.1 Examples

+ +
    +
  • Generate a video with a duration of 5.3 seconds, with size +176x144 and a frame rate of 10 frames per second: +
    +
    testsrc=duration=5.3:size=qcif:rate=10
    +
    + +
  • The following graph description will generate a red source +with an opacity of 0.2, with size "qcif" and a frame rate of 10 +frames per second: +
    +
    color=c=red@0.2:s=qcif:r=10
    +
    + +
  • If the input content is to be ignored, nullsrc can be used. The +following command generates noise in the luminance plane by employing +the geq filter: +
    +
    nullsrc=s=256x256, geq=random(1)*255:128:128
    +
    +
+ +
+
+

34.10.2 Commands

+ +

The color source supports the following commands: +

+
+
c, color
+

Set the color of the created image. Accepts the same syntax of the +corresponding color option. +

+
+ +
+
+
+

34.11 openclsrc

+ +

Generate video using an OpenCL program. +

+
+
source
+

OpenCL program source file. +

+
+
kernel
+

Kernel name in program. +

+
+
size, s
+

Size of frames to generate. This must be set. +

+
+
format
+

Pixel format to use for the generated frames. This must be set. +

+
+
rate, r
+

Number of frames generated every second. Default value is ’25’. +

+
+
+ +

For details of how the program loading works, see the program_opencl +filter. +

+

Example programs: +

+
    +
  • Generate a colour ramp by setting pixel values from the position of the pixel +in the output image. (Note that this will work with all pixel formats, but +the generated output will not be the same.) +
    __kernel void ramp(__write_only image2d_t dst,
    +                   unsigned int index)
    +{
    +    int2 loc = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float4 val;
    +    val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
    +
    +    write_imagef(dst, loc, val);
    +}
    +
    +
  • Generate a Sierpinski carpet pattern, panning by a single pixel each frame. +
    __kernel void sierpinski_carpet(__write_only image2d_t dst,
    +                                unsigned int index)
    +{
    +    int2 loc = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float4 value = 0.0f;
    +    int x = loc.x + index;
    +    int y = loc.y + index;
    +    while (x > 0 || y > 0) {
    +        if (x % 3 == 1 && y % 3 == 1) {
    +            value = 1.0f;
    +            break;
    +        }
    +        x /= 3;
    +        y /= 3;
    +    }
    +
    +    write_imagef(dst, loc, value);
    +}
    +
    +
+ +
+
+

34.12 sierpinski

+ +

Generate a Sierpinski carpet/triangle fractal, and randomly pan around. +

+

This source accepts the following options: +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "640x480". +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
seed
+

Set seed which is used for random panning. +

+
+
jump
+

Set max jump for single pan destination. Allowed range is from 1 to 10000. +

+
+
type
+

Set fractal type, can be default carpet or triangle. +

+
+ +
+
+

34.13 zoneplate

+

Generate a zoneplate test video pattern. +

+

This source accepts the following options: +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "320x240". +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+
sar
+

Set the sample aspect ratio of the sourced video. +

+
+
precision
+

Set precision in bits for look-up table for sine calculations. Default value is 10. +Allowed range is from 4 to 16. +

+
+
xo
+

Set horizontal axis offset for output signal. Default value is 0. +

+
+
yo
+

Set vertical axis offset for output signal. Default value is 0. +

+
+
to
+

Set time axis offset for output signal. Default value is 0. +

+
+
k0
+

Set 0-order, constant added to signal phase. Default value is 0. +

+
+
kx
+

Set 1-order, phase factor multiplier for horizontal axis. Default value is 0. +

+
+
ky
+

Set 1-order, phase factor multiplier for vertical axis. Default value is 0. +

+
+
kt
+

Set 1-order, phase factor multiplier for time axis. Default value is 0. +

+
+
kxt, kyt, kxy
+

Set phase factor multipliers for combination of spatial and temporal axis. +Default value is 0. +

+
+
kx2
+

Set 2-order, phase factor multiplier for horizontal axis. Default value is 0. +

+
+
ky2
+

Set 2-order, phase factor multiplier for vertical axis. Default value is 0. +

+
+
kt2
+

Set 2-order, phase factor multiplier for time axis. Default value is 0. +

+
+
ku
+

Set the constant added to final phase to produce chroma-blue component of signal. +Default value is 0. +

+
+
kv
+

Set the constant added to final phase to produce chroma-red component of signal. +Default value is 0. +

+
+ + +
+

34.13.1 Commands

+ +

This source supports the some above options as commands. +

+
+
+

34.13.2 Examples

+ +
    +
  • Generate horizontal color sine sweep: +
    +
    zoneplate=ku=512:kv=0:kt2=0:kx2=256:s=wvga:xo=-426:kt=11
    +
    + +
  • Generate vertical color sine sweep: +
    +
    zoneplate=ku=512:kv=0:kt2=0:ky2=156:s=wvga:yo=-240:kt=11
    +
    + +
  • Generate circular zone-plate: +
    +
    zoneplate=ku=512:kv=100:kt2=0:ky2=256:kx2=556:s=wvga:yo=0:kt=11
    +
    +
+ + +
+
+
+
+

35 Video Sinks

+ +

Below is a description of the currently available video sinks. +

+ +
+

35.1 buffersink

+ +

Buffer video frames, and make them available to the end of the filter +graph. +

+

This sink is mainly intended for programmatic use, in particular +through the interface defined in libavfilter/buffersink.h +or the options system. +

+

It accepts a pointer to an AVBufferSinkContext structure, which +defines the incoming buffers’ formats, to be passed as the opaque +parameter to avfilter_init_filter for initialization. +

+
+
+

35.2 nullsink

+ +

Null video sink: do absolutely nothing with the input video. It is +mainly useful as a template and for use in analysis / debugging +tools. +

+ +
+
+
+

36 Multimedia Filters

+ +

Below is a description of the currently available multimedia filters. +

+ +
+

36.1 a3dscope

+ +

Convert input audio to 3d scope video output. +

+

The filter accepts the following options: +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is hd720. +

+
+
fov
+

Set the camera field of view. Default is 90 degrees. +Allowed range is from 40 to 150. +

+
+
roll
+

Set the camera roll. +

+
+
pitch
+

Set the camera pitch. +

+
+
yaw
+

Set the camera yaw. +

+
+
xzoom
+

Set the camera zoom on X-axis. +

+
+
yzoom
+

Set the camera zoom on Y-axis. +

+
+
zzoom
+

Set the camera zoom on Z-axis. +

+
+
xpos
+

Set the camera position on X-axis. +

+
+
ypos
+

Set the camera position on Y-axis. +

+
+
zpos
+

Set the camera position on Z-axis. +

+
+
length
+

Set the length of displayed audio waves in number of frames. +

+
+ + +
+

36.1.1 Commands

+ +

Filter supports the some above options as commands. +

+
+
+
+

36.2 abitscope

+ +

Convert input audio to a video output, displaying the audio bit scope. +

+

The filter accepts the following options: +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 1024x256. +

+
+
colors
+

Specify list of colors separated by space or by ’|’ which will be used to +draw channels. Unrecognized or missing colors will be replaced +by white color. +

+
+
mode, m
+

Set output mode. Can be bars or trace. Default is bars. +

+
+ +
+
+

36.3 adrawgraph

+

Draw a graph using input audio metadata. +

+

See drawgraph +

+
+
+

36.4 agraphmonitor

+ +

See graphmonitor. +

+
+
+

36.5 ahistogram

+ +

Convert input audio to a video output, displaying the volume histogram. +

+

The filter accepts the following options: +

+
+
dmode
+

Specify how histogram is calculated. +

+

It accepts the following values: +

+
single
+

Use single histogram for all channels. +

+
separate
+

Use separate histogram for each channel. +

+
+

Default is single. +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is hd720. +

+
+
scale
+

Set display scale. +

+

It accepts the following values: +

+
log
+

logarithmic +

+
sqrt
+

square root +

+
cbrt
+

cubic root +

+
lin
+

linear +

+
rlog
+

reverse logarithmic +

+
+

Default is log. +

+
+
ascale
+

Set amplitude scale. +

+

It accepts the following values: +

+
log
+

logarithmic +

+
lin
+

linear +

+
+

Default is log. +

+
+
acount
+

Set how much frames to accumulate in histogram. +Default is 1. Setting this to -1 accumulates all frames. +

+
+
rheight
+

Set histogram ratio of window height. +

+
+
slide
+

Set sonogram sliding. +

+

It accepts the following values: +

+
replace
+

replace old rows with new ones. +

+
scroll
+

scroll from top to bottom. +

+
+

Default is replace. +

+
+
hmode
+

Set histogram mode. +

+

It accepts the following values: +

+
abs
+

Use absolute values of samples. +

+
sign
+

Use untouched values of samples. +

+
+

Default is abs. +

+
+ +
+
+

36.6 aphasemeter

+ +

Measures phase of input audio, which is exported as metadata lavfi.aphasemeter.phase, +representing mean phase of current audio frame. A video output can also be produced and is +enabled by default. The audio is passed through as first output. +

+

Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in +range [-1, 1] where -1 means left and right channels are completely out of phase +and 1 means channels are in phase. +

+

The filter accepts the following options, all related to its video output: +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+
+
size, s
+

Set the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 800x400. +

+
+
rc
+
gc
+
bc
+

Specify the red, green, blue contrast. Default values are 2, +7 and 1. +Allowed range is [0, 255]. +

+
+
mpc
+

Set color which will be used for drawing median phase. If color is +none which is default, no median phase value will be drawn. +

+
+
video
+

Enable video output. Default is enabled. +

+
+ + +
+

36.6.1 phasing detection

+ +

The filter also detects out of phase and mono sequences in stereo streams. +It logs the sequence start, end and duration when it lasts longer or as long as the minimum set. +

+

The filter accepts the following options for this detection: +

+
+
phasing
+

Enable mono and out of phase detection. Default is disabled. +

+
+
tolerance, t
+

Set phase tolerance for mono detection, in amplitude ratio. Default is 0. +Allowed range is [0, 1]. +

+
+
angle, a
+

Set angle threshold for out of phase detection, in degree. Default is 170. +Allowed range is [90, 180]. +

+
+
duration, d
+

Set mono or out of phase duration until notification, expressed in seconds. Default is 2. +

+
+ +
+
+

36.6.2 Examples

+ +
    +
  • Complete example with ffmpeg to detect 1 second of mono with 0.001 phase tolerance: +
    +
    ffmpeg -i stereo.wav -af aphasemeter=video=0:phasing=1:duration=1:tolerance=0.001 -f null -
    +
    +
+ +
+
+
+

36.7 avectorscope

+ +

Convert input audio to a video output, representing the audio vector +scope. +

+

The filter is used to measure the difference between channels of stereo +audio stream. A monaural signal, consisting of identical left and right +signal, results in straight vertical line. Any stereo separation is visible +as a deviation from this line, creating a Lissajous figure. +If the straight (or deviation from it) but horizontal line appears this +indicates that the left and right channels are out of phase. +

+

The filter accepts the following options: +

+
+
mode, m
+

Set the vectorscope mode. +

+

Available values are: +

+
lissajous
+

Lissajous rotated by 45 degrees. +

+
+
lissajous_xy
+

Same as above but not rotated. +

+
+
polar
+

Shape resembling half of circle. +

+
+ +

Default value is ‘lissajous’. +

+
+
size, s
+

Set the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 400x400. +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+
+
rc
+
gc
+
bc
+
ac
+

Specify the red, green, blue and alpha contrast. Default values are 40, +160, 80 and 255. +Allowed range is [0, 255]. +

+
+
rf
+
gf
+
bf
+
af
+

Specify the red, green, blue and alpha fade. Default values are 15, +10, 5 and 5. +Allowed range is [0, 255]. +

+
+
zoom
+

Set the zoom factor. Default value is 1. Allowed range is [0, 10]. +Values lower than 1 will auto adjust zoom factor to maximal possible value. +

+
+
draw
+

Set the vectorscope drawing mode. +

+

Available values are: +

+
dot
+

Draw dot for each sample. +

+
+
line
+

Draw line between previous and current sample. +

+
+
aaline
+

Draw anti-aliased line between previous and current sample. +

+
+ +

Default value is ‘dot’. +

+
+
scale
+

Specify amplitude scale of audio samples. +

+

Available values are: +

+
lin
+

Linear. +

+
+
sqrt
+

Square root. +

+
+
cbrt
+

Cubic root. +

+
+
log
+

Logarithmic. +

+
+ +
+
swap
+

Swap left channel axis with right channel axis. +

+
+
mirror
+

Mirror axis. +

+
+
none
+

No mirror. +

+
+
x
+

Mirror only x axis. +

+
+
y
+

Mirror only y axis. +

+
+
xy
+

Mirror both axis. +

+
+ +
+
+ + +
+

36.7.1 Examples

+ +
    +
  • Complete example using ffplay: +
    +
    ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
    +             [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
    +
    +
+ +
+
+

36.7.2 Commands

+ +

This filter supports the all above options as commands except options size and rate. +

+
+
+
+

36.8 bench, abench

+ +

Benchmark part of a filtergraph. +

+

The filter accepts the following options: +

+
+
action
+

Start or stop a timer. +

+

Available values are: +

+
start
+

Get the current time, set it as frame metadata (using the key +lavfi.bench.start_time), and forward the frame to the next filter. +

+
+
stop
+

Get the current time and fetch the lavfi.bench.start_time metadata from +the input frame metadata to get the time difference. Time difference, average, +maximum and minimum time (respectively t, avg, max and +min) are then printed. The timestamps are expressed in seconds. +

+
+
+
+ + +
+

36.8.1 Examples

+ +
    +
  • Benchmark selectivecolor filter: +
    +
    bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
    +
    +
+ +
+
+
+

36.9 concat

+ +

Concatenate audio and video streams, joining them together one after the +other. +

+

The filter works on segments of synchronized video and audio streams. All +segments must have the same number of streams of each type, and that will +also be the number of streams at output. +

+

The filter accepts the following options: +

+
+
n
+

Set the number of segments. Default is 2. +

+
+
v
+

Set the number of output video streams, that is also the number of video +streams in each segment. Default is 1. +

+
+
a
+

Set the number of output audio streams, that is also the number of audio +streams in each segment. Default is 0. +

+
+
unsafe
+

Activate unsafe mode: do not fail if segments have a different format. +

+
+
+ +

The filter has v+a outputs: first v video outputs, then +a audio outputs. +

+

There are nx(v+a) inputs: first the inputs for the first +segment, in the same order as the outputs, then the inputs for the second +segment, etc. +

+

Related streams do not always have exactly the same duration, for various +reasons including codec frame size or sloppy authoring. For that reason, +related synchronized streams (e.g. a video and its audio track) should be +concatenated at once. The concat filter will use the duration of the longest +stream in each segment (except the last one), and if necessary pad shorter +audio streams with silence. +

+

For this filter to work correctly, all segments must start at timestamp 0. +

+

All corresponding streams must have the same parameters in all segments; the +filtering system will automatically select a common pixel format for video +streams, and a common sample format, sample rate and channel layout for +audio streams, but other settings, such as resolution, must be converted +explicitly by the user. +

+

Different frame rates are acceptable but will result in variable frame rate +at output; be sure to configure the output file to handle it. +

+ +
+

36.9.1 Examples

+ +
    +
  • Concatenate an opening, an episode and an ending, all in bilingual version +(video in stream 0, audio in streams 1 and 2): +
    +
    ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
    +  '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
    +   concat=n=3:v=1:a=2 [v] [a1] [a2]' \
    +  -map '[v]' -map '[a1]' -map '[a2]' output.mkv
    +
    + +
  • Concatenate two parts, handling audio and video separately, using the +(a)movie sources, and adjusting the resolution: +
    +
    movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
    +movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
    +[v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
    +
    +

    Note that a desync will happen at the stitch if the audio and video streams +do not have exactly the same duration in the first file. +

    +
+ +
+
+

36.9.2 Commands

+ +

This filter supports the following commands: +

+
next
+

Close the current segment and step to the next one +

+
+ +
+
+
+

36.10 ebur128

+ +

EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness +level. By default, it logs a message at a frequency of 10Hz with the +Momentary loudness (identified by M), Short-term loudness (S), +Integrated loudness (I) and Loudness Range (LRA). +

+

The filter can only analyze streams which have +sample format is double-precision floating point. The input stream will be converted to +this specification, if needed. Users may need to insert aformat and/or aresample filters +after this filter to obtain the original parameters. +

+

The filter also has a video output (see the video option) with a real +time graph to observe the loudness evolution. The graphic contains the logged +message mentioned above, so it is not printed anymore when this option is set, +unless the verbose logging is set. The main graphing area contains the +short-term loudness (3 seconds of analysis), and the gauge on the right is for +the momentary loudness (400 milliseconds), but can optionally be configured +to instead display short-term loudness (see gauge). +

+

The green area marks a +/- 1LU target range around the target loudness +(-23LUFS by default, unless modified through target). +

+

More information about the Loudness Recommendation EBU R128 on +http://tech.ebu.ch/loudness. +

+

The filter accepts the following options: +

+
+
video
+

Activate the video output. The audio stream is passed unchanged whether this +option is set or no. The video stream will be the first output stream if +activated. Default is 0. +

+
+
size
+

Set the video size. This option is for video only. For the syntax of this +option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default and minimum resolution is 640x480. +

+
+
meter
+

Set the EBU scale meter. Default is 9. Common values are 9 and +18, respectively for EBU scale meter +9 and EBU scale meter +18. Any +other integer value between this range is allowed. +

+
+
metadata
+

Set metadata injection. If set to 1, the audio input will be segmented +into 100ms output frames, each of them containing various loudness information +in metadata. All the metadata keys are prefixed with lavfi.r128.. +

+

Default is 0. +

+
+
framelog
+

Force the frame logging level. +

+

Available values are: +

+
quiet
+

logging disabled +

+
info
+

information logging level +

+
verbose
+

verbose logging level +

+
+ +

By default, the logging level is set to info. If the video or +the metadata options are set, it switches to verbose. +

+
+
peak
+

Set peak mode(s). +

+

Available modes can be cumulated (the option is a flag type). Possible +values are: +

+
none
+

Disable any peak mode (default). +

+
sample
+

Enable sample-peak mode. +

+

Simple peak mode looking for the higher sample value. It logs a message +for sample-peak (identified by SPK). +

+
true
+

Enable true-peak mode. +

+

If enabled, the peak lookup is done on an over-sampled version of the input +stream for better peak accuracy. It logs a message for true-peak. +(identified by TPK) and true-peak per frame (identified by FTPK). +This mode requires a build with libswresample. +

+
+ +
+
dualmono
+

Treat mono input files as "dual mono". If a mono file is intended for playback +on a stereo system, its EBU R128 measurement will be perceptually incorrect. +If set to true, this option will compensate for this effect. +Multi-channel input files are not affected by this option. +

+
+
panlaw
+

Set a specific pan law to be used for the measurement of dual mono files. +This parameter is optional, and has a default value of -3.01dB. +

+
+
target
+

Set a specific target level (in LUFS) used as relative zero in the visualization. +This parameter is optional and has a default value of -23LUFS as specified +by EBU R128. However, material published online may prefer a level of -16LUFS +(e.g. for use with podcasts or video platforms). +

+
+
gauge
+

Set the value displayed by the gauge. Valid values are momentary and s +shortterm. By default the momentary value will be used, but in certain +scenarios it may be more useful to observe the short term value instead (e.g. +live mixing). +

+
+
scale
+

Sets the display scale for the loudness. Valid parameters are absolute +(in LUFS) or relative (LU) relative to the target. This only affects the +video output, not the summary or continuous log output. +

+
+
integrated
+

Read-only exported value for measured integrated loudness, in LUFS. +

+
+
range
+

Read-only exported value for measured loudness range, in LU. +

+
+
lra_low
+

Read-only exported value for measured LRA low, in LUFS. +

+
+
lra_high
+

Read-only exported value for measured LRA high, in LUFS. +

+
+
sample_peak
+

Read-only exported value for measured sample peak, in dBFS. +

+
+
true_peak
+

Read-only exported value for measured true peak, in dBFS. +

+
+ + +
+

36.10.1 Examples

+ +
    +
  • Real-time graph using ffplay, with a EBU scale meter +18: +
    +
    ffplay -f lavfi -i "amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]"
    +
    + +
  • Run an analysis with ffmpeg: +
    +
    ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
    +
    +
+ +
+
+
+

36.11 interleave, ainterleave

+ +

Temporally interleave frames from several inputs. +

+

interleave works with video inputs, ainterleave with audio. +

+

These filters read frames from several inputs and send the oldest +queued frame to the output. +

+

Input streams must have well defined, monotonically increasing frame +timestamp values. +

+

In order to submit one frame to output, these filters need to enqueue +at least one frame for each input, so they cannot work in case one +input is not yet terminated and will not receive incoming frames. +

+

For example consider the case when one input is a select filter +which always drops input frames. The interleave filter will keep +reading from that input, but it will never be able to send new frames +to output until the input sends an end-of-stream signal. +

+

Also, depending on inputs synchronization, the filters will drop +frames in case one input receives more frames than the other ones, and +the queue is already filled. +

+

These filters accept the following options: +

+
+
nb_inputs, n
+

Set the number of different inputs, it is 2 by default. +

+
+
duration
+

How to determine the end-of-stream. +

+
+
longest
+

The duration of the longest input. (default) +

+
+
shortest
+

The duration of the shortest input. +

+
+
first
+

The duration of the first input. +

+
+ +
+
+ + +
+

36.11.1 Examples

+ +
    +
  • Interleave frames belonging to different streams using ffmpeg: +
    +
    ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex "[0:v][1:v] interleave" out.avi
    +
    + +
  • Add flickering blur effect: +
    +
    select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
    +
    +
+ +
+
+
+

36.12 latency, alatency

+

Measure filtering latency. +

+

Report previous filter filtering latency, delay in number of audio samples for audio filters +or number of video frames for video filters. +

+

On end of input stream, filter will report min and max measured latency for previous running filter +in filtergraph. +

+
+
+

36.13 metadata, ametadata

+ +

Manipulate frame metadata. +

+

This filter accepts the following options: +

+
+
mode
+

Set mode of operation of the filter. +

+

Can be one of the following: +

+
+
select
+

If both value and key is set, select frames +which have such metadata. If only key is set, select +every frame that has such key in metadata. +

+
+
add
+

Add new metadata key and value. If key is already available +do nothing. +

+
+
modify
+

Modify value of already present key. +

+
+
delete
+

If value is set, delete only keys that have such value. +Otherwise, delete key. If key is not set, delete all metadata values in +the frame. +

+
+
print
+

Print key and its value if metadata was found. If key is not set print all +metadata values available in frame. +

+
+ +
+
key
+

Set key used with all modes. Must be set for all modes except print and delete. +

+
+
value
+

Set metadata value which will be used. This option is mandatory for +modify and add mode. +

+
+
function
+

Which function to use when comparing metadata value and value. +

+

Can be one of following: +

+
+
same_str
+

Values are interpreted as strings, returns true if metadata value is same as value. +

+
+
starts_with
+

Values are interpreted as strings, returns true if metadata value starts with +the value option string. +

+
+
less
+

Values are interpreted as floats, returns true if metadata value is less than value. +

+
+
equal
+

Values are interpreted as floats, returns true if value is equal with metadata value. +

+
+
greater
+

Values are interpreted as floats, returns true if metadata value is greater than value. +

+
+
expr
+

Values are interpreted as floats, returns true if expression from option expr +evaluates to true. +

+
+
ends_with
+

Values are interpreted as strings, returns true if metadata value ends with +the value option string. +

+
+ +
+
expr
+

Set expression which is used when function is set to expr. +The expression is evaluated through the eval API and can contain the following +constants: +

+
+
VALUE1, FRAMEVAL
+

Float representation of value from metadata key. +

+
+
VALUE2, USERVAL
+

Float representation of value as supplied by user in value option. +

+
+ +
+
file
+

If specified in print mode, output is written to the named file. Instead of +plain filename any writable url can be specified. Filename “-” is a shorthand +for standard output. If file option is not set, output is written to the log +with AV_LOG_INFO loglevel. +

+
+
direct
+

Reduces buffering in print mode when output is written to a URL set using file. +

+
+
+ + +
+

36.13.1 Examples

+ +
    +
  • Print all metadata values for frames with key lavfi.signalstats.YDIF with values +between 0 and 1. +
    +
    signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
    +
    +
  • Print silencedetect output to file metadata.txt. +
    +
    silencedetect,ametadata=mode=print:file=metadata.txt
    +
    +
  • Direct all metadata to a pipe with file descriptor 4. +
    +
    metadata=mode=print:file='pipe\:4'
    +
    +
+ +
+
+
+

36.14 perms, aperms

+ +

Set read/write permissions for the output frames. +

+

These filters are mainly aimed at developers to test direct path in the +following filter in the filtergraph. +

+

The filters accept the following options: +

+
+
mode
+

Select the permissions mode. +

+

It accepts the following values: +

+
none
+

Do nothing. This is the default. +

+
ro
+

Set all the output frames read-only. +

+
rw
+

Set all the output frames directly writable. +

+
toggle
+

Make the frame read-only if writable, and writable if read-only. +

+
random
+

Set each output frame read-only or writable randomly. +

+
+ +
+
seed
+

Set the seed for the random mode, must be an integer included between +0 and UINT32_MAX. If not specified, or if explicitly set to +-1, the filter will try to use a good random seed on a best effort +basis. +

+
+ +

Note: in case of auto-inserted filter between the permission filter and the +following one, the permission might not be received as expected in that +following filter. Inserting a format or aformat filter before the +perms/aperms filter can avoid this problem. +

+
+
+

36.15 realtime, arealtime

+ +

Slow down filtering to match real time approximately. +

+

These filters will pause the filtering for a variable amount of time to +match the output rate with the input timestamps. +They are similar to the re option to ffmpeg. +

+

They accept the following options: +

+
+
limit
+

Time limit for the pauses. Any pause longer than that will be considered +a timestamp discontinuity and reset the timer. Default is 2 seconds. +

+
speed
+

Speed factor for processing. The value must be a float larger than zero. +Values larger than 1.0 will result in faster than realtime processing, +smaller will slow processing down. The limit is automatically adapted +accordingly. Default is 1.0. +

+

A processing speed faster than what is possible without these filters cannot +be achieved. +

+
+ + +
+

36.15.1 Commands

+ +

Both filters supports the all above options as commands. +

+
+
+
+

36.16 segment, asegment

+ +

Split single input stream into multiple streams. +

+

This filter does opposite of concat filters. +

+

segment works on video frames, asegment on audio samples. +

+

This filter accepts the following options: +

+
+
timestamps
+

Timestamps of output segments separated by ’|’. The first segment will run +from the beginning of the input stream. The last segment will run until +the end of the input stream +

+
+
frames, samples
+

Exact frame/sample count to split the segments. +

+
+ +

In all cases, prefixing an each segment with ’+’ will make it relative to the +previous segment. +

+ +
+

36.16.1 Examples

+ +
    +
  • Split input audio stream into three output audio streams, starting at start of input audio stream +and storing that in 1st output audio stream, then following at 60th second and storing than in 2nd +output audio stream, and last after 150th second of input audio stream store in 3rd output audio stream: +
    +
    asegment=timestamps="60|150"
    +
    + +
+ +
+
+
+

36.17 select, aselect

+ +

Select frames to pass in output. +

+

This filter accepts the following options: +

+
+
expr, e
+

Set expression, which is evaluated for each input frame. +

+

If the expression is evaluated to zero, the frame is discarded. +

+

If the evaluation result is negative or NaN, the frame is sent to the +first output; otherwise it is sent to the output with index +ceil(val)-1, assuming that the input index starts from 0. +

+

For example a value of 1.2 corresponds to the output with index +ceil(1.2)-1 = 2-1 = 1, that is the second output. +

+
+
outputs, n
+

Set the number of outputs. The output to which to send the selected +frame is based on the result of the evaluation. Default value is 1. +

+
+ +

The expression can contain the following constants: +

+
+
n
+

The (sequential) number of the filtered frame, starting from 0. +

+
+
selected_n
+

The (sequential) number of the selected frame, starting from 0. +

+
+
prev_selected_n
+

The sequential number of the last selected frame. It’s NAN if undefined. +

+
+
TB
+

The timebase of the input timestamps. +

+
+
pts
+

The PTS (Presentation TimeStamp) of the filtered frame, +expressed in TB units. It’s NAN if undefined. +

+
+
t
+

The PTS of the filtered frame, +expressed in seconds. It’s NAN if undefined. +

+
+
prev_pts
+

The PTS of the previously filtered frame. It’s NAN if undefined. +

+
+
prev_selected_pts
+

The PTS of the last previously filtered frame. It’s NAN if undefined. +

+
+
prev_selected_t
+

The PTS of the last previously selected frame, expressed in seconds. It’s NAN if undefined. +

+
+
start_pts
+

The first PTS in the stream which is not NAN. It remains NAN if not found. +

+
+
start_t
+

The first PTS, in seconds, in the stream which is not NAN. It remains NAN if not found. +

+
+
pict_type (video only)
+

The type of the filtered frame. It can assume one of the following +values: +

+
I
+
P
+
B
+
S
+
SI
+
SP
+
BI
+
+ +
+
interlace_type (video only)
+

The frame interlace type. It can assume one of the following values: +

+
PROGRESSIVE
+

The frame is progressive (not interlaced). +

+
TOPFIRST
+

The frame is top-field-first. +

+
BOTTOMFIRST
+

The frame is bottom-field-first. +

+
+ +
+
consumed_sample_n (audio only)
+

the number of selected samples before the current frame +

+
+
samples_n (audio only)
+

the number of samples in the current frame +

+
+
sample_rate (audio only)
+

the input sample rate +

+
+
key
+

This is 1 if the filtered frame is a key-frame, 0 otherwise. +

+
+
pos
+

the position in the file of the filtered frame, -1 if the information +is not available (e.g. for synthetic video); deprecated, do not use +

+
+
scene (video only)
+

value between 0 and 1 to indicate a new scene; a low value reflects a low +probability for the current frame to introduce a new scene, while a higher +value means the current frame is more likely to be one (see the example below) +

+
+
concatdec_select
+

The concat demuxer can select only part of a concat input file by setting an +inpoint and an outpoint, but the output packets may not be entirely contained +in the selected interval. By using this variable, it is possible to skip frames +generated by the concat demuxer which are not exactly contained in the selected +interval. +

+

This works by comparing the frame pts against the lavf.concat.start_time +and the lavf.concat.duration packet metadata values which are also +present in the decoded frames. +

+

The concatdec_select variable is -1 if the frame pts is at least +start_time and either the duration metadata is missing or the frame pts is less +than start_time + duration, 0 otherwise, and NaN if the start_time metadata is +missing. +

+

That basically means that an input frame is selected if its pts is within the +interval set by the concat demuxer. +

+
+
+ +

The default value of the select expression is "1". +

+ +
+

36.17.1 Examples

+ +
    +
  • Select all frames in input: +
    +
    select
    +
    + +

    The example above is the same as: +

    +
    select=1
    +
    + +
  • Skip all frames: +
    +
    select=0
    +
    + +
  • Select only I-frames: +
    +
    select='eq(pict_type\,I)'
    +
    + +
  • Select one frame every 100: +
    +
    select='not(mod(n\,100))'
    +
    + +
  • Select only frames contained in the 10-20 time interval: +
    +
    select=between(t\,10\,20)
    +
    + +
  • Select only I-frames contained in the 10-20 time interval: +
    +
    select=between(t\,10\,20)*eq(pict_type\,I)
    +
    + +
  • Select frames with a minimum distance of 10 seconds: +
    +
    select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
    +
    + +
  • Use aselect to select only audio frames with samples number > 100: +
    +
    aselect='gt(samples_n\,100)'
    +
    + +
  • Create a mosaic of the first scenes: +
    +
    ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
    +
    + +

    Comparing scene against a value between 0.3 and 0.5 is generally a sane +choice. +

    +
  • Send even and odd frames to separate outputs, and compose them: +
    +
    select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
    +
    + +
  • Select useful frames from an ffconcat file which is using inpoints and +outpoints but where the source files are not intra frame only. +
    +
    ffmpeg -copyts -vsync 0 -segment_time_metadata 1 -i input.ffconcat -vf select=concatdec_select -af aselect=concatdec_select output.avi
    +
    +
+ +
+
+
+

36.18 sendcmd, asendcmd

+ +

Send commands to filters in the filtergraph. +

+

These filters read commands to be sent to other filters in the +filtergraph. +

+

sendcmd must be inserted between two video filters, +asendcmd must be inserted between two audio filters, but apart +from that they act the same way. +

+

The specification of commands can be provided in the filter arguments +with the commands option, or in a file specified by the +filename option. +

+

These filters accept the following options: +

+
commands, c
+

Set the commands to be read and sent to the other filters. +

+
filename, f
+

Set the filename of the commands to be read and sent to the other +filters. +

+
+ + +
+

36.18.1 Commands syntax

+ +

A commands description consists of a sequence of interval +specifications, comprising a list of commands to be executed when a +particular event related to that interval occurs. The occurring event +is typically the current frame time entering or leaving a given time +interval. +

+

An interval is specified by the following syntax: +

+
START[-END] COMMANDS;
+
+ +

The time interval is specified by the START and END times. +END is optional and defaults to the maximum time. +

+

The current frame time is considered within the specified interval if +it is included in the interval [START, END), that is when +the time is greater or equal to START and is lesser than +END. +

+

COMMANDS consists of a sequence of one or more command +specifications, separated by ",", relating to that interval. The +syntax of a command specification is given by: +

+
[FLAGS] TARGET COMMAND ARG
+
+ +

FLAGS is optional and specifies the type of events relating to +the time interval which enable sending the specified command, and must +be a non-null sequence of identifier flags separated by "+" or "|" and +enclosed between "[" and "]". +

+

The following flags are recognized: +

+
enter
+

The command is sent when the current frame timestamp enters the +specified interval. In other words, the command is sent when the +previous frame timestamp was not in the given interval, and the +current is. +

+
+
leave
+

The command is sent when the current frame timestamp leaves the +specified interval. In other words, the command is sent when the +previous frame timestamp was in the given interval, and the +current is not. +

+
+
expr
+

The command ARG is interpreted as expression and result of +expression is passed as ARG. +

+

The expression is evaluated through the eval API and can contain the following +constants: +

+
+
POS
+

Original position in the file of the frame, or undefined if undefined +for the current frame. Deprecated, do not use. +

+
+
PTS
+

The presentation timestamp in input. +

+
+
N
+

The count of the input frame for video or audio, starting from 0. +

+
+
T
+

The time in seconds of the current frame. +

+
+
TS
+

The start time in seconds of the current command interval. +

+
+
TE
+

The end time in seconds of the current command interval. +

+
+
TI
+

The interpolated time of the current command interval, TI = (T - TS) / (TE - TS). +

+
+
W
+

The video frame width. +

+
+
H
+

The video frame height. +

+
+ +
+
+ +

If FLAGS is not specified, a default value of [enter] is +assumed. +

+

TARGET specifies the target of the command, usually the name of +the filter class or a specific filter instance name. +

+

COMMAND specifies the name of the command for the target filter. +

+

ARG is optional and specifies the optional list of argument for +the given COMMAND. +

+

Between one interval specification and another, whitespaces, or +sequences of characters starting with # until the end of line, +are ignored and can be used to annotate comments. +

+

A simplified BNF description of the commands specification syntax +follows: +

+
COMMAND_FLAG  ::= "enter" | "leave"
+COMMAND_FLAGS ::= COMMAND_FLAG [(+|"|")COMMAND_FLAG]
+COMMAND       ::= ["[" COMMAND_FLAGS "]"] TARGET COMMAND [ARG]
+COMMANDS      ::= COMMAND [,COMMANDS]
+INTERVAL      ::= START[-END] COMMANDS
+INTERVALS     ::= INTERVAL[;INTERVALS]
+
+ +
+
+

36.18.2 Examples

+ +
    +
  • Specify audio tempo change at second 4: +
    +
    asendcmd=c='4.0 atempo tempo 1.5',atempo
    +
    + +
  • Target a specific filter instance: +
    +
    asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
    +
    + +
  • Specify a list of drawtext and hue commands in a file. +
    +
    # show text in the interval 5-10
    +5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
    +         [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
    +
    +# desaturate the image in the interval 15-20
    +15.0-20.0 [enter] hue s 0,
    +          [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
    +          [leave] hue s 1,
    +          [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
    +
    +# apply an exponential saturation fade-out effect, starting from time 25
    +25 [enter] hue s exp(25-t)
    +
    + +

    A filtergraph allowing to read and process the above command list +stored in a file test.cmd, can be specified with: +

    +
    sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
    +
    +
+ +
+
+
+

36.19 setpts, asetpts

+ +

Change the PTS (presentation timestamp) of the input frames. +

+

setpts works on video frames, asetpts on audio frames. +

+

This filter accepts the following options: +

+
+
expr
+

The expression which is evaluated for each frame to construct its timestamp. +

+
+
+ +

The expression is evaluated through the eval API and can contain the following +constants: +

+
+
FRAME_RATE, FR
+

frame rate, only defined for constant frame-rate video +

+
+
PTS
+

The presentation timestamp in input +

+
+
N
+

The count of the input frame for video or the number of consumed samples, +not including the current frame for audio, starting from 0. +

+
+
NB_CONSUMED_SAMPLES
+

The number of consumed samples, not including the current frame (only +audio) +

+
+
NB_SAMPLES, S
+

The number of samples in the current frame (only audio) +

+
+
SAMPLE_RATE, SR
+

The audio sample rate. +

+
+
STARTPTS
+

The PTS of the first frame. +

+
+
STARTT
+

the time in seconds of the first frame +

+
+
INTERLACED
+

State whether the current frame is interlaced. +

+
+
T
+

the time in seconds of the current frame +

+
+
POS
+

original position in the file of the frame, or undefined if undefined +for the current frame; deprecated, do not use +

+
+
PREV_INPTS
+

The previous input PTS. +

+
+
PREV_INT
+

previous input time in seconds +

+
+
PREV_OUTPTS
+

The previous output PTS. +

+
+
PREV_OUTT
+

previous output time in seconds +

+
+
RTCTIME
+

The wallclock (RTC) time in microseconds. This is deprecated, use time(0) +instead. +

+
+
RTCSTART
+

The wallclock (RTC) time at the start of the movie in microseconds. +

+
+
TB
+

The timebase of the input timestamps. +

+
+
T_CHANGE
+

Time of the first frame after command was applied or time of the first frame if no commands. +

+
+
+ + +
+

36.19.1 Examples

+ +
    +
  • Start counting PTS from zero +
    +
    setpts=PTS-STARTPTS
    +
    + +
  • Apply fast motion effect: +
    +
    setpts=0.5*PTS
    +
    + +
  • Apply slow motion effect: +
    +
    setpts=2.0*PTS
    +
    + +
  • Set fixed rate of 25 frames per second: +
    +
    setpts=N/(25*TB)
    +
    + +
  • Set fixed rate 25 fps with some jitter: +
    +
    setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
    +
    + +
  • Apply an offset of 10 seconds to the input PTS: +
    +
    setpts=PTS+10/TB
    +
    + +
  • Generate timestamps from a "live source" and rebase onto the current timebase: +
    +
    setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
    +
    + +
  • Generate timestamps by counting samples: +
    +
    asetpts=N/SR/TB
    +
    + +
+ +
+
+

36.19.2 Commands

+ +

Both filters support all above options as commands. +

+
+
+
+

36.20 setrange

+ +

Force color range for the output video frame. +

+

The setrange filter marks the color range property for the +output frames. It does not change the input frame, but only sets the +corresponding property, which affects how the frame is treated by +following filters. +

+

The filter accepts the following options: +

+
+
range
+

Available values are: +

+
+
auto
+

Keep the same color range property. +

+
+
unspecified, unknown
+

Set the color range as unspecified. +

+
+
limited, tv, mpeg
+

Set the color range as limited. +

+
+
full, pc, jpeg
+

Set the color range as full. +

+
+
+
+ +
+
+

36.21 settb, asettb

+ +

Set the timebase to use for the output frames timestamps. +It is mainly useful for testing timebase configuration. +

+

It accepts the following parameters: +

+
+
expr, tb
+

The expression which is evaluated into the output timebase. +

+
+
+ +

The value for tb is an arithmetic expression representing a +rational. The expression can contain the constants "AVTB" (the default +timebase), "intb" (the input timebase) and "sr" (the sample rate, +audio only). Default value is "intb". +

+ +
+

36.21.1 Examples

+ +
    +
  • Set the timebase to 1/25: +
    +
    settb=expr=1/25
    +
    + +
  • Set the timebase to 1/10: +
    +
    settb=expr=0.1
    +
    + +
  • Set the timebase to 1001/1000: +
    +
    settb=1+0.001
    +
    + +
  • Set the timebase to 2*intb: +
    +
    settb=2*intb
    +
    + +
  • Set the default timebase value: +
    +
    settb=AVTB
    +
    +
+ +
+
+
+

36.22 showcqt

+

Convert input audio to a video output representing frequency spectrum +logarithmically using Brown-Puckette constant Q transform algorithm with +direct frequency domain coefficient calculation (but the transform itself +is not really constant Q, instead the Q factor is actually variable/clamped), +with musical tone scale, from E0 to D#10. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. It must be even. For the syntax of this option, +check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 1920x1080. +

+
+
fps, rate, r
+

Set the output frame rate. Default value is 25. +

+
+
bar_h
+

Set the bargraph height. It must be even. Default value is -1 which +computes the bargraph height automatically. +

+
+
axis_h
+

Set the axis height. It must be even. Default value is -1 which computes +the axis height automatically. +

+
+
sono_h
+

Set the sonogram height. It must be even. Default value is -1 which +computes the sonogram height automatically. +

+
+
fullhd
+

Set the fullhd resolution. This option is deprecated, use size, s +instead. Default value is 1. +

+
+
sono_v, volume
+

Specify the sonogram volume expression. It can contain variables: +

+
bar_v
+

the bar_v evaluated expression +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option +

+
+

and functions: +

+
a_weighting(f)
+

A-weighting of equal loudness +

+
b_weighting(f)
+

B-weighting of equal loudness +

+
c_weighting(f)
+

C-weighting of equal loudness. +

+
+

Default value is 16. +

+
+
bar_v, volume2
+

Specify the bargraph volume expression. It can contain variables: +

+
sono_v
+

the sono_v evaluated expression +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option +

+
+

and functions: +

+
a_weighting(f)
+

A-weighting of equal loudness +

+
b_weighting(f)
+

B-weighting of equal loudness +

+
c_weighting(f)
+

C-weighting of equal loudness. +

+
+

Default value is sono_v. +

+
+
sono_g, gamma
+

Specify the sonogram gamma. Lower gamma makes the spectrum more contrast, +higher gamma makes the spectrum having more range. Default value is 3. +Acceptable range is [1, 7]. +

+
+
bar_g, gamma2
+

Specify the bargraph gamma. Default value is 1. Acceptable range is +[1, 7]. +

+
+
bar_t
+

Specify the bargraph transparency level. Lower value makes the bargraph sharper. +Default value is 1. Acceptable range is [0, 1]. +

+
+
timeclamp, tc
+

Specify the transform timeclamp. At low frequency, there is trade-off between +accuracy in time domain and frequency domain. If timeclamp is lower, +event in time domain is represented more accurately (such as fast bass drum), +otherwise event in frequency domain is represented more accurately +(such as bass guitar). Acceptable range is [0.002, 1]. Default value is 0.17. +

+
+
attack
+

Set attack time in seconds. The default is 0 (disabled). Otherwise, it +limits future samples by applying asymmetric windowing in time domain, useful +when low latency is required. Accepted range is [0, 1]. +

+
+
basefreq
+

Specify the transform base frequency. Default value is 20.01523126408007475, +which is frequency 50 cents below E0. Acceptable range is [10, 100000]. +

+
+
endfreq
+

Specify the transform end frequency. Default value is 20495.59681441799654, +which is frequency 50 cents above D#10. Acceptable range is [10, 100000]. +

+
+
coeffclamp
+

This option is deprecated and ignored. +

+
+
tlength
+

Specify the transform length in time domain. Use this option to control accuracy +trade-off between time domain and frequency domain at every frequency sample. +It can contain variables: +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option. +

+
+

Default value is 384*tc/(384+tc*f). +

+
+
count
+

Specify the transform count for every video frame. Default value is 6. +Acceptable range is [1, 30]. +

+
+
fcount
+

Specify the transform count for every single pixel. Default value is 0, +which makes it computed automatically. Acceptable range is [0, 10]. +

+
+
fontfile
+

Specify font file for use with freetype to draw the axis. If not specified, +use embedded font. Note that drawing with font file or embedded font is not +implemented with custom basefreq and endfreq, use axisfile +option instead. +

+
+
font
+

Specify fontconfig pattern. This has lower priority than fontfile. The +: in the pattern may be replaced by | to avoid unnecessary +escaping. +

+
+
fontcolor
+

Specify font color expression. This is arithmetic expression that should return +integer value 0xRRGGBB. It can contain variables: +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option +

+
+

and functions: +

+
midi(f)
+

midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69) +

+
r(x), g(x), b(x)
+

red, green, and blue value of intensity x. +

+
+

Default value is st(0, (midi(f)-59.5)/12); +st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0)); +r(1-ld(1)) + b(ld(1)). +

+
+
axisfile
+

Specify image file to draw the axis. This option override fontfile and +fontcolor option. +

+
+
axis, text
+

Enable/disable drawing text to the axis. If it is set to 0, drawing to +the axis is disabled, ignoring fontfile and axisfile option. +Default value is 1. +

+
+
csp
+

Set colorspace. The accepted values are: +

+
unspecified
+

Unspecified (default) +

+
+
bt709
+

BT.709 +

+
+
fcc
+

FCC +

+
+
bt470bg
+

BT.470BG or BT.601-6 625 +

+
+
smpte170m
+

SMPTE-170M or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
bt2020ncl
+

BT.2020 with non-constant luminance +

+
+
+ +
+
cscheme
+

Set spectrogram color scheme. This is list of floating point values with format +left_r|left_g|left_b|right_r|right_g|right_b. +The default is 1|0.5|0|0|0.5|1. +

+
+
+ + +
+

36.22.1 Examples

+ +
    +
  • Playing audio while showing the spectrum: +
    +
    ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
    +
    + +
  • Same as above, but with frame rate 30 fps: +
    +
    ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
    +
    + +
  • Playing at 1280x720: +
    +
    ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
    +
    + +
  • Disable sonogram display: +
    +
    sono_h=0
    +
    + +
  • A1 and its harmonics: A1, A2, (near)E3, A3: +
    +
    ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
    +                 asplit[a][out1]; [a] showcqt [out0]'
    +
    + +
  • Same as above, but with more accuracy in frequency domain: +
    +
    ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
    +                 asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
    +
    + +
  • Custom volume: +
    +
    bar_v=10:sono_v=bar_v*a_weighting(f)
    +
    + +
  • Custom gamma, now spectrum is linear to the amplitude. +
    +
    bar_g=2:sono_g=2
    +
    + +
  • Custom tlength equation: +
    +
    tc=0.33:tlength='st(0,0.17); 384*tc / (384 / ld(0) + tc*f /(1-ld(0))) + 384*tc / (tc*f / ld(0) + 384 /(1-ld(0)))'
    +
    + +
  • Custom fontcolor and fontfile, C-note is colored green, others are colored blue: +
    +
    fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
    +
    + +
  • Custom font using fontconfig: +
    +
    font='Courier New,Monospace,mono|bold'
    +
    + +
  • Custom frequency range with custom axis using image file: +
    +
    axisfile=myaxis.png:basefreq=40:endfreq=10000
    +
    +
+ +
+
+
+

36.23 showcwt

+ +

Convert input audio to video output representing frequency spectrum +using Continuous Wavelet Transform and Morlet wavelet. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, +check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 640x512. +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+
+
scale
+

Set the frequency scale used. Allowed values are: +

+
+
linear
+
log2
+
bark
+
mel
+
erbs
+
+

Default value is linear. +

+
+
min
+

Set the minimum frequency that will be used in output. +Default is 20 Hz. +

+
+
max
+

Set the maximum frequency that will be used in output. +Default is 20000 Hz. The real frequency upper limit +depends on input audio’s sample rate and such will be enforced +on this value when it is set to value greater than Nyquist frequency. +

+
+
logb
+

Set the logarithmic basis for brightness strength when +mapping calculated magnitude values to pixel values. +Allowed range is from 0 to 1. +Default value is 0.0001. +

+
+
deviation
+

Set the frequency deviation. +Lower values than 1 are more frequency oriented, +while higher values than 1 are more time oriented. +Allowed range is from 0 to 10. +Default value is 1. +

+
+
pps
+

Set the number of pixel output per each second in one row. +Allowed range is from 1 to 1024. +Default value is 64. +

+
+
mode
+

Set the output visual mode. Allowed values are: +

+
+
magnitude
+

Show magnitude. +

+
phase
+

Show only phase. +

+
magphase
+

Show combination of magnitude and phase. +Magnitude is mapped to brightness and phase to color. +

+
channel
+

Show unique color per channel magnitude. +

+
stereo
+

Show unique color per stereo difference. +

+
+ +

Default value is magnitude. +

+
+
slide
+

Set the output slide method. Allowed values are: +

+
+
replace
+
scroll
+
frame
+
+ +
+
direction
+

Set the direction method for output slide method. Allowed values are: +

+
+
lr
+

Direction from left to right. +

+
rl
+

Direction from right to left. +

+
ud
+

Direction from up to down. +

+
du
+

Direction from down to up. +

+
+
+
+ +
+
+

36.24 showfreqs

+ +

Convert input audio to video output representing the audio power spectrum. +Audio amplitude is on Y-axis while frequency is on X-axis. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify size of video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default is 1024x512. +

+
+
rate, r
+

Set video rate. Default is 25. +

+
+
mode
+

Set display mode. +This set how each frequency bin will be represented. +

+

It accepts the following values: +

+
line
+
bar
+
dot
+
+

Default is bar. +

+
+
ascale
+

Set amplitude scale. +

+

It accepts the following values: +

+
lin
+

Linear scale. +

+
+
sqrt
+

Square root scale. +

+
+
cbrt
+

Cubic root scale. +

+
+
log
+

Logarithmic scale. +

+
+

Default is log. +

+
+
fscale
+

Set frequency scale. +

+

It accepts the following values: +

+
lin
+

Linear scale. +

+
+
log
+

Logarithmic scale. +

+
+
rlog
+

Reverse logarithmic scale. +

+
+

Default is lin. +

+
+
win_size
+

Set window size. Allowed range is from 16 to 65536. +

+

Default is 2048 +

+
+
win_func
+

Set windowing function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hanning. +

+
+
overlap
+

Set window overlap. In range [0, 1]. Default is 1, +which means optimal overlap for selected window function will be picked. +

+
+
averaging
+

Set time averaging. Setting this to 0 will display current maximal peaks. +Default is 1, which means time averaging is disabled. +

+
+
colors
+

Specify list of colors separated by space or by ’|’ which will be used to +draw channel frequencies. Unrecognized or missing colors will be replaced +by white color. +

+
+
cmode
+

Set channel display mode. +

+

It accepts the following values: +

+
combined
+
separate
+
+

Default is combined. +

+
+
minamp
+

Set minimum amplitude used in log amplitude scaler. +

+
+
data
+

Set data display mode. +

+

It accepts the following values: +

+
magnitude
+
phase
+
delay
+
+

Default is magnitude. +

+
+
channels
+

Set channels to use when processing audio. By default all are processed. +

+
+ +
+
+

36.25 showspatial

+ +

Convert stereo input audio to a video output, representing the spatial relationship +between two channels. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 512x512. +

+
+
win_size
+

Set window size. Allowed range is from 1024 to 65536. Default size is 4096. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+ +

Default value is hann. +

+
+
rate, r
+

Set output framerate. +

+
+ +
+
+

36.26 showspectrum

+ +

Convert input audio to a video output, representing the audio frequency +spectrum. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 640x512. +

+
+
slide
+

Specify how the spectrum should slide along the window. +

+

It accepts the following values: +

+
replace
+

the samples start again on the left when they reach the right +

+
scroll
+

the samples scroll from right to left +

+
fullframe
+

frames are only produced when the samples reach the right +

+
rscroll
+

the samples scroll from left to right +

+
lreplace
+

the samples start again on the right when they reach the left +

+
+ +

Default value is replace. +

+
+
mode
+

Specify display mode. +

+

It accepts the following values: +

+
combined
+

all channels are displayed in the same row +

+
separate
+

all channels are displayed in separate rows +

+
+ +

Default value is ‘combined’. +

+
+
color
+

Specify display color mode. +

+

It accepts the following values: +

+
channel
+

each channel is displayed in a separate color +

+
intensity
+

each channel is displayed using the same color scheme +

+
rainbow
+

each channel is displayed using the rainbow color scheme +

+
moreland
+

each channel is displayed using the moreland color scheme +

+
nebulae
+

each channel is displayed using the nebulae color scheme +

+
fire
+

each channel is displayed using the fire color scheme +

+
fiery
+

each channel is displayed using the fiery color scheme +

+
fruit
+

each channel is displayed using the fruit color scheme +

+
cool
+

each channel is displayed using the cool color scheme +

+
magma
+

each channel is displayed using the magma color scheme +

+
green
+

each channel is displayed using the green color scheme +

+
viridis
+

each channel is displayed using the viridis color scheme +

+
plasma
+

each channel is displayed using the plasma color scheme +

+
cividis
+

each channel is displayed using the cividis color scheme +

+
terrain
+

each channel is displayed using the terrain color scheme +

+
+ +

Default value is ‘channel’. +

+
+
scale
+

Specify scale used for calculating intensity color values. +

+

It accepts the following values: +

+
lin
+

linear +

+
sqrt
+

square root, default +

+
cbrt
+

cubic root +

+
log
+

logarithmic +

+
4thrt
+

4th root +

+
5thrt
+

5th root +

+
+ +

Default value is ‘sqrt’. +

+
+
fscale
+

Specify frequency scale. +

+

It accepts the following values: +

+
lin
+

linear +

+
log
+

logarithmic +

+
+ +

Default value is ‘lin’. +

+
+
saturation
+

Set saturation modifier for displayed colors. Negative values provide +alternative color scheme. 0 is no saturation at all. +Saturation must be in [-10.0, 10.0] range. +Default value is 1. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+ +

Default value is hann. +

+
+
orientation
+

Set orientation of time vs frequency axis. Can be vertical or +horizontal. Default is vertical. +

+
+
overlap
+

Set ratio of overlap window. Default value is 0. +When value is 1 overlap is set to recommended size for specific +window function currently used. +

+
+
gain
+

Set scale gain for calculating intensity color values. +Default value is 1. +

+
+
data
+

Set which data to display. Can be magnitude, default or phase, +or unwrapped phase: uphase. +

+
+
rotation
+

Set color rotation, must be in [-1.0, 1.0] range. +Default value is 0. +

+
+
start
+

Set start frequency from which to display spectrogram. Default is 0. +

+
+
stop
+

Set stop frequency to which to display spectrogram. Default is 0. +

+
+
fps
+

Set upper frame rate limit. Default is auto, unlimited. +

+
+
legend
+

Draw time and frequency axes and legends. Default is disabled. +

+
+
drange
+

Set dynamic range used to calculate intensity color values. Default is 120 dBFS. +Allowed range is from 10 to 200. +

+
+
limit
+

Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS. +Allowed range is from -100 to 100. +

+
+
opacity
+

Set opacity strength when using pixel format output with alpha component. +

+
+ +

The usage is very similar to the showwaves filter; see the examples in that +section. +

+ +
+

36.26.1 Examples

+ +
    +
  • Large window with logarithmic color scaling: +
    +
    showspectrum=s=1280x480:scale=log
    +
    + +
  • Complete example for a colored and sliding spectrum per channel using ffplay: +
    +
    ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
    +             [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
    +
    +
+ +
+
+
+

36.27 showspectrumpic

+ +

Convert input audio to a single video frame, representing the audio frequency +spectrum. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 4096x2048. +

+
+
mode
+

Specify display mode. +

+

It accepts the following values: +

+
combined
+

all channels are displayed in the same row +

+
separate
+

all channels are displayed in separate rows +

+
+

Default value is ‘combined’. +

+
+
color
+

Specify display color mode. +

+

It accepts the following values: +

+
channel
+

each channel is displayed in a separate color +

+
intensity
+

each channel is displayed using the same color scheme +

+
rainbow
+

each channel is displayed using the rainbow color scheme +

+
moreland
+

each channel is displayed using the moreland color scheme +

+
nebulae
+

each channel is displayed using the nebulae color scheme +

+
fire
+

each channel is displayed using the fire color scheme +

+
fiery
+

each channel is displayed using the fiery color scheme +

+
fruit
+

each channel is displayed using the fruit color scheme +

+
cool
+

each channel is displayed using the cool color scheme +

+
magma
+

each channel is displayed using the magma color scheme +

+
green
+

each channel is displayed using the green color scheme +

+
viridis
+

each channel is displayed using the viridis color scheme +

+
plasma
+

each channel is displayed using the plasma color scheme +

+
cividis
+

each channel is displayed using the cividis color scheme +

+
terrain
+

each channel is displayed using the terrain color scheme +

+
+

Default value is ‘intensity’. +

+
+
scale
+

Specify scale used for calculating intensity color values. +

+

It accepts the following values: +

+
lin
+

linear +

+
sqrt
+

square root, default +

+
cbrt
+

cubic root +

+
log
+

logarithmic +

+
4thrt
+

4th root +

+
5thrt
+

5th root +

+
+

Default value is ‘log’. +

+
+
fscale
+

Specify frequency scale. +

+

It accepts the following values: +

+
lin
+

linear +

+
log
+

logarithmic +

+
+ +

Default value is ‘lin’. +

+
+
saturation
+

Set saturation modifier for displayed colors. Negative values provide +alternative color scheme. 0 is no saturation at all. +Saturation must be in [-10.0, 10.0] range. +Default value is 1. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default value is hann. +

+
+
orientation
+

Set orientation of time vs frequency axis. Can be vertical or +horizontal. Default is vertical. +

+
+
gain
+

Set scale gain for calculating intensity color values. +Default value is 1. +

+
+
legend
+

Draw time and frequency axes and legends. Default is enabled. +

+
+
rotation
+

Set color rotation, must be in [-1.0, 1.0] range. +Default value is 0. +

+
+
start
+

Set start frequency from which to display spectrogram. Default is 0. +

+
+
stop
+

Set stop frequency to which to display spectrogram. Default is 0. +

+
+
drange
+

Set dynamic range used to calculate intensity color values. Default is 120 dBFS. +Allowed range is from 10 to 200. +

+
+
limit
+

Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS. +Allowed range is from -100 to 100. +

+
+
opacity
+

Set opacity strength when using pixel format output with alpha component. +

+
+ + +
+

36.27.1 Examples

+ +
    +
  • Extract an audio spectrogram of a whole audio track +in a 1024x1024 picture using ffmpeg: +
    +
    ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
    +
    +
+ +
+
+
+

36.28 showvolume

+ +

Convert input audio volume to a video output. +

+

The filter accepts the following options: +

+
+
rate, r
+

Set video rate. +

+
+
b
+

Set border width, allowed range is [0, 5]. Default is 1. +

+
+
w
+

Set channel width, allowed range is [80, 8192]. Default is 400. +

+
+
h
+

Set channel height, allowed range is [1, 900]. Default is 20. +

+
+
f
+

Set fade, allowed range is [0, 1]. Default is 0.95. +

+
+
c
+

Set volume color expression. +

+

The expression can use the following variables: +

+
+
VOLUME
+

Current max volume of channel in dB. +

+
+
PEAK
+

Current peak. +

+
+
CHANNEL
+

Current channel number, starting from 0. +

+
+ +
+
t
+

If set, displays channel names. Default is enabled. +

+
+
v
+

If set, displays volume values. Default is enabled. +

+
+
o
+

Set orientation, can be horizontal: h or vertical: v, +default is h. +

+
+
s
+

Set step size, allowed range is [0, 5]. Default is 0, which means +step is disabled. +

+
+
p
+

Set background opacity, allowed range is [0, 1]. Default is 0. +

+
+
m
+

Set metering mode, can be peak: p or rms: r, +default is p. +

+
+
ds
+

Set display scale, can be linear: lin or log: log, +default is lin. +

+
+
dm
+

In second. +If set to > 0., display a line for the max level +in the previous seconds. +default is disabled: 0. +

+
+
dmc
+

The color of the max line. Use when dm option is set to > 0. +default is: orange +

+
+ +
+
+

36.29 showwaves

+ +

Convert input audio to a video output, representing the samples waves. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 600x240. +

+
+
mode
+

Set display mode. +

+

Available values are: +

+
point
+

Draw a point for each sample. +

+
+
line
+

Draw a vertical line for each sample. +

+
+
p2p
+

Draw a point for each sample and a line between them. +

+
+
cline
+

Draw a centered vertical line for each sample. +

+
+ +

Default value is point. +

+
+
n
+

Set the number of samples which are printed on the same column. A +larger value will decrease the frame rate. Must be a positive +integer. This option can be set only if the value for rate +is not explicitly specified. +

+
+
rate, r
+

Set the (approximate) output frame rate. This is done by setting the +option n. Default value is "25". +

+
+
split_channels
+

Set if channels should be drawn separately or overlap. Default value is 0. +

+
+
colors
+

Set colors separated by ’|’ which are going to be used for drawing of each channel. +

+
+
scale
+

Set amplitude scale. +

+

Available values are: +

+
lin
+

Linear. +

+
+
log
+

Logarithmic. +

+
+
sqrt
+

Square root. +

+
+
cbrt
+

Cubic root. +

+
+ +

Default is linear. +

+
+
draw
+

Set the draw mode. This is mostly useful to set for high n. +

+

Available values are: +

+
scale
+

Scale pixel values for each drawn sample. +

+
+
full
+

Draw every sample directly. +

+
+ +

Default value is scale. +

+
+ + +
+

36.29.1 Examples

+ +
    +
  • Output the input file audio and the corresponding video representation +at the same time: +
    +
    amovie=a.mp3,asplit[out0],showwaves[out1]
    +
    + +
  • Create a synthetic signal and show it with showwaves, forcing a +frame rate of 30 frames per second: +
    +
    aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
    +
    +
+ +
+
+
+

36.30 showwavespic

+ +

Convert input audio to a single video frame, representing the samples waves. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 600x240. +

+
+
split_channels
+

Set if channels should be drawn separately or overlap. Default value is 0. +

+
+
colors
+

Set colors separated by ’|’ which are going to be used for drawing of each channel. +

+
+
scale
+

Set amplitude scale. +

+

Available values are: +

+
lin
+

Linear. +

+
+
log
+

Logarithmic. +

+
+
sqrt
+

Square root. +

+
+
cbrt
+

Cubic root. +

+
+ +

Default is linear. +

+
+
draw
+

Set the draw mode. +

+

Available values are: +

+
scale
+

Scale pixel values for each drawn sample. +

+
+
full
+

Draw every sample directly. +

+
+ +

Default value is scale. +

+
+
filter
+

Set the filter mode. +

+

Available values are: +

+
average
+

Use average samples values for each drawn sample. +

+
+
peak
+

Use peak samples values for each drawn sample. +

+
+ +

Default value is average. +

+
+ + +
+

36.30.1 Examples

+ +
    +
  • Extract a channel split representation of the wave form of a whole audio track +in a 1024x800 picture using ffmpeg: +
    +
    ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
    +
    +
+ +
+
+
+

36.31 sidedata, asidedata

+ +

Delete frame side data, or select frames based on it. +

+

This filter accepts the following options: +

+
+
mode
+

Set mode of operation of the filter. +

+

Can be one of the following: +

+
+
select
+

Select every frame with side data of type. +

+
+
delete
+

Delete side data of type. If type is not set, delete all side +data in the frame. +

+
+
+ +
+
type
+

Set side data type used with all modes. Must be set for select mode. For +the list of frame side data types, refer to the AVFrameSideDataType enum +in libavutil/frame.h. For example, to choose +AV_FRAME_DATA_PANSCAN side data, you must specify PANSCAN. +

+
+
+ +
+
+

36.32 spectrumsynth

+ +

Synthesize audio from 2 input video spectrums, first input stream represents +magnitude across time and second represents phase across time. +The filter will transform from frequency domain as displayed in videos back +to time domain as presented in audio output. +

+

This filter is primarily created for reversing processed showspectrum +filter outputs, but can synthesize sound from other spectrograms too. +But in such case results are going to be poor if the phase data is not +available, because in such cases phase data need to be recreated, usually +it’s just recreated from random noise. +For best results use gray only output (channel color mode in +showspectrum filter) and log scale for magnitude video and +lin scale for phase video. To produce phase, for 2nd video, use +data option. Inputs videos should generally use fullframe +slide mode as that saves resources needed for decoding video. +

+

The filter accepts the following options: +

+
+
sample_rate
+

Specify sample rate of output audio, the sample rate of audio from which +spectrum was generated may differ. +

+
+
channels
+

Set number of channels represented in input video spectrums. +

+
+
scale
+

Set scale which was used when generating magnitude input spectrum. +Can be lin or log. Default is log. +

+
+
slide
+

Set slide which was used when generating inputs spectrums. +Can be replace, scroll, fullframe or rscroll. +Default is fullframe. +

+
+
win_func
+

Set window function used for resynthesis. +

+
+
overlap
+

Set window overlap. In range [0, 1]. Default is 1, +which means optimal overlap for selected window function will be picked. +

+
+
orientation
+

Set orientation of input videos. Can be vertical or horizontal. +Default is vertical. +

+
+ + +
+

36.32.1 Examples

+ +
    +
  • First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate, +then resynthesize videos back to audio with spectrumsynth: +
    +
    ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=log:overlap=0.875:color=channel:slide=fullframe:data=magnitude -an -c:v rawvideo magnitude.nut
    +ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=lin:overlap=0.875:color=channel:slide=fullframe:data=phase -an -c:v rawvideo phase.nut
    +ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
    +
    +
+ +
+
+
+

36.33 split, asplit

+ +

Split input into several identical outputs. +

+

asplit works with audio input, split with video. +

+

The filter accepts a single parameter which specifies the number of outputs. If +unspecified, it defaults to 2. +

+ +
+

36.33.1 Examples

+ +
    +
  • Create two separate outputs from the same input: +
    +
    [in] split [out0][out1]
    +
    + +
  • To create 3 or more outputs, you need to specify the number of +outputs, like in: +
    +
    [in] asplit=3 [out0][out1][out2]
    +
    + +
  • Create two separate outputs from the same input, one cropped and +one padded: +
    +
    [in] split [splitout1][splitout2];
    +[splitout1] crop=100:100:0:0    [cropout];
    +[splitout2] pad=200:200:100:100 [padout];
    +
    + +
  • Create 5 copies of the input audio with ffmpeg: +
    +
    ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
    +
    +
+ +
+
+
+

36.34 zmq, azmq

+ +

Receive commands sent through a libzmq client, and forward them to +filters in the filtergraph. +

+

zmq and azmq work as a pass-through filters. zmq +must be inserted between two video filters, azmq between two +audio filters. Both are capable to send messages to any filter type. +

+

To enable these filters you need to install the libzmq library and +headers and configure FFmpeg with --enable-libzmq. +

+

For more information about libzmq see: +http://www.zeromq.org/ +

+

The zmq and azmq filters work as a libzmq server, which +receives messages sent through a network interface defined by the +bind_address (or the abbreviation "b") option. +Default value of this option is tcp://localhost:5555. You may +want to alter this value to your needs, but do not forget to escape any +’:’ signs (see filtergraph escaping). +

+

The received message must be in the form: +

+
TARGET COMMAND [ARG]
+
+ +

TARGET specifies the target of the command, usually the name of +the filter class or a specific filter instance name. The default +filter instance name uses the pattern ‘Parsed_<filter_name>_<index>’, +but you can override this by using the ‘filter_name@id’ syntax +(see Filtergraph syntax). +

+

COMMAND specifies the name of the command for the target filter. +

+

ARG is optional and specifies the optional argument list for the +given COMMAND. +

+

Upon reception, the message is processed and the corresponding command +is injected into the filtergraph. Depending on the result, the filter +will send a reply to the client, adopting the format: +

+
ERROR_CODE ERROR_REASON
+MESSAGE
+
+ +

MESSAGE is optional. +

+ +
+

36.34.1 Examples

+ +

Look at tools/zmqsend for an example of a zmq client which can +be used to send commands processed by these filters. +

+

Consider the following filtergraph generated by ffplay. +In this example the last overlay filter has an instance name. All other +filters will have default instance names. +

+
+
ffplay -dumpgraph 1 -f lavfi "
+color=s=100x100:c=red  [l];
+color=s=100x100:c=blue [r];
+nullsrc=s=200x100, zmq [bg];
+[bg][l]   overlay     [bg+l];
+[bg+l][r] overlay@my=x=100 "
+
+ +

To change the color of the left side of the video, the following +command can be used: +

+
echo Parsed_color_0 c yellow | tools/zmqsend
+
+ +

To change the right side: +

+
echo Parsed_color_1 c pink | tools/zmqsend
+
+ +

To change the position of the right side: +

+
echo overlay@my x 150 | tools/zmqsend
+
+ + + +
+
+
+
+

37 Multimedia Sources

+ +

Below is a description of the currently available multimedia sources. +

+ +
+

37.1 amovie

+ +

This is the same as movie source, except it selects an audio +stream by default. +

+
+
+

37.2 avsynctest

+

Generate an Audio/Video Sync Test. +

+

Generated stream periodically shows flash video frame and emits beep in audio. +Useful to inspect A/V sync issues. +

+

It accepts the following options: +

+
+
size, s
+

Set output video size. Default value is hd720. +

+
+
framerate, fr
+

Set output video frame rate. Default value is 30. +

+
+
samplerate, sr
+

Set output audio sample rate. Default value is 44100. +

+
+
amplitude, a
+

Set output audio beep amplitude. Default value is 0.7. +

+
+
period, p
+

Set output audio beep period in seconds. Default value is 3. +

+
+
delay, dl
+

Set output video flash delay in number of frames. Default value is 0. +

+
+
cycle, c
+

Enable cycling of video delays, by default is disabled. +

+
+
duration, d
+

Set stream output duration. By default duration is unlimited. +

+
+
fg, bg, ag
+

Set foreground/background/additional color. +

+
+ + +
+

37.2.1 Commands

+ +

This source supports the some above options as commands. +

+
+
+
+

37.3 movie

+ +

Read audio and/or video stream(s) from a movie container. +

+

It accepts the following parameters: +

+
+
filename
+

The name of the resource to read (not necessarily a file; it can also be a +device or a stream accessed through some protocol). +

+
+
format_name, f
+

Specifies the format assumed for the movie to read, and can be either +the name of a container or an input device. If not specified, the +format is guessed from movie_name or by probing. +

+
+
seek_point, sp
+

Specifies the seek point in seconds. The frames will be output +starting from this seek point. The parameter is evaluated with +av_strtod, so the numerical value may be suffixed by an IS +postfix. The default value is "0". +

+
+
streams, s
+

Specifies the streams to read. Several streams can be specified, +separated by "+". The source will then have as many outputs, in the +same order. The syntax is explained in the (ffmpeg)"Stream specifiers" +section in the ffmpeg manual. Two special names, "dv" and "da" specify +respectively the default (best suited) video and audio stream. Default +is "dv", or "da" if the filter is called as "amovie". +

+
+
stream_index, si
+

Specifies the index of the video stream to read. If the value is -1, +the most suitable video stream will be automatically selected. The default +value is "-1". Deprecated. If the filter is called "amovie", it will select +audio instead of video. +

+
+
loop
+

Specifies how many times to read the stream in sequence. +If the value is 0, the stream will be looped infinitely. +Default value is "1". +

+

Note that when the movie is looped the source timestamps are not +changed, so it will generate non monotonically increasing timestamps. +

+
+
discontinuity
+

Specifies the time difference between frames above which the point is +considered a timestamp discontinuity which is removed by adjusting the later +timestamps. +

+
+
dec_threads
+

Specifies the number of threads for decoding +

+
+
format_opts
+

Specify format options for the opened file. Format options can be specified +as a list of key=value pairs separated by ’:’. The following example +shows how to add protocol_whitelist and protocol_blacklist options: +

+
ffplay -f lavfi
+"movie=filename='1.sdp':format_opts='protocol_whitelist=file,rtp,udp\:protocol_blacklist=http'"
+
+
+
+ +

It allows overlaying a second video on top of the main input of +a filtergraph, as shown in this graph: +

+
input -----------> deltapts0 --> overlay --> output
+                                    ^
+                                    |
+movie --> scale--> deltapts1 -------+
+
+ +
+

37.3.1 Examples

+ +
    +
  • Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it +on top of the input labelled "in": +
    +
    movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
    +[in] setpts=PTS-STARTPTS [main];
    +[main][over] overlay=16:16 [out]
    +
    + +
  • Read from a video4linux2 device, and overlay it on top of the input +labelled "in": +
    +
    movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
    +[in] setpts=PTS-STARTPTS [main];
    +[main][over] overlay=16:16 [out]
    +
    + +
  • Read the first video stream and the audio stream with id 0x81 from +dvd.vob; the video is connected to the pad named "video" and the audio is +connected to the pad named "audio": +
    +
    movie=dvd.vob:s=v:0+#0x81 [video] [audio]
    +
    +
+ +
+
+

37.3.2 Commands

+ +

Both movie and amovie support the following commands: +

+
seek
+

Perform seek using "av_seek_frame". +The syntax is: seek stream_index|timestamp|flags +

    +
  • stream_index: If stream_index is -1, a default +stream is selected, and timestamp is automatically converted +from AV_TIME_BASE units to the stream specific time_base. +
  • timestamp: Timestamp in AVStream.time_base units +or, if no stream is specified, in AV_TIME_BASE units. +
  • flags: Flags which select direction and seeking mode. +
+ +
+
get_duration
+

Get movie duration in AV_TIME_BASE units. +

+
+
+ +
+
+
+
+

38 External libraries

+ +

FFmpeg can be hooked up with a number of external libraries to add support +for more formats. None of them are used by default, their use has to be +explicitly requested by passing the appropriate flags to +./configure. +

+ +
+

38.1 Alliance for Open Media (AOM)

+ +

FFmpeg can make use of the AOM library for AV1 decoding and encoding. +

+

Go to http://aomedia.org/ and follow the instructions for +installing the library. Then pass --enable-libaom to configure to +enable it. +

+
+
+

38.2 AMD AMF/VCE

+ +

FFmpeg can use the AMD Advanced Media Framework library +for accelerated H.264 and HEVC(only windows) encoding on hardware with Video Coding Engine (VCE). +

+

To enable support you must obtain the AMF framework header files(version 1.4.9+) from +https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git. +

+

Create an AMF/ directory in the system include path. +Copy the contents of AMF/amf/public/include/ into that directory. +Then configure FFmpeg with --enable-amf. +

+

Initialization of amf encoder occurs in this order: +1) trying to initialize through dx11(only windows) +2) trying to initialize through dx9(only windows) +3) trying to initialize through vulkan +

+

To use h.264(AMD VCE) encoder on linux amdgru-pro version 19.20+ and amf-amdgpu-pro +package(amdgru-pro contains, but does not install automatically) are required. +

+

This driver can be installed using amdgpu-pro-install script in official amd driver archive. +

+
+
+

38.3 AviSynth

+ +

FFmpeg can read AviSynth scripts as input. To enable support, pass +--enable-avisynth to configure after installing the headers +provided by AviSynth+. +AviSynth+ can be configured to install only the headers by either +passing -DHEADERS_ONLY:bool=on to the normal CMake-based build +system, or by using the supplied GNUmakefile. +

+

For Windows, supported AviSynth variants are +AviSynth 2.6 RC1 or higher for 32-bit builds and +AviSynth+ r1718 or higher for 32-bit and 64-bit builds. +

+

For Linux, macOS, and BSD, the only supported AviSynth variant is +AviSynth+, starting with version 3.5. +

+
+

In 2016, AviSynth+ added support for building with GCC. However, due to +the eccentricities of Windows’ calling conventions, 32-bit GCC builds +of AviSynth+ are not compatible with typical 32-bit builds of FFmpeg. +

+

By default, FFmpeg assumes compatibility with 32-bit MSVC builds of +AviSynth+ since that is the most widely-used and entrenched build +configuration. Users can override this and enable support for 32-bit +GCC builds of AviSynth+ by passing -DAVSC_WIN32_GCC32 to +--extra-cflags when configuring FFmpeg. +

+

64-bit builds of FFmpeg are not affected, and can use either MSVC or +GCC builds of AviSynth+ without any special flags. +

NOTE +

+
+

AviSynth(+) is loaded dynamically. Distributors can build FFmpeg +with --enable-avisynth, and the binaries will work regardless +of the end user having AviSynth installed. If/when an end user +would like to use AviSynth scripts, then they can install AviSynth(+) +and FFmpeg will be able to find and use it to open scripts. +

NOTE +

+
+
+

38.4 Chromaprint

+ +

FFmpeg can make use of the Chromaprint library for generating audio fingerprints. +Pass --enable-chromaprint to configure to +enable it. See https://acoustid.org/chromaprint. +

+
+
+

38.5 codec2

+ +

FFmpeg can make use of the codec2 library for codec2 decoding and encoding. +There is currently no native decoder, so libcodec2 must be used for decoding. +

+

Go to http://freedv.org/, download "Codec 2 source archive". +Build and install using CMake. Debian users can install the libcodec2-dev package instead. +Once libcodec2 is installed you can pass --enable-libcodec2 to configure to enable it. +

+

The easiest way to use codec2 is with .c2 files, since they contain the mode information required for decoding. +To encode such a file, use a .c2 file extension and give the libcodec2 encoder the -mode option: +ffmpeg -i input.wav -mode 700C output.c2. +Playback is as simple as ffplay output.c2. +For a list of supported modes, run ffmpeg -h encoder=libcodec2. +Raw codec2 files are also supported. +To make sense of them the mode in use needs to be specified as a format option: +ffmpeg -f codec2raw -mode 1300 -i input.raw output.wav. +

+
+
+

38.6 dav1d

+ +

FFmpeg can make use of the dav1d library for AV1 video decoding. +

+

Go to https://code.videolan.org/videolan/dav1d and follow the instructions for +installing the library. Then pass --enable-libdav1d to configure to enable it. +

+
+
+

38.7 davs2

+ +

FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video decoding. +

+

Go to https://github.com/pkuvcl/davs2 and follow the instructions for +installing the library. Then pass --enable-libdavs2 to configure to +enable it. +

+
+

libdavs2 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

38.8 uavs3d

+ +

FFmpeg can make use of the uavs3d library for AVS3-P2/IEEE1857.10 video decoding. +

+

Go to https://github.com/uavs3/uavs3d and follow the instructions for +installing the library. Then pass --enable-libuavs3d to configure to +enable it. +

+
+
+

38.9 Game Music Emu

+ +

FFmpeg can make use of the Game Music Emu library to read audio from supported video game +music file formats. Pass --enable-libgme to configure to +enable it. See https://bitbucket.org/mpyne/game-music-emu/overview. +

+
+
+

38.10 Intel QuickSync Video

+ +

FFmpeg can use Intel QuickSync Video (QSV) for accelerated decoding and encoding +of multiple codecs. To use QSV, FFmpeg must be linked against the libmfx +dispatcher, which loads the actual decoding libraries. +

+

The dispatcher is open source and can be downloaded from +https://github.com/lu-zero/mfx_dispatch.git. FFmpeg needs to be configured +with the --enable-libmfx option and pkg-config needs to be able to +locate the dispatcher’s .pc files. +

+
+
+

38.11 Kvazaar

+ +

FFmpeg can make use of the Kvazaar library for HEVC encoding. +

+

Go to https://github.com/ultravideo/kvazaar and follow the +instructions for installing the library. Then pass +--enable-libkvazaar to configure to enable it. +

+
+
+

38.12 LAME

+ +

FFmpeg can make use of the LAME library for MP3 encoding. +

+

Go to http://lame.sourceforge.net/ and follow the +instructions for installing the library. +Then pass --enable-libmp3lame to configure to enable it. +

+
+
+

38.13 libilbc

+ +

iLBC is a narrowband speech codec that has been made freely available +by Google as part of the WebRTC project. libilbc is a packaging friendly +copy of the iLBC codec. FFmpeg can make use of the libilbc library for +iLBC decoding and encoding. +

+

Go to https://github.com/TimothyGu/libilbc and follow the instructions for +installing the library. Then pass --enable-libilbc to configure to +enable it. +

+
+
+

38.14 libjxl

+ +

JPEG XL is an image format intended to fully replace legacy JPEG for an extended +period of life. See https://jpegxl.info/ for more information, and see +https://github.com/libjxl/libjxl for the library source. You can pass +--enable-libjxl to configure in order enable the libjxl wrapper. +

+
+
+

38.15 libvpx

+ +

FFmpeg can make use of the libvpx library for VP8/VP9 decoding and encoding. +

+

Go to http://www.webmproject.org/ and follow the instructions for +installing the library. Then pass --enable-libvpx to configure to +enable it. +

+
+
+

38.16 ModPlug

+ +

FFmpeg can make use of this library, originating in Modplug-XMMS, to read from MOD-like music files. +See https://github.com/Konstanty/libmodplug. Pass --enable-libmodplug to configure to +enable it. +

+
+
+

38.17 OpenCORE, VisualOn, and Fraunhofer libraries

+ +

Spun off Google Android sources, OpenCore, VisualOn and Fraunhofer +libraries provide encoders for a number of audio codecs. +

+
+

OpenCORE and VisualOn libraries are under the Apache License 2.0 +(see http://www.apache.org/licenses/LICENSE-2.0 for details), which is +incompatible to the LGPL version 2.1 and GPL version 2. You have to +upgrade FFmpeg’s license to LGPL version 3 (or if you have enabled +GPL components, GPL version 3) by passing --enable-version3 to configure in +order to use it. +

+

The license of the Fraunhofer AAC library is incompatible with the GPL. +Therefore, for GPL builds, you have to pass --enable-nonfree to +configure in order to use it. To the best of our knowledge, it is +compatible with the LGPL. +

NOTE +

+ +
+

38.17.1 OpenCORE AMR

+ +

FFmpeg can make use of the OpenCORE libraries for AMR-NB +decoding/encoding and AMR-WB decoding. +

+

Go to http://sourceforge.net/projects/opencore-amr/ and follow the +instructions for installing the libraries. +Then pass --enable-libopencore-amrnb and/or +--enable-libopencore-amrwb to configure to enable them. +

+
+
+

38.17.2 VisualOn AMR-WB encoder library

+ +

FFmpeg can make use of the VisualOn AMR-WBenc library for AMR-WB encoding. +

+

Go to http://sourceforge.net/projects/opencore-amr/ and follow the +instructions for installing the library. +Then pass --enable-libvo-amrwbenc to configure to enable it. +

+
+
+

38.17.3 Fraunhofer AAC library

+ +

FFmpeg can make use of the Fraunhofer AAC library for AAC decoding & encoding. +

+

Go to http://sourceforge.net/projects/opencore-amr/ and follow the +instructions for installing the library. +Then pass --enable-libfdk-aac to configure to enable it. +

+
+
+
+

38.18 OpenH264

+ +

FFmpeg can make use of the OpenH264 library for H.264 decoding and encoding. +

+

Go to http://www.openh264.org/ and follow the instructions for +installing the library. Then pass --enable-libopenh264 to configure to +enable it. +

+

For decoding, this library is much more limited than the built-in decoder +in libavcodec; currently, this library lacks support for decoding B-frames +and some other main/high profile features. (It currently only supports +constrained baseline profile and CABAC.) Using it is mostly useful for +testing and for taking advantage of Cisco’s patent portfolio license +(http://www.openh264.org/BINARY_LICENSE.txt). +

+
+
+

38.19 OpenJPEG

+ +

FFmpeg can use the OpenJPEG libraries for decoding/encoding J2K videos. Go to +http://www.openjpeg.org/ to get the libraries and follow the installation +instructions. To enable using OpenJPEG in FFmpeg, pass --enable-libopenjpeg to +./configure. +

+
+
+

38.20 rav1e

+ +

FFmpeg can make use of rav1e (Rust AV1 Encoder) via its C bindings to encode videos. +Go to https://github.com/xiph/rav1e/ and follow the instructions to build +the C library. To enable using rav1e in FFmpeg, pass --enable-librav1e +to ./configure. +

+
+
+

38.21 SVT-AV1

+ +

FFmpeg can make use of the Scalable Video Technology for AV1 library for AV1 encoding. +

+

Go to https://gitlab.com/AOMediaCodec/SVT-AV1/ and follow the instructions +for installing the library. Then pass --enable-libsvtav1 to configure to +enable it. +

+
+
+

38.22 TwoLAME

+ +

FFmpeg can make use of the TwoLAME library for MP2 encoding. +

+

Go to http://www.twolame.org/ and follow the +instructions for installing the library. +Then pass --enable-libtwolame to configure to enable it. +

+
+
+

38.23 VapourSynth

+ +

FFmpeg can read VapourSynth scripts as input. To enable support, pass +--enable-vapoursynth to configure. Vapoursynth is detected via +pkg-config. Versions 42 or greater supported. +See http://www.vapoursynth.com/. +

+

Due to security concerns, Vapoursynth scripts will not +be autodetected so the input format has to be forced. For ff* CLI tools, +add -f vapoursynth before the input -i yourscript.vpy. +

+
+
+

38.24 x264

+ +

FFmpeg can make use of the x264 library for H.264 encoding. +

+

Go to http://www.videolan.org/developers/x264.html and follow the +instructions for installing the library. Then pass --enable-libx264 to +configure to enable it. +

+
+

x264 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

38.25 x265

+ +

FFmpeg can make use of the x265 library for HEVC encoding. +

+

Go to http://x265.org/developers.html and follow the instructions +for installing the library. Then pass --enable-libx265 to configure +to enable it. +

+
+

x265 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

38.26 xavs

+ +

FFmpeg can make use of the xavs library for AVS encoding. +

+

Go to http://xavs.sf.net/ and follow the instructions for +installing the library. Then pass --enable-libxavs to configure to +enable it. +

+
+
+

38.27 xavs2

+ +

FFmpeg can make use of the xavs2 library for AVS2-P2/IEEE1857.4 video encoding. +

+

Go to https://github.com/pkuvcl/xavs2 and follow the instructions for +installing the library. Then pass --enable-libxavs2 to configure to +enable it. +

+
+

libxavs2 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

38.28 ZVBI

+ +

ZVBI is a VBI decoding library which can be used by FFmpeg to decode DVB +teletext pages and DVB teletext subtitles. +

+

Go to http://sourceforge.net/projects/zapping/ and follow the instructions for +installing the library. Then pass --enable-libzvbi to configure to +enable it. +

+
+
+
+

39 Supported File Formats, Codecs or Features

+ +

You can use the -formats and -codecs options to have an exhaustive list. +

+ +
+

39.1 File Formats

+ +

FFmpeg supports the following file formats through the libavformat +library: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
3dostrX
4xmX4X Technologies format, used in some games.
8088flex TMVX
AAXXAudible Enhanced Audio format, used in audiobooks.
AAXAudible Format 2, 3, and 4, used in audiobooks.
ACT VoiceXcontains G.729 audio
Adobe FilmstripXX
Audio IFF (AIFF)XX
American Laser Games MMXMultimedia format used in games like Mad Dog McCree.
3GPP AMRXX
Amazing Studio Packed Animation FileXMultimedia format used in game Heart Of Darkness.
Apple HTTP Live StreamingX
Artworx Data FormatX
Interplay ACMXAudio only format used in some Interplay games.
ADPXAudio format used on the Nintendo Gamecube.
AFCXAudio format used on the Nintendo Gamecube.
ADS/SS2XAudio format used on the PS2.
APNGXX
ASFXXAdvanced / Active Streaming Format.
ASTXXAudio format used on the Nintendo Wii.
AVIXX
AviSynthX
AVRXAudio format used on Mac.
AVSXMultimedia format used by the Creature Shock game.
Beam Software SIFFXAudio and video format used in some games by Beam Software.
Bethesda Softworks VIDXUsed in some games from Bethesda Softworks.
Binary textX
BinkXMultimedia format used by many games.
Bink AudioXAudio only multimedia format used by some games.
Bitmap Brothers JVXUsed in Z and Z95 games.
BRPXArgonaut Games format.
Brute Force & IgnoranceXUsed in the game Flash Traffic: City of Angels.
BFSTMXAudio format used on the Nintendo WiiU (based on BRSTM).
BRSTMXAudio format used on the Nintendo Wii.
BW64XBroadcast Wave 64bit.
BWFXX
codec2 (raw)XXMust be given -mode format option to decode correctly.
codec2 (.c2 files)XXContains header with version and mode info, simplifying playback.
CRI ADXXXAudio-only format used in console video games.
CRI AIXX
CRI HCAXAudio-only format used in console video games.
Discworld II BMVX
Interplay C93XUsed in the game Cyberia from Interplay.
Delphine Software International CINXMultimedia format used by Delphine Software games.
Digital Speech Standard (DSS)X
CD+GXVideo format used by CD+G karaoke disks
Phantom CineX
Commodore CDXLXAmiga CD video format
Core Audio FormatXXApple Core Audio Format
CRC testing formatX
Creative VoiceXXCreated for the Sound Blaster Pro.
CRYO APCXAudio format used in some games by CRYO Interactive Entertainment.
D-Cinema audioXX
Deluxe Paint AnimationX
DCSTRX
DFAXThis format is used in Chronomaster game
DirectDraw SurfaceX
DSD Stream File (DSF)X
DV videoXX
DXAXThis format is used in the non-Windows version of the Feeble Files + game and different game cutscenes repacked for use with ScummVM.
Electronic Arts cdataX
Electronic Arts MultimediaXUsed in various EA games; files have extensions like WVE and UV2.
Ensoniq Paris Audio FileX
FFM (FFserver live feed)XX
Flash (SWF)XX
Flash 9 (AVM2)XXOnly embedded audio is decoded.
FLI/FLC/FLX animationX.fli/.flc files
Flash Video (FLV)XXMacromedia Flash video files
framecrc testing formatX
FunCom ISSXAudio format used in various games from FunCom like The Longest Journey.
G.723.1XX
G.726XBoth left- and right-justified.
G.729 BITXX
G.729 rawX
GENHXAudio format for various games.
GIF AnimationXX
GXFXXGeneral eXchange Format SMPTE 360M, used by Thomson Grass Valley + playout servers.
HNMXOnly version 4 supported, used in some games from Cryo Interactive
iCEDraw FileX
ICOXXMicrosoft Windows ICO
id Quake II CIN videoX
id RoQXXUsed in Quake III, Jedi Knight 2 and other computer games.
IEC61937 encapsulationXX
IFFXInterchange File Format
IFVXA format used by some old CCTV DVRs.
iLBCXX
Interplay MVEXFormat used in various Interplay computer games.
Iterated Systems ClearVideoXI-frames only
IV8XA format generated by IndigoVision 8000 video server.
IVF (On2)XXA format used by libvpx
Internet Video RecordingX
IRCAMXX
LAFXLimitless Audio Format
LATMXX
LMLM4XUsed by Linux Media Labs MPEG-4 PCI boards
LOASXcontains LATM multiplexed AAC audio
LRCXX
LVFX
LXFXVR native stream format, used by Leitch/Harris’ video servers.
Magic Lantern Video (MLV)X
MatroskaXX
Matroska audioX
FFmpeg metadataXXMetadata in text format.
MAXIS XAXUsed in Sim City 3000; file extension .xa.
MCAXUsed in some games from Capcom; file extension .mca.
MD StudioX
Metal Gear Solid: The Twin SnakesX
Megalux FrameXUsed by Megalux Ultimate Paint
MobiClip MODSX
MobiClip MOFLEXX
Mobotix .mxgX
Monkey’s AudioX
Motion Pixels MVIX
MOV/QuickTime/MP4XX3GP, 3GP2, PSP, iPod variants supported
MP2XX
MP3XX
MPEG-1 SystemXXmuxed audio and video, VCD format supported
MPEG-PS (program stream)XXalso known as VOB file, SVCD and DVD format supported
MPEG-TS (transport stream)XXalso known as DVB Transport Stream
MPEG-4XXMPEG-4 is a variant of QuickTime.
MSFXAudio format used on the PS3.
Mirillis FIC videoXNo cursor rendering.
MIDI Sample Dump StandardX
MIME multipart JPEGX
MSN TCP webcamXUsed by MSN Messenger webcam streams.
MTVX
MusepackX
Musepack SV8X
Material eXchange Format (MXF)XXSMPTE 377M, used by D-Cinema, broadcast industry.
Material eXchange Format (MXF), D-10 MappingXXSMPTE 386M, D-10/IMX Mapping.
NC camera feedXNC (AVIP NC4600) camera streams
NIST SPeech HEader REsourcesX
Computerized Speech Lab NSPX
NTT TwinVQ (VQF)XNippon Telegraph and Telephone Corporation TwinVQ.
Nullsoft Streaming VideoX
NuppelVideoX
NUTXXNUT Open Container Format
OggXX
Playstation Portable PMPX
Portable Voice FormatX
RK Audio (RKA)X
TechnoTrend PVAXUsed by TechnoTrend DVB PCI boards.
QCPX
raw ADTS (AAC)XX
raw AC-3XX
raw AMR-NBX
raw AMR-WBX
raw APACX
raw aptXXX
raw aptX HDXX
raw BonkX
raw Chinese AVS videoXX
raw DFPWMXX
raw DiracXX
raw DNxHDXX
raw DTSXX
raw DTS-HDX
raw E-AC-3XX
raw FLACXX
raw GSMX
raw H.261XX
raw H.263XX
raw H.264XX
raw HEVCXX
raw Ingenient MJPEGX
raw MJPEGXX
raw MLPX
raw MPEGX
raw MPEG-1X
raw MPEG-2X
raw MPEG-4XX
raw NULLX
raw videoXX
raw id RoQX
raw OBUXX
raw SBCXX
raw ShortenX
raw TAKX
raw TrueHDXX
raw VC-1XX
raw PCM A-lawXX
raw PCM mu-lawXX
raw PCM Archimedes VIDCXX
raw PCM signed 8 bitXX
raw PCM signed 16 bit big-endianXX
raw PCM signed 16 bit little-endianXX
raw PCM signed 24 bit big-endianXX
raw PCM signed 24 bit little-endianXX
raw PCM signed 32 bit big-endianXX
raw PCM signed 32 bit little-endianXX
raw PCM signed 64 bit big-endianXX
raw PCM signed 64 bit little-endianXX
raw PCM unsigned 8 bitXX
raw PCM unsigned 16 bit big-endianXX
raw PCM unsigned 16 bit little-endianXX
raw PCM unsigned 24 bit big-endianXX
raw PCM unsigned 24 bit little-endianXX
raw PCM unsigned 32 bit big-endianXX
raw PCM unsigned 32 bit little-endianXX
raw PCM 16.8 floating point little-endianX
raw PCM 24.0 floating point little-endianX
raw PCM floating-point 32 bit big-endianXX
raw PCM floating-point 32 bit little-endianXX
raw PCM floating-point 64 bit big-endianXX
raw PCM floating-point 64 bit little-endianXX
RDTX
REDCODE R3DXFile format used by RED Digital cameras, contains JPEG 2000 frames and PCM audio.
RealMediaXX
RedirectorX
RedSparkX
Renderware TeXture DictionaryX
Resolume DXVX
RF64X
RL2XAudio and video format used in some games by Entertainment Software Partners.
RPL/ARMovieX
Lego Mindstorms RSOXX
RSDX
RTMPXXOutput is performed by publishing stream to RTMP server
RTPXX
RTSPXX
Sample Dump eXchangeX
SAPXX
SBGX
SDNSX
SDPX
SERX
Digital Pictures SGAX
Sega FILM/CPKXXUsed in many Sega Saturn console games.
Silicon Graphics MovieX
Sierra SOLX.sol files used in Sierra Online games.
Sierra VMDXUsed in Sierra CD-ROM games.
SmackerXMultimedia format used by many games.
SMJPEGXXUsed in certain Loki game ports.
SMPTE 337M encapsulationX
SmushXMultimedia format used in some LucasArts games.
Sony OpenMG (OMA)XXAudio format used in Sony Sonic Stage and Sony Vegas.
Sony PlayStation STRX
Sony Wave64 (W64)XX
SoX native formatXX
SUN AU formatXX
SUP raw PGS subtitlesXX
SVAGXAudio format used in Konami PS2 games.
TDSCX
Text filesX
THPXUsed on the Nintendo GameCube.
Tiertex Limited SEQXTiertex .seq files used in the DOS CD-ROM version of the game Flashback.
True AudioXX
VAGXAudio format used in many Sony PS2 games.
VC-1 test bitstreamXX
Vidvox HapXX
VivoX
VPKXAudio format used in Sony PS games.
Marble WADYX
WAVXX
Waveform ArchiverX
WavPackXX
WebMXX
Windows Televison (WTV)XX
Wing Commander III movieXMultimedia format used in Origin’s Wing Commander III computer game.
Westwood Studios audioXXMultimedia format used in Westwood Studios games.
Westwood Studios VQAXMultimedia format used in Westwood Studios games.
Wideband Single-bit Data (WSD)X
WVEX
Konami XMDX
XMVXMicrosoft video container used in Xbox games.
XVAGXAudio format used on the PS3.
xWMAXMicrosoft audio container used by XAudio 2.
eXtended BINary text (XBIN)X
YUV4MPEG pipeXX
Psygnosis YOPX
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+
+
+

39.2 Image Formats

+ +

FFmpeg can read and write images for each frame of a video sequence. The +following image formats are supported: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
.Y.U.VXXone raw file per component
Alias PIXXXAlias/Wavefront PIX image format
animated GIFXX
APNGXXAnimated Portable Network Graphics
BMPXXMicrosoft BMP image
BRender PIXXArgonaut BRender 3D engine image format.
CRIXCintel RAW
DPXXXDigital Picture Exchange
EXRXOpenEXR
FITSXXFlexible Image Transport System
HDRXXRadiance HDR RGBE Image format
IMGXGEM Raster image
JPEGXXProgressive JPEG is not supported.
JPEG 2000XX
JPEG-LSXX
LJPEGXLossless JPEG
Media 100X
MSPXMicrosoft Paint image
PAMXXPAM is a PNM extension with alpha support.
PBMXXPortable BitMap image
PCDXPhotoCD
PCXXXPC Paintbrush
PFMXXPortable FloatMap image
PGMXXPortable GrayMap image
PGMYUVXXPGM with U and V components in YUV 4:2:0
PGXXPGX file decoder
PHMXXPortable HalfFloatMap image
PICXPictor/PC Paint
PNGXXPortable Network Graphics image
PPMXXPortable PixelMap image
PSDXPhotoshop
PTXXV.Flash PTX format
QOIXXQuite OK Image format
SGIXXSGI RGB image format
Sun RasterfileXXSun RAS image format
TIFFXXYUV, JPEG and some extension is not supported yet.
Truevision TargaXXTarga (.TGA) image format
VBNXXVizrt Binary Image format
WBMPXXWireless Application Protocol Bitmap image format
WebPEXWebP image format, encoding supported through external library libwebp
XBMXXX BitMap image format
XFaceXXX-Face image format
XPMXX PixMap image format
XWDXXX Window Dump image format
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+

E means that support is provided through an external library. +

+
+
+

39.3 Video Codecs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
4X MovieXUsed in certain computer games.
8088flex TMVX
A64 multicolorXCreates video suitable to be played on a commodore 64 (multicolor mode).
Amazing Studio PAF VideoX
American Laser Games MMXUsed in games like Mad Dog McCree.
Amuse Graphics MovieX
AMV VideoXXUsed in Chinese MP3 players.
ANSI/ASCII artX
Apple Intermediate CodecX
Apple MJPEG-BX
Apple PixletX
Apple ProResXXfourcc: apch,apcn,apcs,apco,ap4h,ap4x
Apple QuickDrawXfourcc: qdrw
Argonaut VideoXUsed in some Argonaut games.
Asus v1XXfourcc: ASV1
Asus v2XXfourcc: ASV2
ATI VCR1Xfourcc: VCR1
ATI VCR2Xfourcc: VCR2
Auravision AuraX
Auravision Aura 2X
Autodesk Animator Flic videoX
Autodesk RLEXfourcc: AASC
AV1EESupported through external libraries libaom, libdav1d, librav1e and libsvtav1
Avid 1:1 10-bit RGB PackerXXfourcc: AVrp
AVS (Audio Video Standard) videoXVideo encoding used by the Creature Shock game.
AVS2-P2/IEEE1857.4EESupported through external libraries libxavs2 and libdavs2
AVS3-P2/IEEE1857.10ESupported through external library libuavs3d
AYUVXXMicrosoft uncompressed packed 4:4:4:4
Beam Software VBX
Bethesda VID videoXUsed in some games from Bethesda Softworks.
Bink VideoX
BitJazz SheerVideoX
Bitmap Brothers JV videoX
y41p Brooktree uncompressed 4:1:1 12-bitXX
Brooktree ProSumer VideoXfourcc: BT20
Brute Force & IgnoranceXUsed in the game Flash Traffic: City of Angels.
C93 videoXCodec used in Cyberia game.
CamStudioXfourcc: CSCD
CD+GXVideo codec for CD+G karaoke disks
CDXLXAmiga CD video codec
Chinese AVS videoEXAVS1-P2, JiZhun profile, encoding through external library libxavs
Delphine Software International CIN videoXCodec used in Delphine Software International games.
Discworld II BMV VideoX
CineForm HDXX
Canopus HQX
Canopus HQAX
Canopus HQXX
Canopus Lossless CodecX
CDToonsXCodec used in various Broderbund games.
CinepakX
Cirrus Logic AccuPakXXfourcc: CLJR
CPiA Video FormatX
Creative YUV (CYUV)X
DFAXCodec used in Chronomaster game.
DiracEXsupported though the native vc2 (Dirac Pro) encoder
Deluxe Paint AnimationX
DNxHDXXaka SMPTE VC3
Duck TrueMotion 1.0Xfourcc: DUCK
Duck TrueMotion 2.0Xfourcc: TM20
Duck TrueMotion 2.0 RTXfourcc: TR20
DV (Digital Video)XX
Dxtory capture formatX
Feeble Files/ScummVM DXAXCodec originally used in Feeble Files game.
Electronic Arts CMV videoXUsed in NHL 95 game.
Electronic Arts Madcow videoX
Electronic Arts TGV videoX
Electronic Arts TGQ videoX
Electronic Arts TQI videoX
Escape 124X
Escape 130X
FFmpeg video codec #1XXlossless codec (fourcc: FFV1)
Flash Screen Video v1XXfourcc: FSV1
Flash Screen Video v2XX
Flash Video (FLV)XXSorenson H.263 used in Flash
FM Screen Capture CodecX
Forward UncompressedX
FrapsX
Go2MeetingXfourcc: G2M2, G2M3
Go2WebinarXfourcc: G2M4
Gremlin Digital VideoX
H.261XX
H.263 / H.263-1996XX
H.263+ / H.263-1998 / H.263 version 2XX
H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10EXencoding supported through external library libx264 and OpenH264
HEVCXXencoding supported through external library libx265 and libkvazaar
HNM version 4X
HuffYUVXX
HuffYUV FFmpeg variantXX
IBM UltimotionXfourcc: ULTI
id Cinematic videoXUsed in Quake II.
id RoQ videoXXUsed in Quake III, Jedi Knight 2, other computer games.
IFF ILBMXIFF interleaved bitmap
IFF ByteRun1XIFF run length encoded bitmap
Infinity IMM4X
Intel H.263X
Intel Indeo 2X
Intel Indeo 3X
Intel Indeo 4X
Intel Indeo 5X
Interplay C93XUsed in the game Cyberia from Interplay.
Interplay MVE videoXUsed in Interplay .MVE files.
J2KXX
Karl Morton’s video codecXCodec used in Worms games.
Kega Game Video (KGV1)XKega emulator screen capture codec.
LagarithX
LCL (LossLess Codec Library) MSZHX
LCL (LossLess Codec Library) ZLIBEE
LOCOX
LucasArts SANM/SmushXUsed in LucasArts games / SMUSH animations.
lossless MJPEGXX
MagicYUV VideoXX
Mandsoft Screen Capture CodecX
Microsoft ATC ScreenXAlso known as Microsoft Screen 3.
Microsoft Expression Encoder ScreenXAlso known as Microsoft Titanium Screen 2.
Microsoft RLEX
Microsoft Screen 1XAlso known as Windows Media Video V7 Screen.
Microsoft Screen 2XAlso known as Windows Media Video V9 Screen.
Microsoft Video 1X
MimicXUsed in MSN Messenger Webcam streams.
Miro VideoXLXfourcc: VIXL
MJPEG (Motion JPEG)XX
Mobotix MxPEG videoX
Motion Pixels videoX
MPEG-1 videoXX
MPEG-2 videoXX
MPEG-4 part 2XXlibxvidcore can be used alternatively for encoding.
MPEG-4 part 2 Microsoft variant version 1X
MPEG-4 part 2 Microsoft variant version 2XX
MPEG-4 part 2 Microsoft variant version 3XX
Newtek SpeedHQXX
Nintendo Gamecube THP videoX
NotchLCX
NuppelVideo/RTjpegXVideo encoding used in NuppelVideo files.
On2 VP3Xstill experimental
On2 VP4Xfourcc: VP40
On2 VP5Xfourcc: VP50
On2 VP6Xfourcc: VP60,VP61,VP62
On2 VP7Xfourcc: VP70,VP71
VP8EXfourcc: VP80, encoding supported through external library libvpx
VP9EXencoding supported through external library libvpx
Pinnacle TARGA CineWave YUV16Xfourcc: Y216
Q-team QPEGXfourccs: QPEG, Q1.0, Q1.1
QuickTime 8BPS videoX
QuickTime Animation (RLE) videoXXfourcc: ’rle ’
QuickTime Graphics (SMC)XXfourcc: ’smc ’
QuickTime video (RPZA)XXfourcc: rpza
R10K AJA Kona 10-bit RGB CodecXX
R210 Quicktime Uncompressed RGB 10-bitXX
Raw VideoXX
RealVideo 1.0XX
RealVideo 2.0XX
RealVideo 3.0Xstill far from ideal
RealVideo 4.0X
Renderware TXD (TeXture Dictionary)XTexture dictionaries used by the Renderware Engine.
RL2 videoXused in some games by Entertainment Software Partners
ScreenPressorX
ScreenpressoX
Screen Recorder Gold CodecX
Sierra VMD videoXUsed in Sierra VMD files.
Silicon Graphics Motion Video Compressor 1 (MVC1)X
Silicon Graphics Motion Video Compressor 2 (MVC2)X
Silicon Graphics RLE 8-bit videoX
Smacker videoXVideo encoding used in Smacker.
SMPTE VC-1X
SnowXXexperimental wavelet codec (fourcc: SNOW)
Sony PlayStation MDEC (Motion DECoder)X
Sorenson Vector Quantizer 1XXfourcc: SVQ1
Sorenson Vector Quantizer 3Xfourcc: SVQ3
Sunplus JPEG (SP5X)Xfourcc: SP5X
TechSmith Screen Capture CodecXfourcc: TSCC
TechSmith Screen Capture Codec 2Xfourcc: TSC2
TheoraEXencoding supported through external library libtheora
Tiertex Limited SEQ videoXCodec used in DOS CD-ROM FlashBack game.
Ut VideoXX
v210 QuickTime uncompressed 4:2:2 10-bitXX
v308 QuickTime uncompressed 4:4:4XX
v408 QuickTime uncompressed 4:4:4:4XX
v410 QuickTime uncompressed 4:4:4 10-bitXX
VBLE Lossless CodecX
VMware Screen Codec / VMware VideoXCodec used in videos captured by VMware.
Westwood Studios VQA (Vector Quantized Animation) videoX
Windows Media ImageX
Windows Media Video 7XX
Windows Media Video 8XX
Windows Media Video 9Xnot completely working
Wing Commander III / XanXUsed in Wing Commander III .MVE files.
Wing Commander IV / XanXUsed in Wing Commander IV.
Winnov WNV1X
WMV7XX
YAMAHA SMAFXX
Psygnosis YOP VideoX
yuv4XXlibquicktime uncompressed packed 4:2:0
ZeroCodec Lossless VideoX
ZLIBXXpart of LCL, encoder experimental
Zip Motion Blocks VideoXXEncoder works only in PAL8.
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+

E means that support is provided through an external library. +

+
+
+

39.4 Audio Codecs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
8SVX exponentialX
8SVX fibonacciX
AACEXXencoding supported through internal encoder and external library libfdk-aac
AAC+EIXencoding supported through external library libfdk-aac
AC-3IXIX
ACELP.KELVINX
ADPCM 4X MovieX
ADPCM Yamaha AICAX
ADPCM AmuseGraphics MovieX
ADPCM Argonaut GamesXX
ADPCM CDROM XAX
ADPCM Creative TechnologyX16 -> 4, 8 -> 4, 8 -> 3, 8 -> 2
ADPCM Electronic ArtsXUsed in various EA titles.
ADPCM Electronic Arts Maxis CDROM XSXUsed in Sim City 3000.
ADPCM Electronic Arts R1X
ADPCM Electronic Arts R2X
ADPCM Electronic Arts R3X
ADPCM Electronic Arts XASX
ADPCM G.722XX
ADPCM G.726XX
ADPCM IMA Acorn ReplayX
ADPCM IMA AMVXXUsed in AMV files
ADPCM IMA Cunning DevelopmentsX
ADPCM IMA Electronic Arts EACSX
ADPCM IMA Electronic Arts SEADX
ADPCM IMA FuncomX
ADPCM IMA High Voltage Software ALPXX
ADPCM IMA Mobiclip MOFLEXX
ADPCM IMA QuickTimeXX
ADPCM IMA Simon & Schuster InteractiveXX
ADPCM IMA Ubisoft APMXX
ADPCM IMA Loki SDL MJPEGX
ADPCM IMA WAVXX
ADPCM IMA WestwoodX
ADPCM ISS IMAXUsed in FunCom games.
ADPCM IMA DialogicX
ADPCM IMA Duck DK3XUsed in some Sega Saturn console games.
ADPCM IMA Duck DK4XUsed in some Sega Saturn console games.
ADPCM IMA RadicalX
ADPCM MicrosoftXX
ADPCM MS IMAXX
ADPCM Nintendo Gamecube AFCX
ADPCM Nintendo Gamecube DTKX
ADPCM Nintendo THPX
ADPCM PlaystationX
ADPCM QT IMAXX
ADPCM SEGA CRI ADXXXUsed in Sega Dreamcast games.
ADPCM Shockwave FlashXX
ADPCM Sound Blaster Pro 2-bitX
ADPCM Sound Blaster Pro 2.6-bitX
ADPCM Sound Blaster Pro 4-bitX
ADPCM VIMAXUsed in LucasArts SMUSH animations.
ADPCM Konami XMDX
ADPCM Westwood Studios IMAXXUsed in Westwood Studios games like Command and Conquer.
ADPCM YamahaXX
ADPCM ZorkX
AMR-NBEXencoding supported through external library libopencore-amrnb
AMR-WBEXencoding supported through external library libvo-amrwbenc
Amazing Studio PAF AudioX
Apple lossless audioXXQuickTime fourcc ’alac’
aptXXXUsed in Bluetooth A2DP
aptX HDXXUsed in Bluetooth A2DP
ATRAC1X
ATRAC3X
ATRAC3+X
ATRAC9X
Bink AudioXUsed in Bink and Smacker files in many games.
Bonk audioX
CELTEdecoding supported through external library libcelt
codec2EEen/decoding supported through external library libcodec2
CRI HCAX
Delphine Software International CIN audioXCodec used in Delphine Software International games.
DFPWMXX
Digital Speech Standard - Standard Play mode (DSS SP)X
Discworld II BMV AudioX
COOKXAll versions except 5.1 are supported.
DCA (DTS Coherent Acoustics)XXsupported extensions: XCh, XXCH, X96, XBR, XLL, LBR (partially)
Dolby EX
DPCM Cuberoot-Delta-ExactXUsed in few games.
DPCM GremlinX
DPCM id RoQXXUsed in Quake III, Jedi Knight 2 and other computer games.
DPCM Marble WADYX
DPCM InterplayXUsed in various Interplay computer games.
DPCM Squareroot-Delta-ExactXUsed in various games.
DPCM Sierra OnlineXUsed in Sierra Online game audio files.
DPCM SolX
DPCM XanXUsed in Origin’s Wing Commander IV AVI files.
DPCM Xilam DERFX
DSD (Direct Stream Digital), least significant bit firstX
DSD (Direct Stream Digital), most significant bit firstX
DSD (Direct Stream Digital), least significant bit first, planarX
DSD (Direct Stream Digital), most significant bit first, planarX
DSP Group TrueSpeechX
DST (Direct Stream Transfer)X
DV audioX
Enhanced AC-3XX
EVRC (Enhanced Variable Rate Codec)X
FLAC (Free Lossless Audio Codec)XIX
FTR VoiceX
G.723.1XX
G.729X
GSMEXencoding supported through external library libgsm
GSM Microsoft variantEXencoding supported through external library libgsm
IAC (Indeo Audio Coder)X
iLBC (Internet Low Bitrate Codec)EEXencoding and decoding supported through external library libilbc
IMC (Intel Music Coder)X
Interplay ACMX
MACE (Macintosh Audio Compression/Expansion) 3:1X
MACE (Macintosh Audio Compression/Expansion) 6:1X
Marian’s A-pac audioX
MI-SC4 (Micronas SC-4 Audio)X
MLP (Meridian Lossless Packing)XXUsed in DVD-Audio discs.
Monkey’s AudioX
MP1 (MPEG audio layer 1)IX
MP2 (MPEG audio layer 2)IXIXencoding supported also through external library TwoLAME
MP3 (MPEG audio layer 3)EIXencoding supported through external library LAME, ADU MP3 and MP3onMP4 also supported
MPEG-4 Audio Lossless Coding (ALS)X
MobiClip FastAudioX
Musepack SV7X
Musepack SV8X
Nellymoser AsaoXX
On2 AVC (Audio for Video Codec)X
OpusEXencoding supported through external library libopus
PCM A-lawXX
PCM mu-lawXX
PCM Archimedes VIDCXX
PCM signed 8-bit planarXX
PCM signed 16-bit big-endian planarXX
PCM signed 16-bit little-endian planarXX
PCM signed 24-bit little-endian planarXX
PCM signed 32-bit little-endian planarXX
PCM 32-bit floating point big-endianXX
PCM 32-bit floating point little-endianXX
PCM 64-bit floating point big-endianXX
PCM 64-bit floating point little-endianXX
PCM D-Cinema audio signed 24-bitXX
PCM signed 8-bitXX
PCM signed 16-bit big-endianXX
PCM signed 16-bit little-endianXX
PCM signed 24-bit big-endianXX
PCM signed 24-bit little-endianXX
PCM signed 32-bit big-endianXX
PCM signed 32-bit little-endianXX
PCM signed 16/20/24-bit big-endian in MPEG-TSX
PCM unsigned 8-bitXX
PCM unsigned 16-bit big-endianXX
PCM unsigned 16-bit little-endianXX
PCM unsigned 24-bit big-endianXX
PCM unsigned 24-bit little-endianXX
PCM unsigned 32-bit big-endianXX
PCM unsigned 32-bit little-endianXX
PCM SGAX
QCELP / PureVoiceX
QDesign Music Codec 1X
QDesign Music Codec 2XThere are still some distortions.
RealAudio 1.0 (14.4K)XXReal 14400 bit/s codec
RealAudio 2.0 (28.8K)XReal 28800 bit/s codec
RealAudio 3.0 (dnet)IXXReal low bitrate AC-3 codec
RealAudio LosslessX
RealAudio SIPR / ACELP.NETX
RK Audio (RKA)X
SBC (low-complexity subband codec)XXUsed in Bluetooth A2DP
ShortenX
Sierra VMD audioXUsed in Sierra VMD files.
Smacker audioX
SMPTE 302M AES3 audioXX
SonicXXexperimental codec
Sonic losslessXXexperimental codec
SpeexEEXsupported through external library libspeex
TAK (Tom’s lossless Audio Kompressor)X
True Audio (TTA)XX
TrueHDXXUsed in HD-DVD and Blu-Ray discs.
TwinVQ (VQF flavor)X
VIMAXUsed in LucasArts SMUSH animations.
ViewQuest VQCX
VorbisEXA native but very primitive encoder exists.
Voxware MetaSoundX
Waveform ArchiverX
WavPackXX
Westwood Audio (SND1)X
Windows Media Audio 1XX
Windows Media Audio 2XX
Windows Media Audio LosslessX
Windows Media Audio ProX
Windows Media Audio VoiceX
Xbox Media Audio 1X
Xbox Media Audio 2X
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+

E means that support is provided through an external library. +

+

I means that an integer-only version is available, too (ensures high +performance on systems without hardware floating point support). +

+
+
+

39.5 Subtitle Formats

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameMuxingDemuxingEncodingDecoding
3GPP Timed TextXX
AQTitleXX
DVBXXXX
DVB teletextXE
DVDXXXX
JACOsubXXX
MicroDVDXXX
MPL2XX
MPsub (MPlayer)XX
PGSX
PJS (Phoenix)XX
RealTextXX
SAMIXX
Spruce format (STL)XX
SSA/ASSXXXX
SubRip (SRT)XXXX
SubViewer v1XX
SubViewerXX
TED Talks captionsXX
TTMLXX
VobSub (IDX+SUB)XX
VPlayerXX
WebVTTXXXX
XSUBXX
+ +

X means that the feature is supported. +

+

E means that support is provided through an external library. +

+
+
+

39.6 Network Protocols

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameSupport
AMQPE
fileX
FTPX
GopherX
GophersX
HLSX
HTTPX
HTTPSX
IcecastX
MMSHX
MMSTX
pipeX
Pro-MPEG FECX
RTMPX
RTMPEX
RTMPSX
RTMPTX
RTMPTEX
RTMPTSX
RTPX
SAMBAE
SCTPX
SFTPE
TCPX
TLSX
UDPX
ZMQE
+ +

X means that the protocol is supported. +

+

E means that support is provided through an external library. +

+ +
+
+

39.7 Input/Output Devices

+ + + + + + + + + + + + + + + + + + + + + + +
NameInputOutput
ALSAXX
BKTRX
cacaX
DV1394X
Lavfi virtual deviceX
Linux framebufferXX
JACKX
LIBCDIOX
LIBDC1394X
OpenALX
OpenGLX
OSSXX
PulseAudioXX
SDLX
Video4Linux2XX
VfW captureX
X11 grabbingX
Win32 grabbingX
+ +

X means that input/output is supported. +

+
+
+

39.8 Timecode

+ + + + + + + + + + +
Codec/formatReadWrite
AVIXX
DVXX
GXFXX
MOVXX
MPEG1/2XX
MXFXX
+ +
+
+ +
+

41 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffplay.html b/mm_avh_working_space/bin/ffmpeg/doc/ffplay.html new file mode 100644 index 0000000000000000000000000000000000000000..d0c29449346519ed2909c41b8fa50277cfbe89c3 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffplay.html @@ -0,0 +1,893 @@ + + + + + +ffplay Documentation + + + + + + + + + + + + + + + + + +
+ + + +
+

1 Synopsis

+ +

ffplay [options] [input_url] +

+
+
+

2 Description

+ +

FFplay is a very simple and portable media player using the FFmpeg +libraries and the SDL library. It is mostly used as a testbed for the +various FFmpeg APIs. +

+
+
+

3 Options

+ +

All the numerical options, if not specified otherwise, accept a string +representing a number as input, which may be followed by one of the SI +unit prefixes, for example: ’K’, ’M’, or ’G’. +

+

If ’i’ is appended to the SI unit prefix, the complete prefix will be +interpreted as a unit prefix for binary multiples, which are based on +powers of 1024 instead of powers of 1000. Appending ’B’ to the SI unit +prefix multiplies the value by 8. This allows using, for example: +’KB’, ’MiB’, ’G’ and ’B’ as number suffixes. +

+

Options which do not take arguments are boolean options, and set the +corresponding value to true. They can be set to false by prefixing +the option name with "no". For example using "-nofoo" +will set the boolean option with name "foo" to false. +

+ +
+

3.1 Stream specifiers

+

Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers +are used to precisely specify which stream(s) a given option belongs to. +

+

A stream specifier is a string generally appended to the option name and +separated from it by a colon. E.g. -codec:a:1 ac3 contains the +a:1 stream specifier, which matches the second audio stream. Therefore, it +would select the ac3 codec for the second audio stream. +

+

A stream specifier can match several streams, so that the option is applied to all +of them. E.g. the stream specifier in -b:a 128k matches all audio +streams. +

+

An empty stream specifier matches all streams. For example, -codec copy +or -codec: copy would copy all the streams without reencoding. +

+

Possible forms of stream specifiers are: +

+
stream_index
+

Matches the stream with this index. E.g. -threads:1 4 would set the +thread count for the second stream to 4. If stream_index is used as an +additional stream specifier (see below), then it selects stream number +stream_index from the matching streams. Stream numbering is based on the +order of the streams as detected by libavformat except when a program ID is +also specified. In this case it is based on the ordering of the streams in the +program. +

+
stream_type[:additional_stream_specifier]
+

stream_type is one of following: ’v’ or ’V’ for video, ’a’ for audio, ’s’ +for subtitle, ’d’ for data, and ’t’ for attachments. ’v’ matches all video +streams, ’V’ only matches video streams which are not attached pictures, video +thumbnails or cover arts. If additional_stream_specifier is used, then +it matches streams which both have this type and match the +additional_stream_specifier. Otherwise, it matches all streams of the +specified type. +

+
p:program_id[:additional_stream_specifier]
+

Matches streams which are in the program with the id program_id. If +additional_stream_specifier is used, then it matches streams which both +are part of the program and match the additional_stream_specifier. +

+
+
#stream_id or i:stream_id
+

Match the stream by stream id (e.g. PID in MPEG-TS container). +

+
m:key[:value]
+

Matches streams with the metadata tag key having the specified value. If +value is not given, matches streams that contain the given tag with any +value. +

+
u
+

Matches streams with usable configuration, the codec must be defined and the +essential information such as video dimension or audio sample rate must be present. +

+

Note that in ffmpeg, matching by metadata will only work properly for +input files. +

+
+ +
+
+

3.2 Generic options

+ +

These options are shared amongst the ff* tools. +

+
+
-L
+

Show license. +

+
+
-h, -?, -help, --help [arg]
+

Show help. An optional parameter may be specified to print help about a specific +item. If no argument is specified, only basic (non advanced) tool +options are shown. +

+

Possible values of arg are: +

+
long
+

Print advanced tool options in addition to the basic tool options. +

+
+
full
+

Print complete list of options, including shared and private options +for encoders, decoders, demuxers, muxers, filters, etc. +

+
+
decoder=decoder_name
+

Print detailed information about the decoder named decoder_name. Use the +-decoders option to get a list of all decoders. +

+
+
encoder=encoder_name
+

Print detailed information about the encoder named encoder_name. Use the +-encoders option to get a list of all encoders. +

+
+
demuxer=demuxer_name
+

Print detailed information about the demuxer named demuxer_name. Use the +-formats option to get a list of all demuxers and muxers. +

+
+
muxer=muxer_name
+

Print detailed information about the muxer named muxer_name. Use the +-formats option to get a list of all muxers and demuxers. +

+
+
filter=filter_name
+

Print detailed information about the filter named filter_name. Use the +-filters option to get a list of all filters. +

+
+
bsf=bitstream_filter_name
+

Print detailed information about the bitstream filter named bitstream_filter_name. +Use the -bsfs option to get a list of all bitstream filters. +

+
+
protocol=protocol_name
+

Print detailed information about the protocol named protocol_name. +Use the -protocols option to get a list of all protocols. +

+
+ +
+
-version
+

Show version. +

+
+
-buildconf
+

Show the build configuration, one option per line. +

+
+
-formats
+

Show available formats (including devices). +

+
+
-demuxers
+

Show available demuxers. +

+
+
-muxers
+

Show available muxers. +

+
+
-devices
+

Show available devices. +

+
+
-codecs
+

Show all codecs known to libavcodec. +

+

Note that the term ’codec’ is used throughout this documentation as a shortcut +for what is more correctly called a media bitstream format. +

+
+
-decoders
+

Show available decoders. +

+
+
-encoders
+

Show all available encoders. +

+
+
-bsfs
+

Show available bitstream filters. +

+
+
-protocols
+

Show available protocols. +

+
+
-filters
+

Show available libavfilter filters. +

+
+
-pix_fmts
+

Show available pixel formats. +

+
+
-sample_fmts
+

Show available sample formats. +

+
+
-layouts
+

Show channel names and standard channel layouts. +

+
+
-dispositions
+

Show stream dispositions. +

+
+
-colors
+

Show recognized color names. +

+
+
-sources device[,opt1=val1[,opt2=val2]...]
+

Show autodetected sources of the input device. +Some devices may provide system-dependent source names that cannot be autodetected. +The returned list cannot be assumed to be always complete. +

+
ffmpeg -sources pulse,server=192.168.0.4
+
+ +
+
-sinks device[,opt1=val1[,opt2=val2]...]
+

Show autodetected sinks of the output device. +Some devices may provide system-dependent sink names that cannot be autodetected. +The returned list cannot be assumed to be always complete. +

+
ffmpeg -sinks pulse,server=192.168.0.4
+
+ +
+
-loglevel [flags+]loglevel | -v [flags+]loglevel
+

Set logging level and flags used by the library. +

+

The optional flags prefix can consist of the following values: +

+
repeat
+

Indicates that repeated log output should not be compressed to the first line +and the "Last message repeated n times" line will be omitted. +

+
level
+

Indicates that log output should add a [level] prefix to each message +line. This can be used as an alternative to log coloring, e.g. when dumping the +log to file. +

+
+

Flags can also be used alone by adding a ’+’/’-’ prefix to set/reset a single +flag without affecting other flags or changing loglevel. When +setting both flags and loglevel, a ’+’ separator is expected +between the last flags value and before loglevel. +

+

loglevel is a string or a number containing one of the following values: +

+
quiet, -8
+

Show nothing at all; be silent. +

+
panic, 0
+

Only show fatal errors which could lead the process to crash, such as +an assertion failure. This is not currently used for anything. +

+
fatal, 8
+

Only show fatal errors. These are errors after which the process absolutely +cannot continue. +

+
error, 16
+

Show all errors, including ones which can be recovered from. +

+
warning, 24
+

Show all warnings and errors. Any message related to possibly +incorrect or unexpected events will be shown. +

+
info, 32
+

Show informative messages during processing. This is in addition to +warnings and errors. This is the default value. +

+
verbose, 40
+

Same as info, except more verbose. +

+
debug, 48
+

Show everything, including debugging information. +

+
trace, 56
+
+ +

For example to enable repeated log output, add the level prefix, and set +loglevel to verbose: +

+
ffmpeg -loglevel repeat+level+verbose -i input output
+
+

Another example that enables repeated log output without affecting current +state of level prefix flag or loglevel: +

+
ffmpeg [...] -loglevel +repeat
+
+ +

By default the program logs to stderr. If coloring is supported by the +terminal, colors are used to mark errors and warnings. Log coloring +can be disabled setting the environment variable +AV_LOG_FORCE_NOCOLOR, or can be forced setting +the environment variable AV_LOG_FORCE_COLOR. +

+
+
-report
+

Dump full command line and log output to a file named +program-YYYYMMDD-HHMMSS.log in the current +directory. +This file can be useful for bug reports. +It also implies -loglevel debug. +

+

Setting the environment variable FFREPORT to any value has the +same effect. If the value is a ’:’-separated key=value sequence, these +options will affect the report; option values must be escaped if they +contain special characters or the options delimiter ’:’ (see the +“Quoting and escaping” section in the ffmpeg-utils manual). +

+

The following options are recognized: +

+
file
+

set the file name to use for the report; %p is expanded to the name +of the program, %t is expanded to a timestamp, %% is expanded +to a plain % +

+
level
+

set the log verbosity level using a numerical value (see -loglevel). +

+
+ +

For example, to output a report to a file named ffreport.log +using a log level of 32 (alias for log level info): +

+
+
FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
+
+ +

Errors in parsing the environment variable are not fatal, and will not +appear in the report. +

+
+
-hide_banner
+

Suppress printing banner. +

+

All FFmpeg tools will normally show a copyright notice, build options +and library versions. This option can be used to suppress printing +this information. +

+
+
-cpuflags flags (global)
+

Allows setting and clearing cpu flags. This option is intended +for testing. Do not use it unless you know what you’re doing. +

+
ffmpeg -cpuflags -sse+mmx ...
+ffmpeg -cpuflags mmx ...
+ffmpeg -cpuflags 0 ...
+
+

Possible flags for this option are: +

+
x86
+
+
mmx
+
mmxext
+
sse
+
sse2
+
sse2slow
+
sse3
+
sse3slow
+
ssse3
+
atom
+
sse4.1
+
sse4.2
+
avx
+
avx2
+
xop
+
fma3
+
fma4
+
3dnow
+
3dnowext
+
bmi1
+
bmi2
+
cmov
+
+
+
ARM
+
+
armv5te
+
armv6
+
armv6t2
+
vfp
+
vfpv3
+
neon
+
setend
+
+
+
AArch64
+
+
armv8
+
vfp
+
neon
+
+
+
PowerPC
+
+
altivec
+
+
+
Specific Processors
+
+
pentium2
+
pentium3
+
pentium4
+
k6
+
k62
+
athlon
+
athlonxp
+
k8
+
+
+
+ +
+
-cpucount count (global)
+

Override detection of CPU count. This option is intended +for testing. Do not use it unless you know what you’re doing. +

+
ffmpeg -cpucount 2
+
+ +
+
-max_alloc bytes
+

Set the maximum size limit for allocating a block on the heap by ffmpeg’s +family of malloc functions. Exercise extreme caution when using +this option. Don’t use if you do not understand the full consequence of doing so. +Default is INT_MAX. +

+
+ +
+
+

3.3 AVOptions

+ +

These options are provided directly by the libavformat, libavdevice and +libavcodec libraries. To see the list of available AVOptions, use the +-help option. They are separated into two categories: +

+
generic
+

These options can be set for any container, codec or device. Generic options +are listed under AVFormatContext options for containers/devices and under +AVCodecContext options for codecs. +

+
private
+

These options are specific to the given container, device or codec. Private +options are listed under their corresponding containers/devices/codecs. +

+
+ +

For example to write an ID3v2.3 header instead of a default ID3v2.4 to +an MP3 file, use the id3v2_version private option of the MP3 +muxer: +

+
ffmpeg -i input.flac -id3v2_version 3 out.mp3
+
+ +

All codec AVOptions are per-stream, and thus a stream specifier +should be attached to them: +

+
ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4
+
+ +

In the above example, a multichannel audio stream is mapped twice for output. +The first instance is encoded with codec ac3 and bitrate 640k. +The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using +absolute index of the output stream. +

+

Note: the -nooption syntax cannot be used for boolean +AVOptions, use -option 0/-option 1. +

+

Note: the old undocumented way of specifying per-stream AVOptions by +prepending v/a/s to the options name is now obsolete and will be +removed soon. +

+
+
+

3.4 Main options

+ +
+
-x width
+

Force displayed width. +

+
-y height
+

Force displayed height. +

+
-fs
+

Start in fullscreen mode. +

+
-an
+

Disable audio. +

+
-vn
+

Disable video. +

+
-sn
+

Disable subtitles. +

+
-ss pos
+

Seek to pos. Note that in most formats it is not possible to seek +exactly, so ffplay will seek to the nearest seek point to +pos. +

+

pos must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+
-t duration
+

Play duration seconds of audio/video. +

+

duration must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+
-bytes
+

Seek by bytes. +

+
-seek_interval
+

Set custom interval, in seconds, for seeking using left/right keys. Default is 10 seconds. +

+
-nodisp
+

Disable graphical display. +

+
-noborder
+

Borderless window. +

+
-alwaysontop
+

Window always on top. Available on: X11 with SDL >= 2.0.5, Windows SDL >= 2.0.6. +

+
-volume
+

Set the startup volume. 0 means silence, 100 means no volume reduction or +amplification. Negative values are treated as 0, values above 100 are treated +as 100. +

+
-f fmt
+

Force format. +

+
-window_title title
+

Set window title (default is the input filename). +

+
-left title
+

Set the x position for the left of the window (default is a centered window). +

+
-top title
+

Set the y position for the top of the window (default is a centered window). +

+
-loop number
+

Loops movie playback <number> times. 0 means forever. +

+
-showmode mode
+

Set the show mode to use. +Available values for mode are: +

+
0, video
+

show video +

+
1, waves
+

show audio waves +

+
2, rdft
+

show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform) +

+
+ +

Default value is "video", if video is not present or cannot be played +"rdft" is automatically selected. +

+

You can interactively cycle through the available show modes by +pressing the key w. +

+
+
-vf filtergraph
+

Create the filtergraph specified by filtergraph and use it to +filter the video stream. +

+

filtergraph is a description of the filtergraph to apply to +the stream, and must have a single video input and a single video +output. In the filtergraph, the input is associated to the label +in, and the output to the label out. See the +ffmpeg-filters manual for more information about the filtergraph +syntax. +

+

You can specify this parameter multiple times and cycle through the specified +filtergraphs along with the show modes by pressing the key w. +

+
+
-af filtergraph
+

filtergraph is a description of the filtergraph to apply to +the input audio. +Use the option "-filters" to show all the available filters (including +sources and sinks). +

+
+
-i input_url
+

Read input_url. +

+
+ +
+
+

3.5 Advanced options

+
+
-stats
+

Print several playback statistics, in particular show the stream +duration, the codec parameters, the current position in the stream and +the audio/video synchronisation drift. It is shown by default, unless the +log level is lower than info. Its display can be forced by manually +specifying this option. To disable it, you need to specify -nostats. +

+
+
-fast
+

Non-spec-compliant optimizations. +

+
-genpts
+

Generate pts. +

+
-sync type
+

Set the master clock to audio (type=audio), video +(type=video) or external (type=ext). Default is audio. The +master clock is used to control audio-video synchronization. Most media +players use audio as master clock, but in some cases (streaming or high +quality broadcast) it is necessary to change that. This option is mainly +used for debugging purposes. +

+
-ast audio_stream_specifier
+

Select the desired audio stream using the given stream specifier. The stream +specifiers are described in the Stream specifiers chapter. If this option +is not specified, the "best" audio stream is selected in the program of the +already selected video stream. +

+
-vst video_stream_specifier
+

Select the desired video stream using the given stream specifier. The stream +specifiers are described in the Stream specifiers chapter. If this option +is not specified, the "best" video stream is selected. +

+
-sst subtitle_stream_specifier
+

Select the desired subtitle stream using the given stream specifier. The stream +specifiers are described in the Stream specifiers chapter. If this option +is not specified, the "best" subtitle stream is selected in the program of the +already selected video or audio stream. +

+
-autoexit
+

Exit when video is done playing. +

+
-exitonkeydown
+

Exit if any key is pressed. +

+
-exitonmousedown
+

Exit if any mouse button is pressed. +

+
+
-codec:media_specifier codec_name
+

Force a specific decoder implementation for the stream identified by +media_specifier, which can assume the values a (audio), +v (video), and s subtitle. +

+
+
-acodec codec_name
+

Force a specific audio decoder. +

+
+
-vcodec codec_name
+

Force a specific video decoder. +

+
+
-scodec codec_name
+

Force a specific subtitle decoder. +

+
+
-autorotate
+

Automatically rotate the video according to file metadata. Enabled by +default, use -noautorotate to disable it. +

+
+
-framedrop
+

Drop video frames if video is out of sync. Enabled by default if the master +clock is not set to video. Use this option to enable frame dropping for all +master clock sources, use -noframedrop to disable it. +

+
+
-infbuf
+

Do not limit the input buffer size, read as much data as possible from the +input as soon as possible. Enabled by default for realtime streams, where data +may be dropped if not read in time. Use this option to enable infinite buffers +for all inputs, use -noinfbuf to disable it. +

+
+
-filter_threads nb_threads
+

Defines how many threads are used to process a filter pipeline. Each pipeline +will produce a thread pool with this many threads available for parallel +processing. The default is 0 which means that the thread count will be +determined by the number of available CPUs. +

+
+
+ +
+
+

3.6 While playing

+ +
+
q, ESC
+

Quit. +

+
+
f
+

Toggle full screen. +

+
+
p, SPC
+

Pause. +

+
+
m
+

Toggle mute. +

+
+
9, 0
+
/, *
+

Decrease and increase volume respectively. +

+
+
a
+

Cycle audio channel in the current program. +

+
+
v
+

Cycle video channel. +

+
+
t
+

Cycle subtitle channel in the current program. +

+
+
c
+

Cycle program. +

+
+
w
+

Cycle video filters or show modes. +

+
+
s
+

Step to the next frame. +

+

Pause if the stream is not already paused, step to the next video +frame, and pause. +

+
+
left/right
+

Seek backward/forward 10 seconds. +

+
+
down/up
+

Seek backward/forward 1 minute. +

+
+
page down/page up
+

Seek to the previous/next chapter. +or if there are no chapters +Seek backward/forward 10 minutes. +

+
+
right mouse click
+

Seek to percentage in file corresponding to fraction of width. +

+
+
left mouse double-click
+

Toggle full screen. +

+
+
+ + + +
+
+ +
+

5 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffprobe-all.html b/mm_avh_working_space/bin/ffmpeg/doc/ffprobe-all.html new file mode 100644 index 0000000000000000000000000000000000000000..98065d30f9628fca6b7087eaf3f6f921e1166ada --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffprobe-all.html @@ -0,0 +1,53851 @@ + + + + + +ffprobe Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ +
+ + +
+
+
+

1 Synopsis

+ +

ffprobe [options] input_url +

+
+
+

2 Description

+ +

ffprobe gathers information from multimedia streams and prints it in +human- and machine-readable fashion. +

+

For example it can be used to check the format of the container used +by a multimedia stream and the format and type of each media stream +contained in it. +

+

If a url is specified in input, ffprobe will try to open and +probe the url content. If the url cannot be opened or recognized as +a multimedia file, a positive exit code is returned. +

+

If no output is specified as output with o ffprobe will write +to stdout. +

+

ffprobe may be employed both as a standalone application or in +combination with a textual filter, which may perform more +sophisticated processing, e.g. statistical processing or plotting. +

+

Options are used to list some of the formats supported by ffprobe or +for specifying which information to display, and for setting how +ffprobe will show it. +

+

ffprobe output is designed to be easily parsable by a textual filter, +and consists of one or more sections of a form defined by the selected +writer, which is specified by the print_format option. +

+

Sections may contain other nested sections, and are identified by a +name (which may be shared by other sections), and an unique +name. See the output of sections. +

+

Metadata tags stored in the container or in the streams are recognized +and printed in the corresponding "FORMAT", "STREAM" or "PROGRAM_STREAM" +section. +

+ +
+
+

3 Options

+ +

All the numerical options, if not specified otherwise, accept a string +representing a number as input, which may be followed by one of the SI +unit prefixes, for example: ’K’, ’M’, or ’G’. +

+

If ’i’ is appended to the SI unit prefix, the complete prefix will be +interpreted as a unit prefix for binary multiples, which are based on +powers of 1024 instead of powers of 1000. Appending ’B’ to the SI unit +prefix multiplies the value by 8. This allows using, for example: +’KB’, ’MiB’, ’G’ and ’B’ as number suffixes. +

+

Options which do not take arguments are boolean options, and set the +corresponding value to true. They can be set to false by prefixing +the option name with "no". For example using "-nofoo" +will set the boolean option with name "foo" to false. +

+ +
+

3.1 Stream specifiers

+

Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers +are used to precisely specify which stream(s) a given option belongs to. +

+

A stream specifier is a string generally appended to the option name and +separated from it by a colon. E.g. -codec:a:1 ac3 contains the +a:1 stream specifier, which matches the second audio stream. Therefore, it +would select the ac3 codec for the second audio stream. +

+

A stream specifier can match several streams, so that the option is applied to all +of them. E.g. the stream specifier in -b:a 128k matches all audio +streams. +

+

An empty stream specifier matches all streams. For example, -codec copy +or -codec: copy would copy all the streams without reencoding. +

+

Possible forms of stream specifiers are: +

+
stream_index
+

Matches the stream with this index. E.g. -threads:1 4 would set the +thread count for the second stream to 4. If stream_index is used as an +additional stream specifier (see below), then it selects stream number +stream_index from the matching streams. Stream numbering is based on the +order of the streams as detected by libavformat except when a program ID is +also specified. In this case it is based on the ordering of the streams in the +program. +

+
stream_type[:additional_stream_specifier]
+

stream_type is one of following: ’v’ or ’V’ for video, ’a’ for audio, ’s’ +for subtitle, ’d’ for data, and ’t’ for attachments. ’v’ matches all video +streams, ’V’ only matches video streams which are not attached pictures, video +thumbnails or cover arts. If additional_stream_specifier is used, then +it matches streams which both have this type and match the +additional_stream_specifier. Otherwise, it matches all streams of the +specified type. +

+
p:program_id[:additional_stream_specifier]
+

Matches streams which are in the program with the id program_id. If +additional_stream_specifier is used, then it matches streams which both +are part of the program and match the additional_stream_specifier. +

+
+
#stream_id or i:stream_id
+

Match the stream by stream id (e.g. PID in MPEG-TS container). +

+
m:key[:value]
+

Matches streams with the metadata tag key having the specified value. If +value is not given, matches streams that contain the given tag with any +value. +

+
u
+

Matches streams with usable configuration, the codec must be defined and the +essential information such as video dimension or audio sample rate must be present. +

+

Note that in ffmpeg, matching by metadata will only work properly for +input files. +

+
+ +
+
+

3.2 Generic options

+ +

These options are shared amongst the ff* tools. +

+
+
-L
+

Show license. +

+
+
-h, -?, -help, --help [arg]
+

Show help. An optional parameter may be specified to print help about a specific +item. If no argument is specified, only basic (non advanced) tool +options are shown. +

+

Possible values of arg are: +

+
long
+

Print advanced tool options in addition to the basic tool options. +

+
+
full
+

Print complete list of options, including shared and private options +for encoders, decoders, demuxers, muxers, filters, etc. +

+
+
decoder=decoder_name
+

Print detailed information about the decoder named decoder_name. Use the +-decoders option to get a list of all decoders. +

+
+
encoder=encoder_name
+

Print detailed information about the encoder named encoder_name. Use the +-encoders option to get a list of all encoders. +

+
+
demuxer=demuxer_name
+

Print detailed information about the demuxer named demuxer_name. Use the +-formats option to get a list of all demuxers and muxers. +

+
+
muxer=muxer_name
+

Print detailed information about the muxer named muxer_name. Use the +-formats option to get a list of all muxers and demuxers. +

+
+
filter=filter_name
+

Print detailed information about the filter named filter_name. Use the +-filters option to get a list of all filters. +

+
+
bsf=bitstream_filter_name
+

Print detailed information about the bitstream filter named bitstream_filter_name. +Use the -bsfs option to get a list of all bitstream filters. +

+
+
protocol=protocol_name
+

Print detailed information about the protocol named protocol_name. +Use the -protocols option to get a list of all protocols. +

+
+ +
+
-version
+

Show version. +

+
+
-buildconf
+

Show the build configuration, one option per line. +

+
+
-formats
+

Show available formats (including devices). +

+
+
-demuxers
+

Show available demuxers. +

+
+
-muxers
+

Show available muxers. +

+
+
-devices
+

Show available devices. +

+
+
-codecs
+

Show all codecs known to libavcodec. +

+

Note that the term ’codec’ is used throughout this documentation as a shortcut +for what is more correctly called a media bitstream format. +

+
+
-decoders
+

Show available decoders. +

+
+
-encoders
+

Show all available encoders. +

+
+
-bsfs
+

Show available bitstream filters. +

+
+
-protocols
+

Show available protocols. +

+
+
-filters
+

Show available libavfilter filters. +

+
+
-pix_fmts
+

Show available pixel formats. +

+
+
-sample_fmts
+

Show available sample formats. +

+
+
-layouts
+

Show channel names and standard channel layouts. +

+
+
-dispositions
+

Show stream dispositions. +

+
+
-colors
+

Show recognized color names. +

+
+
-sources device[,opt1=val1[,opt2=val2]...]
+

Show autodetected sources of the input device. +Some devices may provide system-dependent source names that cannot be autodetected. +The returned list cannot be assumed to be always complete. +

+
ffmpeg -sources pulse,server=192.168.0.4
+
+ +
+
-sinks device[,opt1=val1[,opt2=val2]...]
+

Show autodetected sinks of the output device. +Some devices may provide system-dependent sink names that cannot be autodetected. +The returned list cannot be assumed to be always complete. +

+
ffmpeg -sinks pulse,server=192.168.0.4
+
+ +
+
-loglevel [flags+]loglevel | -v [flags+]loglevel
+

Set logging level and flags used by the library. +

+

The optional flags prefix can consist of the following values: +

+
repeat
+

Indicates that repeated log output should not be compressed to the first line +and the "Last message repeated n times" line will be omitted. +

+
level
+

Indicates that log output should add a [level] prefix to each message +line. This can be used as an alternative to log coloring, e.g. when dumping the +log to file. +

+
+

Flags can also be used alone by adding a ’+’/’-’ prefix to set/reset a single +flag without affecting other flags or changing loglevel. When +setting both flags and loglevel, a ’+’ separator is expected +between the last flags value and before loglevel. +

+

loglevel is a string or a number containing one of the following values: +

+
quiet, -8
+

Show nothing at all; be silent. +

+
panic, 0
+

Only show fatal errors which could lead the process to crash, such as +an assertion failure. This is not currently used for anything. +

+
fatal, 8
+

Only show fatal errors. These are errors after which the process absolutely +cannot continue. +

+
error, 16
+

Show all errors, including ones which can be recovered from. +

+
warning, 24
+

Show all warnings and errors. Any message related to possibly +incorrect or unexpected events will be shown. +

+
info, 32
+

Show informative messages during processing. This is in addition to +warnings and errors. This is the default value. +

+
verbose, 40
+

Same as info, except more verbose. +

+
debug, 48
+

Show everything, including debugging information. +

+
trace, 56
+
+ +

For example to enable repeated log output, add the level prefix, and set +loglevel to verbose: +

+
ffmpeg -loglevel repeat+level+verbose -i input output
+
+

Another example that enables repeated log output without affecting current +state of level prefix flag or loglevel: +

+
ffmpeg [...] -loglevel +repeat
+
+ +

By default the program logs to stderr. If coloring is supported by the +terminal, colors are used to mark errors and warnings. Log coloring +can be disabled setting the environment variable +AV_LOG_FORCE_NOCOLOR, or can be forced setting +the environment variable AV_LOG_FORCE_COLOR. +

+
+
-report
+

Dump full command line and log output to a file named +program-YYYYMMDD-HHMMSS.log in the current +directory. +This file can be useful for bug reports. +It also implies -loglevel debug. +

+

Setting the environment variable FFREPORT to any value has the +same effect. If the value is a ’:’-separated key=value sequence, these +options will affect the report; option values must be escaped if they +contain special characters or the options delimiter ’:’ (see the +“Quoting and escaping” section in the ffmpeg-utils manual). +

+

The following options are recognized: +

+
file
+

set the file name to use for the report; %p is expanded to the name +of the program, %t is expanded to a timestamp, %% is expanded +to a plain % +

+
level
+

set the log verbosity level using a numerical value (see -loglevel). +

+
+ +

For example, to output a report to a file named ffreport.log +using a log level of 32 (alias for log level info): +

+
+
FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
+
+ +

Errors in parsing the environment variable are not fatal, and will not +appear in the report. +

+
+
-hide_banner
+

Suppress printing banner. +

+

All FFmpeg tools will normally show a copyright notice, build options +and library versions. This option can be used to suppress printing +this information. +

+
+
-cpuflags flags (global)
+

Allows setting and clearing cpu flags. This option is intended +for testing. Do not use it unless you know what you’re doing. +

+
ffmpeg -cpuflags -sse+mmx ...
+ffmpeg -cpuflags mmx ...
+ffmpeg -cpuflags 0 ...
+
+

Possible flags for this option are: +

+
x86
+
+
mmx
+
mmxext
+
sse
+
sse2
+
sse2slow
+
sse3
+
sse3slow
+
ssse3
+
atom
+
sse4.1
+
sse4.2
+
avx
+
avx2
+
xop
+
fma3
+
fma4
+
3dnow
+
3dnowext
+
bmi1
+
bmi2
+
cmov
+
+
+
ARM
+
+
armv5te
+
armv6
+
armv6t2
+
vfp
+
vfpv3
+
neon
+
setend
+
+
+
AArch64
+
+
armv8
+
vfp
+
neon
+
+
+
PowerPC
+
+
altivec
+
+
+
Specific Processors
+
+
pentium2
+
pentium3
+
pentium4
+
k6
+
k62
+
athlon
+
athlonxp
+
k8
+
+
+
+ +
+
-cpucount count (global)
+

Override detection of CPU count. This option is intended +for testing. Do not use it unless you know what you’re doing. +

+
ffmpeg -cpucount 2
+
+ +
+
-max_alloc bytes
+

Set the maximum size limit for allocating a block on the heap by ffmpeg’s +family of malloc functions. Exercise extreme caution when using +this option. Don’t use if you do not understand the full consequence of doing so. +Default is INT_MAX. +

+
+ +
+
+

3.3 AVOptions

+ +

These options are provided directly by the libavformat, libavdevice and +libavcodec libraries. To see the list of available AVOptions, use the +-help option. They are separated into two categories: +

+
generic
+

These options can be set for any container, codec or device. Generic options +are listed under AVFormatContext options for containers/devices and under +AVCodecContext options for codecs. +

+
private
+

These options are specific to the given container, device or codec. Private +options are listed under their corresponding containers/devices/codecs. +

+
+ +

For example to write an ID3v2.3 header instead of a default ID3v2.4 to +an MP3 file, use the id3v2_version private option of the MP3 +muxer: +

+
ffmpeg -i input.flac -id3v2_version 3 out.mp3
+
+ +

All codec AVOptions are per-stream, and thus a stream specifier +should be attached to them: +

+
ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4
+
+ +

In the above example, a multichannel audio stream is mapped twice for output. +The first instance is encoded with codec ac3 and bitrate 640k. +The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using +absolute index of the output stream. +

+

Note: the -nooption syntax cannot be used for boolean +AVOptions, use -option 0/-option 1. +

+

Note: the old undocumented way of specifying per-stream AVOptions by +prepending v/a/s to the options name is now obsolete and will be +removed soon. +

+
+
+

3.4 Main options

+ +
+
-f format
+

Force format to use. +

+
+
-unit
+

Show the unit of the displayed values. +

+
+
-prefix
+

Use SI prefixes for the displayed values. +Unless the "-byte_binary_prefix" option is used all the prefixes +are decimal. +

+
+
-byte_binary_prefix
+

Force the use of binary prefixes for byte values. +

+
+
-sexagesimal
+

Use sexagesimal format HH:MM:SS.MICROSECONDS for time values. +

+
+
-pretty
+

Prettify the format of the displayed values, it corresponds to the +options "-unit -prefix -byte_binary_prefix -sexagesimal". +

+
+
-of, -print_format writer_name[=writer_options]
+

Set the output printing format. +

+

writer_name specifies the name of the writer, and +writer_options specifies the options to be passed to the writer. +

+

For example for printing the output in JSON format, specify: +

+
-print_format json
+
+ +

For more details on the available output printing formats, see the +Writers section below. +

+
+
-sections
+

Print sections structure and section information, and exit. The output +is not meant to be parsed by a machine. +

+
+
-select_streams stream_specifier
+

Select only the streams specified by stream_specifier. This +option affects only the options related to streams +(e.g. show_streams, show_packets, etc.). +

+

For example to show only audio streams, you can use the command: +

+
ffprobe -show_streams -select_streams a INPUT
+
+ +

To show only video packets belonging to the video stream with index 1: +

+
ffprobe -show_packets -select_streams v:1 INPUT
+
+ +
+
-show_data
+

Show payload data, as a hexadecimal and ASCII dump. Coupled with +-show_packets, it will dump the packets’ data. Coupled with +-show_streams, it will dump the codec extradata. +

+

The dump is printed as the "data" field. It may contain newlines. +

+
+
-show_data_hash algorithm
+

Show a hash of payload data, for packets with -show_packets and for +codec extradata with -show_streams. +

+
+
-show_error
+

Show information about the error found when trying to probe the input. +

+

The error information is printed within a section with name "ERROR". +

+
+
-show_format
+

Show information about the container format of the input multimedia +stream. +

+

All the container format information is printed within a section with +name "FORMAT". +

+
+
-show_format_entry name
+

Like -show_format, but only prints the specified entry of the +container format information, rather than all. This option may be given more +than once, then all specified entries will be shown. +

+

This option is deprecated, use show_entries instead. +

+
+
-show_entries section_entries
+

Set list of entries to show. +

+

Entries are specified according to the following +syntax. section_entries contains a list of section entries +separated by :. Each section entry is composed by a section +name (or unique name), optionally followed by a list of entries local +to that section, separated by ,. +

+

If section name is specified but is followed by no =, all +entries are printed to output, together with all the contained +sections. Otherwise only the entries specified in the local section +entries list are printed. In particular, if = is specified but +the list of local entries is empty, then no entries will be shown for +that section. +

+

Note that the order of specification of the local section entries is +not honored in the output, and the usual display order will be +retained. +

+

The formal syntax is given by: +

+
LOCAL_SECTION_ENTRIES ::= SECTION_ENTRY_NAME[,LOCAL_SECTION_ENTRIES]
+SECTION_ENTRY         ::= SECTION_NAME[=[LOCAL_SECTION_ENTRIES]]
+SECTION_ENTRIES       ::= SECTION_ENTRY[:SECTION_ENTRIES]
+
+ +

For example, to show only the index and type of each stream, and the PTS +time, duration time, and stream index of the packets, you can specify +the argument: +

+
packet=pts_time,duration_time,stream_index : stream=index,codec_type
+
+ +

To show all the entries in the section "format", but only the codec +type in the section "stream", specify the argument: +

+
format : stream=codec_type
+
+ +

To show all the tags in the stream and format sections: +

+
stream_tags : format_tags
+
+ +

To show only the title tag (if available) in the stream +sections: +

+
stream_tags=title
+
+ +
+
-show_packets
+

Show information about each packet contained in the input multimedia +stream. +

+

The information for each single packet is printed within a dedicated +section with name "PACKET". +

+
+
-show_frames
+

Show information about each frame and subtitle contained in the input +multimedia stream. +

+

The information for each single frame is printed within a dedicated +section with name "FRAME" or "SUBTITLE". +

+
+
-show_log loglevel
+

Show logging information from the decoder about each frame according to +the value set in loglevel, (see -loglevel). This option requires -show_frames. +

+

The information for each log message is printed within a dedicated +section with name "LOG". +

+
+
-show_streams
+

Show information about each media stream contained in the input +multimedia stream. +

+

Each media stream information is printed within a dedicated section +with name "STREAM". +

+
+
-show_programs
+

Show information about programs and their streams contained in the input +multimedia stream. +

+

Each media stream information is printed within a dedicated section +with name "PROGRAM_STREAM". +

+
+
-show_chapters
+

Show information about chapters stored in the format. +

+

Each chapter is printed within a dedicated section with name "CHAPTER". +

+
+
-count_frames
+

Count the number of frames per stream and report it in the +corresponding stream section. +

+
+
-count_packets
+

Count the number of packets per stream and report it in the +corresponding stream section. +

+
+
-read_intervals read_intervals
+
+

Read only the specified intervals. read_intervals must be a +sequence of interval specifications separated by ",". +ffprobe will seek to the interval starting point, and will +continue reading from that. +

+

Each interval is specified by two optional parts, separated by "%". +

+

The first part specifies the interval start position. It is +interpreted as an absolute position, or as a relative offset from the +current position if it is preceded by the "+" character. If this first +part is not specified, no seeking will be performed when reading this +interval. +

+

The second part specifies the interval end position. It is interpreted +as an absolute position, or as a relative offset from the current +position if it is preceded by the "+" character. If the offset +specification starts with "#", it is interpreted as the number of +packets to read (not including the flushing packets) from the interval +start. If no second part is specified, the program will read until the +end of the input. +

+

Note that seeking is not accurate, thus the actual interval start +point may be different from the specified position. Also, when an +interval duration is specified, the absolute end time will be computed +by adding the duration to the interval start point found by seeking +the file, rather than to the specified start value. +

+

The formal syntax is given by: +

+
INTERVAL  ::= [START|+START_OFFSET][%[END|+END_OFFSET]]
+INTERVALS ::= INTERVAL[,INTERVALS]
+
+ +

A few examples follow. +

    +
  • Seek to time 10, read packets until 20 seconds after the found seek +point, then seek to position 01:30 (1 minute and thirty +seconds) and read packets until position 01:45. +
    +
    10%+20,01:30%01:45
    +
    + +
  • Read only 42 packets after seeking to position 01:23: +
    +
    01:23%+#42
    +
    + +
  • Read only the first 20 seconds from the start: +
    +
    %+20
    +
    + +
  • Read from the start until position 02:30: +
    +
    %02:30
    +
    +
+ +
+
-show_private_data, -private
+

Show private data, that is data depending on the format of the +particular shown element. +This option is enabled by default, but you may need to disable it +for specific uses, for example when creating XSD-compliant XML output. +

+
+
-show_program_version
+

Show information related to program version. +

+

Version information is printed within a section with name +"PROGRAM_VERSION". +

+
+
-show_library_versions
+

Show information related to library versions. +

+

Version information for each library is printed within a section with +name "LIBRARY_VERSION". +

+
+
-show_versions
+

Show information related to program and library versions. This is the +equivalent of setting both -show_program_version and +-show_library_versions options. +

+
+
-show_pixel_formats
+

Show information about all pixel formats supported by FFmpeg. +

+

Pixel format information for each format is printed within a section +with name "PIXEL_FORMAT". +

+
+
-show_optional_fields value
+

Some writers viz. JSON and XML, omit the printing of fields with invalid or non-applicable values, +while other writers always print them. This option enables one to control this behaviour. +Valid values are always/1, never/0 and auto/-1. +Default is auto. +

+
+
-bitexact
+

Force bitexact output, useful to produce output which is not dependent +on the specific build. +

+
+
-i input_url
+

Read input_url. +

+
+
-o output_url
+

Write output to output_url. If not specified, the output is sent +to stdout. +

+
+
+ +
+
+
+

4 Writers

+ +

A writer defines the output format adopted by ffprobe, and will be +used for printing all the parts of the output. +

+

A writer may accept one or more arguments, which specify the options +to adopt. The options are specified as a list of key=value +pairs, separated by ":". +

+

All writers support the following options: +

+
+
string_validation, sv
+

Set string validation mode. +

+

The following values are accepted. +

+
fail
+

The writer will fail immediately in case an invalid string (UTF-8) +sequence or code point is found in the input. This is especially +useful to validate input metadata. +

+
+
ignore
+

Any validation error will be ignored. This will result in possibly +broken output, especially with the json or xml writer. +

+
+
replace
+

The writer will substitute invalid UTF-8 sequences or code points with +the string specified with the string_validation_replacement. +

+
+ +

Default value is ‘replace’. +

+
+
string_validation_replacement, svr
+

Set replacement string to use in case string_validation is +set to ‘replace’. +

+

In case the option is not specified, the writer will assume the empty +string, that is it will remove the invalid sequences from the input +strings. +

+
+ +

A description of the currently available writers follows. +

+ +
+

4.1 default

+

Default format. +

+

Print each section in the form: +

+
[SECTION]
+key1=val1
+...
+keyN=valN
+[/SECTION]
+
+ +

Metadata tags are printed as a line in the corresponding FORMAT, STREAM or +PROGRAM_STREAM section, and are prefixed by the string "TAG:". +

+

A description of the accepted options follows. +

+
+
nokey, nk
+

If set to 1 specify not to print the key of each field. Default value +is 0. +

+
+
noprint_wrappers, nw
+

If set to 1 specify not to print the section header and footer. +Default value is 0. +

+
+ +
+
+

4.2 compact, csv

+

Compact and CSV format. +

+

The csv writer is equivalent to compact, but supports +different defaults. +

+

Each section is printed on a single line. +If no option is specified, the output has the form: +

+
section|key1=val1| ... |keyN=valN
+
+ +

Metadata tags are printed in the corresponding "format" or "stream" +section. A metadata tag key, if printed, is prefixed by the string +"tag:". +

+

The description of the accepted options follows. +

+
+
item_sep, s
+

Specify the character to use for separating fields in the output line. +It must be a single printable character, it is "|" by default ("," for +the csv writer). +

+
+
nokey, nk
+

If set to 1 specify not to print the key of each field. Its default +value is 0 (1 for the csv writer). +

+
+
escape, e
+

Set the escape mode to use, default to "c" ("csv" for the csv +writer). +

+

It can assume one of the following values: +

+
c
+

Perform C-like escaping. Strings containing a newline (‘\n’), carriage +return (‘\r’), a tab (‘\t’), a form feed (‘\f’), the escaping +character (‘\’) or the item separator character SEP are escaped +using C-like fashioned escaping, so that a newline is converted to the +sequence ‘\n’, a carriage return to ‘\r’, ‘\’ to ‘\\’ and +the separator SEP is converted to ‘\SEP’. +

+
+
csv
+

Perform CSV-like escaping, as described in RFC4180. Strings +containing a newline (‘\n’), a carriage return (‘\r’), a double quote +(‘"’), or SEP are enclosed in double-quotes. +

+
+
none
+

Perform no escaping. +

+
+ +
+
print_section, p
+

Print the section name at the beginning of each line if the value is +1, disable it with value set to 0. Default value is +1. +

+
+
+ +
+
+

4.3 flat

+

Flat format. +

+

A free-form output where each line contains an explicit key=value, such as +"streams.stream.3.tags.foo=bar". The output is shell escaped, so it can be +directly embedded in sh scripts as long as the separator character is an +alphanumeric character or an underscore (see sep_char option). +

+

The description of the accepted options follows. +

+
+
sep_char, s
+

Separator character used to separate the chapter, the section name, IDs and +potential tags in the printed field key. +

+

Default value is ‘.’. +

+
+
hierarchical, h
+

Specify if the section name specification should be hierarchical. If +set to 1, and if there is more than one section in the current +chapter, the section name will be prefixed by the name of the +chapter. A value of 0 will disable this behavior. +

+

Default value is 1. +

+
+ +
+
+

4.4 ini

+

INI format output. +

+

Print output in an INI based format. +

+

The following conventions are adopted: +

+
    +
  • all key and values are UTF-8 +
  • .’ is the subgroup separator +
  • newline, ‘\t’, ‘\f’, ‘\b’ and the following characters are +escaped +
  • \’ is the escape character +
  • #’ is the comment indicator +
  • =’ is the key/value separator +
  • :’ is not used but usually parsed as key/value separator +
+ +

This writer accepts options as a list of key=value pairs, +separated by ‘:’. +

+

The description of the accepted options follows. +

+
+
hierarchical, h
+

Specify if the section name specification should be hierarchical. If +set to 1, and if there is more than one section in the current +chapter, the section name will be prefixed by the name of the +chapter. A value of 0 will disable this behavior. +

+

Default value is 1. +

+
+ +
+
+

4.5 json

+

JSON based format. +

+

Each section is printed using JSON notation. +

+

The description of the accepted options follows. +

+
+
compact, c
+

If set to 1 enable compact output, that is each section will be +printed on a single line. Default value is 0. +

+
+ +

For more information about JSON, see http://www.json.org/. +

+
+
+

4.6 xml

+

XML based format. +

+

The XML output is described in the XML schema description file +ffprobe.xsd installed in the FFmpeg datadir. +

+

An updated version of the schema can be retrieved at the url +http://www.ffmpeg.org/schema/ffprobe.xsd, which redirects to the +latest schema committed into the FFmpeg development source code tree. +

+

Note that the output issued will be compliant to the +ffprobe.xsd schema only when no special global output options +(unit, prefix, byte_binary_prefix, +sexagesimal etc.) are specified. +

+

The description of the accepted options follows. +

+
+
fully_qualified, q
+

If set to 1 specify if the output should be fully qualified. Default +value is 0. +This is required for generating an XML file which can be validated +through an XSD file. +

+
+
xsd_strict, x
+

If set to 1 perform more checks for ensuring that the output is XSD +compliant. Default value is 0. +This option automatically sets fully_qualified to 1. +

+
+ +

For more information about the XML format, see +https://www.w3.org/XML/. +

+
+
+
+

5 Timecode

+ +

ffprobe supports Timecode extraction: +

+
    +
  • MPEG1/2 timecode is extracted from the GOP, and is available in the video +stream details (-show_streams, see timecode). + +
  • MOV timecode is extracted from tmcd track, so is available in the tmcd +stream metadata (-show_streams, see TAG:timecode). + +
  • DV, GXF and AVI timecodes are available in format metadata +(-show_format, see TAG:timecode). + +
+ +
+
+

6 Syntax

+ +

This section documents the syntax and formats employed by the FFmpeg +libraries and tools. +

+ +
+

6.1 Quoting and escaping

+ +

FFmpeg adopts the following quoting and escaping mechanism, unless +explicitly specified. The following rules are applied: +

+
    +
  • '’ and ‘\’ are special characters (respectively used for +quoting and escaping). In addition to them, there might be other +special characters depending on the specific syntax where the escaping +and quoting are employed. + +
  • A special character is escaped by prefixing it with a ‘\’. + +
  • All characters enclosed between ‘''’ are included literally in the +parsed string. The quote character ‘'’ itself cannot be quoted, +so you may need to close the quote and escape it. + +
  • Leading and trailing whitespaces, unless escaped or quoted, are +removed from the parsed string. +
+ +

Note that you may need to add a second level of escaping when using +the command line or a script, which depends on the syntax of the +adopted shell language. +

+

The function av_get_token defined in +libavutil/avstring.h can be used to parse a token quoted or +escaped according to the rules defined above. +

+

The tool tools/ffescape in the FFmpeg source tree can be used +to automatically quote or escape a string in a script. +

+ +
+

6.1.1 Examples

+ +
    +
  • Escape the string Crime d'Amour containing the ' special +character: +
    +
    Crime d\'Amour
    +
    + +
  • The string above contains a quote, so the ' needs to be escaped +when quoting it: +
    +
    'Crime d'\''Amour'
    +
    + +
  • Include leading or trailing whitespaces using quoting: +
    +
    '  this string starts and ends with whitespaces  '
    +
    + +
  • Escaping and quoting can be mixed together: +
    +
    ' The string '\'string\'' is a string '
    +
    + +
  • To include a literal ‘\’ you can use either escaping or quoting: +
    +
    'c:\foo' can be written as c:\\foo
    +
    +
+ +
+
+
+

6.2 Date

+ +

The accepted syntax is: +

+
[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
+now
+
+ +

If the value is "now" it takes the current time. +

+

Time is local time unless Z is appended, in which case it is +interpreted as UTC. +If the year-month-day part is not specified it takes the current +year-month-day. +

+
+
+

6.3 Time duration

+ +

There are two accepted syntaxes for expressing time duration. +

+
+
[-][HH:]MM:SS[.m...]
+
+ +

HH expresses the number of hours, MM the number of minutes +for a maximum of 2 digits, and SS the number of seconds for a +maximum of 2 digits. The m at the end expresses decimal value for +SS. +

+

or +

+
+
[-]S+[.m...][s|ms|us]
+
+ +

S expresses the number of seconds, with the optional decimal part +m. The optional literal suffixes ‘s’, ‘ms’ or ‘us’ +indicate to interpret the value as seconds, milliseconds or microseconds, +respectively. +

+

In both expressions, the optional ‘-’ indicates negative duration. +

+ +
+

6.3.1 Examples

+ +

The following examples are all valid time duration: +

+
+
55
+

55 seconds +

+
+
0.2
+

0.2 seconds +

+
+
200ms
+

200 milliseconds, that’s 0.2s +

+
+
200000us
+

200000 microseconds, that’s 0.2s +

+
+
12:03:45
+

12 hours, 03 minutes and 45 seconds +

+
+
23.189
+

23.189 seconds +

+
+ +
+
+
+

6.4 Video size

+

Specify the size of the sourced video, it may be a string of the form +widthxheight, or the name of a size abbreviation. +

+

The following abbreviations are recognized: +

+
ntsc
+

720x480 +

+
pal
+

720x576 +

+
qntsc
+

352x240 +

+
qpal
+

352x288 +

+
sntsc
+

640x480 +

+
spal
+

768x576 +

+
film
+

352x240 +

+
ntsc-film
+

352x240 +

+
sqcif
+

128x96 +

+
qcif
+

176x144 +

+
cif
+

352x288 +

+
4cif
+

704x576 +

+
16cif
+

1408x1152 +

+
qqvga
+

160x120 +

+
qvga
+

320x240 +

+
vga
+

640x480 +

+
svga
+

800x600 +

+
xga
+

1024x768 +

+
uxga
+

1600x1200 +

+
qxga
+

2048x1536 +

+
sxga
+

1280x1024 +

+
qsxga
+

2560x2048 +

+
hsxga
+

5120x4096 +

+
wvga
+

852x480 +

+
wxga
+

1366x768 +

+
wsxga
+

1600x1024 +

+
wuxga
+

1920x1200 +

+
woxga
+

2560x1600 +

+
wqsxga
+

3200x2048 +

+
wquxga
+

3840x2400 +

+
whsxga
+

6400x4096 +

+
whuxga
+

7680x4800 +

+
cga
+

320x200 +

+
ega
+

640x350 +

+
hd480
+

852x480 +

+
hd720
+

1280x720 +

+
hd1080
+

1920x1080 +

+
2k
+

2048x1080 +

+
2kflat
+

1998x1080 +

+
2kscope
+

2048x858 +

+
4k
+

4096x2160 +

+
4kflat
+

3996x2160 +

+
4kscope
+

4096x1716 +

+
nhd
+

640x360 +

+
hqvga
+

240x160 +

+
wqvga
+

400x240 +

+
fwqvga
+

432x240 +

+
hvga
+

480x320 +

+
qhd
+

960x540 +

+
2kdci
+

2048x1080 +

+
4kdci
+

4096x2160 +

+
uhd2160
+

3840x2160 +

+
uhd4320
+

7680x4320 +

+
+ +
+
+

6.5 Video rate

+ +

Specify the frame rate of a video, expressed as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a float +number or a valid video frame rate abbreviation. +

+

The following abbreviations are recognized: +

+
ntsc
+

30000/1001 +

+
pal
+

25/1 +

+
qntsc
+

30000/1001 +

+
qpal
+

25/1 +

+
sntsc
+

30000/1001 +

+
spal
+

25/1 +

+
film
+

24/1 +

+
ntsc-film
+

24000/1001 +

+
+ +
+
+

6.6 Ratio

+ +

A ratio can be expressed as an expression, or in the form +numerator:denominator. +

+

Note that a ratio with infinite (1/0) or negative value is +considered valid, so you should check on the returned value if you +want to exclude those values. +

+

The undefined value can be expressed using the "0:0" string. +

+
+
+

6.7 Color

+ +

It can be the name of a color as defined below (case insensitive match) or a +[0x|#]RRGGBB[AA] sequence, possibly followed by @ and a string +representing the alpha component. +

+

The alpha component may be a string composed by "0x" followed by an +hexadecimal number or a decimal number between 0.0 and 1.0, which +represents the opacity value (‘0x00’ or ‘0.0’ means completely +transparent, ‘0xff’ or ‘1.0’ completely opaque). If the alpha +component is not specified then ‘0xff’ is assumed. +

+

The string ‘random’ will result in a random color. +

+

The following names of colors are recognized: +

+
AliceBlue
+

0xF0F8FF +

+
AntiqueWhite
+

0xFAEBD7 +

+
Aqua
+

0x00FFFF +

+
Aquamarine
+

0x7FFFD4 +

+
Azure
+

0xF0FFFF +

+
Beige
+

0xF5F5DC +

+
Bisque
+

0xFFE4C4 +

+
Black
+

0x000000 +

+
BlanchedAlmond
+

0xFFEBCD +

+
Blue
+

0x0000FF +

+
BlueViolet
+

0x8A2BE2 +

+
Brown
+

0xA52A2A +

+
BurlyWood
+

0xDEB887 +

+
CadetBlue
+

0x5F9EA0 +

+
Chartreuse
+

0x7FFF00 +

+
Chocolate
+

0xD2691E +

+
Coral
+

0xFF7F50 +

+
CornflowerBlue
+

0x6495ED +

+
Cornsilk
+

0xFFF8DC +

+
Crimson
+

0xDC143C +

+
Cyan
+

0x00FFFF +

+
DarkBlue
+

0x00008B +

+
DarkCyan
+

0x008B8B +

+
DarkGoldenRod
+

0xB8860B +

+
DarkGray
+

0xA9A9A9 +

+
DarkGreen
+

0x006400 +

+
DarkKhaki
+

0xBDB76B +

+
DarkMagenta
+

0x8B008B +

+
DarkOliveGreen
+

0x556B2F +

+
Darkorange
+

0xFF8C00 +

+
DarkOrchid
+

0x9932CC +

+
DarkRed
+

0x8B0000 +

+
DarkSalmon
+

0xE9967A +

+
DarkSeaGreen
+

0x8FBC8F +

+
DarkSlateBlue
+

0x483D8B +

+
DarkSlateGray
+

0x2F4F4F +

+
DarkTurquoise
+

0x00CED1 +

+
DarkViolet
+

0x9400D3 +

+
DeepPink
+

0xFF1493 +

+
DeepSkyBlue
+

0x00BFFF +

+
DimGray
+

0x696969 +

+
DodgerBlue
+

0x1E90FF +

+
FireBrick
+

0xB22222 +

+
FloralWhite
+

0xFFFAF0 +

+
ForestGreen
+

0x228B22 +

+
Fuchsia
+

0xFF00FF +

+
Gainsboro
+

0xDCDCDC +

+
GhostWhite
+

0xF8F8FF +

+
Gold
+

0xFFD700 +

+
GoldenRod
+

0xDAA520 +

+
Gray
+

0x808080 +

+
Green
+

0x008000 +

+
GreenYellow
+

0xADFF2F +

+
HoneyDew
+

0xF0FFF0 +

+
HotPink
+

0xFF69B4 +

+
IndianRed
+

0xCD5C5C +

+
Indigo
+

0x4B0082 +

+
Ivory
+

0xFFFFF0 +

+
Khaki
+

0xF0E68C +

+
Lavender
+

0xE6E6FA +

+
LavenderBlush
+

0xFFF0F5 +

+
LawnGreen
+

0x7CFC00 +

+
LemonChiffon
+

0xFFFACD +

+
LightBlue
+

0xADD8E6 +

+
LightCoral
+

0xF08080 +

+
LightCyan
+

0xE0FFFF +

+
LightGoldenRodYellow
+

0xFAFAD2 +

+
LightGreen
+

0x90EE90 +

+
LightGrey
+

0xD3D3D3 +

+
LightPink
+

0xFFB6C1 +

+
LightSalmon
+

0xFFA07A +

+
LightSeaGreen
+

0x20B2AA +

+
LightSkyBlue
+

0x87CEFA +

+
LightSlateGray
+

0x778899 +

+
LightSteelBlue
+

0xB0C4DE +

+
LightYellow
+

0xFFFFE0 +

+
Lime
+

0x00FF00 +

+
LimeGreen
+

0x32CD32 +

+
Linen
+

0xFAF0E6 +

+
Magenta
+

0xFF00FF +

+
Maroon
+

0x800000 +

+
MediumAquaMarine
+

0x66CDAA +

+
MediumBlue
+

0x0000CD +

+
MediumOrchid
+

0xBA55D3 +

+
MediumPurple
+

0x9370D8 +

+
MediumSeaGreen
+

0x3CB371 +

+
MediumSlateBlue
+

0x7B68EE +

+
MediumSpringGreen
+

0x00FA9A +

+
MediumTurquoise
+

0x48D1CC +

+
MediumVioletRed
+

0xC71585 +

+
MidnightBlue
+

0x191970 +

+
MintCream
+

0xF5FFFA +

+
MistyRose
+

0xFFE4E1 +

+
Moccasin
+

0xFFE4B5 +

+
NavajoWhite
+

0xFFDEAD +

+
Navy
+

0x000080 +

+
OldLace
+

0xFDF5E6 +

+
Olive
+

0x808000 +

+
OliveDrab
+

0x6B8E23 +

+
Orange
+

0xFFA500 +

+
OrangeRed
+

0xFF4500 +

+
Orchid
+

0xDA70D6 +

+
PaleGoldenRod
+

0xEEE8AA +

+
PaleGreen
+

0x98FB98 +

+
PaleTurquoise
+

0xAFEEEE +

+
PaleVioletRed
+

0xD87093 +

+
PapayaWhip
+

0xFFEFD5 +

+
PeachPuff
+

0xFFDAB9 +

+
Peru
+

0xCD853F +

+
Pink
+

0xFFC0CB +

+
Plum
+

0xDDA0DD +

+
PowderBlue
+

0xB0E0E6 +

+
Purple
+

0x800080 +

+
Red
+

0xFF0000 +

+
RosyBrown
+

0xBC8F8F +

+
RoyalBlue
+

0x4169E1 +

+
SaddleBrown
+

0x8B4513 +

+
Salmon
+

0xFA8072 +

+
SandyBrown
+

0xF4A460 +

+
SeaGreen
+

0x2E8B57 +

+
SeaShell
+

0xFFF5EE +

+
Sienna
+

0xA0522D +

+
Silver
+

0xC0C0C0 +

+
SkyBlue
+

0x87CEEB +

+
SlateBlue
+

0x6A5ACD +

+
SlateGray
+

0x708090 +

+
Snow
+

0xFFFAFA +

+
SpringGreen
+

0x00FF7F +

+
SteelBlue
+

0x4682B4 +

+
Tan
+

0xD2B48C +

+
Teal
+

0x008080 +

+
Thistle
+

0xD8BFD8 +

+
Tomato
+

0xFF6347 +

+
Turquoise
+

0x40E0D0 +

+
Violet
+

0xEE82EE +

+
Wheat
+

0xF5DEB3 +

+
White
+

0xFFFFFF +

+
WhiteSmoke
+

0xF5F5F5 +

+
Yellow
+

0xFFFF00 +

+
YellowGreen
+

0x9ACD32 +

+
+ +
+
+

6.8 Channel Layout

+ +

A channel layout specifies the spatial disposition of the channels in +a multi-channel audio stream. To specify a channel layout, FFmpeg +makes use of a special syntax. +

+

Individual channels are identified by an id, as given by the table +below: +

+
FL
+

front left +

+
FR
+

front right +

+
FC
+

front center +

+
LFE
+

low frequency +

+
BL
+

back left +

+
BR
+

back right +

+
FLC
+

front left-of-center +

+
FRC
+

front right-of-center +

+
BC
+

back center +

+
SL
+

side left +

+
SR
+

side right +

+
TC
+

top center +

+
TFL
+

top front left +

+
TFC
+

top front center +

+
TFR
+

top front right +

+
TBL
+

top back left +

+
TBC
+

top back center +

+
TBR
+

top back right +

+
DL
+

downmix left +

+
DR
+

downmix right +

+
WL
+

wide left +

+
WR
+

wide right +

+
SDL
+

surround direct left +

+
SDR
+

surround direct right +

+
LFE2
+

low frequency 2 +

+
+ +

Standard channel layout compositions can be specified by using the +following identifiers: +

+
mono
+

FC +

+
stereo
+

FL+FR +

+
2.1
+

FL+FR+LFE +

+
3.0
+

FL+FR+FC +

+
3.0(back)
+

FL+FR+BC +

+
4.0
+

FL+FR+FC+BC +

+
quad
+

FL+FR+BL+BR +

+
quad(side)
+

FL+FR+SL+SR +

+
3.1
+

FL+FR+FC+LFE +

+
5.0
+

FL+FR+FC+BL+BR +

+
5.0(side)
+

FL+FR+FC+SL+SR +

+
4.1
+

FL+FR+FC+LFE+BC +

+
5.1
+

FL+FR+FC+LFE+BL+BR +

+
5.1(side)
+

FL+FR+FC+LFE+SL+SR +

+
6.0
+

FL+FR+FC+BC+SL+SR +

+
6.0(front)
+

FL+FR+FLC+FRC+SL+SR +

+
hexagonal
+

FL+FR+FC+BL+BR+BC +

+
6.1
+

FL+FR+FC+LFE+BC+SL+SR +

+
6.1
+

FL+FR+FC+LFE+BL+BR+BC +

+
6.1(front)
+

FL+FR+LFE+FLC+FRC+SL+SR +

+
7.0
+

FL+FR+FC+BL+BR+SL+SR +

+
7.0(front)
+

FL+FR+FC+FLC+FRC+SL+SR +

+
7.1
+

FL+FR+FC+LFE+BL+BR+SL+SR +

+
7.1(wide)
+

FL+FR+FC+LFE+BL+BR+FLC+FRC +

+
7.1(wide-side)
+

FL+FR+FC+LFE+FLC+FRC+SL+SR +

+
7.1(top)
+

FL+FR+FC+LFE+BL+BR+TFL+TFR +

+
octagonal
+

FL+FR+FC+BL+BR+BC+SL+SR +

+
cube
+

FL+FR+BL+BR+TFL+TFR+TBL+TBR +

+
hexadecagonal
+

FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR +

+
downmix
+

DL+DR +

+
22.2
+

FL+FR+FC+LFE+BL+BR+FLC+FRC+BC+SL+SR+TC+TFL+TFC+TFR+TBL+TBC+TBR+LFE2+TSL+TSR+BFC+BFL+BFR +

+
+ +

A custom channel layout can be specified as a sequence of terms, separated by ’+’. +Each term can be: +

    +
  • the name of a single channel (e.g. ‘FL’, ‘FR’, ‘FC’, ‘LFE’, etc.), +each optionally containing a custom name after a ’@’, (e.g. ‘FL@Left’, +‘FR@Right’, ‘FC@Center’, ‘LFE@Low_Frequency’, etc.) +
+ +

A standard channel layout can be specified by the following: +

    +
  • the name of a single channel (e.g. ‘FL’, ‘FR’, ‘FC’, ‘LFE’, etc.) + +
  • the name of a standard channel layout (e.g. ‘mono’, +‘stereo’, ‘4.0’, ‘quad’, ‘5.0’, etc.) + +
  • a number of channels, in decimal, followed by ’c’, yielding the default channel +layout for that number of channels (see the function +av_channel_layout_default). Note that not all channel counts have a +default layout. + +
  • a number of channels, in decimal, followed by ’C’, yielding an unknown channel +layout with the specified number of channels. Note that not all channel layout +specification strings support unknown channel layouts. + +
  • a channel layout mask, in hexadecimal starting with "0x" (see the +AV_CH_* macros in libavutil/channel_layout.h. +
+ +

Before libavutil version 53 the trailing character "c" to specify a number of +channels was optional, but now it is required, while a channel layout mask can +also be specified as a decimal number (if and only if not followed by "c" or "C"). +

+

See also the function av_channel_layout_from_string defined in +libavutil/channel_layout.h. +

+
+
+
+

7 Expression Evaluation

+ +

When evaluating an arithmetic expression, FFmpeg uses an internal +formula evaluator, implemented through the libavutil/eval.h +interface. +

+

An expression may contain unary, binary operators, constants, and +functions. +

+

Two expressions expr1 and expr2 can be combined to form +another expression "expr1;expr2". +expr1 and expr2 are evaluated in turn, and the new +expression evaluates to the value of expr2. +

+

The following binary operators are available: +, -, +*, /, ^. +

+

The following unary operators are available: +, -. +

+

The following functions are available: +

+
abs(x)
+

Compute absolute value of x. +

+
+
acos(x)
+

Compute arccosine of x. +

+
+
asin(x)
+

Compute arcsine of x. +

+
+
atan(x)
+

Compute arctangent of x. +

+
+
atan2(x, y)
+

Compute principal value of the arc tangent of y/x. +

+
+
between(x, min, max)
+

Return 1 if x is greater than or equal to min and lesser than or +equal to max, 0 otherwise. +

+
+
bitand(x, y)
+
bitor(x, y)
+

Compute bitwise and/or operation on x and y. +

+

The results of the evaluation of x and y are converted to +integers before executing the bitwise operation. +

+

Note that both the conversion to integer and the conversion back to +floating point can lose precision. Beware of unexpected results for +large numbers (usually 2^53 and larger). +

+
+
ceil(expr)
+

Round the value of expression expr upwards to the nearest +integer. For example, "ceil(1.5)" is "2.0". +

+
+
clip(x, min, max)
+

Return the value of x clipped between min and max. +

+
+
cos(x)
+

Compute cosine of x. +

+
+
cosh(x)
+

Compute hyperbolic cosine of x. +

+
+
eq(x, y)
+

Return 1 if x and y are equivalent, 0 otherwise. +

+
+
exp(x)
+

Compute exponential of x (with base e, the Euler’s number). +

+
+
floor(expr)
+

Round the value of expression expr downwards to the nearest +integer. For example, "floor(-1.5)" is "-2.0". +

+
+
gauss(x)
+

Compute Gauss function of x, corresponding to +exp(-x*x/2) / sqrt(2*PI). +

+
+
gcd(x, y)
+

Return the greatest common divisor of x and y. If both x and +y are 0 or either or both are less than zero then behavior is undefined. +

+
+
gt(x, y)
+

Return 1 if x is greater than y, 0 otherwise. +

+
+
gte(x, y)
+

Return 1 if x is greater than or equal to y, 0 otherwise. +

+
+
hypot(x, y)
+

This function is similar to the C function with the same name; it returns +"sqrt(x*x + y*y)", the length of the hypotenuse of a +right triangle with sides of length x and y, or the distance of the +point (x, y) from the origin. +

+
+
if(x, y)
+

Evaluate x, and if the result is non-zero return the result of +the evaluation of y, return 0 otherwise. +

+
+
if(x, y, z)
+

Evaluate x, and if the result is non-zero return the evaluation +result of y, otherwise the evaluation result of z. +

+
+
ifnot(x, y)
+

Evaluate x, and if the result is zero return the result of the +evaluation of y, return 0 otherwise. +

+
+
ifnot(x, y, z)
+

Evaluate x, and if the result is zero return the evaluation +result of y, otherwise the evaluation result of z. +

+
+
isinf(x)
+

Return 1.0 if x is +/-INFINITY, 0.0 otherwise. +

+
+
isnan(x)
+

Return 1.0 if x is NAN, 0.0 otherwise. +

+
+
ld(var)
+

Load the value of the internal variable with number +var, which was previously stored with st(var, expr). +The function returns the loaded value. +

+
+
lerp(x, y, z)
+

Return linear interpolation between x and y by amount of z. +

+
+
log(x)
+

Compute natural logarithm of x. +

+
+
lt(x, y)
+

Return 1 if x is lesser than y, 0 otherwise. +

+
+
lte(x, y)
+

Return 1 if x is lesser than or equal to y, 0 otherwise. +

+
+
max(x, y)
+

Return the maximum between x and y. +

+
+
min(x, y)
+

Return the minimum between x and y. +

+
+
mod(x, y)
+

Compute the remainder of division of x by y. +

+
+
not(expr)
+

Return 1.0 if expr is zero, 0.0 otherwise. +

+
+
pow(x, y)
+

Compute the power of x elevated y, it is equivalent to +"(x)^(y)". +

+
+
print(t)
+
print(t, l)
+

Print the value of expression t with loglevel l. If +l is not specified then a default log level is used. +Returns the value of the expression printed. +

+

Prints t with loglevel l +

+
+
random(x)
+

Return a pseudo random value between 0.0 and 1.0. x is the index of the +internal variable which will be used to save the seed/state. +

+
+
root(expr, max)
+

Find an input value for which the function represented by expr +with argument ld(0) is 0 in the interval 0..max. +

+

The expression in expr must denote a continuous function or the +result is undefined. +

+

ld(0) is used to represent the function input value, which means +that the given expression will be evaluated multiple times with +various input values that the expression can access through +ld(0). When the expression evaluates to 0 then the +corresponding input value will be returned. +

+
+
round(expr)
+

Round the value of expression expr to the nearest integer. For example, "round(1.5)" is "2.0". +

+
+
sgn(x)
+

Compute sign of x. +

+
+
sin(x)
+

Compute sine of x. +

+
+
sinh(x)
+

Compute hyperbolic sine of x. +

+
+
sqrt(expr)
+

Compute the square root of expr. This is equivalent to +"(expr)^.5". +

+
+
squish(x)
+

Compute expression 1/(1 + exp(4*x)). +

+
+
st(var, expr)
+

Store the value of the expression expr in an internal +variable. var specifies the number of the variable where to +store the value, and it is a value ranging from 0 to 9. The function +returns the value stored in the internal variable. +Note, Variables are currently not shared between expressions. +

+
+
tan(x)
+

Compute tangent of x. +

+
+
tanh(x)
+

Compute hyperbolic tangent of x. +

+
+
taylor(expr, x)
+
taylor(expr, x, id)
+

Evaluate a Taylor series at x, given an expression representing +the ld(id)-th derivative of a function at 0. +

+

When the series does not converge the result is undefined. +

+

ld(id) is used to represent the derivative order in expr, +which means that the given expression will be evaluated multiple times +with various input values that the expression can access through +ld(id). If id is not specified then 0 is assumed. +

+

Note, when you have the derivatives at y instead of 0, +taylor(expr, x-y) can be used. +

+
+
time(0)
+

Return the current (wallclock) time in seconds. +

+
+
trunc(expr)
+

Round the value of expression expr towards zero to the nearest +integer. For example, "trunc(-1.5)" is "-1.0". +

+
+
while(cond, expr)
+

Evaluate expression expr while the expression cond is +non-zero, and returns the value of the last expr evaluation, or +NAN if cond was always false. +

+
+ +

The following constants are available: +

+
PI
+

area of the unit disc, approximately 3.14 +

+
E
+

exp(1) (Euler’s number), approximately 2.718 +

+
PHI
+

golden ratio (1+sqrt(5))/2, approximately 1.618 +

+
+ +

Assuming that an expression is considered "true" if it has a non-zero +value, note that: +

+

* works like AND +

+

+ works like OR +

+

For example the construct: +

+
if (A AND B) then C
+
+

is equivalent to: +

+
if(A*B, C)
+
+ +

In your C code, you can extend the list of unary and binary functions, +and define recognized constants, so that they are available for your +expressions. +

+

The evaluator also recognizes the International System unit prefixes. +If ’i’ is appended after the prefix, binary prefixes are used, which +are based on powers of 1024 instead of powers of 1000. +The ’B’ postfix multiplies the value by 8, and can be appended after a +unit prefix or used alone. This allows using for example ’KB’, ’MiB’, +’G’ and ’B’ as number postfix. +

+

The list of available International System prefixes follows, with +indication of the corresponding powers of 10 and of 2. +

+
y
+

10^-24 / 2^-80 +

+
z
+

10^-21 / 2^-70 +

+
a
+

10^-18 / 2^-60 +

+
f
+

10^-15 / 2^-50 +

+
p
+

10^-12 / 2^-40 +

+
n
+

10^-9 / 2^-30 +

+
u
+

10^-6 / 2^-20 +

+
m
+

10^-3 / 2^-10 +

+
c
+

10^-2 +

+
d
+

10^-1 +

+
h
+

10^2 +

+
k
+

10^3 / 2^10 +

+
K
+

10^3 / 2^10 +

+
M
+

10^6 / 2^20 +

+
G
+

10^9 / 2^30 +

+
T
+

10^12 / 2^40 +

+
P
+

10^15 / 2^50 +

+
E
+

10^18 / 2^60 +

+
Z
+

10^21 / 2^70 +

+
Y
+

10^24 / 2^80 +

+
+ +
+
+

8 Codec Options

+ +

libavcodec provides some generic global options, which can be set on +all the encoders and decoders. In addition each codec may support +so-called private options, which are specific for a given codec. +

+

Sometimes, a global option may only affect a specific kind of codec, +and may be nonsensical or ignored by another, so you need to be aware +of the meaning of the specified options. Also some options are +meant only for decoding or encoding. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the +AVCodecContext options or using the libavutil/opt.h API +for programmatic use. +

+

The list of supported options follow: +

+
+
b integer (encoding,audio,video)
+

Set bitrate in bits/s. Default value is 200K. +

+
+
ab integer (encoding,audio)
+

Set audio bitrate (in bits/s). Default value is 128K. +

+
+
bt integer (encoding,video)
+

Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate +tolerance specifies how far ratecontrol is willing to deviate from the +target average bitrate value. This is not related to min/max +bitrate. Lowering tolerance too much has an adverse effect on quality. +

+
+
flags flags (decoding/encoding,audio,video,subtitles)
+

Set generic flags. +

+

Possible values: +

+
mv4
+

Use four motion vector by macroblock (mpeg4). +

+
qpel
+

Use 1/4 pel motion compensation. +

+
loop
+

Use loop filter. +

+
qscale
+

Use fixed qscale. +

+
pass1
+

Use internal 2pass ratecontrol in first pass mode. +

+
pass2
+

Use internal 2pass ratecontrol in second pass mode. +

+
gray
+

Only decode/encode grayscale. +

+
psnr
+

Set error[?] variables during encoding. +

+
truncated
+

Input bitstream might be randomly truncated. +

+
drop_changed
+

Don’t output frames whose parameters differ from first decoded frame in stream. +Error AVERROR_INPUT_CHANGED is returned when a frame is dropped. +

+
+
ildct
+

Use interlaced DCT. +

+
low_delay
+

Force low delay. +

+
global_header
+

Place global headers in extradata instead of every keyframe. +

+
bitexact
+

Only write platform-, build- and time-independent data. (except (I)DCT). +This ensures that file and data checksums are reproducible and match between +platforms. Its primary use is for regression testing. +

+
aic
+

Apply H263 advanced intra coding / mpeg4 ac prediction. +

+
ilme
+

Apply interlaced motion estimation. +

+
cgop
+

Use closed gop. +

+
output_corrupt
+

Output even potentially corrupted frames. +

+
+ +
+
time_base rational number
+

Set codec time base. +

+

It is the fundamental unit of time (in seconds) in terms of which +frame timestamps are represented. For fixed-fps content, timebase +should be 1 / frame_rate and timestamp increments should be +identically 1. +

+
+
g integer (encoding,video)
+

Set the group of picture (GOP) size. Default value is 12. +

+
+
ar integer (decoding/encoding,audio)
+

Set audio sampling rate (in Hz). +

+
+
ac integer (decoding/encoding,audio)
+

Set number of audio channels. +

+
+
cutoff integer (encoding,audio)
+

Set cutoff bandwidth. (Supported only by selected encoders, see +their respective documentation sections.) +

+
+
frame_size integer (encoding,audio)
+

Set audio frame size. +

+

Each submitted frame except the last must contain exactly frame_size +samples per channel. May be 0 when the codec has +CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not +restricted. It is set by some decoders to indicate constant frame +size. +

+
+
frame_number integer
+

Set the frame number. +

+
+
delay integer
+
qcomp float (encoding,video)
+

Set video quantizer scale compression (VBR). It is used as a constant +in the ratecontrol equation. Recommended range for default rc_eq: +0.0-1.0. +

+
+
qblur float (encoding,video)
+

Set video quantizer scale blur (VBR). +

+
+
qmin integer (encoding,video)
+

Set min video quantizer scale (VBR). Must be included between -1 and +69, default value is 2. +

+
+
qmax integer (encoding,video)
+

Set max video quantizer scale (VBR). Must be included between -1 and +1024, default value is 31. +

+
+
qdiff integer (encoding,video)
+

Set max difference between the quantizer scale (VBR). +

+
+
bf integer (encoding,video)
+

Set max number of B frames between non-B-frames. +

+

Must be an integer between -1 and 16. 0 means that B-frames are +disabled. If a value of -1 is used, it will choose an automatic value +depending on the encoder. +

+

Default value is 0. +

+
+
b_qfactor float (encoding,video)
+

Set qp factor between P and B frames. +

+
+
codec_tag integer
+
bug flags (decoding,video)
+

Workaround not auto detected encoder bugs. +

+

Possible values: +

+
autodetect
+
xvid_ilace
+

Xvid interlacing bug (autodetected if fourcc==XVIX) +

+
ump4
+

(autodetected if fourcc==UMP4) +

+
no_padding
+

padding bug (autodetected) +

+
amv
+
qpel_chroma
+
std_qpel
+

old standard qpel (autodetected per fourcc/version) +

+
qpel_chroma2
+
direct_blocksize
+

direct-qpel-blocksize bug (autodetected per fourcc/version) +

+
edge
+

edge padding bug (autodetected per fourcc/version) +

+
hpel_chroma
+
dc_clip
+
ms
+

Workaround various bugs in microsoft broken decoders. +

+
trunc
+

trancated frames +

+
+ +
+
strict integer (decoding/encoding,audio,video)
+

Specify how strictly to follow the standards. +

+

Possible values: +

+
very
+

strictly conform to an older more strict version of the spec or reference software +

+
strict
+

strictly conform to all the things in the spec no matter what consequences +

+
normal
+
unofficial
+

allow unofficial extensions +

+
experimental
+

allow non standardized experimental things, experimental +(unfinished/work in progress/not well tested) decoders and encoders. +Note: experimental decoders can pose a security risk, do not use this for +decoding untrusted input. +

+
+ +
+
b_qoffset float (encoding,video)
+

Set QP offset between P and B frames. +

+
+
err_detect flags (decoding,audio,video)
+

Set error detection flags. +

+

Possible values: +

+
crccheck
+

verify embedded CRCs +

+
bitstream
+

detect bitstream specification deviations +

+
buffer
+

detect improper bitstream length +

+
explode
+

abort decoding on minor error detection +

+
ignore_err
+

ignore decoding errors, and continue decoding. +This is useful if you want to analyze the content of a video and thus want +everything to be decoded no matter what. This option will not result in a video +that is pleasing to watch in case of errors. +

+
careful
+

consider things that violate the spec and have not been seen in the wild as errors +

+
compliant
+

consider all spec non compliancies as errors +

+
aggressive
+

consider things that a sane encoder should not do as an error +

+
+ +
+
has_b_frames integer
+
block_align integer
+
rc_override_count integer
+
maxrate integer (encoding,audio,video)
+

Set max bitrate tolerance (in bits/s). Requires bufsize to be set. +

+
+
minrate integer (encoding,audio,video)
+

Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR +encode. It is of little use elsewise. +

+
+
bufsize integer (encoding,audio,video)
+

Set ratecontrol buffer size (in bits). +

+
+
i_qfactor float (encoding,video)
+

Set QP factor between P and I frames. +

+
+
i_qoffset float (encoding,video)
+

Set QP offset between P and I frames. +

+
+
dct integer (encoding,video)
+

Set DCT algorithm. +

+

Possible values: +

+
auto
+

autoselect a good one (default) +

+
fastint
+

fast integer +

+
int
+

accurate integer +

+
mmx
+
altivec
+
faan
+

floating point AAN DCT +

+
+ +
+
lumi_mask float (encoding,video)
+

Compress bright areas stronger than medium ones. +

+
+
tcplx_mask float (encoding,video)
+

Set temporal complexity masking. +

+
+
scplx_mask float (encoding,video)
+

Set spatial complexity masking. +

+
+
p_mask float (encoding,video)
+

Set inter masking. +

+
+
dark_mask float (encoding,video)
+

Compress dark areas stronger than medium ones. +

+
+
idct integer (decoding/encoding,video)
+

Select IDCT implementation. +

+

Possible values: +

+
auto
+
int
+
simple
+
simplemmx
+
simpleauto
+

Automatically pick a IDCT compatible with the simple one +

+
+
arm
+
altivec
+
sh4
+
simplearm
+
simplearmv5te
+
simplearmv6
+
simpleneon
+
xvid
+
faani
+

floating point AAN IDCT +

+
+ +
+
slice_count integer
+
ec flags (decoding,video)
+

Set error concealment strategy. +

+

Possible values: +

+
guess_mvs
+

iterative motion vector (MV) search (slow) +

+
deblock
+

use strong deblock filter for damaged MBs +

+
favor_inter
+

favor predicting from the previous frame instead of the current +

+
+ +
+
bits_per_coded_sample integer
+
aspect rational number (encoding,video)
+

Set sample aspect ratio. +

+
+
sar rational number (encoding,video)
+

Set sample aspect ratio. Alias to aspect. +

+
+
debug flags (decoding/encoding,audio,video,subtitles)
+

Print specific debug info. +

+

Possible values: +

+
pict
+

picture info +

+
rc
+

rate control +

+
bitstream
+
mb_type
+

macroblock (MB) type +

+
qp
+

per-block quantization parameter (QP) +

+
dct_coeff
+
green_metadata
+

display complexity metadata for the upcoming frame, GoP or for a given duration. +

+
+
skip
+
startcode
+
er
+

error recognition +

+
mmco
+

memory management control operations (H.264) +

+
bugs
+
buffers
+

picture buffer allocations +

+
thread_ops
+

threading operations +

+
nomc
+

skip motion compensation +

+
+ +
+
cmp integer (encoding,video)
+

Set full pel me compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
subcmp integer (encoding,video)
+

Set sub pel me compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
mbcmp integer (encoding,video)
+

Set macroblock compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
ildctcmp integer (encoding,video)
+

Set interlaced dct compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
dia_size integer (encoding,video)
+

Set diamond type & size for motion estimation. +

+
(1024, INT_MAX)
+

full motion estimation(slowest) +

+
(768, 1024]
+

umh motion estimation +

+
(512, 768]
+

hex motion estimation +

+
(256, 512]
+

l2s diamond motion estimation +

+
[2,256]
+

var diamond motion estimation +

+
(-1, 2)
+

small diamond motion estimation +

+
-1
+

funny diamond motion estimation +

+
(INT_MIN, -1)
+

sab diamond motion estimation +

+
+ +
+
last_pred integer (encoding,video)
+

Set amount of motion predictors from the previous frame. +

+
+
precmp integer (encoding,video)
+

Set pre motion estimation compare function. +

+

Possible values: +

+
sad
+

sum of absolute differences, fast (default) +

+
sse
+

sum of squared errors +

+
satd
+

sum of absolute Hadamard transformed differences +

+
dct
+

sum of absolute DCT transformed differences +

+
psnr
+

sum of squared quantization errors (avoid, low quality) +

+
bit
+

number of bits needed for the block +

+
rd
+

rate distortion optimal, slow +

+
zero
+

0 +

+
vsad
+

sum of absolute vertical differences +

+
vsse
+

sum of squared vertical differences +

+
nsse
+

noise preserving sum of squared differences +

+
w53
+

5/3 wavelet, only used in snow +

+
w97
+

9/7 wavelet, only used in snow +

+
dctmax
+
chroma
+
+ +
+
pre_dia_size integer (encoding,video)
+

Set diamond type & size for motion estimation pre-pass. +

+
+
subq integer (encoding,video)
+

Set sub pel motion estimation quality. +

+
+
me_range integer (encoding,video)
+

Set limit motion vectors range (1023 for DivX player). +

+
+
global_quality integer (encoding,audio,video)
+
slice_flags integer
+
mbd integer (encoding,video)
+

Set macroblock decision algorithm (high quality mode). +

+

Possible values: +

+
simple
+

use mbcmp (default) +

+
bits
+

use fewest bits +

+
rd
+

use best rate distortion +

+
+ +
+
rc_init_occupancy integer (encoding,video)
+

Set number of bits which should be loaded into the rc buffer before +decoding starts. +

+
+
flags2 flags (decoding/encoding,audio,video,subtitles)
+
+

Possible values: +

+
fast
+

Allow non spec compliant speedup tricks. +

+
noout
+

Skip bitstream encoding. +

+
ignorecrop
+

Ignore cropping information from sps. +

+
local_header
+

Place global headers at every keyframe instead of in extradata. +

+
chunks
+

Frame data might be split into multiple chunks. +

+
showall
+

Show all frames before the first keyframe. +

+
export_mvs
+

Export motion vectors into frame side-data (see AV_FRAME_DATA_MOTION_VECTORS) +for codecs that support it. See also doc/examples/export_mvs.c. +

+
skip_manual
+

Do not skip samples and export skip information as frame side data. +

+
ass_ro_flush_noop
+

Do not reset ASS ReadOrder field on flush. +

+
icc_profiles
+

Generate/parse embedded ICC profiles from/to colorimetry tags. +

+
+ +
+
export_side_data flags (decoding/encoding,audio,video,subtitles)
+
+

Possible values: +

+
mvs
+

Export motion vectors into frame side-data (see AV_FRAME_DATA_MOTION_VECTORS) +for codecs that support it. See also doc/examples/export_mvs.c. +

+
prft
+

Export encoder Producer Reference Time into packet side-data (see AV_PKT_DATA_PRFT) +for codecs that support it. +

+
venc_params
+

Export video encoding parameters through frame side data (see AV_FRAME_DATA_VIDEO_ENC_PARAMS) +for codecs that support it. At present, those are H.264 and VP9. +

+
film_grain
+

Export film grain parameters through frame side data (see AV_FRAME_DATA_FILM_GRAIN_PARAMS). +Supported at present by AV1 decoders. +

+
+ +
+
threads integer (decoding/encoding,video)
+

Set the number of threads to be used, in case the selected codec +implementation supports multi-threading. +

+

Possible values: +

+
auto, 0
+

automatically select the number of threads to set +

+
+ +

Default value is ‘auto’. +

+
+
dc integer (encoding,video)
+

Set intra_dc_precision. +

+
+
nssew integer (encoding,video)
+

Set nsse weight. +

+
+
skip_top integer (decoding,video)
+

Set number of macroblock rows at the top which are skipped. +

+
+
skip_bottom integer (decoding,video)
+

Set number of macroblock rows at the bottom which are skipped. +

+
+
profile integer (encoding,audio,video)
+
+

Set encoder codec profile. Default value is ‘unknown’. Encoder specific +profiles are documented in the relevant encoder documentation. +

+
+
level integer (encoding,audio,video)
+
+

Possible values: +

+
unknown
+
+ +
+
lowres integer (decoding,audio,video)
+

Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions. +

+
+
mblmin integer (encoding,video)
+

Set min macroblock lagrange factor (VBR). +

+
+
mblmax integer (encoding,video)
+

Set max macroblock lagrange factor (VBR). +

+
+
skip_loop_filter integer (decoding,video)
+
skip_idct integer (decoding,video)
+
skip_frame integer (decoding,video)
+
+

Make decoder discard processing depending on the frame type selected +by the option value. +

+

skip_loop_filter skips frame loop filtering, skip_idct +skips frame IDCT/dequantization, skip_frame skips decoding. +

+

Possible values: +

+
none
+

Discard no frame. +

+
+
default
+

Discard useless frames like 0-sized frames. +

+
+
noref
+

Discard all non-reference frames. +

+
+
bidir
+

Discard all bidirectional frames. +

+
+
nokey
+

Discard all frames excepts keyframes. +

+
+
nointra
+

Discard all frames except I frames. +

+
+
all
+

Discard all frames. +

+
+ +

Default value is ‘default’. +

+
+
bidir_refine integer (encoding,video)
+

Refine the two motion vectors used in bidirectional macroblocks. +

+
+
keyint_min integer (encoding,video)
+

Set minimum interval between IDR-frames. +

+
+
refs integer (encoding,video)
+

Set reference frames to consider for motion compensation. +

+
+
trellis integer (encoding,audio,video)
+

Set rate-distortion optimal quantization. +

+
+
mv0_threshold integer (encoding,video)
+
compression_level integer (encoding,audio,video)
+
bits_per_raw_sample integer
+
channel_layout integer (decoding/encoding,audio)
+
+

Possible values: +

+
request_channel_layout integer (decoding,audio)
+
+

Possible values: +

+
rc_max_vbv_use float (encoding,video)
+
rc_min_vbv_use float (encoding,video)
+
color_primaries integer (decoding/encoding,video)
+

Possible values: +

+
bt709
+

BT.709 +

+
bt470m
+

BT.470 M +

+
bt470bg
+

BT.470 BG +

+
smpte170m
+

SMPTE 170 M +

+
smpte240m
+

SMPTE 240 M +

+
film
+

Film +

+
bt2020
+

BT.2020 +

+
smpte428
+
smpte428_1
+

SMPTE ST 428-1 +

+
smpte431
+

SMPTE 431-2 +

+
smpte432
+

SMPTE 432-1 +

+
jedec-p22
+

JEDEC P22 +

+
+ +
+
color_trc integer (decoding/encoding,video)
+

Possible values: +

+
bt709
+

BT.709 +

+
gamma22
+

BT.470 M +

+
gamma28
+

BT.470 BG +

+
smpte170m
+

SMPTE 170 M +

+
smpte240m
+

SMPTE 240 M +

+
linear
+

Linear +

+
log
+
log100
+

Log +

+
log_sqrt
+
log316
+

Log square root +

+
iec61966_2_4
+
iec61966-2-4
+

IEC 61966-2-4 +

+
bt1361
+
bt1361e
+

BT.1361 +

+
iec61966_2_1
+
iec61966-2-1
+

IEC 61966-2-1 +

+
bt2020_10
+
bt2020_10bit
+

BT.2020 - 10 bit +

+
bt2020_12
+
bt2020_12bit
+

BT.2020 - 12 bit +

+
smpte2084
+

SMPTE ST 2084 +

+
smpte428
+
smpte428_1
+

SMPTE ST 428-1 +

+
arib-std-b67
+

ARIB STD-B67 +

+
+ +
+
colorspace integer (decoding/encoding,video)
+

Possible values: +

+
rgb
+

RGB +

+
bt709
+

BT.709 +

+
fcc
+

FCC +

+
bt470bg
+

BT.470 BG +

+
smpte170m
+

SMPTE 170 M +

+
smpte240m
+

SMPTE 240 M +

+
ycocg
+

YCOCG +

+
bt2020nc
+
bt2020_ncl
+

BT.2020 NCL +

+
bt2020c
+
bt2020_cl
+

BT.2020 CL +

+
smpte2085
+

SMPTE 2085 +

+
chroma-derived-nc
+

Chroma-derived NCL +

+
chroma-derived-c
+

Chroma-derived CL +

+
ictcp
+

ICtCp +

+
+ +
+
color_range integer (decoding/encoding,video)
+

If used as input parameter, it serves as a hint to the decoder, which +color_range the input has. +Possible values: +

+
tv
+
mpeg
+

MPEG (219*2^(n-8)) +

+
pc
+
jpeg
+

JPEG (2^n-1) +

+
+ +
+
chroma_sample_location integer (decoding/encoding,video)
+

Possible values: +

+
left
+
center
+
topleft
+
top
+
bottomleft
+
bottom
+
+ +
+
log_level_offset integer
+

Set the log level offset. +

+
+
slices integer (encoding,video)
+

Number of slices, used in parallelized encoding. +

+
+
thread_type flags (decoding/encoding,video)
+

Select which multithreading methods to use. +

+

Use of ‘frame’ will increase decoding delay by one frame per +thread, so clients which cannot provide future frames should not use +it. +

+

Possible values: +

+
slice
+

Decode more than one part of a single frame at once. +

+

Multithreading using slices works only when the video was encoded with +slices. +

+
+
frame
+

Decode more than one frame at once. +

+
+ +

Default value is ‘slice+frame’. +

+
+
audio_service_type integer (encoding,audio)
+

Set audio service type. +

+

Possible values: +

+
ma
+

Main Audio Service +

+
ef
+

Effects +

+
vi
+

Visually Impaired +

+
hi
+

Hearing Impaired +

+
di
+

Dialogue +

+
co
+

Commentary +

+
em
+

Emergency +

+
vo
+

Voice Over +

+
ka
+

Karaoke +

+
+ +
+
request_sample_fmt sample_fmt (decoding,audio)
+

Set sample format audio decoders should prefer. Default value is +none. +

+
+
pkt_timebase rational number
+
sub_charenc encoding (decoding,subtitles)
+

Set the input subtitles character encoding. +

+
+
field_order field_order (video)
+

Set/override the field order of the video. +Possible values: +

+
progressive
+

Progressive video +

+
tt
+

Interlaced video, top field coded and displayed first +

+
bb
+

Interlaced video, bottom field coded and displayed first +

+
tb
+

Interlaced video, top coded first, bottom displayed first +

+
bt
+

Interlaced video, bottom coded first, top displayed first +

+
+ +
+
skip_alpha bool (decoding,video)
+

Set to 1 to disable processing alpha (transparency). This works like the +‘gray’ flag in the flags option which skips chroma information +instead of alpha. Default is 0. +

+
+
codec_whitelist list (input)
+

"," separated list of allowed decoders. By default all are allowed. +

+
+
dump_separator string (input)
+

Separator used to separate the fields printed on the command line about the +Stream parameters. +For example, to separate the fields with newlines and indentation: +

+
ffprobe -dump_separator "
+                          "  -i ~/videos/matrixbench_mpeg2.mpg
+
+ +
+
max_pixels integer (decoding/encoding,video)
+

Maximum number of pixels per image. This value can be used to avoid out of +memory failures due to large images. +

+
+
apply_cropping bool (decoding,video)
+

Enable cropping if cropping parameters are multiples of the required +alignment for the left and top parameters. If the alignment is not met the +cropping will be partially applied to maintain alignment. +Default is 1 (enabled). +Note: The required alignment depends on if AV_CODEC_FLAG_UNALIGNED is set and the +CPU. AV_CODEC_FLAG_UNALIGNED cannot be changed from the command line. Also hardware +decoders will not apply left/top Cropping. +

+ +
+
+ + +
+
+

9 Decoders

+ +

Decoders are configured elements in FFmpeg which allow the decoding of +multimedia streams. +

+

When you configure your FFmpeg build, all the supported native decoders +are enabled by default. Decoders requiring an external library must be enabled +manually via the corresponding --enable-lib option. You can list all +available decoders using the configure option --list-decoders. +

+

You can disable all the decoders with the configure option +--disable-decoders and selectively enable / disable single decoders +with the options --enable-decoder=DECODER / +--disable-decoder=DECODER. +

+

The option -decoders of the ff* tools will display the list of +enabled decoders. +

+ +
+
+

10 Video Decoders

+ +

A description of some of the currently available video decoders +follows. +

+ +
+

10.1 av1

+ +

AOMedia Video 1 (AV1) decoder. +

+ +
+

10.1.1 Options

+ +
+
operating_point
+

Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0. +

+
+
+ +
+
+
+

10.2 rawvideo

+ +

Raw video decoder. +

+

This decoder decodes rawvideo streams. +

+ +
+

10.2.1 Options

+ +
+
top top_field_first
+

Specify the assumed field type of the input video. +

+
-1
+

the video is assumed to be progressive (default) +

+
0
+

bottom-field-first is assumed +

+
1
+

top-field-first is assumed +

+
+ +
+
+ +
+
+
+

10.3 libdav1d

+ +

dav1d AV1 decoder. +

+

libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec. +Requires the presence of the libdav1d headers and library during configuration. +You need to explicitly configure the build with --enable-libdav1d. +

+ +
+

10.3.1 Options

+ +

The following options are supported by the libdav1d wrapper. +

+
+
framethreads
+

Set amount of frame threads to use during decoding. The default value is 0 (autodetect). +This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the +option max_frame_delay and the global option threads instead. +

+
+
tilethreads
+

Set amount of tile threads to use during decoding. The default value is 0 (autodetect). +This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the +global option threads instead. +

+
+
max_frame_delay
+

Set max amount of frames the decoder may buffer internally. The default value is 0 +(autodetect). +

+
+
filmgrain
+

Apply film grain to the decoded video if present in the bitstream. Defaults to the +internal default of the library. +This option is deprecated and will be removed in the future. See the global option +export_side_data to export Film Grain parameters instead of applying it. +

+
+
oppoint
+

Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the +internal default of the library. +

+
+
alllayers
+

Output all spatial layers of a scalable AV1 bitstream. The default value is false. +

+
+
+ +
+
+
+

10.4 libdavs2

+ +

AVS2-P2/IEEE1857.4 video decoder wrapper. +

+

This decoder allows libavcodec to decode AVS2 streams with davs2 library. +

+ +
+
+

10.5 libuavs3d

+ +

AVS3-P2/IEEE1857.10 video decoder. +

+

libuavs3d allows libavcodec to decode AVS3 streams. +Requires the presence of the libuavs3d headers and library during configuration. +You need to explicitly configure the build with --enable-libuavs3d. +

+ +
+

10.5.1 Options

+ +

The following option is supported by the libuavs3d wrapper. +

+
+
frame_threads
+

Set amount of frame threads to use during decoding. The default value is 0 (autodetect). +

+
+
+ +
+
+
+

10.6 QSV Decoders

+ +

The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC, +JPEG/MJPEG, VP8, VP9, AV1). +

+ +
+

10.6.1 Common Options

+ +

The following options are supported by all qsv decoders. +

+
+
async_depth
+

Internal parallelization depth, the higher the value the higher the latency. +

+
+
gpu_copy
+

A GPU-accelerated copy between video and system memory +

+
default
+
on
+
off
+
+ +
+
+ +
+
+

10.6.2 HEVC Options

+

Extra options for hevc_qsv. +

+
+
load_plugin
+

A user plugin to load in an internal session +

+
none
+
hevc_sw
+
hevc_hw
+
+ +
+
load_plugins
+

A :-separate list of hexadecimal plugin UIDs to load in an internal session +

+
+
+ +
+
+
+

10.7 v210

+ +

Uncompressed 4:2:2 10-bit decoder. +

+ +
+

10.7.1 Options

+ +
+
custom_stride
+

Set the line size of the v210 data in bytes. The default value is 0 +(autodetect). You can use the special -1 value for a strideless v210 as seen in +BOXX files. +

+
+
+ + +
+
+
+
+

11 Audio Decoders

+ +

A description of some of the currently available audio decoders +follows. +

+ +
+

11.1 ac3

+ +

AC-3 audio decoder. +

+

This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as +the undocumented RealAudio 3 (a.k.a. dnet). +

+ +
+

11.1.1 AC-3 Decoder Options

+ +
+
-drc_scale value
+

Dynamic Range Scale Factor. The factor to apply to dynamic range values +from the AC-3 stream. This factor is applied exponentially. The default value is 1. +There are 3 notable scale factor ranges: +

+
drc_scale == 0
+

DRC disabled. Produces full range audio. +

+
0 < drc_scale <= 1
+

DRC enabled. Applies a fraction of the stream DRC value. +Audio reproduction is between full range and full compression. +

+
drc_scale > 1
+

DRC enabled. Applies drc_scale asymmetrically. +Loud sounds are fully compressed. Soft sounds are enhanced. +

+
+ +
+
+ +
+
+
+

11.2 flac

+ +

FLAC audio decoder. +

+

This decoder aims to implement the complete FLAC specification from Xiph. +

+ +
+

11.2.1 FLAC Decoder options

+ +
+
-use_buggy_lpc
+

The lavc FLAC encoder used to produce buggy streams with high lpc values +(like the default value). This option makes it possible to decode such streams +correctly by using lavc’s old buggy lpc logic for decoding. +

+
+
+ +
+
+
+

11.3 ffwavesynth

+ +

Internal wave synthesizer. +

+

This decoder generates wave patterns according to predefined sequences. Its +use is purely internal and the format of the data it accepts is not publicly +documented. +

+
+
+

11.4 libcelt

+ +

libcelt decoder wrapper. +

+

libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec. +Requires the presence of the libcelt headers and library during configuration. +You need to explicitly configure the build with --enable-libcelt. +

+
+
+

11.5 libgsm

+ +

libgsm decoder wrapper. +

+

libgsm allows libavcodec to decode the GSM full rate audio codec. Requires +the presence of the libgsm headers and library during configuration. You need +to explicitly configure the build with --enable-libgsm. +

+

This decoder supports both the ordinary GSM and the Microsoft variant. +

+
+
+

11.6 libilbc

+ +

libilbc decoder wrapper. +

+

libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC) +audio codec. Requires the presence of the libilbc headers and library during +configuration. You need to explicitly configure the build with +--enable-libilbc. +

+ +
+

11.6.1 Options

+ +

The following option is supported by the libilbc wrapper. +

+
+
enhance
+
+

Enable the enhancement of the decoded audio when set to 1. The default +value is 0 (disabled). +

+
+
+ +
+
+
+

11.7 libopencore-amrnb

+ +

libopencore-amrnb decoder wrapper. +

+

libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate +Narrowband audio codec. Using it requires the presence of the +libopencore-amrnb headers and library during configuration. You need to +explicitly configure the build with --enable-libopencore-amrnb. +

+

An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB +without this library. +

+
+
+

11.8 libopencore-amrwb

+ +

libopencore-amrwb decoder wrapper. +

+

libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate +Wideband audio codec. Using it requires the presence of the +libopencore-amrwb headers and library during configuration. You need to +explicitly configure the build with --enable-libopencore-amrwb. +

+

An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB +without this library. +

+
+
+

11.9 libopus

+ +

libopus decoder wrapper. +

+

libopus allows libavcodec to decode the Opus Interactive Audio Codec. +Requires the presence of the libopus headers and library during +configuration. You need to explicitly configure the build with +--enable-libopus. +

+

An FFmpeg native decoder for Opus exists, so users can decode Opus +without this library. +

+ +
+
+
+

12 Subtitles Decoders

+ + +
+

12.1 libaribb24

+ +

ARIB STD-B24 caption decoder. +

+

Implements profiles A and C of the ARIB STD-B24 standard. +

+ +
+

12.1.1 libaribb24 Decoder Options

+ +
+
-aribb24-base-path path
+

Sets the base path for the libaribb24 library. This is utilized for reading of +configuration files (for custom unicode conversions), and for dumping of +non-text symbols as images under that location. +

+

Unset by default. +

+
+
-aribb24-skip-ruby-text boolean
+

Tells the decoder wrapper to skip text blocks that contain half-height ruby +text. +

+

Enabled by default. +

+
+
+ +
+
+
+

12.2 libaribcaption

+ +

Yet another ARIB STD-B24 caption decoder using external libaribcaption +library. +

+

Implements profiles A and C of the Japanse ARIB STD-B24 standard, +Brazilian ABNT NBR 15606-1, and Philippines version of ISDB-T. +

+

Requires the presence of the libaribcaption headers and library +(https://github.com/xqq/libaribcaption) during configuration. +You need to explicitly configure the build with --enable-libaribcaption. +If both libaribb24 and libaribcaption are enabled, libaribcaption +decoder precedes. +

+ +
+

12.2.1 libaribcaption Decoder Options

+ +
+
-sub_type subtitle_type
+

Specifies the format of the decoded subtitles. +

+
+
bitmap
+

Graphical image. +

+
ass
+

ASS formatted text. +

+
text
+

Simple text based output without formatting. +

+
+ +

The default is ass as same as libaribb24 decoder. +Some present players (e.g., mpv) expect ASS format for ARIB caption. +

+
+
-caption_encoding encoding_scheme
+

Specifies the encoding scheme of input subtitle text. +

+
+
auto
+

Automatically detect text encoding. +

+
jis
+

8bit-char JIS encoding defined in ARIB STD B24. +This encoding used in Japan for ISDB captions. +

+
utf8
+

UTF-8 encoding defined in ARIB STD B24. +This encoding is used in Philippines for ISDB-T captions. +

+
latin
+

Latin character encoding defined in ABNT NBR 15606-1. +This encoding is used in South America for SBTVD / ISDB-Tb captions. +

+
+ +

The default is ass as same as libaribb24 decoder. +Some present players (e.g., mpv) expect ASS format for ARIB caption. +

+
+
-font font_name[,font_name2,...]
+

Specify comma-separated list of font family names to be used for bitmap +or ass type subtitle rendering. +Only first font name is used for ass type subtitle. +

+

If not specified, use internaly defined default font family. +

+
+
-ass_single_rect boolean
+

ARIB STD-B24 specifies that some captions may be displayed at different +positions at a time (multi-rectangle subtitle). +Since some players (e.g., old mpv) can’t handle multiple ASS rectangles +in a single AVSubtitle, or multiple ASS rectangles of indeterminate duration +with the same start timestamp, this option can change the behavior so that +all the texts are displayed in a single ASS rectangle. +

+

The default is false. +

+

If your player cannot handle AVSubtitles with multiple ASS rectangles properly, +set this option to true or define ASS_SINGLE_RECT=1 to change +default behavior at compilation. +

+
+
-replace_fullwidth_ascii boolean
+

Specify whether to replace MSZ (Middle Size, half width) fullwidth +alphanumerics with halfwidth alphanumerics. +

+

The default is true. +

+
+
-force_outline_text boolean
+

Specify whether always render outline text for all characters regardless of +the indication by charactor style. +

+

The default is false. +

+
+
-outline_width number (0.0 - 3.0)
+

Specify width for outline text, in dots (relative). +

+

The default is 1.5. +

+
+
-ignore_background boolean
+

Specify whether to ignore background color rendering. +

+

The default is false. +

+
+
-ignore_ruby boolean
+

Specify whether to ignore rendering for ruby-like (furigana) characters. +

+

The default is false. +

+
+
-replace_drcs boolean
+

Specify whether to render replaced DRCS characters as Unicode characters. +

+

The default is true. +

+
+
-canvas_size image_size
+

Specify the resolution of the canvas to render subtitles to; usually, this +should be frame size of input video. +This only applies when -subtitle_type is set to bitmap. +

+

The libaribcaption decoder assumes input frame size for bitmap rendering as below: +

    +
  1. PROFILE_A : 1440 x 1080 with SAR (PAR) 4:3 +
  2. PROFILE_C : 320 x 180 with SAR (PAR) 1:1 +
+ +

If actual frame size of input video does not match above assumption, +the rendered captions may be distorted. +To make the captions undistorted, add -canvas_size option to specify +actual input video size. +

+

Note that the -canvas_size option is not required for video with +different size but same aspect ratio. +In such cases, the caption will be stretched or shrunk to actual video size +if -canvas_size option is not specified. +If -canvas_size option is specified with different size, +the caption will be stretched or shrunk as specified size with calculated SAR. +

+
+
+ +
+
+

12.2.2 libaribcaption decoder usage examples

+ +

Display MPEG-TS file with ARIB subtitle by ffplay tool: +

+
ffplay -sub_type bitmap MPEG.TS
+
+ +

Display MPEG-TS file with input frame size 1920x1080 by ffplay tool: +

+
ffplay -sub_type bitmap -canvas_size 1920x1080 MPEG.TS
+
+ +

Embed ARIB subtitle in transcoded video: +

+
ffmpeg -sub_type bitmap -i src.m2t -filter_complex "[0:v][0:s]overlay" -vcodec h264 dest.mp4
+
+ +
+
+
+

12.3 dvbsub

+ + +
+

12.3.1 Options

+ +
+
compute_clut
+
+
-2
+

Compute clut once if no matching CLUT is in the stream. +

+
-1
+

Compute clut if no matching CLUT is in the stream. +

+
0
+

Never compute CLUT +

+
1
+

Always compute CLUT and override the one provided in the stream. +

+
+
+
dvb_substream
+

Selects the dvb substream, or all substreams if -1 which is default. +

+
+
+ +
+
+
+

12.4 dvdsub

+ +

This codec decodes the bitmap subtitles used in DVDs; the same subtitles can +also be found in VobSub file pairs and in some Matroska files. +

+ +
+

12.4.1 Options

+ +
+
palette
+

Specify the global palette used by the bitmaps. When stored in VobSub, the +palette is normally specified in the index file; in Matroska, the palette is +stored in the codec extra-data in the same format as in VobSub. In DVDs, the +palette is stored in the IFO file, and therefore not available when reading +from dumped VOB files. +

+

The format for this option is a string containing 16 24-bits hexadecimal +numbers (without 0x prefix) separated by commas, for example 0d00ee, +ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1, +7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b. +

+
+
ifo_palette
+

Specify the IFO file from which the global palette is obtained. +(experimental) +

+
+
forced_subs_only
+

Only decode subtitle entries marked as forced. Some titles have forced +and non-forced subtitles in the same track. Setting this flag to 1 +will only keep the forced subtitles. Default value is 0. +

+
+ +
+
+
+

12.5 libzvbi-teletext

+ +

Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext +subtitles. Requires the presence of the libzvbi headers and library during +configuration. You need to explicitly configure the build with +--enable-libzvbi. +

+ +
+

12.5.1 Options

+ +
+
txt_page
+

List of teletext page numbers to decode. Pages that do not match the specified +list are dropped. You may use the special * string to match all pages, +or subtitle to match all subtitle pages. +Default value is *. +

+
txt_default_region
+

Set default character set used for decoding, a value between 0 and 87 (see +ETS 300 706, Section 15, Table 32). Default value is -1, which does not +override the libzvbi default. This option is needed for some legacy level 1.0 +transmissions which cannot signal the proper charset. +

+
txt_chop_top
+

Discards the top teletext line. Default value is 1. +

+
txt_format
+

Specifies the format of the decoded subtitles. +

+
bitmap
+

The default format, you should use this for teletext pages, because certain +graphics and colors cannot be expressed in simple text or even ASS. +

+
text
+

Simple text based output without formatting. +

+
ass
+

Formatted ASS output, subtitle pages and teletext pages are returned in +different styles, subtitle pages are stripped down to text, but an effort is +made to keep the text alignment and the formatting. +

+
+
+
txt_left
+

X offset of generated bitmaps, default is 0. +

+
txt_top
+

Y offset of generated bitmaps, default is 0. +

+
txt_chop_spaces
+

Chops leading and trailing spaces and removes empty lines from the generated +text. This option is useful for teletext based subtitles where empty spaces may +be present at the start or at the end of the lines or empty lines may be +present between the subtitle lines because of double-sized teletext characters. +Default value is 1. +

+
txt_duration
+

Sets the display duration of the decoded teletext pages or subtitles in +milliseconds. Default value is -1 which means infinity or until the next +subtitle event comes. +

+
txt_transparent
+

Force transparent background of the generated teletext bitmaps. Default value +is 0 which means an opaque background. +

+
txt_opacity
+

Sets the opacity (0-255) of the teletext background. If +txt_transparent is not set, it only affects characters between a start +box and an end box, typically subtitles. Default value is 0 if +txt_transparent is set, 255 otherwise. +

+
+
+ +
+
+
+
+

13 Bitstream Filters

+ +

When you configure your FFmpeg build, all the supported bitstream +filters are enabled by default. You can list all available ones using +the configure option --list-bsfs. +

+

You can disable all the bitstream filters using the configure option +--disable-bsfs, and selectively enable any bitstream filter using +the option --enable-bsf=BSF, or you can disable a particular +bitstream filter using the option --disable-bsf=BSF. +

+

The option -bsfs of the ff* tools will display the list of +all the supported bitstream filters included in your build. +

+

The ff* tools have a -bsf option applied per stream, taking a +comma-separated list of filters, whose parameters follow the filter +name after a ’=’. +

+
+
ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
+
+ +

Below is a description of the currently available bitstream filters, +with their parameters, if any. +

+ +
+

13.1 aac_adtstoasc

+ +

Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration +bitstream. +

+

This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4 +ADTS header and removes the ADTS header. +

+

This filter is required for example when copying an AAC stream from a +raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or +to MOV/MP4 files and related formats such as 3GP or M4A. Please note +that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats. +

+
+
+

13.2 av1_metadata

+ +

Modify metadata embedded in an AV1 stream. +

+
+
td
+

Insert or remove temporal delimiter OBUs in all temporal units of the +stream. +

+
+
insert
+

Insert a TD at the beginning of every TU which does not already have one. +

+
remove
+

Remove the TD from the beginning of every TU which has one. +

+
+ +
+
color_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the color description fields in the stream (see AV1 section 6.4.2). +

+
+
color_range
+

Set the color range in the stream (see AV1 section 6.4.2; note that +this cannot be set for streams using BT.709 primaries, sRGB transfer +characteristic and identity (RGB) matrix coefficients). +

+
tv
+

Limited range. +

+
pc
+

Full range. +

+
+ +
+
chroma_sample_position
+

Set the chroma sample location in the stream (see AV1 section 6.4.2). +This can only be set for 4:2:0 streams. +

+
+
vertical
+

Left position (matching the default in MPEG-2 and H.264). +

+
colocated
+

Top-left position. +

+
+ +
+
tick_rate
+

Set the tick rate (time_scale / num_units_in_display_tick) in +the timing info in the sequence header. +

+
num_ticks_per_picture
+

Set the number of ticks in each picture, to indicate that the stream +has a fixed framerate. Ignored if tick_rate is not also set. +

+
+
delete_padding
+

Deletes Padding OBUs. +

+
+
+ +
+
+

13.3 chomp

+ +

Remove zero padding at the end of a packet. +

+
+
+

13.4 dca_core

+ +

Extract the core from a DCA/DTS stream, dropping extensions such as +DTS-HD. +

+
+
+

13.5 dump_extra

+ +

Add extradata to the beginning of the filtered packets except when +said packets already exactly begin with the extradata that is intended +to be added. +

+
+
freq
+

The additional argument specifies which packets should be filtered. +It accepts the values: +

+
k
+
keyframe
+

add extradata to all key packets +

+
+
e
+
all
+

add extradata to all packets +

+
+
+
+ +

If not specified it is assumed ‘k’. +

+

For example the following ffmpeg command forces a global +header (thus disabling individual packet headers) in the H.264 packets +generated by the libx264 encoder, but corrects them by adding +the header stored in extradata to the key packets: +

+
ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
+
+ +
+
+

13.6 dv_error_marker

+ +

Blocks in DV which are marked as damaged are replaced by blocks of the specified color. +

+
+
color
+

The color to replace damaged blocks by +

+
sta
+

A 16 bit mask which specifies which of the 16 possible error status values are +to be replaced by colored blocks. 0xFFFE is the default which replaces all non 0 +error status values. +

+
ok
+

No error, no concealment +

+
err
+

Error, No concealment +

+
res
+

Reserved +

+
notok
+

Error or concealment +

+
notres
+

Not reserved +

+
Aa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru
+

The specific error status code +

+
+

see page 44-46 or section 5.5 of +http://web.archive.org/web/20060927044735/http://www.smpte.org/smpte_store/standards/pdf/s314m.pdf +

+
+
+ +
+
+

13.7 eac3_core

+ +

Extract the core from a E-AC-3 stream, dropping extra channels. +

+
+
+

13.8 extract_extradata

+ +

Extract the in-band extradata. +

+

Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers, +or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either "in-band" (i.e. as a part +of the bitstream containing the coded frames) or "out of band" (e.g. on the +container level). This latter form is called "extradata" in FFmpeg terminology. +

+

This bitstream filter detects the in-band headers and makes them available as +extradata. +

+
+
remove
+

When this option is enabled, the long-term headers are removed from the +bitstream after extraction. +

+
+ +
+
+

13.9 filter_units

+ +

Remove units with types in or not in a given set from the stream. +

+
+
pass_types
+

List of unit types or ranges of unit types to pass through while removing +all others. This is specified as a ’|’-separated list of unit type values +or ranges of values with ’-’. +

+
+
remove_types
+

Identical to pass_types, except the units in the given set +removed and all others passed through. +

+
+ +

Extradata is unchanged by this transformation, but note that if the stream +contains inline parameter sets then the output may be unusable if they are +removed. +

+

For example, to remove all non-VCL NAL units from an H.264 stream: +

+
ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
+
+ +

To remove all AUDs, SEI and filler from an H.265 stream: +

+
ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
+
+ +
+
+

13.10 hapqa_extract

+ +

Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file. +

+
+
texture
+

Specifies the texture to keep. +

+
+
color
+
alpha
+
+ +
+
+ +

Convert HAPQA to HAPQ +

+
ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=color -tag:v HapY -metadata:s:v:0 encoder="HAPQ" hapq_file.mov
+
+ +

Convert HAPQA to HAPAlphaOnly +

+
ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=alpha -tag:v HapA -metadata:s:v:0 encoder="HAPAlpha Only" hapalphaonly_file.mov
+
+ +
+
+

13.11 h264_metadata

+ +

Modify metadata embedded in an H.264 stream. +

+
+
aud
+

Insert or remove AUD NAL units in all access units of the stream. +

+
+
pass
+
insert
+
remove
+
+ +

Default is pass. +

+
+
sample_aspect_ratio
+

Set the sample aspect ratio of the stream in the VUI parameters. +See H.264 table E-1. +

+
+
overscan_appropriate_flag
+

Set whether the stream is suitable for display using overscan +or not (see H.264 section E.2.1). +

+
+
video_format
+
video_full_range_flag
+

Set the video format in the stream (see H.264 section E.2.1 and +table E-2). +

+
+
colour_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the colour description in the stream (see H.264 section E.2.1 +and tables E-3, E-4 and E-5). +

+
+
chroma_sample_loc_type
+

Set the chroma sample location in the stream (see H.264 section +E.2.1 and figure E-1). +

+
+
tick_rate
+

Set the tick rate (time_scale / num_units_in_tick) in the VUI +parameters. This is the smallest time unit representable in the +stream, and in many cases represents the field rate of the stream +(double the frame rate). +

+
fixed_frame_rate_flag
+

Set whether the stream has fixed framerate - typically this indicates +that the framerate is exactly half the tick rate, but the exact +meaning is dependent on interlacing and the picture structure (see +H.264 section E.2.1 and table E-6). +

+
zero_new_constraint_set_flags
+

Zero constraint_set4_flag and constraint_set5_flag in the SPS. These +bits were reserved in a previous version of the H.264 spec, and thus +some hardware decoders require these to be zero. The result of zeroing +this is still a valid bitstream. +

+
+
crop_left
+
crop_right
+
crop_top
+
crop_bottom
+

Set the frame cropping offsets in the SPS. These values will replace +the current ones if the stream is already cropped. +

+

These fields are set in pixels. Note that some sizes may not be +representable if the chroma is subsampled or the stream is interlaced +(see H.264 section 7.4.2.1.1). +

+
+
sei_user_data
+

Insert a string as SEI unregistered user data. The argument must +be of the form UUID+string, where the UUID is as hex digits +possibly separated by hyphens, and the string can be anything. +

+

For example, ‘086f3693-b7b3-4f2c-9653-21492feee5b8+hello’ will +insert the string “hello” associated with the given UUID. +

+
+
delete_filler
+

Deletes both filler NAL units and filler SEI messages. +

+
+
display_orientation
+

Insert, extract or remove Display orientation SEI messages. +See H.264 section D.1.27 and D.2.27 for syntax and semantics. +

+
+
pass
+
insert
+
remove
+
extract
+
+ +

Default is pass. +

+

Insert mode works in conjunction with rotate and flip options. +Any pre-existing Display orientation messages will be removed in insert or remove mode. +Extract mode attaches the display matrix to the packet as side data. +

+
+
rotate
+

Set rotation in display orientation SEI (anticlockwise angle in degrees). +Range is -360 to +360. Default is NaN. +

+
+
flip
+

Set flip in display orientation SEI. +

+
+
horizontal
+
vertical
+
+ +

Default is unset. +

+
+
level
+

Set the level in the SPS. Refer to H.264 section A.3 and tables A-1 +to A-5. +

+

The argument must be the name of a level (for example, ‘4.2’), a +level_idc value (for example, ‘42’), or the special name ‘auto’ +indicating that the filter should attempt to guess the level from the +input stream properties. +

+
+
+ +
+
+

13.12 h264_mp4toannexb

+ +

Convert an H.264 bitstream from length prefixed mode to start code +prefixed mode (as defined in the Annex B of the ITU-T H.264 +specification). +

+

This is required by some streaming formats, typically the MPEG-2 +transport stream format (muxer mpegts). +

+

For example to remux an MP4 file containing an H.264 stream to mpegts +format with ffmpeg, you can use the command: +

+
+
ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
+
+ +

Please note that this filter is auto-inserted for MPEG-TS (muxer +mpegts) and raw H.264 (muxer h264) output formats. +

+
+
+

13.13 h264_redundant_pps

+ +

This applies a specific fixup to some Blu-ray streams which contain +redundant PPSs modifying irrelevant parameters of the stream which +confuse other transformations which require correct extradata. +

+
+
+

13.14 hevc_metadata

+ +

Modify metadata embedded in an HEVC stream. +

+
+
aud
+

Insert or remove AUD NAL units in all access units of the stream. +

+
+
insert
+
remove
+
+ +
+
sample_aspect_ratio
+

Set the sample aspect ratio in the stream in the VUI parameters. +

+
+
video_format
+
video_full_range_flag
+

Set the video format in the stream (see H.265 section E.3.1 and +table E.2). +

+
+
colour_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the colour description in the stream (see H.265 section E.3.1 +and tables E.3, E.4 and E.5). +

+
+
chroma_sample_loc_type
+

Set the chroma sample location in the stream (see H.265 section +E.3.1 and figure E.1). +

+
+
tick_rate
+

Set the tick rate in the VPS and VUI parameters (time_scale / +num_units_in_tick). Combined with num_ticks_poc_diff_one, this can +set a constant framerate in the stream. Note that it is likely to be +overridden by container parameters when the stream is in a container. +

+
+
num_ticks_poc_diff_one
+

Set poc_proportional_to_timing_flag in VPS and VUI and use this value +to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and +E.3.1). Ignored if tick_rate is not also set. +

+
+
crop_left
+
crop_right
+
crop_top
+
crop_bottom
+

Set the conformance window cropping offsets in the SPS. These values +will replace the current ones if the stream is already cropped. +

+

These fields are set in pixels. Note that some sizes may not be +representable if the chroma is subsampled (H.265 section 7.4.3.2.1). +

+
+
level
+

Set the level in the VPS and SPS. See H.265 section A.4 and tables +A.6 and A.7. +

+

The argument must be the name of a level (for example, ‘5.1’), a +general_level_idc value (for example, ‘153’ for level 5.1), +or the special name ‘auto’ indicating that the filter should +attempt to guess the level from the input stream properties. +

+
+
+ +
+
+

13.15 hevc_mp4toannexb

+ +

Convert an HEVC/H.265 bitstream from length prefixed mode to start code +prefixed mode (as defined in the Annex B of the ITU-T H.265 +specification). +

+

This is required by some streaming formats, typically the MPEG-2 +transport stream format (muxer mpegts). +

+

For example to remux an MP4 file containing an HEVC stream to mpegts +format with ffmpeg, you can use the command: +

+
+
ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
+
+ +

Please note that this filter is auto-inserted for MPEG-TS (muxer +mpegts) and raw HEVC/H.265 (muxer h265 or +hevc) output formats. +

+
+
+

13.16 imxdump

+ +

Modifies the bitstream to fit in MOV and to be usable by the Final Cut +Pro decoder. This filter only applies to the mpeg2video codec, and is +likely not needed for Final Cut Pro 7 and newer with the appropriate +-tag:v. +

+

For example, to remux 30 MB/sec NTSC IMX to MOV: +

+
+
ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
+
+ +
+
+

13.17 mjpeg2jpeg

+ +

Convert MJPEG/AVI1 packets to full JPEG/JFIF packets. +

+

MJPEG is a video codec wherein each video frame is essentially a +JPEG image. The individual frames can be extracted without loss, +e.g. by +

+
+
ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
+
+ +

Unfortunately, these chunks are incomplete JPEG images, because +they lack the DHT segment required for decoding. Quoting from +http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml: +

+

Avery Lee, writing in the rec.video.desktop newsgroup in 2001, +commented that "MJPEG, or at least the MJPEG in AVIs having the +MJPG fourcc, is restricted JPEG with a fixed – and *omitted* – +Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2, +and it must use basic Huffman encoding, not arithmetic or +progressive. . . . You can indeed extract the MJPEG frames and +decode them with a regular JPEG decoder, but you have to prepend +the DHT segment to them, or else the decoder won’t have any idea +how to decompress the data. The exact table necessary is given in +the OpenDML spec." +

+

This bitstream filter patches the header of frames extracted from an MJPEG +stream (carrying the AVI1 header ID and lacking a DHT segment) to +produce fully qualified JPEG images. +

+
+
ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
+exiftran -i -9 frame*.jpg
+ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
+
+ +
+
+

13.18 mjpegadump

+ +

Add an MJPEG A header to the bitstream, to enable decoding by +Quicktime. +

+
+
+

13.19 mov2textsub

+ +

Extract a representable text file from MOV subtitles, stripping the +metadata header from each subtitle packet. +

+

See also the text2movsub filter. +

+
+
+

13.20 mp3decomp

+ +

Decompress non-standard compressed MP3 audio headers. +

+
+
+

13.21 mpeg2_metadata

+ +

Modify metadata embedded in an MPEG-2 stream. +

+
+
display_aspect_ratio
+

Set the display aspect ratio in the stream. +

+

The following fixed values are supported: +

+
4/3
+
16/9
+
221/100
+
+

Any other value will result in square pixels being signalled instead +(see H.262 section 6.3.3 and table 6-3). +

+
+
frame_rate
+

Set the frame rate in the stream. This is constructed from a table +of known values combined with a small multiplier and divisor - if +the supplied value is not exactly representable, the nearest +representable value will be used instead (see H.262 section 6.3.3 +and table 6-4). +

+
+
video_format
+

Set the video format in the stream (see H.262 section 6.3.6 and +table 6-6). +

+
+
colour_primaries
+
transfer_characteristics
+
matrix_coefficients
+

Set the colour description in the stream (see H.262 section 6.3.6 +and tables 6-7, 6-8 and 6-9). +

+
+
+ +
+
+

13.22 mpeg4_unpack_bframes

+ +

Unpack DivX-style packed B-frames. +

+

DivX-style packed B-frames are not valid MPEG-4 and were only a +workaround for the broken Video for Windows subsystem. +They use more space, can cause minor AV sync issues, require more +CPU power to decode (unless the player has some decoded picture queue +to compensate the 2,0,2,0 frame per packet style) and cause +trouble if copied into a standard container like mp4 or mpeg-ps/ts, +because MPEG-4 decoders may not be able to decode them, since they are +not valid MPEG-4. +

+

For example to fix an AVI file containing an MPEG-4 stream with +DivX-style packed B-frames using ffmpeg, you can use the command: +

+
+
ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
+
+ +
+
+

13.23 noise

+ +

Damages the contents of packets or simply drops them without damaging the +container. Can be used for fuzzing or testing error resilience/concealment. +

+

Parameters: +

+
amount
+

Accepts an expression whose evaluation per-packet determines how often bytes in that +packet will be modified. A value below 0 will result in a variable frequency. +Default is 0 which results in no modification. However, if neither amount nor drop is specified, +amount will be set to -1. See below for accepted variables. +

+
drop
+

Accepts an expression evaluated per-packet whose value determines whether that packet is dropped. +Evaluation to a positive value results in the packet being dropped. Evaluation to a negative +value results in a variable chance of it being dropped, roughly inverse in proportion to the magnitude +of the value. Default is 0 which results in no drops. See below for accepted variables. +

+
dropamount
+

Accepts a non-negative integer, which assigns a variable chance of it being dropped, roughly inverse +in proportion to the value. Default is 0 which results in no drops. This option is kept for backwards +compatibility and is equivalent to setting drop to a negative value with the same magnitude +i.e. dropamount=4 is the same as drop=-4. Ignored if drop is also specified. +

+
+ +

Both amount and drop accept expressions containing the following variables: +

+
+
n
+

The index of the packet, starting from zero. +

+
tb
+

The timebase for packet timestamps. +

+
pts
+

Packet presentation timestamp. +

+
dts
+

Packet decoding timestamp. +

+
nopts
+

Constant representing AV_NOPTS_VALUE. +

+
startpts
+

First non-AV_NOPTS_VALUE PTS seen in the stream. +

+
startdts
+

First non-AV_NOPTS_VALUE DTS seen in the stream. +

+
duration
+
d
+

Packet duration, in timebase units. +

+
pos
+

Packet position in input; may be -1 when unknown or not set. +

+
size
+

Packet size, in bytes. +

+
key
+

Whether packet is marked as a keyframe. +

+
state
+

A pseudo random integer, primarily derived from the content of packet payload. +

+
+ + +
+

13.23.1 Examples

+

Apply modification to every byte but don’t drop any packets. +

+
ffmpeg -i INPUT -c copy -bsf noise=1 output.mkv
+
+ +

Drop every video packet not marked as a keyframe after timestamp 30s but do not +modify any of the remaining packets. +

+
ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(t\,30)*not(key)' output.mkv
+
+ +

Drop one second of audio every 10 seconds and add some random noise to the rest. +

+
ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(t\,10)\,9\,10)' output.mkv
+
+ +
+
+
+

13.24 null

+

This bitstream filter passes the packets through unchanged. +

+
+
+

13.25 pcm_rechunk

+ +

Repacketize PCM audio to a fixed number of samples per packet or a fixed packet +rate per second. This is similar to the (ffmpeg-filters)asetnsamples audio +filter but works on audio packets instead of audio frames. +

+
+
nb_out_samples, n
+

Set the number of samples per each output audio packet. The number is intended +as the number of samples per each channel. Default value is 1024. +

+
+
pad, p
+

If set to 1, the filter will pad the last audio packet with silence, so that it +will contain the same number of samples (or roughly the same number of samples, +see frame_rate) as the previous ones. Default value is 1. +

+
+
frame_rate, r
+

This option makes the filter output a fixed number of packets per second instead +of a fixed number of samples per packet. If the audio sample rate is not +divisible by the frame rate then the number of samples will not be constant but +will vary slightly so that each packet will start as close to the frame +boundary as possible. Using this option has precedence over nb_out_samples. +

+
+ +

You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio +for NTSC frame rate using the frame_rate option. +

+
ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
+
+ +
+
+

13.26 pgs_frame_merge

+ +

Merge a sequence of PGS Subtitle segments ending with an "end of display set" +segment into a single packet. +

+

This is required by some containers that support PGS subtitles +(muxer matroska). +

+
+
+

13.27 prores_metadata

+ +

Modify color property metadata embedded in prores stream. +

+
+
color_primaries
+

Set the color primaries. +Available values are: +

+
+
auto
+

Keep the same color primaries property (default). +

+
+
unknown
+
bt709
+
bt470bg
+

BT601 625 +

+
+
smpte170m
+

BT601 525 +

+
+
bt2020
+
smpte431
+

DCI P3 +

+
+
smpte432
+

P3 D65 +

+
+
+ +
+
transfer_characteristics
+

Set the color transfer. +Available values are: +

+
+
auto
+

Keep the same transfer characteristics property (default). +

+
+
unknown
+
bt709
+

BT 601, BT 709, BT 2020 +

+
smpte2084
+

SMPTE ST 2084 +

+
arib-std-b67
+

ARIB STD-B67 +

+
+ + +
+
matrix_coefficients
+

Set the matrix coefficient. +Available values are: +

+
+
auto
+

Keep the same colorspace property (default). +

+
+
unknown
+
bt709
+
smpte170m
+

BT 601 +

+
+
bt2020nc
+
+
+
+ +

Set Rec709 colorspace for each frame of the file +

+
ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
+
+ +

Set Hybrid Log-Gamma parameters for each frame of the file +

+
ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc output.mov
+
+ +
+
+

13.28 remove_extra

+ +

Remove extradata from packets. +

+

It accepts the following parameter: +

+
freq
+

Set which frame types to remove extradata from. +

+
+
k
+

Remove extradata from non-keyframes only. +

+
+
keyframe
+

Remove extradata from keyframes only. +

+
+
e, all
+

Remove extradata from all frames. +

+
+
+
+
+ +
+
+

13.29 setts

+

Set PTS and DTS in packets. +

+

It accepts the following parameters: +

+
ts
+
pts
+
dts
+

Set expressions for PTS, DTS or both. +

+
duration
+

Set expression for duration. +

+
time_base
+

Set output time base. +

+
+ +

The expressions are evaluated through the eval API and can contain the following +constants: +

+
+
N
+

The count of the input packet. Starting from 0. +

+
+
TS
+

The demux timestamp in input in case of ts or dts option or presentation +timestamp in case of pts option. +

+
+
POS
+

The original position in the file of the packet, or undefined if undefined +for the current packet +

+
+
DTS
+

The demux timestamp in input. +

+
+
PTS
+

The presentation timestamp in input. +

+
+
DURATION
+

The duration in input. +

+
+
STARTDTS
+

The DTS of the first packet. +

+
+
STARTPTS
+

The PTS of the first packet. +

+
+
PREV_INDTS
+

The previous input DTS. +

+
+
PREV_INPTS
+

The previous input PTS. +

+
+
PREV_INDURATION
+

The previous input duration. +

+
+
PREV_OUTDTS
+

The previous output DTS. +

+
+
PREV_OUTPTS
+

The previous output PTS. +

+
+
PREV_OUTDURATION
+

The previous output duration. +

+
+
NEXT_DTS
+

The next input DTS. +

+
+
NEXT_PTS
+

The next input PTS. +

+
+
NEXT_DURATION
+

The next input duration. +

+
+
TB
+

The timebase of stream packet belongs. +

+
+
TB_OUT
+

The output timebase. +

+
+
SR
+

The sample rate of stream packet belongs. +

+
+
NOPTS
+

The AV_NOPTS_VALUE constant. +

+
+ +
+
+

13.30 text2movsub

+ +

Convert text subtitles to MOV subtitles (as used by the mov_text +codec) with metadata headers. +

+

See also the mov2textsub filter. +

+
+
+

13.31 trace_headers

+ +

Log trace output containing all syntax elements in the coded stream +headers (everything above the level of individual coded blocks). +This can be useful for debugging low-level stream issues. +

+

Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending +on the build only a subset of these may be available. +

+
+
+

13.32 truehd_core

+ +

Extract the core from a TrueHD stream, dropping ATMOS data. +

+
+
+

13.33 vp9_metadata

+ +

Modify metadata embedded in a VP9 stream. +

+
+
color_space
+

Set the color space value in the frame header. Note that any frame +set to RGB will be implicitly set to PC range and that RGB is +incompatible with profiles 0 and 2. +

+
unknown
+
bt601
+
bt709
+
smpte170
+
smpte240
+
bt2020
+
rgb
+
+ +
+
color_range
+

Set the color range value in the frame header. Note that any value +imposed by the color space will take precedence over this value. +

+
tv
+
pc
+
+
+
+ +
+
+

13.34 vp9_superframe

+ +

Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This +fixes merging of split/segmented VP9 streams where the alt-ref frame +was split from its visible counterpart. +

+
+
+

13.35 vp9_superframe_split

+ +

Split VP9 superframes into single frames. +

+
+
+

13.36 vp9_raw_reorder

+ +

Given a VP9 stream with correct timestamps but possibly out of order, +insert additional show-existing-frame packets to correct the ordering. +

+
+
+
+

14 Format Options

+ +

The libavformat library provides some generic global options, which +can be set on all the muxers and demuxers. In addition each muxer or +demuxer may support so-called private options, which are specific for +that component. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the +AVFormatContext options or using the libavutil/opt.h API +for programmatic use. +

+

The list of supported options follows: +

+
+
avioflags flags (input/output)
+

Possible values: +

+
direct
+

Reduce buffering. +

+
+ +
+
probesize integer (input)
+

Set probing size in bytes, i.e. the size of the data to analyze to get +stream information. A higher value will enable detecting more +information in case it is dispersed into the stream, but will increase +latency. Must be an integer not lesser than 32. It is 5000000 by default. +

+
+
max_probe_packets integer (input)
+

Set the maximum number of buffered packets when probing a codec. +Default is 2500 packets. +

+
+
packetsize integer (output)
+

Set packet size. +

+
+
fflags flags
+

Set format flags. Some are implemented for a limited number of formats. +

+

Possible values for input files: +

+
discardcorrupt
+

Discard corrupted packets. +

+
fastseek
+

Enable fast, but inaccurate seeks for some formats. +

+
genpts
+

Generate missing PTS if DTS is present. +

+
igndts
+

Ignore DTS if PTS is set. Inert when nofillin is set. +

+
ignidx
+

Ignore index. +

+
nobuffer
+

Reduce the latency introduced by buffering during initial input streams analysis. +

+
nofillin
+

Do not fill in missing values in packet fields that can be exactly calculated. +

+
noparse
+

Disable AVParsers, this needs +nofillin too. +

+
sortdts
+

Try to interleave output packets by DTS. At present, available only for AVIs with an index. +

+
+ +

Possible values for output files: +

+
autobsf
+

Automatically apply bitstream filters as required by the output format. Enabled by default. +

+
bitexact
+

Only write platform-, build- and time-independent data. +This ensures that file and data checksums are reproducible and match between +platforms. Its primary use is for regression testing. +

+
flush_packets
+

Write out packets immediately. +

+
shortest
+

Stop muxing at the end of the shortest stream. +It may be needed to increase max_interleave_delta to avoid flushing the longer +streams before EOF. +

+
+ +
+
seek2any integer (input)
+

Allow seeking to non-keyframes on demuxer level when supported if set to 1. +Default is 0. +

+
+
analyzeduration integer (input)
+

Specify how many microseconds are analyzed to probe the input. A +higher value will enable detecting more accurate information, but will +increase latency. It defaults to 5,000,000 microseconds = 5 seconds. +

+
+
cryptokey hexadecimal string (input)
+

Set decryption key. +

+
+
indexmem integer (input)
+

Set max memory used for timestamp index (per stream). +

+
+
rtbufsize integer (input)
+

Set max memory used for buffering real-time frames. +

+
+
fdebug flags (input/output)
+

Print specific debug info. +

+

Possible values: +

+
ts
+
+ +
+
max_delay integer (input/output)
+

Set maximum muxing or demuxing delay in microseconds. +

+
+
fpsprobesize integer (input)
+

Set number of frames used to probe fps. +

+
+
audio_preload integer (output)
+

Set microseconds by which audio packets should be interleaved earlier. +

+
+
chunk_duration integer (output)
+

Set microseconds for each chunk. +

+
+
chunk_size integer (output)
+

Set size in bytes for each chunk. +

+
+
err_detect, f_err_detect flags (input)
+

Set error detection flags. f_err_detect is deprecated and +should be used only via the ffmpeg tool. +

+

Possible values: +

+
crccheck
+

Verify embedded CRCs. +

+
bitstream
+

Detect bitstream specification deviations. +

+
buffer
+

Detect improper bitstream length. +

+
explode
+

Abort decoding on minor error detection. +

+
careful
+

Consider things that violate the spec and have not been seen in the +wild as errors. +

+
compliant
+

Consider all spec non compliancies as errors. +

+
aggressive
+

Consider things that a sane encoder should not do as an error. +

+
+ +
+
max_interleave_delta integer (output)
+

Set maximum buffering duration for interleaving. The duration is +expressed in microseconds, and defaults to 10000000 (10 seconds). +

+

To ensure all the streams are interleaved correctly, libavformat will +wait until it has at least one packet for each stream before actually +writing any packets to the output file. When some streams are +"sparse" (i.e. there are large gaps between successive packets), this +can result in excessive buffering. +

+

This field specifies the maximum difference between the timestamps of the +first and the last packet in the muxing queue, above which libavformat +will output a packet regardless of whether it has queued a packet for all +the streams. +

+

If set to 0, libavformat will continue buffering packets until it has +a packet for each stream, regardless of the maximum timestamp +difference between the buffered packets. +

+
+
use_wallclock_as_timestamps integer (input)
+

Use wallclock as timestamps if set to 1. Default is 0. +

+
+
avoid_negative_ts integer (output)
+
+

Possible values: +

+
make_non_negative
+

Shift timestamps to make them non-negative. +Also note that this affects only leading negative timestamps, and not +non-monotonic negative timestamps. +

+
make_zero
+

Shift timestamps so that the first timestamp is 0. +

+
auto (default)
+

Enables shifting when required by the target format. +

+
disabled
+

Disables shifting of timestamp. +

+
+ +

When shifting is enabled, all output timestamps are shifted by the +same amount. Audio, video, and subtitles desynching and relative +timestamp differences are preserved compared to how they would have +been without shifting. +

+
+
skip_initial_bytes integer (input)
+

Set number of bytes to skip before reading header and frames if set to 1. +Default is 0. +

+
+
correct_ts_overflow integer (input)
+

Correct single timestamp overflows if set to 1. Default is 1. +

+
+
flush_packets integer (output)
+

Flush the underlying I/O stream after each packet. Default is -1 (auto), which +means that the underlying protocol will decide, 1 enables it, and has the +effect of reducing the latency, 0 disables it and may increase IO throughput in +some cases. +

+
+
output_ts_offset offset (output)
+

Set the output time offset. +

+

offset must be a time duration specification, +see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

The offset is added by the muxer to the output timestamps. +

+

Specifying a positive offset means that the corresponding streams are +delayed bt the time duration specified in offset. Default value +is 0 (meaning that no offset is applied). +

+
+
format_whitelist list (input)
+

"," separated list of allowed demuxers. By default all are allowed. +

+
+
dump_separator string (input)
+

Separator used to separate the fields printed on the command line about the +Stream parameters. +For example, to separate the fields with newlines and indentation: +

+
ffprobe -dump_separator "
+                          "  -i ~/videos/matrixbench_mpeg2.mpg
+
+ +
+
max_streams integer (input)
+

Specifies the maximum number of streams. This can be used to reject files that +would require too many resources due to a large number of streams. +

+
+
skip_estimate_duration_from_pts bool (input)
+

Skip estimation of input duration when calculated using PTS. +At present, applicable for MPEG-PS and MPEG-TS. +

+
+
strict, f_strict integer (input/output)
+

Specify how strictly to follow the standards. f_strict is deprecated and +should be used only via the ffmpeg tool. +

+

Possible values: +

+
very
+

strictly conform to an older more strict version of the spec or reference software +

+
strict
+

strictly conform to all the things in the spec no matter what consequences +

+
normal
+
unofficial
+

allow unofficial extensions +

+
experimental
+

allow non standardized experimental things, experimental +(unfinished/work in progress/not well tested) decoders and encoders. +Note: experimental decoders can pose a security risk, do not use this for +decoding untrusted input. +

+
+ +
+
+ + + +
+

14.1 Format stream specifiers

+ +

Format stream specifiers allow selection of one or more streams that +match specific properties. +

+

The exact semantics of stream specifiers is defined by the +avformat_match_stream_specifier() function declared in the +libavformat/avformat.h header and documented in the +(ffmpeg)Stream specifiers section in the ffmpeg(1) manual. +

+
+
+
+

15 Demuxers

+ +

Demuxers are configured elements in FFmpeg that can read the +multimedia streams from a particular type of file. +

+

When you configure your FFmpeg build, all the supported demuxers +are enabled by default. You can list all available ones using the +configure option --list-demuxers. +

+

You can disable all the demuxers using the configure option +--disable-demuxers, and selectively enable a single demuxer with +the option --enable-demuxer=DEMUXER, or disable it +with the option --disable-demuxer=DEMUXER. +

+

The option -demuxers of the ff* tools will display the list of +enabled demuxers. Use -formats to view a combined list of +enabled demuxers and muxers. +

+

The description of some of the currently available demuxers follows. +

+ +
+

15.1 aa

+ +

Audible Format 2, 3, and 4 demuxer. +

+

This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files. +

+
+
+

15.2 aac

+ +

Raw Audio Data Transport Stream AAC demuxer. +

+

This demuxer is used to demux an ADTS input containing a single AAC stream +alongwith any ID3v1/2 or APE tags in it. +

+
+
+

15.3 apng

+ +

Animated Portable Network Graphics demuxer. +

+

This demuxer is used to demux APNG files. +All headers, but the PNG signature, up to (but not including) the first +fcTL chunk are transmitted as extradata. +Frames are then split as being all the chunks between two fcTL ones, or +between the last fcTL and IEND chunks. +

+
+
-ignore_loop bool
+

Ignore the loop variable in the file if set. Default is enabled. +

+
+
-max_fps int
+

Maximum framerate in frames per second. Default of 0 imposes no limit. +

+
+
-default_fps int
+

Default framerate in frames per second when none is specified in the file +(0 meaning as fast as possible). Default is 15. +

+
+
+ +
+
+

15.4 asf

+ +

Advanced Systems Format demuxer. +

+

This demuxer is used to demux ASF files and MMS network streams. +

+
+
-no_resync_search bool
+

Do not try to resynchronize by looking for a certain optional start code. +

+
+ +
+
+

15.5 concat

+ +

Virtual concatenation script demuxer. +

+

This demuxer reads a list of files and other directives from a text file and +demuxes them one after the other, as if all their packets had been muxed +together. +

+

The timestamps in the files are adjusted so that the first file starts at 0 +and each next file starts where the previous one finishes. Note that it is +done globally and may cause gaps if all streams do not have exactly the same +length. +

+

All files must have the same streams (same codecs, same time base, etc.). +

+

The duration of each file is used to adjust the timestamps of the next file: +if the duration is incorrect (because it was computed using the bit-rate or +because the file is truncated, for example), it can cause artifacts. The +duration directive can be used to override the duration stored in +each file. +

+ +
+

15.5.1 Syntax

+ +

The script is a text file in extended-ASCII, with one directive per line. +Empty lines, leading spaces and lines starting with ’#’ are ignored. The +following directive is recognized: +

+
+
file path
+

Path to a file to read; special characters and spaces must be escaped with +backslash or single quotes. +

+

All subsequent file-related directives apply to that file. +

+
+
ffconcat version 1.0
+

Identify the script type and version. +

+

To make FFmpeg recognize the format automatically, this directive must +appear exactly as is (no extra space or byte-order-mark) on the very first +line of the script. +

+
+
duration dur
+

Duration of the file. This information can be specified from the file; +specifying it here may be more efficient or help if the information from the +file is not available or accurate. +

+

If the duration is set for all files, then it is possible to seek in the +whole concatenated video. +

+
+
inpoint timestamp
+

In point of the file. When the demuxer opens the file it instantly seeks to the +specified timestamp. Seeking is done so that all streams can be presented +successfully at In point. +

+

This directive works best with intra frame codecs, because for non-intra frame +ones you will usually get extra packets before the actual In point and the +decoded content will most likely contain frames before In point too. +

+

For each file, packets before the file In point will have timestamps less than +the calculated start timestamp of the file (negative in case of the first +file), and the duration of the files (if not specified by the duration +directive) will be reduced based on their specified In point. +

+

Because of potential packets before the specified In point, packet timestamps +may overlap between two concatenated files. +

+
+
outpoint timestamp
+

Out point of the file. When the demuxer reaches the specified decoding +timestamp in any of the streams, it handles it as an end of file condition and +skips the current and all the remaining packets from all streams. +

+

Out point is exclusive, which means that the demuxer will not output packets +with a decoding timestamp greater or equal to Out point. +

+

This directive works best with intra frame codecs and formats where all streams +are tightly interleaved. For non-intra frame codecs you will usually get +additional packets with presentation timestamp after Out point therefore the +decoded content will most likely contain frames after Out point too. If your +streams are not tightly interleaved you may not get all the packets from all +streams before Out point and you may only will be able to decode the earliest +stream until Out point. +

+

The duration of the files (if not specified by the duration +directive) will be reduced based on their specified Out point. +

+
+
file_packet_metadata key=value
+

Metadata of the packets of the file. The specified metadata will be set for +each file packet. You can specify this directive multiple times to add multiple +metadata entries. +This directive is deprecated, use file_packet_meta instead. +

+
+
file_packet_meta key value
+

Metadata of the packets of the file. The specified metadata will be set for +each file packet. You can specify this directive multiple times to add multiple +metadata entries. +

+
+
option key value
+

Option to access, open and probe the file. +Can be present multiple times. +

+
+
stream
+

Introduce a stream in the virtual file. +All subsequent stream-related directives apply to the last introduced +stream. +Some streams properties must be set in order to allow identifying the +matching streams in the subfiles. +If no streams are defined in the script, the streams from the first file are +copied. +

+
+
exact_stream_id id
+

Set the id of the stream. +If this directive is given, the string with the corresponding id in the +subfiles will be used. +This is especially useful for MPEG-PS (VOB) files, where the order of the +streams is not reliable. +

+
+
stream_meta key value
+

Metadata for the stream. +Can be present multiple times. +

+
+
stream_codec value
+

Codec for the stream. +

+
+
stream_extradata hex_string
+

Extradata for the string, encoded in hexadecimal. +

+
+
chapter id start end
+

Add a chapter. id is an unique identifier, possibly small and +consecutive. +

+
+
+ +
+
+

15.5.2 Options

+ +

This demuxer accepts the following option: +

+
+
safe
+

If set to 1, reject unsafe file paths and directives. +A file path is considered safe if it +does not contain a protocol specification and is relative and all components +only contain characters from the portable character set (letters, digits, +period, underscore and hyphen) and have no period at the beginning of a +component. +

+

If set to 0, any file name is accepted. +

+

The default is 1. +

+
+
auto_convert
+

If set to 1, try to perform automatic conversions on packet data to make the +streams concatenable. +The default is 1. +

+

Currently, the only conversion is adding the h264_mp4toannexb bitstream +filter to H.264 streams in MP4 format. This is necessary in particular if +there are resolution changes. +

+
+
segment_time_metadata
+

If set to 1, every packet will contain the lavf.concat.start_time and the +lavf.concat.duration packet metadata values which are the start_time and +the duration of the respective file segments in the concatenated output +expressed in microseconds. The duration metadata is only set if it is known +based on the concat file. +The default is 0. +

+
+
+ +
+
+

15.5.3 Examples

+ +
    +
  • Use absolute filenames and include some comments: +
    +
    # my first filename
    +file /mnt/share/file-1.wav
    +# my second filename including whitespace
    +file '/mnt/share/file 2.wav'
    +# my third filename including whitespace plus single quote
    +file '/mnt/share/file 3'\''.wav'
    +
    + +
  • Allow for input format auto-probing, use safe filenames and set the duration of +the first file: +
    +
    ffconcat version 1.0
    +
    +file file-1.wav
    +duration 20.0
    +
    +file subdir/file-2.wav
    +
    +
+ +
+
+
+

15.6 dash

+ +

Dynamic Adaptive Streaming over HTTP demuxer. +

+

This demuxer presents all AVStreams found in the manifest. +By setting the discard flags on AVStreams the caller can decide +which streams to actually receive. +Each stream mirrors the id and bandwidth properties from the +<Representation> as metadata keys named "id" and "variant_bitrate" respectively. +

+ +
+

15.6.1 Options

+ +

This demuxer accepts the following option: +

+
+
cenc_decryption_key
+

16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7). +

+
+
+ +
+
+
+

15.7 ea

+ +

Electronic Arts Multimedia format demuxer. +

+

This format is used by various Electronic Arts games. +

+ +
+

15.7.1 Options

+ +
+
merge_alpha bool
+
+

Normally the VP6 alpha channel (if exists) is returned as a secondary video +stream, by setting this option you can make the demuxer return a single video +stream which contains the alpha channel in addition to the ordinary video. +

+
+
+ +
+
+
+

15.8 imf

+ +

Interoperable Master Format demuxer. +

+

This demuxer presents audio and video streams found in an IMF Composition, as +specified in SMPTE ST 2067-2. +

+
+
ffmpeg [-assetmaps <path of ASSETMAP1>,<path of ASSETMAP2>,...] -i <path of CPL> ...
+
+ +

If -assetmaps is not specified, the demuxer looks for a file called +ASSETMAP.xml in the same directory as the CPL. +

+
+
+

15.9 flv, live_flv, kux

+ +

Adobe Flash Video Format demuxer. +

+

This demuxer is used to demux FLV files and RTMP network streams. In case of live network streams, if you force format, you may use live_flv option instead of flv to survive timestamp discontinuities. +KUX is a flv variant used on the Youku platform. +

+
+
ffmpeg -f flv -i myfile.flv ...
+ffmpeg -f live_flv -i rtmp://<any.server>/anything/key ....
+
+ + +
+
-flv_metadata bool
+

Allocate the streams according to the onMetaData array content. +

+
+
-flv_ignore_prevtag bool
+

Ignore the size of previous tag value. +

+
+
-flv_full_metadata bool
+

Output all context of the onMetadata. +

+
+ +
+
+

15.10 gif

+ +

Animated GIF demuxer. +

+

It accepts the following options: +

+
+
min_delay
+

Set the minimum valid delay between frames in hundredths of seconds. +Range is 0 to 6000. Default value is 2. +

+
+
max_gif_delay
+

Set the maximum valid delay between frames in hundredth of seconds. +Range is 0 to 65535. Default value is 65535 (nearly eleven minutes), +the maximum value allowed by the specification. +

+
+
default_delay
+

Set the default delay between frames in hundredths of seconds. +Range is 0 to 6000. Default value is 10. +

+
+
ignore_loop
+

GIF files can contain information to loop a certain number of times (or +infinitely). If ignore_loop is set to 1, then the loop setting +from the input will be ignored and looping will not occur. If set to 0, +then looping will occur and will cycle the number of times according to +the GIF. Default value is 1. +

+
+ +

For example, with the overlay filter, place an infinitely looping GIF +over another video: +

+
ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
+
+ +

Note that in the above example the shortest option for overlay filter is +used to end the output video at the length of the shortest input file, +which in this case is input.mp4 as the GIF in this example loops +infinitely. +

+
+
+

15.11 hls

+ +

HLS demuxer +

+

Apple HTTP Live Streaming demuxer. +

+

This demuxer presents all AVStreams from all variant streams. +The id field is set to the bitrate variant index number. By setting +the discard flags on AVStreams (by pressing ’a’ or ’v’ in ffplay), +the caller can decide which variant streams to actually receive. +The total bitrate of the variant that the stream belongs to is +available in a metadata key named "variant_bitrate". +

+

It accepts the following options: +

+
+
live_start_index
+

segment index to start live streams at (negative values are from the end). +

+
+
prefer_x_start
+

prefer to use #EXT-X-START if it’s in playlist instead of live_start_index. +

+
+
allowed_extensions
+

’,’ separated list of file extensions that hls is allowed to access. +

+
+
max_reload
+

Maximum number of times a insufficient list is attempted to be reloaded. +Default value is 1000. +

+
+
m3u8_hold_counters
+

The maximum number of times to load m3u8 when it refreshes without new segments. +Default value is 1000. +

+
+
http_persistent
+

Use persistent HTTP connections. Applicable only for HTTP streams. +Enabled by default. +

+
+
http_multiple
+

Use multiple HTTP connections for downloading HTTP segments. +Enabled by default for HTTP/1.1 servers. +

+
+
http_seekable
+

Use HTTP partial requests for downloading HTTP segments. +0 = disable, 1 = enable, -1 = auto, Default is auto. +

+
+
seg_format_options
+

Set options for the demuxer of media segments using a list of key=value pairs separated by :. +

+
+
seg_max_retry
+

Maximum number of times to reload a segment on error, useful when segment skip on network error is not desired. +Default value is 0. +

+
+ +
+
+

15.12 image2

+ +

Image file demuxer. +

+

This demuxer reads from a list of image files specified by a pattern. +The syntax and meaning of the pattern is specified by the +option pattern_type. +

+

The pattern may contain a suffix which is used to automatically +determine the format of the images contained in the files. +

+

The size, the pixel format, and the format of each image must be the +same for all the files in the sequence. +

+

This demuxer accepts the following options: +

+
framerate
+

Set the frame rate for the video stream. It defaults to 25. +

+
loop
+

If set to 1, loop over the input. Default value is 0. +

+
pattern_type
+

Select the pattern type used to interpret the provided filename. +

+

pattern_type accepts one of the following values. +

+
none
+

Disable pattern matching, therefore the video will only contain the specified +image. You should use this option if you do not want to create sequences from +multiple images and your filenames may contain special pattern characters. +

+
sequence
+

Select a sequence pattern type, used to specify a sequence of files +indexed by sequential numbers. +

+

A sequence pattern may contain the string "%d" or "%0Nd", which +specifies the position of the characters representing a sequential +number in each filename matched by the pattern. If the form +"%d0Nd" is used, the string representing the number in each +filename is 0-padded and N is the total number of 0-padded +digits representing the number. The literal character ’%’ can be +specified in the pattern with the string "%%". +

+

If the sequence pattern contains "%d" or "%0Nd", the first filename of +the file list specified by the pattern must contain a number +inclusively contained between start_number and +start_number+start_number_range-1, and all the following +numbers must be sequential. +

+

For example the pattern "img-%03d.bmp" will match a sequence of +filenames of the form img-001.bmp, img-002.bmp, ..., +img-010.bmp, etc.; the pattern "i%%m%%g-%d.jpg" will match a +sequence of filenames of the form i%m%g-1.jpg, +i%m%g-2.jpg, ..., i%m%g-10.jpg, etc. +

+

Note that the pattern must not necessarily contain "%d" or +"%0Nd", for example to convert a single image file +img.jpeg you can employ the command: +

+
ffmpeg -i img.jpeg img.png
+
+ +
+
glob
+

Select a glob wildcard pattern type. +

+

The pattern is interpreted like a glob() pattern. This is only +selectable if libavformat was compiled with globbing support. +

+
+
glob_sequence (deprecated, will be removed)
+

Select a mixed glob wildcard/sequence pattern. +

+

If your version of libavformat was compiled with globbing support, and +the provided pattern contains at least one glob meta character among +%*?[]{} that is preceded by an unescaped "%", the pattern is +interpreted like a glob() pattern, otherwise it is interpreted +like a sequence pattern. +

+

All glob special characters %*?[]{} must be prefixed +with "%". To escape a literal "%" you shall use "%%". +

+

For example the pattern foo-%*.jpeg will match all the +filenames prefixed by "foo-" and terminating with ".jpeg", and +foo-%?%?%?.jpeg will match all the filenames prefixed with +"foo-", followed by a sequence of three characters, and terminating +with ".jpeg". +

+

This pattern type is deprecated in favor of glob and +sequence. +

+
+ +

Default value is glob_sequence. +

+
pixel_format
+

Set the pixel format of the images to read. If not specified the pixel +format is guessed from the first image file in the sequence. +

+
start_number
+

Set the index of the file matched by the image file pattern to start +to read from. Default value is 0. +

+
start_number_range
+

Set the index interval range to check when looking for the first image +file in the sequence, starting from start_number. Default value +is 5. +

+
ts_from_file
+

If set to 1, will set frame timestamp to modification time of image file. Note +that monotonity of timestamps is not provided: images go in the same order as +without this option. Default value is 0. +If set to 2, will set frame timestamp to the modification time of the image file in +nanosecond precision. +

+
video_size
+

Set the video size of the images to read. If not specified the video +size is guessed from the first image file in the sequence. +

+
export_path_metadata
+

If set to 1, will add two extra fields to the metadata found in input, making them +also available for other filters (see drawtext filter for examples). Default +value is 0. The extra fields are described below: +

+
lavf.image2dec.source_path
+

Corresponds to the full path to the input file being read. +

+
lavf.image2dec.source_basename
+

Corresponds to the name of the file being read. +

+
+ +
+
+ + +
+

15.12.1 Examples

+ +
    +
  • Use ffmpeg for creating a video from the images in the file +sequence img-001.jpeg, img-002.jpeg, ..., assuming an +input frame rate of 10 frames per second: +
    +
    ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
    +
    + +
  • As above, but start by reading from a file with index 100 in the sequence: +
    +
    ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
    +
    + +
  • Read images matching the "*.png" glob pattern , that is all the files +terminating with the ".png" suffix: +
    +
    ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
    +
    +
+ +
+
+
+

15.13 libgme

+ +

The Game Music Emu library is a collection of video game music file emulators. +

+

See https://bitbucket.org/mpyne/game-music-emu/overview for more information. +

+

It accepts the following options: +

+
+
track_index
+

Set the index of which track to demux. The demuxer can only export one track. +Track indexes start at 0. Default is to pick the first track. Number of tracks +is exported as tracks metadata entry. +

+
+
sample_rate
+

Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100. +

+
+
max_size (bytes)
+

The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size, +which in turn, acts as a ceiling for the size of files that can be read. +Default is 50 MiB. +

+
+
+ +
+
+

15.14 libmodplug

+ +

ModPlug based module demuxer +

+

See https://github.com/Konstanty/libmodplug +

+

It will export one 2-channel 16-bit 44.1 kHz audio stream. +Optionally, a pal8 16-color video stream can be exported with or without printed metadata. +

+

It accepts the following options: +

+
+
noise_reduction
+

Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0. +

+
+
reverb_depth
+

Set amount of reverb. Range 0-100. Default is 0. +

+
+
reverb_delay
+

Set delay in ms, clamped to 40-250 ms. Default is 0. +

+
+
bass_amount
+

Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0. +

+
+
bass_range
+

Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0. +

+
+
surround_depth
+

Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0. +

+
+
surround_delay
+

Set surround delay in ms, clamped to 5-40 ms. Default is 0. +

+
+
max_size
+

The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size, +which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB. +0 removes buffer size limit (not recommended). Default is 5 MiB. +

+
+
video_stream_expr
+

String which is evaluated using the eval API to assign colors to the generated video stream. +Variables which can be used are x, y, w, h, t, speed, +tempo, order, pattern and row. +

+
+
video_stream
+

Generate video stream. Can be 1 (on) or 0 (off). Default is 0. +

+
+
video_stream_w
+

Set video frame width in ’chars’ where one char indicates 8 pixels. Range is 20-512. Default is 30. +

+
+
video_stream_h
+

Set video frame height in ’chars’ where one char indicates 8 pixels. Range is 20-512. Default is 30. +

+
+
video_stream_ptxt
+

Print metadata on video stream. Includes speed, tempo, order, pattern, +row and ts (time in ms). Can be 1 (on) or 0 (off). Default is 1. +

+
+
+ +
+
+

15.15 libopenmpt

+ +

libopenmpt based module demuxer +

+

See https://lib.openmpt.org/libopenmpt/ for more information. +

+

Some files have multiple subsongs (tracks) this can be set with the subsong +option. +

+

It accepts the following options: +

+
+
subsong
+

Set the subsong index. This can be either ’all’, ’auto’, or the index of the +subsong. Subsong indexes start at 0. The default is ’auto’. +

+

The default value is to let libopenmpt choose. +

+
+
layout
+

Set the channel layout. Valid values are 1, 2, and 4 channel layouts. +The default value is STEREO. +

+
+
sample_rate
+

Set the sample rate for libopenmpt to output. +Range is from 1000 to INT_MAX. The value default is 48000. +

+
+ +
+
+

15.16 mov/mp4/3gp

+ +

Demuxer for Quicktime File Format & ISO/IEC Base Media File Format (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12). +

+

Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v +

+ +
+

15.16.1 Options

+ +

This demuxer accepts the following options: +

+
enable_drefs
+

Enable loading of external tracks, disabled by default. +Enabling this can theoretically leak information in some use cases. +

+
+
use_absolute_path
+

Allows loading of external tracks via absolute paths, disabled by default. +Enabling this poses a security risk. It should only be enabled if the source +is known to be non-malicious. +

+
+
seek_streams_individually
+

When seeking, identify the closest point in each stream individually and demux packets in +that stream from identified point. This can lead to a different sequence of packets compared +to demuxing linearly from the beginning. Default is true. +

+
+
ignore_editlist
+

Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the +timeline described by the edit list. Default is false. +

+
+
advanced_editlist
+

Modify the stream index to reflect the timeline described by the edit list. ignore_editlist +must be set to false for this option to be effective. +If both ignore_editlist and this option are set to false, then only the +start of the stream index is modified to reflect initial dwell time or starting timestamp +described by the edit list. Default is true. +

+
+
ignore_chapters
+

Don’t parse chapters. This includes GoPro ’HiLight’ tags/moments. Note that chapters are +only parsed when input is seekable. Default is false. +

+
+
use_mfra_for
+

For seekable fragmented input, set fragment’s starting timestamp from media fragment random access box, if present. +

+

Following options are available: +

+
auto
+

Auto-detect whether to set mfra timestamps as PTS or DTS (default) +

+
+
dts
+

Set mfra timestamps as DTS +

+
+
pts
+

Set mfra timestamps as PTS +

+
+
0
+

Don’t use mfra box to set timestamps +

+
+ +
+
use_tfdt
+

For fragmented input, set fragment’s starting timestamp to baseMediaDecodeTime from the tfdt box. +Default is enabled, which will prefer to use the tfdt box to set DTS. Disable to use the earliest_presentation_time from the sidx box. +In either case, the timestamp from the mfra box will be used if it’s available and use_mfra_for is +set to pts or dts. +

+
+
export_all
+

Export unrecognized boxes within the udta box as metadata entries. The first four +characters of the box type are set as the key. Default is false. +

+
+
export_xmp
+

Export entire contents of XMP_ box and uuid box as a string with key xmp. Note that +if export_all is set and this option isn’t, the contents of XMP_ box are still exported +but with key XMP_. Default is false. +

+
+
activation_bytes
+

4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below. +

+
+
audible_fixed_key
+

Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to +specify. +

+
+
decryption_key
+

16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7). +

+
+
max_stts_delta
+

Very high sample deltas written in a trak’s stts box may occasionally be intended but usually they are written in +error or used to store a negative value for dts correction when treated as signed 32-bit integers. This option lets +the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when +cast to int32 are used to adjust onward dts. +

+

Unit is the track time scale. Range is 0 to UINT_MAX. Default is UINT_MAX - 48000*10 which allows upto +a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of uint32 range. +

+
+ +
+
+

15.16.2 Audible AAX

+ +

Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret. +

+
ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
+
+ +
+
+
+

15.17 mpegts

+ +

MPEG-2 transport stream demuxer. +

+

This demuxer accepts the following options: +

+
resync_size
+

Set size limit for looking up a new synchronization. Default value is +65536. +

+
+
skip_unknown_pmt
+

Skip PMTs for programs not defined in the PAT. Default value is 0. +

+
+
fix_teletext_pts
+

Override teletext packet PTS and DTS values with the timestamps calculated +from the PCR of the first program which the teletext stream is part of and is +not discarded. Default value is 1, set this option to 0 if you want your +teletext packet PTS and DTS values untouched. +

+
+
ts_packetsize
+

Output option carrying the raw packet size in bytes. +Show the detected raw packet size, cannot be set by the user. +

+
+
scan_all_pmts
+

Scan and combine all PMTs. The value is an integer with value from -1 +to 1 (-1 means automatic setting, 1 means enabled, 0 means +disabled). Default value is -1. +

+
+
merge_pmt_versions
+

Re-use existing streams when a PMT’s version is updated and elementary +streams move to different PIDs. Default value is 0. +

+
+
max_packet_size
+

Set maximum size, in bytes, of packet emitted by the demuxer. Payloads above this size +are split across multiple packets. Range is 1 to INT_MAX/2. Default is 204800 bytes. +

+
+ +
+
+

15.18 mpjpeg

+ +

MJPEG encapsulated in multi-part MIME demuxer. +

+

This demuxer allows reading of MJPEG, where each frame is represented as a part of +multipart/x-mixed-replace stream. +

+
strict_mime_boundary
+

Default implementation applies a relaxed standard to multi-part MIME boundary detection, +to prevent regression with numerous existing endpoints not generating a proper MIME +MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check +of the boundary value. +

+
+ +
+
+

15.19 rawvideo

+ +

Raw video demuxer. +

+

This demuxer allows one to read raw video data. Since there is no header +specifying the assumed video parameters, the user must specify them +in order to be able to decode the data correctly. +

+

This demuxer accepts the following options: +

+
framerate
+

Set input video frame rate. Default value is 25. +

+
+
pixel_format
+

Set the input video pixel format. Default value is yuv420p. +

+
+
video_size
+

Set the input video size. This value must be specified explicitly. +

+
+ +

For example to read a rawvideo file input.raw with +ffplay, assuming a pixel format of rgb24, a video +size of 320x240, and a frame rate of 10 images per second, use +the command: +

+
ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
+
+ +
+
+

15.20 sbg

+ +

SBaGen script demuxer. +

+

This demuxer reads the script language used by SBaGen +http://uazu.net/sbagen/ to generate binaural beats sessions. A SBG +script looks like that: +

+
-SE
+a: 300-2.5/3 440+4.5/0
+b: 300-2.5/0 440+4.5/3
+off: -
+NOW      == a
++0:07:00 == b
++0:14:00 == a
++0:21:00 == b
++0:30:00    off
+
+ +

A SBG script can mix absolute and relative timestamps. If the script uses +either only absolute timestamps (including the script start time) or only +relative ones, then its layout is fixed, and the conversion is +straightforward. On the other hand, if the script mixes both kind of +timestamps, then the NOW reference for relative timestamps will be +taken from the current time of day at the time the script is read, and the +script layout will be frozen according to that reference. That means that if +the script is directly played, the actual times will match the absolute +timestamps up to the sound controller’s clock accuracy, but if the user +somehow pauses the playback or seeks, all times will be shifted accordingly. +

+
+
+

15.21 tedcaptions

+ +

JSON captions used for TED Talks. +

+

TED does not provide links to the captions, but they can be guessed from the +page. The file tools/bookmarklets.html from the FFmpeg source tree +contains a bookmarklet to expose them. +

+

This demuxer accepts the following option: +

+
start_time
+

Set the start time of the TED talk, in milliseconds. The default is 15000 +(15s). It is used to sync the captions with the downloadable videos, because +they include a 15s intro. +

+
+ +

Example: convert the captions to a format most players understand: +

+
ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
+
+ +
+
+

15.22 vapoursynth

+ +

Vapoursynth wrapper. +

+

Due to security concerns, Vapoursynth scripts will not +be autodetected so the input format has to be forced. For ff* CLI tools, +add -f vapoursynth before the input -i yourscript.vpy. +

+

This demuxer accepts the following option: +

+
max_script_size
+

The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size, +which in turn, acts as a ceiling for the size of scripts that can be read. +Default is 1 MiB. +

+
+ +
+
+
+

16 Metadata

+ +

FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded +INI-like text file and then load it back using the metadata muxer/demuxer. +

+

The file format is as follows: +

    +
  1. A file consists of a header and a number of metadata tags divided into sections, +each on its own line. + +
  2. The header is a ‘;FFMETADATA’ string, followed by a version number (now 1). + +
  3. Metadata tags are of the form ‘key=value’ + +
  4. Immediately after header follows global metadata + +
  5. After global metadata there may be sections with per-stream/per-chapter +metadata. + +
  6. A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in +brackets (‘[’, ‘]’) and ends with next section or end of file. + +
  7. At the beginning of a chapter section there may be an optional timebase to be +used for start/end values. It must be in form +‘TIMEBASE=num/den’, where num and den are +integers. If the timebase is missing then start/end times are assumed to +be in nanoseconds. + +

    Next a chapter section must contain chapter start and end times in form +‘START=num’, ‘END=num’, where num is a positive +integer. +

    +
  8. Empty lines and lines starting with ‘;’ or ‘#’ are ignored. + +
  9. Metadata keys or values containing special characters (‘=’, ‘;’, +‘#’, ‘\’ and a newline) must be escaped with a backslash ‘\’. + +
  10. Note that whitespace in metadata (e.g. ‘foo = bar’) is considered to be +a part of the tag (in the example above key is ‘foo ’, value is +‘ bar’). +
+ +

A ffmetadata file might look like this: +

+
;FFMETADATA1
+title=bike\\shed
+;this is a comment
+artist=FFmpeg troll team
+
+[CHAPTER]
+TIMEBASE=1/1000
+START=0
+#chapter ends at 0:01:00
+END=60000
+title=chapter \#1
+[STREAM]
+title=multi\
+line
+
+ +

By using the ffmetadata muxer and demuxer it is possible to extract +metadata from an input file to an ffmetadata file, and then transcode +the file into an output file with the edited ffmetadata file. +

+

Extracting an ffmetadata file with ffmpeg goes as follows: +

+
ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
+
+ +

Reinserting edited metadata information from the FFMETADATAFILE file can +be done as: +

+
ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
+
+ +
+
+

17 Protocol Options

+ +

The libavformat library provides some generic global options, which +can be set on all the protocols. In addition each protocol may support +so-called private options, which are specific for that component. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the +AVFormatContext options or using the libavutil/opt.h API +for programmatic use. +

+

The list of supported options follows: +

+
+
protocol_whitelist list (input)
+

Set a ","-separated list of allowed protocols. "ALL" matches all protocols. Protocols +prefixed by "-" are disabled. +All protocols are allowed by default but protocols used by an another +protocol (nested protocols) are restricted to a per protocol subset. +

+
+ + +
+
+

18 Protocols

+ +

Protocols are configured elements in FFmpeg that enable access to +resources that require specific protocols. +

+

When you configure your FFmpeg build, all the supported protocols are +enabled by default. You can list all available ones using the +configure option "–list-protocols". +

+

You can disable all the protocols using the configure option +"–disable-protocols", and selectively enable a protocol using the +option "–enable-protocol=PROTOCOL", or you can disable a +particular protocol using the option +"–disable-protocol=PROTOCOL". +

+

The option "-protocols" of the ff* tools will display the list of +supported protocols. +

+

All protocols accept the following options: +

+
+
rw_timeout
+

Maximum time to wait for (network) read/write operations to complete, +in microseconds. +

+
+ +

A description of the currently available protocols follows. +

+ +
+

18.1 amqp

+ +

Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker based +publish-subscribe communication protocol. +

+

FFmpeg must be compiled with –enable-librabbitmq to support AMQP. A separate +AMQP broker must also be run. An example open-source AMQP broker is RabbitMQ. +

+

After starting the broker, an FFmpeg client may stream data to the broker using +the command: +

+
+
ffmpeg -re -i input -f mpegts amqp://[[user]:[password]@]hostname[:port][/vhost]
+
+ +

Where hostname and port (default is 5672) is the address of the broker. The +client may also set a user/password for authentication. The default for both +fields is "guest". Name of virtual host on broker can be set with vhost. The +default value is "/". +

+

Muliple subscribers may stream from the broker using the command: +

+
ffplay amqp://[[user]:[password]@]hostname[:port][/vhost]
+
+ +

In RabbitMQ all data published to the broker flows through a specific exchange, +and each subscribing client has an assigned queue/buffer. When a packet arrives +at an exchange, it may be copied to a client’s queue depending on the exchange +and routing_key fields. +

+

The following options are supported: +

+
+
exchange
+

Sets the exchange to use on the broker. RabbitMQ has several predefined +exchanges: "amq.direct" is the default exchange, where the publisher and +subscriber must have a matching routing_key; "amq.fanout" is the same as a +broadcast operation (i.e. the data is forwarded to all queues on the fanout +exchange independent of the routing_key); and "amq.topic" is similar to +"amq.direct", but allows for more complex pattern matching (refer to the RabbitMQ +documentation). +

+
+
routing_key
+

Sets the routing key. The default value is "amqp". The routing key is used on +the "amq.direct" and "amq.topic" exchanges to decide whether packets are written +to the queue of a subscriber. +

+
+
pkt_size
+

Maximum size of each packet sent/received to the broker. Default is 131072. +Minimum is 4096 and max is any large value (representable by an int). When +receiving packets, this sets an internal buffer size in FFmpeg. It should be +equal to or greater than the size of the published packets to the broker. Otherwise +the received message may be truncated causing decoding errors. +

+
+
connection_timeout
+

The timeout in seconds during the initial connection to the broker. The +default value is rw_timeout, or 5 seconds if rw_timeout is not set. +

+
+
delivery_mode mode
+

Sets the delivery mode of each message sent to broker. +The following values are accepted: +

+
persistent
+

Delivery mode set to "persistent" (2). This is the default value. +Messages may be written to the broker’s disk depending on its setup. +

+
+
non-persistent
+

Delivery mode set to "non-persistent" (1). +Messages will stay in broker’s memory unless the broker is under memory +pressure. +

+
+
+ +
+
+ +
+
+

18.2 async

+ +

Asynchronous data filling wrapper for input stream. +

+

Fill data in a background thread, to decouple I/O operation from demux thread. +

+
+
async:URL
+async:http://host/resource
+async:cache:http://host/resource
+
+ +
+
+

18.3 bluray

+ +

Read BluRay playlist. +

+

The accepted options are: +

+
angle
+

BluRay angle +

+
+
chapter
+

Start chapter (1...N) +

+
+
playlist
+

Playlist to read (BDMV/PLAYLIST/?????.mpls) +

+
+
+ +

Examples: +

+

Read longest playlist from BluRay mounted to /mnt/bluray: +

+
bluray:/mnt/bluray
+
+ +

Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2: +

+
-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
+
+ +
+
+

18.4 cache

+ +

Caching wrapper for input stream. +

+

Cache the input stream to temporary file. It brings seeking capability to live streams. +

+

The accepted options are: +

+
read_ahead_limit
+

Amount in bytes that may be read ahead when seeking isn’t supported. Range is -1 to INT_MAX. +-1 for unlimited. Default is 65536. +

+
+
+ +

URL Syntax is +

+
cache:URL
+
+ +
+
+

18.5 concat

+ +

Physical concatenation protocol. +

+

Read and seek from many resources in sequence as if they were +a unique resource. +

+

A URL accepted by this protocol has the syntax: +

+
concat:URL1|URL2|...|URLN
+
+ +

where URL1, URL2, ..., URLN are the urls of the +resource to be concatenated, each one possibly specifying a distinct +protocol. +

+

For example to read a sequence of files split1.mpeg, +split2.mpeg, split3.mpeg with ffplay use the +command: +

+
ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
+
+ +

Note that you may need to escape the character "|" which is special for +many shells. +

+
+
+

18.6 concatf

+ +

Physical concatenation protocol using a line break delimited list of +resources. +

+

Read and seek from many resources in sequence as if they were +a unique resource. +

+

A URL accepted by this protocol has the syntax: +

+
concatf:URL
+
+ +

where URL is the url containing a line break delimited list of +resources to be concatenated, each one possibly specifying a distinct +protocol. Special characters must be escaped with backslash or single +quotes. See (ffmpeg-utils)the "Quoting and escaping" +section in the ffmpeg-utils(1) manual. +

+

For example to read a sequence of files split1.mpeg, +split2.mpeg, split3.mpeg listed in separate lines within +a file split.txt with ffplay use the command: +

+
ffplay concatf:split.txt
+
+

Where split.txt contains the lines: +

+
split1.mpeg
+split2.mpeg
+split3.mpeg
+
+ +
+
+

18.7 crypto

+ +

AES-encrypted stream reading protocol. +

+

The accepted options are: +

+
key
+

Set the AES decryption key binary block from given hexadecimal representation. +

+
+
iv
+

Set the AES decryption initialization vector binary block from given hexadecimal representation. +

+
+ +

Accepted URL formats: +

+
crypto:URL
+crypto+URL
+
+ +
+
+

18.8 data

+ +

Data in-line in the URI. See http://en.wikipedia.org/wiki/Data_URI_scheme. +

+

For example, to convert a GIF file given inline with ffmpeg: +

+
ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
+
+ +
+
+

18.9 fd

+ +

File descriptor access protocol. +

+

The accepted syntax is: +

+
fd: -fd file_descriptor
+
+ +

If fd is not specified, by default the stdout file descriptor will be +used for writing, stdin for reading. Unlike the pipe protocol, fd protocol has +seek support if it corresponding to a regular file. fd protocol doesn’t support +pass file descriptor via URL for security. +

+

This protocol accepts the following options: +

+
+
blocksize
+

Set I/O operation maximum block size, in bytes. Default value is +INT_MAX, which results in not limiting the requested block size. +Setting this value reasonably low improves user termination request reaction +time, which is valuable if data transmission is slow. +

+
+
fd
+

Set file descriptor. +

+
+ +
+
+

18.10 file

+ +

File access protocol. +

+

Read from or write to a file. +

+

A file URL can have the form: +

+
file:filename
+
+ +

where filename is the path of the file to read. +

+

An URL that does not have a protocol prefix will be assumed to be a +file URL. Depending on the build, an URL that looks like a Windows +path with the drive letter at the beginning will also be assumed to be +a file URL (usually not the case in builds for unix-like systems). +

+

For example to read from a file input.mpeg with ffmpeg +use the command: +

+
ffmpeg -i file:input.mpeg output.mpeg
+
+ +

This protocol accepts the following options: +

+
+
truncate
+

Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. +

+
+
blocksize
+

Set I/O operation maximum block size, in bytes. Default value is +INT_MAX, which results in not limiting the requested block size. +Setting this value reasonably low improves user termination request reaction +time, which is valuable for files on slow medium. +

+
+
follow
+

If set to 1, the protocol will retry reading at the end of the file, allowing +reading files that still are being written. In order for this to terminate, +you either need to use the rw_timeout option, or use the interrupt callback +(for API users). +

+
+
seekable
+

Controls if seekability is advertised on the file. 0 means non-seekable, -1 +means auto (seekable for normal files, non-seekable for named pipes). +

+

Many demuxers handle seekable and non-seekable resources differently, +overriding this might speed up opening certain files at the cost of losing some +features (e.g. accurate seeking). +

+
+ +
+
+

18.11 ftp

+ +

FTP (File Transfer Protocol). +

+

Read from or write to remote resources using FTP protocol. +

+

Following syntax is required. +

+
ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
+
+ +

This protocol accepts the following options. +

+
+
timeout
+

Set timeout in microseconds of socket I/O operations used by the underlying low level +operation. By default it is set to -1, which means that the timeout is +not specified. +

+
+
ftp-user
+

Set a user to be used for authenticating to the FTP server. This is overridden by the +user in the FTP URL. +

+
+
ftp-password
+

Set a password to be used for authenticating to the FTP server. This is overridden by +the password in the FTP URL, or by ftp-anonymous-password if no user is set. +

+
+
ftp-anonymous-password
+

Password used when login as anonymous user. Typically an e-mail address +should be used. +

+
+
ftp-write-seekable
+

Control seekability of connection during encoding. If set to 1 the +resource is supposed to be seekable, if set to 0 it is assumed not +to be seekable. Default value is 0. +

+
+ +

NOTE: Protocol can be used as output, but it is recommended to not do +it, unless special care is taken (tests, customized server configuration +etc.). Different FTP servers behave in different way during seek +operation. ff* tools may produce incomplete content due to server limitations. +

+
+
+

18.12 gopher

+ +

Gopher protocol. +

+
+
+

18.13 gophers

+ +

Gophers protocol. +

+

The Gopher protocol with TLS encapsulation. +

+
+
+

18.14 hls

+ +

Read Apple HTTP Live Streaming compliant segmented stream as +a uniform one. The M3U8 playlists describing the segments can be +remote HTTP resources or local files, accessed using the standard +file protocol. +The nested protocol is declared by specifying +"+proto" after the hls URI scheme name, where proto +is either "file" or "http". +

+
+
hls+http://host/path/to/remote/resource.m3u8
+hls+file://path/to/local/resource.m3u8
+
+ +

Using this protocol is discouraged - the hls demuxer should work +just as well (if not, please report the issues) and is more complete. +To use the hls demuxer instead, simply use the direct URLs to the +m3u8 files. +

+
+
+

18.15 http

+ +

HTTP (Hyper Text Transfer Protocol). +

+

This protocol accepts the following options: +

+
+
seekable
+

Control seekability of connection. If set to 1 the resource is +supposed to be seekable, if set to 0 it is assumed not to be seekable, +if set to -1 it will try to autodetect if it is seekable. Default +value is -1. +

+
+
chunked_post
+

If set to 1 use chunked Transfer-Encoding for posts, default is 1. +

+
+
content_type
+

Set a specific content type for the POST messages or for listen mode. +

+
+
http_proxy
+

set HTTP proxy to tunnel through e.g. http://example.com:1234 +

+
+
headers
+

Set custom HTTP headers, can override built in default headers. The +value must be a string encoding the headers. +

+
+
multiple_requests
+

Use persistent connections if set to 1, default is 0. +

+
+
post_data
+

Set custom HTTP post data. +

+
+
referer
+

Set the Referer header. Include ’Referer: URL’ header in HTTP request. +

+
+
user_agent
+

Override the User-Agent header. If not specified the protocol will use a +string describing the libavformat build. ("Lavf/<version>") +

+
+
reconnect_at_eof
+

If set then eof is treated like an error and causes reconnection, this is useful +for live / endless streams. +

+
+
reconnect_streamed
+

If set then even streamed/non seekable streams will be reconnected on errors. +

+
+
reconnect_on_network_error
+

Reconnect automatically in case of TCP/TLS errors during connect. +

+
+
reconnect_on_http_error
+

A comma separated list of HTTP status codes to reconnect on. The list can +include specific status codes (e.g. ’503’) or the strings ’4xx’ / ’5xx’. +

+
+
reconnect_delay_max
+

Sets the maximum delay in seconds after which to give up reconnecting +

+
+
mime_type
+

Export the MIME type. +

+
+
http_version
+

Exports the HTTP response version number. Usually "1.0" or "1.1". +

+
+
icy
+

If set to 1 request ICY (SHOUTcast) metadata from the server. If the server +supports this, the metadata has to be retrieved by the application by reading +the icy_metadata_headers and icy_metadata_packet options. +The default is 1. +

+
+
icy_metadata_headers
+

If the server supports ICY metadata, this contains the ICY-specific HTTP reply +headers, separated by newline characters. +

+
+
icy_metadata_packet
+

If the server supports ICY metadata, and icy was set to 1, this +contains the last non-empty metadata packet sent by the server. It should be +polled in regular intervals by applications interested in mid-stream metadata +updates. +

+
+
cookies
+

Set the cookies to be sent in future requests. The format of each cookie is the +same as the value of a Set-Cookie HTTP response field. Multiple cookies can be +delimited by a newline character. +

+
+
offset
+

Set initial byte offset. +

+
+
end_offset
+

Try to limit the request to bytes preceding this offset. +

+
+
method
+

When used as a client option it sets the HTTP method for the request. +

+

When used as a server option it sets the HTTP method that is going to be +expected from the client(s). +If the expected and the received HTTP method do not match the client will +be given a Bad Request response. +When unset the HTTP method is not checked for now. This will be replaced by +autodetection in the future. +

+
+
listen
+

If set to 1 enables experimental HTTP server. This can be used to send data when +used as an output option, or read data from a client with HTTP POST when used as +an input option. +If set to 2 enables experimental multi-client HTTP server. This is not yet implemented +in ffmpeg.c and thus must not be used as a command line option. +

+
# Server side (sending):
+ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://server:port
+
+# Client side (receiving):
+ffmpeg -i http://server:port -c copy somefile.ogg
+
+# Client can also be done with wget:
+wget http://server:port -O somefile.ogg
+
+# Server side (receiving):
+ffmpeg -listen 1 -i http://server:port -c copy somefile.ogg
+
+# Client side (sending):
+ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://server:port
+
+# Client can also be done with wget:
+wget --post-file=somefile.ogg http://server:port
+
+ +
+
send_expect_100
+

Send an Expect: 100-continue header for POST. If set to 1 it will send, if set +to 0 it won’t, if set to -1 it will try to send if it is applicable. Default +value is -1. +

+
+
auth_type
+
+

Set HTTP authentication type. No option for Digest, since this method requires +getting nonce parameters from the server first and can’t be used straight away like +Basic. +

+
+
none
+

Choose the HTTP authentication type automatically. This is the default. +

+
basic
+
+

Choose the HTTP basic authentication. +

+

Basic authentication sends a Base64-encoded string that contains a user name and password +for the client. Base64 is not a form of encryption and should be considered the same as +sending the user name and password in clear text (Base64 is a reversible encoding). +If a resource needs to be protected, strongly consider using an authentication scheme +other than basic authentication. HTTPS/TLS should be used with basic authentication. +Without these additional security enhancements, basic authentication should not be used +to protect sensitive or valuable information. +

+
+ +
+
+ + +
+

18.15.1 HTTP Cookies

+ +

Some HTTP requests will be denied unless cookie values are passed in with the +request. The cookies option allows these cookies to be specified. At +the very least, each cookie must specify a value along with a path and domain. +HTTP requests that match both the domain and path will automatically include the +cookie value in the HTTP Cookie header field. Multiple cookies can be delimited +by a newline. +

+

The required syntax to play a stream specifying a cookie is: +

+
ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
+
+ +
+
+
+

18.16 Icecast

+ +

Icecast protocol (stream to Icecast servers) +

+

This protocol accepts the following options: +

+
+
ice_genre
+

Set the stream genre. +

+
+
ice_name
+

Set the stream name. +

+
+
ice_description
+

Set the stream description. +

+
+
ice_url
+

Set the stream website URL. +

+
+
ice_public
+

Set if the stream should be public. +The default is 0 (not public). +

+
+
user_agent
+

Override the User-Agent header. If not specified a string of the form +"Lavf/<version>" will be used. +

+
+
password
+

Set the Icecast mountpoint password. +

+
+
content_type
+

Set the stream content type. This must be set if it is different from +audio/mpeg. +

+
+
legacy_icecast
+

This enables support for Icecast versions < 2.4.0, that do not support the +HTTP PUT method but the SOURCE method. +

+
+
tls
+

Establish a TLS (HTTPS) connection to Icecast. +

+
+
+ +
+
icecast://[username[:password]@]server:port/mountpoint
+
+ +
+
+

18.17 ipfs

+ +

InterPlanetary File System (IPFS) protocol support. One can access files stored +on the IPFS network through so-called gateways. These are http(s) endpoints. +This protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be sent +to such a gateway. Users can (and should) host their own node which means this +protocol will use one’s local gateway to access files on the IPFS network. +

+

This protocol accepts the following options: +

+
+
gateway
+

Defines the gateway to use. When not set, the protocol will first try +locating the local gateway by looking at $IPFS_GATEWAY, $IPFS_PATH +and $HOME/.ipfs/, in that order. +

+
+
+ +

One can use this protocol in 2 ways. Using IPFS: +

+
ffplay ipfs://<hash>
+
+ +

Or the IPNS protocol (IPNS is mutable IPFS): +

+
ffplay ipns://<hash>
+
+ +
+
+

18.18 mmst

+ +

MMS (Microsoft Media Server) protocol over TCP. +

+
+
+

18.19 mmsh

+ +

MMS (Microsoft Media Server) protocol over HTTP. +

+

The required syntax is: +

+
mmsh://server[:port][/app][/playpath]
+
+ +
+
+

18.20 md5

+ +

MD5 output protocol. +

+

Computes the MD5 hash of the data to be written, and on close writes +this to the designated output or stdout if none is specified. It can +be used to test muxers without writing an actual file. +

+

Some examples follow. +

+
# Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
+ffmpeg -i input.flv -f avi -y md5:output.avi.md5
+
+# Write the MD5 hash of the encoded AVI file to stdout.
+ffmpeg -i input.flv -f avi -y md5:
+
+ +

Note that some formats (typically MOV) require the output protocol to +be seekable, so they will fail with the MD5 output protocol. +

+
+
+

18.21 pipe

+ +

UNIX pipe access protocol. +

+

Read and write from UNIX pipes. +

+

The accepted syntax is: +

+
pipe:[number]
+
+ +

If fd isn’t specified, number is the number corresponding to the file descriptor of the +pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If number +is not specified, by default the stdout file descriptor will be used +for writing, stdin for reading. +

+

For example to read from stdin with ffmpeg: +

+
cat test.wav | ffmpeg -i pipe:0
+# ...this is the same as...
+cat test.wav | ffmpeg -i pipe:
+
+ +

For writing to stdout with ffmpeg: +

+
ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
+# ...this is the same as...
+ffmpeg -i test.wav -f avi pipe: | cat > test.avi
+
+ +

This protocol accepts the following options: +

+
+
blocksize
+

Set I/O operation maximum block size, in bytes. Default value is +INT_MAX, which results in not limiting the requested block size. +Setting this value reasonably low improves user termination request reaction +time, which is valuable if data transmission is slow. +

+
fd
+

Set file descriptor. +

+
+ +

Note that some formats (typically MOV), require the output protocol to +be seekable, so they will fail with the pipe output protocol. +

+
+
+

18.22 prompeg

+ +

Pro-MPEG Code of Practice #3 Release 2 FEC protocol. +

+

The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism +for MPEG-2 Transport Streams sent over RTP. +

+

This protocol must be used in conjunction with the rtp_mpegts muxer and +the rtp protocol. +

+

The required syntax is: +

+
-f rtp_mpegts -fec prompeg=option=val... rtp://hostname:port
+
+ +

The destination UDP ports are port + 2 for the column FEC stream +and port + 4 for the row FEC stream. +

+

This protocol accepts the following options: +

+
l=n
+

The number of columns (4-20, LxD <= 100) +

+
+
d=n
+

The number of rows (4-20, LxD <= 100) +

+
+
+ +

Example usage: +

+
+
-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://hostname:port
+
+ +
+
+

18.23 rist

+ +

Reliable Internet Streaming Transport protocol +

+

The accepted options are: +

+
rist_profile
+

Supported values: +

+
simple
+
main
+

This one is default. +

+
advanced
+
+ +
+
buffer_size
+

Set internal RIST buffer size in milliseconds for retransmission of data. +Default value is 0 which means the librist default (1 sec). Maximum value is 30 +seconds. +

+
+
fifo_size
+

Size of the librist receiver output fifo in number of packets. This must be a +power of 2. +Defaults to 8192 (vs the librist default of 1024). +

+
+
overrun_nonfatal=1|0
+

Survive in case of librist fifo buffer overrun. Default value is 0. +

+
+
pkt_size
+

Set maximum packet size for sending data. 1316 by default. +

+
+
log_level
+

Set loglevel for RIST logging messages. You only need to set this if you +explicitly want to enable debug level messages or packet loss simulation, +otherwise the regular loglevel is respected. +

+
+
secret
+

Set override of encryption secret, by default is unset. +

+
+
encryption
+

Set encryption type, by default is disabled. +Acceptable values are 128 and 256. +

+
+ +
+
+

18.24 rtmp

+ +

Real-Time Messaging Protocol. +

+

The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia +content across a TCP/IP network. +

+

The required syntax is: +

+
rtmp://[username:password@]server[:port][/app][/instance][/playpath]
+
+ +

The accepted parameters are: +

+
username
+

An optional username (mostly for publishing). +

+
+
password
+

An optional password (mostly for publishing). +

+
+
server
+

The address of the RTMP server. +

+
+
port
+

The number of the TCP port to use (by default is 1935). +

+
+
app
+

It is the name of the application to access. It usually corresponds to +the path where the application is installed on the RTMP server +(e.g. /ondemand/, /flash/live/, etc.). You can override +the value parsed from the URI through the rtmp_app option, too. +

+
+
playpath
+

It is the path or name of the resource to play with reference to the +application specified in app, may be prefixed by "mp4:". You +can override the value parsed from the URI through the rtmp_playpath +option, too. +

+
+
listen
+

Act as a server, listening for an incoming connection. +

+
+
timeout
+

Maximum time to wait for the incoming connection. Implies listen. +

+
+ +

Additionally, the following parameters can be set via command line options +(or in code via AVOptions): +

+
rtmp_app
+

Name of application to connect on the RTMP server. This option +overrides the parameter specified in the URI. +

+
+
rtmp_buffer
+

Set the client buffer time in milliseconds. The default is 3000. +

+
+
rtmp_conn
+

Extra arbitrary AMF connection parameters, parsed from a string, +e.g. like B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0. +Each value is prefixed by a single character denoting the type, +B for Boolean, N for number, S for string, O for object, or Z for null, +followed by a colon. For Booleans the data must be either 0 or 1 for +FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or +1 to end or begin an object, respectively. Data items in subobjects may +be named, by prefixing the type with ’N’ and specifying the name before +the value (i.e. NB:myFlag:1). This option may be used multiple +times to construct arbitrary AMF sequences. +

+
+
rtmp_flashver
+

Version of the Flash plugin used to run the SWF player. The default +is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible; +<libavformat version>).) +

+
+
rtmp_flush_interval
+

Number of packets flushed in the same request (RTMPT only). The default +is 10. +

+
+
rtmp_live
+

Specify that the media is a live stream. No resuming or seeking in +live streams is possible. The default value is any, which means the +subscriber first tries to play the live stream specified in the +playpath. If a live stream of that name is not found, it plays the +recorded stream. The other possible values are live and +recorded. +

+
+
rtmp_pageurl
+

URL of the web page in which the media was embedded. By default no +value will be sent. +

+
+
rtmp_playpath
+

Stream identifier to play or to publish. This option overrides the +parameter specified in the URI. +

+
+
rtmp_subscribe
+

Name of live stream to subscribe to. By default no value will be sent. +It is only sent if the option is specified or if rtmp_live +is set to live. +

+
+
rtmp_swfhash
+

SHA256 hash of the decompressed SWF file (32 bytes). +

+
+
rtmp_swfsize
+

Size of the decompressed SWF file, required for SWFVerification. +

+
+
rtmp_swfurl
+

URL of the SWF player for the media. By default no value will be sent. +

+
+
rtmp_swfverify
+

URL to player swf file, compute hash/size automatically. +

+
+
rtmp_tcurl
+

URL of the target stream. Defaults to proto://host[:port]/app. +

+
+
tcp_nodelay=1|0
+

Set TCP_NODELAY to disable Nagle’s algorithm. Default value is 0. +

+

Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY. +

+
+
+ +

For example to read with ffplay a multimedia resource named +"sample" from the application "vod" from an RTMP server "myserver": +

+
ffplay rtmp://myserver/vod/sample
+
+ +

To publish to a password protected server, passing the playpath and +app names separately: +

+
ffmpeg -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@myserver/
+
+ +
+
+

18.25 rtmpe

+ +

Encrypted Real-Time Messaging Protocol. +

+

The Encrypted Real-Time Messaging Protocol (RTMPE) is used for +streaming multimedia content within standard cryptographic primitives, +consisting of Diffie-Hellman key exchange and HMACSHA256, generating +a pair of RC4 keys. +

+
+
+

18.26 rtmps

+ +

Real-Time Messaging Protocol over a secure SSL connection. +

+

The Real-Time Messaging Protocol (RTMPS) is used for streaming +multimedia content across an encrypted connection. +

+
+
+

18.27 rtmpt

+ +

Real-Time Messaging Protocol tunneled through HTTP. +

+

The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used +for streaming multimedia content within HTTP requests to traverse +firewalls. +

+
+
+

18.28 rtmpte

+ +

Encrypted Real-Time Messaging Protocol tunneled through HTTP. +

+

The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE) +is used for streaming multimedia content within HTTP requests to traverse +firewalls. +

+
+
+

18.29 rtmpts

+ +

Real-Time Messaging Protocol tunneled through HTTPS. +

+

The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used +for streaming multimedia content within HTTPS requests to traverse +firewalls. +

+
+
+

18.30 libsmbclient

+ +

libsmbclient permits one to manipulate CIFS/SMB network resources. +

+

Following syntax is required. +

+
+
smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
+
+ +

This protocol accepts the following options. +

+
+
timeout
+

Set timeout in milliseconds of socket I/O operations used by the underlying +low level operation. By default it is set to -1, which means that the timeout +is not specified. +

+
+
truncate
+

Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. +

+
+
workgroup
+

Set the workgroup used for making connections. By default workgroup is not specified. +

+
+
+ +

For more information see: http://www.samba.org/. +

+
+
+

18.31 libssh

+ +

Secure File Transfer Protocol via libssh +

+

Read from or write to remote resources using SFTP protocol. +

+

Following syntax is required. +

+
+
sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
+
+ +

This protocol accepts the following options. +

+
+
timeout
+

Set timeout of socket I/O operations used by the underlying low level +operation. By default it is set to -1, which means that the timeout +is not specified. +

+
+
truncate
+

Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. +

+
+
private_key
+

Specify the path of the file containing private key to use during authorization. +By default libssh searches for keys in the ~/.ssh/ directory. +

+
+
+ +

Example: Play a file stored on remote server. +

+
+
ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
+
+ +
+
+

18.32 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte

+ +

Real-Time Messaging Protocol and its variants supported through +librtmp. +

+

Requires the presence of the librtmp headers and library during +configuration. You need to explicitly configure the build with +"–enable-librtmp". If enabled this will replace the native RTMP +protocol. +

+

This protocol provides most client functions and a few server +functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT), +encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled +variants of these encrypted types (RTMPTE, RTMPTS). +

+

The required syntax is: +

+
rtmp_proto://server[:port][/app][/playpath] options
+
+ +

where rtmp_proto is one of the strings "rtmp", "rtmpt", "rtmpe", +"rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and +server, port, app and playpath have the same +meaning as specified for the RTMP native protocol. +options contains a list of space-separated options of the form +key=val. +

+

See the librtmp manual page (man 3 librtmp) for more information. +

+

For example, to stream a file in real-time to an RTMP server using +ffmpeg: +

+
ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
+
+ +

To play the same stream using ffplay: +

+
ffplay "rtmp://myserver/live/mystream live=1"
+
+ +
+
+

18.33 rtp

+ +

Real-time Transport Protocol. +

+

The required syntax for an RTP URL is: +rtp://hostname[:port][?option=val...] +

+

port specifies the RTP port to use. +

+

The following URL options are supported: +

+
+
ttl=n
+

Set the TTL (Time-To-Live) value (for multicast only). +

+
+
rtcpport=n
+

Set the remote RTCP port to n. +

+
+
localrtpport=n
+

Set the local RTP port to n. +

+
+
localrtcpport=n'
+

Set the local RTCP port to n. +

+
+
pkt_size=n
+

Set max packet size (in bytes) to n. +

+
+
buffer_size=size
+

Set the maximum UDP socket buffer size in bytes. +

+
+
connect=0|1
+

Do a connect() on the UDP socket (if set to 1) or not (if set +to 0). +

+
+
sources=ip[,ip]
+

List allowed source IP addresses. +

+
+
block=ip[,ip]
+

List disallowed (blocked) source IP addresses. +

+
+
write_to_source=0|1
+

Send packets to the source address of the latest received packet (if +set to 1) or to a default remote address (if set to 0). +

+
+
localport=n
+

Set the local RTP port to n. +

+
+
localaddr=addr
+

Local IP address of a network interface used for sending packets or joining +multicast groups. +

+
+
timeout=n
+

Set timeout (in microseconds) of socket I/O operations to n. +

+

This is a deprecated option. Instead, localrtpport should be +used. +

+
+
+ +

Important notes: +

+
    +
  1. If rtcpport is not set the RTCP port will be set to the RTP +port value plus 1. + +
  2. If localrtpport (the local RTP port) is not set any available +port will be used for the local RTP and RTCP ports. + +
  3. If localrtcpport (the local RTCP port) is not set it will be +set to the local RTP port value plus 1. +
+ +
+
+

18.34 rtsp

+ +

Real-Time Streaming Protocol. +

+

RTSP is not technically a protocol handler in libavformat, it is a demuxer +and muxer. The demuxer supports both normal RTSP (with data transferred +over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with +data transferred over RDT). +

+

The muxer can be used to send a stream using RTSP ANNOUNCE to a server +supporting it (currently Darwin Streaming Server and Mischa Spiegelmock’s +RTSP server). +

+

The required syntax for a RTSP url is: +

+
rtsp://hostname[:port]/path
+
+ +

Options can be set on the ffmpeg/ffplay command +line, or set in code via AVOptions or in +avformat_open_input. +

+ +
+

18.34.1 Muxer

+

The following options are supported. +

+
+
rtsp_transport
+

Set RTSP transport protocols. +

+

It accepts the following values: +

+
udp
+

Use UDP as lower transport protocol. +

+
+
tcp
+

Use TCP (interleaving within the RTSP control channel) as lower +transport protocol. +

+
+ +

Default value is ‘0’. +

+
+
rtsp_flags
+

Set RTSP flags. +

+

The following values are accepted: +

+
latm
+

Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC. +

+
rfc2190
+

Use RFC 2190 packetization instead of RFC 4629 for H.263. +

+
skip_rtcp
+

Don’t send RTCP sender reports. +

+
h264_mode0
+

Use mode 0 for H.264 in RTP. +

+
send_bye
+

Send RTCP BYE packets when finishing. +

+
+ +

Default value is ‘0’. +

+ +
+
min_port
+

Set minimum local UDP port. Default value is 5000. +

+
+
max_port
+

Set maximum local UDP port. Default value is 65000. +

+
+
buffer_size
+

Set the maximum socket buffer size in bytes. +

+
+
pkt_size
+

Set max send packet size (in bytes). Default value is 1472. +

+
+ +
+
+

18.34.2 Demuxer

+

The following options are supported. +

+
+
initial_pause
+

Do not start playing the stream immediately if set to 1. Default value +is 0. +

+
+
rtsp_transport
+

Set RTSP transport protocols. +

+

It accepts the following values: +

+
udp
+

Use UDP as lower transport protocol. +

+
+
tcp
+

Use TCP (interleaving within the RTSP control channel) as lower +transport protocol. +

+
+
udp_multicast
+

Use UDP multicast as lower transport protocol. +

+
+
http
+

Use HTTP tunneling as lower transport protocol, which is useful for +passing proxies. +

+
+
https
+

Use HTTPs tunneling as lower transport protocol, which is useful for +passing proxies and widely used for security consideration. +

+
+ +

Multiple lower transport protocols may be specified, in that case they are +tried one at a time (if the setup of one fails, the next one is tried). +For the muxer, only the ‘tcp’ and ‘udp’ options are supported. +

+
+
rtsp_flags
+

Set RTSP flags. +

+

The following values are accepted: +

+
filter_src
+

Accept packets only from negotiated peer address and port. +

+
listen
+

Act as a server, listening for an incoming connection. +

+
prefer_tcp
+

Try TCP for RTP transport first, if TCP is available as RTSP RTP transport. +

+
satip_raw
+

Export raw MPEG-TS stream instead of demuxing. The flag will simply write out +the raw stream, with the original PAT/PMT/PIDs intact. +

+
+ +

Default value is ‘none’. +

+
+
allowed_media_types
+

Set media types to accept from the server. +

+

The following flags are accepted: +

+
video
+
audio
+
data
+
subtitle
+
+ +

By default it accepts all media types. +

+
+
min_port
+

Set minimum local UDP port. Default value is 5000. +

+
+
max_port
+

Set maximum local UDP port. Default value is 65000. +

+
+
listen_timeout
+

Set maximum timeout (in seconds) to establish an initial connection. Setting +listen_timeout > 0 sets rtsp_flags to ‘listen’. Default is -1 +which means an infinite timeout when ‘listen’ mode is set. +

+
+
reorder_queue_size
+

Set number of packets to buffer for handling of reordered packets. +

+
+
timeout
+

Set socket TCP I/O timeout in microseconds. +

+
+
user_agent
+

Override User-Agent header. If not specified, it defaults to the +libavformat identifier string. +

+
+
buffer_size
+

Set the maximum socket buffer size in bytes. +

+
+ +

When receiving data over UDP, the demuxer tries to reorder received packets +(since they may arrive out of order, or packets may get lost totally). This +can be disabled by setting the maximum demuxing delay to zero (via +the max_delay field of AVFormatContext). +

+

When watching multi-bitrate Real-RTSP streams with ffplay, the +streams to display can be chosen with -vst n and +-ast n for video and audio respectively, and can be switched +on the fly by pressing v and a. +

+
+
+

18.34.3 Examples

+ +

The following examples all make use of the ffplay and +ffmpeg tools. +

+
    +
  • Watch a stream over UDP, with a max reordering delay of 0.5 seconds: +
    +
    ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
    +
    + +
  • Watch a stream tunneled over HTTP: +
    +
    ffplay -rtsp_transport http rtsp://server/video.mp4
    +
    + +
  • Send a stream in realtime to a RTSP server, for others to watch: +
    +
    ffmpeg -re -i input -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
    +
    + +
  • Receive a stream in realtime: +
    +
    ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp output
    +
    +
+ +
+
+
+

18.35 sap

+ +

Session Announcement Protocol (RFC 2974). This is not technically a +protocol handler in libavformat, it is a muxer and demuxer. +It is used for signalling of RTP streams, by announcing the SDP for the +streams regularly on a separate port. +

+ +
+

18.35.1 Muxer

+ +

The syntax for a SAP url given to the muxer is: +

+
sap://destination[:port][?options]
+
+ +

The RTP packets are sent to destination on port port, +or to port 5004 if no port is specified. +options is a &-separated list. The following options +are supported: +

+
+
announce_addr=address
+

Specify the destination IP address for sending the announcements to. +If omitted, the announcements are sent to the commonly used SAP +announcement multicast address 224.2.127.254 (sap.mcast.net), or +ff0e::2:7ffe if destination is an IPv6 address. +

+
+
announce_port=port
+

Specify the port to send the announcements on, defaults to +9875 if not specified. +

+
+
ttl=ttl
+

Specify the time to live value for the announcements and RTP packets, +defaults to 255. +

+
+
same_port=0|1
+

If set to 1, send all RTP streams on the same port pair. If zero (the +default), all streams are sent on unique ports, with each stream on a +port 2 numbers higher than the previous. +VLC/Live555 requires this to be set to 1, to be able to receive the stream. +The RTP stack in libavformat for receiving requires all streams to be sent +on unique ports. +

+
+ +

Example command lines follow. +

+

To broadcast a stream on the local subnet, for watching in VLC: +

+
+
ffmpeg -re -i input -f sap sap://224.0.0.255?same_port=1
+
+ +

Similarly, for watching in ffplay: +

+
+
ffmpeg -re -i input -f sap sap://224.0.0.255
+
+ +

And for watching in ffplay, over IPv6: +

+
+
ffmpeg -re -i input -f sap sap://[ff0e::1:2:3:4]
+
+ +
+
+

18.35.2 Demuxer

+ +

The syntax for a SAP url given to the demuxer is: +

+
sap://[address][:port]
+
+ +

address is the multicast address to listen for announcements on, +if omitted, the default 224.2.127.254 (sap.mcast.net) is used. port +is the port that is listened on, 9875 if omitted. +

+

The demuxers listens for announcements on the given address and port. +Once an announcement is received, it tries to receive that particular stream. +

+

Example command lines follow. +

+

To play back the first stream announced on the normal SAP multicast address: +

+
+
ffplay sap://
+
+ +

To play back the first stream announced on one the default IPv6 SAP multicast address: +

+
+
ffplay sap://[ff0e::2:7ffe]
+
+ +
+
+
+

18.36 sctp

+ +

Stream Control Transmission Protocol. +

+

The accepted URL syntax is: +

+
sctp://host:port[?options]
+
+ +

The protocol accepts the following options: +

+
listen
+

If set to any value, listen for an incoming connection. Outgoing connection is done by default. +

+
+
max_streams
+

Set the maximum number of streams. By default no limit is set. +

+
+ +
+
+

18.37 srt

+ +

Haivision Secure Reliable Transport Protocol via libsrt. +

+

The supported syntax for a SRT URL is: +

+
srt://hostname:port[?options]
+
+ +

options contains a list of &-separated options of the form +key=val. +

+

or +

+
+
options srt://hostname:port
+
+ +

options contains a list of ’-key val’ +options. +

+

This protocol accepts the following options. +

+
+
connect_timeout=milliseconds
+

Connection timeout; SRT cannot connect for RTT > 1500 msec +(2 handshake exchanges) with the default connect timeout of +3 seconds. This option applies to the caller and rendezvous +connection modes. The connect timeout is 10 times the value +set for the rendezvous mode (which can be used as a +workaround for this connection problem with earlier versions). +

+
+
ffs=bytes
+

Flight Flag Size (Window Size), in bytes. FFS is actually an +internal parameter and you should set it to not less than +recv_buffer_size and mss. The default value +is relatively large, therefore unless you set a very large receiver buffer, +you do not need to change this option. Default value is 25600. +

+
+
inputbw=bytes/seconds
+

Sender nominal input rate, in bytes per seconds. Used along with +oheadbw, when maxbw is set to relative (0), to +calculate maximum sending rate when recovery packets are sent +along with the main media stream: +inputbw * (100 + oheadbw) / 100 +if inputbw is not set while maxbw is set to +relative (0), the actual input rate is evaluated inside +the library. Default value is 0. +

+
+
iptos=tos
+

IP Type of Service. Applies to sender only. Default value is 0xB8. +

+
+
ipttl=ttl
+

IP Time To Live. Applies to sender only. Default value is 64. +

+
+
latency=microseconds
+

Timestamp-based Packet Delivery Delay. +Used to absorb bursts of missed packet retransmissions. +This flag sets both rcvlatency and peerlatency +to the same value. Note that prior to version 1.3.0 +this is the only flag to set the latency, however +this is effectively equivalent to setting peerlatency, +when side is sender and rcvlatency +when side is receiver, and the bidirectional stream +sending is not supported. +

+
+
listen_timeout=microseconds
+

Set socket listen timeout. +

+
+
maxbw=bytes/seconds
+

Maximum sending bandwidth, in bytes per seconds. +-1 infinite (CSRTCC limit is 30mbps) +0 relative to input rate (see inputbw) +>0 absolute limit value +Default value is 0 (relative) +

+
+
mode=caller|listener|rendezvous
+

Connection mode. +caller opens client connection. +listener starts server to listen for incoming connections. +rendezvous use Rendez-Vous connection mode. +Default value is caller. +

+
+
mss=bytes
+

Maximum Segment Size, in bytes. Used for buffer allocation +and rate calculation using a packet counter assuming fully +filled packets. The smallest MSS between the peers is +used. This is 1500 by default in the overall internet. +This is the maximum size of the UDP packet and can be +only decreased, unless you have some unusual dedicated +network settings. Default value is 1500. +

+
+
nakreport=1|0
+

If set to 1, Receiver will send ‘UMSG_LOSSREPORT‘ messages +periodically until a lost packet is retransmitted or +intentionally dropped. Default value is 1. +

+
+
oheadbw=percents
+

Recovery bandwidth overhead above input rate, in percents. +See inputbw. Default value is 25%. +

+
+
passphrase=string
+

HaiCrypt Encryption/Decryption Passphrase string, length +from 10 to 79 characters. The passphrase is the shared +secret between the sender and the receiver. It is used +to generate the Key Encrypting Key using PBKDF2 +(Password-Based Key Derivation Function). It is used +only if pbkeylen is non-zero. It is used on +the receiver only if the received data is encrypted. +The configured passphrase cannot be recovered (write-only). +

+
+
enforced_encryption=1|0
+

If true, both connection parties must have the same password +set (including empty, that is, with no encryption). If the +password doesn’t match or only one side is unencrypted, +the connection is rejected. Default is true. +

+
+
kmrefreshrate=packets
+

The number of packets to be transmitted after which the +encryption key is switched to a new key. Default is -1. +-1 means auto (0x1000000 in srt library). The range for +this option is integers in the 0 - INT_MAX. +

+
+
kmpreannounce=packets
+

The interval between when a new encryption key is sent and +when switchover occurs. This value also applies to the +subsequent interval between when switchover occurs and +when the old encryption key is decommissioned. Default is -1. +-1 means auto (0x1000 in srt library). The range for +this option is integers in the 0 - INT_MAX. +

+
+
snddropdelay=microseconds
+

The sender’s extra delay before dropping packets. This delay is +added to the default drop delay time interval value. +

+

Special value -1: Do not drop packets on the sender at all. +

+
+
payload_size=bytes
+

Sets the maximum declared size of a packet transferred +during the single call to the sending function in Live +mode. Use 0 if this value isn’t used (which is default in +file mode). +Default is -1 (automatic), which typically means MPEG-TS; +if you are going to use SRT +to send any different kind of payload, such as, for example, +wrapping a live stream in very small frames, then you can +use a bigger maximum frame size, though not greater than +1456 bytes. +

+
+
pkt_size=bytes
+

Alias for ‘payload_size’. +

+
+
peerlatency=microseconds
+

The latency value (as described in rcvlatency) that is +set by the sender side as a minimum value for the receiver. +

+
+
pbkeylen=bytes
+

Sender encryption key length, in bytes. +Only can be set to 0, 16, 24 and 32. +Enable sender encryption if not 0. +Not required on receiver (set to 0), +key size obtained from sender in HaiCrypt handshake. +Default value is 0. +

+
+
rcvlatency=microseconds
+

The time that should elapse since the moment when the +packet was sent and the moment when it’s delivered to +the receiver application in the receiving function. +This time should be a buffer time large enough to cover +the time spent for sending, unexpectedly extended RTT +time, and the time needed to retransmit the lost UDP +packet. The effective latency value will be the maximum +of this options’ value and the value of peerlatency +set by the peer side. Before version 1.3.0 this option +is only available as latency. +

+
+
recv_buffer_size=bytes
+

Set UDP receive buffer size, expressed in bytes. +

+
+
send_buffer_size=bytes
+

Set UDP send buffer size, expressed in bytes. +

+
+
timeout=microseconds
+

Set raise error timeouts for read, write and connect operations. Note that the +SRT library has internal timeouts which can be controlled separately, the +value set here is only a cap on those. +

+
+
tlpktdrop=1|0
+

Too-late Packet Drop. When enabled on receiver, it skips +missing packets that have not been delivered in time and +delivers the following packets to the application when +their time-to-play has come. It also sends a fake ACK to +the sender. When enabled on sender and enabled on the +receiving peer, the sender drops the older packets that +have no chance of being delivered in time. It was +automatically enabled in the sender if the receiver +supports it. +

+
+
sndbuf=bytes
+

Set send buffer size, expressed in bytes. +

+
+
rcvbuf=bytes
+

Set receive buffer size, expressed in bytes. +

+

Receive buffer must not be greater than ffs. +

+
+
lossmaxttl=packets
+

The value up to which the Reorder Tolerance may grow. When +Reorder Tolerance is > 0, then packet loss report is delayed +until that number of packets come in. Reorder Tolerance +increases every time a "belated" packet has come, but it +wasn’t due to retransmission (that is, when UDP packets tend +to come out of order), with the difference between the latest +sequence and this packet’s sequence, and not more than the +value of this option. By default it’s 0, which means that this +mechanism is turned off, and the loss report is always sent +immediately upon experiencing a "gap" in sequences. +

+
+
minversion
+

The minimum SRT version that is required from the peer. A connection +to a peer that does not satisfy the minimum version requirement +will be rejected. +

+

The version format in hex is 0xXXYYZZ for x.y.z in human readable +form. +

+
+
streamid=string
+

A string limited to 512 characters that can be set on the socket prior +to connecting. This stream ID will be able to be retrieved by the +listener side from the socket that is returned from srt_accept and +was connected by a socket with that set stream ID. SRT does not enforce +any special interpretation of the contents of this string. +This option doesn’t make sense in Rendezvous connection; the result +might be that simply one side will override the value from the other +side and it’s the matter of luck which one would win +

+
+
srt_streamid=string
+

Alias for ‘streamid’ to avoid conflict with ffmpeg command line option. +

+
+
smoother=live|file
+

The type of Smoother used for the transmission for that socket, which +is responsible for the transmission and congestion control. The Smoother +type must be exactly the same on both connecting parties, otherwise +the connection is rejected. +

+
+
messageapi=1|0
+

When set, this socket uses the Message API, otherwise it uses Buffer +API. Note that in live mode (see transtype) there’s only +message API available. In File mode you can chose to use one of two modes: +

+

Stream API (default, when this option is false). In this mode you may +send as many data as you wish with one sending instruction, or even use +dedicated functions that read directly from a file. The internal facility +will take care of any speed and congestion control. When receiving, you +can also receive as many data as desired, the data not extracted will be +waiting for the next call. There is no boundary between data portions in +the Stream mode. +

+

Message API. In this mode your single sending instruction passes exactly +one piece of data that has boundaries (a message). Contrary to Live mode, +this message may span across multiple UDP packets and the only size +limitation is that it shall fit as a whole in the sending buffer. The +receiver shall use as large buffer as necessary to receive the message, +otherwise the message will not be given up. When the message is not +complete (not all packets received or there was a packet loss) it will +not be given up. +

+
+
transtype=live|file
+

Sets the transmission type for the socket, in particular, setting this +option sets multiple other parameters to their default values as required +for a particular transmission type. +

+

live: Set options as for live transmission. In this mode, you should +send by one sending instruction only so many data that fit in one UDP packet, +and limited to the value defined first in payload_size (1316 is +default in this mode). There is no speed control in this mode, only the +bandwidth control, if configured, in order to not exceed the bandwidth with +the overhead transmission (retransmitted and control packets). +

+

file: Set options as for non-live transmission. See messageapi +for further explanations +

+
+
linger=seconds
+

The number of seconds that the socket waits for unsent data when closing. +Default is -1. -1 means auto (off with 0 seconds in live mode, on with 180 +seconds in file mode). The range for this option is integers in the +0 - INT_MAX. +

+
+
tsbpd=1|0
+

When true, use Timestamp-based Packet Delivery mode. The default behavior +depends on the transmission type: enabled in live mode, disabled in file +mode. +

+
+
+ +

For more information see: https://github.com/Haivision/srt. +

+
+
+

18.38 srtp

+ +

Secure Real-time Transport Protocol. +

+

The accepted options are: +

+
srtp_in_suite
+
srtp_out_suite
+

Select input and output encoding suites. +

+

Supported values: +

+
AES_CM_128_HMAC_SHA1_80
+
SRTP_AES128_CM_HMAC_SHA1_80
+
AES_CM_128_HMAC_SHA1_32
+
SRTP_AES128_CM_HMAC_SHA1_32
+
+ +
+
srtp_in_params
+
srtp_out_params
+

Set input and output encoding parameters, which are expressed by a +base64-encoded representation of a binary block. The first 16 bytes of +this binary block are used as master key, the following 14 bytes are +used as master salt. +

+
+ +
+
+

18.39 subfile

+ +

Virtually extract a segment of a file or another stream. +The underlying stream must be seekable. +

+

Accepted options: +

+
start
+

Start offset of the extracted segment, in bytes. +

+
end
+

End offset of the extracted segment, in bytes. +If set to 0, extract till end of file. +

+
+ +

Examples: +

+

Extract a chapter from a DVD VOB file (start and end sectors obtained +externally and multiplied by 2048): +

+
subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
+
+ +

Play an AVI file directly from a TAR archive: +

+
subfile,,start,183241728,end,366490624,,:archive.tar
+
+ +

Play a MPEG-TS file from start offset till end: +

+
subfile,,start,32815239,end,0,,:video.ts
+
+ +
+
+

18.40 tee

+ +

Writes the output to multiple protocols. The individual outputs are separated +by | +

+
+
tee:file://path/to/local/this.avi|file://path/to/local/that.avi
+
+ +
+
+

18.41 tcp

+ +

Transmission Control Protocol. +

+

The required syntax for a TCP url is: +

+
tcp://hostname:port[?options]
+
+ +

options contains a list of &-separated options of the form +key=val. +

+

The list of supported options follows. +

+
+
listen=2|1|0
+

Listen for an incoming connection. 0 disables listen, 1 enables listen in +single client mode, 2 enables listen in multi-client mode. Default value is 0. +

+
+
local_addr=addr
+

Local IP address of a network interface used for tcp socket connect. +

+
+
local_port=port
+

Local port used for tcp socket connect. +

+
+
timeout=microseconds
+

Set raise error timeout, expressed in microseconds. +

+

This option is only relevant in read mode: if no data arrived in more +than this time interval, raise error. +

+
+
listen_timeout=milliseconds
+

Set listen timeout, expressed in milliseconds. +

+
+
recv_buffer_size=bytes
+

Set receive buffer size, expressed bytes. +

+
+
send_buffer_size=bytes
+

Set send buffer size, expressed bytes. +

+
+
tcp_nodelay=1|0
+

Set TCP_NODELAY to disable Nagle’s algorithm. Default value is 0. +

+

Remark: Writing to the socket is currently not optimized to minimize system calls and reduces the efficiency / effect of TCP_NODELAY. +

+
+
tcp_mss=bytes
+

Set maximum segment size for outgoing TCP packets, expressed in bytes. +

+
+ +

The following example shows how to setup a listening TCP connection +with ffmpeg, which is then accessed with ffplay: +

+
ffmpeg -i input -f format tcp://hostname:port?listen
+ffplay tcp://hostname:port
+
+ +
+
+

18.42 tls

+ +

Transport Layer Security (TLS) / Secure Sockets Layer (SSL) +

+

The required syntax for a TLS/SSL url is: +

+
tls://hostname:port[?options]
+
+ +

The following parameters can be set via command line options +(or in code via AVOptions): +

+
+
ca_file, cafile=filename
+

A file containing certificate authority (CA) root certificates to treat +as trusted. If the linked TLS library contains a default this might not +need to be specified for verification to work, but not all libraries and +setups have defaults built in. +The file must be in OpenSSL PEM format. +

+
+
tls_verify=1|0
+

If enabled, try to verify the peer that we are communicating with. +Note, if using OpenSSL, this currently only makes sure that the +peer certificate is signed by one of the root certificates in the CA +database, but it does not validate that the certificate actually +matches the host name we are trying to connect to. (With other backends, +the host name is validated as well.) +

+

This is disabled by default since it requires a CA database to be +provided by the caller in many cases. +

+
+
cert_file, cert=filename
+

A file containing a certificate to use in the handshake with the peer. +(When operating as server, in listen mode, this is more often required +by the peer, while client certificates only are mandated in certain +setups.) +

+
+
key_file, key=filename
+

A file containing the private key for the certificate. +

+
+
listen=1|0
+

If enabled, listen for connections on the provided port, and assume +the server role in the handshake instead of the client role. +

+
+
http_proxy
+

The HTTP proxy to tunnel through, e.g. http://example.com:1234. +The proxy must support the CONNECT method. +

+
+
+ +

Example command lines: +

+

To create a TLS/SSL server that serves an input stream. +

+
+
ffmpeg -i input -f format tls://hostname:port?listen&cert=server.crt&key=server.key
+
+ +

To play back a stream from the TLS/SSL server using ffplay: +

+
+
ffplay tls://hostname:port
+
+ +
+
+

18.43 udp

+ +

User Datagram Protocol. +

+

The required syntax for an UDP URL is: +

+
udp://hostname:port[?options]
+
+ +

options contains a list of &-separated options of the form key=val. +

+

In case threading is enabled on the system, a circular buffer is used +to store the incoming data, which allows one to reduce loss of data due to +UDP socket buffer overruns. The fifo_size and +overrun_nonfatal options are related to this buffer. +

+

The list of supported options follows. +

+
+
buffer_size=size
+

Set the UDP maximum socket buffer size in bytes. This is used to set either +the receive or send buffer size, depending on what the socket is used for. +Default is 32 KB for output, 384 KB for input. See also fifo_size. +

+
+
bitrate=bitrate
+

If set to nonzero, the output will have the specified constant bitrate if the +input has enough packets to sustain it. +

+
+
burst_bits=bits
+

When using bitrate this specifies the maximum number of bits in +packet bursts. +

+
+
localport=port
+

Override the local UDP port to bind with. +

+
+
localaddr=addr
+

Local IP address of a network interface used for sending packets or joining +multicast groups. +

+
+
pkt_size=size
+

Set the size in bytes of UDP packets. +

+
+
reuse=1|0
+

Explicitly allow or disallow reusing UDP sockets. +

+
+
ttl=ttl
+

Set the time to live value (for multicast only). +

+
+
connect=1|0
+

Initialize the UDP socket with connect(). In this case, the +destination address can’t be changed with ff_udp_set_remote_url later. +If the destination address isn’t known at the start, this option can +be specified in ff_udp_set_remote_url, too. +This allows finding out the source address for the packets with getsockname, +and makes writes return with AVERROR(ECONNREFUSED) if "destination +unreachable" is received. +For receiving, this gives the benefit of only receiving packets from +the specified peer address/port. +

+
+
sources=address[,address]
+

Only receive packets sent from the specified addresses. In case of multicast, +also subscribe to multicast traffic coming from these addresses only. +

+
+
block=address[,address]
+

Ignore packets sent from the specified addresses. In case of multicast, also +exclude the source addresses in the multicast subscription. +

+
+
fifo_size=units
+

Set the UDP receiving circular buffer size, expressed as a number of +packets with size of 188 bytes. If not specified defaults to 7*4096. +

+
+
overrun_nonfatal=1|0
+

Survive in case of UDP receiving circular buffer overrun. Default +value is 0. +

+
+
timeout=microseconds
+

Set raise error timeout, expressed in microseconds. +

+

This option is only relevant in read mode: if no data arrived in more +than this time interval, raise error. +

+
+
broadcast=1|0
+

Explicitly allow or disallow UDP broadcasting. +

+

Note that broadcasting may not work properly on networks having +a broadcast storm protection. +

+
+ + +
+

18.43.1 Examples

+ +
    +
  • Use ffmpeg to stream over UDP to a remote endpoint: +
    +
    ffmpeg -i input -f format udp://hostname:port
    +
    + +
  • Use ffmpeg to stream in mpegts format over UDP using 188 +sized UDP packets, using a large input buffer: +
    +
    ffmpeg -i input -f mpegts udp://hostname:port?pkt_size=188&buffer_size=65535
    +
    + +
  • Use ffmpeg to receive over UDP from a remote endpoint: +
    +
    ffmpeg -i udp://[multicast-address]:port ...
    +
    +
+ +
+
+
+

18.44 unix

+ +

Unix local socket +

+

The required syntax for a Unix socket URL is: +

+
+
unix://filepath
+
+ +

The following parameters can be set via command line options +(or in code via AVOptions): +

+
+
timeout
+

Timeout in ms. +

+
listen
+

Create the Unix socket in listening mode. +

+
+ +
+
+

18.45 zmq

+ +

ZeroMQ asynchronous messaging using the libzmq library. +

+

This library supports unicast streaming to multiple clients without relying on +an external server. +

+

The required syntax for streaming or connecting to a stream is: +

+
zmq:tcp://ip-address:port
+
+ +

Example: +Create a localhost stream on port 5555: +

+
ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
+
+ +

Multiple clients may connect to the stream using: +

+
ffplay zmq:tcp://127.0.0.1:5555
+
+ +

Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern. +The server side binds to a port and publishes data. Clients connect to the +server (via IP address/port) and subscribe to the stream. The order in which +the server and client start generally does not matter. +

+

ffmpeg must be compiled with the –enable-libzmq option to support +this protocol. +

+

Options can be set on the ffmpeg/ffplay command +line. The following options are supported: +

+
+
pkt_size
+

Forces the maximum packet size for sending/receiving data. The default value is +131,072 bytes. On the server side, this sets the maximum size of sent packets +via ZeroMQ. On the clients, it sets an internal buffer size for receiving +packets. Note that pkt_size on the clients should be equal to or greater than +pkt_size on the server. Otherwise the received message may be truncated causing +decoding errors. +

+
+
+ +
+
+
+

19 Device Options

+ +

The libavdevice library provides the same interface as +libavformat. Namely, an input device is considered like a demuxer, and +an output device like a muxer, and the interface and generic device +options are the same provided by libavformat (see the ffmpeg-formats +manual). +

+

In addition each input or output device may support so-called private +options, which are specific for that component. +

+

Options may be set by specifying -option value in the +FFmpeg tools, or by setting the value explicitly in the device +AVFormatContext options or using the libavutil/opt.h API +for programmatic use. +

+ +
+
+

20 Input Devices

+ +

Input devices are configured elements in FFmpeg which enable accessing +the data coming from a multimedia device attached to your system. +

+

When you configure your FFmpeg build, all the supported input devices +are enabled by default. You can list all available ones using the +configure option "–list-indevs". +

+

You can disable all the input devices using the configure option +"–disable-indevs", and selectively enable an input device using the +option "–enable-indev=INDEV", or you can disable a particular +input device using the option "–disable-indev=INDEV". +

+

The option "-devices" of the ff* tools will display the list of +supported input devices. +

+

A description of the currently available input devices follows. +

+ +
+

20.1 alsa

+ +

ALSA (Advanced Linux Sound Architecture) input device. +

+

To enable this input device during configuration you need libasound +installed on your system. +

+

This device allows capturing from an ALSA device. The name of the +device to capture has to be an ALSA card identifier. +

+

An ALSA identifier has the syntax: +

+
hw:CARD[,DEV[,SUBDEV]]
+
+ +

where the DEV and SUBDEV components are optional. +

+

The three arguments (in order: CARD,DEV,SUBDEV) +specify card number or identifier, device number and subdevice number +(-1 means any). +

+

To see the list of cards currently recognized by your system check the +files /proc/asound/cards and /proc/asound/devices. +

+

For example to capture with ffmpeg from an ALSA device with +card id 0, you may run the command: +

+
ffmpeg -f alsa -i hw:0 alsaout.wav
+
+ +

For more information see: +http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html +

+ +
+

20.1.1 Options

+ +
+
sample_rate
+

Set the sample rate in Hz. Default is 48000. +

+
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

20.2 android_camera

+ +

Android camera input device. +

+

This input devices uses the Android Camera2 NDK API which is +available on devices with API level 24+. The availability of +android_camera is autodetected during configuration. +

+

This device allows capturing from all cameras on an Android device, +which are integrated into the Camera2 NDK API. +

+

The available cameras are enumerated internally and can be selected +with the camera_index parameter. The input file string is +discarded. +

+

Generally the back facing camera has index 0 while the front facing +camera has index 1. +

+ +
+

20.2.1 Options

+ +
+
video_size
+

Set the video size given as a string such as 640x480 or hd720. +Falls back to the first available configuration reported by +Android if requested video size is not available or by default. +

+
+
framerate
+

Set the video framerate. +Falls back to the first available configuration reported by +Android if requested framerate is not available or by default (-1). +

+
+
camera_index
+

Set the index of the camera to use. Default is 0. +

+
+
input_queue_size
+

Set the maximum number of frames to buffer. Default is 5. +

+
+
+ +
+
+
+

20.3 avfoundation

+ +

AVFoundation input device. +

+

AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX >= 10.7 as well as on iOS. +

+

The input filename has to be given in the following syntax: +

+
-i "[[VIDEO]:[AUDIO]]"
+
+

The first entry selects the video input while the latter selects the audio input. +The stream has to be specified by the device name or the device index as shown by the device list. +Alternatively, the video and/or audio input device can be chosen by index using the + + -video_device_index <INDEX> + +and/or + + -audio_device_index <INDEX> + +, overriding any +device name or index given in the input filename. +

+

All available devices can be enumerated by using -list_devices true, listing +all device names and corresponding indices. +

+

There are two device name aliases: +

+
default
+

Select the AVFoundation default device of the corresponding type. +

+
+
none
+

Do not record the corresponding media type. +This is equivalent to specifying an empty device name or index. +

+
+
+ + +
+

20.3.1 Options

+ +

AVFoundation supports the following options: +

+
+
-list_devices <TRUE|FALSE>
+

If set to true, a list of all available input devices is given showing all +device names and indices. +

+
+
-video_device_index <INDEX>
+

Specify the video device by its index. Overrides anything given in the input filename. +

+
+
-audio_device_index <INDEX>
+

Specify the audio device by its index. Overrides anything given in the input filename. +

+
+
-pixel_format <FORMAT>
+

Request the video device to use a specific pixel format. +If the specified format is not supported, a list of available formats is given +and the first one in this list is used instead. Available pixel formats are: +monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0, + bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10, + yuv420p, nv12, yuyv422, gray +

+
+
-framerate
+

Set the grabbing frame rate. Default is ntsc, corresponding to a +frame rate of 30000/1001. +

+
+
-video_size
+

Set the video frame size. +

+
+
-capture_cursor
+

Capture the mouse pointer. Default is 0. +

+
+
-capture_mouse_clicks
+

Capture the screen mouse clicks. Default is 0. +

+
+
-capture_raw_data
+

Capture the raw device data. Default is 0. +Using this option may result in receiving the underlying data delivered to the AVFoundation framework. E.g. for muxed devices that sends raw DV data to the framework (like tape-based camcorders), setting this option to false results in extracted video frames captured in the designated pixel format only. Setting this option to true results in receiving the raw DV stream untouched. +

+
+ +
+
+

20.3.2 Examples

+ +
    +
  • Print the list of AVFoundation supported devices and exit: +
    +
    $ ffmpeg -f avfoundation -list_devices true -i ""
    +
    + +
  • Record video from video device 0 and audio from audio device 0 into out.avi: +
    +
    $ ffmpeg -f avfoundation -i "0:0" out.avi
    +
    + +
  • Record video from video device 2 and audio from audio device 1 into out.avi: +
    +
    $ ffmpeg -f avfoundation -video_device_index 2 -i ":1" out.avi
    +
    + +
  • Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi: +
    +
    $ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
    +
    + +
  • Record raw DV data from a suitable input device and write the output into out.dv: +
    +
    $ ffmpeg -f avfoundation -capture_raw_data true -i "zr100:none" out.dv
    +
    + + +
+ +
+
+
+

20.4 bktr

+ +

BSD video input device. +

+ +
+

20.4.1 Options

+ +
+
framerate
+

Set the frame rate. +

+
+
video_size
+

Set the video frame size. Default is vga. +

+
+
standard
+
+

Available values are: +

+
pal
+
ntsc
+
secam
+
paln
+
palm
+
ntscj
+
+ +
+
+ +
+
+ +
+

20.6 dshow

+ +

Windows DirectShow input device. +

+

DirectShow support is enabled when FFmpeg is built with the mingw-w64 project. +Currently only audio and video devices are supported. +

+

Multiple devices may be opened as separate inputs, but they may also be +opened on the same input, which should improve synchronism between them. +

+

The input name should be in the format: +

+
+
TYPE=NAME[:TYPE=NAME]
+
+ +

where TYPE can be either audio or video, +and NAME is the device’s name or alternative name.. +

+ +
+

20.6.1 Options

+ +

If no options are specified, the device’s defaults are used. +If the device does not support the requested options, it will +fail to open. +

+
+
video_size
+

Set the video size in the captured video. +

+
+
framerate
+

Set the frame rate in the captured video. +

+
+
sample_rate
+

Set the sample rate (in Hz) of the captured audio. +

+
+
sample_size
+

Set the sample size (in bits) of the captured audio. +

+
+
channels
+

Set the number of channels in the captured audio. +

+
+
list_devices
+

If set to true, print a list of devices and exit. +

+
+
list_options
+

If set to true, print a list of selected device’s options +and exit. +

+
+
video_device_number
+

Set video device number for devices with the same name (starts at 0, +defaults to 0). +

+
+
audio_device_number
+

Set audio device number for devices with the same name (starts at 0, +defaults to 0). +

+
+
pixel_format
+

Select pixel format to be used by DirectShow. This may only be set when +the video codec is not set or set to rawvideo. +

+
+
audio_buffer_size
+

Set audio device buffer size in milliseconds (which can directly +impact latency, depending on the device). +Defaults to using the audio device’s +default buffer size (typically some multiple of 500ms). +Setting this value too low can degrade performance. +See also +http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx +

+
+
video_pin_name
+

Select video capture pin to use by name or alternative name. +

+
+
audio_pin_name
+

Select audio capture pin to use by name or alternative name. +

+
+
crossbar_video_input_pin_number
+

Select video input pin number for crossbar device. This will be +routed to the crossbar device’s Video Decoder output pin. +Note that changing this value can affect future invocations +(sets a new default) until system reboot occurs. +

+
+
crossbar_audio_input_pin_number
+

Select audio input pin number for crossbar device. This will be +routed to the crossbar device’s Audio Decoder output pin. +Note that changing this value can affect future invocations +(sets a new default) until system reboot occurs. +

+
+
show_video_device_dialog
+

If set to true, before capture starts, popup a display dialog +to the end user, allowing them to change video filter properties +and configurations manually. +Note that for crossbar devices, adjusting values in this dialog +may be needed at times to toggle between PAL (25 fps) and NTSC (29.97) +input frame rates, sizes, interlacing, etc. Changing these values can +enable different scan rates/frame rates and avoiding green bars at +the bottom, flickering scan lines, etc. +Note that with some devices, changing these properties can also affect future +invocations (sets new defaults) until system reboot occurs. +

+
+
show_audio_device_dialog
+

If set to true, before capture starts, popup a display dialog +to the end user, allowing them to change audio filter properties +and configurations manually. +

+
+
show_video_crossbar_connection_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify crossbar pin routings, when it opens a video device. +

+
+
show_audio_crossbar_connection_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify crossbar pin routings, when it opens an audio device. +

+
+
show_analog_tv_tuner_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify TV channels and frequencies. +

+
+
show_analog_tv_tuner_audio_dialog
+

If set to true, before capture starts, popup a display +dialog to the end user, allowing them to manually +modify TV audio (like mono vs. stereo, Language A,B or C). +

+
+
audio_device_load
+

Load an audio capture filter device from file instead of searching +it by name. It may load additional parameters too, if the filter +supports the serialization of its properties to. +To use this an audio capture source has to be specified, but it can +be anything even fake one. +

+
+
audio_device_save
+

Save the currently used audio capture filter device and its +parameters (if the filter supports it) to a file. +If a file with the same name exists it will be overwritten. +

+
+
video_device_load
+

Load a video capture filter device from file instead of searching +it by name. It may load additional parameters too, if the filter +supports the serialization of its properties to. +To use this a video capture source has to be specified, but it can +be anything even fake one. +

+
+
video_device_save
+

Save the currently used video capture filter device and its +parameters (if the filter supports it) to a file. +If a file with the same name exists it will be overwritten. +

+
+
use_video_device_timestamps
+

If set to false, the timestamp for video frames will be +derived from the wallclock instead of the timestamp provided by +the capture device. This allows working around devices that +provide unreliable timestamps. +

+
+
+ +
+
+

20.6.2 Examples

+ +
    +
  • Print the list of DirectShow supported devices and exit: +
    +
    $ ffmpeg -list_devices true -f dshow -i dummy
    +
    + +
  • Open video device Camera: +
    +
    $ ffmpeg -f dshow -i video="Camera"
    +
    + +
  • Open second video device with name Camera: +
    +
    $ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
    +
    + +
  • Open video device Camera and audio device Microphone: +
    +
    $ ffmpeg -f dshow -i video="Camera":audio="Microphone"
    +
    + +
  • Print the list of supported options in selected device and exit: +
    +
    $ ffmpeg -list_options true -f dshow -i video="Camera"
    +
    + +
  • Specify pin names to capture by name or alternative name, specify alternative device name: +
    +
    $ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i video=video="@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}":audio="Microphone"
    +
    + +
  • Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup: +
    +
    $ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
    +     -crossbar_audio_input_pin_number 3 -i video="AVerMedia BDA Analog Capture":audio="AVerMedia BDA Analog Capture"
    +
    + +
+ +
+
+
+

20.7 fbdev

+ +

Linux framebuffer input device. +

+

The Linux framebuffer is a graphic hardware-independent abstraction +layer to show graphics on a computer monitor, typically on the +console. It is accessed through a file device node, usually +/dev/fb0. +

+

For more detailed information read the file +Documentation/fb/framebuffer.txt included in the Linux source tree. +

+

See also http://linux-fbdev.sourceforge.net/, and fbset(1). +

+

To record from the framebuffer device /dev/fb0 with +ffmpeg: +

+
ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
+
+ +

You can take a single screenshot image with the command: +

+
ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
+
+ + +
+

20.7.1 Options

+ +
+
framerate
+

Set the frame rate. Default is 25. +

+
+
+ +
+
+
+

20.8 gdigrab

+ +

Win32 GDI-based screen capture device. +

+

This device allows you to capture a region of the display on Windows. +

+

There are two options for the input filename: +

+
desktop
+
+

or +

+
title=window_title
+
+ +

The first option will capture the entire desktop, or a fixed region of the +desktop. The second option will instead capture the contents of a single +window, regardless of its position on the screen. +

+

For example, to grab the entire desktop using ffmpeg: +

+
ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
+
+ +

Grab a 640x480 region at position 10,20: +

+
ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
+
+ +

Grab the contents of the window named "Calculator" +

+
ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
+
+ + +
+

20.8.1 Options

+ +
+
draw_mouse
+

Specify whether to draw the mouse pointer. Use the value 0 to +not draw the pointer. Default value is 1. +

+
+
framerate
+

Set the grabbing frame rate. Default value is ntsc, +corresponding to a frame rate of 30000/1001. +

+
+
show_region
+

Show grabbed region on screen. +

+

If show_region is specified with 1, then the grabbing +region will be indicated on screen. With this option, it is easy to +know what is being grabbed if only a portion of the screen is grabbed. +

+

Note that show_region is incompatible with grabbing the contents +of a single window. +

+

For example: +

+
ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
+
+ +
+
video_size
+

Set the video frame size. The default is to capture the full screen if desktop is selected, or the full window size if title=window_title is selected. +

+
+
offset_x
+

When capturing a region with video_size, set the distance from the left edge of the screen or desktop. +

+

Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned to the left of your primary monitor, you will need to use a negative offset_x value to move the region to that monitor. +

+
+
offset_y
+

When capturing a region with video_size, set the distance from the top edge of the screen or desktop. +

+

Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned above your primary monitor, you will need to use a negative offset_y value to move the region to that monitor. +

+
+
+ +
+
+
+

20.9 iec61883

+ +

FireWire DV/HDV input device using libiec61883. +

+

To enable this input device, you need libiec61883, libraw1394 and +libavc1394 installed on your system. Use the configure option +--enable-libiec61883 to compile with the device enabled. +

+

The iec61883 capture device supports capturing from a video device +connected via IEEE1394 (FireWire), using libiec61883 and the new Linux +FireWire stack (juju). This is the default DV/HDV input method in Linux +Kernel 2.6.37 and later, since the old FireWire stack was removed. +

+

Specify the FireWire port to be used as input file, or "auto" +to choose the first port connected. +

+ +
+

20.9.1 Options

+ +
+
dvtype
+

Override autodetection of DV/HDV. This should only be used if auto +detection does not work, or if usage of a different device type +should be prohibited. Treating a DV device as HDV (or vice versa) will +not work and result in undefined behavior. +The values auto, dv and hdv are supported. +

+
+
dvbuffer
+

Set maximum size of buffer for incoming data, in frames. For DV, this +is an exact value. For HDV, it is not frame exact, since HDV does +not have a fixed frame size. +

+
+
dvguid
+

Select the capture device by specifying its GUID. Capturing will only +be performed from the specified device and fails if no device with the +given GUID is found. This is useful to select the input if multiple +devices are connected at the same time. +Look at /sys/bus/firewire/devices to find out the GUIDs. +

+
+
+ +
+
+

20.9.2 Examples

+ +
    +
  • Grab and show the input of a FireWire DV/HDV device. +
    +
    ffplay -f iec61883 -i auto
    +
    + +
  • Grab and record the input of a FireWire DV/HDV device, +using a packet buffer of 100000 packets if the source is HDV. +
    +
    ffmpeg -f iec61883 -i auto -dvbuffer 100000 out.mpg
    +
    + +
+ +
+
+
+

20.10 jack

+ +

JACK input device. +

+

To enable this input device during configuration you need libjack +installed on your system. +

+

A JACK input device creates one or more JACK writable clients, one for +each audio channel, with name client_name:input_N, where +client_name is the name provided by the application, and N +is a number which identifies the channel. +Each writable client will send the acquired data to the FFmpeg input +device. +

+

Once you have created one or more JACK readable clients, you need to +connect them to one or more JACK writable clients. +

+

To connect or disconnect JACK clients you can use the jack_connect +and jack_disconnect programs, or do it through a graphical interface, +for example with qjackctl. +

+

To list the JACK clients and their properties you can invoke the command +jack_lsp. +

+

Follows an example which shows how to capture a JACK readable client +with ffmpeg. +

+
# Create a JACK writable client with name "ffmpeg".
+$ ffmpeg -f jack -i ffmpeg -y out.wav
+
+# Start the sample jack_metro readable client.
+$ jack_metro -b 120 -d 0.2 -f 4000
+
+# List the current JACK clients.
+$ jack_lsp -c
+system:capture_1
+system:capture_2
+system:playback_1
+system:playback_2
+ffmpeg:input_1
+metro:120_bpm
+
+# Connect metro to the ffmpeg writable client.
+$ jack_connect metro:120_bpm ffmpeg:input_1
+
+ +

For more information read: +http://jackaudio.org/ +

+ +
+

20.10.1 Options

+ +
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

20.11 kmsgrab

+ +

KMS video input device. +

+

Captures the KMS scanout framebuffer associated with a specified CRTC or plane as a +DRM object that can be passed to other hardware functions. +

+

Requires either DRM master or CAP_SYS_ADMIN to run. +

+

If you don’t understand what all of that means, you probably don’t want this. Look at +x11grab instead. +

+ +
+

20.11.1 Options

+ +
+
device
+

DRM device to capture on. Defaults to /dev/dri/card0. +

+
+
format
+

Pixel format of the framebuffer. This can be autodetected if you are running Linux 5.7 +or later, but needs to be provided for earlier versions. Defaults to bgr0, +which is the most common format used by the Linux console and Xorg X server. +

+
+
format_modifier
+

Format modifier to signal on output frames. This is necessary to import correctly into +some APIs. It can be autodetected if you are running Linux 5.7 or later, but will need +to be provided explicitly when needed in earlier versions. See the libdrm documentation +for possible values. +

+
+
crtc_id
+

KMS CRTC ID to define the capture source. The first active plane on the given CRTC +will be used. +

+
+
plane_id
+

KMS plane ID to define the capture source. Defaults to the first active plane found if +neither crtc_id nor plane_id are specified. +

+
+
framerate
+

Framerate to capture at. This is not synchronised to any page flipping or framebuffer +changes - it just defines the interval at which the framebuffer is sampled. Sampling +faster than the framebuffer update rate will generate independent frames with the same +content. Defaults to 30. +

+
+
+ +
+
+

20.11.2 Examples

+ +
    +
  • Capture from the first active plane, download the result to normal frames and encode. +This will only work if the framebuffer is both linear and mappable - if not, the result +may be scrambled or fail to download. +
    +
    ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4
    +
    + +
  • Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert to NV12 and encode as H.264. +
    +
    ffmpeg -crtc_id 42 -framerate 60 -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' -c:v h264_vaapi output.mp4
    +
    + +
  • To capture only part of a plane the output can be cropped - this can be used to capture +a single window, as long as it has a known absolute position and size. For example, to +capture and encode the middle quarter of a 1920x1080 plane: +
    +
    ffmpeg -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,crop=960:540:480:270,scale_vaapi=960:540:nv12' -c:v h264_vaapi output.mp4
    +
    + +
+ +
+
+
+

20.12 lavfi

+ +

Libavfilter input virtual device. +

+

This input device reads data from the open output pads of a libavfilter +filtergraph. +

+

For each filtergraph open output, the input device will create a +corresponding stream which is mapped to the generated output. +The filtergraph is specified through the option graph. +

+ +
+

20.12.1 Options

+ +
+
graph
+

Specify the filtergraph to use as input. Each video open output must be +labelled by a unique string of the form "outN", where N is a +number starting from 0 corresponding to the mapped input stream +generated by the device. +The first unlabelled output is automatically assigned to the "out0" +label, but all the others need to be specified explicitly. +

+

The suffix "+subcc" can be appended to the output label to create an extra +stream with the closed captions packets attached to that output +(experimental; only for EIA-608 / CEA-708 for now). +The subcc streams are created after all the normal streams, in the order of +the corresponding stream. +For example, if there is "out19+subcc", "out7+subcc" and up to "out42", the +stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19. +

+

If not specified defaults to the filename specified for the input +device. +

+
+
graph_file
+

Set the filename of the filtergraph to be read and sent to the other +filters. Syntax of the filtergraph is the same as the one specified by +the option graph. +

+
+
dumpgraph
+

Dump graph to stderr. +

+
+
+ +
+
+

20.12.2 Examples

+ +
    +
  • Create a color video stream and play it back with ffplay: +
    +
    ffplay -f lavfi -graph "color=c=pink [out0]" dummy
    +
    + +
  • As the previous example, but use filename for specifying the graph +description, and omit the "out0" label: +
    +
    ffplay -f lavfi color=c=pink
    +
    + +
  • Create three different video test filtered sources and play them: +
    +
    ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
    +
    + +
  • Read an audio stream from a file using the amovie source and play it +back with ffplay: +
    +
    ffplay -f lavfi "amovie=test.wav"
    +
    + +
  • Read an audio stream and a video stream and play it back with +ffplay: +
    +
    ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
    +
    + +
  • Dump decoded frames to images and closed captions to a file (experimental): +
    +
    ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
    +
    + +
+ +
+
+
+

20.13 libcdio

+ +

Audio-CD input device based on libcdio. +

+

To enable this input device during configuration you need libcdio +installed on your system. It requires the configure option +--enable-libcdio. +

+

This device allows playing and grabbing from an Audio-CD. +

+

For example to copy with ffmpeg the entire Audio-CD in /dev/sr0, +you may run the command: +

+
ffmpeg -f libcdio -i /dev/sr0 cd.wav
+
+ + +
+

20.13.1 Options

+
+
speed
+

Set drive reading speed. Default value is 0. +

+

The speed is specified CD-ROM speed units. The speed is set through +the libcdio cdio_cddap_speed_set function. On many CD-ROM +drives, specifying a value too large will result in using the fastest +speed. +

+
+
paranoia_mode
+

Set paranoia recovery mode flags. It accepts one of the following values: +

+
+
disable
+
verify
+
overlap
+
neverskip
+
full
+
+ +

Default value is ‘disable’. +

+

For more information about the available recovery modes, consult the +paranoia project documentation. +

+
+ +
+
+
+

20.14 libdc1394

+ +

IIDC1394 input device, based on libdc1394 and libraw1394. +

+

Requires the configure option --enable-libdc1394. +

+ +
+

20.14.1 Options

+
+
framerate
+

Set the frame rate. Default is ntsc, corresponding to a frame +rate of 30000/1001. +

+
+
pixel_format
+

Select the pixel format. Default is uyvy422. +

+
+
video_size
+

Set the video size given as a string such as 640x480 or hd720. +Default is qvga. +

+
+ +
+
+
+

20.15 openal

+ +

The OpenAL input device provides audio capture on all systems with a +working OpenAL 1.1 implementation. +

+

To enable this input device during configuration, you need OpenAL +headers and libraries installed on your system, and need to configure +FFmpeg with --enable-openal. +

+

OpenAL headers and libraries should be provided as part of your OpenAL +implementation, or as an additional download (an SDK). Depending on your +installation you may need to specify additional flags via the +--extra-cflags and --extra-ldflags for allowing the build +system to locate the OpenAL headers and libraries. +

+

An incomplete list of OpenAL implementations follows: +

+
+
Creative
+

The official Windows implementation, providing hardware acceleration +with supported devices and software fallback. +See http://openal.org/. +

+
OpenAL Soft
+

Portable, open source (LGPL) software implementation. Includes +backends for the most common sound APIs on the Windows, Linux, +Solaris, and BSD operating systems. +See http://kcat.strangesoft.net/openal.html. +

+
Apple
+

OpenAL is part of Core Audio, the official Mac OS X Audio interface. +See http://developer.apple.com/technologies/mac/audio-and-video.html +

+
+ +

This device allows one to capture from an audio input device handled +through OpenAL. +

+

You need to specify the name of the device to capture in the provided +filename. If the empty string is provided, the device will +automatically select the default device. You can get the list of the +supported devices by using the option list_devices. +

+ +
+

20.15.1 Options

+ +
+
channels
+

Set the number of channels in the captured audio. Only the values +1 (monaural) and 2 (stereo) are currently supported. +Defaults to 2. +

+
+
sample_size
+

Set the sample size (in bits) of the captured audio. Only the values +8 and 16 are currently supported. Defaults to +16. +

+
+
sample_rate
+

Set the sample rate (in Hz) of the captured audio. +Defaults to 44.1k. +

+
+
list_devices
+

If set to true, print a list of devices and exit. +Defaults to false. +

+
+
+ +
+
+

20.15.2 Examples

+ +

Print the list of OpenAL supported devices and exit: +

+
$ ffmpeg -list_devices true -f openal -i dummy out.ogg
+
+ +

Capture from the OpenAL device DR-BT101 via PulseAudio: +

+
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
+
+ +

Capture from the default device (note the empty string ” as filename): +

+
$ ffmpeg -f openal -i '' out.ogg
+
+ +

Capture from two devices simultaneously, writing to two different files, +within the same ffmpeg command: +

+
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
+
+

Note: not all OpenAL implementations support multiple simultaneous capture - +try the latest OpenAL Soft if the above does not work. +

+
+
+
+

20.16 oss

+ +

Open Sound System input device. +

+

The filename to provide to the input device is the device node +representing the OSS input device, and is usually set to +/dev/dsp. +

+

For example to grab from /dev/dsp using ffmpeg use the +command: +

+
ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
+
+ +

For more information about OSS see: +http://manuals.opensound.com/usersguide/dsp.html +

+ +
+

20.16.1 Options

+ +
+
sample_rate
+

Set the sample rate in Hz. Default is 48000. +

+
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

20.17 pulse

+ +

PulseAudio input device. +

+

To enable this output device you need to configure FFmpeg with --enable-libpulse. +

+

The filename to provide to the input device is a source device or the +string "default" +

+

To list the PulseAudio source devices and their properties you can invoke +the command pactl list sources. +

+

More information about PulseAudio can be found on http://www.pulseaudio.org. +

+ +
+

20.17.1 Options

+
+
server
+

Connect to a specific PulseAudio server, specified by an IP address. +Default server is used when not provided. +

+
+
name
+

Specify the application name PulseAudio will use when showing active clients, +by default it is the LIBAVFORMAT_IDENT string. +

+
+
stream_name
+

Specify the stream name PulseAudio will use when showing active streams, +by default it is "record". +

+
+
sample_rate
+

Specify the samplerate in Hz, by default 48kHz is used. +

+
+
channels
+

Specify the channels in use, by default 2 (stereo) is set. +

+
+
frame_size
+

This option does nothing and is deprecated. +

+
+
fragment_size
+

Specify the size in bytes of the minimal buffering fragment in PulseAudio, it +will affect the audio latency. By default it is set to 50 ms amount of data. +

+
+
wallclock
+

Set the initial PTS using the current time. Default is 1. +

+
+
+ +
+
+

20.17.2 Examples

+

Record a stream from default device: +

+
ffmpeg -f pulse -i default /tmp/pulse.wav
+
+ +
+
+
+

20.18 sndio

+ +

sndio input device. +

+

To enable this input device during configuration you need libsndio +installed on your system. +

+

The filename to provide to the input device is the device node +representing the sndio input device, and is usually set to +/dev/audio0. +

+

For example to grab from /dev/audio0 using ffmpeg use the +command: +

+
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
+
+ + +
+

20.18.1 Options

+ +
+
sample_rate
+

Set the sample rate in Hz. Default is 48000. +

+
+
channels
+

Set the number of channels. Default is 2. +

+
+
+ +
+
+
+

20.19 video4linux2, v4l2

+ +

Video4Linux2 input video device. +

+

"v4l2" can be used as alias for "video4linux2". +

+

If FFmpeg is built with v4l-utils support (by using the +--enable-libv4l2 configure option), it is possible to use it with the +-use_libv4l2 input device option. +

+

The name of the device to grab is a file device node, usually Linux +systems tend to automatically create such nodes when the device +(e.g. an USB webcam) is plugged into the system, and has a name of the +kind /dev/videoN, where N is a number associated to +the device. +

+

Video4Linux2 devices usually support a limited set of +widthxheight sizes and frame rates. You can check which are +supported using -list_formats all for Video4Linux2 devices. +Some devices, like TV cards, support one or more standards. It is possible +to list all the supported standards using -list_standards all. +

+

The time base for the timestamps is 1 microsecond. Depending on the kernel +version and configuration, the timestamps may be derived from the real time +clock (origin at the Unix Epoch) or the monotonic clock (origin usually at +boot time, unaffected by NTP or manual changes to the clock). The +-timestamps abs or -ts abs option can be used to force +conversion into the real time clock. +

+

Some usage examples of the video4linux2 device with ffmpeg +and ffplay: +

    +
  • List supported formats for a video4linux2 device: +
    +
    ffplay -f video4linux2 -list_formats all /dev/video0
    +
    + +
  • Grab and show the input of a video4linux2 device: +
    +
    ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
    +
    + +
  • Grab and record the input of a video4linux2 device, leave the +frame rate and size as previously set: +
    +
    ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
    +
    +
+ +

For more information about Video4Linux, check http://linuxtv.org/. +

+ +
+

20.19.1 Options

+ +
+
standard
+

Set the standard. Must be the name of a supported standard. To get a +list of the supported standards, use the list_standards +option. +

+
+
channel
+

Set the input channel number. Default to -1, which means using the +previously selected channel. +

+
+
video_size
+

Set the video frame size. The argument must be a string in the form +WIDTHxHEIGHT or a valid size abbreviation. +

+
+
pixel_format
+

Select the pixel format (only valid for raw video input). +

+
+
input_format
+

Set the preferred pixel format (for raw video) or a codec name. +This option allows one to select the input format, when several are +available. +

+
+
framerate
+

Set the preferred video frame rate. +

+
+
list_formats
+

List available formats (supported pixel formats, codecs, and frame +sizes) and exit. +

+

Available values are: +

+
all
+

Show all available (compressed and non-compressed) formats. +

+
+
raw
+

Show only raw video (non-compressed) formats. +

+
+
compressed
+

Show only compressed formats. +

+
+ +
+
list_standards
+

List supported standards and exit. +

+

Available values are: +

+
all
+

Show all supported standards. +

+
+ +
+
timestamps, ts
+

Set type of timestamps for grabbed frames. +

+

Available values are: +

+
default
+

Use timestamps from the kernel. +

+
+
abs
+

Use absolute timestamps (wall clock). +

+
+
mono2abs
+

Force conversion from monotonic to absolute timestamps. +

+
+ +

Default value is default. +

+
+
use_libv4l2
+

Use libv4l2 (v4l-utils) conversion functions. Default is 0. +

+
+
+ +
+
+
+

20.20 vfwcap

+ +

VfW (Video for Windows) capture input device. +

+

The filename passed as input is the capture driver number, ranging from +0 to 9. You may use "list" as filename to print a list of drivers. Any +other filename will be interpreted as device number 0. +

+ +
+

20.20.1 Options

+ +
+
video_size
+

Set the video frame size. +

+
+
framerate
+

Set the grabbing frame rate. Default value is ntsc, +corresponding to a frame rate of 30000/1001. +

+
+
+ +
+
+
+

20.21 x11grab

+ +

X11 video input device. +

+

To enable this input device during configuration you need libxcb +installed on your system. It will be automatically detected during +configuration. +

+

This device allows one to capture a region of an X11 display. +

+

The filename passed as input has the syntax: +

+
[hostname]:display_number.screen_number[+x_offset,y_offset]
+
+ +

hostname:display_number.screen_number specifies the +X11 display name of the screen to grab from. hostname can be +omitted, and defaults to "localhost". The environment variable +DISPLAY contains the default display name. +

+

x_offset and y_offset specify the offsets of the grabbed +area with respect to the top-left border of the X11 screen. They +default to 0. +

+

Check the X11 documentation (e.g. man X) for more detailed +information. +

+

Use the xdpyinfo program for getting basic information about +the properties of your X11 display (e.g. grep for "name" or +"dimensions"). +

+

For example to grab from :0.0 using ffmpeg: +

+
ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +

Grab at position 10,20: +

+
ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
+
+ + +
+

20.21.1 Options

+ +
+
select_region
+

Specify whether to select the grabbing area graphically using the pointer. +A value of 1 prompts the user to select the grabbing area graphically +by clicking and dragging. A single click with no dragging will select the +whole screen. A region with zero width or height will also select the whole +screen. This option overwrites the video_size, grab_x, and +grab_y options. Default value is 0. +

+
+
draw_mouse
+

Specify whether to draw the mouse pointer. A value of 0 specifies +not to draw the pointer. Default value is 1. +

+
+
follow_mouse
+

Make the grabbed area follow the mouse. The argument can be +centered or a number of pixels PIXELS. +

+

When it is specified with "centered", the grabbing region follows the mouse +pointer and keeps the pointer at the center of region; otherwise, the region +follows only when the mouse pointer reaches within PIXELS (greater than +zero) to the edge of region. +

+

For example: +

+
ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +

To follow only when the mouse pointer reaches within 100 pixels to edge: +

+
ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +
+
framerate
+

Set the grabbing frame rate. Default value is ntsc, +corresponding to a frame rate of 30000/1001. +

+
+
show_region
+

Show grabbed region on screen. +

+

If show_region is specified with 1, then the grabbing +region will be indicated on screen. With this option, it is easy to +know what is being grabbed if only a portion of the screen is grabbed. +

+
+
region_border
+

Set the region border thickness if -show_region 1 is used. +Range is 1 to 128 and default is 3 (XCB-based x11grab only). +

+

For example: +

+
ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
+
+ +

With follow_mouse: +

+
ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
+
+ +
+
window_id
+

Grab this window, instead of the whole screen. Default value is 0, which maps to +the whole screen (root window). +

+

The id of a window can be found using the xwininfo program, possibly with options -tree and +-root. +

+

If the window is later enlarged, the new area is not recorded. Video ends when +the window is closed, unmapped (i.e., iconified) or shrunk beyond the video +size (which defaults to the initial window size). +

+

This option disables options follow_mouse and select_region. +

+
+
video_size
+

Set the video frame size. Default is the full desktop or window. +

+
+
grab_x
+
grab_y
+

Set the grabbing region coordinates. They are expressed as offset from +the top left corner of the X11 window and correspond to the +x_offset and y_offset parameters in the device name. The +default value for both options is 0. +

+
+ +
+
+
+
+

21 Resampler Options

+ +

The audio resampler supports the following named options. +

+

Options may be set by specifying -option value in the +FFmpeg tools, option=value for the aresample filter, +by setting the value explicitly in the +SwrContext options or using the libavutil/opt.h API for +programmatic use. +

+
+
uchl, used_chlayout
+

Set used input channel layout. Default is unset. This option is +only used for special remapping. +

+
+
isr, in_sample_rate
+

Set the input sample rate. Default value is 0. +

+
+
osr, out_sample_rate
+

Set the output sample rate. Default value is 0. +

+
+
isf, in_sample_fmt
+

Specify the input sample format. It is set by default to none. +

+
+
osf, out_sample_fmt
+

Specify the output sample format. It is set by default to none. +

+
+
tsf, internal_sample_fmt
+

Set the internal sample format. Default value is none. +This will automatically be chosen when it is not explicitly set. +

+
+
ichl, in_chlayout
+
ochl, out_chlayout
+

Set the input/output channel layout. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+
clev, center_mix_level
+

Set the center mix level. It is a value expressed in deciBel, and must be +in the interval [-32,32]. +

+
+
slev, surround_mix_level
+

Set the surround mix level. It is a value expressed in deciBel, and must +be in the interval [-32,32]. +

+
+
lfe_mix_level
+

Set LFE mix into non LFE level. It is used when there is a LFE input but no +LFE output. It is a value expressed in deciBel, and must +be in the interval [-32,32]. +

+
+
rmvol, rematrix_volume
+

Set rematrix volume. Default value is 1.0. +

+
+
rematrix_maxval
+

Set maximum output value for rematrixing. +This can be used to prevent clipping vs. preventing volume reduction. +A value of 1.0 prevents clipping. +

+
+
flags, swr_flags
+

Set flags used by the converter. Default value is 0. +

+

It supports the following individual flags: +

+
res
+

force resampling, this flag forces resampling to be used even when the +input and output sample rates match. +

+
+ +
+
dither_scale
+

Set the dither scale. Default value is 1. +

+
+
dither_method
+

Set dither method. Default value is 0. +

+

Supported values: +

+
rectangular
+

select rectangular dither +

+
triangular
+

select triangular dither +

+
triangular_hp
+

select triangular dither with high pass +

+
lipshitz
+

select Lipshitz noise shaping dither. +

+
shibata
+

select Shibata noise shaping dither. +

+
low_shibata
+

select low Shibata noise shaping dither. +

+
high_shibata
+

select high Shibata noise shaping dither. +

+
f_weighted
+

select f-weighted noise shaping dither +

+
modified_e_weighted
+

select modified-e-weighted noise shaping dither +

+
improved_e_weighted
+

select improved-e-weighted noise shaping dither +

+
+
+ +
+
resampler
+

Set resampling engine. Default value is swr. +

+

Supported values: +

+
swr
+

select the native SW Resampler; filter options precision and cheby are not +applicable in this case. +

+
soxr
+

select the SoX Resampler (where available); compensation, and filter options +filter_size, phase_shift, exact_rational, filter_type & kaiser_beta, are not +applicable in this case. +

+
+ +
+
filter_size
+

For swr only, set resampling filter size, default value is 32. +

+
+
phase_shift
+

For swr only, set resampling phase shift, default value is 10, and must be in +the interval [0,30]. +

+
+
linear_interp
+

Use linear interpolation when enabled (the default). Disable it if you want +to preserve speed instead of quality when exact_rational fails. +

+
+
exact_rational
+

For swr only, when enabled, try to use exact phase_count based on input and +output sample rate. However, if it is larger than 1 << phase_shift, +the phase_count will be 1 << phase_shift as fallback. Default is enabled. +

+
+
cutoff
+

Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float +value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr +(which, with a sample-rate of 44100, preserves the entire audio band to 20kHz). +

+
+
precision
+

For soxr only, the precision in bits to which the resampled signal will be +calculated. The default value of 20 (which, with suitable dithering, is +appropriate for a destination bit-depth of 16) gives SoX’s ’High Quality’; a +value of 28 gives SoX’s ’Very High Quality’. +

+
+
cheby
+

For soxr only, selects passband rolloff none (Chebyshev) & higher-precision +approximation for ’irrational’ ratios. Default value is 0. +

+
+
async
+

For swr only, simple 1 parameter audio sync to timestamps using stretching, +squeezing, filling and trimming. Setting this to 1 will enable filling and +trimming, larger values represent the maximum amount in samples that the data +may be stretched or squeezed for each second. +Default value is 0, thus no compensation is applied to make the samples match +the audio timestamps. +

+
+
first_pts
+

For swr only, assume the first pts should be this value. The time unit is 1 / sample rate. +This allows for padding/trimming at the start of stream. By default, no +assumption is made about the first frame’s expected pts, so no padding or +trimming is done. For example, this could be set to 0 to pad the beginning with +silence if an audio stream starts after the video stream or to trim any samples +with a negative pts due to encoder delay. +

+
+
min_comp
+

For swr only, set the minimum difference between timestamps and audio data (in +seconds) to trigger stretching/squeezing/filling or trimming of the +data to make it match the timestamps. The default is that +stretching/squeezing/filling and trimming is disabled +(min_comp = FLT_MAX). +

+
+
min_hard_comp
+

For swr only, set the minimum difference between timestamps and audio data (in +seconds) to trigger adding/dropping samples to make it match the +timestamps. This option effectively is a threshold to select between +hard (trim/fill) and soft (squeeze/stretch) compensation. Note that +all compensation is by default disabled through min_comp. +The default is 0.1. +

+
+
comp_duration
+

For swr only, set duration (in seconds) over which data is stretched/squeezed +to make it match the timestamps. Must be a non-negative double float value, +default value is 1.0. +

+
+
max_soft_comp
+

For swr only, set maximum factor by which data is stretched/squeezed to make it +match the timestamps. Must be a non-negative double float value, default value +is 0. +

+
+
matrix_encoding
+

Select matrixed stereo encoding. +

+

It accepts the following values: +

+
none
+

select none +

+
dolby
+

select Dolby +

+
dplii
+

select Dolby Pro Logic II +

+
+ +

Default value is none. +

+
+
filter_type
+

For swr only, select resampling filter type. This only affects resampling +operations. +

+

It accepts the following values: +

+
cubic
+

select cubic +

+
blackman_nuttall
+

select Blackman Nuttall windowed sinc +

+
kaiser
+

select Kaiser windowed sinc +

+
+ +
+
kaiser_beta
+

For swr only, set Kaiser window beta value. Must be a double float value in the +interval [2,16], default value is 9. +

+
+
output_sample_bits
+

For swr only, set number of used output sample bits for dithering. Must be an integer in the +interval [0,64], default value is 0, which means it’s not used. +

+
+
+ +
+
+

22 Scaler Options

+ +

The video scaler supports the following named options. +

+

Options may be set by specifying -option value in the +FFmpeg tools, with a few API-only exceptions noted below. +For programmatic use, they can be set explicitly in the +SwsContext options or through the libavutil/opt.h API. +

+
+
+
+
sws_flags
+

Set the scaler flags. This is also used to set the scaling +algorithm. Only a single algorithm should be selected. Default +value is ‘bicubic’. +

+

It accepts the following values: +

+
fast_bilinear
+

Select fast bilinear scaling algorithm. +

+
+
bilinear
+

Select bilinear scaling algorithm. +

+
+
bicubic
+

Select bicubic scaling algorithm. +

+
+
experimental
+

Select experimental scaling algorithm. +

+
+
neighbor
+

Select nearest neighbor rescaling algorithm. +

+
+
area
+

Select averaging area rescaling algorithm. +

+
+
bicublin
+

Select bicubic scaling algorithm for the luma component, bilinear for +chroma components. +

+
+
gauss
+

Select Gaussian rescaling algorithm. +

+
+
sinc
+

Select sinc rescaling algorithm. +

+
+
lanczos
+

Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be +changed by setting param0. +

+
+
spline
+

Select natural bicubic spline rescaling algorithm. +

+
+
print_info
+

Enable printing/debug logging. +

+
+
accurate_rnd
+

Enable accurate rounding. +

+
+
full_chroma_int
+

Enable full chroma interpolation. +

+
+
full_chroma_inp
+

Select full chroma input. +

+
+
bitexact
+

Enable bitexact output. +

+
+ +
+
srcw (API only)
+

Set source width. +

+
+
srch (API only)
+

Set source height. +

+
+
dstw (API only)
+

Set destination width. +

+
+
dsth (API only)
+

Set destination height. +

+
+
src_format (API only)
+

Set source pixel format (must be expressed as an integer). +

+
+
dst_format (API only)
+

Set destination pixel format (must be expressed as an integer). +

+
+
src_range (boolean)
+

If value is set to 1, indicates source is full range. Default value is +0, which indicates source is limited range. +

+
+
dst_range (boolean)
+

If value is set to 1, enable full range for destination. Default value +is 0, which enables limited range. +

+
+
param0, param1
+

Set scaling algorithm parameters. The specified values are specific of +some scaling algorithms and ignored by others. The specified values +are floating point number values. +

+
+
sws_dither
+

Set the dithering algorithm. Accepts one of the following +values. Default value is ‘auto’. +

+
+
auto
+

automatic choice +

+
+
none
+

no dithering +

+
+
bayer
+

bayer dither +

+
+
ed
+

error diffusion dither +

+
+
a_dither
+

arithmetic dither, based using addition +

+
+
x_dither
+

arithmetic dither, based using xor (more random/less apparent patterning that +a_dither). +

+
+
+ +
+
alphablend
+

Set the alpha blending to use when the input has alpha but the output does not. +Default value is ‘none’. +

+
+
uniform_color
+

Blend onto a uniform background color +

+
+
checkerboard
+

Blend onto a checkerboard +

+
+
none
+

No blending +

+
+
+ +
+
+ +
+
+

23 Filtering Introduction

+ +

Filtering in FFmpeg is enabled through the libavfilter library. +

+

In libavfilter, a filter can have multiple inputs and multiple +outputs. +To illustrate the sorts of things that are possible, we consider the +following filtergraph. +

+
                [main]
+input --> split ---------------------> overlay --> output
+            |                             ^
+            |[tmp]                  [flip]|
+            +-----> crop --> vflip -------+
+
+

This filtergraph splits the input stream in two streams, then sends one +stream through the crop filter and the vflip filter, before merging it +back with the other stream by overlaying it on top. You can use the +following command to achieve this: +

+
+
ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT
+
+ +

The result will be that the top half of the video is mirrored +onto the bottom half of the output video. +

+

Filters in the same linear chain are separated by commas, and distinct +linear chains of filters are separated by semicolons. In our example, +crop,vflip are in one linear chain, split and +overlay are separately in another. The points where the linear +chains join are labelled by names enclosed in square brackets. In the +example, the split filter generates two outputs that are associated to +the labels [main] and [tmp]. +

+

The stream sent to the second output of split, labelled as +[tmp], is processed through the crop filter, which crops +away the lower half part of the video, and then vertically flipped. The +overlay filter takes in input the first unchanged output of the +split filter (which was labelled as [main]), and overlay on its +lower half the output generated by the crop,vflip filterchain. +

+

Some filters take in input a list of parameters: they are specified +after the filter name and an equal sign, and are separated from each other +by a colon. +

+

There exist so-called source filters that do not have an +audio/video input, and sink filters that will not have audio/video +output. +

+ +
+
+

24 graph2dot

+ +

The graph2dot program included in the FFmpeg tools +directory can be used to parse a filtergraph description and issue a +corresponding textual representation in the dot language. +

+

Invoke the command: +

+
graph2dot -h
+
+ +

to see how to use graph2dot. +

+

You can then pass the dot description to the dot program (from +the graphviz suite of programs) and obtain a graphical representation +of the filtergraph. +

+

For example the sequence of commands: +

+
echo GRAPH_DESCRIPTION | \
+tools/graph2dot -o graph.tmp && \
+dot -Tpng graph.tmp -o graph.png && \
+display graph.png
+
+ +

can be used to create and display an image representing the graph +described by the GRAPH_DESCRIPTION string. Note that this string must be +a complete self-contained graph, with its inputs and outputs explicitly defined. +For example if your command line is of the form: +

+
ffmpeg -i infile -vf scale=640:360 outfile
+
+

your GRAPH_DESCRIPTION string will need to be of the form: +

+
nullsrc,scale=640:360,nullsink
+
+

you may also need to set the nullsrc parameters and add a format +filter in order to simulate a specific input file. +

+ +
+
+

25 Filtergraph description

+ +

A filtergraph is a directed graph of connected filters. It can contain +cycles, and there can be multiple links between a pair of +filters. Each link has one input pad on one side connecting it to one +filter from which it takes its input, and one output pad on the other +side connecting it to one filter accepting its output. +

+

Each filter in a filtergraph is an instance of a filter class +registered in the application, which defines the features and the +number of input and output pads of the filter. +

+

A filter with no input pads is called a "source", and a filter with no +output pads is called a "sink". +

+ +
+

25.1 Filtergraph syntax

+ +

A filtergraph has a textual representation, which is recognized by the +-filter/-vf/-af and +-filter_complex options in ffmpeg and +-vf/-af in ffplay, and by the +avfilter_graph_parse_ptr() function defined in +libavfilter/avfilter.h. +

+

A filterchain consists of a sequence of connected filters, each one +connected to the previous one in the sequence. A filterchain is +represented by a list of ","-separated filter descriptions. +

+

A filtergraph consists of a sequence of filterchains. A sequence of +filterchains is represented by a list of ";"-separated filterchain +descriptions. +

+

A filter is represented by a string of the form: +[in_link_1]...[in_link_N]filter_name@id=arguments[out_link_1]...[out_link_M] +

+

filter_name is the name of the filter class of which the +described filter is an instance of, and has to be the name of one of +the filter classes registered in the program optionally followed by "@id". +The name of the filter class is optionally followed by a string +"=arguments". +

+

arguments is a string which contains the parameters used to +initialize the filter instance. It may have one of two forms: +

    +
  • A ’:’-separated list of key=value pairs. + +
  • A ’:’-separated list of value. In this case, the keys are assumed to be +the option names in the order they are declared. E.g. the fade filter +declares three options in this order – type, start_frame and +nb_frames. Then the parameter list in:0:30 means that the value +in is assigned to the option type, 0 to +start_frame and 30 to nb_frames. + +
  • A ’:’-separated list of mixed direct value and long key=value +pairs. The direct value must precede the key=value pairs, and +follow the same constraints order of the previous point. The following +key=value pairs can be set in any preferred order. + +
+ +

If the option value itself is a list of items (e.g. the format filter +takes a list of pixel formats), the items in the list are usually separated by +‘|’. +

+

The list of arguments can be quoted using the character ‘'’ as initial +and ending mark, and the character ‘\’ for escaping the characters +within the quoted text; otherwise the argument string is considered +terminated when the next special character (belonging to the set +‘[]=;,’) is encountered. +

+

A special syntax implemented in the ffmpeg CLI tool allows loading +option values from files. This is done be prepending a slash ’/’ to the option +name, then the supplied value is interpreted as a path from which the actual +value is loaded. E.g. +

+
ffmpeg -i <INPUT> -vf drawtext=/text=/tmp/some_text <OUTPUT>
+
+

will load the text to be drawn from /tmp/some_text. API users wishing to +implement a similar feature should use the avfilter_graph_segment_*() +functions together with custom IO code. +

+

The name and arguments of the filter are optionally preceded and +followed by a list of link labels. +A link label allows one to name a link and associate it to a filter output +or input pad. The preceding labels in_link_1 +... in_link_N, are associated to the filter input pads, +the following labels out_link_1 ... out_link_M, are +associated to the output pads. +

+

When two link labels with the same name are found in the +filtergraph, a link between the corresponding input and output pad is +created. +

+

If an output pad is not labelled, it is linked by default to the first +unlabelled input pad of the next filter in the filterchain. +For example in the filterchain +

+
nullsrc, split[L1], [L2]overlay, nullsink
+
+

the split filter instance has two output pads, and the overlay filter +instance two input pads. The first output pad of split is labelled +"L1", the first input pad of overlay is labelled "L2", and the second +output pad of split is linked to the second input pad of overlay, +which are both unlabelled. +

+

In a filter description, if the input label of the first filter is not +specified, "in" is assumed; if the output label of the last filter is not +specified, "out" is assumed. +

+

In a complete filterchain all the unlabelled filter input and output +pads must be connected. A filtergraph is considered valid if all the +filter input and output pads of all the filterchains are connected. +

+

Leading and trailing whitespaces (space, tabs, or line feeds) separating tokens +in the filtergraph specification are ignored. This means that the filtergraph +can be expressed using empty lines and spaces to improve redability. +

+

For example, the filtergraph: +

+
testsrc,split[L1],hflip[L2];[L1][L2] hstack
+
+ +

can be represented as: +

+
testsrc,
+split [L1], hflip [L2];
+
+[L1][L2] hstack
+
+ +

Libavfilter will automatically insert scale filters where format +conversion is required. It is possible to specify swscale flags +for those automatically inserted scalers by prepending +sws_flags=flags; +to the filtergraph description. +

+

Here is a BNF description of the filtergraph syntax: +

+
NAME             ::= sequence of alphanumeric characters and '_'
+FILTER_NAME      ::= NAME["@"NAME]
+LINKLABEL        ::= "[" NAME "]"
+LINKLABELS       ::= LINKLABEL [LINKLABELS]
+FILTER_ARGUMENTS ::= sequence of chars (possibly quoted)
+FILTER           ::= [LINKLABELS] FILTER_NAME ["=" FILTER_ARGUMENTS] [LINKLABELS]
+FILTERCHAIN      ::= FILTER [,FILTERCHAIN]
+FILTERGRAPH      ::= [sws_flags=flags;] FILTERCHAIN [;FILTERGRAPH]
+
+ +
+
+

25.2 Notes on filtergraph escaping

+ +

Filtergraph description composition entails several levels of +escaping. See (ffmpeg-utils)the "Quoting and escaping" +section in the ffmpeg-utils(1) manual for more +information about the employed escaping procedure. +

+

A first level escaping affects the content of each filter option +value, which may contain the special character : used to +separate values, or one of the escaping characters \'. +

+

A second level escaping affects the whole filter description, which +may contain the escaping characters \' or the special +characters [],; used by the filtergraph description. +

+

Finally, when you specify a filtergraph on a shell commandline, you +need to perform a third level escaping for the shell special +characters contained within it. +

+

For example, consider the following string to be embedded in +the drawtext filter description text value: +

+
this is a 'string': may contain one, or more, special characters
+
+ +

This string contains the ' special escaping character, and the +: special character, so it needs to be escaped in this way: +

+
text=this is a \'string\'\: may contain one, or more, special characters
+
+ +

A second level of escaping is required when embedding the filter +description in a filtergraph description, in order to escape all the +filtergraph special characters. Thus the example above becomes: +

+
drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
+
+

(note that in addition to the \' escaping special characters, +also , needs to be escaped). +

+

Finally an additional level of escaping is needed when writing the +filtergraph description in a shell command, which depends on the +escaping rules of the adopted shell. For example, assuming that +\ is special and needs to be escaped with another \, the +previous string will finally result in: +

+
-vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
+
+ +

In order to avoid cumbersome escaping when using a commandline tool accepting a +filter specification as input, it is advisable to avoid direct inclusion of the +filter or options specification in the shell. +

+

For example, in case of the drawtext filter, you might prefer to +use the textfile option in place of text to specify the text +to render. +

+

When using the ffmpeg tool, you might consider to use the +(ffmpeg)-filter_script option or +(ffmpeg)-filter_complex_script option. +

+
+
+
+

26 Timeline editing

+ +

Some filters support a generic enable option. For the filters +supporting timeline editing, this option can be set to an expression which is +evaluated before sending a frame to the filter. If the evaluation is non-zero, +the filter will be enabled, otherwise the frame will be sent unchanged to the +next filter in the filtergraph. +

+

The expression accepts the following values: +

+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
n
+

sequential number of the input frame, starting from 0 +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, do +not use +

+
+
w
+
h
+

width and height of the input frame if video +

+
+ +

Additionally, these filters support an enable command that can be used +to re-define the expression. +

+

Like any other filtering option, the enable option follows the same +rules. +

+

For example, to enable a blur filter (smartblur) from 10 seconds to 3 +minutes, and a curves filter starting at 3 seconds: +

+
smartblur = enable='between(t,10,3*60)',
+curves    = enable='gte(t,3)' : preset=cross_process
+
+ +

See ffmpeg -filters to view which filters have timeline support. +

+ +
+
+

27 Changing options at runtime with a command

+ +

Some options can be changed during the operation of the filter using +a command. These options are marked ’T’ on the output of +ffmpeg -h filter=<name of filter>. +The name of the command is the name of the option and the argument is +the new value. +

+
+
+

28 Options for filters with several inputs (framesync)

+ +

Some filters with several inputs support a common set of options. +These options can only be set by name, not with the short notation. +

+
+
eof_action
+

The action to take when EOF is encountered on the secondary input; it accepts +one of the following values: +

+
+
repeat
+

Repeat the last frame (the default). +

+
endall
+

End both streams. +

+
pass
+

Pass the main input through. +

+
+ +
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+
repeatlast
+

If set to 1, force the filter to extend the last frame of secondary streams +until the end of the primary stream. A value of 0 disables this behavior. +Default value is 1. +

+
+
ts_sync_mode
+

How strictly to sync streams based on secondary input timestamps; it accepts +one of the following values: +

+
+
default
+

Frame from secondary input with the nearest lower or equal timestamp to the +primary input frame. +

+
nearest
+

Frame from secondary input with the absolute nearest timestamp to the primary +input frame. +

+
+
+
+ + +
+
+

29 Audio Filters

+ +

When you configure your FFmpeg build, you can disable any of the +existing filters using --disable-filters. +The configure output will show the audio filters included in your +build. +

+

Below is a description of the currently available audio filters. +

+ +
+

29.1 acompressor

+ +

A compressor is mainly used to reduce the dynamic range of a signal. +Especially modern music is mostly compressed at a high ratio to +improve the overall loudness. It’s done to get the highest attention +of a listener, "fatten" the sound and bring more "power" to the track. +If a signal is compressed too much it may sound dull or "dead" +afterwards or it may start to "pump" (which could be a powerful effect +but can also destroy a track completely). +The right compression is the key to reach a professional sound and is +the high art of mixing and mastering. Because of its complex settings +it may take a long time to get the right feeling for this kind of effect. +

+

Compression is done by detecting the volume above a chosen level +threshold and dividing it by the factor set with ratio. +So if you set the threshold to -12dB and your signal reaches -6dB a ratio +of 2:1 will result in a signal at -9dB. Because an exact manipulation of +the signal would cause distortion of the waveform the reduction can be +levelled over the time. This is done by setting "Attack" and "Release". +attack determines how long the signal has to rise above the threshold +before any reduction will occur and release sets the time the signal +has to fall below the threshold to reduce the reduction again. Shorter signals +than the chosen attack time will be left untouched. +The overall reduction of the signal can be made up afterwards with the +makeup setting. So compressing the peaks of a signal about 6dB and +raising the makeup to this level results in a signal twice as loud than the +source. To gain a softer entry in the compression the knee flattens the +hard edge at the threshold in the range of the chosen decibels. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. Default is 1. Range is between 0.015625 and 64. +

+
+
mode
+

Set mode of compressor operation. Can be upward or downward. +Default is downward. +

+
+
threshold
+

If a signal of stream rises above this level it will affect the gain +reduction. +By default it is 0.125. Range is between 0.00097563 and 1. +

+
+
ratio
+

Set a ratio by which the signal is reduced. 1:2 means that if the level +rose 4dB above the threshold, it will be only 2dB above after the reduction. +Default is 2. Range is between 1 and 20. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction starts. Default is 20. Range is between 0.01 and 2000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before +reduction is decreased again. Default is 250. Range is between 0.01 and 9000. +

+
+
makeup
+

Set the amount by how much signal will be amplified after processing. +Default is 1. Range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.82843. Range is between 1 and 8. +

+
+
link
+

Choose if the average level between all channels of input stream +or the louder(maximum) channel of input stream affects the +reduction. Default is average. +

+
+
detection
+

Should the exact signal be taken in case of peak or an RMS one in case +of rms. Default is rms which is mostly smoother. +

+
+
mix
+

How much to use compressed signal in output. Default is 1. +Range is between 0 and 1. +

+
+ + +
+

29.1.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.2 acontrast

+

Simple audio dynamic range compression/expansion filter. +

+

The filter accepts the following options: +

+
+
contrast
+

Set contrast. Default is 33. Allowed range is between 0 and 100. +

+
+ +
+
+

29.3 acopy

+ +

Copy the input audio source unchanged to the output. This is mainly useful for +testing purposes. +

+
+
+

29.4 acrossfade

+ +

Apply cross fade from one input audio stream to another input audio stream. +The cross fade is applied for specified duration near the end of first stream. +

+

The filter accepts the following options: +

+
+
nb_samples, ns
+

Specify the number of samples for which the cross fade effect has to last. +At the end of the cross fade effect the first input audio will be completely +silent. Default is 44100. +

+
+
duration, d
+

Specify the duration of the cross fade effect. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +By default the duration is determined by nb_samples. +If set this option is used instead of nb_samples. +

+
+
overlap, o
+

Should first stream end overlap with second stream start. Default is enabled. +

+
+
curve1
+

Set curve for cross fade transition for first stream. +

+
+
curve2
+

Set curve for cross fade transition for second stream. +

+

For description of available curve types see afade filter description. +

+
+ + +
+

29.4.1 Examples

+ +
    +
  • Cross fade from one input to another: +
    +
    ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
    +
    + +
  • Cross fade from one input to another but without overlapping: +
    +
    ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
    +
    +
+ +
+
+
+

29.5 acrossover

+

Split audio stream into several bands. +

+

This filter splits audio stream into two or more frequency ranges. +Summing all streams back will give flat output. +

+

The filter accepts the following options: +

+
+
split
+

Set split frequencies. Those must be positive and increasing. +

+
+
order
+

Set filter order for each band split. This controls filter roll-off or steepness +of filter transfer function. +Available values are: +

+
+
2nd
+

12 dB per octave. +

+
4th
+

24 dB per octave. +

+
6th
+

36 dB per octave. +

+
8th
+

48 dB per octave. +

+
10th
+

60 dB per octave. +

+
12th
+

72 dB per octave. +

+
14th
+

84 dB per octave. +

+
16th
+

96 dB per octave. +

+
18th
+

108 dB per octave. +

+
20th
+

120 dB per octave. +

+
+ +

Default is 4th. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 1. Default value is 1. +

+
+
gains
+

Set output gain for each band. Default value is 1 for all bands. +

+
+
precision
+

Set which precision to use when processing samples. +

+
+
auto
+

Auto pick internal sample format depending on other filters. +

+
+
float
+

Always use single-floating point precision sample format. +

+
+
double
+

Always use double-floating point precision sample format. +

+
+ +

Default value is auto. +

+
+ + +
+

29.5.1 Examples

+ +
    +
  • Split input audio stream into two bands (low and high) with split frequency of 1500 Hz, +each band will be in separate stream: +
    +
    ffmpeg -i in.flac -filter_complex 'acrossover=split=1500[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
    +
    + +
  • Same as above, but with higher filter order: +
    +
    ffmpeg -i in.flac -filter_complex 'acrossover=split=1500:order=8th[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
    +
    + +
  • Same as above, but also with additional middle band (frequencies between 1500 and 8000): +
    +
    ffmpeg -i in.flac -filter_complex 'acrossover=split=1500 8000:order=8th[LOW][MID][HIGH]' -map '[LOW]' low.wav -map '[MID]' mid.wav -map '[HIGH]' high.wav
    +
    +
+ +
+
+
+

29.6 acrusher

+ +

Reduce audio bit resolution. +

+

This filter is bit crusher with enhanced functionality. A bit crusher +is used to audibly reduce number of bits an audio signal is sampled +with. This doesn’t change the bit depth at all, it just produces the +effect. Material reduced in bit depth sounds more harsh and "digital". +This filter is able to even round to continuous values instead of discrete +bit depths. +Additionally it has a D/C offset which results in different crushing of +the lower and the upper half of the signal. +An Anti-Aliasing setting is able to produce "softer" crushing sounds. +

+

Another feature of this filter is the logarithmic mode. +This setting switches from linear distances between bits to logarithmic ones. +The result is a much more "natural" sounding crusher which doesn’t gate low +signals for example. The human ear has a logarithmic perception, +so this kind of crushing is much more pleasant. +Logarithmic crushing is also able to get anti-aliased. +

+

The filter accepts the following options: +

+
+
level_in
+

Set level in. +

+
+
level_out
+

Set level out. +

+
+
bits
+

Set bit reduction. +

+
+
mix
+

Set mixing amount. +

+
+
mode
+

Can be linear: lin or logarithmic: log. +

+
+
dc
+

Set DC. +

+
+
aa
+

Set anti-aliasing. +

+
+
samples
+

Set sample reduction. +

+
+
lfo
+

Enable LFO. By default disabled. +

+
+
lforange
+

Set LFO range. +

+
+
lforate
+

Set LFO rate. +

+
+ + +
+

29.6.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.7 acue

+ +

Delay audio filtering until a given wallclock timestamp. See the cue +filter. +

+
+
+

29.8 adeclick

+

Remove impulsive noise from input audio. +

+

Samples detected as impulsive noise are replaced by interpolated samples using +autoregressive modelling. +

+
+
window, w
+

Set window size, in milliseconds. Allowed range is from 10 to +100. Default value is 55 milliseconds. +This sets size of window which will be processed at once. +

+
+
overlap, o
+

Set window overlap, in percentage of window size. Allowed range is from +50 to 95. Default value is 75 percent. +Setting this to a very high value increases impulsive noise removal but makes +whole process much slower. +

+
+
arorder, a
+

Set autoregression order, in percentage of window size. Allowed range is from +0 to 25. Default value is 2 percent. This option also +controls quality of interpolated samples using neighbour good samples. +

+
+
threshold, t
+

Set threshold value. Allowed range is from 1 to 100. +Default value is 2. +This controls the strength of impulsive noise which is going to be removed. +The lower value, the more samples will be detected as impulsive noise. +

+
+
burst, b
+

Set burst fusion, in percentage of window size. Allowed range is 0 to +10. Default value is 2. +If any two samples detected as noise are spaced less than this value then any +sample between those two samples will be also detected as noise. +

+
+
method, m
+

Set overlap method. +

+

It accepts the following values: +

+
add, a
+

Select overlap-add method. Even not interpolated samples are slightly +changed with this method. +

+
+
save, s
+

Select overlap-save method. Not interpolated samples remain unchanged. +

+
+ +

Default value is a. +

+
+ +
+
+

29.9 adeclip

+

Remove clipped samples from input audio. +

+

Samples detected as clipped are replaced by interpolated samples using +autoregressive modelling. +

+
+
window, w
+

Set window size, in milliseconds. Allowed range is from 10 to 100. +Default value is 55 milliseconds. +This sets size of window which will be processed at once. +

+
+
overlap, o
+

Set window overlap, in percentage of window size. Allowed range is from 50 +to 95. Default value is 75 percent. +

+
+
arorder, a
+

Set autoregression order, in percentage of window size. Allowed range is from +0 to 25. Default value is 8 percent. This option also controls +quality of interpolated samples using neighbour good samples. +

+
+
threshold, t
+

Set threshold value. Allowed range is from 1 to 100. +Default value is 10. Higher values make clip detection less aggressive. +

+
+
hsize, n
+

Set size of histogram used to detect clips. Allowed range is from 100 to 9999. +Default value is 1000. Higher values make clip detection less aggressive. +

+
+
method, m
+

Set overlap method. +

+

It accepts the following values: +

+
add, a
+

Select overlap-add method. Even not interpolated samples are slightly changed +with this method. +

+
+
save, s
+

Select overlap-save method. Not interpolated samples remain unchanged. +

+
+ +

Default value is a. +

+
+ +
+
+

29.10 adecorrelate

+

Apply decorrelation to input audio stream. +

+

The filter accepts the following options: +

+
+
stages
+

Set decorrelation stages of filtering. Allowed +range is from 1 to 16. Default value is 6. +

+
+
seed
+

Set random seed used for setting delay in samples across channels. +

+
+ +
+
+

29.11 adelay

+ +

Delay one or more audio channels. +

+

Samples in delayed channel are filled with silence. +

+

The filter accepts the following option: +

+
+
delays
+

Set list of delays in milliseconds for each channel separated by ’|’. +Unused delays will be silently ignored. If number of given delays is +smaller than number of channels all remaining channels will not be delayed. +If you want to delay exact number of samples, append ’S’ to number. +If you want instead to delay in seconds, append ’s’ to number. +

+
+
all
+

Use last set delay for all remaining channels. By default is disabled. +This option if enabled changes how option delays is interpreted. +

+
+ + +
+

29.11.1 Examples

+ +
    +
  • Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave +the second channel (and any other channels that may be present) unchanged. +
    +
    adelay=1500|0|500
    +
    + +
  • Delay second channel by 500 samples, the third channel by 700 samples and leave +the first channel (and any other channels that may be present) unchanged. +
    +
    adelay=0|500S|700S
    +
    + +
  • Delay all channels by same number of samples: +
    +
    adelay=delays=64S:all=1
    +
    +
+ +
+
+
+

29.12 adenorm

+

Remedy denormals in audio by adding extremely low-level noise. +

+

This filter shall be placed before any filter that can produce denormals. +

+

A description of the accepted parameters follows. +

+
+
level
+

Set level of added noise in dB. Default is -351. +Allowed range is from -451 to -90. +

+
+
type
+

Set type of added noise. +

+
+
dc
+

Add DC signal. +

+
ac
+

Add AC signal. +

+
square
+

Add square signal. +

+
pulse
+

Add pulse signal. +

+
+ +

Default is dc. +

+
+ + +
+

29.12.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.13 aderivative, aintegral

+ +

Compute derivative/integral of audio stream. +

+

Applying both filters one after another produces original audio. +

+
+
+

29.14 adrc

+ +

Apply spectral dynamic range controller filter to input audio stream. +

+

A description of the accepted options follows. +

+
+
transfer
+

Set the transfer expression. +

+

The expression can contain the following constants: +

+
+
ch
+

current channel number +

+
+
sn
+

current sample number +

+
+
nb_channels
+

number of channels +

+
+
t
+

timestamp expressed in seconds +

+
+
sr
+

sample rate +

+
+
p
+

current frequency power value, in dB +

+
+
f
+

current frequency in Hz +

+
+ +

Default value is p. +

+
+
attack
+

Set the attack in milliseconds. Default is 50 milliseconds. +Allowed range is from 1 to 1000 milliseconds. +

+
release
+

Set the release in milliseconds. Default is 100 milliseconds. +Allowed range is from 5 to 2000 milliseconds. +

+
channels
+

Set which channels to filter, by default all channels in audio stream are filtered. +

+
+ + +
+

29.14.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

29.14.2 Examples

+ +
    +
  • Apply spectral compression to all frequencies with threshold of -50 dB and 1:6 ratio: +
    +
    adrc=transfer='if(gt(p,-50),-50+(p-(-50))/6,p)':attack=50:release=100
    +
    + +
  • Similar to above but with 1:2 ratio and filtering only front center channel: +
    +
    adrc=transfer='if(gt(p,-50),-50+(p-(-50))/2,p)':attack=50:release=100:channels=FC
    +
    + +
  • Apply spectral noise gate to all frequencies with threshold of -85 dB and with short attack time and short release time: +
    +
    adrc=transfer='if(lte(p,-85),p-800,p)':attack=1:release=5
    +
    + +
  • Apply spectral expansion to all frequencies with threshold of -10 dB and 1:2 ratio: +
    +
    adrc=transfer='if(lt(p,-10),-10+(p-(-10))*2,p)':attack=50:release=100
    +
    + +
  • Apply limiter to max -60 dB to all frequencies, with attack of 2 ms and release of 10 ms: +
    +
    adrc=transfer='min(p,-60)':attack=2:release=10
    +
    +
+ +
+
+
+

29.15 adynamicequalizer

+ +

Apply dynamic equalization to input audio stream. +

+

A description of the accepted options follows. +

+
+
threshold
+

Set the detection threshold used to trigger equalization. +Threshold detection is using detection filter. +Default value is 0. Allowed range is from 0 to 100. +

+
+
dfrequency
+

Set the detection frequency in Hz used for detection filter used to trigger equalization. +Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz. +

+
+
dqfactor
+

Set the detection resonance factor for detection filter used to trigger equalization. +Default value is 1. Allowed range is from 0.001 to 1000. +

+
+
tfrequency
+

Set the target frequency of equalization filter. +Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz. +

+
+
tqfactor
+

Set the target resonance factor for target equalization filter. +Default value is 1. Allowed range is from 0.001 to 1000. +

+
+
attack
+

Set the amount of milliseconds the signal from detection has to rise above +the detection threshold before equalization starts. +Default is 20. Allowed range is between 1 and 2000. +

+
+
release
+

Set the amount of milliseconds the signal from detection has to fall below the +detection threshold before equalization ends. +Default is 200. Allowed range is between 1 and 2000. +

+
+
ratio
+

Set the ratio by which the equalization gain is raised. +Default is 1. Allowed range is between 0 and 30. +

+
+
makeup
+

Set the makeup offset by which the equalization gain is raised. +Default is 0. Allowed range is between 0 and 100. +

+
+
range
+

Set the max allowed cut/boost amount. Default is 50. +Allowed range is from 1 to 200. +

+
+
mode
+

Set the mode of filter operation, can be one of the following: +

+
+
listen
+

Output only isolated detection signal. +

+
cut
+

Cut frequencies above detection threshold. +

+
boost
+

Boost frequencies bellow detection threshold. +

+
+

Default mode is ‘cut’. +

+
+
dftype
+

Set the type of detection filter, can be one of the following: +

+
+
bandpass
+
lowpass
+
highpass
+
peak
+
+

Default type is ‘bandpass’. +

+
+
tftype
+

Set the type of target filter, can be one of the following: +

+
+
bell
+
lowshelf
+
highshelf
+
+

Default type is ‘bell’. +

+
+
direction
+

Set processing direction relative to threshold. +

+
downward
+

Boost/Cut if threshold is higher/lower than detected volume. +

+
upward
+

Boost/Cut if threshold is lower/higher than detected volume. +

+
+

Default direction is ‘downward’. +

+
+
auto
+

Automatically gather threshold from detection filter. By default +is ‘disabled’. +This option is useful to detect threshold in certain time frame of +input audio stream, in such case option value is changed at runtime. +

+

Available values are: +

+
disabled
+

Disable using automatically gathered threshold value. +

+
off
+

Stop picking threshold value. +

+
on
+

Start picking threshold value. +

+
+ +
+
precision
+

Set which precision to use when processing samples. +

+
+
auto
+

Auto pick internal sample format depending on other filters. +

+
+
float
+

Always use single-floating point precision sample format. +

+
+
double
+

Always use double-floating point precision sample format. +

+
+
+
+ + +
+

29.15.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.16 adynamicsmooth

+ +

Apply dynamic smoothing to input audio stream. +

+

A description of the accepted options follows. +

+
+
sensitivity
+

Set an amount of sensitivity to frequency fluctations. Default is 2. +Allowed range is from 0 to 1e+06. +

+
+
basefreq
+

Set a base frequency for smoothing. Default value is 22050. +Allowed range is from 2 to 1e+06. +

+
+ + +
+

29.16.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.17 aecho

+ +

Apply echoing to the input audio. +

+

Echoes are reflected sound and can occur naturally amongst mountains +(and sometimes large buildings) when talking or shouting; digital echo +effects emulate this behaviour and are often used to help fill out the +sound of a single instrument or vocal. The time difference between the +original signal and the reflection is the delay, and the +loudness of the reflected signal is the decay. +Multiple echoes can have different delays and decays. +

+

A description of the accepted parameters follows. +

+
+
in_gain
+

Set input gain of reflected signal. Default is 0.6. +

+
+
out_gain
+

Set output gain of reflected signal. Default is 0.3. +

+
+
delays
+

Set list of time intervals in milliseconds between original signal and reflections +separated by ’|’. Allowed range for each delay is (0 - 90000.0]. +Default is 1000. +

+
+
decays
+

Set list of loudness of reflected signals separated by ’|’. +Allowed range for each decay is (0 - 1.0]. +Default is 0.5. +

+
+ + +
+

29.17.1 Examples

+ +
    +
  • Make it sound as if there are twice as many instruments as are actually playing: +
    +
    aecho=0.8:0.88:60:0.4
    +
    + +
  • If delay is very short, then it sounds like a (metallic) robot playing music: +
    +
    aecho=0.8:0.88:6:0.4
    +
    + +
  • A longer delay will sound like an open air concert in the mountains: +
    +
    aecho=0.8:0.9:1000:0.3
    +
    + +
  • Same as above but with one more mountain: +
    +
    aecho=0.8:0.9:1000|1800:0.3|0.25
    +
    +
+ +
+
+
+

29.18 aemphasis

+

Audio emphasis filter creates or restores material directly taken from LPs or +emphased CDs with different filter curves. E.g. to store music on vinyl the +signal has to be altered by a filter first to even out the disadvantages of +this recording medium. +Once the material is played back the inverse filter has to be applied to +restore the distortion of the frequency response. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. +

+
+
level_out
+

Set output gain. +

+
+
mode
+

Set filter mode. For restoring material use reproduction mode, otherwise +use production mode. Default is reproduction mode. +

+
+
type
+

Set filter type. Selects medium. Can be one of the following: +

+
+
col
+

select Columbia. +

+
emi
+

select EMI. +

+
bsi
+

select BSI (78RPM). +

+
riaa
+

select RIAA. +

+
cd
+

select Compact Disc (CD). +

+
50fm
+

select 50µs (FM). +

+
75fm
+

select 75µs (FM). +

+
50kf
+

select 50µs (FM-KF). +

+
75kf
+

select 75µs (FM-KF). +

+
+
+
+ + +
+

29.18.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.19 aeval

+ +

Modify an audio signal according to the specified expressions. +

+

This filter accepts one or more expressions (one for each channel), +which are evaluated and used to modify a corresponding audio signal. +

+

It accepts the following parameters: +

+
+
exprs
+

Set the ’|’-separated expressions list for each separate channel. If +the number of input channels is greater than the number of +expressions, the last specified expression is used for the remaining +output channels. +

+
+
channel_layout, c
+

Set output channel layout. If not specified, the channel layout is +specified by the number of expressions. If set to ‘same’, it will +use by default the same input channel layout. +

+
+ +

Each expression in exprs can contain the following constants and functions: +

+
+
ch
+

channel number of the current expression +

+
+
n
+

number of the evaluated sample, starting from 0 +

+
+
s
+

sample rate +

+
+
t
+

time of the evaluated sample expressed in seconds +

+
+
nb_in_channels
+
nb_out_channels
+

input and output number of channels +

+
+
val(CH)
+

the value of input channel with number CH +

+
+ +

Note: this filter is slow. For faster processing you should use a +dedicated filter. +

+ +
+

29.19.1 Examples

+ +
    +
  • Half volume: +
    +
    aeval=val(ch)/2:c=same
    +
    + +
  • Invert phase of the second channel: +
    +
    aeval=val(0)|-val(1)
    +
    +
+ +
+
+
+

29.20 aexciter

+ +

An exciter is used to produce high sound that is not present in the +original signal. This is done by creating harmonic distortions of the +signal which are restricted in range and added to the original signal. +An Exciter raises the upper end of an audio signal without simply raising +the higher frequencies like an equalizer would do to create a more +"crisp" or "brilliant" sound. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level prior processing of signal. +Allowed range is from 0 to 64. +Default value is 1. +

+
+
level_out
+

Set output level after processing of signal. +Allowed range is from 0 to 64. +Default value is 1. +

+
+
amount
+

Set the amount of harmonics added to original signal. +Allowed range is from 0 to 64. +Default value is 1. +

+
+
drive
+

Set the amount of newly created harmonics. +Allowed range is from 0.1 to 10. +Default value is 8.5. +

+
+
blend
+

Set the octave of newly created harmonics. +Allowed range is from -10 to 10. +Default value is 0. +

+
+
freq
+

Set the lower frequency limit of producing harmonics in Hz. +Allowed range is from 2000 to 12000 Hz. +Default is 7500 Hz. +

+
+
ceil
+

Set the upper frequency limit of producing harmonics. +Allowed range is from 9999 to 20000 Hz. +If value is lower than 10000 Hz no limit is applied. +

+
+
listen
+

Mute the original signal and output only added harmonics. +By default is disabled. +

+
+ + +
+

29.20.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.21 afade

+ +

Apply fade-in/out effect to input audio. +

+

A description of the accepted parameters follows. +

+
+
type, t
+

Specify the effect type, can be either in for fade-in, or +out for a fade-out effect. Default is in. +

+
+
start_sample, ss
+

Specify the number of the start sample for starting to apply the fade +effect. Default is 0. +

+
+
nb_samples, ns
+

Specify the number of samples for which the fade effect has to last. At +the end of the fade-in effect the output audio will have the same +volume as the input audio, at the end of the fade-out transition +the output audio will be silence. Default is 44100. +

+
+
start_time, st
+

Specify the start time of the fade effect. Default is 0. +The value must be specified as a time duration; see +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +If set this option is used instead of start_sample. +

+
+
duration, d
+

Specify the duration of the fade effect. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +At the end of the fade-in effect the output audio will have the same +volume as the input audio, at the end of the fade-out transition +the output audio will be silence. +By default the duration is determined by nb_samples. +If set this option is used instead of nb_samples. +

+
+
curve
+

Set curve for fade transition. +

+

It accepts the following values: +

+
tri
+

select triangular, linear slope (default) +

+
qsin
+

select quarter of sine wave +

+
hsin
+

select half of sine wave +

+
esin
+

select exponential sine wave +

+
log
+

select logarithmic +

+
ipar
+

select inverted parabola +

+
qua
+

select quadratic +

+
cub
+

select cubic +

+
squ
+

select square root +

+
cbr
+

select cubic root +

+
par
+

select parabola +

+
exp
+

select exponential +

+
iqsin
+

select inverted quarter of sine wave +

+
ihsin
+

select inverted half of sine wave +

+
dese
+

select double-exponential seat +

+
desi
+

select double-exponential sigmoid +

+
losi
+

select logistic sigmoid +

+
sinc
+

select sine cardinal function +

+
isinc
+

select inverted sine cardinal function +

+
nofade
+

no fade applied +

+
+ +
+
silence
+

Set the initial gain for fade-in or final gain for fade-out. +Default value is 0.0. +

+
+
unity
+

Set the initial gain for fade-out or final gain for fade-in. +Default value is 1.0. +

+
+ + +
+

29.21.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

29.21.2 Examples

+ +
    +
  • Fade in first 15 seconds of audio: +
    +
    afade=t=in:ss=0:d=15
    +
    + +
  • Fade out last 25 seconds of a 900 seconds audio: +
    +
    afade=t=out:st=875:d=25
    +
    +
+ +
+
+
+

29.22 afftdn

+

Denoise audio samples with FFT. +

+

A description of the accepted parameters follows. +

+
+
noise_reduction, nr
+

Set the noise reduction in dB, allowed range is 0.01 to 97. +Default value is 12 dB. +

+
+
noise_floor, nf
+

Set the noise floor in dB, allowed range is -80 to -20. +Default value is -50 dB. +

+
+
noise_type, nt
+

Set the noise type. +

+

It accepts the following values: +

+
white, w
+

Select white noise. +

+
+
vinyl, v
+

Select vinyl noise. +

+
+
shellac, s
+

Select shellac noise. +

+
+
custom, c
+

Select custom noise, defined in bn option. +

+

Default value is white noise. +

+
+ +
+
band_noise, bn
+

Set custom band noise profile for every one of 15 bands. +Bands are separated by ’ ’ or ’|’. +

+
+
residual_floor, rf
+

Set the residual floor in dB, allowed range is -80 to -20. +Default value is -38 dB. +

+
+
track_noise, tn
+

Enable noise floor tracking. By default is disabled. +With this enabled, noise floor is automatically adjusted. +

+
+
track_residual, tr
+

Enable residual tracking. By default is disabled. +

+
+
output_mode, om
+

Set the output mode. +

+

It accepts the following values: +

+
input, i
+

Pass input unchanged. +

+
+
output, o
+

Pass noise filtered out. +

+
+
noise, n
+

Pass only noise. +

+

Default value is output. +

+
+ +
+
adaptivity, ad
+

Set the adaptivity factor, used how fast to adapt gains adjustments per +each frequency bin. Value 0 enables instant adaptation, while higher values +react much slower. +Allowed range is from 0 to 1. Default value is 0.5. +

+
+
floor_offset, fo
+

Set the noise floor offset factor. This option is used to adjust offset applied to measured +noise floor. It is only effective when noise floor tracking is enabled. +Allowed range is from -2.0 to 2.0. Default value is 1.0. +

+
+
noise_link, nl
+

Set the noise link used for multichannel audio. +

+

It accepts the following values: +

+
none
+

Use unchanged channel’s noise floor. +

+
+
min
+

Use measured min noise floor of all channels. +

+
+
max
+

Use measured max noise floor of all channels. +

+
+
average
+

Use measured average noise floor of all channels. +

+

Default value is min. +

+
+ +
+
band_multiplier, bm
+

Set the band multiplier factor, used how much to spread bands across frequency bins. +Allowed range is from 0.2 to 5. Default value is 1.25. +

+
+
sample_noise, sn
+

Toggle capturing and measurement of noise profile from input audio. +

+

It accepts the following values: +

+
start, begin
+

Start sample noise capture. +

+
+
stop, end
+

Stop sample noise capture and measure new noise band profile. +

+

Default value is none. +

+
+ +
+
gain_smooth, gs
+

Set gain smooth spatial radius, used to smooth gains applied to each frequency bin. +Useful to reduce random music noise artefacts. +Higher values increases smoothing of gains. +Allowed range is from 0 to 50. +Default value is 0. +

+
+ + +
+

29.22.1 Commands

+ +

This filter supports the some above mentioned options as commands. +

+
+
+

29.22.2 Examples

+ +
    +
  • Reduce white noise by 10dB, and use previously measured noise floor of -40dB: +
    +
    afftdn=nr=10:nf=-40
    +
    + +
  • Reduce white noise by 10dB, also set initial noise floor to -80dB and enable automatic +tracking of noise floor so noise floor will gradually change during processing: +
    +
    afftdn=nr=10:nf=-80:tn=1
    +
    + +
  • Reduce noise by 20dB, using noise floor of -40dB and using commands to take noise profile +of first 0.4 seconds of input audio: +
    +
    asendcmd=0.0 afftdn sn start,asendcmd=0.4 afftdn sn stop,afftdn=nr=20:nf=-40
    +
    +
+ +
+
+
+

29.23 afftfilt

+

Apply arbitrary expressions to samples in frequency domain. +

+
+
real
+

Set frequency domain real expression for each separate channel separated +by ’|’. Default is "re". +If the number of input channels is greater than the number of +expressions, the last specified expression is used for the remaining +output channels. +

+
+
imag
+

Set frequency domain imaginary expression for each separate channel +separated by ’|’. Default is "im". +

+

Each expression in real and imag can contain the following +constants and functions: +

+
+
sr
+

sample rate +

+
+
b
+

current frequency bin number +

+
+
nb
+

number of available bins +

+
+
ch
+

channel number of the current expression +

+
+
chs
+

number of channels +

+
+
pts
+

current frame pts +

+
+
re
+

current real part of frequency bin of current channel +

+
+
im
+

current imaginary part of frequency bin of current channel +

+
+
real(b, ch)
+

Return the value of real part of frequency bin at location (bin,channel) +

+
+
imag(b, ch)
+

Return the value of imaginary part of frequency bin at location (bin,channel) +

+
+ +
+
win_size
+

Set window size. Allowed range is from 16 to 131072. +Default is 4096 +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann, hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hann. +

+
+
overlap
+

Set window overlap. If set to 1, the recommended overlap for selected +window function will be picked. Default is 0.75. +

+
+ + +
+

29.23.1 Examples

+ +
    +
  • Leave almost only low frequencies in audio: +
    +
    afftfilt="'real=re * (1-clip((b/nb)*b,0,1))':imag='im * (1-clip((b/nb)*b,0,1))'"
    +
    + +
  • Apply robotize effect: +
    +
    afftfilt="real='hypot(re,im)*sin(0)':imag='hypot(re,im)*cos(0)':win_size=512:overlap=0.75"
    +
    + +
  • Apply whisper effect: +
    +
    afftfilt="real='hypot(re,im)*cos((random(0)*2-1)*2*3.14)':imag='hypot(re,im)*sin((random(1)*2-1)*2*3.14)':win_size=128:overlap=0.8"
    +
    + +
  • Apply phase shift: +
    +
    afftfilt="real=re*cos(1)-im*sin(1):imag=re*sin(1)+im*cos(1)"
    +
    +
+ +
+
+
+

29.24 afir

+ +

Apply an arbitrary Finite Impulse Response filter. +

+

This filter is designed for applying long FIR filters, +up to 60 seconds long. +

+

It can be used as component for digital crossover filters, +room equalization, cross talk cancellation, wavefield synthesis, +auralization, ambiophonics, ambisonics and spatialization. +

+

This filter uses the streams higher than first one as FIR coefficients. +If the non-first stream holds a single channel, it will be used +for all input channels in the first stream, otherwise +the number of channels in the non-first stream must be same as +the number of channels in the first stream. +

+

It accepts the following parameters: +

+
+
dry
+

Set dry gain. This sets input gain. +

+
+
wet
+

Set wet gain. This sets final output gain. +

+
+
length
+

Set Impulse Response filter length. Default is 1, which means whole IR is processed. +

+
+
gtype
+

Enable applying gain measured from power of IR. +

+

Set which approach to use for auto gain measurement. +

+
+
none
+

Do not apply any gain. +

+
+
peak
+

select peak gain, very conservative approach. This is default value. +

+
+
dc
+

select DC gain, limited application. +

+
+
gn
+

select gain to noise approach, this is most popular one. +

+
+
ac
+

select AC gain. +

+
+
rms
+

select RMS gain. +

+
+ +
+
irgain
+

Set gain to be applied to IR coefficients before filtering. +Allowed range is 0 to 1. This gain is applied after any gain applied with gtype option. +

+
+
irfmt
+

Set format of IR stream. Can be mono or input. +Default is input. +

+
+
maxir
+

Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds. +Allowed range is 0.1 to 60 seconds. +

+
+
response
+

Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream. +By default it is disabled. +

+
+
channel
+

Set for which IR channel to display frequency response. By default is first channel +displayed. This option is used only when response is enabled. +

+
+
size
+

Set video stream size. This option is used only when response is enabled. +

+
+
rate
+

Set video stream frame rate. This option is used only when response is enabled. +

+
+
minp
+

Set minimal partition size used for convolution. Default is 8192. +Allowed range is from 1 to 65536. +Lower values decreases latency at cost of higher CPU usage. +

+
+
maxp
+

Set maximal partition size used for convolution. Default is 8192. +Allowed range is from 8 to 65536. +Lower values may increase CPU usage. +

+
+
nbirs
+

Set number of input impulse responses streams which will be switchable at runtime. +Allowed range is from 1 to 32. Default is 1. +

+
+
ir
+

Set IR stream which will be used for convolution, starting from 0, should always be +lower than supplied value by nbirs option. Default is 0. +This option can be changed at runtime via commands. +

+
+
precision
+

Set which precision to use when processing samples. +

+
+
auto
+

Auto pick internal sample format depending on other filters. +

+
+
float
+

Always use single-floating point precision sample format. +

+
+
double
+

Always use double-floating point precision sample format. +

+
+ +

Default value is auto. +

+
+
irload
+

Set when to load IR stream. Can be init or access. +First one load and prepares all IRs on initialization, second one +once on first access of specific IR. +Default is init. +

+
+ + +
+

29.24.1 Examples

+ +
    +
  • Apply reverb to stream using mono IR file as second input, complete command using ffmpeg: +
    +
    ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
    +
    + +
  • Apply true stereo processing given input stereo stream, and two stereo impulse responses for left and right channel, +the impulse response files are files with names l_ir.wav and r_ir.wav: +
    +
    "pan=4C|c0=FL|c1=FL|c2=FR|c3=FR[a];amovie=l_ir.wav[LIR];amovie=r_ir.wav[RIR];[LIR][RIR]amerge[ir];[a][ir]afir=irfmt=input:gtype=gn:irgain=-5dB,pan=stereo|FL<c0+c2|FR<c1+c3"
    +
    +
+ +
+
+
+

29.25 aformat

+ +

Set output format constraints for the input audio. The framework will +negotiate the most appropriate format to minimize conversions. +

+

It accepts the following parameters: +

+
sample_fmts, f
+

A ’|’-separated list of requested sample formats. +

+
+
sample_rates, r
+

A ’|’-separated list of requested sample rates. +

+
+
channel_layouts, cl
+

A ’|’-separated list of requested channel layouts. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+ +

If a parameter is omitted, all values are allowed. +

+

Force the output to either unsigned 8-bit or signed 16-bit stereo +

+
aformat=sample_fmts=u8|s16:channel_layouts=stereo
+
+ +
+
+

29.26 afreqshift

+

Apply frequency shift to input audio samples. +

+

The filter accepts the following options: +

+
+
shift
+

Specify frequency shift. Allowed range is -INT_MAX to INT_MAX. +Default value is 0.0. +

+
+
level
+

Set output gain applied to final output. Allowed range is from 0.0 to 1.0. +Default value is 1.0. +

+
+
order
+

Set filter order used for filtering. Allowed range is from 1 to 16. +Default value is 8. +

+
+ + +
+

29.26.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.27 afwtdn

+

Reduce broadband noise from input samples using Wavelets. +

+

A description of the accepted options follows. +

+
+
sigma
+

Set the noise sigma, allowed range is from 0 to 1. +Default value is 0. +This option controls strength of denoising applied to input samples. +Most useful way to set this option is via decibels, eg. -45dB. +

+
+
levels
+

Set the number of wavelet levels of decomposition. +Allowed range is from 1 to 12. +Default value is 10. +Setting this too low make denoising performance very poor. +

+
+
wavet
+

Set wavelet type for decomposition of input frame. +They are sorted by number of coefficients, from lowest to highest. +More coefficients means worse filtering speed, but overall better quality. +Available wavelets are: +

+
+
sym2
+
sym4
+
rbior68
+
deb10
+
sym10
+
coif5
+
bl3
+
+ +
+
percent
+

Set percent of full denoising. Allowed range is from 0 to 100 percent. +Default value is 85 percent or partial denoising. +

+
+
profile
+

If enabled, first input frame will be used as noise profile. +If first frame samples contain non-noise performance will be very poor. +

+
+
adaptive
+

If enabled, input frames are analyzed for presence of noise. +If noise is detected with high possibility then input frame profile will be +used for processing following frames, until new noise frame is detected. +

+
+
samples
+

Set size of single frame in number of samples. Allowed range is from 512 to +65536. Default frame size is 8192 samples. +

+
+
softness
+

Set softness applied inside thresholding function. Allowed range is from 0 to +10. Default softness is 1. +

+
+ + +
+

29.27.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.28 agate

+ +

A gate is mainly used to reduce lower parts of a signal. This kind of signal +processing reduces disturbing noise between useful signals. +

+

Gating is done by detecting the volume below a chosen level threshold +and dividing it by the factor set with ratio. The bottom of the noise +floor is set via range. Because an exact manipulation of the signal +would cause distortion of the waveform the reduction can be levelled over +time. This is done by setting attack and release. +

+

attack determines how long the signal has to fall below the threshold +before any reduction will occur and release sets the time the signal +has to rise above the threshold to reduce the reduction again. +Shorter signals than the chosen attack time will be left untouched. +

+
+
level_in
+

Set input level before filtering. +Default is 1. Allowed range is from 0.015625 to 64. +

+
+
mode
+

Set the mode of operation. Can be upward or downward. +Default is downward. If set to upward mode, higher parts of signal +will be amplified, expanding dynamic range in upward direction. +Otherwise, in case of downward lower parts of signal will be reduced. +

+
+
range
+

Set the level of gain reduction when the signal is below the threshold. +Default is 0.06125. Allowed range is from 0 to 1. +Setting this to 0 disables reduction and then filter behaves like expander. +

+
+
threshold
+

If a signal rises above this level the gain reduction is released. +Default is 0.125. Allowed range is from 0 to 1. +

+
+
ratio
+

Set a ratio by which the signal is reduced. +Default is 2. Allowed range is from 1 to 9000. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction stops. +Default is 20 milliseconds. Allowed range is from 0.01 to 9000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before the +reduction is increased again. Default is 250 milliseconds. +Allowed range is from 0.01 to 9000. +

+
+
makeup
+

Set amount of amplification of signal after processing. +Default is 1. Allowed range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.828427125. Allowed range is from 1 to 8. +

+
+
detection
+

Choose if exact signal should be taken for detection or an RMS like one. +Default is rms. Can be peak or rms. +

+
+
link
+

Choose if the average level between all channels or the louder channel affects +the reduction. +Default is average. Can be average or maximum. +

+
+ + +
+

29.28.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.29 aiir

+ +

Apply an arbitrary Infinite Impulse Response filter. +

+

It accepts the following parameters: +

+
+
zeros, z
+

Set B/numerator/zeros/reflection coefficients. +

+
+
poles, p
+

Set A/denominator/poles/ladder coefficients. +

+
+
gains, k
+

Set channels gains. +

+
+
dry_gain
+

Set input gain. +

+
+
wet_gain
+

Set output gain. +

+
+
format, f
+

Set coefficients format. +

+
+
ll
+

lattice-ladder function +

+
sf
+

analog transfer function +

+
tf
+

digital transfer function +

+
zp
+

Z-plane zeros/poles, cartesian (default) +

+
pr
+

Z-plane zeros/poles, polar radians +

+
pd
+

Z-plane zeros/poles, polar degrees +

+
sp
+

S-plane zeros/poles +

+
+ +
+
process, r
+

Set type of processing. +

+
+
d
+

direct processing +

+
s
+

serial processing +

+
p
+

parallel processing +

+
+ +
+
precision, e
+

Set filtering precision. +

+
+
dbl
+

double-precision floating-point (default) +

+
flt
+

single-precision floating-point +

+
i32
+

32-bit integers +

+
i16
+

16-bit integers +

+
+ +
+
normalize, n
+

Normalize filter coefficients, by default is enabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
mix
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
response
+

Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream. +By default it is disabled. +

+
+
channel
+

Set for which IR channel to display frequency response. By default is first channel +displayed. This option is used only when response is enabled. +

+
+
size
+

Set video stream size. This option is used only when response is enabled. +

+
+ +

Coefficients in tf and sf format are separated by spaces and are in ascending +order. +

+

Coefficients in zp format are separated by spaces and order of coefficients +doesn’t matter. Coefficients in zp format are complex numbers with i +imaginary unit. +

+

Different coefficients and gains can be provided for every channel, in such case +use ’|’ to separate coefficients or gains. Last provided coefficients will be +used for all remaining channels. +

+ +
+

29.29.1 Examples

+ +
    +
  • Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate: +
    +
    aiir=k=1:z=7.957584807809675810E-1 -2.575128568908332300 3.674839853930788710 -2.57512875289799137 7.957586296317130880E-1:p=1 -2.86950072432325953 3.63022088054647218 -2.28075678147272232 6.361362326477423500E-1:f=tf:r=d
    +
    + +
  • Same as above but in zp format: +
    +
    aiir=k=0.79575848078096756:z=0.80918701+0.58773007i 0.80918701-0.58773007i 0.80884700+0.58784055i 0.80884700-0.58784055i:p=0.63892345+0.59951235i 0.63892345-0.59951235i 0.79582691+0.44198673i 0.79582691-0.44198673i:f=zp:r=s
    +
    + +
  • Apply 3-rd order analog normalized Butterworth low-pass filter, using analog transfer function format: +
    +
    aiir=z=1.3057 0 0 0:p=1.3057 2.3892 2.1860 1:f=sf:r=d
    +
    +
+ +
+
+
+

29.30 alimiter

+ +

The limiter prevents an input signal from rising over a desired threshold. +This limiter uses lookahead technology to prevent your signal from distorting. +It means that there is a small delay after the signal is processed. Keep in mind +that the delay it produces is the attack time you set. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. Default is 1. +

+
+
level_out
+

Set output gain. Default is 1. +

+
+
limit
+

Don’t let signals above this level pass the limiter. Default is 1. +

+
+
attack
+

The limiter will reach its attenuation level in this amount of time in +milliseconds. Default is 5 milliseconds. +

+
+
release
+

Come back from limiting to attenuation 1.0 in this amount of milliseconds. +Default is 50 milliseconds. +

+
+
asc
+

When gain reduction is always needed ASC takes care of releasing to an +average reduction level rather than reaching a reduction of 0 in the release +time. +

+
+
asc_level
+

Select how much the release time is affected by ASC, 0 means nearly no changes +in release time while 1 produces higher release times. +

+
+
level
+

Auto level output signal. Default is enabled. +This normalizes audio back to 0dB if enabled. +

+
+
latency
+

Compensate the delay introduced by using the lookahead buffer set with attack +parameter. Also flush the valid audio data in the lookahead buffer when the +stream hits EOF. +

+
+ +

Depending on picked setting it is recommended to upsample input 2x or 4x times +with aresample before applying this filter. +

+
+
+

29.31 allpass

+ +

Apply a two-pole all-pass filter with central frequency (in Hz) +frequency, and filter-width width. +An all-pass filter changes the audio’s frequency to phase relationship +without changing its frequency to amplitude relationship. +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set frequency in Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
order, o
+

Set the filter order, can be 1 or 2. Default is 2. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+
+
+ + +
+

29.31.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change allpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change allpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change allpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change allpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

29.32 aloop

+ +

Loop audio samples. +

+

The filter accepts the following options: +

+
+
loop
+

Set the number of loops. Setting this value to -1 will result in infinite loops. +Default is 0. +

+
+
size
+

Set maximal number of samples. Default is 0. +

+
+
start
+

Set first sample of loop. Default is 0. +

+
+
time
+

Set the time of loop start in seconds. +Only used if option named start is set to -1. +

+
+ +
+
+

29.33 amerge

+ +

Merge two or more audio streams into a single multi-channel stream. +

+

The filter accepts the following options: +

+
+
inputs
+

Set the number of inputs. Default is 2. +

+
+
+ +

If the channel layouts of the inputs are disjoint, and therefore compatible, +the channel layout of the output will be set accordingly and the channels +will be reordered as necessary. If the channel layouts of the inputs are not +disjoint, the output will have all the channels of the first input then all +the channels of the second input, in that order, and the channel layout of +the output will be the default value corresponding to the total number of +channels. +

+

For example, if the first input is in 2.1 (FL+FR+LF) and the second input +is FC+BL+BR, then the output will be in 5.1, with the channels in the +following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the +first input, b1 is the first channel of the second input). +

+

On the other hand, if both input are in stereo, the output channels will be +in the default order: a1, a2, b1, b2, and the channel layout will be +arbitrarily set to 4.0, which may or may not be the expected value. +

+

All inputs must have the same sample rate, and format. +

+

If inputs do not have the same duration, the output will stop with the +shortest. +

+ +
+

29.33.1 Examples

+ +
    +
  • Merge two mono files into a stereo stream: +
    +
    amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
    +
    + +
  • Multiple merges assuming 1 video stream and 6 audio streams in input.mkv: +
    +
    ffmpeg -i input.mkv -filter_complex "[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6" -c:a pcm_s16le output.mkv
    +
    +
+ +
+
+
+

29.34 amix

+ +

Mixes multiple audio inputs into a single output. +

+

Note that this filter only supports float samples (the amerge +and pan audio filters support many formats). If the amix +input has integer samples then aresample will be automatically +inserted to perform the conversion to float samples. +

+

It accepts the following parameters: +

+
inputs
+

The number of inputs. If unspecified, it defaults to 2. +

+
+
duration
+

How to determine the end-of-stream. +

+
longest
+

The duration of the longest input. (default) +

+
+
shortest
+

The duration of the shortest input. +

+
+
first
+

The duration of the first input. +

+
+
+ +
+
dropout_transition
+

The transition time, in seconds, for volume renormalization when an input +stream ends. The default value is 2 seconds. +

+
+
weights
+

Specify weight of each input audio stream as a sequence of numbers separated +by a space. If fewer weights are specified compared to number of inputs, the +last weight is assigned to the remaining inputs. +Default weight for each input is 1. +

+
+
normalize
+

Always scale inputs instead of only doing summation of samples. +Beware of heavy clipping if inputs are not normalized prior or after filtering +by this filter if this option is disabled. By default is enabled. +

+
+ + +
+

29.34.1 Examples

+ +
    +
  • This will mix 3 input audio streams to a single output with the same duration as the +first input and a dropout transition time of 3 seconds: +
    +
    ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
    +
    + +
  • This will mix one vocal and one music input audio stream to a single output with the same duration as the +longest input. The music will have quarter the weight as the vocals, and the inputs are not normalized: +
    +
    ffmpeg -i VOCALS -i MUSIC -filter_complex amix=inputs=2:duration=longest:dropout_transition=0:weights="1 0.25":normalize=0 OUTPUT
    +
    + +
+ +
+
+

29.34.2 Commands

+ +

This filter supports the following commands: +

+
weights
+
normalize
+

Syntax is same as option with same name. +

+
+ +
+
+
+

29.35 amultiply

+ +

Multiply first audio stream with second audio stream and store result +in output audio stream. Multiplication is done by multiplying each +sample from first stream with sample at same position from second stream. +

+

With this element-wise multiplication one can create amplitude fades and +amplitude modulations. +

+
+
+

29.36 anequalizer

+ +

High-order parametric multiband equalizer for each channel. +

+

It accepts the following parameters: +

+
params
+
+

This option string is in format: +"cchn f=cf w=w g=g t=f | ..." +Each equalizer band is separated by ’|’. +

+
+
chn
+

Set channel number to which equalization will be applied. +If input doesn’t have that channel the entry is ignored. +

+
+
f
+

Set central frequency for band. +If input doesn’t have that frequency the entry is ignored. +

+
+
w
+

Set band width in Hertz. +

+
+
g
+

Set band gain in dB. +

+
+
t
+

Set filter type for band, optional, can be: +

+
+
0
+

Butterworth, this is default. +

+
+
1
+

Chebyshev type 1. +

+
+
2
+

Chebyshev type 2. +

+
+
+
+ +
+
curves
+

With this option activated frequency response of anequalizer is displayed +in video stream. +

+
+
size
+

Set video stream size. Only useful if curves option is activated. +

+
+
mgain
+

Set max gain that will be displayed. Only useful if curves option is activated. +Setting this to a reasonable value makes it possible to display gain which is derived from +neighbour bands which are too close to each other and thus produce higher gain +when both are activated. +

+
+
fscale
+

Set frequency scale used to draw frequency response in video output. +Can be linear or logarithmic. Default is logarithmic. +

+
+
colors
+

Set color for each channel curve which is going to be displayed in video stream. +This is list of color names separated by space or by ’|’. +Unrecognised or missing colors will be replaced by white color. +

+
+ + +
+

29.36.1 Examples

+ +
    +
  • Lower gain by 10 of central frequency 200Hz and width 100 Hz +for first 2 channels using Chebyshev type 1 filter: +
    +
    anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
    +
    +
+ +
+
+

29.36.2 Commands

+ +

This filter supports the following commands: +

+
change
+

Alter existing filter parameters. +Syntax for the commands is : "fN|f=freq|w=width|g=gain" +

+

fN is existing filter number, starting from 0, if no such filter is available +error is returned. +freq set new frequency parameter. +width set new width parameter in Hertz. +gain set new gain parameter in dB. +

+

Full filter invocation with asendcmd may look like this: +asendcmd=c=’4.0 anequalizer change 0|f=200|w=50|g=1’,anequalizer=... +

+
+ +
+
+
+

29.37 anlmdn

+ +

Reduce broadband noise in audio samples using Non-Local Means algorithm. +

+

Each sample is adjusted by looking for other samples with similar contexts. This +context similarity is defined by comparing their surrounding patches of size +p. Patches are searched in an area of r around the sample. +

+

The filter accepts the following options: +

+
+
strength, s
+

Set denoising strength. Allowed range is from 0.00001 to 10000. Default value is 0.00001. +

+
+
patch, p
+

Set patch radius duration. Allowed range is from 1 to 100 milliseconds. +Default value is 2 milliseconds. +

+
+
research, r
+

Set research radius duration. Allowed range is from 2 to 300 milliseconds. +Default value is 6 milliseconds. +

+
+
output, o
+

Set the output mode. +

+

It accepts the following values: +

+
i
+

Pass input unchanged. +

+
+
o
+

Pass noise filtered out. +

+
+
n
+

Pass only noise. +

+

Default value is o. +

+
+ +
+
smooth, m
+

Set smooth factor. Default value is 11. Allowed range is from 1 to 1000. +

+
+ + +
+

29.37.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.38 anlmf, anlms

+

Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first audio stream using the second audio stream. +

+

This adaptive filter is used to mimic a desired filter by finding the filter coefficients that +relate to producing the least mean square of the error signal (difference between the desired, +2nd input audio stream and the actual signal, the 1st input audio stream). +

+

A description of the accepted options follows. +

+
+
order
+

Set filter order. +

+
+
mu
+

Set filter mu. +

+
+
eps
+

Set the filter eps. +

+
+
leakage
+

Set the filter leakage. +

+
+
out_mode
+

It accepts the following values: +

+
i
+

Pass the 1st input. +

+
+
d
+

Pass the 2nd input. +

+
+
o
+

Pass difference between desired, 2nd input and error signal estimate. +

+
+
n
+

Pass difference between input, 1st input and error signal estimate. +

+
+
e
+

Pass error signal estimated samples. +

+

Default value is o. +

+
+
+
+ + +
+

29.38.1 Examples

+ +
    +
  • One of many usages of this filter is noise reduction, input audio is filtered +with same samples that are delayed by fixed amount, one such example for stereo audio is: +
    +
    asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
    +
    +
+ +
+
+

29.38.2 Commands

+ +

This filter supports the same commands as options, excluding option order. +

+
+
+
+

29.39 anull

+ +

Pass the audio source unchanged to the output. +

+
+
+

29.40 apad

+ +

Pad the end of an audio stream with silence. +

+

This can be used together with ffmpeg -shortest to +extend audio streams to the same length as the video stream. +

+

A description of the accepted options follows. +

+
+
packet_size
+

Set silence packet size. Default value is 4096. +

+
+
pad_len
+

Set the number of samples of silence to add to the end. After the +value is reached, the stream is terminated. This option is mutually +exclusive with whole_len. +

+
+
whole_len
+

Set the minimum total number of samples in the output audio stream. If +the value is longer than the input audio length, silence is added to +the end, until the value is reached. This option is mutually exclusive +with pad_len. +

+
+
pad_dur
+

Specify the duration of samples of silence to add. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. Used only if set to non-negative value. +

+
+
whole_dur
+

Specify the minimum total duration in the output audio stream. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. Used only if set to non-negative value. If the value is longer than +the input audio length, silence is added to the end, until the value is reached. +This option is mutually exclusive with pad_dur +

+
+ +

If neither the pad_len nor the whole_len nor pad_dur +nor whole_dur option is set, the filter will add silence to the end of +the input stream indefinitely. +

+

Note that for ffmpeg 4.4 and earlier a zero pad_dur or +whole_dur also caused the filter to add silence indefinitely. +

+ +
+

29.40.1 Examples

+ +
    +
  • Add 1024 samples of silence to the end of the input: +
    +
    apad=pad_len=1024
    +
    + +
  • Make sure the audio output will contain at least 10000 samples, pad +the input with silence if required: +
    +
    apad=whole_len=10000
    +
    + +
  • Use ffmpeg to pad the audio input with silence, so that the +video stream will always result the shortest and will be converted +until the end in the output file when using the shortest +option: +
    +
    ffmpeg -i VIDEO -i AUDIO -filter_complex "[1:0]apad" -shortest OUTPUT
    +
    +
+ +
+
+
+

29.41 aphaser

+

Add a phasing effect to the input audio. +

+

A phaser filter creates series of peaks and troughs in the frequency spectrum. +The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect. +

+

A description of the accepted parameters follows. +

+
+
in_gain
+

Set input gain. Default is 0.4. +

+
+
out_gain
+

Set output gain. Default is 0.74 +

+
+
delay
+

Set delay in milliseconds. Default is 3.0. +

+
+
decay
+

Set decay. Default is 0.4. +

+
+
speed
+

Set modulation speed in Hz. Default is 0.5. +

+
+
type
+

Set modulation type. Default is triangular. +

+

It accepts the following values: +

+
triangular, t
+
sinusoidal, s
+
+
+
+ +
+
+

29.42 aphaseshift

+

Apply phase shift to input audio samples. +

+

The filter accepts the following options: +

+
+
shift
+

Specify phase shift. Allowed range is from -1.0 to 1.0. +Default value is 0.0. +

+
+
level
+

Set output gain applied to final output. Allowed range is from 0.0 to 1.0. +Default value is 1.0. +

+
+
order
+

Set filter order used for filtering. Allowed range is from 1 to 16. +Default value is 8. +

+
+ + +
+

29.42.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.43 apsyclip

+

Apply Psychoacoustic clipper to input audio stream. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
level_out
+

Set output gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
clip
+

Set the clipping start value. Default value is 0dBFS or 1. +

+
+
diff
+

Output only difference samples, useful to hear introduced distortions. +By default is disabled. +

+
+
adaptive
+

Set strength of adaptive distortion applied. Default value is 0.5. +Allowed range is from 0 to 1. +

+
+
iterations
+

Set number of iterations of psychoacoustic clipper. +Allowed range is from 1 to 20. Default value is 10. +

+
+
level
+

Auto level output signal. Default is disabled. +This normalizes audio back to 0dBFS if enabled. +

+
+ + +
+

29.43.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.44 apulsator

+ +

Audio pulsator is something between an autopanner and a tremolo. +But it can produce funny stereo effects as well. Pulsator changes the volume +of the left and right channel based on a LFO (low frequency oscillator) with +different waveforms and shifted phases. +This filter have the ability to define an offset between left and right +channel. An offset of 0 means that both LFO shapes match each other. +The left and right channel are altered equally - a conventional tremolo. +An offset of 50% means that the shape of the right channel is exactly shifted +in phase (or moved backwards about half of the frequency) - pulsator acts as +an autopanner. At 1 both curves match again. Every setting in between moves the +phase shift gapless between all stages and produces some "bypassing" sounds with +sine and triangle waveforms. The more you set the offset near 1 (starting from +the 0.5) the faster the signal passes from the left to the right speaker. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
level_out
+

Set output gain. By default it is 1. Range is [0.015625 - 64]. +

+
+
mode
+

Set waveform shape the LFO will use. Can be one of: sine, triangle, square, +sawup or sawdown. Default is sine. +

+
+
amount
+

Set modulation. Define how much of original signal is affected by the LFO. +

+
+
offset_l
+

Set left channel offset. Default is 0. Allowed range is [0 - 1]. +

+
+
offset_r
+

Set right channel offset. Default is 0.5. Allowed range is [0 - 1]. +

+
+
width
+

Set pulse width. Default is 1. Allowed range is [0 - 2]. +

+
+
timing
+

Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz. +

+
+
bpm
+

Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing +is set to bpm. +

+
+
ms
+

Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing +is set to ms. +

+
+
hz
+

Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used +if timing is set to hz. +

+
+ +
+
+

29.45 aresample

+ +

Resample the input audio to the specified parameters, using the +libswresample library. If none are specified then the filter will +automatically convert between its input and output. +

+

This filter is also able to stretch/squeeze the audio data to make it match +the timestamps or to inject silence / cut out audio to make it match the +timestamps, do a combination of both or do neither. +

+

The filter accepts the syntax +[sample_rate:]resampler_options, where sample_rate +expresses a sample rate and resampler_options is a list of +key=value pairs, separated by ":". See the +(ffmpeg-resampler)"Resampler Options" section in the +ffmpeg-resampler(1) manual +for the complete list of supported options. +

+ +
+

29.45.1 Examples

+ +
    +
  • Resample the input audio to 44100Hz: +
    +
    aresample=44100
    +
    + +
  • Stretch/squeeze samples to the given timestamps, with a maximum of 1000 +samples per second compensation: +
    +
    aresample=async=1000
    +
    +
+ +
+
+
+

29.46 areverse

+ +

Reverse an audio clip. +

+

Warning: This filter requires memory to buffer the entire clip, so trimming +is suggested. +

+ +
+

29.46.1 Examples

+ +
    +
  • Take the first 5 seconds of a clip, and reverse it. +
    +
    atrim=end=5,areverse
    +
    +
+ +
+
+
+

29.47 arls

+

Apply Recursive Least Squares algorithm to the first audio stream using the second audio stream. +

+

This adaptive filter is used to mimic a desired filter by recursively finding the filter coefficients that +relate to producing the minimal weighted linear least squares cost function of the error signal (difference +between the desired, 2nd input audio stream and the actual signal, the 1st input audio stream). +

+

A description of the accepted options follows. +

+
+
order
+

Set the filter order. +

+
+
lambda
+

Set the forgetting factor. +

+
+
delta
+

Set the coefficient to initialize internal covariance matrix. +

+
+
out_mode
+

Set the filter output samples. It accepts the following values: +

+
i
+

Pass the 1st input. +

+
+
d
+

Pass the 2nd input. +

+
+
o
+

Pass difference between desired, 2nd input and error signal estimate. +

+
+
n
+

Pass difference between input, 1st input and error signal estimate. +

+
+
e
+

Pass error signal estimated samples. +

+

Default value is o. +

+
+
+
+ +
+
+

29.48 arnndn

+ +

Reduce noise from speech using Recurrent Neural Networks. +

+

This filter accepts the following options: +

+
+
model, m
+

Set train model file to load. This option is always required. +

+
+
mix
+

Set how much to mix filtered samples into final output. +Allowed range is from -1 to 1. Default value is 1. +Negative values are special, they set how much to keep filtered noise +in the final filter output. Set this option to -1 to hear actual +noise removed from input signal. +

+
+ + +
+

29.48.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.49 asdr

+

Measure Audio Signal-to-Distortion Ratio. +

+

This filter takes two audio streams for input, and outputs first +audio stream. +Results are in dB per channel at end of either input. +

+
+
+

29.50 asetnsamples

+ +

Set the number of samples per each output audio frame. +

+

The last output packet may contain a different number of samples, as +the filter will flush all the remaining samples when the input audio +signals its end. +

+

The filter accepts the following options: +

+
+
nb_out_samples, n
+

Set the number of frames per each output audio frame. The number is +intended as the number of samples per each channel. +Default value is 1024. +

+
+
pad, p
+

If set to 1, the filter will pad the last audio frame with zeroes, so +that the last frame will contain the same number of samples as the +previous ones. Default value is 1. +

+
+ +

For example, to set the number of per-frame samples to 1234 and +disable padding for the last frame, use: +

+
asetnsamples=n=1234:p=0
+
+ +
+
+

29.51 asetrate

+ +

Set the sample rate without altering the PCM data. +This will result in a change of speed and pitch. +

+

The filter accepts the following options: +

+
+
sample_rate, r
+

Set the output sample rate. Default is 44100 Hz. +

+
+ +
+
+

29.52 ashowinfo

+ +

Show a line containing various information for each input audio frame. +The input audio is not modified. +

+

The shown line contains a sequence of key/value pairs of the form +key:value. +

+

The following values are shown in the output: +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +

+
+
pts
+

The presentation timestamp of the input frame, in time base units; the time base +depends on the filter input pad, and is usually 1/sample_rate. +

+
+
pts_time
+

The presentation timestamp of the input frame in seconds. +

+
+
fmt
+

The sample format. +

+
+
chlayout
+

The channel layout. +

+
+
rate
+

The sample rate for the audio frame. +

+
+
nb_samples
+

The number of samples (per channel) in the frame. +

+
+
checksum
+

The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar +audio, the data is treated as if all the planes were concatenated. +

+
+
plane_checksums
+

A list of Adler-32 checksums for each data plane. +

+
+ +
+
+

29.53 asoftclip

+

Apply audio soft clipping. +

+

Soft clipping is a type of distortion effect where the amplitude of a signal is saturated +along a smooth curve, rather than the abrupt shape of hard-clipping. +

+

This filter accepts the following options: +

+
+
type
+

Set type of soft-clipping. +

+

It accepts the following values: +

+
hard
+
tanh
+
atan
+
cubic
+
exp
+
alg
+
quintic
+
sin
+
erf
+
+ +
+
threshold
+

Set threshold from where to start clipping. Default value is 0dB or 1. +

+
+
output
+

Set gain applied to output. Default value is 0dB or 1. +

+
+
param
+

Set additional parameter which controls sigmoid function. +

+
+
oversample
+

Set oversampling factor. +

+
+ + +
+

29.53.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.54 aspectralstats

+ +

Display frequency domain statistical information about the audio channels. +Statistics are calculated and stored as metadata for each audio channel and for each audio frame. +

+

It accepts the following option: +

+
win_size
+

Set the window length in samples. Default value is 2048. +Allowed range is from 32 to 65536. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann, hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hann. +

+
+
overlap
+

Set window overlap. Allowed range is from 0 +to 1. Default value is 0.5. +

+
+
measure
+

Select the parameters which are measured. The metadata keys can +be used as flags, default is all which measures everything. +none disables all measurement. +

+
+ +

A list of each metadata key follows: +

+
+
mean
+
variance
+
centroid
+
spread
+
skewness
+
kurtosis
+
entropy
+
flatness
+
crest
+
flux
+
slope
+
decrease
+
rolloff
+
+ +
+
+

29.55 asr

+

Automatic Speech Recognition +

+

This filter uses PocketSphinx for speech recognition. To enable +compilation of this filter, you need to configure FFmpeg with +--enable-pocketsphinx. +

+

It accepts the following options: +

+
+
rate
+

Set sampling rate of input audio. Defaults is 16000. +This need to match speech models, otherwise one will get poor results. +

+
+
hmm
+

Set dictionary containing acoustic model files. +

+
+
dict
+

Set pronunciation dictionary. +

+
+
lm
+

Set language model file. +

+
+
lmctl
+

Set language model set. +

+
+
lmname
+

Set which language model to use. +

+
+
logfn
+

Set output for log messages. +

+
+ +

The filter exports recognized speech as the frame metadata lavfi.asr.text. +

+
+
+

29.56 astats

+ +

Display time domain statistical information about the audio channels. +Statistics are calculated and displayed for each audio channel and, +where applicable, an overall figure is also given. +

+

It accepts the following option: +

+
length
+

Short window length in seconds, used for peak and trough RMS measurement. +Default is 0.05 (50 milliseconds). Allowed range is [0 - 10]. +

+
+
metadata
+
+

Set metadata injection. All the metadata keys are prefixed with lavfi.astats.X, +where X is channel number starting from 1 or string Overall. Default is +disabled. +

+

Available keys for each channel are: +Bit_depth +Crest_factor +DC_offset +Dynamic_range +Entropy +Flat_factor +Max_difference +Max_level +Mean_difference +Min_difference +Min_level +Noise_floor +Noise_floor_count +Number_of_Infs +Number_of_NaNs +Number_of_denormals +Peak_count +Peak_level +RMS_difference +RMS_peak +RMS_trough +Zero_crossings +Zero_crossings_rate +

+

and for Overall: +Bit_depth +DC_offset +Entropy +Flat_factor +Max_difference +Max_level +Mean_difference +Min_difference +Min_level +Noise_floor +Noise_floor_count +Number_of_Infs +Number_of_NaNs +Number_of_denormals +Number_of_samples +Peak_count +Peak_level +RMS_difference +RMS_level +RMS_peak +RMS_trough +

+

For example, a full key looks like lavfi.astats.1.DC_offset or +lavfi.astats.Overall.Peak_count. +

+

Read below for the description of the keys. +

+
+
reset
+

Set the number of frames over which cumulative stats are calculated before +being reset. Default is disabled. +

+
+
measure_perchannel
+

Select the parameters which are measured per channel. The metadata keys can +be used as flags, default is all which measures everything. +none disables all per channel measurement. +

+
+
measure_overall
+

Select the parameters which are measured overall. The metadata keys can +be used as flags, default is all which measures everything. +none disables all overall measurement. +

+
+
+ +

A description of the measure keys follow: +

+
+
none
+

no measures +

+
+
all
+

all measures +

+
+
Bit_depth
+

overall bit depth of audio, i.e. number of bits used for each sample +

+
+
Crest_factor
+

standard ratio of peak to RMS level (note: not in dB) +

+
+
DC_offset
+

mean amplitude displacement from zero +

+
+
Dynamic_range
+

measured dynamic range of audio in dB +

+
+
Entropy
+

entropy measured across whole audio, entropy of value near 1.0 is typically measured for white noise +

+
+
Flat_factor
+

flatness (i.e. consecutive samples with the same value) of the signal at its peak levels +(i.e. either Min_level or Max_level) +

+
+
Max_difference
+

maximal difference between two consecutive samples +

+
+
Max_level
+

maximal sample level +

+
+
Mean_difference
+

mean difference between two consecutive samples, i.e. the average of each difference between two consecutive samples +

+
+
Min_difference
+

minimal difference between two consecutive samples +

+
+
Min_level
+

minimal sample level +

+
+
Noise_floor
+

minimum local peak measured in dBFS over a short window +

+
+
Noise_floor_count
+

number of occasions (not the number of samples) that the signal attained +Noise floor +

+
+
Number_of_Infs
+

number of samples with an infinite value +

+
+
Number_of_NaNs
+

number of samples with a NaN (not a number) value +

+
+
Number_of_denormals
+

number of samples with a subnormal value +

+
+
Number_of_samples
+

number of samples +

+
+
Peak_count
+

number of occasions (not the number of samples) that the signal attained either +Min_level or Max_level +

+
+
Peak_level
+

standard peak level measured in dBFS +

+
+
RMS_difference
+

Root Mean Square difference between two consecutive samples +

+
+
RMS_level
+

standard RMS level measured in dBFS +

+
+
RMS_peak
+
RMS_trough
+

peak and trough values for RMS level measured over a short window, +measured in dBFS. +

+
+
Zero crossings
+

number of points where the waveform crosses the zero level axis +

+
+
Zero crossings rate
+

rate of Zero crossings and number of audio samples +

+
+ +
+
+

29.57 asubboost

+

Boost subwoofer frequencies. +

+

The filter accepts the following options: +

+
+
dry
+

Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1. +Default value is 1.0. +

+
+
wet
+

Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1. +Default value is 1.0. +

+
+
boost
+

Set max boost factor. Allowed range is from 1 to 12. Default value is 2. +

+
+
decay
+

Set delay line decay gain value. Allowed range is from 0 to 1. +Default value is 0.0. +

+
+
feedback
+

Set delay line feedback gain value. Allowed range is from 0 to 1. +Default value is 0.9. +

+
+
cutoff
+

Set cutoff frequency in Hertz. Allowed range is 50 to 900. +Default value is 100. +

+
+
slope
+

Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1. +Default value is 0.5. +

+
+
delay
+

Set delay. Allowed range is from 1 to 100. +Default value is 20. +

+
+
channels
+

Set the channels to process. Default value is all available. +

+
+ + +
+

29.57.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.58 asubcut

+

Cut subwoofer frequencies. +

+

This filter allows to set custom, steeper +roll off than highpass filter, and thus is able to more attenuate +frequency content in stop-band. +

+

The filter accepts the following options: +

+
+
cutoff
+

Set cutoff frequency in Hertz. Allowed range is 2 to 200. +Default value is 20. +

+
+
order
+

Set filter order. Available values are from 3 to 20. +Default value is 10. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 1. Default value is 1. +

+
+ + +
+

29.58.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.59 asupercut

+

Cut super frequencies. +

+

The filter accepts the following options: +

+
+
cutoff
+

Set cutoff frequency in Hertz. Allowed range is 20000 to 192000. +Default value is 20000. +

+
+
order
+

Set filter order. Available values are from 3 to 20. +Default value is 10. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 1. Default value is 1. +

+
+ + +
+

29.59.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.60 asuperpass

+

Apply high order Butterworth band-pass filter. +

+

The filter accepts the following options: +

+
+
centerf
+

Set center frequency in Hertz. Allowed range is 2 to 999999. +Default value is 1000. +

+
+
order
+

Set filter order. Available values are from 4 to 20. +Default value is 4. +

+
+
qfactor
+

Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 2. Default value is 1. +

+
+ + +
+

29.60.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.61 asuperstop

+

Apply high order Butterworth band-stop filter. +

+

The filter accepts the following options: +

+
+
centerf
+

Set center frequency in Hertz. Allowed range is 2 to 999999. +Default value is 1000. +

+
+
order
+

Set filter order. Available values are from 4 to 20. +Default value is 4. +

+
+
qfactor
+

Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1. +

+
+
level
+

Set input gain level. Allowed range is from 0 to 2. Default value is 1. +

+
+ + +
+

29.61.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.62 atempo

+ +

Adjust audio tempo. +

+

The filter accepts exactly one parameter, the audio tempo. If not +specified then the filter will assume nominal 1.0 tempo. Tempo must +be in the [0.5, 100.0] range. +

+

Note that tempo greater than 2 will skip some samples rather than +blend them in. If for any reason this is a concern it is always +possible to daisy-chain several instances of atempo to achieve the +desired product tempo. +

+ +
+

29.62.1 Examples

+ +
    +
  • Slow down audio to 80% tempo: +
    +
    atempo=0.8
    +
    + +
  • To speed up audio to 300% tempo: +
    +
    atempo=3
    +
    + +
  • To speed up audio to 300% tempo by daisy-chaining two atempo instances: +
    +
    atempo=sqrt(3),atempo=sqrt(3)
    +
    +
+ +
+
+

29.62.2 Commands

+ +

This filter supports the following commands: +

+
tempo
+

Change filter tempo scale factor. +Syntax for the command is : "tempo" +

+
+ +
+
+
+

29.63 atilt

+

Apply spectral tilt filter to audio stream. +

+

This filter apply any spectral roll-off slope over any specified frequency band. +

+

The filter accepts the following options: +

+
+
freq
+

Set central frequency of tilt in Hz. Default is 10000 Hz. +

+
+
slope
+

Set slope direction of tilt. Default is 0. Allowed range is from -1 to 1. +

+
+
width
+

Set width of tilt. Default is 1000. Allowed range is from 100 to 10000. +

+
+
order
+

Set order of tilt filter. +

+
+
level
+

Set input volume level. Allowed range is from 0 to 4. +Defalt is 1. +

+
+ + +
+

29.63.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.64 atrim

+ +

Trim the input so that the output contains one continuous subpart of the input. +

+

It accepts the following parameters: +

+
start
+

Timestamp (in seconds) of the start of the section to keep. I.e. the audio +sample with the timestamp start will be the first sample in the output. +

+
+
end
+

Specify time of the first audio sample that will be dropped, i.e. the +audio sample immediately preceding the one with the timestamp end will be +the last sample in the output. +

+
+
start_pts
+

Same as start, except this option sets the start timestamp in samples +instead of seconds. +

+
+
end_pts
+

Same as end, except this option sets the end timestamp in samples instead +of seconds. +

+
+
duration
+

The maximum duration of the output in seconds. +

+
+
start_sample
+

The number of the first sample that should be output. +

+
+
end_sample
+

The number of the first sample that should be dropped. +

+
+ +

start, end, and duration are expressed as time +duration specifications; see +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual. +

+

Note that the first two sets of the start/end options and the duration +option look at the frame timestamp, while the _sample options simply count the +samples that pass through the filter. So start/end_pts and start/end_sample will +give different results when the timestamps are wrong, inexact or do not start at +zero. Also note that this filter does not modify the timestamps. If you wish +to have the output timestamps start at zero, insert the asetpts filter after the +atrim filter. +

+

If multiple start or end options are set, this filter tries to be greedy and +keep all samples that match at least one of the specified constraints. To keep +only the part that matches all the constraints at once, chain multiple atrim +filters. +

+

The defaults are such that all the input is kept. So it is possible to set e.g. +just the end values to keep everything before the specified time. +

+

Examples: +

    +
  • Drop everything except the second minute of input: +
    +
    ffmpeg -i INPUT -af atrim=60:120
    +
    + +
  • Keep only the first 1000 samples: +
    +
    ffmpeg -i INPUT -af atrim=end_sample=1000
    +
    + +
+ +
+
+

29.65 axcorrelate

+

Calculate normalized windowed cross-correlation between two input audio streams. +

+

Resulted samples are always between -1 and 1 inclusive. +If result is 1 it means two input samples are highly correlated in that selected segment. +Result 0 means they are not correlated at all. +If result is -1 it means two input samples are out of phase, which means they cancel each +other. +

+

The filter accepts the following options: +

+
+
size
+

Set size of segment over which cross-correlation is calculated. +Default is 256. Allowed range is from 2 to 131072. +

+
+
algo
+

Set algorithm for cross-correlation. Can be slow or fast. +Default is slow. Fast algorithm assumes mean values over any given segment +are always zero and thus need much less calculations to make. +This is generally not true, but is valid for typical audio streams. +

+
+ + +
+

29.65.1 Examples

+ +
    +
  • Calculate correlation between channels in stereo audio stream: +
    +
    ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
    +
    +
+ +
+
+
+

29.66 bandpass

+ +

Apply a two-pole Butterworth band-pass filter with central +frequency frequency, and (3dB-point) band-width width. +The csg option selects a constant skirt gain (peak gain = Q) +instead of the default: constant 0dB peak gain. +The filter roll off at 6dB per octave (20dB per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the filter’s central frequency. Default is 3000. +

+
+
csg
+

Constant skirt gain if set to 1. Defaults to 0. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

29.66.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change bandpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change bandpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change bandpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change bandpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

29.67 bandreject

+ +

Apply a two-pole Butterworth band-reject filter with central +frequency frequency, and (3dB-point) band-width width. +The filter roll off at 6dB per octave (20dB per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the filter’s central frequency. Default is 3000. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

29.67.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change bandreject frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change bandreject width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change bandreject width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change bandreject mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

29.68 bass, lowshelf

+ +

Boost or cut the bass (lower) frequencies of the audio using a two-pole +shelving filter with a response similar to that of a standard +hi-fi’s tone-controls. This is also known as shelving equalisation (EQ). +

+

The filter accepts the following options: +

+
+
gain, g
+

Give the gain at 0 Hz. Its useful range is about -20 +(for a large cut) to +20 (for a large boost). +Beware of clipping when using a positive gain. +

+
+
frequency, f
+

Set the filter’s central frequency and so can be used +to extend or reduce the frequency range to be boosted or cut. +The default value is 100 Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Determine how steep is the filter’s shelf transition. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

29.68.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change bass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change bass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change bass width. +Syntax for the command is : "width" +

+
+
gain, g
+

Change bass gain. +Syntax for the command is : "gain" +

+
+
mix, m
+

Change bass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

29.69 biquad

+ +

Apply a biquad IIR filter with the given coefficients. +Where b0, b1, b2 and a0, a1, a2 +are the numerator and denominator coefficients respectively. +and channels, c specify which channels to filter, by default all +available are filtered. +

+ +
+

29.69.1 Commands

+ +

This filter supports the following commands: +

+
a0
+
a1
+
a2
+
b0
+
b1
+
b2
+

Change biquad parameter. +Syntax for the command is : "value" +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ +
+
+
+

29.70 bs2b

+

Bauer stereo to binaural transformation, which improves headphone listening of +stereo audio records. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libbs2b. +

+

It accepts the following parameters: +

+
profile
+

Pre-defined crossfeed level. +

+
default
+

Default level (fcut=700, feed=50). +

+
+
cmoy
+

Chu Moy circuit (fcut=700, feed=60). +

+
+
jmeier
+

Jan Meier circuit (fcut=650, feed=95). +

+
+
+ +
+
fcut
+

Cut frequency (in Hz). +

+
+
feed
+

Feed level (in Hz). +

+
+
+ +
+
+

29.71 channelmap

+ +

Remap input channels to new locations. +

+

It accepts the following parameters: +

+
map
+

Map channels from input to output. The argument is a ’|’-separated list of +mappings, each in the in_channel-out_channel or +in_channel form. in_channel can be either the name of the input +channel (e.g. FL for front left) or its index in the input channel layout. +out_channel is the name of the output channel or its index in the output +channel layout. If out_channel is not given then it is implicitly an +index, starting with zero and increasing by one for each mapping. +

+
+
channel_layout
+

The channel layout of the output stream. +

+
+ +

If no mapping is present, the filter will implicitly map input channels to +output channels, preserving indices. +

+ +
+

29.71.1 Examples

+ +
    +
  • For example, assuming a 5.1+downmix input MOV file, +
    +
    ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
    +
    +

    will create an output WAV file tagged as stereo from the downmix channels of +the input. +

    +
  • To fix a 5.1 WAV improperly encoded in AAC’s native channel order +
    +
    ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
    +
    +
+ +
+
+
+

29.72 channelsplit

+ +

Split each channel from an input audio stream into a separate output stream. +

+

It accepts the following parameters: +

+
channel_layout
+

The channel layout of the input stream. The default is "stereo". +

+
channels
+

A channel layout describing the channels to be extracted as separate output streams +or "all" to extract each input channel as a separate stream. The default is "all". +

+

Choosing channels not present in channel layout in the input will result in an error. +

+
+ + +
+

29.72.1 Examples

+ +
    +
  • For example, assuming a stereo input MP3 file, +
    +
    ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
    +
    +

    will create an output Matroska file with two audio streams, one containing only +the left channel and the other the right channel. +

    +
  • Split a 5.1 WAV file into per-channel files: +
    +
    ffmpeg -i in.wav -filter_complex
    +'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
    +-map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
    +front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
    +side_right.wav
    +
    + +
  • Extract only LFE from a 5.1 WAV file: +
    +
    ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
    +-map '[LFE]' lfe.wav
    +
    +
+ +
+
+
+

29.73 chorus

+

Add a chorus effect to the audio. +

+

Can make a single vocal sound like a chorus, but can also be applied to instrumentation. +

+

Chorus resembles an echo effect with a short delay, but whereas with echo the delay is +constant, with chorus, it is varied using using sinusoidal or triangular modulation. +The modulation depth defines the range the modulated delay is played before or after +the delay. Hence the delayed sound will sound slower or faster, that is the delayed +sound tuned around the original one, like in a chorus where some vocals are slightly +off key. +

+

It accepts the following parameters: +

+
in_gain
+

Set input gain. Default is 0.4. +

+
+
out_gain
+

Set output gain. Default is 0.4. +

+
+
delays
+

Set delays. A typical delay is around 40ms to 60ms. +

+
+
decays
+

Set decays. +

+
+
speeds
+

Set speeds. +

+
+
depths
+

Set depths. +

+
+ + +
+

29.73.1 Examples

+ +
    +
  • A single delay: +
    +
    chorus=0.7:0.9:55:0.4:0.25:2
    +
    + +
  • Two delays: +
    +
    chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
    +
    + +
  • Fuller sounding chorus with three delays: +
    +
    chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3
    +
    +
+ +
+
+
+

29.74 compand

+

Compress or expand the audio’s dynamic range. +

+

It accepts the following parameters: +

+
+
attacks
+
decays
+

A list of times in seconds for each channel over which the instantaneous level +of the input signal is averaged to determine its volume. attacks refers to +increase of volume and decays refers to decrease of volume. For most +situations, the attack time (response to the audio getting louder) should be +shorter than the decay time, because the human ear is more sensitive to sudden +loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and +a typical value for decay is 0.8 seconds. +If specified number of attacks & decays is lower than number of channels, the last +set attack/decay will be used for all remaining channels. +

+
+
points
+

A list of points for the transfer function, specified in dB relative to the +maximum possible signal amplitude. Each key points list must be defined using +the following syntax: x0/y0|x1/y1|x2/y2|.... or +x0/y0 x1/y1 x2/y2 .... +

+

The input values must be in strictly increasing order but the transfer function +does not have to be monotonically rising. The point 0/0 is assumed but +may be overridden (by 0/out-dBn). Typical values for the transfer +function are -70/-70|-60/-20|1/0. +

+
+
soft-knee
+

Set the curve radius in dB for all joints. It defaults to 0.01. +

+
+
gain
+

Set the additional gain in dB to be applied at all points on the transfer +function. This allows for easy adjustment of the overall gain. +It defaults to 0. +

+
+
volume
+

Set an initial volume, in dB, to be assumed for each channel when filtering +starts. This permits the user to supply a nominal level initially, so that, for +example, a very large gain is not applied to initial signal levels before the +companding has begun to operate. A typical value for audio which is initially +quiet is -90 dB. It defaults to 0. +

+
+
delay
+

Set a delay, in seconds. The input audio is analyzed immediately, but audio is +delayed before being fed to the volume adjuster. Specifying a delay +approximately equal to the attack/decay times allows the filter to effectively +operate in predictive rather than reactive mode. It defaults to 0. +

+
+
+ + +
+

29.74.1 Examples

+ +
    +
  • Make music with both quiet and loud passages suitable for listening to in a +noisy environment: +
    +
    compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
    +
    + +

    Another example for audio with whisper and explosion parts: +

    +
    compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
    +
    + +
  • A noise gate for when the noise is at a lower level than the signal: +
    +
    compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
    +
    + +
  • Here is another noise gate, this time for when the noise is at a higher level +than the signal (making it, in some ways, similar to squelch): +
    +
    compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
    +
    + +
  • 2:1 compression starting at -6dB: +
    +
    compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
    +
    + +
  • 2:1 compression starting at -9dB: +
    +
    compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
    +
    + +
  • 2:1 compression starting at -12dB: +
    +
    compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
    +
    + +
  • 2:1 compression starting at -18dB: +
    +
    compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
    +
    + +
  • 3:1 compression starting at -15dB: +
    +
    compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
    +
    + +
  • Compressor/Gate: +
    +
    compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
    +
    + +
  • Expander: +
    +
    compand=attacks=0:points=-80/-169|-54/-80|-49.5/-64.6|-41.1/-41.1|-25.8/-15|-10.8/-4.5|0/0|20/8.3
    +
    + +
  • Hard limiter at -6dB: +
    +
    compand=attacks=0:points=-80/-80|-6/-6|20/-6
    +
    + +
  • Hard limiter at -12dB: +
    +
    compand=attacks=0:points=-80/-80|-12/-12|20/-12
    +
    + +
  • Hard noise gate at -35 dB: +
    +
    compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
    +
    + +
  • Soft limiter: +
    +
    compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
    +
    +
+ +
+
+
+

29.75 compensationdelay

+ +

Compensation Delay Line is a metric based delay to compensate differing +positions of microphones or speakers. +

+

For example, you have recorded guitar with two microphones placed in +different locations. Because the front of sound wave has fixed speed in +normal conditions, the phasing of microphones can vary and depends on +their location and interposition. The best sound mix can be achieved when +these microphones are in phase (synchronized). Note that a distance of +~30 cm between microphones makes one microphone capture the signal in +antiphase to the other microphone. That makes the final mix sound moody. +This filter helps to solve phasing problems by adding different delays +to each microphone track and make them synchronized. +

+

The best result can be reached when you take one track as base and +synchronize other tracks one by one with it. +Remember that synchronization/delay tolerance depends on sample rate, too. +Higher sample rates will give more tolerance. +

+

The filter accepts the following parameters: +

+
+
mm
+

Set millimeters distance. This is compensation distance for fine tuning. +Default is 0. +

+
+
cm
+

Set cm distance. This is compensation distance for tightening distance setup. +Default is 0. +

+
+
m
+

Set meters distance. This is compensation distance for hard distance setup. +Default is 0. +

+
+
dry
+

Set dry amount. Amount of unprocessed (dry) signal. +Default is 0. +

+
+
wet
+

Set wet amount. Amount of processed (wet) signal. +Default is 1. +

+
+
temp
+

Set temperature in degrees Celsius. This is the temperature of the environment. +Default is 20. +

+
+ + +
+

29.75.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.76 crossfeed

+

Apply headphone crossfeed filter. +

+

Crossfeed is the process of blending the left and right channels of stereo +audio recording. +It is mainly used to reduce extreme stereo separation of low frequencies. +

+

The intent is to produce more speaker like sound to the listener. +

+

The filter accepts the following options: +

+
+
strength
+

Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1. +This sets gain of low shelf filter for side part of stereo image. +Default is -6dB. Max allowed is -30db when strength is set to 1. +

+
+
range
+

Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1. +This sets cut off frequency of low shelf filter. Default is cut off near +1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz. +

+
+
slope
+

Set curve slope of low shelf filter. Default is 0.5. +Allowed range is from 0.01 to 1. +

+
+
level_in
+

Set input gain. Default is 0.9. +

+
+
level_out
+

Set output gain. Default is 1. +

+
+
block_size
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

29.76.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.77 crystalizer

+

Simple algorithm for audio noise sharpening. +

+

This filter linearly increases differences betweeen each audio sample. +

+

The filter accepts the following options: +

+
+
i
+

Sets the intensity of effect (default: 2.0). Must be in range between -10.0 to 0 +(unchanged sound) to 10.0 (maximum effect). +To inverse filtering use negative value. +

+
+
c
+

Enable clipping. By default is enabled. +

+
+ + +
+

29.77.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.78 dcshift

+

Apply a DC shift to the audio. +

+

This can be useful to remove a DC offset (caused perhaps by a hardware problem +in the recording chain) from the audio. The effect of a DC offset is reduced +headroom and hence volume. The astats filter can be used to determine if +a signal has a DC offset. +

+
+
shift
+

Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift +the audio. +

+
+
limitergain
+

Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is +used to prevent clipping. +

+
+ +
+
+

29.79 deesser

+ +

Apply de-essing to the audio samples. +

+
+
i
+

Set intensity for triggering de-essing. Allowed range is from 0 to 1. +Default is 0. +

+
+
m
+

Set amount of ducking on treble part of sound. Allowed range is from 0 to 1. +Default is 0.5. +

+
+
f
+

How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1. +Default is 0.5. +

+
+
s
+

Set the output mode. +

+

It accepts the following values: +

+
i
+

Pass input unchanged. +

+
+
o
+

Pass ess filtered out. +

+
+
e
+

Pass only ess. +

+

Default value is o. +

+
+ +
+
+ +
+
+

29.80 dialoguenhance

+

Enhance dialogue in stereo audio. +

+

This filter accepts stereo input and produce surround (3.0) channels output. +The newly produced front center channel have enhanced speech dialogue originally +available in both stereo channels. +This filter outputs front left and front right channels same as available in stereo input. +

+

The filter accepts the following options: +

+
+
original
+

Set the original center factor to keep in front center channel output. +Allowed range is from 0 to 1. Default value is 1. +

+
+
enhance
+

Set the dialogue enhance factor to put in front center channel output. +Allowed range is from 0 to 3. Default value is 1. +

+
+
voice
+

Set the voice detection factor. +Allowed range is from 2 to 32. Default value is 2. +

+
+ + +
+

29.80.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.81 drmeter

+

Measure audio dynamic range. +

+

DR values of 14 and higher is found in very dynamic material. DR of 8 to 13 +is found in transition material. And anything less that 8 have very poor dynamics +and is very compressed. +

+

The filter accepts the following options: +

+
+
length
+

Set window length in seconds used to split audio into segments of equal length. +Default is 3 seconds. +

+
+ +
+
+

29.82 dynaudnorm

+

Dynamic Audio Normalizer. +

+

This filter applies a certain amount of gain to the input audio in order +to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in +contrast to more "simple" normalization algorithms, the Dynamic Audio +Normalizer *dynamically* re-adjusts the gain factor to the input audio. +This allows for applying extra gain to the "quiet" sections of the audio +while avoiding distortions or clipping the "loud" sections. In other words: +The Dynamic Audio Normalizer will "even out" the volume of quiet and loud +sections, in the sense that the volume of each section is brought to the +same target level. Note, however, that the Dynamic Audio Normalizer achieves +this goal *without* applying "dynamic range compressing". It will retain 100% +of the dynamic range *within* each section of the audio file. +

+
+
framelen, f
+

Set the frame length in milliseconds. In range from 10 to 8000 milliseconds. +Default is 500 milliseconds. +The Dynamic Audio Normalizer processes the input audio in small chunks, +referred to as frames. This is required, because a peak magnitude has no +meaning for just a single sample value. Instead, we need to determine the +peak magnitude for a contiguous sequence of sample values. While a "standard" +normalizer would simply use the peak magnitude of the complete file, the +Dynamic Audio Normalizer determines the peak magnitude individually for each +frame. The length of a frame is specified in milliseconds. By default, the +Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has +been found to give good results with most files. +Note that the exact frame length, in number of samples, will be determined +automatically, based on the sampling rate of the individual input audio file. +

+
+
gausssize, g
+

Set the Gaussian filter window size. In range from 3 to 301, must be odd +number. Default is 31. +Probably the most important parameter of the Dynamic Audio Normalizer is the +window size of the Gaussian smoothing filter. The filter’s window size +is specified in frames, centered around the current frame. For the sake of +simplicity, this must be an odd number. Consequently, the default value of 31 +takes into account the current frame, as well as the 15 preceding frames and +the 15 subsequent frames. Using a larger window results in a stronger +smoothing effect and thus in less gain variation, i.e. slower gain +adaptation. Conversely, using a smaller window results in a weaker smoothing +effect and thus in more gain variation, i.e. faster gain adaptation. +In other words, the more you increase this value, the more the Dynamic Audio +Normalizer will behave like a "traditional" normalization filter. On the +contrary, the more you decrease this value, the more the Dynamic Audio +Normalizer will behave like a dynamic range compressor. +

+
+
peak, p
+

Set the target peak value. This specifies the highest permissible magnitude +level for the normalized audio input. This filter will try to approach the +target peak magnitude as closely as possible, but at the same time it also +makes sure that the normalized signal will never exceed the peak magnitude. +A frame’s maximum local gain factor is imposed directly by the target peak +magnitude. The default value is 0.95 and thus leaves a headroom of 5%*. +It is not recommended to go above this value. +

+
+
maxgain, m
+

Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0. +The Dynamic Audio Normalizer determines the maximum possible (local) gain +factor for each input frame, i.e. the maximum gain factor that does not +result in clipping or distortion. The maximum gain factor is determined by +the frame’s highest magnitude sample. However, the Dynamic Audio Normalizer +additionally bounds the frame’s maximum gain factor by a predetermined +(global) maximum gain factor. This is done in order to avoid excessive gain +factors in "silent" or almost silent frames. By default, the maximum gain +factor is 10.0, For most inputs the default value should be sufficient and +it usually is not recommended to increase this value. Though, for input +with an extremely low overall volume level, it may be necessary to allow even +higher gain factors. Note, however, that the Dynamic Audio Normalizer does +not simply apply a "hard" threshold (i.e. cut off values above the threshold). +Instead, a "sigmoid" threshold function will be applied. This way, the +gain factors will smoothly approach the threshold value, but never exceed that +value. +

+
+
targetrms, r
+

Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled. +By default, the Dynamic Audio Normalizer performs "peak" normalization. +This means that the maximum local gain factor for each frame is defined +(only) by the frame’s highest magnitude sample. This way, the samples can +be amplified as much as possible without exceeding the maximum signal +level, i.e. without clipping. Optionally, however, the Dynamic Audio +Normalizer can also take into account the frame’s root mean square, +abbreviated RMS. In electrical engineering, the RMS is commonly used to +determine the power of a time-varying signal. It is therefore considered +that the RMS is a better approximation of the "perceived loudness" than +just looking at the signal’s peak magnitude. Consequently, by adjusting all +frames to a constant RMS value, a uniform "perceived loudness" can be +established. If a target RMS value has been specified, a frame’s local gain +factor is defined as the factor that would result in exactly that RMS value. +Note, however, that the maximum local gain factor is still restricted by the +frame’s highest magnitude sample, in order to prevent clipping. +

+
+
coupling, n
+

Enable channels coupling. By default is enabled. +By default, the Dynamic Audio Normalizer will amplify all channels by the same +amount. This means the same gain factor will be applied to all channels, i.e. +the maximum possible gain factor is determined by the "loudest" channel. +However, in some recordings, it may happen that the volume of the different +channels is uneven, e.g. one channel may be "quieter" than the other one(s). +In this case, this option can be used to disable the channel coupling. This way, +the gain factor will be determined independently for each channel, depending +only on the individual channel’s highest magnitude sample. This allows for +harmonizing the volume of the different channels. +

+
+
correctdc, c
+

Enable DC bias correction. By default is disabled. +An audio signal (in the time domain) is a sequence of sample values. +In the Dynamic Audio Normalizer these sample values are represented in the +-1.0 to 1.0 range, regardless of the original input format. Normally, the +audio signal, or "waveform", should be centered around the zero point. +That means if we calculate the mean value of all samples in a file, or in a +single frame, then the result should be 0.0 or at least very close to that +value. If, however, there is a significant deviation of the mean value from +0.0, in either positive or negative direction, this is referred to as a +DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic +Audio Normalizer provides optional DC bias correction. +With DC bias correction enabled, the Dynamic Audio Normalizer will determine +the mean value, or "DC correction" offset, of each input frame and subtract +that value from all of the frame’s sample values which ensures those samples +are centered around 0.0 again. Also, in order to avoid "gaps" at the frame +boundaries, the DC correction offset values will be interpolated smoothly +between neighbouring frames. +

+
+
altboundary, b
+

Enable alternative boundary mode. By default is disabled. +The Dynamic Audio Normalizer takes into account a certain neighbourhood +around each frame. This includes the preceding frames as well as the +subsequent frames. However, for the "boundary" frames, located at the very +beginning and at the very end of the audio file, not all neighbouring +frames are available. In particular, for the first few frames in the audio +file, the preceding frames are not known. And, similarly, for the last few +frames in the audio file, the subsequent frames are not known. Thus, the +question arises which gain factors should be assumed for the missing frames +in the "boundary" region. The Dynamic Audio Normalizer implements two modes +to deal with this situation. The default boundary mode assumes a gain factor +of exactly 1.0 for the missing frames, resulting in a smooth "fade in" and +"fade out" at the beginning and at the end of the input, respectively. +

+
+
compress, s
+

Set the compress factor. In range from 0.0 to 30.0. Default is 0.0. +By default, the Dynamic Audio Normalizer does not apply "traditional" +compression. This means that signal peaks will not be pruned and thus the +full dynamic range will be retained within each local neighbourhood. However, +in some cases it may be desirable to combine the Dynamic Audio Normalizer’s +normalization algorithm with a more "traditional" compression. +For this purpose, the Dynamic Audio Normalizer provides an optional compression +(thresholding) function. If (and only if) the compression feature is enabled, +all input frames will be processed by a soft knee thresholding function prior +to the actual normalization process. Put simply, the thresholding function is +going to prune all samples whose magnitude exceeds a certain threshold value. +However, the Dynamic Audio Normalizer does not simply apply a fixed threshold +value. Instead, the threshold value will be adjusted for each individual +frame. +In general, smaller parameters result in stronger compression, and vice versa. +Values below 3.0 are not recommended, because audible distortion may appear. +

+
+
threshold, t
+

Set the target threshold value. This specifies the lowest permissible +magnitude level for the audio input which will be normalized. +If input frame volume is above this value frame will be normalized. +Otherwise frame may not be normalized at all. The default value is set +to 0, which means all input frames will be normalized. +This option is mostly useful if digital noise is not wanted to be amplified. +

+
+
channels, h
+

Specify which channels to filter, by default all available channels are filtered. +

+
+
overlap, o
+

Specify overlap for frames. If set to 0 (default) no frame overlapping is done. +Using >0 and <1 values will make less conservative gain adjustments, like +when framelen option is set to smaller value, if framelen option value is +compensated for non-zero overlap then gain adjustments will be smoother across time +compared to zero overlap case. +

+
+
curve, v
+

Specify the peak mapping curve expression which is going to be used when calculating +gain applied to frames. The max output frame gain will still be limited by other +options mentioned previously for this filter. +

+

The expression can contain the following constants: +

+
+
ch
+

current channel number +

+
+
sn
+

current sample number +

+
+
nb_channels
+

number of channels +

+
+
t
+

timestamp expressed in seconds +

+
+
sr
+

sample rate +

+
+
p
+

current frame peak value +

+
+
+
+ + +
+

29.82.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.83 earwax

+ +

Make audio easier to listen to on headphones. +

+

This filter adds ‘cues’ to 44.1kHz stereo (i.e. audio CD format) audio +so that when listened to on headphones the stereo image is moved from +inside your head (standard for headphones) to outside and in front of +the listener (standard for speakers). +

+

Ported from SoX. +

+
+
+

29.84 equalizer

+ +

Apply a two-pole peaking equalisation (EQ) filter. With this +filter, the signal-level at and around a selected frequency can +be increased or decreased, whilst (unlike bandpass and bandreject +filters) that at all other frequencies is unchanged. +

+

In order to produce complex equalisation curves, this filter can +be given several times, each with a different central frequency. +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the filter’s central frequency in Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +

+
+
gain, g
+

Set the required gain or attenuation in dB. +Beware of clipping when using a positive gain. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

29.84.1 Examples

+
    +
  • Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz: +
    +
    equalizer=f=1000:t=h:width=200:g=-10
    +
    + +
  • Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2: +
    +
    equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
    +
    +
+ +
+
+

29.84.2 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change equalizer frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change equalizer width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change equalizer width. +Syntax for the command is : "width" +

+
+
gain, g
+

Change equalizer gain. +Syntax for the command is : "gain" +

+
+
mix, m
+

Change equalizer mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

29.85 extrastereo

+ +

Linearly increases the difference between left and right channels which +adds some sort of "live" effect to playback. +

+

The filter accepts the following options: +

+
+
m
+

Sets the difference coefficient (default: 2.5). 0.0 means mono sound +(average of both channels), with 1.0 sound will be unchanged, with +-1.0 left and right channels will be swapped. +

+
+
c
+

Enable clipping. By default is enabled. +

+
+ + +
+

29.85.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.86 firequalizer

+

Apply FIR Equalization using arbitrary frequency response. +

+

The filter accepts the following option: +

+
+
gain
+

Set gain curve equation (in dB). The expression can contain variables: +

+
f
+

the evaluated frequency +

+
sr
+

sample rate +

+
ch
+

channel number, set to 0 when multichannels evaluation is disabled +

+
chid
+

channel id, see libavutil/channel_layout.h, set to the first channel id when +multichannels evaluation is disabled +

+
chs
+

number of channels +

+
chlayout
+

channel_layout, see libavutil/channel_layout.h +

+
+
+

and functions: +

+
gain_interpolate(f)
+

interpolate gain on frequency f based on gain_entry +

+
cubic_interpolate(f)
+

same as gain_interpolate, but smoother +

+
+

This option is also available as command. Default is gain_interpolate(f). +

+
+
gain_entry
+

Set gain entry for gain_interpolate function. The expression can +contain functions: +

+
entry(f, g)
+

store gain entry at frequency f with value g +

+
+

This option is also available as command. +

+
+
delay
+

Set filter delay in seconds. Higher value means more accurate. +Default is 0.01. +

+
+
accuracy
+

Set filter accuracy in Hz. Lower value means more accurate. +Default is 5. +

+
+
wfunc
+

Set window function. Acceptable values are: +

+
rectangular
+

rectangular window, useful when gain curve is already smooth +

+
hann
+

hann window (default) +

+
hamming
+

hamming window +

+
blackman
+

blackman window +

+
nuttall3
+

3-terms continuous 1st derivative nuttall window +

+
mnuttall3
+

minimum 3-terms discontinuous nuttall window +

+
nuttall
+

4-terms continuous 1st derivative nuttall window +

+
bnuttall
+

minimum 4-terms discontinuous nuttall (blackman-nuttall) window +

+
bharris
+

blackman-harris window +

+
tukey
+

tukey window +

+
+ +
+
fixed
+

If enabled, use fixed number of audio samples. This improves speed when +filtering with large delay. Default is disabled. +

+
+
multi
+

Enable multichannels evaluation on gain. Default is disabled. +

+
+
zero_phase
+

Enable zero phase mode by subtracting timestamp to compensate delay. +Default is disabled. +

+
+
scale
+

Set scale used by gain. Acceptable values are: +

+
linlin
+

linear frequency, linear gain +

+
linlog
+

linear frequency, logarithmic (in dB) gain (default) +

+
loglin
+

logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain +

+
loglog
+

logarithmic frequency, logarithmic gain +

+
+ +
+
dumpfile
+

Set file for dumping, suitable for gnuplot. +

+
+
dumpscale
+

Set scale for dumpfile. Acceptable values are same with scale option. +Default is linlog. +

+
+
fft2
+

Enable 2-channel convolution using complex FFT. This improves speed significantly. +Default is disabled. +

+
+
min_phase
+

Enable minimum phase impulse response. Default is disabled. +

+
+ + +
+

29.86.1 Examples

+
    +
  • lowpass at 1000 Hz: +
    +
    firequalizer=gain='if(lt(f,1000), 0, -INF)'
    +
    +
  • lowpass at 1000 Hz with gain_entry: +
    +
    firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
    +
    +
  • custom equalization: +
    +
    firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
    +
    +
  • higher delay with zero phase to compensate delay: +
    +
    firequalizer=delay=0.1:fixed=on:zero_phase=on
    +
    +
  • lowpass on left channel, highpass on right channel: +
    +
    firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
    +:gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
    +
    +
+ +
+
+
+

29.87 flanger

+

Apply a flanging effect to the audio. +

+

The filter accepts the following options: +

+
+
delay
+

Set base delay in milliseconds. Range from 0 to 30. Default value is 0. +

+
+
depth
+

Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2. +

+
+
regen
+

Set percentage regeneration (delayed signal feedback). Range from -95 to 95. +Default value is 0. +

+
+
width
+

Set percentage of delayed signal mixed with original. Range from 0 to 100. +Default value is 71. +

+
+
speed
+

Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5. +

+
+
shape
+

Set swept wave shape, can be triangular or sinusoidal. +Default value is sinusoidal. +

+
+
phase
+

Set swept wave percentage-shift for multi channel. Range from 0 to 100. +Default value is 25. +

+
+
interp
+

Set delay-line interpolation, linear or quadratic. +Default is linear. +

+
+ +
+
+

29.88 haas

+

Apply Haas effect to audio. +

+

Note that this makes most sense to apply on mono signals. +With this filter applied to mono signals it give some directionality and +stretches its stereo image. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level. By default is 1, or 0dB +

+
+
level_out
+

Set output level. By default is 1, or 0dB. +

+
+
side_gain
+

Set gain applied to side part of signal. By default is 1. +

+
+
middle_source
+

Set kind of middle source. Can be one of the following: +

+
+
left
+

Pick left channel. +

+
+
right
+

Pick right channel. +

+
+
mid
+

Pick middle part signal of stereo image. +

+
+
side
+

Pick side part signal of stereo image. +

+
+ +
+
middle_phase
+

Change middle phase. By default is disabled. +

+
+
left_delay
+

Set left channel delay. By default is 2.05 milliseconds. +

+
+
left_balance
+

Set left channel balance. By default is -1. +

+
+
left_gain
+

Set left channel gain. By default is 1. +

+
+
left_phase
+

Change left phase. By default is disabled. +

+
+
right_delay
+

Set right channel delay. By defaults is 2.12 milliseconds. +

+
+
right_balance
+

Set right channel balance. By default is 1. +

+
+
right_gain
+

Set right channel gain. By default is 1. +

+
+
right_phase
+

Change right phase. By default is enabled. +

+
+ +
+
+

29.89 hdcd

+ +

Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with +embedded HDCD codes is expanded into a 20-bit PCM stream. +

+

The filter supports the Peak Extend and Low-level Gain Adjustment features +of HDCD, and detects the Transient Filter flag. +

+
+
ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
+
+ +

When using the filter with wav, note the default encoding for wav is 16-bit, +so the resulting 20-bit stream will be truncated back to 16-bit. Use something +like -acodec pcm_s24le after the filter to get 24-bit PCM output. +

+
ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
+ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
+
+ +

The filter accepts the following options: +

+
+
disable_autoconvert
+

Disable any automatic format conversion or resampling in the filter graph. +

+
+
process_stereo
+

Process the stereo channels together. If target_gain does not match between +channels, consider it invalid and use the last valid target_gain. +

+
+
cdt_ms
+

Set the code detect timer period in ms. +

+
+
force_pe
+

Always extend peaks above -3dBFS even if PE isn’t signaled. +

+
+
analyze_mode
+

Replace audio with a solid tone and adjust the amplitude to signal some +specific aspect of the decoding process. The output file can be loaded in +an audio editor alongside the original to aid analysis. +

+

analyze_mode=pe:force_pe=true can be used to see all samples above the PE level. +

+

Modes are: +

+
0, off
+

Disabled +

+
1, lle
+

Gain adjustment level at each sample +

+
2, pe
+

Samples where peak extend occurs +

+
3, cdt
+

Samples where the code detect timer is active +

+
4, tgm
+

Samples where the target gain does not match between channels +

+
+
+
+ +
+
+

29.90 headphone

+ +

Apply head-related transfer functions (HRTFs) to create virtual +loudspeakers around the user for binaural listening via headphones. +The HRIRs are provided via additional streams, for each channel +one stereo input stream is needed. +

+

The filter accepts the following options: +

+
+
map
+

Set mapping of input streams for convolution. +The argument is a ’|’-separated list of channel names in order as they +are given as additional stream inputs for filter. +This also specify number of input streams. Number of input streams +must be not less than number of channels in first stream plus one. +

+
+
gain
+

Set gain applied to audio. Value is in dB. Default is 0. +

+
+
type
+

Set processing type. Can be time or freq. time is +processing audio in time domain which is slow. +freq is processing audio in frequency domain which is fast. +Default is freq. +

+
+
lfe
+

Set custom gain for LFE channels. Value is in dB. Default is 0. +

+
+
size
+

Set size of frame in number of samples which will be processed at once. +Default value is 1024. Allowed range is from 1024 to 96000. +

+
+
hrir
+

Set format of hrir stream. +Default value is stereo. Alternative value is multich. +If value is set to stereo, number of additional streams should +be greater or equal to number of input channels in first input stream. +Also each additional stream should have stereo number of channels. +If value is set to multich, number of additional streams should +be exactly one. Also number of input channels of additional stream +should be equal or greater than twice number of channels of first input +stream. +

+
+ + +
+

29.90.1 Examples

+ +
    +
  • Full example using wav files as coefficients with amovie filters for 7.1 downmix, +each amovie filter use stereo file with IR coefficients as input. +The files give coefficients for each position of virtual loudspeaker: +
    +
    ffmpeg -i input.wav
    +-filter_complex "amovie=azi_270_ele_0_DFC.wav[sr];amovie=azi_90_ele_0_DFC.wav[sl];amovie=azi_225_ele_0_DFC.wav[br];amovie=azi_135_ele_0_DFC.wav[bl];amovie=azi_0_ele_0_DFC.wav,asplit[fc][lfe];amovie=azi_35_ele_0_DFC.wav[fl];amovie=azi_325_ele_0_DFC.wav[fr];[0:a][fl][fr][fc][lfe][bl][br][sl][sr]headphone=FL|FR|FC|LFE|BL|BR|SL|SR"
    +output.wav
    +
    + +
  • Full example using wav files as coefficients with amovie filters for 7.1 downmix, +but now in multich hrir format. +
    +
    ffmpeg -i input.wav -filter_complex "amovie=minp.wav[hrirs];[0:a][hrirs]headphone=map=FL|FR|FC|LFE|BL|BR|SL|SR:hrir=multich"
    +output.wav
    +
    +
+ +
+
+
+

29.91 highpass

+ +

Apply a high-pass filter with 3dB point frequency. +The filter can be either single-pole, or double-pole (the default). +The filter roll off at 6dB per pole per octave (20dB per pole per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set frequency in Hz. Default is 3000. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +Applies only to double-pole filter. +The default is 0.707q and gives a Butterworth response. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

29.91.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change highpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change highpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change highpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change highpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

29.92 join

+ +

Join multiple input streams into one multi-channel stream. +

+

It accepts the following parameters: +

+
inputs
+

The number of input streams. It defaults to 2. +

+
+
channel_layout
+

The desired output channel layout. It defaults to stereo. +

+
+
map
+

Map channels from inputs to output. The argument is a ’|’-separated list of +mappings, each in the input_idx.in_channel-out_channel +form. input_idx is the 0-based index of the input stream. in_channel +can be either the name of the input channel (e.g. FL for front left) or its +index in the specified input stream. out_channel is the name of the output +channel. +

+
+ +

The filter will attempt to guess the mappings when they are not specified +explicitly. It does so by first trying to find an unused matching input channel +and if that fails it picks the first unused input channel. +

+

Join 3 inputs (with properly set channel layouts): +

+
ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
+
+ +

Build a 5.1 output from 6 single-channel streams: +

+
ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
+'join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-SL|4.0-SR|5.0-LFE'
+out
+
+ +
+
+

29.93 ladspa

+ +

Load a LADSPA (Linux Audio Developer’s Simple Plugin API) plugin. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-ladspa. +

+
+
file, f
+

Specifies the name of LADSPA plugin library to load. If the environment +variable LADSPA_PATH is defined, the LADSPA plugin is searched in +each one of the directories specified by the colon separated list in +LADSPA_PATH, otherwise in the standard LADSPA paths, which are in +this order: HOME/.ladspa/lib/, /usr/local/lib/ladspa/, +/usr/lib/ladspa/. +

+
+
plugin, p
+

Specifies the plugin within the library. Some libraries contain only +one plugin, but others contain many of them. If this is not set filter +will list all available plugins within the specified library. +

+
+
controls, c
+

Set the ’|’ separated list of controls which are zero or more floating point +values that determine the behavior of the loaded plugin (for example delay, +threshold or gain). +Controls need to be defined using the following syntax: +c0=value0|c1=value1|c2=value2|..., where +valuei is the value set on the i-th control. +Alternatively they can be also defined using the following syntax: +value0|value1|value2|..., where +valuei is the value set on the i-th control. +If controls is set to help, all available controls and +their valid ranges are printed. +

+
+
sample_rate, s
+

Specify the sample rate, default to 44100. Only used if plugin have +zero inputs. +

+
+
nb_samples, n
+

Set the number of samples per channel per each output frame, default +is 1024. Only used if plugin have zero inputs. +

+
+
duration, d
+

Set the minimum duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +Note that the resulting duration may be greater than the specified duration, +as the generated audio is always cut at the end of a complete frame. +If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +Only used if plugin have zero inputs. +

+
+
latency, l
+

Enable latency compensation, by default is disabled. +Only used if plugin have inputs. +

+
+ + +
+

29.93.1 Examples

+ +
    +
  • List all available plugins within amp (LADSPA example plugin) library: +
    +
    ladspa=file=amp
    +
    + +
  • List all available controls and their valid ranges for vcf_notch +plugin from VCF library: +
    +
    ladspa=f=vcf:p=vcf_notch:c=help
    +
    + +
  • Simulate low quality audio equipment using Computer Music Toolkit (CMT) +plugin library: +
    +
    ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
    +
    + +
  • Add reverberation to the audio using TAP-plugins +(Tom’s Audio Processing plugins): +
    +
    ladspa=file=tap_reverb:tap_reverb
    +
    + +
  • Generate white noise, with 0.2 amplitude: +
    +
    ladspa=file=cmt:noise_source_white:c=c0=.2
    +
    + +
  • Generate 20 bpm clicks using plugin C* Click - Metronome from the +C* Audio Plugin Suite (CAPS) library: +
    +
    ladspa=file=caps:Click:c=c1=20'
    +
    + +
  • Apply C* Eq10X2 - Stereo 10-band equaliser effect: +
    +
    ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
    +
    + +
  • Increase volume by 20dB using fast lookahead limiter from Steve Harris +SWH Plugins collection: +
    +
    ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
    +
    + +
  • Attenuate low frequencies using Multiband EQ from Steve Harris +SWH Plugins collection: +
    +
    ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
    +
    + +
  • Reduce stereo image using Narrower from the C* Audio Plugin Suite +(CAPS) library: +
    +
    ladspa=caps:Narrower
    +
    + +
  • Another white noise, now using C* Audio Plugin Suite (CAPS) library: +
    +
    ladspa=caps:White:.2
    +
    + +
  • Some fractal noise, using C* Audio Plugin Suite (CAPS) library: +
    +
    ladspa=caps:Fractal:c=c1=1
    +
    + +
  • Dynamic volume normalization using VLevel plugin: +
    +
    ladspa=vlevel-ladspa:vlevel_mono
    +
    +
+ +
+
+

29.93.2 Commands

+ +

This filter supports the following commands: +

+
cN
+

Modify the N-th control value. +

+

If the specified value is not valid, it is ignored and prior one is kept. +

+
+ +
+
+
+

29.94 loudnorm

+ +

EBU R128 loudness normalization. Includes both dynamic and linear normalization modes. +Support for both single pass (livestreams, files) and double pass (files) modes. +This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately +detect true peaks, the audio stream will be upsampled to 192 kHz. +Use the -ar option or aresample filter to explicitly set an output sample rate. +

+

The filter accepts the following options: +

+
+
I, i
+

Set integrated loudness target. +Range is -70.0 - -5.0. Default value is -24.0. +

+
+
LRA, lra
+

Set loudness range target. +Range is 1.0 - 50.0. Default value is 7.0. +

+
+
TP, tp
+

Set maximum true peak. +Range is -9.0 - +0.0. Default value is -2.0. +

+
+
measured_I, measured_i
+

Measured IL of input file. +Range is -99.0 - +0.0. +

+
+
measured_LRA, measured_lra
+

Measured LRA of input file. +Range is 0.0 - 99.0. +

+
+
measured_TP, measured_tp
+

Measured true peak of input file. +Range is -99.0 - +99.0. +

+
+
measured_thresh
+

Measured threshold of input file. +Range is -99.0 - +0.0. +

+
+
offset
+

Set offset gain. Gain is applied before the true-peak limiter. +Range is -99.0 - +99.0. Default is +0.0. +

+
+
linear
+

Normalize by linearly scaling the source audio. +measured_I, measured_LRA, measured_TP, +and measured_thresh must all be specified. Target LRA shouldn’t +be lower than source LRA and the change in integrated loudness shouldn’t +result in a true peak which exceeds the target TP. If any of these +conditions aren’t met, normalization mode will revert to dynamic. +Options are true or false. Default is true. +

+
+
dual_mono
+

Treat mono input files as "dual-mono". If a mono file is intended for playback +on a stereo system, its EBU R128 measurement will be perceptually incorrect. +If set to true, this option will compensate for this effect. +Multi-channel input files are not affected by this option. +Options are true or false. Default is false. +

+
+
print_format
+

Set print format for stats. Options are summary, json, or none. +Default value is none. +

+
+ +
+
+

29.95 lowpass

+ +

Apply a low-pass filter with 3dB point frequency. +The filter can be either single-pole or double-pole (the default). +The filter roll off at 6dB per pole per octave (20dB per pole per decade). +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set frequency in Hz. Default is 500. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Specify the band-width of a filter in width_type units. +Applies only to double-pole filter. +The default is 0.707q and gives a Butterworth response. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

29.95.1 Examples

+
    +
  • Lowpass only LFE channel, it LFE is not present it does nothing: +
    +
    lowpass=c=LFE
    +
    +
+ +
+
+

29.95.2 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change lowpass frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change lowpass width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change lowpass width. +Syntax for the command is : "width" +

+
+
mix, m
+

Change lowpass mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

29.96 lv2

+ +

Load a LV2 (LADSPA Version 2) plugin. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-lv2. +

+
+
plugin, p
+

Specifies the plugin URI. You may need to escape ’:’. +

+
+
controls, c
+

Set the ’|’ separated list of controls which are zero or more floating point +values that determine the behavior of the loaded plugin (for example delay, +threshold or gain). +If controls is set to help, all available controls and +their valid ranges are printed. +

+
+
sample_rate, s
+

Specify the sample rate, default to 44100. Only used if plugin have +zero inputs. +

+
+
nb_samples, n
+

Set the number of samples per channel per each output frame, default +is 1024. Only used if plugin have zero inputs. +

+
+
duration, d
+

Set the minimum duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +Note that the resulting duration may be greater than the specified duration, +as the generated audio is always cut at the end of a complete frame. +If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +Only used if plugin have zero inputs. +

+
+ + +
+

29.96.1 Examples

+ +
    +
  • Apply bass enhancer plugin from Calf: +
    +
    lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
    +
    + +
  • Apply vinyl plugin from Calf: +
    +
    lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
    +
    + +
  • Apply bit crusher plugin from ArtyFX: +
    +
    lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
    +
    +
+ +
+
+

29.96.2 Commands

+ +

This filter supports all options that are exported by plugin as commands. +

+
+
+
+

29.97 mcompand

+

Multiband Compress or expand the audio’s dynamic range. +

+

The input audio is divided into bands using 4th order Linkwitz-Riley IIRs. +This is akin to the crossover of a loudspeaker, and results in flat frequency +response when absent compander action. +

+

It accepts the following parameters: +

+
+
args
+

This option syntax is: +attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ... +For explanation of each item refer to compand filter documentation. +

+
+ +
+
+

29.98 pan

+ +

Mix channels with specific gain levels. The filter accepts the output +channel layout followed by a set of channels definitions. +

+

This filter is also designed to efficiently remap the channels of an audio +stream. +

+

The filter accepts parameters of the form: +"l|outdef|outdef|..." +

+
+
l
+

output channel layout or number of channels +

+
+
outdef
+

output channel specification, of the form: +"out_name=[gain*]in_name[(+-)[gain*]in_name...]" +

+
+
out_name
+

output channel to define, either a channel name (FL, FR, etc.) or a channel +number (c0, c1, etc.) +

+
+
gain
+

multiplicative coefficient for the channel, 1 leaving the volume unchanged +

+
+
in_name
+

input channel to use, see out_name for details; it is not possible to mix +named and numbered input channels +

+
+ +

If the ‘=’ in a channel specification is replaced by ‘<’, then the gains for +that specification will be renormalized so that the total is 1, thus +avoiding clipping noise. +

+ +
+

29.98.1 Mixing examples

+ +

For example, if you want to down-mix from stereo to mono, but with a bigger +factor for the left channel: +

+
pan=1c|c0=0.9*c0+0.1*c1
+
+ +

A customized down-mix to stereo that works automatically for 3-, 4-, 5- and +7-channels surround: +

+
pan=stereo| FL < FL + 0.5*FC + 0.6*BL + 0.6*SL | FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
+
+ +

Note that ffmpeg integrates a default down-mix (and up-mix) system +that should be preferred (see "-ac" option) unless you have very specific +needs. +

+
+
+

29.98.2 Remapping examples

+ +

The channel remapping will be effective if, and only if: +

+
    +
  • gain coefficients are zeroes or ones, +
  • only one input per channel output, +
+ +

If all these conditions are satisfied, the filter will notify the user ("Pure +channel mapping detected"), and use an optimized and lossless method to do the +remapping. +

+

For example, if you have a 5.1 source and want a stereo audio stream by +dropping the extra channels: +

+
pan="stereo| c0=FL | c1=FR"
+
+ +

Given the same source, you can also switch front left and front right channels +and keep the input channel layout: +

+
pan="5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5"
+
+ +

If the input is a stereo audio stream, you can mute the front left channel (and +still keep the stereo channel layout) with: +

+
pan="stereo|c1=c1"
+
+ +

Still with a stereo audio stream input, you can copy the right channel in both +front left and right: +

+
pan="stereo| c0=FR | c1=FR"
+
+ +
+
+
+

29.99 replaygain

+ +

ReplayGain scanner filter. This filter takes an audio stream as an input and +outputs it unchanged. +At end of filtering it displays track_gain and track_peak. +

+

The filter accepts the following exported read-only options: +

+
+
track_gain
+

Exported track gain in dB at end of stream. +

+
+
track_peak
+

Exported track peak at end of stream. +

+
+ +
+
+

29.100 resample

+ +

Convert the audio sample format, sample rate and channel layout. It is +not meant to be used directly. +

+
+
+

29.101 rubberband

+

Apply time-stretching and pitch-shifting with librubberband. +

+

To enable compilation of this filter, you need to configure FFmpeg with +--enable-librubberband. +

+

The filter accepts the following options: +

+
+
tempo
+

Set tempo scale factor. +

+
+
pitch
+

Set pitch scale factor. +

+
+
transients
+

Set transients detector. +Possible values are: +

+
crisp
+
mixed
+
smooth
+
+ +
+
detector
+

Set detector. +Possible values are: +

+
compound
+
percussive
+
soft
+
+ +
+
phase
+

Set phase. +Possible values are: +

+
laminar
+
independent
+
+ +
+
window
+

Set processing window size. +Possible values are: +

+
standard
+
short
+
long
+
+ +
+
smoothing
+

Set smoothing. +Possible values are: +

+
off
+
on
+
+ +
+
formant
+

Enable formant preservation when shift pitching. +Possible values are: +

+
shifted
+
preserved
+
+ +
+
pitchq
+

Set pitch quality. +Possible values are: +

+
quality
+
speed
+
consistency
+
+ +
+
channels
+

Set channels. +Possible values are: +

+
apart
+
together
+
+
+
+ + +
+

29.101.1 Commands

+ +

This filter supports the following commands: +

+
tempo
+

Change filter tempo scale factor. +Syntax for the command is : "tempo" +

+
+
pitch
+

Change filter pitch scale factor. +Syntax for the command is : "pitch" +

+
+ +
+
+
+

29.102 sidechaincompress

+ +

This filter acts like normal compressor but has the ability to compress +detected signal using second input signal. +It needs two input streams and returns one output stream. +First input stream will be processed depending on second stream signal. +The filtered signal then can be filtered with other filters in later stages of +processing. See pan and amerge filter. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input gain. Default is 1. Range is between 0.015625 and 64. +

+
+
mode
+

Set mode of compressor operation. Can be upward or downward. +Default is downward. +

+
+
threshold
+

If a signal of second stream raises above this level it will affect the gain +reduction of first stream. +By default is 0.125. Range is between 0.00097563 and 1. +

+
+
ratio
+

Set a ratio about which the signal is reduced. 1:2 means that if the level +raised 4dB above the threshold, it will be only 2dB above after the reduction. +Default is 2. Range is between 1 and 20. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction starts. Default is 20. Range is between 0.01 and 2000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before +reduction is decreased again. Default is 250. Range is between 0.01 and 9000. +

+
+
makeup
+

Set the amount by how much signal will be amplified after processing. +Default is 1. Range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.82843. Range is between 1 and 8. +

+
+
link
+

Choose if the average level between all channels of side-chain stream +or the louder(maximum) channel of side-chain stream affects the +reduction. Default is average. +

+
+
detection
+

Should the exact signal be taken in case of peak or an RMS one in case +of rms. Default is rms which is mainly smoother. +

+
+
level_sc
+

Set sidechain gain. Default is 1. Range is between 0.015625 and 64. +

+
+
mix
+

How much to use compressed signal in output. Default is 1. +Range is between 0 and 1. +

+
+ + +
+

29.102.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

29.102.2 Examples

+ +
    +
  • Full ffmpeg example taking 2 audio inputs, 1st input to be compressed +depending on the signal of 2nd input and later compressed signal to be +merged with 2nd input: +
    +
    ffmpeg -i main.flac -i sidechain.flac -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge"
    +
    +
+ +
+
+
+

29.103 sidechaingate

+ +

A sidechain gate acts like a normal (wideband) gate but has the ability to +filter the detected signal before sending it to the gain reduction stage. +Normally a gate uses the full range signal to detect a level above the +threshold. +For example: If you cut all lower frequencies from your sidechain signal +the gate will decrease the volume of your track only if not enough highs +appear. With this technique you are able to reduce the resonation of a +natural drum or remove "rumbling" of muted strokes from a heavily distorted +guitar. +It needs two input streams and returns one output stream. +First input stream will be processed depending on second stream signal. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level before filtering. +Default is 1. Allowed range is from 0.015625 to 64. +

+
+
mode
+

Set the mode of operation. Can be upward or downward. +Default is downward. If set to upward mode, higher parts of signal +will be amplified, expanding dynamic range in upward direction. +Otherwise, in case of downward lower parts of signal will be reduced. +

+
+
range
+

Set the level of gain reduction when the signal is below the threshold. +Default is 0.06125. Allowed range is from 0 to 1. +Setting this to 0 disables reduction and then filter behaves like expander. +

+
+
threshold
+

If a signal rises above this level the gain reduction is released. +Default is 0.125. Allowed range is from 0 to 1. +

+
+
ratio
+

Set a ratio about which the signal is reduced. +Default is 2. Allowed range is from 1 to 9000. +

+
+
attack
+

Amount of milliseconds the signal has to rise above the threshold before gain +reduction stops. +Default is 20 milliseconds. Allowed range is from 0.01 to 9000. +

+
+
release
+

Amount of milliseconds the signal has to fall below the threshold before the +reduction is increased again. Default is 250 milliseconds. +Allowed range is from 0.01 to 9000. +

+
+
makeup
+

Set amount of amplification of signal after processing. +Default is 1. Allowed range is from 1 to 64. +

+
+
knee
+

Curve the sharp knee around the threshold to enter gain reduction more softly. +Default is 2.828427125. Allowed range is from 1 to 8. +

+
+
detection
+

Choose if exact signal should be taken for detection or an RMS like one. +Default is rms. Can be peak or rms. +

+
+
link
+

Choose if the average level between all channels or the louder channel affects +the reduction. +Default is average. Can be average or maximum. +

+
+
level_sc
+

Set sidechain gain. Default is 1. Range is from 0.015625 to 64. +

+
+ + +
+

29.103.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

29.104 silencedetect

+ +

Detect silence in an audio stream. +

+

This filter logs a message when it detects that the input audio volume is less +or equal to a noise tolerance value for a duration greater or equal to the +minimum detected noise duration. +

+

The printed times and duration are expressed in seconds. The +lavfi.silence_start or lavfi.silence_start.X metadata key +is set on the first frame whose timestamp equals or exceeds the detection +duration and it contains the timestamp of the first frame of the silence. +

+

The lavfi.silence_duration or lavfi.silence_duration.X +and lavfi.silence_end or lavfi.silence_end.X metadata +keys are set on the first frame after the silence. If mono is +enabled, and each channel is evaluated separately, the .X +suffixed keys are used, and X corresponds to the channel number. +

+

The filter accepts the following options: +

+
+
noise, n
+

Set noise tolerance. Can be specified in dB (in case "dB" is appended to the +specified value) or amplitude ratio. Default is -60dB, or 0.001. +

+
+
duration, d
+

Set silence duration until notification (default is 2 seconds). See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+
+
mono, m
+

Process each channel separately, instead of combined. By default is disabled. +

+
+ + +
+

29.104.1 Examples

+ +
    +
  • Detect 5 seconds of silence with -50dB noise tolerance: +
    +
    silencedetect=n=-50dB:d=5
    +
    + +
  • Complete example with ffmpeg to detect silence with 0.0001 noise +tolerance in silence.mp3: +
    +
    ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
    +
    +
+ +
+
+
+

29.105 silenceremove

+ +

Remove silence from the beginning, middle or end of the audio. +

+

The filter accepts the following options: +

+
+
start_periods
+

This value is used to indicate if audio should be trimmed at beginning of +the audio. A value of zero indicates no silence should be trimmed from the +beginning. When specifying a non-zero value, it trims audio up until it +finds non-silence. Normally, when trimming silence from beginning of audio +the start_periods will be 1 but it can be increased to higher +values to trim all audio up to specific count of non-silence periods. +Default value is 0. +

+
+
start_duration
+

Specify the amount of time that non-silence must be detected before it stops +trimming audio. By increasing the duration, bursts of noises can be treated +as silence and trimmed off. Default value is 0. +

+
+
start_threshold
+

This indicates what sample value should be treated as silence. For digital +audio, a value of 0 may be fine but for audio recorded from analog, +you may wish to increase the value to account for background noise. +Can be specified in dB (in case "dB" is appended to the specified value) +or amplitude ratio. Default value is 0. +

+
+
start_silence
+

Specify max duration of silence at beginning that will be kept after +trimming. Default is 0, which is equal to trimming all samples detected +as silence. +

+
+
start_mode
+

Specify mode of detection of silence end in start of multi-channel audio. +Can be any or all. Default is any. +With any, any sample that is detected as non-silence will cause +stopped trimming of silence. +With all, only if all channels are detected as non-silence will cause +stopped trimming of silence. +

+
+
stop_periods
+

Set the count for trimming silence from the end of audio. +To remove silence from the middle of a file, specify a stop_periods +that is negative. This value is then treated as a positive value and is +used to indicate the effect should restart processing as specified by +start_periods, making it suitable for removing periods of silence +in the middle of the audio. +Default value is 0. +

+
+
stop_duration
+

Specify a duration of silence that must exist before audio is not copied any +more. By specifying a higher duration, silence that is wanted can be left in +the audio. +Default value is 0. +

+
+
stop_threshold
+

This is the same as start_threshold but for trimming silence from +the end of audio. +Can be specified in dB (in case "dB" is appended to the specified value) +or amplitude ratio. Default value is 0. +

+
+
stop_silence
+

Specify max duration of silence at end that will be kept after +trimming. Default is 0, which is equal to trimming all samples detected +as silence. +

+
+
stop_mode
+

Specify mode of detection of silence start in end of multi-channel audio. +Can be any or all. Default is any. +With any, any sample that is detected as non-silence will cause +stopped trimming of silence. +With all, only if all channels are detected as non-silence will cause +stopped trimming of silence. +

+
+
detection
+

Set how is silence detected. Can be rms or peak. Second is faster +and works better with digital silence which is exactly 0. +Default value is rms. +

+
+
window
+

Set duration in number of seconds used to calculate size of window in number +of samples for detecting silence. +Default value is 0.02. Allowed range is from 0 to 10. +

+
+ + +
+

29.105.1 Examples

+ +
    +
  • The following example shows how this filter can be used to start a recording +that does not contain the delay at the start which usually occurs between +pressing the record button and the start of the performance: +
    +
    silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
    +
    + +
  • Trim all silence encountered from beginning to end where there is more than 1 +second of silence in audio: +
    +
    silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
    +
    + +
  • Trim all digital silence samples, using peak detection, from beginning to end +where there is more than 0 samples of digital silence in audio and digital +silence is detected in all channels at same positions in stream: +
    +
    silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
    +
    +
+ +
+
+
+

29.106 sofalizer

+ +

SOFAlizer uses head-related transfer functions (HRTFs) to create virtual +loudspeakers around the user for binaural listening via headphones (audio +formats up to 9 channels supported). +The HRTFs are stored in SOFA files (see http://www.sofacoustics.org/ for a database). +SOFAlizer is developed at the Acoustics Research Institute (ARI) of the +Austrian Academy of Sciences. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libmysofa. +

+

The filter accepts the following options: +

+
+
sofa
+

Set the SOFA file used for rendering. +

+
+
gain
+

Set gain applied to audio. Value is in dB. Default is 0. +

+
+
rotation
+

Set rotation of virtual loudspeakers in deg. Default is 0. +

+
+
elevation
+

Set elevation of virtual speakers in deg. Default is 0. +

+
+
radius
+

Set distance in meters between loudspeakers and the listener with near-field +HRTFs. Default is 1. +

+
+
type
+

Set processing type. Can be time or freq. time is +processing audio in time domain which is slow. +freq is processing audio in frequency domain which is fast. +Default is freq. +

+
+
speakers
+

Set custom positions of virtual loudspeakers. Syntax for this option is: +<CH> <AZIM> <ELEV>[|<CH> <AZIM> <ELEV>|...]. +Each virtual loudspeaker is described with short channel name following with +azimuth and elevation in degrees. +Each virtual loudspeaker description is separated by ’|’. +For example to override front left and front right channel positions use: +’speakers=FL 45 15|FR 345 15’. +Descriptions with unrecognised channel names are ignored. +

+
+
lfegain
+

Set custom gain for LFE channels. Value is in dB. Default is 0. +

+
+
framesize
+

Set custom frame size in number of samples. Default is 1024. +Allowed range is from 1024 to 96000. Only used if option ‘type’ +is set to freq. +

+
+
normalize
+

Should all IRs be normalized upon importing SOFA file. +By default is enabled. +

+
+
interpolate
+

Should nearest IRs be interpolated with neighbor IRs if exact position +does not match. By default is disabled. +

+
+
minphase
+

Minphase all IRs upon loading of SOFA file. By default is disabled. +

+
+
anglestep
+

Set neighbor search angle step. Only used if option interpolate is enabled. +

+
+
radstep
+

Set neighbor search radius step. Only used if option interpolate is enabled. +

+
+ + +
+

29.106.1 Examples

+ +
    +
  • Using ClubFritz6 sofa file: +
    +
    sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
    +
    + +
  • Using ClubFritz12 sofa file and bigger radius with small rotation: +
    +
    sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
    +
    + +
  • Similar as above but with custom speaker positions for front left, front right, back left and back right +and also with custom gain: +
    +
    "sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|BL 135|BR 225:gain=28"
    +
    +
+ +
+
+
+

29.107 speechnorm

+

Speech Normalizer. +

+

This filter expands or compresses each half-cycle of audio samples +(local set of samples all above or all below zero and between two nearest zero crossings) depending +on threshold value, so audio reaches target peak value under conditions controlled by below options. +

+

The filter accepts the following options: +

+
+
peak, p
+

Set the expansion target peak value. This specifies the highest allowed absolute amplitude +level for the normalized audio input. Default value is 0.95. Allowed range is from 0.0 to 1.0. +

+
+
expansion, e
+

Set the maximum expansion factor. Allowed range is from 1.0 to 50.0. Default value is 2.0. +This option controls maximum local half-cycle of samples expansion. The maximum expansion +would be such that local peak value reaches target peak value but never to surpass it and that +ratio between new and previous peak value does not surpass this option value. +

+
+
compression, c
+

Set the maximum compression factor. Allowed range is from 1.0 to 50.0. Default value is 2.0. +This option controls maximum local half-cycle of samples compression. This option is used +only if threshold option is set to value greater than 0.0, then in such cases +when local peak is lower or same as value set by threshold all samples belonging to +that peak’s half-cycle will be compressed by current compression factor. +

+
+
threshold, t
+

Set the threshold value. Default value is 0.0. Allowed range is from 0.0 to 1.0. +This option specifies which half-cycles of samples will be compressed and which will be expanded. +Any half-cycle samples with their local peak value below or same as this option value will be +compressed by current compression factor, otherwise, if greater than threshold value they will be +expanded with expansion factor so that it could reach peak target value but never surpass it. +

+
+
raise, r
+

Set the expansion raising amount per each half-cycle of samples. Default value is 0.001. +Allowed range is from 0.0 to 1.0. This controls how fast expansion factor is raised per +each new half-cycle until it reaches expansion value. +Setting this options too high may lead to distortions. +

+
+
fall, f
+

Set the compression raising amount per each half-cycle of samples. Default value is 0.001. +Allowed range is from 0.0 to 1.0. This controls how fast compression factor is raised per +each new half-cycle until it reaches compression value. +

+
+
channels, h
+

Specify which channels to filter, by default all available channels are filtered. +

+
+
invert, i
+

Enable inverted filtering, by default is disabled. This inverts interpretation of threshold +option. When enabled any half-cycle of samples with their local peak value below or same as +threshold option will be expanded otherwise it will be compressed. +

+
+
link, l
+

Link channels when calculating gain applied to each filtered channel sample, by default is disabled. +When disabled each filtered channel gain calculation is independent, otherwise when this option +is enabled the minimum of all possible gains for each filtered channel is used. +

+
+
rms, m
+

Set the expansion target RMS value. This specifies the highest allowed RMS level for the normalized +audio input. Default value is 0.0, thus disabled. Allowed range is from 0.0 to 1.0. +

+
+ + +
+

29.107.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

29.107.2 Examples

+ +
    +
  • Weak and slow amplification: +
    +
    speechnorm=e=3:r=0.00001:l=1
    +
    + +
  • Moderate and slow amplification: +
    +
    speechnorm=e=6.25:r=0.00001:l=1
    +
    + +
  • Strong and fast amplification: +
    +
    speechnorm=e=12.5:r=0.0001:l=1
    +
    + +
  • Very strong and fast amplification: +
    +
    speechnorm=e=25:r=0.0001:l=1
    +
    + +
  • Extreme and fast amplification: +
    +
    speechnorm=e=50:r=0.0001:l=1
    +
    +
+ +
+
+
+

29.108 stereotools

+ +

This filter has some handy utilities to manage stereo signals, for converting +M/S stereo recordings to L/R signal while having control over the parameters +or spreading the stereo image of master track. +

+

The filter accepts the following options: +

+
+
level_in
+

Set input level before filtering for both channels. Defaults is 1. +Allowed range is from 0.015625 to 64. +

+
+
level_out
+

Set output level after filtering for both channels. Defaults is 1. +Allowed range is from 0.015625 to 64. +

+
+
balance_in
+

Set input balance between both channels. Default is 0. +Allowed range is from -1 to 1. +

+
+
balance_out
+

Set output balance between both channels. Default is 0. +Allowed range is from -1 to 1. +

+
+
softclip
+

Enable softclipping. Results in analog distortion instead of harsh digital 0dB +clipping. Disabled by default. +

+
+
mutel
+

Mute the left channel. Disabled by default. +

+
+
muter
+

Mute the right channel. Disabled by default. +

+
+
phasel
+

Change the phase of the left channel. Disabled by default. +

+
+
phaser
+

Change the phase of the right channel. Disabled by default. +

+
+
mode
+

Set stereo mode. Available values are: +

+
+
lr>lr
+

Left/Right to Left/Right, this is default. +

+
+
lr>ms
+

Left/Right to Mid/Side. +

+
+
ms>lr
+

Mid/Side to Left/Right. +

+
+
lr>ll
+

Left/Right to Left/Left. +

+
+
lr>rr
+

Left/Right to Right/Right. +

+
+
lr>l+r
+

Left/Right to Left + Right. +

+
+
lr>rl
+

Left/Right to Right/Left. +

+
+
ms>ll
+

Mid/Side to Left/Left. +

+
+
ms>rr
+

Mid/Side to Right/Right. +

+
+
ms>rl
+

Mid/Side to Right/Left. +

+
+
lr>l-r
+

Left/Right to Left - Right. +

+
+ +
+
slev
+

Set level of side signal. Default is 1. +Allowed range is from 0.015625 to 64. +

+
+
sbal
+

Set balance of side signal. Default is 0. +Allowed range is from -1 to 1. +

+
+
mlev
+

Set level of the middle signal. Default is 1. +Allowed range is from 0.015625 to 64. +

+
+
mpan
+

Set middle signal pan. Default is 0. Allowed range is from -1 to 1. +

+
+
base
+

Set stereo base between mono and inversed channels. Default is 0. +Allowed range is from -1 to 1. +

+
+
delay
+

Set delay in milliseconds how much to delay left from right channel and +vice versa. Default is 0. Allowed range is from -20 to 20. +

+
+
sclevel
+

Set S/C level. Default is 1. Allowed range is from 1 to 100. +

+
+
phase
+

Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360. +

+
+
bmode_in, bmode_out
+

Set balance mode for balance_in/balance_out option. +

+

Can be one of the following: +

+
+
balance
+

Classic balance mode. Attenuate one channel at time. +Gain is raised up to 1. +

+
+
amplitude
+

Similar as classic mode above but gain is raised up to 2. +

+
+
power
+

Equal power distribution, from -6dB to +6dB range. +

+
+
+
+ + +
+

29.108.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

29.108.2 Examples

+ +
    +
  • Apply karaoke like effect: +
    +
    stereotools=mlev=0.015625
    +
    + +
  • Convert M/S signal to L/R: +
    +
    "stereotools=mode=ms>lr"
    +
    +
+ +
+
+
+

29.109 stereowiden

+ +

This filter enhance the stereo effect by suppressing signal common to both +channels and by delaying the signal of left into right and vice versa, +thereby widening the stereo effect. +

+

The filter accepts the following options: +

+
+
delay
+

Time in milliseconds of the delay of left signal into right and vice versa. +Default is 20 milliseconds. +

+
+
feedback
+

Amount of gain in delayed signal into right and vice versa. Gives a delay +effect of left signal in right output and vice versa which gives widening +effect. Default is 0.3. +

+
+
crossfeed
+

Cross feed of left into right with inverted phase. This helps in suppressing +the mono. If the value is 1 it will cancel all the signal common to both +channels. Default is 0.3. +

+
+
drymix
+

Set level of input signal of original channel. Default is 0.8. +

+
+ + +
+

29.109.1 Commands

+ +

This filter supports the all above options except delay as commands. +

+
+
+
+

29.110 superequalizer

+

Apply 18 band equalizer. +

+

The filter accepts the following options: +

+
1b
+

Set 65Hz band gain. +

+
2b
+

Set 92Hz band gain. +

+
3b
+

Set 131Hz band gain. +

+
4b
+

Set 185Hz band gain. +

+
5b
+

Set 262Hz band gain. +

+
6b
+

Set 370Hz band gain. +

+
7b
+

Set 523Hz band gain. +

+
8b
+

Set 740Hz band gain. +

+
9b
+

Set 1047Hz band gain. +

+
10b
+

Set 1480Hz band gain. +

+
11b
+

Set 2093Hz band gain. +

+
12b
+

Set 2960Hz band gain. +

+
13b
+

Set 4186Hz band gain. +

+
14b
+

Set 5920Hz band gain. +

+
15b
+

Set 8372Hz band gain. +

+
16b
+

Set 11840Hz band gain. +

+
17b
+

Set 16744Hz band gain. +

+
18b
+

Set 20000Hz band gain. +

+
+ +
+
+

29.111 surround

+

Apply audio surround upmix filter. +

+

This filter allows to produce multichannel output from audio stream. +

+

The filter accepts the following options: +

+
+
chl_out
+

Set output channel layout. By default, this is 5.1. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+
chl_in
+

Set input channel layout. By default, this is stereo. +

+

See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual +for the required syntax. +

+
+
level_in
+

Set input volume level. By default, this is 1. +

+
+
level_out
+

Set output volume level. By default, this is 1. +

+
+
lfe
+

Enable LFE channel output if output channel layout has it. By default, this is enabled. +

+
+
lfe_low
+

Set LFE low cut off frequency. By default, this is 128 Hz. +

+
+
lfe_high
+

Set LFE high cut off frequency. By default, this is 256 Hz. +

+
+
lfe_mode
+

Set LFE mode, can be add or sub. Default is add. +In add mode, LFE channel is created from input audio and added to output. +In sub mode, LFE channel is created from input audio and added to output but +also all non-LFE output channels are subtracted with output LFE channel. +

+
+
smooth
+

Set temporal smoothness strength, used to gradually change factors when transforming +stereo sound in time. Allowed range is from 0.0 to 1.0. +Useful to improve output quality with focus option values greater than 0.0. +Default is 0.0. Only values inside this range and without edges are effective. +

+
+
angle
+

Set angle of stereo surround transform, Allowed range is from 0 to 360. +Default is 90. +

+
+
focus
+

Set focus of stereo surround transform, Allowed range is from -1 to 1. +Default is 0. +

+
+
fc_in
+

Set front center input volume. By default, this is 1. +

+
+
fc_out
+

Set front center output volume. By default, this is 1. +

+
+
fl_in
+

Set front left input volume. By default, this is 1. +

+
+
fl_out
+

Set front left output volume. By default, this is 1. +

+
+
fr_in
+

Set front right input volume. By default, this is 1. +

+
+
fr_out
+

Set front right output volume. By default, this is 1. +

+
+
sl_in
+

Set side left input volume. By default, this is 1. +

+
+
sl_out
+

Set side left output volume. By default, this is 1. +

+
+
sr_in
+

Set side right input volume. By default, this is 1. +

+
+
sr_out
+

Set side right output volume. By default, this is 1. +

+
+
bl_in
+

Set back left input volume. By default, this is 1. +

+
+
bl_out
+

Set back left output volume. By default, this is 1. +

+
+
br_in
+

Set back right input volume. By default, this is 1. +

+
+
br_out
+

Set back right output volume. By default, this is 1. +

+
+
bc_in
+

Set back center input volume. By default, this is 1. +

+
+
bc_out
+

Set back center output volume. By default, this is 1. +

+
+
lfe_in
+

Set LFE input volume. By default, this is 1. +

+
+
lfe_out
+

Set LFE output volume. By default, this is 1. +

+
+
allx
+

Set spread usage of stereo image across X axis for all channels. +Allowed range is from -1 to 15. +By default this value is negative -1, and thus unused. +

+
+
ally
+

Set spread usage of stereo image across Y axis for all channels. +Allowed range is from -1 to 15. +By default this value is negative -1, and thus unused. +

+
+
fcx, flx, frx, blx, brx, slx, srx, bcx
+

Set spread usage of stereo image across X axis for each channel. +Allowed range is from 0.06 to 15. +By default this value is 0.5. +

+
+
fcy, fly, fry, bly, bry, sly, sry, bcy
+

Set spread usage of stereo image across Y axis for each channel. +Allowed range is from 0.06 to 15. +By default this value is 0.5. +

+
+
win_size
+

Set window size. Allowed range is from 1024 to 65536. Default size is 4096. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann, hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hann. +

+
+
overlap
+

Set window overlap. If set to 1, the recommended overlap for selected +window function will be picked. Default is 0.5. +

+
+ +
+
+

29.112 tiltshelf

+ +

Boost or cut the lower frequencies and cut or boost higher frequencies +of the audio using a two-pole shelving filter with a response similar to +that of a standard hi-fi’s tone-controls. +This is also known as shelving equalisation (EQ). +

+

The filter accepts the following options: +

+
+
gain, g
+

Give the gain at 0 Hz. Its useful range is about -20 +(for a large cut) to +20 (for a large boost). +Beware of clipping when using a positive gain. +

+
+
frequency, f
+

Set the filter’s central frequency and so can be used +to extend or reduce the frequency range to be boosted or cut. +The default value is 3000 Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Determine how steep is the filter’s shelf transition. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

29.112.1 Commands

+ +

This filter supports some options as commands. +

+
+
+
+

29.113 treble, highshelf

+ +

Boost or cut treble (upper) frequencies of the audio using a two-pole +shelving filter with a response similar to that of a standard +hi-fi’s tone-controls. This is also known as shelving equalisation (EQ). +

+

The filter accepts the following options: +

+
+
gain, g
+

Give the gain at whichever is the lower of ~22 kHz and the +Nyquist frequency. Its useful range is about -20 (for a large cut) +to +20 (for a large boost). Beware of clipping when using a positive gain. +

+
+
frequency, f
+

Set the filter’s central frequency and so can be used +to extend or reduce the frequency range to be boosted or cut. +The default value is 3000 Hz. +

+
+
width_type, t
+

Set method to specify band-width of filter. +

+
h
+

Hz +

+
q
+

Q-Factor +

+
o
+

octave +

+
s
+

slope +

+
k
+

kHz +

+
+ +
+
width, w
+

Determine how steep is the filter’s shelf transition. +

+
+
poles, p
+

Set number of poles. Default is 2. +

+
+
mix, m
+

How much to use filtered signal in output. Default is 1. +Range is between 0 and 1. +

+
+
channels, c
+

Specify which channels to filter, by default all available are filtered. +

+
+
normalize, n
+

Normalize biquad coefficients, by default is disabled. +Enabling it will normalize magnitude response at DC to 0dB. +

+
+
transform, a
+

Set transform type of IIR filter. +

+
di
+
dii
+
tdi
+
tdii
+
latt
+
svf
+
zdf
+
+ +
+
precision, r
+

Set precison of filtering. +

+
auto
+

Pick automatic sample format depending on surround filters. +

+
s16
+

Always use signed 16-bit. +

+
s32
+

Always use signed 32-bit. +

+
f32
+

Always use float 32-bit. +

+
f64
+

Always use float 64-bit. +

+
+ +
+
block_size, b
+

Set block size used for reverse IIR processing. If this value is set to high enough +value (higher than impulse response length truncated when reaches near zero values) filtering +will become linear phase otherwise if not big enough it will just produce nasty artifacts. +

+

Note that filter delay will be exactly this many samples when set to non-zero value. +

+
+ + +
+

29.113.1 Commands

+ +

This filter supports the following commands: +

+
frequency, f
+

Change treble frequency. +Syntax for the command is : "frequency" +

+
+
width_type, t
+

Change treble width_type. +Syntax for the command is : "width_type" +

+
+
width, w
+

Change treble width. +Syntax for the command is : "width" +

+
+
gain, g
+

Change treble gain. +Syntax for the command is : "gain" +

+
+
mix, m
+

Change treble mix. +Syntax for the command is : "mix" +

+
+ +
+
+
+

29.114 tremolo

+ +

Sinusoidal amplitude modulation. +

+

The filter accepts the following options: +

+
+
f
+

Modulation frequency in Hertz. Modulation frequencies in the subharmonic range +(20 Hz or lower) will result in a tremolo effect. +This filter may also be used as a ring modulator by specifying +a modulation frequency higher than 20 Hz. +Range is 0.1 - 20000.0. Default value is 5.0 Hz. +

+
+
d
+

Depth of modulation as a percentage. Range is 0.0 - 1.0. +Default value is 0.5. +

+
+ +
+
+

29.115 vibrato

+ +

Sinusoidal phase modulation. +

+

The filter accepts the following options: +

+
+
f
+

Modulation frequency in Hertz. +Range is 0.1 - 20000.0. Default value is 5.0 Hz. +

+
+
d
+

Depth of modulation as a percentage. Range is 0.0 - 1.0. +Default value is 0.5. +

+
+ +
+
+

29.116 virtualbass

+ +

Apply audio Virtual Bass filter. +

+

This filter accepts stereo input and produce stereo with LFE (2.1) channels output. +The newly produced LFE channel have enhanced virtual bass originally obtained from both stereo channels. +This filter outputs front left and front right channels unchanged as available in stereo input. +

+

The filter accepts the following options: +

+
+
cutoff
+

Set the virtual bass cutoff frequency. Default value is 250 Hz. +Allowed range is from 100 to 500 Hz. +

+
+
strength
+

Set the virtual bass strength. Allowed range is from 0.5 to 3. +Default value is 3. +

+
+ +
+
+

29.117 volume

+ +

Adjust the input audio volume. +

+

It accepts the following parameters: +

+
volume
+

Set audio volume expression. +

+

Output values are clipped to the maximum value. +

+

The output audio volume is given by the relation: +

+
output_volume = volume * input_volume
+
+ +

The default value for volume is "1.0". +

+
+
precision
+

This parameter represents the mathematical precision. +

+

It determines which input sample formats will be allowed, which affects the +precision of the volume scaling. +

+
+
fixed
+

8-bit fixed-point; this limits input sample format to U8, S16, and S32. +

+
float
+

32-bit floating-point; this limits input sample format to FLT. (default) +

+
double
+

64-bit floating-point; this limits input sample format to DBL. +

+
+ +
+
replaygain
+

Choose the behaviour on encountering ReplayGain side data in input frames. +

+
+
drop
+

Remove ReplayGain side data, ignoring its contents (the default). +

+
+
ignore
+

Ignore ReplayGain side data, but leave it in the frame. +

+
+
track
+

Prefer the track gain, if present. +

+
+
album
+

Prefer the album gain, if present. +

+
+ +
+
replaygain_preamp
+

Pre-amplification gain in dB to apply to the selected replaygain gain. +

+

Default value for replaygain_preamp is 0.0. +

+
+
replaygain_noclip
+

Prevent clipping by limiting the gain applied. +

+

Default value for replaygain_noclip is 1. +

+
+
eval
+

Set when the volume expression is evaluated. +

+

It accepts the following values: +

+
once
+

only evaluate expression once during the filter initialization, or +when the ‘volume’ command is sent +

+
+
frame
+

evaluate expression for each incoming frame +

+
+ +

Default value is ‘once’. +

+
+ +

The volume expression can contain the following parameters. +

+
+
n
+

frame number (starting at zero) +

+
nb_channels
+

number of channels +

+
nb_consumed_samples
+

number of samples consumed by the filter +

+
nb_samples
+

number of samples in the current frame +

+
pos
+

original frame position in the file; deprecated, do not use +

+
pts
+

frame PTS +

+
sample_rate
+

sample rate +

+
startpts
+

PTS at start of stream +

+
startt
+

time at start of stream +

+
t
+

frame time +

+
tb
+

timestamp timebase +

+
volume
+

last set volume value +

+
+ +

Note that when eval is set to ‘once’ only the +sample_rate and tb variables are available, all other +variables will evaluate to NAN. +

+ +
+

29.117.1 Commands

+ +

This filter supports the following commands: +

+
volume
+

Modify the volume expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+

29.117.2 Examples

+ +
    +
  • Halve the input audio volume: +
    +
    volume=volume=0.5
    +volume=volume=1/2
    +volume=volume=-6.0206dB
    +
    + +

    In all the above example the named key for volume can be +omitted, for example like in: +

    +
    volume=0.5
    +
    + +
  • Increase input audio power by 6 decibels using fixed-point precision: +
    +
    volume=volume=6dB:precision=fixed
    +
    + +
  • Fade volume after time 10 with an annihilation period of 5 seconds: +
    +
    volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
    +
    +
+ +
+
+
+

29.118 volumedetect

+ +

Detect the volume of the input video. +

+

The filter has no parameters. It supports only 16-bit signed integer samples, +so the input will be converted when needed. Statistics about the volume will +be printed in the log when the input stream end is reached. +

+

In particular it will show the mean volume (root mean square), maximum +volume (on a per-sample basis), and the beginning of a histogram of the +registered volume values (from the maximum value to a cumulated 1/1000 of +the samples). +

+

All volumes are in decibels relative to the maximum PCM value. +

+ +
+

29.118.1 Examples

+ +

Here is an excerpt of the output: +

+
[Parsed_volumedetect_0  0xa23120] mean_volume: -27 dB
+[Parsed_volumedetect_0  0xa23120] max_volume: -4 dB
+[Parsed_volumedetect_0  0xa23120] histogram_4db: 6
+[Parsed_volumedetect_0  0xa23120] histogram_5db: 62
+[Parsed_volumedetect_0  0xa23120] histogram_6db: 286
+[Parsed_volumedetect_0  0xa23120] histogram_7db: 1042
+[Parsed_volumedetect_0  0xa23120] histogram_8db: 2551
+[Parsed_volumedetect_0  0xa23120] histogram_9db: 4609
+[Parsed_volumedetect_0  0xa23120] histogram_10db: 8409
+
+ +

It means that: +

    +
  • The mean square energy is approximately -27 dB, or 10^-2.7. +
  • The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB. +
  • There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc. +
+ +

In other words, raising the volume by +4 dB does not cause any clipping, +raising it by +5 dB causes clipping for 6 samples, etc. +

+ +
+
+
+
+

30 Audio Sources

+ +

Below is a description of the currently available audio sources. +

+ +
+

30.1 abuffer

+ +

Buffer audio frames, and make them available to the filter chain. +

+

This source is mainly intended for a programmatic use, in particular +through the interface defined in libavfilter/buffersrc.h. +

+

It accepts the following parameters: +

+
time_base
+

The timebase which will be used for timestamps of submitted frames. It must be +either a floating-point number or in numerator/denominator form. +

+
+
sample_rate
+

The sample rate of the incoming audio buffers. +

+
+
sample_fmt
+

The sample format of the incoming audio buffers. +Either a sample format name or its corresponding integer representation from +the enum AVSampleFormat in libavutil/samplefmt.h +

+
+
channel_layout
+

The channel layout of the incoming audio buffers. +Either a channel layout name from channel_layout_map in +libavutil/channel_layout.c or its corresponding integer representation +from the AV_CH_LAYOUT_* macros in libavutil/channel_layout.h +

+
+
channels
+

The number of channels of the incoming audio buffers. +If both channels and channel_layout are specified, then they +must be consistent. +

+
+
+ + +
+

30.1.1 Examples

+ +
+
abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
+
+ +

will instruct the source to accept planar 16bit signed stereo at 44100Hz. +Since the sample format with name "s16p" corresponds to the number +6 and the "stereo" channel layout corresponds to the value 0x3, this is +equivalent to: +

+
abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
+
+ +
+
+
+

30.2 aevalsrc

+ +

Generate an audio signal specified by an expression. +

+

This source accepts in input one or more expressions (one for each +channel), which are evaluated and used to generate a corresponding +audio signal. +

+

This source accepts the following options: +

+
+
exprs
+

Set the ’|’-separated expressions list for each separate channel. In case the +channel_layout option is not specified, the selected channel layout +depends on the number of provided expressions. Otherwise the last +specified expression is applied to the remaining output channels. +

+
+
channel_layout, c
+

Set the channel layout. The number of channels in the specified layout +must be equal to the number of specified expressions. +

+
+
duration, d
+

Set the minimum duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +Note that the resulting duration may be greater than the specified +duration, as the generated audio is always cut at the end of a +complete frame. +

+

If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +

+
+
nb_samples, n
+

Set the number of samples per channel per each output frame, +default to 1024. +

+
+
sample_rate, s
+

Specify the sample rate, default to 44100. +

+
+ +

Each expression in exprs can contain the following constants: +

+
+
n
+

number of the evaluated sample, starting from 0 +

+
+
t
+

time of the evaluated sample expressed in seconds, starting from 0 +

+
+
s
+

sample rate +

+
+
+ + +
+

30.2.1 Examples

+ +
    +
  • Generate silence: +
    +
    aevalsrc=0
    +
    + +
  • Generate a sin signal with frequency of 440 Hz, set sample rate to +8000 Hz: +
    +
    aevalsrc="sin(440*2*PI*t):s=8000"
    +
    + +
  • Generate a two channels signal, specify the channel layout (Front +Center + Back Center) explicitly: +
    +
    aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
    +
    + +
  • Generate white noise: +
    +
    aevalsrc="-2+random(0)"
    +
    + +
  • Generate an amplitude modulated signal: +
    +
    aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
    +
    + +
  • Generate 2.5 Hz binaural beats on a 360 Hz carrier: +
    +
    aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
    +
    + +
+ +
+
+
+

30.3 afdelaysrc

+ +

Generate a fractional delay FIR coefficients. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
delay, d
+

Set the fractional delay. Default is 0. +

+
+
sample_rate, r
+

Set the sample rate, default is 44100. +

+
+
nb_samples, n
+

Set the number of samples per each frame. Default is 1024. +

+
+
taps, t
+

Set the number of filter coefficents in output audio stream. +Default value is 0. +

+
+
channel_layout, c
+

Specifies the channel layout, and can be a string representing a channel layout. +The default value of channel_layout is "stereo". +

+
+ +
+
+

30.4 afireqsrc

+ +

Generate a FIR equalizer coefficients. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
preset, p
+

Set equalizer preset. +Default preset is flat. +

+

Available presets are: +

+
custom
+
flat
+
acoustic
+
bass
+
beats
+
classic
+
clear
+
deep bass
+
dubstep
+
electronic
+
hard-style
+
hip-hop
+
jazz
+
metal
+
movie
+
pop
+
r&b
+
rock
+
vocal booster
+
+ +
+
gains, g
+

Set custom gains for each band. Only used if the preset option is set to custom. +Gains are separated by white spaces and each gain is set in dBFS. +Default is 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0. +

+
+
bands, b
+

Set the custom bands from where custon equalizer gains are set. +This must be in strictly increasing order. Only used if the preset option is set to custom. +Bands are separated by white spaces and each band represent frequency in Hz. +Default is 25 40 63 100 160 250 400 630 1000 1600 2500 4000 6300 10000 16000 24000. +

+
+
taps, t
+

Set number of filter coefficents in output audio stream. +Default value is 4096. +

+
+
sample_rate, r
+

Set sample rate of output audio stream, default is 44100. +

+
+
nb_samples, n
+

Set number of samples per each frame in output audio stream. Default is 1024. +

+
+
interp, i
+

Set interpolation method for FIR equalizer coefficients. Can be linear or cubic. +

+
+
phase, h
+

Set phase type of FIR filter. Can be linear or min: minimum-phase. +Default is minimum-phase filter. +

+
+ +
+
+

30.5 afirsrc

+ +

Generate a FIR coefficients using frequency sampling method. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
taps, t
+

Set number of filter coefficents in output audio stream. +Default value is 1025. +

+
+
frequency, f
+

Set frequency points from where magnitude and phase are set. +This must be in non decreasing order, and first element must be 0, while last element +must be 1. Elements are separated by white spaces. +

+
+
magnitude, m
+

Set magnitude value for every frequency point set by frequency. +Number of values must be same as number of frequency points. +Values are separated by white spaces. +

+
+
phase, p
+

Set phase value for every frequency point set by frequency. +Number of values must be same as number of frequency points. +Values are separated by white spaces. +

+
+
sample_rate, r
+

Set sample rate, default is 44100. +

+
+
nb_samples, n
+

Set number of samples per each frame. Default is 1024. +

+
+
win_func, w
+

Set window function. Default is blackman. +

+
+ +
+
+

30.6 anullsrc

+ +

The null audio source, return unprocessed audio frames. It is mainly useful +as a template and to be employed in analysis / debugging tools, or as +the source for filters which ignore the input data (for example the sox +synth filter). +

+

This source accepts the following options: +

+
+
channel_layout, cl
+
+

Specifies the channel layout, and can be either an integer or a string +representing a channel layout. The default value of channel_layout +is "stereo". +

+

Check the channel_layout_map definition in +libavutil/channel_layout.c for the mapping between strings and +channel layout values. +

+
+
sample_rate, r
+

Specifies the sample rate, and defaults to 44100. +

+
+
nb_samples, n
+

Set the number of samples per requested frames. +

+
+
duration, d
+

Set the duration of the sourced audio. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the audio is +supposed to be generated forever. +

+
+ + +
+

30.6.1 Examples

+ +
    +
  • Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO. +
    +
    anullsrc=r=48000:cl=4
    +
    + +
  • Do the same operation with a more obvious syntax: +
    +
    anullsrc=r=48000:cl=mono
    +
    +
+ +

All the parameters need to be explicitly defined. +

+
+
+
+

30.7 flite

+ +

Synthesize a voice utterance using the libflite library. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libflite. +

+

Note that versions of the flite library prior to 2.0 are not thread-safe. +

+

The filter accepts the following options: +

+
+
list_voices
+

If set to 1, list the names of the available voices and exit +immediately. Default value is 0. +

+
+
nb_samples, n
+

Set the maximum number of samples per frame. Default value is 512. +

+
+
textfile
+

Set the filename containing the text to speak. +

+
+
text
+

Set the text to speak. +

+
+
voice, v
+

Set the voice to use for the speech synthesis. Default value is +kal. See also the list_voices option. +

+
+ + +
+

30.7.1 Examples

+ +
    +
  • Read from file speech.txt, and synthesize the text using the +standard flite voice: +
    +
    flite=textfile=speech.txt
    +
    + +
  • Read the specified text selecting the slt voice: +
    +
    flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
    +
    + +
  • Input text to ffmpeg: +
    +
    ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
    +
    + +
  • Make ffplay speak the specified text, using flite and +the lavfi device: +
    +
    ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
    +
    +
+ +

For more information about libflite, check: +http://www.festvox.org/flite/ +

+
+
+
+

30.8 anoisesrc

+ +

Generate a noise audio signal. +

+

The filter accepts the following options: +

+
+
sample_rate, r
+

Specify the sample rate. Default value is 48000 Hz. +

+
+
amplitude, a
+

Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value +is 1.0. +

+
+
duration, d
+

Specify the duration of the generated audio stream. Not specifying this option +results in noise with an infinite length. +

+
+
color, colour, c
+

Specify the color of noise. Available noise colors are white, pink, brown, +blue, violet and velvet. Default color is white. +

+
+
seed, s
+

Specify a value used to seed the PRNG. +

+
+
nb_samples, n
+

Set the number of samples per each output frame, default is 1024. +

+
+
density
+

Set the density (0.0 - 1.0) for the velvet noise generator, default is 0.05. +

+
+ + +
+

30.8.1 Examples

+ +
    +
  • Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5: +
    +
    anoisesrc=d=60:c=pink:r=44100:a=0.5
    +
    +
+ +
+
+
+

30.9 hilbert

+ +

Generate odd-tap Hilbert transform FIR coefficients. +

+

The resulting stream can be used with afir filter for phase-shifting +the signal by 90 degrees. +

+

This is used in many matrix coding schemes and for analytic signal generation. +The process is often written as a multiplication by i (or j), the imaginary unit. +

+

The filter accepts the following options: +

+
+
sample_rate, s
+

Set sample rate, default is 44100. +

+
+
taps, t
+

Set length of FIR filter, default is 22051. +

+
+
nb_samples, n
+

Set number of samples per each frame. +

+
+
win_func, w
+

Set window function to be used when generating FIR coefficients. +

+
+ +
+
+

30.10 sinc

+ +

Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients. +

+

The resulting stream can be used with afir filter for filtering the audio signal. +

+

The filter accepts the following options: +

+
+
sample_rate, r
+

Set sample rate, default is 44100. +

+
+
nb_samples, n
+

Set number of samples per each frame. Default is 1024. +

+
+
hp
+

Set high-pass frequency. Default is 0. +

+
+
lp
+

Set low-pass frequency. Default is 0. +If high-pass frequency is lower than low-pass frequency and low-pass frequency +is higher than 0 then filter will create band-pass filter coefficients, +otherwise band-reject filter coefficients. +

+
+
phase
+

Set filter phase response. Default is 50. Allowed range is from 0 to 100. +

+
+
beta
+

Set Kaiser window beta. +

+
+
att
+

Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB. +

+
+
round
+

Enable rounding, by default is disabled. +

+
+
hptaps
+

Set number of taps for high-pass filter. +

+
+
lptaps
+

Set number of taps for low-pass filter. +

+
+ +
+
+

30.11 sine

+ +

Generate an audio signal made of a sine wave with amplitude 1/8. +

+

The audio signal is bit-exact. +

+

The filter accepts the following options: +

+
+
frequency, f
+

Set the carrier frequency. Default is 440 Hz. +

+
+
beep_factor, b
+

Enable a periodic beep every second with frequency beep_factor times +the carrier frequency. Default is 0, meaning the beep is disabled. +

+
+
sample_rate, r
+

Specify the sample rate, default is 44100. +

+
+
duration, d
+

Specify the duration of the generated audio stream. +

+
+
samples_per_frame
+

Set the number of samples per output frame. +

+

The expression can contain the following constants: +

+
+
n
+

The (sequential) number of the output audio frame, starting from 0. +

+
+
pts
+

The PTS (Presentation TimeStamp) of the output audio frame, +expressed in TB units. +

+
+
t
+

The PTS of the output audio frame, expressed in seconds. +

+
+
TB
+

The timebase of the output audio frames. +

+
+ +

Default is 1024. +

+
+ + +
+

30.11.1 Examples

+ +
    +
  • Generate a simple 440 Hz sine wave: +
    +
    sine
    +
    + +
  • Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds: +
    +
    sine=220:4:d=5
    +sine=f=220:b=4:d=5
    +sine=frequency=220:beep_factor=4:duration=5
    +
    + +
  • Generate a 1 kHz sine wave following 1602,1601,1602,1601,1602 NTSC +pattern: +
    +
    sine=1000:samples_per_frame='st(0,mod(n,5)); 1602-not(not(eq(ld(0),1)+eq(ld(0),3)))'
    +
    +
+ + +
+
+
+
+

31 Audio Sinks

+ +

Below is a description of the currently available audio sinks. +

+ +
+

31.1 abuffersink

+ +

Buffer audio frames, and make them available to the end of filter chain. +

+

This sink is mainly intended for programmatic use, in particular +through the interface defined in libavfilter/buffersink.h +or the options system. +

+

It accepts a pointer to an AVABufferSinkContext structure, which +defines the incoming buffers’ formats, to be passed as the opaque +parameter to avfilter_init_filter for initialization. +

+
+

31.2 anullsink

+ +

Null audio sink; do absolutely nothing with the input audio. It is +mainly useful as a template and for use in analysis / debugging +tools. +

+ +
+
+
+

32 Video Filters

+ +

When you configure your FFmpeg build, you can disable any of the +existing filters using --disable-filters. +The configure output will show the video filters included in your +build. +

+

Below is a description of the currently available video filters. +

+ +
+

32.1 addroi

+ +

Mark a region of interest in a video frame. +

+

The frame data is passed through unchanged, but metadata is attached +to the frame indicating regions of interest which can affect the +behaviour of later encoding. Multiple regions can be marked by +applying the filter multiple times. +

+
+
x
+

Region distance in pixels from the left edge of the frame. +

+
y
+

Region distance in pixels from the top edge of the frame. +

+
w
+

Region width in pixels. +

+
h
+

Region height in pixels. +

+

The parameters x, y, w and h are expressions, +and may contain the following variables: +

+
iw
+

Width of the input frame. +

+
ih
+

Height of the input frame. +

+
+ +
+
qoffset
+

Quantisation offset to apply within the region. +

+

This must be a real value in the range -1 to +1. A value of zero +indicates no quality change. A negative value asks for better quality +(less quantisation), while a positive value asks for worse quality +(greater quantisation). +

+

The range is calibrated so that the extreme values indicate the +largest possible offset - if the rest of the frame is encoded with the +worst possible quality, an offset of -1 indicates that this region +should be encoded with the best possible quality anyway. Intermediate +values are then interpolated in some codec-dependent way. +

+

For example, in 10-bit H.264 the quantisation parameter varies between +-12 and 51. A typical qoffset value of -1/10 therefore indicates that +this region should be encoded with a QP around one-tenth of the full +range better than the rest of the frame. So, if most of the frame +were to be encoded with a QP of around 30, this region would get a QP +of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3). +An extreme value of -1 would indicate that this region should be +encoded with the best possible quality regardless of the treatment of +the rest of the frame - that is, should be encoded at a QP of -12. +

+
clear
+

If set to true, remove any existing regions of interest marked on the +frame before adding the new one. +

+
+ + +
+

32.1.1 Examples

+ +
    +
  • Mark the centre quarter of the frame as interesting. +
    +
    addroi=iw/4:ih/4:iw/2:ih/2:-1/10
    +
    +
  • Mark the 100-pixel-wide region on the left edge of the frame as very +uninteresting (to be encoded at much lower quality than the rest of +the frame). +
    +
    addroi=0:0:100:ih:+1/5
    +
    +
+ +
+
+
+

32.2 alphaextract

+ +

Extract the alpha component from the input as a grayscale video. This +is especially useful with the alphamerge filter. +

+
+
+

32.3 alphamerge

+ +

Add or replace the alpha component of the primary input with the +grayscale value of a second input. This is intended for use with +alphaextract to allow the transmission or storage of frame +sequences that have alpha in a format that doesn’t support an alpha +channel. +

+

For example, to reconstruct full frames from a normal YUV-encoded video +and a separate video created with alphaextract, you might use: +

+
movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
+
+ +
+
+

32.4 amplify

+ +

Amplify differences between current pixel and pixels of adjacent frames in +same pixel location. +

+

This filter accepts the following options: +

+
+
radius
+

Set frame radius. Default is 2. Allowed range is from 1 to 63. +For example radius of 3 will instruct filter to calculate average of 7 frames. +

+
+
factor
+

Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535. +

+
+
threshold
+

Set threshold for difference amplification. Any difference greater or equal to +this value will not alter source pixel. Default is 10. +Allowed range is from 0 to 65535. +

+
+
tolerance
+

Set tolerance for difference amplification. Any difference lower to +this value will not alter source pixel. Default is 0. +Allowed range is from 0 to 65535. +

+
+
low
+

Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535. +This option controls maximum possible value that will decrease source pixel value. +

+
+
high
+

Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535. +This option controls maximum possible value that will increase source pixel value. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+ + +
+

32.4.1 Commands

+ +

This filter supports the following commands that corresponds to option of same name: +

+
factor
+
threshold
+
tolerance
+
low
+
high
+
planes
+
+ +
+
+
+

32.5 ass

+ +

Same as the subtitles filter, except that it doesn’t require libavcodec +and libavformat to work. On the other hand, it is limited to ASS (Advanced +Substation Alpha) subtitles files. +

+

This filter accepts the following option in addition to the common options from +the subtitles filter: +

+
+
shaping
+

Set the shaping engine +

+

Available values are: +

+
auto
+

The default libass shaping engine, which is the best available. +

+
simple
+

Fast, font-agnostic shaper that can do only substitutions +

+
complex
+

Slower shaper using OpenType for substitutions and positioning +

+
+ +

The default is auto. +

+
+ +
+
+

32.6 atadenoise

+

Apply an Adaptive Temporal Averaging Denoiser to the video input. +

+

The filter accepts the following options: +

+
+
0a
+

Set threshold A for 1st plane. Default is 0.02. +Valid range is 0 to 0.3. +

+
+
0b
+

Set threshold B for 1st plane. Default is 0.04. +Valid range is 0 to 5. +

+
+
1a
+

Set threshold A for 2nd plane. Default is 0.02. +Valid range is 0 to 0.3. +

+
+
1b
+

Set threshold B for 2nd plane. Default is 0.04. +Valid range is 0 to 5. +

+
+
2a
+

Set threshold A for 3rd plane. Default is 0.02. +Valid range is 0 to 0.3. +

+
+
2b
+

Set threshold B for 3rd plane. Default is 0.04. +Valid range is 0 to 5. +

+

Threshold A is designed to react on abrupt changes in the input signal and +threshold B is designed to react on continuous changes in the input signal. +

+
+
s
+

Set number of frames filter will use for averaging. Default is 9. Must be odd +number in range [5, 129]. +

+
+
p
+

Set what planes of frame filter will use for averaging. Default is all. +

+
+
a
+

Set what variant of algorithm filter will use for averaging. Default is p parallel. +Alternatively can be set to s serial. +

+

Parallel can be faster then serial, while other way around is never true. +Parallel will abort early on first change being greater then thresholds, while serial +will continue processing other side of frames if they are equal or below thresholds. +

+
+
0s
+
1s
+
2s
+

Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767. +Valid range is from 0 to 32767. +This options controls weight for each pixel in radius defined by size. +Default value means every pixel have same weight. +Setting this option to 0 effectively disables filtering. +

+
+ + +
+

32.6.1 Commands

+

This filter supports same commands as options except option s. +The command accepts the same syntax of the corresponding option. +

+
+
+
+

32.7 avgblur

+ +

Apply average blur filter. +

+

The filter accepts the following options: +

+
+
sizeX
+

Set horizontal radius size. +

+
+
planes
+

Set which planes to filter. By default all planes are filtered. +

+
+
sizeY
+

Set vertical radius size, if zero it will be same as sizeX. +Default is 0. +

+
+ + +
+

32.7.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

32.8 backgroundkey

+ +

Turns a static background into transparency. +

+

The filter accepts the following option: +

+
+
threshold
+

Threshold for scene change detection. +

+
similarity
+

Similarity percentage with the background. +

+
blend
+

Set the blend amount for pixels that are not similar. +

+
+ + +
+

32.8.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.9 bbox

+ +

Compute the bounding box for the non-black pixels in the input frame +luminance plane. +

+

This filter computes the bounding box containing all the pixels with a +luminance value greater than the minimum allowed value. +The parameters describing the bounding box are printed on the filter +log. +

+

The filter accepts the following option: +

+
+
min_val
+

Set the minimal luminance value. Default is 16. +

+
+ + +
+

32.9.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.10 bilateral

+

Apply bilateral filter, spatial smoothing while preserving edges. +

+

The filter accepts the following options: +

+
sigmaS
+

Set sigma of gaussian function to calculate spatial weight. +Allowed range is 0 to 512. Default is 0.1. +

+
+
sigmaR
+

Set sigma of gaussian function to calculate range weight. +Allowed range is 0 to 1. Default is 0.1. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

32.10.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.11 bilateral_cuda

+

CUDA accelerated bilateral filter, an edge preserving filter. +This filter is mathematically accurate thanks to the use of GPU acceleration. +For best output quality, use one to one chroma subsampling, i.e. yuv444p format. +

+

The filter accepts the following options: +

+
sigmaS
+

Set sigma of gaussian function to calculate spatial weight, also called sigma space. +Allowed range is 0.1 to 512. Default is 0.1. +

+
+
sigmaR
+

Set sigma of gaussian function to calculate color range weight, also called sigma color. +Allowed range is 0.1 to 512. Default is 0.1. +

+
+
window_size
+

Set window size of the bilateral function to determine the number of neighbours to loop on. +If the number entered is even, one will be added automatically. +Allowed range is 1 to 255. Default is 1. +

+
+ +
+

32.11.1 Examples

+ +
    +
  • Apply the bilateral filter on a video. + +
    +
    ./ffmpeg -v verbose \
    +-hwaccel cuda -hwaccel_output_format cuda -i input.mp4  \
    +-init_hw_device cuda \
    +-filter_complex \
    +" \
    +[0:v]scale_cuda=format=yuv444p[scaled_video];
    +[scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0" \
    +-an -sn -c:v h264_nvenc -cq 20 out.mp4
    +
    + +
+ +
+
+
+

32.12 bitplanenoise

+ +

Show and measure bit plane noise. +

+

The filter accepts the following options: +

+
+
bitplane
+

Set which plane to analyze. Default is 1. +

+
+
filter
+

Filter out noisy pixels from bitplane set above. +Default is disabled. +

+
+ +
+
+

32.13 blackdetect

+ +

Detect video intervals that are (almost) completely black. Can be +useful to detect chapter transitions, commercials, or invalid +recordings. +

+

The filter outputs its detection analysis to both the log as well as +frame metadata. If a black segment of at least the specified minimum +duration is found, a line with the start and end timestamps as well +as duration is printed to the log with level info. In addition, +a log line with level debug is printed per frame showing the +black amount detected for that frame. +

+

The filter also attaches metadata to the first frame of a black +segment with key lavfi.black_start and to the first frame +after the black segment ends with key lavfi.black_end. The +value is the frame’s timestamp. This metadata is added regardless +of the minimum duration specified. +

+

The filter accepts the following options: +

+
+
black_min_duration, d
+

Set the minimum detected black duration expressed in seconds. It must +be a non-negative floating point number. +

+

Default value is 2.0. +

+
+
picture_black_ratio_th, pic_th
+

Set the threshold for considering a picture "black". +Express the minimum value for the ratio: +

+
nb_black_pixels / nb_pixels
+
+ +

for which a picture is considered black. +Default value is 0.98. +

+
+
pixel_black_th, pix_th
+

Set the threshold for considering a pixel "black". +

+

The threshold expresses the maximum pixel luminance value for which a +pixel is considered "black". The provided value is scaled according to +the following equation: +

+
absolute_threshold = luminance_minimum_value + pixel_black_th * luminance_range_size
+
+ +

luminance_range_size and luminance_minimum_value depend on +the input video format, the range is [0-255] for YUV full-range +formats and [16-235] for YUV non full-range formats. +

+

Default value is 0.10. +

+
+ +

The following example sets the maximum pixel threshold to the minimum +value, and detects only black intervals of 2 or more seconds: +

+
blackdetect=d=2:pix_th=0.00
+
+ +
+
+

32.14 blackframe

+ +

Detect frames that are (almost) completely black. Can be useful to +detect chapter transitions or commercials. Output lines consist of +the frame number of the detected frame, the percentage of blackness, +the position in the file if known or -1 and the timestamp in seconds. +

+

In order to display the output lines, you need to set the loglevel at +least to the AV_LOG_INFO value. +

+

This filter exports frame metadata lavfi.blackframe.pblack. +The value represents the percentage of pixels in the picture that +are below the threshold value. +

+

It accepts the following parameters: +

+
+
amount
+

The percentage of the pixels that have to be below the threshold; it defaults to +98. +

+
+
threshold, thresh
+

The threshold below which a pixel value is considered black; it defaults to +32. +

+
+
+ +
+
+

32.15 blend

+ +

Blend two video frames into each other. +

+

The blend filter takes two input streams and outputs one +stream, the first input is the "top" layer and second input is +"bottom" layer. By default, the output terminates when the longest input terminates. +

+

The tblend (time blend) filter takes two consecutive frames +from one single stream, and outputs the result obtained by blending +the new frame on top of the old frame. +

+

A description of the accepted options follows. +

+
+
c0_mode
+
c1_mode
+
c2_mode
+
c3_mode
+
all_mode
+

Set blend mode for specific pixel component or all pixel components in case +of all_mode. Default value is normal. +

+

Available values for component modes are: +

+
addition
+
and
+
average
+
bleach
+
burn
+
darken
+
difference
+
divide
+
dodge
+
exclusion
+
extremity
+
freeze
+
geometric
+
glow
+
grainextract
+
grainmerge
+
hardlight
+
hardmix
+
hardoverlay
+
harmonic
+
heat
+
interpolate
+
lighten
+
linearlight
+
multiply
+
multiply128
+
negation
+
normal
+
or
+
overlay
+
phoenix
+
pinlight
+
reflect
+
screen
+
softdifference
+
softlight
+
stain
+
subtract
+
vividlight
+
xor
+
+ +
+
c0_opacity
+
c1_opacity
+
c2_opacity
+
c3_opacity
+
all_opacity
+

Set blend opacity for specific pixel component or all pixel components in case +of all_opacity. Only used in combination with pixel component blend modes. +

+
+
c0_expr
+
c1_expr
+
c2_expr
+
c3_expr
+
all_expr
+

Set blend expression for specific pixel component or all pixel components in case +of all_expr. Note that related mode options will be ignored if those are set. +

+

The expressions can use the following variables: +

+
+
N
+

The sequential number of the filtered frame, starting from 0. +

+
+
X
+
Y
+

the coordinates of the current sample +

+
+
W
+
H
+

the width and height of currently filtered plane +

+
+
SW
+
SH
+

Width and height scale for the plane being filtered. It is the +ratio between the dimensions of the current plane to the luma plane, +e.g. for a yuv420p frame, the values are 1,1 for +the luma plane and 0.5,0.5 for the chroma planes. +

+
+
T
+

Time of the current frame, expressed in seconds. +

+
+
TOP, A
+

Value of pixel component at current location for first video frame (top layer). +

+
+
BOTTOM, B
+

Value of pixel component at current location for second video frame (bottom layer). +

+
+
+
+ +

The blend filter also supports the framesync options. +

+ +
+

32.15.1 Examples

+ +
    +
  • Apply transition from bottom layer to top layer in first 10 seconds: +
    +
    blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
    +
    + +
  • Apply linear horizontal transition from top layer to bottom layer: +
    +
    blend=all_expr='A*(X/W)+B*(1-X/W)'
    +
    + +
  • Apply 1x1 checkerboard effect: +
    +
    blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
    +
    + +
  • Apply uncover left effect: +
    +
    blend=all_expr='if(gte(N*SW+X,W),A,B)'
    +
    + +
  • Apply uncover down effect: +
    +
    blend=all_expr='if(gte(Y-N*SH,0),A,B)'
    +
    + +
  • Apply uncover up-left effect: +
    +
    blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
    +
    + +
  • Split diagonally video and shows top and bottom layer on each side: +
    +
    blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
    +
    + +
  • Display differences between the current and the previous frame: +
    +
    tblend=all_mode=grainextract
    +
    +
+ +
+
+

32.15.2 Commands

+

This filter supports same commands as options. +

+
+
+
+

32.16 blockdetect

+ +

Determines blockiness of frames without altering the input frames. +

+

Based on Remco Muijs and Ihor Kirenko: "A no-reference blocking artifact measure for adaptive video processing." 2005 13th European signal processing conference. +

+

The filter accepts the following options: +

+
+
period_min
+
period_max
+

Set minimum and maximum values for determining pixel grids (periods). +Default values are [3,24]. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

32.16.1 Examples

+ +
    +
  • Determine blockiness for the first plane and search for periods within [8,32]: +
    +
    blockdetect=period_min=8:period_max=32:planes=1
    +
    +
+ +
+
+
+

32.17 blurdetect

+ +

Determines blurriness of frames without altering the input frames. +

+

Based on Marziliano, Pina, et al. "A no-reference perceptual blur metric." +Allows for a block-based abbreviation. +

+

The filter accepts the following options: +

+
+
low
+
high
+

Set low and high threshold values used by the Canny thresholding +algorithm. +

+

The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. +

+

low and high threshold values must be chosen in the range +[0,1], and low should be lesser or equal to high. +

+

Default value for low is 20/255, and default value for high +is 50/255. +

+
+
radius
+

Define the radius to search around an edge pixel for local maxima. +

+
+
block_pct
+

Determine blurriness only for the most significant blocks, given in percentage. +

+
+
block_width
+

Determine blurriness for blocks of width block_width. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of block_height. +

+
+
block_height
+

Determine blurriness for blocks of height block_height. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of block_width. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

32.17.1 Examples

+ +
    +
  • Determine blur for 80% of most significant 32x32 blocks: +
    +
    blurdetect=block_width=32:block_height=32:block_pct=80
    +
    +
+ +
+
+
+

32.18 bm3d

+ +

Denoise frames using Block-Matching 3D algorithm. +

+

The filter accepts the following options. +

+
+
sigma
+

Set denoising strength. Default value is 1. +Allowed range is from 0 to 999.9. +The denoising algorithm is very sensitive to sigma, so adjust it +according to the source. +

+
+
block
+

Set local patch size. This sets dimensions in 2D. +

+
+
bstep
+

Set sliding step for processing blocks. Default value is 4. +Allowed range is from 1 to 64. +Smaller values allows processing more reference blocks and is slower. +

+
+
group
+

Set maximal number of similar blocks for 3rd dimension. Default value is 1. +When set to 1, no block matching is done. Larger values allows more blocks +in single group. +Allowed range is from 1 to 256. +

+
+
range
+

Set radius for search block matching. Default is 9. +Allowed range is from 1 to INT32_MAX. +

+
+
mstep
+

Set step between two search locations for block matching. Default is 1. +Allowed range is from 1 to 64. Smaller is slower. +

+
+
thmse
+

Set threshold of mean square error for block matching. Valid range is 0 to +INT32_MAX. +

+
+
hdthr
+

Set thresholding parameter for hard thresholding in 3D transformed domain. +Larger values results in stronger hard-thresholding filtering in frequency +domain. +

+
+
estim
+

Set filtering estimation mode. Can be basic or final. +Default is basic. +

+
+
ref
+

If enabled, filter will use 2nd stream for block matching. +Default is disabled for basic value of estim option, +and always enabled if value of estim is final. +

+
+
planes
+

Set planes to filter. Default is all available except alpha. +

+
+ + +
+

32.18.1 Examples

+ +
    +
  • Basic filtering with bm3d: +
    +
    bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
    +
    + +
  • Same as above, but filtering only luma: +
    +
    bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
    +
    + +
  • Same as above, but with both estimation modes: +
    +
    split[a][b],[a]bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
    +
    + +
  • Same as above, but prefilter with nlmeans filter instead: +
    +
    split[a][b],[a]nlmeans=s=3:r=7:p=3[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
    +
    +
+ +
+
+
+

32.19 boxblur

+ +

Apply a boxblur algorithm to the input video. +

+

It accepts the following parameters: +

+
+
luma_radius, lr
+
luma_power, lp
+
chroma_radius, cr
+
chroma_power, cp
+
alpha_radius, ar
+
alpha_power, ap
+
+ +

A description of the accepted options follows. +

+
+
luma_radius, lr
+
chroma_radius, cr
+
alpha_radius, ar
+

Set an expression for the box radius in pixels used for blurring the +corresponding input plane. +

+

The radius value must be a non-negative number, and must not be +greater than the value of the expression min(w,h)/2 for the +luma and alpha planes, and of min(cw,ch)/2 for the chroma +planes. +

+

Default value for luma_radius is "2". If not specified, +chroma_radius and alpha_radius default to the +corresponding value set for luma_radius. +

+

The expressions can contain the following constants: +

+
w
+
h
+

The input width and height in pixels. +

+
+
cw
+
ch
+

The input chroma image width and height in pixels. +

+
+
hsub
+
vsub
+

The horizontal and vertical chroma subsample values. For example, for the +pixel format "yuv422p", hsub is 2 and vsub is 1. +

+
+ +
+
luma_power, lp
+
chroma_power, cp
+
alpha_power, ap
+

Specify how many times the boxblur filter is applied to the +corresponding plane. +

+

Default value for luma_power is 2. If not specified, +chroma_power and alpha_power default to the +corresponding value set for luma_power. +

+

A value of 0 will disable the effect. +

+
+ + +
+

32.19.1 Examples

+ +
    +
  • Apply a boxblur filter with the luma, chroma, and alpha radii +set to 2: +
    +
    boxblur=luma_radius=2:luma_power=1
    +boxblur=2:1
    +
    + +
  • Set the luma radius to 2, and alpha and chroma radius to 0: +
    +
    boxblur=2:1:cr=0:ar=0
    +
    + +
  • Set the luma and chroma radii to a fraction of the video dimension: +
    +
    boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
    +
    +
+ +
+
+
+

32.20 bwdif

+ +

Deinterlace the input video ("bwdif" stands for "Bob Weaver +Deinterlacing Filter"). +

+

Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic +interpolation algorithms. +It accepts the following parameters: +

+
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
0, send_frame
+

Output one frame for each frame. +

+
1, send_field
+

Output one frame for each field. +

+
+ +

The default value is send_field. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
0, tff
+

Assume the top field is first. +

+
1, bff
+

Assume the bottom field is first. +

+
-1, auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
0, all
+

Deinterlace all frames. +

+
1, interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+ +
+
+

32.21 ccrepack

+ +

Repack CEA-708 closed captioning side data +

+

This filter fixes various issues seen with commerical encoders +related to upstream malformed CEA-708 payloads, specifically +incorrect number of tuples (wrong cc_count for the target FPS), +and incorrect ordering of tuples (i.e. the CEA-608 tuples are not at +the first entries in the payload). +

+
+
+

32.22 cas

+ +

Apply Contrast Adaptive Sharpen filter to video stream. +

+

The filter accepts the following options: +

+
+
strength
+

Set the sharpening strength. Default value is 0. +

+
+
planes
+

Set planes to filter. Default value is to filter all +planes except alpha plane. +

+
+ + +
+

32.22.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

32.23 chromahold

+

Remove all color information for all colors except for certain one. +

+

The filter accepts the following options: +

+
+
color
+

The color which will not be replaced with neutral chroma. +

+
+
similarity
+

Similarity percentage with the above color. +0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +0.0 makes pixels either fully gray, or not gray at all. +Higher values result in more preserved color. +

+
+
yuv
+

Signals that the color passed is already in YUV instead of RGB. +

+

Literal colors like "green" or "red" don’t make sense with this enabled anymore. +This can be used to pass exact YUV values as hexadecimal numbers. +

+
+ + +
+

32.23.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

32.24 chromakey

+

YUV colorspace color/chroma keying. +

+

The filter accepts the following options: +

+
+
color
+

The color which will be replaced with transparency. +

+
+
similarity
+

Similarity percentage with the key color. +

+

0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +

+

0.0 makes pixels either fully transparent, or not transparent at all. +

+

Higher values result in semi-transparent pixels, with a higher transparency +the more similar the pixels color is to the key color. +

+
+
yuv
+

Signals that the color passed is already in YUV instead of RGB. +

+

Literal colors like "green" or "red" don’t make sense with this enabled anymore. +This can be used to pass exact YUV values as hexadecimal numbers. +

+
+ + +
+

32.24.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+

32.24.2 Examples

+ +
    +
  • Make every green pixel in the input image transparent: +
    +
    ffmpeg -i input.png -vf chromakey=green out.png
    +
    + +
  • Overlay a greenscreen-video on top of a static black background. +
    +
    ffmpeg -f lavfi -i color=c=black:s=1280x720 -i video.mp4 -shortest -filter_complex "[1:v]chromakey=0x70de77:0.1:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.mkv
    +
    +
+ +
+
+
+

32.25 chromakey_cuda

+

CUDA accelerated YUV colorspace color/chroma keying. +

+

This filter works like normal chromakey filter but operates on CUDA frames. +for more details and parameters see chromakey. +

+ +
+

32.25.1 Examples

+ +
    +
  • Make all the green pixels in the input video transparent and use it as an overlay for another video: + +
    +
    ./ffmpeg \
    +    -hwaccel cuda -hwaccel_output_format cuda -i input_green.mp4  \
    +    -hwaccel cuda -hwaccel_output_format cuda -i base_video.mp4 \
    +    -init_hw_device cuda \
    +    -filter_complex \
    +    " \
    +        [0:v]chromakey_cuda=0x25302D:0.1:0.12:1[overlay_video]; \
    +        [1:v]scale_cuda=format=yuv420p[base]; \
    +        [base][overlay_video]overlay_cuda" \
    +    -an -sn -c:v h264_nvenc -cq 20 output.mp4
    +
    + +
  • Process two software sources, explicitly uploading the frames: + +
    +
    ./ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda \
    +    -f lavfi -i color=size=800x600:color=white,format=yuv420p \
    +    -f lavfi -i yuvtestsrc=size=200x200,format=yuv420p \
    +    -filter_complex \
    +    " \
    +        [0]hwupload[under]; \
    +        [1]hwupload,chromakey_cuda=green:0.1:0.12[over]; \
    +        [under][over]overlay_cuda" \
    +    -c:v hevc_nvenc -cq 18 -preset slow output.mp4
    +
    + +
+ +
+
+
+

32.26 chromanr

+

Reduce chrominance noise. +

+

The filter accepts the following options: +

+
+
thres
+

Set threshold for averaging chrominance values. +Sum of absolute difference of Y, U and V pixel components of current +pixel and neighbour pixels lower than this threshold will be used in +averaging. Luma component is left unchanged and is copied to output. +Default value is 30. Allowed range is from 1 to 200. +

+
+
sizew
+

Set horizontal radius of rectangle used for averaging. +Allowed range is from 1 to 100. Default value is 5. +

+
+
sizeh
+

Set vertical radius of rectangle used for averaging. +Allowed range is from 1 to 100. Default value is 5. +

+
+
stepw
+

Set horizontal step when averaging. Default value is 1. +Allowed range is from 1 to 50. +Mostly useful to speed-up filtering. +

+
+
steph
+

Set vertical step when averaging. Default value is 1. +Allowed range is from 1 to 50. +Mostly useful to speed-up filtering. +

+
+
threy
+

Set Y threshold for averaging chrominance values. +Set finer control for max allowed difference between Y components +of current pixel and neigbour pixels. +Default value is 200. Allowed range is from 1 to 200. +

+
+
threu
+

Set U threshold for averaging chrominance values. +Set finer control for max allowed difference between U components +of current pixel and neigbour pixels. +Default value is 200. Allowed range is from 1 to 200. +

+
+
threv
+

Set V threshold for averaging chrominance values. +Set finer control for max allowed difference between V components +of current pixel and neigbour pixels. +Default value is 200. Allowed range is from 1 to 200. +

+
+
distance
+

Set distance type used in calculations. +

+
+
manhattan
+

Absolute difference. +

+
euclidean
+

Difference squared. +

+
+ +

Default distance type is manhattan. +

+
+ + +
+

32.26.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+
+
+
+

32.27 chromashift

+

Shift chroma pixels horizontally and/or vertically. +

+

The filter accepts the following options: +

+
cbh
+

Set amount to shift chroma-blue horizontally. +

+
cbv
+

Set amount to shift chroma-blue vertically. +

+
crh
+

Set amount to shift chroma-red horizontally. +

+
crv
+

Set amount to shift chroma-red vertically. +

+
edge
+

Set edge mode, can be smear, default, or warp. +

+
+ + +
+

32.27.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.28 ciescope

+ +

Display CIE color diagram with pixels overlaid onto it. +

+

The filter accepts the following options: +

+
+
system
+

Set color system. +

+
+
ntsc, 470m
+
ebu, 470bg
+
smpte
+
240m
+
apple
+
widergb
+
cie1931
+
rec709, hdtv
+
uhdtv, rec2020
+
dcip3
+
+ +
+
cie
+

Set CIE system. +

+
+
xyy
+
ucs
+
luv
+
+ +
+
gamuts
+

Set what gamuts to draw. +

+

See system option for available values. +

+
+
size, s
+

Set ciescope size, by default set to 512. +

+
+
intensity, i
+

Set intensity used to map input pixel values to CIE diagram. +

+
+
contrast
+

Set contrast used to draw tongue colors that are out of active color system gamut. +

+
+
corrgamma
+

Correct gamma displayed on scope, by default enabled. +

+
+
showwhite
+

Show white point on CIE diagram, by default disabled. +

+
+
gamma
+

Set input gamma. Used only with XYZ input color space. +

+
+
fill
+

Fill with CIE colors. By default is enabled. +

+
+ +
+
+

32.29 codecview

+ +

Visualize information exported by some codecs. +

+

Some codecs can export information through frames using side-data or other +means. For example, some MPEG based codecs export motion vectors through the +export_mvs flag in the codec flags2 option. +

+

The filter accepts the following option: +

+
+
block
+

Display block partition structure using the luma plane. +

+
+
mv
+

Set motion vectors to visualize. +

+

Available flags for mv are: +

+
+
pf
+

forward predicted MVs of P-frames +

+
bf
+

forward predicted MVs of B-frames +

+
bb
+

backward predicted MVs of B-frames +

+
+ +
+
qp
+

Display quantization parameters using the chroma planes. +

+
+
mv_type, mvt
+

Set motion vectors type to visualize. Includes MVs from all frames unless specified by frame_type option. +

+

Available flags for mv_type are: +

+
+
fp
+

forward predicted MVs +

+
bp
+

backward predicted MVs +

+
+ +
+
frame_type, ft
+

Set frame type to visualize motion vectors of. +

+

Available flags for frame_type are: +

+
+
if
+

intra-coded frames (I-frames) +

+
pf
+

predicted frames (P-frames) +

+
bf
+

bi-directionally predicted frames (B-frames) +

+
+
+
+ + +
+

32.29.1 Examples

+ +
    +
  • Visualize forward predicted MVs of all frames using ffplay: +
    +
    ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
    +
    + +
  • Visualize multi-directionals MVs of P and B-Frames using ffplay: +
    +
    ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
    +
    +
+ +
+
+
+

32.30 colorbalance

+

Modify intensity of primary colors (red, green and blue) of input frames. +

+

The filter allows an input frame to be adjusted in the shadows, midtones or highlights +regions for the red-cyan, green-magenta or blue-yellow balance. +

+

A positive adjustment value shifts the balance towards the primary color, a negative +value towards the complementary color. +

+

The filter accepts the following options: +

+
+
rs
+
gs
+
bs
+

Adjust red, green and blue shadows (darkest pixels). +

+
+
rm
+
gm
+
bm
+

Adjust red, green and blue midtones (medium pixels). +

+
+
rh
+
gh
+
bh
+

Adjust red, green and blue highlights (brightest pixels). +

+

Allowed ranges for options are [-1.0, 1.0]. Defaults are 0. +

+
+
pl
+

Preserve lightness when changing color balance. Default is disabled. +

+
+ + +
+

32.30.1 Examples

+ +
    +
  • Add red color cast to shadows: +
    +
    colorbalance=rs=.3
    +
    +
+ +
+
+

32.30.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.31 colorcontrast

+ +

Adjust color contrast between RGB components. +

+

The filter accepts the following options: +

+
+
rc
+

Set the red-cyan contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. +

+
+
gm
+

Set the green-magenta contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. +

+
+
by
+

Set the blue-yellow contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. +

+
+
rcw
+
gmw
+
byw
+

Set the weight of each rc, gm, by option value. Default value is 0.0. +Allowed range is from 0.0 to 1.0. If all weights are 0.0 filtering is disabled. +

+
+
pl
+

Set the amount of preserving lightness. Default value is 0.0. Allowed range is from 0.0 to 1.0. +

+
+ + +
+

32.31.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.32 colorcorrect

+ +

Adjust color white balance selectively for blacks and whites. +This filter operates in YUV colorspace. +

+

The filter accepts the following options: +

+
+
rl
+

Set the red shadow spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
bl
+

Set the blue shadow spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
rh
+

Set the red highlight spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
bh
+

Set the blue highlight spot. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+
saturation
+

Set the amount of saturation. Allowed range is from -3.0 to 3.0. +Default value is 1. +

+
+
analyze
+

If set to anything other than manual it will analyze every frame and use derived +parameters for filtering output frame. +

+

Possible values are: +

+
manual
+
average
+
minmax
+
median
+
+

Default value is manual. +

+
+ + +
+

32.32.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.33 colorchannelmixer

+ +

Adjust video input frames by re-mixing color channels. +

+

This filter modifies a color channel by adding the values associated to +the other channels of the same pixels. For example if the value to +modify is red, the output value will be: +

+
red=red*rr + blue*rb + green*rg + alpha*ra
+
+ +

The filter accepts the following options: +

+
+
rr
+
rg
+
rb
+
ra
+

Adjust contribution of input red, green, blue and alpha channels for output red channel. +Default is 1 for rr, and 0 for rg, rb and ra. +

+
+
gr
+
gg
+
gb
+
ga
+

Adjust contribution of input red, green, blue and alpha channels for output green channel. +Default is 1 for gg, and 0 for gr, gb and ga. +

+
+
br
+
bg
+
bb
+
ba
+

Adjust contribution of input red, green, blue and alpha channels for output blue channel. +Default is 1 for bb, and 0 for br, bg and ba. +

+
+
ar
+
ag
+
ab
+
aa
+

Adjust contribution of input red, green, blue and alpha channels for output alpha channel. +Default is 1 for aa, and 0 for ar, ag and ab. +

+

Allowed ranges for options are [-2.0, 2.0]. +

+
+
pc
+

Set preserve color mode. The accepted values are: +

+
none
+

Disable color preserving, this is default. +

+
lum
+

Preserve luminance. +

+
max
+

Preserve max value of RGB triplet. +

+
avg
+

Preserve average value of RGB triplet. +

+
sum
+

Preserve sum value of RGB triplet. +

+
nrm
+

Preserve normalized value of RGB triplet. +

+
pwr
+

Preserve power value of RGB triplet. +

+
+ +
+
pa
+

Set the preserve color amount when changing colors. Allowed range is from [0.0, 1.0]. +Default is 0.0, thus disabled. +

+
+ + +
+

32.33.1 Examples

+ +
    +
  • Convert source to grayscale: +
    +
    colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
    +
    +
  • Simulate sepia tones: +
    +
    colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
    +
    +
+ +
+
+

32.33.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.34 colorize

+

Overlay a solid color on the video stream. +

+

The filter accepts the following options: +

+
+
hue
+

Set the color hue. Allowed range is from 0 to 360. +Default value is 0. +

+
+
saturation
+

Set the color saturation. Allowed range is from 0 to 1. +Default value is 0.5. +

+
+
lightness
+

Set the color lightness. Allowed range is from 0 to 1. +Default value is 0.5. +

+
+
mix
+

Set the mix of source lightness. By default is set to 1.0. +Allowed range is from 0.0 to 1.0. +

+
+ + +
+

32.34.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.35 colorkey

+

RGB colorspace color keying. +This filter operates on 8-bit RGB format frames by setting the alpha component of each pixel +which falls within the similarity radius of the key color to 0. The alpha value for pixels outside +the similarity radius depends on the value of the blend option. +

+

The filter accepts the following options: +

+
+
color
+

Set the color for which alpha will be set to 0 (full transparency). +See (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +Default is black. +

+
+
similarity
+

Set the radius from the key color within which other colors also have full transparency. +The computed distance is related to the unit fractional distance in 3D space between the RGB values +of the key color and the pixel’s color. Range is 0.01 to 1.0. 0.01 matches within a very small radius +around the exact key color, while 1.0 matches everything. +Default is 0.01. +

+
+
blend
+

Set how the alpha value for pixels that fall outside the similarity radius is computed. +0.0 makes pixels either fully transparent or fully opaque. +Higher values result in semi-transparent pixels, with greater transparency +the more similar the pixel color is to the key color. +Range is 0.0 to 1.0. Default is 0.0. +

+
+ + +
+

32.35.1 Examples

+ +
    +
  • Make every green pixel in the input image transparent: +
    +
    ffmpeg -i input.png -vf colorkey=green out.png
    +
    + +
  • Overlay a greenscreen-video on top of a static background image. +
    +
    ffmpeg -i background.png -i video.mp4 -filter_complex "[1:v]colorkey=0x3BBD1E:0.3:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.flv
    +
    +
+ +
+
+

32.35.2 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

32.36 colorhold

+

Remove all color information for all RGB colors except for certain one. +

+

The filter accepts the following options: +

+
+
color
+

The color which will not be replaced with neutral gray. +

+
+
similarity
+

Similarity percentage with the above color. +0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. 0.0 makes pixels fully gray. +Higher values result in more preserved color. +

+
+ + +
+

32.36.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

32.37 colorlevels

+ +

Adjust video input frames using levels. +

+

The filter accepts the following options: +

+
+
rimin
+
gimin
+
bimin
+
aimin
+

Adjust red, green, blue and alpha input black point. +Allowed ranges for options are [-1.0, 1.0]. Defaults are 0. +

+
+
rimax
+
gimax
+
bimax
+
aimax
+

Adjust red, green, blue and alpha input white point. +Allowed ranges for options are [-1.0, 1.0]. Defaults are 1. +

+

Input levels are used to lighten highlights (bright tones), darken shadows +(dark tones), change the balance of bright and dark tones. +

+
+
romin
+
gomin
+
bomin
+
aomin
+

Adjust red, green, blue and alpha output black point. +Allowed ranges for options are [0, 1.0]. Defaults are 0. +

+
+
romax
+
gomax
+
bomax
+
aomax
+

Adjust red, green, blue and alpha output white point. +Allowed ranges for options are [0, 1.0]. Defaults are 1. +

+

Output levels allows manual selection of a constrained output level range. +

+
+
preserve
+

Set preserve color mode. The accepted values are: +

+
none
+

Disable color preserving, this is default. +

+
lum
+

Preserve luminance. +

+
max
+

Preserve max value of RGB triplet. +

+
avg
+

Preserve average value of RGB triplet. +

+
sum
+

Preserve sum value of RGB triplet. +

+
nrm
+

Preserve normalized value of RGB triplet. +

+
pwr
+

Preserve power value of RGB triplet. +

+
+
+
+ + +
+

32.37.1 Examples

+ +
    +
  • Make video output darker: +
    +
    colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
    +
    + +
  • Increase contrast: +
    +
    colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
    +
    + +
  • Make video output lighter: +
    +
    colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
    +
    + +
  • Increase brightness: +
    +
    colorlevels=romin=0.5:gomin=0.5:bomin=0.5
    +
    +
+ +
+
+

32.37.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.38 colormap

+

Apply custom color maps to video stream. +

+

This filter needs three input video streams. +First stream is video stream that is going to be filtered out. +Second and third video stream specify color patches for source +color to target color mapping. +

+

The filter accepts the following options: +

+
+
patch_size
+

Set the source and target video stream patch size in pixels. +

+
+
nb_patches
+

Set the max number of used patches from source and target video stream. +Default value is number of patches available in additional video streams. +Max allowed number of patches is 64. +

+
+
type
+

Set the adjustments used for target colors. Can be relative or absolute. +Defaults is absolute. +

+
+
kernel
+

Set the kernel used to measure color differences between mapped colors. +

+

The accepted values are: +

+
euclidean
+
weuclidean
+
+ +

Default is euclidean. +

+
+ +
+
+

32.39 colormatrix

+ +

Convert color matrix. +

+

The filter accepts the following options: +

+
+
src
+
dst
+

Specify the source and destination color matrix. Both values must be +specified. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
fcc
+

FCC +

+
+
bt601
+

BT.601 +

+
+
bt470
+

BT.470 +

+
+
bt470bg
+

BT.470BG +

+
+
smpte170m
+

SMPTE-170M +

+
+
smpte240m
+

SMPTE-240M +

+
+
bt2020
+

BT.2020 +

+
+
+
+ +

For example to convert from BT.601 to SMPTE-240M, use the command: +

+
colormatrix=bt601:smpte240m
+
+ +
+
+

32.40 colorspace

+ +

Convert colorspace, transfer characteristics or color primaries. +Input video needs to have an even size. +

+

The filter accepts the following options: +

+
+
+
all
+

Specify all color properties at once. +

+

The accepted values are: +

+
bt470m
+

BT.470M +

+
+
bt470bg
+

BT.470BG +

+
+
bt601-6-525
+

BT.601-6 525 +

+
+
bt601-6-625
+

BT.601-6 625 +

+
+
bt709
+

BT.709 +

+
+
smpte170m
+

SMPTE-170M +

+
+
smpte240m
+

SMPTE-240M +

+
+
bt2020
+

BT.2020 +

+
+
+ +
+
space
+

Specify output colorspace. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
fcc
+

FCC +

+
+
bt470bg
+

BT.470BG or BT.601-6 625 +

+
+
smpte170m
+

SMPTE-170M or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
ycgco
+

YCgCo +

+
+
bt2020ncl
+

BT.2020 with non-constant luminance +

+
+
+ +
+
trc
+

Specify output transfer characteristics. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
bt470m
+

BT.470M +

+
+
bt470bg
+

BT.470BG +

+
+
gamma22
+

Constant gamma of 2.2 +

+
+
gamma28
+

Constant gamma of 2.8 +

+
+
smpte170m
+

SMPTE-170M, BT.601-6 625 or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
srgb
+

SRGB +

+
+
iec61966-2-1
+

iec61966-2-1 +

+
+
iec61966-2-4
+

iec61966-2-4 +

+
+
xvycc
+

xvycc +

+
+
bt2020-10
+

BT.2020 for 10-bits content +

+
+
bt2020-12
+

BT.2020 for 12-bits content +

+
+
+ +
+
primaries
+

Specify output color primaries. +

+

The accepted values are: +

+
bt709
+

BT.709 +

+
+
bt470m
+

BT.470M +

+
+
bt470bg
+

BT.470BG or BT.601-6 625 +

+
+
smpte170m
+

SMPTE-170M or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
film
+

film +

+
+
smpte431
+

SMPTE-431 +

+
+
smpte432
+

SMPTE-432 +

+
+
bt2020
+

BT.2020 +

+
+
jedec-p22
+

JEDEC P22 phosphors +

+
+
+ +
+
range
+

Specify output color range. +

+

The accepted values are: +

+
tv
+

TV (restricted) range +

+
+
mpeg
+

MPEG (restricted) range +

+
+
pc
+

PC (full) range +

+
+
jpeg
+

JPEG (full) range +

+
+
+ +
+
format
+

Specify output color format. +

+

The accepted values are: +

+
yuv420p
+

YUV 4:2:0 planar 8-bits +

+
+
yuv420p10
+

YUV 4:2:0 planar 10-bits +

+
+
yuv420p12
+

YUV 4:2:0 planar 12-bits +

+
+
yuv422p
+

YUV 4:2:2 planar 8-bits +

+
+
yuv422p10
+

YUV 4:2:2 planar 10-bits +

+
+
yuv422p12
+

YUV 4:2:2 planar 12-bits +

+
+
yuv444p
+

YUV 4:4:4 planar 8-bits +

+
+
yuv444p10
+

YUV 4:4:4 planar 10-bits +

+
+
yuv444p12
+

YUV 4:4:4 planar 12-bits +

+
+
+ +
+
fast
+

Do a fast conversion, which skips gamma/primary correction. This will take +significantly less CPU, but will be mathematically incorrect. To get output +compatible with that produced by the colormatrix filter, use fast=1. +

+
+
dither
+

Specify dithering mode. +

+

The accepted values are: +

+
none
+

No dithering +

+
+
fsb
+

Floyd-Steinberg dithering +

+
+ +
+
wpadapt
+

Whitepoint adaptation mode. +

+

The accepted values are: +

+
bradford
+

Bradford whitepoint adaptation +

+
+
vonkries
+

von Kries whitepoint adaptation +

+
+
identity
+

identity whitepoint adaptation (i.e. no whitepoint adaptation) +

+
+ +
+
iall
+

Override all input properties at once. Same accepted values as all. +

+
+
ispace
+

Override input colorspace. Same accepted values as space. +

+
+
iprimaries
+

Override input color primaries. Same accepted values as primaries. +

+
+
itrc
+

Override input transfer characteristics. Same accepted values as trc. +

+
+
irange
+

Override input color range. Same accepted values as range. +

+
+
+ +

The filter converts the transfer characteristics, color space and color +primaries to the specified user values. The output value, if not specified, +is set to a default value based on the "all" property. If that property is +also not specified, the filter will log an error. The output color range and +format default to the same value as the input color range and format. The +input transfer characteristics, color space, color primaries and color range +should be set on the input data. If any of these are missing, the filter will +log an error and no conversion will take place. +

+

For example to convert the input to SMPTE-240M, use the command: +

+
colorspace=smpte240m
+
+ +
+
+

32.41 colorspace_cuda

+ +

CUDA accelerated implementation of the colorspace filter. +

+

It is by no means feature complete compared to the software colorspace filter, +and at the current time only supports color range conversion between jpeg/full +and mpeg/limited range. +

+

The filter accepts the following options: +

+
+
range
+

Specify output color range. +

+

The accepted values are: +

+
tv
+

TV (restricted) range +

+
+
mpeg
+

MPEG (restricted) range +

+
+
pc
+

PC (full) range +

+
+
jpeg
+

JPEG (full) range +

+
+
+ +
+
+ +
+
+

32.42 colortemperature

+

Adjust color temperature in video to simulate variations in ambient color temperature. +

+

The filter accepts the following options: +

+
+
temperature
+

Set the temperature in Kelvin. Allowed range is from 1000 to 40000. +Default value is 6500 K. +

+
+
mix
+

Set mixing with filtered output. Allowed range is from 0 to 1. +Default value is 1. +

+
+
pl
+

Set the amount of preserving lightness. Allowed range is from 0 to 1. +Default value is 0. +

+
+ + +
+

32.42.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

32.43 convolution

+ +

Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements. +

+

The filter accepts the following options: +

+
+
0m
+
1m
+
2m
+
3m
+

Set matrix for each plane. +Matrix is sequence of 9, 25 or 49 signed integers in square mode, +and from 1 to 49 odd number of signed integers in row mode. +

+
+
0rdiv
+
1rdiv
+
2rdiv
+
3rdiv
+

Set multiplier for calculated value for each plane. +If unset or 0, it will be sum of all matrix elements. +

+
+
0bias
+
1bias
+
2bias
+
3bias
+

Set bias for each plane. This value is added to the result of the multiplication. +Useful for making the overall image brighter or darker. Default is 0.0. +

+
+
0mode
+
1mode
+
2mode
+
3mode
+

Set matrix mode for each plane. Can be square, row or column. +Default is square. +

+
+ + +
+

32.43.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

32.43.2 Examples

+ +
    +
  • Apply sharpen: +
    +
    convolution="0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0"
    +
    + +
  • Apply blur: +
    +
    convolution="1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9"
    +
    + +
  • Apply edge enhance: +
    +
    convolution="0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128"
    +
    + +
  • Apply edge detect: +
    +
    convolution="0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128"
    +
    + +
  • Apply laplacian edge detector which includes diagonals: +
    +
    convolution="1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0"
    +
    + +
  • Apply emboss: +
    +
    convolution="-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2"
    +
    +
+ +
+
+
+

32.44 convolve

+ +

Apply 2D convolution of video stream in frequency domain using second stream +as impulse. +

+

The filter accepts the following options: +

+
+
planes
+

Set which planes to process. +

+
+
impulse
+

Set which impulse video frames will be processed, can be first +or all. Default is all. +

+
+ +

The convolve filter also supports the framesync options. +

+
+
+

32.45 copy

+ +

Copy the input video source unchanged to the output. This is mainly useful for +testing purposes. +

+
+
+

32.46 coreimage

+

Video filtering on GPU using Apple’s CoreImage API on OSX. +

+

Hardware acceleration is based on an OpenGL context. Usually, this means it is +processed by video hardware. However, software-based OpenGL implementations +exist which means there is no guarantee for hardware processing. It depends on +the respective OSX. +

+

There are many filters and image generators provided by Apple that come with a +large variety of options. The filter has to be referenced by its name along +with its options. +

+

The coreimage filter accepts the following options: +

+
list_filters
+

List all available filters and generators along with all their respective +options as well as possible minimum and maximum values along with the default +values. +

+
list_filters=true
+
+ +
+
filter
+

Specify all filters by their respective name and options. +Use list_filters to determine all valid filter names and options. +Numerical options are specified by a float value and are automatically clamped +to their respective value range. Vector and color options have to be specified +by a list of space separated float values. Character escaping has to be done. +A special option name default is available to use default options for a +filter. +

+

It is required to specify either default or at least one of the filter options. +All omitted options are used with their default values. +The syntax of the filter string is as follows: +

+
filter=<NAME>@<OPTION>=<VALUE>[@<OPTION>=<VALUE>][@...][#<NAME>@<OPTION>=<VALUE>[@<OPTION>=<VALUE>][@...]][#...]
+
+ +
+
output_rect
+

Specify a rectangle where the output of the filter chain is copied into the +input image. It is given by a list of space separated float values: +

+
output_rect=x\ y\ width\ height
+
+

If not given, the output rectangle equals the dimensions of the input image. +The output rectangle is automatically cropped at the borders of the input +image. Negative values are valid for each component. +

+
output_rect=25\ 25\ 100\ 100
+
+
+
+ +

Several filters can be chained for successive processing without GPU-HOST +transfers allowing for fast processing of complex filter chains. +Currently, only filters with zero (generators) or exactly one (filters) input +image and one output image are supported. Also, transition filters are not yet +usable as intended. +

+

Some filters generate output images with additional padding depending on the +respective filter kernel. The padding is automatically removed to ensure the +filter output has the same size as the input image. +

+

For image generators, the size of the output image is determined by the +previous output image of the filter chain or the input image of the whole +filterchain, respectively. The generators do not use the pixel information of +this image to generate their output. However, the generated output is +blended onto this image, resulting in partial or complete coverage of the +output image. +

+

The coreimagesrc video source can be used for generating input images +which are directly fed into the filter chain. By using it, providing input +images by another video source or an input video is not required. +

+ +
+

32.46.1 Examples

+ +
    +
  • List all filters available: +
    +
    coreimage=list_filters=true
    +
    + +
  • Use the CIBoxBlur filter with default options to blur an image: +
    +
    coreimage=filter=CIBoxBlur@default
    +
    + +
  • Use a filter chain with CISepiaTone at default values and CIVignetteEffect with +its center at 100x100 and a radius of 50 pixels: +
    +
    coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
    +
    + +
  • Use nullsrc and CIQRCodeGenerator to create a QR code for the FFmpeg homepage, +given as complete and escaped command-line for Apple’s standard bash shell: +
    +
    ffmpeg -f lavfi -i nullsrc=s=100x100,coreimage=filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
    +
    +
+ +
+
+
+

32.47 corr

+ +

Obtain the correlation between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained per component, average, min and max correlation is printed through +the logging system. +

+

The filter stores the calculated correlation of each frame in frame metadata. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi corr -f null -
+
+ +
+
+

32.48 cover_rect

+ +

Cover a rectangular object +

+

It accepts the following options: +

+
+
cover
+

Filepath of the optional cover image, needs to be in yuv420. +

+
+
mode
+

Set covering mode. +

+

It accepts the following values: +

+
cover
+

cover it by the supplied image +

+
blur
+

cover it by interpolating the surrounding pixels +

+
+ +

Default value is blur. +

+
+ + +
+

32.48.1 Examples

+ +
    +
  • Cover a rectangular object by the supplied image of a given video using ffmpeg: +
    +
    ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
    +
    +
+ +
+
+
+

32.49 crop

+ +

Crop the input video to given dimensions. +

+

It accepts the following parameters: +

+
+
w, out_w
+

The width of the output video. It defaults to iw. +This expression is evaluated only once during the filter +configuration, or when the ‘w’ or ‘out_w’ command is sent. +

+
+
h, out_h
+

The height of the output video. It defaults to ih. +This expression is evaluated only once during the filter +configuration, or when the ‘h’ or ‘out_h’ command is sent. +

+
+
x
+

The horizontal position, in the input video, of the left edge of the output +video. It defaults to (in_w-out_w)/2. +This expression is evaluated per-frame. +

+
+
y
+

The vertical position, in the input video, of the top edge of the output video. +It defaults to (in_h-out_h)/2. +This expression is evaluated per-frame. +

+
+
keep_aspect
+

If set to 1 will force the output display aspect ratio +to be the same of the input, by changing the output sample aspect +ratio. It defaults to 0. +

+
+
exact
+

Enable exact cropping. If enabled, subsampled videos will be cropped at exact +width/height/x/y as specified and will not be rounded to nearest smaller value. +It defaults to 0. +

+
+ +

The out_w, out_h, x, y parameters are +expressions containing the following constants: +

+
+
x
+
y
+

The computed values for x and y. They are evaluated for +each new frame. +

+
+
in_w
+
in_h
+

The input width and height. +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (cropped) width and height. +

+
+
ow
+
oh
+

These are the same as out_w and out_h. +

+
+
a
+

same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (iw / ih) * sar +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
n
+

The number of the input frame, starting from 0. +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, +do not use +

+
+
t
+

The timestamp expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
+ +

The expression for out_w may depend on the value of out_h, +and the expression for out_h may depend on out_w, but they +cannot depend on x and y, as x and y are +evaluated after out_w and out_h. +

+

The x and y parameters specify the expressions for the +position of the top-left corner of the output (non-cropped) area. They +are evaluated for each frame. If the evaluated value is not valid, it +is approximated to the nearest valid value. +

+

The expression for x may depend on y, and the expression +for y may depend on x. +

+ +
+

32.49.1 Examples

+ +
    +
  • Crop area with size 100x100 at position (12,34). +
    +
    crop=100:100:12:34
    +
    + +

    Using named options, the example above becomes: +

    +
    crop=w=100:h=100:x=12:y=34
    +
    + +
  • Crop the central input area with size 100x100: +
    +
    crop=100:100
    +
    + +
  • Crop the central input area with size 2/3 of the input video: +
    +
    crop=2/3*in_w:2/3*in_h
    +
    + +
  • Crop the input video central square: +
    +
    crop=out_w=in_h
    +crop=in_h
    +
    + +
  • Delimit the rectangle with the top-left corner placed at position +100:100 and the right-bottom corner corresponding to the right-bottom +corner of the input image. +
    +
    crop=in_w-100:in_h-100:100:100
    +
    + +
  • Crop 10 pixels from the left and right borders, and 20 pixels from +the top and bottom borders +
    +
    crop=in_w-2*10:in_h-2*20
    +
    + +
  • Keep only the bottom right quarter of the input image: +
    +
    crop=in_w/2:in_h/2:in_w/2:in_h/2
    +
    + +
  • Crop height for getting Greek harmony: +
    +
    crop=in_w:1/PHI*in_w
    +
    + +
  • Apply trembling effect: +
    +
    crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)
    +
    + +
  • Apply erratic camera effect depending on timestamp: +
    +
    crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)
    +
    + +
  • Set x depending on the value of y: +
    +
    crop=in_w/2:in_h/2:y:10+10*sin(n/10)
    +
    +
+ +
+
+

32.49.2 Commands

+ +

This filter supports the following commands: +

+
w, out_w
+
h, out_h
+
x
+
y
+

Set width/height of the output video and the horizontal/vertical position +in the input video. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

32.50 cropdetect

+ +

Auto-detect the crop size. +

+

It calculates the necessary cropping parameters and prints the +recommended parameters via the logging system. The detected dimensions +correspond to the non-black or video area of the input video according to mode. +

+

It accepts the following parameters: +

+
+
mode
+

Depending on mode crop detection is based on either the mere black value of surrounding pixels or a combination of motion vectors and edge pixels. +

+
+
black
+

Detect black pixels surrounding the playing video. For fine control use option limit. +

+
+
mvedges
+

Detect the playing video by the motion vectors inside the video and scanning for edge pixels typically forming the border of a playing video. +

+
+ +
+
limit
+

Set higher black value threshold, which can be optionally specified +from nothing (0) to everything (255 for 8-bit based formats). An intensity +value greater to the set value is considered non-black. It defaults to 24. +You can also specify a value between 0.0 and 1.0 which will be scaled depending +on the bitdepth of the pixel format. +

+
+
round
+

The value which the width/height should be divisible by. It defaults to +16. The offset is automatically adjusted to center the video. Use 2 to +get only even dimensions (needed for 4:2:2 video). 16 is best when +encoding to most video codecs. +

+
+
skip
+

Set the number of initial frames for which evaluation is skipped. +Default is 2. Range is 0 to INT_MAX. +

+
+
reset_count, reset
+

Set the counter that determines after how many frames cropdetect will +reset the previously detected largest video area and start over to +detect the current optimal crop area. Default value is 0. +

+

This can be useful when channel logos distort the video area. 0 +indicates ’never reset’, and returns the largest area encountered during +playback. +

+
+
mv_threshold
+

Set motion in pixel units as threshold for motion detection. It defaults to 8. +

+
+
low
+
high
+

Set low and high threshold values used by the Canny thresholding +algorithm. +

+

The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. +

+

low and high threshold values must be chosen in the range +[0,1], and low should be lesser or equal to high. +

+

Default value for low is 5/255, and default value for high +is 15/255. +

+
+ + +
+

32.50.1 Examples

+ +
    +
  • Find video area surrounded by black borders: +
    +
    ffmpeg -i file.mp4 -vf cropdetect,metadata=mode=print -f null -
    +
    + +
  • Find an embedded video area, generate motion vectors beforehand: +
    +
    ffmpeg -i file.mp4 -vf mestimate,cropdetect=mode=mvedges,metadata=mode=print -f null -
    +
    + +
  • Find an embedded video area, use motion vectors from decoder: +
    +
    ffmpeg -flags2 +export_mvs -i file.mp4 -vf cropdetect=mode=mvedges,metadata=mode=print -f null -
    +
    +
+ +
+
+

32.50.2 Commands

+ +

This filter supports the following commands: +

+
+
limit
+

The command accepts the same syntax of the corresponding option. +If the specified expression is not valid, it is kept at its current value. +

+
+ +
+
+
+

32.51 cue

+ +

Delay video filtering until a given wallclock timestamp. The filter first +passes on preroll amount of frames, then it buffers at most +buffer amount of frames and waits for the cue. After reaching the cue +it forwards the buffered frames and also any subsequent frames coming in its +input. +

+

The filter can be used synchronize the output of multiple ffmpeg processes for +realtime output devices like decklink. By putting the delay in the filtering +chain and pre-buffering frames the process can pass on data to output almost +immediately after the target wallclock timestamp is reached. +

+

Perfect frame accuracy cannot be guaranteed, but the result is good enough for +some use cases. +

+
+
cue
+

The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0. +

+
+
preroll
+

The duration of content to pass on as preroll expressed in seconds. Default is 0. +

+
+
buffer
+

The maximum duration of content to buffer before waiting for the cue expressed +in seconds. Default is 0. +

+
+
+ +
+
+

32.52 curves

+ +

Apply color adjustments using curves. +

+

This filter is similar to the Adobe Photoshop and GIMP curves tools. Each +component (red, green and blue) has its values defined by N key points +tied from each other using a smooth curve. The x-axis represents the pixel +values from the input frame, and the y-axis the new pixel values to be set for +the output frame. +

+

By default, a component curve is defined by the two points (0;0) and +(1;1). This creates a straight line where each original pixel value is +"adjusted" to its own value, which means no change to the image. +

+

The filter allows you to redefine these two points and add some more. A new +curve will be define to pass smoothly through all these new coordinates. The +new defined points needs to be strictly increasing over the x-axis, and their +x and y values must be in the [0;1] interval. The curve is +formed by using a natural or monotonic cubic spline interpolation, depending +on the interp option (default: natural). The natural +spline produces a smoother curve in general while the monotonic (pchip) +spline guarantees the transitions between the specified points to be +monotonic. If the computed curves happened to go outside the vector spaces, +the values will be clipped accordingly. +

+

The filter accepts the following options: +

+
+
preset
+

Select one of the available color presets. This option can be used in addition +to the r, g, b parameters; in this case, the later +options takes priority on the preset values. +Available presets are: +

+
none
+
color_negative
+
cross_process
+
darker
+
increase_contrast
+
lighter
+
linear_contrast
+
medium_contrast
+
negative
+
strong_contrast
+
vintage
+
+

Default is none. +

+
master, m
+

Set the master key points. These points will define a second pass mapping. It +is sometimes called a "luminance" or "value" mapping. It can be used with +r, g, b or all since it acts like a +post-processing LUT. +

+
red, r
+

Set the key points for the red component. +

+
green, g
+

Set the key points for the green component. +

+
blue, b
+

Set the key points for the blue component. +

+
all
+

Set the key points for all components (not including master). +Can be used in addition to the other key points component +options. In this case, the unset component(s) will fallback on this +all setting. +

+
psfile
+

Specify a Photoshop curves file (.acv) to import the settings from. +

+
plot
+

Save Gnuplot script of the curves in specified file. +

+
interp
+

Specify the kind of interpolation. Available algorithms are: +

+
natural
+

Natural cubic spline using a piece-wise cubic polynomial that is twice continuously differentiable. +

+
pchip
+

Monotonic cubic spline using a piecewise cubic Hermite interpolating polynomial (PCHIP). +

+
+ +
+
+ +

To avoid some filtergraph syntax conflicts, each key points list need to be +defined using the following syntax: x0/y0 x1/y1 x2/y2 .... +

+ +
+

32.52.1 Commands

+ +

This filter supports same commands as options. +

+
+
+

32.52.2 Examples

+ +
    +
  • Increase slightly the middle level of blue: +
    +
    curves=blue='0/0 0.5/0.58 1/1'
    +
    + +
  • Vintage effect: +
    +
    curves=r='0/0.11 .42/.51 1/0.95':g='0/0 0.50/0.48 1/1':b='0/0.22 .49/.44 1/0.8'
    +
    +

    Here we obtain the following coordinates for each components: +

    +
    red
    +

    (0;0.11) (0.42;0.51) (1;0.95) +

    +
    green
    +

    (0;0) (0.50;0.48) (1;1) +

    +
    blue
    +

    (0;0.22) (0.49;0.44) (1;0.80) +

    +
    + +
  • The previous example can also be achieved with the associated built-in preset: +
    +
    curves=preset=vintage
    +
    + +
  • Or simply: +
    +
    curves=vintage
    +
    + +
  • Use a Photoshop preset and redefine the points of the green component: +
    +
    curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
    +
    + +
  • Check out the curves of the cross_process profile using ffmpeg +and gnuplot: +
    +
    ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
    +gnuplot -p /tmp/curves.plt
    +
    +
+ +
+
+
+

32.53 datascope

+ +

Video data analysis filter. +

+

This filter shows hexadecimal pixel values of part of video. +

+

The filter accepts the following options: +

+
+
size, s
+

Set output video size. +

+
+
x
+

Set x offset from where to pick pixels. +

+
+
y
+

Set y offset from where to pick pixels. +

+
+
mode
+

Set scope mode, can be one of the following: +

+
mono
+

Draw hexadecimal pixel values with white color on black background. +

+
+
color
+

Draw hexadecimal pixel values with input video pixel color on black +background. +

+
+
color2
+

Draw hexadecimal pixel values on color background picked from input video, +the text color is picked in such way so its always visible. +

+
+ +
+
axis
+

Draw rows and columns numbers on left and top of video. +

+
+
opacity
+

Set background opacity. +

+
+
format
+

Set display number format. Can be hex, or dec. Default is hex. +

+
+
components
+

Set pixel components to display. By default all pixel components are displayed. +

+
+ + +
+

32.53.1 Commands

+ +

This filter supports same commands as options excluding size option. +

+
+
+
+

32.54 dblur

+

Apply Directional blur filter. +

+

The filter accepts the following options: +

+
+
angle
+

Set angle of directional blur. Default is 45. +

+
+
radius
+

Set radius of directional blur. Default is 5. +

+
+
planes
+

Set which planes to filter. By default all planes are filtered. +

+
+ + +
+

32.54.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

32.55 dctdnoiz

+ +

Denoise frames using 2D DCT (frequency domain filtering). +

+

This filter is not designed for real time. +

+

The filter accepts the following options: +

+
+
sigma, s
+

Set the noise sigma constant. +

+

This sigma defines a hard threshold of 3 * sigma; every DCT +coefficient (absolute value) below this threshold with be dropped. +

+

If you need a more advanced filtering, see expr. +

+

Default is 0. +

+
+
overlap
+

Set number overlapping pixels for each block. Since the filter can be slow, you +may want to reduce this value, at the cost of a less effective filter and the +risk of various artefacts. +

+

If the overlapping value doesn’t permit processing the whole input width or +height, a warning will be displayed and according borders won’t be denoised. +

+

Default value is blocksize-1, which is the best possible setting. +

+
+
expr, e
+

Set the coefficient factor expression. +

+

For each coefficient of a DCT block, this expression will be evaluated as a +multiplier value for the coefficient. +

+

If this is option is set, the sigma option will be ignored. +

+

The absolute value of the coefficient can be accessed through the c +variable. +

+
+
n
+

Set the blocksize using the number of bits. 1<<n defines the +blocksize, which is the width and height of the processed blocks. +

+

The default value is 3 (8x8) and can be raised to 4 for a +blocksize of 16x16. Note that changing this setting has huge consequences +on the speed processing. Also, a larger block size does not necessarily means a +better de-noising. +

+
+ + +
+

32.55.1 Examples

+ +

Apply a denoise with a sigma of 4.5: +

+
dctdnoiz=4.5
+
+ +

The same operation can be achieved using the expression system: +

+
dctdnoiz=e='gte(c, 4.5*3)'
+
+ +

Violent denoise using a block size of 16x16: +

+
dctdnoiz=15:n=4
+
+ +
+
+
+

32.56 deband

+ +

Remove banding artifacts from input video. +It works by replacing banded pixels with average value of referenced pixels. +

+

The filter accepts the following options: +

+
+
1thr
+
2thr
+
3thr
+
4thr
+

Set banding detection threshold for each plane. Default is 0.02. +Valid range is 0.00003 to 0.5. +If difference between current pixel and reference pixel is less than threshold, +it will be considered as banded. +

+
+
range, r
+

Banding detection range in pixels. Default is 16. If positive, random number +in range 0 to set value will be used. If negative, exact absolute value +will be used. +The range defines square of four pixels around current pixel. +

+
+
direction, d
+

Set direction in radians from which four pixel will be compared. If positive, +random direction from 0 to set direction will be picked. If negative, exact of +absolute value will be picked. For example direction 0, -PI or -2*PI radians +will pick only pixels on same row and -PI/2 will pick only pixels on same +column. +

+
+
blur, b
+

If enabled, current pixel is compared with average value of all four +surrounding pixels. The default is enabled. If disabled current pixel is +compared with all four surrounding pixels. The pixel is considered banded +if only all four differences with surrounding pixels are less than threshold. +

+
+
coupling, c
+

If enabled, current pixel is changed if and only if all pixel components are banded, +e.g. banding detection threshold is triggered for all color components. +The default is disabled. +

+
+ + +
+

32.56.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.57 deblock

+ +

Remove blocking artifacts from input video. +

+

The filter accepts the following options: +

+
+
filter
+

Set filter type, can be weak or strong. Default is strong. +This controls what kind of deblocking is applied. +

+
+
block
+

Set size of block, allowed range is from 4 to 512. Default is 8. +

+
+
alpha
+
beta
+
gamma
+
delta
+

Set blocking detection thresholds. Allowed range is 0 to 1. +Defaults are: 0.098 for alpha and 0.05 for the rest. +Using higher threshold gives more deblocking strength. +Setting alpha controls threshold detection at exact edge of block. +Remaining options controls threshold detection near the edge. Each one for +below/above or left/right. Setting any of those to 0 disables +deblocking. +

+
+
planes
+

Set planes to filter. Default is to filter all available planes. +

+
+ + +
+

32.57.1 Examples

+ +
    +
  • Deblock using weak filter and block size of 4 pixels. +
    +
    deblock=filter=weak:block=4
    +
    + +
  • Deblock using strong filter, block size of 4 pixels and custom thresholds for +deblocking more edges. +
    +
    deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
    +
    + +
  • Similar as above, but filter only first plane. +
    +
    deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
    +
    + +
  • Similar as above, but filter only second and third plane. +
    +
    deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
    +
    +
+ +
+
+

32.57.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.58 decimate

+ +

Drop duplicated frames at regular intervals. +

+

The filter accepts the following options: +

+
+
cycle
+

Set the number of frames from which one will be dropped. Setting this to +N means one frame in every batch of N frames will be dropped. +Default is 5. +

+
+
dupthresh
+

Set the threshold for duplicate detection. If the difference metric for a frame +is less than or equal to this value, then it is declared as duplicate. Default +is 1.1 +

+
+
scthresh
+

Set scene change threshold. Default is 15. +

+
+
blockx
+
blocky
+

Set the size of the x and y-axis blocks used during metric calculations. +Larger blocks give better noise suppression, but also give worse detection of +small movements. Must be a power of two. Default is 32. +

+
+
ppsrc
+

Mark main input as a pre-processed input and activate clean source input +stream. This allows the input to be pre-processed with various filters to help +the metrics calculation while keeping the frame selection lossless. When set to +1, the first stream is for the pre-processed input, and the second +stream is the clean source from where the kept frames are chosen. Default is +0. +

+
+
chroma
+

Set whether or not chroma is considered in the metric calculations. Default is +1. +

+
+
mixed
+

Set whether or not the input only partially contains content to be decimated. +Default is false. +If enabled video output stream will be in variable frame rate. +

+
+ +
+
+

32.59 deconvolve

+ +

Apply 2D deconvolution of video stream in frequency domain using second stream +as impulse. +

+

The filter accepts the following options: +

+
+
planes
+

Set which planes to process. +

+
+
impulse
+

Set which impulse video frames will be processed, can be first +or all. Default is all. +

+
+
noise
+

Set noise when doing divisions. Default is 0.0000001. Useful when width +and height are not same and not power of 2 or if stream prior to convolving +had noise. +

+
+ +

The deconvolve filter also supports the framesync options. +

+
+
+

32.60 dedot

+ +

Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video. +

+

It accepts the following options: +

+
+
m
+

Set mode of operation. Can be combination of dotcrawl for cross-luminance reduction and/or +rainbows for cross-color reduction. +

+
+
lt
+

Set spatial luma threshold. Lower values increases reduction of cross-luminance. +

+
+
tl
+

Set tolerance for temporal luma. Higher values increases reduction of cross-luminance. +

+
+
tc
+

Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color. +

+
+
ct
+

Set temporal chroma threshold. Lower values increases reduction of cross-color. +

+
+ +
+
+

32.61 deflate

+ +

Apply deflate effect to the video. +

+

This filter replaces the pixel by the local(3x3) average by taking into account +only values lower than the pixel. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+ + +
+

32.61.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.62 deflicker

+ +

Remove temporal frame luminance variations. +

+

It accepts the following options: +

+
+
size, s
+

Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129. +

+
+
mode, m
+

Set averaging mode to smooth temporal luminance variations. +

+

Available values are: +

+
am
+

Arithmetic mean +

+
+
gm
+

Geometric mean +

+
+
hm
+

Harmonic mean +

+
+
qm
+

Quadratic mean +

+
+
cm
+

Cubic mean +

+
+
pm
+

Power mean +

+
+
median
+

Median +

+
+ +
+
bypass
+

Do not actually modify frame. Useful when one only wants metadata. +

+
+ +
+
+

32.63 dejudder

+ +

Remove judder produced by partially interlaced telecined content. +

+

Judder can be introduced, for instance, by pullup filter. If the original +source was partially telecined content then the output of pullup,dejudder +will have a variable frame rate. May change the recorded frame rate of the +container. Aside from that change, this filter will not affect constant frame +rate video. +

+

The option available in this filter is: +

+
cycle
+

Specify the length of the window over which the judder repeats. +

+

Accepts any integer greater than 1. Useful values are: +

+
4
+

If the original was telecined from 24 to 30 fps (Film to NTSC). +

+
+
5
+

If the original was telecined from 25 to 30 fps (PAL to NTSC). +

+
+
20
+

If a mixture of the two. +

+
+ +

The default is ‘4’. +

+
+ +
+ +
+

32.65 derain

+ +

Remove the rain in the input image/video by applying the derain methods based on +convolutional neural networks. Supported models: +

+ + +

Training as well as model generation scripts are provided in +the repository at https://github.com/XueweiMeng/derain_filter.git. +

+

The filter accepts the following options: +

+
+
filter_type
+

Specify which filter to use. This option accepts the following values: +

+
+
derain
+

Derain filter. To conduct derain filter, you need to use a derain model. +

+
+
dehaze
+

Dehaze filter. To conduct dehaze filter, you need to use a dehaze model. +

+
+

Default value is ‘derain’. +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +the following values: +

+
+
tensorflow
+

TensorFlow backend. To enable this backend you +need to install the TensorFlow for C library (see +https://www.tensorflow.org/install/lang_c) and configure FFmpeg with +--enable-libtensorflow +

+
+ +
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. TensorFlow can load files for only its format. +

+
+ +

To get full functionality (such as async execution), please use the dnn_processing filter. +

+
+
+

32.66 deshake

+ +

Attempt to fix small changes in horizontal and/or vertical shift. This +filter helps remove camera shake from hand-holding a camera, bumping a +tripod, moving on a vehicle, etc. +

+

The filter accepts the following options: +

+
+
x
+
y
+
w
+
h
+

Specify a rectangular area where to limit the search for motion +vectors. +If desired the search for motion vectors can be limited to a +rectangular area of the frame defined by its top left corner, width +and height. These parameters have the same meaning as the drawbox +filter which can be used to visualise the position of the bounding +box. +

+

This is useful when simultaneous movement of subjects within the frame +might be confused for camera motion by the motion vector search. +

+

If any or all of x, y, w and h are set to -1 +then the full frame is used. This allows later options to be set +without specifying the bounding box for the motion vector search. +

+

Default - search the whole frame. +

+
+
rx
+
ry
+

Specify the maximum extent of movement in x and y directions in the +range 0-64 pixels. Default 16. +

+
+
edge
+

Specify how to generate pixels to fill blanks at the edge of the +frame. Available values are: +

+
blank, 0
+

Fill zeroes at blank locations +

+
original, 1
+

Original image at blank locations +

+
clamp, 2
+

Extruded edge value at blank locations +

+
mirror, 3
+

Mirrored edge at blank locations +

+
+

Default value is ‘mirror’. +

+
+
blocksize
+

Specify the blocksize to use for motion search. Range 4-128 pixels, +default 8. +

+
+
contrast
+

Specify the contrast threshold for blocks. Only blocks with more than +the specified contrast (difference between darkest and lightest +pixels) will be considered. Range 1-255, default 125. +

+
+
search
+

Specify the search strategy. Available values are: +

+
exhaustive, 0
+

Set exhaustive search +

+
less, 1
+

Set less exhaustive search. +

+
+

Default value is ‘exhaustive’. +

+
+
filename
+

If set then a detailed log of the motion search is written to the +specified file. +

+
+
+ +
+
+

32.67 despill

+ +

Remove unwanted contamination of foreground colors, caused by reflected color of +greenscreen or bluescreen. +

+

This filter accepts the following options: +

+
+
type
+

Set what type of despill to use. +

+
+
mix
+

Set how spillmap will be generated. +

+
+
expand
+

Set how much to get rid of still remaining spill. +

+
+
red
+

Controls amount of red in spill area. +

+
+
green
+

Controls amount of green in spill area. +Should be -1 for greenscreen. +

+
+
blue
+

Controls amount of blue in spill area. +Should be -1 for bluescreen. +

+
+
brightness
+

Controls brightness of spill area, preserving colors. +

+
+
alpha
+

Modify alpha from generated spillmap. +

+
+ + +
+

32.67.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.68 detelecine

+ +

Apply an exact inverse of the telecine operation. It requires a predefined +pattern specified using the pattern option which must be the same as that passed +to the telecine filter. +

+

This filter accepts the following options: +

+
+
first_field
+
+
top, t
+

top field first +

+
bottom, b
+

bottom field first +The default value is top. +

+
+ +
+
pattern
+

A string of numbers representing the pulldown pattern you wish to apply. +The default value is 23. +

+
+
start_frame
+

A number representing position of the first frame with respect to the telecine +pattern. This is to be used if the stream is cut. The default value is 0. +

+
+ +
+
+

32.69 dilation

+ +

Apply dilation effect to the video. +

+

This filter replaces the pixel by the local(3x3) maximum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. Default is 255 i.e. all eight +pixels are used. +

+

Flags to local 3x3 coordinates maps like this: +

+

1 2 3 + 4 5 + 6 7 8 +

+
+ + +
+

32.69.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.70 displace

+ +

Displace pixels as indicated by second and third input stream. +

+

It takes three input streams and outputs one stream, the first input is the +source, and second and third input are displacement maps. +

+

The second input specifies how much to displace pixels along the +x-axis, while the third input specifies how much to displace pixels +along the y-axis. +If one of displacement map streams terminates, last frame from that +displacement map will be used. +

+

Note that once generated, displacements maps can be reused over and over again. +

+

A description of the accepted options follows. +

+
+
edge
+

Set displace behavior for pixels that are out of range. +

+

Available values are: +

+
blank
+

Missing pixels are replaced by black pixels. +

+
+
smear
+

Adjacent pixels will spread out to replace missing pixels. +

+
+
wrap
+

Out of range pixels are wrapped so they point to pixels of other side. +

+
+
mirror
+

Out of range pixels will be replaced with mirrored pixels. +

+
+

Default is ‘smear’. +

+
+
+ + +
+

32.70.1 Examples

+ +
    +
  • Add ripple effect to rgb input of video size hd720: +
    +
    ffmpeg -i INPUT -f lavfi -i nullsrc=s=hd720,lutrgb=128:128:128 -f lavfi -i nullsrc=s=hd720,geq='r=128+30*sin(2*PI*X/400+T):g=128+30*sin(2*PI*X/400+T):b=128+30*sin(2*PI*X/400+T)' -lavfi '[0][1][2]displace' OUTPUT
    +
    + +
  • Add wave effect to rgb input of video size hd720: +
    +
    ffmpeg -i INPUT -f lavfi -i nullsrc=hd720,geq='r=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):g=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):b=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T))' -lavfi '[1]split[x][y],[0][x][y]displace' OUTPUT
    +
    +
+ +
+
+
+

32.71 dnn_classify

+ +

Do classification with deep neural networks based on bounding boxes. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +only openvino now, tensorflow backends will be added. +

+
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. +

+
+
input
+

Set the input name of the dnn network. +

+
+
output
+

Set the output name of the dnn network. +

+
+
confidence
+

Set the confidence threshold (default: 0.5). +

+
+
labels
+

Set path to label file specifying the mapping between label id and name. +Each label name is written in one line, tailing spaces and empty lines are skipped. +The first line is the name of label id 0, +and the second line is the name of label id 1, etc. +The label id is considered as name if the label file is not provided. +

+
+
backend_configs
+

Set the configs to be passed into backend +

+

For tensorflow backend, you can set its configs with sess_config options, +please use tools/python/tf_sess_config.py to get the configs for your system. +

+
+
+ +
+
+

32.72 dnn_detect

+ +

Do object detection with deep neural networks. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +only openvino now, tensorflow backends will be added. +

+
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. +

+
+
input
+

Set the input name of the dnn network. +

+
+
output
+

Set the output name of the dnn network. +

+
+
confidence
+

Set the confidence threshold (default: 0.5). +

+
+
labels
+

Set path to label file specifying the mapping between label id and name. +Each label name is written in one line, tailing spaces and empty lines are skipped. +The first line is the name of label id 0 (usually it is ’background’), +and the second line is the name of label id 1, etc. +The label id is considered as name if the label file is not provided. +

+
+
backend_configs
+

Set the configs to be passed into backend. To use async execution, set async (default: set). +Roll back to sync execution if the backend does not support async. +

+
+
+ +
+
+

32.73 dnn_processing

+ +

Do image processing with deep neural networks. It works together with another filter +which converts the pixel format of the Frame to what the dnn network requires. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +the following values: +

+
+
tensorflow
+

TensorFlow backend. To enable this backend you +need to install the TensorFlow for C library (see +https://www.tensorflow.org/install/lang_c) and configure FFmpeg with +--enable-libtensorflow +

+
+
openvino
+

OpenVINO backend. To enable this backend you +need to build and install the OpenVINO for C library (see +https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md) and configure FFmpeg with +--enable-libopenvino (–extra-cflags=-I... –extra-ldflags=-L... might +be needed if the header files and libraries are not installed into system path) +

+
+
+ +
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. TensorFlow, OpenVINO backend can load files for only its format. +

+
+
input
+

Set the input name of the dnn network. +

+
+
output
+

Set the output name of the dnn network. +

+
+
backend_configs
+

Set the configs to be passed into backend. To use async execution, set async (default: set). +Roll back to sync execution if the backend does not support async. +

+

For tensorflow backend, you can set its configs with sess_config options, +please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system. +

+
+
+ + +
+

32.73.1 Examples

+ +
    +
  • Remove rain in rgb24 frame with can.pb (see derain filter): +
    +
    ./ffmpeg -i rain.jpg -vf format=rgb24,dnn_processing=dnn_backend=tensorflow:model=can.pb:input=x:output=y derain.jpg
    +
    + +
  • Handle the Y channel with srcnn.pb (see sr filter) for frame with yuv420p (planar YUV formats supported): +
    +
    ./ffmpeg -i 480p.jpg -vf format=yuv420p,scale=w=iw*2:h=ih*2,dnn_processing=dnn_backend=tensorflow:model=srcnn.pb:input=x:output=y -y srcnn.jpg
    +
    + +
  • Handle the Y channel with espcn.pb (see sr filter), which changes frame size, for format yuv420p (planar YUV formats supported), +please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system. +
    +
    ./ffmpeg -i 480p.jpg -vf format=yuv420p,dnn_processing=dnn_backend=tensorflow:model=espcn.pb:input=x:output=y:backend_configs=sess_config=0x10022805320e09cdccccccccccec3f20012a01303801 -y tmp.espcn.jpg
    +
    + +
+ +
+
+
+

32.74 drawbox

+ +

Draw a colored box on the input image. +

+

It accepts the following parameters: +

+
+
x
+
y
+

The expressions which specify the top left corner coordinates of the box. It defaults to 0. +

+
+
width, w
+
height, h
+

The expressions which specify the width and height of the box; if 0 they are interpreted as +the input width and height. It defaults to 0. +

+
+
color, c
+

Specify the color of the box to write. For the general syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. If the special +value invert is used, the box edge color is the same as the +video with inverted luma. +

+
+
thickness, t
+

The expression which sets the thickness of the box edge. +A value of fill will create a filled box. Default value is 3. +

+

See below for the list of accepted constants. +

+
+
replace
+

Applicable if the input has alpha. With value 1, the pixels of the painted box +will overwrite the video’s color and alpha pixels. +Default is 0, which composites the box onto the input, leaving the video’s alpha intact. +

+
+ +

The parameters for x, y, w and h and t are expressions containing the +following constants: +

+
+
dar
+

The input display aspect ratio, it is the same as (w / h) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
in_h, ih
+
in_w, iw
+

The input width and height. +

+
+
sar
+

The input sample aspect ratio. +

+
+
x
+
y
+

The x and y offset coordinates where the box is drawn. +

+
+
w
+
h
+

The width and height of the drawn box. +

+
+
box_source
+

Box source can be set as side_data_detection_bboxes if you want to use box data in +detection bboxes of side data. +

+

If box_source is set, the x, y, width and height will be ignored and +still use box data in detection bboxes of side data. So please do not use this parameter if you were +not sure about the box source. +

+
+
t
+

The thickness of the drawn box. +

+

These constants allow the x, y, w, h and t expressions to refer to +each other, so you may for example specify y=x/dar or h=w/dar. +

+
+
+ + +
+

32.74.1 Examples

+ +
    +
  • Draw a black box around the edge of the input image: +
    +
    drawbox
    +
    + +
  • Draw a box with color red and an opacity of 50%: +
    +
    drawbox=10:20:200:60:red@0.5
    +
    + +

    The previous example can be specified as: +

    +
    drawbox=x=10:y=20:w=200:h=60:color=red@0.5
    +
    + +
  • Fill the box with pink color: +
    +
    drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
    +
    + +
  • Draw a 2-pixel red 2.40:1 mask: +
    +
    drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
    +
    +
+ +
+
+

32.74.2 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

32.75 drawgraph

+

Draw a graph using input video metadata. +

+

It accepts the following parameters: +

+
+
m1
+

Set 1st frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg1
+

Set 1st foreground color expression. +

+
+
m2
+

Set 2nd frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg2
+

Set 2nd foreground color expression. +

+
+
m3
+

Set 3rd frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg3
+

Set 3rd foreground color expression. +

+
+
m4
+

Set 4th frame metadata key from which metadata values will be used to draw a graph. +

+
+
fg4
+

Set 4th foreground color expression. +

+
+
min
+

Set minimal value of metadata value. +

+
+
max
+

Set maximal value of metadata value. +

+
+
bg
+

Set graph background color. Default is white. +

+
+
mode
+

Set graph mode. +

+

Available values for mode is: +

+
bar
+
dot
+
line
+
+ +

Default is line. +

+
+
slide
+

Set slide mode. +

+

Available values for slide is: +

+
frame
+

Draw new frame when right border is reached. +

+
+
replace
+

Replace old columns with new ones. +

+
+
scroll
+

Scroll from right to left. +

+
+
rscroll
+

Scroll from left to right. +

+
+
picture
+

Draw single picture. +

+
+ +

Default is frame. +

+
+
size
+

Set size of graph video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +The default value is 900x256. +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+

The foreground color expressions can use the following variables: +

+
MIN
+

Minimal value of metadata value. +

+
+
MAX
+

Maximal value of metadata value. +

+
+
VAL
+

Current metadata key value. +

+
+ +

The color is defined as 0xAABBGGRR. +

+
+ +

Example using metadata from signalstats filter: +

+
signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
+
+ +

Example using metadata from ebur128 filter: +

+
ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
+
+ +
+
+

32.76 drawgrid

+ +

Draw a grid on the input image. +

+

It accepts the following parameters: +

+
+
x
+
y
+

The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0. +

+
+
width, w
+
height, h
+

The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the +input width and height, respectively, minus thickness, so image gets +framed. Default to 0. +

+
+
color, c
+

Specify the color of the grid. For the general syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. If the special +value invert is used, the grid color is the same as the +video with inverted luma. +

+
+
thickness, t
+

The expression which sets the thickness of the grid line. Default value is 1. +

+

See below for the list of accepted constants. +

+
+
replace
+

Applicable if the input has alpha. With 1 the pixels of the painted grid +will overwrite the video’s color and alpha pixels. +Default is 0, which composites the grid onto the input, leaving the video’s alpha intact. +

+
+ +

The parameters for x, y, w and h and t are expressions containing the +following constants: +

+
+
dar
+

The input display aspect ratio, it is the same as (w / h) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
in_h, ih
+
in_w, iw
+

The input grid cell width and height. +

+
+
sar
+

The input sample aspect ratio. +

+
+
x
+
y
+

The x and y coordinates of some point of grid intersection (meant to configure offset). +

+
+
w
+
h
+

The width and height of the drawn cell. +

+
+
t
+

The thickness of the drawn cell. +

+

These constants allow the x, y, w, h and t expressions to refer to +each other, so you may for example specify y=x/dar or h=w/dar. +

+
+
+ + +
+

32.76.1 Examples

+ +
    +
  • Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%: +
    +
    drawgrid=width=100:height=100:thickness=2:color=red@0.5
    +
    + +
  • Draw a white 3x3 grid with an opacity of 50%: +
    +
    drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
    +
    +
+ +
+
+

32.76.2 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

32.77 drawtext

+ +

Draw a text string or text from a specified file on top of a video, using the +libfreetype library. +

+

To enable compilation of this filter, you need to configure FFmpeg with +--enable-libfreetype. +To enable default font fallback and the font option you need to +configure FFmpeg with --enable-libfontconfig. +To enable the text_shaping option, you need to configure FFmpeg with +--enable-libfribidi. +

+ +
+

32.77.1 Syntax

+ +

It accepts the following parameters: +

+
+
box
+

Used to draw a box around text using the background color. +The value must be either 1 (enable) or 0 (disable). +The default value of box is 0. +

+
+
boxborderw
+

Set the width of the border to be drawn around the box using boxcolor. +The default value of boxborderw is 0. +

+
+
boxcolor
+

The color to be used for drawing box around text. For the syntax of this +option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+

The default value of boxcolor is "white". +

+
+
line_spacing
+

Set the line spacing in pixels of the border to be drawn around the box using box. +The default value of line_spacing is 0. +

+
+
borderw
+

Set the width of the border to be drawn around the text using bordercolor. +The default value of borderw is 0. +

+
+
bordercolor
+

Set the color to be used for drawing border around text. For the syntax of this +option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+

The default value of bordercolor is "black". +

+
+
expansion
+

Select how the text is expanded. Can be either none, +strftime (deprecated) or normal (default). See the +Text expansion section below for details. +

+
+
basetime
+

Set a start time for the count. Value is in microseconds. Only applied +in the deprecated strftime expansion mode. To emulate in normal expansion +mode use the pts function, supplying the start time (in seconds) +as the second argument. +

+
+
fix_bounds
+

If true, check and fix text coords to avoid clipping. +

+
+
fontcolor
+

The color to be used for drawing fonts. For the syntax of this option, check +the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+

The default value of fontcolor is "black". +

+
+
fontcolor_expr
+

String which is expanded the same way as text to obtain dynamic +fontcolor value. By default this option has empty value and is not +processed. When this option is set, it overrides fontcolor option. +

+
+
font
+

The font family to be used for drawing text. By default Sans. +

+
+
fontfile
+

The font file to be used for drawing text. The path must be included. +This parameter is mandatory if the fontconfig support is disabled. +

+
+
alpha
+

Draw the text applying alpha blending. The value can +be a number between 0.0 and 1.0. +The expression accepts the same variables x, y as well. +The default value is 1. +Please see fontcolor_expr. +

+
+
fontsize
+

The font size to be used for drawing text. +The default value of fontsize is 16. +

+
+
text_shaping
+

If set to 1, attempt to shape the text (for example, reverse the order of +right-to-left text and join Arabic characters) before drawing it. +Otherwise, just draw the text exactly as given. +By default 1 (if supported). +

+
+
ft_load_flags
+

The flags to be used for loading the fonts. +

+

The flags map the corresponding flags supported by libfreetype, and are +a combination of the following values: +

+
default
+
no_scale
+
no_hinting
+
render
+
no_bitmap
+
vertical_layout
+
force_autohint
+
crop_bitmap
+
pedantic
+
ignore_global_advance_width
+
no_recurse
+
ignore_transform
+
monochrome
+
linear_design
+
no_autohint
+
+ +

Default value is "default". +

+

For more information consult the documentation for the FT_LOAD_* +libfreetype flags. +

+
+
shadowcolor
+

The color to be used for drawing a shadow behind the drawn text. For the +syntax of this option, check the (ffmpeg-utils)"Color" section in the +ffmpeg-utils manual. +

+

The default value of shadowcolor is "black". +

+
+
shadowx
+
shadowy
+

The x and y offsets for the text shadow position with respect to the +position of the text. They can be either positive or negative +values. The default value for both is "0". +

+
+
start_number
+

The starting frame number for the n/frame_num variable. The default value +is "0". +

+
+
tabsize
+

The size in number of spaces to use for rendering the tab. +Default value is 4. +

+
+
timecode
+

Set the initial timecode representation in "hh:mm:ss[:;.]ff" +format. It can be used with or without text parameter. timecode_rate +option must be specified. +

+
+
timecode_rate, rate, r
+

Set the timecode frame rate (timecode only). Value will be rounded to nearest +integer. Minimum value is "1". +Drop-frame timecode is supported for frame rates 30 & 60. +

+
+
tc24hmax
+

If set to 1, the output of the timecode option will wrap around at 24 hours. +Default is 0 (disabled). +

+
+
text
+

The text string to be drawn. The text must be a sequence of UTF-8 +encoded characters. +This parameter is mandatory if no file is specified with the parameter +textfile. +

+
+
textfile
+

A text file containing text to be drawn. The text must be a sequence +of UTF-8 encoded characters. +

+

This parameter is mandatory if no text string is specified with the +parameter text. +

+

If both text and textfile are specified, an error is thrown. +

+
+
text_source
+

Text source should be set as side_data_detection_bboxes if you want to use text data in +detection bboxes of side data. +

+

If text source is set, text and textfile will be ignored and still use +text data in detection bboxes of side data. So please do not use this parameter +if you are not sure about the text source. +

+
+
reload
+

The textfile will be reloaded at specified frame interval. +Be sure to update textfile atomically, or it may be read partially, +or even fail. +Range is 0 to INT_MAX. Default is 0. +

+
+
x
+
y
+

The expressions which specify the offsets where text will be drawn +within the video frame. They are relative to the top/left border of the +output image. +

+

The default value of x and y is "0". +

+

See below for the list of accepted constants and functions. +

+
+ +

The parameters for x and y are expressions containing the +following constants and functions: +

+
+
dar
+

input display aspect ratio, it is the same as (w / h) * sar +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
line_h, lh
+

the height of each text line +

+
+
main_h, h, H
+

the input height +

+
+
main_w, w, W
+

the input width +

+
+
max_glyph_a, ascent
+

the maximum distance from the baseline to the highest/upper grid +coordinate used to place a glyph outline point, for all the rendered +glyphs. +It is a positive value, due to the grid’s orientation with the Y axis +upwards. +

+
+
max_glyph_d, descent
+

the maximum distance from the baseline to the lowest grid coordinate +used to place a glyph outline point, for all the rendered glyphs. +This is a negative value, due to the grid’s orientation, with the Y axis +upwards. +

+
+
max_glyph_h
+

maximum glyph height, that is the maximum height for all the glyphs +contained in the rendered text, it is equivalent to ascent - +descent. +

+
+
max_glyph_w
+

maximum glyph width, that is the maximum width for all the glyphs +contained in the rendered text +

+
+
n
+

the number of input frame, starting from 0 +

+
+
rand(min, max)
+

return a random number included between min and max +

+
+
sar
+

The input sample aspect ratio. +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
text_h, th
+

the height of the rendered text +

+
+
text_w, tw
+

the width of the rendered text +

+
+
x
+
y
+

the x and y offset coordinates where the text is drawn. +

+

These parameters allow the x and y expressions to refer +to each other, so you can for example specify y=x/dar. +

+
+
pict_type
+

A one character description of the current frame’s picture type. +

+
+
pkt_pos
+

The current packet’s position in the input file or stream +(in bytes, from the start of the input). A value of -1 indicates +this info is not available. +

+
+
duration
+

The current packet’s duration, in seconds. +

+
+
pkt_size
+

The current packet’s size (in bytes). +

+
+ +
+
+

32.77.2 Text expansion

+ +

If expansion is set to strftime, the filter recognizes +sequences accepted by the strftime C function in the provided +text and expands them accordingly. Check the documentation of +strftime. This feature is deprecated in favor of normal +expansion with the gmtime or localtime expansion +functions. +

+

If expansion is set to none, the text is printed verbatim. +

+

If expansion is set to normal (which is the default), +the following expansion mechanism is used. +

+

The backslash character ‘\’, followed by any character, always expands to +the second character. +

+

Sequences of the form %{...} are expanded. The text between the +braces is a function name, possibly followed by arguments separated by ’:’. +If the arguments contain special characters or delimiters (’:’ or ’}’), +they should be escaped. +

+

Note that they probably must also be escaped as the value for the text +option in the filter argument string and as the filter argument in the +filtergraph description, and possibly also for the shell, that makes up to four +levels of escaping; using a text file with the textfile option avoids +these problems. +

+

The following functions are available: +

+
+
expr, e
+

The expression evaluation result. +

+

It must take one argument specifying the expression to be evaluated, +which accepts the same constants and functions as the x and +y values. Note that not all constants should be used, for +example the text size is not known when evaluating the expression, so +the constants text_w and text_h will have an undefined +value. +

+
+
expr_int_format, eif
+

Evaluate the expression’s value and output as formatted integer. +

+

The first argument is the expression to be evaluated, just as for the expr function. +The second argument specifies the output format. Allowed values are ‘x’, +‘X’, ‘d’ and ‘u’. They are treated exactly as in the +printf function. +The third parameter is optional and sets the number of positions taken by the output. +It can be used to add padding with zeros from the left. +

+
+
gmtime
+

The time at which the filter is running, expressed in UTC. +It can accept an argument: a strftime C function format string. +The format string is extended to support the variable %[1-6]N +which prints fractions of the second with optionally specified number of digits. +

+
+
localtime
+

The time at which the filter is running, expressed in the local time zone. +It can accept an argument: a strftime C function format string. +The format string is extended to support the variable %[1-6]N +which prints fractions of the second with optionally specified number of digits. +

+
+
metadata
+

Frame metadata. Takes one or two arguments. +

+

The first argument is mandatory and specifies the metadata key. +

+

The second argument is optional and specifies a default value, used when the +metadata key is not found or empty. +

+

Available metadata can be identified by inspecting entries +starting with TAG included within each frame section +printed by running ffprobe -show_frames. +

+

String metadata generated in filters leading to +the drawtext filter are also available. +

+
+
n, frame_num
+

The frame number, starting from 0. +

+
+
pict_type
+

A one character description of the current picture type. +

+
+
pts
+

The timestamp of the current frame. +It can take up to three arguments. +

+

The first argument is the format of the timestamp; it defaults to flt +for seconds as a decimal number with microsecond accuracy; hms stands +for a formatted [-]HH:MM:SS.mmm timestamp with millisecond accuracy. +gmtime stands for the timestamp of the frame formatted as UTC time; +localtime stands for the timestamp of the frame formatted as +local time zone time. +

+

The second argument is an offset added to the timestamp. +

+

If the format is set to hms, a third argument 24HH may be +supplied to present the hour part of the formatted timestamp in 24h format +(00-23). +

+

If the format is set to localtime or gmtime, a third +argument may be supplied: a strftime C function format string. +By default, YYYY-MM-DD HH:MM:SS format will be used. +

+
+ +
+
+

32.77.3 Commands

+ +

This filter supports altering parameters via commands: +

+
reinit
+

Alter existing filter parameters. +

+

Syntax for the argument is the same as for filter invocation, e.g. +

+
+
fontsize=56:fontcolor=green:text='Hello World'
+
+ +

Full filter invocation with sendcmd would look like this: +

+
+
sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
+
+
+
+ +

If the entire argument can’t be parsed or applied as valid values then the filter will +continue with its existing parameters. +

+
+
+

32.77.4 Examples

+ +
    +
  • Draw "Test Text" with font FreeSerif, using the default values for the +optional parameters. + +
    +
    drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
    +
    + +
  • Draw ’Test Text’ with font FreeSerif of size 24 at position x=100 +and y=50 (counting from the top-left corner of the screen), text is +yellow with a red box around it. Both the text and the box have an +opacity of 20%. + +
    +
    drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
    +          x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
    +
    + +

    Note that the double quotes are not necessary if spaces are not used +within the parameter list. +

    +
  • Show the text at the center of the video frame: +
    +
    drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2"
    +
    + +
  • Show the text at a random position, switching to a new position every 30 seconds: +
    +
    drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=if(eq(mod(t\,30)\,0)\,rand(0\,(w-text_w))\,x):y=if(eq(mod(t\,30)\,0)\,rand(0\,(h-text_h))\,y)"
    +
    + +
  • Show a text line sliding from right to left in the last row of the video +frame. The file LONG_LINE is assumed to contain a single line +with no newlines. +
    +
    drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"
    +
    + +
  • Show the content of file CREDITS off the bottom of the frame and scroll up. +
    +
    drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t"
    +
    + +
  • Draw a single green letter "g", at the center of the input video. +The glyph baseline is placed at half screen height. +
    +
    drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent"
    +
    + +
  • Show text for 1 second every 3 seconds: +
    +
    drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'"
    +
    + +
  • Use fontconfig to set the font. Note that the colons need to be escaped. +
    +
    drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
    +
    + +
  • Draw "Test Text" with font size dependent on height of the video. +
    +
    drawtext="text='Test Text': fontsize=h/30: x=(w-text_w)/2: y=(h-text_h*2)"
    +
    + +
  • Print the date of a real-time encoding (see documentation for the +strftime C function): +
    +
    drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
    +
    + +
  • Show text fading in and out (appearing/disappearing): +
    +
    #!/bin/sh
    +DS=1.0 # display start
    +DE=10.0 # display end
    +FID=1.5 # fade in duration
    +FOD=5 # fade out duration
    +ffplay -f lavfi "color,drawtext=text=TEST:fontsize=50:fontfile=FreeSerif.ttf:fontcolor_expr=ff0000%{eif\\\\: clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - $DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE - $FOD\\, $DE) )\\, 0\\, 255) \\\\: x\\\\: 2 }"
    +
    + +
  • Horizontally align multiple separate texts. Note that max_glyph_a +and the fontsize value are included in the y offset. +
    +
    drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
    +drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
    +
    + +
  • Plot special lavf.image2dec.source_basename metadata onto each frame if +such metadata exists. Otherwise, plot the string "NA". Note that image2 demuxer +must have option -export_path_metadata 1 for the special metadata fields +to be available for filters. +
    +
    drawtext="fontsize=20:fontcolor=white:fontfile=FreeSans.ttf:text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=10:y=10"
    +
    + +
+ +

For more information about libfreetype, check: +http://www.freetype.org/. +

+

For more information about fontconfig, check: +http://freedesktop.org/software/fontconfig/fontconfig-user.html. +

+

For more information about libfribidi, check: +http://fribidi.org/. +

+
+
+
+

32.78 edgedetect

+ +

Detect and draw edges. The filter uses the Canny Edge Detection algorithm. +

+

The filter accepts the following options: +

+
+
low
+
high
+

Set low and high threshold values used by the Canny thresholding +algorithm. +

+

The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. +

+

low and high threshold values must be chosen in the range +[0,1], and low should be lesser or equal to high. +

+

Default value for low is 20/255, and default value for high +is 50/255. +

+
+
mode
+

Define the drawing mode. +

+
+
wires
+

Draw white/gray wires on black background. +

+
+
colormix
+

Mix the colors to create a paint/cartoon effect. +

+
+
canny
+

Apply Canny edge detector on all selected planes. +

+
+

Default value is wires. +

+
+
planes
+

Select planes for filtering. By default all available planes are filtered. +

+
+ + +
+

32.78.1 Examples

+ +
    +
  • Standard edge detection with custom values for the hysteresis thresholding: +
    +
    edgedetect=low=0.1:high=0.4
    +
    + +
  • Painting effect without thresholding: +
    +
    edgedetect=mode=colormix:high=0
    +
    +
+ +
+
+
+

32.79 elbg

+ +

Apply a posterize effect using the ELBG (Enhanced LBG) algorithm. +

+

For each input image, the filter will compute the optimal mapping from +the input to the output given the codebook length, that is the number +of distinct output colors. +

+

This filter accepts the following options. +

+
+
codebook_length, l
+

Set codebook length. The value must be a positive integer, and +represents the number of distinct output colors. Default value is 256. +

+
+
nb_steps, n
+

Set the maximum number of iterations to apply for computing the optimal +mapping. The higher the value the better the result and the higher the +computation time. Default value is 1. +

+
+
seed, s
+

Set a random seed, must be an integer included between 0 and +UINT32_MAX. If not specified, or if explicitly set to -1, the filter +will try to use a good random seed on a best effort basis. +

+
+
pal8
+

Set pal8 output pixel format. This option does not work with codebook +length greater than 256. Default is disabled. +

+
+
use_alpha
+

Include alpha values in the quantization calculation. Allows creating +palettized output images (e.g. PNG8) with multiple alpha smooth blending. +

+
+ +
+
+

32.80 entropy

+ +

Measure graylevel entropy in histogram of color channels of video frames. +

+

It accepts the following parameters: +

+
+
mode
+

Can be either normal or diff. Default is normal. +

+

diff mode measures entropy of histogram delta values, absolute differences +between neighbour histogram values. +

+
+ +
+
+

32.81 epx

+

Apply the EPX magnification filter which is designed for pixel art. +

+

It accepts the following option: +

+
+
n
+

Set the scaling dimension: 2 for 2xEPX, 3 for +3xEPX. +Default is 3. +

+
+ +
+
+

32.82 eq

+

Set brightness, contrast, saturation and approximate gamma adjustment. +

+

The filter accepts the following options: +

+
+
contrast
+

Set the contrast expression. The value must be a float value in range +-1000.0 to 1000.0. The default value is "1". +

+
+
brightness
+

Set the brightness expression. The value must be a float value in +range -1.0 to 1.0. The default value is "0". +

+
+
saturation
+

Set the saturation expression. The value must be a float in +range 0.0 to 3.0. The default value is "1". +

+
+
gamma
+

Set the gamma expression. The value must be a float in range +0.1 to 10.0. The default value is "1". +

+
+
gamma_r
+

Set the gamma expression for red. The value must be a float in +range 0.1 to 10.0. The default value is "1". +

+
+
gamma_g
+

Set the gamma expression for green. The value must be a float in range +0.1 to 10.0. The default value is "1". +

+
+
gamma_b
+

Set the gamma expression for blue. The value must be a float in range +0.1 to 10.0. The default value is "1". +

+
+
gamma_weight
+

Set the gamma weight expression. It can be used to reduce the effect +of a high gamma value on bright image areas, e.g. keep them from +getting overamplified and just plain white. The value must be a float +in range 0.0 to 1.0. A value of 0.0 turns the +gamma correction all the way down while 1.0 leaves it at its +full strength. Default is "1". +

+
+
eval
+

Set when the expressions for brightness, contrast, saturation and +gamma expressions are evaluated. +

+

It accepts the following values: +

+
init
+

only evaluate expressions once during the filter initialization or +when a command is processed +

+
+
frame
+

evaluate expressions for each incoming frame +

+
+ +

Default value is ‘init’. +

+
+ +

The expressions accept the following parameters: +

+
n
+

frame count of the input frame starting from 0 +

+
+
pos
+

byte position of the corresponding packet in the input file, NAN if +unspecified; deprecated, do not use +

+
+
r
+

frame rate of the input video, NAN if the input frame rate is unknown +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+ + +
+

32.82.1 Commands

+

The filter supports the following commands: +

+
+
contrast
+

Set the contrast expression. +

+
+
brightness
+

Set the brightness expression. +

+
+
saturation
+

Set the saturation expression. +

+
+
gamma
+

Set the gamma expression. +

+
+
gamma_r
+

Set the gamma_r expression. +

+
+
gamma_g
+

Set gamma_g expression. +

+
+
gamma_b
+

Set gamma_b expression. +

+
+
gamma_weight
+

Set gamma_weight expression. +

+

The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+ +
+
+
+

32.83 erosion

+ +

Apply erosion effect to the video. +

+

This filter replaces the pixel by the local(3x3) minimum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. Default is 255 i.e. all eight +pixels are used. +

+

Flags to local 3x3 coordinates maps like this: +

+

1 2 3 + 4 5 + 6 7 8 +

+
+ + +
+

32.83.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.84 estdif

+ +

Deinterlace the input video ("estdif" stands for "Edge Slope +Tracing Deinterlacing Filter"). +

+

Spatial only filter that uses edge slope tracing algorithm +to interpolate missing lines. +It accepts the following parameters: +

+
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
frame
+

Output one frame for each frame. +

+
field
+

Output one frame for each field. +

+
+ +

The default value is field. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
tff
+

Assume the top field is first. +

+
bff
+

Assume the bottom field is first. +

+
auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
all
+

Deinterlace all frames. +

+
interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+
rslope
+

Specify the search radius for edge slope tracing. Default value is 1. +Allowed range is from 1 to 15. +

+
+
redge
+

Specify the search radius for best edge matching. Default value is 2. +Allowed range is from 0 to 15. +

+
+
ecost
+

Specify the edge cost for edge matching. Default value is 2. +Allowed range is from 0 to 50. +

+
+
mcost
+

Specify the middle cost for edge matching. Default value is 1. +Allowed range is from 0 to 50. +

+
+
dcost
+

Specify the distance cost for edge matching. Default value is 1. +Allowed range is from 0 to 50. +

+
+
interp
+

Specify the interpolation used. Default is 4-point interpolation. It accepts one +of the following values: +

+
+
2p
+

Two-point interpolation. +

+
4p
+

Four-point interpolation. +

+
6p
+

Six-point interpolation. +

+
+
+
+ + +
+

32.84.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

32.85 exposure

+

Adjust exposure of the video stream. +

+

The filter accepts the following options: +

+
+
exposure
+

Set the exposure correction in EV. Allowed range is from -3.0 to 3.0 EV +Default value is 0 EV. +

+
+
black
+

Set the black level correction. Allowed range is from -1.0 to 1.0. +Default value is 0. +

+
+ + +
+

32.85.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

32.86 extractplanes

+ +

Extract color channel components from input video stream into +separate grayscale video streams. +

+

The filter accepts the following option: +

+
+
planes
+

Set plane(s) to extract. +

+

Available values for planes are: +

+
y
+
u
+
v
+
a
+
r
+
g
+
b
+
+ +

Choosing planes not available in the input will result in an error. +That means you cannot select r, g, b planes +with y, u, v planes at same time. +

+
+ + +
+

32.86.1 Examples

+ +
    +
  • Extract luma, u and v color channel component from input video frame +into 3 grayscale outputs: +
    +
    ffmpeg -i video.avi -filter_complex 'extractplanes=y+u+v[y][u][v]' -map '[y]' y.avi -map '[u]' u.avi -map '[v]' v.avi
    +
    +
+ +
+
+
+

32.87 fade

+ +

Apply a fade-in/out effect to the input video. +

+

It accepts the following parameters: +

+
+
type, t
+

The effect type can be either "in" for a fade-in, or "out" for a fade-out +effect. +Default is in. +

+
+
start_frame, s
+

Specify the number of the frame to start applying the fade +effect at. Default is 0. +

+
+
nb_frames, n
+

The number of frames that the fade effect lasts. At the end of the +fade-in effect, the output video will have the same intensity as the input video. +At the end of the fade-out transition, the output video will be filled with the +selected color. +Default is 25. +

+
+
alpha
+

If set to 1, fade only alpha channel, if one exists on the input. +Default value is 0. +

+
+
start_time, st
+

Specify the timestamp (in seconds) of the frame to start to apply the fade +effect. If both start_frame and start_time are specified, the fade will start at +whichever comes last. Default is 0. +

+
+
duration, d
+

The number of seconds for which the fade effect has to last. At the end of the +fade-in effect the output video will have the same intensity as the input video, +at the end of the fade-out transition the output video will be filled with the +selected color. +If both duration and nb_frames are specified, duration is used. Default is 0 +(nb_frames is used by default). +

+
+
color, c
+

Specify the color of the fade. Default is "black". +

+
+ + +
+

32.87.1 Examples

+ +
    +
  • Fade in the first 30 frames of video: +
    +
    fade=in:0:30
    +
    + +

    The command above is equivalent to: +

    +
    fade=t=in:s=0:n=30
    +
    + +
  • Fade out the last 45 frames of a 200-frame video: +
    +
    fade=out:155:45
    +fade=type=out:start_frame=155:nb_frames=45
    +
    + +
  • Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video: +
    +
    fade=in:0:25, fade=out:975:25
    +
    + +
  • Make the first 5 frames yellow, then fade in from frame 5-24: +
    +
    fade=in:5:20:color=yellow
    +
    + +
  • Fade in alpha over first 25 frames of video: +
    +
    fade=in:0:25:alpha=1
    +
    + +
  • Make the first 5.5 seconds black, then fade in for 0.5 seconds: +
    +
    fade=t=in:st=5.5:d=0.5
    +
    + +
+ +
+
+
+

32.88 feedback

+

Apply feedback video filter. +

+

This filter pass cropped input frames to 2nd output. +From there it can be filtered with other video filters. +After filter receives frame from 2nd input, that frame +is combined on top of original frame from 1st input and passed +to 1st output. +

+

The typical usage is filter only part of frame. +

+

The filter accepts the following options: +

+
x
+
y
+

Set the top left crop position. +

+
+
w
+
h
+

Set the crop size. +

+
+ + +
+

32.88.1 Examples

+ +
    +
  • Blur only top left rectangular part of video frame size 100x100 with gblur filter. +
    +
    [in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]gblur=8[blurin]
    +
    + +
  • Draw black box on top left part of video frame of size 100x100 with drawbox filter. +
    +
    [in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]drawbox=x=0:y=0:w=100:h=100:t=100[blurin]
    +
    +
+ +
+
+
+

32.89 fftdnoiz

+

Denoise frames using 3D FFT (frequency domain filtering). +

+

The filter accepts the following options: +

+
+
sigma
+

Set the noise sigma constant. This sets denoising strength. +Default value is 1. Allowed range is from 0 to 30. +Using very high sigma with low overlap may give blocking artifacts. +

+
+
amount
+

Set amount of denoising. By default all detected noise is reduced. +Default value is 1. Allowed range is from 0 to 1. +

+
+
block
+

Set size of block in pixels, Default is 32, can be 8 to 256. +

+
+
overlap
+

Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8. +

+
+
method
+

Set denoising method. Default is wiener, can also be hard. +

+
+
prev
+

Set number of previous frames to use for denoising. By default is set to 0. +

+
+
next
+

Set number of next frames to to use for denoising. By default is set to 0. +

+
+
planes
+

Set planes which will be filtered, by default are all available filtered +except alpha. +

+
+ +
+
+

32.90 fftfilt

+

Apply arbitrary expressions to samples in frequency domain +

+
+
dc_Y
+

Adjust the dc value (gain) of the luma plane of the image. The filter +accepts an integer value in range 0 to 1000. The default +value is set to 0. +

+
+
dc_U
+

Adjust the dc value (gain) of the 1st chroma plane of the image. The +filter accepts an integer value in range 0 to 1000. The +default value is set to 0. +

+
+
dc_V
+

Adjust the dc value (gain) of the 2nd chroma plane of the image. The +filter accepts an integer value in range 0 to 1000. The +default value is set to 0. +

+
+
weight_Y
+

Set the frequency domain weight expression for the luma plane. +

+
+
weight_U
+

Set the frequency domain weight expression for the 1st chroma plane. +

+
+
weight_V
+

Set the frequency domain weight expression for the 2nd chroma plane. +

+
+
eval
+

Set when the expressions are evaluated. +

+

It accepts the following values: +

+
init
+

Only evaluate expressions once during the filter initialization. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+ +

Default value is ‘init’. +

+

The filter accepts the following variables: +

+
X
+
Y
+

The coordinates of the current sample. +

+
+
W
+
H
+

The width and height of the image. +

+
+
N
+

The number of input frame, starting from 0. +

+
+
WS
+
HS
+

The size of FFT array for horizontal and vertical processing. +

+
+ + +
+

32.90.1 Examples

+ +
    +
  • High-pass: +
    +
    fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
    +
    + +
  • Low-pass: +
    +
    fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
    +
    + +
  • Sharpen: +
    +
    fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
    +
    + +
  • Blur: +
    +
    fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
    +
    + +
+ +
+
+
+

32.91 field

+ +

Extract a single field from an interlaced image using stride +arithmetic to avoid wasting CPU time. The output frames are marked as +non-interlaced. +

+

The filter accepts the following options: +

+
+
type
+

Specify whether to extract the top (if the value is 0 or +top) or the bottom field (if the value is 1 or +bottom). +

+
+ +
+
+

32.92 fieldhint

+ +

Create new frames by copying the top and bottom fields from surrounding frames +supplied as numbers by the hint file. +

+
+
hint
+

Set file containing hints: absolute/relative frame numbers. +

+

There must be one line for each frame in a clip. Each line must contain two +numbers separated by the comma, optionally followed by - or +. +Numbers supplied on each line of file can not be out of [N-1,N+1] where N +is current frame number for absolute mode or out of [-1, 1] range +for relative mode. First number tells from which frame to pick up top +field and second number tells from which frame to pick up bottom field. +

+

If optionally followed by + output frame will be marked as interlaced, +else if followed by - output frame will be marked as progressive, else +it will be marked same as input frame. +If optionally followed by t output frame will use only top field, or in +case of b it will use only bottom field. +If line starts with # or ; that line is skipped. +

+
+
mode
+

Can be item absolute or relative or pattern. Default is absolute. +The pattern mode is same as relative mode, except at last entry of file if there +are more frames to process than hint file is seek back to start. +

+
+ +

Example of first several lines of hint file for relative mode: +

+
0,0 - # first frame
+1,0 - # second frame, use third's frame top field and second's frame bottom field
+1,0 - # third frame, use fourth's frame top field and third's frame bottom field
+1,0 -
+0,0 -
+0,0 -
+1,0 -
+1,0 -
+1,0 -
+0,0 -
+0,0 -
+1,0 -
+1,0 -
+1,0 -
+0,0 -
+
+ +
+
+

32.93 fieldmatch

+ +

Field matching filter for inverse telecine. It is meant to reconstruct the +progressive frames from a telecined stream. The filter does not drop duplicated +frames, so to achieve a complete inverse telecine fieldmatch needs to be +followed by a decimation filter such as decimate in the filtergraph. +

+

The separation of the field matching and the decimation is notably motivated by +the possibility of inserting a de-interlacing filter fallback between the two. +If the source has mixed telecined and real interlaced content, +fieldmatch will not be able to match fields for the interlaced parts. +But these remaining combed frames will be marked as interlaced, and thus can be +de-interlaced by a later filter such as yadif before decimation. +

+

In addition to the various configuration options, fieldmatch can take an +optional second stream, activated through the ppsrc option. If +enabled, the frames reconstruction will be based on the fields and frames from +this second stream. This allows the first input to be pre-processed in order to +help the various algorithms of the filter, while keeping the output lossless +(assuming the fields are matched properly). Typically, a field-aware denoiser, +or brightness/contrast adjustments can help. +

+

Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project) +and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from +which fieldmatch is based on. While the semantic and usage are very +close, some behaviour and options names can differ. +

+

The decimate filter currently only works for constant frame rate input. +If your input has mixed telecined (30fps) and progressive content with a lower +framerate like 24fps use the following filterchain to produce the necessary cfr +stream: dejudder,fps=30000/1001,fieldmatch,decimate. +

+

The filter accepts the following options: +

+
+
order
+

Specify the assumed field order of the input stream. Available values are: +

+
+
auto
+

Auto detect parity (use FFmpeg’s internal parity value). +

+
bff
+

Assume bottom field first. +

+
tff
+

Assume top field first. +

+
+ +

Note that it is sometimes recommended not to trust the parity announced by the +stream. +

+

Default value is auto. +

+
+
mode
+

Set the matching mode or strategy to use. pc mode is the safest in the +sense that it won’t risk creating jerkiness due to duplicate frames when +possible, but if there are bad edits or blended fields it will end up +outputting combed frames when a good match might actually exist. On the other +hand, pcn_ub mode is the most risky in terms of creating jerkiness, +but will almost always find a good frame if there is one. The other values are +all somewhere in between pc and pcn_ub in terms of risking +jerkiness and creating duplicate frames versus finding good matches in sections +with bad edits, orphaned fields, blended fields, etc. +

+

More details about p/c/n/u/b are available in p/c/n/u/b meaning section. +

+

Available values are: +

+
+
pc
+

2-way matching (p/c) +

+
pc_n
+

2-way matching, and trying 3rd match if still combed (p/c + n) +

+
pc_u
+

2-way matching, and trying 3rd match (same order) if still combed (p/c + u) +

+
pc_n_ub
+

2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if +still combed (p/c + n + u/b) +

+
pcn
+

3-way matching (p/c/n) +

+
pcn_ub
+

3-way matching, and trying 4th/5th matches if all 3 of the original matches are +detected as combed (p/c/n + u/b) +

+
+ +

The parenthesis at the end indicate the matches that would be used for that +mode assuming order=tff (and field on auto or +top). +

+

In terms of speed pc mode is by far the fastest and pcn_ub is +the slowest. +

+

Default value is pc_n. +

+
+
ppsrc
+

Mark the main input stream as a pre-processed input, and enable the secondary +input stream as the clean source to pick the fields from. See the filter +introduction for more details. It is similar to the clip2 feature from +VFM/TFM. +

+

Default value is 0 (disabled). +

+
+
field
+

Set the field to match from. It is recommended to set this to the same value as +order unless you experience matching failures with that setting. In +certain circumstances changing the field that is used to match from can have a +large impact on matching performance. Available values are: +

+
+
auto
+

Automatic (same value as order). +

+
bottom
+

Match from the bottom field. +

+
top
+

Match from the top field. +

+
+ +

Default value is auto. +

+
+
mchroma
+

Set whether or not chroma is included during the match comparisons. In most +cases it is recommended to leave this enabled. You should set this to 0 +only if your clip has bad chroma problems such as heavy rainbowing or other +artifacts. Setting this to 0 could also be used to speed things up at +the cost of some accuracy. +

+

Default value is 1. +

+
+
y0
+
y1
+

These define an exclusion band which excludes the lines between y0 and +y1 from being included in the field matching decision. An exclusion +band can be used to ignore subtitles, a logo, or other things that may +interfere with the matching. y0 sets the starting scan line and +y1 sets the ending line; all lines in between y0 and +y1 (including y0 and y1) will be ignored. Setting +y0 and y1 to the same value will disable the feature. +y0 and y1 defaults to 0. +

+
+
scthresh
+

Set the scene change detection threshold as a percentage of maximum change on +the luma plane. Good values are in the [8.0, 14.0] range. Scene change +detection is only relevant in case combmatch=sc. The range for +scthresh is [0.0, 100.0]. +

+

Default value is 12.0. +

+
+
combmatch
+

When combatch is not none, fieldmatch will take into +account the combed scores of matches when deciding what match to use as the +final match. Available values are: +

+
+
none
+

No final matching based on combed scores. +

+
sc
+

Combed scores are only used when a scene change is detected. +

+
full
+

Use combed scores all the time. +

+
+ +

Default is sc. +

+
+
combdbg
+

Force fieldmatch to calculate the combed metrics for certain matches and +print them. This setting is known as micout in TFM/VFM vocabulary. +Available values are: +

+
+
none
+

No forced calculation. +

+
pcn
+

Force p/c/n calculations. +

+
pcnub
+

Force p/c/n/u/b calculations. +

+
+ +

Default value is none. +

+
+
cthresh
+

This is the area combing threshold used for combed frame detection. This +essentially controls how "strong" or "visible" combing must be to be detected. +Larger values mean combing must be more visible and smaller values mean combing +can be less visible or strong and still be detected. Valid settings are from +-1 (every pixel will be detected as combed) to 255 (no pixel will +be detected as combed). This is basically a pixel difference value. A good +range is [8, 12]. +

+

Default value is 9. +

+
+
chroma
+

Sets whether or not chroma is considered in the combed frame decision. Only +disable this if your source has chroma problems (rainbowing, etc.) that are +causing problems for the combed frame detection with chroma enabled. Actually, +using chroma=0 is usually more reliable, except for the case +where there is chroma only combing in the source. +

+

Default value is 0. +

+
+
blockx
+
blocky
+

Respectively set the x-axis and y-axis size of the window used during combed +frame detection. This has to do with the size of the area in which +combpel pixels are required to be detected as combed for a frame to be +declared combed. See the combpel parameter description for more info. +Possible values are any number that is a power of 2 starting at 4 and going up +to 512. +

+

Default value is 16. +

+
+
combpel
+

The number of combed pixels inside any of the blocky by +blockx size blocks on the frame for the frame to be detected as +combed. While cthresh controls how "visible" the combing must be, this +setting controls "how much" combing there must be in any localized area (a +window defined by the blockx and blocky settings) on the +frame. Minimum value is 0 and maximum is blocky x blockx (at +which point no frames will ever be detected as combed). This setting is known +as MI in TFM/VFM vocabulary. +

+

Default value is 80. +

+
+ + +
+

32.93.1 p/c/n/u/b meaning

+ + +
+

32.93.1.1 p/c/n

+ +

We assume the following telecined stream: +

+
+
Top fields:     1 2 2 3 4
+Bottom fields:  1 2 3 4 4
+
+ +

The numbers correspond to the progressive frame the fields relate to. Here, the +first two frames are progressive, the 3rd and 4th are combed, and so on. +

+

When fieldmatch is configured to run a matching from bottom +(field=bottom) this is how this input stream get transformed: +

+
+
Input stream:
+                T     1 2 2 3 4
+                B     1 2 3 4 4   <-- matching reference
+
+Matches:              c c n n c
+
+Output stream:
+                T     1 2 3 4 4
+                B     1 2 3 4 4
+
+ +

As a result of the field matching, we can see that some frames get duplicated. +To perform a complete inverse telecine, you need to rely on a decimation filter +after this operation. See for instance the decimate filter. +

+

The same operation now matching from top fields (field=top) +looks like this: +

+
+
Input stream:
+                T     1 2 2 3 4   <-- matching reference
+                B     1 2 3 4 4
+
+Matches:              c c p p c
+
+Output stream:
+                T     1 2 2 3 4
+                B     1 2 2 3 4
+
+ +

In these examples, we can see what p, c and n mean; +basically, they refer to the frame and field of the opposite parity: +

+
    +
  • p matches the field of the opposite parity in the previous frame +
  • c matches the field of the opposite parity in the current frame +
  • n matches the field of the opposite parity in the next frame +
+ +
+
+

32.93.1.2 u/b

+ +

The u and b matching are a bit special in the sense that they match +from the opposite parity flag. In the following examples, we assume that we are +currently matching the 2nd frame (Top:2, bottom:2). According to the match, a +’x’ is placed above and below each matched fields. +

+

With bottom matching (field=bottom): +

+
Match:           c         p           n          b          u
+
+                 x       x               x        x          x
+  Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
+  Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
+                 x         x           x        x              x
+
+Output frames:
+                 2          1          2          2          2
+                 2          2          2          1          3
+
+ +

With top matching (field=top): +

+
Match:           c         p           n          b          u
+
+                 x         x           x        x              x
+  Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
+  Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
+                 x       x               x        x          x
+
+Output frames:
+                 2          2          2          1          2
+                 2          1          3          2          2
+
+ +
+
+
+

32.93.2 Examples

+ +

Simple IVTC of a top field first telecined stream: +

+
fieldmatch=order=tff:combmatch=none, decimate
+
+ +

Advanced IVTC, with fallback on yadif for still combed frames: +

+
fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
+
+ +
+
+
+

32.94 fieldorder

+ +

Transform the field order of the input video. +

+

It accepts the following parameters: +

+
+
order
+

The output field order. Valid values are tff for top field first or bff +for bottom field first. +

+
+ +

The default value is ‘tff’. +

+

The transformation is done by shifting the picture content up or down +by one line, and filling the remaining line with appropriate picture content. +This method is consistent with most broadcast field order converters. +

+

If the input video is not flagged as being interlaced, or it is already +flagged as being of the required output field order, then this filter does +not alter the incoming video. +

+

It is very useful when converting to or from PAL DV material, +which is bottom field first. +

+

For example: +

+
ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
+
+ +
+
+

32.95 fifo, afifo

+ +

Buffer input images and send them when they are requested. +

+

It is mainly useful when auto-inserted by the libavfilter +framework. +

+

It does not take parameters. +

+
+
+

32.96 fillborders

+ +

Fill borders of the input video, without changing video stream dimensions. +Sometimes video can have garbage at the four edges and you may not want to +crop video input to keep size multiple of some number. +

+

This filter accepts the following options: +

+
+
left
+

Number of pixels to fill from left border. +

+
+
right
+

Number of pixels to fill from right border. +

+
+
top
+

Number of pixels to fill from top border. +

+
+
bottom
+

Number of pixels to fill from bottom border. +

+
+
mode
+

Set fill mode. +

+

It accepts the following values: +

+
smear
+

fill pixels using outermost pixels +

+
+
mirror
+

fill pixels using mirroring (half sample symmetric) +

+
+
fixed
+

fill pixels with constant value +

+
+
reflect
+

fill pixels using reflecting (whole sample symmetric) +

+
+
wrap
+

fill pixels using wrapping +

+
+
fade
+

fade pixels to constant value +

+
+
margins
+

fill pixels at top and bottom with weighted averages pixels near borders +

+
+ +

Default is smear. +

+
+
color
+

Set color for pixels in fixed or fade mode. Default is black. +

+
+ + +
+

32.96.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

32.97 find_rect

+ +

Find a rectangular object in the input video. +

+

The object to search for must be specified as a gray8 image specified with the +object option. +

+

For each possible match, a score is computed. If the score reaches the specified +threshold, the object is considered found. +

+

If the input video contains multiple instances of the object, the filter will +find only one of them. +

+

When an object is found, the following metadata entries are set in the matching +frame: +

+
lavfi.rect.w
+

width of object +

+
+
lavfi.rect.h
+

height of object +

+
+
lavfi.rect.x
+

x position of object +

+
+
lavfi.rect.y
+

y position of object +

+
+
lavfi.rect.score
+

match score of the found object +

+
+ +

It accepts the following options: +

+
+
object
+

Filepath of the object image, needs to be in gray8. +

+
+
threshold
+

Detection threshold, expressed as a decimal number in the range 0-1. +

+

A threshold value of 0.01 means only exact matches, a threshold of 0.99 means +almost everything matches. +

+

Default value is 0.5. +

+
+
mipmaps
+

Number of mipmaps, default is 3. +

+
+
xmin, ymin, xmax, ymax
+

Specifies the rectangle in which to search. +

+
+
discard
+

Discard frames where object is not detected. Default is disabled. +

+
+ + +
+

32.97.1 Examples

+ +
    +
  • Cover a rectangular object by the supplied image of a given video using ffmpeg: +
    +
    ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
    +
    + +
  • Find the position of an object in each frame using ffprobe and write +it to a log file: +
    +
    ffprobe -f lavfi movie=test.mp4,find_rect=object=object.pgm:threshold=0.3 \
    +  -show_entries frame=pkt_pts_time:frame_tags=lavfi.rect.x,lavfi.rect.y \
    +  -of csv -o find_rect.csv
    +
    + +
+ +
+
+
+

32.98 floodfill

+ +

Flood area with values of same pixel components with another values. +

+

It accepts the following options: +

+
x
+

Set pixel x coordinate. +

+
+
y
+

Set pixel y coordinate. +

+
+
s0
+

Set source #0 component value. +

+
+
s1
+

Set source #1 component value. +

+
+
s2
+

Set source #2 component value. +

+
+
s3
+

Set source #3 component value. +

+
+
d0
+

Set destination #0 component value. +

+
+
d1
+

Set destination #1 component value. +

+
+
d2
+

Set destination #2 component value. +

+
+
d3
+

Set destination #3 component value. +

+
+ +
+
+

32.99 format

+ +

Convert the input video to one of the specified pixel formats. +Libavfilter will try to pick one that is suitable as input to +the next filter. +

+

It accepts the following parameters: +

+
pix_fmts
+

A ’|’-separated list of pixel format names, such as +"pix_fmts=yuv420p|monow|rgb24". +

+
+
+ + +
+

32.99.1 Examples

+ +
    +
  • Convert the input video to the yuv420p format +
    +
    format=pix_fmts=yuv420p
    +
    + +

    Convert the input video to any of the formats in the list +

    +
    format=pix_fmts=yuv420p|yuv444p|yuv410p
    +
    +
+ +
+
+
+

32.100 fps

+ +

Convert the video to specified constant frame rate by duplicating or dropping +frames as necessary. +

+

It accepts the following parameters: +

+
fps
+

The desired output frame rate. It accepts expressions containing the following +constants: +

+
+
source_fps
+

The input’s frame rate +

+
+
ntsc
+

NTSC frame rate of 30000/1001 +

+
+
pal
+

PAL frame rate of 25.0 +

+
+
film
+

Film frame rate of 24.0 +

+
+
ntsc_film
+

NTSC-film frame rate of 24000/1001 +

+
+ +

The default is 25. +

+
+
start_time
+

Assume the first PTS should be the given value, in seconds. This allows for +padding/trimming at the start of stream. By default, no assumption is made +about the first frame’s expected PTS, so no padding or trimming is done. +For example, this could be set to 0 to pad the beginning with duplicates of +the first frame if a video stream starts after the audio stream or to trim any +frames with a negative PTS. +

+
+
round
+

Timestamp (PTS) rounding method. +

+

Possible values are: +

+
zero
+

round towards 0 +

+
inf
+

round away from 0 +

+
down
+

round towards -infinity +

+
up
+

round towards +infinity +

+
near
+

round to nearest +

+
+

The default is near. +

+
+
eof_action
+

Action performed when reading the last frame. +

+

Possible values are: +

+
round
+

Use same timestamp rounding method as used for other frames. +

+
pass
+

Pass through last frame if input duration has not been reached yet. +

+
+

The default is round. +

+
+
+ +

Alternatively, the options can be specified as a flat string: +fps[:start_time[:round]]. +

+

See also the setpts filter. +

+ +
+

32.100.1 Examples

+ +
    +
  • A typical usage in order to set the fps to 25: +
    +
    fps=fps=25
    +
    + +
  • Sets the fps to 24, using abbreviation and rounding method to round to nearest: +
    +
    fps=fps=film:round=near
    +
    +
+ +
+
+
+

32.101 framepack

+ +

Pack two different video streams into a stereoscopic video, setting proper +metadata on supported codecs. The two views should have the same size and +framerate and processing will stop when the shorter video ends. Please note +that you may conveniently adjust view properties with the scale and +fps filters. +

+

It accepts the following parameters: +

+
format
+

The desired packing format. Supported values are: +

+
+
sbs
+

The views are next to each other (default). +

+
+
tab
+

The views are on top of each other. +

+
+
lines
+

The views are packed by line. +

+
+
columns
+

The views are packed by column. +

+
+
frameseq
+

The views are temporally interleaved. +

+
+
+ +
+
+ +

Some examples: +

+
+
# Convert left and right views into a frame-sequential video
+ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
+
+# Convert views into a side-by-side video with the same output resolution as the input
+ffmpeg -i LEFT -i RIGHT -filter_complex [0:v]scale=w=iw/2[left],[1:v]scale=w=iw/2[right],[left][right]framepack=sbs OUTPUT
+
+ +
+
+

32.102 framerate

+ +

Change the frame rate by interpolating new video output frames from the source +frames. +

+

This filter is not designed to function correctly with interlaced media. If +you wish to change the frame rate of interlaced media then you are required +to deinterlace before this filter and re-interlace after this filter. +

+

A description of the accepted options follows. +

+
+
fps
+

Specify the output frames per second. This option can also be specified +as a value alone. The default is 50. +

+
+
interp_start
+

Specify the start of a range where the output frame will be created as a +linear interpolation of two frames. The range is [0-255], +the default is 15. +

+
+
interp_end
+

Specify the end of a range where the output frame will be created as a +linear interpolation of two frames. The range is [0-255], +the default is 240. +

+
+
scene
+

Specify the level at which a scene change is detected as a value between +0 and 100 to indicate a new scene; a low value reflects a low +probability for the current frame to introduce a new scene, while a higher +value means the current frame is more likely to be one. +The default is 8.2. +

+
+
flags
+

Specify flags influencing the filter process. +

+

Available value for flags is: +

+
+
scene_change_detect, scd
+

Enable scene change detection using the value of the option scene. +This flag is enabled by default. +

+
+
+
+ +
+
+

32.103 framestep

+ +

Select one frame every N-th frame. +

+

This filter accepts the following option: +

+
step
+

Select frame after every step frames. +Allowed values are positive integers higher than 0. Default value is 1. +

+
+ +
+
+

32.104 freezedetect

+ +

Detect frozen video. +

+

This filter logs a message and sets frame metadata when it detects that the +input video has no significant change in content during a specified duration. +Video freeze detection calculates the mean average absolute difference of all +the components of video frames and compares it to a noise floor. +

+

The printed times and duration are expressed in seconds. The +lavfi.freezedetect.freeze_start metadata key is set on the first frame +whose timestamp equals or exceeds the detection duration and it contains the +timestamp of the first frame of the freeze. The +lavfi.freezedetect.freeze_duration and +lavfi.freezedetect.freeze_end metadata keys are set on the first frame +after the freeze. +

+

The filter accepts the following options: +

+
+
noise, n
+

Set noise tolerance. Can be specified in dB (in case "dB" is appended to the +specified value) or as a difference ratio between 0 and 1. Default is -60dB, or +0.001. +

+
+
duration, d
+

Set freeze duration until notification (default is 2 seconds). +

+
+ +
+
+

32.105 freezeframes

+ +

Freeze video frames. +

+

This filter freezes video frames using frame from 2nd input. +

+

The filter accepts the following options: +

+
+
first
+

Set number of first frame from which to start freeze. +

+
+
last
+

Set number of last frame from which to end freeze. +

+
+
replace
+

Set number of frame from 2nd input which will be used instead of replaced frames. +

+
+ +
+
+

32.106 frei0r

+ +

Apply a frei0r effect to the input video. +

+

To enable the compilation of this filter, you need to install the frei0r +header and configure FFmpeg with --enable-frei0r. +

+

It accepts the following parameters: +

+
+
filter_name
+

The name of the frei0r effect to load. If the environment variable +FREI0R_PATH is defined, the frei0r effect is searched for in each of the +directories specified by the colon-separated list in FREI0R_PATH. +Otherwise, the standard frei0r paths are searched, in this order: +HOME/.frei0r-1/lib/, /usr/local/lib/frei0r-1/, +/usr/lib/frei0r-1/. +

+
+
filter_params
+

A ’|’-separated list of parameters to pass to the frei0r effect. +

+
+
+ +

A frei0r effect parameter can be a boolean (its value is either +"y" or "n"), a double, a color (specified as +R/G/B, where R, G, and B are floating point +numbers between 0.0 and 1.0, inclusive) or a color description as specified in the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual, +a position (specified as X/Y, where +X and Y are floating point numbers) and/or a string. +

+

The number and types of parameters depend on the loaded effect. If an +effect parameter is not specified, the default value is set. +

+ +
+

32.106.1 Examples

+ +
    +
  • Apply the distort0r effect, setting the first two double parameters: +
    +
    frei0r=filter_name=distort0r:filter_params=0.5|0.01
    +
    + +
  • Apply the colordistance effect, taking a color as the first parameter: +
    +
    frei0r=colordistance:0.2/0.3/0.4
    +frei0r=colordistance:violet
    +frei0r=colordistance:0x112233
    +
    + +
  • Apply the perspective effect, specifying the top left and top right image +positions: +
    +
    frei0r=perspective:0.2/0.2|0.8/0.2
    +
    +
+ +

For more information, see +http://frei0r.dyne.org +

+
+
+

32.106.2 Commands

+ +

This filter supports the filter_params option as commands. +

+
+
+
+

32.107 fspp

+ +

Apply fast and simple postprocessing. It is a faster version of spp. +

+

It splits (I)DCT into horizontal/vertical passes. Unlike the simple post- +processing filter, one of them is performed once per block, not per pixel. +This allows for much higher speed. +

+

The filter accepts the following options: +

+
+
quality
+

Set quality. This option defines the number of levels for averaging. It accepts +an integer in the range 4-5. Default value is 4. +

+
+
qp
+

Force a constant quantization parameter. It accepts an integer in range 0-63. +If not set, the filter will use the QP from the video stream (if available). +

+
+
strength
+

Set filter strength. It accepts an integer in range -15 to 32. Lower values mean +more details but also more artifacts, while higher values make the image smoother +but also blurrier. Default value is 0 − PSNR optimal. +

+
+
use_bframe_qp
+

Enable the use of the QP from the B-Frames if set to 1. Using this +option may cause flicker since the B-Frames have often larger QP. Default is +0 (not enabled). +

+
+
+ +
+
+

32.108 gblur

+ +

Apply Gaussian blur filter. +

+

The filter accepts the following options: +

+
+
sigma
+

Set horizontal sigma, standard deviation of Gaussian blur. Default is 0.5. +

+
+
steps
+

Set number of steps for Gaussian approximation. Default is 1. +

+
+
planes
+

Set which planes to filter. By default all planes are filtered. +

+
+
sigmaV
+

Set vertical sigma, if negative it will be same as sigma. +Default is -1. +

+
+ + +
+

32.108.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

32.109 geq

+ +

Apply generic equation to each pixel. +

+

The filter accepts the following options: +

+
+
lum_expr, lum
+

Set the luminance expression. +

+
cb_expr, cb
+

Set the chrominance blue expression. +

+
cr_expr, cr
+

Set the chrominance red expression. +

+
alpha_expr, a
+

Set the alpha expression. +

+
red_expr, r
+

Set the red expression. +

+
green_expr, g
+

Set the green expression. +

+
blue_expr, b
+

Set the blue expression. +

+
+ +

The colorspace is selected according to the specified options. If one +of the lum_expr, cb_expr, or cr_expr +options is specified, the filter will automatically select a YCbCr +colorspace. If one of the red_expr, green_expr, or +blue_expr options is specified, it will select an RGB +colorspace. +

+

If one of the chrominance expression is not defined, it falls back on the other +one. If no alpha expression is specified it will evaluate to opaque value. +If none of chrominance expressions are specified, they will evaluate +to the luminance expression. +

+

The expressions can use the following variables and functions: +

+
+
N
+

The sequential number of the filtered frame, starting from 0. +

+
+
X
+
Y
+

The coordinates of the current sample. +

+
+
W
+
H
+

The width and height of the image. +

+
+
SW
+
SH
+

Width and height scale depending on the currently filtered plane. It is the +ratio between the corresponding luma plane number of pixels and the current +plane ones. E.g. for YUV4:2:0 the values are 1,1 for the luma plane, and +0.5,0.5 for chroma planes. +

+
+
T
+

Time of the current frame, expressed in seconds. +

+
+
p(x, y)
+

Return the value of the pixel at location (x,y) of the current +plane. +

+
+
lum(x, y)
+

Return the value of the pixel at location (x,y) of the luminance +plane. +

+
+
cb(x, y)
+

Return the value of the pixel at location (x,y) of the +blue-difference chroma plane. Return 0 if there is no such plane. +

+
+
cr(x, y)
+

Return the value of the pixel at location (x,y) of the +red-difference chroma plane. Return 0 if there is no such plane. +

+
+
r(x, y)
+
g(x, y)
+
b(x, y)
+

Return the value of the pixel at location (x,y) of the +red/green/blue component. Return 0 if there is no such component. +

+
+
alpha(x, y)
+

Return the value of the pixel at location (x,y) of the alpha +plane. Return 0 if there is no such plane. +

+
+
psum(x,y), lumsum(x, y), cbsum(x,y), crsum(x,y), rsum(x,y), gsum(x,y), bsum(x,y), alphasum(x,y)
+

Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining +sums of samples within a rectangle. See the functions without the sum postfix. +

+
+
interpolation
+

Set one of interpolation methods: +

+
nearest, n
+
bilinear, b
+
+

Default is bilinear. +

+
+ +

For functions, if x and y are outside the area, the value will be +automatically clipped to the closer edge. +

+

Please note that this filter can use multiple threads in which case each slice +will have its own expression state. If you want to use only a single expression +state because your expressions depend on previous state then you should limit +the number of filter threads to 1. +

+ +
+

32.109.1 Examples

+ +
    +
  • Flip the image horizontally: +
    +
    geq=p(W-X\,Y)
    +
    + +
  • Generate a bidimensional sine wave, with angle PI/3 and a +wavelength of 100 pixels: +
    +
    geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
    +
    + +
  • Generate a fancy enigmatic moving light: +
    +
    nullsrc=s=256x256,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128
    +
    + +
  • Generate a quick emboss effect: +
    +
    format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
    +
    + +
  • Modify RGB components depending on pixel position: +
    +
    geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
    +
    + +
  • Create a radial gradient that is the same size as the input (also see +the vignette filter): +
    +
    geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray
    +
    +
+ +
+
+
+

32.110 gradfun

+ +

Fix the banding artifacts that are sometimes introduced into nearly flat +regions by truncation to 8-bit color depth. +Interpolate the gradients that should go where the bands are, and +dither them. +

+

It is designed for playback only. Do not use it prior to +lossy compression, because compression tends to lose the dither and +bring back the bands. +

+

It accepts the following parameters: +

+
+
strength
+

The maximum amount by which the filter will change any one pixel. This is also +the threshold for detecting nearly flat regions. Acceptable values range from +.51 to 64; the default value is 1.2. Out-of-range values will be clipped to the +valid range. +

+
+
radius
+

The neighborhood to fit the gradient to. A larger radius makes for smoother +gradients, but also prevents the filter from modifying the pixels near detailed +regions. Acceptable values are 8-32; the default value is 16. Out-of-range +values will be clipped to the valid range. +

+
+
+ +

Alternatively, the options can be specified as a flat string: +strength[:radius] +

+ +
+

32.110.1 Examples

+ +
    +
  • Apply the filter with a 3.5 strength and radius of 8: +
    +
    gradfun=3.5:8
    +
    + +
  • Specify radius, omitting the strength (which will fall-back to the default +value): +
    +
    gradfun=radius=8
    +
    + +
+ +
+
+
+

32.111 graphmonitor

+

Show various filtergraph stats. +

+

With this filter one can debug complete filtergraph. +Especially issues with links filling with queued frames. +

+

The filter accepts the following options: +

+
+
size, s
+

Set video output size. Default is hd720. +

+
+
opacity, o
+

Set video opacity. Default is 0.9. Allowed range is from 0 to 1. +

+
+
mode, m
+

Set output mode flags. +

+

Available values for flags are: +

+
full
+

No any filtering. Default. +

+
compact
+

Show only filters with queued frames. +

+
nozero
+

Show only filters with non-zero stats. +

+
noeof
+

Show only filters with non-eof stat. +

+
nodisabled
+

Show only filters that are enabled in timeline. +

+
+ +
+
flags, f
+

Set flags which enable which stats are shown in video. +

+

Available values for flags are: +

+
none
+

All flags turned off. +

+
+
all
+

All flags turned on. +

+
+
queue
+

Display number of queued frames in each link. +

+
+
frame_count_in
+

Display number of frames taken from filter. +

+
+
frame_count_out
+

Display number of frames given out from filter. +

+
+
frame_count_delta
+

Display delta number of frames between above two values. +

+
+
pts
+

Display current filtered frame pts. +

+
+
pts_delta
+

Display pts delta between current and previous frame. +

+
+
time
+

Display current filtered frame time. +

+
+
time_delta
+

Display time delta between current and previous frame. +

+
+
timebase
+

Display time base for filter link. +

+
+
format
+

Display used format for filter link. +

+
+
size
+

Display video size or number of audio channels in case of audio used by filter link. +

+
+
rate
+

Display video frame rate or sample rate in case of audio used by filter link. +

+
+
eof
+

Display link output status. +

+
+
sample_count_in
+

Display number of samples taken from filter. +

+
+
sample_count_out
+

Display number of samples given out from filter. +

+
+
sample_count_delta
+

Display delta number of samples between above two values. +

+
+
disabled
+

Show the timeline filter status. +

+
+ +
+
rate, r
+

Set upper limit for video rate of output stream, Default value is 25. +This guarantee that output video frame rate will not be higher than this value. +

+
+ +
+
+

32.112 grayworld

+

A color constancy filter that applies color correction based on the grayworld assumption +

+

See: https://www.researchgate.net/publication/275213614_A_New_Color_Correction_Method_for_Underwater_Imaging +

+

The algorithm uses linear light, so input +data should be linearized beforehand (and possibly correctly tagged). +

+
+
ffmpeg -i INPUT -vf zscale=transfer=linear,grayworld,zscale=transfer=bt709,format=yuv420p OUTPUT
+
+ +
+
+

32.113 greyedge

+

A color constancy variation filter which estimates scene illumination via grey edge algorithm +and corrects the scene colors accordingly. +

+

See: https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf +

+

The filter accepts the following options: +

+
+
difford
+

The order of differentiation to be applied on the scene. Must be chosen in the range +[0,2] and default value is 1. +

+
+
minknorm
+

The Minkowski parameter to be used for calculating the Minkowski distance. Must +be chosen in the range [0,20] and default value is 1. Set to 0 for getting +max value instead of calculating Minkowski distance. +

+
+
sigma
+

The standard deviation of Gaussian blur to be applied on the scene. Must be +chosen in the range [0,1024.0] and default value = 1. floor( sigma * break_off_sigma(3) ) +can’t be equal to 0 if difford is greater than 0. +

+
+ + +
+

32.113.1 Examples

+
    +
  • Grey Edge: +
    +
    greyedge=difford=1:minknorm=5:sigma=2
    +
    + +
  • Max Edge: +
    +
    greyedge=difford=1:minknorm=0:sigma=2
    +
    + +
+ +
+
+
+

32.114 guided

+

Apply guided filter for edge-preserving smoothing, dehazing and so on. +

+

The filter accepts the following options: +

+
radius
+

Set the box radius in pixels. +Allowed range is 1 to 20. Default is 3. +

+
+
eps
+

Set regularization parameter (with square). +Allowed range is 0 to 1. Default is 0.01. +

+
+
mode
+

Set filter mode. Can be basic or fast. +Default is basic. +

+
+
sub
+

Set subsampling ratio for fast mode. +Range is 2 to 64. Default is 4. +No subsampling occurs in basic mode. +

+
+
guidance
+

Set guidance mode. Can be off or on. Default is off. +If off, single input is required. +If on, two inputs of the same resolution and pixel format are required. +The second input serves as the guidance. +

+
+
planes
+

Set planes to filter. Default is first only. +

+
+ + +
+

32.114.1 Commands

+

This filter supports the all above options as commands. +

+
+
+

32.114.2 Examples

+
    +
  • Edge-preserving smoothing with guided filter: +
    +
    ffmpeg -i in.png -vf guided out.png
    +
    + +
  • Dehazing, structure-transferring filtering, detail enhancement with guided filter. +For the generation of guidance image, refer to paper "Guided Image Filtering". +See: http://kaiminghe.com/publications/pami12guidedfilter.pdf. +
    +
    ffmpeg -i in.png -i guidance.png -filter_complex guided=guidance=on out.png
    +
    + +
+ +
+
+
+

32.115 haldclut

+ +

Apply a Hald CLUT to a video stream. +

+

First input is the video stream to process, and second one is the Hald CLUT. +The Hald CLUT input can be a simple picture or a complete video stream. +

+

The filter accepts the following options: +

+
+
clut
+

Set which CLUT video frames will be processed from second input stream, +can be first or all. Default is all. +

+
+
shortest
+

Force termination when the shortest input terminates. Default is 0. +

+
repeatlast
+

Continue applying the last CLUT after the end of the stream. A value of +0 disable the filter after the last frame of the CLUT is reached. +Default is 1. +

+
+ +

haldclut also has the same interpolation options as lut3d (both +filters share the same internals). +

+

This filter also supports the framesync options. +

+

More information about the Hald CLUT can be found on Eskil Steenberg’s website +(Hald CLUT author) at http://www.quelsolaar.com/technology/clut.html. +

+ +
+

32.115.1 Commands

+ +

This filter supports the interp option as commands. +

+
+
+

32.115.2 Workflow examples

+ + +
+

32.115.2.1 Hald CLUT video stream

+ +

Generate an identity Hald CLUT stream altered with various effects: +

+
ffmpeg -f lavfi -i haldclutsrc=8 -vf "hue=H=2*PI*t:s=sin(2*PI*t)+1, curves=cross_process" -t 10 -c:v ffv1 clut.nut
+
+ +

Note: make sure you use a lossless codec. +

+

Then use it with haldclut to apply it on some random stream: +

+
ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
+
+ +

The Hald CLUT will be applied to the 10 first seconds (duration of +clut.nut), then the latest picture of that CLUT stream will be applied +to the remaining frames of the mandelbrot stream. +

+
+
+

32.115.2.2 Hald CLUT with preview

+ +

A Hald CLUT is supposed to be a squared image of Level*Level*Level by +Level*Level*Level pixels. For a given Hald CLUT, FFmpeg will select the +biggest possible square starting at the top left of the picture. The remaining +padding pixels (bottom or right) will be ignored. This area can be used to add +a preview of the Hald CLUT. +

+

Typically, the following generated Hald CLUT will be supported by the +haldclut filter: +

+
+
ffmpeg -f lavfi -i haldclutsrc=8 -vf "
+   pad=iw+320 [padded_clut];
+   smptebars=s=320x256, split [a][b];
+   [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
+   [main][b] overlay=W-320" -frames:v 1 clut.png
+
+ +

It contains the original and a preview of the effect of the CLUT: SMPTE color +bars are displayed on the right-top, and below the same color bars processed by +the color changes. +

+

Then, the effect of this Hald CLUT can be visualized with: +

+
ffplay input.mkv -vf "movie=clut.png, [in] haldclut"
+
+ +
+
+
+
+

32.116 hflip

+ +

Flip the input video horizontally. +

+

For example, to horizontally flip the input video with ffmpeg: +

+
ffmpeg -i in.avi -vf "hflip" out.avi
+
+ +
+
+

32.117 histeq

+

This filter applies a global color histogram equalization on a +per-frame basis. +

+

It can be used to correct video that has a compressed range of pixel +intensities. The filter redistributes the pixel intensities to +equalize their distribution across the intensity range. It may be +viewed as an "automatically adjusting contrast filter". This filter is +useful only for correcting degraded or poorly captured source +video. +

+

The filter accepts the following options: +

+
+
strength
+

Determine the amount of equalization to be applied. As the strength +is reduced, the distribution of pixel intensities more-and-more +approaches that of the input frame. The value must be a float number +in the range [0,1] and defaults to 0.200. +

+
+
intensity
+

Set the maximum intensity that can generated and scale the output +values appropriately. The strength should be set as desired and then +the intensity can be limited if needed to avoid washing-out. The value +must be a float number in the range [0,1] and defaults to 0.210. +

+
+
antibanding
+

Set the antibanding level. If enabled the filter will randomly vary +the luminance of output pixels by a small amount to avoid banding of +the histogram. Possible values are none, weak or +strong. It defaults to none. +

+
+ +
+
+

32.118 histogram

+ +

Compute and draw a color distribution histogram for the input video. +

+

The computed histogram is a representation of the color component +distribution in an image. +

+

Standard histogram displays the color components distribution in an image. +Displays color graph for each color component. Shows distribution of +the Y, U, V, A or R, G, B components, depending on input format, in the +current frame. Below each graph a color component scale meter is shown. +

+

The filter accepts the following options: +

+
+
level_height
+

Set height of level. Default value is 200. +Allowed range is [50, 2048]. +

+
+
scale_height
+

Set height of color scale. Default value is 12. +Allowed range is [0, 40]. +

+
+
display_mode
+

Set display mode. +It accepts the following values: +

+
stack
+

Per color component graphs are placed below each other. +

+
+
parade
+

Per color component graphs are placed side by side. +

+
+
overlay
+

Presents information identical to that in the parade, except +that the graphs representing color components are superimposed directly +over one another. +

+
+

Default is stack. +

+
+
levels_mode
+

Set mode. Can be either linear, or logarithmic. +Default is linear. +

+
+
components
+

Set what color components to display. +Default is 7. +

+
+
fgopacity
+

Set foreground opacity. Default is 0.7. +

+
+
bgopacity
+

Set background opacity. Default is 0.5. +

+
+
colors_mode
+

Set colors mode. +It accepts the following values: +

+
whiteonblack
+
blackonwhite
+
whiteongray
+
blackongray
+
coloronblack
+
coloronwhite
+
colorongray
+
blackoncolor
+
whiteoncolor
+
grayoncolor
+
+

Default is whiteonblack. +

+
+ + +
+

32.118.1 Examples

+ +
    +
  • Calculate and draw histogram: +
    +
    ffplay -i input -vf histogram
    +
    + +
+ +
+
+
+

32.119 hqdn3d

+ +

This is a high precision/quality 3d denoise filter. It aims to reduce +image noise, producing smooth images and making still images really +still. It should enhance compressibility. +

+

It accepts the following optional parameters: +

+
+
luma_spatial
+

A non-negative floating point number which specifies spatial luma strength. +It defaults to 4.0. +

+
+
chroma_spatial
+

A non-negative floating point number which specifies spatial chroma strength. +It defaults to 3.0*luma_spatial/4.0. +

+
+
luma_tmp
+

A floating point number which specifies luma temporal strength. It defaults to +6.0*luma_spatial/4.0. +

+
+
chroma_tmp
+

A floating point number which specifies chroma temporal strength. It defaults to +luma_tmp*chroma_spatial/luma_spatial. +

+
+ + +
+

32.119.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

32.120 hwdownload

+ +

Download hardware frames to system memory. +

+

The input must be in hardware frames, and the output a non-hardware format. +Not all formats will be supported on the output - it may be necessary to insert +an additional format filter immediately following in the graph to get +the output in a supported format. +

+
+
+

32.121 hwmap

+ +

Map hardware frames to system memory or to another device. +

+

This filter has several different modes of operation; which one is used depends +on the input and output formats: +

    +
  • Hardware frame input, normal frame output + +

    Map the input frames to system memory and pass them to the output. If the +original hardware frame is later required (for example, after overlaying +something else on part of it), the hwmap filter can be used again +in the next mode to retrieve it. +

  • Normal frame input, hardware frame output + +

    If the input is actually a software-mapped hardware frame, then unmap it - +that is, return the original hardware frame. +

    +

    Otherwise, a device must be provided. Create new hardware surfaces on that +device for the output, then map them back to the software format at the input +and give those frames to the preceding filter. This will then act like the +hwupload filter, but may be able to avoid an additional copy when +the input is already in a compatible format. +

  • Hardware frame input and output + +

    A device must be supplied for the output, either directly or with the +derive_device option. The input and output devices must be of +different types and compatible - the exact meaning of this is +system-dependent, but typically it means that they must refer to the same +underlying hardware context (for example, refer to the same graphics card). +

    +

    If the input frames were originally created on the output device, then unmap +to retrieve the original frames. +

    +

    Otherwise, map the frames to the output device - create new hardware frames +on the output corresponding to the frames on the input. +

+ +

The following additional parameters are accepted: +

+
+
mode
+

Set the frame mapping mode. Some combination of: +

+
read
+

The mapped frame should be readable. +

+
write
+

The mapped frame should be writeable. +

+
overwrite
+

The mapping will always overwrite the entire frame. +

+

This may improve performance in some cases, as the original contents of the +frame need not be loaded. +

+
direct
+

The mapping must not involve any copying. +

+

Indirect mappings to copies of frames are created in some cases where either +direct mapping is not possible or it would have unexpected properties. +Setting this flag ensures that the mapping is direct and will fail if that is +not possible. +

+
+

Defaults to read+write if not specified. +

+
+
derive_device type
+

Rather than using the device supplied at initialisation, instead derive a new +device of type type from the device the input frames exist on. +

+
+
reverse
+

In a hardware to hardware mapping, map in reverse - create frames in the sink +and map them back to the source. This may be necessary in some cases where +a mapping in one direction is required but only the opposite direction is +supported by the devices being used. +

+

This option is dangerous - it may break the preceding filter in undefined +ways if there are any additional constraints on that filter’s output. +Do not use it without fully understanding the implications of its use. +

+
+ +
+
+

32.122 hwupload

+ +

Upload system memory frames to hardware surfaces. +

+

The device to upload to must be supplied when the filter is initialised. If +using ffmpeg, select the appropriate device with the -filter_hw_device +option or with the derive_device option. The input and output devices +must be of different types and compatible - the exact meaning of this is +system-dependent, but typically it means that they must refer to the same +underlying hardware context (for example, refer to the same graphics card). +

+

The following additional parameters are accepted: +

+
+
derive_device type
+

Rather than using the device supplied at initialisation, instead derive a new +device of type type from the device the input frames exist on. +

+
+ +
+
+

32.123 hwupload_cuda

+ +

Upload system memory frames to a CUDA device. +

+

It accepts the following optional parameters: +

+
+
device
+

The number of the CUDA device to use +

+
+ +
+
+

32.124 hqx

+ +

Apply a high-quality magnification filter designed for pixel art. This filter +was originally created by Maxim Stepin. +

+

It accepts the following option: +

+
+
n
+

Set the scaling dimension: 2 for hq2x, 3 for +hq3x and 4 for hq4x. +Default is 3. +

+
+ +
+
+

32.125 hstack

+

Stack input videos horizontally. +

+

All streams must be of same pixel format and of same height. +

+

Note that this filter is faster than using overlay and pad filter +to create same output. +

+

The filter accepts the following option: +

+
+
inputs
+

Set number of input streams. Default is 2. +

+
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+ +
+
+

32.126 hsvhold

+

Turns a certain HSV range into gray values. +

+

This filter measures color difference between set HSV color in options +and ones measured in video stream. Depending on options, output +colors can be changed to be gray or not. +

+

The filter accepts the following options: +

+
+
hue
+

Set the hue value which will be used in color difference calculation. +Allowed range is from -360 to 360. Default value is 0. +

+
+
sat
+

Set the saturation value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
val
+

Set the value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
similarity
+

Set similarity percentage with the key color. +Allowed range is from 0 to 1. Default value is 0.01. +

+

0.00001 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +Allowed range is from 0 to 1. Default value is 0. +

+

0.0 makes pixels either fully gray, or not gray at all. +

+

Higher values result in more gray pixels, with a higher gray pixel +the more similar the pixels color is to the key color. +

+
+ +
+
+

32.127 hsvkey

+

Turns a certain HSV range into transparency. +

+

This filter measures color difference between set HSV color in options +and ones measured in video stream. Depending on options, output +colors can be changed to transparent by adding alpha channel. +

+

The filter accepts the following options: +

+
+
hue
+

Set the hue value which will be used in color difference calculation. +Allowed range is from -360 to 360. Default value is 0. +

+
+
sat
+

Set the saturation value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
val
+

Set the value which will be used in color difference calculation. +Allowed range is from -1 to 1. Default value is 0. +

+
+
similarity
+

Set similarity percentage with the key color. +Allowed range is from 0 to 1. Default value is 0.01. +

+

0.00001 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +Allowed range is from 0 to 1. Default value is 0. +

+

0.0 makes pixels either fully transparent, or not transparent at all. +

+

Higher values result in semi-transparent pixels, with a higher transparency +the more similar the pixels color is to the key color. +

+
+ +
+
+

32.128 hue

+ +

Modify the hue and/or the saturation of the input. +

+

It accepts the following parameters: +

+
+
h
+

Specify the hue angle as a number of degrees. It accepts an expression, +and defaults to "0". +

+
+
s
+

Specify the saturation in the [-10,10] range. It accepts an expression and +defaults to "1". +

+
+
H
+

Specify the hue angle as a number of radians. It accepts an +expression, and defaults to "0". +

+
+
b
+

Specify the brightness in the [-10,10] range. It accepts an expression and +defaults to "0". +

+
+ +

h and H are mutually exclusive, and can’t be +specified at the same time. +

+

The b, h, H and s option values are +expressions containing the following constants: +

+
+
n
+

frame count of the input frame starting from 0 +

+
+
pts
+

presentation timestamp of the input frame expressed in time base units +

+
+
r
+

frame rate of the input video, NAN if the input frame rate is unknown +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
tb
+

time base of the input video +

+
+ + +
+

32.128.1 Examples

+ +
    +
  • Set the hue to 90 degrees and the saturation to 1.0: +
    +
    hue=h=90:s=1
    +
    + +
  • Same command but expressing the hue in radians: +
    +
    hue=H=PI/2:s=1
    +
    + +
  • Rotate hue and make the saturation swing between 0 +and 2 over a period of 1 second: +
    +
    hue="H=2*PI*t: s=sin(2*PI*t)+1"
    +
    + +
  • Apply a 3 seconds saturation fade-in effect starting at 0: +
    +
    hue="s=min(t/3\,1)"
    +
    + +

    The general fade-in expression can be written as: +

    +
    hue="s=min(0\, max((t-START)/DURATION\, 1))"
    +
    + +
  • Apply a 3 seconds saturation fade-out effect starting at 5 seconds: +
    +
    hue="s=max(0\, min(1\, (8-t)/3))"
    +
    + +

    The general fade-out expression can be written as: +

    +
    hue="s=max(0\, min(1\, (START+DURATION-t)/DURATION))"
    +
    + +
+ +
+
+

32.128.2 Commands

+ +

This filter supports the following commands: +

+
b
+
s
+
h
+
H
+

Modify the hue and/or the saturation and/or brightness of the input video. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

32.129 huesaturation

+

Apply hue-saturation-intensity adjustments to input video stream. +

+

This filter operates in RGB colorspace. +

+

This filter accepts the following options: +

+
+
hue
+

Set the hue shift in degrees to apply. Default is 0. +Allowed range is from -180 to 180. +

+
+
saturation
+

Set the saturation shift. Default is 0. +Allowed range is from -1 to 1. +

+
+
intensity
+

Set the intensity shift. Default is 0. +Allowed range is from -1 to 1. +

+
+
colors
+

Set which primary and complementary colors are going to be adjusted. +This options is set by providing one or multiple values. +This can select multiple colors at once. By default all colors are selected. +

+
r
+

Adjust reds. +

+
y
+

Adjust yellows. +

+
g
+

Adjust greens. +

+
c
+

Adjust cyans. +

+
b
+

Adjust blues. +

+
m
+

Adjust magentas. +

+
a
+

Adjust all colors. +

+
+ +
+
strength
+

Set strength of filtering. Allowed range is from 0 to 100. +Default value is 1. +

+
+
rw, gw, bw
+

Set weight for each RGB component. Allowed range is from 0 to 1. +By default is set to 0.333, 0.334, 0.333. +Those options are used in saturation and lightess processing. +

+
+
lightness
+

Set preserving lightness, by default is disabled. +Adjusting hues can change lightness from original RGB triplet, +with this option enabled lightness is kept at same value. +

+
+ +
+
+

32.130 hysteresis

+ +

Grow first stream into second stream by connecting components. +This makes it possible to build more robust edge masks. +

+

This filter accepts the following options: +

+
+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+
threshold
+

Set threshold which is used in filtering. If pixel component value is higher than +this value filter algorithm for connecting components is activated. +By default value is 0. +

+
+ +

The hysteresis filter also supports the framesync options. +

+
+
+

32.131 iccdetect

+ +

Detect the colorspace from an embedded ICC profile (if present), and update +the frame’s tags accordingly. +

+

This filter accepts the following options: +

+
+
force
+

If true, the frame’s existing colorspace tags will always be overridden by +values detected from an ICC profile. Otherwise, they will only be assigned if +they contain unknown. Enabled by default. +

+
+ +
+
+

32.132 iccgen

+ +

Generate ICC profiles and attach them to frames. +

+

This filter accepts the following options: +

+
+
color_primaries
+
color_trc
+

Configure the colorspace that the ICC profile will be generated for. The +default value of auto infers the value from the input frame’s metadata, +defaulting to BT.709/sRGB as appropriate. +

+

See the setparams filter for a list of possible values, but note that +unknown are not valid values for this filter. +

+
+
force
+

If true, an ICC profile will be generated even if it would overwrite an +already existing ICC profile. Disabled by default. +

+
+ +
+
+

32.133 identity

+ +

Obtain the identity score between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained per component, average, min and max identity score is printed through +the logging system. +

+

The filter stores the calculated identity scores of each frame in frame metadata. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi identity -f null -
+
+ +
+
+

32.134 idet

+ +

Detect video interlacing type. +

+

This filter tries to detect if the input frames are interlaced, progressive, +top or bottom field first. It will also try to detect fields that are +repeated between adjacent frames (a sign of telecine). +

+

Single frame detection considers only immediately adjacent frames when classifying each frame. +Multiple frame detection incorporates the classification history of previous frames. +

+

The filter will log these metadata values: +

+
+
single.current_frame
+

Detected type of current frame using single-frame detection. One of: +“tff” (top field first), “bff” (bottom field first), +“progressive”, or “undetermined” +

+
+
single.tff
+

Cumulative number of frames detected as top field first using single-frame detection. +

+
+
multiple.tff
+

Cumulative number of frames detected as top field first using multiple-frame detection. +

+
+
single.bff
+

Cumulative number of frames detected as bottom field first using single-frame detection. +

+
+
multiple.current_frame
+

Detected type of current frame using multiple-frame detection. One of: +“tff” (top field first), “bff” (bottom field first), +“progressive”, or “undetermined” +

+
+
multiple.bff
+

Cumulative number of frames detected as bottom field first using multiple-frame detection. +

+
+
single.progressive
+

Cumulative number of frames detected as progressive using single-frame detection. +

+
+
multiple.progressive
+

Cumulative number of frames detected as progressive using multiple-frame detection. +

+
+
single.undetermined
+

Cumulative number of frames that could not be classified using single-frame detection. +

+
+
multiple.undetermined
+

Cumulative number of frames that could not be classified using multiple-frame detection. +

+
+
repeated.current_frame
+

Which field in the current frame is repeated from the last. One of “neither”, “top”, or “bottom”. +

+
+
repeated.neither
+

Cumulative number of frames with no repeated field. +

+
+
repeated.top
+

Cumulative number of frames with the top field repeated from the previous frame’s top field. +

+
+
repeated.bottom
+

Cumulative number of frames with the bottom field repeated from the previous frame’s bottom field. +

+
+ +

The filter accepts the following options: +

+
+
intl_thres
+

Set interlacing threshold. +

+
prog_thres
+

Set progressive threshold. +

+
rep_thres
+

Threshold for repeated field detection. +

+
half_life
+

Number of frames after which a given frame’s contribution to the +statistics is halved (i.e., it contributes only 0.5 to its +classification). The default of 0 means that all frames seen are given +full weight of 1.0 forever. +

+
analyze_interlaced_flag
+

When this is not 0 then idet will use the specified number of frames to determine +if the interlaced flag is accurate, it will not count undetermined frames. +If the flag is found to be accurate it will be used without any further +computations, if it is found to be inaccurate it will be cleared without any +further computations. This allows inserting the idet filter as a low computational +method to clean up the interlaced flag +

+
+ +
+
+

32.135 il

+ +

Deinterleave or interleave fields. +

+

This filter allows one to process interlaced images fields without +deinterlacing them. Deinterleaving splits the input frame into 2 +fields (so called half pictures). Odd lines are moved to the top +half of the output image, even lines to the bottom half. +You can process (filter) them independently and then re-interleave them. +

+

The filter accepts the following options: +

+
+
luma_mode, l
+
chroma_mode, c
+
alpha_mode, a
+

Available values for luma_mode, chroma_mode and +alpha_mode are: +

+
+
none
+

Do nothing. +

+
+
deinterleave, d
+

Deinterleave fields, placing one above the other. +

+
+
interleave, i
+

Interleave fields. Reverse the effect of deinterleaving. +

+
+

Default value is none. +

+
+
luma_swap, ls
+
chroma_swap, cs
+
alpha_swap, as
+

Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is 0. +

+
+ + +
+

32.135.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.136 inflate

+ +

Apply inflate effect to the video. +

+

This filter replaces the pixel by the local(3x3) average by taking into account +only values higher than the pixel. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane, default is 65535. +If 0, plane will remain unchanged. +

+
+ + +
+

32.136.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.137 interlace

+ +

Simple interlacing filter from progressive contents. This interleaves upper (or +lower) lines from odd frames with lower (or upper) lines from even frames, +halving the frame rate and preserving image height. +

+
+
   Original        Original             New Frame
+   Frame 'j'      Frame 'j+1'             (tff)
+  ==========      ===========       ==================
+    Line 0  -------------------->    Frame 'j' Line 0
+    Line 1          Line 1  ---->   Frame 'j+1' Line 1
+    Line 2 --------------------->    Frame 'j' Line 2
+    Line 3          Line 3  ---->   Frame 'j+1' Line 3
+     ...             ...                   ...
+New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
+
+ +

It accepts the following optional parameters: +

+
+
scan
+

This determines whether the interlaced frame is taken from the even +(tff - default) or odd (bff) lines of the progressive frame. +

+
+
lowpass
+

Vertical lowpass filter to avoid twitter interlacing and +reduce moire patterns. +

+
+
0, off
+

Disable vertical lowpass filter +

+
+
1, linear
+

Enable linear filter (default) +

+
+
2, complex
+

Enable complex filter. This will slightly less reduce twitter and moire +but better retain detail and subjective sharpness impression. +

+
+
+
+
+ +
+
+

32.138 kerndeint

+ +

Deinterlace input video by applying Donald Graft’s adaptive kernel +deinterling. Work on interlaced parts of a video to produce +progressive frames. +

+

The description of the accepted parameters follows. +

+
+
thresh
+

Set the threshold which affects the filter’s tolerance when +determining if a pixel line must be processed. It must be an integer +in the range [0,255] and defaults to 10. A value of 0 will result in +applying the process on every pixels. +

+
+
map
+

Paint pixels exceeding the threshold value to white if set to 1. +Default is 0. +

+
+
order
+

Set the fields order. Swap fields if set to 1, leave fields alone if +0. Default is 0. +

+
+
sharp
+

Enable additional sharpening if set to 1. Default is 0. +

+
+
twoway
+

Enable twoway sharpening if set to 1. Default is 0. +

+
+ + +
+

32.138.1 Examples

+ +
    +
  • Apply default values: +
    +
    kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
    +
    + +
  • Enable additional sharpening: +
    +
    kerndeint=sharp=1
    +
    + +
  • Paint processed pixels in white: +
    +
    kerndeint=map=1
    +
    +
+ +
+
+
+

32.139 kirsch

+

Apply kirsch operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

32.139.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.140 lagfun

+ +

Slowly update darker pixels. +

+

This filter makes short flashes of light appear longer. +This filter accepts the following options: +

+
+
decay
+

Set factor for decaying. Default is .95. Allowed range is from 0 to 1. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+ + +
+

32.140.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.141 lenscorrection

+ +

Correct radial lens distortion +

+

This filter can be used to correct for radial distortion as can result from the use +of wide angle lenses, and thereby re-rectify the image. To find the right parameters +one can use tools available for example as part of opencv or simply trial-and-error. +To use opencv use the calibration sample (under samples/cpp) from the opencv sources +and extract the k1 and k2 coefficients from the resulting matrix. +

+

Note that effectively the same filter is available in the open-source tools Krita and +Digikam from the KDE project. +

+

In contrast to the vignette filter, which can also be used to compensate lens errors, +this filter corrects the distortion of the image, whereas vignette corrects the +brightness distribution, so you may want to use both filters together in certain +cases, though you will have to take care of ordering, i.e. whether vignetting should +be applied before or after lens correction. +

+ +
+

32.141.1 Options

+ +

The filter accepts the following options: +

+
+
cx
+

Relative x-coordinate of the focal point of the image, and thereby the center of the +distortion. This value has a range [0,1] and is expressed as fractions of the image +width. Default is 0.5. +

+
cy
+

Relative y-coordinate of the focal point of the image, and thereby the center of the +distortion. This value has a range [0,1] and is expressed as fractions of the image +height. Default is 0.5. +

+
k1
+

Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means +no correction. Default is 0. +

+
k2
+

Coefficient of the double quadratic correction term. This value has a range [-1,1]. +0 means no correction. Default is 0. +

+
i
+

Set interpolation type. Can be nearest or bilinear. +Default is nearest. +

+
fc
+

Specify the color of the unmapped pixels. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Default color is black@0. +

+
+ +

The formula that generates the correction is: +

+

r_src = r_tgt * (1 + k1 * (r_tgt / r_0)^2 + k2 * (r_tgt / r_0)^4) +

+

where r_0 is halve of the image diagonal and r_src and r_tgt are the +distances from the focal point in the source and target images, respectively. +

+
+
+

32.141.2 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.142 lensfun

+ +

Apply lens correction via the lensfun library (http://lensfun.sourceforge.net/). +

+

The lensfun filter requires the camera make, camera model, and lens model +to apply the lens correction. The filter will load the lensfun database and +query it to find the corresponding camera and lens entries in the database. As +long as these entries can be found with the given options, the filter can +perform corrections on frames. Note that incomplete strings will result in the +filter choosing the best match with the given options, and the filter will +output the chosen camera and lens models (logged with level "info"). You must +provide the make, camera model, and lens model as they are required. +

+

To obtain a list of available makes and models, leave out one or both of make and +model options. The filter will send the full list to the log with level INFO. +The first column is the make and the second column is the model. +To obtain a list of available lenses, set any values for make and model and leave out the +lens_model option. The filter will send the full list of lenses in the log with level +INFO. The ffmpeg tool will exit after the list is printed. +

+

The filter accepts the following options: +

+
+
make
+

The make of the camera (for example, "Canon"). This option is required. +

+
+
model
+

The model of the camera (for example, "Canon EOS 100D"). This option is +required. +

+
+
lens_model
+

The model of the lens (for example, "Canon EF-S 18-55mm f/3.5-5.6 IS STM"). This +option is required. +

+
+
db_path
+

The full path to the lens database folder. If not set, the filter will attempt to +load the database from the install path when the library was built. Default is unset. +

+
+
mode
+

The type of correction to apply. The following values are valid options: +

+
+
vignetting
+

Enables fixing lens vignetting. +

+
+
geometry
+

Enables fixing lens geometry. This is the default. +

+
+
subpixel
+

Enables fixing chromatic aberrations. +

+
+
vig_geo
+

Enables fixing lens vignetting and lens geometry. +

+
+
vig_subpixel
+

Enables fixing lens vignetting and chromatic aberrations. +

+
+
distortion
+

Enables fixing both lens geometry and chromatic aberrations. +

+
+
all
+

Enables all possible corrections. +

+
+
+
+
focal_length
+

The focal length of the image/video (zoom; expected constant for video). For +example, a 18–55mm lens has focal length range of [18–55], so a value in that +range should be chosen when using that lens. Default 18. +

+
+
aperture
+

The aperture of the image/video (expected constant for video). Note that +aperture is only used for vignetting correction. Default 3.5. +

+
+
focus_distance
+

The focus distance of the image/video (expected constant for video). Note that +focus distance is only used for vignetting and only slightly affects the +vignetting correction process. If unknown, leave it at the default value (which +is 1000). +

+
+
scale
+

The scale factor which is applied after transformation. After correction the +video is no longer necessarily rectangular. This parameter controls how much of +the resulting image is visible. The value 0 means that a value will be chosen +automatically such that there is little or no unmapped area in the output +image. 1.0 means that no additional scaling is done. Lower values may result +in more of the corrected image being visible, while higher values may avoid +unmapped areas in the output. +

+
+
target_geometry
+

The target geometry of the output image/video. The following values are valid +options: +

+
+
rectilinear (default)
+
fisheye
+
panoramic
+
equirectangular
+
fisheye_orthographic
+
fisheye_stereographic
+
fisheye_equisolid
+
fisheye_thoby
+
+
+
reverse
+

Apply the reverse of image correction (instead of correcting distortion, apply +it). +

+
+
interpolation
+

The type of interpolation used when correcting distortion. The following values +are valid options: +

+
+
nearest
+
linear (default)
+
lanczos
+
+
+
+ + +
+

32.142.1 Examples

+ +
    +
  • Apply lens correction with make "Canon", camera model "Canon EOS 100D", and lens +model "Canon EF-S 18-55mm f/3.5-5.6 IS STM" with focal length of "18" and +aperture of "8.0". + +
    +
    ffmpeg -i input.mov -vf lensfun=make=Canon:model="Canon EOS 100D":lens_model="Canon EF-S 18-55mm f/3.5-5.6 IS STM":focal_length=18:aperture=8 -c:v h264 -b:v 8000k output.mov
    +
    + +
  • Apply the same as before, but only for the first 5 seconds of video. + +
    +
    ffmpeg -i input.mov -vf lensfun=make=Canon:model="Canon EOS 100D":lens_model="Canon EF-S 18-55mm f/3.5-5.6 IS STM":focal_length=18:aperture=8:enable='lte(t\,5)' -c:v h264 -b:v 8000k output.mov
    +
    + +
+ +
+
+
+

32.143 libplacebo

+ +

Flexible GPU-accelerated processing filter based on libplacebo +(https://code.videolan.org/videolan/libplacebo). +

+ +
+

32.143.1 Options

+ +

The options for this filter are divided into the following sections: +

+ +
+

32.143.1.1 Output mode

+

These options control the overall output mode. By default, libplacebo will try +to preserve the source colorimetry and size as best as it can, but it will +apply any embedded film grain, dolby vision metadata or anamorphic SAR present +in source frames. +

+
w
+
h
+

Set the output video dimension expression. Default values are iw and +ih. +

+

Allows for the same expressions as the scale filter. +

+
+
crop_x
+
crop_y
+

Set the input crop x/y expressions, default values are (iw-cw)/2 and +(ih-ch)/2. +

+
+
crop_w
+
crop_h
+

Set the input crop width/height expressions, default values are iw and +ih. +

+
+
pos_x
+
pos_y
+

Set the output placement x/y expressions, default values are (ow-pw)/2 +and (oh-ph)/2. +

+
+
pos_w
+
pos_h
+

Set the output placement width/height expressions, default values are ow +and oh. +

+
+
fps
+

Set the output frame rate. This can be rational, e.g. 60000/1001. If +set to the special string none (the default), input timestamps will +instead be passed through to the output unmodified. Otherwise, the input video +frames will be interpolated as necessary to rescale the video to the specified +target framerate, in a manner as determined by the frame_mixer option. +

+
+
format
+

Set the output format override. If unset (the default), frames will be output +in the same format as the respective input frames. Otherwise, format conversion +will be performed. +

+
+
force_original_aspect_ratio
+
force_divisible_by
+

Work the same as the identical scale filter options. +

+
+
normalize_sar
+

If enabled, output frames will always have a pixel aspect ratio of 1:1. This +will introduce additional padding/cropping as necessary. If disabled (the +default), any aspect ratio mismatches, including those from e.g. anamorphic +video sources, are forwarded to the output pixel aspect ratio. +

+
+
pad_crop_ratio
+

Specifies a ratio (between 0.0 and 1.0) between padding and +cropping when the input aspect ratio does not match the output aspect ratio and +normalize_sar is in effect. The default of 0.0 always pads the +content with black borders, while a value of 1.0 always crops off parts +of the content. Intermediate values are possible, leading to a mix of the two +approaches. +

+
+
fillcolor
+

Set the color used to fill the output area not covered by the output image, for +example as a result of normalize_sar. For the general syntax of this +option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Defaults to black. +

+
+
colorspace
+
color_primaries
+
color_trc
+
range
+

Configure the colorspace that output frames will be delivered in. The default +value of auto outputs frames in the same format as the input frames, +leading to no change. For any other value, conversion will be performed. +

+

See the setparams filter for a list of possible values. +

+
+
apply_filmgrain
+

Apply film grain (e.g. AV1 or H.274) if present in source frames, and strip +it from the output. Enabled by default. +

+
+
apply_dolbyvision
+

Apply Dolby Vision RPU metadata if present in source frames, and strip it from +the output. Enabled by default. Note that Dolby Vision will always output +BT.2020+PQ, overriding the usual input frame metadata. These will also be +picked as the values of auto for the respective frame output options. +

+
+ +

In addition to the expression constants documented for the scale filter, +the crop_w, crop_h, crop_x, crop_y, +pos_w, pos_h, pos_x and pos_y options can +also contain the following constants: +

+
+
crop_w, cw
+
crop_h, ch
+

The computed values of crop_w and crop_h. +

+
+
pos_w, pw
+
pos_h, ph
+

The computed values of pos_w and pos_h. +

+
+
in_t, t
+

The input frame timestamp, in seconds. NAN if input timestamp is unknown. +

+
+
out_t, ot
+

The input frame timestamp, in seconds. NAN if input timestamp is unknown. +

+
+
n
+

The input frame number, starting with 0. +

+
+ +
+
+

32.143.1.2 Scaling

+

The options in this section control how libplacebo performs upscaling and (if +necessary) downscaling. Note that libplacebo will always internally operate on +4:4:4 content, so any sub-sampled chroma formats such as yuv420p will +necessarily be upsampled and downsampled as part of the rendering process. That +means scaling might be in effect even if the source and destination resolution +are the same. +

+
upscaler
+
downscaler
+

Configure the filter kernel used for upscaling and downscaling. The respective +defaults are spline36 and mitchell. For a full list of possible +values, pass help to these options. The most important values are: +

+
none
+

Forces the use of built-in GPU texture sampling (typically bilinear). Extremely +fast but poor quality, especially when downscaling. +

+
+
bilinear
+

Bilinear interpolation. Can generally be done for free on GPUs, except when +doing so would lead to aliasing. Fast and low quality. +

+
+
nearest
+

Nearest-neighbour interpolation. Sharp but highly aliasing. +

+
+
oversample
+

Algorithm that looks visually similar to nearest-neighbour interpolation but +tries to preserve pixel aspect ratio. Good for pixel art, since it results in +minimal distortion of the artistic appearance. +

+
+
lanczos
+

Standard sinc-sinc interpolation kernel. +

+
+
spline36
+

Cubic spline approximation of lanczos. No difference in performance, but has +very slightly less ringing. +

+
+
ewa_lanczos
+

Elliptically weighted average version of lanczos, based on a jinc-sinc kernel. +This is also popularly referred to as just "Jinc scaling". Slow but very high +quality. +

+
+
gaussian
+

Gaussian kernel. Has certain ideal mathematical properties, but subjectively +very blurry. +

+
+
mitchell
+

Cubic BC spline with parameters recommended by Mitchell and Netravali. Very +little ringing. +

+
+ +
+
frame_mixer
+

Controls the kernel used for mixing frames temporally. The default value is +none, which disables frame mixing. For a full list of possible values, +pass help to this option. The most important values are: +

+
none
+

Disables frame mixing, giving a result equivalent to "nearest neighbour" +semantics. +

+
+
oversample
+

Oversamples the input video to create a "Smooth Motion"-type effect: if an +output frame would exactly fall on the transition between two video frames, it +is blended according to the relative overlap. This is the recommended option +whenever preserving the original subjective appearance is desired. +

+
+
mitchell_clamp
+

Larger filter kernel that smoothly interpolates multiple frames in a manner +designed to eliminate ringing and other artefacts as much as possible. This is +the recommended option wherever maximum visual smoothness is desired. +

+
+
linear
+

Linear blend/fade between frames. Especially useful for constructing e.g. +slideshows. +

+
+ +
+
lut_entries
+

Configures the size of scaler LUTs, ranging from 1 to 256. The +default of 0 will pick libplacebo’s internal default, typically +64. +

+
+
antiringing
+

Enables anti-ringing (for non-EWA filters). The value (between 0.0 and +1.0) configures the strength of the anti-ringing algorithm. May increase +aliasing if set too high. Disabled by default. +

+
+
sigmoid
+

Enable sigmoidal compression during upscaling. Reduces ringing slightly. +Enabled by default. +

+
+ +
+
+

32.143.1.3 Debanding

+

Libplacebo comes with a built-in debanding filter that is good at counteracting +many common sources of banding and blocking. Turning this on is highly +recommended whenever quality is desired. +

+
deband
+

Enable (fast) debanding algorithm. Disabled by default. +

+
+
deband_iterations
+

Number of deband iterations of the debanding algorithm. Each iteration is +performed with progressively increased radius (and diminished threshold). +Recommended values are in the range 1 to 4. Defaults to 1. +

+
+
deband_threshold
+

Debanding filter strength. Higher numbers lead to more aggressive debanding. +Defaults to 4.0. +

+
+
deband_radius
+

Debanding filter radius. A higher radius is better for slow gradients, while +a lower radius is better for steep gradients. Defaults to 16.0. +

+
+
deband_grain
+

Amount of extra output grain to add. Helps hide imperfections. Defaults to +6.0. +

+
+ +
+
+

32.143.1.4 Color adjustment

+

A collection of subjective color controls. Not very rigorous, so the exact +effect will vary somewhat depending on the input primaries and colorspace. +

+
brightness
+

Brightness boost, between -1.0 and 1.0. Defaults to 0.0. +

+
+
contrast
+

Contrast gain, between 0.0 and 16.0. Defaults to 1.0. +

+
+
saturation
+

Saturation gain, between 0.0 and 16.0. Defaults to 1.0. +

+
+
hue
+

Hue shift in radians, between -3.14 and 3.14. Defaults to +0.0. This will rotate the UV subvector, defaulting to BT.709 +coefficients for RGB inputs. +

+
+
gamma
+

Gamma adjustment, between 0.0 and 16.0. Defaults to 1.0. +

+
+
cones
+

Cone model to use for color blindness simulation. Accepts any combination of +l, m and s. Here are some examples: +

+
m
+

Deuteranomaly / deuteranopia (affecting 3%-4% of the population) +

+
l
+

Protanomaly / protanopia (affecting 1%-2% of the population) +

+
l+m
+

Monochromacy (very rare) +

+
l+m+s
+

Achromatopsy (complete loss of daytime vision, extremely rare) +

+
+ +
+
cone-strength
+

Gain factor for the cones specified by cones, between 0.0 and +10.0. A value of 1.0 results in no change to color vision. A +value of 0.0 (the default) simulates complete loss of those cones. Values +above 1.0 result in exaggerating the differences between cones, which +may help compensate for reduced color vision. +

+
+ +
+
+

32.143.1.5 Peak detection

+

To help deal with sources that only have static HDR10 metadata (or no tagging +whatsoever), libplacebo uses its own internal frame analysis compute shader to +analyze source frames and adapt the tone mapping function in realtime. If this +is too slow, or if exactly reproducible frame-perfect results are needed, it’s +recommended to turn this feature off. +

+
peak_detect
+

Enable HDR peak detection. Ignores static MaxCLL/MaxFALL values in favor of +dynamic detection from the input. Note that the detected values do not get +written back to the output frames, they merely guide the internal tone mapping +process. Enabled by default. +

+
+
smoothing_period
+

Peak detection smoothing period, between 0.0 and 1000.0. Higher +values result in peak detection becoming less responsive to changes in the +input. Defaults to 100.0. +

+
+
minimum_peak
+

Lower bound on the detected peak (relative to SDR white), between 0.0 +and 100.0. Defaults to 1.0. +

+
+
scene_threshold_low
+
scene_threshold_high
+

Lower and upper thresholds for scene change detection. Expressed in a +logarithmic scale between 0.0 and 100.0. Default to 5.5 +and 10.0, respectively. Setting either to a negative value disables +this functionality. +

+
+
percentile
+

Which percentile of the frame brightness histogram to use as the source peak +for tone-mapping. Defaults to 99.995, a fairly conservative value. +Setting this to 100.0 disables frame histogram measurement and instead +uses the true peak brightness for tone-mapping. +

+
+ +
+
+

32.143.1.6 Tone mapping

+

The options in this section control how libplacebo performs tone-mapping and +gamut-mapping when dealing with mismatches between wide-gamut or HDR content. +In general, libplacebo relies on accurate source tagging and mastering display +gamut information to produce the best results. +

+
gamut_mode
+

How to handle out-of-gamut colors that can occur as a result of colorimetric +gamut mapping. +

+
clip
+

Do nothing, simply clip out-of-range colors to the RGB volume. Low quality but +extremely fast. +

+
perceptual
+

Perceptually soft-clip colors to the gamut volume. This is the default. +

+
relative
+

Relative colorimetric hard-clip. Similar to perceptual but without +the soft knee. +

+
saturation
+

Saturation mapping, maps primaries directly to primaries in RGB space. +Not recommended except for artificial computer graphics for which a bright, +saturated display is desired. +

+
absolute
+

Absolute colorimetric hard-clip. Performs no adjustment of the white point. +

+
desaturate
+

Hard-desaturates out-of-gamut colors towards white, while preserving the +luminance. Has a tendency to distort the visual appearance of bright objects. +

+
darken
+

Linearly reduces content brightness to preserves saturated details, followed by +clipping the remaining out-of-gamut colors. +

+
warn
+

Highlight out-of-gamut pixels (by inverting/marking them). +

+
linear
+

Linearly reduces chromaticity of the entire image to make it fit within the +target color volume. Be careful when using this on BT.2020 sources without +proper mastering metadata, as doing so will lead to excessive desaturation. +

+
+ +
+
tonemapping
+

Tone-mapping algorithm to use. Available values are: +

+
auto
+

Automatic selection based on internal heuristics. This is the default. +

+
clip
+

Performs no tone-mapping, just clips out-of-range colors. Retains perfect color +accuracy for in-range colors but completely destroys out-of-range information. +Does not perform any black point adaptation. Not configurable. +

+
st2094-40
+

EETF from SMPTE ST 2094-40 Annex B, which applies the Bezier curves from HDR10+ +dynamic metadata based on Bezier curves to perform tone-mapping. The OOTF used +is adjusted based on the ratio between the targeted and actual display peak +luminances. +

+
st2094-10
+

EETF from SMPTE ST 2094-10 Annex B.2, which takes into account the input signal +average luminance in addition to the maximum/minimum. The configurable contrast +parameter influences the slope of the linear output segment, defaulting to +1.0 for no increase/decrease in contrast. Note that this does not +currently include the subjective gain/offset/gamma controls defined in Annex +B.3. +

+
bt.2390
+

EETF from the ITU-R Report BT.2390, a hermite spline roll-off with linear +segment. The knee point offset is configurable. Note that this parameter +defaults to 1.0, rather than the value of 0.5 from the ITU-R +spec. +

+
bt.2446a
+

EETF from ITU-R Report BT.2446, method A. Designed for well-mastered HDR +sources. Can be used for both forward and inverse tone mapping. Not +configurable. +

+
spline
+

Simple spline consisting of two polynomials, joined by a single pivot point. +The parameter gives the pivot point (in PQ space), defaulting to 0.30. +Can be used for both forward and inverse tone mapping. +

+
reinhard
+

Simple non-linear, global tone mapping algorithm. The parameter specifies the +local contrast coefficient at the display peak. Essentially, a parameter of +0.5 implies that the reference white will be about half as bright as +when clipping. Defaults to 0.5, which results in the simplest +formulation of this function. +

+
mobius
+

Generalization of the reinhard tone mapping algorithm to support an additional +linear slope near black. The tone mapping parameter indicates the trade-off +between the linear section and the non-linear section. Essentially, for a given +parameter x, every color value below x will be mapped linearly, +while higher values get non-linearly tone-mapped. Values near 1.0 make +this curve behave like clip, while values near 0.0 make this +curve behave like reinhard. The default value is 0.3, which +provides a good balance between colorimetric accuracy and preserving +out-of-gamut details. +

+
hable
+

Piece-wise, filmic tone-mapping algorithm developed by John Hable for use in +Uncharted 2, inspired by a similar tone-mapping algorithm used by Kodak. +Popularized by its use in video games with HDR rendering. Preserves both dark +and bright details very well, but comes with the drawback of changing the +average brightness quite significantly. This is sort of similar to +reinhard with parameter 0.24. +

+
gamma
+

Fits a gamma (power) function to transfer between the source and target color +spaces, effectively resulting in a perceptual hard-knee joining two roughly +linear sections. This preserves details at all scales fairly accurately, but +can result in an image with a muted or dull appearance. The parameter is used +as the cutoff point, defaulting to 0.5. +

+
linear
+

Linearly stretches the input range to the output range, in PQ space. This will +preserve all details accurately, but results in a significantly different +average brightness. Can be used for inverse tone-mapping in addition to regular +tone-mapping. The parameter can be used as an additional linear gain +coefficient (defaulting to 1.0). +

+
+ +
+
tonemapping_param
+

For tunable tone mapping functions, this parameter can be used to fine-tune the +curve behavior. Refer to the documentation of tonemapping. The default +value of 0.0 is replaced by the curve’s preferred default setting. +

+
+
inverse_tonemapping
+

If enabled, this filter will also attempt stretching SDR signals to fill HDR +output color volumes. Disabled by default. +

+
+
tonemapping_lut_size
+

Size of the tone-mapping LUT, between 2 and 1024. Defaults to +256. Note that this figure is squared when combined with +peak_detect. +

+
+
hybrid_mix
+

If nonzero, this much of the upper range of the tone-mapped result is smoothly +mixed with a per-channel (LMS) tone-mapped version. Helps avoid unnatural +blown-out highlights when tone-mapping very bright, strongly saturated colors. +Defaults to 0.2. +

+
+ +
+
+

32.143.1.7 Dithering

+

By default, libplacebo will dither whenever necessary, which includes rendering +to any integer format below 16-bit precision. It’s recommended to always leave +this on, since not doing so may result in visible banding in the output, even +if the debanding filter is enabled. If maximum performance is needed, +use ordered_fixed instead of disabling dithering. +

+
dithering
+

Dithering method to use. Accepts the following values: +

+
none
+

Disables dithering completely. May result in visible banding. +

+
blue
+

Dither with pseudo-blue noise. This is the default. +

+
ordered
+

Tunable ordered dither pattern. +

+
ordered_fixed
+

Faster ordered dither with a fixed size of 6. Texture-less. +

+
white
+

Dither with white noise. Texture-less. +

+
+ +
+
dither_lut_size
+

Dither LUT size, as log base2 between 1 and 8. Defaults to +6, corresponding to a LUT size of 64x64. +

+
+
dither_temporal
+

Enables temporal dithering. Disabled by default. +

+
+ +
+
+

32.143.1.8 Custom shaders

+

libplacebo supports a number of custom shaders based on the mpv .hook GLSL +syntax. A collection of such shaders can be found here: +https://github.com/mpv-player/mpv/wiki/User-Scripts#user-shaders +

+

A full description of the mpv shader format is beyond the scope of this +section, but a summary can be found here: +https://mpv.io/manual/master/#options-glsl-shader +

+
custom_shader_path
+

Specifies a path to a custom shader file to load at runtime. +

+
+
custom_shader_bin
+

Specifies a complete custom shader as a raw string. +

+
+ +
+
+

32.143.1.9 Debugging / performance

+

All of the options in this section default off. They may be of assistance when +attempting to squeeze the maximum performance at the cost of quality. +

+
skip_aa
+

Disable anti-aliasing when downscaling. +

+
+
polar_cutoff
+

Truncate polar (EWA) scaler kernels below this absolute magnitude, between +0.0 and 1.0. +

+
+
disable_linear
+

Disable linear light scaling. +

+
+
disable_builtin
+

Disable built-in GPU sampling (forces LUT). +

+
+
disable_fbos
+

Forcibly disable FBOs, resulting in loss of almost all functionality, but +offering the maximum possible speed. +

+
+ +
+
+
+

32.143.2 Commands

+

This filter supports almost all of the above options as commands. +

+
+
+

32.143.3 Examples

+
    +
  • Tone-map input to standard gamut BT.709 output: +
    +
    libplacebo=colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv
    +
    + +
  • Rescale input to fit into standard 1080p, with high quality scaling: +
    +
    libplacebo=w=1920:h=1080:force_original_aspect_ratio=decrease:normalize_sar=true:upscaler=ewa_lanczos:downscaler=ewa_lanczos
    +
    + +
  • Interpolate low FPS / VFR input to smoothed constant 60 fps output: +
    +
    libplacebo=fps=60:frame_mixer=mitchell_clamp
    +
    + +
  • Convert input to standard sRGB JPEG: +
    +
    libplacebo=format=yuv420p:colorspace=bt470bg:color_primaries=bt709:color_trc=iec61966-2-1:range=pc
    +
    + +
  • Use higher quality debanding settings: +
    +
    libplacebo=deband=true:deband_iterations=3:deband_radius=8:deband_threshold=6
    +
    + +
  • Run this filter on the CPU, on systems with Mesa installed (and with the most +expensive options disabled): +
    +
    ffmpeg ... -init_hw_device vulkan:llvmpipe ... -vf libplacebo=upscaler=none:downscaler=none:peak_detect=false
    +
    + +
  • Suppress CPU-based AV1/H.274 film grain application in the decoder, in favor of +doing it with this filter. Note that this is only a gain if the frames are +either already on the GPU, or if you’re using libplacebo for other purposes, +since otherwise the VRAM roundtrip will more than offset any expected speedup. +
    +
    ffmpeg -export_side_data +film_grain ... -vf libplacebo=apply_filmgrain=true
    +
    + +
  • Interop with VAAPI hwdec to avoid round-tripping through RAM: +
    +
    ffmpeg -init_hw_device vulkan -hwaccel vaapi -hwaccel_output_format vaapi ... -vf libplacebo
    +
    +
+ +
+
+
+

32.144 libvmaf

+ +

Calulate the VMAF (Video Multi-Method Assessment Fusion) score for a +reference/distorted pair of input videos. +

+

The first input is the distorted video, and the second input is the reference video. +

+

The obtained VMAF score is printed through the logging system. +

+

It requires Netflix’s vmaf library (libvmaf) as a pre-requisite. +After installing the library it can be enabled using: +./configure --enable-libvmaf. +

+

The filter has following options: +

+
+
model
+

A ‘|‘ delimited list of vmaf models. Each model can be configured with a number of parameters. +Default value: "version=vmaf_v0.6.1" +

+
+
model_path
+

Deprecated, use model=’path=...’. +

+
+
enable_transform
+

Deprecated, use model=’enable_transform=true’. +

+
+
phone_model
+

Deprecated, use model=’enable_transform=true’. +

+
+
enable_conf_interval
+

Deprecated, use model=’enable_conf_interval=true’. +

+
+
feature
+

A ‘|‘ delimited list of features. Each feature can be configured with a number of parameters. +

+
+
psnr
+

Deprecated, use feature=’name=psnr’. +

+
+
ssim
+

Deprecated, use feature=’name=ssim’. +

+
+
ms_ssim
+

Deprecated, use feature=’name=ms_ssim’. +

+
+
log_path
+

Set the file path to be used to store log files. +

+
+
log_fmt
+

Set the format of the log file (xml, json, csv, or sub). +

+
+
n_threads
+

Set number of threads to be used when initializing libvmaf. +Default value: 0, no threads. +

+
+
n_subsample
+

Set frame subsampling interval to be used. +

+
+ +

This filter also supports the framesync options. +

+ +
+

32.144.1 Examples

+
    +
  • In the examples below, a distorted video distorted.mpg is +compared with a reference file reference.mpg. + +
  • Basic usage: +
    +
    ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf=log_path=output.xml -f null -
    +
    + +
  • Example with multiple models: +
    +
    ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='model=version=vmaf_v0.6.1\\:name=vmaf|version=vmaf_v0.6.1neg\\:name=vmaf_neg' -f null -
    +
    + +
  • Example with multiple addtional features: +
    +
    ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='feature=name=psnr|name=ciede' -f null -
    +
    + +
  • Example with options and different containers: +
    +
    ffmpeg -i distorted.mpg -i reference.mkv -lavfi "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]libvmaf=log_fmt=json:log_path=output.json" -f null -
    +
    +
+ +
+
+
+

32.145 limitdiff

+

Apply limited difference filter using second and optionally third video stream. +

+

The filter accepts the following options: +

+
+
threshold
+

Set the threshold to use when allowing certain differences between video streams. +Any absolute difference value lower or exact than this threshold will pick pixel components from +first video stream. +

+
+
elasticity
+

Set the elasticity of soft thresholding when processing video streams. +This value multiplied with first one sets second threshold. +Any absolute difference value greater or exact than second threshold will pick pixel components +from second video stream. For values between those two threshold +linear interpolation between first and second video stream will be used. +

+
+
reference
+

Enable the reference (third) video stream processing. By default is disabled. +If set, this video stream will be used for calculating absolute difference with first video +stream. +

+
+
planes
+

Specify which planes will be processed. Defaults to all available. +

+
+ + +
+

32.145.1 Commands

+ +

This filter supports the all above options as commands except option ‘reference’. +

+
+
+
+

32.146 limiter

+ +

Limits the pixel components values to the specified range [min, max]. +

+

The filter accepts the following options: +

+
+
min
+

Lower bound. Defaults to the lowest allowed value for the input. +

+
+
max
+

Upper bound. Defaults to the highest allowed value for the input. +

+
+
planes
+

Specify which planes will be processed. Defaults to all available. +

+
+ + +
+

32.146.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.147 loop

+ +

Loop video frames. +

+

The filter accepts the following options: +

+
+
loop
+

Set the number of loops. Setting this value to -1 will result in infinite loops. +Default is 0. +

+
+
size
+

Set maximal size in number of frames. Default is 0. +

+
+
start
+

Set first frame of loop. Default is 0. +

+
+
time
+

Set the time of loop start in seconds. +Only used if option named start is set to -1. +

+
+ + +
+

32.147.1 Examples

+ +
    +
  • Loop single first frame infinitely: +
    +
    loop=loop=-1:size=1:start=0
    +
    + +
  • Loop single first frame 10 times: +
    +
    loop=loop=10:size=1:start=0
    +
    + +
  • Loop 10 first frames 5 times: +
    +
    loop=loop=5:size=10:start=0
    +
    +
+ +
+
+
+

32.148 lut1d

+ +

Apply a 1D LUT to an input video. +

+

The filter accepts the following options: +

+
+
file
+

Set the 1D LUT file name. +

+

Currently supported formats: +

+
cube
+

Iridas +

+
csp
+

cineSpace +

+
+ +
+
interp
+

Select interpolation mode. +

+

Available values are: +

+
+
nearest
+

Use values from the nearest defined point. +

+
linear
+

Interpolate values using the linear interpolation. +

+
cosine
+

Interpolate values using the cosine interpolation. +

+
cubic
+

Interpolate values using the cubic interpolation. +

+
spline
+

Interpolate values using the spline interpolation. +

+
+
+
+ + +
+

32.148.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.149 lut3d

+ +

Apply a 3D LUT to an input video. +

+

The filter accepts the following options: +

+
+
file
+

Set the 3D LUT file name. +

+

Currently supported formats: +

+
3dl
+

AfterEffects +

+
cube
+

Iridas +

+
dat
+

DaVinci +

+
m3d
+

Pandora +

+
csp
+

cineSpace +

+
+
+
interp
+

Select interpolation mode. +

+

Available values are: +

+
+
nearest
+

Use values from the nearest defined point. +

+
trilinear
+

Interpolate values using the 8 points defining a cube. +

+
tetrahedral
+

Interpolate values using a tetrahedron. +

+
pyramid
+

Interpolate values using a pyramid. +

+
prism
+

Interpolate values using a prism. +

+
+
+
+ + +
+

32.149.1 Commands

+ +

This filter supports the interp option as commands. +

+
+
+
+

32.150 lumakey

+ +

Turn certain luma values into transparency. +

+

The filter accepts the following options: +

+
+
threshold
+

Set the luma which will be used as base for transparency. +Default value is 0. +

+
+
tolerance
+

Set the range of luma values to be keyed out. +Default value is 0.01. +

+
+
softness
+

Set the range of softness. Default value is 0. +Use this to control gradual transition from zero to full transparency. +

+
+ + +
+

32.150.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

32.151 lut, lutrgb, lutyuv

+ +

Compute a look-up table for binding each pixel component input value +to an output value, and apply it to the input video. +

+

lutyuv applies a lookup table to a YUV input video, lutrgb +to an RGB input video. +

+

These filters accept the following parameters: +

+
c0
+

set first pixel component expression +

+
c1
+

set second pixel component expression +

+
c2
+

set third pixel component expression +

+
c3
+

set fourth pixel component expression, corresponds to the alpha component +

+
+
r
+

set red component expression +

+
g
+

set green component expression +

+
b
+

set blue component expression +

+
a
+

alpha component expression +

+
+
y
+

set Y/luminance component expression +

+
u
+

set U/Cb component expression +

+
v
+

set V/Cr component expression +

+
+ +

Each of them specifies the expression to use for computing the lookup table for +the corresponding pixel component values. +

+

The exact component associated to each of the c* options depends on the +format in input. +

+

The lut filter requires either YUV or RGB pixel formats in input, +lutrgb requires RGB pixel formats in input, and lutyuv requires YUV. +

+

The expressions can contain the following constants and functions: +

+
+
w
+
h
+

The input width and height. +

+
+
val
+

The input value for the pixel component. +

+
+
clipval
+

The input value, clipped to the minval-maxval range. +

+
+
maxval
+

The maximum value for the pixel component. +

+
+
minval
+

The minimum value for the pixel component. +

+
+
negval
+

The negated value for the pixel component value, clipped to the +minval-maxval range; it corresponds to the expression +"maxval-clipval+minval". +

+
+
clip(val)
+

The computed value in val, clipped to the +minval-maxval range. +

+
+
gammaval(gamma)
+

The computed gamma correction value of the pixel component value, +clipped to the minval-maxval range. It corresponds to the +expression +"pow((clipval-minval)/(maxval-minval)\,gamma)*(maxval-minval)+minval" +

+
+
+ +

All expressions default to "clipval". +

+ +
+

32.151.1 Commands

+ +

This filter supports same commands as options. +

+
+
+

32.151.2 Examples

+ +
    +
  • Negate input video: +
    +
    lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
    +lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
    +
    + +

    The above is the same as: +

    +
    lutrgb="r=negval:g=negval:b=negval"
    +lutyuv="y=negval:u=negval:v=negval"
    +
    + +
  • Negate luminance: +
    +
    lutyuv=y=negval
    +
    + +
  • Remove chroma components, turning the video into a graytone image: +
    +
    lutyuv="u=128:v=128"
    +
    + +
  • Apply a luma burning effect: +
    +
    lutyuv="y=2*val"
    +
    + +
  • Remove green and blue components: +
    +
    lutrgb="g=0:b=0"
    +
    + +
  • Set a constant alpha channel value on input: +
    +
    format=rgba,lutrgb=a="maxval-minval/2"
    +
    + +
  • Correct luminance gamma by a factor of 0.5: +
    +
    lutyuv=y=gammaval(0.5)
    +
    + +
  • Discard least significant bits of luma: +
    +
    lutyuv=y='bitand(val, 128+64+32)'
    +
    + +
  • Technicolor like effect: +
    +
    lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
    +
    +
+ +
+
+
+

32.152 lut2, tlut2

+ +

The lut2 filter takes two input streams and outputs one +stream. +

+

The tlut2 (time lut2) filter takes two consecutive frames +from one single stream. +

+

This filter accepts the following parameters: +

+
c0
+

set first pixel component expression +

+
c1
+

set second pixel component expression +

+
c2
+

set third pixel component expression +

+
c3
+

set fourth pixel component expression, corresponds to the alpha component +

+
+
d
+

set output bit depth, only available for lut2 filter. By default is 0, +which means bit depth is automatically picked from first input format. +

+
+ +

The lut2 filter also supports the framesync options. +

+

Each of them specifies the expression to use for computing the lookup table for +the corresponding pixel component values. +

+

The exact component associated to each of the c* options depends on the +format in inputs. +

+

The expressions can contain the following constants: +

+
+
w
+
h
+

The input width and height. +

+
+
x
+

The first input value for the pixel component. +

+
+
y
+

The second input value for the pixel component. +

+
+
bdx
+

The first input video bit depth. +

+
+
bdy
+

The second input video bit depth. +

+
+ +

All expressions default to "x". +

+ +
+

32.152.1 Commands

+ +

This filter supports the all above options as commands except option d. +

+
+
+

32.152.2 Examples

+ +
    +
  • Highlight differences between two RGB video streams: +
    +
    lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1)'
    +
    + +
  • Highlight differences between two YUV video streams: +
    +
    lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1)'
    +
    + +
  • Show max difference between two video streams: +
    +
    lut2='if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1)))'
    +
    +
+ +
+
+
+

32.153 maskedclamp

+ +

Clamp the first input stream with the second input and third input stream. +

+

Returns the value of first stream to be between second input +stream - undershoot and third input stream + overshoot. +

+

This filter accepts the following options: +

+
undershoot
+

Default value is 0. +

+
+
overshoot
+

Default value is 0. +

+
+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

32.153.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.154 maskedmax

+ +

Merge the second and third input stream into output stream using absolute differences +between second input stream and first input stream and absolute difference between +third input stream and first input stream. The picked value will be from second input +stream if second absolute difference is greater than first one or from third input stream +otherwise. +

+

This filter accepts the following options: +

+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

32.154.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.155 maskedmerge

+ +

Merge the first input stream with the second input stream using per pixel +weights in the third input stream. +

+

A value of 0 in the third stream pixel component means that pixel component +from first stream is returned unchanged, while maximum value (eg. 255 for +8-bit videos) means that pixel component from second stream is returned +unchanged. Intermediate values define the amount of merging between both +input stream’s pixel components. +

+

This filter accepts the following options: +

+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

32.155.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.156 maskedmin

+ +

Merge the second and third input stream into output stream using absolute differences +between second input stream and first input stream and absolute difference between +third input stream and first input stream. The picked value will be from second input +stream if second absolute difference is less than first one or from third input stream +otherwise. +

+

This filter accepts the following options: +

+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from first stream. +By default value 0xf, all planes will be processed. +

+
+ + +
+

32.156.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.157 maskedthreshold

+

Pick pixels comparing absolute difference of two video streams with fixed +threshold. +

+

If absolute difference between pixel component of first and second video +stream is equal or lower than user supplied threshold than pixel component +from first video stream is picked, otherwise pixel component from second +video stream is picked. +

+

This filter accepts the following options: +

+
threshold
+

Set threshold used when picking pixels from absolute difference from two input +video streams. +

+
+
planes
+

Set which planes will be processed as bitmap, unprocessed planes will be +copied from second stream. +By default value 0xf, all planes will be processed. +

+
+
mode
+

Set mode of filter operation. Can be abs or diff. +Default is abs. +

+
+ + +
+

32.157.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.158 maskfun

+

Create mask from input video. +

+

For example it is useful to create motion masks after tblend filter. +

+

This filter accepts the following options: +

+
+
low
+

Set low threshold. Any pixel component lower or exact than this value will be set to 0. +

+
+
high
+

Set high threshold. Any pixel component higher than this value will be set to max value +allowed for current pixel format. +

+
+
planes
+

Set planes to filter, by default all available planes are filtered. +

+
+
fill
+

Fill all frame pixels with this value. +

+
+
sum
+

Set max average pixel value for frame. If sum of all pixel components is higher that this +average, output frame will be completely filled with value set by fill option. +Typically useful for scene changes when used in combination with tblend filter. +

+
+ + +
+

32.158.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.159 mcdeint

+ +

Apply motion-compensation deinterlacing. +

+

It needs one field per frame as input and must thus be used together +with yadif=1/3 or equivalent. +

+

This filter accepts the following options: +

+
mode
+

Set the deinterlacing mode. +

+

It accepts one of the following values: +

+
fast
+
medium
+
slow
+

use iterative motion estimation +

+
extra_slow
+

like ‘slow’, but use multiple reference frames. +

+
+

Default value is ‘fast’. +

+
+
parity
+

Set the picture field parity assumed for the input video. It must be +one of the following values: +

+
+
0, tff
+

assume top field first +

+
1, bff
+

assume bottom field first +

+
+ +

Default value is ‘bff’. +

+
+
qp
+

Set per-block quantization parameter (QP) used by the internal +encoder. +

+

Higher values should result in a smoother motion vector field but less +optimal individual vectors. Default value is 1. +

+
+ +
+
+

32.160 median

+ +

Pick median pixel from certain rectangle defined by radius. +

+

This filter accepts the following options: +

+
+
radius
+

Set horizontal radius size. Default value is 1. +Allowed range is integer from 1 to 127. +

+
+
planes
+

Set which planes to process. Default is 15, which is all available planes. +

+
+
radiusV
+

Set vertical radius size. Default value is 0. +Allowed range is integer from 0 to 127. +If it is 0, value will be picked from horizontal radius option. +

+
+
percentile
+

Set median percentile. Default value is 0.5. +Default value of 0.5 will pick always median values, while 0 will pick +minimum values, and 1 maximum values. +

+
+ + +
+

32.160.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+
+

32.161 mergeplanes

+ +

Merge color channel components from several video streams. +

+

The filter accepts up to 4 input streams, and merge selected input +planes to the output video. +

+

This filter accepts the following options: +

+
mapping
+

Set input to output plane mapping. Default is 0. +

+

The mappings is specified as a bitmap. It should be specified as a +hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. ’Aa’ describes the +mapping for the first plane of the output stream. ’A’ sets the number of +the input stream to use (from 0 to 3), and ’a’ the plane number of the +corresponding input to use (from 0 to 3). The rest of the mappings is +similar, ’Bb’ describes the mapping for the output stream second +plane, ’Cc’ describes the mapping for the output stream third plane and +’Dd’ describes the mapping for the output stream fourth plane. +

+
+
format
+

Set output pixel format. Default is yuva444p. +

+
+
map0s
+
map1s
+
map2s
+
map3s
+

Set input to output stream mapping for output Nth plane. Default is 0. +

+
+
map0p
+
map1p
+
map2p
+
map3p
+

Set input to output plane mapping for output Nth plane. Default is 0. +

+
+ + +
+

32.161.1 Examples

+ +
    +
  • Merge three gray video streams of same width and height into single video stream: +
    +
    [a0][a1][a2]mergeplanes=0x001020:yuv444p
    +
    + +
  • Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream: +
    +
    [a0][a1]mergeplanes=0x00010210:yuva444p
    +
    + +
  • Swap Y and A plane in yuva444p stream: +
    +
    format=yuva444p,mergeplanes=0x03010200:yuva444p
    +
    + +
  • Swap U and V plane in yuv420p stream: +
    +
    format=yuv420p,mergeplanes=0x000201:yuv420p
    +
    + +
  • Cast a rgb24 clip to yuv444p: +
    +
    format=rgb24,mergeplanes=0x000102:yuv444p
    +
    +
+ +
+
+
+

32.162 mestimate

+ +

Estimate and export motion vectors using block matching algorithms. +Motion vectors are stored in frame side data to be used by other filters. +

+

This filter accepts the following options: +

+
method
+

Specify the motion estimation method. Accepts one of the following values: +

+
+
esa
+

Exhaustive search algorithm. +

+
tss
+

Three step search algorithm. +

+
tdls
+

Two dimensional logarithmic search algorithm. +

+
ntss
+

New three step search algorithm. +

+
fss
+

Four step search algorithm. +

+
ds
+

Diamond search algorithm. +

+
hexbs
+

Hexagon-based search algorithm. +

+
epzs
+

Enhanced predictive zonal search algorithm. +

+
umh
+

Uneven multi-hexagon search algorithm. +

+
+

Default value is ‘esa’. +

+
+
mb_size
+

Macroblock size. Default 16. +

+
+
search_param
+

Search parameter. Default 7. +

+
+ +
+
+

32.163 midequalizer

+ +

Apply Midway Image Equalization effect using two video streams. +

+

Midway Image Equalization adjusts a pair of images to have the same +histogram, while maintaining their dynamics as much as possible. It’s +useful for e.g. matching exposures from a pair of stereo cameras. +

+

This filter has two inputs and one output, which must be of same pixel format, but +may be of different sizes. The output of filter is first input adjusted with +midway histogram of both inputs. +

+

This filter accepts the following option: +

+
+
planes
+

Set which planes to process. Default is 15, which is all available planes. +

+
+ +
+
+

32.164 minterpolate

+ +

Convert the video to specified frame rate using motion interpolation. +

+

This filter accepts the following options: +

+
fps
+

Specify the output frame rate. This can be rational e.g. 60000/1001. Frames are dropped if fps is lower than source fps. Default 60. +

+
+
mi_mode
+

Motion interpolation mode. Following values are accepted: +

+
dup
+

Duplicate previous or next frame for interpolating new ones. +

+
blend
+

Blend source frames. Interpolated frame is mean of previous and next frames. +

+
mci
+

Motion compensated interpolation. Following options are effective when this mode is selected: +

+
+
mc_mode
+

Motion compensation mode. Following values are accepted: +

+
obmc
+

Overlapped block motion compensation. +

+
aobmc
+

Adaptive overlapped block motion compensation. Window weighting coefficients are controlled adaptively according to the reliabilities of the neighboring motion vectors to reduce oversmoothing. +

+
+

Default mode is ‘obmc’. +

+
+
me_mode
+

Motion estimation mode. Following values are accepted: +

+
bidir
+

Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions. +

+
bilat
+

Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame. +

+
+

Default mode is ‘bilat’. +

+
+
me
+

The algorithm to be used for motion estimation. Following values are accepted: +

+
esa
+

Exhaustive search algorithm. +

+
tss
+

Three step search algorithm. +

+
tdls
+

Two dimensional logarithmic search algorithm. +

+
ntss
+

New three step search algorithm. +

+
fss
+

Four step search algorithm. +

+
ds
+

Diamond search algorithm. +

+
hexbs
+

Hexagon-based search algorithm. +

+
epzs
+

Enhanced predictive zonal search algorithm. +

+
umh
+

Uneven multi-hexagon search algorithm. +

+
+

Default algorithm is ‘epzs’. +

+
+
mb_size
+

Macroblock size. Default 16. +

+
+
search_param
+

Motion estimation search parameter. Default 32. +

+
+
vsbmc
+

Enable variable-size block motion compensation. Motion estimation is applied with smaller block sizes at object boundaries in order to make the them less blur. Default is 0 (disabled). +

+
+
+
+ +
+
scd
+

Scene change detection method. Scene change leads motion vectors to be in random direction. Scene change detection replace interpolated frames by duplicate ones. May not be needed for other modes. Following values are accepted: +

+
none
+

Disable scene change detection. +

+
fdiff
+

Frame difference. Corresponding pixel values are compared and if it satisfies scd_threshold scene change is detected. +

+
+

Default method is ‘fdiff’. +

+
+
scd_threshold
+

Scene change detection threshold. Default is 10.. +

+
+ +
+
+

32.165 mix

+ +

Mix several video input streams into one video stream. +

+

A description of the accepted options follows. +

+
+
inputs
+

The number of inputs. If unspecified, it defaults to 2. +

+
+
weights
+

Specify weight of each input video stream as sequence. +Each weight is separated by space. If number of weights +is smaller than number of frames last specified +weight will be used for all remaining unset weights. +

+
+
scale
+

Specify scale, if it is set it will be multiplied with sum +of each weight multiplied with pixel values to give final destination +pixel value. By default scale is auto scaled to sum of weights. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+
duration
+

Specify how end of stream is determined. +

+
longest
+

The duration of the longest input. (default) +

+
+
shortest
+

The duration of the shortest input. +

+
+
first
+

The duration of the first input. +

+
+
+
+ + +
+

32.165.1 Commands

+ +

This filter supports the following commands: +

+
weights
+
scale
+
planes
+

Syntax is same as option with same name. +

+
+ +
+
+
+

32.166 monochrome

+

Convert video to gray using custom color filter. +

+

A description of the accepted options follows. +

+
+
cb
+

Set the chroma blue spot. Allowed range is from -1 to 1. +Default value is 0. +

+
+
cr
+

Set the chroma red spot. Allowed range is from -1 to 1. +Default value is 0. +

+
+
size
+

Set the color filter size. Allowed range is from .1 to 10. +Default value is 1. +

+
+
high
+

Set the highlights strength. Allowed range is from 0 to 1. +Default value is 0. +

+
+ + +
+

32.166.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.167 morpho

+ +

This filter allows to apply main morphological grayscale transforms, +erode and dilate with arbitrary structures set in second input stream. +

+

Unlike naive implementation and much slower performance in erosion +and dilation filters, when speed is critical morpho filter +should be used instead. +

+

A description of accepted options follows, +

+
+
mode
+

Set morphological transform to apply, can be: +

+
+
erode
+
dilate
+
open
+
close
+
gradient
+
tophat
+
blackhat
+
+

Default is erode. +

+
+
planes
+

Set planes to filter, by default all planes except alpha are filtered. +

+
+
structure
+

Set which structure video frames will be processed from second input stream, +can be first or all. Default is all. +

+
+ +

The morpho filter also supports the framesync options. +

+ +
+

32.167.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

32.168 mpdecimate

+ +

Drop frames that do not differ greatly from the previous frame in +order to reduce frame rate. +

+

The main use of this filter is for very-low-bitrate encoding +(e.g. streaming over dialup modem), but it could in theory be used for +fixing movies that were inverse-telecined incorrectly. +

+

A description of the accepted options follows. +

+
+
max
+

Set the maximum number of consecutive frames which can be dropped (if +positive), or the minimum interval between dropped frames (if +negative). If the value is 0, the frame is dropped disregarding the +number of previous sequentially dropped frames. +

+

Default value is 0. +

+
+
keep
+

Set the maximum number of consecutive similar frames to ignore before to start dropping them. +If the value is 0, the frame is dropped disregarding the +number of previous sequentially similar frames. +

+

Default value is 0. +

+
+
hi
+
lo
+
frac
+

Set the dropping threshold values. +

+

Values for hi and lo are for 8x8 pixel blocks and +represent actual pixel value differences, so a threshold of 64 +corresponds to 1 unit of difference for each pixel, or the same spread +out differently over the block. +

+

A frame is a candidate for dropping if no 8x8 blocks differ by more +than a threshold of hi, and if no more than frac blocks (1 +meaning the whole image) differ by more than a threshold of lo. +

+

Default value for hi is 64*12, default value for lo is +64*5, and default value for frac is 0.33. +

+
+ +
+
+

32.169 msad

+ +

Obtain the MSAD (Mean Sum of Absolute Differences) between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained per component, average, min and max MSAD is printed through +the logging system. +

+

The filter stores the calculated MSAD of each frame in frame metadata. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi msad -f null -
+
+ +
+
+

32.170 multiply

+

Multiply first video stream pixels values with second video stream pixels values. +

+

The filter accepts the following options: +

+
+
scale
+

Set the scale applied to second video stream. By default is 1. +Allowed range is from 0 to 9. +

+
+
offset
+

Set the offset applied to second video stream. By default is 0.5. +Allowed range is from -1 to 1. +

+
+
planes
+

Specify planes from input video stream that will be processed. +By default all planes are processed. +

+
+ + +
+

32.170.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

32.171 negate

+ +

Negate (invert) the input video. +

+

It accepts the following option: +

+
+
components
+

Set components to negate. +

+

Available values for components are: +

+
y
+
u
+
v
+
a
+
r
+
g
+
b
+
+ +
+
negate_alpha
+

With value 1, it negates the alpha component, if present. Default value is 0. +

+
+ + +
+

32.171.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

32.172 nlmeans

+ +

Denoise frames using Non-Local Means algorithm. +

+

Each pixel is adjusted by looking for other pixels with similar contexts. This +context similarity is defined by comparing their surrounding patches of size +pxp. Patches are searched in an area of rxr +around the pixel. +

+

Note that the research area defines centers for patches, which means some +patches will be made of pixels outside that research area. +

+

The filter accepts the following options. +

+
+
s
+

Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0]. +

+
+
p
+

Set patch size. Default is 7. Must be odd number in range [0, 99]. +

+
+
pc
+

Same as p but for chroma planes. +

+

The default value is 0 and means automatic. +

+
+
r
+

Set research size. Default is 15. Must be odd number in range [0, 99]. +

+
+
rc
+

Same as r but for chroma planes. +

+

The default value is 0 and means automatic. +

+
+ +
+
+

32.173 nnedi

+ +

Deinterlace video using neural network edge directed interpolation. +

+

This filter accepts the following options: +

+
+
weights
+

Mandatory option, without binary file filter can not work. +Currently file can be found here: +https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin +

+
+
deint
+

Set which frames to deinterlace, by default it is all. +Can be all or interlaced. +

+
+
field
+

Set mode of operation. +

+

Can be one of the following: +

+
+
af
+

Use frame flags, both fields. +

+
a
+

Use frame flags, single field. +

+
t
+

Use top field only. +

+
b
+

Use bottom field only. +

+
tf
+

Use both fields, top first. +

+
bf
+

Use both fields, bottom first. +

+
+ +
+
planes
+

Set which planes to process, by default filter process all frames. +

+
+
nsize
+

Set size of local neighborhood around each pixel, used by the predictor neural +network. +

+

Can be one of the following: +

+
+
s8x6
+
s16x6
+
s32x6
+
s48x6
+
s8x4
+
s16x4
+
s32x4
+
+ +
+
nns
+

Set the number of neurons in predictor neural network. +Can be one of the following: +

+
+
n16
+
n32
+
n64
+
n128
+
n256
+
+ +
+
qual
+

Controls the number of different neural network predictions that are blended +together to compute the final output value. Can be fast, default or +slow. +

+
+
etype
+

Set which set of weights to use in the predictor. +Can be one of the following: +

+
+
a, abs
+

weights trained to minimize absolute error +

+
s, mse
+

weights trained to minimize squared error +

+
+ +
+
pscrn
+

Controls whether or not the prescreener neural network is used to decide +which pixels should be processed by the predictor neural network and which +can be handled by simple cubic interpolation. +The prescreener is trained to know whether cubic interpolation will be +sufficient for a pixel or whether it should be predicted by the predictor nn. +The computational complexity of the prescreener nn is much less than that of +the predictor nn. Since most pixels can be handled by cubic interpolation, +using the prescreener generally results in much faster processing. +The prescreener is pretty accurate, so the difference between using it and not +using it is almost always unnoticeable. +

+

Can be one of the following: +

+
+
none
+
original
+
new
+
new2
+
new3
+
+ +

Default is new. +

+
+ + +
+

32.173.1 Commands

+

This filter supports same commands as options, excluding weights option. +

+
+
+
+

32.174 noformat

+ +

Force libavfilter not to use any of the specified pixel formats for the +input to the next filter. +

+

It accepts the following parameters: +

+
pix_fmts
+

A ’|’-separated list of pixel format names, such as +pix_fmts=yuv420p|monow|rgb24". +

+
+
+ + +
+

32.174.1 Examples

+ +
    +
  • Force libavfilter to use a format different from yuv420p for the +input to the vflip filter: +
    +
    noformat=pix_fmts=yuv420p,vflip
    +
    + +
  • Convert the input video to any of the formats not contained in the list: +
    +
    noformat=yuv420p|yuv444p|yuv410p
    +
    +
+ +
+
+
+

32.175 noise

+ +

Add noise on video input frame. +

+

The filter accepts the following options: +

+
+
all_seed
+
c0_seed
+
c1_seed
+
c2_seed
+
c3_seed
+

Set noise seed for specific pixel component or all pixel components in case +of all_seed. Default value is 123457. +

+
+
all_strength, alls
+
c0_strength, c0s
+
c1_strength, c1s
+
c2_strength, c2s
+
c3_strength, c3s
+

Set noise strength for specific pixel component or all pixel components in case +all_strength. Default value is 0. Allowed range is [0, 100]. +

+
+
all_flags, allf
+
c0_flags, c0f
+
c1_flags, c1f
+
c2_flags, c2f
+
c3_flags, c3f
+

Set pixel component flags or set flags for all components if all_flags. +Available values for component flags are: +

+
a
+

averaged temporal noise (smoother) +

+
p
+

mix random noise with a (semi)regular pattern +

+
t
+

temporal noise (noise pattern changes between frames) +

+
u
+

uniform noise (gaussian otherwise) +

+
+
+
+ + +
+

32.175.1 Examples

+ +

Add temporal and uniform noise to input video: +

+
noise=alls=20:allf=t+u
+
+ +
+
+
+

32.176 normalize

+ +

Normalize RGB video (aka histogram stretching, contrast stretching). +See: https://en.wikipedia.org/wiki/Normalization_(image_processing) +

+

For each channel of each frame, the filter computes the input range and maps +it linearly to the user-specified output range. The output range defaults +to the full dynamic range from pure black to pure white. +

+

Temporal smoothing can be used on the input range to reduce flickering (rapid +changes in brightness) caused when small dark or bright objects enter or leave +the scene. This is similar to the auto-exposure (automatic gain control) on a +video camera, and, like a video camera, it may cause a period of over- or +under-exposure of the video. +

+

The R,G,B channels can be normalized independently, which may cause some +color shifting, or linked together as a single channel, which prevents +color shifting. Linked normalization preserves hue. Independent normalization +does not, so it can be used to remove some color casts. Independent and linked +normalization can be combined in any ratio. +

+

The normalize filter accepts the following options: +

+
+
blackpt
+
whitept
+

Colors which define the output range. The minimum input value is mapped to +the blackpt. The maximum input value is mapped to the whitept. +The defaults are black and white respectively. Specifying white for +blackpt and black for whitept will give color-inverted, +normalized video. Shades of grey can be used to reduce the dynamic range +(contrast). Specifying saturated colors here can create some interesting +effects. +

+
+
smoothing
+

The number of previous frames to use for temporal smoothing. The input range +of each channel is smoothed using a rolling average over the current frame +and the smoothing previous frames. The default is 0 (no temporal +smoothing). +

+
+
independence
+

Controls the ratio of independent (color shifting) channel normalization to +linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully +independent. Defaults to 1.0 (fully independent). +

+
+
strength
+

Overall strength of the filter. 1.0 is full strength. 0.0 is a rather +expensive no-op. Defaults to 1.0 (full strength). +

+
+
+ + +
+

32.176.1 Commands

+

This filter supports same commands as options, excluding smoothing option. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+

32.176.2 Examples

+ +

Stretch video contrast to use the full dynamic range, with no temporal +smoothing; may flicker depending on the source content: +

+
normalize=blackpt=black:whitept=white:smoothing=0
+
+ +

As above, but with 50 frames of temporal smoothing; flicker should be +reduced, depending on the source content: +

+
normalize=blackpt=black:whitept=white:smoothing=50
+
+ +

As above, but with hue-preserving linked channel normalization: +

+
normalize=blackpt=black:whitept=white:smoothing=50:independence=0
+
+ +

As above, but with half strength: +

+
normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
+
+ +

Map the darkest input color to red, the brightest input color to cyan: +

+
normalize=blackpt=red:whitept=cyan
+
+ +
+
+
+

32.177 null

+ +

Pass the video source unchanged to the output. +

+
+
+

32.178 ocr

+

Optical Character Recognition +

+

This filter uses Tesseract for optical character recognition. To enable +compilation of this filter, you need to configure FFmpeg with +--enable-libtesseract. +

+

It accepts the following options: +

+
+
datapath
+

Set datapath to tesseract data. Default is to use whatever was +set at installation. +

+
+
language
+

Set language, default is "eng". +

+
+
whitelist
+

Set character whitelist. +

+
+
blacklist
+

Set character blacklist. +

+
+ +

The filter exports recognized text as the frame metadata lavfi.ocr.text. +The filter exports confidence of recognized words as the frame metadata lavfi.ocr.confidence. +

+
+
+

32.179 ocv

+ +

Apply a video transform using libopencv. +

+

To enable this filter, install the libopencv library and headers and +configure FFmpeg with --enable-libopencv. +

+

It accepts the following parameters: +

+
+
filter_name
+

The name of the libopencv filter to apply. +

+
+
filter_params
+

The parameters to pass to the libopencv filter. If not specified, the default +values are assumed. +

+
+
+ +

Refer to the official libopencv documentation for more precise +information: +http://docs.opencv.org/master/modules/imgproc/doc/filtering.html +

+

Several libopencv filters are supported; see the following subsections. +

+ +
+

32.179.1 dilate

+ +

Dilate an image by using a specific structuring element. +It corresponds to the libopencv function cvDilate. +

+

It accepts the parameters: struct_el|nb_iterations. +

+

struct_el represents a structuring element, and has the syntax: +colsxrows+anchor_xxanchor_y/shape +

+

cols and rows represent the number of columns and rows of +the structuring element, anchor_x and anchor_y the anchor +point, and shape the shape for the structuring element. shape +must be "rect", "cross", "ellipse", or "custom". +

+

If the value for shape is "custom", it must be followed by a +string of the form "=filename". The file with name +filename is assumed to represent a binary image, with each +printable character corresponding to a bright pixel. When a custom +shape is used, cols and rows are ignored, the number +or columns and rows of the read file are assumed instead. +

+

The default value for struct_el is "3x3+0x0/rect". +

+

nb_iterations specifies the number of times the transform is +applied to the image, and defaults to 1. +

+

Some examples: +

+
# Use the default values
+ocv=dilate
+
+# Dilate using a structuring element with a 5x5 cross, iterating two times
+ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
+
+# Read the shape from the file diamond.shape, iterating two times.
+# The file diamond.shape may contain a pattern of characters like this
+#   *
+#  ***
+# *****
+#  ***
+#   *
+# The specified columns and rows are ignored
+# but the anchor point coordinates are not
+ocv=dilate:0x0+2x2/custom=diamond.shape|2
+
+ +
+
+

32.179.2 erode

+ +

Erode an image by using a specific structuring element. +It corresponds to the libopencv function cvErode. +

+

It accepts the parameters: struct_el:nb_iterations, +with the same syntax and semantics as the dilate filter. +

+
+
+

32.179.3 smooth

+ +

Smooth the input video. +

+

The filter takes the following parameters: +type|param1|param2|param3|param4. +

+

type is the type of smooth filter to apply, and must be one of +the following values: "blur", "blur_no_scale", "median", "gaussian", +or "bilateral". The default value is "gaussian". +

+

The meaning of param1, param2, param3, and param4 +depends on the smooth type. param1 and +param2 accept integer positive values or 0. param3 and +param4 accept floating point values. +

+

The default value for param1 is 3. The default value for the +other parameters is 0. +

+

These parameters correspond to the parameters assigned to the +libopencv function cvSmooth. +

+
+
+
+

32.180 oscilloscope

+ +

2D Video Oscilloscope. +

+

Useful to measure spatial impulse, step responses, chroma delays, etc. +

+

It accepts the following parameters: +

+
+
x
+

Set scope center x position. +

+
+
y
+

Set scope center y position. +

+
+
s
+

Set scope size, relative to frame diagonal. +

+
+
t
+

Set scope tilt/rotation. +

+
+
o
+

Set trace opacity. +

+
+
tx
+

Set trace center x position. +

+
+
ty
+

Set trace center y position. +

+
+
tw
+

Set trace width, relative to width of frame. +

+
+
th
+

Set trace height, relative to height of frame. +

+
+
c
+

Set which components to trace. By default it traces first three components. +

+
+
g
+

Draw trace grid. By default is enabled. +

+
+
st
+

Draw some statistics. By default is enabled. +

+
+
sc
+

Draw scope. By default is enabled. +

+
+ + +
+

32.180.1 Commands

+

This filter supports same commands as options. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+
+

32.180.2 Examples

+ +
    +
  • Inspect full first row of video frame. +
    +
    oscilloscope=x=0.5:y=0:s=1
    +
    + +
  • Inspect full last row of video frame. +
    +
    oscilloscope=x=0.5:y=1:s=1
    +
    + +
  • Inspect full 5th line of video frame of height 1080. +
    +
    oscilloscope=x=0.5:y=5/1080:s=1
    +
    + +
  • Inspect full last column of video frame. +
    +
    oscilloscope=x=1:y=0.5:s=1:t=1
    +
    + +
+ +
+
+
+

32.181 overlay

+ +

Overlay one video on top of another. +

+

It takes two inputs and has one output. The first input is the "main" +video on which the second input is overlaid. +

+

It accepts the following parameters: +

+

A description of the accepted options follows. +

+
+
x
+
y
+

Set the expression for the x and y coordinates of the overlaid video +on the main video. Default value is "0" for both expressions. In case +the expression is invalid, it is set to a huge value (meaning that the +overlay will not be displayed within the output visible area). +

+
+
eof_action
+

See framesync. +

+
+
eval
+

Set when the expressions for x, and y are evaluated. +

+

It accepts the following values: +

+
init
+

only evaluate expressions once during the filter initialization or +when a command is processed +

+
+
frame
+

evaluate expressions for each incoming frame +

+
+ +

Default value is ‘frame’. +

+
+
shortest
+

See framesync. +

+
+
format
+

Set the format for the output video. +

+

It accepts the following values: +

+
yuv420
+

force YUV420 output +

+
+
yuv420p10
+

force YUV420p10 output +

+
+
yuv422
+

force YUV422 output +

+
+
yuv422p10
+

force YUV422p10 output +

+
+
yuv444
+

force YUV444 output +

+
+
rgb
+

force packed RGB output +

+
+
gbrp
+

force planar RGB output +

+
+
auto
+

automatically pick format +

+
+ +

Default value is ‘yuv420’. +

+
+
repeatlast
+

See framesync. +

+
+
alpha
+

Set format of alpha of the overlaid video, it can be straight or +premultiplied. Default is straight. +

+
+ +

The x, and y expressions can contain the following +parameters. +

+
+
main_w, W
+
main_h, H
+

The main input width and height. +

+
+
overlay_w, w
+
overlay_h, h
+

The overlay input width and height. +

+
+
x
+
y
+

The computed values for x and y. They are evaluated for +each new frame. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values of the output +format. For example for the pixel format "yuv422p" hsub is 2 and +vsub is 1. +

+
+
n
+

the number of input frame, starting from 0 +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, +do not use +

+
+
t
+

The timestamp, expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
+ +

This filter also supports the framesync options. +

+

Note that the n, t variables are available only +when evaluation is done per frame, and will evaluate to NAN +when eval is set to ‘init’. +

+

Be aware that frames are taken from each input video in timestamp +order, hence, if their initial timestamps differ, it is a good idea +to pass the two inputs through a setpts=PTS-STARTPTS filter to +have them begin in the same zero timestamp, as the example for +the movie filter does. +

+

You can chain together more overlays but you should test the +efficiency of such approach. +

+ +
+

32.181.1 Commands

+ +

This filter supports the following commands: +

+
x
+
y
+

Modify the x and y of the overlay input. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+

32.181.2 Examples

+ +
    +
  • Draw the overlay at 10 pixels from the bottom right corner of the main +video: +
    +
    overlay=main_w-overlay_w-10:main_h-overlay_h-10
    +
    + +

    Using named options the example above becomes: +

    +
    overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
    +
    + +
  • Insert a transparent PNG logo in the bottom left corner of the input, +using the ffmpeg tool with the -filter_complex option: +
    +
    ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
    +
    + +
  • Insert 2 different transparent PNG logos (second logo on bottom +right corner) using the ffmpeg tool: +
    +
    ffmpeg -i input -i logo1 -i logo2 -filter_complex 'overlay=x=10:y=H-h-10,overlay=x=W-w-10:y=H-h-10' output
    +
    + +
  • Add a transparent color layer on top of the main video; WxH +must specify the size of the main input to the overlay filter: +
    +
    color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
    +
    + +
  • Play an original video and a filtered version (here with the deshake +filter) side by side using the ffplay tool: +
    +
    ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
    +
    + +

    The above command is the same as: +

    +
    ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
    +
    + +
  • Make a sliding overlay appearing from the left to the right top part of the +screen starting since time 2: +
    +
    overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
    +
    + +
  • Compose output by putting two input videos side to side: +
    +
    ffmpeg -i left.avi -i right.avi -filter_complex "
    +nullsrc=size=200x100 [background];
    +[0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
    +[1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
    +[background][left]       overlay=shortest=1       [background+left];
    +[background+left][right] overlay=shortest=1:x=100 [left+right]
    +"
    +
    + +
  • Mask 10-20 seconds of a video by applying the delogo filter to a section +
    +
    ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
    +-vf '[in]split[split_main][split_delogo];[split_delogo]trim=start=360:end=371,delogo=0:0:640:480[delogoed];[split_main][delogoed]overlay=eof_action=pass[out]'
    +masked.avi
    +
    + +
  • Chain several overlays in cascade: +
    +
    nullsrc=s=200x200 [bg];
    +testsrc=s=100x100, split=4 [in0][in1][in2][in3];
    +[in0] lutrgb=r=0, [bg]   overlay=0:0     [mid0];
    +[in1] lutrgb=g=0, [mid0] overlay=100:0   [mid1];
    +[in2] lutrgb=b=0, [mid1] overlay=0:100   [mid2];
    +[in3] null,       [mid2] overlay=100:100 [out0]
    +
    + +
+ +
+
+
+

32.182 overlay_cuda

+ +

Overlay one video on top of another. +

+

This is the CUDA variant of the overlay filter. +It only accepts CUDA frames. The underlying input pixel formats have to match. +

+

It takes two inputs and has one output. The first input is the "main" +video on which the second input is overlaid. +

+

It accepts the following parameters: +

+
+
x
+
y
+

Set expressions for the x and y coordinates of the overlaid video +on the main video. +

+

They can contain the following parameters: +

+
+
main_w, W
+
main_h, H
+

The main input width and height. +

+
+
overlay_w, w
+
overlay_h, h
+

The overlay input width and height. +

+
+
x
+
y
+

The computed values for x and y. They are evaluated for +each new frame. +

+
+
n
+

The ordinal index of the main input frame, starting from 0. +

+
+
pos
+

The byte offset position in the file of the main input frame, NAN if unknown. +Deprecated, do not use. +

+
+
t
+

The timestamp of the main input frame, expressed in seconds, NAN if unknown. +

+
+
+ +

Default value is "0" for both expressions. +

+
+
eval
+

Set when the expressions for x and y are evaluated. +

+

It accepts the following values: +

+
init
+

Evaluate expressions once during filter initialization or +when a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame +

+
+ +

Default value is frame. +

+
+
eof_action
+

See framesync. +

+
+
shortest
+

See framesync. +

+
+
repeatlast
+

See framesync. +

+
+
+ +

This filter also supports the framesync options. +

+
+
+

32.183 owdenoise

+ +

Apply Overcomplete Wavelet denoiser. +

+

The filter accepts the following options: +

+
+
depth
+

Set depth. +

+

Larger depth values will denoise lower frequency components more, but +slow down filtering. +

+

Must be an int in the range 8-16, default is 8. +

+
+
luma_strength, ls
+

Set luma strength. +

+

Must be a double value in the range 0-1000, default is 1.0. +

+
+
chroma_strength, cs
+

Set chroma strength. +

+

Must be a double value in the range 0-1000, default is 1.0. +

+
+ +
+
+

32.184 pad

+ +

Add paddings to the input image, and place the original input at the +provided x, y coordinates. +

+

It accepts the following parameters: +

+
+
width, w
+
height, h
+

Specify an expression for the size of the output image with the +paddings added. If the value for width or height is 0, the +corresponding input size is used for the output. +

+

The width expression can reference the value set by the +height expression, and vice versa. +

+

The default value of width and height is 0. +

+
+
x
+
y
+

Specify the offsets to place the input image at within the padded area, +with respect to the top/left border of the output image. +

+

The x expression can reference the value set by the y +expression, and vice versa. +

+

The default value of x and y is 0. +

+

If x or y evaluate to a negative number, they’ll be changed +so the input image is centered on the padded area. +

+
+
color
+

Specify the color of the padded area. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. +

+

The default value of color is "black". +

+
+
eval
+

Specify when to evaluate width, height, x and y expression. +

+

It accepts the following values: +

+
+
init
+

Only evaluate expressions once during the filter initialization or when +a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+
+ +

Default value is ‘init’. +

+
+
aspect
+

Pad to aspect instead to a resolution. +

+
+
+ +

The value for the width, height, x, and y +options are expressions containing the following constants: +

+
+
in_w
+
in_h
+

The input video width and height. +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output width and height (the size of the padded area), as +specified by the width and height expressions. +

+
+
ow
+
oh
+

These are the same as out_w and out_h. +

+
+
x
+
y
+

The x and y offsets as specified by the x and y +expressions, or NAN if not yet specified. +

+
+
a
+

same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (iw / ih) * sar +

+
+
hsub
+
vsub
+

The horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ + +
+

32.184.1 Examples

+ +
    +
  • Add paddings with the color "violet" to the input video. The output video +size is 640x480, and the top-left corner of the input video is placed at +column 0, row 40 +
    +
    pad=640:480:0:40:violet
    +
    + +

    The example above is equivalent to the following command: +

    +
    pad=width=640:height=480:x=0:y=40:color=violet
    +
    + +
  • Pad the input to get an output with dimensions increased by 3/2, +and put the input video at the center of the padded area: +
    +
    pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • Pad the input to get a squared output with size equal to the maximum +value between the input width and height, and put the input video at +the center of the padded area: +
    +
    pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • Pad the input to get a final w/h ratio of 16:9: +
    +
    pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • In case of anamorphic video, in order to set the output display aspect +correctly, it is necessary to use sar in the expression, +according to the relation: +
    +
    (ih * X / ih) * sar = output_dar
    +X = output_dar / sar
    +
    + +

    Thus the previous example needs to be modified to: +

    +
    pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
    +
    + +
  • Double the output size and put the input video in the bottom-right +corner of the output padded area: +
    +
    pad="2*iw:2*ih:ow-iw:oh-ih"
    +
    +
+ +
+
+
+

32.185 palettegen

+ +

Generate one palette for a whole video stream. +

+

It accepts the following options: +

+
+
max_colors
+

Set the maximum number of colors to quantize in the palette. +Note: the palette will still contain 256 colors; the unused palette entries +will be black. +

+
+
reserve_transparent
+

Create a palette of 255 colors maximum and reserve the last one for +transparency. Reserving the transparency color is useful for GIF optimization. +If not set, the maximum of colors in the palette will be 256. You probably want +to disable this option for a standalone image. +Set by default. +

+
+
transparency_color
+

Set the color that will be used as background for transparency. +

+
+
stats_mode
+

Set statistics mode. +

+

It accepts the following values: +

+
full
+

Compute full frame histograms. +

+
diff
+

Compute histograms only for the part that differs from previous frame. This +might be relevant to give more importance to the moving part of your input if +the background is static. +

+
single
+

Compute new histogram for each frame. +

+
+ +

Default value is full. +

+
+ +

The filter also exports the frame metadata lavfi.color_quant_ratio +(nb_color_in / nb_color_out) which you can use to evaluate the degree of +color quantization of the palette. This information is also visible at +info logging level. +

+ +
+

32.185.1 Examples

+ +
    +
  • Generate a representative palette of a given video using ffmpeg: +
    +
    ffmpeg -i input.mkv -vf palettegen palette.png
    +
    +
+ +
+
+
+

32.186 paletteuse

+ +

Use a palette to downsample an input video stream. +

+

The filter takes two inputs: one video stream and a palette. The palette must +be a 256 pixels image. +

+

It accepts the following options: +

+
+
dither
+

Select dithering mode. Available algorithms are: +

+
bayer
+

Ordered 8x8 bayer dithering (deterministic) +

+
heckbert
+

Dithering as defined by Paul Heckbert in 1982 (simple error diffusion). +Note: this dithering is sometimes considered "wrong" and is included as a +reference. +

+
floyd_steinberg
+

Floyd and Steingberg dithering (error diffusion) +

+
sierra2
+

Frankie Sierra dithering v2 (error diffusion) +

+
sierra2_4a
+

Frankie Sierra dithering v2 "Lite" (error diffusion) +

+
sierra3
+

Frankie Sierra dithering v3 (error diffusion) +

+
burkes
+

Burkes dithering (error diffusion) +

+
atkinson
+

Atkinson dithering by Bill Atkinson at Apple Computer (error diffusion) +

+
none
+

Disable dithering. +

+
+ +

Default is sierra2_4a. +

+
+
bayer_scale
+

When bayer dithering is selected, this option defines the scale of the +pattern (how much the crosshatch pattern is visible). A low value means more +visible pattern for less banding, and higher value means less visible pattern +at the cost of more banding. +

+

The option must be an integer value in the range [0,5]. Default is 2. +

+
+
diff_mode
+

If set, define the zone to process +

+
+
rectangle
+

Only the changing rectangle will be reprocessed. This is similar to GIF +cropping/offsetting compression mechanism. This option can be useful for speed +if only a part of the image is changing, and has use cases such as limiting the +scope of the error diffusal dither to the rectangle that bounds the +moving scene (it leads to more deterministic output if the scene doesn’t change +much, and as a result less moving noise and better GIF compression). +

+
+ +

Default is none. +

+
+
new
+

Take new palette for each output frame. +

+
+
alpha_threshold
+

Sets the alpha threshold for transparency. Alpha values above this threshold +will be treated as completely opaque, and values below this threshold will be +treated as completely transparent. +

+

The option must be an integer value in the range [0,255]. Default is 128. +

+
+ + +
+

32.186.1 Examples

+ +
    +
  • Use a palette (generated for example with palettegen) to encode a GIF +using ffmpeg: +
    +
    ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
    +
    +
+ +
+
+
+

32.187 perspective

+ +

Correct perspective of video not recorded perpendicular to the screen. +

+

A description of the accepted parameters follows. +

+
+
x0
+
y0
+
x1
+
y1
+
x2
+
y2
+
x3
+
y3
+

Set coordinates expression for top left, top right, bottom left and bottom right corners. +Default values are 0:0:W:0:0:H:W:H with which perspective will remain unchanged. +If the sense option is set to source, then the specified points will be sent +to the corners of the destination. If the sense option is set to destination, +then the corners of the source will be sent to the specified coordinates. +

+

The expressions can use the following variables: +

+
+
W
+
H
+

the width and height of video frame. +

+
in
+

Input frame count. +

+
on
+

Output frame count. +

+
+ +
+
interpolation
+

Set interpolation for perspective correction. +

+

It accepts the following values: +

+
linear
+
cubic
+
+ +

Default value is ‘linear’. +

+
+
sense
+

Set interpretation of coordinate options. +

+

It accepts the following values: +

+
0, source
+
+

Send point in the source specified by the given coordinates to +the corners of the destination. +

+
+
1, destination
+
+

Send the corners of the source to the point in the destination specified +by the given coordinates. +

+

Default value is ‘source’. +

+
+ +
+
eval
+

Set when the expressions for coordinates x0,y0,...x3,y3 are evaluated. +

+

It accepts the following values: +

+
init
+

only evaluate expressions once during the filter initialization or +when a command is processed +

+
+
frame
+

evaluate expressions for each incoming frame +

+
+ +

Default value is ‘init’. +

+
+ +
+
+

32.188 phase

+ +

Delay interlaced video by one field time so that the field order changes. +

+

The intended use is to fix PAL movies that have been captured with the +opposite field order to the film-to-video transfer. +

+

A description of the accepted parameters follows. +

+
+
mode
+

Set phase mode. +

+

It accepts the following values: +

+
t
+

Capture field order top-first, transfer bottom-first. +Filter will delay the bottom field. +

+
+
b
+

Capture field order bottom-first, transfer top-first. +Filter will delay the top field. +

+
+
p
+

Capture and transfer with the same field order. This mode only exists +for the documentation of the other options to refer to, but if you +actually select it, the filter will faithfully do nothing. +

+
+
a
+

Capture field order determined automatically by field flags, transfer +opposite. +Filter selects among ‘t’ and ‘b’ modes on a frame by frame +basis using field flags. If no field information is available, +then this works just like ‘u’. +

+
+
u
+

Capture unknown or varying, transfer opposite. +Filter selects among ‘t’ and ‘b’ on a frame by frame basis by +analyzing the images and selecting the alternative that produces best +match between the fields. +

+
+
T
+

Capture top-first, transfer unknown or varying. +Filter selects among ‘t’ and ‘p’ using image analysis. +

+
+
B
+

Capture bottom-first, transfer unknown or varying. +Filter selects among ‘b’ and ‘p’ using image analysis. +

+
+
A
+

Capture determined by field flags, transfer unknown or varying. +Filter selects among ‘t’, ‘b’ and ‘p’ using field flags and +image analysis. If no field information is available, then this works just +like ‘U’. This is the default mode. +

+
+
U
+

Both capture and transfer unknown or varying. +Filter selects among ‘t’, ‘b’ and ‘p’ using image analysis only. +

+
+
+
+ + +
+

32.188.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.189 photosensitivity

+

Reduce various flashes in video, so to help users with epilepsy. +

+

It accepts the following options: +

+
frames, f
+

Set how many frames to use when filtering. Default is 30. +

+
+
threshold, t
+

Set detection threshold factor. Default is 1. +Lower is stricter. +

+
+
skip
+

Set how many pixels to skip when sampling frames. Default is 1. +Allowed range is from 1 to 1024. +

+
+
bypass
+

Leave frames unchanged. Default is disabled. +

+
+ +
+
+

32.190 pixdesctest

+ +

Pixel format descriptor test filter, mainly useful for internal +testing. The output video should be equal to the input video. +

+

For example: +

+
format=monow, pixdesctest
+
+ +

can be used to test the monowhite pixel format descriptor definition. +

+
+
+

32.191 pixelize

+

Apply pixelization to video stream. +

+

The filter accepts the following options: +

+
width, w
+
height, h
+

Set block dimensions that will be used for pixelization. +Default value is 16. +

+
+
mode, m
+

Set the mode of pixelization used. +

+

Possible values are: +

+
avg
+
min
+
max
+
+

Default value is avg. +

+
+
planes, p
+

Set what planes to filter. Default is to filter all planes. +

+
+ + +
+

32.191.1 Commands

+ +

This filter supports all options as commands. +

+
+
+
+

32.192 pixscope

+ +

Display sample values of color channels. Mainly useful for checking color +and levels. Minimum supported resolution is 640x480. +

+

The filters accept the following options: +

+
+
x
+

Set scope X position, relative offset on X axis. +

+
+
y
+

Set scope Y position, relative offset on Y axis. +

+
+
w
+

Set scope width. +

+
+
h
+

Set scope height. +

+
+
o
+

Set window opacity. This window also holds statistics about pixel area. +

+
+
wx
+

Set window X position, relative offset on X axis. +

+
+
wy
+

Set window Y position, relative offset on Y axis. +

+
+ + +
+

32.192.1 Commands

+ +

This filter supports same commands as options. +

+
+
+
+

32.193 pp

+ +

Enable the specified chain of postprocessing subfilters using libpostproc. This +library should be automatically selected with a GPL build (--enable-gpl). +Subfilters must be separated by ’/’ and can be disabled by prepending a ’-’. +Each subfilter and some options have a short and a long name that can be used +interchangeably, i.e. dr/dering are the same. +

+

The filters accept the following options: +

+
+
subfilters
+

Set postprocessing subfilters string. +

+
+ +

All subfilters share common options to determine their scope: +

+
+
a/autoq
+

Honor the quality commands for this subfilter. +

+
+
c/chrom
+

Do chrominance filtering, too (default). +

+
+
y/nochrom
+

Do luminance filtering only (no chrominance). +

+
+
n/noluma
+

Do chrominance filtering only (no luminance). +

+
+ +

These options can be appended after the subfilter name, separated by a ’|’. +

+

Available subfilters are: +

+
+
hb/hdeblock[|difference[|flatness]]
+

Horizontal deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+ +
+
vb/vdeblock[|difference[|flatness]]
+

Vertical deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+ +
+
ha/hadeblock[|difference[|flatness]]
+

Accurate horizontal deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+ +
+
va/vadeblock[|difference[|flatness]]
+

Accurate vertical deblocking filter +

+
difference
+

Difference factor where higher values mean more deblocking (default: 32). +

+
flatness
+

Flatness threshold where lower values mean more deblocking (default: 39). +

+
+
+
+ +

The horizontal and vertical deblocking filters share the difference and +flatness values so you cannot set different horizontal and vertical +thresholds. +

+
+
h1/x1hdeblock
+

Experimental horizontal deblocking filter +

+
+
v1/x1vdeblock
+

Experimental vertical deblocking filter +

+
+
dr/dering
+

Deringing filter +

+
+
tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer
+
+
threshold1
+

larger -> stronger filtering +

+
threshold2
+

larger -> stronger filtering +

+
threshold3
+

larger -> stronger filtering +

+
+ +
+
al/autolevels[:f/fullyrange], automatic brightness / contrast correction
+
+
f/fullyrange
+

Stretch luminance to 0-255. +

+
+ +
+
lb/linblenddeint
+

Linear blend deinterlacing filter that deinterlaces the given block by +filtering all lines with a (1 2 1) filter. +

+
+
li/linipoldeint
+

Linear interpolating deinterlacing filter that deinterlaces the given block by +linearly interpolating every second line. +

+
+
ci/cubicipoldeint
+

Cubic interpolating deinterlacing filter deinterlaces the given block by +cubically interpolating every second line. +

+
+
md/mediandeint
+

Median deinterlacing filter that deinterlaces the given block by applying a +median filter to every second line. +

+
+
fd/ffmpegdeint
+

FFmpeg deinterlacing filter that deinterlaces the given block by filtering every +second line with a (-1 4 2 4 -1) filter. +

+
+
l5/lowpass5
+

Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given +block by filtering all lines with a (-1 2 6 2 -1) filter. +

+
+
fq/forceQuant[|quantizer]
+

Overrides the quantizer table from the input with the constant quantizer you +specify. +

+
quantizer
+

Quantizer to use +

+
+ +
+
de/default
+

Default pp filter combination (hb|a,vb|a,dr|a) +

+
+
fa/fast
+

Fast pp filter combination (h1|a,v1|a,dr|a) +

+
+
ac
+

High quality pp filter combination (ha|a|128|7,va|a,dr|a) +

+
+ + +
+

32.193.1 Examples

+ +
    +
  • Apply horizontal and vertical deblocking, deringing and automatic +brightness/contrast: +
    +
    pp=hb/vb/dr/al
    +
    + +
  • Apply default filters without brightness/contrast correction: +
    +
    pp=de/-al
    +
    + +
  • Apply default filters and temporal denoiser: +
    +
    pp=default/tmpnoise|1|2|3
    +
    + +
  • Apply deblocking on luminance only, and switch vertical deblocking on or off +automatically depending on available CPU time: +
    +
    pp=hb|y/vb|a
    +
    +
+ +
+
+
+

32.194 pp7

+

Apply Postprocessing filter 7. It is variant of the spp filter, +similar to spp = 6 with 7 point DCT, where only the center sample is +used after IDCT. +

+

The filter accepts the following options: +

+
+
qp
+

Force a constant quantization parameter. It accepts an integer in range +0 to 63. If not set, the filter will use the QP from the video stream +(if available). +

+
+
mode
+

Set thresholding mode. Available modes are: +

+
+
hard
+

Set hard thresholding. +

+
soft
+

Set soft thresholding (better de-ringing effect, but likely blurrier). +

+
medium
+

Set medium thresholding (good results, default). +

+
+
+
+ +
+
+

32.195 premultiply

+

Apply alpha premultiply effect to input video stream using first plane +of second stream as alpha. +

+

Both streams must have same dimensions and same pixel format. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
inplace
+

Do not require 2nd input for processing, instead use alpha plane from input stream. +

+
+ +
+
+

32.196 prewitt

+

Apply prewitt operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

32.196.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.197 pseudocolor

+ +

Alter frame colors in video with pseudocolors. +

+

This filter accepts the following options: +

+
+
c0
+

set pixel first component expression +

+
+
c1
+

set pixel second component expression +

+
+
c2
+

set pixel third component expression +

+
+
c3
+

set pixel fourth component expression, corresponds to the alpha component +

+
+
index, i
+

set component to use as base for altering colors +

+
+
preset, p
+

Pick one of built-in LUTs. By default is set to none. +

+

Available LUTs: +

+
magma
+
inferno
+
plasma
+
viridis
+
turbo
+
cividis
+
range1
+
range2
+
shadows
+
highlights
+
solar
+
nominal
+
preferred
+
total
+
spectral
+
+ +
+
opacity
+

Set opacity of output colors. Allowed range is from 0 to 1. +Default value is set to 1. +

+
+ +

Each of the expression options specifies the expression to use for computing +the lookup table for the corresponding pixel component values. +

+

The expressions can contain the following constants and functions: +

+
+
w
+
h
+

The input width and height. +

+
+
val
+

The input value for the pixel component. +

+
+
ymin, umin, vmin, amin
+

The minimum allowed component value. +

+
+
ymax, umax, vmax, amax
+

The maximum allowed component value. +

+
+ +

All expressions default to "val". +

+ +
+

32.197.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

32.197.2 Examples

+ +
    +
  • Change too high luma values to gradient: +
    +
    pseudocolor="'if(between(val,ymax,amax),lerp(ymin,ymax,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(umax,umin,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(vmin,vmax,(val-ymax)/(amax-ymax)),-1):-1'"
    +
    +
+ +
+
+
+

32.198 psnr

+ +

Obtain the average, maximum and minimum PSNR (Peak Signal to Noise +Ratio) between two input videos. +

+

This filter takes in input two input videos, the first input is +considered the "main" source and is passed unchanged to the +output. The second input is used as a "reference" video for computing +the PSNR. +

+

Both video inputs must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained average PSNR is printed through the logging system. +

+

The filter stores the accumulated MSE (mean squared error) of each +frame, and at the end of the processing it is averaged across all frames +equally, and the following formula is applied to obtain the PSNR: +

+
+
PSNR = 10*log10(MAX^2/MSE)
+
+ +

Where MAX is the average of the maximum values of each component of the +image. +

+

The description of the accepted parameters follows. +

+
+
stats_file, f
+

If specified the filter will use the named file to save the PSNR of +each individual frame. When filename equals "-" the data is sent to +standard output. +

+
+
stats_version
+

Specifies which version of the stats file format to use. Details of +each format are written below. +Default value is 1. +

+
+
stats_add_max
+

Determines whether the max value is output to the stats log. +Default value is 0. +Requires stats_version >= 2. If this is set and stats_version < 2, +the filter will return an error. +

+
+ +

This filter also supports the framesync options. +

+

The file printed if stats_file is selected, contains a sequence of +key/value pairs of the form key:value for each compared +couple of frames. +

+

If a stats_version greater than 1 is specified, a header line precedes +the list of per-frame-pair stats, with key value pairs following the frame +format with the following parameters: +

+
+
psnr_log_version
+

The version of the log file format. Will match stats_version. +

+
+
fields
+

A comma separated list of the per-frame-pair parameters included in +the log. +

+
+ +

A description of each shown per-frame-pair parameter follows: +

+
+
n
+

sequential number of the input frame, starting from 1 +

+
+
mse_avg
+

Mean Square Error pixel-by-pixel average difference of the compared +frames, averaged over all the image components. +

+
+
mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a
+

Mean Square Error pixel-by-pixel average difference of the compared +frames for the component specified by the suffix. +

+
+
psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a
+

Peak Signal to Noise ratio of the compared frames for the component +specified by the suffix. +

+
+
max_avg, max_y, max_u, max_v
+

Maximum allowed value for each channel, and average over all +channels. +

+
+ + +
+

32.198.1 Examples

+
    +
  • For example: +
    +
    movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
    +[main][ref] psnr="stats_file=stats.log" [out]
    +
    + +

    On this example the input file being processed is compared with the +reference file ref_movie.mpg. The PSNR of each individual frame +is stored in stats.log. +

    +
  • Another example with different containers: +
    +
    ffmpeg -i main.mpg -i ref.mkv -lavfi  "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]psnr" -f null -
    +
    +
+ +
+
+
+

32.199 pullup

+ +

Pulldown reversal (inverse telecine) filter, capable of handling mixed +hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive +content. +

+

The pullup filter is designed to take advantage of future context in making +its decisions. This filter is stateless in the sense that it does not lock +onto a pattern to follow, but it instead looks forward to the following +fields in order to identify matches and rebuild progressive frames. +

+

To produce content with an even framerate, insert the fps filter after +pullup, use fps=24000/1001 if the input frame rate is 29.97fps, +fps=24 for 30fps and the (rare) telecined 25fps input. +

+

The filter accepts the following options: +

+
+
jl
+
jr
+
jt
+
jb
+

These options set the amount of "junk" to ignore at the left, right, top, and +bottom of the image, respectively. Left and right are in units of 8 pixels, +while top and bottom are in units of 2 lines. +The default is 8 pixels on each side. +

+
+
sb
+

Set the strict breaks. Setting this option to 1 will reduce the chances of +filter generating an occasional mismatched frame, but it may also cause an +excessive number of frames to be dropped during high motion sequences. +Conversely, setting it to -1 will make filter match fields more easily. +This may help processing of video where there is slight blurring between +the fields, but may also cause there to be interlaced frames in the output. +Default value is 0. +

+
+
mp
+

Set the metric plane to use. It accepts the following values: +

+
l
+

Use luma plane. +

+
+
u
+

Use chroma blue plane. +

+
+
v
+

Use chroma red plane. +

+
+ +

This option may be set to use chroma plane instead of the default luma plane +for doing filter’s computations. This may improve accuracy on very clean +source material, but more likely will decrease accuracy, especially if there +is chroma noise (rainbow effect) or any grayscale video. +The main purpose of setting mp to a chroma plane is to reduce CPU +load and make pullup usable in realtime on slow machines. +

+
+ +

For best results (without duplicated frames in the output file) it is +necessary to change the output frame rate. For example, to inverse +telecine NTSC input: +

+
ffmpeg -i input -vf pullup -r 24000/1001 ...
+
+ +
+
+

32.200 qp

+ +

Change video quantization parameters (QP). +

+

The filter accepts the following option: +

+
+
qp
+

Set expression for quantization parameter. +

+
+ +

The expression is evaluated through the eval API and can contain, among others, +the following constants: +

+
+
known
+

1 if index is not 129, 0 otherwise. +

+
+
qp
+

Sequential index starting from -129 to 128. +

+
+ + +
+

32.200.1 Examples

+ +
    +
  • Some equation like: +
    +
    qp=2+2*sin(PI*qp)
    +
    +
+ +
+
+
+

32.201 random

+ +

Flush video frames from internal cache of frames into a random order. +No frame is discarded. +Inspired by frei0r nervous filter. +

+
+
frames
+

Set size in number of frames of internal cache, in range from 2 to +512. Default is 30. +

+
+
seed
+

Set seed for random number generator, must be an integer included between +0 and UINT32_MAX. If not specified, or if explicitly set to +less than 0, the filter will try to use a good random seed on a +best effort basis. +

+
+ +
+
+

32.202 readeia608

+ +

Read closed captioning (EIA-608) information from the top lines of a video frame. +

+

This filter adds frame metadata for lavfi.readeia608.X.cc and +lavfi.readeia608.X.line, where X is the number of the identified line +with EIA-608 data (starting from 0). A description of each metadata value follows: +

+
+
lavfi.readeia608.X.cc
+

The two bytes stored as EIA-608 data (printed in hexadecimal). +

+
+
lavfi.readeia608.X.line
+

The number of the line on which the EIA-608 data was identified and read. +

+
+ +

This filter accepts the following options: +

+
+
scan_min
+

Set the line to start scanning for EIA-608 data. Default is 0. +

+
+
scan_max
+

Set the line to end scanning for EIA-608 data. Default is 29. +

+
+
spw
+

Set the ratio of width reserved for sync code detection. +Default is 0.27. Allowed range is [0.1 - 0.7]. +

+
+
chp
+

Enable checking the parity bit. In the event of a parity error, the filter will output +0x00 for that character. Default is false. +

+
+
lp
+

Lowpass lines prior to further processing. Default is enabled. +

+
+ + +
+

32.202.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+

32.202.2 Examples

+ +
    +
  • Output a csv with presentation time and the first two lines of identified EIA-608 captioning data. +
    +
    ffprobe -f lavfi -i movie=captioned_video.mov,readeia608 -show_entries frame=pts_time:frame_tags=lavfi.readeia608.0.cc,lavfi.readeia608.1.cc -of csv
    +
    +
+ +
+
+
+

32.203 readvitc

+ +

Read vertical interval timecode (VITC) information from the top lines of a +video frame. +

+

The filter adds frame metadata key lavfi.readvitc.tc_str with the +timecode value, if a valid timecode has been detected. Further metadata key +lavfi.readvitc.found is set to 0/1 depending on whether +timecode data has been found or not. +

+

This filter accepts the following options: +

+
+
scan_max
+

Set the maximum number of lines to scan for VITC data. If the value is set to +-1 the full video frame is scanned. Default is 45. +

+
+
thr_b
+

Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0], +default value is 0.2. The value must be equal or less than thr_w. +

+
+
thr_w
+

Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0], +default value is 0.6. The value must be equal or greater than thr_b. +

+
+ + +
+

32.203.1 Examples

+ +
    +
  • Detect and draw VITC data onto the video frame; if no valid VITC is detected, +draw --:--:--:-- as a placeholder: +
    +
    ffmpeg -i input.avi -filter:v 'readvitc,drawtext=fontfile=FreeMono.ttf:text=%{metadata\\:lavfi.readvitc.tc_str\\:--\\\\\\:--\\\\\\:--\\\\\\:--}:x=(w-tw)/2:y=400-ascent'
    +
    +
+ +
+
+
+

32.204 remap

+ +

Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream. +

+

Destination pixel at position (X, Y) will be picked from source (x, y) position +where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero +value for pixel will be used for destination pixel. +

+

Xmap and Ymap input video streams must be of same dimensions. Output video stream +will have Xmap/Ymap video stream dimensions. +Xmap and Ymap input video streams are 16bit depth, single channel. +

+
+
format
+

Specify pixel format of output from this filter. Can be color or gray. +Default is color. +

+
+
fill
+

Specify the color of the unmapped pixels. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Default color is black. +

+
+ +
+
+

32.205 removegrain

+ +

The removegrain filter is a spatial denoiser for progressive video. +

+
+
m0
+

Set mode for the first plane. +

+
+
m1
+

Set mode for the second plane. +

+
+
m2
+

Set mode for the third plane. +

+
+
m3
+

Set mode for the fourth plane. +

+
+ +

Range of mode is from 0 to 24. Description of each mode follows: +

+
+
0
+

Leave input plane unchanged. Default. +

+
+
1
+

Clips the pixel with the minimum and maximum of the 8 neighbour pixels. +

+
+
2
+

Clips the pixel with the second minimum and maximum of the 8 neighbour pixels. +

+
+
3
+

Clips the pixel with the third minimum and maximum of the 8 neighbour pixels. +

+
+
4
+

Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels. +This is equivalent to a median filter. +

+
+
5
+

Line-sensitive clipping giving the minimal change. +

+
+
6
+

Line-sensitive clipping, intermediate. +

+
+
7
+

Line-sensitive clipping, intermediate. +

+
+
8
+

Line-sensitive clipping, intermediate. +

+
+
9
+

Line-sensitive clipping on a line where the neighbours pixels are the closest. +

+
+
10
+

Replaces the target pixel with the closest neighbour. +

+
+
11
+

[1 2 1] horizontal and vertical kernel blur. +

+
+
12
+

Same as mode 11. +

+
+
13
+

Bob mode, interpolates top field from the line where the neighbours +pixels are the closest. +

+
+
14
+

Bob mode, interpolates bottom field from the line where the neighbours +pixels are the closest. +

+
+
15
+

Bob mode, interpolates top field. Same as 13 but with a more complicated +interpolation formula. +

+
+
16
+

Bob mode, interpolates bottom field. Same as 14 but with a more complicated +interpolation formula. +

+
+
17
+

Clips the pixel with the minimum and maximum of respectively the maximum and +minimum of each pair of opposite neighbour pixels. +

+
+
18
+

Line-sensitive clipping using opposite neighbours whose greatest distance from +the current pixel is minimal. +

+
+
19
+

Replaces the pixel with the average of its 8 neighbours. +

+
+
20
+

Averages the 9 pixels ([1 1 1] horizontal and vertical blur). +

+
+
21
+

Clips pixels using the averages of opposite neighbour. +

+
+
22
+

Same as mode 21 but simpler and faster. +

+
+
23
+

Small edge and halo removal, but reputed useless. +

+
+
24
+

Similar as 23. +

+
+ +
+ +
+

32.207 repeatfields

+ +

This filter uses the repeat_field flag from the Video ES headers and hard repeats +fields based on its value. +

+
+
+

32.208 reverse

+ +

Reverse a video clip. +

+

Warning: This filter requires memory to buffer the entire clip, so trimming +is suggested. +

+ +
+

32.208.1 Examples

+ +
    +
  • Take the first 5 seconds of a clip, and reverse it. +
    +
    trim=end=5,reverse
    +
    +
+ +
+
+
+

32.209 rgbashift

+

Shift R/G/B/A pixels horizontally and/or vertically. +

+

The filter accepts the following options: +

+
rh
+

Set amount to shift red horizontally. +

+
rv
+

Set amount to shift red vertically. +

+
gh
+

Set amount to shift green horizontally. +

+
gv
+

Set amount to shift green vertically. +

+
bh
+

Set amount to shift blue horizontally. +

+
bv
+

Set amount to shift blue vertically. +

+
ah
+

Set amount to shift alpha horizontally. +

+
av
+

Set amount to shift alpha vertically. +

+
edge
+

Set edge mode, can be smear, default, or warp. +

+
+ + +
+

32.209.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.210 roberts

+

Apply roberts cross operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

32.210.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.211 rotate

+ +

Rotate video by an arbitrary angle expressed in radians. +

+

The filter accepts the following options: +

+

A description of the optional parameters follows. +

+
angle, a
+

Set an expression for the angle by which to rotate the input video +clockwise, expressed as a number of radians. A negative value will +result in a counter-clockwise rotation. By default it is set to "0". +

+

This expression is evaluated for each frame. +

+
+
out_w, ow
+

Set the output width expression, default value is "iw". +This expression is evaluated just once during configuration. +

+
+
out_h, oh
+

Set the output height expression, default value is "ih". +This expression is evaluated just once during configuration. +

+
+
bilinear
+

Enable bilinear interpolation if set to 1, a value of 0 disables +it. Default value is 1. +

+
+
fillcolor, c
+

Set the color used to fill the output area not covered by the rotated +image. For the general syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +If the special value "none" is selected then no +background is printed (useful for example if the background is never shown). +

+

Default value is "black". +

+
+ +

The expressions for the angle and the output size can contain the +following constants and functions: +

+
+
n
+

sequential number of the input frame, starting from 0. It is always NAN +before the first frame is filtered. +

+
+
t
+

time in seconds of the input frame, it is set to 0 when the filter is +configured. It is always NAN before the first frame is filtered. +

+
+
hsub
+
vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
in_w, iw
+
in_h, ih
+

the input video width and height +

+
+
out_w, ow
+
out_h, oh
+

the output width and height, that is the size of the padded area as +specified by the width and height expressions +

+
+
rotw(a)
+
roth(a)
+

the minimal width/height required for completely containing the input +video rotated by a radians. +

+

These are only available when computing the out_w and +out_h expressions. +

+
+ + +
+

32.211.1 Examples

+ +
    +
  • Rotate the input by PI/6 radians clockwise: +
    +
    rotate=PI/6
    +
    + +
  • Rotate the input by PI/6 radians counter-clockwise: +
    +
    rotate=-PI/6
    +
    + +
  • Rotate the input by 45 degrees clockwise: +
    +
    rotate=45*PI/180
    +
    + +
  • Apply a constant rotation with period T, starting from an angle of PI/3: +
    +
    rotate=PI/3+2*PI*t/T
    +
    + +
  • Make the input video rotation oscillating with a period of T +seconds and an amplitude of A radians: +
    +
    rotate=A*sin(2*PI/T*t)
    +
    + +
  • Rotate the video, output size is chosen so that the whole rotating +input video is always completely contained in the output: +
    +
    rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
    +
    + +
  • Rotate the video, reduce the output size so that no background is ever +shown: +
    +
    rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
    +
    +
+ +
+
+

32.211.2 Commands

+ +

The filter supports the following commands: +

+
+
a, angle
+

Set the angle expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

32.212 sab

+ +

Apply Shape Adaptive Blur. +

+

The filter accepts the following options: +

+
+
luma_radius, lr
+

Set luma blur filter strength, must be a value in range 0.1-4.0, default +value is 1.0. A greater value will result in a more blurred image, and +in slower processing. +

+
+
luma_pre_filter_radius, lpfr
+

Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default +value is 1.0. +

+
+
luma_strength, ls
+

Set luma maximum difference between pixels to still be considered, must +be a value in the 0.1-100.0 range, default value is 1.0. +

+
+
chroma_radius, cr
+

Set chroma blur filter strength, must be a value in range -0.9-4.0. A +greater value will result in a more blurred image, and in slower +processing. +

+
+
chroma_pre_filter_radius, cpfr
+

Set chroma pre-filter radius, must be a value in the -0.9-2.0 range. +

+
+
chroma_strength, cs
+

Set chroma maximum difference between pixels to still be considered, +must be a value in the -0.9-100.0 range. +

+
+ +

Each chroma option value, if not explicitly specified, is set to the +corresponding luma option value. +

+
+
+

32.213 scale

+ +

Scale (resize) the input video, using the libswscale library. +

+

The scale filter forces the output display aspect ratio to be the same +of the input, by changing the output sample aspect ratio. +

+

If the input image format is different from the format requested by +the next filter, the scale filter will convert the input to the +requested format. +

+ +
+

32.213.1 Options

+

The filter accepts the following options, or any of the options +supported by the libswscale scaler. +

+

See (ffmpeg-scaler)the ffmpeg-scaler manual for +the complete list of scaler options. +

+
+
width, w
+
height, h
+

Set the output video dimension expression. Default value is the input +dimension. +

+

If the width or w value is 0, the input width is used for +the output. If the height or h value is 0, the input height +is used for the output. +

+

If one and only one of the values is -n with n >= 1, the scale filter +will use a value that maintains the aspect ratio of the input image, +calculated from the other specified dimension. After that it will, +however, make sure that the calculated dimension is divisible by n and +adjust the value if necessary. +

+

If both values are -n with n >= 1, the behavior will be identical to +both values being set to 0 as previously detailed. +

+

See below for the list of accepted constants for use in the dimension +expression. +

+
+
eval
+

Specify when to evaluate width and height expression. It accepts the following values: +

+
+
init
+

Only evaluate expressions once during the filter initialization or when a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+
+ +

Default value is ‘init’. +

+ +
+
interl
+

Set the interlacing mode. It accepts the following values: +

+
+
1
+

Force interlaced aware scaling. +

+
+
0
+

Do not apply interlaced scaling. +

+
+
-1
+

Select interlaced aware scaling depending on whether the source frames +are flagged as interlaced or not. +

+
+ +

Default value is ‘0’. +

+
+
flags
+

Set libswscale scaling flags. See +(ffmpeg-scaler)the ffmpeg-scaler manual for the +complete list of values. If not explicitly specified the filter applies +the default flags. +

+ +
+
param0, param1
+

Set libswscale input parameters for scaling algorithms that need them. See +(ffmpeg-scaler)the ffmpeg-scaler manual for the +complete documentation. If not explicitly specified the filter applies +empty parameters. +

+ + +
+
size, s
+

Set the video size. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
in_color_matrix
+
out_color_matrix
+

Set in/output YCbCr color space type. +

+

This allows the autodetected value to be overridden as well as allows forcing +a specific value used for the output and encoder. +

+

If not specified, the color space type depends on the pixel format. +

+

Possible values: +

+
+
auto
+

Choose automatically. +

+
+
bt709
+

Format conforming to International Telecommunication Union (ITU) +Recommendation BT.709. +

+
+
fcc
+

Set color space conforming to the United States Federal Communications +Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a). +

+
+
bt601
+
bt470
+
smpte170m
+

Set color space conforming to: +

+
    +
  • ITU Radiocommunication Sector (ITU-R) Recommendation BT.601 + +
  • ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G + +
  • Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004 + +
+ +
+
smpte240m
+

Set color space conforming to SMPTE ST 240:1999. +

+
+
bt2020
+

Set color space conforming to ITU-R BT.2020 non-constant luminance system. +

+
+ +
+
in_range
+
out_range
+

Set in/output YCbCr sample range. +

+

This allows the autodetected value to be overridden as well as allows forcing +a specific value used for the output and encoder. If not specified, the +range depends on the pixel format. Possible values: +

+
+
auto/unknown
+

Choose automatically. +

+
+
jpeg/full/pc
+

Set full range (0-255 in case of 8-bit luma). +

+
+
mpeg/limited/tv
+

Set "MPEG" range (16-235 in case of 8-bit luma). +

+
+ +
+
force_original_aspect_ratio
+

Enable decreasing or increasing output video width or height if necessary to +keep the original aspect ratio. Possible values: +

+
+
disable
+

Scale the video as specified and disable this feature. +

+
+
decrease
+

The output video dimensions will automatically be decreased if needed. +

+
+
increase
+

The output video dimensions will automatically be increased if needed. +

+
+
+ +

One useful instance of this option is that when you know a specific device’s +maximum allowed resolution, you can use this to limit the output video to +that, while retaining the aspect ratio. For example, device A allows +1280x720 playback, and your video is 1920x800. Using this option (set it to +decrease) and specifying 1280x720 to the command line makes the output +1280x533. +

+

Please note that this is a different thing than specifying -1 for w +or h, you still need to specify the output resolution for this option +to work. +

+
+
force_divisible_by
+

Ensures that both the output dimensions, width and height, are divisible by the +given integer when used together with force_original_aspect_ratio. This +works similar to using -n in the w and h options. +

+

This option respects the value set for force_original_aspect_ratio, +increasing or decreasing the resolution accordingly. The video’s aspect ratio +may be slightly modified. +

+

This option can be handy if you need to have a video fit within or exceed +a defined resolution using force_original_aspect_ratio but also have +encoder restrictions on width or height divisibility. +

+
+
+ +

The values of the w and h options are expressions +containing the following constants: +

+
+
in_w
+
in_h
+

The input width and height +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (scaled) width and height +

+
+
ow
+
oh
+

These are the same as out_w and out_h +

+
+
a
+

The same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

The input display aspect ratio. Calculated from (iw / ih) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical input chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
ohsub
+
ovsub
+

horizontal and vertical output chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +Only available with eval=frame. +

+
+
t
+

The presentation timestamp of the input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
pos
+

The position (byte offset) of the frame in the input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +Deprecated, do not use. +

+
+ +
+
+

32.213.2 Examples

+ +
    +
  • Scale the input video to a size of 200x100 +
    +
    scale=w=200:h=100
    +
    + +

    This is equivalent to: +

    +
    scale=200:100
    +
    + +

    or: +

    +
    scale=200x100
    +
    + +
  • Specify a size abbreviation for the output size: +
    +
    scale=qcif
    +
    + +

    which can also be written as: +

    +
    scale=size=qcif
    +
    + +
  • Scale the input to 2x: +
    +
    scale=w=2*iw:h=2*ih
    +
    + +
  • The above is the same as: +
    +
    scale=2*in_w:2*in_h
    +
    + +
  • Scale the input to 2x with forced interlaced scaling: +
    +
    scale=2*iw:2*ih:interl=1
    +
    + +
  • Scale the input to half size: +
    +
    scale=w=iw/2:h=ih/2
    +
    + +
  • Increase the width, and set the height to the same size: +
    +
    scale=3/2*iw:ow
    +
    + +
  • Seek Greek harmony: +
    +
    scale=iw:1/PHI*iw
    +scale=ih*PHI:ih
    +
    + +
  • Increase the height, and set the width to 3/2 of the height: +
    +
    scale=w=3/2*oh:h=3/5*ih
    +
    + +
  • Increase the size, making the size a multiple of the chroma +subsample values: +
    +
    scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
    +
    + +
  • Increase the width to a maximum of 500 pixels, +keeping the same aspect ratio as the input: +
    +
    scale=w='min(500\, iw*3/2):h=-1'
    +
    + +
  • Make pixels square by combining scale and setsar: +
    +
    scale='trunc(ih*dar):ih',setsar=1/1
    +
    + +
  • Make pixels square by combining scale and setsar, +making sure the resulting resolution is even (required by some codecs): +
    +
    scale='trunc(ih*dar/2)*2:trunc(ih/2)*2',setsar=1/1
    +
    +
+ +
+
+

32.213.3 Commands

+ +

This filter supports the following commands: +

+
width, w
+
height, h
+

Set the output video dimension expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

32.214 scale_cuda

+ +

Scale (resize) and convert (pixel format) the input video, using accelerated CUDA kernels. +Setting the output width and height works in the same way as for the scale filter. +

+

The filter accepts the following options: +

+
w
+
h
+

Set the output video dimension expression. Default value is the input dimension. +

+

Allows for the same expressions as the scale filter. +

+
+
interp_algo
+

Sets the algorithm used for scaling: +

+
+
nearest
+

Nearest neighbour +

+

Used by default if input parameters match the desired output. +

+
+
bilinear
+

Bilinear +

+
+
bicubic
+

Bicubic +

+

This is the default. +

+
+
lanczos
+

Lanczos +

+
+
+ +
+
format
+

Controls the output pixel format. By default, or if none is specified, the input +pixel format is used. +

+

The filter does not support converting between YUV and RGB pixel formats. +

+
+
passthrough
+

If set to 0, every frame is processed, even if no conversion is neccesary. +This mode can be useful to use the filter as a buffer for a downstream +frame-consumer that exhausts the limited decoder frame pool. +

+

If set to 1, frames are passed through as-is if they match the desired output +parameters. This is the default behaviour. +

+
+
param
+

Algorithm-Specific parameter. +

+

Affects the curves of the bicubic algorithm. +

+
+
force_original_aspect_ratio
+
force_divisible_by
+

Work the same as the identical scale filter options. +

+
+
+ + +
+

32.214.1 Examples

+ +
    +
  • Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p. +
    +
    scale_cuda=-2:720:format=yuv420p
    +
    + +
  • Upscale to 4K using nearest neighbour algorithm. +
    +
    scale_cuda=4096:2160:interp_algo=nearest
    +
    + +
  • Don’t do any conversion or scaling, but copy all input frames into newly allocated ones. +This can be useful to deal with a filter and encode chain that otherwise exhausts the +decoders frame pool. +
    +
    scale_cuda=passthrough=0
    +
    +
+ +
+
+
+

32.215 scale_npp

+ +

Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel +format conversion on CUDA video frames. Setting the output width and height +works in the same way as for the scale filter. +

+

The following additional options are accepted: +

+
format
+

The pixel format of the output CUDA frames. If set to the string "same" (the +default), the input format will be kept. Note that automatic format negotiation +and conversion is not yet supported for hardware frames +

+
+
interp_algo
+

The interpolation algorithm used for resizing. One of the following: +

+
nn
+

Nearest neighbour. +

+
+
linear
+
cubic
+
cubic2p_bspline
+

2-parameter cubic (B=1, C=0) +

+
+
cubic2p_catmullrom
+

2-parameter cubic (B=0, C=1/2) +

+
+
cubic2p_b05c03
+

2-parameter cubic (B=1/2, C=3/10) +

+
+
super
+

Supersampling +

+
+
lanczos
+
+ +
+
force_original_aspect_ratio
+

Enable decreasing or increasing output video width or height if necessary to +keep the original aspect ratio. Possible values: +

+
+
disable
+

Scale the video as specified and disable this feature. +

+
+
decrease
+

The output video dimensions will automatically be decreased if needed. +

+
+
increase
+

The output video dimensions will automatically be increased if needed. +

+
+
+ +

One useful instance of this option is that when you know a specific device’s +maximum allowed resolution, you can use this to limit the output video to +that, while retaining the aspect ratio. For example, device A allows +1280x720 playback, and your video is 1920x800. Using this option (set it to +decrease) and specifying 1280x720 to the command line makes the output +1280x533. +

+

Please note that this is a different thing than specifying -1 for w +or h, you still need to specify the output resolution for this option +to work. +

+
+
force_divisible_by
+

Ensures that both the output dimensions, width and height, are divisible by the +given integer when used together with force_original_aspect_ratio. This +works similar to using -n in the w and h options. +

+

This option respects the value set for force_original_aspect_ratio, +increasing or decreasing the resolution accordingly. The video’s aspect ratio +may be slightly modified. +

+

This option can be handy if you need to have a video fit within or exceed +a defined resolution using force_original_aspect_ratio but also have +encoder restrictions on width or height divisibility. +

+
+
eval
+

Specify when to evaluate width and height expression. It accepts the following values: +

+
+
init
+

Only evaluate expressions once during the filter initialization or when a command is processed. +

+
+
frame
+

Evaluate expressions for each incoming frame. +

+
+
+ +
+
+ +

The values of the w and h options are expressions +containing the following constants: +

+
+
in_w
+
in_h
+

The input width and height +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (scaled) width and height +

+
+
ow
+
oh
+

These are the same as out_w and out_h +

+
+
a
+

The same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

The input display aspect ratio. Calculated from (iw / ih) * sar. +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +Only available with eval=frame. +

+
+
t
+

The presentation timestamp of the input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
pos
+

The position (byte offset) of the frame in the input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +Deprecated, do not use. +

+
+ +
+
+

32.216 scale2ref

+ +

Scale (resize) the input video, based on a reference video. +

+

See the scale filter for available options, scale2ref supports the same but +uses the reference video instead of the main input as basis. scale2ref also +supports the following additional constants for the w and +h options: +

+
+
main_w
+
main_h
+

The main input video’s width and height +

+
+
main_a
+

The same as main_w / main_h +

+
+
main_sar
+

The main input video’s sample aspect ratio +

+
+
main_dar, mdar
+

The main input video’s display aspect ratio. Calculated from +(main_w / main_h) * main_sar. +

+
+
main_hsub
+
main_vsub
+

The main input video’s horizontal and vertical chroma subsample values. +For example for the pixel format "yuv422p" hsub is 2 and vsub +is 1. +

+
+
main_n
+

The (sequential) number of the main input frame, starting from 0. +Only available with eval=frame. +

+
+
main_t
+

The presentation timestamp of the main input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
main_pos
+

The position (byte offset) of the frame in the main input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +

+
+ + +
+

32.216.1 Examples

+ +
    +
  • Scale a subtitle stream (b) to match the main video (a) in size before overlaying +
    +
    'scale2ref[b][a];[a][b]overlay'
    +
    + +
  • Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio. +
    +
    [logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]
    +
    +
+ +
+
+

32.216.2 Commands

+ +

This filter supports the following commands: +

+
width, w
+
height, h
+

Set the output video dimension expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ +
+
+
+

32.217 scale2ref_npp

+ +

Use the NVIDIA Performance Primitives (libnpp) to scale (resize) the input +video, based on a reference video. +

+

See the scale_npp filter for available options, scale2ref_npp supports the same +but uses the reference video instead of the main input as basis. scale2ref_npp +also supports the following additional constants for the w and +h options: +

+
+
main_w
+
main_h
+

The main input video’s width and height +

+
+
main_a
+

The same as main_w / main_h +

+
+
main_sar
+

The main input video’s sample aspect ratio +

+
+
main_dar, mdar
+

The main input video’s display aspect ratio. Calculated from +(main_w / main_h) * main_sar. +

+
+
main_n
+

The (sequential) number of the main input frame, starting from 0. +Only available with eval=frame. +

+
+
main_t
+

The presentation timestamp of the main input frame, expressed as a number of +seconds. Only available with eval=frame. +

+
+
main_pos
+

The position (byte offset) of the frame in the main input stream, or NaN if +this information is unavailable and/or meaningless (for example in case of synthetic video). +Only available with eval=frame. +

+
+ + +
+

32.217.1 Examples

+ +
    +
  • Scale a subtitle stream (b) to match the main video (a) in size before overlaying +
    +
    'scale2ref_npp[b][a];[a][b]overlay_cuda'
    +
    + +
  • Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio. +
    +
    [logo-in][video-in]scale2ref_npp=w=oh*mdar:h=ih/10[logo-out][video-out]
    +
    +
+ +
+
+
+

32.218 scharr

+

Apply scharr operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

32.218.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.219 scroll

+

Scroll input video horizontally and/or vertically by constant speed. +

+

The filter accepts the following options: +

+
horizontal, h
+

Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1. +Negative values changes scrolling direction. +

+
+
vertical, v
+

Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1. +Negative values changes scrolling direction. +

+
+
hpos
+

Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1. +

+
+
vpos
+

Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1. +

+
+ + +
+

32.219.1 Commands

+ +

This filter supports the following commands: +

+
horizontal, h
+

Set the horizontal scrolling speed. +

+
vertical, v
+

Set the vertical scrolling speed. +

+
+ +
+
+
+

32.220 scdet

+ +

Detect video scene change. +

+

This filter sets frame metadata with mafd between frame, the scene score, and +forward the frame to the next filter, so they can use these metadata to detect +scene change or others. +

+

In addition, this filter logs a message and sets frame metadata when it detects +a scene change by threshold. +

+

lavfi.scd.mafd metadata keys are set with mafd for every frame. +

+

lavfi.scd.score metadata keys are set with scene change score for every frame +to detect scene change. +

+

lavfi.scd.time metadata keys are set with current filtered frame time which +detect scene change with threshold. +

+

The filter accepts the following options: +

+
+
threshold, t
+

Set the scene change detection threshold as a percentage of maximum change. Good +values are in the [8.0, 14.0] range. The range for threshold is +[0., 100.]. +

+

Default value is 10.. +

+
+
sc_pass, s
+

Set the flag to pass scene change frames to the next filter. Default value is 0 +You can enable it if you want to get snapshot of scene change frames only. +

+
+ +
+
+

32.221 selectivecolor

+ +

Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such +as "reds", "yellows", "greens", "cyans", ...). The adjustment range is defined +by the "purity" of the color (that is, how saturated it already is). +

+

This filter is similar to the Adobe Photoshop Selective Color tool. +

+

The filter accepts the following options: +

+
+
correction_method
+

Select color correction method. +

+

Available values are: +

+
absolute
+

Specified adjustments are applied "as-is" (added/subtracted to original pixel +component value). +

+
relative
+

Specified adjustments are relative to the original component value. +

+
+

Default is absolute. +

+
reds
+

Adjustments for red pixels (pixels where the red component is the maximum) +

+
yellows
+

Adjustments for yellow pixels (pixels where the blue component is the minimum) +

+
greens
+

Adjustments for green pixels (pixels where the green component is the maximum) +

+
cyans
+

Adjustments for cyan pixels (pixels where the red component is the minimum) +

+
blues
+

Adjustments for blue pixels (pixels where the blue component is the maximum) +

+
magentas
+

Adjustments for magenta pixels (pixels where the green component is the minimum) +

+
whites
+

Adjustments for white pixels (pixels where all components are greater than 128) +

+
neutrals
+

Adjustments for all pixels except pure black and pure white +

+
blacks
+

Adjustments for black pixels (pixels where all components are lesser than 128) +

+
psfile
+

Specify a Photoshop selective color file (.asv) to import the settings from. +

+
+ +

All the adjustment settings (reds, yellows, ...) accept up to +4 space separated floating point adjustment values in the [-1,1] range, +respectively to adjust the amount of cyan, magenta, yellow and black for the +pixels of its range. +

+ +
+

32.221.1 Examples

+ +
    +
  • Increase cyan by 50% and reduce yellow by 33% in every green areas, and +increase magenta by 27% in blue areas: +
    +
    selectivecolor=greens=.5 0 -.33 0:blues=0 .27
    +
    + +
  • Use a Photoshop selective color preset: +
    +
    selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
    +
    +
+ +
+
+
+

32.222 separatefields

+ +

The separatefields takes a frame-based video input and splits +each frame into its components fields, producing a new half height clip +with twice the frame rate and twice the frame count. +

+

This filter use field-dominance information in frame to decide which +of each pair of fields to place first in the output. +If it gets it wrong use setfield filter before separatefields filter. +

+
+
+

32.223 setdar, setsar

+ +

The setdar filter sets the Display Aspect Ratio for the filter +output video. +

+

This is done by changing the specified Sample (aka Pixel) Aspect +Ratio, according to the following equation: +

+
DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR
+
+ +

Keep in mind that the setdar filter does not modify the pixel +dimensions of the video frame. Also, the display aspect ratio set by +this filter may be changed by later filters in the filterchain, +e.g. in case of scaling or if another "setdar" or a "setsar" filter is +applied. +

+

The setsar filter sets the Sample (aka Pixel) Aspect Ratio for +the filter output video. +

+

Note that as a consequence of the application of this filter, the +output display aspect ratio will change according to the equation +above. +

+

Keep in mind that the sample aspect ratio set by the setsar +filter may be changed by later filters in the filterchain, e.g. if +another "setsar" or a "setdar" filter is applied. +

+

It accepts the following parameters: +

+
+
r, ratio, dar (setdar only), sar (setsar only)
+

Set the aspect ratio used by the filter. +

+

The parameter can be a floating point number string, or an expression. If the +parameter is not specified, the value "0" is assumed, meaning that the same +input value is used. +

+
+
max
+

Set the maximum integer value to use for expressing numerator and +denominator when reducing the expressed aspect ratio to a rational. +Default value is 100. +

+
+
+ +

The parameter sar is an expression containing the following constants: +

+
+
w, h
+

The input width and height. +

+
+
a
+

Same as w / h. +

+
+
sar
+

The input sample aspect ratio. +

+
+
dar
+

The input display aspect ratio. It is the same as +(w / h) * sar. +

+
+
hsub, vsub
+

Horizontal and vertical chroma subsample values. For example, for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ + +
+

32.223.1 Examples

+ +
    +
  • To change the display aspect ratio to 16:9, specify one of the following: +
    +
    setdar=dar=1.77777
    +setdar=dar=16/9
    +
    + +
  • To change the sample aspect ratio to 10:11, specify: +
    +
    setsar=sar=10/11
    +
    + +
  • To set a display aspect ratio of 16:9, and specify a maximum integer value of +1000 in the aspect ratio reduction, use the command: +
    +
    setdar=ratio=16/9:max=1000
    +
    + +
+ +
+
+
+

32.224 setfield

+ +

Force field for the output video frame. +

+

The setfield filter marks the interlace type field for the +output frames. It does not change the input frame, but only sets the +corresponding property, which affects how the frame is treated by +following filters (e.g. fieldorder or yadif). +

+

The filter accepts the following options: +

+
+
mode
+

Available values are: +

+
+
auto
+

Keep the same field property. +

+
+
bff
+

Mark the frame as bottom-field-first. +

+
+
tff
+

Mark the frame as top-field-first. +

+
+
prog
+

Mark the frame as progressive. +

+
+
+
+ +
+
+

32.225 setparams

+ +

Force frame parameter for the output video frame. +

+

The setparams filter marks interlace and color range for the +output frames. It does not change the input frame, but only sets the +corresponding property, which affects how the frame is treated by +filters/encoders. +

+
+
field_mode
+

Available values are: +

+
+
auto
+

Keep the same field property (default). +

+
+
bff
+

Mark the frame as bottom-field-first. +

+
+
tff
+

Mark the frame as top-field-first. +

+
+
prog
+

Mark the frame as progressive. +

+
+ +
+
range
+

Available values are: +

+
+
auto
+

Keep the same color range property (default). +

+
+
unspecified, unknown
+

Mark the frame as unspecified color range. +

+
+
limited, tv, mpeg
+

Mark the frame as limited range. +

+
+
full, pc, jpeg
+

Mark the frame as full range. +

+
+ +
+
color_primaries
+

Set the color primaries. +Available values are: +

+
+
auto
+

Keep the same color primaries property (default). +

+
+
bt709
+
unknown
+
bt470m
+
bt470bg
+
smpte170m
+
smpte240m
+
film
+
bt2020
+
smpte428
+
smpte431
+
smpte432
+
jedec-p22
+
+ +
+
color_trc
+

Set the color transfer. +Available values are: +

+
+
auto
+

Keep the same color trc property (default). +

+
+
bt709
+
unknown
+
bt470m
+
bt470bg
+
smpte170m
+
smpte240m
+
linear
+
log100
+
log316
+
iec61966-2-4
+
bt1361e
+
iec61966-2-1
+
bt2020-10
+
bt2020-12
+
smpte2084
+
smpte428
+
arib-std-b67
+
+ +
+
colorspace
+

Set the colorspace. +Available values are: +

+
+
auto
+

Keep the same colorspace property (default). +

+
+
gbr
+
bt709
+
unknown
+
fcc
+
bt470bg
+
smpte170m
+
smpte240m
+
ycgco
+
bt2020nc
+
bt2020c
+
smpte2085
+
chroma-derived-nc
+
chroma-derived-c
+
ictcp
+
+
+
+ +
+
+

32.226 sharpen_npp

+

Use the NVIDIA Performance Primitives (libnpp) to perform image sharpening with +border control. +

+

The following additional options are accepted: +

+
border_type
+

Type of sampling to be used ad frame borders. One of the following: +

+
replicate
+

Replicate pixel values. +

+
+
+
+
+ +
+
+

32.227 shear

+

Apply shear transform to input video. +

+

This filter supports the following options: +

+
+
shx
+

Shear factor in X-direction. Default value is 0. +Allowed range is from -2 to 2. +

+
+
shy
+

Shear factor in Y-direction. Default value is 0. +Allowed range is from -2 to 2. +

+
+
fillcolor, c
+

Set the color used to fill the output area not covered by the transformed +video. For the general syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +If the special value "none" is selected then no +background is printed (useful for example if the background is never shown). +

+

Default value is "black". +

+
+
interp
+

Set interpolation type. Can be bilinear or nearest. Default is bilinear. +

+
+ + +
+

32.227.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.228 showinfo

+ +

Show a line containing various information for each input video frame. +The input video is not modified. +

+

This filter supports the following options: +

+
+
checksum
+

Calculate checksums of each plane. By default enabled. +

+
+ +

The shown line contains a sequence of key/value pairs of the form +key:value. +

+

The following values are shown in the output: +

+
+
n
+

The (sequential) number of the input frame, starting from 0. +

+
+
pts
+

The Presentation TimeStamp of the input frame, expressed as a number of +time base units. The time base unit depends on the filter input pad. +

+
+
pts_time
+

The Presentation TimeStamp of the input frame, expressed as a number of +seconds. +

+
+
fmt
+

The pixel format name. +

+
+
sar
+

The sample aspect ratio of the input frame, expressed in the form +num/den. +

+
+
s
+

The size of the input frame. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
i
+

The type of interlaced mode ("P" for "progressive", "T" for top field first, "B" +for bottom field first). +

+
+
iskey
+

This is 1 if the frame is a key frame, 0 otherwise. +

+
+
type
+

The picture type of the input frame ("I" for an I-frame, "P" for a +P-frame, "B" for a B-frame, or "?" for an unknown type). +Also refer to the documentation of the AVPictureType enum and of +the av_get_picture_type_char function defined in +libavutil/avutil.h. +

+
+
checksum
+

The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame. +

+
+
plane_checksum
+

The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame, +expressed in the form "[c0 c1 c2 c3]". +

+
+
mean
+

The mean value of pixels in each plane of the input frame, expressed in the form +"[mean0 mean1 mean2 mean3]". +

+
+
stdev
+

The standard deviation of pixel values in each plane of the input frame, expressed +in the form "[stdev0 stdev1 stdev2 stdev3]". +

+
+
+ +
+
+

32.229 showpalette

+ +

Displays the 256 colors palette of each frame. This filter is only relevant for +pal8 pixel format frames. +

+

It accepts the following option: +

+
+
s
+

Set the size of the box used to represent one palette color entry. Default is +30 (for a 30x30 pixel box). +

+
+ +
+
+

32.230 shuffleframes

+ +

Reorder and/or duplicate and/or drop video frames. +

+

It accepts the following parameters: +

+
+
mapping
+

Set the destination indexes of input frames. +This is space or ’|’ separated list of indexes that maps input frames to output +frames. Number of indexes also sets maximal value that each index may have. +’-1’ index have special meaning and that is to drop frame. +

+
+ +

The first frame has the index 0. The default is to keep the input unchanged. +

+ +
+

32.230.1 Examples

+ +
    +
  • Swap second and third frame of every three frames of the input: +
    +
    ffmpeg -i INPUT -vf "shuffleframes=0 2 1" OUTPUT
    +
    + +
  • Swap 10th and 1st frame of every ten frames of the input: +
    +
    ffmpeg -i INPUT -vf "shuffleframes=9 1 2 3 4 5 6 7 8 0" OUTPUT
    +
    +
+ +
+
+
+

32.231 shufflepixels

+ +

Reorder pixels in video frames. +

+

This filter accepts the following options: +

+
+
direction, d
+

Set shuffle direction. Can be forward or inverse direction. +Default direction is forward. +

+
+
mode, m
+

Set shuffle mode. Can be horizontal, vertical or block mode. +

+
+
width, w
+
height, h
+

Set shuffle block_size. In case of horizontal shuffle mode only width +part of size is used, and in case of vertical shuffle mode only height +part of size is used. +

+
+
seed, s
+

Set random seed used with shuffling pixels. Mainly useful to set to be able +to reverse filtering process to get original input. +For example, to reverse forward shuffle you need to use same parameters +and exact same seed and to set direction to inverse. +

+
+ +
+
+

32.232 shuffleplanes

+ +

Reorder and/or duplicate video planes. +

+

It accepts the following parameters: +

+
+
map0
+

The index of the input plane to be used as the first output plane. +

+
+
map1
+

The index of the input plane to be used as the second output plane. +

+
+
map2
+

The index of the input plane to be used as the third output plane. +

+
+
map3
+

The index of the input plane to be used as the fourth output plane. +

+
+
+ +

The first plane has the index 0. The default is to keep the input unchanged. +

+ +
+

32.232.1 Examples

+ +
    +
  • Swap the second and third planes of the input: +
    +
    ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
    +
    +
+ +
+
+
+

32.233 signalstats

+

Evaluate various visual metrics that assist in determining issues associated +with the digitization of analog video media. +

+

By default the filter will log these metadata values: +

+
+
YMIN
+

Display the minimal Y value contained within the input frame. Expressed in +range of [0-255]. +

+
+
YLOW
+

Display the Y value at the 10% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
YAVG
+

Display the average Y value within the input frame. Expressed in range of +[0-255]. +

+
+
YHIGH
+

Display the Y value at the 90% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
YMAX
+

Display the maximum Y value contained within the input frame. Expressed in +range of [0-255]. +

+
+
UMIN
+

Display the minimal U value contained within the input frame. Expressed in +range of [0-255]. +

+
+
ULOW
+

Display the U value at the 10% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
UAVG
+

Display the average U value within the input frame. Expressed in range of +[0-255]. +

+
+
UHIGH
+

Display the U value at the 90% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
UMAX
+

Display the maximum U value contained within the input frame. Expressed in +range of [0-255]. +

+
+
VMIN
+

Display the minimal V value contained within the input frame. Expressed in +range of [0-255]. +

+
+
VLOW
+

Display the V value at the 10% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
VAVG
+

Display the average V value within the input frame. Expressed in range of +[0-255]. +

+
+
VHIGH
+

Display the V value at the 90% percentile within the input frame. Expressed in +range of [0-255]. +

+
+
VMAX
+

Display the maximum V value contained within the input frame. Expressed in +range of [0-255]. +

+
+
SATMIN
+

Display the minimal saturation value contained within the input frame. +Expressed in range of [0-~181.02]. +

+
+
SATLOW
+

Display the saturation value at the 10% percentile within the input frame. +Expressed in range of [0-~181.02]. +

+
+
SATAVG
+

Display the average saturation value within the input frame. Expressed in range +of [0-~181.02]. +

+
+
SATHIGH
+

Display the saturation value at the 90% percentile within the input frame. +Expressed in range of [0-~181.02]. +

+
+
SATMAX
+

Display the maximum saturation value contained within the input frame. +Expressed in range of [0-~181.02]. +

+
+
HUEMED
+

Display the median value for hue within the input frame. Expressed in range of +[0-360]. +

+
+
HUEAVG
+

Display the average value for hue within the input frame. Expressed in range of +[0-360]. +

+
+
YDIF
+

Display the average of sample value difference between all values of the Y +plane in the current frame and corresponding values of the previous input frame. +Expressed in range of [0-255]. +

+
+
UDIF
+

Display the average of sample value difference between all values of the U +plane in the current frame and corresponding values of the previous input frame. +Expressed in range of [0-255]. +

+
+
VDIF
+

Display the average of sample value difference between all values of the V +plane in the current frame and corresponding values of the previous input frame. +Expressed in range of [0-255]. +

+
+
YBITDEPTH
+

Display bit depth of Y plane in current frame. +Expressed in range of [0-16]. +

+
+
UBITDEPTH
+

Display bit depth of U plane in current frame. +Expressed in range of [0-16]. +

+
+
VBITDEPTH
+

Display bit depth of V plane in current frame. +Expressed in range of [0-16]. +

+
+ +

The filter accepts the following options: +

+
+
stat
+
out
+
+

stat specify an additional form of image analysis. +out output video with the specified type of pixel highlighted. +

+

Both options accept the following values: +

+
+
tout
+

Identify temporal outliers pixels. A temporal outlier is a pixel +unlike the neighboring pixels of the same field. Examples of temporal outliers +include the results of video dropouts, head clogs, or tape tracking issues. +

+
+
vrep
+

Identify vertical line repetition. Vertical line repetition includes +similar rows of pixels within a frame. In born-digital video vertical line +repetition is common, but this pattern is uncommon in video digitized from an +analog source. When it occurs in video that results from the digitization of an +analog source it can indicate concealment from a dropout compensator. +

+
+
brng
+

Identify pixels that fall outside of legal broadcast range. +

+
+ +
+
color, c
+

Set the highlight color for the out option. The default color is +yellow. +

+
+ + +
+

32.233.1 Examples

+ +
    +
  • Output data of various video metrics: +
    +
    ffprobe -f lavfi movie=example.mov,signalstats="stat=tout+vrep+brng" -show_frames
    +
    + +
  • Output specific data about the minimum and maximum values of the Y plane per frame: +
    +
    ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
    +
    + +
  • Playback video while highlighting pixels that are outside of broadcast range in red. +
    +
    ffplay example.mov -vf signalstats="out=brng:color=red"
    +
    + +
  • Playback video with signalstats metadata drawn over the frame. +
    +
    ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
    +
    + +

    The contents of signalstat_drawtext.txt used in the command are: +

    +
    time %{pts:hms}
    +Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
    +U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
    +V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
    +saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
    +
    +
    +
+ +
+
+
+

32.234 signature

+ +

Calculates the MPEG-7 Video Signature. The filter can handle more than one +input. In this case the matching between the inputs can be calculated additionally. +The filter always passes through the first input. The signature of each stream can +be written into a file. +

+

It accepts the following options: +

+
+
detectmode
+

Enable or disable the matching process. +

+

Available values are: +

+
+
off
+

Disable the calculation of a matching (default). +

+
full
+

Calculate the matching for the whole video and output whether the whole video +matches or only parts. +

+
fast
+

Calculate only until a matching is found or the video ends. Should be faster in +some cases. +

+
+ +
+
nb_inputs
+

Set the number of inputs. The option value must be a non negative integer. +Default value is 1. +

+
+
filename
+

Set the path to which the output is written. If there is more than one input, +the path must be a prototype, i.e. must contain %d or %0nd (where n is a positive +integer), that will be replaced with the input number. If no filename is +specified, no output will be written. This is the default. +

+
+
format
+

Choose the output format. +

+

Available values are: +

+
+
binary
+

Use the specified binary representation (default). +

+
xml
+

Use the specified xml representation. +

+
+ +
+
th_d
+

Set threshold to detect one word as similar. The option value must be an integer +greater than zero. The default value is 9000. +

+
+
th_dc
+

Set threshold to detect all words as similar. The option value must be an integer +greater than zero. The default value is 60000. +

+
+
th_xh
+

Set threshold to detect frames as similar. The option value must be an integer +greater than zero. The default value is 116. +

+
+
th_di
+

Set the minimum length of a sequence in frames to recognize it as matching +sequence. The option value must be a non negative integer value. +The default value is 0. +

+
+
th_it
+

Set the minimum relation, that matching frames to all frames must have. +The option value must be a double value between 0 and 1. The default value is 0.5. +

+
+ + +
+

32.234.1 Examples

+ +
    +
  • To calculate the signature of an input video and store it in signature.bin: +
    +
    ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
    +
    + +
  • To detect whether two videos match and store the signatures in XML format in +signature0.xml and signature1.xml: +
    +
    ffmpeg -i input1.mkv -i input2.mkv -filter_complex "[0:v][1:v] signature=nb_inputs=2:detectmode=full:format=xml:filename=signature%d.xml" -map :v -f null -
    +
    + +
+ +
+
+
+

32.235 siti

+ +

Calculate Spatial Information (SI) and Temporal Information (TI) scores for a video, +as defined in ITU-T Rec. P.910 (11/21): Subjective video quality assessment methods +for multimedia applications. Available PDF at https://www.itu.int/rec/T-REC-P.910-202111-S/en. +Note that this is a legacy implementation that corresponds to a superseded recommendation. +Refer to ITU-T Rec. P.910 (07/22) for the latest version: https://www.itu.int/rec/T-REC-P.910-202207-I/en +

+

It accepts the following option: +

+
+
print_summary
+

If set to 1, Summary statistics will be printed to the console. Default 0. +

+
+ + +
+

32.235.1 Examples

+
    +
  • To calculate SI/TI metrics and print summary: +
    +
    ffmpeg -i input.mp4 -vf siti=print_summary=1 -f null -
    +
    +
+ +
+
+
+

32.236 smartblur

+ +

Blur the input video without impacting the outlines. +

+

It accepts the following options: +

+
+
luma_radius, lr
+

Set the luma radius. The option value must be a float number in +the range [0.1,5.0] that specifies the variance of the gaussian filter +used to blur the image (slower if larger). Default value is 1.0. +

+
+
luma_strength, ls
+

Set the luma strength. The option value must be a float number +in the range [-1.0,1.0] that configures the blurring. A value included +in [0.0,1.0] will blur the image whereas a value included in +[-1.0,0.0] will sharpen the image. Default value is 1.0. +

+
+
luma_threshold, lt
+

Set the luma threshold used as a coefficient to determine +whether a pixel should be blurred or not. The option value must be an +integer in the range [-30,30]. A value of 0 will filter all the image, +a value included in [0,30] will filter flat areas and a value included +in [-30,0] will filter edges. Default value is 0. +

+
+
chroma_radius, cr
+

Set the chroma radius. The option value must be a float number in +the range [0.1,5.0] that specifies the variance of the gaussian filter +used to blur the image (slower if larger). Default value is luma_radius. +

+
+
chroma_strength, cs
+

Set the chroma strength. The option value must be a float number +in the range [-1.0,1.0] that configures the blurring. A value included +in [0.0,1.0] will blur the image whereas a value included in +[-1.0,0.0] will sharpen the image. Default value is luma_strength. +

+
+
chroma_threshold, ct
+

Set the chroma threshold used as a coefficient to determine +whether a pixel should be blurred or not. The option value must be an +integer in the range [-30,30]. A value of 0 will filter all the image, +a value included in [0,30] will filter flat areas and a value included +in [-30,0] will filter edges. Default value is luma_threshold. +

+
+ +

If a chroma option is not explicitly set, the corresponding luma value +is set. +

+
+
+

32.237 sobel

+

Apply sobel operator to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +

+
+
delta
+

Set value which will be added to filtered result. +

+
+ + +
+

32.237.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.238 spp

+ +

Apply a simple postprocessing filter that compresses and decompresses the image +at several (or - in the case of quality level 6 - all) shifts +and average the results. +

+

The filter accepts the following options: +

+
+
quality
+

Set quality. This option defines the number of levels for averaging. It accepts +an integer in the range 0-6. If set to 0, the filter will have no +effect. A value of 6 means the higher quality. For each increment of +that value the speed drops by a factor of approximately 2. Default value is +3. +

+
+
qp
+

Force a constant quantization parameter. If not set, the filter will use the QP +from the video stream (if available). +

+
+
mode
+

Set thresholding mode. Available modes are: +

+
+
hard
+

Set hard thresholding (default). +

+
soft
+

Set soft thresholding (better de-ringing effect, but likely blurrier). +

+
+ +
+
use_bframe_qp
+

Enable the use of the QP from the B-Frames if set to 1. Using this +option may cause flicker since the B-Frames have often larger QP. Default is +0 (not enabled). +

+
+ + +
+

32.238.1 Commands

+ +

This filter supports the following commands: +

+
quality, level
+

Set quality level. The value max can be used to set the maximum level, +currently 6. +

+
+ +
+
+
+

32.239 sr

+ +

Scale the input by applying one of the super-resolution methods based on +convolutional neural networks. Supported models: +

+ + +

Training scripts as well as scripts for model file (.pb) saving can be found at +https://github.com/XueweiMeng/sr/tree/sr_dnn_native. Original repository +is at https://github.com/HighVoltageRocknRoll/sr.git. +

+

The filter accepts the following options: +

+
+
dnn_backend
+

Specify which DNN backend to use for model loading and execution. This option accepts +the following values: +

+
+
tensorflow
+

TensorFlow backend. To enable this backend you +need to install the TensorFlow for C library (see +https://www.tensorflow.org/install/lang_c) and configure FFmpeg with +--enable-libtensorflow +

+
+ +
+
model
+

Set path to model file specifying network architecture and its parameters. +Note that different backends use different file formats. TensorFlow, OpenVINO backend +can load files for only its format. +

+
+
scale_factor
+

Set scale factor for SRCNN model. Allowed values are 2, 3 and 4. +Default value is 2. Scale factor is necessary for SRCNN model, because it accepts +input upscaled using bicubic upscaling with proper scale factor. +

+
+ +

To get full functionality (such as async execution), please use the dnn_processing filter. +

+
+
+

32.240 ssim

+ +

Obtain the SSIM (Structural SImilarity Metric) between two input videos. +

+

This filter takes in input two input videos, the first input is +considered the "main" source and is passed unchanged to the +output. The second input is used as a "reference" video for computing +the SSIM. +

+

Both video inputs must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The filter stores the calculated SSIM of each frame. +

+

The description of the accepted parameters follows. +

+
+
stats_file, f
+

If specified the filter will use the named file to save the SSIM of +each individual frame. When filename equals "-" the data is sent to +standard output. +

+
+ +

The file printed if stats_file is selected, contains a sequence of +key/value pairs of the form key:value for each compared +couple of frames. +

+

A description of each shown parameter follows: +

+
+
n
+

sequential number of the input frame, starting from 1 +

+
+
Y, U, V, R, G, B
+

SSIM of the compared frames for the component specified by the suffix. +

+
+
All
+

SSIM of the compared frames for the whole frame. +

+
+
dB
+

Same as above but in dB representation. +

+
+ +

This filter also supports the framesync options. +

+ +
+

32.240.1 Examples

+
    +
  • For example: +
    +
    movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
    +[main][ref] ssim="stats_file=stats.log" [out]
    +
    + +

    On this example the input file being processed is compared with the +reference file ref_movie.mpg. The SSIM of each individual frame +is stored in stats.log. +

    +
  • Another example with both psnr and ssim at same time: +
    +
    ffmpeg -i main.mpg -i ref.mpg -lavfi  "ssim;[0:v][1:v]psnr" -f null -
    +
    + +
  • Another example with different containers: +
    +
    ffmpeg -i main.mpg -i ref.mkv -lavfi  "[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]ssim" -f null -
    +
    +
+ +
+
+
+

32.241 stereo3d

+ +

Convert between different stereoscopic image formats. +

+

The filters accept the following options: +

+
+
in
+

Set stereoscopic image format of input. +

+

Available values for input image formats are: +

+
sbsl
+

side by side parallel (left eye left, right eye right) +

+
+
sbsr
+

side by side crosseye (right eye left, left eye right) +

+
+
sbs2l
+

side by side parallel with half width resolution +(left eye left, right eye right) +

+
+
sbs2r
+

side by side crosseye with half width resolution +(right eye left, left eye right) +

+
+
abl
+
tbl
+

above-below (left eye above, right eye below) +

+
+
abr
+
tbr
+

above-below (right eye above, left eye below) +

+
+
ab2l
+
tb2l
+

above-below with half height resolution +(left eye above, right eye below) +

+
+
ab2r
+
tb2r
+

above-below with half height resolution +(right eye above, left eye below) +

+
+
al
+

alternating frames (left eye first, right eye second) +

+
+
ar
+

alternating frames (right eye first, left eye second) +

+
+
irl
+

interleaved rows (left eye has top row, right eye starts on next row) +

+
+
irr
+

interleaved rows (right eye has top row, left eye starts on next row) +

+
+
icl
+

interleaved columns, left eye first +

+
+
icr
+

interleaved columns, right eye first +

+

Default value is ‘sbsl’. +

+
+ +
+
out
+

Set stereoscopic image format of output. +

+
+
sbsl
+

side by side parallel (left eye left, right eye right) +

+
+
sbsr
+

side by side crosseye (right eye left, left eye right) +

+
+
sbs2l
+

side by side parallel with half width resolution +(left eye left, right eye right) +

+
+
sbs2r
+

side by side crosseye with half width resolution +(right eye left, left eye right) +

+
+
abl
+
tbl
+

above-below (left eye above, right eye below) +

+
+
abr
+
tbr
+

above-below (right eye above, left eye below) +

+
+
ab2l
+
tb2l
+

above-below with half height resolution +(left eye above, right eye below) +

+
+
ab2r
+
tb2r
+

above-below with half height resolution +(right eye above, left eye below) +

+
+
al
+

alternating frames (left eye first, right eye second) +

+
+
ar
+

alternating frames (right eye first, left eye second) +

+
+
irl
+

interleaved rows (left eye has top row, right eye starts on next row) +

+
+
irr
+

interleaved rows (right eye has top row, left eye starts on next row) +

+
+
arbg
+

anaglyph red/blue gray +(red filter on left eye, blue filter on right eye) +

+
+
argg
+

anaglyph red/green gray +(red filter on left eye, green filter on right eye) +

+
+
arcg
+

anaglyph red/cyan gray +(red filter on left eye, cyan filter on right eye) +

+
+
arch
+

anaglyph red/cyan half colored +(red filter on left eye, cyan filter on right eye) +

+
+
arcc
+

anaglyph red/cyan color +(red filter on left eye, cyan filter on right eye) +

+
+
arcd
+

anaglyph red/cyan color optimized with the least squares projection of dubois +(red filter on left eye, cyan filter on right eye) +

+
+
agmg
+

anaglyph green/magenta gray +(green filter on left eye, magenta filter on right eye) +

+
+
agmh
+

anaglyph green/magenta half colored +(green filter on left eye, magenta filter on right eye) +

+
+
agmc
+

anaglyph green/magenta colored +(green filter on left eye, magenta filter on right eye) +

+
+
agmd
+

anaglyph green/magenta color optimized with the least squares projection of dubois +(green filter on left eye, magenta filter on right eye) +

+
+
aybg
+

anaglyph yellow/blue gray +(yellow filter on left eye, blue filter on right eye) +

+
+
aybh
+

anaglyph yellow/blue half colored +(yellow filter on left eye, blue filter on right eye) +

+
+
aybc
+

anaglyph yellow/blue colored +(yellow filter on left eye, blue filter on right eye) +

+
+
aybd
+

anaglyph yellow/blue color optimized with the least squares projection of dubois +(yellow filter on left eye, blue filter on right eye) +

+
+
ml
+

mono output (left eye only) +

+
+
mr
+

mono output (right eye only) +

+
+
chl
+

checkerboard, left eye first +

+
+
chr
+

checkerboard, right eye first +

+
+
icl
+

interleaved columns, left eye first +

+
+
icr
+

interleaved columns, right eye first +

+
+
hdmi
+

HDMI frame pack +

+
+ +

Default value is ‘arcd’. +

+
+ + +
+

32.241.1 Examples

+ +
    +
  • Convert input video from side by side parallel to anaglyph yellow/blue dubois: +
    +
    stereo3d=sbsl:aybd
    +
    + +
  • Convert input video from above below (left eye above, right eye below) to side by side crosseye. +
    +
    stereo3d=abl:sbsr
    +
    +
+ +
+
+
+

32.242 streamselect, astreamselect

+

Select video or audio streams. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of inputs. Default is 2. +

+
+
map
+

Set input indexes to remap to outputs. +

+
+ + +
+

32.242.1 Commands

+ +

The streamselect and astreamselect filter supports the following +commands: +

+
+
map
+

Set input indexes to remap to outputs. +

+
+ +
+
+

32.242.2 Examples

+ +
    +
  • Select first 5 seconds 1st stream and rest of time 2nd stream: +
    +
    sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
    +
    + +
  • Same as above, but for audio: +
    +
    asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
    +
    +
+ +
+
+
+

32.243 subtitles

+ +

Draw subtitles on top of input video using the libass library. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libass. This filter also requires a build with libavcodec and +libavformat to convert the passed subtitles file to ASS (Advanced Substation +Alpha) subtitles format. +

+

The filter accepts the following options: +

+
+
filename, f
+

Set the filename of the subtitle file to read. It must be specified. +

+
+
original_size
+

Specify the size of the original video, the video for which the ASS file +was composed. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to +correctly scale the fonts if the aspect ratio has been changed. +

+
+
fontsdir
+

Set a directory path containing fonts that can be used by the filter. +These fonts will be used in addition to whatever the font provider uses. +

+
+
alpha
+

Process alpha channel, by default alpha channel is untouched. +

+
+
charenc
+

Set subtitles input character encoding. subtitles filter only. Only +useful if not UTF-8. +

+
+
stream_index, si
+

Set subtitles stream index. subtitles filter only. +

+
+
force_style
+

Override default style or script info parameters of the subtitles. It accepts a +string containing ASS style format KEY=VALUE couples separated by ",". +

+
+ +

If the first key is not specified, it is assumed that the first value +specifies the filename. +

+

For example, to render the file sub.srt on top of the input +video, use the command: +

+
subtitles=sub.srt
+
+ +

which is equivalent to: +

+
subtitles=filename=sub.srt
+
+ +

To render the default subtitles stream from file video.mkv, use: +

+
subtitles=video.mkv
+
+ +

To render the second subtitles stream from that file, use: +

+
subtitles=video.mkv:si=1
+
+ +

To make the subtitles stream from sub.srt appear in 80% transparent blue +DejaVu Serif, use: +

+
subtitles=sub.srt:force_style='Fontname=DejaVu Serif,PrimaryColour=&HCCFF0000'
+
+ +
+
+

32.244 super2xsai

+ +

Scale the input by 2x and smooth using the Super2xSaI (Scale and +Interpolate) pixel art scaling algorithm. +

+

Useful for enlarging pixel art images without reducing sharpness. +

+
+
+

32.245 swaprect

+ +

Swap two rectangular objects in video. +

+

This filter accepts the following options: +

+
+
w
+

Set object width. +

+
+
h
+

Set object height. +

+
+
x1
+

Set 1st rect x coordinate. +

+
+
y1
+

Set 1st rect y coordinate. +

+
+
x2
+

Set 2nd rect x coordinate. +

+
+
y2
+

Set 2nd rect y coordinate. +

+

All expressions are evaluated once for each frame. +

+
+ +

The all options are expressions containing the following constants: +

+
+
w
+
h
+

The input width and height. +

+
+
a
+

same as w / h +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (w / h) * sar +

+
+
n
+

The number of the input frame, starting from 0. +

+
+
t
+

The timestamp expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
pos
+

the position in the file of the input frame, NAN if unknown; deprecated, +do not use +

+
+ + +
+

32.245.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.246 swapuv

+

Swap U & V plane. +

+
+
+

32.247 tblend

+

Blend successive video frames. +

+

See blend +

+
+
+

32.248 telecine

+ +

Apply telecine process to the video. +

+

This filter accepts the following options: +

+
+
first_field
+
+
top, t
+

top field first +

+
bottom, b
+

bottom field first +The default value is top. +

+
+ +
+
pattern
+

A string of numbers representing the pulldown pattern you wish to apply. +The default value is 23. +

+
+ +
+
Some typical patterns:
+
+NTSC output (30i):
+27.5p: 32222
+24p: 23 (classic)
+24p: 2332 (preferred)
+20p: 33
+18p: 334
+16p: 3444
+
+PAL output (25i):
+27.5p: 12222
+24p: 222222222223 ("Euro pulldown")
+16.67p: 33
+16p: 33333334
+
+ +
+
+

32.249 thistogram

+ +

Compute and draw a color distribution histogram for the input video across time. +

+

Unlike histogram video filter which only shows histogram of single input frame +at certain time, this filter shows also past histograms of number of frames defined +by width option. +

+

The computed histogram is a representation of the color component +distribution in an image. +

+

The filter accepts the following options: +

+
+
width, w
+

Set width of single color component output. Default value is 0. +Value of 0 means width will be picked from input video. +This also set number of passed histograms to keep. +Allowed range is [0, 8192]. +

+
+
display_mode, d
+

Set display mode. +It accepts the following values: +

+
stack
+

Per color component graphs are placed below each other. +

+
+
parade
+

Per color component graphs are placed side by side. +

+
+
overlay
+

Presents information identical to that in the parade, except +that the graphs representing color components are superimposed directly +over one another. +

+
+

Default is stack. +

+
+
levels_mode, m
+

Set mode. Can be either linear, or logarithmic. +Default is linear. +

+
+
components, c
+

Set what color components to display. +Default is 7. +

+
+
bgopacity, b
+

Set background opacity. Default is 0.9. +

+
+
envelope, e
+

Show envelope. Default is disabled. +

+
+
ecolor, ec
+

Set envelope color. Default is gold. +

+
+
slide
+

Set slide mode. +

+

Available values for slide is: +

+
frame
+

Draw new frame when right border is reached. +

+
+
replace
+

Replace old columns with new ones. +

+
+
scroll
+

Scroll from right to left. +

+
+
rscroll
+

Scroll from left to right. +

+
+
picture
+

Draw single picture. +

+
+ +

Default is replace. +

+
+ +
+
+

32.250 threshold

+ +

Apply threshold effect to video stream. +

+

This filter needs four video streams to perform thresholding. +First stream is stream we are filtering. +Second stream is holding threshold values, third stream is holding min values, +and last, fourth stream is holding max values. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+
+ +

For example if first stream pixel’s component value is less then threshold value +of pixel component from 2nd threshold stream, third stream value will picked, +otherwise fourth stream pixel component value will be picked. +

+

Using color source filter one can perform various types of thresholding: +

+ +
+

32.250.1 Commands

+ +

This filter supports the all options as commands. +

+
+
+

32.250.2 Examples

+ +
    +
  • Binary threshold, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=black -f lavfi -i color=white -lavfi threshold output.avi
    +
    + +
  • Inverted binary threshold, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -f lavfi -i color=black -lavfi threshold output.avi
    +
    + +
  • Truncate binary threshold, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=gray -lavfi threshold output.avi
    +
    + +
  • Threshold to zero, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -i 320x240.avi -lavfi threshold output.avi
    +
    + +
  • Inverted threshold to zero, using gray color as threshold: +
    +
    ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=white -lavfi threshold output.avi
    +
    +
+ +
+
+
+

32.251 thumbnail

+

Select the most representative frame in a given sequence of consecutive frames. +

+

The filter accepts the following options: +

+
+
n
+

Set the frames batch size to analyze; in a set of n frames, the filter +will pick one of them, and then handle the next batch of n frames until +the end. Default is 100. +

+
+
log
+

Set the log level to display picked frame stats. +Default is info. +

+
+ +

Since the filter keeps track of the whole frames sequence, a bigger n +value will result in a higher memory usage, so a high value is not recommended. +

+ +
+

32.251.1 Examples

+ +
    +
  • Extract one picture each 50 frames: +
    +
    thumbnail=50
    +
    + +
  • Complete example of a thumbnail creation with ffmpeg: +
    +
    ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
    +
    +
+ +
+
+
+

32.252 tile

+ +

Tile several successive frames together. +

+

The untile filter can do the reverse. +

+

The filter accepts the following options: +

+
+
layout
+

Set the grid size in the form COLUMNSxROWS. Range is upto UINT_MAX cells. +Default is 6x5. +

+
+
nb_frames
+

Set the maximum number of frames to render in the given area. It must be less +than or equal to wxh. The default value is 0, meaning all +the area will be used. +

+
+
margin
+

Set the outer border margin in pixels. Range is 0 to 1024. Default is 0. +

+
+
padding
+

Set the inner border thickness (i.e. the number of pixels between frames). For +more advanced padding options (such as having different values for the edges), +refer to the pad video filter. Range is 0 to 1024. Default is 0. +

+
+
color
+

Specify the color of the unused area. For the syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +The default value of color is "black". +

+
+
overlap
+

Set the number of frames to overlap when tiling several successive frames together. +The value must be between 0 and nb_frames - 1. Default is 0. +

+
+
init_padding
+

Set the number of frames to initially be empty before displaying first output frame. +This controls how soon will one get first output frame. +The value must be between 0 and nb_frames - 1. Default is 0. +

+
+ + +
+

32.252.1 Examples

+ +
    +
  • Produce 8x8 PNG tiles of all keyframes (-skip_frame nokey) in a movie: +
    +
    ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
    +
    +

    The -vsync 0 is necessary to prevent ffmpeg from +duplicating each output frame to accommodate the originally detected frame +rate. +

    +
  • Display 5 pictures in an area of 3x2 frames, +with 7 pixels between them, and 2 pixels of initial margin, using +mixed flat and named options: +
    +
    tile=3x2:nb_frames=5:padding=7:margin=2
    +
    +
+ +
+
+
+

32.253 tinterlace

+ +

Perform various types of temporal field interlacing. +

+

Frames are counted starting from 1, so the first input frame is +considered odd. +

+

The filter accepts the following options: +

+
+
mode
+

Specify the mode of the interlacing. This option can also be specified +as a value alone. See below for a list of values for this option. +

+

Available values are: +

+
+
merge, 0
+

Move odd frames into the upper field, even into the lower field, +generating a double height frame at half frame rate. +

+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+
+ +
+
drop_even, 1
+

Only output odd frames, even frames are dropped, generating a frame with +unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111                           33333
+11111                           33333
+11111                           33333
+11111                           33333
+
+ +
+
drop_odd, 2
+

Only output even frames, odd frames are dropped, generating a frame with +unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+                22222                           44444
+                22222                           44444
+                22222                           44444
+                22222                           44444
+
+ +
+
pad, 3
+

Expand each frame to full height, but pad alternate lines with black, +generating a frame with double height at the same input frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111           .....           33333           .....
+.....           22222           .....           44444
+11111           .....           33333           .....
+.....           22222           .....           44444
+11111           .....           33333           .....
+.....           22222           .....           44444
+11111           .....           33333           .....
+.....           22222           .....           44444
+
+ + +
+
interleave_top, 4
+

Interleave the upper field from odd frames with the lower field from +even frames, generating a frame with unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111<-         22222           33333<-         44444
+11111           22222<-         33333           44444<-
+11111<-         22222           33333<-         44444
+11111           22222<-         33333           44444<-
+
+Output:
+11111                           33333
+22222                           44444
+11111                           33333
+22222                           44444
+
+ + +
+
interleave_bottom, 5
+

Interleave the lower field from odd frames with the upper field from +even frames, generating a frame with unchanged height at half frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222<-         33333           44444<-
+11111<-         22222           33333<-         44444
+11111           22222<-         33333           44444<-
+11111<-         22222           33333<-         44444
+
+Output:
+22222                           44444
+11111                           33333
+22222                           44444
+11111                           33333
+
+ + +
+
interlacex2, 6
+

Double frame rate with unchanged height. Frames are inserted each +containing the second temporal field from the previous input frame and +the first temporal field from the next input frame. This mode relies on +the top_field_first flag. Useful for interlaced video displays with no +field synchronisation. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+ 11111           22222           33333           44444
+11111           22222           33333           44444
+ 11111           22222           33333           44444
+
+Output:
+11111   22222   22222   33333   33333   44444   44444
+ 11111   11111   22222   22222   33333   33333   44444
+11111   22222   22222   33333   33333   44444   44444
+ 11111   11111   22222   22222   33333   33333   44444
+
+ + +
+
mergex2, 7
+

Move odd frames into the upper field, even into the lower field, +generating a double height frame at same frame rate. +

+
+
 ------> time
+Input:
+Frame 1         Frame 2         Frame 3         Frame 4
+
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+11111           22222           33333           44444
+
+Output:
+11111           33333           33333           55555
+22222           22222           44444           44444
+11111           33333           33333           55555
+22222           22222           44444           44444
+11111           33333           33333           55555
+22222           22222           44444           44444
+11111           33333           33333           55555
+22222           22222           44444           44444
+
+ +
+
+ +

Numeric values are deprecated but are accepted for backward +compatibility reasons. +

+

Default mode is merge. +

+
+
flags
+

Specify flags influencing the filter process. +

+

Available value for flags is: +

+
+
low_pass_filter, vlpf
+

Enable linear vertical low-pass filtering in the filter. +Vertical low-pass filtering is required when creating an interlaced +destination from a progressive source which contains high-frequency +vertical detail. Filtering will reduce interlace ’twitter’ and Moire +patterning. +

+
+
complex_filter, cvlpf
+

Enable complex vertical low-pass filtering. +This will slightly less reduce interlace ’twitter’ and Moire +patterning but better retain detail and subjective sharpness impression. +

+
+
bypass_il
+

Bypass already interlaced frames, only adjust the frame rate. +

+
+ +

Vertical low-pass filtering and bypassing already interlaced frames can only be +enabled for mode interleave_top and interleave_bottom. +

+
+
+ +
+
+

32.254 tmedian

+

Pick median pixels from several successive input video frames. +

+

The filter accepts the following options: +

+
+
radius
+

Set radius of median filter. +Default is 1. Allowed range is from 1 to 127. +

+
+
planes
+

Set which planes to filter. Default value is 15, by which all planes are processed. +

+
+
percentile
+

Set median percentile. Default value is 0.5. +Default value of 0.5 will pick always median values, while 0 will pick +minimum values, and 1 maximum values. +

+
+ + +
+

32.254.1 Commands

+ +

This filter supports all above options as commands, excluding option radius. +

+
+
+
+

32.255 tmidequalizer

+ +

Apply Temporal Midway Video Equalization effect. +

+

Midway Video Equalization adjusts a sequence of video frames to have the same +histograms, while maintaining their dynamics as much as possible. It’s +useful for e.g. matching exposures from a video frames sequence. +

+

This filter accepts the following option: +

+
+
radius
+

Set filtering radius. Default is 5. Allowed range is from 1 to 127. +

+
+
sigma
+

Set filtering sigma. Default is 0.5. This controls strength of filtering. +Setting this option to 0 effectively does nothing. +

+
+
planes
+

Set which planes to process. Default is 15, which is all available planes. +

+
+ +
+
+

32.256 tmix

+ +

Mix successive video frames. +

+

A description of the accepted options follows. +

+
+
frames
+

The number of successive frames to mix. If unspecified, it defaults to 3. +

+
+
weights
+

Specify weight of each input video frame. +Each weight is separated by space. If number of weights is smaller than +number of frames last specified weight will be used for all remaining +unset weights. +

+
+
scale
+

Specify scale, if it is set it will be multiplied with sum +of each weight multiplied with pixel values to give final destination +pixel value. By default scale is auto scaled to sum of weights. +

+
+
planes
+

Set which planes to filter. Default is all. Allowed range is from 0 to 15. +

+
+ + +
+

32.256.1 Examples

+ +
    +
  • Average 7 successive frames: +
    +
    tmix=frames=7:weights="1 1 1 1 1 1 1"
    +
    + +
  • Apply simple temporal convolution: +
    +
    tmix=frames=3:weights="-1 3 -1"
    +
    + +
  • Similar as above but only showing temporal differences: +
    +
    tmix=frames=3:weights="-1 2 -1":scale=1
    +
    +
+ +
+
+

32.256.2 Commands

+ +

This filter supports the following commands: +

+
weights
+
scale
+
planes
+

Syntax is same as option with same name. +

+
+ +
+
+
+

32.257 tonemap

+

Tone map colors from different dynamic ranges. +

+

This filter expects data in single precision floating point, as it needs to +operate on (and can output) out-of-range values. Another filter, such as +zscale, is needed to convert the resulting frame to a usable format. +

+

The tonemapping algorithms implemented only work on linear light, so input +data should be linearized beforehand (and possibly correctly tagged). +

+
+
ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
+
+ + +
+

32.257.1 Options

+

The filter accepts the following options. +

+
+
tonemap
+

Set the tone map algorithm to use. +

+

Possible values are: +

+
none
+

Do not apply any tone map, only desaturate overbright pixels. +

+
+
clip
+

Hard-clip any out-of-range values. Use it for perfect color accuracy for +in-range values, while distorting out-of-range values. +

+
+
linear
+

Stretch the entire reference gamut to a linear multiple of the display. +

+
+
gamma
+

Fit a logarithmic transfer between the tone curves. +

+
+
reinhard
+

Preserve overall image brightness with a simple curve, using nonlinear +contrast, which results in flattening details and degrading color accuracy. +

+
+
hable
+

Preserve both dark and bright details better than reinhard, at the cost +of slightly darkening everything. Use it when detail preservation is more +important than color and brightness accuracy. +

+
+
mobius
+

Smoothly map out-of-range values, while retaining contrast and colors for +in-range material as much as possible. Use it when color accuracy is more +important than detail preservation. +

+
+ +

Default is none. +

+
+
param
+

Tune the tone mapping algorithm. +

+

This affects the following algorithms: +

+
none
+

Ignored. +

+
+
linear
+

Specifies the scale factor to use while stretching. +Default to 1.0. +

+
+
gamma
+

Specifies the exponent of the function. +Default to 1.8. +

+
+
clip
+

Specify an extra linear coefficient to multiply into the signal before clipping. +Default to 1.0. +

+
+
reinhard
+

Specify the local contrast coefficient at the display peak. +Default to 0.5, which means that in-gamut values will be about half as bright +as when clipping. +

+
+
hable
+

Ignored. +

+
+
mobius
+

Specify the transition point from linear to mobius transform. Every value +below this point is guaranteed to be mapped 1:1. The higher the value, the +more accurate the result will be, at the cost of losing bright details. +Default to 0.3, which due to the steep initial slope still preserves in-range +colors fairly accurately. +

+
+ +
+
desat
+

Apply desaturation for highlights that exceed this level of brightness. The +higher the parameter, the more color information will be preserved. This +setting helps prevent unnaturally blown-out colors for super-highlights, by +(smoothly) turning into white instead. This makes images feel more natural, +at the cost of reducing information about out-of-range colors. +

+

The default of 2.0 is somewhat conservative and will mostly just apply to +skies or directly sunlit surfaces. A setting of 0.0 disables this option. +

+

This option works only if the input frame has a supported color tag. +

+
+
peak
+

Override signal/nominal/reference peak with this value. Useful when the +embedded peak information in display metadata is not reliable or when tone +mapping from a lower range to a higher range. +

+
+ +
+
+
+

32.258 tpad

+ +

Temporarily pad video frames. +

+

The filter accepts the following options: +

+
+
start
+

Specify number of delay frames before input video stream. Default is 0. +

+
+
stop
+

Specify number of padding frames after input video stream. +Set to -1 to pad indefinitely. Default is 0. +

+
+
start_mode
+

Set kind of frames added to beginning of stream. +Can be either add or clone. +With add frames of solid-color are added. +With clone frames are clones of first frame. +Default is add. +

+
+
stop_mode
+

Set kind of frames added to end of stream. +Can be either add or clone. +With add frames of solid-color are added. +With clone frames are clones of last frame. +Default is add. +

+
+
start_duration, stop_duration
+

Specify the duration of the start/stop delay. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +These options override start and stop. Default is 0. +

+
+
color
+

Specify the color of the padded area. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. +

+

The default value of color is "black". +

+
+ +
+
+

32.259 transpose

+ +

Transpose rows with columns in the input video and optionally flip it. +

+

It accepts the following parameters: +

+
+
dir
+

Specify the transposition direction. +

+

Can assume the following values: +

+
0, 4, cclock_flip
+

Rotate by 90 degrees counterclockwise and vertically flip (default), that is: +

+
L.R     L.l
+. . ->  . .
+l.r     R.r
+
+ +
+
1, 5, clock
+

Rotate by 90 degrees clockwise, that is: +

+
L.R     l.L
+. . ->  . .
+l.r     r.R
+
+ +
+
2, 6, cclock
+

Rotate by 90 degrees counterclockwise, that is: +

+
L.R     R.r
+. . ->  . .
+l.r     L.l
+
+ +
+
3, 7, clock_flip
+

Rotate by 90 degrees clockwise and vertically flip, that is: +

+
L.R     r.R
+. . ->  . .
+l.r     l.L
+
+
+
+ +

For values between 4-7, the transposition is only done if the input +video geometry is portrait and not landscape. These values are +deprecated, the passthrough option should be used instead. +

+

Numerical values are deprecated, and should be dropped in favor of +symbolic constants. +

+
+
passthrough
+

Do not apply the transposition if the input geometry matches the one +specified by the specified value. It accepts the following values: +

+
none
+

Always apply transposition. +

+
portrait
+

Preserve portrait geometry (when height >= width). +

+
landscape
+

Preserve landscape geometry (when width >= height). +

+
+ +

Default value is none. +

+
+ +

For example to rotate by 90 degrees clockwise and preserve portrait +layout: +

+
transpose=dir=1:passthrough=portrait
+
+ +

The command above can also be specified as: +

+
transpose=1:portrait
+
+ +
+
+

32.260 transpose_npp

+ +

Transpose rows with columns in the input video and optionally flip it. +For more in depth examples see the transpose video filter, which shares mostly the same options. +

+

It accepts the following parameters: +

+
+
dir
+

Specify the transposition direction. +

+

Can assume the following values: +

+
cclock_flip
+

Rotate by 90 degrees counterclockwise and vertically flip. (default) +

+
+
clock
+

Rotate by 90 degrees clockwise. +

+
+
cclock
+

Rotate by 90 degrees counterclockwise. +

+
+
clock_flip
+

Rotate by 90 degrees clockwise and vertically flip. +

+
+ +
+
passthrough
+

Do not apply the transposition if the input geometry matches the one +specified by the specified value. It accepts the following values: +

+
none
+

Always apply transposition. (default) +

+
portrait
+

Preserve portrait geometry (when height >= width). +

+
landscape
+

Preserve landscape geometry (when width >= height). +

+
+ +
+
+ +
+
+

32.261 trim

+

Trim the input so that the output contains one continuous subpart of the input. +

+

It accepts the following parameters: +

+
start
+

Specify the time of the start of the kept section, i.e. the frame with the +timestamp start will be the first frame in the output. +

+
+
end
+

Specify the time of the first frame that will be dropped, i.e. the frame +immediately preceding the one with the timestamp end will be the last +frame in the output. +

+
+
start_pts
+

This is the same as start, except this option sets the start timestamp +in timebase units instead of seconds. +

+
+
end_pts
+

This is the same as end, except this option sets the end timestamp +in timebase units instead of seconds. +

+
+
duration
+

The maximum duration of the output in seconds. +

+
+
start_frame
+

The number of the first frame that should be passed to the output. +

+
+
end_frame
+

The number of the first frame that should be dropped. +

+
+ +

start, end, and duration are expressed as time +duration specifications; see +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

Note that the first two sets of the start/end options and the duration +option look at the frame timestamp, while the _frame variants simply count the +frames that pass through the filter. Also note that this filter does not modify +the timestamps. If you wish for the output timestamps to start at zero, insert a +setpts filter after the trim filter. +

+

If multiple start or end options are set, this filter tries to be greedy and +keep all the frames that match at least one of the specified constraints. To keep +only the part that matches all the constraints at once, chain multiple trim +filters. +

+

The defaults are such that all the input is kept. So it is possible to set e.g. +just the end values to keep everything before the specified time. +

+

Examples: +

    +
  • Drop everything except the second minute of input: +
    +
    ffmpeg -i INPUT -vf trim=60:120
    +
    + +
  • Keep only the first second: +
    +
    ffmpeg -i INPUT -vf trim=duration=1
    +
    + +
+ +
+
+

32.262 unpremultiply

+

Apply alpha unpremultiply effect to input video stream using first plane +of second stream as alpha. +

+

Both streams must have same dimensions and same pixel format. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes will be processed, unprocessed planes will be copied. +By default value 0xf, all planes will be processed. +

+

If the format has 1 or 2 components, then luma is bit 0. +If the format has 3 or 4 components: +for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red; +for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V. +If present, the alpha channel is always the last bit. +

+
+
inplace
+

Do not require 2nd input for processing, instead use alpha plane from input stream. +

+
+ +
+
+

32.263 unsharp

+ +

Sharpen or blur the input video. +

+

It accepts the following parameters: +

+
+
luma_msize_x, lx
+

Set the luma matrix horizontal size. It must be an odd integer between +3 and 23. The default value is 5. +

+
+
luma_msize_y, ly
+

Set the luma matrix vertical size. It must be an odd integer between 3 +and 23. The default value is 5. +

+
+
luma_amount, la
+

Set the luma effect strength. It must be a floating point number, reasonable +values lay between -1.5 and 1.5. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+

Default value is 1.0. +

+
+
chroma_msize_x, cx
+

Set the chroma matrix horizontal size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
chroma_msize_y, cy
+

Set the chroma matrix vertical size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
chroma_amount, ca
+

Set the chroma effect strength. It must be a floating point number, reasonable +values lay between -1.5 and 1.5. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+

Default value is 0.0. +

+
+
alpha_msize_x, ax
+

Set the alpha matrix horizontal size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
alpha_msize_y, ay
+

Set the alpha matrix vertical size. It must be an odd integer +between 3 and 23. The default value is 5. +

+
+
alpha_amount, aa
+

Set the alpha effect strength. It must be a floating point number, reasonable +values lay between -1.5 and 1.5. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+

Default value is 0.0. +

+
+
+ +

All parameters are optional and default to the equivalent of the +string ’5:5:1.0:5:5:0.0’. +

+ +
+

32.263.1 Examples

+ +
    +
  • Apply strong luma sharpen effect: +
    +
    unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
    +
    + +
  • Apply a strong blur of both luma and chroma parameters: +
    +
    unsharp=7:7:-2:7:7:-2
    +
    +
+ +
+
+
+

32.264 untile

+ +

Decompose a video made of tiled images into the individual images. +

+

The frame rate of the output video is the frame rate of the input video +multiplied by the number of tiles. +

+

This filter does the reverse of tile. +

+

The filter accepts the following options: +

+
+
layout
+

Set the grid size (i.e. the number of lines and columns). For the syntax of +this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+ + +
+

32.264.1 Examples

+ +
    +
  • Produce a 1-second video from a still image file made of 25 frames stacked +vertically, like an analogic film reel: +
    +
    ffmpeg -r 1 -i image.jpg -vf untile=1x25 movie.mkv
    +
    +
+ +
+
+
+

32.265 uspp

+ +

Apply ultra slow/simple postprocessing filter that compresses and decompresses +the image at several (or - in the case of quality level 8 - all) +shifts and average the results. +

+

The way this differs from the behavior of spp is that uspp actually encodes & +decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8 +DCT similar to MJPEG. +

+

This filter is only available in ffmpeg version 4.4 or earlier. +

+

The filter accepts the following options: +

+
+
quality
+

Set quality. This option defines the number of levels for averaging. It accepts +an integer in the range 0-8. If set to 0, the filter will have no +effect. A value of 8 means the higher quality. For each increment of +that value the speed drops by a factor of approximately 2. Default value is +3. +

+
+
qp
+

Force a constant quantization parameter. If not set, the filter will use the QP +from the video stream (if available). +

+
+
codec
+

Use specified codec instead of snow. +

+
+ +
+
+

32.266 v360

+ +

Convert 360 videos between various formats. +

+

The filter accepts the following options: +

+
+
input
+
output
+

Set format of the input/output video. +

+

Available formats: +

+
+
e
+
equirect
+

Equirectangular projection. +

+
+
c3x2
+
c6x1
+
c1x6
+

Cubemap with 3x2/6x1/1x6 layout. +

+

Format specific options: +

+
+
in_pad
+
out_pad
+

Set padding proportion for the input/output cubemap. Values in decimals. +

+

Example values: +

+
0
+

No padding. +

+
0.01
+

1% of face is padding. For example, with 1920x1280 resolution face size would be 640x640 and padding would be 3 pixels from each side. (640 * 0.01 = 6 pixels) +

+
+ +

Default value is 0. +Maximum value is 0.1. +

+
+
fin_pad
+
fout_pad
+

Set fixed padding for the input/output cubemap. Values in pixels. +

+

Default value is 0. If greater than zero it overrides other padding options. +

+
+
in_forder
+
out_forder
+

Set order of faces for the input/output cubemap. Choose one direction for each position. +

+

Designation of directions: +

+
r
+

right +

+
l
+

left +

+
u
+

up +

+
d
+

down +

+
f
+

forward +

+
b
+

back +

+
+ +

Default value is rludfb. +

+
+
in_frot
+
out_frot
+

Set rotation of faces for the input/output cubemap. Choose one angle for each position. +

+

Designation of angles: +

+
0
+

0 degrees clockwise +

+
1
+

90 degrees clockwise +

+
2
+

180 degrees clockwise +

+
3
+

270 degrees clockwise +

+
+ +

Default value is 000000. +

+
+ +
+
eac
+

Equi-Angular Cubemap. +

+
+
flat
+
gnomonic
+
rectilinear
+

Regular video. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
dfisheye
+

Dual fisheye. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
barrel
+
fb
+
barrelsplit
+

Facebook’s 360 formats. +

+
+
sg
+

Stereographic format. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
mercator
+

Mercator format. +

+
+
ball
+

Ball format, gives significant distortion toward the back. +

+
+
hammer
+

Hammer-Aitoff map projection format. +

+
+
sinusoidal
+

Sinusoidal map projection format. +

+
+
fisheye
+

Fisheye projection. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
pannini
+

Pannini projection. +

+

Format specific options: +

+
h_fov
+

Set output pannini parameter. +

+
+
ih_fov
+

Set input pannini parameter. +

+
+ +
+
cylindrical
+

Cylindrical projection. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
perspective
+

Perspective projection. (output only) +

+

Format specific options: +

+
v_fov
+

Set perspective parameter. +

+
+ +
+
tetrahedron
+

Tetrahedron projection. +

+
+
tsp
+

Truncated square pyramid projection. +

+
+
he
+
hequirect
+

Half equirectangular projection. +

+
+
equisolid
+

Equisolid format. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
og
+

Orthographic format. +

+

Format specific options: +

+
h_fov
+
v_fov
+
d_fov
+

Set output horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+
ih_fov
+
iv_fov
+
id_fov
+

Set input horizontal/vertical/diagonal field of view. Values in degrees. +

+

If diagonal field of view is set it overrides horizontal and vertical field of view. +

+
+ +
+
octahedron
+

Octahedron projection. +

+
+
cylindricalea
+

Cylindrical Equal Area projection. +

+
+ +
+
interp
+

Set interpolation method.
+Note: more complex interpolation methods require much more memory to run. +

+

Available methods: +

+
+
near
+
nearest
+

Nearest neighbour. +

+
line
+
linear
+

Bilinear interpolation. +

+
lagrange9
+

Lagrange9 interpolation. +

+
cube
+
cubic
+

Bicubic interpolation. +

+
lanc
+
lanczos
+

Lanczos interpolation. +

+
sp16
+
spline16
+

Spline16 interpolation. +

+
gauss
+
gaussian
+

Gaussian interpolation. +

+
mitchell
+

Mitchell interpolation. +

+
+ +

Default value is line. +

+
+
w
+
h
+

Set the output video resolution. +

+

Default resolution depends on formats. +

+
+
in_stereo
+
out_stereo
+

Set the input/output stereo format. +

+
+
2d
+

2D mono +

+
sbs
+

Side by side +

+
tb
+

Top bottom +

+
+ +

Default value is 2d for input and output format. +

+
+
yaw
+
pitch
+
roll
+

Set rotation for the output video. Values in degrees. +

+
+
rorder
+

Set rotation order for the output video. Choose one item for each position. +

+
+
y, Y
+

yaw +

+
p, P
+

pitch +

+
r, R
+

roll +

+
+ +

Default value is ypr. +

+
+
h_flip
+
v_flip
+
d_flip
+

Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values. +

+
+
ih_flip
+
iv_flip
+

Set if input video is flipped horizontally/vertically. Boolean values. +

+
+
in_trans
+

Set if input video is transposed. Boolean value, by default disabled. +

+
+
out_trans
+

Set if output video needs to be transposed. Boolean value, by default disabled. +

+
+
h_offset
+
v_offset
+

Set output horizontal/vertical off-axis offset. Default is set to 0. +Allowed range is from -1 to 1. +

+
+
alpha_mask
+

Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled. +

+
+
reset_rot
+

Reset rotation of output video. Boolean value, by default disabled. +

+
+ + +
+

32.266.1 Examples

+ +
    +
  • Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation: +
    +
    ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
    +
    +
  • Extract back view of Equi-Angular Cubemap: +
    +
    ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
    +
    +
  • Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format: +
    +
    v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
    +
    +
+ +
+
+

32.266.2 Commands

+ +

This filter supports subset of above options as commands. +

+
+
+
+

32.267 vaguedenoiser

+ +

Apply a wavelet based denoiser. +

+

It transforms each frame from the video input into the wavelet domain, +using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to +the obtained coefficients. It does an inverse wavelet transform after. +Due to wavelet properties, it should give a nice smoothed result, and +reduced noise, without blurring picture features. +

+

This filter accepts the following options: +

+
+
threshold
+

The filtering strength. The higher, the more filtered the video will be. +Hard thresholding can use a higher threshold than soft thresholding +before the video looks overfiltered. Default value is 2. +

+
+
method
+

The filtering method the filter will use. +

+

It accepts the following values: +

+
hard
+

All values under the threshold will be zeroed. +

+
+
soft
+

All values under the threshold will be zeroed. All values above will be +reduced by the threshold. +

+
+
garrote
+

Scales or nullifies coefficients - intermediary between (more) soft and +(less) hard thresholding. +

+
+ +

Default is garrote. +

+
+
nsteps
+

Number of times, the wavelet will decompose the picture. Picture can’t +be decomposed beyond a particular point (typically, 8 for a 640x480 +frame - as 2^9 = 512 > 480). Valid values are integers between 1 and 32. Default value is 6. +

+
+
percent
+

Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85. +

+
+
planes
+

A list of the planes to process. By default all planes are processed. +

+
+
type
+

The threshold type the filter will use. +

+

It accepts the following values: +

+
universal
+

Threshold used is same for all decompositions. +

+
+
bayes
+

Threshold used depends also on each decomposition coefficients. +

+
+ +

Default is universal. +

+
+ +
+
+

32.268 varblur

+

Apply variable blur filter by using 2nd video stream to set blur radius. +The 2nd stream must have the same dimensions. +

+

This filter accepts the following options: +

+
+
min_r
+

Set min allowed radius. Allowed range is from 0 to 254. Default is 0. +

+
max_r
+

Set max allowed radius. Allowed range is from 1 to 255. Default is 8. +

+
planes
+

Set which planes to process. By default, all are used. +

+
+ +

The varblur filter also supports the framesync options. +

+ +
+

32.268.1 Commands

+ +

This filter supports all the above options as commands. +

+
+
+
+

32.269 vectorscope

+ +

Display 2 color component values in the two dimensional graph (which is called +a vectorscope). +

+

This filter accepts the following options: +

+
+
mode, m
+

Set vectorscope mode. +

+

It accepts the following values: +

+
gray
+
tint
+

Gray values are displayed on graph, higher brightness means more pixels have +same component color value on location in graph. This is the default mode. +

+
+
color
+

Gray values are displayed on graph. Surrounding pixels values which are not +present in video frame are drawn in gradient of 2 color components which are +set by option x and y. The 3rd color component is static. +

+
+
color2
+

Actual color components values present in video frame are displayed on graph. +

+
+
color3
+

Similar as color2 but higher frequency of same values x and y +on graph increases value of another color component, which is luminance by +default values of x and y. +

+
+
color4
+

Actual colors present in video frame are displayed on graph. If two different +colors map to same position on graph then color with higher value of component +not present in graph is picked. +

+
+
color5
+

Gray values are displayed on graph. Similar to color but with 3rd color +component picked from radial gradient. +

+
+ +
+
x
+

Set which color component will be represented on X-axis. Default is 1. +

+
+
y
+

Set which color component will be represented on Y-axis. Default is 2. +

+
+
intensity, i
+

Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness +of color component which represents frequency of (X, Y) location in graph. +

+
+
envelope, e
+
+
none
+

No envelope, this is default. +

+
+
instant
+

Instant envelope, even darkest single pixel will be clearly highlighted. +

+
+
peak
+

Hold maximum and minimum values presented in graph over time. This way you +can still spot out of range values without constantly looking at vectorscope. +

+
+
peak+instant
+

Peak and instant envelope combined together. +

+
+ +
+
graticule, g
+

Set what kind of graticule to draw. +

+
none
+
green
+
color
+
invert
+
+ +
+
opacity, o
+

Set graticule opacity. +

+
+
flags, f
+

Set graticule flags. +

+
+
white
+

Draw graticule for white point. +

+
+
black
+

Draw graticule for black point. +

+
+
name
+

Draw color points short names. +

+
+ +
+
bgopacity, b
+

Set background opacity. +

+
+
lthreshold, l
+

Set low threshold for color component not represented on X or Y axis. +Values lower than this value will be ignored. Default is 0. +Note this value is multiplied with actual max possible value one pixel component +can have. So for 8-bit input and low threshold value of 0.1 actual threshold +is 0.1 * 255 = 25. +

+
+
hthreshold, h
+

Set high threshold for color component not represented on X or Y axis. +Values higher than this value will be ignored. Default is 1. +Note this value is multiplied with actual max possible value one pixel component +can have. So for 8-bit input and high threshold value of 0.9 actual threshold +is 0.9 * 255 = 230. +

+
+
colorspace, c
+

Set what kind of colorspace to use when drawing graticule. +

+
auto
+
601
+
709
+
+

Default is auto. +

+
+
tint0, t0
+
tint1, t1
+

Set color tint for gray/tint vectorscope mode. By default both options are zero. +This means no tint, and output will remain gray. +

+
+ +
+
+

32.270 vidstabdetect

+ +

Analyze video stabilization/deshaking. Perform pass 1 of 2, see +vidstabtransform for pass 2. +

+

This filter generates a file with relative translation and rotation +transform information about subsequent frames, which is then used by +the vidstabtransform filter. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libvidstab. +

+

This filter accepts the following options: +

+
+
result
+

Set the path to the file used to write the transforms information. +Default value is transforms.trf. +

+
+
shakiness
+

Set how shaky the video is and how quick the camera is. It accepts an +integer in the range 1-10, a value of 1 means little shakiness, a +value of 10 means strong shakiness. Default value is 5. +

+
+
accuracy
+

Set the accuracy of the detection process. It must be a value in the +range 1-15. A value of 1 means low accuracy, a value of 15 means high +accuracy. Default value is 15. +

+
+
stepsize
+

Set stepsize of the search process. The region around minimum is +scanned with 1 pixel resolution. Default value is 6. +

+
+
mincontrast
+

Set minimum contrast. Below this value a local measurement field is +discarded. Must be a floating point value in the range 0-1. Default +value is 0.3. +

+
+
tripod
+

Set reference frame number for tripod mode. +

+

If enabled, the motion of the frames is compared to a reference frame +in the filtered stream, identified by the specified number. The idea +is to compensate all movements in a more-or-less static scene and keep +the camera view absolutely still. +

+

If set to 0, it is disabled. The frames are counted starting from 1. +

+
+
show
+

Show fields and transforms in the resulting frames. It accepts an +integer in the range 0-2. Default value is 0, which disables any +visualization. +

+
+ + +
+

32.270.1 Examples

+ +
    +
  • Use default values: +
    +
    vidstabdetect
    +
    + +
  • Analyze strongly shaky movie and put the results in file +mytransforms.trf: +
    +
    vidstabdetect=shakiness=10:accuracy=15:result="mytransforms.trf"
    +
    + +
  • Visualize the result of internal transformations in the resulting +video: +
    +
    vidstabdetect=show=1
    +
    + +
  • Analyze a video with medium shakiness using ffmpeg: +
    +
    ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
    +
    +
+ +
+
+
+

32.271 vidstabtransform

+ +

Video stabilization/deshaking: pass 2 of 2, +see vidstabdetect for pass 1. +

+

Read a file with transform information for each frame and +apply/compensate them. Together with the vidstabdetect +filter this can be used to deshake videos. See also +http://public.hronopik.de/vid.stab. It is important to also use +the unsharp filter, see below. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libvidstab. +

+ +
+

32.271.1 Options

+ +
+
input
+

Set path to the file used to read the transforms. Default value is +transforms.trf. +

+
+
smoothing
+

Set the number of frames (value*2 + 1) used for lowpass filtering the +camera movements. Default value is 10. +

+

For example a number of 10 means that 21 frames are used (10 in the +past and 10 in the future) to smoothen the motion in the video. A +larger value leads to a smoother video, but limits the acceleration of +the camera (pan/tilt movements). 0 is a special case where a static +camera is simulated. +

+
+
optalgo
+

Set the camera path optimization algorithm. +

+

Accepted values are: +

+
gauss
+

gaussian kernel low-pass filter on camera motion (default) +

+
avg
+

averaging on transformations +

+
+ +
+
maxshift
+

Set maximal number of pixels to translate frames. Default value is -1, +meaning no limit. +

+
+
maxangle
+

Set maximal angle in radians (degree*PI/180) to rotate frames. Default +value is -1, meaning no limit. +

+
+
crop
+

Specify how to deal with borders that may be visible due to movement +compensation. +

+

Available values are: +

+
keep
+

keep image information from previous frame (default) +

+
black
+

fill the border black +

+
+ +
+
invert
+

Invert transforms if set to 1. Default value is 0. +

+
+
relative
+

Consider transforms as relative to previous frame if set to 1, +absolute if set to 0. Default value is 0. +

+
+
zoom
+

Set percentage to zoom. A positive value will result in a zoom-in +effect, a negative value in a zoom-out effect. Default value is 0 (no +zoom). +

+
+
optzoom
+

Set optimal zooming to avoid borders. +

+

Accepted values are: +

+
0
+

disabled +

+
1
+

optimal static zoom value is determined (only very strong movements +will lead to visible borders) (default) +

+
2
+

optimal adaptive zoom value is determined (no borders will be +visible), see zoomspeed +

+
+ +

Note that the value given at zoom is added to the one calculated here. +

+
+
zoomspeed
+

Set percent to zoom maximally each frame (enabled when +optzoom is set to 2). Range is from 0 to 5, default value is +0.25. +

+
+
interpol
+

Specify type of interpolation. +

+

Available values are: +

+
no
+

no interpolation +

+
linear
+

linear only horizontal +

+
bilinear
+

linear in both directions (default) +

+
bicubic
+

cubic in both directions (slow) +

+
+ +
+
tripod
+

Enable virtual tripod mode if set to 1, which is equivalent to +relative=0:smoothing=0. Default value is 0. +

+

Use also tripod option of vidstabdetect. +

+
+
debug
+

Increase log verbosity if set to 1. Also the detected global motions +are written to the temporary file global_motions.trf. Default +value is 0. +

+
+ +
+
+

32.271.2 Examples

+ +
    +
  • Use ffmpeg for a typical stabilization with default values: +
    +
    ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
    +
    + +

    Note the use of the unsharp filter which is always recommended. +

    +
  • Zoom in a bit more and load transform data from a given file: +
    +
    vidstabtransform=zoom=5:input="mytransforms.trf"
    +
    + +
  • Smoothen the video even more: +
    +
    vidstabtransform=smoothing=30
    +
    +
+ +
+
+
+

32.272 vflip

+ +

Flip the input video vertically. +

+

For example, to vertically flip a video with ffmpeg: +

+
ffmpeg -i in.avi -vf "vflip" out.avi
+
+ +
+
+

32.273 vfrdet

+ +

Detect variable frame rate video. +

+

This filter tries to detect if the input is variable or constant frame rate. +

+

At end it will output number of frames detected as having variable delta pts, +and ones with constant delta pts. +If there was frames with variable delta, than it will also show min, max and +average delta encountered. +

+
+
+

32.274 vibrance

+ +

Boost or alter saturation. +

+

The filter accepts the following options: +

+
intensity
+

Set strength of boost if positive value or strength of alter if negative value. +Default is 0. Allowed range is from -2 to 2. +

+
+
rbal
+

Set the red balance. Default is 1. Allowed range is from -10 to 10. +

+
+
gbal
+

Set the green balance. Default is 1. Allowed range is from -10 to 10. +

+
+
bbal
+

Set the blue balance. Default is 1. Allowed range is from -10 to 10. +

+
+
rlum
+

Set the red luma coefficient. +

+
+
glum
+

Set the green luma coefficient. +

+
+
blum
+

Set the blue luma coefficient. +

+
+
alternate
+

If intensity is negative and this is set to 1, colors will change, +otherwise colors will be less saturated, more towards gray. +

+
+ + +
+

32.274.1 Commands

+ +

This filter supports the all above options as commands. +

+
+
+
+

32.275 vif

+ +

Obtain the average VIF (Visual Information Fidelity) between two input videos. +

+

This filter takes two input videos. +

+

Both input videos must have the same resolution and pixel format for +this filter to work correctly. Also it assumes that both inputs +have the same number of frames, which are compared one by one. +

+

The obtained average VIF score is printed through the logging system. +

+

The filter stores the calculated VIF score of each frame. +

+

This filter also supports the framesync options. +

+

In the below example the input file main.mpg being processed is compared +with the reference file ref.mpg. +

+
+
ffmpeg -i main.mpg -i ref.mpg -lavfi vif -f null -
+
+ +
+
+

32.276 vignette

+ +

Make or reverse a natural vignetting effect. +

+

The filter accepts the following options: +

+
+
angle, a
+

Set lens angle expression as a number of radians. +

+

The value is clipped in the [0,PI/2] range. +

+

Default value: "PI/5" +

+
+
x0
+
y0
+

Set center coordinates expressions. Respectively "w/2" and "h/2" +by default. +

+
+
mode
+

Set forward/backward mode. +

+

Available modes are: +

+
forward
+

The larger the distance from the central point, the darker the image becomes. +

+
+
backward
+

The larger the distance from the central point, the brighter the image becomes. +This can be used to reverse a vignette effect, though there is no automatic +detection to extract the lens angle and other settings (yet). It can +also be used to create a burning effect. +

+
+ +

Default value is ‘forward’. +

+
+
eval
+

Set evaluation mode for the expressions (angle, x0, y0). +

+

It accepts the following values: +

+
init
+

Evaluate expressions only once during the filter initialization. +

+
+
frame
+

Evaluate expressions for each incoming frame. This is way slower than the +‘init’ mode since it requires all the scalers to be re-computed, but it +allows advanced dynamic expressions. +

+
+ +

Default value is ‘init’. +

+
+
dither
+

Set dithering to reduce the circular banding effects. Default is 1 +(enabled). +

+
+
aspect
+

Set vignette aspect. This setting allows one to adjust the shape of the vignette. +Setting this value to the SAR of the input will make a rectangular vignetting +following the dimensions of the video. +

+

Default is 1/1. +

+
+ + +
+

32.276.1 Expressions

+ +

The alpha, x0 and y0 expressions can contain the +following parameters. +

+
+
w
+
h
+

input width and height +

+
+
n
+

the number of input frame, starting from 0 +

+
+
pts
+

the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in +TB units, NAN if undefined +

+
+
r
+

frame rate of the input video, NAN if the input frame rate is unknown +

+
+
t
+

the PTS (Presentation TimeStamp) of the filtered video frame, +expressed in seconds, NAN if undefined +

+
+
tb
+

time base of the input video +

+
+ + +
+
+

32.276.2 Examples

+ +
    +
  • Apply simple strong vignetting effect: +
    +
    vignette=PI/4
    +
    + +
  • Make a flickering vignetting: +
    +
    vignette='PI/4+random(1)*PI/50':eval=frame
    +
    + +
+ +
+
+
+

32.277 vmafmotion

+ +

Obtain the average VMAF motion score of a video. +It is one of the component metrics of VMAF. +

+

The obtained average motion score is printed through the logging system. +

+

The filter accepts the following options: +

+
+
stats_file
+

If specified, the filter will use the named file to save the motion score of +each frame with respect to the previous frame. +When filename equals "-" the data is sent to standard output. +

+
+ +

Example: +

+
ffmpeg -i ref.mpg -vf vmafmotion -f null -
+
+ +
+
+

32.278 vstack

+

Stack input videos vertically. +

+

All streams must be of same pixel format and of same width. +

+

Note that this filter is faster than using overlay and pad filter +to create same output. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of input streams. Default is 2. +

+
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+ +
+
+

32.279 w3fdif

+ +

Deinterlace the input video ("w3fdif" stands for "Weston 3 Field +Deinterlacing Filter"). +

+

Based on the process described by Martin Weston for BBC R&D, and +implemented based on the de-interlace algorithm written by Jim +Easterbrook for BBC R&D, the Weston 3 field deinterlacing filter +uses filter coefficients calculated by BBC R&D. +

+

This filter uses field-dominance information in frame to decide which +of each pair of fields to place first in the output. +If it gets it wrong use setfield filter before w3fdif filter. +

+

There are two sets of filter coefficients, so called "simple" +and "complex". Which set of filter coefficients is used can +be set by passing an optional parameter: +

+
+
filter
+

Set the interlacing filter coefficients. Accepts one of the following values: +

+
+
simple
+

Simple filter coefficient set. +

+
complex
+

More-complex filter coefficient set. +

+
+

Default value is ‘complex’. +

+
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
frame
+

Output one frame for each frame. +

+
field
+

Output one frame for each field. +

+
+ +

The default value is field. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
tff
+

Assume the top field is first. +

+
bff
+

Assume the bottom field is first. +

+
auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following values: +

+
+
all
+

Deinterlace all frames, +

+
interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

Default value is ‘all’. +

+
+ + +
+

32.279.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

32.280 waveform

+

Video waveform monitor. +

+

The waveform monitor plots color component intensity. By default luminance +only. Each column of the waveform corresponds to a column of pixels in the +source video. +

+

It accepts the following options: +

+
+
mode, m
+

Can be either row, or column. Default is column. +In row mode, the graph on the left side represents color component value 0 and +the right side represents value = 255. In column mode, the top side represents +color component value = 0 and bottom side represents value = 255. +

+
+
intensity, i
+

Set intensity. Smaller values are useful to find out how many values of the same +luminance are distributed across input rows/columns. +Default value is 0.04. Allowed range is [0, 1]. +

+
+
mirror, r
+

Set mirroring mode. 0 means unmirrored, 1 means mirrored. +In mirrored mode, higher values will be represented on the left +side for row mode and at the top for column mode. Default is +1 (mirrored). +

+
+
display, d
+

Set display mode. +It accepts the following values: +

+
overlay
+

Presents information identical to that in the parade, except +that the graphs representing color components are superimposed directly +over one another. +

+

This display mode makes it easier to spot relative differences or similarities +in overlapping areas of the color components that are supposed to be identical, +such as neutral whites, grays, or blacks. +

+
+
stack
+

Display separate graph for the color components side by side in +row mode or one below the other in column mode. +

+
+
parade
+

Display separate graph for the color components side by side in +column mode or one below the other in row mode. +

+

Using this display mode makes it easy to spot color casts in the highlights +and shadows of an image, by comparing the contours of the top and the bottom +graphs of each waveform. Since whites, grays, and blacks are characterized +by exactly equal amounts of red, green, and blue, neutral areas of the picture +should display three waveforms of roughly equal width/height. If not, the +correction is easy to perform by making level adjustments the three waveforms. +

+
+

Default is stack. +

+
+
components, c
+

Set which color components to display. Default is 1, which means only luminance +or red color component if input is in RGB colorspace. If is set for example to +7 it will display all 3 (if) available color components. +

+
+
envelope, e
+
+
none
+

No envelope, this is default. +

+
+
instant
+

Instant envelope, minimum and maximum values presented in graph will be easily +visible even with small step value. +

+
+
peak
+

Hold minimum and maximum values presented in graph across time. This way you +can still spot out of range values without constantly looking at waveforms. +

+
+
peak+instant
+

Peak and instant envelope combined together. +

+
+ +
+
filter, f
+
+
lowpass
+

No filtering, this is default. +

+
+
flat
+

Luma and chroma combined together. +

+
+
aflat
+

Similar as above, but shows difference between blue and red chroma. +

+
+
xflat
+

Similar as above, but use different colors. +

+
+
yflat
+

Similar as above, but again with different colors. +

+
+
chroma
+

Displays only chroma. +

+
+
color
+

Displays actual color value on waveform. +

+
+
acolor
+

Similar as above, but with luma showing frequency of chroma values. +

+
+ +
+
graticule, g
+

Set which graticule to display. +

+
+
none
+

Do not display graticule. +

+
+
green
+

Display green graticule showing legal broadcast ranges. +

+
+
orange
+

Display orange graticule showing legal broadcast ranges. +

+
+
invert
+

Display invert graticule showing legal broadcast ranges. +

+
+ +
+
opacity, o
+

Set graticule opacity. +

+
+
flags, fl
+

Set graticule flags. +

+
+
numbers
+

Draw numbers above lines. By default enabled. +

+
+
dots
+

Draw dots instead of lines. +

+
+ +
+
scale, s
+

Set scale used for displaying graticule. +

+
+
digital
+
millivolts
+
ire
+
+

Default is digital. +

+
+
bgopacity, b
+

Set background opacity. +

+
+
tint0, t0
+
tint1, t1
+

Set tint for output. +Only used with lowpass filter and when display is not overlay and input +pixel formats are not RGB. +

+
+
fitmode, fm
+

Set sample aspect ratio of video output frames. +Can be used to configure waveform so it is not +streched too much in one of directions. +

+
+
none
+

Set sample aspect ration to 1/1. +

+
size
+

Set sample aspect ratio to match input size of video +

+
+

Default is ‘none’. +

+
+
input
+

Set input formats for filter to pick from. +Can be ‘all’, for selecting from all available formats, +or ‘first’, for selecting first available format. +Default is ‘first’. +

+
+ +
+
+

32.281 weave, doubleweave

+ +

The weave takes a field-based video input and join +each two sequential fields into single frame, producing a new double +height clip with half the frame rate and half the frame count. +

+

The doubleweave works same as weave but without +halving frame rate and frame count. +

+

It accepts the following option: +

+
+
first_field
+

Set first field. Available values are: +

+
+
top, t
+

Set the frame as top-field-first. +

+
+
bottom, b
+

Set the frame as bottom-field-first. +

+
+
+
+ + +
+

32.281.1 Examples

+ +
    +
  • Interlace video using select and separatefields filter: +
    +
    separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
    +
    +
+ +
+
+
+

32.282 xbr

+

Apply the xBR high-quality magnification filter which is designed for pixel +art. It follows a set of edge-detection rules, see +https://forums.libretro.com/t/xbr-algorithm-tutorial/123. +

+

It accepts the following option: +

+
+
n
+

Set the scaling dimension: 2 for 2xBR, 3 for +3xBR and 4 for 4xBR. +Default is 3. +

+
+ +
+
+

32.283 xcorrelate

+

Apply normalized cross-correlation between first and second input video stream. +

+

Second input video stream dimensions must be lower than first input video stream. +

+

The filter accepts the following options: +

+
+
planes
+

Set which planes to process. +

+
+
secondary
+

Set which secondary video frames will be processed from second input video stream, +can be first or all. Default is all. +

+
+ +

The xcorrelate filter also supports the framesync options. +

+
+
+

32.284 xfade

+ +

Apply cross fade from one input video stream to another input video stream. +The cross fade is applied for specified duration. +

+

Both inputs must be constant frame-rate and have the same resolution, pixel format, +frame rate and timebase. +

+

The filter accepts the following options: +

+
+
transition
+

Set one of available transition effects: +

+
+
custom
+
fade
+
wipeleft
+
wiperight
+
wipeup
+
wipedown
+
slideleft
+
slideright
+
slideup
+
slidedown
+
circlecrop
+
rectcrop
+
distance
+
fadeblack
+
fadewhite
+
radial
+
smoothleft
+
smoothright
+
smoothup
+
smoothdown
+
circleopen
+
circleclose
+
vertopen
+
vertclose
+
horzopen
+
horzclose
+
dissolve
+
pixelize
+
diagtl
+
diagtr
+
diagbl
+
diagbr
+
hlslice
+
hrslice
+
vuslice
+
vdslice
+
hblur
+
fadegrays
+
wipetl
+
wipetr
+
wipebl
+
wipebr
+
squeezeh
+
squeezev
+
zoomin
+
fadefast
+
fadeslow
+
hlwind
+
hrwind
+
vuwind
+
vdwind
+
+

Default transition effect is fade. +

+
+
duration
+

Set cross fade duration in seconds. +Range is 0 to 60 seconds. +Default duration is 1 second. +

+
+
offset
+

Set cross fade start relative to first input stream in seconds. +Default offset is 0. +

+
+
expr
+

Set expression for custom transition effect. +

+

The expressions can use the following variables and functions: +

+
+
X
+
Y
+

The coordinates of the current sample. +

+
+
W
+
H
+

The width and height of the image. +

+
+
P
+

Progress of transition effect. +

+
+
PLANE
+

Currently processed plane. +

+
+
A
+

Return value of first input at current location and plane. +

+
+
B
+

Return value of second input at current location and plane. +

+
+
a0(x, y)
+
a1(x, y)
+
a2(x, y)
+
a3(x, y)
+

Return the value of the pixel at location (x,y) of the +first/second/third/fourth component of first input. +

+
+
b0(x, y)
+
b1(x, y)
+
b2(x, y)
+
b3(x, y)
+

Return the value of the pixel at location (x,y) of the +first/second/third/fourth component of second input. +

+
+
+
+ + +
+

32.284.1 Examples

+ +
    +
  • Cross fade from one input video to another input video, with fade transition and duration of transition +of 2 seconds starting at offset of 5 seconds: +
    +
    ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
    +
    +
+ +
+
+
+

32.285 xmedian

+

Pick median pixels from several input videos. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of inputs. +Default is 3. Allowed range is from 3 to 255. +If number of inputs is even number, than result will be mean value between two median values. +

+
+
planes
+

Set which planes to filter. Default value is 15, by which all planes are processed. +

+
+
percentile
+

Set median percentile. Default value is 0.5. +Default value of 0.5 will pick always median values, while 0 will pick +minimum values, and 1 maximum values. +

+
+ + +
+

32.285.1 Commands

+ +

This filter supports all above options as commands, excluding option inputs. +

+
+
+
+

32.286 xstack

+

Stack video inputs into custom layout. +

+

All streams must be of same pixel format. +

+

The filter accepts the following options: +

+
+
inputs
+

Set number of input streams. Default is 2. +

+
+
layout
+

Specify layout of inputs. +This option requires the desired layout configuration to be explicitly set by the user. +This sets position of each video input in output. Each input +is separated by ’|’. +The first number represents the column, and the second number represents the row. +Numbers start at 0 and are separated by ’_’. Optionally one can use wX and hX, +where X is video input from which to take width or height. +Multiple values can be used when separated by ’+’. In such +case values are summed together. +

+

Note that if inputs are of different sizes gaps may appear, as not all of +the output video frame will be filled. Similarly, videos can overlap each +other if their position doesn’t leave enough space for the full frame of +adjoining videos. +

+

For 2 inputs, a default layout of 0_0|w0_0 (equivalent to +grid=2x1) is set. In all other cases, a layout or a grid must be set by +the user. Either grid or layout can be specified at a time. +Specifying both will result in an error. +

+
+
grid
+

Specify a fixed size grid of inputs. +This option is used to create a fixed size grid of the input streams. Set the +grid size in the form COLUMNSxROWS. There must be ROWS * COLUMNS +input streams and they will be arranged as a grid with ROWS rows and +COLUMNS columns. When using this option, each input stream within a row +must have the same height and all the rows must have the same width. +

+

If grid is set, then inputs option is ignored and is implicitly +set to ROWS * COLUMNS. +

+

For 2 inputs, a default grid of 2x1 (equivalent to +layout=0_0|w0_0) is set. In all other cases, a layout or a grid must be +set by the user. Either grid or layout can be specified at a time. +Specifying both will result in an error. +

+
+
shortest
+

If set to 1, force the output to terminate when the shortest input +terminates. Default value is 0. +

+
+
fill
+

If set to valid color, all unused pixels will be filled with that color. +By default fill is set to none, so it is disabled. +

+
+ + +
+

32.286.1 Examples

+ +
    +
  • Display 4 inputs into 2x2 grid. + +

    Layout: +

    +
    input1(0, 0)  | input3(w0, 0)
    +input2(0, h0) | input4(w0, h0)
    +
    + +
    +
    xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
    +
    + +

    Note that if inputs are of different sizes, gaps or overlaps may occur. +

    +
  • Display 4 inputs into 1x4 grid. + +

    Layout: +

    +
    input1(0, 0)
    +input2(0, h0)
    +input3(0, h0+h1)
    +input4(0, h0+h1+h2)
    +
    + +
    +
    xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
    +
    + +

    Note that if inputs are of different widths, unused space will appear. +

    +
  • Display 9 inputs into 3x3 grid. + +

    Layout: +

    +
    input1(0, 0)       | input4(w0, 0)      | input7(w0+w3, 0)
    +input2(0, h0)      | input5(w0, h0)     | input8(w0+w3, h0)
    +input3(0, h0+h1)   | input6(w0, h0+h1)  | input9(w0+w3, h0+h1)
    +
    + +
    +
    xstack=inputs=9:layout=0_0|0_h0|0_h0+h1|w0_0|w0_h0|w0_h0+h1|w0+w3_0|w0+w3_h0|w0+w3_h0+h1
    +
    + +

    Note that if inputs are of different sizes, gaps or overlaps may occur. +

    +
  • Display 16 inputs into 4x4 grid. + +

    Layout: +

    +
    input1(0, 0)       | input5(w0, 0)       | input9 (w0+w4, 0)       | input13(w0+w4+w8, 0)
    +input2(0, h0)      | input6(w0, h0)      | input10(w0+w4, h0)      | input14(w0+w4+w8, h0)
    +input3(0, h0+h1)   | input7(w0, h0+h1)   | input11(w0+w4, h0+h1)   | input15(w0+w4+w8, h0+h1)
    +input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
    +
    + +
    +
    xstack=inputs=16:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0+w4_0|
    +w0+w4_h0|w0+w4_h0+h1|w0+w4_h0+h1+h2|w0+w4+w8_0|w0+w4+w8_h0|w0+w4+w8_h0+h1|w0+w4+w8_h0+h1+h2
    +
    + +

    Note that if inputs are of different sizes, gaps or overlaps may occur. +

    +
+ +
+
+
+

32.287 yadif

+ +

Deinterlace the input video ("yadif" means "yet another deinterlacing +filter"). +

+

It accepts the following parameters: +

+ +
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
0, send_frame
+

Output one frame for each frame. +

+
1, send_field
+

Output one frame for each field. +

+
2, send_frame_nospatial
+

Like send_frame, but it skips the spatial interlacing check. +

+
3, send_field_nospatial
+

Like send_field, but it skips the spatial interlacing check. +

+
+ +

The default value is send_frame. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
0, tff
+

Assume the top field is first. +

+
1, bff
+

Assume the bottom field is first. +

+
-1, auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
0, all
+

Deinterlace all frames. +

+
1, interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+ +
+
+

32.288 yadif_cuda

+ +

Deinterlace the input video using the yadif algorithm, but implemented +in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec +and/or nvenc. +

+

It accepts the following parameters: +

+ +
+
mode
+

The interlacing mode to adopt. It accepts one of the following values: +

+
+
0, send_frame
+

Output one frame for each frame. +

+
1, send_field
+

Output one frame for each field. +

+
2, send_frame_nospatial
+

Like send_frame, but it skips the spatial interlacing check. +

+
3, send_field_nospatial
+

Like send_field, but it skips the spatial interlacing check. +

+
+ +

The default value is send_frame. +

+
+
parity
+

The picture field parity assumed for the input interlaced video. It accepts one +of the following values: +

+
+
0, tff
+

Assume the top field is first. +

+
1, bff
+

Assume the bottom field is first. +

+
-1, auto
+

Enable automatic detection of field parity. +

+
+ +

The default value is auto. +If the interlacing is unknown or the decoder does not export this information, +top field first will be assumed. +

+
+
deint
+

Specify which frames to deinterlace. Accepts one of the following +values: +

+
+
0, all
+

Deinterlace all frames. +

+
1, interlaced
+

Only deinterlace frames marked as interlaced. +

+
+ +

The default value is all. +

+
+ +
+
+

32.289 yaepblur

+ +

Apply blur filter while preserving edges ("yaepblur" means "yet another edge preserving blur filter"). +The algorithm is described in +"J. S. Lee, Digital image enhancement and noise filtering by use of local statistics, IEEE Trans. Pattern Anal. Mach. Intell. PAMI-2, 1980." +

+

It accepts the following parameters: +

+
+
radius, r
+

Set the window radius. Default value is 3. +

+
+
planes, p
+

Set which planes to filter. Default is only the first plane. +

+
+
sigma, s
+

Set blur strength. Default value is 128. +

+
+ + +
+

32.289.1 Commands

+

This filter supports same commands as options. +

+
+
+
+

32.290 zoompan

+ +

Apply Zoom & Pan effect. +

+

This filter accepts the following options: +

+
+
zoom, z
+

Set the zoom expression. Range is 1-10. Default is 1. +

+
+
x
+
y
+

Set the x and y expression. Default is 0. +

+
+
d
+

Set the duration expression in number of frames. +This sets for how many number of frames effect will last for +single input image. Default is 90. +

+
+
s
+

Set the output image size, default is ’hd720’. +

+
+
fps
+

Set the output frame rate, default is ’25’. +

+
+ +

Each expression can contain the following constants: +

+
+
in_w, iw
+

Input width. +

+
+
in_h, ih
+

Input height. +

+
+
out_w, ow
+

Output width. +

+
+
out_h, oh
+

Output height. +

+
+
in
+

Input frame count. +

+
+
on
+

Output frame count. +

+
+
in_time, it
+

The input timestamp expressed in seconds. It’s NAN if the input timestamp is unknown. +

+
+
out_time, time, ot
+

The output timestamp expressed in seconds. +

+
+
x
+
y
+

Last calculated ’x’ and ’y’ position from ’x’ and ’y’ expression +for current input frame. +

+
+
px
+
py
+

’x’ and ’y’ of last output frame of previous input frame or 0 when there was +not yet such frame (first input frame). +

+
+
zoom
+

Last calculated zoom from ’z’ expression for current input frame. +

+
+
pzoom
+

Last calculated zoom of last output frame of previous input frame. +

+
+
duration
+

Number of output frames for current input frame. Calculated from ’d’ expression +for each input frame. +

+
+
pduration
+

number of output frames created for previous input frame +

+
+
a
+

Rational number: input width / input height +

+
+
sar
+

sample aspect ratio +

+
+
dar
+

display aspect ratio +

+
+
+ + +
+

32.290.1 Examples

+ +
    +
  • Zoom in up to 1.5x and pan at same time to some spot near center of picture: +
    +
    zoompan=z='min(zoom+0.0015,1.5)':d=700:x='if(gte(zoom,1.5),x,x+1/a)':y='if(gte(zoom,1.5),y,y+1)':s=640x360
    +
    + +
  • Zoom in up to 1.5x and pan always at center of picture: +
    +
    zoompan=z='min(zoom+0.0015,1.5)':d=700:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
    +
    + +
  • Same as above but without pausing: +
    +
    zoompan=z='min(max(zoom,pzoom)+0.0015,1.5)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
    +
    + +
  • Zoom in 2x into center of picture only for the first second of the input video: +
    +
    zoompan=z='if(between(in_time,0,1),2,1)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
    +
    + +
+ +
+
+
+

32.291 zscale

+

Scale (resize) the input video, using the z.lib library: +https://github.com/sekrit-twc/zimg. To enable compilation of this +filter, you need to configure FFmpeg with --enable-libzimg. +

+

The zscale filter forces the output display aspect ratio to be the same +as the input, by changing the output sample aspect ratio. +

+

If the input image format is different from the format requested by +the next filter, the zscale filter will convert the input to the +requested format. +

+ +
+

32.291.1 Options

+

The filter accepts the following options. +

+
+
width, w
+
height, h
+

Set the output video dimension expression. Default value is the input +dimension. +

+

If the width or w value is 0, the input width is used for +the output. If the height or h value is 0, the input height +is used for the output. +

+

If one and only one of the values is -n with n >= 1, the zscale filter +will use a value that maintains the aspect ratio of the input image, +calculated from the other specified dimension. After that it will, +however, make sure that the calculated dimension is divisible by n and +adjust the value if necessary. +

+

If both values are -n with n >= 1, the behavior will be identical to +both values being set to 0 as previously detailed. +

+

See below for the list of accepted constants for use in the dimension +expression. +

+
+
size, s
+

Set the video size. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
dither, d
+

Set the dither type. +

+

Possible values are: +

+
none
+
ordered
+
random
+
error_diffusion
+
+ +

Default is none. +

+
+
filter, f
+

Set the resize filter type. +

+

Possible values are: +

+
point
+
bilinear
+
bicubic
+
spline16
+
spline36
+
lanczos
+
+ +

Default is bilinear. +

+
+
range, r
+

Set the color range. +

+

Possible values are: +

+
input
+
limited
+
full
+
+ +

Default is same as input. +

+
+
primaries, p
+

Set the color primaries. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
170m
+
240m
+
2020
+
+ +

Default is same as input. +

+
+
transfer, t
+

Set the transfer characteristics. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
601
+
linear
+
2020_10
+
2020_12
+
smpte2084
+
iec61966-2-1
+
arib-std-b67
+
+ +

Default is same as input. +

+
+
matrix, m
+

Set the colorspace matrix. +

+

Possible value are: +

+
input
+
709
+
unspecified
+
470bg
+
170m
+
2020_ncl
+
2020_cl
+
+ +

Default is same as input. +

+
+
rangein, rin
+

Set the input color range. +

+

Possible values are: +

+
input
+
limited
+
full
+
+ +

Default is same as input. +

+
+
primariesin, pin
+

Set the input color primaries. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
170m
+
240m
+
2020
+
+ +

Default is same as input. +

+
+
transferin, tin
+

Set the input transfer characteristics. +

+

Possible values are: +

+
input
+
709
+
unspecified
+
601
+
linear
+
2020_10
+
2020_12
+
+ +

Default is same as input. +

+
+
matrixin, min
+

Set the input colorspace matrix. +

+

Possible value are: +

+
input
+
709
+
unspecified
+
470bg
+
170m
+
2020_ncl
+
2020_cl
+
+ +
+
chromal, c
+

Set the output chroma location. +

+

Possible values are: +

+
input
+
left
+
center
+
topleft
+
top
+
bottomleft
+
bottom
+
+ +
+
chromalin, cin
+

Set the input chroma location. +

+

Possible values are: +

+
input
+
left
+
center
+
topleft
+
top
+
bottomleft
+
bottom
+
+ +
+
npl
+

Set the nominal peak luminance. +

+
+
param_a
+

Parameter A for scaling filters. Parameter "b" for bicubic, and the number of +filter taps for lanczos. +

+
+
param_b
+

Parameter B for scaling filters. Parameter "c" for bicubic. +

+
+ +

The values of the w and h options are expressions +containing the following constants: +

+
+
in_w
+
in_h
+

The input width and height +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output (scaled) width and height +

+
+
ow
+
oh
+

These are the same as out_w and out_h +

+
+
a
+

The same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

The input display aspect ratio. Calculated from (iw / ih) * sar. +

+
+
hsub
+
vsub
+

horizontal and vertical input chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+
ohsub
+
ovsub
+

horizontal and vertical output chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ +
+
+

32.291.2 Commands

+ +

This filter supports the following commands: +

+
width, w
+
height, h
+

Set the output video dimension expression. +The command accepts the same syntax of the corresponding option. +

+

If the specified expression is not valid, it is kept at its current +value. +

+
+ + +
+
+
+
+

33 OpenCL Video Filters

+ +

Below is a description of the currently available OpenCL video filters. +

+

To enable compilation of these filters you need to configure FFmpeg with +--enable-opencl. +

+

Running OpenCL filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph. +

+
-init_hw_device opencl[=name][:device[,key=value...]]
+

Initialise a new hardware device of type opencl called name, using the +given device parameters. +

+
+
-filter_hw_device name
+

Pass the hardware device called name to all filters in any filter graph. +

+
+
+ +

For more detailed information see https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options +

+
    +
  • Example of choosing the first device on the second platform and running avgblur_opencl filter with default parameters on it. +
    +
    -init_hw_device opencl=gpu:1.0 -filter_hw_device gpu -i INPUT -vf "hwupload, avgblur_opencl, hwdownload" OUTPUT
    +
    +
+ +

Since OpenCL filters are not able to access frame data in normal memory, all frame data needs to be uploaded(hwupload) to hardware surfaces connected to the appropriate device before being used and then downloaded(hwdownload) back to normal memory. Note that hwupload will upload to a surface with the same layout as the software frame, so it may be necessary to add a format filter immediately before to get the input into the right format and hwdownload does not support all formats on the output - it may be necessary to insert an additional format filter immediately following in the graph to get the output in a supported format. +

+ +
+

33.1 avgblur_opencl

+ +

Apply average blur filter. +

+

The filter accepts the following options: +

+
+
sizeX
+

Set horizontal radius size. +Range is [1, 1024] and default value is 1. +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
sizeY
+

Set vertical radius size. Range is [1, 1024] and default value is 0. If zero, sizeX value will be used. +

+
+ + +
+

33.1.1 Example

+ +
    +
  • Apply average blur filter with horizontal and vertical size of 3, setting each pixel of the output to the average value of the 7x7 region centered on it in the input. For pixels on the edges of the image, the region does not extend beyond the image boundaries, and so out-of-range coordinates are not used in the calculations. +
    +
    -i INPUT -vf "hwupload, avgblur_opencl=3, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

33.2 boxblur_opencl

+ +

Apply a boxblur algorithm to the input video. +

+

It accepts the following parameters: +

+
+
luma_radius, lr
+
luma_power, lp
+
chroma_radius, cr
+
chroma_power, cp
+
alpha_radius, ar
+
alpha_power, ap
+
+ +

A description of the accepted options follows. +

+
+
luma_radius, lr
+
chroma_radius, cr
+
alpha_radius, ar
+

Set an expression for the box radius in pixels used for blurring the +corresponding input plane. +

+

The radius value must be a non-negative number, and must not be +greater than the value of the expression min(w,h)/2 for the +luma and alpha planes, and of min(cw,ch)/2 for the chroma +planes. +

+

Default value for luma_radius is "2". If not specified, +chroma_radius and alpha_radius default to the +corresponding value set for luma_radius. +

+

The expressions can contain the following constants: +

+
w
+
h
+

The input width and height in pixels. +

+
+
cw
+
ch
+

The input chroma image width and height in pixels. +

+
+
hsub
+
vsub
+

The horizontal and vertical chroma subsample values. For example, for the +pixel format "yuv422p", hsub is 2 and vsub is 1. +

+
+ +
+
luma_power, lp
+
chroma_power, cp
+
alpha_power, ap
+

Specify how many times the boxblur filter is applied to the +corresponding plane. +

+

Default value for luma_power is 2. If not specified, +chroma_power and alpha_power default to the +corresponding value set for luma_power. +

+

A value of 0 will disable the effect. +

+
+ + +
+

33.2.1 Examples

+ +

Apply boxblur filter, setting each pixel of the output to the average value of box-radiuses luma_radius, chroma_radius, alpha_radius for each plane respectively. The filter will apply luma_power, chroma_power, alpha_power times onto the corresponding plane. For pixels on the edges of the image, the radius does not extend beyond the image boundaries, and so out-of-range coordinates are not used in the calculations. +

+
    +
  • Apply a boxblur filter with the luma, chroma, and alpha radius +set to 2 and luma, chroma, and alpha power set to 3. The filter will run 3 times with box-radius set to 2 for every plane of the image. +
    +
    -i INPUT -vf "hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload" OUTPUT
    +-i INPUT -vf "hwupload, boxblur_opencl=2:3, hwdownload" OUTPUT
    +
    + +
  • Apply a boxblur filter with luma radius set to 2, luma_power to 1, chroma_radius to 4, chroma_power to 5, alpha_radius to 3 and alpha_power to 7. + +

    For the luma plane, a 2x2 box radius will be run once. +

    +

    For the chroma plane, a 4x4 box radius will be run 5 times. +

    +

    For the alpha plane, a 3x3 box radius will be run 7 times. +

    +
    -i INPUT -vf "hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

33.3 colorkey_opencl

+

RGB colorspace color keying. +

+

The filter accepts the following options: +

+
+
color
+

The color which will be replaced with transparency. +

+
+
similarity
+

Similarity percentage with the key color. +

+

0.01 matches only the exact key color, while 1.0 matches everything. +

+
+
blend
+

Blend percentage. +

+

0.0 makes pixels either fully transparent, or not transparent at all. +

+

Higher values result in semi-transparent pixels, with a higher transparency +the more similar the pixels color is to the key color. +

+
+ + +
+

33.3.1 Examples

+ +
    +
  • Make every semi-green pixel in the input transparent with some slight blending: +
    +
    -i INPUT -vf "hwupload, colorkey_opencl=green:0.3:0.1, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

33.4 convolution_opencl

+ +

Apply convolution of 3x3, 5x5, 7x7 matrix. +

+

The filter accepts the following options: +

+
+
0m
+
1m
+
2m
+
3m
+

Set matrix for each plane. +Matrix is sequence of 9, 25 or 49 signed numbers. +Default value for each plane is 0 0 0 0 1 0 0 0 0. +

+
+
0rdiv
+
1rdiv
+
2rdiv
+
3rdiv
+

Set multiplier for calculated value for each plane. +If unset or 0, it will be sum of all matrix elements. +The option value must be a float number greater or equal to 0.0. Default value is 1.0. +

+
+
0bias
+
1bias
+
2bias
+
3bias
+

Set bias for each plane. This value is added to the result of the multiplication. +Useful for making the overall image brighter or darker. +The option value must be a float number greater or equal to 0.0. Default value is 0.0. +

+
+
+ + +
+

33.4.1 Examples

+ +
    +
  • Apply sharpen: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0, hwdownload" OUTPUT
    +
    + +
  • Apply blur: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9, hwdownload" OUTPUT
    +
    + +
  • Apply edge enhance: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128, hwdownload" OUTPUT
    +
    + +
  • Apply edge detect: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128, hwdownload" OUTPUT
    +
    + +
  • Apply laplacian edge detector which includes diagonals: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0, hwdownload" OUTPUT
    +
    + +
  • Apply emboss: +
    +
    -i INPUT -vf "hwupload, convolution_opencl=-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

33.5 erosion_opencl

+ +

Apply erosion effect to the video. +

+

This filter replaces the pixel by the local(3x3) minimum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane. Range is [0, 65535] and default value is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. +Range is [0, 255] and default value is 255, i.e. all eight pixels are used. +

+

Flags to local 3x3 coordinates region centered on x: +

+

1 2 3 +

+

4 x 5 +

+

6 7 8 +

+
+ + +
+

33.5.1 Example

+ +
    +
  • Apply erosion filter with threshold0 set to 30, threshold1 set 40, threshold2 set to 50 and coordinates set to 231, setting each pixel of the output to the local minimum between pixels: 1, 2, 3, 6, 7, 8 of the 3x3 region centered on it in the input. If the difference between input pixel and local minimum is more then threshold of the corresponding plane, output pixel will be set to input pixel - threshold of corresponding plane. +
    +
    -i INPUT -vf "hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

33.6 deshake_opencl

+

Feature-point based video stabilization filter. +

+

The filter accepts the following options: +

+
+
tripod
+

Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to 0. +

+
+
debug
+

Whether or not additional debug info should be displayed, both in the processed output and in the console. +

+

Note that in order to see console debug output you will also need to pass -v verbose to ffmpeg. +

+

Viewing point matches in the output video is only supported for RGB input. +

+

Defaults to 0. +

+
+
adaptive_crop
+

Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels. +

+

Defaults to 1. +

+
+
refine_features
+

Whether or not feature points should be refined at a sub-pixel level. +

+

This can be turned off for a slight performance gain at the cost of precision. +

+

Defaults to 1. +

+
+
smooth_strength
+

The strength of the smoothing applied to the camera path from 0.0 to 1.0. +

+

1.0 is the maximum smoothing strength while values less than that result in less smoothing. +

+

0.0 causes the filter to adaptively choose a smoothing strength on a per-frame basis. +

+

Defaults to 0.0. +

+
+
smooth_window_multiplier
+

Controls the size of the smoothing window (the number of frames buffered to determine motion information from). +

+

The size of the smoothing window is determined by multiplying the framerate of the video by this number. +

+

Acceptable values range from 0.1 to 10.0. +

+

Larger values increase the amount of motion data available for determining how to smooth the camera path, +potentially improving smoothness, but also increase latency and memory usage. +

+

Defaults to 2.0. +

+
+
+ + +
+

33.6.1 Examples

+ +
    +
  • Stabilize a video with a fixed, medium smoothing strength: +
    +
    -i INPUT -vf "hwupload, deshake_opencl=smooth_strength=0.5, hwdownload" OUTPUT
    +
    + +
  • Stabilize a video with debugging (both in console and in rendered video): +
    +
    -i INPUT -filter_complex "[0:v]format=rgba, hwupload, deshake_opencl=debug=1, hwdownload, format=rgba, format=yuv420p" -v verbose OUTPUT
    +
    +
+ +
+
+
+

33.7 dilation_opencl

+ +

Apply dilation effect to the video. +

+

This filter replaces the pixel by the local(3x3) maximum. +

+

It accepts the following options: +

+
+
threshold0
+
threshold1
+
threshold2
+
threshold3
+

Limit the maximum change for each plane. Range is [0, 65535] and default value is 65535. +If 0, plane will remain unchanged. +

+
+
coordinates
+

Flag which specifies the pixel to refer to. +Range is [0, 255] and default value is 255, i.e. all eight pixels are used. +

+

Flags to local 3x3 coordinates region centered on x: +

+

1 2 3 +

+

4 x 5 +

+

6 7 8 +

+
+ + +
+

33.7.1 Example

+ +
    +
  • Apply dilation filter with threshold0 set to 30, threshold1 set 40, threshold2 set to 50 and coordinates set to 231, setting each pixel of the output to the local maximum between pixels: 1, 2, 3, 6, 7, 8 of the 3x3 region centered on it in the input. If the difference between input pixel and local maximum is more then threshold of the corresponding plane, output pixel will be set to input pixel + threshold of corresponding plane. +
    +
    -i INPUT -vf "hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

33.8 nlmeans_opencl

+ +

Non-local Means denoise filter through OpenCL, this filter accepts same options as nlmeans. +

+
+
+

33.9 overlay_opencl

+ +

Overlay one video on top of another. +

+

It takes two inputs and has one output. The first input is the "main" video on which the second input is overlaid. +This filter requires same memory layout for all the inputs. So, format conversion may be needed. +

+

The filter accepts the following options: +

+
+
x
+

Set the x coordinate of the overlaid video on the main video. +Default value is 0. +

+
+
y
+

Set the y coordinate of the overlaid video on the main video. +Default value is 0. +

+
+
+ + +
+

33.9.1 Examples

+ +
    +
  • Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs are yuv420p format. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_opencl, hwdownload" OUTPUT
    +
    +
  • The inputs have same memory layout for color channels , the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_opencl, hwdownload" OUTPUT
    +
    + +
+ +
+
+
+

33.10 pad_opencl

+ +

Add paddings to the input image, and place the original input at the +provided x, y coordinates. +

+

It accepts the following options: +

+
+
width, w
+
height, h
+

Specify an expression for the size of the output image with the +paddings added. If the value for width or height is 0, the +corresponding input size is used for the output. +

+

The width expression can reference the value set by the +height expression, and vice versa. +

+

The default value of width and height is 0. +

+
+
x
+
y
+

Specify the offsets to place the input image at within the padded area, +with respect to the top/left border of the output image. +

+

The x expression can reference the value set by the y +expression, and vice versa. +

+

The default value of x and y is 0. +

+

If x or y evaluate to a negative number, they’ll be changed +so the input image is centered on the padded area. +

+
+
color
+

Specify the color of the padded area. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. +

+
+
aspect
+

Pad to an aspect instead to a resolution. +

+
+ +

The value for the width, height, x, and y +options are expressions containing the following constants: +

+
+
in_w
+
in_h
+

The input video width and height. +

+
+
iw
+
ih
+

These are the same as in_w and in_h. +

+
+
out_w
+
out_h
+

The output width and height (the size of the padded area), as +specified by the width and height expressions. +

+
+
ow
+
oh
+

These are the same as out_w and out_h. +

+
+
x
+
y
+

The x and y offsets as specified by the x and y +expressions, or NAN if not yet specified. +

+
+
a
+

same as iw / ih +

+
+
sar
+

input sample aspect ratio +

+
+
dar
+

input display aspect ratio, it is the same as (iw / ih) * sar +

+
+ +
+
+

33.11 prewitt_opencl

+ +

Apply the Prewitt operator (https://en.wikipedia.org/wiki/Prewitt_operator) to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +Range is [0.0, 65535] and default value is 1.0. +

+
+
delta
+

Set value which will be added to filtered result. +Range is [-65535, 65535] and default value is 0.0. +

+
+ + +
+

33.11.1 Example

+ +
    +
  • Apply the Prewitt operator with scale set to 2 and delta set to 10. +
    +
    -i INPUT -vf "hwupload, prewitt_opencl=scale=2:delta=10, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

33.12 program_opencl

+ +

Filter video using an OpenCL program. +

+
+
source
+

OpenCL program source file. +

+
+
kernel
+

Kernel name in program. +

+
+
inputs
+

Number of inputs to the filter. Defaults to 1. +

+
+
size, s
+

Size of output frames. Defaults to the same as the first input. +

+
+
+ +

The program_opencl filter also supports the framesync options. +

+

The program source file must contain a kernel function with the given name, +which will be run once for each plane of the output. Each run on a plane +gets enqueued as a separate 2D global NDRange with one work-item for each +pixel to be generated. The global ID offset for each work-item is therefore +the coordinates of a pixel in the destination image. +

+

The kernel function needs to take the following arguments: +

    +
  • Destination image, __write_only image2d_t. + +

    This image will become the output; the kernel should write all of it. +

  • Frame index, unsigned int. + +

    This is a counter starting from zero and increasing by one for each frame. +

  • Source images, __read_only image2d_t. + +

    These are the most recent images on each input. The kernel may read from +them to generate the output, but they can’t be written to. +

+ +

Example programs: +

+
    +
  • Copy the input to the output (output must be the same size as the input). +
    __kernel void copy(__write_only image2d_t destination,
    +                   unsigned int index,
    +                   __read_only  image2d_t source)
    +{
    +    const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
    +
    +    int2 location = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float4 value = read_imagef(source, sampler, location);
    +
    +    write_imagef(destination, location, value);
    +}
    +
    +
  • Apply a simple transformation, rotating the input by an amount increasing +with the index counter. Pixel values are linearly interpolated by the +sampler, and the output need not have the same dimensions as the input. +
    __kernel void rotate_image(__write_only image2d_t dst,
    +                           unsigned int index,
    +                           __read_only  image2d_t src)
    +{
    +    const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
    +                               CLK_FILTER_LINEAR);
    +
    +    float angle = (float)index / 100.0f;
    +
    +    float2 dst_dim = convert_float2(get_image_dim(dst));
    +    float2 src_dim = convert_float2(get_image_dim(src));
    +
    +    float2 dst_cen = dst_dim / 2.0f;
    +    float2 src_cen = src_dim / 2.0f;
    +
    +    int2   dst_loc = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float2 dst_pos = convert_float2(dst_loc) - dst_cen;
    +    float2 src_pos = {
    +        cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
    +        sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
    +    };
    +    src_pos = src_pos * src_dim / dst_dim;
    +
    +    float2 src_loc = src_pos + src_cen;
    +
    +    if (src_loc.x < 0.0f      || src_loc.y < 0.0f ||
    +        src_loc.x > src_dim.x || src_loc.y > src_dim.y)
    +        write_imagef(dst, dst_loc, 0.5f);
    +    else
    +        write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
    +}
    +
    +
  • Blend two inputs together, with the amount of each input used varying +with the index counter. +
    __kernel void blend_images(__write_only image2d_t dst,
    +                           unsigned int index,
    +                           __read_only  image2d_t src1,
    +                           __read_only  image2d_t src2)
    +{
    +    const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
    +                               CLK_FILTER_LINEAR);
    +
    +    float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
    +
    +    int2  dst_loc = (int2)(get_global_id(0), get_global_id(1));
    +    int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
    +    int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
    +
    +    float4 val1 = read_imagef(src1, sampler, src1_loc);
    +    float4 val2 = read_imagef(src2, sampler, src2_loc);
    +
    +    write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
    +}
    +
    +
+ +
+
+

33.13 remap_opencl

+ +

Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream. +

+

Destination pixel at position (X, Y) will be picked from source (x, y) position +where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero +value for pixel will be used for destination pixel. +

+

Xmap and Ymap input video streams must be of same dimensions. Output video stream +will have Xmap/Ymap video stream dimensions. +Xmap and Ymap input video streams are 32bit float pixel format, single channel. +

+
+
interp
+

Specify interpolation used for remapping of pixels. +Allowed values are near and linear. +Default value is linear. +

+
+
fill
+

Specify the color of the unmapped pixels. For the syntax of this option, +check the (ffmpeg-utils)"Color" section in the ffmpeg-utils +manual. Default color is black. +

+
+ +
+
+

33.14 roberts_opencl

+

Apply the Roberts cross operator (https://en.wikipedia.org/wiki/Roberts_cross) to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +Range is [0.0, 65535] and default value is 1.0. +

+
+
delta
+

Set value which will be added to filtered result. +Range is [-65535, 65535] and default value is 0.0. +

+
+ + +
+

33.14.1 Example

+ +
    +
  • Apply the Roberts cross operator with scale set to 2 and delta set to 10 +
    +
    -i INPUT -vf "hwupload, roberts_opencl=scale=2:delta=10, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

33.15 sobel_opencl

+ +

Apply the Sobel operator (https://en.wikipedia.org/wiki/Sobel_operator) to input video stream. +

+

The filter accepts the following option: +

+
+
planes
+

Set which planes to filter. Default value is 0xf, by which all planes are processed. +

+
+
scale
+

Set value which will be multiplied with filtered result. +Range is [0.0, 65535] and default value is 1.0. +

+
+
delta
+

Set value which will be added to filtered result. +Range is [-65535, 65535] and default value is 0.0. +

+
+ + +
+

33.15.1 Example

+ +
    +
  • Apply sobel operator with scale set to 2 and delta set to 10 +
    +
    -i INPUT -vf "hwupload, sobel_opencl=scale=2:delta=10, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

33.16 tonemap_opencl

+ +

Perform HDR(PQ/HLG) to SDR conversion with tone-mapping. +

+

It accepts the following parameters: +

+
+
tonemap
+

Specify the tone-mapping operator to be used. Same as tonemap option in tonemap. +

+
+
param
+

Tune the tone mapping algorithm. same as param option in tonemap. +

+
+
desat
+

Apply desaturation for highlights that exceed this level of brightness. The +higher the parameter, the more color information will be preserved. This +setting helps prevent unnaturally blown-out colors for super-highlights, by +(smoothly) turning into white instead. This makes images feel more natural, +at the cost of reducing information about out-of-range colors. +

+

The default value is 0.5, and the algorithm here is a little different from +the cpu version tonemap currently. A setting of 0.0 disables this option. +

+
+
threshold
+

The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold +is used to detect whether the scene has changed or not. If the distance between +the current frame average brightness and the current running average exceeds +a threshold value, we would re-calculate scene average and peak brightness. +The default value is 0.2. +

+
+
format
+

Specify the output pixel format. +

+

Currently supported formats are: +

+
p010
+
nv12
+
+ +
+
range, r
+

Set the output color range. +

+

Possible values are: +

+
tv/mpeg
+
pc/jpeg
+
+ +

Default is same as input. +

+
+
primaries, p
+

Set the output color primaries. +

+

Possible values are: +

+
bt709
+
bt2020
+
+ +

Default is same as input. +

+
+
transfer, t
+

Set the output transfer characteristics. +

+

Possible values are: +

+
bt709
+
bt2020
+
+ +

Default is bt709. +

+
+
matrix, m
+

Set the output colorspace matrix. +

+

Possible value are: +

+
bt709
+
bt2020
+
+ +

Default is same as input. +

+
+
+ + +
+

33.16.1 Example

+ +
    +
  • Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator. +
    +
    -i INPUT -vf "format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010" OUTPUT
    +
    +
+ +
+
+
+

33.17 unsharp_opencl

+ +

Sharpen or blur the input video. +

+

It accepts the following parameters: +

+
+
luma_msize_x, lx
+

Set the luma matrix horizontal size. +Range is [1, 23] and default value is 5. +

+
+
luma_msize_y, ly
+

Set the luma matrix vertical size. +Range is [1, 23] and default value is 5. +

+
+
luma_amount, la
+

Set the luma effect strength. +Range is [-10, 10] and default value is 1.0. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+
+
chroma_msize_x, cx
+

Set the chroma matrix horizontal size. +Range is [1, 23] and default value is 5. +

+
+
chroma_msize_y, cy
+

Set the chroma matrix vertical size. +Range is [1, 23] and default value is 5. +

+
+
chroma_amount, ca
+

Set the chroma effect strength. +Range is [-10, 10] and default value is 0.0. +

+

Negative values will blur the input video, while positive values will +sharpen it, a value of zero will disable the effect. +

+
+
+ +

All parameters are optional and default to the equivalent of the +string ’5:5:1.0:5:5:0.0’. +

+ +
+

33.17.1 Examples

+ +
    +
  • Apply strong luma sharpen effect: +
    +
    -i INPUT -vf "hwupload, unsharp_opencl=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5, hwdownload" OUTPUT
    +
    + +
  • Apply a strong blur of both luma and chroma parameters: +
    +
    -i INPUT -vf "hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload" OUTPUT
    +
    +
+ +
+
+
+

33.18 xfade_opencl

+ +

Cross fade two videos with custom transition effect by using OpenCL. +

+

It accepts the following options: +

+
+
transition
+

Set one of possible transition effects. +

+
+
custom
+

Select custom transition effect, the actual transition description +will be picked from source and kernel options. +

+
+
fade
+
wipeleft
+
wiperight
+
wipeup
+
wipedown
+
slideleft
+
slideright
+
slideup
+
slidedown
+
+

Default transition is fade. +

+
+ +
+
source
+

OpenCL program source file for custom transition. +

+
+
kernel
+

Set name of kernel to use for custom transition from program source file. +

+
+
duration
+

Set duration of video transition. +

+
+
offset
+

Set time of start of transition relative to first video. +

+
+ +

The program source file must contain a kernel function with the given name, +which will be run once for each plane of the output. Each run on a plane +gets enqueued as a separate 2D global NDRange with one work-item for each +pixel to be generated. The global ID offset for each work-item is therefore +the coordinates of a pixel in the destination image. +

+

The kernel function needs to take the following arguments: +

    +
  • Destination image, __write_only image2d_t. + +

    This image will become the output; the kernel should write all of it. +

    +
  • First Source image, __read_only image2d_t. +Second Source image, __read_only image2d_t. + +

    These are the most recent images on each input. The kernel may read from +them to generate the output, but they can’t be written to. +

    +
  • Transition progress, float. This value is always between 0 and 1 inclusive. +
+ +

Example programs: +

+
    +
  • Apply dots curtain transition effect: +
    __kernel void blend_images(__write_only image2d_t dst,
    +                           __read_only  image2d_t src1,
    +                           __read_only  image2d_t src2,
    +                           float progress)
    +{
    +    const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
    +                               CLK_FILTER_LINEAR);
    +    int2  p = (int2)(get_global_id(0), get_global_id(1));
    +    float2 rp = (float2)(get_global_id(0), get_global_id(1));
    +    float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
    +    rp = rp / dim;
    +
    +    float2 dots = (float2)(20.0, 20.0);
    +    float2 center = (float2)(0,0);
    +    float2 unused;
    +
    +    float4 val1 = read_imagef(src1, sampler, p);
    +    float4 val2 = read_imagef(src2, sampler, p);
    +    bool next = distance(fract(rp * dots, &unused), (float2)(0.5, 0.5)) < (progress / distance(rp, center));
    +
    +    write_imagef(dst, p, next ? val1 : val2);
    +}
    +
    +
+ + +
+
+
+

34 VAAPI Video Filters

+ +

VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters. +

+

To enable compilation of these filters you need to configure FFmpeg with +--enable-vaapi. +

+

To use vaapi filters, you need to setup the vaapi device correctly. For more information, please read https://trac.ffmpeg.org/wiki/Hardware/VAAPI +

+ +
+

34.1 overlay_vaapi

+ +

Overlay one video on the top of another. +

+

It takes two inputs and has one output. The first input is the "main" video on which the second input is overlaid. +

+

The filter accepts the following options: +

+
+
x
+
y
+

Set expressions for the x and y coordinates of the overlaid video +on the main video. +

+

Default value is "0" for both expressions. +

+
+
w
+
h
+

Set expressions for the width and height the overlaid video +on the main video. +

+

Default values are ’overlay_iw’ for ’w’ and ’overlay_ih*w/overlay_iw’ for ’h’. +

+

The expressions can contain the following parameters: +

+
+
main_w, W
+
main_h, H
+

The main input width and height. +

+
+
overlay_iw
+
overlay_ih
+

The overlay input width and height. +

+
+
overlay_w, w
+
overlay_h, h
+

The overlay output width and height. +

+
+
overlay_x, x
+
overlay_y, y
+

Position of the overlay layer inside of main +

+
+
+ +
+
alpha
+

Set transparency of overlaid video. Allowed range is 0.0 to 1.0. +Higher value means lower transparency. +Default value is 1.0. +

+
+
eof_action
+

See framesync. +

+
+
shortest
+

See framesync. +

+
+
repeatlast
+

See framesync. +

+
+
+ +

This filter also supports the framesync options. +

+
+

34.1.1 Examples

+ +
    +
  • Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs for this filter are yuv420p format. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_vaapi" OUTPUT
    +
    +
  • Overlay an image LOGO at the offset (200, 100) from the top-left corner of the INPUT video. +The inputs have same memory layout for color channels, the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p. +
    +
    -i INPUT -i LOGO -filter_complex "[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_vaapi=x=200:y=100:w=400:h=300:alpha=1.0, hwdownload, format=nv12" OUTPUT
    +
    + +
+ +
+
+
+

34.2 tonemap_vaapi

+ +

Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping. +It maps the dynamic range of HDR10 content to the SDR content. +It currently only accepts HDR10 as input. +

+

It accepts the following parameters: +

+
+
format
+

Specify the output pixel format. +

+

Currently supported formats are: +

+
p010
+
nv12
+
+ +

Default is nv12. +

+
+
primaries, p
+

Set the output color primaries. +

+

Default is same as input. +

+
+
transfer, t
+

Set the output transfer characteristics. +

+

Default is bt709. +

+
+
matrix, m
+

Set the output colorspace matrix. +

+

Default is same as input. +

+
+
+ + +
+

34.2.1 Example

+ +
    +
  • Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format +
    +
    tonemap_vaapi=format=p010:t=bt2020-10
    +
    +
+ +
+
+
+

34.3 hstack_vaapi

+

Stack input videos horizontally. +

+

This is the VA-API variant of the hstack filter, each input stream may +have different height, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See hstack. +

+
+
shortest
+

See hstack. +

+
+
height
+

Set height of output. If set to 0, this filter will set height of output to +height of the first input stream. Default value is 0. +

+
+ +
+
+

34.4 vstack_vaapi

+

Stack input videos vertically. +

+

This is the VA-API variant of the vstack filter, each input stream may +have different width, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See vstack. +

+
+
shortest
+

See vstack. +

+
+
width
+

Set width of output. If set to 0, this filter will set width of output to +width of the first input stream. Default value is 0. +

+
+ +
+
+

34.5 xstack_vaapi

+

Stack video inputs into custom layout. +

+

This is the VA-API variant of the xstack filter, each input stream may +have different size, this filter will scale down/up each input stream to the +given output size, or the size of the first input stream. +

+

It accepts the following options: +

+
+
inputs
+

See xstack. +

+
+
shortest
+

See xstack. +

+
+
layout
+

See xstack. +Moreover, this permits the user to supply output size for each input stream. +

+
xstack_vaapi=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
+
+ +
+
grid
+

See xstack. +

+
+
grid_tile_size
+

Set output size for each input stream when grid is set. If this option +is not set, this filter will set output size by default to the size of the +first input stream. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
fill
+

See xstack. +

+
+ + +
+
+
+

35 QSV Video Filters

+ +

Below is a description of the currently available QSV video filters. +

+

To enable compilation of these filters you need to configure FFmpeg with +--enable-libmfx or --enable-libvpl. +

+

To use QSV filters, you need to setup the QSV device correctly. For more information, please read https://trac.ffmpeg.org/wiki/Hardware/QuickSync +

+ +
+

35.1 hstack_qsv

+

Stack input videos horizontally. +

+

This is the QSV variant of the hstack filter, each input stream may +have different height, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See hstack. +

+
+
shortest
+

See hstack. +

+
+
height
+

Set height of output. If set to 0, this filter will set height of output to +height of the first input stream. Default value is 0. +

+
+ +
+
+

35.2 vstack_qsv

+

Stack input videos vertically. +

+

This is the QSV variant of the vstack filter, each input stream may +have different width, this filter will scale down/up each input stream while +keeping the orignal aspect. +

+

It accepts the following options: +

+
+
inputs
+

See vstack. +

+
+
shortest
+

See vstack. +

+
+
width
+

Set width of output. If set to 0, this filter will set width of output to +width of the first input stream. Default value is 0. +

+
+ +
+
+

35.3 xstack_qsv

+

Stack video inputs into custom layout. +

+

This is the QSV variant of the xstack filter. +

+

It accepts the following options: +

+
+
inputs
+

See xstack. +

+
+
shortest
+

See xstack. +

+
+
layout
+

See xstack. +Moreover, this permits the user to supply output size for each input stream. +

+
xstack_qsv=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
+
+ +
+
grid
+

See xstack. +

+
+
grid_tile_size
+

Set output size for each input stream when grid is set. If this option +is not set, this filter will set output size by default to the size of the +first input stream. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
fill
+

See xstack. +

+
+ + +
+
+
+

36 Video Sources

+ +

Below is a description of the currently available video sources. +

+ +
+

36.1 buffer

+ +

Buffer video frames, and make them available to the filter chain. +

+

This source is mainly intended for a programmatic use, in particular +through the interface defined in libavfilter/buffersrc.h. +

+

It accepts the following parameters: +

+
+
video_size
+

Specify the size (width and height) of the buffered video frames. For the +syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
width
+

The input video width. +

+
+
height
+

The input video height. +

+
+
pix_fmt
+

A string representing the pixel format of the buffered video frames. +It may be a number corresponding to a pixel format, or a pixel format +name. +

+
+
time_base
+

Specify the timebase assumed by the timestamps of the buffered frames. +

+
+
frame_rate
+

Specify the frame rate expected for the video stream. +

+
+
pixel_aspect, sar
+

The sample (pixel) aspect ratio of the input video. +

+
+
hw_frames_ctx
+

When using a hardware pixel format, this should be a reference to an +AVHWFramesContext describing input frames. +

+
+ +

For example: +

+
buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
+
+ +

will instruct the source to accept video frames with size 320x240 and +with format "yuv410p", assuming 1/24 as the timestamps timebase and +square pixels (1:1 sample aspect ratio). +Since the pixel format with name "yuv410p" corresponds to the number 6 +(check the enum AVPixelFormat definition in libavutil/pixfmt.h), +this example corresponds to: +

+
buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
+
+ +

Alternatively, the options can be specified as a flat string, but this +syntax is deprecated: +

+

width:height:pix_fmt:time_base.num:time_base.den:pixel_aspect.num:pixel_aspect.den +

+
+
+

36.2 cellauto

+ +

Create a pattern generated by an elementary cellular automaton. +

+

The initial state of the cellular automaton can be defined through the +filename and pattern options. If such options are +not specified an initial state is created randomly. +

+

At each new frame a new row in the video is filled with the result of +the cellular automaton next generation. The behavior when the whole +frame is filled is defined by the scroll option. +

+

This source accepts the following options: +

+
+
filename, f
+

Read the initial cellular automaton state, i.e. the starting row, from +the specified file. +In the file, each non-whitespace character is considered an alive +cell, a newline will terminate the row, and further characters in the +file will be ignored. +

+
+
pattern, p
+

Read the initial cellular automaton state, i.e. the starting row, from +the specified string. +

+

Each non-whitespace character in the string is considered an alive +cell, a newline will terminate the row, and further characters in the +string will be ignored. +

+
+
rate, r
+

Set the video rate, that is the number of frames generated per second. +Default is 25. +

+
+
random_fill_ratio, ratio
+

Set the random fill ratio for the initial cellular automaton row. It +is a floating point number value ranging from 0 to 1, defaults to +1/PHI. +

+

This option is ignored when a file or a pattern is specified. +

+
+
random_seed, seed
+

Set the seed for filling randomly the initial row, must be an integer +included between 0 and UINT32_MAX. If not specified, or if explicitly +set to -1, the filter will try to use a good random seed on a best +effort basis. +

+
+
rule
+

Set the cellular automaton rule, it is a number ranging from 0 to 255. +Default value is 110. +

+
+
size, s
+

Set the size of the output video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+

If filename or pattern is specified, the size is set +by default to the width of the specified initial state row, and the +height is set to width * PHI. +

+

If size is set, it must contain the width of the specified +pattern string, and the specified pattern will be centered in the +larger row. +

+

If a filename or a pattern string is not specified, the size value +defaults to "320x518" (used for a randomly generated initial state). +

+
+
scroll
+

If set to 1, scroll the output upward when all the rows in the output +have been already filled. If set to 0, the new generated row will be +written over the top row just after the bottom row is filled. +Defaults to 1. +

+
+
start_full, full
+

If set to 1, completely fill the output with generated rows before +outputting the first frame. +This is the default behavior, for disabling set the value to 0. +

+
+
stitch
+

If set to 1, stitch the left and right row edges together. +This is the default behavior, for disabling set the value to 0. +

+
+ + +
+

36.2.1 Examples

+ +
    +
  • Read the initial state from pattern, and specify an output of +size 200x400. +
    +
    cellauto=f=pattern:s=200x400
    +
    + +
  • Generate a random initial row with a width of 200 cells, with a fill +ratio of 2/3: +
    +
    cellauto=ratio=2/3:s=200x200
    +
    + +
  • Create a pattern generated by rule 18 starting by a single alive cell +centered on an initial row with width 100: +
    +
    cellauto=p=@:s=100x400:full=0:rule=18
    +
    + +
  • Specify a more elaborated initial pattern: +
    +
    cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
    +
    + +
+ +
+
+
+

36.3 coreimagesrc

+

Video source generated on GPU using Apple’s CoreImage API on OSX. +

+

This video source is a specialized version of the coreimage video filter. +Use a core image generator at the beginning of the applied filterchain to +generate the content. +

+

The coreimagesrc video source accepts the following options: +

+
list_generators
+

List all available generators along with all their respective options as well as +possible minimum and maximum values along with the default values. +

+
list_generators=true
+
+ +
+
size, s
+

Specify the size of the sourced video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +The default value is 320x240. +

+
+
rate, r
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a floating point +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
sar
+

Set the sample aspect ratio of the sourced video. +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+ +

Additionally, all options of the coreimage video filter are accepted. +A complete filterchain can be used for further processing of the +generated input without CPU-HOST transfer. See coreimage documentation +and examples for details. +

+ +
+

36.3.1 Examples

+ +
    +
  • Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage, +given as complete and escaped command-line for Apple’s standard bash shell: +
    +
    ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
    +
    +

    This example is equivalent to the QRCode example of coreimage without the +need for a nullsrc video source. +

+ + +
+
+
+

36.4 ddagrab

+ +

Captures the Windows Desktop via Desktop Duplication API. +

+

The filter exclusively returns D3D11 Hardware Frames, for on-gpu encoding +or processing. So an explicit hwdownload is needed for any kind of +software processing. +

+

It accepts the following options: +

+
+
output_idx
+

DXGI Output Index to capture. +

+

Usually corresponds to the index Windows has given the screen minus one, +so it’s starting at 0. +

+

Defaults to output 0. +

+
+
draw_mouse
+

Whether to draw the mouse cursor. +

+

Defaults to true. +

+

Only affects hardware cursors. If a game or application renders its own cursor, +it’ll always be captured. +

+
+
framerate
+

Framerate at which the desktop will be captured. +

+

Defaults to 30 FPS. +

+
+
video_size
+

Specify the size of the captured video. +

+

Defaults to the full size of the screen. +

+

Cropped from the bottom/right if smaller than screen size. +

+
+
offset_x
+

Horizontal offset of the captured video. +

+
+
offset_y
+

Vertical offset of the captured video. +

+
+
output_fmt
+

Desired filter output format. +Defaults to 8 Bit BGRA. +

+

It accepts the following values: +

+
auto
+

Passes all supported output formats to DDA and returns what DDA decides to use. +

+
8bit
+
bgra
+

8 Bit formats always work, and DDA will convert to them if neccesary. +

+
10bit
+
x2bgr10
+

Filter initialization will fail if 10 bit format is requested but unavailable. +

+
+ +
+
+ + +
+

36.4.1 Examples

+ +

Capture primary screen and encode using nvenc: +

+
ffmpeg -f lavfi -i ddagrab -c:v h264_nvenc -cq 18 output.mp4
+
+ +

You can also skip the lavfi device and directly use the filter. +Also demonstrates downloading the frame and encoding with libx264. +Explicit output format specification is required in this case: +

+
ffmpeg -filter_complex ddagrab=output_idx=1:framerate=60,hwdownload,format=bgra -c:v libx264 -crf 18 output.mp4
+
+ +

If you want to capture only a subsection of the desktop, this can be achieved +by specifying a smaller size and its offsets into the screen: +

+
ddagrab=video_size=800x600:offset_x=100:offset_y=100
+
+ + +
+
+
+

36.5 gradients

+

Generate several gradients. +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "640x480". +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
c0, c1, c2, c3, c4, c5, c6, c7
+

Set 8 colors. Default values for colors is to pick random one. +

+
+
x0, y0, y0, y1
+

Set gradient line source and destination points. If negative or out of range, random ones +are picked. +

+
+
nb_colors, n
+

Set number of colors to use at once. Allowed range is from 2 to 8. Default value is 2. +

+
+
seed
+

Set seed for picking gradient line points. +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+
speed
+

Set speed of gradients rotation. +

+
+
type, t
+

Set type of gradients, can be linear or radial or circular or spiral. +

+
+ + +
+
+

36.6 mandelbrot

+ +

Generate a Mandelbrot set fractal, and progressively zoom towards the +point specified with start_x and start_y. +

+

This source accepts the following options: +

+
+
end_pts
+

Set the terminal pts value. Default value is 400. +

+
+
end_scale
+

Set the terminal scale value. +Must be a floating point value. Default value is 0.3. +

+
+
inner
+

Set the inner coloring mode, that is the algorithm used to draw the +Mandelbrot fractal internal region. +

+

It shall assume one of the following values: +

+
black
+

Set black mode. +

+
convergence
+

Show time until convergence. +

+
mincol
+

Set color based on point closest to the origin of the iterations. +

+
period
+

Set period mode. +

+
+ +

Default value is mincol. +

+
+
bailout
+

Set the bailout value. Default value is 10.0. +

+
+
maxiter
+

Set the maximum of iterations performed by the rendering +algorithm. Default value is 7189. +

+
+
outer
+

Set outer coloring mode. +It shall assume one of following values: +

+
iteration_count
+

Set iteration count mode. +

+
normalized_iteration_count
+

set normalized iteration count mode. +

+
+

Default value is normalized_iteration_count. +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "640x480". +

+
+
start_scale
+

Set the initial scale value. Default value is 3.0. +

+
+
start_x
+

Set the initial x position. Must be a floating point value between +-100 and 100. Default value is -0.743643887037158704752191506114774. +

+
+
start_y
+

Set the initial y position. Must be a floating point value between +-100 and 100. Default value is -0.131825904205311970493132056385139. +

+
+ +
+
+

36.7 mptestsrc

+ +

Generate various test patterns, as generated by the MPlayer test filter. +

+

The size of the generated video is fixed, and is 256x256. +This source is useful in particular for testing encoding features. +

+

This source accepts the following options: +

+
+
rate, r
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a floating point +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+
test, t
+
+

Set the number or the name of the test to perform. Supported tests are: +

+
dc_luma
+
dc_chroma
+
freq_luma
+
freq_chroma
+
amp_luma
+
amp_chroma
+
cbp
+
mv
+
ring1
+
ring2
+
all
+
max_frames, m
+

Set the maximum number of frames generated for each test, default value is 30. +

+
+
+ +

Default value is "all", which will cycle through the list of all tests. +

+
+ +

Some examples: +

+
mptestsrc=t=dc_luma
+
+ +

will generate a "dc_luma" test pattern. +

+
+
+

36.8 frei0r_src

+ +

Provide a frei0r source. +

+

To enable compilation of this filter you need to install the frei0r +header and configure FFmpeg with --enable-frei0r. +

+

This source accepts the following parameters: +

+
+
size
+

The size of the video to generate. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+
+
framerate
+

The framerate of the generated video. It may be a string of the form +num/den or a frame rate abbreviation. +

+
+
filter_name
+

The name to the frei0r source to load. For more information regarding frei0r and +how to set the parameters, read the frei0r section in the video filters +documentation. +

+
+
filter_params
+

A ’|’-separated list of parameters to pass to the frei0r source. +

+
+
+ +

For example, to generate a frei0r partik0l source with size 200x200 +and frame rate 10 which is overlaid on the overlay filter main input: +

+
frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
+
+ +
+
+

36.9 life

+ +

Generate a life pattern. +

+

This source is based on a generalization of John Conway’s life game. +

+

The sourced input represents a life grid, each pixel represents a cell +which can be in one of two possible states, alive or dead. Every cell +interacts with its eight neighbours, which are the cells that are +horizontally, vertically, or diagonally adjacent. +

+

At each interaction the grid evolves according to the adopted rule, +which specifies the number of neighbor alive cells which will make a +cell stay alive or born. The rule option allows one to specify +the rule to adopt. +

+

This source accepts the following options: +

+
+
filename, f
+

Set the file from which to read the initial grid state. In the file, +each non-whitespace character is considered an alive cell, and newline +is used to delimit the end of each row. +

+

If this option is not specified, the initial grid is generated +randomly. +

+
+
rate, r
+

Set the video rate, that is the number of frames generated per second. +Default is 25. +

+
+
random_fill_ratio, ratio
+

Set the random fill ratio for the initial random grid. It is a +floating point number value ranging from 0 to 1, defaults to 1/PHI. +It is ignored when a file is specified. +

+
+
random_seed, seed
+

Set the seed for filling the initial random grid, must be an integer +included between 0 and UINT32_MAX. If not specified, or if explicitly +set to -1, the filter will try to use a good random seed on a best +effort basis. +

+
+
rule
+

Set the life rule. +

+

A rule can be specified with a code of the kind "SNS/BNB", +where NS and NB are sequences of numbers in the range 0-8, +NS specifies the number of alive neighbor cells which make a +live cell stay alive, and NB the number of alive neighbor cells +which make a dead cell to become alive (i.e. to "born"). +"s" and "b" can be used in place of "S" and "B", respectively. +

+

Alternatively a rule can be specified by an 18-bits integer. The 9 +high order bits are used to encode the next cell state if it is alive +for each number of neighbor alive cells, the low order bits specify +the rule for "borning" new cells. Higher order bits encode for an +higher number of neighbor cells. +For example the number 6153 = (12<<9)+9 specifies a stay alive +rule of 12 and a born rule of 9, which corresponds to "S23/B03". +

+

Default value is "S23/B3", which is the original Conway’s game of life +rule, and will keep a cell alive if it has 2 or 3 neighbor alive +cells, and will born a new cell if there are three alive cells around +a dead cell. +

+
+
size, s
+

Set the size of the output video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +

+

If filename is specified, the size is set by default to the +same size of the input file. If size is set, it must contain +the size specified in the input file, and the initial grid defined in +that file is centered in the larger resulting area. +

+

If a filename is not specified, the size value defaults to "320x240" +(used for a randomly generated initial grid). +

+
+
stitch
+

If set to 1, stitch the left and right grid edges together, and the +top and bottom edges also. Defaults to 1. +

+
+
mold
+

Set cell mold speed. If set, a dead cell will go from death_color to +mold_color with a step of mold. mold can have a +value from 0 to 255. +

+
+
life_color
+

Set the color of living (or new born) cells. +

+
+
death_color
+

Set the color of dead cells. If mold is set, this is the first color +used to represent a dead cell. +

+
+
mold_color
+

Set mold color, for definitely dead and moldy cells. +

+

For the syntax of these 3 color options, check the (ffmpeg-utils)"Color" section in the +ffmpeg-utils manual. +

+
+ + +
+

36.9.1 Examples

+ +
    +
  • Read a grid from pattern, and center it on a grid of size +300x300 pixels: +
    +
    life=f=pattern:s=300x300
    +
    + +
  • Generate a random grid of size 200x200, with a fill ratio of 2/3: +
    +
    life=ratio=2/3:s=200x200
    +
    + +
  • Specify a custom rule for evolving a randomly generated grid: +
    +
    life=rule=S14/B34
    +
    + +
  • Full example with slow death effect (mold) using ffplay: +
    +
    ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
    +
    +
+ +
+
+
+

36.10 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc

+ +

The allrgb source returns frames of size 4096x4096 of all rgb colors. +

+

The allyuv source returns frames of size 4096x4096 of all yuv colors. +

+

The color source provides an uniformly colored input. +

+

The colorchart source provides a colors checker chart. +

+

The colorspectrum source provides a color spectrum input. +

+

The haldclutsrc source provides an identity Hald CLUT. See also +haldclut filter. +

+

The nullsrc source returns unprocessed video frames. It is +mainly useful to be employed in analysis / debugging tools, or as the +source for filters which ignore the input data. +

+

The pal75bars source generates a color bars pattern, based on +EBU PAL recommendations with 75% color levels. +

+

The pal100bars source generates a color bars pattern, based on +EBU PAL recommendations with 100% color levels. +

+

The rgbtestsrc source generates an RGB test pattern useful for +detecting RGB vs BGR issues. You should see a red, green and blue +stripe from top to bottom. +

+

The smptebars source generates a color bars pattern, based on +the SMPTE Engineering Guideline EG 1-1990. +

+

The smptehdbars source generates a color bars pattern, based on +the SMPTE RP 219-2002. +

+

The testsrc source generates a test video pattern, showing a +color pattern, a scrolling gradient and a timestamp. This is mainly +intended for testing purposes. +

+

The testsrc2 source is similar to testsrc, but supports more +pixel formats instead of just rgb24. This allows using it as an +input for other tests without requiring a format conversion. +

+

The yuvtestsrc source generates an YUV test pattern. You should +see a y, cb and cr stripe from top to bottom. +

+

The sources accept the following parameters: +

+
+
level
+

Specify the level of the Hald CLUT, only available in the haldclutsrc +source. A level of N generates a picture of N*N*N by N*N*N +pixels to be used as identity matrix for 3D lookup tables. Each component is +coded on a 1/(N*N) scale. +

+
+
color, c
+

Specify the color of the source, only available in the color +source. For the syntax of this option, check the +(ffmpeg-utils)"Color" section in the ffmpeg-utils manual. +

+
+
size, s
+

Specify the size of the sourced video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +The default value is 320x240. +

+

This option is not available with the allrgb, allyuv, and +haldclutsrc filters. +

+
+
rate, r
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a floating point +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+

Since the frame rate is used as time base, all frames including the last one +will have their full duration. If the specified duration is not a multiple +of the frame duration, it will be rounded up. +

+
+
sar
+

Set the sample aspect ratio of the sourced video. +

+
+
alpha
+

Specify the alpha (opacity) of the background, only available in the +testsrc2 source. The value must be between 0 (fully transparent) and +255 (fully opaque, the default). +

+
+
decimals, n
+

Set the number of decimals to show in the timestamp, only available in the +testsrc source. +

+

The displayed timestamp value will correspond to the original +timestamp value multiplied by the power of 10 of the specified +value. Default value is 0. +

+
+
type
+

Set the type of the color spectrum, only available in the +colorspectrum source. Can be one of the following: +

+
+
black
+
white
+
all
+
+ +
+
patch_size
+

Set patch size of single color patch, only available in the +colorchart source. Default is 64x64. +

+
+
preset
+

Set colorchecker colors preset, only available in the +colorchart source. +

+

Available values are: +

+
reference
+
skintones
+
+ +

Default value is reference. +

+
+ + +
+

36.10.1 Examples

+ +
    +
  • Generate a video with a duration of 5.3 seconds, with size +176x144 and a frame rate of 10 frames per second: +
    +
    testsrc=duration=5.3:size=qcif:rate=10
    +
    + +
  • The following graph description will generate a red source +with an opacity of 0.2, with size "qcif" and a frame rate of 10 +frames per second: +
    +
    color=c=red@0.2:s=qcif:r=10
    +
    + +
  • If the input content is to be ignored, nullsrc can be used. The +following command generates noise in the luminance plane by employing +the geq filter: +
    +
    nullsrc=s=256x256, geq=random(1)*255:128:128
    +
    +
+ +
+
+

36.10.2 Commands

+ +

The color source supports the following commands: +

+
+
c, color
+

Set the color of the created image. Accepts the same syntax of the +corresponding color option. +

+
+ +
+
+
+

36.11 openclsrc

+ +

Generate video using an OpenCL program. +

+
+
source
+

OpenCL program source file. +

+
+
kernel
+

Kernel name in program. +

+
+
size, s
+

Size of frames to generate. This must be set. +

+
+
format
+

Pixel format to use for the generated frames. This must be set. +

+
+
rate, r
+

Number of frames generated every second. Default value is ’25’. +

+
+
+ +

For details of how the program loading works, see the program_opencl +filter. +

+

Example programs: +

+
    +
  • Generate a colour ramp by setting pixel values from the position of the pixel +in the output image. (Note that this will work with all pixel formats, but +the generated output will not be the same.) +
    __kernel void ramp(__write_only image2d_t dst,
    +                   unsigned int index)
    +{
    +    int2 loc = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float4 val;
    +    val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
    +
    +    write_imagef(dst, loc, val);
    +}
    +
    +
  • Generate a Sierpinski carpet pattern, panning by a single pixel each frame. +
    __kernel void sierpinski_carpet(__write_only image2d_t dst,
    +                                unsigned int index)
    +{
    +    int2 loc = (int2)(get_global_id(0), get_global_id(1));
    +
    +    float4 value = 0.0f;
    +    int x = loc.x + index;
    +    int y = loc.y + index;
    +    while (x > 0 || y > 0) {
    +        if (x % 3 == 1 && y % 3 == 1) {
    +            value = 1.0f;
    +            break;
    +        }
    +        x /= 3;
    +        y /= 3;
    +    }
    +
    +    write_imagef(dst, loc, value);
    +}
    +
    +
+ +
+
+

36.12 sierpinski

+ +

Generate a Sierpinski carpet/triangle fractal, and randomly pan around. +

+

This source accepts the following options: +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "640x480". +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
seed
+

Set seed which is used for random panning. +

+
+
jump
+

Set max jump for single pan destination. Allowed range is from 1 to 10000. +

+
+
type
+

Set fractal type, can be default carpet or triangle. +

+
+ +
+
+

36.13 zoneplate

+

Generate a zoneplate test video pattern. +

+

This source accepts the following options: +

+
+
size, s
+

Set frame size. For the syntax of this option, check the (ffmpeg-utils)"Video +size" section in the ffmpeg-utils manual. Default value is "320x240". +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
duration, d
+

Set the duration of the sourced video. See +(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual +for the accepted syntax. +

+

If not specified, or the expressed duration is negative, the video is +supposed to be generated forever. +

+
+
sar
+

Set the sample aspect ratio of the sourced video. +

+
+
precision
+

Set precision in bits for look-up table for sine calculations. Default value is 10. +Allowed range is from 4 to 16. +

+
+
xo
+

Set horizontal axis offset for output signal. Default value is 0. +

+
+
yo
+

Set vertical axis offset for output signal. Default value is 0. +

+
+
to
+

Set time axis offset for output signal. Default value is 0. +

+
+
k0
+

Set 0-order, constant added to signal phase. Default value is 0. +

+
+
kx
+

Set 1-order, phase factor multiplier for horizontal axis. Default value is 0. +

+
+
ky
+

Set 1-order, phase factor multiplier for vertical axis. Default value is 0. +

+
+
kt
+

Set 1-order, phase factor multiplier for time axis. Default value is 0. +

+
+
kxt, kyt, kxy
+

Set phase factor multipliers for combination of spatial and temporal axis. +Default value is 0. +

+
+
kx2
+

Set 2-order, phase factor multiplier for horizontal axis. Default value is 0. +

+
+
ky2
+

Set 2-order, phase factor multiplier for vertical axis. Default value is 0. +

+
+
kt2
+

Set 2-order, phase factor multiplier for time axis. Default value is 0. +

+
+
ku
+

Set the constant added to final phase to produce chroma-blue component of signal. +Default value is 0. +

+
+
kv
+

Set the constant added to final phase to produce chroma-red component of signal. +Default value is 0. +

+
+ + +
+

36.13.1 Commands

+ +

This source supports the some above options as commands. +

+
+
+

36.13.2 Examples

+ +
    +
  • Generate horizontal color sine sweep: +
    +
    zoneplate=ku=512:kv=0:kt2=0:kx2=256:s=wvga:xo=-426:kt=11
    +
    + +
  • Generate vertical color sine sweep: +
    +
    zoneplate=ku=512:kv=0:kt2=0:ky2=156:s=wvga:yo=-240:kt=11
    +
    + +
  • Generate circular zone-plate: +
    +
    zoneplate=ku=512:kv=100:kt2=0:ky2=256:kx2=556:s=wvga:yo=0:kt=11
    +
    +
+ + +
+
+
+
+

37 Video Sinks

+ +

Below is a description of the currently available video sinks. +

+ +
+

37.1 buffersink

+ +

Buffer video frames, and make them available to the end of the filter +graph. +

+

This sink is mainly intended for programmatic use, in particular +through the interface defined in libavfilter/buffersink.h +or the options system. +

+

It accepts a pointer to an AVBufferSinkContext structure, which +defines the incoming buffers’ formats, to be passed as the opaque +parameter to avfilter_init_filter for initialization. +

+
+
+

37.2 nullsink

+ +

Null video sink: do absolutely nothing with the input video. It is +mainly useful as a template and for use in analysis / debugging +tools. +

+ +
+
+
+

38 Multimedia Filters

+ +

Below is a description of the currently available multimedia filters. +

+ +
+

38.1 a3dscope

+ +

Convert input audio to 3d scope video output. +

+

The filter accepts the following options: +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is hd720. +

+
+
fov
+

Set the camera field of view. Default is 90 degrees. +Allowed range is from 40 to 150. +

+
+
roll
+

Set the camera roll. +

+
+
pitch
+

Set the camera pitch. +

+
+
yaw
+

Set the camera yaw. +

+
+
xzoom
+

Set the camera zoom on X-axis. +

+
+
yzoom
+

Set the camera zoom on Y-axis. +

+
+
zzoom
+

Set the camera zoom on Z-axis. +

+
+
xpos
+

Set the camera position on X-axis. +

+
+
ypos
+

Set the camera position on Y-axis. +

+
+
zpos
+

Set the camera position on Z-axis. +

+
+
length
+

Set the length of displayed audio waves in number of frames. +

+
+ + +
+

38.1.1 Commands

+ +

Filter supports the some above options as commands. +

+
+
+
+

38.2 abitscope

+ +

Convert input audio to a video output, displaying the audio bit scope. +

+

The filter accepts the following options: +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 1024x256. +

+
+
colors
+

Specify list of colors separated by space or by ’|’ which will be used to +draw channels. Unrecognized or missing colors will be replaced +by white color. +

+
+
mode, m
+

Set output mode. Can be bars or trace. Default is bars. +

+
+ +
+
+

38.3 adrawgraph

+

Draw a graph using input audio metadata. +

+

See drawgraph +

+
+
+

38.4 agraphmonitor

+ +

See graphmonitor. +

+
+
+

38.5 ahistogram

+ +

Convert input audio to a video output, displaying the volume histogram. +

+

The filter accepts the following options: +

+
+
dmode
+

Specify how histogram is calculated. +

+

It accepts the following values: +

+
single
+

Use single histogram for all channels. +

+
separate
+

Use separate histogram for each channel. +

+
+

Default is single. +

+
+
rate, r
+

Set frame rate, expressed as number of frames per second. Default +value is "25". +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is hd720. +

+
+
scale
+

Set display scale. +

+

It accepts the following values: +

+
log
+

logarithmic +

+
sqrt
+

square root +

+
cbrt
+

cubic root +

+
lin
+

linear +

+
rlog
+

reverse logarithmic +

+
+

Default is log. +

+
+
ascale
+

Set amplitude scale. +

+

It accepts the following values: +

+
log
+

logarithmic +

+
lin
+

linear +

+
+

Default is log. +

+
+
acount
+

Set how much frames to accumulate in histogram. +Default is 1. Setting this to -1 accumulates all frames. +

+
+
rheight
+

Set histogram ratio of window height. +

+
+
slide
+

Set sonogram sliding. +

+

It accepts the following values: +

+
replace
+

replace old rows with new ones. +

+
scroll
+

scroll from top to bottom. +

+
+

Default is replace. +

+
+
hmode
+

Set histogram mode. +

+

It accepts the following values: +

+
abs
+

Use absolute values of samples. +

+
sign
+

Use untouched values of samples. +

+
+

Default is abs. +

+
+ +
+
+

38.6 aphasemeter

+ +

Measures phase of input audio, which is exported as metadata lavfi.aphasemeter.phase, +representing mean phase of current audio frame. A video output can also be produced and is +enabled by default. The audio is passed through as first output. +

+

Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in +range [-1, 1] where -1 means left and right channels are completely out of phase +and 1 means channels are in phase. +

+

The filter accepts the following options, all related to its video output: +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+
+
size, s
+

Set the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 800x400. +

+
+
rc
+
gc
+
bc
+

Specify the red, green, blue contrast. Default values are 2, +7 and 1. +Allowed range is [0, 255]. +

+
+
mpc
+

Set color which will be used for drawing median phase. If color is +none which is default, no median phase value will be drawn. +

+
+
video
+

Enable video output. Default is enabled. +

+
+ + +
+

38.6.1 phasing detection

+ +

The filter also detects out of phase and mono sequences in stereo streams. +It logs the sequence start, end and duration when it lasts longer or as long as the minimum set. +

+

The filter accepts the following options for this detection: +

+
+
phasing
+

Enable mono and out of phase detection. Default is disabled. +

+
+
tolerance, t
+

Set phase tolerance for mono detection, in amplitude ratio. Default is 0. +Allowed range is [0, 1]. +

+
+
angle, a
+

Set angle threshold for out of phase detection, in degree. Default is 170. +Allowed range is [90, 180]. +

+
+
duration, d
+

Set mono or out of phase duration until notification, expressed in seconds. Default is 2. +

+
+ +
+
+

38.6.2 Examples

+ +
    +
  • Complete example with ffmpeg to detect 1 second of mono with 0.001 phase tolerance: +
    +
    ffmpeg -i stereo.wav -af aphasemeter=video=0:phasing=1:duration=1:tolerance=0.001 -f null -
    +
    +
+ +
+
+
+

38.7 avectorscope

+ +

Convert input audio to a video output, representing the audio vector +scope. +

+

The filter is used to measure the difference between channels of stereo +audio stream. A monaural signal, consisting of identical left and right +signal, results in straight vertical line. Any stereo separation is visible +as a deviation from this line, creating a Lissajous figure. +If the straight (or deviation from it) but horizontal line appears this +indicates that the left and right channels are out of phase. +

+

The filter accepts the following options: +

+
+
mode, m
+

Set the vectorscope mode. +

+

Available values are: +

+
lissajous
+

Lissajous rotated by 45 degrees. +

+
+
lissajous_xy
+

Same as above but not rotated. +

+
+
polar
+

Shape resembling half of circle. +

+
+ +

Default value is ‘lissajous’. +

+
+
size, s
+

Set the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 400x400. +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+
+
rc
+
gc
+
bc
+
ac
+

Specify the red, green, blue and alpha contrast. Default values are 40, +160, 80 and 255. +Allowed range is [0, 255]. +

+
+
rf
+
gf
+
bf
+
af
+

Specify the red, green, blue and alpha fade. Default values are 15, +10, 5 and 5. +Allowed range is [0, 255]. +

+
+
zoom
+

Set the zoom factor. Default value is 1. Allowed range is [0, 10]. +Values lower than 1 will auto adjust zoom factor to maximal possible value. +

+
+
draw
+

Set the vectorscope drawing mode. +

+

Available values are: +

+
dot
+

Draw dot for each sample. +

+
+
line
+

Draw line between previous and current sample. +

+
+
aaline
+

Draw anti-aliased line between previous and current sample. +

+
+ +

Default value is ‘dot’. +

+
+
scale
+

Specify amplitude scale of audio samples. +

+

Available values are: +

+
lin
+

Linear. +

+
+
sqrt
+

Square root. +

+
+
cbrt
+

Cubic root. +

+
+
log
+

Logarithmic. +

+
+ +
+
swap
+

Swap left channel axis with right channel axis. +

+
+
mirror
+

Mirror axis. +

+
+
none
+

No mirror. +

+
+
x
+

Mirror only x axis. +

+
+
y
+

Mirror only y axis. +

+
+
xy
+

Mirror both axis. +

+
+ +
+
+ + +
+

38.7.1 Examples

+ +
    +
  • Complete example using ffplay: +
    +
    ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
    +             [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
    +
    +
+ +
+
+

38.7.2 Commands

+ +

This filter supports the all above options as commands except options size and rate. +

+
+
+
+

38.8 bench, abench

+ +

Benchmark part of a filtergraph. +

+

The filter accepts the following options: +

+
+
action
+

Start or stop a timer. +

+

Available values are: +

+
start
+

Get the current time, set it as frame metadata (using the key +lavfi.bench.start_time), and forward the frame to the next filter. +

+
+
stop
+

Get the current time and fetch the lavfi.bench.start_time metadata from +the input frame metadata to get the time difference. Time difference, average, +maximum and minimum time (respectively t, avg, max and +min) are then printed. The timestamps are expressed in seconds. +

+
+
+
+ + +
+

38.8.1 Examples

+ +
    +
  • Benchmark selectivecolor filter: +
    +
    bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
    +
    +
+ +
+
+
+

38.9 concat

+ +

Concatenate audio and video streams, joining them together one after the +other. +

+

The filter works on segments of synchronized video and audio streams. All +segments must have the same number of streams of each type, and that will +also be the number of streams at output. +

+

The filter accepts the following options: +

+
+
n
+

Set the number of segments. Default is 2. +

+
+
v
+

Set the number of output video streams, that is also the number of video +streams in each segment. Default is 1. +

+
+
a
+

Set the number of output audio streams, that is also the number of audio +streams in each segment. Default is 0. +

+
+
unsafe
+

Activate unsafe mode: do not fail if segments have a different format. +

+
+
+ +

The filter has v+a outputs: first v video outputs, then +a audio outputs. +

+

There are nx(v+a) inputs: first the inputs for the first +segment, in the same order as the outputs, then the inputs for the second +segment, etc. +

+

Related streams do not always have exactly the same duration, for various +reasons including codec frame size or sloppy authoring. For that reason, +related synchronized streams (e.g. a video and its audio track) should be +concatenated at once. The concat filter will use the duration of the longest +stream in each segment (except the last one), and if necessary pad shorter +audio streams with silence. +

+

For this filter to work correctly, all segments must start at timestamp 0. +

+

All corresponding streams must have the same parameters in all segments; the +filtering system will automatically select a common pixel format for video +streams, and a common sample format, sample rate and channel layout for +audio streams, but other settings, such as resolution, must be converted +explicitly by the user. +

+

Different frame rates are acceptable but will result in variable frame rate +at output; be sure to configure the output file to handle it. +

+ +
+

38.9.1 Examples

+ +
    +
  • Concatenate an opening, an episode and an ending, all in bilingual version +(video in stream 0, audio in streams 1 and 2): +
    +
    ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
    +  '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
    +   concat=n=3:v=1:a=2 [v] [a1] [a2]' \
    +  -map '[v]' -map '[a1]' -map '[a2]' output.mkv
    +
    + +
  • Concatenate two parts, handling audio and video separately, using the +(a)movie sources, and adjusting the resolution: +
    +
    movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
    +movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
    +[v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
    +
    +

    Note that a desync will happen at the stitch if the audio and video streams +do not have exactly the same duration in the first file. +

    +
+ +
+
+

38.9.2 Commands

+ +

This filter supports the following commands: +

+
next
+

Close the current segment and step to the next one +

+
+ +
+
+
+

38.10 ebur128

+ +

EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness +level. By default, it logs a message at a frequency of 10Hz with the +Momentary loudness (identified by M), Short-term loudness (S), +Integrated loudness (I) and Loudness Range (LRA). +

+

The filter can only analyze streams which have +sample format is double-precision floating point. The input stream will be converted to +this specification, if needed. Users may need to insert aformat and/or aresample filters +after this filter to obtain the original parameters. +

+

The filter also has a video output (see the video option) with a real +time graph to observe the loudness evolution. The graphic contains the logged +message mentioned above, so it is not printed anymore when this option is set, +unless the verbose logging is set. The main graphing area contains the +short-term loudness (3 seconds of analysis), and the gauge on the right is for +the momentary loudness (400 milliseconds), but can optionally be configured +to instead display short-term loudness (see gauge). +

+

The green area marks a +/- 1LU target range around the target loudness +(-23LUFS by default, unless modified through target). +

+

More information about the Loudness Recommendation EBU R128 on +http://tech.ebu.ch/loudness. +

+

The filter accepts the following options: +

+
+
video
+

Activate the video output. The audio stream is passed unchanged whether this +option is set or no. The video stream will be the first output stream if +activated. Default is 0. +

+
+
size
+

Set the video size. This option is for video only. For the syntax of this +option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default and minimum resolution is 640x480. +

+
+
meter
+

Set the EBU scale meter. Default is 9. Common values are 9 and +18, respectively for EBU scale meter +9 and EBU scale meter +18. Any +other integer value between this range is allowed. +

+
+
metadata
+

Set metadata injection. If set to 1, the audio input will be segmented +into 100ms output frames, each of them containing various loudness information +in metadata. All the metadata keys are prefixed with lavfi.r128.. +

+

Default is 0. +

+
+
framelog
+

Force the frame logging level. +

+

Available values are: +

+
quiet
+

logging disabled +

+
info
+

information logging level +

+
verbose
+

verbose logging level +

+
+ +

By default, the logging level is set to info. If the video or +the metadata options are set, it switches to verbose. +

+
+
peak
+

Set peak mode(s). +

+

Available modes can be cumulated (the option is a flag type). Possible +values are: +

+
none
+

Disable any peak mode (default). +

+
sample
+

Enable sample-peak mode. +

+

Simple peak mode looking for the higher sample value. It logs a message +for sample-peak (identified by SPK). +

+
true
+

Enable true-peak mode. +

+

If enabled, the peak lookup is done on an over-sampled version of the input +stream for better peak accuracy. It logs a message for true-peak. +(identified by TPK) and true-peak per frame (identified by FTPK). +This mode requires a build with libswresample. +

+
+ +
+
dualmono
+

Treat mono input files as "dual mono". If a mono file is intended for playback +on a stereo system, its EBU R128 measurement will be perceptually incorrect. +If set to true, this option will compensate for this effect. +Multi-channel input files are not affected by this option. +

+
+
panlaw
+

Set a specific pan law to be used for the measurement of dual mono files. +This parameter is optional, and has a default value of -3.01dB. +

+
+
target
+

Set a specific target level (in LUFS) used as relative zero in the visualization. +This parameter is optional and has a default value of -23LUFS as specified +by EBU R128. However, material published online may prefer a level of -16LUFS +(e.g. for use with podcasts or video platforms). +

+
+
gauge
+

Set the value displayed by the gauge. Valid values are momentary and s +shortterm. By default the momentary value will be used, but in certain +scenarios it may be more useful to observe the short term value instead (e.g. +live mixing). +

+
+
scale
+

Sets the display scale for the loudness. Valid parameters are absolute +(in LUFS) or relative (LU) relative to the target. This only affects the +video output, not the summary or continuous log output. +

+
+
integrated
+

Read-only exported value for measured integrated loudness, in LUFS. +

+
+
range
+

Read-only exported value for measured loudness range, in LU. +

+
+
lra_low
+

Read-only exported value for measured LRA low, in LUFS. +

+
+
lra_high
+

Read-only exported value for measured LRA high, in LUFS. +

+
+
sample_peak
+

Read-only exported value for measured sample peak, in dBFS. +

+
+
true_peak
+

Read-only exported value for measured true peak, in dBFS. +

+
+ + +
+

38.10.1 Examples

+ +
    +
  • Real-time graph using ffplay, with a EBU scale meter +18: +
    +
    ffplay -f lavfi -i "amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]"
    +
    + +
  • Run an analysis with ffmpeg: +
    +
    ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
    +
    +
+ +
+
+
+

38.11 interleave, ainterleave

+ +

Temporally interleave frames from several inputs. +

+

interleave works with video inputs, ainterleave with audio. +

+

These filters read frames from several inputs and send the oldest +queued frame to the output. +

+

Input streams must have well defined, monotonically increasing frame +timestamp values. +

+

In order to submit one frame to output, these filters need to enqueue +at least one frame for each input, so they cannot work in case one +input is not yet terminated and will not receive incoming frames. +

+

For example consider the case when one input is a select filter +which always drops input frames. The interleave filter will keep +reading from that input, but it will never be able to send new frames +to output until the input sends an end-of-stream signal. +

+

Also, depending on inputs synchronization, the filters will drop +frames in case one input receives more frames than the other ones, and +the queue is already filled. +

+

These filters accept the following options: +

+
+
nb_inputs, n
+

Set the number of different inputs, it is 2 by default. +

+
+
duration
+

How to determine the end-of-stream. +

+
+
longest
+

The duration of the longest input. (default) +

+
+
shortest
+

The duration of the shortest input. +

+
+
first
+

The duration of the first input. +

+
+ +
+
+ + +
+

38.11.1 Examples

+ +
    +
  • Interleave frames belonging to different streams using ffmpeg: +
    +
    ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex "[0:v][1:v] interleave" out.avi
    +
    + +
  • Add flickering blur effect: +
    +
    select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
    +
    +
+ +
+
+
+

38.12 latency, alatency

+

Measure filtering latency. +

+

Report previous filter filtering latency, delay in number of audio samples for audio filters +or number of video frames for video filters. +

+

On end of input stream, filter will report min and max measured latency for previous running filter +in filtergraph. +

+
+
+

38.13 metadata, ametadata

+ +

Manipulate frame metadata. +

+

This filter accepts the following options: +

+
+
mode
+

Set mode of operation of the filter. +

+

Can be one of the following: +

+
+
select
+

If both value and key is set, select frames +which have such metadata. If only key is set, select +every frame that has such key in metadata. +

+
+
add
+

Add new metadata key and value. If key is already available +do nothing. +

+
+
modify
+

Modify value of already present key. +

+
+
delete
+

If value is set, delete only keys that have such value. +Otherwise, delete key. If key is not set, delete all metadata values in +the frame. +

+
+
print
+

Print key and its value if metadata was found. If key is not set print all +metadata values available in frame. +

+
+ +
+
key
+

Set key used with all modes. Must be set for all modes except print and delete. +

+
+
value
+

Set metadata value which will be used. This option is mandatory for +modify and add mode. +

+
+
function
+

Which function to use when comparing metadata value and value. +

+

Can be one of following: +

+
+
same_str
+

Values are interpreted as strings, returns true if metadata value is same as value. +

+
+
starts_with
+

Values are interpreted as strings, returns true if metadata value starts with +the value option string. +

+
+
less
+

Values are interpreted as floats, returns true if metadata value is less than value. +

+
+
equal
+

Values are interpreted as floats, returns true if value is equal with metadata value. +

+
+
greater
+

Values are interpreted as floats, returns true if metadata value is greater than value. +

+
+
expr
+

Values are interpreted as floats, returns true if expression from option expr +evaluates to true. +

+
+
ends_with
+

Values are interpreted as strings, returns true if metadata value ends with +the value option string. +

+
+ +
+
expr
+

Set expression which is used when function is set to expr. +The expression is evaluated through the eval API and can contain the following +constants: +

+
+
VALUE1, FRAMEVAL
+

Float representation of value from metadata key. +

+
+
VALUE2, USERVAL
+

Float representation of value as supplied by user in value option. +

+
+ +
+
file
+

If specified in print mode, output is written to the named file. Instead of +plain filename any writable url can be specified. Filename “-” is a shorthand +for standard output. If file option is not set, output is written to the log +with AV_LOG_INFO loglevel. +

+
+
direct
+

Reduces buffering in print mode when output is written to a URL set using file. +

+
+
+ + +
+

38.13.1 Examples

+ +
    +
  • Print all metadata values for frames with key lavfi.signalstats.YDIF with values +between 0 and 1. +
    +
    signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
    +
    +
  • Print silencedetect output to file metadata.txt. +
    +
    silencedetect,ametadata=mode=print:file=metadata.txt
    +
    +
  • Direct all metadata to a pipe with file descriptor 4. +
    +
    metadata=mode=print:file='pipe\:4'
    +
    +
+ +
+
+
+

38.14 perms, aperms

+ +

Set read/write permissions for the output frames. +

+

These filters are mainly aimed at developers to test direct path in the +following filter in the filtergraph. +

+

The filters accept the following options: +

+
+
mode
+

Select the permissions mode. +

+

It accepts the following values: +

+
none
+

Do nothing. This is the default. +

+
ro
+

Set all the output frames read-only. +

+
rw
+

Set all the output frames directly writable. +

+
toggle
+

Make the frame read-only if writable, and writable if read-only. +

+
random
+

Set each output frame read-only or writable randomly. +

+
+ +
+
seed
+

Set the seed for the random mode, must be an integer included between +0 and UINT32_MAX. If not specified, or if explicitly set to +-1, the filter will try to use a good random seed on a best effort +basis. +

+
+ +

Note: in case of auto-inserted filter between the permission filter and the +following one, the permission might not be received as expected in that +following filter. Inserting a format or aformat filter before the +perms/aperms filter can avoid this problem. +

+
+
+

38.15 realtime, arealtime

+ +

Slow down filtering to match real time approximately. +

+

These filters will pause the filtering for a variable amount of time to +match the output rate with the input timestamps. +They are similar to the re option to ffmpeg. +

+

They accept the following options: +

+
+
limit
+

Time limit for the pauses. Any pause longer than that will be considered +a timestamp discontinuity and reset the timer. Default is 2 seconds. +

+
speed
+

Speed factor for processing. The value must be a float larger than zero. +Values larger than 1.0 will result in faster than realtime processing, +smaller will slow processing down. The limit is automatically adapted +accordingly. Default is 1.0. +

+

A processing speed faster than what is possible without these filters cannot +be achieved. +

+
+ + +
+

38.15.1 Commands

+ +

Both filters supports the all above options as commands. +

+
+
+
+

38.16 segment, asegment

+ +

Split single input stream into multiple streams. +

+

This filter does opposite of concat filters. +

+

segment works on video frames, asegment on audio samples. +

+

This filter accepts the following options: +

+
+
timestamps
+

Timestamps of output segments separated by ’|’. The first segment will run +from the beginning of the input stream. The last segment will run until +the end of the input stream +

+
+
frames, samples
+

Exact frame/sample count to split the segments. +

+
+ +

In all cases, prefixing an each segment with ’+’ will make it relative to the +previous segment. +

+ +
+

38.16.1 Examples

+ +
    +
  • Split input audio stream into three output audio streams, starting at start of input audio stream +and storing that in 1st output audio stream, then following at 60th second and storing than in 2nd +output audio stream, and last after 150th second of input audio stream store in 3rd output audio stream: +
    +
    asegment=timestamps="60|150"
    +
    + +
+ +
+
+
+

38.17 select, aselect

+ +

Select frames to pass in output. +

+

This filter accepts the following options: +

+
+
expr, e
+

Set expression, which is evaluated for each input frame. +

+

If the expression is evaluated to zero, the frame is discarded. +

+

If the evaluation result is negative or NaN, the frame is sent to the +first output; otherwise it is sent to the output with index +ceil(val)-1, assuming that the input index starts from 0. +

+

For example a value of 1.2 corresponds to the output with index +ceil(1.2)-1 = 2-1 = 1, that is the second output. +

+
+
outputs, n
+

Set the number of outputs. The output to which to send the selected +frame is based on the result of the evaluation. Default value is 1. +

+
+ +

The expression can contain the following constants: +

+
+
n
+

The (sequential) number of the filtered frame, starting from 0. +

+
+
selected_n
+

The (sequential) number of the selected frame, starting from 0. +

+
+
prev_selected_n
+

The sequential number of the last selected frame. It’s NAN if undefined. +

+
+
TB
+

The timebase of the input timestamps. +

+
+
pts
+

The PTS (Presentation TimeStamp) of the filtered frame, +expressed in TB units. It’s NAN if undefined. +

+
+
t
+

The PTS of the filtered frame, +expressed in seconds. It’s NAN if undefined. +

+
+
prev_pts
+

The PTS of the previously filtered frame. It’s NAN if undefined. +

+
+
prev_selected_pts
+

The PTS of the last previously filtered frame. It’s NAN if undefined. +

+
+
prev_selected_t
+

The PTS of the last previously selected frame, expressed in seconds. It’s NAN if undefined. +

+
+
start_pts
+

The first PTS in the stream which is not NAN. It remains NAN if not found. +

+
+
start_t
+

The first PTS, in seconds, in the stream which is not NAN. It remains NAN if not found. +

+
+
pict_type (video only)
+

The type of the filtered frame. It can assume one of the following +values: +

+
I
+
P
+
B
+
S
+
SI
+
SP
+
BI
+
+ +
+
interlace_type (video only)
+

The frame interlace type. It can assume one of the following values: +

+
PROGRESSIVE
+

The frame is progressive (not interlaced). +

+
TOPFIRST
+

The frame is top-field-first. +

+
BOTTOMFIRST
+

The frame is bottom-field-first. +

+
+ +
+
consumed_sample_n (audio only)
+

the number of selected samples before the current frame +

+
+
samples_n (audio only)
+

the number of samples in the current frame +

+
+
sample_rate (audio only)
+

the input sample rate +

+
+
key
+

This is 1 if the filtered frame is a key-frame, 0 otherwise. +

+
+
pos
+

the position in the file of the filtered frame, -1 if the information +is not available (e.g. for synthetic video); deprecated, do not use +

+
+
scene (video only)
+

value between 0 and 1 to indicate a new scene; a low value reflects a low +probability for the current frame to introduce a new scene, while a higher +value means the current frame is more likely to be one (see the example below) +

+
+
concatdec_select
+

The concat demuxer can select only part of a concat input file by setting an +inpoint and an outpoint, but the output packets may not be entirely contained +in the selected interval. By using this variable, it is possible to skip frames +generated by the concat demuxer which are not exactly contained in the selected +interval. +

+

This works by comparing the frame pts against the lavf.concat.start_time +and the lavf.concat.duration packet metadata values which are also +present in the decoded frames. +

+

The concatdec_select variable is -1 if the frame pts is at least +start_time and either the duration metadata is missing or the frame pts is less +than start_time + duration, 0 otherwise, and NaN if the start_time metadata is +missing. +

+

That basically means that an input frame is selected if its pts is within the +interval set by the concat demuxer. +

+
+
+ +

The default value of the select expression is "1". +

+ +
+

38.17.1 Examples

+ +
    +
  • Select all frames in input: +
    +
    select
    +
    + +

    The example above is the same as: +

    +
    select=1
    +
    + +
  • Skip all frames: +
    +
    select=0
    +
    + +
  • Select only I-frames: +
    +
    select='eq(pict_type\,I)'
    +
    + +
  • Select one frame every 100: +
    +
    select='not(mod(n\,100))'
    +
    + +
  • Select only frames contained in the 10-20 time interval: +
    +
    select=between(t\,10\,20)
    +
    + +
  • Select only I-frames contained in the 10-20 time interval: +
    +
    select=between(t\,10\,20)*eq(pict_type\,I)
    +
    + +
  • Select frames with a minimum distance of 10 seconds: +
    +
    select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
    +
    + +
  • Use aselect to select only audio frames with samples number > 100: +
    +
    aselect='gt(samples_n\,100)'
    +
    + +
  • Create a mosaic of the first scenes: +
    +
    ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
    +
    + +

    Comparing scene against a value between 0.3 and 0.5 is generally a sane +choice. +

    +
  • Send even and odd frames to separate outputs, and compose them: +
    +
    select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
    +
    + +
  • Select useful frames from an ffconcat file which is using inpoints and +outpoints but where the source files are not intra frame only. +
    +
    ffmpeg -copyts -vsync 0 -segment_time_metadata 1 -i input.ffconcat -vf select=concatdec_select -af aselect=concatdec_select output.avi
    +
    +
+ +
+
+
+

38.18 sendcmd, asendcmd

+ +

Send commands to filters in the filtergraph. +

+

These filters read commands to be sent to other filters in the +filtergraph. +

+

sendcmd must be inserted between two video filters, +asendcmd must be inserted between two audio filters, but apart +from that they act the same way. +

+

The specification of commands can be provided in the filter arguments +with the commands option, or in a file specified by the +filename option. +

+

These filters accept the following options: +

+
commands, c
+

Set the commands to be read and sent to the other filters. +

+
filename, f
+

Set the filename of the commands to be read and sent to the other +filters. +

+
+ + +
+

38.18.1 Commands syntax

+ +

A commands description consists of a sequence of interval +specifications, comprising a list of commands to be executed when a +particular event related to that interval occurs. The occurring event +is typically the current frame time entering or leaving a given time +interval. +

+

An interval is specified by the following syntax: +

+
START[-END] COMMANDS;
+
+ +

The time interval is specified by the START and END times. +END is optional and defaults to the maximum time. +

+

The current frame time is considered within the specified interval if +it is included in the interval [START, END), that is when +the time is greater or equal to START and is lesser than +END. +

+

COMMANDS consists of a sequence of one or more command +specifications, separated by ",", relating to that interval. The +syntax of a command specification is given by: +

+
[FLAGS] TARGET COMMAND ARG
+
+ +

FLAGS is optional and specifies the type of events relating to +the time interval which enable sending the specified command, and must +be a non-null sequence of identifier flags separated by "+" or "|" and +enclosed between "[" and "]". +

+

The following flags are recognized: +

+
enter
+

The command is sent when the current frame timestamp enters the +specified interval. In other words, the command is sent when the +previous frame timestamp was not in the given interval, and the +current is. +

+
+
leave
+

The command is sent when the current frame timestamp leaves the +specified interval. In other words, the command is sent when the +previous frame timestamp was in the given interval, and the +current is not. +

+
+
expr
+

The command ARG is interpreted as expression and result of +expression is passed as ARG. +

+

The expression is evaluated through the eval API and can contain the following +constants: +

+
+
POS
+

Original position in the file of the frame, or undefined if undefined +for the current frame. Deprecated, do not use. +

+
+
PTS
+

The presentation timestamp in input. +

+
+
N
+

The count of the input frame for video or audio, starting from 0. +

+
+
T
+

The time in seconds of the current frame. +

+
+
TS
+

The start time in seconds of the current command interval. +

+
+
TE
+

The end time in seconds of the current command interval. +

+
+
TI
+

The interpolated time of the current command interval, TI = (T - TS) / (TE - TS). +

+
+
W
+

The video frame width. +

+
+
H
+

The video frame height. +

+
+ +
+
+ +

If FLAGS is not specified, a default value of [enter] is +assumed. +

+

TARGET specifies the target of the command, usually the name of +the filter class or a specific filter instance name. +

+

COMMAND specifies the name of the command for the target filter. +

+

ARG is optional and specifies the optional list of argument for +the given COMMAND. +

+

Between one interval specification and another, whitespaces, or +sequences of characters starting with # until the end of line, +are ignored and can be used to annotate comments. +

+

A simplified BNF description of the commands specification syntax +follows: +

+
COMMAND_FLAG  ::= "enter" | "leave"
+COMMAND_FLAGS ::= COMMAND_FLAG [(+|"|")COMMAND_FLAG]
+COMMAND       ::= ["[" COMMAND_FLAGS "]"] TARGET COMMAND [ARG]
+COMMANDS      ::= COMMAND [,COMMANDS]
+INTERVAL      ::= START[-END] COMMANDS
+INTERVALS     ::= INTERVAL[;INTERVALS]
+
+ +
+
+

38.18.2 Examples

+ +
    +
  • Specify audio tempo change at second 4: +
    +
    asendcmd=c='4.0 atempo tempo 1.5',atempo
    +
    + +
  • Target a specific filter instance: +
    +
    asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
    +
    + +
  • Specify a list of drawtext and hue commands in a file. +
    +
    # show text in the interval 5-10
    +5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
    +         [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
    +
    +# desaturate the image in the interval 15-20
    +15.0-20.0 [enter] hue s 0,
    +          [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
    +          [leave] hue s 1,
    +          [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
    +
    +# apply an exponential saturation fade-out effect, starting from time 25
    +25 [enter] hue s exp(25-t)
    +
    + +

    A filtergraph allowing to read and process the above command list +stored in a file test.cmd, can be specified with: +

    +
    sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
    +
    +
+ +
+
+
+

38.19 setpts, asetpts

+ +

Change the PTS (presentation timestamp) of the input frames. +

+

setpts works on video frames, asetpts on audio frames. +

+

This filter accepts the following options: +

+
+
expr
+

The expression which is evaluated for each frame to construct its timestamp. +

+
+
+ +

The expression is evaluated through the eval API and can contain the following +constants: +

+
+
FRAME_RATE, FR
+

frame rate, only defined for constant frame-rate video +

+
+
PTS
+

The presentation timestamp in input +

+
+
N
+

The count of the input frame for video or the number of consumed samples, +not including the current frame for audio, starting from 0. +

+
+
NB_CONSUMED_SAMPLES
+

The number of consumed samples, not including the current frame (only +audio) +

+
+
NB_SAMPLES, S
+

The number of samples in the current frame (only audio) +

+
+
SAMPLE_RATE, SR
+

The audio sample rate. +

+
+
STARTPTS
+

The PTS of the first frame. +

+
+
STARTT
+

the time in seconds of the first frame +

+
+
INTERLACED
+

State whether the current frame is interlaced. +

+
+
T
+

the time in seconds of the current frame +

+
+
POS
+

original position in the file of the frame, or undefined if undefined +for the current frame; deprecated, do not use +

+
+
PREV_INPTS
+

The previous input PTS. +

+
+
PREV_INT
+

previous input time in seconds +

+
+
PREV_OUTPTS
+

The previous output PTS. +

+
+
PREV_OUTT
+

previous output time in seconds +

+
+
RTCTIME
+

The wallclock (RTC) time in microseconds. This is deprecated, use time(0) +instead. +

+
+
RTCSTART
+

The wallclock (RTC) time at the start of the movie in microseconds. +

+
+
TB
+

The timebase of the input timestamps. +

+
+
T_CHANGE
+

Time of the first frame after command was applied or time of the first frame if no commands. +

+
+
+ + +
+

38.19.1 Examples

+ +
    +
  • Start counting PTS from zero +
    +
    setpts=PTS-STARTPTS
    +
    + +
  • Apply fast motion effect: +
    +
    setpts=0.5*PTS
    +
    + +
  • Apply slow motion effect: +
    +
    setpts=2.0*PTS
    +
    + +
  • Set fixed rate of 25 frames per second: +
    +
    setpts=N/(25*TB)
    +
    + +
  • Set fixed rate 25 fps with some jitter: +
    +
    setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
    +
    + +
  • Apply an offset of 10 seconds to the input PTS: +
    +
    setpts=PTS+10/TB
    +
    + +
  • Generate timestamps from a "live source" and rebase onto the current timebase: +
    +
    setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
    +
    + +
  • Generate timestamps by counting samples: +
    +
    asetpts=N/SR/TB
    +
    + +
+ +
+
+

38.19.2 Commands

+ +

Both filters support all above options as commands. +

+
+
+
+

38.20 setrange

+ +

Force color range for the output video frame. +

+

The setrange filter marks the color range property for the +output frames. It does not change the input frame, but only sets the +corresponding property, which affects how the frame is treated by +following filters. +

+

The filter accepts the following options: +

+
+
range
+

Available values are: +

+
+
auto
+

Keep the same color range property. +

+
+
unspecified, unknown
+

Set the color range as unspecified. +

+
+
limited, tv, mpeg
+

Set the color range as limited. +

+
+
full, pc, jpeg
+

Set the color range as full. +

+
+
+
+ +
+
+

38.21 settb, asettb

+ +

Set the timebase to use for the output frames timestamps. +It is mainly useful for testing timebase configuration. +

+

It accepts the following parameters: +

+
+
expr, tb
+

The expression which is evaluated into the output timebase. +

+
+
+ +

The value for tb is an arithmetic expression representing a +rational. The expression can contain the constants "AVTB" (the default +timebase), "intb" (the input timebase) and "sr" (the sample rate, +audio only). Default value is "intb". +

+ +
+

38.21.1 Examples

+ +
    +
  • Set the timebase to 1/25: +
    +
    settb=expr=1/25
    +
    + +
  • Set the timebase to 1/10: +
    +
    settb=expr=0.1
    +
    + +
  • Set the timebase to 1001/1000: +
    +
    settb=1+0.001
    +
    + +
  • Set the timebase to 2*intb: +
    +
    settb=2*intb
    +
    + +
  • Set the default timebase value: +
    +
    settb=AVTB
    +
    +
+ +
+
+
+

38.22 showcqt

+

Convert input audio to a video output representing frequency spectrum +logarithmically using Brown-Puckette constant Q transform algorithm with +direct frequency domain coefficient calculation (but the transform itself +is not really constant Q, instead the Q factor is actually variable/clamped), +with musical tone scale, from E0 to D#10. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. It must be even. For the syntax of this option, +check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 1920x1080. +

+
+
fps, rate, r
+

Set the output frame rate. Default value is 25. +

+
+
bar_h
+

Set the bargraph height. It must be even. Default value is -1 which +computes the bargraph height automatically. +

+
+
axis_h
+

Set the axis height. It must be even. Default value is -1 which computes +the axis height automatically. +

+
+
sono_h
+

Set the sonogram height. It must be even. Default value is -1 which +computes the sonogram height automatically. +

+
+
fullhd
+

Set the fullhd resolution. This option is deprecated, use size, s +instead. Default value is 1. +

+
+
sono_v, volume
+

Specify the sonogram volume expression. It can contain variables: +

+
bar_v
+

the bar_v evaluated expression +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option +

+
+

and functions: +

+
a_weighting(f)
+

A-weighting of equal loudness +

+
b_weighting(f)
+

B-weighting of equal loudness +

+
c_weighting(f)
+

C-weighting of equal loudness. +

+
+

Default value is 16. +

+
+
bar_v, volume2
+

Specify the bargraph volume expression. It can contain variables: +

+
sono_v
+

the sono_v evaluated expression +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option +

+
+

and functions: +

+
a_weighting(f)
+

A-weighting of equal loudness +

+
b_weighting(f)
+

B-weighting of equal loudness +

+
c_weighting(f)
+

C-weighting of equal loudness. +

+
+

Default value is sono_v. +

+
+
sono_g, gamma
+

Specify the sonogram gamma. Lower gamma makes the spectrum more contrast, +higher gamma makes the spectrum having more range. Default value is 3. +Acceptable range is [1, 7]. +

+
+
bar_g, gamma2
+

Specify the bargraph gamma. Default value is 1. Acceptable range is +[1, 7]. +

+
+
bar_t
+

Specify the bargraph transparency level. Lower value makes the bargraph sharper. +Default value is 1. Acceptable range is [0, 1]. +

+
+
timeclamp, tc
+

Specify the transform timeclamp. At low frequency, there is trade-off between +accuracy in time domain and frequency domain. If timeclamp is lower, +event in time domain is represented more accurately (such as fast bass drum), +otherwise event in frequency domain is represented more accurately +(such as bass guitar). Acceptable range is [0.002, 1]. Default value is 0.17. +

+
+
attack
+

Set attack time in seconds. The default is 0 (disabled). Otherwise, it +limits future samples by applying asymmetric windowing in time domain, useful +when low latency is required. Accepted range is [0, 1]. +

+
+
basefreq
+

Specify the transform base frequency. Default value is 20.01523126408007475, +which is frequency 50 cents below E0. Acceptable range is [10, 100000]. +

+
+
endfreq
+

Specify the transform end frequency. Default value is 20495.59681441799654, +which is frequency 50 cents above D#10. Acceptable range is [10, 100000]. +

+
+
coeffclamp
+

This option is deprecated and ignored. +

+
+
tlength
+

Specify the transform length in time domain. Use this option to control accuracy +trade-off between time domain and frequency domain at every frequency sample. +It can contain variables: +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option. +

+
+

Default value is 384*tc/(384+tc*f). +

+
+
count
+

Specify the transform count for every video frame. Default value is 6. +Acceptable range is [1, 30]. +

+
+
fcount
+

Specify the transform count for every single pixel. Default value is 0, +which makes it computed automatically. Acceptable range is [0, 10]. +

+
+
fontfile
+

Specify font file for use with freetype to draw the axis. If not specified, +use embedded font. Note that drawing with font file or embedded font is not +implemented with custom basefreq and endfreq, use axisfile +option instead. +

+
+
font
+

Specify fontconfig pattern. This has lower priority than fontfile. The +: in the pattern may be replaced by | to avoid unnecessary +escaping. +

+
+
fontcolor
+

Specify font color expression. This is arithmetic expression that should return +integer value 0xRRGGBB. It can contain variables: +

+
frequency, freq, f
+

the frequency where it is evaluated +

+
timeclamp, tc
+

the value of timeclamp option +

+
+

and functions: +

+
midi(f)
+

midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69) +

+
r(x), g(x), b(x)
+

red, green, and blue value of intensity x. +

+
+

Default value is st(0, (midi(f)-59.5)/12); +st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0)); +r(1-ld(1)) + b(ld(1)). +

+
+
axisfile
+

Specify image file to draw the axis. This option override fontfile and +fontcolor option. +

+
+
axis, text
+

Enable/disable drawing text to the axis. If it is set to 0, drawing to +the axis is disabled, ignoring fontfile and axisfile option. +Default value is 1. +

+
+
csp
+

Set colorspace. The accepted values are: +

+
unspecified
+

Unspecified (default) +

+
+
bt709
+

BT.709 +

+
+
fcc
+

FCC +

+
+
bt470bg
+

BT.470BG or BT.601-6 625 +

+
+
smpte170m
+

SMPTE-170M or BT.601-6 525 +

+
+
smpte240m
+

SMPTE-240M +

+
+
bt2020ncl
+

BT.2020 with non-constant luminance +

+
+
+ +
+
cscheme
+

Set spectrogram color scheme. This is list of floating point values with format +left_r|left_g|left_b|right_r|right_g|right_b. +The default is 1|0.5|0|0|0.5|1. +

+
+
+ + +
+

38.22.1 Examples

+ +
    +
  • Playing audio while showing the spectrum: +
    +
    ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
    +
    + +
  • Same as above, but with frame rate 30 fps: +
    +
    ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
    +
    + +
  • Playing at 1280x720: +
    +
    ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
    +
    + +
  • Disable sonogram display: +
    +
    sono_h=0
    +
    + +
  • A1 and its harmonics: A1, A2, (near)E3, A3: +
    +
    ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
    +                 asplit[a][out1]; [a] showcqt [out0]'
    +
    + +
  • Same as above, but with more accuracy in frequency domain: +
    +
    ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
    +                 asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
    +
    + +
  • Custom volume: +
    +
    bar_v=10:sono_v=bar_v*a_weighting(f)
    +
    + +
  • Custom gamma, now spectrum is linear to the amplitude. +
    +
    bar_g=2:sono_g=2
    +
    + +
  • Custom tlength equation: +
    +
    tc=0.33:tlength='st(0,0.17); 384*tc / (384 / ld(0) + tc*f /(1-ld(0))) + 384*tc / (tc*f / ld(0) + 384 /(1-ld(0)))'
    +
    + +
  • Custom fontcolor and fontfile, C-note is colored green, others are colored blue: +
    +
    fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
    +
    + +
  • Custom font using fontconfig: +
    +
    font='Courier New,Monospace,mono|bold'
    +
    + +
  • Custom frequency range with custom axis using image file: +
    +
    axisfile=myaxis.png:basefreq=40:endfreq=10000
    +
    +
+ +
+
+
+

38.23 showcwt

+ +

Convert input audio to video output representing frequency spectrum +using Continuous Wavelet Transform and Morlet wavelet. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, +check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 640x512. +

+
+
rate, r
+

Set the output frame rate. Default value is 25. +

+
+
scale
+

Set the frequency scale used. Allowed values are: +

+
+
linear
+
log2
+
bark
+
mel
+
erbs
+
+

Default value is linear. +

+
+
min
+

Set the minimum frequency that will be used in output. +Default is 20 Hz. +

+
+
max
+

Set the maximum frequency that will be used in output. +Default is 20000 Hz. The real frequency upper limit +depends on input audio’s sample rate and such will be enforced +on this value when it is set to value greater than Nyquist frequency. +

+
+
logb
+

Set the logarithmic basis for brightness strength when +mapping calculated magnitude values to pixel values. +Allowed range is from 0 to 1. +Default value is 0.0001. +

+
+
deviation
+

Set the frequency deviation. +Lower values than 1 are more frequency oriented, +while higher values than 1 are more time oriented. +Allowed range is from 0 to 10. +Default value is 1. +

+
+
pps
+

Set the number of pixel output per each second in one row. +Allowed range is from 1 to 1024. +Default value is 64. +

+
+
mode
+

Set the output visual mode. Allowed values are: +

+
+
magnitude
+

Show magnitude. +

+
phase
+

Show only phase. +

+
magphase
+

Show combination of magnitude and phase. +Magnitude is mapped to brightness and phase to color. +

+
channel
+

Show unique color per channel magnitude. +

+
stereo
+

Show unique color per stereo difference. +

+
+ +

Default value is magnitude. +

+
+
slide
+

Set the output slide method. Allowed values are: +

+
+
replace
+
scroll
+
frame
+
+ +
+
direction
+

Set the direction method for output slide method. Allowed values are: +

+
+
lr
+

Direction from left to right. +

+
rl
+

Direction from right to left. +

+
ud
+

Direction from up to down. +

+
du
+

Direction from down to up. +

+
+
+
+ +
+
+

38.24 showfreqs

+ +

Convert input audio to video output representing the audio power spectrum. +Audio amplitude is on Y-axis while frequency is on X-axis. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify size of video. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default is 1024x512. +

+
+
rate, r
+

Set video rate. Default is 25. +

+
+
mode
+

Set display mode. +This set how each frequency bin will be represented. +

+

It accepts the following values: +

+
line
+
bar
+
dot
+
+

Default is bar. +

+
+
ascale
+

Set amplitude scale. +

+

It accepts the following values: +

+
lin
+

Linear scale. +

+
+
sqrt
+

Square root scale. +

+
+
cbrt
+

Cubic root scale. +

+
+
log
+

Logarithmic scale. +

+
+

Default is log. +

+
+
fscale
+

Set frequency scale. +

+

It accepts the following values: +

+
lin
+

Linear scale. +

+
+
log
+

Logarithmic scale. +

+
+
rlog
+

Reverse logarithmic scale. +

+
+

Default is lin. +

+
+
win_size
+

Set window size. Allowed range is from 16 to 65536. +

+

Default is 2048 +

+
+
win_func
+

Set windowing function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default is hanning. +

+
+
overlap
+

Set window overlap. In range [0, 1]. Default is 1, +which means optimal overlap for selected window function will be picked. +

+
+
averaging
+

Set time averaging. Setting this to 0 will display current maximal peaks. +Default is 1, which means time averaging is disabled. +

+
+
colors
+

Specify list of colors separated by space or by ’|’ which will be used to +draw channel frequencies. Unrecognized or missing colors will be replaced +by white color. +

+
+
cmode
+

Set channel display mode. +

+

It accepts the following values: +

+
combined
+
separate
+
+

Default is combined. +

+
+
minamp
+

Set minimum amplitude used in log amplitude scaler. +

+
+
data
+

Set data display mode. +

+

It accepts the following values: +

+
magnitude
+
phase
+
delay
+
+

Default is magnitude. +

+
+
channels
+

Set channels to use when processing audio. By default all are processed. +

+
+ +
+
+

38.25 showspatial

+ +

Convert stereo input audio to a video output, representing the spatial relationship +between two channels. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 512x512. +

+
+
win_size
+

Set window size. Allowed range is from 1024 to 65536. Default size is 4096. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+ +

Default value is hann. +

+
+
rate, r
+

Set output framerate. +

+
+ +
+
+

38.26 showspectrum

+ +

Convert input audio to a video output, representing the audio frequency +spectrum. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 640x512. +

+
+
slide
+

Specify how the spectrum should slide along the window. +

+

It accepts the following values: +

+
replace
+

the samples start again on the left when they reach the right +

+
scroll
+

the samples scroll from right to left +

+
fullframe
+

frames are only produced when the samples reach the right +

+
rscroll
+

the samples scroll from left to right +

+
lreplace
+

the samples start again on the right when they reach the left +

+
+ +

Default value is replace. +

+
+
mode
+

Specify display mode. +

+

It accepts the following values: +

+
combined
+

all channels are displayed in the same row +

+
separate
+

all channels are displayed in separate rows +

+
+ +

Default value is ‘combined’. +

+
+
color
+

Specify display color mode. +

+

It accepts the following values: +

+
channel
+

each channel is displayed in a separate color +

+
intensity
+

each channel is displayed using the same color scheme +

+
rainbow
+

each channel is displayed using the rainbow color scheme +

+
moreland
+

each channel is displayed using the moreland color scheme +

+
nebulae
+

each channel is displayed using the nebulae color scheme +

+
fire
+

each channel is displayed using the fire color scheme +

+
fiery
+

each channel is displayed using the fiery color scheme +

+
fruit
+

each channel is displayed using the fruit color scheme +

+
cool
+

each channel is displayed using the cool color scheme +

+
magma
+

each channel is displayed using the magma color scheme +

+
green
+

each channel is displayed using the green color scheme +

+
viridis
+

each channel is displayed using the viridis color scheme +

+
plasma
+

each channel is displayed using the plasma color scheme +

+
cividis
+

each channel is displayed using the cividis color scheme +

+
terrain
+

each channel is displayed using the terrain color scheme +

+
+ +

Default value is ‘channel’. +

+
+
scale
+

Specify scale used for calculating intensity color values. +

+

It accepts the following values: +

+
lin
+

linear +

+
sqrt
+

square root, default +

+
cbrt
+

cubic root +

+
log
+

logarithmic +

+
4thrt
+

4th root +

+
5thrt
+

5th root +

+
+ +

Default value is ‘sqrt’. +

+
+
fscale
+

Specify frequency scale. +

+

It accepts the following values: +

+
lin
+

linear +

+
log
+

logarithmic +

+
+ +

Default value is ‘lin’. +

+
+
saturation
+

Set saturation modifier for displayed colors. Negative values provide +alternative color scheme. 0 is no saturation at all. +Saturation must be in [-10.0, 10.0] range. +Default value is 1. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+ +

Default value is hann. +

+
+
orientation
+

Set orientation of time vs frequency axis. Can be vertical or +horizontal. Default is vertical. +

+
+
overlap
+

Set ratio of overlap window. Default value is 0. +When value is 1 overlap is set to recommended size for specific +window function currently used. +

+
+
gain
+

Set scale gain for calculating intensity color values. +Default value is 1. +

+
+
data
+

Set which data to display. Can be magnitude, default or phase, +or unwrapped phase: uphase. +

+
+
rotation
+

Set color rotation, must be in [-1.0, 1.0] range. +Default value is 0. +

+
+
start
+

Set start frequency from which to display spectrogram. Default is 0. +

+
+
stop
+

Set stop frequency to which to display spectrogram. Default is 0. +

+
+
fps
+

Set upper frame rate limit. Default is auto, unlimited. +

+
+
legend
+

Draw time and frequency axes and legends. Default is disabled. +

+
+
drange
+

Set dynamic range used to calculate intensity color values. Default is 120 dBFS. +Allowed range is from 10 to 200. +

+
+
limit
+

Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS. +Allowed range is from -100 to 100. +

+
+
opacity
+

Set opacity strength when using pixel format output with alpha component. +

+
+ +

The usage is very similar to the showwaves filter; see the examples in that +section. +

+ +
+

38.26.1 Examples

+ +
    +
  • Large window with logarithmic color scaling: +
    +
    showspectrum=s=1280x480:scale=log
    +
    + +
  • Complete example for a colored and sliding spectrum per channel using ffplay: +
    +
    ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
    +             [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
    +
    +
+ +
+
+
+

38.27 showspectrumpic

+ +

Convert input audio to a single video frame, representing the audio frequency +spectrum. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 4096x2048. +

+
+
mode
+

Specify display mode. +

+

It accepts the following values: +

+
combined
+

all channels are displayed in the same row +

+
separate
+

all channels are displayed in separate rows +

+
+

Default value is ‘combined’. +

+
+
color
+

Specify display color mode. +

+

It accepts the following values: +

+
channel
+

each channel is displayed in a separate color +

+
intensity
+

each channel is displayed using the same color scheme +

+
rainbow
+

each channel is displayed using the rainbow color scheme +

+
moreland
+

each channel is displayed using the moreland color scheme +

+
nebulae
+

each channel is displayed using the nebulae color scheme +

+
fire
+

each channel is displayed using the fire color scheme +

+
fiery
+

each channel is displayed using the fiery color scheme +

+
fruit
+

each channel is displayed using the fruit color scheme +

+
cool
+

each channel is displayed using the cool color scheme +

+
magma
+

each channel is displayed using the magma color scheme +

+
green
+

each channel is displayed using the green color scheme +

+
viridis
+

each channel is displayed using the viridis color scheme +

+
plasma
+

each channel is displayed using the plasma color scheme +

+
cividis
+

each channel is displayed using the cividis color scheme +

+
terrain
+

each channel is displayed using the terrain color scheme +

+
+

Default value is ‘intensity’. +

+
+
scale
+

Specify scale used for calculating intensity color values. +

+

It accepts the following values: +

+
lin
+

linear +

+
sqrt
+

square root, default +

+
cbrt
+

cubic root +

+
log
+

logarithmic +

+
4thrt
+

4th root +

+
5thrt
+

5th root +

+
+

Default value is ‘log’. +

+
+
fscale
+

Specify frequency scale. +

+

It accepts the following values: +

+
lin
+

linear +

+
log
+

logarithmic +

+
+ +

Default value is ‘lin’. +

+
+
saturation
+

Set saturation modifier for displayed colors. Negative values provide +alternative color scheme. 0 is no saturation at all. +Saturation must be in [-10.0, 10.0] range. +Default value is 1. +

+
+
win_func
+

Set window function. +

+

It accepts the following values: +

+
rect
+
bartlett
+
hann
+
hanning
+
hamming
+
blackman
+
welch
+
flattop
+
bharris
+
bnuttall
+
bhann
+
sine
+
nuttall
+
lanczos
+
gauss
+
tukey
+
dolph
+
cauchy
+
parzen
+
poisson
+
bohman
+
kaiser
+
+

Default value is hann. +

+
+
orientation
+

Set orientation of time vs frequency axis. Can be vertical or +horizontal. Default is vertical. +

+
+
gain
+

Set scale gain for calculating intensity color values. +Default value is 1. +

+
+
legend
+

Draw time and frequency axes and legends. Default is enabled. +

+
+
rotation
+

Set color rotation, must be in [-1.0, 1.0] range. +Default value is 0. +

+
+
start
+

Set start frequency from which to display spectrogram. Default is 0. +

+
+
stop
+

Set stop frequency to which to display spectrogram. Default is 0. +

+
+
drange
+

Set dynamic range used to calculate intensity color values. Default is 120 dBFS. +Allowed range is from 10 to 200. +

+
+
limit
+

Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS. +Allowed range is from -100 to 100. +

+
+
opacity
+

Set opacity strength when using pixel format output with alpha component. +

+
+ + +
+

38.27.1 Examples

+ +
    +
  • Extract an audio spectrogram of a whole audio track +in a 1024x1024 picture using ffmpeg: +
    +
    ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
    +
    +
+ +
+
+
+

38.28 showvolume

+ +

Convert input audio volume to a video output. +

+

The filter accepts the following options: +

+
+
rate, r
+

Set video rate. +

+
+
b
+

Set border width, allowed range is [0, 5]. Default is 1. +

+
+
w
+

Set channel width, allowed range is [80, 8192]. Default is 400. +

+
+
h
+

Set channel height, allowed range is [1, 900]. Default is 20. +

+
+
f
+

Set fade, allowed range is [0, 1]. Default is 0.95. +

+
+
c
+

Set volume color expression. +

+

The expression can use the following variables: +

+
+
VOLUME
+

Current max volume of channel in dB. +

+
+
PEAK
+

Current peak. +

+
+
CHANNEL
+

Current channel number, starting from 0. +

+
+ +
+
t
+

If set, displays channel names. Default is enabled. +

+
+
v
+

If set, displays volume values. Default is enabled. +

+
+
o
+

Set orientation, can be horizontal: h or vertical: v, +default is h. +

+
+
s
+

Set step size, allowed range is [0, 5]. Default is 0, which means +step is disabled. +

+
+
p
+

Set background opacity, allowed range is [0, 1]. Default is 0. +

+
+
m
+

Set metering mode, can be peak: p or rms: r, +default is p. +

+
+
ds
+

Set display scale, can be linear: lin or log: log, +default is lin. +

+
+
dm
+

In second. +If set to > 0., display a line for the max level +in the previous seconds. +default is disabled: 0. +

+
+
dmc
+

The color of the max line. Use when dm option is set to > 0. +default is: orange +

+
+ +
+
+

38.29 showwaves

+ +

Convert input audio to a video output, representing the samples waves. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 600x240. +

+
+
mode
+

Set display mode. +

+

Available values are: +

+
point
+

Draw a point for each sample. +

+
+
line
+

Draw a vertical line for each sample. +

+
+
p2p
+

Draw a point for each sample and a line between them. +

+
+
cline
+

Draw a centered vertical line for each sample. +

+
+ +

Default value is point. +

+
+
n
+

Set the number of samples which are printed on the same column. A +larger value will decrease the frame rate. Must be a positive +integer. This option can be set only if the value for rate +is not explicitly specified. +

+
+
rate, r
+

Set the (approximate) output frame rate. This is done by setting the +option n. Default value is "25". +

+
+
split_channels
+

Set if channels should be drawn separately or overlap. Default value is 0. +

+
+
colors
+

Set colors separated by ’|’ which are going to be used for drawing of each channel. +

+
+
scale
+

Set amplitude scale. +

+

Available values are: +

+
lin
+

Linear. +

+
+
log
+

Logarithmic. +

+
+
sqrt
+

Square root. +

+
+
cbrt
+

Cubic root. +

+
+ +

Default is linear. +

+
+
draw
+

Set the draw mode. This is mostly useful to set for high n. +

+

Available values are: +

+
scale
+

Scale pixel values for each drawn sample. +

+
+
full
+

Draw every sample directly. +

+
+ +

Default value is scale. +

+
+ + +
+

38.29.1 Examples

+ +
    +
  • Output the input file audio and the corresponding video representation +at the same time: +
    +
    amovie=a.mp3,asplit[out0],showwaves[out1]
    +
    + +
  • Create a synthetic signal and show it with showwaves, forcing a +frame rate of 30 frames per second: +
    +
    aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
    +
    +
+ +
+
+
+

38.30 showwavespic

+ +

Convert input audio to a single video frame, representing the samples waves. +

+

The filter accepts the following options: +

+
+
size, s
+

Specify the video size for the output. For the syntax of this option, check the +(ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. +Default value is 600x240. +

+
+
split_channels
+

Set if channels should be drawn separately or overlap. Default value is 0. +

+
+
colors
+

Set colors separated by ’|’ which are going to be used for drawing of each channel. +

+
+
scale
+

Set amplitude scale. +

+

Available values are: +

+
lin
+

Linear. +

+
+
log
+

Logarithmic. +

+
+
sqrt
+

Square root. +

+
+
cbrt
+

Cubic root. +

+
+ +

Default is linear. +

+
+
draw
+

Set the draw mode. +

+

Available values are: +

+
scale
+

Scale pixel values for each drawn sample. +

+
+
full
+

Draw every sample directly. +

+
+ +

Default value is scale. +

+
+
filter
+

Set the filter mode. +

+

Available values are: +

+
average
+

Use average samples values for each drawn sample. +

+
+
peak
+

Use peak samples values for each drawn sample. +

+
+ +

Default value is average. +

+
+ + +
+

38.30.1 Examples

+ +
    +
  • Extract a channel split representation of the wave form of a whole audio track +in a 1024x800 picture using ffmpeg: +
    +
    ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
    +
    +
+ +
+
+
+

38.31 sidedata, asidedata

+ +

Delete frame side data, or select frames based on it. +

+

This filter accepts the following options: +

+
+
mode
+

Set mode of operation of the filter. +

+

Can be one of the following: +

+
+
select
+

Select every frame with side data of type. +

+
+
delete
+

Delete side data of type. If type is not set, delete all side +data in the frame. +

+
+
+ +
+
type
+

Set side data type used with all modes. Must be set for select mode. For +the list of frame side data types, refer to the AVFrameSideDataType enum +in libavutil/frame.h. For example, to choose +AV_FRAME_DATA_PANSCAN side data, you must specify PANSCAN. +

+
+
+ +
+
+

38.32 spectrumsynth

+ +

Synthesize audio from 2 input video spectrums, first input stream represents +magnitude across time and second represents phase across time. +The filter will transform from frequency domain as displayed in videos back +to time domain as presented in audio output. +

+

This filter is primarily created for reversing processed showspectrum +filter outputs, but can synthesize sound from other spectrograms too. +But in such case results are going to be poor if the phase data is not +available, because in such cases phase data need to be recreated, usually +it’s just recreated from random noise. +For best results use gray only output (channel color mode in +showspectrum filter) and log scale for magnitude video and +lin scale for phase video. To produce phase, for 2nd video, use +data option. Inputs videos should generally use fullframe +slide mode as that saves resources needed for decoding video. +

+

The filter accepts the following options: +

+
+
sample_rate
+

Specify sample rate of output audio, the sample rate of audio from which +spectrum was generated may differ. +

+
+
channels
+

Set number of channels represented in input video spectrums. +

+
+
scale
+

Set scale which was used when generating magnitude input spectrum. +Can be lin or log. Default is log. +

+
+
slide
+

Set slide which was used when generating inputs spectrums. +Can be replace, scroll, fullframe or rscroll. +Default is fullframe. +

+
+
win_func
+

Set window function used for resynthesis. +

+
+
overlap
+

Set window overlap. In range [0, 1]. Default is 1, +which means optimal overlap for selected window function will be picked. +

+
+
orientation
+

Set orientation of input videos. Can be vertical or horizontal. +Default is vertical. +

+
+ + +
+

38.32.1 Examples

+ +
    +
  • First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate, +then resynthesize videos back to audio with spectrumsynth: +
    +
    ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=log:overlap=0.875:color=channel:slide=fullframe:data=magnitude -an -c:v rawvideo magnitude.nut
    +ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=lin:overlap=0.875:color=channel:slide=fullframe:data=phase -an -c:v rawvideo phase.nut
    +ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
    +
    +
+ +
+
+
+

38.33 split, asplit

+ +

Split input into several identical outputs. +

+

asplit works with audio input, split with video. +

+

The filter accepts a single parameter which specifies the number of outputs. If +unspecified, it defaults to 2. +

+ +
+

38.33.1 Examples

+ +
    +
  • Create two separate outputs from the same input: +
    +
    [in] split [out0][out1]
    +
    + +
  • To create 3 or more outputs, you need to specify the number of +outputs, like in: +
    +
    [in] asplit=3 [out0][out1][out2]
    +
    + +
  • Create two separate outputs from the same input, one cropped and +one padded: +
    +
    [in] split [splitout1][splitout2];
    +[splitout1] crop=100:100:0:0    [cropout];
    +[splitout2] pad=200:200:100:100 [padout];
    +
    + +
  • Create 5 copies of the input audio with ffmpeg: +
    +
    ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
    +
    +
+ +
+
+
+

38.34 zmq, azmq

+ +

Receive commands sent through a libzmq client, and forward them to +filters in the filtergraph. +

+

zmq and azmq work as a pass-through filters. zmq +must be inserted between two video filters, azmq between two +audio filters. Both are capable to send messages to any filter type. +

+

To enable these filters you need to install the libzmq library and +headers and configure FFmpeg with --enable-libzmq. +

+

For more information about libzmq see: +http://www.zeromq.org/ +

+

The zmq and azmq filters work as a libzmq server, which +receives messages sent through a network interface defined by the +bind_address (or the abbreviation "b") option. +Default value of this option is tcp://localhost:5555. You may +want to alter this value to your needs, but do not forget to escape any +’:’ signs (see filtergraph escaping). +

+

The received message must be in the form: +

+
TARGET COMMAND [ARG]
+
+ +

TARGET specifies the target of the command, usually the name of +the filter class or a specific filter instance name. The default +filter instance name uses the pattern ‘Parsed_<filter_name>_<index>’, +but you can override this by using the ‘filter_name@id’ syntax +(see Filtergraph syntax). +

+

COMMAND specifies the name of the command for the target filter. +

+

ARG is optional and specifies the optional argument list for the +given COMMAND. +

+

Upon reception, the message is processed and the corresponding command +is injected into the filtergraph. Depending on the result, the filter +will send a reply to the client, adopting the format: +

+
ERROR_CODE ERROR_REASON
+MESSAGE
+
+ +

MESSAGE is optional. +

+ +
+

38.34.1 Examples

+ +

Look at tools/zmqsend for an example of a zmq client which can +be used to send commands processed by these filters. +

+

Consider the following filtergraph generated by ffplay. +In this example the last overlay filter has an instance name. All other +filters will have default instance names. +

+
+
ffplay -dumpgraph 1 -f lavfi "
+color=s=100x100:c=red  [l];
+color=s=100x100:c=blue [r];
+nullsrc=s=200x100, zmq [bg];
+[bg][l]   overlay     [bg+l];
+[bg+l][r] overlay@my=x=100 "
+
+ +

To change the color of the left side of the video, the following +command can be used: +

+
echo Parsed_color_0 c yellow | tools/zmqsend
+
+ +

To change the right side: +

+
echo Parsed_color_1 c pink | tools/zmqsend
+
+ +

To change the position of the right side: +

+
echo overlay@my x 150 | tools/zmqsend
+
+ + + +
+
+
+
+

39 Multimedia Sources

+ +

Below is a description of the currently available multimedia sources. +

+ +
+

39.1 amovie

+ +

This is the same as movie source, except it selects an audio +stream by default. +

+
+
+

39.2 avsynctest

+

Generate an Audio/Video Sync Test. +

+

Generated stream periodically shows flash video frame and emits beep in audio. +Useful to inspect A/V sync issues. +

+

It accepts the following options: +

+
+
size, s
+

Set output video size. Default value is hd720. +

+
+
framerate, fr
+

Set output video frame rate. Default value is 30. +

+
+
samplerate, sr
+

Set output audio sample rate. Default value is 44100. +

+
+
amplitude, a
+

Set output audio beep amplitude. Default value is 0.7. +

+
+
period, p
+

Set output audio beep period in seconds. Default value is 3. +

+
+
delay, dl
+

Set output video flash delay in number of frames. Default value is 0. +

+
+
cycle, c
+

Enable cycling of video delays, by default is disabled. +

+
+
duration, d
+

Set stream output duration. By default duration is unlimited. +

+
+
fg, bg, ag
+

Set foreground/background/additional color. +

+
+ + +
+

39.2.1 Commands

+ +

This source supports the some above options as commands. +

+
+
+
+

39.3 movie

+ +

Read audio and/or video stream(s) from a movie container. +

+

It accepts the following parameters: +

+
+
filename
+

The name of the resource to read (not necessarily a file; it can also be a +device or a stream accessed through some protocol). +

+
+
format_name, f
+

Specifies the format assumed for the movie to read, and can be either +the name of a container or an input device. If not specified, the +format is guessed from movie_name or by probing. +

+
+
seek_point, sp
+

Specifies the seek point in seconds. The frames will be output +starting from this seek point. The parameter is evaluated with +av_strtod, so the numerical value may be suffixed by an IS +postfix. The default value is "0". +

+
+
streams, s
+

Specifies the streams to read. Several streams can be specified, +separated by "+". The source will then have as many outputs, in the +same order. The syntax is explained in the (ffmpeg)"Stream specifiers" +section in the ffmpeg manual. Two special names, "dv" and "da" specify +respectively the default (best suited) video and audio stream. Default +is "dv", or "da" if the filter is called as "amovie". +

+
+
stream_index, si
+

Specifies the index of the video stream to read. If the value is -1, +the most suitable video stream will be automatically selected. The default +value is "-1". Deprecated. If the filter is called "amovie", it will select +audio instead of video. +

+
+
loop
+

Specifies how many times to read the stream in sequence. +If the value is 0, the stream will be looped infinitely. +Default value is "1". +

+

Note that when the movie is looped the source timestamps are not +changed, so it will generate non monotonically increasing timestamps. +

+
+
discontinuity
+

Specifies the time difference between frames above which the point is +considered a timestamp discontinuity which is removed by adjusting the later +timestamps. +

+
+
dec_threads
+

Specifies the number of threads for decoding +

+
+
format_opts
+

Specify format options for the opened file. Format options can be specified +as a list of key=value pairs separated by ’:’. The following example +shows how to add protocol_whitelist and protocol_blacklist options: +

+
ffplay -f lavfi
+"movie=filename='1.sdp':format_opts='protocol_whitelist=file,rtp,udp\:protocol_blacklist=http'"
+
+
+
+ +

It allows overlaying a second video on top of the main input of +a filtergraph, as shown in this graph: +

+
input -----------> deltapts0 --> overlay --> output
+                                    ^
+                                    |
+movie --> scale--> deltapts1 -------+
+
+ +
+

39.3.1 Examples

+ +
    +
  • Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it +on top of the input labelled "in": +
    +
    movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
    +[in] setpts=PTS-STARTPTS [main];
    +[main][over] overlay=16:16 [out]
    +
    + +
  • Read from a video4linux2 device, and overlay it on top of the input +labelled "in": +
    +
    movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
    +[in] setpts=PTS-STARTPTS [main];
    +[main][over] overlay=16:16 [out]
    +
    + +
  • Read the first video stream and the audio stream with id 0x81 from +dvd.vob; the video is connected to the pad named "video" and the audio is +connected to the pad named "audio": +
    +
    movie=dvd.vob:s=v:0+#0x81 [video] [audio]
    +
    +
+ +
+
+

39.3.2 Commands

+ +

Both movie and amovie support the following commands: +

+
seek
+

Perform seek using "av_seek_frame". +The syntax is: seek stream_index|timestamp|flags +

    +
  • stream_index: If stream_index is -1, a default +stream is selected, and timestamp is automatically converted +from AV_TIME_BASE units to the stream specific time_base. +
  • timestamp: Timestamp in AVStream.time_base units +or, if no stream is specified, in AV_TIME_BASE units. +
  • flags: Flags which select direction and seeking mode. +
+ +
+
get_duration
+

Get movie duration in AV_TIME_BASE units. +

+
+
+ +
+
+
+
+

40 External libraries

+ +

FFmpeg can be hooked up with a number of external libraries to add support +for more formats. None of them are used by default, their use has to be +explicitly requested by passing the appropriate flags to +./configure. +

+ +
+

40.1 Alliance for Open Media (AOM)

+ +

FFmpeg can make use of the AOM library for AV1 decoding and encoding. +

+

Go to http://aomedia.org/ and follow the instructions for +installing the library. Then pass --enable-libaom to configure to +enable it. +

+
+
+

40.2 AMD AMF/VCE

+ +

FFmpeg can use the AMD Advanced Media Framework library +for accelerated H.264 and HEVC(only windows) encoding on hardware with Video Coding Engine (VCE). +

+

To enable support you must obtain the AMF framework header files(version 1.4.9+) from +https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git. +

+

Create an AMF/ directory in the system include path. +Copy the contents of AMF/amf/public/include/ into that directory. +Then configure FFmpeg with --enable-amf. +

+

Initialization of amf encoder occurs in this order: +1) trying to initialize through dx11(only windows) +2) trying to initialize through dx9(only windows) +3) trying to initialize through vulkan +

+

To use h.264(AMD VCE) encoder on linux amdgru-pro version 19.20+ and amf-amdgpu-pro +package(amdgru-pro contains, but does not install automatically) are required. +

+

This driver can be installed using amdgpu-pro-install script in official amd driver archive. +

+
+
+

40.3 AviSynth

+ +

FFmpeg can read AviSynth scripts as input. To enable support, pass +--enable-avisynth to configure after installing the headers +provided by AviSynth+. +AviSynth+ can be configured to install only the headers by either +passing -DHEADERS_ONLY:bool=on to the normal CMake-based build +system, or by using the supplied GNUmakefile. +

+

For Windows, supported AviSynth variants are +AviSynth 2.6 RC1 or higher for 32-bit builds and +AviSynth+ r1718 or higher for 32-bit and 64-bit builds. +

+

For Linux, macOS, and BSD, the only supported AviSynth variant is +AviSynth+, starting with version 3.5. +

+
+

In 2016, AviSynth+ added support for building with GCC. However, due to +the eccentricities of Windows’ calling conventions, 32-bit GCC builds +of AviSynth+ are not compatible with typical 32-bit builds of FFmpeg. +

+

By default, FFmpeg assumes compatibility with 32-bit MSVC builds of +AviSynth+ since that is the most widely-used and entrenched build +configuration. Users can override this and enable support for 32-bit +GCC builds of AviSynth+ by passing -DAVSC_WIN32_GCC32 to +--extra-cflags when configuring FFmpeg. +

+

64-bit builds of FFmpeg are not affected, and can use either MSVC or +GCC builds of AviSynth+ without any special flags. +

NOTE +

+
+

AviSynth(+) is loaded dynamically. Distributors can build FFmpeg +with --enable-avisynth, and the binaries will work regardless +of the end user having AviSynth installed. If/when an end user +would like to use AviSynth scripts, then they can install AviSynth(+) +and FFmpeg will be able to find and use it to open scripts. +

NOTE +

+
+
+

40.4 Chromaprint

+ +

FFmpeg can make use of the Chromaprint library for generating audio fingerprints. +Pass --enable-chromaprint to configure to +enable it. See https://acoustid.org/chromaprint. +

+
+
+

40.5 codec2

+ +

FFmpeg can make use of the codec2 library for codec2 decoding and encoding. +There is currently no native decoder, so libcodec2 must be used for decoding. +

+

Go to http://freedv.org/, download "Codec 2 source archive". +Build and install using CMake. Debian users can install the libcodec2-dev package instead. +Once libcodec2 is installed you can pass --enable-libcodec2 to configure to enable it. +

+

The easiest way to use codec2 is with .c2 files, since they contain the mode information required for decoding. +To encode such a file, use a .c2 file extension and give the libcodec2 encoder the -mode option: +ffmpeg -i input.wav -mode 700C output.c2. +Playback is as simple as ffplay output.c2. +For a list of supported modes, run ffmpeg -h encoder=libcodec2. +Raw codec2 files are also supported. +To make sense of them the mode in use needs to be specified as a format option: +ffmpeg -f codec2raw -mode 1300 -i input.raw output.wav. +

+
+
+

40.6 dav1d

+ +

FFmpeg can make use of the dav1d library for AV1 video decoding. +

+

Go to https://code.videolan.org/videolan/dav1d and follow the instructions for +installing the library. Then pass --enable-libdav1d to configure to enable it. +

+
+
+

40.7 davs2

+ +

FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video decoding. +

+

Go to https://github.com/pkuvcl/davs2 and follow the instructions for +installing the library. Then pass --enable-libdavs2 to configure to +enable it. +

+
+

libdavs2 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

40.8 uavs3d

+ +

FFmpeg can make use of the uavs3d library for AVS3-P2/IEEE1857.10 video decoding. +

+

Go to https://github.com/uavs3/uavs3d and follow the instructions for +installing the library. Then pass --enable-libuavs3d to configure to +enable it. +

+
+
+

40.9 Game Music Emu

+ +

FFmpeg can make use of the Game Music Emu library to read audio from supported video game +music file formats. Pass --enable-libgme to configure to +enable it. See https://bitbucket.org/mpyne/game-music-emu/overview. +

+
+
+

40.10 Intel QuickSync Video

+ +

FFmpeg can use Intel QuickSync Video (QSV) for accelerated decoding and encoding +of multiple codecs. To use QSV, FFmpeg must be linked against the libmfx +dispatcher, which loads the actual decoding libraries. +

+

The dispatcher is open source and can be downloaded from +https://github.com/lu-zero/mfx_dispatch.git. FFmpeg needs to be configured +with the --enable-libmfx option and pkg-config needs to be able to +locate the dispatcher’s .pc files. +

+
+
+

40.11 Kvazaar

+ +

FFmpeg can make use of the Kvazaar library for HEVC encoding. +

+

Go to https://github.com/ultravideo/kvazaar and follow the +instructions for installing the library. Then pass +--enable-libkvazaar to configure to enable it. +

+
+
+

40.12 LAME

+ +

FFmpeg can make use of the LAME library for MP3 encoding. +

+

Go to http://lame.sourceforge.net/ and follow the +instructions for installing the library. +Then pass --enable-libmp3lame to configure to enable it. +

+
+
+

40.13 libilbc

+ +

iLBC is a narrowband speech codec that has been made freely available +by Google as part of the WebRTC project. libilbc is a packaging friendly +copy of the iLBC codec. FFmpeg can make use of the libilbc library for +iLBC decoding and encoding. +

+

Go to https://github.com/TimothyGu/libilbc and follow the instructions for +installing the library. Then pass --enable-libilbc to configure to +enable it. +

+
+
+

40.14 libjxl

+ +

JPEG XL is an image format intended to fully replace legacy JPEG for an extended +period of life. See https://jpegxl.info/ for more information, and see +https://github.com/libjxl/libjxl for the library source. You can pass +--enable-libjxl to configure in order enable the libjxl wrapper. +

+
+
+

40.15 libvpx

+ +

FFmpeg can make use of the libvpx library for VP8/VP9 decoding and encoding. +

+

Go to http://www.webmproject.org/ and follow the instructions for +installing the library. Then pass --enable-libvpx to configure to +enable it. +

+
+
+

40.16 ModPlug

+ +

FFmpeg can make use of this library, originating in Modplug-XMMS, to read from MOD-like music files. +See https://github.com/Konstanty/libmodplug. Pass --enable-libmodplug to configure to +enable it. +

+
+
+

40.17 OpenCORE, VisualOn, and Fraunhofer libraries

+ +

Spun off Google Android sources, OpenCore, VisualOn and Fraunhofer +libraries provide encoders for a number of audio codecs. +

+
+

OpenCORE and VisualOn libraries are under the Apache License 2.0 +(see http://www.apache.org/licenses/LICENSE-2.0 for details), which is +incompatible to the LGPL version 2.1 and GPL version 2. You have to +upgrade FFmpeg’s license to LGPL version 3 (or if you have enabled +GPL components, GPL version 3) by passing --enable-version3 to configure in +order to use it. +

+

The license of the Fraunhofer AAC library is incompatible with the GPL. +Therefore, for GPL builds, you have to pass --enable-nonfree to +configure in order to use it. To the best of our knowledge, it is +compatible with the LGPL. +

NOTE +

+ +
+

40.17.1 OpenCORE AMR

+ +

FFmpeg can make use of the OpenCORE libraries for AMR-NB +decoding/encoding and AMR-WB decoding. +

+

Go to http://sourceforge.net/projects/opencore-amr/ and follow the +instructions for installing the libraries. +Then pass --enable-libopencore-amrnb and/or +--enable-libopencore-amrwb to configure to enable them. +

+
+
+

40.17.2 VisualOn AMR-WB encoder library

+ +

FFmpeg can make use of the VisualOn AMR-WBenc library for AMR-WB encoding. +

+

Go to http://sourceforge.net/projects/opencore-amr/ and follow the +instructions for installing the library. +Then pass --enable-libvo-amrwbenc to configure to enable it. +

+
+
+

40.17.3 Fraunhofer AAC library

+ +

FFmpeg can make use of the Fraunhofer AAC library for AAC decoding & encoding. +

+

Go to http://sourceforge.net/projects/opencore-amr/ and follow the +instructions for installing the library. +Then pass --enable-libfdk-aac to configure to enable it. +

+
+
+
+

40.18 OpenH264

+ +

FFmpeg can make use of the OpenH264 library for H.264 decoding and encoding. +

+

Go to http://www.openh264.org/ and follow the instructions for +installing the library. Then pass --enable-libopenh264 to configure to +enable it. +

+

For decoding, this library is much more limited than the built-in decoder +in libavcodec; currently, this library lacks support for decoding B-frames +and some other main/high profile features. (It currently only supports +constrained baseline profile and CABAC.) Using it is mostly useful for +testing and for taking advantage of Cisco’s patent portfolio license +(http://www.openh264.org/BINARY_LICENSE.txt). +

+
+
+

40.19 OpenJPEG

+ +

FFmpeg can use the OpenJPEG libraries for decoding/encoding J2K videos. Go to +http://www.openjpeg.org/ to get the libraries and follow the installation +instructions. To enable using OpenJPEG in FFmpeg, pass --enable-libopenjpeg to +./configure. +

+
+
+

40.20 rav1e

+ +

FFmpeg can make use of rav1e (Rust AV1 Encoder) via its C bindings to encode videos. +Go to https://github.com/xiph/rav1e/ and follow the instructions to build +the C library. To enable using rav1e in FFmpeg, pass --enable-librav1e +to ./configure. +

+
+
+

40.21 SVT-AV1

+ +

FFmpeg can make use of the Scalable Video Technology for AV1 library for AV1 encoding. +

+

Go to https://gitlab.com/AOMediaCodec/SVT-AV1/ and follow the instructions +for installing the library. Then pass --enable-libsvtav1 to configure to +enable it. +

+
+
+

40.22 TwoLAME

+ +

FFmpeg can make use of the TwoLAME library for MP2 encoding. +

+

Go to http://www.twolame.org/ and follow the +instructions for installing the library. +Then pass --enable-libtwolame to configure to enable it. +

+
+
+

40.23 VapourSynth

+ +

FFmpeg can read VapourSynth scripts as input. To enable support, pass +--enable-vapoursynth to configure. Vapoursynth is detected via +pkg-config. Versions 42 or greater supported. +See http://www.vapoursynth.com/. +

+

Due to security concerns, Vapoursynth scripts will not +be autodetected so the input format has to be forced. For ff* CLI tools, +add -f vapoursynth before the input -i yourscript.vpy. +

+
+
+

40.24 x264

+ +

FFmpeg can make use of the x264 library for H.264 encoding. +

+

Go to http://www.videolan.org/developers/x264.html and follow the +instructions for installing the library. Then pass --enable-libx264 to +configure to enable it. +

+
+

x264 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

40.25 x265

+ +

FFmpeg can make use of the x265 library for HEVC encoding. +

+

Go to http://x265.org/developers.html and follow the instructions +for installing the library. Then pass --enable-libx265 to configure +to enable it. +

+
+

x265 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

40.26 xavs

+ +

FFmpeg can make use of the xavs library for AVS encoding. +

+

Go to http://xavs.sf.net/ and follow the instructions for +installing the library. Then pass --enable-libxavs to configure to +enable it. +

+
+
+

40.27 xavs2

+ +

FFmpeg can make use of the xavs2 library for AVS2-P2/IEEE1857.4 video encoding. +

+

Go to https://github.com/pkuvcl/xavs2 and follow the instructions for +installing the library. Then pass --enable-libxavs2 to configure to +enable it. +

+
+

libxavs2 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

40.28 ZVBI

+ +

ZVBI is a VBI decoding library which can be used by FFmpeg to decode DVB +teletext pages and DVB teletext subtitles. +

+

Go to http://sourceforge.net/projects/zapping/ and follow the instructions for +installing the library. Then pass --enable-libzvbi to configure to +enable it. +

+
+
+
+

41 Supported File Formats, Codecs or Features

+ +

You can use the -formats and -codecs options to have an exhaustive list. +

+ +
+

41.1 File Formats

+ +

FFmpeg supports the following file formats through the libavformat +library: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
3dostrX
4xmX4X Technologies format, used in some games.
8088flex TMVX
AAXXAudible Enhanced Audio format, used in audiobooks.
AAXAudible Format 2, 3, and 4, used in audiobooks.
ACT VoiceXcontains G.729 audio
Adobe FilmstripXX
Audio IFF (AIFF)XX
American Laser Games MMXMultimedia format used in games like Mad Dog McCree.
3GPP AMRXX
Amazing Studio Packed Animation FileXMultimedia format used in game Heart Of Darkness.
Apple HTTP Live StreamingX
Artworx Data FormatX
Interplay ACMXAudio only format used in some Interplay games.
ADPXAudio format used on the Nintendo Gamecube.
AFCXAudio format used on the Nintendo Gamecube.
ADS/SS2XAudio format used on the PS2.
APNGXX
ASFXXAdvanced / Active Streaming Format.
ASTXXAudio format used on the Nintendo Wii.
AVIXX
AviSynthX
AVRXAudio format used on Mac.
AVSXMultimedia format used by the Creature Shock game.
Beam Software SIFFXAudio and video format used in some games by Beam Software.
Bethesda Softworks VIDXUsed in some games from Bethesda Softworks.
Binary textX
BinkXMultimedia format used by many games.
Bink AudioXAudio only multimedia format used by some games.
Bitmap Brothers JVXUsed in Z and Z95 games.
BRPXArgonaut Games format.
Brute Force & IgnoranceXUsed in the game Flash Traffic: City of Angels.
BFSTMXAudio format used on the Nintendo WiiU (based on BRSTM).
BRSTMXAudio format used on the Nintendo Wii.
BW64XBroadcast Wave 64bit.
BWFXX
codec2 (raw)XXMust be given -mode format option to decode correctly.
codec2 (.c2 files)XXContains header with version and mode info, simplifying playback.
CRI ADXXXAudio-only format used in console video games.
CRI AIXX
CRI HCAXAudio-only format used in console video games.
Discworld II BMVX
Interplay C93XUsed in the game Cyberia from Interplay.
Delphine Software International CINXMultimedia format used by Delphine Software games.
Digital Speech Standard (DSS)X
CD+GXVideo format used by CD+G karaoke disks
Phantom CineX
Commodore CDXLXAmiga CD video format
Core Audio FormatXXApple Core Audio Format
CRC testing formatX
Creative VoiceXXCreated for the Sound Blaster Pro.
CRYO APCXAudio format used in some games by CRYO Interactive Entertainment.
D-Cinema audioXX
Deluxe Paint AnimationX
DCSTRX
DFAXThis format is used in Chronomaster game
DirectDraw SurfaceX
DSD Stream File (DSF)X
DV videoXX
DXAXThis format is used in the non-Windows version of the Feeble Files + game and different game cutscenes repacked for use with ScummVM.
Electronic Arts cdataX
Electronic Arts MultimediaXUsed in various EA games; files have extensions like WVE and UV2.
Ensoniq Paris Audio FileX
FFM (FFserver live feed)XX
Flash (SWF)XX
Flash 9 (AVM2)XXOnly embedded audio is decoded.
FLI/FLC/FLX animationX.fli/.flc files
Flash Video (FLV)XXMacromedia Flash video files
framecrc testing formatX
FunCom ISSXAudio format used in various games from FunCom like The Longest Journey.
G.723.1XX
G.726XBoth left- and right-justified.
G.729 BITXX
G.729 rawX
GENHXAudio format for various games.
GIF AnimationXX
GXFXXGeneral eXchange Format SMPTE 360M, used by Thomson Grass Valley + playout servers.
HNMXOnly version 4 supported, used in some games from Cryo Interactive
iCEDraw FileX
ICOXXMicrosoft Windows ICO
id Quake II CIN videoX
id RoQXXUsed in Quake III, Jedi Knight 2 and other computer games.
IEC61937 encapsulationXX
IFFXInterchange File Format
IFVXA format used by some old CCTV DVRs.
iLBCXX
Interplay MVEXFormat used in various Interplay computer games.
Iterated Systems ClearVideoXI-frames only
IV8XA format generated by IndigoVision 8000 video server.
IVF (On2)XXA format used by libvpx
Internet Video RecordingX
IRCAMXX
LAFXLimitless Audio Format
LATMXX
LMLM4XUsed by Linux Media Labs MPEG-4 PCI boards
LOASXcontains LATM multiplexed AAC audio
LRCXX
LVFX
LXFXVR native stream format, used by Leitch/Harris’ video servers.
Magic Lantern Video (MLV)X
MatroskaXX
Matroska audioX
FFmpeg metadataXXMetadata in text format.
MAXIS XAXUsed in Sim City 3000; file extension .xa.
MCAXUsed in some games from Capcom; file extension .mca.
MD StudioX
Metal Gear Solid: The Twin SnakesX
Megalux FrameXUsed by Megalux Ultimate Paint
MobiClip MODSX
MobiClip MOFLEXX
Mobotix .mxgX
Monkey’s AudioX
Motion Pixels MVIX
MOV/QuickTime/MP4XX3GP, 3GP2, PSP, iPod variants supported
MP2XX
MP3XX
MPEG-1 SystemXXmuxed audio and video, VCD format supported
MPEG-PS (program stream)XXalso known as VOB file, SVCD and DVD format supported
MPEG-TS (transport stream)XXalso known as DVB Transport Stream
MPEG-4XXMPEG-4 is a variant of QuickTime.
MSFXAudio format used on the PS3.
Mirillis FIC videoXNo cursor rendering.
MIDI Sample Dump StandardX
MIME multipart JPEGX
MSN TCP webcamXUsed by MSN Messenger webcam streams.
MTVX
MusepackX
Musepack SV8X
Material eXchange Format (MXF)XXSMPTE 377M, used by D-Cinema, broadcast industry.
Material eXchange Format (MXF), D-10 MappingXXSMPTE 386M, D-10/IMX Mapping.
NC camera feedXNC (AVIP NC4600) camera streams
NIST SPeech HEader REsourcesX
Computerized Speech Lab NSPX
NTT TwinVQ (VQF)XNippon Telegraph and Telephone Corporation TwinVQ.
Nullsoft Streaming VideoX
NuppelVideoX
NUTXXNUT Open Container Format
OggXX
Playstation Portable PMPX
Portable Voice FormatX
RK Audio (RKA)X
TechnoTrend PVAXUsed by TechnoTrend DVB PCI boards.
QCPX
raw ADTS (AAC)XX
raw AC-3XX
raw AMR-NBX
raw AMR-WBX
raw APACX
raw aptXXX
raw aptX HDXX
raw BonkX
raw Chinese AVS videoXX
raw DFPWMXX
raw DiracXX
raw DNxHDXX
raw DTSXX
raw DTS-HDX
raw E-AC-3XX
raw FLACXX
raw GSMX
raw H.261XX
raw H.263XX
raw H.264XX
raw HEVCXX
raw Ingenient MJPEGX
raw MJPEGXX
raw MLPX
raw MPEGX
raw MPEG-1X
raw MPEG-2X
raw MPEG-4XX
raw NULLX
raw videoXX
raw id RoQX
raw OBUXX
raw SBCXX
raw ShortenX
raw TAKX
raw TrueHDXX
raw VC-1XX
raw PCM A-lawXX
raw PCM mu-lawXX
raw PCM Archimedes VIDCXX
raw PCM signed 8 bitXX
raw PCM signed 16 bit big-endianXX
raw PCM signed 16 bit little-endianXX
raw PCM signed 24 bit big-endianXX
raw PCM signed 24 bit little-endianXX
raw PCM signed 32 bit big-endianXX
raw PCM signed 32 bit little-endianXX
raw PCM signed 64 bit big-endianXX
raw PCM signed 64 bit little-endianXX
raw PCM unsigned 8 bitXX
raw PCM unsigned 16 bit big-endianXX
raw PCM unsigned 16 bit little-endianXX
raw PCM unsigned 24 bit big-endianXX
raw PCM unsigned 24 bit little-endianXX
raw PCM unsigned 32 bit big-endianXX
raw PCM unsigned 32 bit little-endianXX
raw PCM 16.8 floating point little-endianX
raw PCM 24.0 floating point little-endianX
raw PCM floating-point 32 bit big-endianXX
raw PCM floating-point 32 bit little-endianXX
raw PCM floating-point 64 bit big-endianXX
raw PCM floating-point 64 bit little-endianXX
RDTX
REDCODE R3DXFile format used by RED Digital cameras, contains JPEG 2000 frames and PCM audio.
RealMediaXX
RedirectorX
RedSparkX
Renderware TeXture DictionaryX
Resolume DXVX
RF64X
RL2XAudio and video format used in some games by Entertainment Software Partners.
RPL/ARMovieX
Lego Mindstorms RSOXX
RSDX
RTMPXXOutput is performed by publishing stream to RTMP server
RTPXX
RTSPXX
Sample Dump eXchangeX
SAPXX
SBGX
SDNSX
SDPX
SERX
Digital Pictures SGAX
Sega FILM/CPKXXUsed in many Sega Saturn console games.
Silicon Graphics MovieX
Sierra SOLX.sol files used in Sierra Online games.
Sierra VMDXUsed in Sierra CD-ROM games.
SmackerXMultimedia format used by many games.
SMJPEGXXUsed in certain Loki game ports.
SMPTE 337M encapsulationX
SmushXMultimedia format used in some LucasArts games.
Sony OpenMG (OMA)XXAudio format used in Sony Sonic Stage and Sony Vegas.
Sony PlayStation STRX
Sony Wave64 (W64)XX
SoX native formatXX
SUN AU formatXX
SUP raw PGS subtitlesXX
SVAGXAudio format used in Konami PS2 games.
TDSCX
Text filesX
THPXUsed on the Nintendo GameCube.
Tiertex Limited SEQXTiertex .seq files used in the DOS CD-ROM version of the game Flashback.
True AudioXX
VAGXAudio format used in many Sony PS2 games.
VC-1 test bitstreamXX
Vidvox HapXX
VivoX
VPKXAudio format used in Sony PS games.
Marble WADYX
WAVXX
Waveform ArchiverX
WavPackXX
WebMXX
Windows Televison (WTV)XX
Wing Commander III movieXMultimedia format used in Origin’s Wing Commander III computer game.
Westwood Studios audioXXMultimedia format used in Westwood Studios games.
Westwood Studios VQAXMultimedia format used in Westwood Studios games.
Wideband Single-bit Data (WSD)X
WVEX
Konami XMDX
XMVXMicrosoft video container used in Xbox games.
XVAGXAudio format used on the PS3.
xWMAXMicrosoft audio container used by XAudio 2.
eXtended BINary text (XBIN)X
YUV4MPEG pipeXX
Psygnosis YOPX
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+
+
+

41.2 Image Formats

+ +

FFmpeg can read and write images for each frame of a video sequence. The +following image formats are supported: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
.Y.U.VXXone raw file per component
Alias PIXXXAlias/Wavefront PIX image format
animated GIFXX
APNGXXAnimated Portable Network Graphics
BMPXXMicrosoft BMP image
BRender PIXXArgonaut BRender 3D engine image format.
CRIXCintel RAW
DPXXXDigital Picture Exchange
EXRXOpenEXR
FITSXXFlexible Image Transport System
HDRXXRadiance HDR RGBE Image format
IMGXGEM Raster image
JPEGXXProgressive JPEG is not supported.
JPEG 2000XX
JPEG-LSXX
LJPEGXLossless JPEG
Media 100X
MSPXMicrosoft Paint image
PAMXXPAM is a PNM extension with alpha support.
PBMXXPortable BitMap image
PCDXPhotoCD
PCXXXPC Paintbrush
PFMXXPortable FloatMap image
PGMXXPortable GrayMap image
PGMYUVXXPGM with U and V components in YUV 4:2:0
PGXXPGX file decoder
PHMXXPortable HalfFloatMap image
PICXPictor/PC Paint
PNGXXPortable Network Graphics image
PPMXXPortable PixelMap image
PSDXPhotoshop
PTXXV.Flash PTX format
QOIXXQuite OK Image format
SGIXXSGI RGB image format
Sun RasterfileXXSun RAS image format
TIFFXXYUV, JPEG and some extension is not supported yet.
Truevision TargaXXTarga (.TGA) image format
VBNXXVizrt Binary Image format
WBMPXXWireless Application Protocol Bitmap image format
WebPEXWebP image format, encoding supported through external library libwebp
XBMXXX BitMap image format
XFaceXXX-Face image format
XPMXX PixMap image format
XWDXXX Window Dump image format
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+

E means that support is provided through an external library. +

+
+
+

41.3 Video Codecs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
4X MovieXUsed in certain computer games.
8088flex TMVX
A64 multicolorXCreates video suitable to be played on a commodore 64 (multicolor mode).
Amazing Studio PAF VideoX
American Laser Games MMXUsed in games like Mad Dog McCree.
Amuse Graphics MovieX
AMV VideoXXUsed in Chinese MP3 players.
ANSI/ASCII artX
Apple Intermediate CodecX
Apple MJPEG-BX
Apple PixletX
Apple ProResXXfourcc: apch,apcn,apcs,apco,ap4h,ap4x
Apple QuickDrawXfourcc: qdrw
Argonaut VideoXUsed in some Argonaut games.
Asus v1XXfourcc: ASV1
Asus v2XXfourcc: ASV2
ATI VCR1Xfourcc: VCR1
ATI VCR2Xfourcc: VCR2
Auravision AuraX
Auravision Aura 2X
Autodesk Animator Flic videoX
Autodesk RLEXfourcc: AASC
AV1EESupported through external libraries libaom, libdav1d, librav1e and libsvtav1
Avid 1:1 10-bit RGB PackerXXfourcc: AVrp
AVS (Audio Video Standard) videoXVideo encoding used by the Creature Shock game.
AVS2-P2/IEEE1857.4EESupported through external libraries libxavs2 and libdavs2
AVS3-P2/IEEE1857.10ESupported through external library libuavs3d
AYUVXXMicrosoft uncompressed packed 4:4:4:4
Beam Software VBX
Bethesda VID videoXUsed in some games from Bethesda Softworks.
Bink VideoX
BitJazz SheerVideoX
Bitmap Brothers JV videoX
y41p Brooktree uncompressed 4:1:1 12-bitXX
Brooktree ProSumer VideoXfourcc: BT20
Brute Force & IgnoranceXUsed in the game Flash Traffic: City of Angels.
C93 videoXCodec used in Cyberia game.
CamStudioXfourcc: CSCD
CD+GXVideo codec for CD+G karaoke disks
CDXLXAmiga CD video codec
Chinese AVS videoEXAVS1-P2, JiZhun profile, encoding through external library libxavs
Delphine Software International CIN videoXCodec used in Delphine Software International games.
Discworld II BMV VideoX
CineForm HDXX
Canopus HQX
Canopus HQAX
Canopus HQXX
Canopus Lossless CodecX
CDToonsXCodec used in various Broderbund games.
CinepakX
Cirrus Logic AccuPakXXfourcc: CLJR
CPiA Video FormatX
Creative YUV (CYUV)X
DFAXCodec used in Chronomaster game.
DiracEXsupported though the native vc2 (Dirac Pro) encoder
Deluxe Paint AnimationX
DNxHDXXaka SMPTE VC3
Duck TrueMotion 1.0Xfourcc: DUCK
Duck TrueMotion 2.0Xfourcc: TM20
Duck TrueMotion 2.0 RTXfourcc: TR20
DV (Digital Video)XX
Dxtory capture formatX
Feeble Files/ScummVM DXAXCodec originally used in Feeble Files game.
Electronic Arts CMV videoXUsed in NHL 95 game.
Electronic Arts Madcow videoX
Electronic Arts TGV videoX
Electronic Arts TGQ videoX
Electronic Arts TQI videoX
Escape 124X
Escape 130X
FFmpeg video codec #1XXlossless codec (fourcc: FFV1)
Flash Screen Video v1XXfourcc: FSV1
Flash Screen Video v2XX
Flash Video (FLV)XXSorenson H.263 used in Flash
FM Screen Capture CodecX
Forward UncompressedX
FrapsX
Go2MeetingXfourcc: G2M2, G2M3
Go2WebinarXfourcc: G2M4
Gremlin Digital VideoX
H.261XX
H.263 / H.263-1996XX
H.263+ / H.263-1998 / H.263 version 2XX
H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10EXencoding supported through external library libx264 and OpenH264
HEVCXXencoding supported through external library libx265 and libkvazaar
HNM version 4X
HuffYUVXX
HuffYUV FFmpeg variantXX
IBM UltimotionXfourcc: ULTI
id Cinematic videoXUsed in Quake II.
id RoQ videoXXUsed in Quake III, Jedi Knight 2, other computer games.
IFF ILBMXIFF interleaved bitmap
IFF ByteRun1XIFF run length encoded bitmap
Infinity IMM4X
Intel H.263X
Intel Indeo 2X
Intel Indeo 3X
Intel Indeo 4X
Intel Indeo 5X
Interplay C93XUsed in the game Cyberia from Interplay.
Interplay MVE videoXUsed in Interplay .MVE files.
J2KXX
Karl Morton’s video codecXCodec used in Worms games.
Kega Game Video (KGV1)XKega emulator screen capture codec.
LagarithX
LCL (LossLess Codec Library) MSZHX
LCL (LossLess Codec Library) ZLIBEE
LOCOX
LucasArts SANM/SmushXUsed in LucasArts games / SMUSH animations.
lossless MJPEGXX
MagicYUV VideoXX
Mandsoft Screen Capture CodecX
Microsoft ATC ScreenXAlso known as Microsoft Screen 3.
Microsoft Expression Encoder ScreenXAlso known as Microsoft Titanium Screen 2.
Microsoft RLEX
Microsoft Screen 1XAlso known as Windows Media Video V7 Screen.
Microsoft Screen 2XAlso known as Windows Media Video V9 Screen.
Microsoft Video 1X
MimicXUsed in MSN Messenger Webcam streams.
Miro VideoXLXfourcc: VIXL
MJPEG (Motion JPEG)XX
Mobotix MxPEG videoX
Motion Pixels videoX
MPEG-1 videoXX
MPEG-2 videoXX
MPEG-4 part 2XXlibxvidcore can be used alternatively for encoding.
MPEG-4 part 2 Microsoft variant version 1X
MPEG-4 part 2 Microsoft variant version 2XX
MPEG-4 part 2 Microsoft variant version 3XX
Newtek SpeedHQXX
Nintendo Gamecube THP videoX
NotchLCX
NuppelVideo/RTjpegXVideo encoding used in NuppelVideo files.
On2 VP3Xstill experimental
On2 VP4Xfourcc: VP40
On2 VP5Xfourcc: VP50
On2 VP6Xfourcc: VP60,VP61,VP62
On2 VP7Xfourcc: VP70,VP71
VP8EXfourcc: VP80, encoding supported through external library libvpx
VP9EXencoding supported through external library libvpx
Pinnacle TARGA CineWave YUV16Xfourcc: Y216
Q-team QPEGXfourccs: QPEG, Q1.0, Q1.1
QuickTime 8BPS videoX
QuickTime Animation (RLE) videoXXfourcc: ’rle ’
QuickTime Graphics (SMC)XXfourcc: ’smc ’
QuickTime video (RPZA)XXfourcc: rpza
R10K AJA Kona 10-bit RGB CodecXX
R210 Quicktime Uncompressed RGB 10-bitXX
Raw VideoXX
RealVideo 1.0XX
RealVideo 2.0XX
RealVideo 3.0Xstill far from ideal
RealVideo 4.0X
Renderware TXD (TeXture Dictionary)XTexture dictionaries used by the Renderware Engine.
RL2 videoXused in some games by Entertainment Software Partners
ScreenPressorX
ScreenpressoX
Screen Recorder Gold CodecX
Sierra VMD videoXUsed in Sierra VMD files.
Silicon Graphics Motion Video Compressor 1 (MVC1)X
Silicon Graphics Motion Video Compressor 2 (MVC2)X
Silicon Graphics RLE 8-bit videoX
Smacker videoXVideo encoding used in Smacker.
SMPTE VC-1X
SnowXXexperimental wavelet codec (fourcc: SNOW)
Sony PlayStation MDEC (Motion DECoder)X
Sorenson Vector Quantizer 1XXfourcc: SVQ1
Sorenson Vector Quantizer 3Xfourcc: SVQ3
Sunplus JPEG (SP5X)Xfourcc: SP5X
TechSmith Screen Capture CodecXfourcc: TSCC
TechSmith Screen Capture Codec 2Xfourcc: TSC2
TheoraEXencoding supported through external library libtheora
Tiertex Limited SEQ videoXCodec used in DOS CD-ROM FlashBack game.
Ut VideoXX
v210 QuickTime uncompressed 4:2:2 10-bitXX
v308 QuickTime uncompressed 4:4:4XX
v408 QuickTime uncompressed 4:4:4:4XX
v410 QuickTime uncompressed 4:4:4 10-bitXX
VBLE Lossless CodecX
VMware Screen Codec / VMware VideoXCodec used in videos captured by VMware.
Westwood Studios VQA (Vector Quantized Animation) videoX
Windows Media ImageX
Windows Media Video 7XX
Windows Media Video 8XX
Windows Media Video 9Xnot completely working
Wing Commander III / XanXUsed in Wing Commander III .MVE files.
Wing Commander IV / XanXUsed in Wing Commander IV.
Winnov WNV1X
WMV7XX
YAMAHA SMAFXX
Psygnosis YOP VideoX
yuv4XXlibquicktime uncompressed packed 4:2:0
ZeroCodec Lossless VideoX
ZLIBXXpart of LCL, encoder experimental
Zip Motion Blocks VideoXXEncoder works only in PAL8.
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+

E means that support is provided through an external library. +

+
+
+

41.4 Audio Codecs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
8SVX exponentialX
8SVX fibonacciX
AACEXXencoding supported through internal encoder and external library libfdk-aac
AAC+EIXencoding supported through external library libfdk-aac
AC-3IXIX
ACELP.KELVINX
ADPCM 4X MovieX
ADPCM Yamaha AICAX
ADPCM AmuseGraphics MovieX
ADPCM Argonaut GamesXX
ADPCM CDROM XAX
ADPCM Creative TechnologyX16 -> 4, 8 -> 4, 8 -> 3, 8 -> 2
ADPCM Electronic ArtsXUsed in various EA titles.
ADPCM Electronic Arts Maxis CDROM XSXUsed in Sim City 3000.
ADPCM Electronic Arts R1X
ADPCM Electronic Arts R2X
ADPCM Electronic Arts R3X
ADPCM Electronic Arts XASX
ADPCM G.722XX
ADPCM G.726XX
ADPCM IMA Acorn ReplayX
ADPCM IMA AMVXXUsed in AMV files
ADPCM IMA Cunning DevelopmentsX
ADPCM IMA Electronic Arts EACSX
ADPCM IMA Electronic Arts SEADX
ADPCM IMA FuncomX
ADPCM IMA High Voltage Software ALPXX
ADPCM IMA Mobiclip MOFLEXX
ADPCM IMA QuickTimeXX
ADPCM IMA Simon & Schuster InteractiveXX
ADPCM IMA Ubisoft APMXX
ADPCM IMA Loki SDL MJPEGX
ADPCM IMA WAVXX
ADPCM IMA WestwoodX
ADPCM ISS IMAXUsed in FunCom games.
ADPCM IMA DialogicX
ADPCM IMA Duck DK3XUsed in some Sega Saturn console games.
ADPCM IMA Duck DK4XUsed in some Sega Saturn console games.
ADPCM IMA RadicalX
ADPCM MicrosoftXX
ADPCM MS IMAXX
ADPCM Nintendo Gamecube AFCX
ADPCM Nintendo Gamecube DTKX
ADPCM Nintendo THPX
ADPCM PlaystationX
ADPCM QT IMAXX
ADPCM SEGA CRI ADXXXUsed in Sega Dreamcast games.
ADPCM Shockwave FlashXX
ADPCM Sound Blaster Pro 2-bitX
ADPCM Sound Blaster Pro 2.6-bitX
ADPCM Sound Blaster Pro 4-bitX
ADPCM VIMAXUsed in LucasArts SMUSH animations.
ADPCM Konami XMDX
ADPCM Westwood Studios IMAXXUsed in Westwood Studios games like Command and Conquer.
ADPCM YamahaXX
ADPCM ZorkX
AMR-NBEXencoding supported through external library libopencore-amrnb
AMR-WBEXencoding supported through external library libvo-amrwbenc
Amazing Studio PAF AudioX
Apple lossless audioXXQuickTime fourcc ’alac’
aptXXXUsed in Bluetooth A2DP
aptX HDXXUsed in Bluetooth A2DP
ATRAC1X
ATRAC3X
ATRAC3+X
ATRAC9X
Bink AudioXUsed in Bink and Smacker files in many games.
Bonk audioX
CELTEdecoding supported through external library libcelt
codec2EEen/decoding supported through external library libcodec2
CRI HCAX
Delphine Software International CIN audioXCodec used in Delphine Software International games.
DFPWMXX
Digital Speech Standard - Standard Play mode (DSS SP)X
Discworld II BMV AudioX
COOKXAll versions except 5.1 are supported.
DCA (DTS Coherent Acoustics)XXsupported extensions: XCh, XXCH, X96, XBR, XLL, LBR (partially)
Dolby EX
DPCM Cuberoot-Delta-ExactXUsed in few games.
DPCM GremlinX
DPCM id RoQXXUsed in Quake III, Jedi Knight 2 and other computer games.
DPCM Marble WADYX
DPCM InterplayXUsed in various Interplay computer games.
DPCM Squareroot-Delta-ExactXUsed in various games.
DPCM Sierra OnlineXUsed in Sierra Online game audio files.
DPCM SolX
DPCM XanXUsed in Origin’s Wing Commander IV AVI files.
DPCM Xilam DERFX
DSD (Direct Stream Digital), least significant bit firstX
DSD (Direct Stream Digital), most significant bit firstX
DSD (Direct Stream Digital), least significant bit first, planarX
DSD (Direct Stream Digital), most significant bit first, planarX
DSP Group TrueSpeechX
DST (Direct Stream Transfer)X
DV audioX
Enhanced AC-3XX
EVRC (Enhanced Variable Rate Codec)X
FLAC (Free Lossless Audio Codec)XIX
FTR VoiceX
G.723.1XX
G.729X
GSMEXencoding supported through external library libgsm
GSM Microsoft variantEXencoding supported through external library libgsm
IAC (Indeo Audio Coder)X
iLBC (Internet Low Bitrate Codec)EEXencoding and decoding supported through external library libilbc
IMC (Intel Music Coder)X
Interplay ACMX
MACE (Macintosh Audio Compression/Expansion) 3:1X
MACE (Macintosh Audio Compression/Expansion) 6:1X
Marian’s A-pac audioX
MI-SC4 (Micronas SC-4 Audio)X
MLP (Meridian Lossless Packing)XXUsed in DVD-Audio discs.
Monkey’s AudioX
MP1 (MPEG audio layer 1)IX
MP2 (MPEG audio layer 2)IXIXencoding supported also through external library TwoLAME
MP3 (MPEG audio layer 3)EIXencoding supported through external library LAME, ADU MP3 and MP3onMP4 also supported
MPEG-4 Audio Lossless Coding (ALS)X
MobiClip FastAudioX
Musepack SV7X
Musepack SV8X
Nellymoser AsaoXX
On2 AVC (Audio for Video Codec)X
OpusEXencoding supported through external library libopus
PCM A-lawXX
PCM mu-lawXX
PCM Archimedes VIDCXX
PCM signed 8-bit planarXX
PCM signed 16-bit big-endian planarXX
PCM signed 16-bit little-endian planarXX
PCM signed 24-bit little-endian planarXX
PCM signed 32-bit little-endian planarXX
PCM 32-bit floating point big-endianXX
PCM 32-bit floating point little-endianXX
PCM 64-bit floating point big-endianXX
PCM 64-bit floating point little-endianXX
PCM D-Cinema audio signed 24-bitXX
PCM signed 8-bitXX
PCM signed 16-bit big-endianXX
PCM signed 16-bit little-endianXX
PCM signed 24-bit big-endianXX
PCM signed 24-bit little-endianXX
PCM signed 32-bit big-endianXX
PCM signed 32-bit little-endianXX
PCM signed 16/20/24-bit big-endian in MPEG-TSX
PCM unsigned 8-bitXX
PCM unsigned 16-bit big-endianXX
PCM unsigned 16-bit little-endianXX
PCM unsigned 24-bit big-endianXX
PCM unsigned 24-bit little-endianXX
PCM unsigned 32-bit big-endianXX
PCM unsigned 32-bit little-endianXX
PCM SGAX
QCELP / PureVoiceX
QDesign Music Codec 1X
QDesign Music Codec 2XThere are still some distortions.
RealAudio 1.0 (14.4K)XXReal 14400 bit/s codec
RealAudio 2.0 (28.8K)XReal 28800 bit/s codec
RealAudio 3.0 (dnet)IXXReal low bitrate AC-3 codec
RealAudio LosslessX
RealAudio SIPR / ACELP.NETX
RK Audio (RKA)X
SBC (low-complexity subband codec)XXUsed in Bluetooth A2DP
ShortenX
Sierra VMD audioXUsed in Sierra VMD files.
Smacker audioX
SMPTE 302M AES3 audioXX
SonicXXexperimental codec
Sonic losslessXXexperimental codec
SpeexEEXsupported through external library libspeex
TAK (Tom’s lossless Audio Kompressor)X
True Audio (TTA)XX
TrueHDXXUsed in HD-DVD and Blu-Ray discs.
TwinVQ (VQF flavor)X
VIMAXUsed in LucasArts SMUSH animations.
ViewQuest VQCX
VorbisEXA native but very primitive encoder exists.
Voxware MetaSoundX
Waveform ArchiverX
WavPackXX
Westwood Audio (SND1)X
Windows Media Audio 1XX
Windows Media Audio 2XX
Windows Media Audio LosslessX
Windows Media Audio ProX
Windows Media Audio VoiceX
Xbox Media Audio 1X
Xbox Media Audio 2X
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+

E means that support is provided through an external library. +

+

I means that an integer-only version is available, too (ensures high +performance on systems without hardware floating point support). +

+
+
+

41.5 Subtitle Formats

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameMuxingDemuxingEncodingDecoding
3GPP Timed TextXX
AQTitleXX
DVBXXXX
DVB teletextXE
DVDXXXX
JACOsubXXX
MicroDVDXXX
MPL2XX
MPsub (MPlayer)XX
PGSX
PJS (Phoenix)XX
RealTextXX
SAMIXX
Spruce format (STL)XX
SSA/ASSXXXX
SubRip (SRT)XXXX
SubViewer v1XX
SubViewerXX
TED Talks captionsXX
TTMLXX
VobSub (IDX+SUB)XX
VPlayerXX
WebVTTXXXX
XSUBXX
+ +

X means that the feature is supported. +

+

E means that support is provided through an external library. +

+
+
+

41.6 Network Protocols

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameSupport
AMQPE
fileX
FTPX
GopherX
GophersX
HLSX
HTTPX
HTTPSX
IcecastX
MMSHX
MMSTX
pipeX
Pro-MPEG FECX
RTMPX
RTMPEX
RTMPSX
RTMPTX
RTMPTEX
RTMPTSX
RTPX
SAMBAE
SCTPX
SFTPE
TCPX
TLSX
UDPX
ZMQE
+ +

X means that the protocol is supported. +

+

E means that support is provided through an external library. +

+ +
+
+

41.7 Input/Output Devices

+ + + + + + + + + + + + + + + + + + + + + + +
NameInputOutput
ALSAXX
BKTRX
cacaX
DV1394X
Lavfi virtual deviceX
Linux framebufferXX
JACKX
LIBCDIOX
LIBDC1394X
OpenALX
OpenGLX
OSSXX
PulseAudioXX
SDLX
Video4Linux2XX
VfW captureX
X11 grabbingX
Win32 grabbingX
+ +

X means that input/output is supported. +

+
+
+

41.8 Timecode

+ + + + + + + + + + +
Codec/formatReadWrite
AVIXX
DVXX
GXFXX
MOVXX
MPEG1/2XX
MXFXX
+ +
+
+ +
+

43 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/ffprobe.html b/mm_avh_working_space/bin/ffmpeg/doc/ffprobe.html new file mode 100644 index 0000000000000000000000000000000000000000..6948d783688c2985dcdb73ed953426ab6c0c10a1 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/ffprobe.html @@ -0,0 +1,1258 @@ + + + + + +ffprobe Documentation + + + + + + + + + + + + + + + + + +
+ + + +
+

1 Synopsis

+ +

ffprobe [options] input_url +

+
+
+

2 Description

+ +

ffprobe gathers information from multimedia streams and prints it in +human- and machine-readable fashion. +

+

For example it can be used to check the format of the container used +by a multimedia stream and the format and type of each media stream +contained in it. +

+

If a url is specified in input, ffprobe will try to open and +probe the url content. If the url cannot be opened or recognized as +a multimedia file, a positive exit code is returned. +

+

If no output is specified as output with o ffprobe will write +to stdout. +

+

ffprobe may be employed both as a standalone application or in +combination with a textual filter, which may perform more +sophisticated processing, e.g. statistical processing or plotting. +

+

Options are used to list some of the formats supported by ffprobe or +for specifying which information to display, and for setting how +ffprobe will show it. +

+

ffprobe output is designed to be easily parsable by a textual filter, +and consists of one or more sections of a form defined by the selected +writer, which is specified by the print_format option. +

+

Sections may contain other nested sections, and are identified by a +name (which may be shared by other sections), and an unique +name. See the output of sections. +

+

Metadata tags stored in the container or in the streams are recognized +and printed in the corresponding "FORMAT", "STREAM" or "PROGRAM_STREAM" +section. +

+ +
+
+

3 Options

+ +

All the numerical options, if not specified otherwise, accept a string +representing a number as input, which may be followed by one of the SI +unit prefixes, for example: ’K’, ’M’, or ’G’. +

+

If ’i’ is appended to the SI unit prefix, the complete prefix will be +interpreted as a unit prefix for binary multiples, which are based on +powers of 1024 instead of powers of 1000. Appending ’B’ to the SI unit +prefix multiplies the value by 8. This allows using, for example: +’KB’, ’MiB’, ’G’ and ’B’ as number suffixes. +

+

Options which do not take arguments are boolean options, and set the +corresponding value to true. They can be set to false by prefixing +the option name with "no". For example using "-nofoo" +will set the boolean option with name "foo" to false. +

+ +
+

3.1 Stream specifiers

+

Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers +are used to precisely specify which stream(s) a given option belongs to. +

+

A stream specifier is a string generally appended to the option name and +separated from it by a colon. E.g. -codec:a:1 ac3 contains the +a:1 stream specifier, which matches the second audio stream. Therefore, it +would select the ac3 codec for the second audio stream. +

+

A stream specifier can match several streams, so that the option is applied to all +of them. E.g. the stream specifier in -b:a 128k matches all audio +streams. +

+

An empty stream specifier matches all streams. For example, -codec copy +or -codec: copy would copy all the streams without reencoding. +

+

Possible forms of stream specifiers are: +

+
stream_index
+

Matches the stream with this index. E.g. -threads:1 4 would set the +thread count for the second stream to 4. If stream_index is used as an +additional stream specifier (see below), then it selects stream number +stream_index from the matching streams. Stream numbering is based on the +order of the streams as detected by libavformat except when a program ID is +also specified. In this case it is based on the ordering of the streams in the +program. +

+
stream_type[:additional_stream_specifier]
+

stream_type is one of following: ’v’ or ’V’ for video, ’a’ for audio, ’s’ +for subtitle, ’d’ for data, and ’t’ for attachments. ’v’ matches all video +streams, ’V’ only matches video streams which are not attached pictures, video +thumbnails or cover arts. If additional_stream_specifier is used, then +it matches streams which both have this type and match the +additional_stream_specifier. Otherwise, it matches all streams of the +specified type. +

+
p:program_id[:additional_stream_specifier]
+

Matches streams which are in the program with the id program_id. If +additional_stream_specifier is used, then it matches streams which both +are part of the program and match the additional_stream_specifier. +

+
+
#stream_id or i:stream_id
+

Match the stream by stream id (e.g. PID in MPEG-TS container). +

+
m:key[:value]
+

Matches streams with the metadata tag key having the specified value. If +value is not given, matches streams that contain the given tag with any +value. +

+
u
+

Matches streams with usable configuration, the codec must be defined and the +essential information such as video dimension or audio sample rate must be present. +

+

Note that in ffmpeg, matching by metadata will only work properly for +input files. +

+
+ +
+
+

3.2 Generic options

+ +

These options are shared amongst the ff* tools. +

+
+
-L
+

Show license. +

+
+
-h, -?, -help, --help [arg]
+

Show help. An optional parameter may be specified to print help about a specific +item. If no argument is specified, only basic (non advanced) tool +options are shown. +

+

Possible values of arg are: +

+
long
+

Print advanced tool options in addition to the basic tool options. +

+
+
full
+

Print complete list of options, including shared and private options +for encoders, decoders, demuxers, muxers, filters, etc. +

+
+
decoder=decoder_name
+

Print detailed information about the decoder named decoder_name. Use the +-decoders option to get a list of all decoders. +

+
+
encoder=encoder_name
+

Print detailed information about the encoder named encoder_name. Use the +-encoders option to get a list of all encoders. +

+
+
demuxer=demuxer_name
+

Print detailed information about the demuxer named demuxer_name. Use the +-formats option to get a list of all demuxers and muxers. +

+
+
muxer=muxer_name
+

Print detailed information about the muxer named muxer_name. Use the +-formats option to get a list of all muxers and demuxers. +

+
+
filter=filter_name
+

Print detailed information about the filter named filter_name. Use the +-filters option to get a list of all filters. +

+
+
bsf=bitstream_filter_name
+

Print detailed information about the bitstream filter named bitstream_filter_name. +Use the -bsfs option to get a list of all bitstream filters. +

+
+
protocol=protocol_name
+

Print detailed information about the protocol named protocol_name. +Use the -protocols option to get a list of all protocols. +

+
+ +
+
-version
+

Show version. +

+
+
-buildconf
+

Show the build configuration, one option per line. +

+
+
-formats
+

Show available formats (including devices). +

+
+
-demuxers
+

Show available demuxers. +

+
+
-muxers
+

Show available muxers. +

+
+
-devices
+

Show available devices. +

+
+
-codecs
+

Show all codecs known to libavcodec. +

+

Note that the term ’codec’ is used throughout this documentation as a shortcut +for what is more correctly called a media bitstream format. +

+
+
-decoders
+

Show available decoders. +

+
+
-encoders
+

Show all available encoders. +

+
+
-bsfs
+

Show available bitstream filters. +

+
+
-protocols
+

Show available protocols. +

+
+
-filters
+

Show available libavfilter filters. +

+
+
-pix_fmts
+

Show available pixel formats. +

+
+
-sample_fmts
+

Show available sample formats. +

+
+
-layouts
+

Show channel names and standard channel layouts. +

+
+
-dispositions
+

Show stream dispositions. +

+
+
-colors
+

Show recognized color names. +

+
+
-sources device[,opt1=val1[,opt2=val2]...]
+

Show autodetected sources of the input device. +Some devices may provide system-dependent source names that cannot be autodetected. +The returned list cannot be assumed to be always complete. +

+
ffmpeg -sources pulse,server=192.168.0.4
+
+ +
+
-sinks device[,opt1=val1[,opt2=val2]...]
+

Show autodetected sinks of the output device. +Some devices may provide system-dependent sink names that cannot be autodetected. +The returned list cannot be assumed to be always complete. +

+
ffmpeg -sinks pulse,server=192.168.0.4
+
+ +
+
-loglevel [flags+]loglevel | -v [flags+]loglevel
+

Set logging level and flags used by the library. +

+

The optional flags prefix can consist of the following values: +

+
repeat
+

Indicates that repeated log output should not be compressed to the first line +and the "Last message repeated n times" line will be omitted. +

+
level
+

Indicates that log output should add a [level] prefix to each message +line. This can be used as an alternative to log coloring, e.g. when dumping the +log to file. +

+
+

Flags can also be used alone by adding a ’+’/’-’ prefix to set/reset a single +flag without affecting other flags or changing loglevel. When +setting both flags and loglevel, a ’+’ separator is expected +between the last flags value and before loglevel. +

+

loglevel is a string or a number containing one of the following values: +

+
quiet, -8
+

Show nothing at all; be silent. +

+
panic, 0
+

Only show fatal errors which could lead the process to crash, such as +an assertion failure. This is not currently used for anything. +

+
fatal, 8
+

Only show fatal errors. These are errors after which the process absolutely +cannot continue. +

+
error, 16
+

Show all errors, including ones which can be recovered from. +

+
warning, 24
+

Show all warnings and errors. Any message related to possibly +incorrect or unexpected events will be shown. +

+
info, 32
+

Show informative messages during processing. This is in addition to +warnings and errors. This is the default value. +

+
verbose, 40
+

Same as info, except more verbose. +

+
debug, 48
+

Show everything, including debugging information. +

+
trace, 56
+
+ +

For example to enable repeated log output, add the level prefix, and set +loglevel to verbose: +

+
ffmpeg -loglevel repeat+level+verbose -i input output
+
+

Another example that enables repeated log output without affecting current +state of level prefix flag or loglevel: +

+
ffmpeg [...] -loglevel +repeat
+
+ +

By default the program logs to stderr. If coloring is supported by the +terminal, colors are used to mark errors and warnings. Log coloring +can be disabled setting the environment variable +AV_LOG_FORCE_NOCOLOR, or can be forced setting +the environment variable AV_LOG_FORCE_COLOR. +

+
+
-report
+

Dump full command line and log output to a file named +program-YYYYMMDD-HHMMSS.log in the current +directory. +This file can be useful for bug reports. +It also implies -loglevel debug. +

+

Setting the environment variable FFREPORT to any value has the +same effect. If the value is a ’:’-separated key=value sequence, these +options will affect the report; option values must be escaped if they +contain special characters or the options delimiter ’:’ (see the +“Quoting and escaping” section in the ffmpeg-utils manual). +

+

The following options are recognized: +

+
file
+

set the file name to use for the report; %p is expanded to the name +of the program, %t is expanded to a timestamp, %% is expanded +to a plain % +

+
level
+

set the log verbosity level using a numerical value (see -loglevel). +

+
+ +

For example, to output a report to a file named ffreport.log +using a log level of 32 (alias for log level info): +

+
+
FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
+
+ +

Errors in parsing the environment variable are not fatal, and will not +appear in the report. +

+
+
-hide_banner
+

Suppress printing banner. +

+

All FFmpeg tools will normally show a copyright notice, build options +and library versions. This option can be used to suppress printing +this information. +

+
+
-cpuflags flags (global)
+

Allows setting and clearing cpu flags. This option is intended +for testing. Do not use it unless you know what you’re doing. +

+
ffmpeg -cpuflags -sse+mmx ...
+ffmpeg -cpuflags mmx ...
+ffmpeg -cpuflags 0 ...
+
+

Possible flags for this option are: +

+
x86
+
+
mmx
+
mmxext
+
sse
+
sse2
+
sse2slow
+
sse3
+
sse3slow
+
ssse3
+
atom
+
sse4.1
+
sse4.2
+
avx
+
avx2
+
xop
+
fma3
+
fma4
+
3dnow
+
3dnowext
+
bmi1
+
bmi2
+
cmov
+
+
+
ARM
+
+
armv5te
+
armv6
+
armv6t2
+
vfp
+
vfpv3
+
neon
+
setend
+
+
+
AArch64
+
+
armv8
+
vfp
+
neon
+
+
+
PowerPC
+
+
altivec
+
+
+
Specific Processors
+
+
pentium2
+
pentium3
+
pentium4
+
k6
+
k62
+
athlon
+
athlonxp
+
k8
+
+
+
+ +
+
-cpucount count (global)
+

Override detection of CPU count. This option is intended +for testing. Do not use it unless you know what you’re doing. +

+
ffmpeg -cpucount 2
+
+ +
+
-max_alloc bytes
+

Set the maximum size limit for allocating a block on the heap by ffmpeg’s +family of malloc functions. Exercise extreme caution when using +this option. Don’t use if you do not understand the full consequence of doing so. +Default is INT_MAX. +

+
+ +
+
+

3.3 AVOptions

+ +

These options are provided directly by the libavformat, libavdevice and +libavcodec libraries. To see the list of available AVOptions, use the +-help option. They are separated into two categories: +

+
generic
+

These options can be set for any container, codec or device. Generic options +are listed under AVFormatContext options for containers/devices and under +AVCodecContext options for codecs. +

+
private
+

These options are specific to the given container, device or codec. Private +options are listed under their corresponding containers/devices/codecs. +

+
+ +

For example to write an ID3v2.3 header instead of a default ID3v2.4 to +an MP3 file, use the id3v2_version private option of the MP3 +muxer: +

+
ffmpeg -i input.flac -id3v2_version 3 out.mp3
+
+ +

All codec AVOptions are per-stream, and thus a stream specifier +should be attached to them: +

+
ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4
+
+ +

In the above example, a multichannel audio stream is mapped twice for output. +The first instance is encoded with codec ac3 and bitrate 640k. +The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using +absolute index of the output stream. +

+

Note: the -nooption syntax cannot be used for boolean +AVOptions, use -option 0/-option 1. +

+

Note: the old undocumented way of specifying per-stream AVOptions by +prepending v/a/s to the options name is now obsolete and will be +removed soon. +

+
+
+

3.4 Main options

+ +
+
-f format
+

Force format to use. +

+
+
-unit
+

Show the unit of the displayed values. +

+
+
-prefix
+

Use SI prefixes for the displayed values. +Unless the "-byte_binary_prefix" option is used all the prefixes +are decimal. +

+
+
-byte_binary_prefix
+

Force the use of binary prefixes for byte values. +

+
+
-sexagesimal
+

Use sexagesimal format HH:MM:SS.MICROSECONDS for time values. +

+
+
-pretty
+

Prettify the format of the displayed values, it corresponds to the +options "-unit -prefix -byte_binary_prefix -sexagesimal". +

+
+
-of, -print_format writer_name[=writer_options]
+

Set the output printing format. +

+

writer_name specifies the name of the writer, and +writer_options specifies the options to be passed to the writer. +

+

For example for printing the output in JSON format, specify: +

+
-print_format json
+
+ +

For more details on the available output printing formats, see the +Writers section below. +

+
+
-sections
+

Print sections structure and section information, and exit. The output +is not meant to be parsed by a machine. +

+
+
-select_streams stream_specifier
+

Select only the streams specified by stream_specifier. This +option affects only the options related to streams +(e.g. show_streams, show_packets, etc.). +

+

For example to show only audio streams, you can use the command: +

+
ffprobe -show_streams -select_streams a INPUT
+
+ +

To show only video packets belonging to the video stream with index 1: +

+
ffprobe -show_packets -select_streams v:1 INPUT
+
+ +
+
-show_data
+

Show payload data, as a hexadecimal and ASCII dump. Coupled with +-show_packets, it will dump the packets’ data. Coupled with +-show_streams, it will dump the codec extradata. +

+

The dump is printed as the "data" field. It may contain newlines. +

+
+
-show_data_hash algorithm
+

Show a hash of payload data, for packets with -show_packets and for +codec extradata with -show_streams. +

+
+
-show_error
+

Show information about the error found when trying to probe the input. +

+

The error information is printed within a section with name "ERROR". +

+
+
-show_format
+

Show information about the container format of the input multimedia +stream. +

+

All the container format information is printed within a section with +name "FORMAT". +

+
+
-show_format_entry name
+

Like -show_format, but only prints the specified entry of the +container format information, rather than all. This option may be given more +than once, then all specified entries will be shown. +

+

This option is deprecated, use show_entries instead. +

+
+
-show_entries section_entries
+

Set list of entries to show. +

+

Entries are specified according to the following +syntax. section_entries contains a list of section entries +separated by :. Each section entry is composed by a section +name (or unique name), optionally followed by a list of entries local +to that section, separated by ,. +

+

If section name is specified but is followed by no =, all +entries are printed to output, together with all the contained +sections. Otherwise only the entries specified in the local section +entries list are printed. In particular, if = is specified but +the list of local entries is empty, then no entries will be shown for +that section. +

+

Note that the order of specification of the local section entries is +not honored in the output, and the usual display order will be +retained. +

+

The formal syntax is given by: +

+
LOCAL_SECTION_ENTRIES ::= SECTION_ENTRY_NAME[,LOCAL_SECTION_ENTRIES]
+SECTION_ENTRY         ::= SECTION_NAME[=[LOCAL_SECTION_ENTRIES]]
+SECTION_ENTRIES       ::= SECTION_ENTRY[:SECTION_ENTRIES]
+
+ +

For example, to show only the index and type of each stream, and the PTS +time, duration time, and stream index of the packets, you can specify +the argument: +

+
packet=pts_time,duration_time,stream_index : stream=index,codec_type
+
+ +

To show all the entries in the section "format", but only the codec +type in the section "stream", specify the argument: +

+
format : stream=codec_type
+
+ +

To show all the tags in the stream and format sections: +

+
stream_tags : format_tags
+
+ +

To show only the title tag (if available) in the stream +sections: +

+
stream_tags=title
+
+ +
+
-show_packets
+

Show information about each packet contained in the input multimedia +stream. +

+

The information for each single packet is printed within a dedicated +section with name "PACKET". +

+
+
-show_frames
+

Show information about each frame and subtitle contained in the input +multimedia stream. +

+

The information for each single frame is printed within a dedicated +section with name "FRAME" or "SUBTITLE". +

+
+
-show_log loglevel
+

Show logging information from the decoder about each frame according to +the value set in loglevel, (see -loglevel). This option requires -show_frames. +

+

The information for each log message is printed within a dedicated +section with name "LOG". +

+
+
-show_streams
+

Show information about each media stream contained in the input +multimedia stream. +

+

Each media stream information is printed within a dedicated section +with name "STREAM". +

+
+
-show_programs
+

Show information about programs and their streams contained in the input +multimedia stream. +

+

Each media stream information is printed within a dedicated section +with name "PROGRAM_STREAM". +

+
+
-show_chapters
+

Show information about chapters stored in the format. +

+

Each chapter is printed within a dedicated section with name "CHAPTER". +

+
+
-count_frames
+

Count the number of frames per stream and report it in the +corresponding stream section. +

+
+
-count_packets
+

Count the number of packets per stream and report it in the +corresponding stream section. +

+
+
-read_intervals read_intervals
+
+

Read only the specified intervals. read_intervals must be a +sequence of interval specifications separated by ",". +ffprobe will seek to the interval starting point, and will +continue reading from that. +

+

Each interval is specified by two optional parts, separated by "%". +

+

The first part specifies the interval start position. It is +interpreted as an absolute position, or as a relative offset from the +current position if it is preceded by the "+" character. If this first +part is not specified, no seeking will be performed when reading this +interval. +

+

The second part specifies the interval end position. It is interpreted +as an absolute position, or as a relative offset from the current +position if it is preceded by the "+" character. If the offset +specification starts with "#", it is interpreted as the number of +packets to read (not including the flushing packets) from the interval +start. If no second part is specified, the program will read until the +end of the input. +

+

Note that seeking is not accurate, thus the actual interval start +point may be different from the specified position. Also, when an +interval duration is specified, the absolute end time will be computed +by adding the duration to the interval start point found by seeking +the file, rather than to the specified start value. +

+

The formal syntax is given by: +

+
INTERVAL  ::= [START|+START_OFFSET][%[END|+END_OFFSET]]
+INTERVALS ::= INTERVAL[,INTERVALS]
+
+ +

A few examples follow. +

    +
  • Seek to time 10, read packets until 20 seconds after the found seek +point, then seek to position 01:30 (1 minute and thirty +seconds) and read packets until position 01:45. +
    +
    10%+20,01:30%01:45
    +
    + +
  • Read only 42 packets after seeking to position 01:23: +
    +
    01:23%+#42
    +
    + +
  • Read only the first 20 seconds from the start: +
    +
    %+20
    +
    + +
  • Read from the start until position 02:30: +
    +
    %02:30
    +
    +
+ +
+
-show_private_data, -private
+

Show private data, that is data depending on the format of the +particular shown element. +This option is enabled by default, but you may need to disable it +for specific uses, for example when creating XSD-compliant XML output. +

+
+
-show_program_version
+

Show information related to program version. +

+

Version information is printed within a section with name +"PROGRAM_VERSION". +

+
+
-show_library_versions
+

Show information related to library versions. +

+

Version information for each library is printed within a section with +name "LIBRARY_VERSION". +

+
+
-show_versions
+

Show information related to program and library versions. This is the +equivalent of setting both -show_program_version and +-show_library_versions options. +

+
+
-show_pixel_formats
+

Show information about all pixel formats supported by FFmpeg. +

+

Pixel format information for each format is printed within a section +with name "PIXEL_FORMAT". +

+
+
-show_optional_fields value
+

Some writers viz. JSON and XML, omit the printing of fields with invalid or non-applicable values, +while other writers always print them. This option enables one to control this behaviour. +Valid values are always/1, never/0 and auto/-1. +Default is auto. +

+
+
-bitexact
+

Force bitexact output, useful to produce output which is not dependent +on the specific build. +

+
+
-i input_url
+

Read input_url. +

+
+
-o output_url
+

Write output to output_url. If not specified, the output is sent +to stdout. +

+
+
+ +
+
+
+

4 Writers

+ +

A writer defines the output format adopted by ffprobe, and will be +used for printing all the parts of the output. +

+

A writer may accept one or more arguments, which specify the options +to adopt. The options are specified as a list of key=value +pairs, separated by ":". +

+

All writers support the following options: +

+
+
string_validation, sv
+

Set string validation mode. +

+

The following values are accepted. +

+
fail
+

The writer will fail immediately in case an invalid string (UTF-8) +sequence or code point is found in the input. This is especially +useful to validate input metadata. +

+
+
ignore
+

Any validation error will be ignored. This will result in possibly +broken output, especially with the json or xml writer. +

+
+
replace
+

The writer will substitute invalid UTF-8 sequences or code points with +the string specified with the string_validation_replacement. +

+
+ +

Default value is ‘replace’. +

+
+
string_validation_replacement, svr
+

Set replacement string to use in case string_validation is +set to ‘replace’. +

+

In case the option is not specified, the writer will assume the empty +string, that is it will remove the invalid sequences from the input +strings. +

+
+ +

A description of the currently available writers follows. +

+ +
+

4.1 default

+

Default format. +

+

Print each section in the form: +

+
[SECTION]
+key1=val1
+...
+keyN=valN
+[/SECTION]
+
+ +

Metadata tags are printed as a line in the corresponding FORMAT, STREAM or +PROGRAM_STREAM section, and are prefixed by the string "TAG:". +

+

A description of the accepted options follows. +

+
+
nokey, nk
+

If set to 1 specify not to print the key of each field. Default value +is 0. +

+
+
noprint_wrappers, nw
+

If set to 1 specify not to print the section header and footer. +Default value is 0. +

+
+ +
+
+

4.2 compact, csv

+

Compact and CSV format. +

+

The csv writer is equivalent to compact, but supports +different defaults. +

+

Each section is printed on a single line. +If no option is specified, the output has the form: +

+
section|key1=val1| ... |keyN=valN
+
+ +

Metadata tags are printed in the corresponding "format" or "stream" +section. A metadata tag key, if printed, is prefixed by the string +"tag:". +

+

The description of the accepted options follows. +

+
+
item_sep, s
+

Specify the character to use for separating fields in the output line. +It must be a single printable character, it is "|" by default ("," for +the csv writer). +

+
+
nokey, nk
+

If set to 1 specify not to print the key of each field. Its default +value is 0 (1 for the csv writer). +

+
+
escape, e
+

Set the escape mode to use, default to "c" ("csv" for the csv +writer). +

+

It can assume one of the following values: +

+
c
+

Perform C-like escaping. Strings containing a newline (‘\n’), carriage +return (‘\r’), a tab (‘\t’), a form feed (‘\f’), the escaping +character (‘\’) or the item separator character SEP are escaped +using C-like fashioned escaping, so that a newline is converted to the +sequence ‘\n’, a carriage return to ‘\r’, ‘\’ to ‘\\’ and +the separator SEP is converted to ‘\SEP’. +

+
+
csv
+

Perform CSV-like escaping, as described in RFC4180. Strings +containing a newline (‘\n’), a carriage return (‘\r’), a double quote +(‘"’), or SEP are enclosed in double-quotes. +

+
+
none
+

Perform no escaping. +

+
+ +
+
print_section, p
+

Print the section name at the beginning of each line if the value is +1, disable it with value set to 0. Default value is +1. +

+
+
+ +
+
+

4.3 flat

+

Flat format. +

+

A free-form output where each line contains an explicit key=value, such as +"streams.stream.3.tags.foo=bar". The output is shell escaped, so it can be +directly embedded in sh scripts as long as the separator character is an +alphanumeric character or an underscore (see sep_char option). +

+

The description of the accepted options follows. +

+
+
sep_char, s
+

Separator character used to separate the chapter, the section name, IDs and +potential tags in the printed field key. +

+

Default value is ‘.’. +

+
+
hierarchical, h
+

Specify if the section name specification should be hierarchical. If +set to 1, and if there is more than one section in the current +chapter, the section name will be prefixed by the name of the +chapter. A value of 0 will disable this behavior. +

+

Default value is 1. +

+
+ +
+
+

4.4 ini

+

INI format output. +

+

Print output in an INI based format. +

+

The following conventions are adopted: +

+
    +
  • all key and values are UTF-8 +
  • .’ is the subgroup separator +
  • newline, ‘\t’, ‘\f’, ‘\b’ and the following characters are +escaped +
  • \’ is the escape character +
  • #’ is the comment indicator +
  • =’ is the key/value separator +
  • :’ is not used but usually parsed as key/value separator +
+ +

This writer accepts options as a list of key=value pairs, +separated by ‘:’. +

+

The description of the accepted options follows. +

+
+
hierarchical, h
+

Specify if the section name specification should be hierarchical. If +set to 1, and if there is more than one section in the current +chapter, the section name will be prefixed by the name of the +chapter. A value of 0 will disable this behavior. +

+

Default value is 1. +

+
+ +
+
+

4.5 json

+

JSON based format. +

+

Each section is printed using JSON notation. +

+

The description of the accepted options follows. +

+
+
compact, c
+

If set to 1 enable compact output, that is each section will be +printed on a single line. Default value is 0. +

+
+ +

For more information about JSON, see http://www.json.org/. +

+
+
+

4.6 xml

+

XML based format. +

+

The XML output is described in the XML schema description file +ffprobe.xsd installed in the FFmpeg datadir. +

+

An updated version of the schema can be retrieved at the url +http://www.ffmpeg.org/schema/ffprobe.xsd, which redirects to the +latest schema committed into the FFmpeg development source code tree. +

+

Note that the output issued will be compliant to the +ffprobe.xsd schema only when no special global output options +(unit, prefix, byte_binary_prefix, +sexagesimal etc.) are specified. +

+

The description of the accepted options follows. +

+
+
fully_qualified, q
+

If set to 1 specify if the output should be fully qualified. Default +value is 0. +This is required for generating an XML file which can be validated +through an XSD file. +

+
+
xsd_strict, x
+

If set to 1 perform more checks for ensuring that the output is XSD +compliant. Default value is 0. +This option automatically sets fully_qualified to 1. +

+
+ +

For more information about the XML format, see +https://www.w3.org/XML/. +

+
+
+
+

5 Timecode

+ +

ffprobe supports Timecode extraction: +

+
    +
  • MPEG1/2 timecode is extracted from the GOP, and is available in the video +stream details (-show_streams, see timecode). + +
  • MOV timecode is extracted from tmcd track, so is available in the tmcd +stream metadata (-show_streams, see TAG:timecode). + +
  • DV, GXF and AVI timecodes are available in format metadata +(-show_format, see TAG:timecode). + +
+ + +
+ +
+

7 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/general.html b/mm_avh_working_space/bin/ffmpeg/doc/general.html new file mode 100644 index 0000000000000000000000000000000000000000..8bfd594231d99ef67d78943c33dc0f08b0ab85b3 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/general.html @@ -0,0 +1,1440 @@ + + + + + +General Documentation + + + + + + + + + + + + + + + + + +
+ + + +
+

1 External libraries

+ +

FFmpeg can be hooked up with a number of external libraries to add support +for more formats. None of them are used by default, their use has to be +explicitly requested by passing the appropriate flags to +./configure. +

+ +
+

1.1 Alliance for Open Media (AOM)

+ +

FFmpeg can make use of the AOM library for AV1 decoding and encoding. +

+

Go to http://aomedia.org/ and follow the instructions for +installing the library. Then pass --enable-libaom to configure to +enable it. +

+
+
+

1.2 AMD AMF/VCE

+ +

FFmpeg can use the AMD Advanced Media Framework library +for accelerated H.264 and HEVC(only windows) encoding on hardware with Video Coding Engine (VCE). +

+

To enable support you must obtain the AMF framework header files(version 1.4.9+) from +https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git. +

+

Create an AMF/ directory in the system include path. +Copy the contents of AMF/amf/public/include/ into that directory. +Then configure FFmpeg with --enable-amf. +

+

Initialization of amf encoder occurs in this order: +1) trying to initialize through dx11(only windows) +2) trying to initialize through dx9(only windows) +3) trying to initialize through vulkan +

+

To use h.264(AMD VCE) encoder on linux amdgru-pro version 19.20+ and amf-amdgpu-pro +package(amdgru-pro contains, but does not install automatically) are required. +

+

This driver can be installed using amdgpu-pro-install script in official amd driver archive. +

+
+
+

1.3 AviSynth

+ +

FFmpeg can read AviSynth scripts as input. To enable support, pass +--enable-avisynth to configure after installing the headers +provided by AviSynth+. +AviSynth+ can be configured to install only the headers by either +passing -DHEADERS_ONLY:bool=on to the normal CMake-based build +system, or by using the supplied GNUmakefile. +

+

For Windows, supported AviSynth variants are +AviSynth 2.6 RC1 or higher for 32-bit builds and +AviSynth+ r1718 or higher for 32-bit and 64-bit builds. +

+

For Linux, macOS, and BSD, the only supported AviSynth variant is +AviSynth+, starting with version 3.5. +

+
+

In 2016, AviSynth+ added support for building with GCC. However, due to +the eccentricities of Windows’ calling conventions, 32-bit GCC builds +of AviSynth+ are not compatible with typical 32-bit builds of FFmpeg. +

+

By default, FFmpeg assumes compatibility with 32-bit MSVC builds of +AviSynth+ since that is the most widely-used and entrenched build +configuration. Users can override this and enable support for 32-bit +GCC builds of AviSynth+ by passing -DAVSC_WIN32_GCC32 to +--extra-cflags when configuring FFmpeg. +

+

64-bit builds of FFmpeg are not affected, and can use either MSVC or +GCC builds of AviSynth+ without any special flags. +

NOTE +

+
+

AviSynth(+) is loaded dynamically. Distributors can build FFmpeg +with --enable-avisynth, and the binaries will work regardless +of the end user having AviSynth installed. If/when an end user +would like to use AviSynth scripts, then they can install AviSynth(+) +and FFmpeg will be able to find and use it to open scripts. +

NOTE +

+
+
+

1.4 Chromaprint

+ +

FFmpeg can make use of the Chromaprint library for generating audio fingerprints. +Pass --enable-chromaprint to configure to +enable it. See https://acoustid.org/chromaprint. +

+
+
+

1.5 codec2

+ +

FFmpeg can make use of the codec2 library for codec2 decoding and encoding. +There is currently no native decoder, so libcodec2 must be used for decoding. +

+

Go to http://freedv.org/, download "Codec 2 source archive". +Build and install using CMake. Debian users can install the libcodec2-dev package instead. +Once libcodec2 is installed you can pass --enable-libcodec2 to configure to enable it. +

+

The easiest way to use codec2 is with .c2 files, since they contain the mode information required for decoding. +To encode such a file, use a .c2 file extension and give the libcodec2 encoder the -mode option: +ffmpeg -i input.wav -mode 700C output.c2. +Playback is as simple as ffplay output.c2. +For a list of supported modes, run ffmpeg -h encoder=libcodec2. +Raw codec2 files are also supported. +To make sense of them the mode in use needs to be specified as a format option: +ffmpeg -f codec2raw -mode 1300 -i input.raw output.wav. +

+
+
+

1.6 dav1d

+ +

FFmpeg can make use of the dav1d library for AV1 video decoding. +

+

Go to https://code.videolan.org/videolan/dav1d and follow the instructions for +installing the library. Then pass --enable-libdav1d to configure to enable it. +

+
+
+

1.7 davs2

+ +

FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video decoding. +

+

Go to https://github.com/pkuvcl/davs2 and follow the instructions for +installing the library. Then pass --enable-libdavs2 to configure to +enable it. +

+
+

libdavs2 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

1.8 uavs3d

+ +

FFmpeg can make use of the uavs3d library for AVS3-P2/IEEE1857.10 video decoding. +

+

Go to https://github.com/uavs3/uavs3d and follow the instructions for +installing the library. Then pass --enable-libuavs3d to configure to +enable it. +

+
+
+

1.9 Game Music Emu

+ +

FFmpeg can make use of the Game Music Emu library to read audio from supported video game +music file formats. Pass --enable-libgme to configure to +enable it. See https://bitbucket.org/mpyne/game-music-emu/overview. +

+
+
+

1.10 Intel QuickSync Video

+ +

FFmpeg can use Intel QuickSync Video (QSV) for accelerated decoding and encoding +of multiple codecs. To use QSV, FFmpeg must be linked against the libmfx +dispatcher, which loads the actual decoding libraries. +

+

The dispatcher is open source and can be downloaded from +https://github.com/lu-zero/mfx_dispatch.git. FFmpeg needs to be configured +with the --enable-libmfx option and pkg-config needs to be able to +locate the dispatcher’s .pc files. +

+
+
+

1.11 Kvazaar

+ +

FFmpeg can make use of the Kvazaar library for HEVC encoding. +

+

Go to https://github.com/ultravideo/kvazaar and follow the +instructions for installing the library. Then pass +--enable-libkvazaar to configure to enable it. +

+
+
+

1.12 LAME

+ +

FFmpeg can make use of the LAME library for MP3 encoding. +

+

Go to http://lame.sourceforge.net/ and follow the +instructions for installing the library. +Then pass --enable-libmp3lame to configure to enable it. +

+
+
+

1.13 libilbc

+ +

iLBC is a narrowband speech codec that has been made freely available +by Google as part of the WebRTC project. libilbc is a packaging friendly +copy of the iLBC codec. FFmpeg can make use of the libilbc library for +iLBC decoding and encoding. +

+

Go to https://github.com/TimothyGu/libilbc and follow the instructions for +installing the library. Then pass --enable-libilbc to configure to +enable it. +

+
+
+

1.14 libjxl

+ +

JPEG XL is an image format intended to fully replace legacy JPEG for an extended +period of life. See https://jpegxl.info/ for more information, and see +https://github.com/libjxl/libjxl for the library source. You can pass +--enable-libjxl to configure in order enable the libjxl wrapper. +

+
+
+

1.15 libvpx

+ +

FFmpeg can make use of the libvpx library for VP8/VP9 decoding and encoding. +

+

Go to http://www.webmproject.org/ and follow the instructions for +installing the library. Then pass --enable-libvpx to configure to +enable it. +

+
+
+

1.16 ModPlug

+ +

FFmpeg can make use of this library, originating in Modplug-XMMS, to read from MOD-like music files. +See https://github.com/Konstanty/libmodplug. Pass --enable-libmodplug to configure to +enable it. +

+
+
+

1.17 OpenCORE, VisualOn, and Fraunhofer libraries

+ +

Spun off Google Android sources, OpenCore, VisualOn and Fraunhofer +libraries provide encoders for a number of audio codecs. +

+
+

OpenCORE and VisualOn libraries are under the Apache License 2.0 +(see http://www.apache.org/licenses/LICENSE-2.0 for details), which is +incompatible to the LGPL version 2.1 and GPL version 2. You have to +upgrade FFmpeg’s license to LGPL version 3 (or if you have enabled +GPL components, GPL version 3) by passing --enable-version3 to configure in +order to use it. +

+

The license of the Fraunhofer AAC library is incompatible with the GPL. +Therefore, for GPL builds, you have to pass --enable-nonfree to +configure in order to use it. To the best of our knowledge, it is +compatible with the LGPL. +

NOTE +

+ +
+

1.17.1 OpenCORE AMR

+ +

FFmpeg can make use of the OpenCORE libraries for AMR-NB +decoding/encoding and AMR-WB decoding. +

+

Go to http://sourceforge.net/projects/opencore-amr/ and follow the +instructions for installing the libraries. +Then pass --enable-libopencore-amrnb and/or +--enable-libopencore-amrwb to configure to enable them. +

+
+
+

1.17.2 VisualOn AMR-WB encoder library

+ +

FFmpeg can make use of the VisualOn AMR-WBenc library for AMR-WB encoding. +

+

Go to http://sourceforge.net/projects/opencore-amr/ and follow the +instructions for installing the library. +Then pass --enable-libvo-amrwbenc to configure to enable it. +

+
+
+

1.17.3 Fraunhofer AAC library

+ +

FFmpeg can make use of the Fraunhofer AAC library for AAC decoding & encoding. +

+

Go to http://sourceforge.net/projects/opencore-amr/ and follow the +instructions for installing the library. +Then pass --enable-libfdk-aac to configure to enable it. +

+
+
+
+

1.18 OpenH264

+ +

FFmpeg can make use of the OpenH264 library for H.264 decoding and encoding. +

+

Go to http://www.openh264.org/ and follow the instructions for +installing the library. Then pass --enable-libopenh264 to configure to +enable it. +

+

For decoding, this library is much more limited than the built-in decoder +in libavcodec; currently, this library lacks support for decoding B-frames +and some other main/high profile features. (It currently only supports +constrained baseline profile and CABAC.) Using it is mostly useful for +testing and for taking advantage of Cisco’s patent portfolio license +(http://www.openh264.org/BINARY_LICENSE.txt). +

+
+
+

1.19 OpenJPEG

+ +

FFmpeg can use the OpenJPEG libraries for decoding/encoding J2K videos. Go to +http://www.openjpeg.org/ to get the libraries and follow the installation +instructions. To enable using OpenJPEG in FFmpeg, pass --enable-libopenjpeg to +./configure. +

+
+
+

1.20 rav1e

+ +

FFmpeg can make use of rav1e (Rust AV1 Encoder) via its C bindings to encode videos. +Go to https://github.com/xiph/rav1e/ and follow the instructions to build +the C library. To enable using rav1e in FFmpeg, pass --enable-librav1e +to ./configure. +

+
+
+

1.21 SVT-AV1

+ +

FFmpeg can make use of the Scalable Video Technology for AV1 library for AV1 encoding. +

+

Go to https://gitlab.com/AOMediaCodec/SVT-AV1/ and follow the instructions +for installing the library. Then pass --enable-libsvtav1 to configure to +enable it. +

+
+
+

1.22 TwoLAME

+ +

FFmpeg can make use of the TwoLAME library for MP2 encoding. +

+

Go to http://www.twolame.org/ and follow the +instructions for installing the library. +Then pass --enable-libtwolame to configure to enable it. +

+
+
+

1.23 VapourSynth

+ +

FFmpeg can read VapourSynth scripts as input. To enable support, pass +--enable-vapoursynth to configure. Vapoursynth is detected via +pkg-config. Versions 42 or greater supported. +See http://www.vapoursynth.com/. +

+

Due to security concerns, Vapoursynth scripts will not +be autodetected so the input format has to be forced. For ff* CLI tools, +add -f vapoursynth before the input -i yourscript.vpy. +

+
+
+

1.24 x264

+ +

FFmpeg can make use of the x264 library for H.264 encoding. +

+

Go to http://www.videolan.org/developers/x264.html and follow the +instructions for installing the library. Then pass --enable-libx264 to +configure to enable it. +

+
+

x264 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

1.25 x265

+ +

FFmpeg can make use of the x265 library for HEVC encoding. +

+

Go to http://x265.org/developers.html and follow the instructions +for installing the library. Then pass --enable-libx265 to configure +to enable it. +

+
+

x265 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

1.26 xavs

+ +

FFmpeg can make use of the xavs library for AVS encoding. +

+

Go to http://xavs.sf.net/ and follow the instructions for +installing the library. Then pass --enable-libxavs to configure to +enable it. +

+
+
+

1.27 xavs2

+ +

FFmpeg can make use of the xavs2 library for AVS2-P2/IEEE1857.4 video encoding. +

+

Go to https://github.com/pkuvcl/xavs2 and follow the instructions for +installing the library. Then pass --enable-libxavs2 to configure to +enable it. +

+
+

libxavs2 is under the GNU Public License Version 2 or later +(see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html for +details), you must upgrade FFmpeg’s license to GPL in order to use it. +

NOTE +

+
+
+

1.28 ZVBI

+ +

ZVBI is a VBI decoding library which can be used by FFmpeg to decode DVB +teletext pages and DVB teletext subtitles. +

+

Go to http://sourceforge.net/projects/zapping/ and follow the instructions for +installing the library. Then pass --enable-libzvbi to configure to +enable it. +

+
+
+
+

2 Supported File Formats, Codecs or Features

+ +

You can use the -formats and -codecs options to have an exhaustive list. +

+ +
+

2.1 File Formats

+ +

FFmpeg supports the following file formats through the libavformat +library: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
3dostrX
4xmX4X Technologies format, used in some games.
8088flex TMVX
AAXXAudible Enhanced Audio format, used in audiobooks.
AAXAudible Format 2, 3, and 4, used in audiobooks.
ACT VoiceXcontains G.729 audio
Adobe FilmstripXX
Audio IFF (AIFF)XX
American Laser Games MMXMultimedia format used in games like Mad Dog McCree.
3GPP AMRXX
Amazing Studio Packed Animation FileXMultimedia format used in game Heart Of Darkness.
Apple HTTP Live StreamingX
Artworx Data FormatX
Interplay ACMXAudio only format used in some Interplay games.
ADPXAudio format used on the Nintendo Gamecube.
AFCXAudio format used on the Nintendo Gamecube.
ADS/SS2XAudio format used on the PS2.
APNGXX
ASFXXAdvanced / Active Streaming Format.
ASTXXAudio format used on the Nintendo Wii.
AVIXX
AviSynthX
AVRXAudio format used on Mac.
AVSXMultimedia format used by the Creature Shock game.
Beam Software SIFFXAudio and video format used in some games by Beam Software.
Bethesda Softworks VIDXUsed in some games from Bethesda Softworks.
Binary textX
BinkXMultimedia format used by many games.
Bink AudioXAudio only multimedia format used by some games.
Bitmap Brothers JVXUsed in Z and Z95 games.
BRPXArgonaut Games format.
Brute Force & IgnoranceXUsed in the game Flash Traffic: City of Angels.
BFSTMXAudio format used on the Nintendo WiiU (based on BRSTM).
BRSTMXAudio format used on the Nintendo Wii.
BW64XBroadcast Wave 64bit.
BWFXX
codec2 (raw)XXMust be given -mode format option to decode correctly.
codec2 (.c2 files)XXContains header with version and mode info, simplifying playback.
CRI ADXXXAudio-only format used in console video games.
CRI AIXX
CRI HCAXAudio-only format used in console video games.
Discworld II BMVX
Interplay C93XUsed in the game Cyberia from Interplay.
Delphine Software International CINXMultimedia format used by Delphine Software games.
Digital Speech Standard (DSS)X
CD+GXVideo format used by CD+G karaoke disks
Phantom CineX
Commodore CDXLXAmiga CD video format
Core Audio FormatXXApple Core Audio Format
CRC testing formatX
Creative VoiceXXCreated for the Sound Blaster Pro.
CRYO APCXAudio format used in some games by CRYO Interactive Entertainment.
D-Cinema audioXX
Deluxe Paint AnimationX
DCSTRX
DFAXThis format is used in Chronomaster game
DirectDraw SurfaceX
DSD Stream File (DSF)X
DV videoXX
DXAXThis format is used in the non-Windows version of the Feeble Files + game and different game cutscenes repacked for use with ScummVM.
Electronic Arts cdataX
Electronic Arts MultimediaXUsed in various EA games; files have extensions like WVE and UV2.
Ensoniq Paris Audio FileX
FFM (FFserver live feed)XX
Flash (SWF)XX
Flash 9 (AVM2)XXOnly embedded audio is decoded.
FLI/FLC/FLX animationX.fli/.flc files
Flash Video (FLV)XXMacromedia Flash video files
framecrc testing formatX
FunCom ISSXAudio format used in various games from FunCom like The Longest Journey.
G.723.1XX
G.726XBoth left- and right-justified.
G.729 BITXX
G.729 rawX
GENHXAudio format for various games.
GIF AnimationXX
GXFXXGeneral eXchange Format SMPTE 360M, used by Thomson Grass Valley + playout servers.
HNMXOnly version 4 supported, used in some games from Cryo Interactive
iCEDraw FileX
ICOXXMicrosoft Windows ICO
id Quake II CIN videoX
id RoQXXUsed in Quake III, Jedi Knight 2 and other computer games.
IEC61937 encapsulationXX
IFFXInterchange File Format
IFVXA format used by some old CCTV DVRs.
iLBCXX
Interplay MVEXFormat used in various Interplay computer games.
Iterated Systems ClearVideoXI-frames only
IV8XA format generated by IndigoVision 8000 video server.
IVF (On2)XXA format used by libvpx
Internet Video RecordingX
IRCAMXX
LAFXLimitless Audio Format
LATMXX
LMLM4XUsed by Linux Media Labs MPEG-4 PCI boards
LOASXcontains LATM multiplexed AAC audio
LRCXX
LVFX
LXFXVR native stream format, used by Leitch/Harris’ video servers.
Magic Lantern Video (MLV)X
MatroskaXX
Matroska audioX
FFmpeg metadataXXMetadata in text format.
MAXIS XAXUsed in Sim City 3000; file extension .xa.
MCAXUsed in some games from Capcom; file extension .mca.
MD StudioX
Metal Gear Solid: The Twin SnakesX
Megalux FrameXUsed by Megalux Ultimate Paint
MobiClip MODSX
MobiClip MOFLEXX
Mobotix .mxgX
Monkey’s AudioX
Motion Pixels MVIX
MOV/QuickTime/MP4XX3GP, 3GP2, PSP, iPod variants supported
MP2XX
MP3XX
MPEG-1 SystemXXmuxed audio and video, VCD format supported
MPEG-PS (program stream)XXalso known as VOB file, SVCD and DVD format supported
MPEG-TS (transport stream)XXalso known as DVB Transport Stream
MPEG-4XXMPEG-4 is a variant of QuickTime.
MSFXAudio format used on the PS3.
Mirillis FIC videoXNo cursor rendering.
MIDI Sample Dump StandardX
MIME multipart JPEGX
MSN TCP webcamXUsed by MSN Messenger webcam streams.
MTVX
MusepackX
Musepack SV8X
Material eXchange Format (MXF)XXSMPTE 377M, used by D-Cinema, broadcast industry.
Material eXchange Format (MXF), D-10 MappingXXSMPTE 386M, D-10/IMX Mapping.
NC camera feedXNC (AVIP NC4600) camera streams
NIST SPeech HEader REsourcesX
Computerized Speech Lab NSPX
NTT TwinVQ (VQF)XNippon Telegraph and Telephone Corporation TwinVQ.
Nullsoft Streaming VideoX
NuppelVideoX
NUTXXNUT Open Container Format
OggXX
Playstation Portable PMPX
Portable Voice FormatX
RK Audio (RKA)X
TechnoTrend PVAXUsed by TechnoTrend DVB PCI boards.
QCPX
raw ADTS (AAC)XX
raw AC-3XX
raw AMR-NBX
raw AMR-WBX
raw APACX
raw aptXXX
raw aptX HDXX
raw BonkX
raw Chinese AVS videoXX
raw DFPWMXX
raw DiracXX
raw DNxHDXX
raw DTSXX
raw DTS-HDX
raw E-AC-3XX
raw FLACXX
raw GSMX
raw H.261XX
raw H.263XX
raw H.264XX
raw HEVCXX
raw Ingenient MJPEGX
raw MJPEGXX
raw MLPX
raw MPEGX
raw MPEG-1X
raw MPEG-2X
raw MPEG-4XX
raw NULLX
raw videoXX
raw id RoQX
raw OBUXX
raw SBCXX
raw ShortenX
raw TAKX
raw TrueHDXX
raw VC-1XX
raw PCM A-lawXX
raw PCM mu-lawXX
raw PCM Archimedes VIDCXX
raw PCM signed 8 bitXX
raw PCM signed 16 bit big-endianXX
raw PCM signed 16 bit little-endianXX
raw PCM signed 24 bit big-endianXX
raw PCM signed 24 bit little-endianXX
raw PCM signed 32 bit big-endianXX
raw PCM signed 32 bit little-endianXX
raw PCM signed 64 bit big-endianXX
raw PCM signed 64 bit little-endianXX
raw PCM unsigned 8 bitXX
raw PCM unsigned 16 bit big-endianXX
raw PCM unsigned 16 bit little-endianXX
raw PCM unsigned 24 bit big-endianXX
raw PCM unsigned 24 bit little-endianXX
raw PCM unsigned 32 bit big-endianXX
raw PCM unsigned 32 bit little-endianXX
raw PCM 16.8 floating point little-endianX
raw PCM 24.0 floating point little-endianX
raw PCM floating-point 32 bit big-endianXX
raw PCM floating-point 32 bit little-endianXX
raw PCM floating-point 64 bit big-endianXX
raw PCM floating-point 64 bit little-endianXX
RDTX
REDCODE R3DXFile format used by RED Digital cameras, contains JPEG 2000 frames and PCM audio.
RealMediaXX
RedirectorX
RedSparkX
Renderware TeXture DictionaryX
Resolume DXVX
RF64X
RL2XAudio and video format used in some games by Entertainment Software Partners.
RPL/ARMovieX
Lego Mindstorms RSOXX
RSDX
RTMPXXOutput is performed by publishing stream to RTMP server
RTPXX
RTSPXX
Sample Dump eXchangeX
SAPXX
SBGX
SDNSX
SDPX
SERX
Digital Pictures SGAX
Sega FILM/CPKXXUsed in many Sega Saturn console games.
Silicon Graphics MovieX
Sierra SOLX.sol files used in Sierra Online games.
Sierra VMDXUsed in Sierra CD-ROM games.
SmackerXMultimedia format used by many games.
SMJPEGXXUsed in certain Loki game ports.
SMPTE 337M encapsulationX
SmushXMultimedia format used in some LucasArts games.
Sony OpenMG (OMA)XXAudio format used in Sony Sonic Stage and Sony Vegas.
Sony PlayStation STRX
Sony Wave64 (W64)XX
SoX native formatXX
SUN AU formatXX
SUP raw PGS subtitlesXX
SVAGXAudio format used in Konami PS2 games.
TDSCX
Text filesX
THPXUsed on the Nintendo GameCube.
Tiertex Limited SEQXTiertex .seq files used in the DOS CD-ROM version of the game Flashback.
True AudioXX
VAGXAudio format used in many Sony PS2 games.
VC-1 test bitstreamXX
Vidvox HapXX
VivoX
VPKXAudio format used in Sony PS games.
Marble WADYX
WAVXX
Waveform ArchiverX
WavPackXX
WebMXX
Windows Televison (WTV)XX
Wing Commander III movieXMultimedia format used in Origin’s Wing Commander III computer game.
Westwood Studios audioXXMultimedia format used in Westwood Studios games.
Westwood Studios VQAXMultimedia format used in Westwood Studios games.
Wideband Single-bit Data (WSD)X
WVEX
Konami XMDX
XMVXMicrosoft video container used in Xbox games.
XVAGXAudio format used on the PS3.
xWMAXMicrosoft audio container used by XAudio 2.
eXtended BINary text (XBIN)X
YUV4MPEG pipeXX
Psygnosis YOPX
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+
+
+

2.2 Image Formats

+ +

FFmpeg can read and write images for each frame of a video sequence. The +following image formats are supported: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
.Y.U.VXXone raw file per component
Alias PIXXXAlias/Wavefront PIX image format
animated GIFXX
APNGXXAnimated Portable Network Graphics
BMPXXMicrosoft BMP image
BRender PIXXArgonaut BRender 3D engine image format.
CRIXCintel RAW
DPXXXDigital Picture Exchange
EXRXOpenEXR
FITSXXFlexible Image Transport System
HDRXXRadiance HDR RGBE Image format
IMGXGEM Raster image
JPEGXXProgressive JPEG is not supported.
JPEG 2000XX
JPEG-LSXX
LJPEGXLossless JPEG
Media 100X
MSPXMicrosoft Paint image
PAMXXPAM is a PNM extension with alpha support.
PBMXXPortable BitMap image
PCDXPhotoCD
PCXXXPC Paintbrush
PFMXXPortable FloatMap image
PGMXXPortable GrayMap image
PGMYUVXXPGM with U and V components in YUV 4:2:0
PGXXPGX file decoder
PHMXXPortable HalfFloatMap image
PICXPictor/PC Paint
PNGXXPortable Network Graphics image
PPMXXPortable PixelMap image
PSDXPhotoshop
PTXXV.Flash PTX format
QOIXXQuite OK Image format
SGIXXSGI RGB image format
Sun RasterfileXXSun RAS image format
TIFFXXYUV, JPEG and some extension is not supported yet.
Truevision TargaXXTarga (.TGA) image format
VBNXXVizrt Binary Image format
WBMPXXWireless Application Protocol Bitmap image format
WebPEXWebP image format, encoding supported through external library libwebp
XBMXXX BitMap image format
XFaceXXX-Face image format
XPMXX PixMap image format
XWDXXX Window Dump image format
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+

E means that support is provided through an external library. +

+
+
+

2.3 Video Codecs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
4X MovieXUsed in certain computer games.
8088flex TMVX
A64 multicolorXCreates video suitable to be played on a commodore 64 (multicolor mode).
Amazing Studio PAF VideoX
American Laser Games MMXUsed in games like Mad Dog McCree.
Amuse Graphics MovieX
AMV VideoXXUsed in Chinese MP3 players.
ANSI/ASCII artX
Apple Intermediate CodecX
Apple MJPEG-BX
Apple PixletX
Apple ProResXXfourcc: apch,apcn,apcs,apco,ap4h,ap4x
Apple QuickDrawXfourcc: qdrw
Argonaut VideoXUsed in some Argonaut games.
Asus v1XXfourcc: ASV1
Asus v2XXfourcc: ASV2
ATI VCR1Xfourcc: VCR1
ATI VCR2Xfourcc: VCR2
Auravision AuraX
Auravision Aura 2X
Autodesk Animator Flic videoX
Autodesk RLEXfourcc: AASC
AV1EESupported through external libraries libaom, libdav1d, librav1e and libsvtav1
Avid 1:1 10-bit RGB PackerXXfourcc: AVrp
AVS (Audio Video Standard) videoXVideo encoding used by the Creature Shock game.
AVS2-P2/IEEE1857.4EESupported through external libraries libxavs2 and libdavs2
AVS3-P2/IEEE1857.10ESupported through external library libuavs3d
AYUVXXMicrosoft uncompressed packed 4:4:4:4
Beam Software VBX
Bethesda VID videoXUsed in some games from Bethesda Softworks.
Bink VideoX
BitJazz SheerVideoX
Bitmap Brothers JV videoX
y41p Brooktree uncompressed 4:1:1 12-bitXX
Brooktree ProSumer VideoXfourcc: BT20
Brute Force & IgnoranceXUsed in the game Flash Traffic: City of Angels.
C93 videoXCodec used in Cyberia game.
CamStudioXfourcc: CSCD
CD+GXVideo codec for CD+G karaoke disks
CDXLXAmiga CD video codec
Chinese AVS videoEXAVS1-P2, JiZhun profile, encoding through external library libxavs
Delphine Software International CIN videoXCodec used in Delphine Software International games.
Discworld II BMV VideoX
CineForm HDXX
Canopus HQX
Canopus HQAX
Canopus HQXX
Canopus Lossless CodecX
CDToonsXCodec used in various Broderbund games.
CinepakX
Cirrus Logic AccuPakXXfourcc: CLJR
CPiA Video FormatX
Creative YUV (CYUV)X
DFAXCodec used in Chronomaster game.
DiracEXsupported though the native vc2 (Dirac Pro) encoder
Deluxe Paint AnimationX
DNxHDXXaka SMPTE VC3
Duck TrueMotion 1.0Xfourcc: DUCK
Duck TrueMotion 2.0Xfourcc: TM20
Duck TrueMotion 2.0 RTXfourcc: TR20
DV (Digital Video)XX
Dxtory capture formatX
Feeble Files/ScummVM DXAXCodec originally used in Feeble Files game.
Electronic Arts CMV videoXUsed in NHL 95 game.
Electronic Arts Madcow videoX
Electronic Arts TGV videoX
Electronic Arts TGQ videoX
Electronic Arts TQI videoX
Escape 124X
Escape 130X
FFmpeg video codec #1XXlossless codec (fourcc: FFV1)
Flash Screen Video v1XXfourcc: FSV1
Flash Screen Video v2XX
Flash Video (FLV)XXSorenson H.263 used in Flash
FM Screen Capture CodecX
Forward UncompressedX
FrapsX
Go2MeetingXfourcc: G2M2, G2M3
Go2WebinarXfourcc: G2M4
Gremlin Digital VideoX
H.261XX
H.263 / H.263-1996XX
H.263+ / H.263-1998 / H.263 version 2XX
H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10EXencoding supported through external library libx264 and OpenH264
HEVCXXencoding supported through external library libx265 and libkvazaar
HNM version 4X
HuffYUVXX
HuffYUV FFmpeg variantXX
IBM UltimotionXfourcc: ULTI
id Cinematic videoXUsed in Quake II.
id RoQ videoXXUsed in Quake III, Jedi Knight 2, other computer games.
IFF ILBMXIFF interleaved bitmap
IFF ByteRun1XIFF run length encoded bitmap
Infinity IMM4X
Intel H.263X
Intel Indeo 2X
Intel Indeo 3X
Intel Indeo 4X
Intel Indeo 5X
Interplay C93XUsed in the game Cyberia from Interplay.
Interplay MVE videoXUsed in Interplay .MVE files.
J2KXX
Karl Morton’s video codecXCodec used in Worms games.
Kega Game Video (KGV1)XKega emulator screen capture codec.
LagarithX
LCL (LossLess Codec Library) MSZHX
LCL (LossLess Codec Library) ZLIBEE
LOCOX
LucasArts SANM/SmushXUsed in LucasArts games / SMUSH animations.
lossless MJPEGXX
MagicYUV VideoXX
Mandsoft Screen Capture CodecX
Microsoft ATC ScreenXAlso known as Microsoft Screen 3.
Microsoft Expression Encoder ScreenXAlso known as Microsoft Titanium Screen 2.
Microsoft RLEX
Microsoft Screen 1XAlso known as Windows Media Video V7 Screen.
Microsoft Screen 2XAlso known as Windows Media Video V9 Screen.
Microsoft Video 1X
MimicXUsed in MSN Messenger Webcam streams.
Miro VideoXLXfourcc: VIXL
MJPEG (Motion JPEG)XX
Mobotix MxPEG videoX
Motion Pixels videoX
MPEG-1 videoXX
MPEG-2 videoXX
MPEG-4 part 2XXlibxvidcore can be used alternatively for encoding.
MPEG-4 part 2 Microsoft variant version 1X
MPEG-4 part 2 Microsoft variant version 2XX
MPEG-4 part 2 Microsoft variant version 3XX
Newtek SpeedHQXX
Nintendo Gamecube THP videoX
NotchLCX
NuppelVideo/RTjpegXVideo encoding used in NuppelVideo files.
On2 VP3Xstill experimental
On2 VP4Xfourcc: VP40
On2 VP5Xfourcc: VP50
On2 VP6Xfourcc: VP60,VP61,VP62
On2 VP7Xfourcc: VP70,VP71
VP8EXfourcc: VP80, encoding supported through external library libvpx
VP9EXencoding supported through external library libvpx
Pinnacle TARGA CineWave YUV16Xfourcc: Y216
Q-team QPEGXfourccs: QPEG, Q1.0, Q1.1
QuickTime 8BPS videoX
QuickTime Animation (RLE) videoXXfourcc: ’rle ’
QuickTime Graphics (SMC)XXfourcc: ’smc ’
QuickTime video (RPZA)XXfourcc: rpza
R10K AJA Kona 10-bit RGB CodecXX
R210 Quicktime Uncompressed RGB 10-bitXX
Raw VideoXX
RealVideo 1.0XX
RealVideo 2.0XX
RealVideo 3.0Xstill far from ideal
RealVideo 4.0X
Renderware TXD (TeXture Dictionary)XTexture dictionaries used by the Renderware Engine.
RL2 videoXused in some games by Entertainment Software Partners
ScreenPressorX
ScreenpressoX
Screen Recorder Gold CodecX
Sierra VMD videoXUsed in Sierra VMD files.
Silicon Graphics Motion Video Compressor 1 (MVC1)X
Silicon Graphics Motion Video Compressor 2 (MVC2)X
Silicon Graphics RLE 8-bit videoX
Smacker videoXVideo encoding used in Smacker.
SMPTE VC-1X
SnowXXexperimental wavelet codec (fourcc: SNOW)
Sony PlayStation MDEC (Motion DECoder)X
Sorenson Vector Quantizer 1XXfourcc: SVQ1
Sorenson Vector Quantizer 3Xfourcc: SVQ3
Sunplus JPEG (SP5X)Xfourcc: SP5X
TechSmith Screen Capture CodecXfourcc: TSCC
TechSmith Screen Capture Codec 2Xfourcc: TSC2
TheoraEXencoding supported through external library libtheora
Tiertex Limited SEQ videoXCodec used in DOS CD-ROM FlashBack game.
Ut VideoXX
v210 QuickTime uncompressed 4:2:2 10-bitXX
v308 QuickTime uncompressed 4:4:4XX
v408 QuickTime uncompressed 4:4:4:4XX
v410 QuickTime uncompressed 4:4:4 10-bitXX
VBLE Lossless CodecX
VMware Screen Codec / VMware VideoXCodec used in videos captured by VMware.
Westwood Studios VQA (Vector Quantized Animation) videoX
Windows Media ImageX
Windows Media Video 7XX
Windows Media Video 8XX
Windows Media Video 9Xnot completely working
Wing Commander III / XanXUsed in Wing Commander III .MVE files.
Wing Commander IV / XanXUsed in Wing Commander IV.
Winnov WNV1X
WMV7XX
YAMAHA SMAFXX
Psygnosis YOP VideoX
yuv4XXlibquicktime uncompressed packed 4:2:0
ZeroCodec Lossless VideoX
ZLIBXXpart of LCL, encoder experimental
Zip Motion Blocks VideoXXEncoder works only in PAL8.
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+

E means that support is provided through an external library. +

+
+
+

2.4 Audio Codecs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
8SVX exponentialX
8SVX fibonacciX
AACEXXencoding supported through internal encoder and external library libfdk-aac
AAC+EIXencoding supported through external library libfdk-aac
AC-3IXIX
ACELP.KELVINX
ADPCM 4X MovieX
ADPCM Yamaha AICAX
ADPCM AmuseGraphics MovieX
ADPCM Argonaut GamesXX
ADPCM CDROM XAX
ADPCM Creative TechnologyX16 -> 4, 8 -> 4, 8 -> 3, 8 -> 2
ADPCM Electronic ArtsXUsed in various EA titles.
ADPCM Electronic Arts Maxis CDROM XSXUsed in Sim City 3000.
ADPCM Electronic Arts R1X
ADPCM Electronic Arts R2X
ADPCM Electronic Arts R3X
ADPCM Electronic Arts XASX
ADPCM G.722XX
ADPCM G.726XX
ADPCM IMA Acorn ReplayX
ADPCM IMA AMVXXUsed in AMV files
ADPCM IMA Cunning DevelopmentsX
ADPCM IMA Electronic Arts EACSX
ADPCM IMA Electronic Arts SEADX
ADPCM IMA FuncomX
ADPCM IMA High Voltage Software ALPXX
ADPCM IMA Mobiclip MOFLEXX
ADPCM IMA QuickTimeXX
ADPCM IMA Simon & Schuster InteractiveXX
ADPCM IMA Ubisoft APMXX
ADPCM IMA Loki SDL MJPEGX
ADPCM IMA WAVXX
ADPCM IMA WestwoodX
ADPCM ISS IMAXUsed in FunCom games.
ADPCM IMA DialogicX
ADPCM IMA Duck DK3XUsed in some Sega Saturn console games.
ADPCM IMA Duck DK4XUsed in some Sega Saturn console games.
ADPCM IMA RadicalX
ADPCM MicrosoftXX
ADPCM MS IMAXX
ADPCM Nintendo Gamecube AFCX
ADPCM Nintendo Gamecube DTKX
ADPCM Nintendo THPX
ADPCM PlaystationX
ADPCM QT IMAXX
ADPCM SEGA CRI ADXXXUsed in Sega Dreamcast games.
ADPCM Shockwave FlashXX
ADPCM Sound Blaster Pro 2-bitX
ADPCM Sound Blaster Pro 2.6-bitX
ADPCM Sound Blaster Pro 4-bitX
ADPCM VIMAXUsed in LucasArts SMUSH animations.
ADPCM Konami XMDX
ADPCM Westwood Studios IMAXXUsed in Westwood Studios games like Command and Conquer.
ADPCM YamahaXX
ADPCM ZorkX
AMR-NBEXencoding supported through external library libopencore-amrnb
AMR-WBEXencoding supported through external library libvo-amrwbenc
Amazing Studio PAF AudioX
Apple lossless audioXXQuickTime fourcc ’alac’
aptXXXUsed in Bluetooth A2DP
aptX HDXXUsed in Bluetooth A2DP
ATRAC1X
ATRAC3X
ATRAC3+X
ATRAC9X
Bink AudioXUsed in Bink and Smacker files in many games.
Bonk audioX
CELTEdecoding supported through external library libcelt
codec2EEen/decoding supported through external library libcodec2
CRI HCAX
Delphine Software International CIN audioXCodec used in Delphine Software International games.
DFPWMXX
Digital Speech Standard - Standard Play mode (DSS SP)X
Discworld II BMV AudioX
COOKXAll versions except 5.1 are supported.
DCA (DTS Coherent Acoustics)XXsupported extensions: XCh, XXCH, X96, XBR, XLL, LBR (partially)
Dolby EX
DPCM Cuberoot-Delta-ExactXUsed in few games.
DPCM GremlinX
DPCM id RoQXXUsed in Quake III, Jedi Knight 2 and other computer games.
DPCM Marble WADYX
DPCM InterplayXUsed in various Interplay computer games.
DPCM Squareroot-Delta-ExactXUsed in various games.
DPCM Sierra OnlineXUsed in Sierra Online game audio files.
DPCM SolX
DPCM XanXUsed in Origin’s Wing Commander IV AVI files.
DPCM Xilam DERFX
DSD (Direct Stream Digital), least significant bit firstX
DSD (Direct Stream Digital), most significant bit firstX
DSD (Direct Stream Digital), least significant bit first, planarX
DSD (Direct Stream Digital), most significant bit first, planarX
DSP Group TrueSpeechX
DST (Direct Stream Transfer)X
DV audioX
Enhanced AC-3XX
EVRC (Enhanced Variable Rate Codec)X
FLAC (Free Lossless Audio Codec)XIX
FTR VoiceX
G.723.1XX
G.729X
GSMEXencoding supported through external library libgsm
GSM Microsoft variantEXencoding supported through external library libgsm
IAC (Indeo Audio Coder)X
iLBC (Internet Low Bitrate Codec)EEXencoding and decoding supported through external library libilbc
IMC (Intel Music Coder)X
Interplay ACMX
MACE (Macintosh Audio Compression/Expansion) 3:1X
MACE (Macintosh Audio Compression/Expansion) 6:1X
Marian’s A-pac audioX
MI-SC4 (Micronas SC-4 Audio)X
MLP (Meridian Lossless Packing)XXUsed in DVD-Audio discs.
Monkey’s AudioX
MP1 (MPEG audio layer 1)IX
MP2 (MPEG audio layer 2)IXIXencoding supported also through external library TwoLAME
MP3 (MPEG audio layer 3)EIXencoding supported through external library LAME, ADU MP3 and MP3onMP4 also supported
MPEG-4 Audio Lossless Coding (ALS)X
MobiClip FastAudioX
Musepack SV7X
Musepack SV8X
Nellymoser AsaoXX
On2 AVC (Audio for Video Codec)X
OpusEXencoding supported through external library libopus
PCM A-lawXX
PCM mu-lawXX
PCM Archimedes VIDCXX
PCM signed 8-bit planarXX
PCM signed 16-bit big-endian planarXX
PCM signed 16-bit little-endian planarXX
PCM signed 24-bit little-endian planarXX
PCM signed 32-bit little-endian planarXX
PCM 32-bit floating point big-endianXX
PCM 32-bit floating point little-endianXX
PCM 64-bit floating point big-endianXX
PCM 64-bit floating point little-endianXX
PCM D-Cinema audio signed 24-bitXX
PCM signed 8-bitXX
PCM signed 16-bit big-endianXX
PCM signed 16-bit little-endianXX
PCM signed 24-bit big-endianXX
PCM signed 24-bit little-endianXX
PCM signed 32-bit big-endianXX
PCM signed 32-bit little-endianXX
PCM signed 16/20/24-bit big-endian in MPEG-TSX
PCM unsigned 8-bitXX
PCM unsigned 16-bit big-endianXX
PCM unsigned 16-bit little-endianXX
PCM unsigned 24-bit big-endianXX
PCM unsigned 24-bit little-endianXX
PCM unsigned 32-bit big-endianXX
PCM unsigned 32-bit little-endianXX
PCM SGAX
QCELP / PureVoiceX
QDesign Music Codec 1X
QDesign Music Codec 2XThere are still some distortions.
RealAudio 1.0 (14.4K)XXReal 14400 bit/s codec
RealAudio 2.0 (28.8K)XReal 28800 bit/s codec
RealAudio 3.0 (dnet)IXXReal low bitrate AC-3 codec
RealAudio LosslessX
RealAudio SIPR / ACELP.NETX
RK Audio (RKA)X
SBC (low-complexity subband codec)XXUsed in Bluetooth A2DP
ShortenX
Sierra VMD audioXUsed in Sierra VMD files.
Smacker audioX
SMPTE 302M AES3 audioXX
SonicXXexperimental codec
Sonic losslessXXexperimental codec
SpeexEEXsupported through external library libspeex
TAK (Tom’s lossless Audio Kompressor)X
True Audio (TTA)XX
TrueHDXXUsed in HD-DVD and Blu-Ray discs.
TwinVQ (VQF flavor)X
VIMAXUsed in LucasArts SMUSH animations.
ViewQuest VQCX
VorbisEXA native but very primitive encoder exists.
Voxware MetaSoundX
Waveform ArchiverX
WavPackXX
Westwood Audio (SND1)X
Windows Media Audio 1XX
Windows Media Audio 2XX
Windows Media Audio LosslessX
Windows Media Audio ProX
Windows Media Audio VoiceX
Xbox Media Audio 1X
Xbox Media Audio 2X
+ +

X means that the feature in that column (encoding / decoding) is supported. +

+

E means that support is provided through an external library. +

+

I means that an integer-only version is available, too (ensures high +performance on systems without hardware floating point support). +

+
+
+

2.5 Subtitle Formats

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameMuxingDemuxingEncodingDecoding
3GPP Timed TextXX
AQTitleXX
DVBXXXX
DVB teletextXE
DVDXXXX
JACOsubXXX
MicroDVDXXX
MPL2XX
MPsub (MPlayer)XX
PGSX
PJS (Phoenix)XX
RealTextXX
SAMIXX
Spruce format (STL)XX
SSA/ASSXXXX
SubRip (SRT)XXXX
SubViewer v1XX
SubViewerXX
TED Talks captionsXX
TTMLXX
VobSub (IDX+SUB)XX
VPlayerXX
WebVTTXXXX
XSUBXX
+ +

X means that the feature is supported. +

+

E means that support is provided through an external library. +

+
+
+

2.6 Network Protocols

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameSupport
AMQPE
fileX
FTPX
GopherX
GophersX
HLSX
HTTPX
HTTPSX
IcecastX
MMSHX
MMSTX
pipeX
Pro-MPEG FECX
RTMPX
RTMPEX
RTMPSX
RTMPTX
RTMPTEX
RTMPTSX
RTPX
SAMBAE
SCTPX
SFTPE
TCPX
TLSX
UDPX
ZMQE
+ +

X means that the protocol is supported. +

+

E means that support is provided through an external library. +

+ +
+
+

2.7 Input/Output Devices

+ + + + + + + + + + + + + + + + + + + + + + +
NameInputOutput
ALSAXX
BKTRX
cacaX
DV1394X
Lavfi virtual deviceX
Linux framebufferXX
JACKX
LIBCDIOX
LIBDC1394X
OpenALX
OpenGLX
OSSXX
PulseAudioXX
SDLX
Video4Linux2XX
VfW captureX
X11 grabbingX
Win32 grabbingX
+ +

X means that input/output is supported. +

+
+
+

2.8 Timecode

+ + + + + + + + + + +
Codec/formatReadWrite
AVIXX
DVXX
GXFXX
MOVXX
MPEG1/2XX
MXFXX
+ +
+
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/git-howto.html b/mm_avh_working_space/bin/ffmpeg/doc/git-howto.html new file mode 100644 index 0000000000000000000000000000000000000000..cc9d354db324e96a4bdd342e18e36cb332d21a18 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/git-howto.html @@ -0,0 +1,624 @@ + + + + + +Using Git to develop FFmpeg + + + + + + + + + + + + + + + + + + +
+ + + +
+

1 Introduction

+ +

This document aims in giving some quick references on a set of useful Git +commands. You should always use the extensive and detailed documentation +provided directly by Git: +

+
+
git --help
+man git
+
+ +

shows you the available subcommands, +

+
+
git <command> --help
+man git-<command>
+
+ +

shows information about the subcommand <command>. +

+

Additional information could be found on the +Git Reference website. +

+

For more information about the Git project, visit the +Git website. +

+

Consult these resources whenever you have problems, they are quite exhaustive. +

+

What follows now is a basic introduction to Git and some FFmpeg-specific +guidelines to ease the contribution to the project. +

+
+
+

2 Basics Usage

+ + +
+

2.1 Get Git

+ +

You can get Git from http://git-scm.com/ +Most distribution and operating system provide a package for it. +

+ +
+
+

2.2 Cloning the source tree

+ +
+
git clone https://git.ffmpeg.org/ffmpeg.git <target>
+
+ +

This will put the FFmpeg sources into the directory <target>. +

+
+
git clone git@source.ffmpeg.org:ffmpeg <target>
+
+ +

This will put the FFmpeg sources into the directory <target> and let +you push back your changes to the remote repository. +

+
+
git clone gil@ffmpeg.org:ffmpeg-web <target>
+
+ +

This will put the source of the FFmpeg website into the directory +<target> and let you push back your changes to the remote repository. +(Note that gil stands for GItoLite and is not a typo of git.) +

+

If you don’t have write-access to the ffmpeg-web repository, you can +create patches after making a read-only ffmpeg-web clone: +

+
+
git clone git://ffmpeg.org/ffmpeg-web <target>
+
+ +

Make sure that you do not have Windows line endings in your checkouts, +otherwise you may experience spurious compilation failures. One way to +achieve this is to run +

+
+
git config --global core.autocrlf false
+
+ + +
+
+

2.3 Updating the source tree to the latest revision

+ +
+
git pull (--rebase)
+
+ +

pulls in the latest changes from the tracked branch. The tracked branch +can be remote. By default the master branch tracks the branch master in +the remote origin. +

+
+

--rebase (see below) is recommended. +

IMPORTANT +

+
+
+

2.4 Rebasing your local branches

+ +
+
git pull --rebase
+
+ +

fetches the changes from the main repository and replays your local commits +over it. This is required to keep all your local changes at the top of +FFmpeg’s master tree. The master tree will reject pushes with merge commits. +

+ +
+
+

2.5 Adding/removing files/directories

+ +
+
git add [-A] <filename/dirname>
+git rm [-r] <filename/dirname>
+
+ +

Git needs to get notified of all changes you make to your working +directory that makes files appear or disappear. +Line moves across files are automatically tracked. +

+ +
+
+

2.6 Showing modifications

+ +
+
git diff <filename(s)>
+
+ +

will show all local modifications in your working directory as unified diff. +

+ +
+
+

2.7 Inspecting the changelog

+ +
+
git log <filename(s)>
+
+ +

You may also use the graphical tools like gitview or gitk +or the web interface available at http://source.ffmpeg.org/. +

+
+
+

2.8 Checking source tree status

+ +
+
git status
+
+ +

detects all the changes you made and lists what actions will be taken in case +of a commit (additions, modifications, deletions, etc.). +

+ +
+
+

2.9 Committing

+ +
+
git diff --check
+
+ +

to double check your changes before committing them to avoid trouble later +on. All experienced developers do this on each and every commit, no matter +how small. +

+

Every one of them has been saved from looking like a fool by this many times. +It’s very easy for stray debug output or cosmetic modifications to slip in, +please avoid problems through this extra level of scrutiny. +

+

For cosmetics-only commits you should get (almost) empty output from +

+
+
git diff -w -b <filename(s)>
+
+ +

Also check the output of +

+
+
git status
+
+ +

to make sure you don’t have untracked files or deletions. +

+
+
git add [-i|-p|-A] <filenames/dirnames>
+
+ +

Make sure you have told Git your name, email address and GPG key +

+
+
git config --global user.name "My Name"
+git config --global user.email my@email.invalid
+git config --global user.signingkey ABCDEF0123245
+
+ +

Enable signing all commits or use -S +

+
+
git config --global commit.gpgsign true
+
+ +

Use --global to set the global configuration for all your Git checkouts. +

+

Git will select the changes to the files for commit. Optionally you can use +the interactive or the patch mode to select hunk by hunk what should be +added to the commit. +

+ +
+
git commit
+
+ +

Git will commit the selected changes to your current local branch. +

+

You will be prompted for a log message in an editor, which is either +set in your personal configuration file through +

+
+
git config --global core.editor
+
+ +

or set by one of the following environment variables: +GIT_EDITOR, VISUAL or EDITOR. +

+
+
+

2.10 Writing a commit message

+ +

Log messages should be concise but descriptive. +

+

The first line must contain the context, a colon and a very short +summary of what the commit does. Details can be added, if necessary, +separated by an empty line. These details should not exceed 60-72 characters +per line, except when containing code. +

+

Example of a good commit message: +

+
+
avcodec/cbs: add a helper to read extradata within packet side data
+
+Using ff_cbs_read() on the raw buffer will not parse it as extradata,
+resulting in parsing errors for example when handling ISOBMFF avcC.
+This helper works around that.
+
+ +
+
ptr might be NULL
+
+ +

If the summary on the first line is not enough, in the body of the message, +explain why you made a change, what you did will be obvious from the changes +themselves most of the time. Saying just "bug fix" or "10l" is bad. Remember +that people of varying skill levels look at and educate themselves while +reading through your code. Don’t include filenames in log messages except in +the context, Git provides that information. +

+

If the commit fixes a registered issue, state it in a separate line of the +body: Fix Trac ticket #42. +

+

The first line will be used to name +the patch by git format-patch. +

+

Common mistakes for the first line, as seen in git log --oneline +include: missing context at the beginning; description of what the code did +before the patch; line too long or wrapped to the second line. +

+
+
+

2.11 Preparing a patchset

+ +
+
git format-patch <commit> [-o directory]
+
+ +

will generate a set of patches for each commit between <commit> and +current HEAD. E.g. +

+
+
git format-patch origin/master
+
+ +

will generate patches for all commits on current branch which are not +present in upstream. +A useful shortcut is also +

+
+
git format-patch -n
+
+ +

which will generate patches from last n commits. +By default the patches are created in the current directory. +

+
+
+

2.12 Sending patches for review

+ +
+
git send-email <commit list|directory>
+
+ +

will send the patches created by git format-patch or directly +generates them. All the email fields can be configured in the global/local +configuration or overridden by command line. +Note that this tool must often be installed separately (e.g. git-email +package on Debian-based distros). +

+ +
+
+

2.13 Renaming/moving/copying files or contents of files

+ +

Git automatically tracks such changes, making those normal commits. +

+
+
mv/cp path/file otherpath/otherfile
+git add [-A] .
+git commit
+
+ + +
+
+
+

3 Git configuration

+ +

In order to simplify a few workflows, it is advisable to configure both +your personal Git installation and your local FFmpeg repository. +

+ +
+

3.1 Personal Git installation

+ +

Add the following to your ~/.gitconfig to help git send-email +and git format-patch detect renames: +

+
+
[diff]
+        renames = copy
+
+ +
+
+

3.2 Repository configuration

+ +

In order to have git send-email automatically send patches +to the ffmpeg-devel mailing list, add the following stanza +to /path/to/ffmpeg/repository/.git/config: +

+
+
[sendemail]
+        to = ffmpeg-devel@ffmpeg.org
+
+ +
+
+
+

4 FFmpeg specific

+ + +
+

4.1 Reverting broken commits

+ +
+
git reset <commit>
+
+ +

git reset will uncommit the changes till <commit> rewriting +the current branch history. +

+
+
git commit --amend
+
+ +

allows one to amend the last commit details quickly. +

+
+
git rebase -i origin/master
+
+ +

will replay local commits over the main repository allowing to edit, merge +or remove some of them in the process. +

+
+

git reset, git commit --amend and git rebase +rewrite history, so you should use them ONLY on your local or topic branches. +The main repository will reject those changes. +

NOTE +

+
+
git revert <commit>
+
+ +

git revert will generate a revert commit. This will not make the +faulty commit disappear from the history. +

+
+
+

4.2 Pushing changes to remote trees

+ +
+
git push origin master --dry-run
+
+ +

Will simulate a push of the local master branch to the default remote +(origin). And list which branches and ranges or commits would have been +pushed. +Git will prevent you from pushing changes if the local and remote trees are +out of sync. Refer to Updating the source tree to the latest revision. +

+
+
git remote add <name> <url>
+
+ +

Will add additional remote with a name reference, it is useful if you want +to push your local branch for review on a remote host. +

+
+
git push <remote> <refspec>
+
+ +

Will push the changes to the <remote> repository. +Omitting <refspec> makes git push update all the remote +branches matching the local ones. +

+
+
+

4.3 Finding a specific svn revision

+ +

Since version 1.7.1 Git supports ‘:/foo’ syntax for specifying commits +based on a regular expression. see man gitrevisions +

+
+
git show :/'as revision 23456'
+
+ +

will show the svn changeset ‘r23456’. With older Git versions searching in +the git log output is the easiest option (especially if a pager with +search capabilities is used). +

+

This commit can be checked out with +

+
+
git checkout -b svn_23456 :/'as revision 23456'
+
+ +

or for Git < 1.7.1 with +

+
+
git checkout -b svn_23456 $SHA1
+
+ +

where $SHA1 is the commit hash from the git log output. +

+ +
+
+
+

5 gpg key generation

+ +

If you have no gpg key yet, we recommend that you create a ed25519 based key as it +is small, fast and secure. Especially it results in small signatures in git. +

+
+
gpg --default-new-key-algo "ed25519/cert,sign+cv25519/encr" --quick-generate-key "human@server.com"
+
+ +

When generating a key, make sure the email specified matches the email used in git as some sites like +github consider mismatches a reason to declare such commits unverified. After generating a key you +can add it to the MAINTAINER file and upload it to a keyserver. +

+
+
+

6 Pre-push checklist

+ +

Once you have a set of commits that you feel are ready for pushing, +work through the following checklist to doublecheck everything is in +proper order. This list tries to be exhaustive. In case you are just +pushing a typo in a comment, some of the steps may be unnecessary. +Apply your common sense, but if in doubt, err on the side of caution. +

+

First, make sure that the commits and branches you are going to push +match what you want pushed and that nothing is missing, extraneous or +wrong. You can see what will be pushed by running the git push command +with --dry-run first. And then inspecting the commits listed with +git log -p 1234567..987654. The git status command +may help in finding local changes that have been forgotten to be added. +

+

Next let the code pass through a full run of our test suite. +

+
    +
  • make distclean +
  • /path/to/ffmpeg/configure +
  • make fate +
  • if fate fails due to missing samples run make fate-rsync and retry +
+ +

Make sure all your changes have been checked before pushing them, the +test suite only checks against regressions and that only to some extend. It does +obviously not check newly added features/code to be working unless you have +added a test for that (which is recommended). +

+

Also note that every single commit should pass the test suite, not just +the result of a series of patches. +

+

Once everything passed, push the changes to your public ffmpeg clone and post a +merge request to ffmpeg-devel. You can also push them directly but this is not +recommended. +

+
+
+

7 Server Issues

+ +

Contact the project admins at if you have technical +problems with the Git server. +

+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/libavcodec.html b/mm_avh_working_space/bin/ffmpeg/doc/libavcodec.html new file mode 100644 index 0000000000000000000000000000000000000000..9e69aad257436f858247ef4078c1542cd0fc91b8 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/libavcodec.html @@ -0,0 +1,85 @@ + + + + + +Libavcodec Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ + +
+
+

1 Description

+ +

The libavcodec library provides a generic encoding/decoding framework +and contains multiple decoders and encoders for audio, video and +subtitle streams, and several bitstream filters. +

+

The shared architecture provides various services ranging from bit +stream I/O to DSP optimizations, and makes it suitable for +implementing robust and fast codecs as well as for experimentation. +

+ +
+ +
+

3 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/libavdevice.html b/mm_avh_working_space/bin/ffmpeg/doc/libavdevice.html new file mode 100644 index 0000000000000000000000000000000000000000..5261dc2d1cc4acd3edb2799abbcb18d5a253b16f --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/libavdevice.html @@ -0,0 +1,82 @@ + + + + + +Libavdevice Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ + +
+
+

1 Description

+ +

The libavdevice library provides a generic framework for grabbing from +and rendering to many common multimedia input/output devices, and +supports several input and output devices, including Video4Linux2, +VfW, DShow, and ALSA. +

+ +
+ +
+

3 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/libavfilter.html b/mm_avh_working_space/bin/ffmpeg/doc/libavfilter.html new file mode 100644 index 0000000000000000000000000000000000000000..83002202db9d91ed74df0f5ddeb2b2a48300b825 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/libavfilter.html @@ -0,0 +1,81 @@ + + + + + +Libavfilter Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ + +
+
+

1 Description

+ +

The libavfilter library provides a generic audio/video filtering +framework containing several filters, sources and sinks. +

+ +
+ +
+

3 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/libavformat.html b/mm_avh_working_space/bin/ffmpeg/doc/libavformat.html new file mode 100644 index 0000000000000000000000000000000000000000..8f04cf05ca74925640ff19e561b5160b32474e11 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/libavformat.html @@ -0,0 +1,85 @@ + + + + + +Libavformat Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ + +
+
+

1 Description

+ +

The libavformat library provides a generic framework for multiplexing +and demultiplexing (muxing and demuxing) audio, video and subtitle +streams. It encompasses multiple muxers and demuxers for multimedia +container formats. +

+

It also supports several input and output protocols to access a media +resource. +

+ +
+ +
+

3 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/libavutil.html b/mm_avh_working_space/bin/ffmpeg/doc/libavutil.html new file mode 100644 index 0000000000000000000000000000000000000000..f058063a40f98f2d8fa2a4a1ddc4d584c5febc9c --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/libavutil.html @@ -0,0 +1,104 @@ + + + + + +Libavutil Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ + +
+
+

1 Description

+ +

The libavutil library is a utility library to aid portable +multimedia programming. It contains safe portable string functions, +random number generators, data structures, additional mathematics +functions, cryptography and multimedia related functionality (like +enumerations for pixel and sample formats). It is not a library for +code needed by both libavcodec and libavformat. +

+

The goals for this library is to be: +

+
+
Modular
+

It should have few interdependencies and the possibility of disabling individual +parts during ./configure. +

+
+
Small
+

Both sources and objects should be small. +

+
+
Efficient
+

It should have low CPU and memory usage. +

+
+
Useful
+

It should avoid useless features that almost no one needs. +

+
+ + +
+
+

2 See Also

+ +

ffmpeg, ffplay, ffprobe, +ffmpeg-utils +

+ +
+
+

3 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/libswresample.html b/mm_avh_working_space/bin/ffmpeg/doc/libswresample.html new file mode 100644 index 0000000000000000000000000000000000000000..c2de2cc3e0d640da30324f48b4d28bb0882c3846 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/libswresample.html @@ -0,0 +1,105 @@ + + + + + +Libswresample Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ + +
+
+

1 Description

+ +

The libswresample library performs highly optimized audio resampling, +rematrixing and sample format conversion operations. +

+

Specifically, this library performs the following conversions: +

+
    +
  • Resampling: is the process of changing the audio rate, for +example from a high sample rate of 44100Hz to 8000Hz. Audio +conversion from high to low sample rate is a lossy process. Several +resampling options and algorithms are available. + +
  • Format conversion: is the process of converting the type of +samples, for example from 16-bit signed samples to unsigned 8-bit or +float samples. It also handles packing conversion, when passing from +packed layout (all samples belonging to distinct channels interleaved +in the same buffer), to planar layout (all samples belonging to the +same channel stored in a dedicated buffer or "plane"). + +
  • Rematrixing: is the process of changing the channel layout, for +example from stereo to mono. When the input channels cannot be mapped +to the output streams, the process is lossy, since it involves +different gain factors and mixing. +
+ +

Various other audio conversions (e.g. stretching and padding) are +enabled through dedicated options. +

+ +
+
+

2 See Also

+ +

ffmpeg, ffplay, ffprobe, +ffmpeg-resampler, +libavutil +

+ +
+
+

3 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/libswscale.html b/mm_avh_working_space/bin/ffmpeg/doc/libswscale.html new file mode 100644 index 0000000000000000000000000000000000000000..57341157dd776d71c71fda4fc20f2478b5419047 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/libswscale.html @@ -0,0 +1,99 @@ + + + + + +Libswscale Documentation + + + + + + + + + + + + + + + + + +
+ + +
+

Table of Contents

+ + +
+
+

1 Description

+ +

The libswscale library performs highly optimized image scaling and +colorspace and pixel format conversion operations. +

+

Specifically, this library performs the following conversions: +

+
    +
  • Rescaling: is the process of changing the video size. Several +rescaling options and algorithms are available. This is usually a +lossy process. + +
  • Pixel format conversion: is the process of converting the image +format and colorspace of the image, for example from planar YUV420P to +RGB24 packed. It also handles packing conversion, that is converts +from packed layout (all pixels belonging to distinct planes +interleaved in the same buffer), to planar layout (all samples +belonging to the same plane stored in a dedicated buffer or "plane"). + +

    This is usually a lossy process in case the source and destination +colorspaces differ. +

+ + +
+
+

2 See Also

+ +

ffmpeg, ffplay, ffprobe, +ffmpeg-scaler, +libavutil +

+ +
+
+

3 Authors

+ +

The FFmpeg developers. +

+

For details about the authorship, see the Git history of the project +(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command +git log in the FFmpeg source directory, or browsing the +online repository at https://git.ffmpeg.org/ffmpeg. +

+

Maintainers for the specific components are listed in the file +MAINTAINERS in the source code tree. +

+ +
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/mailing-list-faq.html b/mm_avh_working_space/bin/ffmpeg/doc/mailing-list-faq.html new file mode 100644 index 0000000000000000000000000000000000000000..d795d1ef7da53cb49729c16f61b92ceea05d1016 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/mailing-list-faq.html @@ -0,0 +1,524 @@ + + + + + +FFmpeg Mailing List FAQ + + + + + + + + + + + + + + + + + +
+ + + +
+

1 General Questions

+ + +
+

1.1 What is a mailing list?

+ +

A mailing list is not much different than emailing someone, but the +main difference is that your message is received by everyone who +subscribes to the list. It is somewhat like a forum but in email form. +

+

See the ffmpeg-user archives +for examples. +

+
+
+

1.2 What type of questions can I ask?

+ +
    +
  • ffmpeg-user: +For questions involving unscripted usage or compilation of the FFmpeg +command-line tools (ffmpeg, ffprobe, ffplay). + +
  • libav-user: +For questions involving the FFmpeg libav* libraries (libavcodec, +libavformat, libavfilter, etc). + +
  • ffmpeg-devel: +For discussions involving the development of FFmpeg and for submitting +patches. User questions should be asked at ffmpeg-user or libav-user. +
+ +

To report a bug see https://ffmpeg.org/bugreports.html. +

+

We cannot provide help for scripts and/or third-party tools. +

+
+
+

1.3 How do I ask a question or send a message to a mailing list?

+ +

First you must subscribe. Then all you have to do is +send an email: +

+ + +
+
+
+

2 Subscribing / Unsubscribing

+ + +
+

2.1 How do I subscribe?

+ +

Email with the subject +subscribe. +

+

Or visit the ffmpeg-user mailing list info page +and refer to the Subscribing to ffmpeg-user section. +

+

The process is the same for the other mailing lists. +

+
+
+

2.2 How do I unsubscribe?

+ +

Email with subject unsubscribe. +

+

Or visit the ffmpeg-user mailing list info page, +scroll to bottom of page, enter your email address in the box, and click +the Unsubscribe or edit options button. +

+

The process is the same for the other mailing lists. +

+

Please avoid asking a mailing list admin to unsubscribe you unless you +are absolutely unable to do so by yourself. See Who do I contact if I have a problem with the mailing list? +

+

Note that it is possible to temporarily halt message delivery (vacation mode). +See How do I disable mail delivery without unsubscribing? +

+
+
+
+

3 Moderation Queue

+ +
+

3.1 Why is my message awaiting moderator approval?

+ +

Some messages are automatically held in the moderation queue and +must be manually approved by a mailing list admin: +

+

These are: +

+
    +
  • Messages that exceed the message size limit. + +
  • Messages from users whose accounts have been set with the moderation flag +(very rarely occurs, but may if a user repeatedly ignores the rules +or is abusive towards others). +
+ +
+
+

3.2 How long does it take for my message in the moderation queue to be approved?

+ +

The queue is not checked on a regular basis. You can ask on the +#ffmpeg-devel IRC channel on Libera Chat for someone to approve your message. +

+
+
+

3.3 How do I delete my message in the moderation queue?

+ +

You should have received an email with the subject Your message to <mailing list name> awaits moderator approval. +A link is in the message that will allow you to delete your message +unless a mailing list admin already approved or rejected it. +

+
+
+
+

4 Archives

+ + +
+

4.1 Where are the archives?

+ +

See the Archives section on the FFmpeg Contact +page for links to all FFmpeg mailing list archives. +

+

Note that the archives are split by month. Discussions that span +several months will be split into separate months in the archives. +

+
+
+

4.2 How do I reply to a message in the archives?

+ +

Click the email link at the top of the message just under the subject +title. The link will provide the proper headers to keep the message +within the thread. +

+

Note that you must be subscribed to send a message to the ffmpeg-user or +libav-user mailing lists. +

+
+
+

4.3 How do I search the archives?

+ +

Perform a site search using your favorite search engine. Example: +

+

site:lists.ffmpeg.org/pipermail/ffmpeg-user/ "search term" +

+
+
+
+

5 Other

+ + +
+

5.1 Is there an alternative to the mailing list?

+ +

You can ask for help in the official #ffmpeg IRC channel on Libera Chat. +

+

Some users prefer the third-party Nabble +interface which presents the mailing lists in a typical forum layout. +

+

There are also numerous third-party help sites such as +Super User and +r/ffmpeg on reddit. +

+
+
+

5.2 What is top-posting?

+ +

See https://en.wikipedia.org/wiki/Posting_style#Top-posting. +

+

Instead, use trimmed interleaved/inline replies (example). +

+
+
+

5.3 What is the message size limit?

+ +

The message size limit is 1000 kilobytes. Please provide links to larger files +instead of attaching them. +

+
+
+

5.4 Where can I upload sample files?

+ +

Anywhere that is not too annoying for us to use. +

+

Google Drive and Dropbox are acceptable if you need a file host, and +0x0.st is good for files under 256 MiB. +

+

Small, short samples are preferred if possible. +

+
+
+

5.5 Will I receive spam if I send and/or subscribe to a mailing list?

+ +

Highly unlikely. +

+
    +
  • The list of subscribed users is not public. + +
  • Email addresses in the archives are obfuscated. + +
  • Several unique test email accounts were utilized and none have yet +received any spam. +
+ +

However, you may see a spam in the mailing lists on rare occasions: +

+
    +
  • Spam in the moderation queue may be accidentally approved due to human +error. + +
  • There have been a few messages from subscribed users who had their own +email addresses hacked and spam messages from (or appearing to be from) +the hacked account were sent to their contacts (a mailing list being a +contact in these cases). + +
  • If you are subscribed to the bug tracker mailing list (ffmpeg-trac) you +may see the occasional spam as a false bug report, but we take measures +to try to prevent this. +
+ +
+
+

5.6 How do I filter mailing list messages?

+ +

Use the List-Id. For example, the ffmpeg-user mailing list is +ffmpeg-user.ffmpeg.org. You can view the List-Id in the raw message +or headers. +

+

You can then filter the mailing list messages to their own folder. +

+
+
+

5.7 How do I disable mail delivery without unsubscribing?

+ +

Sometimes you may want to temporarily stop receiving all mailing list +messages. This "vacation mode" is simple to do: +

+
    +
  1. Go to the ffmpeg-user mailing list info page + +
  2. Enter your email address in the box at very bottom of the page and click the +Unsubscribe or edit options box. + +
  3. Enter your password and click the Log in button. + +
  4. Look for the Mail delivery option. Here you can disable/enable mail +delivery. If you check Set globally it will apply your choice to all +other FFmpeg mailing lists you are subscribed to. +
+ +

Alternatively, from your subscribed address, send a message to +with the subject set delivery off. To re-enable mail delivery send a +message to with the subject +set delivery on. +

+
+
+

5.8 Why is the mailing list munging my address?

+ +

This is due to subscribers that use an email service with a DMARC reject policy +which adds difficulties to mailing list operators. +

+

The mailing list must re-write (munge) the From: header for such users; +otherwise their email service will reject and bounce the message resulting in +automatic unsubscribing from the mailing list. +

+

When sending a message these users will see via <mailing list name> +added to their name and the From: address munged to the address of +the particular mailing list. +

+

If you want to avoid this then please use a different email service. +

+

Note that ffmpeg-devel does not apply any munging as it causes issues with +patch authorship. As a result users with an email service with a DMARC reject +policy may be automatically unsubscribed due to rejected and bounced messages. +

+
+
+
+

6 Rules and Etiquette

+ + +
+

6.1 What are the rules and the proper etiquette?

+ +

There may seem to be many things to remember, but we want to help and +following these guidelines will allow you to get answers more quickly +and help avoid getting ignored. +

+
    +
  • Always show your actual, unscripted ffmpeg command and the +complete, uncut console output from your command. + +
  • Use the most simple and minimal command that still shows the issue you +are encountering. + +
  • Provide all necessary information so others can attempt to duplicate +your issue. This includes the actual command, complete uncut console +output, and any inputs that are required to duplicate the issue. + +
  • Use the latest ffmpeg build you can get. See the FFmpeg Download +page for links to recent builds for Linux, macOS, and Windows. Or +compile from the current git master branch. + +
  • Avoid top-posting. +Also see What is top-posting? + +
  • Avoid hijacking threads. Thread hijacking is replying to a message and +changing the subject line to something unrelated to the original thread. +Most email clients will still show the renamed message under the +original thread. This can be confusing and these types of messages are +often ignored. + +
  • Do not send screenshots. Copy and paste console text instead of making +screenshots of the text. + +
  • Avoid sending email disclaimers and legalese if possible as this is a +public list. + +
  • Avoid using the -loglevel debug, -loglevel quiet, and +-hide_banner options unless requested to do so. + +
  • If you attach files avoid compressing small files. Uncompressed is +preferred. + +
  • Please do not send HTML-only messages. The mailing list will ignore the +HTML component of your message. Most mail clients will automatically +include a text component: this is what the mailing list will use. + +
  • Configuring your mail client to break lines after 70 or so characters is +recommended. + +
  • Avoid sending the same message to multiple mailing lists. + +
  • Please follow our Code of Conduct. +
+ +
+
+
+

7 Help

+ + +
+

7.1 Why am I not receiving any messages?

+ +

Some email providers have blacklists or spam filters that block or mark +the mailing list messages as false positives. Unfortunately, the user is +often not aware of this and is often out of their control. +

+

When possible we attempt to notify the provider to be removed from the +blacklists or filters. +

+
+
+

7.2 Why are my sent messages not showing up?

+ +

Excluding messages that are held in the moderation queue +there are a few other reasons why your messages may fail to appear: +

+
    +
  • HTML-only messages are ignored by the mailing lists. Most mail clients +automatically include a text component alongside HTML email: this is what +the mailing list will use. If it does not then consider your client to be +broken, because sending a text component along with the HTML component to +form a multi-part message is recommended by email standards. + +
  • Check your spam folder. +
+ +
+
+

7.3 Why do I keep getting unsubscribed from ffmpeg-devel?

+ +

Users with an email service that has a DMARC reject or quarantine policy may be +automatically unsubscribed from the ffmpeg-devel mailing list due to the mailing +list messages being continuously rejected and bounced back. +

+

Consider using a different email service. +

+
+
+

7.4 Who do I contact if I have a problem with the mailing list?

+ +

Send a message to . +

+
+
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/nut.html b/mm_avh_working_space/bin/ffmpeg/doc/nut.html new file mode 100644 index 0000000000000000000000000000000000000000..143847ad3865e48becba51e7a1fb7c5d838cb814 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/nut.html @@ -0,0 +1,244 @@ + + + + + +NUT + + + + + + + + + + + + + + + + + + +
+ + + +
+

1 Description

+

NUT is a low overhead generic container format. It stores audio, video, +subtitle and user-defined streams in a simple, yet efficient, way. +

+

It was created by a group of FFmpeg and MPlayer developers in 2003 +and was finalized in 2008. +

+

The official nut specification is at svn://svn.mplayerhq.hu/nut +In case of any differences between this text and the official specification, +the official specification shall prevail. +

+
+
+

2 Modes

+

NUT has some variants signaled by using the flags field in its main header. +

+ + + + +
BROADCASTExtend the syncpoint to report the sender wallclock
PIPEOmit completely the syncpoint
+ + +
+

2.1 BROADCAST

+ +

The BROADCAST variant provides a secondary time reference to facilitate +detecting endpoint latency and network delays. +It assumes all the endpoint clocks are synchronized. +To be used in real-time scenarios. +

+
+
+

2.2 PIPE

+ +

The PIPE variant assumes NUT is used as non-seekable intermediate container, +by not using syncpoint removes unneeded overhead and reduces the overall +memory usage. +

+
+
+
+

3 Container-specific codec tags

+ + +
+

3.1 Generic raw YUVA formats

+ +

Since many exotic planar YUVA pixel formats are not considered by +the AVI/QuickTime FourCC lists, the following scheme is adopted for +representing them. +

+

The first two bytes can contain the values: +Y1 = only Y +Y2 = Y+A +Y3 = YUV +Y4 = YUVA +

+

The third byte represents the width and height chroma subsampling +values for the UV planes, that is the amount to shift the luma +width/height right to find the chroma width/height. +

+

The fourth byte is the number of bits used (8, 16, ...). +

+

If the order of bytes is inverted, that means that each component has +to be read big-endian. +

+
+
+

3.2 Raw Audio

+ + + + + + + +
ALAWA-LAW
ULAWMU-LAW
P<type><interleaving><bits>little-endian PCM
<bits><interleaving><type>Pbig-endian PCM
+ +

<type> is S for signed integer, U for unsigned integer, F for IEEE float +<interleaving> is D for default, P is for planar. +<bits> is 8/16/24/32 +

+
+
PFD[32]   would for example be signed 32 bit little-endian IEEE float
+
+ +
+
+

3.3 Subtitles

+ + + + + + + +
UTF8Raw UTF-8
SSA[0]SubStation Alpha
DVDSDVD subtitles
DVBSDVB subtitles
+ +
+
+

3.4 Raw Data

+ + + + +
UTF8Raw UTF-8
+ +
+
+

3.5 Codecs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
3IV1non-compliant MPEG-4 generated by old 3ivx
ASV1Asus Video
ASV2Asus Video 2
CVIDCinepak
CYUVCreative YUV
DIVXnon-compliant MPEG-4 generated by old DivX
DUCKTruemotion 1
FFV1FFmpeg video 1
FFVHFFmpeg Huffyuv
H261ITU H.261
H262ITU H.262
H263ITU H.263
H264ITU H.264
HFYUHuffyuv
I263Intel H.263
IV31Indeo 3.1
IV32Indeo 3.2
IV50Indeo 5.0
LJPGITU JPEG (lossless)
MJLSITU JPEG-LS
MJPGITU JPEG
MPG4MS MPEG-4v1 (not ISO MPEG-4)
MP42MS MPEG-4v2
MP43MS MPEG-4v3
MP4VISO MPEG-4 Part 2 Video (from old encoders)
mpg1ISO MPEG-1 Video
mpg2ISO MPEG-2 Video
MRLEMS RLE
MSVCMS Video 1
RT21Indeo 2.1
RV10RealVideo 1.0
RV20RealVideo 2.0
RV30RealVideo 3.0
RV40RealVideo 4.0
SNOWFFmpeg Snow
SVQ1Sorenson Video 1
SVQ3Sorenson Video 3
theoXiph Theora
TM20Truemotion 2.0
UMP4non-compliant MPEG-4 generated by UB Video MPEG-4
VCR1ATI VCR1
VP30VP 3.0
VP31VP 3.1
VP50VP 5.0
VP60VP 6.0
VP61VP 6.1
VP62VP 6.2
VP70VP 7.0
WMV1MS WMV7
WMV2MS WMV8
WMV3MS WMV9
WV1Fnon-compliant MPEG-4 generated by ?
WVC1VC-1
XVIDnon-compliant MPEG-4 generated by old Xvid
XVIXnon-compliant MPEG-4 generated by old Xvid with interlacing bug
+ +
+
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/platform.html b/mm_avh_working_space/bin/ffmpeg/doc/platform.html new file mode 100644 index 0000000000000000000000000000000000000000..2362a7928a3db7eddf63300468b1a172596804d3 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/platform.html @@ -0,0 +1,434 @@ + + + + + +Platform Specific Information + + + + + + + + + + + + + + + + + +
+ + + +
+

1 Unix-like

+ +

Some parts of FFmpeg cannot be built with version 2.15 of the GNU +assembler which is still provided by a few AMD64 distributions. To +make sure your compiler really uses the required version of gas +after a binutils upgrade, run: +

+
+
$(gcc -print-prog-name=as) --version
+
+ +

If not, then you should install a different compiler that has no +hard-coded path to gas. In the worst case pass --disable-asm +to configure. +

+ +
+

1.1 Advanced linking configuration

+ +

If you compiled FFmpeg libraries statically and you want to use them to +build your own shared library, you may need to force PIC support (with +--enable-pic during FFmpeg configure) and add the following option +to your project LDFLAGS: +

+
+
-Wl,-Bsymbolic
+
+ +

If your target platform requires position independent binaries, you should +pass the correct linking flag (e.g. -pie) to --extra-ldexeflags. +

+
+
+

1.2 BSD

+ +

BSD make will not build FFmpeg, you need to install and use GNU Make +(gmake). +

+
+
+

1.3 (Open)Solaris

+ +

GNU Make is required to build FFmpeg, so you have to invoke (gmake), +standard Solaris Make will not work. When building with a non-c99 front-end +(gcc, generic suncc) add either --extra-libs=/usr/lib/values-xpg6.o +or --extra-libs=/usr/lib/64/values-xpg6.o to the configure options +since the libc is not c99-compliant by default. The probes performed by +configure may raise an exception leading to the death of configure itself +due to a bug in the system shell. Simply invoke a different shell such as +bash directly to work around this: +

+
+
bash ./configure
+
+ +
+
+

1.4 Darwin (Mac OS X, iPhone)

+ +

The toolchain provided with Xcode is sufficient to build the basic +unaccelerated code. +

+

Mac OS X on PowerPC or ARM (iPhone) requires a preprocessor from +https://github.com/FFmpeg/gas-preprocessor or +https://github.com/yuvi/gas-preprocessor(currently outdated) to build the optimized +assembly functions. Put the Perl script somewhere +in your PATH, FFmpeg’s configure will pick it up automatically. +

+

Mac OS X on amd64 and x86 requires nasm to build most of the +optimized assembly functions. Fink, +Gentoo Prefix, +Homebrew +or MacPorts can easily provide it. +

+ +
+
+
+

2 DOS

+ +

Using a cross-compiler is preferred for various reasons. +http://www.delorie.com/howto/djgpp/linux-x-djgpp.html +

+ +
+
+

3 OS/2

+ +

For information about compiling FFmpeg on OS/2 see +http://www.edm2.com/index.php/FFmpeg. +

+ +
+
+

4 Windows

+ + +
+

4.1 Native Windows compilation using MinGW or MinGW-w64

+ +

FFmpeg can be built to run natively on Windows using the MinGW-w64 +toolchain. Install the latest versions of MSYS2 and MinGW-w64 from +http://msys2.github.io/ and/or http://mingw-w64.sourceforge.net/. +You can find detailed installation instructions in the download section and +the FAQ. +

+

Notes: +

+
    +
  • Building for the MSYS environment is discouraged, MSYS2 provides a full +MinGW-w64 environment through mingw64_shell.bat or +mingw32_shell.bat that should be used instead of the environment +provided by msys2_shell.bat. + +
  • Building using MSYS2 can be sped up by disabling implicit rules in the +Makefile by calling make -r instead of plain make. This +speed up is close to non-existent for normal one-off builds and is only +noticeable when running make for a second time (for example during +make install). + +
  • In order to compile FFplay, you must have the MinGW development library +of SDL and pkg-config installed. + +
  • By using ./configure --enable-shared when configuring FFmpeg, +you can build the FFmpeg libraries (e.g. libavutil, libavcodec, +libavformat) as DLLs. + +
+ + +
+

4.1.1 Native Windows compilation using MSYS2

+ +

The MSYS2 MinGW-w64 environment provides ready to use toolchains and dependencies +through pacman. +

+

Make sure to use mingw64_shell.bat or mingw32_shell.bat to have +the correct MinGW-w64 environment. The default install provides shortcuts to +them under MinGW-w64 Win64 Shell and MinGW-w64 Win32 Shell. +

+
+
# normal msys2 packages
+pacman -S make pkgconf diffutils
+
+# mingw-w64 packages and toolchains
+pacman -S mingw-w64-x86_64-nasm mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2
+
+ +

To target 32 bits replace x86_64 with i686 in the command above. +

+
+
+
+

4.2 Microsoft Visual C++ or Intel C++ Compiler for Windows

+ +

FFmpeg can be built with MSVC 2013 or later. +

+

You will need the following prerequisites: +

+
    +
  • MSYS2 +
  • NASM +(Also available via MSYS2’s package manager.) +
+ +

To set up a proper environment in MSYS2, you need to run msys_shell.bat from +the Visual Studio or Intel Compiler command prompt. +

+

Place yasm.exe somewhere in your PATH. +

+

Next, make sure any other headers and libs you want to use, such as zlib, are +located in a spot that the compiler can see. Do so by modifying the LIB +and INCLUDE environment variables to include the Windows-style +paths to these directories. Alternatively, you can try to use the +--extra-cflags/--extra-ldflags configure options. +

+

Finally, run: +

+
+
For MSVC:
+./configure --toolchain=msvc
+
+For ICL:
+./configure --toolchain=icl
+
+make
+make install
+
+ +

If you wish to compile shared libraries, add --enable-shared to your +configure options. Note that due to the way MSVC and ICL handle DLL imports and +exports, you cannot compile static and shared libraries at the same time, and +enabling shared libraries will automatically disable the static ones. +

+

Notes: +

+
    +
  • If you wish to build with zlib support, you will have to grab a compatible +zlib binary from somewhere, with an MSVC import lib, or if you wish to link +statically, you can follow the instructions below to build a compatible +zlib.lib with MSVC. Regardless of which method you use, you must still +follow step 3, or compilation will fail. +
      +
    1. Grab the zlib sources. +
    2. Edit win32/Makefile.msc so that it uses -MT instead of -MD, since +this is how FFmpeg is built as well. +
    3. Edit zconf.h and remove its inclusion of unistd.h. This gets +erroneously included when building FFmpeg. +
    4. Run nmake -f win32/Makefile.msc. +
    5. Move zlib.lib, zconf.h, and zlib.h to somewhere MSVC +can see. +
    + +
  • FFmpeg has been tested with the following on i686 and x86_64: +
      +
    • Visual Studio 2013 Pro and Express +
    • Intel Composer XE 2013 +
    • Intel Composer XE 2013 SP1 +
    +

    Anything else is not officially supported. +

    +
+ + +
+

4.2.1 Linking to FFmpeg with Microsoft Visual C++

+ +

If you plan to link with MSVC-built static libraries, you will need +to make sure you have Runtime Library set to +Multi-threaded (/MT) in your project’s settings. +

+

You will need to define inline to something MSVC understands: +

+
#define inline __inline
+
+ +

Also note, that as stated in Microsoft Visual C++, you will need +an MSVC-compatible inttypes.h. +

+

If you plan on using import libraries created by dlltool, you must +set References to No (/OPT:NOREF) under the linker optimization +settings, otherwise the resulting binaries will fail during runtime. +This is not required when using import libraries generated by lib.exe. +This issue is reported upstream at +http://sourceware.org/bugzilla/show_bug.cgi?id=12633. +

+

To create import libraries that work with the /OPT:REF option +(which is enabled by default in Release mode), follow these steps: +

+
    +
  1. Open the Visual Studio Command Prompt. + +

    Alternatively, in a normal command line prompt, call vcvars32.bat +which sets up the environment variables for the Visual C++ tools +(the standard location for this file is something like +C:\Program Files (x86_\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat). +

    +
  2. Enter the bin directory where the created LIB and DLL files +are stored. + +
  3. Generate new import libraries with lib.exe: + +
    +
    lib /machine:i386 /def:..\lib\foo-version.def  /out:foo.lib
    +
    + +

    Replace foo-version and foo with the respective library names. +

    +
+ +
+
+
+

4.3 Cross compilation for Windows with Linux

+ +

You must use the MinGW cross compilation tools available at +http://www.mingw.org/. +

+

Then configure FFmpeg with the following options: +

+
./configure --target-os=mingw32 --cross-prefix=i386-mingw32msvc-
+
+

(you can change the cross-prefix according to the prefix chosen for the +MinGW tools). +

+

Then you can easily test FFmpeg with Wine. +

+
+
+

4.4 Compilation under Cygwin

+ +

Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack +llrint() in its C library. +

+

Install your Cygwin with all the "Base" packages, plus the +following "Devel" ones: +

+
binutils, gcc4-core, make, git, mingw-runtime, texinfo
+
+ +

In order to run FATE you will also need the following "Utils" packages: +

+
diffutils
+
+ +

If you want to build FFmpeg with additional libraries, download Cygwin +"Devel" packages for Ogg and Vorbis from any Cygwin packages repository: +

+
libogg-devel, libvorbis-devel
+
+ +

These library packages are only available from +Cygwin Ports: +

+
+
yasm, libSDL-devel, libgsm-devel, libmp3lame-devel,
+speex-devel, libtheora-devel, libxvidcore-devel
+
+ +

The recommendation for x264 is to build it from source, as it evolves too +quickly for Cygwin Ports to be up to date. +

+
+
+

4.5 Crosscompilation for Windows under Cygwin

+ +

With Cygwin you can create Windows binaries that do not need the cygwin1.dll. +

+

Just install your Cygwin as explained before, plus these additional +"Devel" packages: +

+
gcc-mingw-core, mingw-runtime, mingw-zlib
+
+ +

and add some special flags to your configure invocation. +

+

For a static build run +

+
./configure --target-os=mingw32 --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
+
+ +

and for a build with shared libraries +

+
./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
+
+ +
+
+
+ + + + + diff --git a/mm_avh_working_space/bin/ffmpeg/doc/style.min.css b/mm_avh_working_space/bin/ffmpeg/doc/style.min.css new file mode 100644 index 0000000000000000000000000000000000000000..6843fda57d03d5ed37c7d952248e6b042755e2df --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/doc/style.min.css @@ -0,0 +1,23 @@ +/*! +The MIT License (MIT) + +Copyright (c) 2014 Barbara Lepage + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + */body{background-color:#313131;color:#e6e6e6;text-align:justify}body, h1, h2, h3, h4, h5, h6{font-family:"Lucida Grande","Lucida Sans Unicode","Lucida Sans","Helvetica Neue",Helvetica,Verdana,Tahoma,sans-serif}a{color:#4cae4c}a strong{color:#e6e6e6}a:hover{color:#7fc77f}a:hover strong{color:#4cae4c}main{width:100% ! important;min-height:600px;margin:auto}h1, h2, h3, h4{font-weight:bold;text-align:left}h1, h2, h3{color:#bebebe}h1 strong, h2 strong, h3 strong{color:#e6e6e6}h4, h5, h6{color:#3c8b3c}h1{border-bottom:4px #bebebe solid;padding:20px 2%}h3{border-bottom:2px #bebebe solid;padding:15px 1%}h4{border-bottom:1px solid #e6e6e6;padding:10px 0;margin:20px 0;color:#e6e6e6}.list-group .list-group-item{background-color:#3e3e3e;border-color:black}.list-group.list-group-big .list-group-item{padding:25px}.list-group a.list-group-item{color:#7fc77f}.list-group a.list-group-item:hover{background-color:#313131;color:#4cae4c}.well{background-color:#242424;border-color:black;color:#bebebe}.well strong{color:#e6e6e6}.well code{background-color:#313131}.well hr{border-color:#3c8b3c}.well h3{margin:5px 0 15px 0;border:0;padding:0}.well a{color:#4cae4c}.well a.btn{color:white}.well small{display:block;padding:0 10px;font-style:italic}.well.example{padding-top:40px;margin-bottom:130px}.well.example pre{margin:50px;margin-bottom:30px;font-size:1.5em}.well.example .btn{margin-right:50px;margin-bottom:20px}.well.well-with-icon{min-height:136px}.well.well-with-icon .pull-right,.well.well-with-icon .pull-left{background-color:#4cae4c;color:#e6e6e6;padding:10px;border-radius:5px;margin:5px}.well.well-with-icon .pull-right{margin-left:20px}.well.well-with-icon .pull-left{margin-right:20px}a.well{display:block}a.well:hover{text-decoration:none;opacity:0.8}.info, .warning{margin:10px;padding:10px;background-color:#3e3e3e;color:#e6e6e6}.info code, .warning code{background-color:#313131}.info{border-left:10px #4cae4c solid}.warning{border-left:10px #ae4c4c solid}.with-icon{padding:30px}.with-icon .pull-left{padding-right:30px}.with-icon .pull-right{padding-left:30px}dd{margin-left:20px}code{background-color:#242424;color:#7fc77f;display:inline-block;margin:5px}.table{margin:20px 0;border-radius:4px}.table th,.table td,.table tr{border:1px solid #171717}.table tr th{background-color:#3e3e3e;border-bottom:2px solid #e6e6e6}.table tr:nth-child(odd){background-color:#242424}#sidebar-wrapper, .navbar{background-color:#171717;overflow-x:hidden}#sidebar-wrapper .sidebar-brand img,#sidebar-wrapper .navbar-brand img, .navbar .sidebar-brand img, .navbar .navbar-brand img{opacity:0.6;margin-right:8px}#sidebar-wrapper .sidebar-brand:hover,#sidebar-wrapper .navbar-brand:hover, .navbar .sidebar-brand:hover, .navbar .navbar-brand:hover{color:#fff}#sidebar-wrapper .sidebar-brand:hover img,#sidebar-wrapper .navbar-brand:hover img, .navbar .sidebar-brand:hover img, .navbar .navbar-brand:hover img{opacity:1}#sidebar-wrapper .sidebar-nav li ul, .navbar .sidebar-nav li ul{list-style-type:none;padding:0}#sidebar-wrapper .sidebar-nav li ul li, .navbar .sidebar-nav li ul li{line-height:20px}#sidebar-wrapper .sidebar-nav li ul li a, .navbar .sidebar-nav li ul li a{padding-left:20px}.content-header{height:auto;background-color:#242424}.content-header h1{color:#e6e6e6;display:block;margin:0;margin-bottom:20px;line-height:normal;border-bottom:none}#download h4, #index h4{margin-top:180px}#download h4.first, #index h4.first{margin-top:20px}#download h4.first small, #index h4.first small{color:inherit;font-size:1em}#download .btn-download-wrapper, #index .btn-download-wrapper{text-align:center;margin:160px auto}#download .btn-download-wrapper .btn, #index .btn-download-wrapper .btn{font-size:3em;padding:3%;display:inline-block;margin-bottom:5px}#download .btn-download-wrapper small, #index .btn-download-wrapper small{display:block;font-size:0.4em}#download h2.description, #index h2.description{color:#e6e6e6;font-size:2em;font-weight:bold;margin:120px 50px;line-height:2em}#download h2.description .label, #index h2.description .label{font-size:0.5em}#download .btn-download-wrapper{margin:40px auto}#download .os-selector{text-align:center;color:#e6e6e6;margin:30px 0}#download .os-selector a.btn-build{color:#e6e6e6;display:block;padding:20px;border-radius:2px}#download .os-selector .btn-build[href="#build-linux"]{background-color:#e43}#download .os-selector .btn-build[href="#build-linux"]:hover{color:#e43;background-color:#e6e6e6}#download .os-selector .btn-build[href="#build-windows"]{background-color:#06a}#download .os-selector .btn-build[href="#build-windows"]:hover{color:#06a;background-color:#e6e6e6}#download .os-selector .btn-build[href="#build-mac"]{background-color:darkgrey}#download .os-selector .btn-build[href="#build-mac"]:hover{color:darkgrey;background-color:#e6e6e6}#download .os-selector .tab-content{margin-top:20px}#download .os-selector #build-linux h3{color:#e43}#download .os-selector #build-windows h3{color:#06a}#download .os-selector #build-mac h3{color:darkgrey}footer{background-color:#242424;border-top:1px #101010 solid;padding:20px 0%}footer a{display:block}footer img[alt="FFmpeg"]{width:50%;display:block;margin:auto} diff --git a/mm_avh_working_space/bin/ffmpeg/presets/libvpx-1080p.ffpreset b/mm_avh_working_space/bin/ffmpeg/presets/libvpx-1080p.ffpreset new file mode 100644 index 0000000000000000000000000000000000000000..cf25932100a6305692270ad89b5dd468995898fc --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/presets/libvpx-1080p.ffpreset @@ -0,0 +1,19 @@ +vcodec=libvpx + +g=120 +lag-in-frames=16 +deadline=good +cpu-used=0 +vprofile=1 +qmax=51 +qmin=11 +slices=4 +b=2M + +#ignored unless using -pass 2 +maxrate=24M +minrate=100k +auto-alt-ref=1 +arnr-maxframes=7 +arnr-strength=5 +arnr-type=centered diff --git a/mm_avh_working_space/bin/ffmpeg/presets/libvpx-1080p50_60.ffpreset b/mm_avh_working_space/bin/ffmpeg/presets/libvpx-1080p50_60.ffpreset new file mode 100644 index 0000000000000000000000000000000000000000..4a88040d34225e4db75794ff6d09855dfbed3619 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/presets/libvpx-1080p50_60.ffpreset @@ -0,0 +1,19 @@ +vcodec=libvpx + +g=120 +lag-in-frames=25 +deadline=good +cpu-used=0 +vprofile=1 +qmax=51 +qmin=11 +slices=4 +b=2M + +#ignored unless using -pass 2 +maxrate=24M +minrate=100k +auto-alt-ref=1 +arnr-maxframes=7 +arnr-strength=5 +arnr-type=centered diff --git a/mm_avh_working_space/bin/ffmpeg/presets/libvpx-360p.ffpreset b/mm_avh_working_space/bin/ffmpeg/presets/libvpx-360p.ffpreset new file mode 100644 index 0000000000000000000000000000000000000000..f9729ba2bb2bdb2fda98f7276728e77d219aba77 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/presets/libvpx-360p.ffpreset @@ -0,0 +1,18 @@ +vcodec=libvpx + +g=120 +lag-in-frames=16 +deadline=good +cpu-used=0 +vprofile=0 +qmax=63 +qmin=0 +b=768k + +#ignored unless using -pass 2 +maxrate=1.5M +minrate=40k +auto-alt-ref=1 +arnr-maxframes=7 +arnr-strength=5 +arnr-type=centered diff --git a/mm_avh_working_space/bin/ffmpeg/presets/libvpx-720p.ffpreset b/mm_avh_working_space/bin/ffmpeg/presets/libvpx-720p.ffpreset new file mode 100644 index 0000000000000000000000000000000000000000..e84cc150cde913e5e5dd805af7279b6847a43d8b --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/presets/libvpx-720p.ffpreset @@ -0,0 +1,19 @@ +vcodec=libvpx + +g=120 +lag-in-frames=16 +deadline=good +cpu-used=0 +vprofile=0 +qmax=51 +qmin=11 +slices=4 +b=2M + +#ignored unless using -pass 2 +maxrate=24M +minrate=100k +auto-alt-ref=1 +arnr-maxframes=7 +arnr-strength=5 +arnr-type=centered diff --git a/mm_avh_working_space/bin/ffmpeg/presets/libvpx-720p50_60.ffpreset b/mm_avh_working_space/bin/ffmpeg/presets/libvpx-720p50_60.ffpreset new file mode 100644 index 0000000000000000000000000000000000000000..8fce2bfb5a8ecabefbbbfa650201b49a4480a3e9 --- /dev/null +++ b/mm_avh_working_space/bin/ffmpeg/presets/libvpx-720p50_60.ffpreset @@ -0,0 +1,19 @@ +vcodec=libvpx + +g=120 +lag-in-frames=25 +deadline=good +cpu-used=0 +vprofile=0 +qmax=51 +qmin=11 +slices=4 +b=2M + +#ignored unless using -pass 2 +maxrate=24M +minrate=100k +auto-alt-ref=1 +arnr-maxframes=7 +arnr-strength=5 +arnr-type=centered diff --git a/mm_avh_working_space/bin/mkvtoolnix/MKVToolNix.url b/mm_avh_working_space/bin/mkvtoolnix/MKVToolNix.url new file mode 100644 index 0000000000000000000000000000000000000000..f180f43b1f414c3865cdd50677d7856ec41d72ce --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/MKVToolNix.url @@ -0,0 +1,2 @@ +[InternetShortcut] +URL=https://www.bunkus.org/videotools/mkvtoolnix/ diff --git a/mm_avh_working_space/bin/mkvtoolnix/data/portable-app b/mm_avh_working_space/bin/mkvtoolnix/data/portable-app new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/mm_avh_working_space/bin/mkvtoolnix/data/sounds/finished-1.webm b/mm_avh_working_space/bin/mkvtoolnix/data/sounds/finished-1.webm new file mode 100644 index 0000000000000000000000000000000000000000..f7df67d9b4e4712ae821ff85d86ac06bcb526b4b Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/data/sounds/finished-1.webm differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/data/sounds/finished-2.webm b/mm_avh_working_space/bin/mkvtoolnix/data/sounds/finished-2.webm new file mode 100644 index 0000000000000000000000000000000000000000..3ec77e34646dc500bc57ee9d4a14d819d9c575b2 Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/data/sounds/finished-2.webm differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/data/sounds/finished-3.webm b/mm_avh_working_space/bin/mkvtoolnix/data/sounds/finished-3.webm new file mode 100644 index 0000000000000000000000000000000000000000..9235354821eb187922e3cc25529f1949c28a674a Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/data/sounds/finished-3.webm differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/COPYING.txt b/mm_avh_working_space/bin/mkvtoolnix/doc/COPYING.txt new file mode 100644 index 0000000000000000000000000000000000000000..d159169d1050894d3ea3b98e1c965c4058208fe1 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/COPYING.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/NEWS.txt b/mm_avh_working_space/bin/mkvtoolnix/doc/NEWS.txt new file mode 100644 index 0000000000000000000000000000000000000000..878f8b4a66bdc319818c890d9243ed74522fc4e5 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/NEWS.txt @@ -0,0 +1,10496 @@ +# Version 76.0 "Celebration" 2023-04-30 + +## Important notes + +* mkvmerge: removed the option `--blockadd`. Removing block additional data is + not possible anymore, as it is often required for proper decoding. Part of + the implementation of #3511. + +## New features and enhancements + +* mkvmerge: JSON file identification: added a child element called + `num_index_entries` to the `properties` track element containing the number + of index entries found for a track. Currently only implemented for Matroska + files where it contains the number of cue points. See #3510. +* mkvmerge: the maximum block addition ID track header value is now calculated + automatically from both the existing mappings & the actually used block + additions in the block groups. Part of the implementation of #3511. +* mkvmerge: Matroska reader: when reading WebM files that use block additions + with ID 4 (HDR for VP9) an appropriate block addition mapping will be + created automatically. Part of the implementation of #3511. +* mkvmerge: MP4 reader: the title/movie name meta data (content of the + `udta.meta.ilst.©nam` atom) will now be copied over as the segment title + track header attribute. Part of the implementation of #3475. +* mkvmerge: MP4 reader: the comment & encoder meta data (content of the + `udta.meta.ilst.©cmt` & `….©too` atoms) will now be copied over as global + tags `COMMENT` & `ENCODER` respectively. Part of the implementation of + #3475. +* mkvmerge, MKVToolNix GUI's multiplexer: added an option to stop processing + after the primary video track ends called `--stop-after-video-ends`. This + discards any remaining packets of other tracks. Part of the implementation + #3506. +* MKVToolNix GUI: only on Windows: the GUI now uses Qt's "Fusion" style + instead of the deprecated "Windows Vista" style. The advantage is that as of + Qt 6.5 the "Fusion" style properly supports Windows 10's & 11's dark + application mode. The Windows binaries are now built with said Qt + version. Therefore the option to disable the dark mode has been + removed. Fixes #3264 and likely others. +* MKVToolNix GUI: multiplexer: automatically setting the destination file + name: added an option in the preferences for using the first source file's + directory name instead of its file name as the basis for the destination + file name. Implements #3512. +* MKVToolNix GUI: multiplexer: double-clicking on certain columns in the + "tracks" view will now toggle them directly (columns "Default track" & + "Forced track") or activate the corresponding control (columns "Language", + "Name" & "Delay"). Double-clicks on other columns will do what they've done + before, too: toggling the "Copy item" state. Implements #3513 & others. +* MKVToolNix GUI: the dialog for editing language tags is now created only the + first time the user wants to edit a language tag & cached afterwards instead + of creating a new instance each time. This makes subsequent uses instant. + +## Bug fixes + +* mkvmerge: mkvmerge will now only try to probe for VobSubs if the name of the + file to identify ends in either `.idx` or `.sub`, preventing + mis-identification of other file types if VobSubs with the same base name + exist in the same directory. Fixes #3508. +* mkvmerge: AC-3: mkvmerge will now skip certain types of garbage data (16 + bytes starting with 0x01 0x10) that can occur before each sync frame, + fixing the file not being identified as AC-3. Fixes #3484. +* mkvmerge: Matroska reader: when reading files that use block additions with + IDs other than 1 (e.g. 4 for HDR for VP9) the IDs will now be kept & written + to the output file. Before no ID would be written, effectively using 1 as + that's the default value for the corresponding element. Part of the + implementation of #3511. +* mkvmerge: mkvmerge will no longer write block addition mappings or the max + block addition ID track header elements when creating a WebM file as those + elements aren't supported there. Part of the implementation of #3511. +* mkvpropedit: fixed replacing chapters & tags in files that don't contain + tracks. Fixes #3498. + + +# Version 75.0.0 "Goliath" 2023-03-26 + +## New features and enhancements + +* mkvmerge: MP4 reader: mkvmerge will now read Timed Text (FourCC `tx3g`) + subtitle tracks & convert them on the fly to Matroska's simple text subtitle + format (`S_TEXT/UTF8`; text only, no styles). Implements #2208, #2242, + #2613, #3000, #3243, #3418 and possibly others. + +## Bug fixes + +* all: switched back to using `boost::filesystem` functions for creating + directories instead of the ones introduced to work around bugs in + `std::filesystem`. The latter didn't work correctly with UNC paths after the + switch to `boost::filesystem::path` in v74. Fixes #3483. +* mkvmerge: VobSub reader: mkvmerge will now probe the `.idx` file during + VobSub identification even if the `.sub` file is passed as the + source. Avoids mis-detection of the `.sub` as MPEG program streams. Fixes + #3489. +* MKVToolNix GUI: the GUI could abort with an exception on startup while + looking for the `mkvmerge` or `mediainfo` executables due to inaccessible + folders. Fixes #3481. +* MKVToolNix GUI: preferences: when opening the preferences the first time the + UI might pre-select the first entry in the list of interface languages if + the operating system's language is not available for MKVToolNix. This might + also happen on Linux if e.g. `en_GB` is set, even though `en_US` is + available. Now English (`en_US`) will be selected instead. Fixes #3486. +* MKVToolNix GUI: multiplexer: when adding files the GUI has special handling + for chapter/tags/segment info files. This is done by comparing their content + to certain patterns. This recognition could wrongfully be triggered if any + such file was embedded in another file verbatim, e.g. with a chapter XML + file attachment in a Matroska file. When trying to add that Matroska file, + the GUI would treat it as a chapter file instead of a regular one. This + content-based detection was fixed. Fixes #3487. + +## Other changes + +* mkvpropedit, GUI's header editor: removed support for the deprecated + "minimum cache" & "maximum cache" track header elements. + + +# Version 74.0.0 "You Oughta Know" 2023-02-12 + +## New features and enhancements + +* mkvmerge: SRT handling: added a hack called `--engage + keep_whitespaces_in_text_subtitles` which disables stripping whitespaces + from the start & end of each line of SRT entries during muxing. Part of the + implementation of #3470. + +## Bug fixes + +* all: Windows: UNC paths of type `\\?\C:\…` are supported again by switching + back to Boost's file system library instead of using C++17's file system + library. Fixes #3058. +* mkvmerge: AVC/H.264 & HEVC/H.265 packetizers: when appending tracks the + pixel dimensions will be checked & muxing will be aborted if they don't + match. Fixes #3480. +* mkvmerge: file type detection: file types that can be detected unambiguously + by their content (e.g. Matroska, MP4, WAV…) will now preferred in the + detection order over file types based on their extension. Prevents certain + cases of mis-detection, e.g. DTS in WAV but with a file name extension of + `.dts` being detected as the wrong type of DTS. Fixes #3462. +* mkvmerge: SRT handling: whitespaces will now be stripped from the start & + the end of each line of each entry, not just from the end of the last + line. Part of the fix of #3470. +* mkvextract: SRT extraction: whitespaces will not be stripped from the start + & end of the whole entry anymore. Part of the fix of #3470. +* MKVToolNix GUI: multiplexer: when adding multiple files that include certain + file types (chapters, segment info and tag files) and when the choice where + to add them is "all files to a single new tab", these certain file types + will now be added in the newly added tab as well instead of the current tab + that had already been open. Fixes #3469. +* build system: fixed compatibility with Ruby 3.2.0 by using `FileTest.exist?` + instead of `File.exists?`, `Dir.exists?` & `FileTest.exists?` which were + removed in that release. + +## Build system changes + +* MKVToolNix is now using & requiring Boost's "file system" and "system" + libraries again instead of C++17's file system library. This is due to gcc's + library not supporting UNC paths of types `\\?\C:\dir\file.ext`. + + +# Version 73.0.0 "25 or 6 to 4" 2023-01-02 + +## New features and enhancements + +* mkvmerge: greatly enhanced the speed of Base64 decoding which is used used + e.g. when reading pictures embedded in Ogg or FLAC files or for binary data + inside XML chapter & tag files. Even small blocks of data could take + unreasonably long. +* mkvmerge: added support for reading HEVC/H.265 video from FLV + containers. Implements #3466. + +## Bug fixes + +* mkvmerge: splitting: fixed a typo in the string output in GUI mode regarding + the timestamps before which splitting was done. See #3421. +* MKVToolNix GUI: job output: after having run multiple jobs the "Clear + output" functionality only reset the visible parts. However, using the "save + output" function would also save the output generated before the user used + "clear output". Now only the output after the last use of "clear output" is + saved. Fixes #3438. +* build system: when probing for the FLAC library the Ogg libraries will be + linked with the compiled test program as well. This fixes detection if the + `pkg-config` settings for FLAC don't list Ogg & the linker doesn't find the + library automatically (e.g. for my macOS builds). Fixes #3439. + + +# Version 72.0.0 "Minuano (Six-eight)" 2022-11-13 + +## New features and enhancements + +* mkvmerge: AV1 parser: the variable-width OBU size field will be re-written + with minimal length if it's encoded longer than necessary. +* mkvmerge: when splitting is active the program will output the timestamps + actually used for making the decision when to split. If GUI mode is active, + a specially formatted line `#GUI#splitting_before_timestamp ` is + output as well. Lines prefixed with`#GUI#` are suitable for machine parsing, + won't be translated and are guaranteed not to change in format. Implements + #3421. +* MKVToolNix GUI: multiplexer: when dragging & dropping directories to the + "attachments" tab, the files contained in those directories will be + attached. Implements #3410. +* MKVToolNix GUI: info tool: added information about the file (directory, + size, modification timestamp) at the top of each tab. Implements #3407. + +## Bug fixes + +* mkvmerge: AV1 parser: fixed the parser completely aborting when parsing the + OBU size field fails due to there not being enough data to parse. Instead + the parser will remember the last known-good position & restart from there + after more data is available. Fixes #3431. +* mkvmerge: HDMV PGS subtitles: reverted the change that implemented a + heuristic for detecting bogus timestamps & attempting to fix them. This was + done to fix #3268. Unfortunately this affected valid subtitle files with + intentional huge gaps in timestamps, e.g. forced subtitle tracks. The + heuristic has simply been removed, fixing #3392. +* mkvmerge: Matroska reader: fixed reading files with EBML Void elements + before the Matroska Segment element. +* mkvmerge: fixed reversed attachment selection: `--attachments !4` would not + copy any attachment instead of all attachments but the one with ID 4. Fixes + #3427. +* mkvextract: IETF BCP 47/RFC 5646 language tags: mkvextract will now use & + prefer IETF BCP 47 track language elements if they're present. Only affects + the VobSub & USF subtitle extraction. +* mkvpropedit, MKVToolNix GUI's chapter & header editors: updated the list of + deprecated Matroska elements. The applications will no longer try to write + those elements, even if they're found in the file to be modified. The + programs will no longer abort with error messages such as `assertion "false" + failed`. Fixes #3416. +* mkvpropedit, MKVToolNix GUI's chapter & header editors: when the Matroska + version numbers stored in the EBML Head element are updated, the updated + EBML Head element might be smaller than the existing one. In that case the + programs used to shrink the EBML Head & write a small EBML Void element + between the updated EBML Head & the following element, usually a Matroska + Segment element. This isn't widely supported by programs including + MKVToolNix itself, causing them to declare such files as invalid. The + programs will now create the EBML Void element inside the EBML Head element, + making them a level 1 element instead of a level 0 element. Fixes #3355. +* mkvpropedit, MKVToolNix GUI's chapter & header editors: often the programs + have to relocate the Master elements in which the modifications were + done. In that case the Seek Head elements must also be updated to reflect to + the Master elements' new positions. If a file contained a Seek Head element + at the start already and if that Seek Head was too small to contain the + updated positions, the programs would end up in an endless loop trying to + write data to the end, creating ever-growing files. This is now handled + properly by voiding this too-small Seek Head & finding a proper space for a + new one instead. Fixes #3338. +* MKVToolNix GUI: header editor: fixed pixelated icons on higher display + scaling values. Fixes #3420. + +## Build system changes + +* bug fix: libFLAC detection is now done via `pkg-config`, and the + corresponding compiler flags are honored. Fixes static compilation with + newer versions of libFLAC with MXE where a compiler definition is required + to signal that it libFLAC wasn't built as a DLL. + + +# Version 71.1.0 "Fortitude" 2022-10-09 + +## Bug fixes + +* Chapters DTD: added the new edition & chapter elements from Matroska v5. +* Chapters DTD: fixed EditionUID being mandatory. mkvmerge can auto-generate + it if it's missing from the XML file. +* Chapters DTD: fixed the `example-chapters-1.xml` not validating against the + DTD. +* Chapters DTD: corrected the old name `EditionManaged` to + `EditionFlagOrdered`. +* Chapters DTD: fixed `ChapLanguageIETF` missing its element declaration & + `ChapterLanguage` being required. +* XML DTDs: fixed elements representing binary data not allowing the `format` + attribute. + +## Build system changes + +* bug fix: configure accidentally tested for libEBML ≥ 2.0.0 & libMatroska ≥ + 2.0.0, even though the actual requirements are 1.4.4 & 1.7.1 respectively. + + +# Version 71.0.0 "Altitude" 2022-10-08 + +## New features and enhancements + +* mkvmerge, MKVToolNix GUI's multiplexer: added support for the Emphasis audio + track header element via the `--audio-emphasis` option. It is also read from + Matroska files. +* mkvmerge: the options `--list-stereo-modes` and `--list-audio-emphasis` have + been added to list all support numerical & textual values for the + `--stereo-mode` & `--audio-emphasis` options. +* mkvpropedit, MKVToolNix GUI's header editor: added support for the Emphasis + audio track header element via the `emphasis` property. +* MKVToolNix GUI: multiplexer: when the track properties are + configured to be displayed in a tab widget below the files & tracks + in the "Input" tab, the "Color information" tab will be laid out in + two columns. This reduces the minimum height the whole tab widget + requires. Implements #3401. +* MKVToolNix GUI: greatly sped up closing the preferences dialog by only + re-running certain initialization functions when their corresponding + settings have changed. Also fixes issues such as #3406. +* mkvinfo, MKVToolNix GUI's info tool: added support for the following new + elements from Matroska v5: Emphasis audio track header element; Chapter Skip + Type; Edition Display; Edition String; Edition Language IETF. +* mkvmerge, mkvpropedit: added support for the following new chapter elements + from Matroska v5: Chapter Skip Type; Edition Display; Edition String; + Edition Language IETF. The GUI's chapter editor will receive support for + them in the next release. + +## Bug fixes + +* mkvmerge: Ogg/OGM reader: mkvmerge will now correctly skip tracks of + unsupported types as well as tracks for which all track header pages + haven't been found. Fixes #3394. + +## Build system changes + +* libEBML 1.4.4 & libMatroska 1.7.1 are now required. +* The bundled libEBML & libMatroska libraries were updated to v1.4.4 & v1.7.1 + respectively. +* The bundled `fmt` library was updated to v9.1.0. +* The bundled `nlohmann-json` library was updated to v3.11.2. + + +# Version 70.0.0 "Caught A Lite Sneeze" 2022-08-14 + +## New features and enhancements + +* MKVToolNix GUI: the user can now control where the job queue files & the + preferences INI file are stored via environment variables. If set, the + variable `MKVTOOLNIX_GUI_STATE_DIR` can point to a directory where the GUI + stores both the job queue sub-directory and the preferences INI file. If you + only want to relocate the preferences INI file, you can store the desired + file name for the INI file in `MKVTOOLNIX_GUI_CONFIG_FILE`. Implements + #3382. +* MKVToolNix GUI: when adding directories via drag & drop/copy & paste the GUI + will now offer the user the option to create one multiplex settings tab per + directory & adding all files from that directory to the corresponding, newly + created tab. Implements #3371. + +## Bug fixes + +* mkvmerge: AV1 OBU parser: fixed identifying files that only contain single + frame. Fixes #3380. +* MKVToolNix GUI: multiplexer: when reading color parameters from identified + files that are floating point numbers (minimum/maximum luminance, projection + pitch/roll/yaw) the numbers will be formatted in floating-point notation + instead of scientific notation as mkvmerge only supports the former. Fixes + #3368. +* MKVToolNix GUI: multiplexer: color parameters that are floating point + numbers (minimum/maximum luminance, projection pitch/roll/yaw) will only be + set to a value during identification if the identification actually contains + the property, and not to 0 anymore if it doesn't. + +## Build system changes + +* Several merge requests where accepted that improve compilation on MSYS2 on + Windows. Note that this build type isn't supported. + + +# Version 69.0.0 "Day And Age" 2022-07-09 + +## Important notes + +* all: the spelling of "colour" was changed to "color" throughout all programs + to match the use of American English spelling in MKVToolNix. This not only + affects documentation and user interface controls, but also program options + for mkvmerge & mkvpropedit. Both programs will continue to accept the + British English spelling of their respective options indefinitely. One + breaking change is that the property names in mkvmerge's JSON identification + mode have also been changed to American English spelling. As those + properties have only been introduced in release v68, this seems like a small + enough window to make such a change. + +## New features and enhancements + +* MKVToolNix GUI: the number of recently used entries (e.g. destination + directories) remembered by the GUI can now be configured in the + preferences. Implements #3362. +* MKVToolNix GUI: multiplexer: when adding files the track properties + regarding color information & color mastering meta information will be + parsed & set in the corresponding GUI controls. Implements #3359. +* MKVToolNix GUI: job queue: the job queue can now be sorted by clicking on + the column headers. Part of the implementation of #3365. +* MKVToolNix GUI: job queue: when loading jobs from the queue directory that + weren't previously known to the program those jobs will be sorted by their + "date added" timestamp instead of using the order the operating system + returns them in. Part of the implementation of #3365. + +## Bug fixes + +* build system: fixed compilation with fmt v9. Fixes #3366. +* mkvmerge: HEVC ES parser: the parser will now parse at least the first full + access unit before reporting that it has found all the required + headers. Otherwise parsing might stop in the middle of the access unit due + to the source reader not providing more data in the first call, leading to + the parser not finding the `unspec62` and `unspec63` NALUs required for + Dolby Vision. Fixes #3363. +* MKVToolNix GUI: preferences: the default actions added to the "execute + programs" section on new installations now default to use WebM file names + instead of Ogg, matching the format of the included audio files. + +## Build system changes + +* The bundled `fmt` library was updated to v9.0.0. + + +# Version 68.0.0 "The Curtain" 2022-05-22 + +## New features and enhancements + +* mkvmerge: HDMV PGS subtitles: mkvmerge now tries to detect bogus timestamps + (where the current timestamp is two hours or more after the previous + timestamp) & correct them to something more sensible (1s after the previous + timestamp). That way one bogus timestamp cannot cause the rest of the frames + to not be interleaved properly with the other audio & video + packets. Implemented for #3268. +* mkvmerge: added color information, color mastering meta information & + video projection information properties to the JSON identification + format. The properties are reported for container types for which mkvmerge + supports reading them (Matroska & MP4). The JSON identification format + version number has been bumped to v15. +* MKVToolNix GUI: multiplexer: added controls for all the video color + information & the video projection information. + +## Bug fixes + +* mkvmerge: SRT reader: entries with a duration of 0 or less will now be + skipped. Fixes #3332. +* mkvpropedit, MKVToolNix GUI's chapter & header editors: fixed an invalid + memory access when trying to update existing Matroska files whose EBML Head + element had a "size" field length of eight bytes, and where rewriting said + element would shrink the element by one byte. Files created by gstreamer fit + the first part whereas the second depends on the changes requested by the + user. Part of the fix of #3325. +* mkvpropedit, MKVToolNix GUI's chapter & header editors: fixed the programs + not handling having to remove EBML void elements at the end of the file + correctly and consequently aborting. Part of the fix of #3325. +* MKVToolNix GUI: the GUI now uses almost all SVG icons, allowing proper + scaling even for scaling factors such as 125%. Fixes #3335. +* MKVToolNix GUI: when compiled with Qt 5 the character set of INI files is + forced to UTF-8 in order to fix reading INI files written by a version + compiled with Qt 6. Fixes #3346. + +## Build system changes + +* Qt's SVG library is now required. + + +# Version 67.0.0 "Under Stars" 2022-04-10 + +## New features and enhancements + +* all: IETF BCP 47/RFC 5646 language tags: when deriving the legacy language + element codes to use a language tag's ISO 639 code is also potentially + interpreted as an & its prefix is used as the legacy language code. For + example, "Yue Chinese" = `yue` is not part of ISO 639-2. However, there is + an extlang subtag `yue` with a valid prefix of `zh` ("Chinese"), and for + "Chinese" there is an ISO 639-2 language code: `chi`. In this example the + IETF language element would be set to `yue` and the corresponding legacy + element to `chi`. Part of the implementation of #3307. +* all: IETF BCP 47/RFC 5646 language tags: grandfathered language tags are now + supported. Part of the implementation of #3307. +* all: IETF BCP 47/RFC 5646 language tags: all deprecated subtags from the + IANA language subtag registry are now supported. Part of the implementation + of #3307. +* all: IETF BCP 47/RFC 5646 language tags: all lists of valid subtags have + been updated from their respective authoritative sources. Part of the + implementation of #3307. +* all: IETF BCP 47/RFC 5646 language tags: all in the IANA language subtag + registry are now supported, even those marked as deprecated and of type + 'grandfathered'. Part of the implementation of #3307. +* all: IETF BCP 47/RFC 5646 language tags: reduced the maximum number of + extended language subtags that are present in a valid tag from 3 to 1 in + compliance with RFC 5646 section 2.2.2. Part of the implementation of #3307. +* all: IETF BCP 47/RFC 5646 language tags: all language codes reserved for + private/local use (`qaa`–`qtz`) are now supported. Part of the + implementation of #3307. +* all: IETF BCP 47/RFC 5646 language tags: Digital Cinema Naming Convention + language codes that fall into the IETF BCP 47 range of "private use" tags + (`qaa`–`qtz`) are now replaced by their IETF BCP 47 equivalents during + normalization (e.g. `QMS` → `cmn-Hans`). Part of the implementation of + #3307. +* all: added a new translation to Chinese Simplified (Singapore) by Dian Li. +* mkvmerge, mkvpropedit: added a new command line option called + `--enable-legacy-font-mime-types`. With this option on the two programs will + use the same legacy MIME types for fonts whenever new attachments are added + (both programs), when reading existing attachments (only `mkvmerge`) or when + replacing existing ones (only `mkvpropedit`). +* mkvmerge, mkvpropedit: IETF BCP 47/RFC 5646 language tags: added a command + line option `--normalize-language-ietf ` which turns on normalization + of IETF BCP 47 language tags to either their canonical (mode `canonical`) or + extended language subtags form (mode `extlang`) or turns it off (mode + `off`). If the option isn't given, language tags will now be normalized to + the canonical form. Part of the implementation of #3307. +* MKVToolNix GUI: IETF BCP 47/RFC 5646 language tags: ISO 639-3 and 639-5 + languages will now be used by default. Part of the implementation of #3307. +* MKVToolNix GUI: IETF BCP 47/RFC 5646 language tags: the language editor + dialog will now show warnings in several cases: when deprecated tags are + used; when the tag's canonical and/or extlang forms differ from the user + input. Part of the implementation of #3307. +* MKVToolNix GUI: IETF BCP 47/RFC 5646 language tags: the language editor now + has a button to replace the current tag with a normalized form (canonical or + extlang) if those differ from the current tag. Part of the implementation of + #3307. +* MKVToolNix GUI: IETF BCP 47/RFC 5646 language tags: added an option in the + preferences to always normalize all language tags to their canonical or + extlang forms or to turn normalization off. Can also be enabled from the + language editor dialog. Part of the implementation of #3307. +* MKVToolNix GUI: IETF BCP 47/RFC 5646 language tags: the language dialog now + shows a warning if a variant is used with a prefix that isn't in the + variant's list of suitable prefixes. It'll also say if the corresponding + canonical/extlang forms would have a suitable prefix. Part of the + implementation of #3307. +* MKVToolNix GUI: IETF BCP 47/RFC 5646 language tags: the language dialog now + shows a warning if a script is used with a language for which it should be + suppressed. Part of the implementation of #3307. +* MKVToolNix GUI: multiplexer: the track property group boxes in the + scrollable pane are now collapsible & expandable, saving their state over + restarts of the GUI. This is in preparation of adding many more track + properties in future releases, allowing the user to hide parts they don't + use all that often. +* MKVToolNix GUI: multiplexer: if the option "use legacy font MIME types" is + enabled in the preferences, the new command line option + `--enable-legacy-font-mime-types` will be passed to `mkvmerge` in order to + have it remap the MIME types of existing attachments, too. + +## Bug fixes + +* all: IETF BCP 47/RFC 5646 language tags: variants aren't validated wrt. to + prefixes anymore as BCP 47 doesn't actually pose restrictions on them, + saying only that prefixes "are suitable sequences" for use with the + variants. What is now verified, though, is that no variant is used multiple + times within the same language tag. Part of the implementation/fix of #3307. +* build system & MKVToolNix GUI: fixed detecting the presence of & the + compilation with the multimedia module of Qt version 6.2.0 and newer. +* build system: fixed compilation on Unices other than Linux & macOS + (e.g. FreeBSD). Fixes #3316. +* MKVToolNix GUI: job queue: fixed compiling in the audio player code for the + the "play audio" end-of-job action. Fixes #3303. +* MKVToolNix GUI: multiplexer: recognizing added XML chapter, segment info or + chapter files required the XML declaration & root node (e.g. ` … + ` for chapters) be located within the first 1 KB, which wasn't + enough for files that contain a lot of comments at the start like the + included `example-chapters-2.xml`. The detection range was extended to 10 + KB. Fixes #3302. + +## Build system changes + +* build system: the provided Windows binaries are now compiled with Qt 6. A + drawback is that certain audio formats aren't supported anymore by Qt for + the "end of job" sound notification playback, notably the Ogg file format & + the Vorbis audio codec. MKVToolNix therefore now ships Opus-in-WebM files + for the same purpose. +* The bundled `fmt` library was updated to v8.1.1. +* The bundled `nlohmann-json` library was updated to v3.10.5. +* The bundled `pugixml` library was updated to v1.12.1. + + +# Version 66.0.0 "Josie" 2022-03-13 + +## New features and enhancements + +* mkvpropedit: added a new option `--chapter-charset` allowing the user to + specify the character set to use when reading the following chapter + file. Implements #3276. +* MKVToolNix GUI: each language shortcut can now be associated with an + optional track name that is set along with the language when the shortcut is + used. This is an alternative to the feature requested in #3283. + +## Bug fixes + +* mkvmerge: Ogg/OGM reader: mkvmerge will no longer abort with an exception + when it encounters Vorbis comments that contain data that isn't valid + UTF-8. Fixes #3290. +* MKVToolNix GUI: multiplexer: fixed several issues with the tab order of + elements in the "properties" pane and the "output" tab. Also fixed the + language display widgets (e.g. "track language" in the "properties" pane) + never receiving tab focus. Fixes #3274. +* MKVToolNix GUI: multiplexer: the chapter name template will now be passed to + `mkvmerge` if a chapter file is selected on the "output" tab. Fixes #3295. + + +# Version 65.0.0 "Too Much" 2022-02-06 + +## New features and enhancements + +* mkvmerge: the options `--default-track` and `--forced-track` have been + renamed to `--default-track-flag` and `--forced-display-flag` respectively + for improved consistency with other option names & the wording used in the + GUI. However, the old names will be supported and recognized + indefinitely. What will remain unchanged is the property names for those + flags in mkvmerge's identification output. Existing third-party programs + will continue working as they are. +* mkvmerge: added a new option `--track-enabled-flag` to set or unset the + "track enabled" track header flag. +* mkvmerge: MP4 reader: `mkvmerge` will now evaluate the `flags` field of the + track header atom (`tkhd`) and set the track's "enabled" flag + accordingly. Implements #3272. +* MKVToolNix GUI: multiplexer: added support for the "track enabled" track + header flag. +* MKVToolNix GUI: multiplexer, header editor: added several menu entries & + keyboard shortcuts for toggling various track flags of the currently + selected tracks, e.g. `Ctrl+Alt+F, D` (that's `Ctrl` and `Alt` with `F` + simultaneously followed by `D` without any other key pressed) for toggling + the "default track" flag. Part of the implementation of #3253. +* MKVToolNix GUI: multiplexer, header editor: added menu entries & keyboard + shortcuts for setting the language of the currently selected tracks to one + from a configurable list of languages. The shortcuts used are `Ctrl+Alt+A, + 1` through `Ctrl+Alt+A, 0` for the first ten entries of that list (that's + `Ctrl` and `Alt` with `A` simultaneously followed by a digit without any + other key pressed). Part of the implementation of #3253. +* MKVToolNix GUI: chapter editor: if the user enters commas in start or end + timestamps they will automatically be changed to points as the decimal + separator, allowing for easier copy & paste from other + programs/sources. Implements #3273. +* MKVToolNix: header editor: the selected track or attached file can now be + moved up & down with the keyboard shortcuts `Ctrl+Up` & `Ctrl+Down` + respectively. Part of the implementation of #3253. + +## Bug fixes + +* mkvmerge: Matroska reader: DVB subtitle tracks with a codec private data + size of more than five bytes are accepted now, too. Fixes #3258. + + +# Version 64.0.0 "Willows" 2021-12-27 + +## New features and enhancements + +* MKVToolNix GUI: language dialog: when the user switches between the two edit + modes, the mode's corresponding first control is automatically focussed. + +## Bug fixes + +* all: language lists: the entries for "Ancient Greek (to 1453)" and "Modern + Greek (1453-)" have been renamed to "Greek (ancient, -1453)" and "Greek + (modern, 1453-)" respectively in order to be easier to find. +* mkvmerge: VobSub reader: files containing `id: --` lines to indicate that + the track language isn't known were rejected by `mkvmerge`. Now they're + accepted, and `und` (undetermined) is used as the language. Fixes #3246. +* MKVToolNix GUI: chapter editor: the "Save to Matroska or WebM file" function + was using the wrong standard file dialog (the "open file" one instead of + "save"), leading to confusing button names. Fixes #3242. +* MKVToolNix GUI: high DPI scaling: fixed the icons in the tool selector + having the wrong size for scaling factors other than 100% or 200%. Fixes + #3229. + +## Build system changes + +* The bundled `fmt` library was updated to v8.0.1. +* The bundled `nlohmann-json` library was updated to v3.9.1. +* The bundled `pugixml` library was updated to v1.11 revision 6a76cac. +* The bundled `utf8-cpp` library was updated to v3.2 revision b85efd6. + + +# Version 63.0.0 "Everything" 2021-11-14 + +## New features and enhancements + +* mkvmerge: AC-3 parser: E-AC-3 with BSID values > 10 and ≤ 15 are recognized + now, too. Implements #3211. +* mkvmerge: when using language codes for track selection (e.g. `-a und,en`) + all tracks that do not have a language property (due to their container not + providing one, e.g. AVIs) will be treated as if they did have one set to + `und` ("undetermined") as that is the language the track will have in the + Matroska file anyway. Before this change it wasn't possible to match such + tracks via language codes. +* MKVToolNix GUI: only on Windows: when compiled with Qt ≥ 5.14 and < 6 (which + is the case for the officially provided binaries) fractional screen scaling + will be enabled. This means that the GUI will be scaled appropriately if + Windows is set to 125%, 150% or 175% instead of being too small or too + large. Implements #3043. +* MKVToolNix GUI: the spinner in the bottom right corner will now be hidden + when no jobs are currently running. Implements #3225. +* MKVToolNix GUI: header editor: a new column has been added to the tree view + showing the status of the "track enabled" flag. The information is also + shown on the track overview page on the right. Implements #3228. +* MKVToolNix GUI: header editor: users can now reorder tracks by dragging & + dropping. Implements #3227. + +## Bug fixes + +* mkvmerge: AVI reader: fixed reading AVI files that contain `vprp` video + properties header chunks; reading aborted too early. Fixes #3209. + + +# Version 62.0.0 "Apollo" 2021-10-10 + +## New features and enhancements + +* all: IETF BCP 47/TFC 5646 language tags: all ISO 639 languages are now + available, even the ones that aren't of types "Constructed", "Living" or + "Special". +* mkvmerge, mkvpropedit: chapters: both programs will now write elements set + to their default value, too (e.g. the legacy language element if it's set to + `eng`). This is done to be more consistent with how MKVToolNix GUI writes + chapters. Implements #3210. +* MKVToolNix GUI: multiplexer: when adding new files as attachments the GUI + checks if there are other attachments with the same name. If so, the GUI + would ask whether to skip the affected files or add them anyway. There's now + an option in the preferences to always skip such files, and it's enabled by + default. Implements #3213. +* MKVToolNix GUI: chapter editor: removed the support for explicitly setting + the legacy country elements. Instead the legacy country elements are derived + from the region parts of the IETF BCP 47 languages. Part of the + implementation of #3193. + +## Bug fixes + +* mkvmerge: fixed a crash when splitting by chapters is enabled but there are + no chapters at all. Part of the fix of #3198. +* mkvmerge: the error message when trying to split by a chapter number that + doesn't exist contained the wrong number of chapters that actually do + exist. Part of the fix of #3198. +* mkvmerge: AVC ES parser: fixed mkvmerge aborting due to uncaught exception + when encountering bad SPS data. Part of the fix of #3176. +* mkvmerge: AVC/H.264 parser: re-added the hack `--engage + all_i_slices_are_key_frames` which was accidentally removed in release v61. +* mkvmerge: AVI reader: fixed a crash trying to allocate too big of a memory + chunk due to an integer overflows in check conditions. Part of the fix of + #3176. +* mkvmerge: HEVC ES parser: fixed another issue with frame type + recognition. Certain frames were marked as B frames/discardable on the + container level even though they could be reference pictures. Now only SLNR + pictures (sub-layer non-reference) are marked that way. Fixes #3192. +* mkvmerge: HEVC ES reader: improved file content detection for HEVC ES files + with wrong file name extensions (e.g. `.mkv`), which fixes them being + mis-detected as something else, e.g. DTS. Fixes #3201. +* mkvmerge: HEVC ES parser: "end of sequence" NALUs are kept now, and no + superfluous flushing will be done when one is found. This prevents splitting + NALUs into two different Matroska blocks when they should really be part of + a single one, also causing problems with erroneous timestamps. Mostly + affects DoVi NALUs. Fixes #3202. +* mkvmerge: Matroska reader, TrueHD: mkvmerge will now probe much more TrueHD + frames trying to find the first sync frame. This fixes track detection in + situations when a TrueHD doesn't start with a sync frame, e.g. when the + source file's the result of splitting between sync frames. +* mkvmerge, MKVToolNix GUI's chapter editor: IETF BCP 47/RFC 5646 language + tags: when reading chapters from MPLS playlist files, the `ChapLanguageIETF` + element will now be set to the configured default chapter language, not just + the legacy `ChapterLanguage` element. Part of the fix of #3193. +* mkvmerge, mkvpropedit, MKVToolNix GUI's chapter editor: IETF BCP 47 elements + will now always be created before writing chapters unless IETF BCP 47 + elements are disabled. Part of the fix of #3193. +* mkvmerge, mkvpropedit, MKVToolNix GUI's chapter editor: when a chapter + display element contains legacy language & country elements but no IETF BCP + 47 elements and IETF BCP 47 elements aren't disabled, the IETF BCP 47 + elements created will contain the region from the legacy element. Part of + the fix of #3193. +* mkvmerge, mkvpropedit, MKVToolNix GUI's chapter editor: Legacy country + elements are now created when IETF BCP 47 elements are present & contain a + region code allowed in legacy country elements. Part of the fix of #3193. + +## Build system changes + +* The `tools` sub-directory is now always built. The corresponding `configure` + option `--with-tools` has been removed. The `install` target still doesn't + install them, though. + + +# Version 61.0.0 "So" 2021-08-30 + +## New features and enhancements + +* all: IETF BCP 47/RFC 5646 language tags: implemented support for officially + registered IANA language tag extensions. +* mkvmerge: track selection: when using language tags for selecting which + tracks to keep, mkvmerge will now use component-based language tag matching + instead of comparing them verbatim. This means that only those components + (language, region etc.) the user specified will be required to exist and be + equal. For example, if a file contains three subtitle tracks with languages + `es` (generic Spanish), `es-MX` (Spanish as spoken in Mexico) and `es-ES` + (Spanish as spoken in Spain), the user can use `--stracks es` to match all + three tracks or be more specific with e.g. `--stracks es-MX` which would + only match one track. Similarly inverting the selection with e.g. `--stracks + !es` would get rid of all three tracks, not just the one for the generic + Spanish. +* MKVToolNix GUI: multiplexer: deriving track languages from file names: the + GUI can now detect full BCP 47/RFC 5646 language tags in file names. Part of + the implementation of #3173. +* MKVToolNix GUI: multiplexer: deriving track languages from file names: the + default list of boundary characters now includes `-`. Part of the + implementation of #3173. +* MKVToolNix GUI: multiplexer: the GUI now defaults to the "lower" process + priority setting for new installations in order to leave more room for other + applications, especially interactive ones. Up to and including v59 the + default was the "normal" process priority. v60 changed that to "lowest", + which turned out to be much slower on Windows for no real gain over + "lower". The setting will be auto-corrected by the GUI if the settings file + were saved last with a version between v60.0.0.0 & v60.0.0.17 & "lowest" & + it is still set to "lowest". +* HEVC dumper development tool: the tool has been renamed to `xvc_dump` and + extended to be able to dump AVC/H.264 bitstreams, too. It now also detects + the type of bitstream framing (ISO 14496-15 vs. ITU-T H.264/H.265 Annex B). + +## Bug fixes + +* all: IETF BCP 47/RFC 5646 language tags: fixed a corner case of wrongfully + allowing scripts/variants not listed in any of the entries in the prefix + list when the prefix list contains prefixes restricting scripts/variants and + a prefix solely with the language at the same time (example: the variant + `ekavsk` with its prefixes `sr`, `sr-Cyrl` and `sr-Latn` where + e.g. `sr-ekavsk` and `sr-Cyrl-ekavsk` should be allowed but not + `sr-Bali-ekavsk`). +* mkvmerge: HEVC/H.265: the frame type of B frames was often wrongfully + signalled as P frames instead, both with `BlockGroup` (missing second + references) and `SimpleBlock` ("discardable" flag not set) elements. +* mkvmerge: SSA/ASS packetizer: the frame numbers will now be re-calculated + when appending SSA/ASS tracks so that frame numbers of appended tracks are + always strictly higher than frame numbers of the track they're appended to. +* mkvmerge, MKVToolNix GUI's chapter editor: BCP 47/RFC 5646 language tags: + when BCP 47 language tags are used with a language code that isn't part of + ISO 639-2, the programs will now write a legacy language element set to + `und` ("undetermined") instead of not writing such an element at all or + writing one with an invalid code. Fixes #3174. +* mkvmerge, MKVToolNix GUI's chapter editor: BCP 47/RFC 5646 language tags: + the programs will ensure that the legacy and IETF language elements written + will be unique within the scope of the same "chapter display" element. +* mkvinfo, MKVToolNix GUI's info tool: in summary mode the frame type was + reported wrong for `BlockGroup` elements in which the `ReferenceBlock` + elements were located behind the `Block` element. + +## Build system changes + +* all: `std::codecvt_utf8` is now used instead of Boost's + `utf8_codecvt_facet`. The bundled copy the latter in `lib/boost` has + therefore been removed. + + +# Version 60.0.0 "Are We Copies?" 2021-07-31 + +## New features and enhancements + +* all: IETF BCP 47/RFC 5646 language tags: added support for language families + from ISO 639-5 that aren't part of 639-2. +* all: IETF BCP 47/RFC 5646 language tags: implemented support for Alpha 2 + country codes of the "user-defined" category: `AA`, `QM`–`QZ`, `XA`–`XZ` and + `ZZ`. +* all: IETF BCP 47/RFC 5646 language tags: updated the various lists of valid + subtags from the official specs. +* MKVToolNix GUI: multiplexer: pressing the keyboard shortcut for the track's + "Language" label (Alt+L for English) will now open the language dialog. +* MKVToolNix GUI: multiplexer: added an option in the preferences for turning + off the colored boxes indicating which file each track belongs to. + +## Bug fixes + +* all: IETF BCP 47/RFC 5646 language tags: fixed validating extended language + & variant subtags against their allowed prefixes (e.g. a valid tag with a + country code as in `de-CH-1996` is recognized as valid while two generally + known variants that aren't allowed together as in `de-1901-1996` is + recognized as invalid). +* all: IETF BCP 47/RFC 5646 language tags: when looking up a language for a + two- or three-letter code, the programs will no longer compare that code + with language names as that was unintended, ambiguous (e.g. the code "Ga" + could be interpreted as the 639-2 alpha-2 code for "Irish" or as the name of + the language called "Ga") and only worked with languages whose name was at + most three letters long. +* mkvmerge: HEVC/H.265: appending Matroska files with HEVC tracks might lead + to the loss of the first couple of frames from each of the second and all + following files. Fixes #3170. +* mkvmerge, mkvextract: HEVC/H.265 parser: fixed the programs aborting when + parsing VPS or SPS NALUs with invalid content due to unhandled + exceptions. Fixes #3162. +* MKVToolNix GUI: multiplexer: when the option "use legacy MIME types for font + attachments" is enabled, the GUI will now use `application/x-truetype-font` + for font collection files. +* MKVToolNix GUI: multiplexer: fixed escaping the `mkvmerge` argument in the + "Show command-line options" dialog for the "Windows (cmd.exe)" mode. Fixes + #3164. +* MKVToolNix GUI: multiplexer: when adding multiple files at once, the GUI + will sort file names with numbers the way a human would expect it to. For + example, `1.mp4`, `9.aac`, `10.srt`, `11.srt` are now sorted exactly that + order instead of `1.mp4`, `10.srt`, `11.srt`, `9.aac`. +* MKVToolNix GUI: header editor: the header editor will now honor the "use + legacy MIME types when adding font attachments" setting when adding new + attachments. + + +# Version 59.0.0 "Shining Star" 2021-07-10 + +## New features and enhancements + +* mkvmerge: WebVTT parser: the parser now follows the specs' rules for parsing + timestamps more closely by being more lenient: it allows arbitrary number of + spaces & tabs at the start of the line & around the arrow; it allows any + number of digits for the hours. Part of #3139. +* MKVToolNix GUI: multiplexer: when adding a Blu-ray playlist without scanning + for other playlists the GUI will now look for disc library information & let + the user select which one to use if there's more than one entry. Implements + #3143. +* MKVToolNix GUI: multiplexer: added an option for sorting files & tracks by + track types when adding them to multiplex settings. The order is: video + first followed by audio, subtitles and other types. Files & tracks can still + be reordered manually later. The option is enabled by default & can be found + in the preferences → "Multiplexer" page → "Adding files" section. Implements + #2366. +* MKVToolNix GUI: multiplexer: added an option for recognizing file name + sequences such as `movie.001.mp4`, `movie.002.mp4`, `movie.003.mp4` when + adding multiple files at once. If a sequence is detected, the only first + file will be added while the second and following file names will be + appended to the first one. The option is enabled by default & can be found + in the preferences → "Multiplexer" page → "Adding files" section. Implements + #2866. +* MKVToolNix GUI: multiplexer: added small colored boxes for each file & track + in order to indicate from which file each track is read. The colors used can + be configured in the preferences → "Multiplexer" page → "File & track + colors" section. + +## Bug fixes + +* build system: fixed compilation with fmt v8. Fixes #3151. +* mkvmerge: SRT subtitle reader: characters that aren't valid according to the + assumed encoding of the file will now be replaced by the Unicode + "Replacement Character" U+FFFD instead of keeping the invalid characters, + potentially violating the Matroska specs. +* mkvmerge: WebVTT parser: the parser now accepts timestamps with hours + larger than 99. Part of #3139. +* mkvextract: TTA extraction, only on Windows: fixed removing the temporary + file created during extraction. +* mkvmerge, mkvpropedit, MKVToolNix GUI's multiplexer & header editor: MIME + type detection is now done using Qt instead of the `magic` library. The main + impact is the MIME types of TrueType & OpenType fonts are now detected + correctly. Fixes #3137. +* mkvmerge, mkvinfo, MKVToolNix GUI's info tool: only on Windows: displaying + dates before 1970-01-01 00:00:00 UTC or after 2038-01-19 03:14:08 UTC was + broken. Note that the header editor was not affected. Fixes #3148. +* MKVToolNix GUI: only on 64-bit Windows: under certain conditions, the 64-bit + Windows binaries crashed when opening dialog windows. Even though the + underlying bug hasn't been identified, the investigation showed that + building it with newer versions than 10.2.0 of the mingw/gcc cross-compiler + enabled the crashes, while binaries built with 10.2.0 were fine. This + affected v57 and v58 which were built with gcc versions 10.3.0 and 11.1.0 + respectively. For the time being I've switched back to building Windows + binaries with gcc 10.2.0. Fixes #3132 & #3133. +* MKVToolNix GUI: multiplexer: when adding files to the multiplexer by running + the GUI's executable with file names as command line arguments, the source + directory will be remembered as the "last open directory" again, causing + subsequent uses of the "open file" dialog to start in the same directory. +* MKVToolNix GUI: multiplexer: the "default track flag" column in the track + list was missing its icons. Additionally it contained text even for things + that aren't regular tracks and therefore do not actually have that flag + (e.g. chapters or tags). Fixes #3144. +* MKVToolNix GUI: multiplexer: the default for the dialog asking the user what + to do with dragged & dropped files if they've never seen the dialog is back + to adding the files to the current multiplex settings instead of "add as + additional parts" which was an unintentional default. +* MKVToolNix GUI: multiplexer: the "show command line" dialog will now always + use backward slashes for the "Windows (cmd.exe)" mode and forward slashes + for the "Linux/Unix shells" mode, regardless of the operating system it's + currently running on. Fixes #3155. + +## Build system changes + +* The Qt library is now required for building all applications, even the + command-line ones, as they use Qt's MIME type detection capabilities. In + turn this means that you cannot disable the Qt usage anymore; either Qt5 or + Qt 6 is required. + + You can still chose not to build MKVToolNix GUI, though. A new option has + been added to `configure` for this purpose: `--disable-gui`. +* The `gmp` library is now required. +* The `magic` library is not used anymore. +* The `PCRE2` & `JPCRE2` libraries are not used anymore. The bundled version + of `JPCRE2` was removed. +* Boost's "rational" library is not used anymore. +* `configure`: the option `--enable-appimage` has been removed. The location + of the relevant directories within an AppImage is now detected + automatically. +* The bundled `fmt` library was updated to v8.0.0. + + +# Version 58.0.0 "Supper's Ready" 2021-06-13 + +## New features and enhancements + +* mkvmerge, MKVToolNix GUI's multiplexer: the handling of the "default track" + flag has been changed to match the recent changes to the Matroska + specifications. The new semantics are that if it is set, it is supposed to + signal to the player that this track is eligible for being played by + default, potentially taking other factors such as user preferences regarding + languages into account. + + This implies that more than one track of each type can have this flag + set. For example, a Blu-ray disc with three audio tracks might have + the main audio in both English and Japanese, whereas the third audio + track contains the director's comments. In such a case the first two + tracks should have the "default track" flag set, the third one + shouldn't. + + Earlier `mkvmerge` was enforcing that only one track of each type could have + the flag set. This restriction has been removed, both in `mkvmerge` and in + the GUI's multiplexer. + + `mkvpropedit` and the GUI's header editor are unaffected as they've always + allowed to set the flag on as many tracks as the user wanted. +* mkvmerge: AVC/H.264 & HEVC/H.265 identification: added the stream's pixel + dimensions (AVC only; were present for HEVC already) & default + duration. Implements #3116. +* mkvmerge, mkvextract: HEVC/H.265: added support for reading single-layer + Dolby Vision from Annex B type bitstreams (elementary streams, MPEG + transport streams). Patch by quietvoid. Implements #3113. +* mkvinfo: the option `-X`/`--full-hexdump` now affects all binary elements, + not just the frame data in `SimpleBlock` and `BlockGroup` elements. +* MKVToolNix GUI: multiplexer: the "delay" and "sync" options can now be used + for chapters in source files, too. Implements #3129. +* MKVToolNix GUI: when moving list entries up & down with the optional buttons + or the keyboard shortcuts (instead of using drag & drop), the GUI ensures + that the top-most selected entry remains visible after the move. Implements + #3123. +* MKVToolNix GUI: added an option in the preference to use legacy MIME types + for font attachments instead of the current standard ones + (e.g. 'application/x-truetype-font' instead of 'font/sfnt' and 'font/ttf'). + + +## Bug fixes + +* build system: fixed filtering out optimization options when compiling the + file `iso639_language_list.cpp` (before only numeric optimization levels + were filtered out and only if it wasn't the last option in the list of + flags). See #3105 for context. +* build system: when libmagic was detected via `pkg-config`, MKVToolNix was + actually compiled without support for libmagic due to a preprocessor symbol + not being defined. +* mkvmerge: MP4 reader: fixed an issue with timestamps overflowing when the + file's or the track's time scale is large. Fixes #3124. +* mkvmerge, mkvextract: fixed key frame handling for `BlockGroup` elements + with a forward reference but no backward references. Patches by Tom Yan. +* mkvmerge, mkvpropedit, MKVToolNix GUI's chapter editor: the programs will no + longer omit writing mandatory elements set to their default value if other + elements of the same type are present in the same master. This affects + mostly the "chapter language" element which may occur multiple times within + the same "chapter display" master. If it does occur multiple times and one + of them is set to "English" (which is that element's default value), that + element will now be written, too. Part of the fix of #3120. +* mkvmerge, mkvpropedit, MKVToolNix GUI's chapter editor: when parsing chapter + files IETF & legacy language elements as well as legacy country elements + will now be properly generated depending on which exist already, especially + when there's more than one language and/or country element in a "chapter + display" element. Part of the fix of #3120. +* mkvmerge, mkvpropedit, MKVToolNix GUI's chapter editor: fixed reading + OGM-style chapter files with timestamps that don't have exactly three + decimal places. Any number of decimal places between one and nine is now + supported for nanosecond precision. Fixes #3121. +* MKVToolNix GUI: chapter editor: added/fixed support for "chapter display" + elements with multiple languages or countries. Part of the fix of #3120. + +## Build system changes + +* Qt 6: added support for building with Qt 6. `configure` will look for Qt 6 + first and only continue looking for Qt 5 if Qt 6 isn't found or disabled via + `--disable-qt6`. + + Qt 6 detection works by first looking for the `qmake6` binary. Its location + can be specified with the `--with-qmake6=…` option. + + All other Qt 6 related facts (such as compiler & linker flags or the + position of the other required tools such as `lconvert`, `moc`, `rcc` and + `uic`) will be derived from the output generated by `qmake6`. + + Note that at this point Qt 6 is not yet supported for the cross-compilation + build to Windows, nor is a static Qt 6 build supported yet. + + Note that the command line options `--enable-static-qt`, + `--with-qt-pkg-config-modules` and `--without-qt-pkg-config` only apply to + the Qt 5 and have no effect on Qt 6. +* Qt 5: the options for specifying the position of the tools (`--with-moc=…`, + `--with-rcc=…` and `--with-uic=…`) have been removed. Their position will + now be derived from the output generated by `qmake`. +* `configure`: completely disabling the GUI now requires passing both + `--disable-qt6` and `--disable-qt` options. +* Boost's multi-precision library is now required. +* Boost v1.66 or newer is now required. + +## Other changes + +* The Windows build is now using an updated version of the + `file`/`magic` library for MIME type detection of attachments. This + affects fonts whose MIME types will now be the current standard MIME + types (e.g. `font/sfnt` or `font/ttf` for TrueType fonts). As this + might pose problematic with older players that only support the + legacy MIME type (e.g. `application/x-truetype-font`), a new option + was added in the GUI's preferences to use the legacy MIME types + instead of the current standard ones. This is off by default. + Builds for other operating systems have already been using newer + versions of the `file`/`magic` library for a long time. + + +# Version 57.0.0 "Till The End" 2021-05-22 + +## New features and enhancements + +* mkvmerge: MP4 reader: added support for reading Dolby Vision from MP4 files + (FourCCs `dvh1` and `dvhe`; configuration records `dvcC`, `dvvC` and `hvcE` + will be converted into block addition mappings). Implements #2784. +* mkvmerge: SRT subtitles: mkvmerge now accepts empty text files with the + extension `.srt` as SRT subtitle files, enabling the creation of empty SRT + tracks. Implements #3089. +* mkvmerge, mkvextract: HEVC/H.265: access unit delimiter NALUs will no longer + be discarded, neither during muxing nor during extraction. +* MKVToolNix GUI: preferences: switched the order & wording of controls in the + "enabling items" panel to make it clearer that certain controls define + exceptions. Inspired by 3086. + +## Bug fixes + +* mkvmerge: HEVC/H.265 parser: several NALU types, notably the Dolby + Vision-specific NALUs ("unspecified 62" and "unspecified 63") and suffix SEI + NALUs, are now stored with the frame they belong to instead of with the next + frame. Part of fixing & implementing #2784, #2818, #3093 and #3113. +* mkvmerge: HEVC/H.265 packetizer: fixed setting the track's default duration + when reading HEVC/H.265 from Matroska files that don't have a default + duration set. +* mkvmerge: HEVC/H.265 packetizer: fixed the calculation of the duration of + frames so that `SimpleBlock` elements can be used again instead of + `BlockGroups` with `BlockDuration` elements. Fixes #3114. +* mkvmerge, mkvextract: HEVC/H.265 parser: fixed issues with ordering & + duplication of certain NALUs (parameter set & prefix SEI NALUs). Part of + fixing & implementing of #2784, #2818, #3093 and #3113. +* MKVToolNix GUI: multiplexer: when dragging & dropping files to the + multiplexer, the source directory will be remembered as the "last open + directory" again, causing subsequent uses of the "open file" dialog to start + in the same directory. Fixes #3110. +* mkvinfo: fixed the position of frames in block groups containing "block + duration" elements in summary mode (e.g. for subtitle tracks). + +## Build system changes + +* `configure` will now try to detect `libmagic` via `pkg-config` and fall back + to including & linking directly if it cannot be found via `pkg-config`. + + +# Version 56.1.0 "My Friend" 2021-04-09 + +## New features and enhancements + +* mkvmerge: AAC: added support for LOAS/LATM files with channel configuration + indexes 9–21 (e.g. channel count 22.2 for index 13) according to Rec. ITU-R + BS.1196-7 & ISO/IEC 23008-3:2019. Fixes #3081. + +## Bug fixes + +* mkvmerge: HEVC/H.265 parser: fixed invalid memory access that could happen + when reading certain types of HEVC data (e.g. with changing parameter sets + mid-stream) from certain containers (e.g. Matroska). This bug was introduced + in release 56.0.0. Fixes #3083. +* mkvextract: AAC: mkvextract will now abort with an useful error message when + the user tries to extract a track whose 'audio-specific config' element in + `CodecPrivate` signals a number of channels of 7 or greater than 8 as that + isn't supported by the ADTS format. + +## Build system changes + +* configure: the `--enable-ubsan` option hasn't actually enabled anything + since release 39.0.0. + + +# Version 56.0.0 "Strasbourg / St. Denis" 2021-04-05 + +## New features and enhancements + +* mkvmerge, mkvpropedit: tags: the programs will no longer write tag elements + that are mandatory and set to their default value (e.g. "tag language" set + to `und` = undetermined). +* mkvmerge, mkvpropedit, MKVToolNix GUI chapter editor: chapters: the programs + will no longer write chapter elements that are mandatory and set to their + default value (e.g. "chapter language" set to `eng` = English or "Chapter + flag enabled" = 1). +* mkvextract: chapters: mkvextract will no longer add a `ChapterLanguage` + element set to `eng` to the generated XML content if the source file doesn't + contain such an element. +* MKVToolNix GUI: multiplexer: when using the "tab widget below the files & + tracks" layout option for the track properties the elements in the "general + options" tab will use six rows à four columns instead of twelve rows à two + columns, greatly reducing the required height. Implements #3062. + +## Bug fixes + +* mkvmerge: AAC reader: fixed mkvmerge aborting to read AAC files bigger than + 2 GB with a message about not being able to allocate memory. Fixes #3059. +* mkvmerge: chapters: `ChapLanguageIETF` elements were still created when the + option `--disable-language-ietf` was given after an option leading to the + creation of chapters. Now the position doesn't matter anymore. Part of the + fix of #3069. +* mkvmerge: chapters: when the option `--disable-language-ietf` is used, + `ChapLanguageIETF` elements won't be written even when sources are read + (Matroska files or XML chapters files) that do contain those elements. Part + of the fix of #3069. +* mkvmerge: tags: when the option `--disable-language-ietf` is used, + `TagLanguageIETF` elements won't be written. Fixes #3070. +* mkvmerge: tags: mkvmerge will no longer write language elements for the + track statistics tags it creates, making the effective language + "undetermined" due to `und` being the default value for the legacy tag + language element. Fixes #3073. +* mkvmerge: tags: the XML tag parser will now validate all `` children + of `` elements, not just the first for each ``. Part of the fix of + #3071. +* mkvmerge: tags: the XML tag parser now uses the spec-compliant `und` + ("undetermined") as the default language for `` tags instead of + `eng`. Part of the fix of #3071. +* mkvmerge, mkvpropedit: tags: mkvmerge will no longer set the "target type" + for track statistics tags (earlier it used `MOVIE`). The "target type value" + will still be set to `50`. Fixes #3074. +* mkvmerge, mkvextract: HEVC/H.265: both programs will now normalize the + placement of VPS, SPS and PPS NALUs. Each key frame is prefixed with exactly + one copy of the currently active parameter sets. This fixes certain classes + of bugs related to splitting/appending. Fixes #3034. +* mkvinfo: when compiled with newer versions of the `fmt` library, certain + numbers were not output correctly (e.g. a track's audio sampling frequency + of 48000 might be output as 48). +* MKVToolNix GUI: multiplexer: deriving the track language from the file name + will match languages case insensitively again (like versions prior to + v55). Fixes #3068. +* MKVToolNix GUI: multiplexer: under certain circumstances keyboard shortcuts + such as `Ctrl+W` for closing the active tab or `Ctrl+R` for starting to + multiplex ceased to work until the user did certain other things (such as + switching to a different tool & back to the multiplexer or opening the + multiplexer menu). This started with v54. Fixes #3051. +* MKVToolNix GUI: chapter editor: the editor will no longer create empty + `ChapterCountry` elements when adding a chapter name with no default country + selected in the preferences. Fixes #3072. + +## Build system changes + +* The bundled `fmt` library was updated to v7.1.3. + + +# Version 55.0.0 "Waiting For Space" 2021-03-06 + +## Bug fixes + +* all programs, only on Windows: fixed checking existence of & creating + directories with UNC paths such as `\\server\share\folder\file.mkv`. Fixes + #3041. +* all programs, only on Windows: implemented several workarounds for bugs in + `std::filesystem` wrt. UNC paths. The effect of those bugs was that Blu-rays + and DVDs couldn't be added from UNC paths. Fixes #3037. +* mkvmerge, only on Windows: fixed non-ASCII characters getting mangled in the + destination file name when splitting is active. +* MKVToolNix GUI, only on Windows: fixed the GUI hanging when trying to browse + for files on drives that don't actually exist. Fixes #3046. +* MKVToolNix GUI, only on Windows: the GUI did not remember UNC paths as the + "most recently used source directory" properly. +* MKVToolNix GUI: only on Windows: when dragging & dropping files from other + applications to MKVToolNix GUI the GUI will force the drop action to be a + copy action, no matter which keys were pressed by the users. This prevents + Windows Explorer from deleting the dragged file when the user presses shift + while dropping the file onto MKVToolNix GUI. +* MKVToolNix GUI, only on Windows: when using the file dialog for selecting a + file name to save to (e.g. when browsing for the destination file name in + the multiplexer or saving an attachment in the header editor) non-ASCII + characters in the default file name were mangled. Fixes #3049. +* MKVToolNix GUI: multiplexer: the user can now configure what to do when + using the "Add source files" button independently of the setting for what + happens when files are dragged & dropped onto the GUI. The same options are + available, but they're distinct settings, allowing for different use + cases. Fixes #3035. +* MKVToolNix GUI: multiplexer: deriving the track language from file names + doesn't use one big regular expression of all enabled languages + anymore. Instead, the file name is split into parts on a list of characters + (such as `.` or `(` and `)`; configurable in the preferences). This prevents + the regular expression becoming too big for the regular expression library + to handle when many languages are enabled. Fixes #3048. +* MKVToolNix GUI: preferences: the language lists for "deriving track + languages" and "enabling items by language" always included all the ISO + 639-3 languages, even if those weren't enabled in the "often-used languages" + pane. Fixes #3047. + +## Other changes + +* mkvmerge, MKVToolNix GUI multiplexer: the functionality for changing the + length of the NALU "size" field for AVC/H.264 and HEVC/H.265 tracks has been + removed. The corresponding command-line option will continue to be + recognized by mkvmerge as not to break existing third-party applications, + but it won't actually do anything. + + +# Version 54.0.0 "F Maj Pixie" 2021-02-26 + +## New features and enhancements + +* mkvmerge: added support for using ISO 639-3 language codes in IETF BF47 + language tags. Part of the implementation of #3007. +* mkvmerge: AC-3 parser: added support for byte-swapped AC-3 data. Implements + #3022. +* mkvmerge: Matroska reader: for audio tracks that have the bit depth track + header set mkvmerge will now keep that header even for codecs that don't + require it for decoding. Implements #3009. +* mkvmerge: MPEG transport stream reader, PCM audio tracks: mkvmerge will now + re-order the channels for 5.1, 7.0 and 7.1 channel tracks from the Blu-ray + layout to the WAVEFORMATEXTENSIBLE layout expected in Matroska. Patch by Tom + Yan. Implements #2988. +* mkvmerge, mkvinfo, mkvpropedit, MKVToolNix GUI: added support for the + following new track header elements: "hearing impaired" flag, "visual + impaired" flag, "text descriptions" flag, "original" flag, "commentary" + flag. Implements #3011. +* MKVToolNix GUI: added support for using ISO 639-3 language codes in IETF + BF47 language tags. As there are several thousand of them, they're + deactivated by default and must be activated in the preferences ("GUI" → + "Often used selections" → "Languages"). Part of the implementation of #3007. +* MKVToolNix GUI: multiplexer: when adding Blu-rays the user can select + multiple playlists to add simultaneously in the "select playlist to add" + dialog. Implements #2961. +* MKVToolNix GUI: multiplexer: the file name extensions "eb3" and "ec3" were + added for Dolby Digital Plus & "mpl" for Dolby TrueHD in the file + dialogs. Part of the implementation of #3027. +* MKVToolNix GUI: multiplexer: when adding multiple files the dialog asking + the user what to do with them has gained a new checkbox. If enabled, all + files containing at least one video track will always be placed in newly + created multiplex setting. Implements #2966. +* MKVToolNix GUI: multiplexer: added a menu entry in the "Multiplexer" for + adding all files that are currently in the clipboard. Implements #3006. + +## Bug fixes + +* all: Windows: fixed compatibility with gettext 0.21 and newer on mingw. +* all: Windows: fixed several of the programs having problems with certain + Unicode characters (primarily emojis) in file names (e.g. mkvextract + wrongfully complaining about an "invalid mode" or the GUI not being able to + find parts of Blu-ray file structures). +* mkvextract: AAC: fixed wrong channel mask field in the ADTS headers for 7.1 + channel layouts. Fix by Tom Yan. Fixes #2636. +* mkvextract: HEVC/H.265 extraction: if the first frame starts with the + parameter sets (SPS, PPS & VPS), the ones from CodecPrivate aren't written + and the ones from the first frame are kept. Fixes #3031. +* mkvmerge: fixed the calculation of chapter timestamps read from NTSC + DVDs. Fix by Tom Yan. +* MKVToolNix GUI: IETF BCP 47 language widget: the language combo box will now + always contain the language code the user enters in the free-form field, + even if it isn't in the list of often-used languages the user configured in + the preferences. +* MKVToolNix GUI: multiplexer: when browsing for the destination file name the + default directory is now chosen according to the preferences regarding how + the destination file name should be formed. For example, if the policy is + set to "fixed output directory" then that output directory will be the one + initially set when the directory selection dialog is opened. Fixes #3021. +* MKVToolNix GUI: multiplexer: fixed the removal of appended source files if + the "delete source files" end-of-job action is enabled. Fixes #3029. +* MKVToolNix GUI: chapter editor: when importing chapters from DVDs the IETF + BCP 47 language elements will be set, too, not just the legacy language + elements. + +## Build system changes + +* libEBML v1.4.2 and libMatroska v1.6.3 are now required. The optional, + bundled copies of both libraries have been updated to those versions. This + bump in requirements fixes several heap overflow bugs in libEBML. +* MKVToolNix is now using the C++17 library feature "file system library" + instead of Boost's "file system" and "system" libraries. For the GNU + Compiler Collection (gcc) libstdc++ this means v8 or newer is required; for + clang's libc++ it means v7 or newer. For macOS this means that provided disk + image will only run on 10.15 "Catalina" or newer. + + +# Version 53.0.0 "Fool's Gold" 2021-01-30 + +## New features and enhancements + +* mkvmerge: AVI reader: added support for reading the video aspect ratio from + the video properties header (`vprp` chunk) if present and setting the + display dimensions accordingly. Implements #2993. +* mkvmerge: MP4 reader: for AVC/H.264 tracks that don't have an + `AVCConfigurationBox` (`avcC` atom) in their sample description (`stsd`) + atom or whose `avcC` atom contains no content `mkvmerge` will now re-derive + the `AVCConfigurationBox` from the bitstream. Implements #2995. +* mkvextract: mkvextract will now check if any of the destination file names + is the same as the source file name and abort with an error if that's the + case. Implements #3001. +* MKVToolNix GUI: when querying the user for a file name for saving things + (e.g. multiplexer settings or an attachment in the header editor), the + automatically suggested file name will now be based on the + situation-specific file names (e.g. the destination file name for + multiplexer settings or the attachment's name when saving an attachment in + the header editor) instead of the directory's name. Implements #3012. +* MKVToolNix GUI: multiplexer: when deriving track languages from file names + the GUI will now select the right-most match instead of the left-most + one. For example, "La.vie.en.rose.(fr).srt" will now be detected as French + (fr) instead of English (en). Implements #3013. +* MKVToolNix GUI: preferences: the items in the "pre-defined …" lists can now + be renamed by double-clicking with the mouse or pressing the F2 key. +* Windows installer: the `bluray_dump` command-line utility will be installed + into the `tools` sub-directory. `bluray_dump` can read & dump certain file + types used on Blu-rays: `.mpls` playlists, `.clpi` clip information + databases, `.bdmv` index files, `bdmt_….xml` disc library databases and + `tnmt_….xml` track & chapter name databases. + +## Bug fixes + +* mkvmerge: stretching chapter timestamps with `--chapter-sync` now works + correctly with floating point values including fractions of floating point + numbers (e.g. `12.3/45.67`). The tooltips in the GUI have been adjusted + accordingly. Fixes #3002. +* mkvmerge: MPEG 1/2 video handling: the "default duration" header field was + often half the value it actually should be, resulting in all video frames + having an explicit block duration with the correct value. This has been + fixed with a patch by Tom Yan. +* mkvmerge: MPEG 1/2 video handling: the data stored in `Codec private` and + `Codec state` doesn't contain extensions other than sequence & sequence + display extensions anymore. Fix by Tom Yan. +* mkvmerge: tag handling: when remuxing a Matroska file with the + `--no-track-tags`, existing `SOURCE_ID` track tags are now skipped, too. +* MKVToolNix GUI: multiplexer: the drop-down boxes with pre-defined track + names now follow the order set in the preferences instead of sorting the + entries alphabetically. Fixes #2999. + + +# Version 52.0.0 "Secret For The Mad" 2021-01-04 + +## New features and enhancements + +* MKVToolNix GUI: job queue: the maximum number of jobs to run concurrently + can now be increased in the preferences. The default remains + at 1. Implements #2984. +* MKVToolNix GUI: the GUI will now add a context-specific default extension to + file names selected for saving on platforms that don't add one itself + (e.g. GNOME). For example, when saving multiplexer settings the extension + `.mtxcfg` will be added. Implements #2983. +* MKVToolNix GUI: added an option to the preferences for the window to stay on + top of other windows. Implements #2967. + +## Bug fixes + +* mkvextract: HEVC/H.265 extraction: the code for skipping extraction of + prefix SEI NALUs in the first frame was skipping two bytes too few, + resulting in broken processing of all following bytes. Patch by Mike Chen. +* libEBML: the optional, bundled version of libEBML was updated to v1.4.1. + +## Build system changes + +* libEBML v1.4.1 is now required due to a bug in libEBML that caused pointers + to just-freed memory being returned to the caller under certain invalid data + constellations, causing use-after-free errors in all of MKVToolNix's + programs. Fixes #2989. + + +# Version 51.0.0 "I Wish" 2020-10-04 + +## New features and enhancements + +* mkvmerge, mkvpropedit, MKVToolNix GUI: IETF BCP 47 language tags: added + missing support for UN M.49 regions for which there are no corresponding ISO + 3166 alpha codes. This enables language tags such as `es-419` = Spanish in + Latin America and the Caribbean. Implements #2919. +* MKVToolNix GUI: IETF BCP 47 language tags: the text in the widget displaying + the current language & the corresponding edit button is now displayed like a + link (depending on the theme: different color & underlined), making it + clearer that not just the edit button can be clicked but the text, too. + +## Bug fixes + +* mkvmerge: AV1 parser: fixed mkvmerge crashing after uncaught exceptions due + to certain data conditions. Found by fuzzying. +* mkvmerge: AV1 packetizer: the duration of frames wasn't set properly. When + appending AV1 IVF or OBU files this meant that the last frame of the Nth + file and the first frame of file N+1 had the same timestamp. Fixes #2937. +* mkvmerge: DTS reader: fixed handling of buffers with an odd length when + byte-swapped DTS is detected so that mkvmerge doesn't abort with a failed + assertion. Found by fuzzying. +* mkvmerge: AVC/H.264 and HEVC/H.265 elementary stream readers: mkvmerge will + no longer claim to recognize data that looks like AVC or HEVC but with + invalid video width/height values as that lead to failed assertions in + libEBML later. Found by fuzzying. +* mkvmerge: HEVC/H.265 parser: fixed mkvmerge aborting after uncaught + exceptions due to certain data constellations found by fuzzying. +* mkvmerge: IVF reader: fixed mkvmerge crashing with a "division by zero" + error due to certain data conditions. Found by fuzzying. +* mkvmerge: fixed mkvmerge aborting with a "division by zero" error due to the + timestamp scaling factor being 0 after handling certain data constellations + found by fuzzying. +* mkvmerge: track statistics: fixed a "division by zero" error when the + content's shorter than 1ms. Found by fuzzying. +* mkvmerge, mkvinfo, mkvextract, mkvpropedit: Matroska access class: fixed an + invalid memory access under certain data conditions. Found by fuzzying. +* MKVToolNix GIU: IETF BCP 47/RFC 5646 language tags: the GUI will no longer + open the language dialog when clicking on a disabled language display + widget. +* MKVToolNix GUI: IETF BCP 47 language tags: the "variants" combo-boxes were + not populated even when the language tag was valid and contained at a + variant. Fixes #2923. +* MKVToolNix GUI: IETF BCP 47 language tags: when no language is selected, at + least one of the other components (extended subtags, region, or variants) + has something selected and "private use" is not empty, the GUI would claim + this to be a valid tag, which it isn't. Fixes #2924. +* MKVToolNix GUI: multiplexer: when the tracks/chapters/tags selection changes + from "at least one entry selected" to "no entry selected", the input + controls will be reset to their default state and not just disabled. Fixes + #2927. + +## Build system changes + +* `configure` now checks for the presence of the a system-wide installed copy + of the JPCRE2 C++ wrapper library for the PCRE2 library and uses that if + it's new enough (at least v10.32.1). If not, the bundled version will be + used as a fallback. Implements #2929. + + +# Version 50.0.0 "Awakenings" 2020-09-06 + +## New feature: IETF BCP 47 language tags + +* I've written up a [nice FAQ + entry](https://gitlab.com/mbunkus/mkvtoolnix/-/wikis/Languages-in-Matroska-and-MKVToolNix) + about the switch to using IETF BCP 47 language tags, how they interact with + legacy language elements, how the programs actually behave and how to + disable their use if necessary. +* mkvmerge: IETF BCP 47/RFC 5646 language tags: mkvmerge will now accept full + BCP 47 language tags for all options taking a language. mkvmerge will always + write "LanguageIETF" track header elements. If the language tag contains a + valid ISO 639-2 language code it will also set the legacy "Language" track + header element to the included ISO 639-2 code. Part of the implementation of + #2419. +* mkvmerge: IETF BCP 47/RFC 5646 language tags: if present the "LanguageIETF" + track header element will be reported as the `language_ietf` property in + JSON identification mode. Part of the implementation of #2419. +* mkvmerge: IETF BCP 47/RFC 5646 language tags in chapters: mkvmerge will now + write "ChapLanguageIETF" elements when creating chapter atoms, either when + reading the simple chapter format or when generating chapters due to the + `--generate-chapters` command line option. Part of the implementation of + #2419. +* mkvmerge: IETF BCP 47/RFC 5646 language tags in tags: mkvmerge will now + write "TagLanguageIETF" elements when creating "simple tag" elements, either + when reading tag XML files or when generating them. Part of the + implementation of #2419. +* mkvmerge: IETF BCP 47/RFC 5646 language tags: added an option + `--disable-language-ietf` that causes mkvmerge to only write the legacy + language elements. +* mkvmerge, mkvpropedit, MKVToolNix GUI's chapter editor: IETF BCP 47/RFC 5646 + language tags in chapters: when reading XML chapter files the programs will + now add "ChapLanguageIETF" elements for atoms that don't contain them. The + values are derived from existing "ChapterLanguage" elements. Part of the + implementation of #2419. +* mkvpropedit: IETF BCP 47/RFC 5646 language tags: setting/deleting the track + language now acts on both the old language element as well as the + "LanguageIETF" track header element. Part of the implementation of #2419. +* mkvpropedit: IETF BCP 47/RFC 5646 language tags: added an option + `--disable-language-ietf` that causes mkvpropedit to apply changes to the + `language` track header property only to the legacy language track header + element. +* mkvinfo: IETF BCP 47/RFC 5646 language tags: added support for the + "LanguageIETF" track header element. Part of the implementation of #2419. +* MKVToolNix GUI: multiplexer: added full support for IETF BCP 47/RFC 5646 + language tags for both track and chapter languages. Part of the + implementation of #2419. +* MKVToolNix GUI: chapter: added full support for IETF BCP 47/RFC 5646 + language tags for chapter languages. Part of the implementation of #2419. +* MKVToolNix GUI: header editor: added full support for IETF BCP 47/RFC 5646 + language tags for track header languages. The header editor allows editing + of the legacy language elements and the IETF BCP 47 language elements + independent of each other. Part of the implementation of #2419. + +## Other new features and enhancements + +* mkvmerge: the chapter generation mode `when-appending` now also works with + the splitting modes `parts:` & `parts-frames:` when using the `…,+…` syntax + for appending other sections of the source file to the same destination + file. Implements #2898. +* MKVToolNix GUI: multiplexer: the file selection dialogs now include the + extension `.dtsma` for DTS files. Implements #2901. +* mkvmerge: MP4 reader: sped up parsing MP4 DASH files with a lot of segments + (`trun` atoms) quite a bit. Part of the fix of #2900. +* The PCRE2 regular expression library is now used instead of `std::regex` for + big performance improvements in all places where regular expressions are + used for parsing big chunks of text, e.g. in the subtitle parsers. Part of + the fix of #2899. +* all programs: Windows: all programs now support long file names on Windows + 10 release 1604 if they're turned on in the registry. Implements #2916. + +## Bug fixes + +* MKVToolNix GUI: preferences: under certain conditions changing the selected + entry in the page tree on the left did not cause the page shown on the right + to be updated. Fixes #2895. +* mkvmerge: splitting text by a fixed string (e.g. `,`) is now done by using + `std::string.find()` instead of using a regular-expression-based text + splitting function, greatly improving its performance. Part of the fix of + #2899. +* mkvmerge: mkvmerge will now read-buffer file I/O when probing text file + formats which increases its speed significantly on Windows. Part of the fix + of #2899. +* mkvmerge: MP4 reader: fixed handling of `tkhd` atoms of version 1. Fixes + #2900. + +## Build system changes + +* The PCRE2 library (the 8-bit variant) is now required. + + +# Version 49.0.0 "Sick Of Losing Soulmates" 2020-08-02 + +## New features and enhancements + +* mkvmerge: added support for copying the new track header elements + `BlockAddIDName`, `BlockAddIDType`, `BlockAddIDValue` and + `BlockAddIDExtraData` from Matroska files if they exist. Part of the + implementation of #2887. +* mkvinfo: added support for the new track header elements + `BlockAdditionMapping`, `BlockAddIDName`, `BlockAddIDType`, + `BlockAddIDValue` and `BlockAddIDExtraData`. Part of the implementation of + #2887. +* MKVToolNix GUI: multiplexer: the list of recent directories can now be + edited in the preferences → "Multiplexer" → "Destination file + name". Implements #2861. +* MKVToolNix GUI: preferences: the values in the various "predefined values" + lists can now be re-ordered freely by dragging & dropping. + +## Bug fixes + +* mkvmerge: Matroska reader: when reading tracks (e.g. a subtitle track) from + Matroska files with their `default track` flag set to `yes`, and when + overwriting those via the command line to `no`, `mkvmerge` would not promote + additional tracks of the same type from other files (e.g. another subtitle + track from an SRT file). Fixes #2863. +* mkvmerge: SRT reader: empty lines inside entries were doubled. Fixes #2888. +* mkvmerge: subtitles: when calculating the rounded duration of each entry the + error from rounding the corresponding timestamp will be taken into + account. Fixes #2890. +* mkvextract: SSA/ASS extraction: mkvextract is no longer inserting empty + lines before the `Dialogue:` lines. Fixes #2876. +* mkvextract: USF subtitles: start & end timestamps were too high by a factor + of 1.000.000. Fixes #2875. +* MKVToolNix: info tool: when saving to a text file the checkbox "Save as + default for saving output to text files" did nothing. Fixes #2869. +* MKVToolNix: info tool: when saving to a text file in "all elements in a + tree-like structure" mode, the GUI always stopped at the first cluster + regardless of the setting of the "verbosity" option. +* MKVToolNix GUI: preferences: when tooltips were disabled the dialogs for + adding new entries to the various "predefined values" lists were missing + their texts. +* Windows installer: the images are shown again. Fixes #2868. +* configure: fixed detection of QtDBus. Fixes #2886. + +## Build system changes + +* libMatroska v1.6.1 is now required. The bundled version has been updated to + that version. + + +# Version 48.0.0 "Fortress Around Your Heart" 2020-06-27 + +## New features and enhancements + +* mkvmerge: AC-3: file identification will report AC-3 tracks encoded in Dolby + Surround EX as codec "AC-3 Dolby Surround EX". Implements #2740. +* MKVToolNix GUI: multiplexer: on new installations the GUI will now recognize + all known ISO 639-2 language codes in file names by default instead of only + the top 100 of languages by native speakers. +* MKVToolNix GUI: multiplexer: on new installations the list of "often used + languages" will by default only contain certain agnostic ones ("multiple + languages", "no linguistic content", "reserved for local use", "uncoded + languages"), "English" and the default user interface language. The "list of + spoken languages by native speaks" isn't used anymore. Also implements #2716. +* MKVToolNix GUI: header editor: added an option to remove all attachments to + the tree context menu. Implements #2835. +* MKVToolNix GUI: while the GUI is running it will remember the last page that + was selected when the preferences dialog is closed. Upon re-opening the + preferences that page will be selected by default. Implements #2852. + +## Bug fixes + +* mkvmerge: fixed a segmentation fault when exiting prematurely due to write + errors such as the destination having run out of space. Fixes #2843. +* mkvmerge: DTS: fixed wrong channel count for DTS tracks with XCh + extensions. Fixes #2715. +* mkvmerge: MPEG TS reader: fixed detecting AVC/H.264 and HEVC/H.265 tracks + that consist of only a single frame. Part of the fix of #2849. +* mkvmerge: MPEG TS reader: fixed handling of unbounded PES sizes for tracks + that consist of only a single PES packet. Part of the fix of #2849. +* mkvmerge: MPEG TS reader: PGS subtitle tracks are now exempt from the + "detect bogus subtitle timestamps" heuristic which could lead to some PGS + subtitles not being timestamped correctly. Symptoms were that they were + shown at the wrong time or that they were shown indefinitely. Fixes #2736 + and partially fixes #2824. +* mkvmerge: MPEG TS reader: when reading MPLS playlists the start timestamps + of a play items were handled wrong: all the timestamps of packets read were + compared to that start timestamp, dropping those packets whose timestamps + were smaller than the play item's start timestamp. The correct behavior is + to accept all packets as soon as the first one with a timestamp equal to or + larger than the play item's start timestamp is encountered. This could + result in PGS subtitle entries located right at the start of the play item + being garbled/lost as they consist of multiple PES packets for which some + timestamps are often slightly smaller. Part of the fix of #2824. +* mkvmerge: MPEG TS reader: when reading MPLS playlists mkvmerge will no + longer read the whole M2TS files they reference, processing only the packets + lying inside the timestamp range given by the playlists's play item's start + & end timestamps. Instead mkvmerge will use the index information present in + corresponding clip information (CLPI) files in order to seek to the nearest + file position of the play item's start timestamp. Additionally mkvmerge will + simply stop processing a file once the end timestamp is seen. This change + greatly speeds up processing files from which only small portions must be + read. Part of the fix of #2824. +* mkvmerge: WavPack: fixed support for files created by v5 of the + program. Checksums, DSD audio data and non-standard sampling rates are + handled correctly. Patch by David Bryant. +* MKVToolNix GUI: multiplexer: fixed the cursor being positioned wrong after + entering or pasting characters that aren't allowed in file names into the + "destination file" control. Fixes #2855. + +## Build system changes + +* libEBML v1.4.0 and libMatroska v1.6.0 are now required. + +## Other changes + +* The source code repository's main development branch was renamed to `main`. + + +# Version 47.0.0 "Black Flag" 2020-05-30 + +## New features and enhancements + +* mkvmerge: chapters: mkvmerge can now read chapters from DVDs if the user + specifies the path to a DVD folder structure via the `--chapters …` + parameter. By default chapters from the first title will be imported. This + can be changed by append `:` to the file/directory name in the + `--chapters …` argument, e.g. `--chapters /srv/dvds/BigBuckBunny/VIDEO_TS:3` + This feature requires mkvmerge to have been built with the `libdvdread` + library. Part of the implementation of #2808. +* mkvmerge: added `--engage append_and_split_flac` that enables mkvmerge to + append and split FLAC tracks, restoring pre-v45 behavior. The resulting + tracks will be broken: the official FLAC tools will not be able to decode + them and seeking will not work as expected. +* MKVToolNix GUI: multiplexer: added support for mkvmerge's new support for + reading chapters from DVDs if both have been built with the `libdvdread` + library. Part of the implementation of #2808. +* MKVToolNix GUI: multiplexer: when deriving languages from file names the GUI + will now look for simplified language names instead of the full ones + (e.g. instead of looking for "Greek, Modern (1453-)" it would simply look + for "Greek"). +* MKVToolNix GUI: multiplexer: the options in the "additional command-line + options" dialog are now sorted alphabetically. Additionally the + `--append-mode` option has been added as one of the only missing global + options. +* MKVToolNix GUI: chapter editor: the chapter editor can now read chapters + from DVDs if MKVToolNix has been build with the `libdvdread` library. Part + of the implementation of #2808. +* MKVToolNix GUI: header editor: added an option in the preferences for + displaying all date & time values in UTC instead of the local time + zone. Implements #2814. + +## Bug fixes + +* all: fixed a crash when using the `MTX_LOGGER=file` syntax for logging debug + messages without specifying a file name to log to. It will now log to a file + called `mkvtoolnix-debug.log` in the system's default temporary directory, + as initially intended. + +## Build system changes + +* The [`libdvdread`](https://www.videolan.org/developers/libdvdnav.html) + library will be used if found via `pkg-config`. If it is found, support for + reading chapters from DVDs will be enabled in `mkvmerge` and the MKVToolNix + GUI. Part of the implementation of #2808. +* Boost's Date/Time, Lexical Cast, Range, Range Adaptors, Tri-Bool, Variant + libraries are not used anymore. +* MKVToolNix now requires a C++ compiler & standard library that support the + following features of the C++17 standard: "`std::variant`", "`std::gcd`". + For the GNU Compiler Collection (gcc) this means v7 or newer; for clang it + means v4 or newer — the same versions required by earlier MKVToolNix + versions. +* MKVToolNix now requires version 6.1.0 of fmtlib or later for the + `fmt::to_string` function and bugfixes to the formatting of floating point + numbers. If a system-wide version is installed that's older, the bundled + copy will be used. +* The bundled version of fmtlib has been updated to release 6.2.1. + + +# Version 46.0.0 "No Deeper Escape" 2020-05-01 + +## New features and enhancements + +* mkvmerge: when splitting, the placeholder `%c` can be used in the + destination file name. It'll be replaced by the name of the first chapter in + the file. Implements #2791. +* mkvmerge: when reading MPLS playlists mkvmerge will include a tag named + `SOURCE_ID` in the track's statistics tags that conveys the fact that the + source was a Blu-ray and what the track's ID was in the source + container. When reading Matroska file existing `SOURCE_ID` tags will be + kept. The format used is the same format MakeMKV uses. Implements #2774. +* mkvmerge: for audio-only files mkvmerge will now write a cue entry every + 500ms instead of every 2s. +* MKVToolNix GUI: job actions: split up the option "execute when the job + finishes successfully or with warnings" into two separate options: "…when + finishes successfully" and "…when exits with warnings". Implements #2798. + +## Bug fixes + +* mkvmerge: Matroska reader: when regenerating UIDs for chapters mkvmerge will + now fix referencing tag chapter UID targets to have the same values. Fixes + #2804. +* mkvmerge: MP4 reader: fixed a crash that could potentially happen while + trying to identify HEVC/H.265 tracks. +* mkvmerge: MP4 reader: when reading HEVC/H.265 tracks without a frame offset + table (`ctts` atom) present, mkvmerge did not parse the `hevcC` structure + correctly in certain cases, causing no video frames to be output at all or + the output not being playable. This fixes #2782, a bug introduced in v45. +* mkvmerge: MPLS handling/MPEG TS reader: timestamp restrictions as given in + an MPLS file were only honored for the first play item, not for subsequent + play items. For those play items the whole referenced file was always + copied. Part of the fix of #2789. +* mkvmerge: MPLS handling/MPEG TS reader: under certain circumstances mkvmerge + copied one frame too many before switching to the next play item. Part of + the fix of #2789. +* mkvmerge: for audio-only files cues will only be created for I frames + (important for e.g. TrueHD where decoding can only start on a sync + frame). Fixes #2790. +* MKVToolNix GUI: fixed a crash that happened when closing the preferences + after having closed at least one multiplexer tab. Fixes #2785. +* MKVToolNix GUI: macOS: changed the default of the "elide tab header labels" + feature introduced in v45 from "no" to "yes" to mirror how versions before + v45 behaved on macOS. + + +# Version 45.0.0 "Heaven in Pennies" 2020-04-04 + +## New features and enhancements + +* mkvmerge: mkvmerge has never supported appending & splitting FLAC audio + tracks. mkvmerge will now emit error messages when the user attempts either + instead of continuing and creating invalid FLAC tracks. +* MKVToolNix GUI: added an option in the preferences to turn on eliding text + on tab headers. If enabled, tab names will be shortened so that all tab + headers fit into the window's width. Implements #2768. +* MKVToolNix GUI: added an option in the preferences to disable all tooltips. +* MKVToolNix GUI: Windows: debug output sent via Qt's to Windows' debugging + facility will use a more verbose message format including the application + name, making it easier to filter for in SysInternal's "Debug View" utility. +* MKVToolNix GUI: multiplexer: if the file identification fails due to a JSON + parser error, the output generated by `mkvmerge` will be output via Qt's + debugging facility (viewable with SysInternal's "Debug View" utility on + Windows; on other systems it's output on `STDERR`) allowing insight into + what's gone wrong. +* MKVToolNix GUI: multiplexer: if an error occurs during file identification, + the name of the processed file will be mentioned in the error message. +* MKVToolNix GUI: multiplexer: if an error occurs during identification of + multiple files, the GUI will ask the user whether to continue or abort the + identification process. Implements #2778. +* MKVToolNix GUI: job queue: added an option in the preferences for removing + completed jobs when exiting the program depending on their status. + Implements #2769. + +## Bug fixes + +* mkvmerge: HEVC/H.265 packetizer: fixed changing the NALU size length, it was + using the wrong offset into the `hevcC` structure. +* mkvmerge: MP4 reader: fixed calculating the duration of video tracks that + only contain a single frame. Fixes #2747. +* mkvmerge: MP4 reader: if there's no frame offset table (`ctts` atom) present + for HEVC/H.265 video tracks, mkvmerge will determine the timestamp order + itself instead of relying on the timestamps in the MP4 being in the + presentation order required by Matroska. Fixes #2777. +* mkvpropedit: Windows: mkvpropedit wasn't caching when reading the file to + modify, slowing down operations such as adding track statistics tags + considerably. Fixes #2761. +* MKVToolNix GUI: multiplexer: when using the title as part of the destination + file name (both automatically as well as using the "copy title to + destination file name" function) all characters that aren't valid in a file + name are replaced by hyphens. +* MKVToolNix GUI: multiplexer: the "copy title to destination file name" + function was broken when the "make file name unique" option in the + preferences was disabled. In that case the file base name was removed + regardless of what the title was set to at the time. +* MKVToolNix GUI: multiplexer: when using the "show command line" menu option + on Windows the path to the `mkvmerge` executable was shown with forward + slashes instead of backslashes. This is a purely cosmetic fix as Windows + supports both forward and backward slashes. +* MKVToolNix GUI: multiplexer: when adding Blu-ray playlists the GUI used to + only look for the English version of the disc library information (title & + cover images). Now the GUI will present all disc library entries in the + "select playlist to add" dialog & let the user chose which one to use (if + any). Fixes #2765. +* MKVToolNix GUI: multiplexer, info tool: fixed the "warn before overwriting" + check wrt. jobs creating the same file. Fixes #2758. + + +# Version 44.0.0 "Domino" 2020-03-08 + +## New features and enhancements + +* MKVToolNix GUI: header editor: the attachments can now be reordered via drag + & drop. Implements #2753. + +## Bug fixes + +* mkvmerge: Matroska reader: when encountering certain errors in the track + headers such as the codec ID not being present mkvmerge will simply skip + those tracks instead of exiting with an error. Fixes #2737. +* MKVToolNix GUI: multiplexer: the "ask before overwriting" functionality did + not look for the correct file names when splitting was active. Fixes #2741. + + +# Version 43.0.0 "The Quartermaster" 2020-01-26 + +## New features and enhancements + +* MKVToolNix GUI: using one of the command line options `--info`, + `--edit-headers` or `--edit-chapters` will make the GUI select the + corresponding tool on startup even if no further file name is + given. Implements #2723. +* MKVToolNix GUI: multiplexer: added a setting in the preferences for changing + the location of the MediaInfo executable for when the user accidentally + selected the wrong one. + +## Bug fixes + +* mkvmerge: AVC/H.264 parser: the order of the NALUs before each key frame was + sometimes wrong: mkvmerge wrote SPS & PPS after SEI NALUs. Now SPS & PPS + NALUs are always written before the other NALUs. Patch by Torsten + Hauska. Part of the implementation of #2709 and part of the fix of #2250. +* mkvmerge: AVC/H.264 parser: when additional SPS or PPS NALUs (with IDs that + haven't been seen so far) are found mid-stream, mkvmerge will prepend all + following key frames with all current valid SPS & PPS NALUs (just like when + SPS & PPS NALUs are overwritten mid-stream). Part of the fix of #2250. +* mkvmerge: MPEG TS reader: fixed detection of MPEG-1/2 video tracks + consisting of very few frames. Fixes #2732. +* mkvmerge: Ogg Opus reader: fixed the handling of Ogg Opus streams that + contain a just one Ogg page (`mkvmerge` aborted with an exception). Fixes + #2722. +* MKVToolNix GUI: multiplexer: dragging & dropping XML files with chapters or + tags to the GUI's window was broken in v42. Instead of adding the file names + to the appropriate input boxes the GUI was running mkvmerge for file + identification purposes which then failed. Fixes #2718. + + +# Version 42.0.0 "Overtime" 2020-01-02 + +## New features and enhancements + +* mkvmerge: added an option for creating byte-identical files: + `--deterministic <seed>`. Part of the implementation of #2698. +* mkvmerge: Matroska reader: mkvmerge will remove the `icpf` atom headers if + they're present in frames read from Matroska files. Implements #2692. +* mkvmerge: MP4 reader: ALAC tracks: the number of channels, sampling + frequency and bit depth are now taken from the bitstream in order to fix + bogus values on the container level. Implements #2714. +* mkvpropedit: when changing track UIDs the referring elements in existing + chapters & tags will be updated automatically, too. Part of the + implementation of #2700. +* mkvinfo: when the option `-p`/`--hex-positions` is used, element positions + will be output regardless of the verbosity level. Part of the implementation + of #2713. +* mkvinfo: added the option `-P`/`--positions` for showing the position of + each element in decimal regardless of the verbosity level used. Part of the + implementation of #2713. +* mkvinfo: added the option `-o`/`--continue` for continuing processing when + the first cluster is encountered regardless of the verbosity level + used. Part of the implementation of #2713. +* mkvinfo: added the option `-a`/`--all` for outputting all sub-elements (even + cues & seek head entries) and not stopping at the first cluster regardless + of the verbosity level used. Part of the implementation of #2713. +* MKVToolNix GUI: multiplexer: added an option in the preferences for + disabling adding cover images from Blu-ray discs. Implements #2693. +* MKVToolNix GUI: multiplexer: added mkvmerge's new `--deterministic` option + in the "additional command-line options" dialog. Part of the implementation + of #2698. +* MKVToolNix GUI: header editor:: when changing track UIDs the referring + elements in existing chapters & tags will be updated automatically, + too. Part of the implementation of #2700. + +## Bug fixes + +* mkvmerge: HEVC ES parser: fixed a bug in the slice parser calculating the + size of a field which in turn could have led to the slice's type being read + wrong. Patch by Torsten Hauska. Fixes #2710. +* mkvmerge: Matroska reader: fixed a segmentation fault when trying to read a + file that uses header removal compression but no removed bytes are present + in the track headers. Fixes #2687. +* mkvmerge: MPEG elementary stream parser: fixed an invalid memory access and + use of uninitialized memory that could happen under certain + circumstances. Fixes #2690. +* mkvmerge: RealMedia reader: fixed a division by zero when all audio + timestamps were zero. Fixes #2689. +* mkvmerge: RealMedia reader: fixed an invalid memory access in the video + frame assembly code triggered by invalid data in the file. Fixes #2691. + +## Build system changes + +* `std::optional` (C++17 feature) is now used instead of `boost::optional`. +* `std::regex` is now used instead of `boost::regex`. + +## Other changes + +* New man page translations into French, Italian, Russian and Chinese + Traditional have been added. + + +# Version 41.0.0 "Smarra" 2019-12-06 + +## New features and enhancements + +* mkvmerge: Matroska reader: Vorbis tracks: stream comments (aka Vorbis + comments) will be converted to Matroska attachments (for cover arts) and + Matroska track tags (for other comments). Additionally the stream comments + will be removed from Vorbis headers. +* mkvmerge: MP4 reader: added support for reading Opus audio from MP4 + files. Part of the implementation of #2673. +* mkvmerge: MP4 reader: added support for reading VP9 video from MP4 + files. Part of the implementation of #2673. +* mkvmerge: Ogg reader: Vorbis, Opus & VP8 streams: stream comments (aka + Vorbis comments) will be converted to Matroska attachments (for cover arts) + and Matroska track tags (for other comments). Additionally the stream + comments will be removed from Vorbis headers. +* mkvmerge: WAV reader: added support for reading RF64 files. +* MKVToolNix GUI: multiplexer: the list of predefined track names is now split + up into three lists, one for each track type (audio, video & + subtitles). Part of the implementation of #2654. +* MKVToolNix GUI: multiplexer: when trying to add thumbnails for a Blu-ray the + GUI will determine the thumbnail's pixel size from the thumbnail files if + the XML file doesn't contain that information. This works for JPEG and PNG + files. Implements #2674. +* MKVToolNix GUI: general: line edits & combo boxes will now have a "clear + text" button appear whenever they're not empty. Part of the implementation + of #2654. +* MKVToolNix GUI: update check: the dialog showing the latest news & version + information states explicitly where the links take the user (the MKVToolNix + `NEWS.md` file and YouTube respectively). + +## Bug fixes + +* mkvmerge: Matroska reader: mkvmerge did not copy the codec's private data + when reading WavPack from Matroska files. Fixes #2685. +* mkvmerge: MPLS handling: re-added caching when using MPLS playlists as input + files. Fixes #2666. +* mkvmerge: MPEG TS reader: when reading an MPLS playlist, the calculation of + the minimum timestamp to use for shifting all output timestamps to zero was + wrong. It was wrongfully considering timestamps from packets it would not + copy due to the MPLS's timestamp restrictions. This could lead to the first + timestamps in the output file being quite large, e.g. more than a couple of + minutes, causing sync problems when multiplexing together with other + files. Fixes #2670. +* MKVToolNix GUI: multiplexer: the automatic switch between aspect ratio & + display width/height wasn't reflected in the configuration generated for + `mkvmerge`. The user had to change between the two settings manually. Fixes + #2660. +* MKVToolNix GUI: multiplexer: the progress dialog shown when scanning a + Blu-ray wasn't closed properly in certain situations. Fixes #2678. +* MKVToolNix GUI: general: the configured font was not applied to a lot of + controls (e.g. the file & track lists or the menu entries) on application + startup. Instead the user had to open & close the preferences in order for + the font to be applied to all controls. Fixes #2671. + + +# Version 40.0.0 "Old Town Road + Pony" 2019-11-09 + +## New features and enhancements + +* mkvmerge: MP4 reader: added support for BMP covert art images. +* MKVToolNix GUI: multiplexer: added an option to disable deriving the + destination file name from the file title. Implements #2648. +* MKVToolNix GUI: multiplexer: the content of the "stereoscopy" combo box has + been simplified making the box's minimum width much smaller, allowing the + user to resize the GUI's whole window to a much smaller width. +* MKVToolNix GUI: multiplexer: whenever the user changes the "aspect ratio" or + "display dimensions" controls, the corresponding radio button will be + activated automatically. Implements #2651. +* MKVToolNix GUI: Windows: added a setting in the preferences to disable the + GUI's dark color mode even if Windows's app color mode is set to + dark. Implements #2646. +* MKVToolNix GUI: Windows: replaced the dark mode introduced in v39 with + another dark mode that's less wasteful with space between widgets. + +## Bug fixes + +* mkvmerge: MP4 reader: mkvmerge was reading eight bytes too many for cover + art images. This could cause file identification to fail when the cover art + was located at the end of the MP4 file. Even if it succeeded, this meant too + much data present in the attachment. Fixes #2650. +* mkvmerge: MP4 reader: covert art images with unknown image types will be + skipped instead of treated as JPEG images. + +## Build system changes + +* Qt 5.9.0 or newer is now required for building MKVToolNix GUI. + + +# Version 39.0.0 "In The Waiting Line" 2019-11-04 + +## New features and enhancements + +* mkvmerge: Blu-ray: when reading an MPLS playlist mkvmerge will look up and + use chapter names from the Blu-ray's "track/chapter names" meta data if it + exists. Part of the implementation of 2486. +* mkvmerge: MP4 reader: if present, cover art images (the + `udta.meta.list.covr` atom) will be converted into attachments. +* MKVToolNix GUI: multiplexer: when adding a playlist from a Blu-ray disc, the + disc library meta data will be parsed, and the biggest thumbnail, if + present, will be added as a new attachment with name `cover.jpg` (extension + depends on thumbnail's extension). Implements #2644. +* MKVToolNix GUI: multiplexer: when adding a playlist from a Blu-ray disc, the + title from the disc library meta data will be set as the new file title if + the disc library meta data contains one & no title has been set yet. +* MKVToolNix GUI: multiplexer: the automatically generated destination file + name will now be based on the file title if one is set at that point. This + works in conjunction with the title being said from the Blu-ray disc library + meta data. +* MKVToolNix GUI: chapter editor: when reading chapters from an MPLS playlist + the GUI will look up and use chapter names from the Blu-ray's "track/chapter + names" meta data if it exists. Part of the implementation of 2486. +* MKVToolNix GUI: Windows: added a dark mode that's enabled when Windows 10's + dark mode is turned on. +* translations: added a Bulgarian translation of the programs & the man pages + by Симеон Цветков (see `AUTHORS`). + +## Bug fixes + +* mkvmerge: attachments without a file name won't be ignored anymore. Part of + the fix of #2642. +* MKVToolNix GUI: header editor: attachments with an empty name element will + be shown as `<unnamed>` as originally intended. Part of the fix of #2642. +* Linux AppImage: the AppImage will no longer change directories before + running the desired executable allow the use of relative file names. Fixes + #2632. + +## Build system changes + +* MKVToolNix now requires a C++ compiler that supports the following features + of the C++17 standard: "`[[maybe_unused]]` attribute", "nested namespace + definition", "structured bindings". For the GNU Compiler Collection (gcc) + this means v7 or newer; for clang it means v4 or newer. +* Boost 1.60.0 or newer is now required. + + +# Version 38.0.0 "The Silent Type" 2019-10-06 + +## New features and enhancements + +* mkvextract: chapters, tags & cue sheets will now be written to standard + output if no file name is given, same as if `-` is given as the file name. +* MKVToolNix GUI: job queue: added a new setting in the preferences' "job + queue & job status" section that, when enabled, will cause the GUI to remove + all output files created by jobs that are either aborted by the user or that + end in an error. Implements #2614. + +## Bug fixes + +* all programs: macOS: fixed file access if the file name (including all path + components) contains any Unicode character where NFC (Normalization Form + Canonical Composed) and NFD (Normalization Form Canonical Decomposed) + differ, e.g. German Umlauts. Fixes #2620. +* mkvmerge: when splitting by chapters the user can now split by chapters + coming from one of the appended files, too. Fixes #2625. +* mkvmerge: AAC reader: fixed reading codec parameters (channels, sample rate) + if a file starts with garbage that includes valid-but-bogus AAC + headers. Fixes #2622. +* MKVToolNix GUI: Hebrew was added to the list of often-used languages so that + it can be selected by default again. Fixes #2610. +* MKVToolNix GUI: when updating the GUI's settings from v37.0.0 or older, the + GUI checks if the list of often-used languages equals the built-in list from + v36.0.0. If it does, it will be updated to the built-in list changed in + v37.0.0. Fixes #2611. + +## Build system changes + +* Boost's Operators header library is now required. + + +# Version 37.0.0 "Leave It" 2019-08-24 + +## New features and enhancements + +* MKVToolNix GUI: the list of often used languages now contains those from + Wikipedia's "List of languages by native speakers" by default. Also by + default only those languages will be shown in the language drop-down boxes. + +## Bug fixes + +* MKVToolNix GUI: multiplexer: fixed a bug in the "make destination file names + unique" logic that caused an existing number-in-parenthesis at the end of + the file base name to be removed in certain situations (e.g. when the first + added file was named `m (3).mkv` and both `m (3) (1).mkv` and `m (3) + (2).mkv` existed already, the GUI was suddenly use `m.mkv` instead of `m (3) + (3).mkv`). +* MKVToolNix GUI: on Windows the GUI is built with a slightly older version of + the Qt library again (5.12.4). The Qt version used in release v36.0.0, + v5.13.0, lead to crashes when doing certain things such as selecting + multiple tracks in the multiplexer. Fixes #2605 and #26008. + + +# Version 36.0.0 "Is That Jazz?" 2019-08-10 + +## New features and enhancements + +* mkvmerge: mkvmerge now allows appending AV1, VP8, VP9, AVC/H.264 and + HEVC/H.265 tracks whose pixel dimensions differ. Implements #2582. + +## Bug fixes + +* source code: fixed building with Boost 1.71.0. Fixes #2599. +* all: fixed the spelling of the H.264 & H.265 codec names. +* mkvmerge: Blu-ray MPLS handling: mkvmerge will now find corresponding M2TS + files even if the `clip_codec_identifier` playlist item field is not set to + `M2TS` in the MPLS file. Fixes #2601. +* mkvmerge: fixed handling of text files that use both DOS-style and + Unix-style line endings resulting in problems such as text subtitle files + not being parsed correctly. Fixes #2594. + + +# Version 35.0.0 "All The Love In The World" 2019-06-22 + +## New features and enhancements + +* mkvmerge: JSON identification: the "codec name" track property will be + output as `codec_name`. The JSON schema has been bumped to v12 for this + change. +* MKVToolNix GUI: job queue: added a new type of action to execute after job + completion: deleting source files for of multiplexer jobs. As this is a + destructive operation, the action is disabled by default. Implements #869 + and #2570. + +## Bug fixes + +* mkvmerge: the "codec name" track property wasn't copied from Matroska + files. Fixes #2566. +* MKVToolNix GUI: multiplexer: Windows: clearing the destination file name + will reset the tab name to "\<No destination file\>" again. Fixes #2571. +* MKVToolNix GUI: multiplexer: the file types were not re-translated if the UI + language was changed. Fixes #2572. + + +# Version 34.0.0 "Sight and Seen" 2019-05-18 + +## Bug fixes + +* mkvmerge: all subtitle frames are now treated as key frames in order to fix + wrong data in source files. Fixes #2541. +* mkvmerge: AV1: fixed frame timestamp calculation when reading bitstreams + that lack timing information from IVF files. Fixes #2553. +* mkvmerge: Matroska reader: fixed an infinite loop that could happen with + large video frames and applied timestamp files due to too much data being + buffered at the wrong time. Fixes #2550. + + +# Version 33.1.0 "Primrose" 2019-04-15 + +## Bug fixes + +* MKVToolNix GUI: multiplexer: Windows: using UNC paths + (e.g. `\\server\Videos`) when the option "automatically set the destination + file name" was set in the preferences, the GUI would create a destination + file name with forward slashes (e.g. `//server/Videos/outputfile.mkv`), a + syntax not supported by `mkvmerge`. Fixes #2533 & #2534. +* build system: the programs were accidentally built without stack protection + (`-fstack-protector-strong`) on recent versions of gcc and clang. + + +# Version 33.0.0 "A Little Bit of Madness" 2019-04-12 + +## Bug fixes + +* mkvinfo: when using the `--size` option, mkvinfo will now report the + correctly if an element has an unknown size. Part of the fix of #2530. +* MKVToolNix GUI: info tool: clusters with an unknown size will now be read + and displayed correctly. Part of the fix of #2530. +* MKVToolNix GUI: multiplexer: Windows: trying to open Blu-ray index or + playlist files failed when the path to the files contained symbolic links + (e.g. when mounting a drive in a sub-folder via Windows' disk management + utility). Fixes #2522. +* MKVToolNix GUI: multiplexer: if a destination file names ends with a number + in parenthesis (e.g. a year such as "(2017)"), that number will not be + stripped anymore during the process of ensuring the destination file name is + unique. Only those suffixes added automatically in prior attempts to make + the file name unique will be removed. Fixes #2521. +* MKVToolNix GUI: multiplexer: Windows: the GUI will let the user change the + drive letter part of the destination file name freely again and only verify + its validity right before starting to mux/adding to the job queue. Before it + tried to force that into something valid, often resulting in unintentional + paths (such as "C:\users\…\DC\files\…"). Fixes #2527. + + +# Version 32.0.0 "Astral Progressions" 2019-03-12 + +## New features and enhancements + +* mkvinfo: when sizes are output the size of the element's data portion is + output in addition to the element's total size. +* MKVToolNix GUI: info tool: the element's data portion is + shown as an extra column. +* MKVToolNix GUI: multiplexer: added column "Delay" to the track list + containing the additional delay to apply during multiplexing. Implements + #2506. + +## Bug fixes + +* all: fixed handling of Unicode code points \> U+FFFF. Fixes #2516. +* mkvmerge: Windows: mkvmerge was crashing with an exception when trying to + identify certain files that can be used on Blu-rays (such as MPEG transport + streams of MPLS play list files) and when the file name was given as a UNC + path (e.g. `\\servername\sharename\path\to\file.m2ts`). The GUI emitted + errors such as "the JSON output could not be parsed" in that case. Fixes + #2507. +* MKVToolNix GUI: the portable mode wasn't detected correctly when the current + working directory the GUI was started from wasn't the directory the GUI's + executable file was located it. Examples for when this is the case are + Windows' "send to" or "open with" functions. Fixes #2501. +* MKVToolNix GUI: multiplexer: using button to change the current destination + directory to one of the recently used ones did not update the file name + according to the "make file name unique" setting. Part of the fix of #2519. +* MKVToolNix GUI: multiplexer: the function "set destination file name from + selected file's name" will now only change the destination file's name but + not its path. Part of the fix of #2519. + +## Build system changes + +* libEBML v1.3.7 and libMatroska 1.5.0 are now required as they fix their + handling of Unicode code points \> U+FFFF (see #2516). + + +# Version 31.0.0 "Dolores In A Shoestand" 2019-02-09 + +## New features and enhancements + +* all programs: added a new option `--abort-on-warnings` that will cause the + program to abort after it has emitted the first warning, similar to how it + aborts after the first error. Implements #2493. +* mkvmerge, mkvextract: when closing files that were opened for writing, + cached data will not be flushed to storage automatically anymore. This + reverts the workaround implemented for #2469. A new option was added to both + programs (`--flush-on-close`) that re-enables flushing for people who are + affected by data loss such as described in #2469. + + The reason is that automatic flushing causes long delays in processing + queues when the output by mkvmerge/mkvextract isn't the final product but + just an intermediate result to be processed further. + + Implements #2480. +* MKVToolNix GUI: multiplexer: the dialog previewing different character sets + for text subtitles will now keep the position of the displayed text when + switching between character sets. Implements #2489. + +## Bug fixes + +* mkvmerge: AVI reader: using DV type 1 AVIs will now result in an unsupported + file type being reported (as the underlying AVI library doesn't support + them) instead of crashing mkvmerge. Fixes #2491. +* mkvmerge: HEVC: the height of interlaced streams will now be set correctly + to the height of the full frame instead of the height of a single interlaced + field. Fixes #2446. +* mkvmerge: MP4 reader: edit lists consisting solely of elements that mkvmerge + doesn't support (such as dwells) are simply ignored. Before no data was read + for such tracks at all. Fixes #2487. +* mkvmerge: text subtitles: entries with an explicit duration of 0ms will now + be handled correctly: the 0ms duration will be stored in Matroska instead of + the difference between the current and the following entry. Fixes #2490. +* MKVToolNix GUI: multiplexer, chapter editor: fixed drag & drop handling with + Qt 5.12.0 and newer. Fixes #2472. +* MKVToolNix GUI: multiplexer: the GUI did not clean up temporary files + created when running `mkvmerge`. Fixes #2499. + +## Build system changes + +* Qt 5.4.0 or newer has required (up from 5.3.0) since version 30.0.0; I just + forgot to include this entry. + + +# Version 30.1.0 "Forever And More" 2019-01-05 + +## Bug fixes + +* build system: fixed building on non-UTF-8 locales. Fixes #2474. +* MKVToolNix GUI: multiplexer: implemented a workaround for drag & drop not + working on macOS with Qt 5.12 due to a bug in Qt 5.12. Fixes #2472. +* MKVToolNix GUI: chapter editor: when opening a Matroska/WebM file that + doesn't contain chapters and later saving chapters back to them, the editor + was truncating the file down to a couple of KB in size. This was a + regression introduced with the implementation of #2439 in v30.0.0 Fixes + #2476. + + +# Version 30.0.0 "Interstellar" 2019-01-04 + +## New features and enhancements + +* mkvextract: WAV extractor: mkvextract will now write W64 files instead of + WAV files if the file name extension is `.w64` or if the final file size is + bigger than 4 GB, the file size limit for WAV files. Implements #2458. +* MKVToolNix GUI: multiplexer: a new button was added next to the "destination + file" controls. Clicking it shows a menu with the ten most recently used + output directories. Selecting one of them will change the destination file + to the selected directory keeping the file name. Implements #2468. +* MKVToolNix GUI: multiplexer (preferences): the ten most recently used values + for the "relative output directory" and "fixed output directory" settings + are now saved. The corresponding settings have been changed into combo boxes + allowing quick access to those recent values. +* MKVToolNix GUI: multiplexer (preferences): the predefined split sizes and + durations can now be customized in the preferences. +* MKVToolNix GUI: chapter editor: added an option in the "Chapter editor" menu + for appending chapters from an existing file to the currently open editor + tab. Part of the implementation of #2439. +* MKVToolNix GUI: chapter editor: added an action in the context menu for + copying the selected entry and all of its children to another open editor + tab. Part of the implementation of #2439. + +## Bug fixes + +* mkvmerge: all files opened for writing will now be flushed once before + they're closed. This ensures the operating system actually writes all cached + data to disk preventing data loss in certain situations such as power + outages or buggy drivers in combination with suspending the computer. Fixes + #2469. +* mkvmerge: AAC: under certain conditions 8 channel audio files were taken for + 7 channel ones. +* MKVToolNix GUI: multiplexer: removing a file added as an "additional part" + will no longer cause a crash. Fixes #2461. +* source code: fixed compilation with Boost 1.69.0 after API-breaking change + to the `boost::tribool` class. Fixes #2460. + + +# Version 29.0.0 "Like It Or Not" 2018-12-01 + +## Important notes + +* The string formatting library used was switched from `boost::format` to + [`fmt`](http://fmtlib.net/). See the section "Build system changes" for + details. + +## New features and enhancements + +* MKVToolNix GUI: added an option in the preferences for disabling automatic + scaling for high DPI displays. Implements #2415. +* MKVToolNix GUI: the GUI will now prevent the system from going to sleep + while the job queue is running. This feature is implemented for macOS, + Windows and Linux/Unix systems where the `org.freedesktop.login1.Manager` + D-Bus interface is available. Implements #2411. + +## Bug fixes + +* mkvmerge: chapter generation: the start timestamps of chapters generated in + intervals was wrong for files whose smallest video timestamp was bigger than + 0. Fixes #2432. +* mkvmerge: MP4 reader: fixed handling of atoms whose size exceeds the parent + atom's size. Fixes #2431. +* mkvmerge, MKVToolNix GUI's chapter editor: the chapter name template will + now also be used when reading Ogg-style chapter files with empty chapter + names. Fixes #2441. +* mkvextract: AAC: mkvextract will now write the program config element (PCE) + before the first AAC raw data packet if the PCE is present in the + `AudioSpecificConfig` structure in the `Codec Private` Matroska element. The + PCE carries vital information about the number of channels and is required + in certain cases. Fixes #2205 and #2433. +* mkvpropedit, MKVToolNix GUI's header editor: in situations when a one-byte + space must be covered by a new EBML void element the following element must + be moved up instead. If that moved element is a cluster, the corresponding + cue entries will now be updated to reflect the cluster's new position. Fixes + #2408. +* MKVToolNix GUI: Windows: the application manifest is now included properly + so that Windows actually recognizes it. See #2415. + +## Build system changes + +* Qt's D-Bus implementation is now required for building on systems other than + macOS and Windows, +* The `boost::format` library is not used anymore. +* The [`fmt` library](http://fmtlib.net/) is now required. Versions 3 and + newer are supported. As not all Linux distributions include packages for the + library, its release 5.2.1 comes bundled with MKVToolNix. The `configure` + script will check for a system version of the library and use it if present + and recent enough. Otherwise it will fall back to the bundled version and + link that statically. + + +# Version 28.2.0 "The Awakening" 2018-10-25 + +## Bug fixes + +* mkvmerge, mkvinfo, mkvextract, mkvpropedit, MKVToolNix GUI's info tool & + chapter editor: fixed a case of memory being accessed after it had been + freed earlier. This can be triggered by specially crafted Matroska files and + lead to arbitrary code execution. The vulnerability was reported as Cisco + TALOS 2018-0694 on 2018-10-25. + + +# Version 28.1.0 "Morning Child" 2018-10-23 + +## Bug fixes + +* mkvmerge: AV1 parser: fixed an error in the sequence header parser if + neither the `reduced_still_picture_header` nor the + `frame_id_numbers_present_flag` is set. Part of the fix for #2410. +* mkvmerge: AV1 parser: when creating the `av1C` structure for the Codec + Private element the sequence header OBU wasn't copied completely: its common + data (type field & OBU size among others) was missing. Part of the fix for + #2410. +* mkvmerge: Matroska reader, AV1: mkvmerge will try to re-create the `av1C` + data stored in Codec Private when reading AV1 from Matroska or WebM files + created by mkvmerge v28.0.0. Part of the fix for #2410. +* MKVToolNix GUI: info tool: the tool will no longer stop scanning elements + when an EBML Void element is found after the first Cluster element. Fixes + #2413. + + +# Version 28.0.0 "Voice In My Head" 2018-10-20 + +## New features and enhancements + +* mkvmerge: AV1 parser: updated the code for the finalized AV1 bitstream + specification. Part of the implementation of #2261. +* mkvmerge: AV1 packetizer: updated the code for the finalized AV1-in-Matroska + & WebM mapping specification. Part of the implementation of #2261. +* mkvmerge: AV1 support: the `--engage enable_av1` option has been removed + again. Part of the implementation of #2261. +* mkvmerge: MP4 reader: added support for AV1. Part of the implementation of + #2261. +* mkvmerge: DTS: implemented dialog normalization gain removal for extension + substreams. Implements #2377. +* mkvmerge, mkvextract: simple text subtitles: added a workaround for simple + text subtitle tracks that don't contain a duration. Implements #2397. +* mkvextract: added support for extracting AV1 to IVF. Part of the + implementation of #2261. +* mkvextract: IVF extractor (AV1, VP8, VP9): precise values will be used for + the frame rate numerator & denominator header fields for certain well-known + values of the track's default duration. +* mkvmerge: VP9: mkvmerge will now create codec private data according to the + VP9 codec mapping described in the WebM specifications. Implements #2379. +* MKVToolNix GUI: automatic scaling for high DPI displays is activated if the + GUI is compiled with Qt ≥ 5.6.0. Fixes #1996 and #2383. +* MKVToolNix GUI: added a menu item ("Help" → "System information") for + displaying information about the system MKVToolNix is running on in order to + make debugging easier. +* MKVToolNix GUI: multiplexer, header editor: the user can enter a list of + predefined track names in the preferences. She can later select from them in + "track name" combo box. Implements #2230. + + +## Bug fixes + +* mkvmerge: JSON identification: fixed a bug when removing invalid UTF-8 data + from strings before they're output as JSON. Fixes #2398. +* mkvmerge: MP4/QuickTime reader: fixed handling of PCM audio with FourCC + `in24`. Fixes #2391. +* mkvmerge: MPEG transport stream reader, teletext subtitles: the decision + whether or not to keep frames around in order to potentially merge them with + the following frame is made sooner. That avoids problems if there are large + gaps between teletext subtitle frames which could lead to frames being + interleaved too late. Fixes #2393. +* mkvextract: IVF extractor (AV1, VP8, VP8): the frame rate header fields + weren't clamped to 16 bits properly causing wrong frame rates to be written + in certain situations. +* mkvpropedit, MKVToolNix GUI's header editor: fixed file corruption when a + one-byte space must be covered with a new EBML void element but all + surrounding elements have a "size length" field that's eight bytes long + already. Fixes #2406. + + +# Version 27.0.0 "Metropolis" 2018-09-26 + +## New features and enhancements + +* mkvmerge: chapters: the timestamps of chapters read from containers or from + chapter files can be adjusted (multiplication and addition) with the new + `--chapter-sync` option or using the special track ID `-2` for the existing + `--sync` option. Part of the implementation of #2358. +* MKVToolNix GUI: multiplexer: adjusted & added controls for mkvmerge's new + feature of being able to adjust chapter timestamps. Part of the + implementation of #2358. +* MKVToolNix GUI: multiplexer: the GUI can now ask for confirmation when the + user is about to create a file that won't contain audio tracks. It does this + by default if at least one source file contains an audio track. Implements + #2380. + +## Bug fixes + +* mkvmerge: AC-3: dialog normalization gain removal was corrupting E-AC-3 + frames irreversibly by writing checksums in places where they didn't + belong. Additionally only the first E-AC-3 frame in a Matroska was processed + but not additional dependent frames in the same block. Fixes #2386. +* MKVToolNix GUI: fixed a leak of Windows font resources leading to a general + slowdown and subsequent crash. Fixes #2372. + + +# Version 26.0.0 "In The Game" 2018-08-26 + +## New features and enhancements + +* mkvmerge: chapter generation: if the name template given by + `--generate-chapters-name-template` is empty, no names (`ChapterDisplay` + master elements with `ChapterString`/`ChapterLanguage` children) will be + generated for the chapter atoms. Part of the implementation of #2275. +* mkvmerge: chapters: chapter names generated from MPLS files will now use the + name template if one is set via `--generate-chapters-name-template`. Part of + the implementation of #2275. +* mkvmerge: mkvmerge will no longer abort with an error message if no audio, + video and subtitle tracks should be multiplexed. This allows copying of + chapters from non-chapter source files (e.g. Matroska or MP4 files). +* MKVToolNix GUI: the font size in the tool selector on the left will scale + with the font size the user selects in the preferences. +* MKVToolNix GUI: the GUI will no longer automatically resize the columns in + tree and list views to match the content size. Instead it remembers and + restores the widths set by the user. Implements #2353. +* MKVToolNix GUI: multiplexer: the chapter name template will now be set + automatically to the name template in the preferences' "chapter editor" + section. Additionally the option `--generate-chapters-name-template …` will + be passed to mkvmerge in situations when mkvmerge will generate chapters + (either because automatic generation is enabled or if chapters are generated + for MPLS playlists). Part of the implementation of #2275. +* MKVToolNix GUI: chapter editor: if the chapter name template is empty, + chapters will be generated without names. Part of the implementation of + #2275. +* MKVToolNix GUI: chapter editor: added an option to remove all chapter names + to the "additional modifications" dialog. Part of the implementation of + #2275. + +## Bug fixes + +* mkvmerge: Matroska reader: fixed wrong timestamps when appending Matroska + files where the second Matroska file's first timestamp is bigger + than 0. Fixes #2345. +* mkvmerge: MP4 reader: fixed division by zero errors during file + identification if the timescale is 0 in the `MVHD` atom. +* mkvmerge: Windows Television DVR files are now recognized as an unsupported + file type. This prevents mis-detection as MPEG-2 with an accompanying flood + of error messages. Fixes #2347. +* MKVToolNix GUI: info tool: under certain circumstances "cues" were shown at + the wrong level (inside the previous master element instead of on level + 1). Fixes #2361. +* MKVToolNix GUI: job queue: fixed invalid memory handling and consequent + crashes when using the "edit in corresponding tool & remove from job queue" + option if one of the files in that job contained attached files. Fixes + #2368. + +## Build system changes + +* An AppStream metadata file will be installed in `$prefix/share/metainfo`. + + +# Version 25.0.0 "Prog Noir" 2018-07-12 + +## New features and enhancements + +* mkvmerge: SRT/ASS/SSA text subtitles: for files for which no encoding has + been specified, mkvmerge will try UTF-8 first before falling back to the + system's default encoding. Part of the implementation of #2246. +* mkvmerge: SRT/ASS/SSA/WebVTT text subtitles: a warning is now emitted if + invalid 8-bit characters are encountered outside valid multi-byte UTF-8 + sequences. Part of the implementation of #2246. +* mkvmerge: Matroska & MPEG transport stream readers: the encoding of text + subtitles read from Matroska files can now be changed with the + `--sub-charset` parameter. +* Linux: starting with release 25 an AppImage will be provided which should + run on any Linux distribution released around the time of CentOS 7/Ubuntu + 14.04 or later. +* macOS: translations: updated the `build.sh` script to build `libiconv` and a + complete `gettext`. Together with an additional fix to how translation files + are located, MKVToolNix can now use all interface languages on macOS, + too. Fixes #2110, #2307, #2323. + +## Bug fixes + +* mkvmerge: AVC/H.264: fixed file identification failing for certain + elementary streams due to internal buffers not being cleared properly. Fixes + #2325. +* mkvmerge: HEVC/H.265: fixed file identification failing for certain + elementary streams due to internal buffers not being cleared properly. This + is the HEVC analog to what was fixed for AVC in #2325. +* mkvmerge: MLP code: fixed various issues preventing MLP from being parsed + correctly. Fixes #2326. +* mkvmerge: TrueHD/MLP packetizer; dialog volume normalization removal isn't + attempted if the track is an MLP track as the operation is only supported + for TrueHD, not MLP. +* mkvmerge: MPEG TS reader: when reading MPLS mkvmerge will now compare the + MPLS's start and end timestamps against the transport stream's PTS instead + of its DTS. Otherwise the first key frame of a video track might be dropped + if it isn't the first in presentation order. Fixes #2321. +* mkvmerge: JSON identification: mkvmerge will ensure that all strings passed + to the JSON output modules are valid UTF-8 encoded strings by replacing + invalid bytes with placeholder characters. This avoids the JSON library + throwing an exception and mkvmerge aborting on such data. Fixes #2327. +* mkvmerge: audio packetizers: mkvmerge will now keep discard padding values + if they're present for packets read from Matroska files. Fixes #2296. +* mkvmerge: Ogg Opus reader: packet timestamps aren't calculated by summing up + the duration of all packets starting with timestamp 0 anymore. Instead the + algorithm is based on the Ogg page's granule position and which packet + number is currently timestamped (special handling for the first and last + packets in the stream). + + * This fixes the first timestamp if the first Ogg packet's granule position + is larger than the number of samples in the first packet (= if the first + sample's timestamp is bigger than 0). mkvmerge will keep those offsets now + and inserts "discard padding" only where it's actually needed. + * It also improves handling of invalid files where the first Ogg packet's + granule position is smaller than the number of samples in the first packet + (= the first sample's timestamp is smaller than 0). mkvmerge will now + shift all timestamps up to 0 in such a case instead of inserting "discard + padding" elements all over the place. + * mkvmerge will no longer insert "discard padding" elements if the + difference between a) the calculated number of samples in the packet + according to the granule position and b) the actual number of samples as + calculated from the bitstream is one sample or less and if the packet + isn't the last one in the stream. This circumvents certain rounding + errors. + * The timestamp of the first packet after a gap in the middle of the stream + is now calculated based on the Ogg page the packet belongs to, and not + based on the timestamps before the gap. + + Fixes #2280. +* mkvmerge: complete rewrite of the progress handling. It's now based upon the + total size of all source files and the current position within them instead + of the number of frames/blocks to be processed. This simplifies calculation + when appending files and fixes rare cases of when progress report was + obvious wrong (e.g. stuck at 0% right until the end). Fixes #2150 and #2330. +* MKVToolNix GUI: header editor: non-mandatory elements couldn't be removed + anymore due to a regression while fixing #2320. They can now be removed + again. Fixes #2322. + + +# Version 24.0.0 "Beyond The Pale" 2018-06-10 + +## New features and enhancements + +* mkvmerge: MP4 reader: improved the detection of edit lists consisting of two + identical entries, each spanning the file's duration as given in the movie + header atom. The second entry is ignored in such cases. See #2306. +* mkvmerge: JSON identification: the "display unit" video track property is + now reported as `display_unit`. The JSON schema has been bumped to v11 for + this change. +* mkvmerge, mkvextract: AVC/H.264: empty NALUs will now be removed. +* mkvextract: VobSub extraction: empty SPU packets will now be dropped during + extraction as other tools such as MP4Box cannot handle them + correctly. Implements #2293. + +## Bug fixes + +* mkvmerge: E-AC-3 parser: fixed determining the number of channels for + streams that contain an AC-3 core with dependent E-AC-3 frames. Fixes #2283. +* mkvmerge: Matroska reader: fixed mkvmerge buffering the whole file if a + video track is multiplexed that consists of only one or a few frames. Fixes + #2304. +* mkvmerge: the "display unit" video track property will now be kept if it is + set in the source file. Fixes #2317. +* MKVToolNix GUI: multiplexer: when scanning playlists, all playlists were + offered for selection regardless of the value of the "minimum playlist + duration" setting. Fixes #2299. +* MKVToolNix GUI: multiplexer: deriving track languages from file names: the + regular sub-expressions for ISO 639-1 codes could match on empty strings, + too, causing matches in wrong places and hence no language being recognized + in certain situations. Fixes #2298. +* MKVToolNix GUI: header editor: fixed a crash when saving the file fails + (e.g. because it isn't writable). Fixes #2319. +* MKVToolNix GUI: header editor: the editor was wrongfully claiming that + mandatory elements with default values cannot be removed in the "status" + text. Fixes #2320. +* MKVToolNix GUI: preferences: on macOS & Linux the setting "enable copying + tracks by their type" wasn't restored on program start. Fixes #2297. + +## Other changes + +* Niels Lohmann's JSON library: the bundled version has been updated from + v1.1.0 (git revision 54d3cab) to v3.1.1 (git revision g183390c1). +* pugixml library: the bundled version has been updated from v1.8 to v1.9 (git + revision e584ea3). + + +# Version 23.0.0 "The Bride Said No" 2018-05-02 + +## New features and enhancements + +* mkvmerge: input: format detection uses file-extension to improve performance + and to give preference when several formats match. +* mkvmerge: AV1: added support for reading AV1 video from Open Bitstream Unit + files. +* mkvmerge: AV1: adjusted the code for the AV1 bitstream format changes made + up to 2018-05-02 (git revision d14e878). +* mkvmerge: MP4 reader: if a track has an edit list with two identical + entries, each spanning the file's duration as given in the movie header + atom, then the second entry will now be ignored. Improves the handling of + files with bogus data; see #2196 and #2270. +* MKVToolNix GUI: multiplexer: added options to only enable tracks of certain + types by default. Implements #2271. +* MKVToolNix GUI: multiplexer: added an option to enable dialog normalization + gain removal by default for all audio tracks for which the operation is + supported. Implements #2272. +* MKVToolNix GUI: multiplexer: when deriving track languages from the file + names is active and the file name contains the usual season/episode pattern + (e.g. "S02E14"), then only the part after the season/episode pattern will be + used for detecting the language. Part of the improvements for #2267. +* MKVToolNix GUI: multiplexer: the regular expression used for deriving track + languages from the file names can now be customized in the preferences. Part + of the improvements for #2267. +* MKVToolNix GUI: multiplexer: the user can now customize the list of track + languages the GUI recognizes in file names. This list defaults to a handful + of common languages instead of the full list of supported languages. Part of + the improvements for #2267. + +## Bug fixes + +* mkvmerge: MP3 packetizer: removed a memory leak growing linearly with the + track's size. +* mkvmerge: VobSub packetizer: whenever a VobSub packet doesn't contain a + duration on the container level, mkvmerge will now set it from the duration + in the SPU packets. Before it was accidentally setting the SPU-level + duration to 0 instead. Fixes #2260. +* mkvmerge: track statistics tags: if writing the `Date` element is + deactivated via `--no-date`, the `_STATISTICS_WRITING_DATE_UTC` isn't + written either anymore. Fixes #2286. +* mkvmerge, mkvextract, mkvpropedit: removed several small, constant-size + memory leaks. +* mkvextract: fixed a crash when mkvextract with a non-Matroska file as the + source file. Fixes #2281. +* MKVToolNix GUI: the central area is now scrollable, allowing the GUI to be + resized to almost arbitrary sizes. Fixes #2265. +* MKVToolNix GUI: multiplexer: the "copy file title to destination file name" + functionality will now replace everything in the destination file name up to + the last period instead of only up to the first period. Fixes #2276. + +## Build system changes + +* build system: MKVToolNix now requires a compiler that supports the following + features of the C++14 standard: "user-defined literals for + `std::string`". For the GNU Compiler Collection (gcc) this means v5.x or + newer; for clang it means v3.4 or newer. +* Windows: linking against and installing shared version of the libraries with + MXE is now supported by setting `configure`'s `host` triplet accordingly, + e.g. `--host=x86_64-w64-mingw32.shared`. + +## Other changes + +* mkvmerge: AV1: support for AV1 must be activated manually by adding + `--engage enable_av1` as the AV1 bitstream specification hasn't been + finalized yet. + + +# Version 22.0.0 "At The End Of The World" 2018-04-01 + +## New features and enhancements + +* mkvmerge, MKVToolNix GUI multiplexer: AC-3, DTS, TrueHD: added an option for + removing/minimizing the dialog normalization gain for all supported types of + the mentioned codecs. Implements #1981. +* mkvmerge: AV1: added support for reading AV1 video from IVF, WebM and + Matroska files. +* mkvmerge: FLAC: mkvmerge can now ignore ID3 tags in FLAC files which would + otherwise prevent mkvmerge from detecting the file type. Implements #2243. +* mkvinfo: the size and positions of frames within "SimpleBlock" and + "BlockGroup" elements are now shown the same way they're shown for other + elements (by adding the `-v -v` and `-z` options). +* MKVToolNix GUI: multiplexer: added options for deriving the track languages + from the file name by searching for ISO 639-1/639-2 language codes or + language names enclosed in non-word, non-space characters (e.g. "…[ger]…" + for German or "…+en+…" for English). Implements #1808. +* MKVToolNix GUI: info tool: implemented reading all elements in the file + after the first cluster. Only top-level elements are shown; child elements + are only loaded on demand. Implements the rest of #2104. +* MKVToolNix GUI: info tool: added a context menu with the option to show a + hex dump of the element with the bytes making up the EBML ID and the size + portion highlighted in different colors. In-depth highlighting is done for + the data in `SimpleBlock` and `Block` elements. +* MKVToolNix GUI: chapter editor: added an option to remove all end timestamps + to the "additional modifications" dialog. Implements #2231. + +## Bug fixes + +* mkvmerge: MP4 reader: fixed reading the ESDS audio header atom if it is + located inside a "wave" atom inside the "stsd" atom. +* mkvmerge: MP4 reader: AAC audio tracks signalling eight channels in the + track headers but only seven in the codec-specific configuration will be + treated as having eight channels. +* mkvmerge: MPEG TS reader: fixed wrong handling of the continuity counter for + TS packets that signal that TS payload is present but where the adaptation + field spans the whole TS packet. +* mkvmerge: the 'document type version' and 'document type read version' + header fields are now set depending on which elements are actually written, + not on which features are active (e.g. if a `SimpleBlock` is never written, + then the 'read version' won't be set to 2 anymore). Part of the fix for + #2240. +* mkvmerge: the 'document type version' header field is now set to 4 correctly + if any of the version 4 Matroska elements is written. Part of the fix for + #2240. +* mkvinfo: summary mode: the file positions reported for frames in + `BlockGroup` elements did not take the bytes used for information such as + timestamp, track number flags or lace sizes into account. They were + therefore too low. +* mkvpropedit, MKVToolNix GUI header editor: the 'document type version' and + 'document type read version' header fields are now updated if elements + written by the changes require higher version numbers. Part of the fix for + #2240. +* mkvpropedit, MKVToolNix GUI header editor: mandatory elements can now be + deleted if there's a default value for them in the specifications. Fixes + #2241. +* source code: fixed a compilation error on FreeBSD with clang++ 5.0. Fixes + #2255. + +## Build system changes + +* A compilation database (in the form of a file `compile_commands.json`) can + be built automatically if the variable `BUILD_COMPILATION_DATABASE` is set + to `yes` (e.g. as `rake BUILD_COMPILATION_DATABASE=yes`). + + +# Version 21.0.0 "Tardigrades Will Inherit The Earth" 2018-02-24 + +## New features and enhancements + +* mkvmerge: track statistics tags: the `TagDefault` element will not be + written anymore as it was always set to the default value `1` + anyway. Implements #2202. +* mkvmerge, MKVToolNix GUI: JSON files can now contain C++-style line comments + outside of strings (e.g. something like this: `// this is ignored`). Such + comments, even though not part of the official JSON specifications, are now + ignored when reading JSON files. +* MKVToolNix GUI: chapter editor: opening a Matroska file without chapters in + it will now open the file in an empty chapter editor instead of showing an + error message. Implements #2218. +* MKVToolNix GUI: an "info" tool has been added, replacing the functionality + of mkvinfo's GUI. The functionality is not on par yet but will be for + release v22. Implements most of the functionality of #2104. + +## Bug fixes + +* build system: `configure` was treating `--disable-ubsan` and + `--disable-addrsan` the same as `--enable-ubsan` and + `--enable-addrsan`. Fixes #2199. +* build system: an error message is output if a command to execute is not + found instead of silently failing. +* build system: in addition to looking for the `gettext` C function and + library, `configure` now also verifies the presence of the `msgfmt` program + instead of simply relying on it. +* mkvmerge: appending files with additional parts at the same time was broken + if more than one additional part was appended (e.g. when appending files + from DVDs with something like `'(' VTS_01_1.VOB VTS_01_2.VOB ')' + '(' + VTS_02_1.VOB VTS_02_2.VOB ')'`). In such a situation the content from files + `VTS_02_1.VOB` and `VTS_02_2.VOB` where laid out in parallel to the content + from the earlier files. +* mkvmerge: FLV reader: a single invalid AAC frame was written for AAC audio + tracks with codec initialization data longer than five bytes. +* mkvmerge: FLV reader: timestamps will be normalized down to 0. Fixes #2220. +* mkvmerge: MP4 reader: if an AAC track doesn't contain an AAC-specific + decoder configuration in the ESDS portion, then a default decoder + configuration will be generated based on the track's header data instead of + skipping the track. Fixes #2221. +* mkvmerge: MP4 reader: fixed reading HEVC/H.265 video tracks if they're + stored as Annex B byte streams inside MP4. Fixes #2215. +* mkvmerge: Ogg Opus reader: mkvmerge will now emit a warning instead of + aborting when it encounters an Ogg Opus page with no data in the + packet. Fixes #2217. +* mkvmerge, mkvextract: Matroska parser: fixed a segmentation fault that + occurred whenever the first level 1 element after resyncing after an error + in the file structure isn't a cluster. Fixes #2211. +* mkvmerge, MKVToolNix GUI multiplexer & header editor: fixed a crash during + file type detection for attachments if MKVToolNix is installed in a path + with non-ASCII characters (e.g. German Umlauts). Fixes #2212. +* mkvinfo: the `--hex-positions` parameter did nothing in summary mode. +* mkvinfo: Windows: line endings will be written as `\r\n` (carriage return & + line feed) again instead of just `\n` (line feed). +* mkvpropedit: adding track statistics tags: for tracks with content encoding + (compression) mkvpropedit is now accounting the uncompressed number of + bytes, not the encoded (compressed) number of bytes. Fixes #2200. +* MKVToolNix GUI: multiplexer: the subtitle character set can now be set for + appended subtitle files, too. Fixes #2214. +* MKVToolNix GUI: multiplexer: when appending, all tracks appended to disabled + tracks will start out disabled, too. + +## Build system changes + +* mkvinfo: the GUI portion has been removed. mkvinfo is now a pure + command-line program again. + + +# Version 20.0.0 "I Am The Sun" 2018-01-15 + +## Important notes + +* Feature removal: several deprecated features have been removed: + + * mkvmerge: the deprecated options `--identify-verbose` (and its counterpart + `-I`), `--identify-for-gui`, `--identify-for-mmg` and + `--identification-format verbose-text` + * all command line tools: support for the deprecated, old, proprietary format + used for option files + * all command line tools: support for passing command line options via the + deprecated environment variables `MKVTOOLNIX_OPTIONS`, `MKVEXTRACT_OPTIONS`, + `MKVINFO_OPTIONS`, `MKVMERGE_OPTIONS` and `MKVPROPEDIT_OPTIONS` + +* mkvinfo: most of its code was re-written in order to lay the groundwork for + including its functionality in MKVToolNix GUI but with more features than + the existing mkvinfo GUI. The result is that a lot of its output has been + changed slightly while keeping the basic layout. Changes include but aren't + limited to: + + * Several element names are a bit clearer (e.g. `Maximum cache` instead of + `MaxCache`). + * All timestamps and durations are now output as nanoseconds in formatted + form (e.g. `01:23:45.67890123`). All additional formats (e.g. floating + point numbers output in seconds or milliseconds) were removed. + * Element names for chapters and tags are now translated if a translation is + available. + * Elements located in wrong positions within the Matroska document are + handled better. + + While mkvinfo's output is mostly kept very stable, it is not designed to be + parsed by other utilities. Even though I've tried hard to cram all changes + and cleanups into this version, additional changes may be made in the next + couple of releases depending on user feedback and bug reports. + +## New features and enhancements + +* mkvmerge: AVC/H.264 packetizer (framed): access unit delimiter NALUs will + now be removed. Implements #2173. + +## Bug fixes + +* mkvmerge: AVC/H.264 parser: when fixing the bitstream timing information + mkvmerge will now use exact representations of the desired field duration if + possible. For example, when indicating 50 fields/second `num_units_in_tick` + is set to 1 and `time_scale` to 50 instead of 5368709 and 268435456. Part of + the fix for #1673. +* mkvmerge: AVC/H.264 parser: mkvmerge no longer assumes that encountering + sequence parameter set or picture parameter set NALUs signal the start of a + new frame. Fixes #2179. +* mkvmerge: AVC/H.264 packetizer (framed): when mkvmerge is told to fix the + bitstream timing information, it will now update all SPS NALUs, not just the + ones in the AVCC. Part of the fix for #1673. +* mkvmerge: MPEG TS reader: TS packet payloads will only be treated as PES + packets if the payload actually starts with a PES start code. The prior + behavior led to wrong timestamps and potentially broken frame data. Fixes + #2193. +* mkvmerge: MPEG TS reader: mkvmerge will now drop incomplete PES packets as + soon as an error is detected in the transport stream instead of passing the + incomplete frame to the packetizer. An error is assumed either if the + `transport_error_indicator` flag is set or if the value of the + `continuity_counter` header field doesn't match the expected value. Fixes + #2181. +* mkvmerge: Opus: when re-muxing Opus from Matroska mkvmerge will now write + "block duration" elements for all block groups where a "discard padding" is + set, too. Fixes #2188. +* mkvmerge: SRT reader: mkvmerge can now handle SRT files with timestamps + without decimal places (e.g. `00:01:15` instead of `00:01:15.000`). +* mkvmerge: read buffer I/O class: the class could get out of sync regarding + the file position of the underlying file I/O class causing wrong data to be + returned on subsequent read operations. One result was that trying to + identifying MPLS files that refer to very short M2TS files caused mkvmerge + to segfault. +* mkvmerge: multiplexer core: if there's a gap in audio timestamps, a new + block group/lace will be started for the first frame after each gap. Before + the fix the frame after the gap was often stored in the previous block group + causing the gap to be in the wrong place: at the end of that block + group. Fixes #1700. +* mkvextract: AVC/H.264: if two consecutive IDR frames with the same + `idr_pic_id` parameter and no access unit delimiters are found between them, + mkvextract will insert an access unit delimiter in order to signal the start + of a new access unit. Fixes #1704. +* MKVToolNix GUI: update check dialog: Markdown links will now be converted to + clickable links. Fixes #2176. +* build system: fixed a race condition when creating new directories if `rake` + is run with `-jN` in newer versions of Ruby/`rake`. Fixes #2194. + +## Build system changes + +* [cmark](https://github.com/commonmark/cmark), the CommonMark parsing and + rendering library in C, is now required when building the GUIs. + + +# Version 19.0.0 "Brave Captain" 2017-12-17 + +## Important notes + +* The MKVToolNix project now contains a + [Code of Conduct](https://mkvtoolnix.download/doc/CODE_OF_CONDUCT.md). +* The MKVToolNix project's source code repository, bug tracker and wiki have + been moved to [GitLab](https://gitlab.com/mbunkus/mkvtoolnix/). + +## New features and enhancements + +* mkvmerge: splitting by duration, by timestamps or by timestamp-based parts: + mkvmerge will now consider the first key frame within 1ms of the requested + value to be eligible for splitting. +* MKVToolNix GUI: the GUI will now save and restore the widths of columns in + tree and list views. Implements #2057. +* MKVToolNix GUI: header editor: when closing or reloading a modified file, + the GUI will now focus the first element that's been modified before asking + the user for confirmation regarding discarding unsaved changes. + +## Bug fixes + +* mkvmerge: fixed reading text files encoded in UTF-16 order UTF-32 that have + different forms of line endings (new lines, carriage returns or a mix of + both). Fixes #2160. +* mkvmerge: MP4 reader: fixed mkvmerge's interpretation of edit list entries + with `segment_duration == 0` when there's more than one edit list entry. In + that case mkvmerge was reading the whole content more than once. Fixes + #2152. +* mkvmerge, GUI's multiplexer: MIME types: added the `font` top-level media + types from RFC 8081. This means that the following new MIME types for fonts + can be used: `font/ttf`, `font/otf`, `font/woff` and `font/woff2`. +* mkvmerge: MPEG transport stream reader: fixed slow speed on Windows due to + lack of buffering. +* mkvextract: fixed slow track extraction speed on Windows due to lack of + buffering. Fixes #2166. +* MKVToolNix GUI: multiplexer: changing the "subtitle/chapter character set" + drop-down was ignored when the selected track was a chapter track. Fixes + #2165. +* MKVToolNix GUI: multiplexer: once a "subtitle/chapter character set" was set + for a track it couldn't be changed back to the empty entry (= + auto-detection) anymore. +* MKVToolNix GUI: header editor: fixed re-translating several displayed + strings when the GUI language is changed if the language the GUI was started + with was not English. Fixes #2159. +* MKVToolNix GUI: header editor: whenever a file did not contain a "date" + element in its segment information section, the GUI would erroneously ask + the user to confirm discarding unsaved changes when closing or reloading the + tab. Fixes #2167. +* MKVToolNix GUI: job queue: jobs are now saved when their status changes in + addition to when the program exits. Fixes #2168. + + +# Version 18.0.0 "Apricity" 2017-11-18 + +## New features and enhancements + +* build system: when building with clang v3.8.0 or newer, `configure` will no + longer restrict optimization flags to `-O1` and use `-O3` again (older + versions of clang suffered from excessive memory usage with higher + optimization levels). +* build system: when building with mingw 7.2.0 or newer, `configure` will no + longer restrict optimization flags to `-O2` and use `-O3` again (older + versions of mingw suffered from bugs such as segmentation faults with higher + optimization levels). +* build system: stack protection is enabled when building with clang 3.5.0 or + newer on all platforms. +* mkvmerge: AVC/H.264 & HEVC/H.265 ES parsers: performance improvements by + copying much less memory around. +* mkvmerge: tags: reintroduced a workaround for non-compliant files with tags + that do not contain the mandatory `SimpleTag` element. This workaround was + removed during code refactoring in release v15.0.0. +* GUI: multiplexer: the "AAC is SBR/HE-AAC/AAC+" checkbox in the "audio + properties" section will be disabled if the functionality is not implemented + for the selected track's codec & container. +* GUI: multiplexer: the "reduce to core" checkbox in the "audio properties" + section will be disabled if the functionality is not implemented for the + selected track's codec. See #2134. + +## Bug fixes + +* mkvmerge: AAC ADTS parser: fixed interpretation of the + `channel_configuration` header element for ADTS files that do not contain a + program configuration element: value 7 means 7.1 channels. Fixes #2151. +* mkvmerge: Matroska identification: the `date_local` and `date_utc` + attributes will only be output if the identified Matroska file actually + contains the "date" header field. +* mkvmerge: WebVTT: mkvmerge did not recognize timestamp lines if the hours + components were absent. Fixes #2139. +* mkvpropedit, GUI's header editor: the `date` header field won't be added + automatically anymore whenever the segment info section is edited and the + `date` element is either deleted or not present in the first place. Fixes + #2143. + + +# Version 17.0.0 "Be Ur Friend" 2017-10-14 + +## Important notes + +* The word "timecode" has been changed to "timestamp" everywhere it was + used in MKVToolNix. This affects program output (including mkvinfo's), GUI + controls, command line parameters (e.g. `mkvmerge --timestamp-scale …`) and + file formats. All programs remain backwards compatible insofar as they still + accept "timecode" in all those places (e.g. `mkvmerge --timecode-scale …`). + + The reason for the change is wrong usage. What both the Matroska specification + and MKVToolNix used "timecode" for is normally called a "timestamp" in audio & + video domains. A "timecode" on the other hand has a specific meaning. As the + Matroska specification is moving towards implementing real timecodes, it will + also move towards correcting the verbiage. MKVToolNix is following this + change. + +* mkvextract's command line interface has been changed to allow extraction of + multiple items at the same time. The first argument must now be the source + file's name. All following arguments either set the mode (e.g. `tracks`) or + specify what to extract in the currently active mode. + + Those items that were written to the standard output (chapters, tags and cue + sheets) are now always written to files instead. Therefore the respective + modes require an output file name. + + For example, extracting two tracks, the chapters and the tags can be done + with the following command: + + `mkvextract input.mkv tracks 0:video.h265 1:audio.aac chapters chapters.xml tags tags.xml` + + The old interface (specifying the mode first and the source file name + second) remains working and supported. However, it is now deprecated and + will be removed at the end of 2018. + +## New features and enhancements + +* mkvmerge: AC-3: during identification regular AC-3 and E-AC-3 tracks will + now be identified differently for most container formats (exception: AVI, + Real Media, Ogg/OGM). The codec will be reported as `AC-3` for regular AC-3 + and as `E-AC-3` for E-AC-3 tracks instead of the combined `AC-3/E-AC-3`. +* mkvextract: the command line interface has been changed to allow extraction + of multiple items at the same time. See section "Important notes" for details. + +## Bug fixes + +* mkvmerge: AAC ADTS parser: mkvmerge will now parse the + `program_config_element` if it is located at the start of an AAC frame in + order to determine the actual number of channels. This overrides invalid + channel configurations in the ADTS headers, for example. Fixes #2107. +* mkvmerge: fixed AC-3 being misdetected as encrypted MPEG program streams + under certain conditions. +* mkvmerge: Dirac: under certain conditions (e.g. only muxing a single Dirac + track without any other tracks) mkvmerge was always setting the pixel width + & height to 123. The frame rate was wrong, too. +* mkvmerge: E-AC-3 in Matroska: if AC-3 cores and their corresponding E-AC-3 + extension are located in two different Matroska blocks, then mkvmerge will + now re-assemble them into a single block and only use the first block's + timestamp. +* mkvmerge: SRT reader: fixed calculating the duration of entries starting + with at a negative timestamp. +* mkvmerge: VC-1: under certain conditions (e.g. only muxing a single VC-1 + track without any other tracks) mkvmerge was always setting the pixel width + & height to 123. The frame rate was wrong, too. Fixes #2113. +* mkvmerge: command line options: an error message will be output if the + single-value-form of the `--sync` option is used and it isn't a number + (e.g. `--sync 0:asd`). Fixes #2121. +* mkvpropedit, GUI's header editor: both programs will now show proper error + messages instead of crashing when certain kinds of data corruption is found + when reading a file. Fixes #2115. + + +# Version 16.0.0 "Protest" 2017-09-30 + +## New features and enhancements + +* mkvmerge: MP4 reader: added support for Vorbis. Implements #2093. + +## Bug fixes + +* configure: the checks for libEBML and libMatroska have been fixed to require + libEBML 1.3.5 and libMatroska 1.4.7 as intended. +* mkvmerge: AAC reader: mkvmerge will now emit an error message for AAC files + whose header fields imply a sampling frequency or number of channels + of 0. See #2107. +* mkvmerge: AVC/H.264 ES parser: fixed the calculation of reference + information for P and B frames. This also fixes some P frames being marked + as B frames and vice versa. +* mkvmerge: AVC/H.264 ES parser: only non-key frames that have the NALU header + field `nal_ref_idc` set to 0 will be marked as "discardable" in + `SimpleBlock` elements. Other half of the fix for #2047. +* mkvmerge: HEVC/H.265: the generation of the HEVCC structure stored in + `CodecPrivate` was wrong in two places: 1. the position of the number of + sub-layers was swapped with reserved bits and 2. the VPS/SPS/PPS/SEI lists + did not start with a reserved 1 bit. +* mkvmerge: output: the `doc type version` will be set at least to 2 if + certain elements are written (`CodecState`, `CueCodecState`, + `FlagInterlaced`). +* mkvmerge: output: the track header attributes `MinCache` and `MaxCache` will not be + written anymore. Fixes #2079. +* mkvmerge: Matroska reader: the "key" and "discardable" flags of SimpleBlock + elements will be kept as they are. Partial fix for #2047. +* mkvmerge: Matroska reader: if present in the file, the "white color + coordinate x" track header attribute was written to both "white color + coordinate x" and "white color coordinate y" in the output file. +* mkvmerge: Opus output: mkvmerge will now put all frames with discard padding + into their own block group. Fixes #2100. +* MKVToolNix GUI: header editor: removed the check for external modification + when saving the file. Fixes #2097. +* MKVToolNix GUI: job queue: fixed calculation of total progress when + automatic removal of completed is enabled. Fixes #2105. + +## Build system changes + +* libEBML v1.3.5 and libMatroska v1.4.8 are now required. In fact v15.0.0 + already requires libEBML v1.3.5 and libMatroska v1.4.7 but did not include + proper version checks for them (nor was there a NEWS.md entry for the new + libMatroska requirement). New is the requirement for libMatroska v1.4.8 due + to it fixing writing block groups for tracks with the track number 128 (see + #2103). + + +# Version 15.0.0 "Duel with the Devil" 2017-08-19 + +## Important notes + +* mkvmerge, mkvpropedit, GUI's header and chapter editors: the programs will + no longer add most missing Matroska elements that are mandatory but have a + default value in the Matroska specification (e.g. the `TagLanguage` element + with a value of `und` if it isn't present in its `SimpleTag` parent). Due to + this change libEBML v1.3.5 is now required. + +## New features and enhancements + +* MKVToolNix GUI: multiplex tool: added a new entry to the "source files" + context menu labeled "Set destination file name from selected file's + name". It will force the GUI to consider the selected file to be the + reference for automatically setting the file name, no matter which file was + originally added as the first file. It will also force setting the + destination file name once if automatic destination file name generation is + turned off in the preferences. Implements part of #2058. +* MKVToolNix GUI: multiplex tool: added an option in the preferences on + "Multiplexer" → "Output" labeled "Only use the first source file that + contains a video track". If enabled, only source files containing video + tracks will be used for setting the destination file name. Other files that + are added are ignore. Implements the rest of #2058. +* MKVToolNix GUI: header editor: added support for editing the video color + attributes. Implements the second half of #2038. +* MKVToolNix GUI: header editor: added support for the "video projection" + track header attributes. Part of the implementation of #2064. +* MKVToolNix GUI: job queue: selected jobs can now be move up and down by + pressing the `Ctrl+Up` and `Ctrl+Down` keys. Additionally, push buttons to + move them up & down are shown if the corresponding option is enabled in the + preferences. Implements #2060. +* mkvmerge: added support for the "video projection" track header + attributes. Part of the implementation of #2064. +* mkvinfo: added support for the "video projection" track header + attributes. Part of the implementation of #2064. +* mkvpropedit: added support for editing the video color + attributes. Implements one half of #2038. +* mkvpropedit: added support for the "video projection" track header + attributes. Part of the implementation of #2064. + +## Bug fixes + +* all: selecting the program's language (e.g. via the `--ui-language` + command-line option or via the GUI's preferences) did not work on Linux & + Unix if the `LANGUAGE` environment variable was set and didn't include the + desired language. Fixes #2070. +* MKVToolNix GUI: removed the keyboard shortcuts for switching between the + different tools (e.g. `Ctrl+Alt+1` for the multiplexer). They overlapped + with basic functionality on keyboards that use an `AltGr` key, e.g. German + ones, where `AltGr+7` emits `{`. As `AltGr+key` is implemented as + `Ctrl+Alt+key` under the hood, this means that `AltGr+7` is really + `Ctrl+Alt+7` which the GUI now took to mean "switch to the job queue" + instead of "insert `{`". Fixes #2056. +* MKVToolNix GUI: header editor: after saving the file the GUI wasn't updating + its internal file modification timestamp. That lead to the GUI wrongfully + claiming that the file had been modified externally when the user wanted to + save the file once more, requiring a reload of the file losing all + modifications made since saving the first time. +* mkvmerge: DTS handling: some source files provide timestamps for audio + tracks only once every `n` audio frames. In such situations mkvmerge was + buffering too much data resulting in a single gap in the timestamps of one + frame duration after frame number `n - 1` (the second audio timestamp read + from the source file was used one output frame too early). Fixes #2071. +* mkvinfo: fixed a null pointer dereference if an `EbmlBinary` element's data + pointer is a null pointer. Fixes #2072. + +## Build system changes + +* configure: added option `--disable-update-check`. If given, the code + checking online for available updates will be disabled. The update check is + enabled and included in the GUI by default. +* libEBML v1.3.5 is now required. + +## Other changes + +* mkvmerge: the option `--color-matrix` has been renamed to + `--color-matrix-coefficients` in order to match the specification more + closely. The old option name will continue to be recognized as well. + + +# Version 14.0.0 "Flow" 2017-07-23 + +## New features and enhancements + +* mkvmerge: AAC: implemented support for AAC with 960 samples per + frame. Implements #2031. +* mkvmerge: identification: if the encoding/character set of a text subtitle + track is known (e.g. because a byte order mark is present in the file), then + it will be output during identification as the `encoding` + property. Implements mkvmerge's part of #2053. +* mkvmerge: WAV reader: added support for Wave64 files. Implements #2042. +* mkvmerge, mkvpropedit, MKVToolNix GUI (chapter editor): added support for + chapters in WebM files that is spec-compliant by removing all tag elements + not supported by the WebM spec. Implements #2002. +* mkvpropedit: added support for tags in WebM files that is spec-compliant by + removing all tag elements not supported by the WebM spec. +* MKVToolNix GUI: multiplexer: if the encoding/character set of a subtitle + track cannot be changed, the GUI will deactivate the "subtitle character + set" drop-down box and ignore changes to it when multiple tracks are + selected. Additionally, if the track's encoding is known and cannot be + changed (e.g. due to a byte order mark in the file), that encoding will be + selected in the drop-down box automatically. Both changes signal to the user + that she doesn't have to take care of the encoding herself. Implements the + GUI's part of + #2053. +* MKVToolNix GUI: chapter editor: added a function to the "additional + modifications" dialog for calculating and setting the end + timestamps. Implements #1887. +* MKVToolNix GUI: changed the shortcuts for switching between the various + tools from `Alt+number` (e.g. `Alt+1` for the multiplexer tool) to + `Ctrl+Alt+number` in order to avoid clashing with Windows' input method for + arbitrary characters (pressing and holding `Alt` and typing the codepoint on + the number pad). Implements #2034. +* MKVToolNix GUI: added a "Window" menu and entries with shortcuts for + selecting the next (`Ctrl+F6`) respectively previous tab (`Ctrl+Shift+F6`) + in the current tool. Implements #1972, #2032. +* MKVToolNix GUI: on Windows the GUI will now determine the default font to + use by querying Windows for the default UI/message box font instead of using + the hardcoded `Segoe UI`. This might fix issues such as #2003 (unverified). +* translations: added a Romanian translation of the programs by Daniel (see + AUTHORS). + + +## Bug fixes + +* mkvmerge: AVC/H.264 parser: fixed wrong frame order & timestamp calculation + in certain situations when SPS (sequence parameter sets) or PPS (picture + parameter sets) change mid-stream. Fixes #2028. +* mkvmerge: HEVC/H.265 parser: fixed wrong frame order & timestamp calculation + in certain situations when SPS (sequence parameter sets) or PPS (picture + parameter sets) change mid-stream. This is the HEVC/H.265 equivalent of + #2028. +* mkvmerge: MPEG-1/-2 video: the "remove stuffing bytes" feature introduced in + v5.8.0 (feature request #734) was broken. In a lot of situations it did not + detect the end of a slice correctly and removed 0 bytes that were actually + part of the slice structure. Often there were no visual problems as decoders + were able to ignore such errors, but in other cases there are visual + artifacts upon decoding. As detecting the slice end properly requires + parsing the whole slice structure, this feature has been removed + again. Fixes #2045. +* mkvmerge: MPEG PS reader: fixed mkvmerge trying to handle an "end" code the + same way as a "program stream map" code. +* mkvmerge: MPEG TS reader: mkvmerge won't emit warnings if the system's + `iconv` library doesn't support the ISO 6937 character set. Fixes #2023. +* mkvmerge: when appending fails the error message details (e.g. "the number + of channels differs: 1 and 2") were often not output. Fixes #2046. +* MKVToolNix GUI: multiplex tool: implemented a workaround for a crash that + could occur during drag & drop if at least one of the columns is + hidden. Fixes #2009. +* MKVToolNix GUI: multiplex tool: appended tracks can no longer be enabled + (selected for multiplexing) if the track they're going to be appended to is + not enabled. Fixes #2039. +* MKVToolNix GUI: multiplex tool: if the GUI is set to ensure unique output + file names, it will now verify that right before starting to + multiplex/adding the job to the queue, too. Fixes #2052. +* MKVToolNix GUI: fixed the total progress reverting to 0% instead of staying + at 100% when all jobs have finished. This was introduced by the attempt at + fixing the computation of the value of total progress bar for multiple jobs + running. Fixes #2005. +* configure: fixed DocBook detection if `/bin/sh` is `dash`. Patch by Steve + Dibb. Fixes #2054. + +## Build system changes + +* Boost: the minimum required version has been bumped to 1.49.0. Earlier + releases fail to build on my current systems and will therefore not be + supported anymore. +* configure: when looking for the "nlohnmann JSON" include files configure + will now try the path "nlohmann/json.hpp" first, "json.hpp" second (only + "json.hpp" was tried before). If neither is found, the copy included in the + MKVToolNix sources will be used. Fixes #2048. + + +# Version 13.0.0 "The Juggler" 2017-06-25 + +## New features and enhancements + +* mkvmerge: MPEG TS reader: information about multiple programs will be output + as container properties during verbose/JSON identification. See #1990 for + the use case. +* MKVToolNix GUI: multiplex tool: added a column "program" to the tracks + list. Certain container types such as MPEG transport streams can contain + multiple programs. The new column will contain the service name (think TV + station names such as "arte HD") for such streams. Implements the GUI part + of #1990. +* MKVToolNix GUI: multiplex tool: the dialog asking the user what to do with + dropped files (add to current settings, add to new settings etc.) now + remembers the previous decision and defaults to it the next time it's + shown. Implements #1997. +* MKVToolNix GUI: tabs can now be closed by pressing the middle mouse + button. Implements #1998. + +## Bug fixes + +* mkvmerge: MP4 reader: MPEG-1/2 video read from MP4 files was written with an + invalid codec ID (e.g. `V_MPEG7`) in certain cases. Fixes #1995. +* mkvmerge: MPEG PS reader: made the file type detection less strict so that + garbage at the start of the file doesn't prevent detection. Fixes #2008. +* mkvmerge: MPEG PS reader: (E-)AC-3 tracks were not detected if the very + first packet for that track didn't contain a full (E-)AC-3 frame. Fixes + #2016. +* mkvmerge: MPEG TS reader: fixed mkvmerge not detecting all tracks in MPEG + transport streams containing multiple programs. Fixes one part of #1990. +* mkvmerge: MPEG TS reader: fixed track content being broken for some tracks + read from MPEG transport streams containing multiple programs. Fixes another + part of #1990. +* mkvmerge: JSON identification: the `stream_id` and `sub_stream_id` track + properties were output as hexadecimal strings instead of unsigned + integers. As the `ts_pid` track property was only used for MPEG transport + streams, its value is now output as `stream_id` instead, and the `ts_pid` + property has been removed. The JSON schema version has been bumped to 8 due + to this change. +* mkvmerge: fixed a crash when appending video tracks where one track has a + CodecPrivate member and the other one doesn't. +* mkvmerge: track statistics tags: the `NUMBER_OF_BYTES` tag is supposed to + contain the number of bytes in a track before any of the content encoding + schemes such as lossless compression is applied; however, mkvmerge was + wrongfully using the number of bytes after the schemes had been + applied. Fixes #2022. +* mkvmerge: CLPI & MPLS parsers: MPLS and CLPI files with version number + `0300` as used on Ultra HD Blu-ray Discs are now accepted as well. Fixes + #2010. +* mkvpropedit: fixed a crash when the selector used for `--tags` is invalid. +* MKVToolNix GUI: fixed computation of value of total progress bar for multiple + jobs running. Fixes #2005. +* MKVToolNix GUI: multiplexer, adding new attachments: when the GUI checks if + there's an attachment with the same name it will now disregard disabled + attached files. Fixes #2001. +* Debian/Ubuntu packaging: during a `dpkg-buildpackage` run the test suite was + failing when a non-English locale was active and MKVToolNix packages had + already been installed. Fixes #2011. + + +# Version 12.0.0 "Trust / Lust" 2017-05-20 + +## New features and enhancements + +* MKVToolNix GUI: the key combination Ctrl+Shift+Space will now toggle the + selection of the current item in all tree views where multiple selections + are allowed. Implements #1983. +* MKVToolNix GUI: chapter editor: added the extension `*.cue` (for cue sheet + files) to the "open chapter file" dialog. +* mkvmerge: cue sheet parser: if the cue sheet contains a non-empty `TITLE` + entry and if no other segment title has been set yet, then the segment title + will be set to the cue sheet's `TITLE` value. Implements #1977. +* mkvmerge, MKVToolNix GUI (multiplexer): added an option `--no-date` that + prevents the "date" field from being written to the segment information + headers. Implements one half of #1964. +* mkvpropedit, MKVToolNix GUI: header editor: added support for editing the + "date" segment information field. Implements the other half of #1964. + +## Bug fixes + +* MKVToolNix GUI: preferences → job actions, type "play audio file": the GUI + will no longer clear the audio file name input if the user aborts the audio + file selection dialog. +* MKVToolNix GUI: preferences → job actions, type "play audio file", on + Windows: the default "play audio" action was pointing to the wrong + directory. Existing configurations with such a wrong path will be fixed + automatically upon starting the GUI. Fixes #1956. +* mkvmerge: HEVC/H.265 parser: fixed the superfluous copying of the + `bitstream_restriction_flag` and its dependent flags in the VUI parameters + of the sequence parameter sets if the timing information is present, + too. This fixes #1924 properly, and it also fixes #1958. +* mkvmerge: MPEG TS reader, AAC parser: the MPEG TS reader will now force the + AAC parser to use the multiplex mode that the MPEG TS reader has detected + (e.g. LOAS/LATM). This prevents the AAC packetizer from mis-detecting it in + its own attempt to identify the mode. Fixes #1957. +* mkvmerge: MPEG TS reader: valid MPEG transport streams that start with an + H.264/H.265 start code (e.g. a file created by cutting at an arbitrary + position) were not recognized as a supported file type. +* mkvmerge: MPEG TS reader: fixed a potential read access from invalid memory + addresses in the code parsing the program map table (PMT). +* mkvmerge: MPEG TS reader: if packets are encountered that belong to a PID + not listed in the program map table (PMT), mkvmerge will attempt to + determine their type and codec from the content. This supported content + types are AAC (ADTS only) and AC-3. Fixes #1980. +* mkvmerge: MP4 reader: fixed finding and parsing the `colr` atom if there are + more than one video extension atoms and the `colr` atom is not the first + one. +* mkvmerge: MP4 reader: the `nclx` color type of the `colr` atom is now + recognized, too (as defined by ISO/IEC 14496-12, "ISO base media format"). +* configure: fixed configure aborting if a `moc`, `uic`, `rcc` or `qmake` + binary is found, but the binary's version is too old. Fixes #1979. + + +# Version 11.0.0 "Alive" 2017-04-22 + +## New features and enhancements + +* mkvmerge: FLAC reader: added support for handling embedded pictures as + attachments. Implements #1942. +* mkvmerge: MP4 reader: merged pull request #1804 adding support for parsing + the "COLR" atom and including its values as track headers. +* MKVToolNix GUI: watch jobs: the user can now have the GUI execute an action + once as soon as the current job or the whole queue finishes. The actions are + the same ones that can be configured to be run automatically after job or + queue completion. +* MKVToolNix GUI: implemented several built-in actions that can be executed + either on special events or once via the "watch jobs" tool. These are: + playing an audio file (implemented for all operating systems); hibernating, + sleeping and shutting down the computer (only implemented for Windows and + for Linux systems using systemd). +* MKVToolNix GUI: multiplex tool: added a new option for what to do after + starting to multiplex/adding to the job queue: "close current settings" will + close the current multiplex settings without opening new ones. + +## Bug fixes + +* mkvmerge: AAC parser: fixed mis-detection of certain data as valid ADTS AAC + headers resulting in memory allocation failures. Fixes #1941. +* mkvmerge: AVC/H.264 parser: mkvmerge will now ignore bogus timing + information in the sequence parameter sets (values indicating more than + 100000 progressive frames per second). Fixes #1946. +* mkvmerge: AVC/H.264 & HEVC/H.265 parsers: all trailing zero bytes will now + be removed from NALUs. Fixes #1952. +* mkvmerge: HEVC/H.265 parser: fixed copying the `bitstream_restriction_flag` + and all dependent fields in the VUI parameters of the sequence parameter + sets. Fixes #1924. +* mkvmerge: HEVC/H.265 parser: fixed the calculation of the number of + parameter set arrays in the HEVCC data structure stored in + CodecPrivate. Fixes the video-related part of #1938. +* mkvmerge: HEVC/H.265 parser: fixed writing superfluous and uninitialized + bytes at the end of the HEVCC data structure stored in CodecPrivate. Another + fix for the video-related part of #1938. +* mkvmerge: HEVC/H.265 parser: fixed the assumption that the HEVCC data + structure always includes arrays for all parameter set types (VPS, SPS, PPS + and SEI), and that the order is always VPS → SPS → PPS → SEI. Instead now + only the arrays actually present are parsed, and they can be in any order. + This fixes mkvinfo's output for Matroska files created from files such as + the one from #1938. +* mkvmerge: AVC/H.264 packetizer: when reading a framed track (e.g. from + Matroska or MP4 files), specifying a default duration as fields (e.g. `50i`) + would result in double the actual duration for each frame and the track's + default duration header field. Fixes #1916. +* mkvmerge: Matroska reader: invalid track language elements are now treated as + if they were set to `und` = "undetermined". See #1929 for context. +* mkvmerge: MPEG TS reader, AAC: mkvmerge will now require five consecutive + AAC headers with identical parameters before track type determination is + considered valid. This avoids false positives and consequently wrong track + parameters. Fixes the audio-related part of #1938. +* mkvmerge: fixed an endless loop in certain circumstances when splitting by + `parts` or `parts-frames` and the start of the file is discarded. Fixes + #1944. +* MKVToolNix GUI: multiplexer tool: the "show command line" dialog will no + longer include the mkvmerge executable's location as the first argument for + the two "MKVToolNix option files" escape modes. Fixes #1949. +* MKVToolNix GUI, header editor: empty track language elements are now treated + the same as those set to invalid ISO 639-2 codes: as if they were set to + `und` = "undetermined". See #1929 for context. + +## Build system changes + +* bug fix: configure now looks for the `strings` binary by using the + `AC_CHECK_TOOL()` autoconf macro. That way it will be found in multiarch + setups, too. Fixes #1923. +* bug fix: the environment variable USER_CXXFLAGS was accidentally removed + from the compiler flags in release 9.8.0. It's been re-added. Fixes #1925. +* The `.desktop` files have been renamed to + `org.bunkus.mkvtoolnix-gui.desktop` and `org.bunkus.mkvinfo.desktop`. This + allows Wayland compositors to associate the correct icons with running + applications for e.g. task switchers. Fixes #1948. +* Qt's multimedia component is required for compilation of the GUIs since + version 11.0.0. + + +# Version 10.0.0 "To Drown In You" 2017-03-25 + +## New features and enhancements + +* mkvmerge: AVC/H.264 parser: mkvmerge will now drop all frames before the + first key frame as they cannot be decoded properly anyway. See #1908. +* mkvmerge: HEVC/H.265 parser: mkvmerge will now drop all frames before the + first key frame as they cannot be decoded properly anyway. See #1908. +* mkvmerge: HEVC/H.265 parser: added a workaround for invalid values for the + "default display window" in the VUI parameters of sequence parameter + sets. Fixes #1907. + +## Bug fixes + +* mkvmerge: MP4 reader: fixed track offsets being wrong in certain situations + regarding the presence or absence of edit lists ('elst' atoms) & composition + timestamps ('ctts' atoms). Fixes #1889. +* mkvmerge: MP4 reader: offsets in "ctts" are now always treated as signed + integers, even with version 0 atoms. +* mkvinfo: the timestamps of SimpleBlocks with negative timestamps are now + shown correctly. +* mkvmerge: Matroska reader: fixed handling BlockGroups and SimpleBlocks with + negative timestamps. +* mkvmerge: MP3 packetizer: the MP3 packetizer will no longer drop timestamps + from source containers if they go backwards. This keeps A/V in sync for + files where the source was in sync even though their timestamps aren't + monotonic increasing. Fixes #1909. +* mkvmerge: AVC/H.264 parser: mkvmerge will now drop timestamps from the + source container if no frame is emitted for that timestamp. Fixes #1908. +* mkvmerge: HEVC/H.265 parser: mkvmerge will now drop timestamps from the + source container if no frame is emitted for that timestamp. Fixes the HEVC + equivalent of the problem with AVC described in #1908. +* mkvextract: SSA/ASS: fixed extraction when the "Format" line in the + "[Events]" section contains less fields than the default for SSA/ASS would + indicate. Fixes #1913. + + +# Version 9.9.0 "Pick Up" 2017-02-19 + +## New features and enhancements + +* GUI: chapter editor: added a character set selection in the preferences for + text files. If a character set is selected there, it will be used instead of + asking the user when opening text chapter files. Implements #1874. +* GUI: multiplexer: added a column "character set" to the "tracks, chapters + and tags" list view showing the currently selected character set for that + track. Implements #1873. +* mkvmerge: added an --engage option "all_i_slices_are_key_frames" for + treating all I slices of an AVC/H.264 stream as key frames in pathological + streams that lack real key frames. Implements #1876. +* GUI: running programs after jobs: added a new variable + \<MTX_INSTALLATION_DIRECTORY\> for the directory the MKVToolNix GUI executable + is located in. +* mkvmerge: DVB subtitle tracks whose CodecPrivate data is only four bytes + long will now be fixed up to the proper five bytes by adding the subtitling + type byte. +* mkvmerge: MP4 reader: "ctts" version 1 atoms are now supported. + +## Bug fixes + +* mkvmerge: AC-3 handling: some source files provide timestamps for audio + tracks only once every n audio frames. In such situations mkvmerge was + buffering too much data resulting in a single gap in the timestamps of one + frame duration after frame number n - 1 (the second audio timestamp read + from the source file was used one output frame too early). Fixes #1864. +* mkvmerge: MP4 reader: mkvmerge was only reading a small part of MP4 DASH + files where the first "moov" "mdat" atoms occur before the first "moof" + atom. This is part of the fix for #1867. +* mkvmerge: MP4 reader: edit list ("edts" atoms) that are part of the "moof" + atoms used in MP4 DASH files weren't parsed. Instead the edit lists from the + main track headers inside the "moov" atom were used. This is part of the fix + for #1867. +* mkvmerge: MP4 reader: when an MP4 DASH file contained both normal chunk + offset table ("stco"/"co64" atoms) in their regular "moov" atoms, a + sample-to-chunk table ("stsc" atom) whose last entry had a "samples per + chunk" count greater than 1 and DASH "trun" atoms, then mkvmerge was + calculating wrong positions the frame content. This is part of the fix for + #1867. +* mkvmerge: MP4 reader: mkvmerge couldn't deal with the key frame index table + having duplicate entries. The result was that only key frames up to and + including the first duplicate entry were marked as key frames in the output + file. All other frames weren't, even though some of them were referenced + from the key frame table after the first duplicate entry. This is part of + the fix for #1867. +* mkvmerge: MP4 reader: when an MP4 file contained more than one copy of the + "moov" atom (the track headers etc.), mkvmerge was parsing them all adding + tracks multiple times. Fix for #1877. +* mkvmerge: MP4 reader: fixed an integer overflow during the timestamp + calculation leading to files with wrong timestamps. Such files could not be + played back properly by most players. Fixes #1883. +* mkvmerge: MPEG TS reader: if the PMT lists a DVBSUB track, mkvmerge will now + recognize it without having to find a packet for it within the probed range. +* mkvmerge: splitting by parts (both the "timestamps" and the "frames" + variants): fixed the calculation of track statistics tags. When calculating + the duration the skipped portions weren't taken into account leading to a + too-high duration. As a consequence the BPS tag (bits per second) was wrong, + too. Fixes #1885. +* mkvmerge: reading files with DVB/HDMV TextSV subtitle tracks with invalid + CodecPrivate caused mkvmerge to abort with an error from boost::format about + the format string not having enough arguments. Fixes #1894. +* mkvmerge: fixed misdetection of certain AC-3 files as MP3 files which led to + an error message that "the demultiplexer could not be initialized". +* mkvmerge: fixed huge memory consumption when appending big Matroska files + with sparse tracks (e.g. forced subtitle tracks). The Matroska reader will + now queue at most 128 MB of data. Fixes #1893. +* mkvmerge: MP4 reader: the timestamps of all multiplexed tracks will now be + 0-based properly. +* mkvmerge: MP4 reader: the DTS-to-PTS offsets given by the "ctts" atoms are + now applied for all tracks containing a "ctts" atom, not just H.264 & H.265 + tracks. + +## Build system changes + +* Up to and including release 9.8.0 the man pages and their translations came + pre-built and bundled with the source code. Those pre-built files have now + been removed and must be built during the build process. Therefore the tool + "xsltproc" and the DocBook XSL stylesheets for man pages are now required + dependencies. Additionally the tool "po4a" must be installed for the + translated man pages to be built and installed, though this is optional. + + In order to facilitate finding the new requirements new options have been + added to confiure: "--with-xsltproc=prog", "--with-docbook-xsl-root=dir", + "--with-po4a=prog" and "--with-po4a-translate=prog. +* pugixml detection will be attempted via "pkg-config" first. If that fails, + "configure" will fall back to the previous method of trying just to compile + and link a test program with the standard include and library locations. + Implements #1891. + + +# Version 9.8.0 "Kuglblids" 2017-01-22 + +## Important notes + +* build system: the included version of the "drake" build tool has been + removed. Since Ruby 2.1 rake has supported parallel builds, too. The + MKVToolNix build system has been adjusted to enable parallel builds by + default. + +## New features and enhancements + +* mkvmerge: VobSub in Matroska: mkvmerge will now create and use a default + index for VobSub tracks read from Matroska files that are missing their + CodecPrivate element (which normally contains said index). Implements #1854. +* GUI: added checks for several common problems with the installation. These + checks will be executed when the GUI starts, and any problems will be + reported to the user. +* mkvmerge: added the ISO 639-2 language codes "qaa" and "qad" (both are + titled "reserved for local use") as both are used often in France. See #1848 + for more information. +* mkvmerge: the JSON identification result now includes a track's codec delay + if set (only for Matroska source files). The JSON schema version has been + bumped to 6. +* mkvmerge: MPEG TS: added a workaround for files where the subtitle packets + are multiplexed properly, but where their timestamps are way off from the + audio and video timestamps. Implements #1841. +* mkvmerge: added support for Digital Video Broadcasting (DVB) subtitles + (CodecID `S_DVBSUB`). They can be read from MPEG transport streams and from + Matroska files. Implements #1843. + +## Bug fixes + +* mkvmerge: MP4 reader: when an MP4 file contained fewer entries for + timestamps than frames (which they never should), mkvmerge would use 0 as + the timestamp for all the other frames. This resulted in effects such as the + last frame of an output file having a timestamp of 0 and in split files + having a much longer duration than they should have. Fixes #1847. +* GUI: the cache cleanup process that's run automatically when the GUI starts + no longer blocks file identification until it is finished. Additionally the + process will only be run once per release of MKVToolNix. Fixes #1860. +* GUI: certain failures during file identification that can be traced to + broken installations (e.g. mkvmerge being too old) won't be stored in the + cache anymore. Without this fix the GUI would still use the cached failed + identification result even though the underlying might have already been + fixed. +* mkvmerge: fixed that the error message "not enough space on disk" was shown + twice on some operating systems. Fixes #1850. +* mkvmerge, Matroska: if a codec delay is set for a track in the input file, + it is kept. Fixes #1849. +* GUI: multiplexer: changing default values in the preferences (e.g. the + default track language to set) did not affect files whose identification + results had already been cached. +* mkvmerge, MP4: fixed detection of MP3 audio when the object type ID in the + ESDS signals MP2 and the track headers have invalid values for number of + channels or sampling frequency. Fixes #1844. + +## Build system changes + +* nlohman json-cpp: configure now looks for a system-wide installed version of + the nlohmann json-cpp header-only library. If one is found, it is used; + otherwise the included version will be used. Implements #1858. +* If MKVToolNix is built with rake v10.0.0 or newer, its "multitask" feature + will be turned on allowing automatic parallel builds. +* CURL is no longer used by MKVToolNix and is therefore not required + for building anymore. + +## Other changes + +* GUI: the update check now uses Qt's networking classes instead of CURL. +* The command line option "--check-for-updates" has been removed, even + though the deprecation warning in release 9.7.0 stated that it would + be removed in 2018. + + +# Version 9.7.1 "Pandemonium" 2016-12-27 + +## Bug fixes + +* MKVToolNix GUI: multiplex tool bug fix: under certain circumstances the GUI was + creating invalid JSON files when starting to multiplex resulting in an error + message ("JSON option files must contain a JSON array consisting solely of JSON + strings"). + + +# Version 9.7.0 "Numbers" 2016-12-27 + +## Important notes + +* Deprecation warning: Several options and features are now deprecated and will be + removed at the start of 2018. These are: - mkvmerge: the options + "--identify-verbose", "--identify-for-gui", "--identify-for-mmg" and + "--identification-format verbose". Please convert existing users of these + interfaces to use mkvmerge's JSON identification output which can be invoked with + "--identification-format json --identify …". - all command line tools: the old, + proprietary format used for option files. Please convert users of this interface to + the new JSON option file format introduced in this release. - all command line tools: + the option "--check-for-updates" (the GUI will keep its online check for updates, + though). There is and will be no equivalent interface in the tools themselves. Users + of this interface can switch to retrieving the information about available updates + directly from the MKVToolNix website. The information is available as JSON and XML + files at the following URLs: + https://mkvtoolnix.download/latest-release.json.gz + https://mkvtoolnix.download/latest-release.xml.gz + +## New features and enhancements + +* mkvmerge: enhancement: added a new track property in JSON/verbose identification + mode called "multiplexed_tracks". It's an array of track IDs that describe which of + the tracks mkvmerge reports as separate ones were originally part of the same source + track (e.g. TrueHD+AC-3 in a single track in MPEG transport streams). Implements + #1835. +* mkvmerge: added support for skipping APE(v2) tags in TTA files. +* mkvextract: enhancement: added support for reporting progress in --gui-mode the + same way mkvmerge does. +* all: new feature: all command line tools can now read JSON-formatted option files. + Such a file's name must have an extension of ".json" (e.g. "mkvmerge + @options.json"). Its content must be a valid JSON array consisting solely of JSON + strings. +* MKVToolNix GUI: header editor & job output enhancement: added menu entries for + saving or closing all open tabs. +* MKVToolNix GUI: chapter editor enhancement: added menu entries for saving or + closing all open tabs. +* mkvmerge: MPEG TS/MPLS reader improvements: added support for subtitle tracks + that are referenced from the MPLS file as sub-paths in other M2TS files than the main + tracks. +* MKVToolNix GUI: multiplexer enhancement: the file identification process has + been re-written to be properly multi-threaded. This allows the user to continue + working with the GUI while e.g. playlists from a Blu-ray are identified. +* mkvmerge: enhancement: mkvmerge can now handle Blu-ray playlists from the + "BACKUP" sub-directory of a Blu-ray disc. +* MKVToolNix GUI: new multiplexer feature: added a menu entry for copying the title to + the destination file name. It will replace the destination file's base name but keep + its path & extension. +* MKVToolNix GUI: new multiplexer feature: all positive file identification + results will now be cached between runs. This speeds up adding the same file a lot, + especially when scanning the same Blu-ray playlists again. Cached results are + invalidated automatically with newer MKVToolNix releases or when the source file + changes. +* MKVToolNix GUI: multiplexer enhancement: when the user tries to add one of the main + Blu-ray index files (index.bdmv, MovieObject.bdmv) the GUI will automatically + scan the Blu-ray playlist files and offer them for selection. +* MKVToolNix GUI: multiplexer enhancement: tracks, chapters, tags, attachments + not selected for multiplexing will be displayed the same way as other disabled + controls. Implements #1819. + +## Bug fixes + +* mkvmerge: bug fix: when using --track-order without specifying all tracks, the + track numbers could end up in a way the user did not expect. Now mkvmerge will always + assign track numbers for those tracks that are listed in --track-order first. The + other tracks are assigned numbers afterwards. Fixes the second part of #1832. +* mkvmerge: bug fix: when reading Matroska files the movie title was always taken from + the first Matroska source file, even if that file didn't have a title set. Fixes one + part of #1832. +* MKVToolNix GUI: re-worked the startup code not to use lock files when trying to open a + socket for communicating with an already-running instance. This aims to prevent + situations with stale lock files not being cleaned up and the GUI not starting + anymore as a result. This might fix or prevent issues like #1805. +* mkvmerge: teletext subtitle bug fix: fixed the handling of DVB teletext subtitles + signaled with data unit ID 0x02 and that contain pages from multiple magazines. +* mkvmerge: bug fix: files smaller than 4 bytes were wrongly identified as MPEG + transport streams. +* mkvmerge: bug fix: the MPEG transport stream reader was using an outdated format for + the "CodecPrivate" element for HDMV TextST subtitles. This has been updated to the + current format which only contains the "dialog style element". Existing Matroska + files using this outdated scheme can be fixed by running them through mkvmerge + v9.6.0 itself or any later release as the old format is automatically converted to + the new one when it is read from Matroska files. + +## Build system changes + +* build system: building the GUI components of MKVToolNix now requires Qt v5.3.0 or + newer. +* build system: MKVToolNix now requires a compiler that supports the following + features of the C++14 standard: "std::make_unique()", "digit separators", + "binary literals" and "generic lambdas". For the GNU Compiler Collection (gcc) + this means v4.9.x or newer; for clang it means v3.4 or newer. + + +# Version 9.6.0 "Slave To Your Mind" 2016-11-29 + +## New features and enhancements + +* mkvmerge & mkvextract: added support for HDMV TextST subtitles. +* MKVToolNix GUI: multiplexer enhancement: added a column "source file's + directory" to the track list. Implements #1809. +* MKVToolNix GUI: multiplexer enhancement: added an option for selecting all tracks + of the currently selected source files in the source file context menu. Inspired by + #1809. +* MKVToolNix GUI: new feature: added options in the preferences to only show the list + of often used languages/country codes/character sets in their respective + selections instead of both the often used and the full list. Implements #1796. + +## Bug fixes + +* mkvextract: VobSub bug fix: mkvextract will add a "langidx" line to the .idx file + upon extraction. Fixes #1810. +* MKVToolNix GUI: job output tool bug fix: the button for acknowledging warnings & + errors wasn't properly disabled when the user used outside methods of + acknowledging them (e.g. via the menu or via the job queue). Fixes #1802. +* mkvmerge: MPLS parser bug fix: fixed reading the "in" & "out" timestamps for "play + items". This bug resulted in mkvmerge not reading the correct range from the + referenced M2TS file under certain rare circumstances. +* mkvmerge: bug fix: mkvmerge was entering endless loops under certain conditions + when appending files. This was a regression introduced with the fix to #1774 (using + very large --sync values causing mkvmerge to abort). + + +# Version 9.5.0 "Quiet Fire" 2016-10-16 + +## New features and enhancements + +* mkvmerge, mkvpropedit, MKVToolNix GUI: added support for the "field order" video + track header element. +* mkvinfo: added support for the "field order" video track header element. Patch by + James Almer (see AUTHORS). +* MKVToolNix GUI: merge tool enhancement: added menu entries that execute the + "close", "save settings", "start muxing" or "add to job queue" action for all + currently open tabs. +* MKVToolNix GUI: merge tool enhancement: when dragging & dropping directories the + GUI will process all files within those directories recursively instead. +* mkvpropedit, MKVToolNix GUI's header editor: added options to modify the "muxing + application" and "writing application" elements in the "segment information" + container. Implements #1788. + +## Bug fixes + +* mkvmerge, mkvextract: VobSub handling bug fix: mkvmerge and mkvextract will now + update the duration stored in the SPU bitsream with the duration from the container + level if it differs at least 1ms. Fixes #1771. +* mkvmerge: H.264 elementary stream handling bug fix: if mkvmerge ever encounters + changing SPS or PPS NALUs (ones where their ID has been encountered before with + different settings) in the H.264 then it will prepend all following key frames with + all currently active SPS and PPS NALUs. This enables playback from arbitrary key + frames even if they require other SPS or PPS settings than the ones stored in the AVCC + in CodecPrivate. Fixes #1711. +* mkvmerge: MPEG transport stream reader bug fix: fixed the handling of Blu-ray PCM + audio with an odd number of channels by removing their alignment bytes. +* mkvmerge: MPEG transport stream reader bug fix: fixed mis-detection of certain + H.264 files as MPEG transport streams. +* mkvmerge: WAV reader bug fix: the track properties (channels, sample rate) for DTS + and AC-3 in WAV will now be derived from the decoded bitstream headers instead of the + WAV file header as the latter is often incorrect. +* mkvmerge: WAV reader bug fix: fixed detection and merging of DTS in WAV that uses the + 14-bytes-in-16-bytes packing method. +* mkvmerge: bug fix: The Ogg/OGM reader did not recognize Opus files with comment + headers anymore. This was broken by the fix to not require Ogg/OGM files to have + comment headers in v9.4.0. + + +# Version 9.4.2 "So High" 2016-09-11 + +## Bug fixes + +* mkvmerge: bug fix: AVC & HEVC readers: release v9.4.1 contains a change to both + readers so that they will refuse to handle files where the detected pixel width or + height is equal to or less than 0. This check was wrong in certain cases causing + mkvmerge to reject a file as an unsupported file type. This has been fixed while + keeping the constraints on width & height having to be positive. + + +# Version 9.4.1 "Black Rain" 2016-09-11 + +## Important notes + +* Note: most of the bugs fixed on 2016-09-06 and 2016-09-07 for issue #1780 are + potentially exploitable. The scenario is arbitrary code execution with + specially-crafted files. Updating is highly recommended. + +## Bug fixes + +* mkvmerge: bug fix: AVC & HEVC readers: the readers will now refuse to handle files + where the detected pixel width or height is equal to or less than 0. Before this fix the + muxing process aborted with an assertion inside libMatroska. Fixes the last test + case of #1780. +* mkvmerge: bug fix: HEVC parser: fixed another invalid memory access (beyond the end + of allocated space). Fixes two test cases of #1780. +* mkvmerge: bug fix: HEVC parser: fixed another invalid memory access (beyond the end + of a fixed-size array). Fixes several test cases of #1780. +* mkvmerge: bug fix: MP4 reader: an error message will be printed instead of an + uncaught exception when an invalid atom chunk size is encountered during resync. + Fixes a test case of #1780. +* mkvmerge: bug fix: AAC reader: fixed mkvmerge throwing an uncaught exception due to + the sample rate being 0. Fixes a test case of #1780. +* mkvmerge: bug fix: MP4 reader: fixed an invalid memory access (beyond the end of + allocated space). Fixes several test cases of #1780. +* mkvmerge: bug fix: HEVC parser: fixed an invalid memory access (beyond the end of + allocated space). Fixes several test cases of #1780. +* mkvmerge: bug fix: fixed an invalid memory access (use after free) during global + destruction phase. Fixes several test cases of #1780. +* mkvmerge: bug fix: using very large --sync values (several minutes) with certain + container formats was causing mkvmerge to abort muxing. Fixes #1774. + + +# Version 9.4.0 "Knurl" 2016-08-22 + +## New features and enhancements + +* mkvmerge: new feature: added support for reading Apple ProRes video from MOV/MP4 + files. Patch by Chao Chen (see AUTHORS). +* MKVToolNix GUI: merge tool enhancement: when adding attachments the GUI will check + if there are attachments or attached files with the same name as the file to add. If so + the GUI will tell the user and ask for confirmation. +* mkvmerge: enhancement: mkvmerge now accepts file names in square brackets for + appending files, e.g. "mvkmerge -o out.mkv [ in1.avi in2.avi in3.avi ]" instead of + "mkvmerge -o out.mkv in1.avi + in2.avi + in3.avi". +* MKVToolNix GUI: merge tool enhancement: the "select a play list to add" dialog does + now contain a column with the number of chapters for each play list found. +* MKVToolNix GUI: job queue enhancement: dragging & dropping a valid .mtxcfg file + (either a full job file or one containing only merge settings without the job + properties) onto the job queue window will import the dropped .mtxcfg job into the + job queue. Rest of the implementation of #1714. +* MKVToolNix GUI: merge tool enhancement: dragging & dropping a job queue .mtxcfg + file onto the merge tool or using one as a command line parameter to the + mkvtoolnix-gui executable will import the .mtxcfg job into the job queue. Part of + the implementation of #1714. +* MKVToolNix GUI: merge tool enhancement: toggling the WebM mode check box will + update the output file name's extension automatically. + +## Bug fixes + +* mkvpropedit: bug fix: mkvpropedit will no longer say that it's writing the changes + if only attachment changes are specified and none of the specified attachments can + be found. +* MKVToolNix GUI: chapter editor bug fix: overly long chapter names don't cause the + GUI's window to become overly wide anymore. Fixes #1760. +* mkvmerge: DTS bug fix: if present mkvmerge will use an XLL extension's sample rate + information as the sample rate to put into the track headers. Fixes #1762. +* mkvmerge: bug fix: when appending files mkvmerge wasn't starting clusters on video + key frame anymore for the first and all following appended files. Fixes #1757. +* mkvmerge: bug fix: VP8 in Ogg: fixed dropping the first frame and the timestamp + calculation. Fixes #1754. +* mkvmerge: bug fix: mkvmerge does no longer emit a warning if no comment header packet + is found when reading tracks from Ogg/OGM files. See #1754. +* MKVToolNix GUI: merge tool bug fix: the automatic adjustments to the output file + name based on the track types selected for muxing and the mechanism for keeping + output file names unique had been broken since release v9.3.0. Fixes #1743. + + +# Version 9.3.1 "Mask Machine" 2016-07-14 + +## Bug fixes + +* MKVToolNix GUI: merge tool bug fix: the GUI v9.3.0 was often creating an invalid + syntax for the --probe-range-percentage parameter for mkvmerge due to + uninitialized memory. Fixes #1741. + + +# Version 9.3.0 "Second Sight" 2016-07-13 + +## Important notes + +* mkvmerge, mkvextract, MKVToolNix GUI: bug fix: several fixes to the handling of + country codes. The list has been updated to reflect the currently valid top level + domain country codes. Deprecated codes such as "gb" for "Great Britain" are now + mapped to their updated values ("uk" for "United Kingdom" in this case). Fixes + #1731. + +## New features and enhancements + +* mkvmerge, MKVToolNix GUI: new chapter generation feature: two new placeholders + have been introduced when generating chapters for appended files, \<FILE_NAME\> and + \<FILE_NAME_WITH_EXT\>. The former will be replaced by the appended file's name + without its extension; the latter with its extension. Implements #1737. +* MKVToolNix GUI: merge tool enhancement: when opening a saved configuration (via + the menu as well as via drag & drop) the current tab will be replaced if it is empty ( = in + the same state it is in right after creating new mux settings). Implements #1738. +* mkvmerge, MKVToolNix GUI: added an option for specifying how much of a MPEG PS or TS + file is probed for tracks (--probe-range-percentage). Implements #1734. +* mkvmerge, mkvinfo: new feature: added flags to support the Color elements in the + video tracks of Matroska containers. Users can use those flags to specify the color + space, transfer function, chromaticity coordinates etc. These properties are + useful for correct color reproduction of high dynamic range / wide color gamut + videos. +* MKVToolNix GUI: merge tool enhancement: the default track languages to set can now + also be set whenever the language in the source file is 'undefined' ('und'). This is + now the default and can be changed back to the old behavior (only set if the source file + doesn't contain a language attribute) in the preferences. Implements #1697. +* MKVToolNix GUI: merge tool enhancement: menus have been added to both the "start + muxing" and the "add to job queue" buttons. The menus let the user override the + preferences regarding clearing merge settings after starting to mux and after + adding a job to the queue respectively. Implements #1696. +* mkvmerge: the warning about not being able to determine whether a raw AAC file + contains HE-AAC/AAC+/SBR has been removed. Implements #1701. +* MKVToolNix GUI: enhancement: all file names are now displayed with their native + path separators (e.g. "C:\some\where\output.mkv" on Windows). Implements + #1298, #1456. + +## Bug fixes + +* mkvmerge: bug fix: fixed overly long file type detection in some cases when text + subtitle type probing read a lot of data due to there being no carriage returns near + the start of the file. +* mkvmerge: WavPack4 bug fix: relaxed the stream detection criteria to only require + the major version to be 4 and not to check the minor version. Fixes #1720. +* configure: fixed the Qt detection with Qt 5.7.0 which now requires the compiler to be + in C++11 mode. +* mkvmerge: MP4 bug fix wrt. DTS handling: mkvmerge will re-derive parameters such as + number of channels and sampling frequency from the DTS bitstream circumventing + invalid values in the track headers (e.g. a channel count of 0). Fixes #1727/1728. +* mkvmerge: TrueHD bug fix: fixed detection of 96 kHz sampling frequency. +* mkvinfo's GUI: fix a crash due to wrong usage of referenced temporary objects. Fixes + #1725. +* MKVToolNix GUI: merge tool bug fix: the GUI now takes into account whether splitting + is activated when looking for and warning due to existing destination files. Fixes + #1694. +* mkvmerge: bug fix: the parser for the --default-duration argument was wrongfully + handling arguments of the form "123/456i" (only this specific syntax and only with + "i" as the unit; other formats and units were fine). This is part of #1673. + Additionally the parser doesn't use the "double" data type internally anymore + fixing loss of precision and failing test cases on certain 32bit platforms. This + fixes #1705. + +## Build system changes + +* build system: libEBML v1.3.4 and libMatroska v1.4.5 are now required due to several + new elements having been specified for Matroska, and mkvmerge uses those elements. +* build system: libEBML v1.3.4 and libMatroska v1.4.5 are now required due to the + usage of new elements introduced in libMatroska v1.4.5. The copies included in the + MKVToolNix source code have been updated to those releases as well. + +## Other changes + +* mkvmerge: MPEG TS: considerable parts of the module have been rewritten. Due to its + convoluted structure didn't buffer PES packets properly before trying to parse the + PES header leading to invalid memory accesses in certain cases. + + +# Version 9.2.0 "Photograph" 2016-05-28 + +## New features and enhancements + +* MKVToolNix GUI: merge tool enhancement: the action "select all attached files" in + the popup menu actions for the attached files view has been split up into "enable all + attached files" and "disable all attached files". Implements #1698. +* mkvinfo GUI: enhancement: the window title now includes the file name. Implements + #1679. +* mkvmerge: enhancement: the "bit depth" track header field will be set for DTS tracks + from the first DTS core header. Implements #1680. + +## Bug fixes + +* MKVToolNix GUI: bug fix on Windows: removing the drive letter does not cause the + colon to be removed automatically anymore. Fixes #1692. +* MKVToolNix GUI: merge tool bug fix: it's no longer possible to select "1" as the + maximum number of files to split into as mkvmerge doesn't accept that value. Fixes + #1695. +* mkvmerge: bug fix: the "interval" chapter generation mode was always creating one + chapter too many. +* mkvmerge: bug fix: if a certain number of chapters had been generated with + --generate-chapters then mkvmerge wasn't replacing the void placerholder with + the actual chapters. Fixes #1693. +* MKVToolNix GUI: merge tool bug fix: the track column "default track in output" + wasn't taking into account if the track had its "default track" flag set to "no" in the + source file. This would result in the column showing "yes" in certain situations + even though mkvmerge would assign "no". +* mkvmerge: bug fix: fixed detection of (E-)AC-3 in MPEG TS files with unusual stream + types (e.g. 0x87) but with (E-)AC-3 PMT descriptors. Fixes #1684. +* mkvmerge, mkvextract: bug fix: fixed handling of Big Endian PCM with a bit depth + other than 16, 32 or 64 bits/sample. Other formats were using the Little Endian codec + ID, but their content was actually not byte-swapped to match it. Now those other bit + depths are byte-swapped to Little Endian, too. Fixes #1683. +* mkvmerge: bug fix: the time zone portion of the "date_local" member of the JSON and + verbose identification formats contained the time zone's name instead of its + offset on Windows due to the Visual C++ runtime's std::strftime not being C++11 + compliant. Additionally this resulted in errors about invalid UTF-8 strings for + locales where the time zone's name contained non-ASCII characters. + +## Other changes + +* mkvinfo: the change to start the GUI by default on Windows and macOS has been + reverted. Instead a separate executable (mkvinfo-gui) will be included for those + platforms which starts the GUI by default. The newly introduced option "--no-gui" + will remain valid but won't have any effect when used with mkvinfo. + + +# Version 9.1.0 "Little Earthquakes" 2016-04-23 + +## New features and enhancements + +* mkvmerge: MPEG TS/teletext enhancement: included the teletext page number in the + JSON/verbose identification output as track property "teletext_page". +* mkvmerge: MPEG TS/teletext enhancement: if a teletext track contains multiple + teletext pages then mkvmerge will now recognize all of those pages as separate + tracks to merge instead of only merging the first page. See #1662. +* mkvmerge: MPEG TS/teletext enhancement: mkvmerge will now ignore obviously bogus + PTS values for teletext tracks and use PTS from earlier audio or video packets + instead. See #1662. +* mkvmerge: MPEG TS reader enhancement: teletext tracks of type 5 (hearing impaired) + are recognized as subtitles, too. Implements #1662. +* MKVToolNix GUI: merge tool enhancement: characters that aren't valid in path names + are automatically removed from the output file name. Implements #1647. +* mkvextract: new feature: added support for extracting WebVTT subtitles. + Implements the extraction part of #1592. +* mkvmerge: new feature: added support for reading WebVTT subtitles from WebVTT and + Matroska files. Implements the merge part of #1592. +* mkvmerge: enhancement: when reading Matroska files not created by mkvmerge that + contain chapters the existing edition UIDs and chapter UIDs are removed and random + ones created. This is necessary as not only HandBrake but other tools assign + sequential numbers starting at 1 for each file. Therefore there are two chapter + entries with the UID 1, two with the UID 2 etc. and those should, strictly speaking, be + treated as if they were a single chapter whereas the user expects those entries to + stay separate entries. +* MKVToolNix GUI: new feature: added an option in the preferences ("Merge" → + "Output") for controlling whether or not the GUI clears the "output file name" input + upon removal of the last file. +* MKVToolNix GUI: new feature: added an option in the preferences ("Merge" → "Default + values") for controlling whether or not the GUI clears the "file title" input upon + removal of the last file. +* mkvmerge: enhancement: added the muxing date in both local time zone and UTC to + verbose/JSON identification outputs (keys "date_local" and "date_utc", + formatted after ISO 8601) when identifying Matroska files. +* mkvmerge: enhancement: added the minimum timestamp for each track in verbose/JSON + identification outputs (key "minimum_timestamp") when identifying Matroska + files. At most the first ten seconds are probed; if no block is found for a track within + that range then the key is not output for the track. Also added "muxing_application" + and "writing_application" to the "container" section of the output. Currently + those are only set for Matroska files. + +## Bug fixes + +* mkvmerge: MPEG TS bug fix: the "text_subtitles" property of the JSON/verbose + identification modes was always set to true for all subtitle tracks, even for those + that aren't text subtitles (VobSub, PG). +* mkvmerge: MPEG TS/teletext bug fix: the language code signaled in the MPEG TS PMT is + taken into account when selecting the character encoding to use during decoding of + the teletext subtitles, not just the "national character set" stored in the + teletext page headers. For example, a German teletext page may signal "national + character set" 0 (English) whereas it's actually 4 (German). See #1662. +* mkvmerge: teletext decoding bug fix: fixed dropping of certain non-ASCII + characters in rare circumstances due to wrong filtering of already UTF-8 encoded + strings. +* MKVToolNix GUI: bug fix (Windows only): the GUI didn't start if the USERNAME + environment variable contained characters that aren't allowed in file names (e.g. + : or ?). +* mkvmerge: AVI reader bug fix: fixed reading files where the file ends in the middle of + an audio chunk. Fixes #1657. +* mkvmerge: bug fix: mkvmerge will no longer abort reading a Matroska file with a + structural error right before the first cluster. Fixes #1654. +* MKVToolNix: merge tool bug fix: when adding playlists the GUI won't ask the user + whether or not to scan if there's only a single playlist in that directory. +* mkvmerge: bug fix: AVC/H.264: fixed handling of interlaced frames with bottom + field first. +* MKVToolNix GUI: bug fix: fixed huge memory consumption (e.g. allocation of 2 GB for a + JSON file of 650 KB) in the JSON library by updating said JSON library. Fixes #1631. + +## Other changes + +* MKVToolNix GUI: merge tool change: attachments from source files have been moved + from the "Tracks, chapters, tags and attachments" list on the "sources" tab to a new + list on the "attachments" tab. That way all existing attachments and all the ones to + newly add will be shown in a single tab. This makes it easier to decide which + attachments will have to be added and which can be removed. + + +# Version 9.0.1 "Obstacles" 2016-03-28 + +## Bug fixes + +* mkvmerge: bug fix: regression in v9.0.0: the text subtitle packetizer was + wrongfully assuming an encoding of UTF-8 if none was given instead of assuming the + system's encoding. Fixes #1639. +* mkvmerge: bug fix: if too many chapters had been generated with + --generate-chapters then mkvmerge created a bogus entry in the meta seek element + and did not actually write the chapters to the file. +* mkvmerge: bug fix: the DTS packetizer was setting the number of channels wrong + sometimes when reducing to the DTS core. It was using the number of channels + including the extensions instead of the channels of the core only. + + +# Version 9.0.0 "Power to progress" 2016-03-26 + +## New features and enhancements + +* all: new feature: added a new translation of both the programs and the man pages to + Korean by Potato (see AUTHORS). +* MKVToolNix GUI: chapter editor enhancement: added a button next to the 'segment + UID' controls that enable the user to select a Matroska file. The GUI reads that + file's segment UID and enters its value into the input field. +* mkvinfo: change: on Windows and macOS mkvinfo will now launch the GUI by default + unless the option »--no-gui« (or »-G«) has been given. This is due to the fact that on + both OS users often use portable versions respectively disk images and launch the + executable directly and not via start menu entries. In those situations adding + command line options for launching the GUI is unnecessarily difficult. +* MKVToolNix GUI: merge tool (playlist selection dialog) enhancement: the playlist + items are sorted by their position within the playlist by default. +* MKVToolNix GUI: merge tool (playlist selection dialog) enhancement: + double-clicking on a playlist will select and add that playlist. +* mkvmerge: enhancement: added the number of bits per sample to the verbose/JSON + identification output for FLAC files. +* mkvextract: new feature: implemented the extraction of Big Endian PCM (codec ID + A_PCM/INT/BIG) to WAV files. The content will be byte-swapped into Little Endian + PCM in the process. +* mkvmerge: enhancement: Big Endian PCM tracks will now be byte-swapped into Little + Endian PCM, and the codec ID A_PCM/INT/LIT will be used. This was done due to a lot of + players not supporting Big Endian PCM inside Matroska. +* MKVToolNix GUI: job queue enhancement: completed jobs will now be removed from the + queue automatically on exit if the job has been added more than 14 days ago in order not + to let the queue grow arbitrarily large. This feature can be turned off and the number + of days can be adjusted in the preferences. +* mkvextract: enhancement: when extracting chapters in the simple format the user + can use the new option »--simple-language …« for selecting the chapter names that + are output. Normally the first chapter name found in each atom is used. With this + option mkvextract looks for a chapter name whose language matches the specified + one. Implements the feature enhancement part of #1610. +* MKVToolNix GUI: new chapter editor feature: added an option to multiply all chapter + timecodes by a factor to the "additional modifications" dialog. Implements #1609. + +## Bug fixes + +* Installer: fixed support for silent installation and uninstallation. +* mkvmerge: bug fix: fixed two more issues in the conversion of teletext subtitles to + SRT subtitles: 1. Packets belonging to pages that don't contain subtitles were used + as valid end points for subtitles causing entries to become very short (e.g. 40ms). + 2. Sometimes the timestamps of wrong packets were used as entry's start and end + points causing start timestamps and durations that were slightly off. Second part + of the fix for #1623. +* mkvmerge: bug fix: MP4/QuickTime reader: audio tracks can contain two instances of + certain header fields (channel count, bits/sample & channel, sample rate) in the + STSD atom: one instance in the version 0 header and one in the version 2 header parts. + So far mkvmerge has used those from the version 0 header only and ignored the ones from + the version 2 header. This has been changed to match the behavior of other players and + MP4 readers like ffmpeg. If the STSD atom contains a version 2 structure then the + fields from it will be used. Otherwise the fields from the version 0 part will be used. + Fixes #1633. +* mkvmerge: bug fix: fixed two issues in the conversion of teletext subtitles to SRT + subtitles: 1. Consecutive teletext packets with the same content are now merged + into a single entry instead of resulting in multiple entries. 2. The calculation of a + packet's duration was wrong in certain situations. Part of the fix for #1623. +* mkvextract: bug fix: fixed the duplication of VPS, SPS, PPS and SEI NALUs when + extracting HEVC/H.265 tracks. See #1076 and #1621. +* mkvmerge: bug fix: reverted the patch by Vladimír Pilný that made the HEVC/H.265 not + store SEI NALUs with the frames during muxing. It was supposed to prevent having the + SEI NALUs present twice when extracting HEVC due to some SEI information also being + stored in the codec private data, but it dropped a lot of other SEI NALUs irrevocably. + Fixes #1621. +* mkvmerge: bug fix: the --sub-charset option is now ignored for text subtitle files + that start with a byte-order mark (BOM) bringing the behavior in line with the + documentation. Fixes #1620. +* mkvmerge, MKVToolNix GUI: new feature: added switches (»--generate-chapters« + and »--generate-chapter-name-template«) and their corresponding UI items for + generating chapters while muxing. Two modes are currently supported: + »when-appending« which creates one chapter at the beginning and an additional one + each time a file is appended and »interval:…« which generates chapters in fixed + intervals. Implements mkvmerge's and the GUI's part of #1586. +* mkvpropedit, MKVToolNix GUI's header editor: bug fix: fixed the handling of files + where the last level 1 element has an unknown size. The programs will now either fix + this element to have a known size or abort the process with an appropriate error + message but without modifying the file. Fixes #1601. +* mkvextract: several issues regarding the extraction of chapters in the simple + format have been fixed: if multiple names with different languages were present + then an entry had been written for each name; the total number of entries written was + wrong; the wrong entries were written. The new code only writes the first name found + from the top-most chapter atoms of all editions. Chapters flagged as hidden or as not + enabled are not extracted at all. Fixes the bug part of #1610. + +## Build system changes + +* build system: implemented support for explicit pre-compiled headers for Linux and + macOS. +* build system: added an option to configure »--without-qt-pkg-config«. Normally + configure uses pkg-config for detecting Qt and setting QT_CFLAGS and QT_LIBS. With + this option configure won't use pkg-config and rely on the user having set both + variables before running configure. This enables using Qt on systems where no + pkg-config files are generated (e.g. Qt 5.6.0 on MacOS with frameworks enabled). + +## Other changes + +* mkvmerge: MP4/QuickTime reader: audio tracks with the FourCC 'lpcm' are muxed as + A_PCM/INT/LIT instead of A_QUICKTIME. + + +# Version 8.9.0 "Father Daughter" 2016-02-21 + +## New features and enhancements + +* MKVToolNix GUI: header editor enhancement: when the user drags & drops files on an + open header editor tab the GUI will ask the user what to do with them: either open the + files as new header editor tabs or add the files as new attachments to the current tab. + The action can also be set as the default. Implements #1585. +* MKVToolNix GUI: chapter & header editor enhancement: Matroska files are initially + opened in read-only mode and only later re-opened in read/write mode in order to + enable reading from write-protected files. Part of the implementation of #1594. +* MKVToolNix GUI: chapter & header enhancement: the error messages shown when a + Matroska file could not be parsed have been improved to include the most likely + reasons. Part of the implementation of #1594. +* MKVToolNix GUI: chapter editor enhancement: added a menu entry for removing + chapters from an existing Matroska file. Inspired by #1593. +* MKVToolNix GUI: chapter editor enhancement: it is now possible to save chapters to + Matroska files after having removed all entries (editions and chapter atoms). This + effectively removes the chapters from the file. Implements #1593. +* MKVToolNix GUI: job queue enhancement: added keyboard shortcuts for removing all + completed jobs and for removing successfully completed jobs. Implements #1599. +* MKVToolNix GUI: merge tool enhancement: added icons to the context menu actions in + the "attachments" sub-tab. Implements #1596. +* MKVToolNix GUI: merge tool enhancement: made the context menu entries in the + "attachments" sub-tab clearer. Implements #1597. +* docs: added a Polish translation of the man pages by Daniel Kluz (see AUTHORS). +* MKVToolNix GUI: "run program after XYZ" enhancement: configurations can now be + deactivated without having to change them. Implements #1581. +* mkvmerge: enhancement: when reading Matroska files created by HandBrake that + contain chapters the existing edition UIDs and chapter UIDs are removed and random + ones created. This is necessary as HandBrake assigns sequential numbers starting + at 1 for each file. Therefore there are two chapter entries with the UID 1, two with the + UID 2 etc. and those should, strictly speaking, be treated as if they were a single + chapter whereas the user expects those entries to stay separate entries. + Implements an improvement for issues such as #1561. +* MKVToolNix GUI: enhancement: the "escape for Windows' cmd.exe" mechanism will + only escape arguments that actually need escaping in order to produce easier to read + command lines. + +## Bug fixes + +* MKVToolNix GUI: bug fix: ampersands (&) in file names were shown as keyboard + shortcuts in tab titles in various tools (merge tool, chapter and header editors, + job output tool). Fixes #1603. +* mkvmerge: bug fix: fixed the handling of AVIs with a negative video height (which + signals that the rows are arranged top-to-bottom). +* MKVToolNix GUI: job queue bug fix: fixed an invalid memory access in the "edit in + corresponding tool and remove from queue" functionality. +* MKVToolNix GUI: re-write, merge tool bug fix: the file identification is now based + on mkvmerge's JSON output instead of its verbose output. This also fixes the merge + tool not showing names of attachments inside Matroska files properly if those names + contain spaces (#1583). +* MKVToolNix GUI: merge tool bug fix: the "mux this" combo box was disabled if a single + attachment was selected. +* mkvmerge: bug fix: removed spurious output generated during file identification + in the HEVC detection code (e.g. "Error No Error"). +* mkvmerge: bug fix: fixed the output of the "playlist_file" and "other_file" + properties of the "container" entity in the JSON identification format from a + single string to an array of strings. The format version has been bumped to 3 due to + this change. +* mkvmerge: bug fix: fixed parsing of AAC in MP4 with a program config element with an + empty comment field at the end of the GA specific config. Fixes #1578. +* MKVToolNix GUI: merge tool bug fix: the GUI no longer requires at least one source + file to be present before muxing can start in order to allow creation of track-less + files. Fixes #1576. +* mkvmerge: QuickTime/MP4 reader: fix a division by zero in the index generation for + certain old audio codecs that have certain header fields (bytes_per_frame, + samples_per_packet) set to 0. +* mkvinfo: bug fix: global elements (EBML void and CRC-32 elements) are now handled + correctly if they're located inside the segment info or the chapter translate + parents. + +## Other changes + +* MKVToolNix GUI: the default font size adjustment has been deactivated for the time + being as it causes problems on high DPI displays. See #1602. + + +# Version 8.8.0 "Wind at my back" 2016-01-10 + +## New features and enhancements + +* MKVToolNix GUI: "run program after XYZ" enhancement: added a button for executing + the program right now as a test run. See #1570. +* MKVToolNix GUI: "run program after XYZ" enhancement: an error message is shown if + the program couldn't be executed. See #1570. +* MKVToolNix GUI: "run program after XYZ" enhancement: any leading spaces in the + executable path are removed in order to make copying & pasting less error-prone. +* mkvpropedit: enhancement: mkvpropedit will accept terminology variants of ISO + 639-2 language codes and convert them to the bibliographic variants + automatically. Implements #1565. +* MKVToolNix GUI: enhancement: the GUI's default font's size is now scaled with the + screen's DPI and is at least 9 points high (up from 8). Additionally on Windows "Segoe + UI", which is Windows' default user interface font, is used instead of the default + provided by Qt, "MS Shell Dlg 2". +* MKVToolNix GUI: enhancement: the user can select the font family and size for the GUI + in the preferences. +* MKVToolNix GUI: merge tool enhancement: added a column to the "attachments" tab + containing the file size. +* MKVToolNix GUI: enhancement: pressing the insert key when the focus is on the merge + tool's source files or attachments list, on the chapter editor's chapter list or on + the header editor's list will invoke the corresponding action for adding elements + to that list. +* MKVToolNix GUI: new feature: implemented adding, changing and removing + attachments in existing Matroska files as part of the header editor. Implements + #1533. + +## Bug fixes + +* MKVToolNix GUI: "run program after XYZ" bug fix: the paths used in the variables and + the executable are converted to the platforms native path separators. This fixes + compatibility with Windows applications that don't support the use of forward + slashes in path names like e.g. VLC. See #1570. +* mkvmerge: bug fix: fixed TrueHD detection both as raw streams as well as inside other + contains if the stream does not start with a TrueHD sync frame. +* MKVToolNix GUI: new merge tool feature: added a layout for the track properties + where they're on the right of the files/tracks lists in two fixed columns. + Implements #1526. +* mkvmerge: bug fix: fixed a mis-detection of an MPEG-2 video elementary stream as a + TrueHD file which then caused a segmentation fault. Fixes #1559. +* mkvmerge: bug fix: Matroska attachments with the same name, size and MIME type were + not output during file identification. +* MKVToolNix GUI: merge tool bug fix: when using one of the "select all tracks (of + type…)" actions the "properties" column didn't show the selection. + + +# Version 8.7.0 "All of the above" 2015-12-31 + +## New features and enhancements + +* mkvmerge: enhancement: the MP4 reader will keep the display dimensions from the + track header atom ("tkhd") and use them as the display width & height. See also #1547. +* MKVToolNix GUI: merge tool enhancement: the "add source files" button now has + optional popup menu containing actions for adding/appending files and adding + files as additional parts for easier discovery of those actions. This popup is only + shown if the user clicks on the arrow shown on the right of the button. +* mkvmerge: new feature: TrueHD tracks that contain Dolby Atmos will be identified as + "TrueHD Atmos". Implements #1519. +* MKVToolNix GUI: new merge tool feature: added menu options in the "Merge" menu for + copying either the first source file's name or the current output file's name into + the "file title" control. +* mkvpropedit: new feature: added an option for calculating statistics for all + tracks and adding new/updating existing statistics tags in a file. Second half of + the implementation of #1507. +* mkvpropedit: new feature: added an option for removing all existing track + statistics tags from a file. Part of the implementation of #1507. +* mkvmerge: enhancement: added the container's internal track ID as the "number" + attribute in verbose & JSON identification modes for several container types + (QuickTime/MP4: the track ID from the 'tkhd' atom; MPEG program stream: the + sub-stream ID in the upper 32 bits and the stream ID in the lower 32 bits; MPEG + transport stream: the program ID; Ogg/OGM: the stream's serial number field; + RealMedia: the track ID). Implements #1541. +* mkvmerge: enhancement: if JSON identification mode is active then warnings and + errors will be output as JSON as well. They're output as arrays of strings as the keys + "warnings" and "errors" of the main JSON object. Implements #1537. +* mkvpropedit: enhancement: when using --add-attachment, --replace-attachment + or --update-attachment the UID can be changed with --attachment-uid. See #1532. +* mkvpropedit: new feature: added an option "--update-attachment" for updating the + properties of existing attachments without replacing their content. Implements + #1532. +* MKVToolNix GUI: new feature: added options for running arbitrary programs after a + job has finished or after the queue has finished. Implements #1406. +* MKVToolNix GUI: merge tool enhancement: if files are dragged & dropped from an + external application with the right mouse button being pressed then the GUI will + always ask the user what to do with the files even if the user has configured the GUI not + to ask. Implements #1508. + +## Bug fixes + +* mkvmerge: bug fix: fixed the handling of a PES size of 0 ( = unknown). Tracks whose PES + packets had such a size were sometimes not detected at all, and even if they were their + content was incomplete. Fixes #1553. +* mkvmerge: bug fix: made the MPEG 1/2 video elementary stream file type recognition + more resilient and more flexible dropping the requirement for a file to start with an + MPEG start code (0x00 00 01). Fixes #1462. +* mkvpropedit: bug fix: when changing the track language it is now verified to be a + valid ISO 639-2 language code before writing it to the file. Fixes #1550. +* mkvmerge: bug fix: the Matroska reader now uses TrueHD-specific code when reading + Matroska files. This can fix things like wrong frame type flags. +* mkvmerge: bug fix: MP4 edit lists of certain types (two entries, first entry's + media_time is -1, second entry's segment_duration is != 0) weren't handled + properly resulting in key frame flags being assigned to the wrong frames. Fixes + #1547. +* mkvmerge: bug fix: the HEVC/H.265 code was writing SEI NALUs twice. This had already + been mentioned in #1076 but never fixed. Patch by Vladimír Pilný. +* mkvmerge: bug fix: the HEVC/H.265 code wasn't converting slice NALUs to RBSP form + before parsing it resulting in wrongly timestamped frames under certain + conditions. This is a similar fix to the issues reported in #918 and #1548. +* mkvmerge: bug fix: the AVC/H.264 code wasn't converting slice NALUs to RBSP form + before parsing it resulting in wrongly timestamped frames under certain + conditions. Fixes #918 and #1548. +* mkvmerge: bug fix: the MP4 reader can now understand the 'random access point' + sample grouping information for marking open GOP random access points as key + frames. Fixes #1543. +* mkvmerge: bug fix: fixed the decisions whether or not to write the last frame of a + track as a BlockGroup or a SimpleBlock and whether or not to write a block duration for + that frame. Fixes #1545. +* mkvmerge: bug fix: the progress calculation was sometimes outputting negative + numbers when appending Matroska files whose timestamps don't start at 0 (e.g. if + they were created by splitting with linking enabled). In the the GUI this resulted in + lines like "#GUI#progress -2%" in the job's output. +* mkvmerge: bug fix: AAC with low sampling frequencies was sometimes mis-detected + with the wrong profile preventing appending it to other AAC tracks. Fixes #1540. +* mkvmerge: bug fix: chapters were output as both "chapters" and "track_tags" in JSON + identification mode. Fixes #1538. +* MKVToolNix GUI: bug fix: the "split mode" drop-down box got reset to "do not split" + each time the preferences dialog was closed with the "OK" button. Fixes #1539. +* MKVToolNix GUI: enhancement: when starting the GUI with a saved settings file then + the GUI won't contain an empty tab in the merge tool anymore. Fixes #1504. +* mkvmerge: bug fix: fixed the key frame detection for VP9 video tracks. +* MKVToolNix GUI: bug fix: relative file names given on the command line were + interpreted as being relative to the user's home directory. Fixes #1534. + +## Other changes + +* all: reversion of a change: several ISO 639-2 codes of languages that are very old and + not spoken anymore have been re-added (e.g. "English, Middle (1100-1500)") due to + feedback from users who did have a use for such codes. +* all: reversion of a change: all of the tools will write a byte-order mark (BOM) to text + files encoded any of the UTF-* schemes again. This reverts the change in release + 8.6.0 due to user feedback preferring the old way. +* MKVToolNix GUI: the preferences dialog has been reworked heavily in order to + provide a better overview and to be less overwhelming. + + +# Version 8.6.1 "Flying" 2015-11-29 + +## Bug fixes + +* mkvpropedit, GUI's chapter & header editors bug fix: in certain situations the + modified file would not contain a seek head before the first cluster anymore + resulting in most players not finding elements such as attachments or the index + located at the end of the file anymore. Fixes #1513. +* mkvmerge: bug fix: the change to do a deeper file analysis if no seek head was found was + causing huge increases in file type detection time as popular tools like x264 don't + write seek heads. The way elements at the end are searched has been changed to only + scan the last 5 MB of the file instead of iterating over every level 1 element from the + beginning of the file. + + +# Version 8.6.0 "A Place In Your World" 2015-11-28 + +## New features and enhancements + +* mkvmerge: enhancement: if no seek head is found before the first cluster when + reading Matroska files then mkvmerge will attempt a deeper scan of all elements in + the file in order to find track headers, attachments, chapters and tags located at + the end of the file. See #1513 for the rationale. +* mkvmerge: enhancement: added JSON as an output format for file type + identification. It can be activated with "--identification-format json + --identify yourfile.ext" (or their short counterparts "-F json -i + yourfile.ext"). + +## Bug fixes + +* mkvmerge: Matroska reader bug fix: the info about which packetizer is used was + output twice for each HEVC track. Fixes #1522. +* MKVToolNix GUI: bug fix: implemented a workaround for a bug in Qt which caused the GUI + not to start anymore due to failing to detect a stale lock file if the GUI had crashed + before on a computer with a host name that included non-ASCII characters. See + https://bugreports.qt.io/browse/QTBUG-49640 +* mkvmerge: bug fix: a track's number of bits per audio sample wasn't output in verbose + identification mode even if it was present in the file. +* MKVToolNix GUI: header editor bug fix: the "status" description wasn't adjusting + its height properly resulting in its text being cut off. Fixes #1517. +* MKVToolNix GUI: bug fix: the program changes its working directory to the user's + profile/home directory on startup allowing the removal of its installation folder + even if a program started by the GUI (e.g. a web browser) is still running. Fixes + #1518. +* ebml_validator: bug fix: elements with an unknown size weren't handled correctly. +* build system: fixed building and linking against libEBML and libMatroska if + they're installed in a non-standard location. +* mkvpropedit, MKVToolNix GUI's chapter and header editors: the tools were unable to + update elements in files without a seek head present. Fixes #1516. +* mkvmerge: bug fix: fixed two issues causing mkvmerge to write invalid data when + updating track headers caused by the fix for "Re-rendering track headers: + data_size != 0 not implemented yet". Fixes #1498. +* MKVToolNix GUI: bug fix: the options for linking to the next/previous segment UID + were wrong. Fixes #1511. +* mkvmerge: bug fix: the VC-1 handlig code was duplicating the first sequence headers + with each mux. Fixes #1503. +* build system: bug fix: configure was checking for and using libintl if + --without-gettext was used. Fixes #1501. + +## Other changes + +* all: change: none of the tools will write a byte-order mark (BOM) to text files + encoded any of the UTF-* schemes anymore. +* all: MKVToolNix now requires gcc 4.8.0 or later or clang 3.4 or later for + compilation. + + +# Version 8.5.2 "Crosses" 2015-11-04 + +## New features and enhancements + +* mkvpropedit, MKVToolNix GUI header editor: enhancement: added the "codec delay" + track header field as an editable property. + +## Bug fixes + +* MKVToolNix GUI: bug fix: the file/track columns aren't resized to fit their content + when expanding/collapsing tree nodes anymore. Such expansion also happened when + moving entries with the "move up/down" buttons. Fixes #1492. +* mkvmerge: bug fix: fixed the values of the "previous/next segment UID" elements + when splitting by parts with segment linking enabled. Fixes #1497. +* mkvmerge: bug fix: mkvmerge no longer creates a "next segment UID" field in the last + file when splitting and segment linking is active. +* mkvmerge: bug fix: fixed an endless loop when updating track headers caused by the + fix for "Re-rendering track headers: data_size != 0 not implemented yet". Fixes + #1485. + + +# Version 8.5.1 "Where you lead I will follow" 2015-10-21 + +## New features and enhancements + +* MKVToolNix GUI: header editor enhancement: several track properties like name or + language are shown as columns in the tree for easier distinction between tracks. + They're also shown on the overview page on the right when that track's entry is + selected in the tree. The text in the labels on this overview page can be selected with + the mouse for copying & pasting elsewhere. + +## Bug fixes + +* build system: libEBML v1.3.3 and libMatroska v1.4.4 are now required due to + important fixes for invalid memory accesses in those two releases. The copies + included in the MKVToolNix source code have been updated to those releases as well. +* MKVToolNix GUI: bug fix: the "save file" dialogs did not have the currently entered + file name pre-selected anymore. Fixes #1480. +* MKVToolNix GUI: bug fix: fixed a crash when loading corrupted job settings. +* MKVToolNix GUI: header editor bug fix: the tree items weren't re-translated when + the GUI language was changed. +* mkvmerge: bug fix: updating the track headers wasn't working in some rare cases + (corresponding error message "Re-rendering track headers: data_size != 0 not + implemented yet"). +* MKVToolNix GUI: bug fix (Linux): the function "open folder" was inserting a + superfluous leading slash in the directory name. This causes some file managers (in + this particular case Dolphin on Linux) to interpret a directory name like + "//home/mosu/…" as a share called "mosu" on a Samba/Windows server called "home" + and to prepend the whole name with the "smb://" protocol. Fixes #1479. + + +# Version 8.5.0 "Vanishing Act" 2015-10-17 + +## New features and enhancements + +* MKVToolNix GUI: merge tool enhancement: when dropping files onto the GUI the last + file's directory is remembered as the last directory a file was opened from causing + the next open file dialog to start in that directory. Implements #1477. +* all: new feature: added a Catalan translation of the man pages by Antoni Bella Pérez + (see AUTHORS). +* MKVToolNix GUI: chapter editor enhancement: the start and end timestamps in the + tree are displayed with nanosecond precision. Implements #1474. +* MKVToolNix GUI: merge tool enhancement: added a column to the track list containing + the state of the "forced track" flag. Implements #1472. +* MKVToolNix GUI: merge tool enhancement: pressing the delete key in the attachments + list removes the selected entries. Implements #1473. +* MKVToolNix GUI: enhancement: the context menu for the status bar job status + counters is now shown when the user clicks with any mouse button, not just the right + one. This should make the feature easier to discover. Implements #1396. +* MKVToolNix GUI: new job queue feature: added an option in the preferences for + resetting the warning and error counters of all jobs and the global counters in the + status bar to 0 when exiting the program. Implements #1437. +* MKVToolNix GUI: current job output enhancement: the separator lines for warnings + and errors ("--- Warnings emitted by Job … started on … ---") are only shown when + warnings/errors actually occur and not for each job that's run. +* mkvmerge: enhancement: improved identification output for DTS 96/24. Implements + #1431. +* MKVToolNix GUI: merge tool enhancement: added buttons for previewing the + character sets for text subtitles read from SRT and SSA/ASS files as well as for + chapter files. They're located next to the drop down boxes for the character sets on + the input and output tabs. +* MKVToolNix GUI: merge tool enhancement: added buttons next to the 'segment UID', + 'previous segment UID' and 'next segment UID' controls that enable the user to + select a Matroska file. The GUI reads that file's segment UID and enters its value + into the corresponding control. Part of the implementation of #1363. +* MKVToolNix GUI: chapter editor enhancement: Added another variable to the chapter + name templates called \<START\> which is replaced by the chapter's start timestamp. + An optional format can be specified, e.g. \<START:%H:%M:%S.%3n\> resulting in + something like 01:35:27.734. This can be used in the 'generate sub-chapters' or the + 'renumber sub-chapters' functionality. Implements #1445. +* MKVToolNix GUI: merge tool enhancement: implemented the optional warning before + overwriting existing files when starting to mux or adding a job to the queue. The + pending jobs in the queue are checked for the same destination file name as well. + Implements #1390. +* MKVToolNix GUI: enhancement: pressing the delete key in the chapter editor and the + job queue removes the selected entries. Implements #1454. +* MKVToolNix GUI: merge tool enhancement: dropping chapter, tag and segment info + files from external applications will cause those file names to be added to the + appropriate controls on the 'output' tab. Implements #1332 and 1345. +* MKVToolNix GUI: merge tool enhancement: the feature "default track language" has + been split into track languages by type. There are now three separate settings for + audio, video and subtitle tracks. Implements #1338. +* mkvmerge: enhancement: the verbose identification for MP4 files will now derive + basic audio parameters of MP3 and AC3 tracks from the bitstream instead of relying on + the values in the track headers. +* MKVToolNix GUI: new merge tool feature: implemented an optional vertical layout + mode for the "input" tab in which the track properties are shown below the track list. + Implements #1304. +* MKVToolNix GUI: merge tool enhancement: when browsing for chapter files on the + "output" tab the initial directory is the first input file's directory instead of + the directory accessed last. +* MKVToolNix GUI: enhancement: on Windows the drop down boxes were elliding overlong + text. This has been changed to making the open combo boxes' scroll areas wide enough + to contain the whole entries. This matches the behavior of Qt on other operating + systems. +* MKVToolNix GUI: new merge tool feature: added context menu entries for opening the + selected files/the source files of selected tracks in MediaInfo. Implements + #1423. + +## Bug fixes + +* mkvmerge: bug fix: the cropping parameters contained the "cropping:" prefix twice + in the verbose identification output. +* MKVToolNix GUI: enhancement: if the last directory opened doesn't exist anymore + then default to one that does in order to prevent an error message from older Windows + versions about a location not being available. Fixes #1438. +* MKVToolNix GUI: bug fix: the menus that are currently not shown are disabled + properly so that they don't react to keyboard shortcuts anymore. This affected e.g. + Alt+J with the English localization as there were three shortcuts active: the "add + to job queue" button (if the merge tool is active), the "job queue" menu and the "job + output" menu. +* MKVToolNix GUI: bug fix (Windows): changed some options for Qt's file dialogs in + order to speed up access to network shares in certain situations. Fixes #1459. +* mkvmerge: bug fix: PCM tracks: if the number of samples per packet varies then no + default duration will be written. Fixes #1426. +* mkvmerge: new feature: The three options that use segment UIDs (--segment-uid, + --link-to-previous and --link-to-next) can now read the segment UID of an existing + Matroska file. For this the file's name must be given as an argument prefixed with = + (e.g. '--segment-uid =some_file.mkv'). Implements #1363. +* MKVToolNix GUI: merge tool bug fix: If there's currently no source file present when + the user drags & drops files onto the merge tool then the GUI will no longer leave an + empty, superfluous tab for certain drop modes. Fixes #1446. +* MKVToolNix GUI: merge tool bug fix: the "default track flag in output" column wasn't + updated properly directly after loading settings. +* MKVToolNix GUI: merge tool bug fix: the cropping parameters were not converted into + parameters for mkvmerge at all. +* all: fixed the spelling of the AC-3, E-AC-3 and VC-1 codec names. +* MKVToolNix GUI: bug fix: the interface language selection has been improved not to + select wrong entries resulting in error messages from mkvmerge about unknown + translations. Fixes #1434. +* MKVToolNix GUI: bug fix: if the Windows version of the GUI was started from a + symbolically linked folder then it would crash when the user added a file. Fixes + #1315. + +## Other changes + +* all: several ISO 639-2 codes of languages that are very old and not spoken anymore + have been removed (e.g. "English, Middle (1100-1500)"). + + +# Version 8.4.0 "A better way to fly" 2015-09-19 + +## New features and enhancements + +* MKVToolNix GUI: new merge tool feature: when dragging & dropping files onto merge + settings already containing a file the user can set more options to be always done + instead of asking (before: only adding files to the current merge settings could be + thus marked; now: adding to current, adding to new settings and adding each file to + new settings can be set to perform without asking). Implements #1388. +* MKVToolNix GUI: merge tool enhancement: when dragging & dropping files onto merge + settings already containing a file the dialog asking the user what to do has received + a new option for creating one new merge tab for each of the dropped files. Implements + #1380. +* MKVToolNix GUI: new merge tool feature: the "tracks" tree view contains a new column + titled "properties" which contains basic track properties: the pixel dimensions + for a video track and sampling frequency, number of channels and bits per sample for + an audio track. Implements #1295. +* mkvmerge: enhancement: the verbose identification result for all audio tracks has + been extended to include the number of channels, the sample rate and the bits per + sample where applicable. Part of the implementation of #1295. +* mkvmerge: enhancement: the pixel width/height will be reported in verbose + identification mode for all video tracks. +* MKVToolNix GUI: new merge tool feature: added a column in the track list showing the + effective state of the "default track" flag. It shows the state of the flag as it will + be in the output file. Implements #1353. +* mkvmerge: enhancement: when mkvmerge encounters garbage data in the middle of AC-3 + or MP3 tracks it will now output the timecode where the garbage occurred in order to + make checking for audio/video sync issues easier. Implements #1420. +* MKVToolNix GUI: chapter editor enhancement: added a column in the tree with the + edition's/chapter's flags. +* MKVToolNix GUI: new feature: the state of all columns in all list/tree views can be + reset (both the shown/hidden state as well as their order) from the column's context + menu. See #1268. +* MKVToolNix GUI: new feature: the column headers of all list/tree views can be + re-ordered via drag & drop and the GUI will remember their position upon restart. + Additionally the columns can be hidden/shown via a context menu by right-clicking + on the column headers. Implements #1268. +* MKVToolNix GUI: new chapter editor feature: added an option for skipping chapters + marked as "hidden" in the re-numbering dialog. Implements #1414. +* all: new feature: added a new translation to Serbian (Cyrillic) by Jay Alexander + Fleming (see AUTHORS). +* MKVToolNix GUI: enhancement: the header editor will convert ISO 639-2 terminology + codes used in language elements to their corresponding bibliographic variants. + Implements #1418. +* MKVToolNix GUI: enhancement: the titles and button texts of dialogs asking + questions have been improved to be easier understandable. For example, instead of + using "yes/no" as the answers to the question "Do you want to close the unmodified + file?" the choices are now "Close file/Cancel". Implements #1417. +* MKVToolNix GUI: chapter editor enhancement: when loading simple/ OGM style + chapter files that contain non-ASCII characters and which do not start with a byte + order mark (BOM) the GUI will let the user chose the character set to use. A preview is + shown for the selected character set and updated when the user changes the character + set. +* MKVToolNix GUI: merge tool enhancement: added "remove all" and "select all" + entries to the attachments context menu. Implements #1386. +* MKVToolNix GUI: job output enhancement: the output, warnings and error text views + are now separated by two splitters enabling the user to change their respective + sizes. These changes are remembered over restarts. Implements #1394. +* MKVToolNix GUI: chapter editor enhancement: pressing shift+return will cause the + next appropriate chapter control to be selected depending on where the focus + currently is: from a chapter input (start/end time, flags, UIDs) to the next chapter + entry's start time, from a chapter name to the next chapter name and from the last + chapter name to the next chapter entry's first chapter name. Implements #1398 and + complements #1358. +* MKVToolNix GUI: chapter editor enhancement: pressing return on the very last + chapter entry will wrap and focus the first one in the tree again. Enhances #1358. +* MKVToolNix GUI: enhancement: scrolling over input elements like combo boxes, + check boxes and radio buttons located within a scroll area will now scroll the scroll + area instead of the element the cursor is over (e.g. a combo box). Implements #1400. + +## Bug fixes + +* MKVToolNix GUI: chapter editor bug fix: whenever the additional modification of + "expanding start/end timecodes to include the minimum/maximum timecodes of their + children" was run on an edition entry then ChapterTimeStart and sometimes + ChapterTimeEnd nodes were inserted as direct children of the EditionEntry node + when saving. This resulted in invalid chapters. +* mkvmerge: bug fix: the pixel dimensions reported for VC-1 in MPEG transport streams + in verbose identification mode was 0x0. +* mkvmerge: bug fix: the number of channels and the sample rate reported for DTS in MPEG + transport streams and MPEG program streams in verbose identification mode was 0. +* all: bug fix: parsing of strings containing negative values or timecodes was broken + on 32bit architectures. Fixes #1425. +* MKVToolNix GUI: merge tool bug fix: if the output file name policy "last output + directory" was used then manual changes to the output file name weren't recognized + as changes to the last output directory. Fixes #1411. +* MKVToolNix GUI: merge tool bug fix: the "default subtitle charset" is not applied to + text subtitles from Matroska files as those are always encoded in UTF-8. Fixes + #1416. +* MKVToolNix GUI: chapter editor bug fix: the "shift timecodes" action in the mass + modification dialog wasn't working at all, and selecting multiple actions in the + dialog would result in wrong actions being executed. +* MKVToolNix GUI: bug fix: fixed the total job queue progress with respect to removing + completed jobs (either automatically or manually). Fixes #1405. +* MKVToolNix GUI: bug fix: mkvmerge is now run in with the same interface language set + for the GUI. +* mkvmerge: bug fix: The formula used for calculating the audio delay for garbage data + at the start of tracks in AVI files has been fixed again. It now uses the values + dwStart, dwScale and dwSampleSize from the AVI stream header structure instead of + values derived from the audio packet headers. Fixes #1382 and still works correctly + for #1137. +* all: the environment variable \<TOOLNAME\>_OPTIONS is now parsed for options for + TOOL (e.g. MKVMERGE_OPTIONS for mkvmerge). MKVTOOLNIX_OPTIONS is still used for + all programs. Fixes #1403. +* MKVToolNix GUI: bug fix: fixed the escaping of the command line for cmd.exe + regarding the command name itself (the very first argument). Fixes #1401. +* build system: bug fix: fixed Qt platform plugin detection on MacOS. + +## Build system changes + +* build system: removal: the switch "--without-mkvtoolnix-gui" has been removed. + There are only two GUIs left in the package: the Qt-enabled mkvinfo and MKVToolNix + GUI. Both are enabled by default and can be disabled with the option "--disable-qt". + In that case only the text-mode version of mkvinfo is built, and the MKVToolNix GUI is + not built at all. + +## Other changes + +* mkvmerge: container and track properties in verbose identification mode are now + output sorted. +* mkvmerge: the verbose identification result for the MPEG program stream, MPEG + transport stream and WAV readers has been changed for audio tracks in order to match + the Matroska reader's result. The old keys "channels", "sample_rate" and + "bits_per_sample" have been replaced by "audio_channels", + "audio_sampling_frequency" and "audio_bits_per_sample". +* Removal: all support for wxWidgets has been removed. This means that the mkvmerge + GUI (mmg) has been removed and that mkvinfo now only supports a text-mode and a + Qt-based interface. + + +# Version 8.3.0 "Over the Horizon" 2015-08-15 + +## New features and enhancements + +* MKVToolNix GUI: chapter editor enhancement: pressing return will cause the next + appropriate chapter control to be selected depending on where the focus currently + is: from a chapter input to the first chapter name, from a chapter name to the next + chapter name and from the last chapter name to the next chapter entry's start time. + Implements #1358. +* MKVToolNix GUI: enhancement: the number of running jobs is shown in the status bar. + Implements #1381. +* MKVToolNix GUI: new job queue feature: added a context menu for force-starting + selected jobs. This allows for running more than one job at the same time. Implements + #1395. +* MKVToolNix GUI: new merge tool feature: added an option for automatically setting + the "default track" flag to "no" for all subtitle tracks when they're added. + Implements #1339. +* MKVToolNix GUI: new merge tool feature: dragging & dropping files onto line edit + controls that expect file names (e.g. the "chapter file" control) will set that line + edit's text to the dropped file name. Implements #1344. +* MKVToolNix GUI: new feature: jobs in the queue can now be edited again. For that + they're re-opened in the corresponding tool and removed from the queue. Implements + #1296. +* MKVToolNix GUI: enhancement: the format of the setting and queue files has been + changed from INI style to JSON documents. Reading older setting files in INI style + remains supported, but saving will convert them to JSON. Together with the other + three changes mentioned below this results in a noticeable reduction in the time + needed for writing the queue files, e.g. when pressing "start muxing" or when + quitting the application. +* MKVToolNix GUI: enhancement: the way the job queue is stored has been changed. + Earlier all jobs were stored in the same file (or registry on Windows) as the + preferences. Now they're stored in a sub directory called "jobQueue" with one file + per queue entry. +* MKVToolNix GUI: enhancement: on Windows the preferences are not stored in the + registry anymore, not even if the application has been installed. Instead they're + stored in an INI file in the user's AppData\Local directory tree. +* MKVToolNix GUI: enhancement: the number of times the queue files are saved has been + reduced. The queue files are also loaded only once on startup, not twice. +* MKVToolNix GUI: enhancement: if an instance is already running when the + application is started a second time then the GUI requests that the already-running + instance will be activated. Implements #1379. +* MKVToolNix GUI: new feature: added an option in the preferences for automatically + switching to the job output tool whenever the user starts a job (e.g. by pressing + "start muxing"). Implements #1376. +* MKVToolNix GUI: new job output and job queue feature: added a function for opening + the output folder. Implements #1342. +* MKVToolNix GUI: new job output tool feature: added a way to clear the output, + warnings and errors views. Implements #1356. +* MKVToolNix GUI: merge tool enhancement: added "Simple OGM-style chapter files + (*.txt)" to the file selection dialog when selecting a chapter file. Implements + #1269. + +## Bug fixes + +* mkvmerge: bug fix: track statistics tags can be kept with the option "--engage + keep_track_statistics_tags". This allows outputting them in verbose + identification mode for easier parsing. Fixes #1351. +* MKVToolNix GUI: bug fix: fixed various crashes when dragging & dropping in all of the + tree views (merge tool: files view, tracks view, attachments view; chapter editor: + edition/chapter tree, chapter name list; job queue). Fixes #1365. +* MKVToolNix GUI: merge tool bug fix: attachments: sometimes changing values didn't + apply the changes to all selected attachments depending on how they were selected. + Fixes #1373. +* MKVToolNix GUI: merge tool bug fix: the automatically suggested description for + new jobs contained the file name twice, even in the directory portion. Fixes #1378. +* MKVToolNix GUI: merge tool bug fix: if "set output file name automatically" is + enabled then file names ending with a number in parenthesis (e.g. "Berlin + (1962).mkv") will keep their number in the generated output file name. Fixes #1375. +* MKVToolNix GUI: merge tool bug fix: the GUI will keep manual changes to the output + file name even if "set output file name automatically" is enabled. Fixes #1372. +* MKVToolNix GUI: bug fix: fixed the stereoscopy drop down box not being + re-translated when the GUI language is changed. Fixes #1224. +* MKVToolNix GUI: chapter editor bug fix: it was possible to drop chapter entries on + the top-level reserved for editions. Fixes #1369. +* MKVToolNix GUI: bug fix: fixed compilation when building without curl support. + Fixes #1359. + +## Build system changes + +* build system: stack protection is enabled when building with gcc on all platforms. + For Windows DEP and ASLR is enabled. Implements #1370. +* build system: the Boost detection macros were updated from www.gnu.org resulting + in better compatibility with bare-bones shells like dash. + +## Other changes + +* MKVToolNix GUI: Windows: if the application has been installed then its settings + will no longer be saved in the registry but in an INI file in the user's data + application folder (e.g. + C:\Users\mbunkus\AppData\Local\bunkus.org\mkvtoolnix-gui). + + +# Version 8.2.0 "World of Adventure" 2015-07-18 + +## New features and enhancements + +* MKVToolNix GUI: chapter editor enhancement: the template for chapter names can now + contain a number of places for the chapter number, e.g. '\<NUM:3\>'. The number will be + zero-padded if there are less places than specified. +* MKVToolNix GUI: new chapter editor feature: implemented a function for + renumbering chapters. This allows the user to automatically assign new chapter + names to one level of sub-chapters with ascending numbers. Implements #1355. +* MKVToolNix GUI: new feature: the position of the tab headers of all tab widgets can be + changed in the preferences. Implements #1334. +* MKVToolNix GUI: new feature: added an option for hiding the tool selector. +* MKVToolNix GUI: new job queue feature: added menu options for stopping the queue + either immediately or after the current job has finished. Implements #1303. +* MKVToolNix GUI: new job queue feature: added a context menu option for setting jobs + to status "pending manual start". +* MKVToolNix GUI: new merge tool feature: added context menu options for selecting + all tracks of a specific type (e.g. all audio tracks). Implements #1197. +* MKVToolNix GUI: merge tool enhancement: the dialog shown after dragging & dropping + files from external applications asking if those files should be added or appended + now has an option to always add and never to show that dialog again. For new MKVToolNix + installations the default is now to show this dialog again until the user + deactivates it either in the dialog or in the preferences. +* MKVToolNix GUI: new feature: added additional ways to move selected files, tracks + and attachments around: keyboard shortcuts (Ctrl+Up and Ctrl+Down) and optional + buttons (those have to be enabled in the preferences). Using drag & drop remains + possible. Implements #1279. +* MKVToolNix GUI: new merge tool feature: dragging files from external applications + now allows you to create new mux settings and add the dropped files to those if the + "always add dropped files" option is off. Implements #1297. +* MKVToolNix GUI: new feature: added support for displaying the queue progress on the + task bar button. Implements #1335. +* MKVToolNix GUI: new merge tool feature: implemented support for re-ordering new + attachments via drag & drop. Implements #1276. +* docs: added a Spanish translation of the man pages by Israel Lucas Torrijos (see + AUTHORS). +* MKVToolNix GUI: enhancement: several drop down boxes have had their options + renamed slightly to be more consistent overall and easier to select via the + keyboard. Implements #1309. +* MKVToolNix GUI: enhancement: position and size of the several additional windows + are saved and restored. These include: the preferences window, the dialog for + additional command line options, the dialog showing the command line and the dialog + for selecting the playlist to add. Implements #1317. +* MKVToolNix GUI: enhancement: the relative sizes of all splitters are saved and + restored. Implements #1306. + +## Bug fixes + +* mkvmerge, MKVToolNix GUI: bug fix: fixed the container type not being recognized + properly by the GUI. Now the numerical container type ID is output in verbose + identification mode by mkvmerge. +* MKVToolNix GUI: chapter editor bug fix: the file is not kept open so that you can open + it in other applications at the same time. +* MKVToolNix GUI: bug fix: if a GUI language other than English was selected then the + warning/error messages output by mkvmerge were not recognized properly and output + in the wrong text views. +* MKVToolNix GUI: merge tool bug fix: fixed loading saved settings in which an + appended file contains chapters/tags/attachments. +* mkvmerge: bug fix: fixed handling of MPEG transport streams where all PATs and PMTs + have CRC errors. Fixes #1336. +* MKVToolNix GUI: bug fix: fixed the command line option used when the "fix bitstream + timing info" check box is checked. Fixes #1337. +* MKVToolNix GUI: fix compilation with the upcoming Qt 5.5.0. Fixes #1328. +* MKVToolNix GUI: job queue bug fix: when re-starting a job the "date finished" field + wasn't reset. Fixes #1323. +* MKVToolNix GUI: merge tool bug fix: the option "set output file name relative to + first input file" caused the relative path to be applied each time a file was added + resulting in the wrong directory. Fixes #1321. +* MKVToolNix GUI: merge tool bug fix: when adding a Blu-ray playlist and aborting the + "select playlist to add" dialog the originally opened playlist was added even so. +* mkvmerge: bug fix: the MPEG-1/2 video code was causing an illegal memory access + under certain conditions. Fixes #1217 and #1278. +* MKVToolNix GUI: bug fix: the "default subtitle character set" combo box required a + selection without an option for using the system's default. An entry "– no selection + by default –" has been added at the top. +* MKVToolNix GUI: bug fix: fixed parsing command line arguments to an + already-running instance on Windows. Fixes #1322. +* MKVToolNix GUI: bug fix: fixed the combo boxes with languages, countries and + character sets not being re-initialized after changes to the list of common + languages/countries/character sets in the preferences. Fixes #1224. +* MKVToolNix GUI: chapter editor bug fix: fixed the menu entries "save to XML file" and + "save to Matroska file" not being available after loading chapters until the tool or + tab was changed. Fixes #1312. +* MKVToolNix GUI: bug fix: fixed labels and therefore the window becoming + excessively wide with long file names. Fixes #1314. +* MKVToolNix GUI: merge tool bug fix: fixed the focus marker around combo boxes inside + scroll areas not being drawn. Fixes #1310. +* MKVToolNix GUI: merge tool bug fix: fixed the stereoscopy mode being off by one. + Fixes #1311. +* MKVToolNix GUI: merge tool bug fix: fixed the --append-to calculation if more than + one file has been appended. Fixes #1313. + + +# Version 8.1.0 "Psychedelic Postcard" 2015-06-27 + +## Important notes + +* mmg: bug fix: the deprecation warning will only be shown once. Fixes #1252. + +## New features and enhancements + +* MKVToolNix GUI: merge tool enhancement: moved the "output file name" controls + below the three tabs so they're always visible. Also added an option in the + preferences to move them back inside the "output" tab. Implements #1266. +* MKVToolNix GUI: new chapter editor feature: added a function for generating a + certain number of evenly spaced sub-chapter. Implements #1291. +* MKVToolNix GUI: new chapter editor feature: implemented loading chapter entries + from Blu-ray playlists. +* MKVToolNix GUI: job queue enhancement: added menu entries for acknowledging both + warnings and errors at the same time. +* MKVToolNix GUI: new watch jobs tool feature: the first tab showing the output of the + current job has been changed to show the output of all jobs that have been run since the + GUI's been started. This can be turned off in the preferences so that only the output + of the currently running job is shown again. Implements #1263. +* MKVToolNix GUI: new merge tool feature: added an option to set a directory relative + to the first input file as the default output directory. Implements #1261. +* MKVToolNix GUI: new feature: added a check box to the + track/chapters/tags/attachments list. This offers an additional way of toggling + the "mux this" state of entries, same as the drop down box on the right and as + double-clicking on the item already did. Implements #1277. +* MKVToolNix GUI: new feature: added an option for always using the suggested + description and not asking the user when adding a job to the queue. Implements #1288. +* MKVToolNix GUI: job queue enhancement: added the shortcut Ctrl+R for the menu entry + "start all pending jobs". Implements #1287. +* MKVToolNix GUI: new feature: added an option to always treat files dragged & dropped + external applications as being added circumventing the question what to do with + them (add, append or add as additional parts). This option is enabled by default + changing the default behavior from release 8.0.0. Implements #1259. +* MKVToolNix GUI: new feature: added an optional action after starting a job or adding + one to the queue. This can be either to create whole new settings or to only remove all + input files. Implements #1254. +* Installer for Windows: enhancement: associated the .mtxcfg files with MKVToolNix + GUI. Implements #1258. +* MIME and desktop files: enhancement: added file associations for .mtxcfg with + MKVToolNix GUI. Implements #1258. +* MKVToolNix GUI: new feature: implemented command line handling. You can open + configuration files, add files to merge jobs, open files in the chapter or header + editors. Implements #1209. + +## Bug fixes + +* mmg: bug fix: fixed handling of the characters [ and ] in container and track + properties. +* MKVToolNix GUI: merge tool bug fix: fixed various menu entries not working + correctly after closing a tab or switching to another one. Fixes #1301. +* MKVToolNix GUI: merge tool bug fix: if "automatically set the file title" is enabled + then the title field will be cleared after all source files have been removed. +* MKVToolNix GUI: merge tool bug fix: fixed a crash when enabling/disabling chapters + coming from an appended file. Fixes #1293. +* MKVToolNix GUI: merge tool bug fix: it was possible to set the "default track flag" to + "yes" for multiple tracks of the same type. Fixes #1289. +* MKVToolNix GUI: enhancement: the "open file" dialogs for the chapter and header + editor tools will use the same directory that was last used in the merge tool. Fixes + #1290. +* MKVToolNix GUI: bug fix: fixed reading the "default track" flag of tracks from added + Matroska files. Fixes #1281. +* MKVToolNix GUI: merge tool bug fix: when appending files with multiple tracks of a + type (e.g. multiple audio tracks) then all tracks of that kind would get assigned to + the first track of that kind of the file they're appended to. Now the second audio + track from the appended file is appended to the second audio track of the existing + file, the third to the third etc. Fixes #1257. +* MKVToolNix GUI: merge tool bug fix: fixed automatic output file name re-generation + when the mux status of tracks changes. Fixes #1253. +* mkvmerge: bug fix: fixed recognition of (E)AC-3 audio tracks using a FourCC of + "ec-3". Fixes #1272. +* MKVToolNix GUI: merge tool bug fix: fixed attachments not being merged into the file + in certain situations. Fixes #1260. +* MKVToolNix GUI: merge tool bug fix: fixed showing existing attachments present in + source files in the "tracks, chapters, tags and attachments" list. Fixes #1256. +* MKVToolNix GUI: merge tool bug fix: the jobs created when appending files were + incorrect resulting in an error message from mkvmerge. Fixes #1271. +* mkvpropedit: bug fix: fixed a warning about "edit specifications resolving to the + same track" when changing the track properties and setting tags for the same track + simultaneously. Fixes #1247. +* MKVToolNix GUI: merge tool bug fix: the output/destination file name is cleared + when all files are removed. Fixes #1265. +* MKVToolNix GUI: merge tool bug fix: fixed command line escaping for empty + arguments. Fixes #1270. +* MKVToolNix GUI: merge tool bug fix: fixed creating files without a title if one of the + input files contains a file title. Fixes #1264. +* MKVToolNix GUI: bug fix: if the job removal policy is set to "remove even if there were + warnings" then jobs that were muxed without warnings weren't removed. Fixes #1262. +* Build system: fixed inclusion of desktop files for the two GUIs for Debian/Ubuntu + packages. Fixes #1255. + + +# Version 8.0.0 "Til The Day That I Die" 2015-06-19 + +## New features and enhancements + +* MKVToolNix GUI: merge tool enhancement: drag & drop of files works even if no mux + settings are currently open. Implements #1245. +* MKVToolNix GUI: job output enhancement: when clicking the "abort" button the GUI + asks for confirmation before aborting. Both this check and the one when quitting the + application can be turned off via an option in the preferences. Implements #1238. +* MKVToolNix GUI: new merge tool, header & chapter editor features: the GUI will ask + for confirmation before closing or reloading tabs that have been modified and + before quitting if there are modified tabs. This check can be disabled in the + preferences. Implements #1211. +* MKVToolNix GUI: new merge tool feature: implemented an option that allows the user + to set up a list of languages. When adding files only those tracks whose language is + included in that list are set to be muxed by default. Implements #1227. +* MKVToolNix GUI: new feature: added an option in the preferences for disabling + additional lossless compression for all track types. Implements #1174. +* mkvmerge, MKVToolNix GUI: new feature: added an option ("--engage + keep_last_chapter_in_mpls") that will cause mkvmerge not to remove the last + chapter entry from a Blu-ray play list file which mkvmerge normally does if that + entry's timecode is within five seconds of the movie's end. Implements #1226. +* MKVToolNix GUI: new watch jobs tool feature: implemented estimating the remaining + time for both the current job and the whole queue. +* MKVToolNix GUI: enhancement: the following dialogs can now be maximized: the + "preferences" dialog; the "additional command line options" dialog; the dialog + showing the command line; the dialog where the user selects the play list to add. + Implements #1231. +* MKVToolNix GUI: merge tool enhancement: pressing delete when the source files view + is focused will cause the selected source files to be removed. Implements #1225. +* MKVToolNix GUI: merge tool enhancement: implemented toggling of "mux this" for all + selected tracks by either double-clicking on the tracks or pressing enter/return + when the tracks view is currently focused. Implements #1225. +* MKVToolNix GUI: job queue enhancement: added a menu entry for starting all jobs + pending manual start. Implements #1228. +* MKVToolNix GUI: enhancement: the text in all message box dialogs can now be selected + & copied, even on Windows. Implements #1230. +* all: the detection whether or not the applications are installed on Windows is done + by checking for the presence of a special file in the program folder instead of + checking for an entry in the registry written by the installer. This enables users to + try new portable versions without having to uninstall an installed version first as + their settings will be kept separate now. A side effect is that compatibility with + Windows XP should be restored. Implements #1229. +* mkvmerge: enhancement: if running in GUI mode (parameter "--gui-mode") then the + progress will be output as the untranslated "#GUI#progress …%" in order to + facilitate parsing of progress by GUIs. +* MKVToolNix GUI: new feature: added a "help" menu with links to several parts of the + MKVToolNix documentation. Implements #1195. +* MKVToolNix GUI: job output tool: added a button for acknowleding the + warnings/errors produced for the job shown. Implements #1210 and is the last part of + the implementation of #1196. +* MKVToolNix GUI: enhancement: header editor: made the meaning of the "Reset" button + clearer with a better label and an additional tool tip. Implements #1212. +* MKVToolNix GUI: enhancement: the tabs for the tools that haven't been implemented + yet (extraction, info and the tag editor) are not shown anymore. +* MKVToolNix GUI: enhancement: the update check dialog showing the change log can now + be maximized. Implements #1204. +* MKVToolNix GUI: new feature: implemented viewing the output of any job in the job + queue. +* MKVToolNix GUI: new feature: implemented saving the job output to a file. +* MKVToolNix GUI: enhancement: language and country drop-down boxes will contain + the common languages/countries both at the top as well as in the full list. Part of the + implementation of #1200. +* MKVToolNix GUI: enhancement: the entry "Undefined (und)" is always shown at the top + of the language drop-down boxes. Part of the implementation of #1200. +* MKVToolNix GUI: enhancement: the number of new warnings and errors are shown in the + status bar. Both counters can be acknowledged via context menus on the status bar and + in the job queue view. Part of the implementation of #1199. +* MKVToolNix GUI: enhancement: the number of jobs pending automatic/manual + execution is listed in the status bar. Part of the implementation of #1199. +* MKVToolNix GUI: enhancement: the progress widget in the stats bar is not reset to 0 + once all the jobs have been processed in order to signal the user that the jobs have + actually been processed. Part of the implementation of #1198. +* MKVToolNix GUI: merge tool enhancement: a short animation of a moving icon is shown + when a job is started or added to the job queue as a clue to the user what's happening and + where to look for output. This animation can be disabled in the preferences. + Implements #1198. +* MKVToolNix GUI: chapter editor enhancements: when selecting a chapter the the + chapter name closest to the previously selected chapter name (or the first if there + wasn't a previously selected one) is selected automatically. +* MKVToolNix GUI: chapter editor enhancements: when starting a new file a single + edition and a single chapter are added automatically. +* MKVToolNix GUI: merge tool enhancement: the "add files" button has been re-labeled + "add source files" in order to make it clearer that it cannot be used for adding + attachments, even if the attachments tab is the currently selected tab. +* MKVToolNix GUI: merge tool & job queue tool enhancement: short tool tips will be + shown for the files, tracks, attachments and jobs views telling the user to + right-click for adding files and similar actions. +* MKVToolNix GUI: new feature for the merge tool, the header and chapter editors: if no + file is open then "new" and "open file" buttons are shown. + +## Bug fixes + +* MKVToolNix GUI: improved locating the mkvmerge executable on non-Windows + systems. Fixes #1246. +* MKVToolNix GUI: chapter editor bug fix: dragging & dropping a file onto the chapter + editor that cannot be parsed as chapters was causing a confusing warning about + changed chapters not being saved. +* MKVToolNix GUI: merge tool bug fix: fixed several controls not changing their + language correctly when the interface language is changed. +* mkvmerge: bug fix: fixed codec identification for MP2 audio read from MPEG + program/transport streams. Fixes #1242. +* MKVToolNix GUI: job output bug fix: fixed displaying the estimated remaining time + in tabs that have been opened for specific jobs. Fixes #1244. +* MKVToolNix GUI: header editor bug fix: fixed the editor assuming values were + changed if a track is present whose language element is not present in the file. Fixes + #1240. +* MKVToolNix GUI: bug fix: fixed the translation of the tool tip for the "close tab" + buttons after changing the interface language. Fixes #1237. +* MKVToolNix GUI: bug fix: appended tracks will be disabled automatically when + starting to mux if the track they're appended to has been disabled by the user. +* MKVToolNix GUI: fixed updating the number of pending jobs info in the status bar when + manually starting jobs. Fixes #1236. +* MKVToolNix GUI: merge tool bug fix: fixed a crash when removing source files. Fixes + #1235. +* MKVToolNix GUI: merge tool bug fix: the default settings for the "output directory + policy" was changed to "same directory as the first input file". Fixes #1234. +* MKVToolNix GUI: bug fix: on Windows the job queue was accidentally always saved to + and loaded from the registry even if the portable version was used. +* MKVToolNix GUI: job queue bug fix: fixed accidental duplication of lines when using + drag & drop in certain ways. Fixes #1221. +* MKVToolNix GUI: bug fix: if a job is running when the user wants to quit requires + confirmation from the user that the running job should be aborted. Fixes #1219. +* MKVToolNix GUI: bug fix: fixed the initial status display when viewing a job's + output from the queue. +* MKVToolNix GUI: bug fix: running jobs cannot be removed from the job queue anymore. + Fixes #1220. +* MKVToolNix GUI: bug fix: when starting the GUI old jobs from the queue were silently + discarded if they included additional parts (e.g. VOBs). +* MKVToolNix GUI: bug fix: job queue: when saving the job queue jobs removed in the GUI + were not removed from the stored settings. +* MKVToolNix GUI: bug fix: when viewing the job output of a job that hasn't been run yet + the "save output" button was enabled. +* mkvmerge, mkvpropedit: bug fix: fixed an invalid memory access leading to a crash in + the Base 64 decoder. Fixes #1222. +* MKVToolNix GUI: bug fix: fixed progress parsing for interface languages other than + English. +* mkvmerge: bug fix: fixed key frame designation for video tracks in MP4 DASH files. +* mkvmerge: bug fix: the track statistics tags of Matroska source files are always + discarded, no matter whether or not they're to be created for the output file. That + way they won't be reported as track tags by mkvmerge's identification mode. This + makes it easier for the user to create output files without track statistics tags as + (s)he only has to use the option "--disable-track-statistics-tags" and not + disable all the track tags as well anymore. Fixes #1186. +* mkvmerge, mkvinfo, mkvextract: bug fix: fixed a crash with certain types of invalid + Matroska files. Fix for #1183. +* all: bug fix: removed some unused code thereby fixing compilation on OpenBSD + (#1215). +* MKVToolNix GUI: bug fix: fix alignment of the tool contents with the tool selector at + the bottom. Fixes #1194. +* MKVToolNix GUI: bug fix: header editor: fixed the track language shown if the + element is not present in the file. +* MKVToolNix GUI: bug fix: when browsing the output file name the currently entered + file name is pre-selected in the dialog. Fixes #1207. +* MKVToolNix GUI: job output bug fix: fixed superfluous empty lines in job + output/warning/error output. +* MKVToolNix GUI: merge tool bug fix: when adding a VOB from a DVD the tree items for the + additional parts (the other VOBs processed automatically) weren't shown. +* MKVToolNix GUI: merge tool: fixed the scroll bar not disappearing in the input tab if + the window is high enough. Fixes #1193. +* build system: desktop files and icons were only installed if wxWidgets was enabled. + Fixes #1188. +* man pages: clarify functionality of --default-duration. Fixes #1191. +* build system: bug fix: fixed running rake if no locale or one with an encoding other + than UTF-8 is set. Fixes #1189. + +## Other changes + +* MKVToolNix GUI: merge tool: the "save" button has been removed in favor of the + "save…" menu entries. This also improves consistency with the other tools. + + +# Version 7.9.0 "Birds" 2015-05-10 + +## New features and enhancements + +* MKVToolNix GUI: new feature: added context menu entries for tracks: "select all", + "enable all" and "disable all". +* MKVToolNix GUI: new feature: implemented aborting the currently running job. +* MKVToolNix GUI: new feature: implemented the "additional command line options" + dialog. +* MKVToolNix GUI: new feature in the chapter editor: added features "set the + language/country of the selected chapter and its sub-chapters". +* MKVToolNix GUI: new feature in the chapter editor: added features "clamping time + stamps of sub-chapters to their parent's time stamps", "expanding time stamps of + chapters to encompass their sub-chapters' time stamps" and "shifting start and end + time stamps by an offset". +* MKVToolNix GUI: new feature: the main window's size, position and state + (maximized/minimized) is saved on exit and restored on startup. +* MKVToolNix GUI: new feature: the GUI is now fully translatable. The German + translation has been completed for the GUI, too. +* MKVToolNix GUI: new feature: implemented changing the interface language. +* MKVToolNix GUI: enhancement: implemented often used subtitle character sets. +* MKVToolNix GUI: enhancement: implemented setting a user configurable subtitle + character set by default. +* MKVToolNix GUI: enhancement: implemented the automatic removal of jobs + configurable by the user. +* mkvmerge: enhancement for MPEG program stream handling: mkvmerge will only look + for additional files automatically if the source file begins with "VTS_…" and just + if it ends in a number. E.g. when reading "video_1.mpg" another file called + "video_2.mpg" will no longer be read automatically. Implements #1164. +* MKVToolNix GUI: enhancement: display country names in addition to country codes. +* MKVToolNix GUI: enhancement: implemented often used languages and country codes. +* MKVToolNix GUI: chapter editor enhancement: implemented defaults for the + language and country settings for newly created chapter names. +* MKVToolNix GUI: merge tool enhancement: added controls for mkvmerge's "reduce + audio to its core" and "force NALU size length" features. +* MKVToolNix GUI: new feature: implemented the "Preferences" dialog (not all of the + functionality the options refer to has been implemented yet, though). +* MKVToolNix GUI: merge tool enhancement: Implemented adding and append files and + adding files as additional parts via drag & drop from external applications. +* MKVToolNix GUI: chapter editor enhancement: implemented opening files via drag & + drop from external applications. +* MKVToolNix GUI: enhancement: The portable Windows version will store its settings + in a file in the same folder instead of the registry. +* MKVToolNix GUI: enhancement: Qt's "Windows Vista" style is now used on Windows + instead of the old, Windows 98-like "Windows" style. +* MKVToolNix GUI: merge tool enhancement: The merge tool has been re-written to be + tabbed like the header and chapter editors allowing for multiple merge job settings + to be open at the same time. +* MKVToolNix GUI: chapter editor enhancement: implemented re-ordering chapters + and editions with drag & drop. +* MKVToolNix GUI: new feature: implemented the chapter editor. +* MKVToolNix GUI: merge tool enhancement: implemented adding attachments via drag & + drop from external applications. +* MKVToolNix GUI: new feature: implemented the header editor. +* mkvmerge: enhancement: Implemented proper type output during identification for + DTS-ES (extended surround) tracks. Implements #1157. +* MKVToolNix GUI: new feature: implemented the online update check. +* mkvmerge: new feature: Implemented support for the DTS-HD container format. +* mkvmerge: new feature: Implemented support for core-less DTS streams consisting + solely of XLL extension sub-streams. +* mkvmerge: new feature: track selection can be done by language codes as well. + Affects the options --audio-tracks, --button-tracks, --subtitle-tracks and + --video-tracks. Works only for containers that actually provide a language tag. + Implements #1108. + +## Bug fixes + +* mkvinfo: bug fix: mkvinfo would exit with the wrong return code (0 instead of 2) if a + non-existing file name had been given. Fixes #1182. +* all: fix compilation on macOS in common/command_line.cpp due to + boost::range::filtered requiring a copyable functor. Fixes #1175. +* all: fix compilation on macOS in common/version.cpp due to wrong usage of + std::stringstream and ostream operators. Fixes #1176. +* all: bug fix: fixed compilation with Boost 1.58.0. Fixes #1172. +* mkvmerge: bug fix: Fixed a segmentation fault during cleanup after Ctrl+C was + pressed. Fixes #1173. +* mkvmerge: bug fix: fixed --sync not doing anything if --default-duration is used + for the same track, too. +* mkvmerge: bug fix: fixed aborting file identification with an error message about + "aac_error_protection_specific_config" that happened for some files. Fixes + #1166. +* mkvmerge: bug fix: fixed specifying track properties like language or name for AC-3 + cores embedded in TrueHD tracks when they're read from raw thd+ac3 files. Fixes + #1158. +* mkvmerge: bug fix: MPEG-1/2 parser: fixed a long-standing issue that prevented + mkvmerge from recognizing certain MPEG-1/2 video tracks and files if the frame's + sequence numbers didn't follow a certain expected pattern. Fixes #1162 and + probably others like #1145 or #1099. +* MKVToolNix GUI: merge tool bug fix: fixed the column headers on the "attachments" + tab. +* mkvmerge: bug fix: The calculation of the width and height of HEVC/H.265 video + tracks did not take the conformance window (cropping) into account. Fixes #1152. +* mkvmerge: bug fix: Fixed the value of the DocTypeVersion header field if any of the + Matroska elements CodecDelay, DiscardPadding or SeekPreRoll is used. This is the + case for Opus tracks. +* mkvmerge: bug fix: Fixed the handling of E-AC-3 tracks in M2TS files if the AC-3 core + and the extension are stored in separate packets. +* source code: bug fix: Accidental uses of the "long double" type have been converted + to normal "double"s. This fixes compilation on platforms which don't support the + "long double" type in combination with Boost::Math. Fixes #1150. + +## Build system changes + +* build system: configure will now check for Qt by default. If at least v5.2.0 is found + then the Qt versions of mkvinfo's GUI and the new mkvtoolnix-gui will be enabled. You + can affect this detection with the options --disable-gui (turns off all GUIs; works + the same as before), --disable-qt (will compile the wxWidgets GUI for mkvinfo and + mmg) and --without-mkvtoolnix-gui (will compile the Qt version of mkvinfo's GUI + but no mkvtoolnix-gui). + +## Other changes + +* mkvmerge: Two more characters are now escaped in the container and track properties + output in verbose identification mode: [ is replaced with \b and ] with \B. This is + needed for reliable parsing by other programs, e.g. GUIs. +* all: permanently removed the build times tamp from the version information and the + corresponding configure option. + + +# Version 7.8.0 "River Man" 2015-03-27 + +## New features and enhancements + +* mkvmerge: enhancement: File type identification will output a more detailed + description of the DTS type for DTS audio tracks (DTS-HD Master Audio, DTS-HD High + Resolution, DTS Express or just plain DTS). Implements #1109. +* mkvmerge: new feature: Implemented support for DTS Express. +* all: new feature: added a Swedish translation of the programs by Kristoffer + Grundström (see AUTHORS). +* mkvinfo (Qt interface): enhancement: implemented support for opening files via + drag & drop. +* mkvmerge: enhancement: added an option (--engage no_delay_for_garbage_in_avi) + for disabling deriving a delay from garbage in audio tracks in AVI files. Requested + in #1137. + +## Bug fixes + +* mkvmerge: bug fix: HEVC tracks which did not have an aspect ratio present in their + sequence parameter set were copied incorrectly; the resulting sequence parameter + set was invalid. Fixes #1081. +* mkvextract: bug fix: When extracting HEVC tracks mkvextract will use the same start + code lengths that x265 uses (four bytes 0x00000001 for the first and + video/picture/sequence parameter set NALs and three bytes 0x000001 for all + others). +* mkvmerge: bug fix: The number of channels in DTS tracks with more than six channels is + now recognized correctly by parsing the DTS HD extensions, too. Fixes #1139. +* mkvmerge: bug fix: Fixed handling of the BITIMAPINFOHEADER extra data size + handling during merging and extraction for codecs like HuffYUV. +* mkvmerge: bug fix: When appending unframed HEVC/H.265 tracks and setting the + default duration the second and all following source parts will use the same default + duration as set for the first part. Fixes #1147. +* mkvmerge: bug fix: enabled the use of tags in WebM files. Tagging elements not + supported by the WebM specs are removed. Fixes #1143. +* mkvmerge: bug fix: fixed detection of audio tracks in QuickTime files whose FourCC + code is unknown to mkvmerge. +* mkvmerge: bug fix: fixed detection of video tracks in QuickTime files whose FourCC + code is unknown to mkvmerge. +* mkvextract: bug fix: Fixed VobSub file naming when mkvextract is built against + Boost::Filesystem older than 1.50.0. Fixes #1140. +* mkvmerge: bug fix: fixed detection of Cinepak video tracks in QuickTime files. +* mkvmerge: bug fix: fixed detection of PCM audio tracks in QuickTime files using the + "raw " FourCC. +* mkvmerge: bug fix: fixed detection of tracks in Flash Video files for which the + headers do not signal a track. +* mkvmerge: bug fix: fixed a segfault in the Flash Video file format reader. +* mkvmerge: bug fix: Fixed file type detection for MP3 files with big ID3 tags at the + start of the file (e.g. if they contain cover images). +* mkvmerge: bug fix: The formula used for calculating the audio delay for garbage data + at the start of tracks in AVI files has been fixed. Fixes #1137. + +## Build system changes + +* build system: Boost's "Math" library is now required. + +## Other changes + +* mmg: The change making the window wider by default has been reverted. + + +# Version 7.7.0 "Six Voices" 2015-02-28 + +## Important notes + +* mkvmerge: removal: AAC: The hack for using the old codec IDs (e.g. + A_AAC/MPEG4/LC/SBR) for AAC tracks has been removed. Those codec IDs have been + deprecated for nearly ten years. Reading files that use those IDs will stay + supported. + +## New features and enhancements + +* mmg: new feature: added a button "toggle all" that enables or disables all tracks. It + at least one track is currently disabled then all tracks are enabled when pressing + that button. Otherwise (if all tracks are currently enabled) then they will all be + disabled. Implements #1130. +* mmg: new feature: added a new checkbox "reduce to audio core" on the + "format-specific options" tab that passes the new --reduce-to-core option to + mkvmerge if enabled. Part of the implementation of #1107. +* mkvextract: new feature: implemented a mode for extracting cue information. +* mkvmerge: enhancement: The code for determining the time codes of AAC, AC-3, DTS, + MP3 and TrueHD packets has been completely rewritten. This improves how timecodes + are kept if the source container provides them in many cases. +* mkvmerge: new feature: Added an option "--reduce-to-core" that tells mkvmerge not + to copy HD extensions for DTS tracks. Part of the implementation of #1107. +* mkvmerge: new feature: mkvmerge will now recognize TrueHD tracks inside MPEG + transport streams that contain an AC-3 core as consisting of two tracks. Instead of + always dropping the AC-3 part the user can simply select which tracks to keep. Part of + the implementation of #1107. +* mkvmerge: new feature: mkvmerge will now recognize TrueHD+AC-3 files as + consisting of two tracks. Instead of always dropping the AC-3 part the user can + simply select which tracks to keep. Part of the implementation of #1107. + +## Bug fixes + +* source code: Fixed the compilation on cygwin. +* documentation: The Dutch, Ukrainian and Chinese (Simplified) manual pages have + contained only untranslated English strings since release 7.0.0. This was due to + the files holding the translatable strings having being corrupted by a misbehaving + tool in the build process. This has been rectified. Fixes #1134, +* mkvmerge: bug fix: Fixed reading all of the private codec data in AVIs from the 'strf' + chunk for codecs that don't set biSize to include that data. Fixes #1129. +* mkvextract: bug fix: Fixed writing AVIs with ckSize fields that were too large. + Fixes #1128. +* mkvmerge: bug fix: fixed determining the key frame status in certain AVIs (those + whose dwFlags index field has more bits set than just 0x10). +* mkvinfo (Qt interface): bug fix: added WebM extensions to the known types in the + "Open file" dialog. +* mkvextract: bug fix: Fixed writing AVIs with the wrong bit depth for video codecs + that don't use 24 bits/pixel. Fixes #1123. +* mkvmerge: bug fix: Fixed recognition of E-AC-3 audio tracks in MPEG transport + streams if they use the type ID 0xa1 (and the same for DTS tracks stored with type ID + 0xa2). Fixes #1126. +* mkvextract: bug fix: Fixed VobSubs being written to the wrong directory if the + output file name given by the user didn't have an extension but one of the directories + contained a dot. Fixes #1124. +* mkvpropedit, mmg's header editor: bug fix: if updating the file required creating + an EBML void for a 130 bytes long gap then the void element created was one byte too + short resulting in an invalid file structure. Fixes #1121. +* mkvmerge: bug fix: If the MP4 track headers for MP3 tracks contain invalid values + (number of channels is 0 or the sampling rate is 0) then mkvmerge will re-derive these + parameters from the MP3 bitstream instead of ignoring that track. +* mkvmerge: bug fix: Matroska reader: track-specific tags weren't copied for tracks + for which the pass-through packetizer was used (e.g. those with the codec ID + A_MS/ACM) instead of a specialized one. + +## Build system changes + +* build system: new feature: added configure options for building + statically-linked binaries (--enable-static). Patches by Florent Thiéry. + Implements #1119. + +## Other changes + +* mkvmerge: removal: TrueHD: The hack for merging a sync frame and all following + normal frames into a single Matroska packet has been removed as there are no players + that can play such merged frames anyway. + + +# Version 7.6.0 "Garden of Dreams" 2015-02-08 + +## New features and enhancements + +* all: new feature: added a Serbian (Latin) translation of the programs by Danko (see + AUTHORS). + +## Bug fixes + +* all programs: bug fix: Since release 7.0.0 the wrong exit code was used when warnings + were finished (0 instead of 1). Fixes #1101. +* mkvmerge: bug fix: Appending chapters with the same chapter UID was dropping all + sub-chapters from the one of the two merged chapters. Now the sub-chapters are + merged recursively as well. +* mkvmerge: bug fix: The wrong Codec ID was written when reading PCM tracks from + Matroska files in Big Endian byte order. Fixes #1113. +* mkvmerge: bug fix: If splitting was active and AC-3 tracks read from Matroska files + were shorter than a split point then the following output file would contain an AC-3 + packet with the timecode of 00:00:00 somewhere in the middle. Fixes #1104. +* mmg: bug fix: If a chapter track from a Matroska file is selected then the "language" + drop-down box is disabled. Fixes #1105. +* mkvmerge: bug fix: On Windows the end-of-file-reached status wasn't tracked + correctly for certain file operations. This could manifest in e.g. mkvmerge not + finding tracks in MPEG transport streams when probing MPLS playlist files. Fixes + #1100. +* mmg: bug fix: When scanning for play lists the window presenting the results listed + some properties in an unescaped way (e.g. "\s" instead of spaces). +* mmg: bug fix: When adding MPLS files mmg was only offering to scan for more playlists + if there were at least two additional MPLS files present. This has been fixed to one + MPLS file (in addition to the one just added). + + +# Version 7.5.0 "Glass Culture" 2015-01-04 + +## New features and enhancements + +* mkvmerge: new feature: implemented support for MP4 DASH files. Implements #1038. +* mkvmerge: new feature: implemented reading MPEG-H p2/HEVC video tracks from MP4 + files. Implements #996. +* all: enhancement: improved exception messages that can occur when reading damaged + Matroska files to make it clearer for the user what's happening. See #1089. +* mkvmerge: new feature: Added support for reading HEVC/H.265 video tracks from MPEG + transport streams. Implements #995. + +## Bug fixes + +* mkvmerge: bug fix: If the target drive is full then a nicer error message is output + instead of simply crashing due to an uncaught exception. +* mkvmerge: bug fix: Fixed reading MPEG transport streams in which all PATs and/or + PMTs have CRC errors. Fixes #1100. +* all: bug fix: Re-wrote the whole checksum calculation code. This lead to a fix for the + Adler-32 checksum algorithm that was triggered under certain circumstances. + Adler-32 is used in mkvinfo's output (e.g. in summary mode or if checksums are + activated), in the HEVC/H.265 bitstream and TrueAudio (TTA) file headers. +* mkvmerge: bug fix: fixed handling of HE-AACv2 with object type "parametric + stereo". +* mkvinfo: bug fix: track statistics: the duration (and therefore the estimated + bitrate) was wrong for files in which the frame with the maximum timecode wasn't the + last frame in the file. Fixes #1092. +* mkvmerge: new feature: implemented support for AAC in LOAS/LATM multiplex if read + from MPEG transport streams or raw LOAS/LATM AAC files. Implements #877 and fixes + the underlying issue in #832. +* all: bug fix: several fixes have gone into libEBML and libMatroska that prevent + illegal memory access (both reading from and writing to unallocated addresses). + The bugs #1089 and #1096 have thus been fixed. +* mkvinfo: bug fix: mkvinfo will abort with a proper error message if the first element + found is not an EBML head element. See #1089. +* mkvinfo: bug fix: Timecodes output with ms resolution are now rounded to ms instead + of simply cut off. Fixes #1093. + +## Build system changes + +* build system: libEBML and libMatroska have been changed to provide pkg-config + configuration files. Therefore MKVToolNix' build system has been switched to look + for both libraries via pkg-config. +* build system: libMatroska v1.4.2 is now required as part of a fix for #1096. +* build system: libEBML v1.3.1 is now required as a part of a fix for #1089. + + +# Version 7.4.0 "Circles" 2014-12-12 + +## New features and enhancements + +* all: new feature: added a Catalan translation of the programs by Antoni Bella Pérez + (see AUTHORS). + +## Bug fixes + +* mkvmerge: bug fix: mkvmerge was sometimes dropping lines from teletext subtitles + read from MPEG transport streams. See #773. +* mkvmerge: bug fix: The PCM packetizer was producing wrong track statistics by + disregarding the last packet's duration when reading PCM data from packaged + sources (Matroska, MP4 files). Fixes #1075. +* build system: enhancement: configure will look for a system version of the pugixml + library and use that instead of the bundled version if it is found. Fixes #1090. +* mkvextract: bug fix for chapter & tag extraction: If locale is set to a non-UTF locale + (including C or POSIX) then no XML data was output at all even if the XML data contained + ASCII characters only. Fixes #1086. This also fixes mkvextract writing two BOMs + when extracting tags with the "--redirect-output" option on Windows. +* mkvinfo: bug fix: summary mode: reported frame types in block groups are now derived + from the number of references found and not by the references' values. +* mkvmerge: bug fix: Fixed muxing open GOPs after I frames in MPEG-1/2 video (patch by + Stefan Pöschel). Fixes #1084. +* mmg: bug fix: VP9 video tracks are accepted in WebM mode. +* mkvmerge: bug fix: Cherry-picked several commits from DivX' mkvmerge fork for + improved HEVC handling. Fixes #1076. +* mkvmerge: bug fix: Fixed the handling of Big Endian PCM tracks read from MP4 files. + Fixes #1078. + + +# Version 7.3.0 "Nouages" 2014-10-22 + +## New features and enhancements + +* mkvmerge: new feature: implemented support for reading teletext subtitles from + MPEG transport streams. They're converted to SRT-style subtitles (CodecID + S_TEXT/UTF8). Implements #773. +* MKVToolNix GUI: implemented drag & drop in the files pane. +* MKVToolNix GUI: implemented drag & drop in the track pane. +* mkvmerge: new feature: added support for PCM in MPEG program streams (.vob – DVDs) + and transport streams (.ts, .m2ts – Blu-rays). Implements #763. +* MKVToolNix GUI: implemented drag & drop in the job queue. +* MKVToolNix GUI: implemented storing the job queue when the application exits and + retrieving it when it starts again. +* MKVToolNix GUI: implemented setting the file title automatically from added files + that already have a title. + +## Bug fixes + +* mkvmerge: bug fix: probing MPEG transport streams with certain types of broken + MPEG-2 inside caused mkvmerge to exit with an error message. Such tracks are now + ignored instead. +* mkvmerge, mmg's chapter editor: fixed the default value for the "language" element + if it isn't present in a chapter XML file. +* mkvinfo (Qt version on Windows): bug fix: the console window is closed if the GUI is + launched. +* mkvmerge: bug fix: Reading tracks from MPEG transport streams resulted in the track + being cut off at points with a five minute gap in between frames. It is due to timecode + wrap detection introduced in v6.9.0. As it affects subtitles the most the wrap + detection has been relaxed for them. +* MKVToolNix GUI: fixed missing command line switch for audio sync/stretch. +* Installer: bug fix: the shortcut for the GUI preview on the desktop is removed upon + uninstallation. If the user opts not to have shortcuts on the desktop then no + shortcut is created for the GUI preview either. +* MKVToolNix GUI: fixed clearing the file/track/attachment lists when starting a + new config or when loading an existing one. +* MKVToolNix GUI: implemented setting the output file name automatically in four + different modes (don't set at all; place in previous output directory; place in + fixed output directory; place in parent directory of first source file) with an + option to make them unique by appending a running number. + + +# Version 7.2.0 "On Every Street" 2014-09-13 + +## Bug fixes + +* mkvmerge: bug fix: Fixed calculating AC-3 delay from garbage data when reading AC-3 + from AVIs. This stopped working in release 5.4.0 due to commit 97cc2121. +* mkvextract: bug fix: SSA/ASS files with sections after "[Events]" in their + CodecPrivate are now handled correctly. Fixes #1057. +* mkvmerge: bug fix: Fixed handling certain edit list types in MP4 files that are used + for positive track delays. Fixes #1059. +* source: Fixed compilation with Boost 1.56.0 which changed the "indexed" range + adaptor in an incompatible way. +* mkvpropedit, mmg's header editor: bug fix: when editing files with missing track + UID elements such an element will be generated automatically instead of crashing + and leaving the file in an unplayable state. Part of a fix for #1050. +* mkvmerge: bug fix: Reading Matroska files with missing track UID elements will no + longer cause mkvmerge to abort with an error. A warning is printed and a new unique + track ID generated instead. Part of a fix for #1050. + +## Other changes + +* MKVToolNix GUI: included a first preview version in the Windows installer and + portable releases. + + +# Version 7.1.0 "Good Love" 2014-07-27 + +## New features and enhancements + +* mkvmerge: enhancement: SSA/ASS: in addition to semicolons comments can now start + with exclamation marks, too. + +## Bug fixes + +* all: bug fix: Fixed file seeking code for "seek relative to end of file" case. Fixes + #1035. +* mmg: bug fix: Selecting the root of the chapter editor tree will disable the + language/country inputs properly as changing those fields doesn't make sense for + the root. +* all: bug fix: if MKVToolNix on Windows is residing in a directory containing + non-ASCII characters then translations weren't found. This has only been fixed for + cases where those non-ASCII characters are part of the system's active code page. +* mkvmerge: bug fix: track statistics tags are not written for WebM files anymore as + the WebM specification doesn't allow tags. +* mkvmerge: bug fix: Fixed wrong default duration for PCM audio tracks if the source + file provides timecodes for that track. Fixes #1001 and #1033. +* mkvextract: bug fix: Fixed a crash when opening damaged/invalid Matroska files in + all extraction modes. Fixes #1027. + + +# Version 7.0.0 "Where We Going" 2014-06-09 + +## New features and enhancements + +* mkvmerge: enhancement: In addition to the track statistics tags "BPS", + "DURATION", "NUMBER_OF_BYTES" and "NUMBER_OF_FRAMES" mkvmerge will write two + more tags identifying which application wrote the statistics + ("_STATISTICS_WRITING_APP") and when the file in question was written: + "_STATISTICS_WRITING_DATE_UTC". "_STATISTICS_WRITING_APP" will always + contain the same string contained in the segment info header element "WritingApp". + "_STATISTICS_WRITING_DATE_UTC" will contain the same timestamp as in the segment + info header element "Date", though "_STATISTICS_WRITING_DATE_UTC" is actually a + string representation instead of an integer value. Additionally a tag named + "_STATISTICS_TAGS" is written containing the names of the tags that mkvmerge has + set automatically. It equals the following currently: "BPS DURATION + NUMBER_OF_BYTES NUMBER_OF_FRAMES". +* mkvmerge: new feature: Added a global option for disabling writing the tags with + statistics for each track: --disable-track-specific-tags. +* mkvmerge: new feature: When identifying a Matroska file in verbose identification + mode track-specific tags will be output as well. The format is "tag_\<tag name in + lower case\>:\<tag value\>", e.g. for a tag named "BPS" with the value "224000" the + output would be "tag_bps:224000". Enhancement for #1021. +* mkvmerge: new feature: mkvmerge will write track-specific tags with statistics + ("BPS" for the average number of bits per second, "DURATION" for the duration, + "NUMBER_OF_BYTES" and "NUMBER_OF_FRAMES" for the track's size in bytes and its + number of frames/packets). Implements #1021. +* mmg: enhancement: The chapter editor will only use fast-mode parsing when loading + chapters from Matroska files. +* mkvmerge: enhancement: The last chapter entry read from MPLS files is removed if it + is at most five seconds long. Patch by Andrew Dvorak (see AUTHORS). +* mkvmerge: enhancement: added the attachment UID to the verbose identification + output of Matroska files. +* mmg: enhancement: the subtitle character set cannot be set anymore for subtitle + tracks read from Matroska files as mkvmerge ignores that setting for said container + anyway (text subs are always encoded in UTF-8 in Matroska). +* mmg: enhancement: mmg will look for the "mkvmerge" executable in the same directory + as the "mmg" executable is located it if the location hasn't been set by the user on all + operating systems (before: only on Windows). Improves detection if "mkvmerge" is + not in the $PATH. + +## Bug fixes + +* mkvmerge: bug fix: If a single subtitle track contains two or more entries at the same + timecode then the cue duration and cue relative position elements written were + wrong. +* mkvinfo: bug fix: fixed wrong progress percentage shown during saving the + information to text files. Fixes #1016. +* mkvmerge: bug fix: Changed the file type detection order again. The text subtitle + formats are now probed after those binary formats that can be detected quickly and + unambiguously. This avoids some mis-detection if e.g. Matroska files as ASS text + subtitles if they do contain such a track. +* all: bug fix: fixed invalid memory access in the cleanup procedures which only + occurred if the output was redirected with the "--redirect-output" command line + parameter. +* mmg: bug fix: Selecting a subtitle track correctly sets the "character set" + drop-down box if no character set was set for this track. Fixes #1008. + +## Build system changes + +* build system: Boost's "date/time" library is now required. + + +# Version 6.9.1 "Blue Panther" 2014-14-18 + +## Bug fixes + +* mkvmerge: bug fix: fixed huge memory usage when probing files (it was reading the + whole file into memory for that). + + +# Version 6.9.0 "On Duende" 2014-04-18 + +## New features and enhancements + +* all: new feature: added a Brazilian Portuguese translation of the programs by + Thiago Kühn (see AUTHORS). +* mkvmerge: enhancement: improved file type detection speed for text subtitle + formats. +* mkvmerge: enhancements: trailing zero bytes will be removed from AVC/H.264 NALUs. + Implements #997. + +## Bug fixes + +* mkvpropedit, mmg's header editor: bug fix: fixed a failed assertion in libEBML when + writing the same changes twice to certain files (those for which a seek head with a + single entry pointing to the elements modified by mkvpropedit/mmg's header + editor; e.g. x264 creates such files). Fixes #1007. +* mkvmerge: bug fix: reading fonts embedded in SSA/ASS files was sometimes + truncating the attachments created from them. Fixes #1003. +* mkvmerge: bug fix: fixed display of very large IDs during attachment extraction. +* mkvextract: bug fix: during the extraction of chapters, tags or segment info XML + files with the --redirect-output parameter the BOM (byte order mark) was written + twice. +* mkvmerge: bug fix: MPEG TS: timestamp outliers are ignored if they differ at least + five minutes from the last valid timestamp. Fixes #998. +* mkvmerge: bug fix: fixed timestamp assignment for AVC/H.264 videos in which + recovery point SEIs occur in front of the second field of two interlaced fields. + + +# Version 6.8.0 "Theme for Great Cities" 2014-03-02 + +## Important notes + +* mkvmerge: enhancement: The deprecated ISO 639-1 code "iw" is now recognized for + Hebrew. + +## New features and enhancements + +* mkvmerge, mkvextract: new feature: added support for HEVC/H.265 by merging the + patches from DivX/Rovi Corp. So far HEVC is only supported as elementary streams and + read from other Matroska files. +* mkvmerge: enhancements: AVI reader: audio chunks with obvious wrong size + information (bigger than 10 MB) will be skipped. +* mkvmerge, mkvextract, mkvpropedit: enhancement: attachments in Matroska files + with a missing FileUID element are not ignored anymore even though they violate the + specs. mkvmerge generates a new FileUID instead. +* installer: enhancement: the architecture (32bit vs 64bit) is mentioned in the + interface. + +## Bug fixes + +* mkvmerge: bug fix: The AC-3 packetizer will re-derive the sampling frequency and + the number of channels from the bitstream. This way obviously invalid information + from the source container like a sampling frequency of 0 Hz will be fixed. +* mkvmerge: bug fix: When reading M2TS files belonging to an MPLS playlist mkvmerge + will now only copy packets whose timestamps lie between the "in time" and "out time" + restrictions from the playlist's entry corresponding to that M2TS file. Fixes + #985. +* all: Windows 64bit: fixed return value checks for opening files. Fixes #972. +* all: Windows: when redirecting the program's output with cmd.exe (e.g. "mkvinfo + file.mkv \> info.txt") the programs will no longer write two line feed characters + (\r) per carriage return character (\n). Fixes #970. +* all: bug fix: Windows: messages written to the console (cmd.exe) are not re-encoded + to the local charset and back to UTF-16 before they're handed over to + ConsoleWriteW(). This fixes outputting Unicode characters to the console that are + not part of the local charset. Fixes #971. +* extract: bug fix: using names of non-existing files in "attachments", "chapters", + "cuesheet" or "tags" mode caused mkvextract to crash instead of emitting a proper + error message. Fixes #964. +* mmg: bug fix: fixed the check for WebM-compatible track types for Opus. +* mkvmerge: bug fix: fixed muxing Sorenson v3 (SVQ3) video from QuickTime files. +* mmg: bug fix: mkvmerge's file identification is written to a temporary file with + --redirect-output and from there into mmg instead of directly from mkvmerge. This + prevents from character re-coding done by wxWidgets 3.0.0 on Windows. Fixes #959. +* installer: bug fix: the installation directory for 64bit builds will default to the + proper directory ("C:\Program Files" instead of "C:\Program Files (x86)"). Fixes + #956. + +## Build system changes + +* mkvmerge: re-built with the 64bit build for Windows with a newer compiler version in + order to fix #957. It was due to a bug in gcc: + http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56742 + +## Other changes + +* all: Windows: the default charset for the files created with "--redirect-output" + has been changed from the system's local charset to UTF-8. Just like before it can be + changed with "--output-charset". See #970. + + +# Version 6.7.0 "Back to the Ground" 2014-01-08 + +## New features and enhancements + +* all: enhancement: The architecture (32bit/64bit) is mentioned in the version + information of all programs. +* mmg: enhancement: The "additional parts" dialog will now show the files that make up + an MPLS playlist. This is for informational purposes only and doesn't allow + changing the playlist itself. +* mkvmerge: enhancement: unified codec names output by mkvmerge's identification + mode for all file format readers. +* mmg: enhancement: The user can select the default subtitle character set to use for + newly added subtitle tracks in the preferences dialog as requested in bug #948. +* mkvmerge: new feature: implemented reading DTS audio tracks from MP4 files (with + ESDS object type ID == 0xA9 (decimal 169) or FourCC == 'DTS ' or 'dtsc'). +* mkvmerge: enhancement: allowed muxing Opus to WebM files. + +## Bug fixes + +* build system: bug fix for 64bit builds on Windows (x86_64-w64-mingw32): use the + correct processor architecture via separate Windows manifest files. Fixes mmg and + mkvinfo not starting due to "error 0x0000007b". +* mkvmerge: bug fix: Fixed a potential endless loop due to an integer overflow in the + code removing AVC/H.264 filler NALUs. +* mkvmerge: bug fix: Fixed reading uncompressed PCM audio tracks from QuickTime/MP4 + files in certain situations. Fixes #950. +* mmg: enhancement: Made the "scanned files" list box sortable by all columns. Fixes + #954. +* mkvmerge: bug fix: Reading from an MPLS playlist file is now done as if the second and + following files referenced in that playlist had been appended to the first file from + that playlist. Before they were treated as if they were additional parts. Fixes + #934. +* mmg: enhancement: a couple of fixes to tooltips: 1. Content correction for + "splitting by chapters"; 2. no ugly re-formatting with wxWidgets 3.0.0 on Windows. +* mkvmerge: bug fix: Improved the AAC, AC-3 and MP3 header decoding error handling so + that the corresponding parsing routines won't get stuck in endless loops when + encountering certain garbage data patterns. +* mkvinfo: bug fix: when setting the language with --ui-language a few strings were + still translated using the system's default language. +* mkvextract: bug fix: if the track headers were located at the end of the file (e.g. + after modification with mkvpropedit or mmg's header editor) then mkvextract was + writing files with a length 0 bytes. +* mmg: bug fix: the "playlist items" list box in the "select playlist file to add" + dialog was showing the items in reversed order. Fixes #952. +* mmg: bug fix: the "select playlist file to add" dialog can now be resized, minimized + and maximized. It also remembers its position and size during runs. Fixes #951. +* mmg: bug fix: fixed the tooltip for the subtitle character set drop-down box to match + mkvmerge's actual behavior. Fixes #948. +* mkvmerge: bug fix: Fixed the mapping of the Opus element "seek pre-roll" and + "pre-skip" to the Matroska elements "track seek pre-roll" and "codec delay". + Remuxing Matroska files with Opus created with earlier versions of MKVToolNix is + enough to fix such a file. +* mkvmerge: bug fix: fixing the bitstream timing information of AVC/H.264 writes + clean values for 25000/1001 frames per second video (e.g. de-telecined PAL @ + 29.97). +* mmg: bug fix: fixed a crash in during drag & drop operations in mmg's chapter editor. + +## Build system changes + +* build system: Ruby 1.9.x is now required. + + +# Version 6.6.0 "Edge Of The In Between" 2013-12-01 + +## New features and enhancements + +* mmg: new feature: implemented drag & drop in the chapter editor. Implements #929. +* all: integrated the Portuguese translation. Although the translation files + themselves had been added back in 6.3.0 that translation wasn't available for + selection due to forgetfulness on my part. + +## Bug fixes + +* mmg: bug fix: fixed an assertion in wxLogMessage() due to wrong format + string/argument data types caused by changes in wxWidgets 3.0.0. See Debian bug + #730273. +* mkvmerge: bug fix: improved resilience against MP4 files with obviously wrong + entries in the 'sample size table' (STSZ) atom. +* mkvmerge: bug fix: improved VC-1 frame type detection so that it works even for + streams without entry points. +* mkvinfo: bug fix: at most the lower 32bits of the track numbers and track UIDs + elements were output, even if the element in the file used more bits. Fixes #935. +* mkvmerge: bug fix: fixed accessing invalid memory in the memory handling core + routines. May be triggered by the code to remove filler NALUs introduced in v6.5.0. + Fixes #931. +* mmg: bug fix: fixed the tracks list box on the input tab being invisible/0 pixels high + with wxWidgets 2.9.x/3.x. +* mkvmerge: bug fix: The file detection code in the MPEG elementary stream reader had a + logic error. Fixes #928. In practice this logic error didn't have any consequence. + + +# Version 6.5.0 "Isn't she lovely" 2013-10-19 + +## New features and enhancements + +* mkvmerge: enhancement: filler NALUs will now be removed from framed AVC/H.264 + tracks (such as the ones read from Matroska/MP4 files) just like they have already + been when handling unframed tracks. +* mkvextract: new feature: implemented support for extracting VP9 tracks into IVF + files. +* mkvmerge: new feature: implemented support for VP9 read from IVF and Matroska/WebM + files. Implements #899. +* mkvextract: enhancement: using the same track/attachment ID multiple times in + "tracks", "attachments" or "timecodes_v2" mode will result in an error message + instead of one empty file. Implements #914. +* documentation: Added a German translation of the man pages by Chris Leick (see + AUTHORS). + +## Bug fixes + +* mmg: bug fix: With wxWidgets 2.9.x/3.0.x debug message will no longer appear as + modal dialogs but only go to the log window. +* mkvmerge: bug fix: fixed a crash when reading empty global tag files. Fixes #921. +* build system: bug fix: fix autodetection of Boost's library path if it is installed + in the multiarch directories (e.g. /usr/lib/i386-linux-gnu or + /usr/lib/x86_64-linux-gnu). +* mmg: bug fix: saved window widths were growing by 1 pixel each time mmg was exited. +* mkvmerge: bug fix: Reading OGM files with chapter entries not encoded in the + system's local character set has been fixed. During identification the number of + chapter entries is still output by removing any non-ASCII characters from the + chapter entries. When muxing an additional warning is output if parsing those + chapter entries fails, e.g. due to the format being wrong or due to the charset + guessed wrongly. Fixes #919. +* mkvmerge: bug fix: The "duration" element was calculated wrong if the first element + in the file wasn't the one with the smallest timestamp. To be precise, it was too short + by the difference between the first timestamp and the smallest one (e.g with video + sequences timestamped 80ms, 0ms, 40ms, 120ms... the duration was 80ms too short). + + +# Version 6.4.1 "Omega Point" 2013-09-16 + +## Bug fixes + +* mkvmerge: bug fix: fixed packet ordering regression introduced in 6.4.0 if + --default-duration is used for a track. + + +# Version 6.4.0 "Pale Blue Dot" 2013-09-15 + +## New features and enhancements + +* mkvextract: new feature: Implemented extraction of Opus tracks into OggOpus + files. +* mkvmerge: new feature: Implemented final Opus muxing. +* mkvinfo: new feature: Added support for the new Matroska elements DiscardPadding, + CodecDelay and SeekPreRoll. + +## Bug fixes + +* mkvinfo: bug fix: The track information summary enabled with -t/--track-info + counted bytes in SimpleBlocks twice. +* mkvmerge: bug fix: CueRelativePosition was wrong for BlockGroups: it pointed to + the Block inside the group instead of the BlockGroup itself. CueRelativePosition + elements for SimpleBlock elements are not affected. Fixes #903. +* mmg: bug fix: The "jobs" folder will be created in the same mmg.exe is located in for + the portable version. The installed version will still keep the folder where has + already been (%APP_DATA%\mkvtoolnix\jobs). +* mmg: bug fix: Closing mmg's window while it was minimized caused mmg to appear hidden + and unmovable when started the next time. +* mmg: bug fix: Fixed overly long startup time with wxWidgets 2.9.x (especially on + Windows) by using alternative methods for initializing certain controls. Makes + startup time on par with wxWidgets 2.8. See #893. + +## Build system changes + +* build system: libMatroska 1.4.1 is now required for building. + + +# Version 6.3.0 "You can't stop me!" 2013-06-27 + +## New features and enhancements + +* all: enhancement (Windows only): mmg will store its settings in a file + "mkvtoolnix.ini" in the same folder mmg.exe is located in if MKVToolNix hasn't been + installed via its installer. If it has been installed then the settings are stored in + the Windows registry. This way MKVToolNix is truly portable. +* mmg: new feature: mmg's windows and dialogs will remember and restore their + positions and sizes. Implements #878. +* all: new feature: added a Portuguese translation of the programs by Ricardo + Perdigão (see AUTHORS). + +## Bug fixes + +* mkvmerge: bug fix: When appending unframed AVC/H.264 tracks and setting the + default duration the second and all following source parts will use the same default + duration as set for the first part. Fixes #889. +* mkvmerge: bug fix: AVC/H.264 output module: fixed writing the wrong values if + --fix-bitstream-timing-information is used. Fixes #888. +* mkvmerge: bug fix: FLV reader: Implemented deriving the video dimensions for FLV1 + type tracks from the frame content if they're not given within a script tag. Fixes + #880. +* mkvmerge: bug fix: Fixed handling MPEG transport streams with broken PES packet + streams. Fixes #879 and #887. +* mkvextract: bug fix: mkvextract writes the correct value for the "block alignment" + value in the header of WAV files (mostly affects mono PCM audio tracks). Fixes #883. + + +# Version 6.2.0 "Promised Land" 2013-04-27 + +## New features and enhancements + +* mkvextract: enhancement: track extraction mode: If mkvextract encounters a + broken file structure it will output the last timecode successfully read before + resyncing. After the resync the first cluster timecode will be reported as well. +* mkvmerge: new feature: Selecting the lowest process priority with "--priority + lowest" will cause mkvmerge to also select an idle/background I/O priority. + Implements #863. +* mmg: new feature: Add control for new option + "--fix-bitstream-timing-information". +* mkvmerge: new feature: Add option for fixing the timing information in video track + bitstreams (--fix-bitstream-timing-information). +* mkvmerge: enhancement: Matroska reader: If mkvmerge encounters a broken file + structure it will output the last timecode successfully read before resyncing. + After the resync the first cluster timecode will be reported as well. +* all: enhancement on Windows: all programs now determine the interface language to + use from the user's selected interface language (C function + "GetUserDefaultUILanguage()"), not from the locale setting. Implements #852. + +## Bug fixes + +* mkvmerge: bug fix: The option "--engage remove_bitstream_ar_info" will now work + on AVC/H.264 tracks read from Matroska/MP4 files as well. Fixes #868. +* mmg: bug fix: mmg will now handle all file names given on the command line instead of + only the first one. This allows things like opening several selected files with mmg + in Windows, and mmg will add all of them. Fixes #867. +* mkvmerge: bug fix: The amount of memory required to store the cues during muxing has + been reduced drastically. This is more noticeable the more video and subtitle + tracks are muxed. Fixes #871. +* mkvmerge: bug fix: If splitting had been active then the elements "cue duration" and + "cue relative position" were only written to the first output file. +* mkvmerge: bug fix: The "CTS offset" field of FLV files with AVC/H.264 video tracks is + now read as a signed-integer field in accordance with the FLV specifications. +* mkvmerge: bug fix: DTS parsing: no more warnings about incompatible encoder + revision numbers will be printed. Fixes #866. +* mkvmerge: bug fix: The parsing of the AAC AudioSpecificConfig structure (the bytes + contained in Matroska's CodecPrivate and in MP4's "ESDS" atom) was fixed to support + parsing the GASpecificConfig and the ProgramConfigElement if the channel + configuration is 0. Fixes #872. +* mmg: bug fix: Loading chapters from Matroska files will open the file in read-only + mode allowing to read from write-protected files. +* mkvmerge: bug fix: All entries in chapters imported from MPLS playlists were named + "Chapter 0". The numbering has been fixed. Fixes #870. +* mkvmerge: bug fix: Fixed reading AVI files with audio chunks of size 0. Fixes #843. +* mkvmerge: bug fix: MPEG program stream reader: tracks with invalid video + properties (e.g. width or height = 0) are ignored properly. +* mkvmerge: bug fix: The progress percentage was sometimes using the wrong input file + as the reference if multiple files are read with the "additional parts" mechanism + (on the command line: the syntax "( VTS_01_1.VOB VTS_1_2.VOB VTS_1_3.VOB )". +* mkvmerge: bug fix: Fixed one situation that could lead to mkvmerge aborting with the + error message "Re-rendering track headers: data_size != 0 not implemented yet". +* mmg: bug fix: Using drag & drop to add playlists will no longer lock the dragging + application (e.g. Windows Explorer) in D&D mode for the duration of the scan for + other playlists. +* mmg: bug fix: The validation for the argument to "split by chapters" was wrongfully + rejecting certain valid inputs (chapter number lists in which the second or any + later chapter number was higher than 9). + +## Other changes + +* installer: The installation directory will no longer be added to the PATH + environment variable. +* mkvmerge: removal: Support for BZ2 (bzlib) and LZO (lzo1x) compression has been + removed. + + +# Version 6.1.0 "Old Devil" 2013-03-02 + +## New features and enhancements + +* mmg: new feature: When a playlist file (e.g. MPLS Blu-ray playlist) is added mmg can + optionally scan all the other files in the directory that have the same extension and + present the user with the results (including them playback time, total size, number + of chapters, number and types of tracks). The user can then select the actual + playlist file to add. The user can configure the minimum playlist duration in order + to filter out too short ones. +* mmg: new feature: Added an option for disabling making the suggested output file + name unique by adding a running number (e.g. ' (1)'). Implements #848. +* mmg: new feature: The output file name can be auto-set to be located in the first input + file's parent directory. Implements #849. +* documentation: Added a Dutch translation of mmg's guide by René Maassen (see + AUTHORS). +* mkvmerge: new feature: Implemented support for reading MPLS BluRay playlist + files. All M2TS files referenced from an MPLS file are processed. Chapter entries + from that MPLS file are used as well. Implements #765. + +## Bug fixes + +* mkvmerge: bug fix: Fixed mkvmerge sometimes mistakenly detecting MPEG-1 video in + MPEG program streams as AVC/H.264. Fixes #845. +* mkvinfo, mkvpropedit, mmg's header editor: bug fix: Fixed the description for the + DisplayUnit element to include value 3 ("aspect ratio"). +* mkvmerge: bug fix: Fixed handling chapters when splitting by parts (both + parts/timecodes and parts/frames). Fixes #831. +* mkvmerge: bug fix: Fixed reading certain MP4 atoms with invalid length fields. +* mkvmerge: bug fix in common AAC code: Fixed wrong calculation of AAC packet size for + malformed packets resulting in "safemalloc()" failing to allocate memory. Part of + a fix for #832. +* mmg: bug fix: Selecting one of the pre-defined values from the "split by X" argument + drop down box (e.g. "700M") was not leaving the selected entry in the drop down box but + set it to empty instead. +* mkvmerge: bug fix: Fixed reading VP6 video from FlashVideo files. Fixes #836. +* mmg: bug fix: Fixed validating the argument for splitting parts by frame/field + numbers. Fixes #835. + + +# Version 6.0.0 "Coming Up For Air" 2013-01-20 + +## Important notes + +* mkvmerge: bug fix: ISO 639-2 language handling: The deprecated language codes + "scr", "scc" and "mol" are replaced by their respective successors "hrv", "srp" and + "rum". Fixes #803. + +## New features and enhancements + +* mkvmerge: new feature: Implemented splitting by parts based on frame/field + numbers ("--split parts-frames:" in mkvmerge). Implements #819. +* mkvmerge: new feature: Implemented reading VobSubs from MP4 files if they're + stored in the Nero Digital way (track sub-type 'mp4s', ESDS object type identifier + 0xe0). Implements #821 and the second half of #815. +* mmg: new feature: Command line options can be saved as default for new jobs by + clicking a check box in the "add command line options" dialog. +* mkvmerge: new feature: Added experimental support for the Opus audio codec. Parts + of an implementation of #779. +* mkvmerge, mmg: new feature: Implemented splitting by chapter numbers. Implements + #504 and #814. +* mkvmerge: enhancement: Removed several warnings from the MPEG-2 video parser code + about open GOPs, missing references. Those were too confusing for most users, even + after being given additional information via email and FAQs. +* mkvextract: new feature: Implemented extraction of ALAC into Core Audio Format + files (CAF). Implements #786. +* mkvmerge, mmg: new feature: Implemented splitting by frame/field numbers. + Implements #771. +* mkvmerge: new feature: Implemented a reader for the Flash Video format (.flv). + Implements #735. + +## Bug fixes + +* mkvmerge: bug fix: Re-writing the track headers after they'd grown a lot (to more + than the EBML void size located after them allowed for) led to an integer underflow. + Then mkvmerge tried to write a void element the size of that integer (e.g. nearly 4 GB + on 32bit platforms). Fixes #822 and #828. +* mkvmerge: bug fix in the MP4 reader: Fixed language code conversion from what is used + in MP4 to the ISO 639-2 codes used in Matroska (e.g. convert from "deu" to "ger"). +* mmg: bug fix: Fixed a crash in the chapter editor if the root was selected and the user + used the "Set values" button. +* mkvmerge: bug fix: "text"-type tracks in MP4 files are only treated as chapters if + their track ID is listed on a "chap" atom inside a "tref" track reference atom. Fixes + #815. +* mmg: bug fix: Fixed consistency checks when appending files and at least one track is + disabled. +* mkvmerge: bug fix: Matroska reader: Fixed finding the "segment info" element if it + is located behind the clusters. +* mkvmerge: bug fix: MP3 parser code: Fixed skipping ID3 tags so that the header + directly behind the ID3 tag is recognized properly. Fixes #747. +* mkvmerge: bug fix: MP4 reader: Fixed handling of edit lists if the edit list is used to + adjust the track's timecodes by a fixed amount (either positive or negative). Fixes + #780. +* mkvpropedit: bug fix: Giving a non-existent file name in tags mode will result in a + proper error message. Fixes #806. + +## Build system changes + +* Build system: Boost's "variant" library is now required. + +## Other changes + +* Source distribution: source code archives (tarballs) will be compressed with xz + instead of bzip2 from now on. The file name's extension will therefore change from + ".tar.bz2" to ".tar.xz". The download URL changes accordingly. +* mkvmerge, mmg: removal: The 'header removal compression' method is not turned on by + default anymore. This affects the following track types: AC-3, AVC/H.264, Dirac, + DTS, MP3. The setting in mmg that turned it off by default has been removed. + + +# Version 5.9.0 "On The Loose" 2012-12-09 + +## Important notes + +* mkvpropedit, mmg, mkvmerge: removal: removed support for the deprecated element + TrackTimecodeScale. + +## New features and enhancements + +* mkvmerge: enhancement: Dirac video code: Added four more pre-defined video types + from Dirac spec v2.2.2 and two from Dirac Pro. +* mkvmerge, mmg: enhancement: Added options for turning off writing "CueDuration" + elements ("--engage no_cue_duration") and "CueRelativePosition" elements + ("--engage no_cue_relative_positions"). +* mkvmerge: new feature: The element "CueRelativePosition" is written for all cue + entries. +* mkvmerge: new feature: The element "CueDuration" will be written for all cue + entries referring to subtitle tracks. +* mkvmerge: new feature: mkvmerge will write cues for subtitle tracks by default now. +* mkvinfo: new feature: added support for the new elements CueDuration and + CueRelativePosition. + +## Bug fixes + +* mkvmerge: bug fix: Fixed reading seek position values bigger than 2 GB. Fixes #805. +* mkvmerge: bug fix: Fixed appending non-empty tracks to empty tracks. Fixes #793. +* mkvmerge: bug fix: mkvmerge will now keep timecodes of PCM tracks from source files + if they're available. Fixes #804. +* all: bug fix: EBML void elements will be skipped when reading structures from XML + (e.g. chapters). Fixes #802. +* all: bug fix: EBML void elements will be skipped when saving structures to XML (e.g. + chapters). Fixes #801. +* mkvmerge: bug fix: Fixed reading linked seek heads in Matroska files. +* mmg: bug fix: Fixed reading file names containing a '%' from a .mmg settings file + (both normally saved files and the job queue files). Fixes #795. + + +# Version 5.8.0 "No Sleep / Pillow" 2012-09-02 + +## New features and enhancements + +* mkvpropedit: new feature: Added support for adding, deleting and replacing + attachments. +* mmg: new feature: chapter editor: Added support for the edition flags "hidden", + "default" and "ordered" as well as the chapter values "segment UID" and "segment + edition UID". Implements ticket #736. +* documentation: Added a Basque translation of mmg's guide by Xabier Aramendi (see + AUTHORS). +* mkvmerge: new feature: Added support for reading ALAC (Apple Lossless Audio Codec) + from CAF (CoreAudio), MP4 and Matroska files. Implements #753. +* mkvmerge: new feature: mkvmerge will remove stuffing bytes from MPEG-1/-2 video + streams that are used to keep the bit rate above certain levels (the 0 bytes between + slices and the following start code). Implements #734. +* mkvmerge: enhancement: SRT files can have spaces in their timecode line's arrow + (e.g. "-- \>"). +* all: new feature: Added a Basque translation by Xabier Aramendi (see AUTHORS). + +## Bug fixes + +* all: bug fix: Fixed a buffer overflow in the Base64 decoder routine. +* source: Various fixes for building with g++ 4.7.x and clang 3.1. +* mkvmerge: bug fix: MPEG transport streams whose timecodes wrap around/overflow + are handled correctly. Fixes #777. +* mkvmerge: bug fix: MP2/MP3 audio tracks in MPEG program streams that contained + garbage at the start of the very first packet caused mkvmerge to use + uninitialized/random values for certain parameters (sample rate, number of + channels, and therefore also during timecode calculation). +* mkvmerge: bug fix: Fixed audio/video synchronisation when reading MPEG program + streams with MPEG-1/2 video with respect to B frames. Fixes #579. +* mkvmerge: bug fix: VC-1: mkvmerge will now only mark frames as I frames if a sequence + header precedes them directly. Fixes #755. +* all: bug fix: The programs do not try to create directories with empty names anymore. + This happened if the output file name for e.g. mkvmerge or mkvextract was only a file + name without a directory component. With Boost v1.50.0 the call to + "boost::filesystem::create_directory()" would result in an error if the name was + empty (it didn't in earlier versions of Boost). +* mmg: bug fix: Fixed mmg not reading the very last line of mkvmerge's output. The + result was that messages like "the cues are being written" did not show up in mmg and + that the progress bar was not filled completely. Fixes #774. + +## Build system changes + +* Build system: dropped support for gcc 4.6.0. +* Build system: Boost's "bind" library is not required anymore. The C++11 features + from "functional" are used instead. + + +# Version 5.7.0 "The Whirlwind" 2012-07-08 + +## New features and enhancements + +* mkvmerge: new feature: If "splitting by parts" is active and the last split part has a + finite end point then mkvmerge will finish muxing after the last part has been + completed. Implements #768. +* mmg, mkvinfo's GUI, all .exes: enhancement: Added new icons by Ben Humpert based on + the ones by Eduard Geier (see AUTHORS). + +## Bug fixes + +* mmg: bug fix: mmg will no longer print false warnings about a chapter UID not being + unique. Fixes #760. +* mkvmerge, mkvpropedit, mmg: bug fix: All tools can now deal with 64bit UID values + (chapter UIDs, edition UIDs etc). +* mkvmerge: bug fix: The DTS and TrueHD packetizers were not flushed correctly. In + some rare circumstances this could lead to mkvmerge aborting with an error message + about the packet queue not being empty at the end of the muxing process. Fixes #772. +* mkvmerge: bug fix: Fixed handling of tracks in QuickTime/MP4 files with a constant + sample size. This fixes the other reason for the "constant sample size and variable + duration not supported" error. Fixes issue 764. +* mkvmerge: bug fix: Tracks in QuickTime/MP4 files with empty chunk offset tables + (STCO and CO64 atoms) are ignored. This fixes one of the reasons for the "constant + sample size and variable duration not supported" error. +* mmg: bug fix: Fixed mmg's excessive CPU usage during muxing. +* mkvmerge: bug fix: Reading DTS from AVI files often resulted in the error message + that DTS headers could not be found in the first frames. This has been fixed. Fixes + issue 759. +* Documentation: Updated the cross-compilation guide and fixed the + "setup_cross_compilation_env.sh" script. + + +# Version 5.6.0 "Kenya Kane" 2012-05-27 + +## New features and enhancements + +* documentation: Added Spanish translation of mmg's guide by Israel Lucas Torrijos + (see AUTHORS). +* mkvmerge: enhancement: mkvmerge was optimized to keep cluster time codes strictly + increasing in most situations. +* all: Added a translation to Polish by Daniel (see AUTHORS). +* mmg: new feature: When adding a Matroska file that has either the "previous segment + UID" or the "next segment UID" set then mmg will copy those two and the source file's + segment UID into the corresponding controls on the "global" tab if they haven't been + set before. Implements ticket 733. +* mkvmerge: new feature: The verbose identification mode for Matroska files will now + includes the "segment UID", the "next segment UID" and "previous segment UID" + elements. +* mkvmerge: enhancement: In "--split parts:" mode mkvmerge will use the output file + name as it is instead of adding a running number to it if all the ranges to be kept are to + be written into a single output file. Implements ticket 743. + +## Bug fixes + +* mkvmerge: bug fix: SRT subtitle entries with colons as the decimal separator are + accepted. Fix for issue 754. +* mkvmerge: bug fix: XML tag files with \<Simple\> tags that only contained a name and + nested \<Simple\> were wrongfully rejected as invalid. Fixes issue 752. +* mkvextract: bug fix: Extraction of AVC/H.264 was completely broken after + 2012-04-09 resulting in files with a length of 0 bytes. +* mkvextract: bug fix: mkvextract will no longer abort extracting H.264 tracks if it + encounters a NAL smaller than its size field. Instead it will warn about it and drop + the NAL. +* mkvmerge: bug fix: Writing more than two parts into the same file with "--split + parts:" resulted in the time codes of the third and all following parts to be wrong. + Fixes ticket 740. +* mkvmerge: bug fix: The "--split parts:" functionality was not taking dropped + ranges into account when calculating the segment duration for files that more than + one range was written to. Fixes ticket 738. +* mkvmerge: bug fix: The "--split parts:" functionality was producing a small gap + between the first part's last packet's time code and the second part's first + packet's time code if two parts are written to the same file. Fixes ticket 742. +* mkvmerge: bug fix: The "--split parts:" functionality was writing a superfluous + and empty first part if the first range starts at 00:00:00. Fixes ticket 737. +* mmg, build system: Fixed building with wxWidgets 2.9.3. + + +# Version 5.5.0 "Healer" 2012-04-06 + +## New features and enhancements + +* mmg: new feature: Added GUI controls for mkvmerge's "file concatenation" feature + as "additional file parts". The user can chose which individual files are treated as + if they were a single huge source file. +* mkvmerge, mmg: new feature: Added support for keeping only certain time code ranges + from the source files with a new format to "--split": "--split parts:...". + Implements ticket #518. +* mmg: new feature: Added an option in the preferences dialog called "clear jobs from + the job queue after they've been run". Can be set to "only if run was successful", + "even if there were warnings" and "even if there were errors". Defaults to off. +* documentation: enhancement: mkvmerge's man page has been updated with a list of + valid XML tags for the chapters, tags and segment info XML file formats. +* mkvmerge: enhancement: Chapter XML files: mkvmerge can handle the + "ChapterSegmentEditionUID" element. +* mkvmerge: enhancement: Segment info XML files: mkvmerge can handle the + "SegmentFilename", "PreviousSegmentFilename" and "NextSegmentFilename" + elements. +* mmg: enhancement: Added "mts" as yet another file extension for MPEG transport + streams. +* mmg, mkvinfo's GUI, all .exes: enhancement: Added new icons by Eduard Geier. (see + AUTHORS). + +## Bug fixes + +* mkvmerge: bug fix: The handling of the "do not read other files" options (e.g. + "=file.vob" and "( file.vob )") was broken for MPEG program stream files. +* mkvmerge: bug fix: Fixed a wrong assertion about minimum MPEG 1/2 video start code + lengths. Fixes ticket 728. +* mmg: bug fix: Fixed a crash due to a missing argument for a format string when clicking + on the "Browse" button for the track-specific tags. +* mkvextract: bug fix: mkvextract sometimes wrote undefined values to a single + reserved header field when extracting into AVI files. Patch by buguser128k. Fix for + ticket 727. +* mkvmerge: bug fix: AVC/H.264 mkvmerge was wrongfully writing a default duration of + 60 frames/fields even if the source was signalling 60000/1001 frames/fields. The + frame time codes have been correct already. +* mkvmerge: bug fix: Fixed time code calculation for (E)AC-3 tracks if the source + container (e.g. MPEG transport streams) only provided time codes for some of the + (E)AC-3 packets itself. + +## Build system changes + +* Build system: Boost's "lexical_cast" and "type traits" libraries are now + required. +* Build system: removed all files and documentation related to building MKVToolNix + with Microsoft's Visual Studio because even the most recent version of Visual C++ + does not support the C++11 features required for MKVToolNix. + +## Other changes + +* mkvmerge, mkvextract, mmg: Re-write of the whole XML handling code. It now uses the + "pugixml" C++ library instead of the "expat" library. Therefore "expat" is not + required for building MKVToolNix anymore. And neither is Boost's "property tree" + library. "pugixml" itself is included and not an external requirement either. +* mkvmerge, mkvextract: removal: Removed support for the CorePicture file format. + It was mostly unused and relied on old code that will be removed soon. +* all: Updated the DTD files with the newly supported elements. + + +# Version 5.4.0 "Piper" 2012-03-10 + +## New features and enhancements + +* mkvinfo: new feature: mkvinfo will output the track ID that mkvmerge and mkvextract + would use for a track. This information is shown alongside the "track number" + element in verbose mode and in the track summary in summary mode. +* mkvmerge, mmg: enhancement: The "--default-duration" in mkvmerge and the "FPS" + drop down box in mmg now accept "p" or "i" as a unit -- as in e.g. "25p" or "50i". Several + commonly used values have been added to mmg's "FPS" drop down box and others removed. +* mmg: enhancement: Added the values "50", "60" and "48000/1001" to the list of + commonly used values for the "FPS" input field. +* mkvmerge: enhancement: mkvmerge will keep the "enabled" track header flag when + muxing. mkvmerge will also output its value in verbose identification mode as + "enabled_track". +* mkvmerge: enhancement: MicroDVD text subtitles are recognized as an unsupported + format instead of an unknown format. +* doc: enhancement: Updates for option file usage and supported subtitle formats. + +## Bug fixes + +* mkvmerge: bug fix: Fixed wrong calculation of the maximum number of ns per cluster in + certain fringe cases if time code scale was set to "auto" mode ("--time code-scale + -1"). Fix for bug 707. +* mkvmerge: bug fix: When using an external time code file with AVC/H.264 video the + default duration will be set to the most-often used duration in the time code file. +* mkvmerge: bug fix: AVC/H.264 packetizer: The value given with + "--default-duration" (after internal conversion from the unit given by the user to + duration in nanoseconds) is now again interpreted as the duration of a frame and not + of a field. +* mkvmerge: bug fix: SRT subtitles: time codes can contain the minus sign before any + digit, not just before the first one. +* mkvmerge: bug fix: Sometimes non-AC-3 files were mistakenly for AC-3 after the + re-write of the AC-3 handling code on 2012-02-26. This has been rectified. Fix for + bug 723. +* mkvmerge: bug fix: Complete re-write of the time code handling code for AVC/H.264 + tracks. Now handles several cases correctly: interlaced video, video with + multiple or changing SPS with different timing information. The timing + information is extracted from the bitstream. Therefore the user doesn't have to + specify the default duration/FPS himself anymore. Fix for bugs 434 and 688. +* mkvmerge: bug fix: Complete re-write of the (E)AC-3 parsing and handling code. + Dependent E-AC-3 frames are now handled correctly. Fix for bug 704. +* mkvmerge: bug fix: The width and height of H.264 video tracks with a pixel format + other than 4:2:0 are now calculated correctly. Fix for bug 649. Patch by Nicholai + Main (see AUTHORS). +* mkvmerge: bug fix: Fixed file type recognition and frame drops for VC-1 elementary + streams that do not start with a sequence header but with frame or field packets + instead. +* mkvmerge: bug fix: Fixed mis-detection as unsupported DV files (happened for e.g. + PGS subtitle files). + +## Build system changes + +* build system: The C++ compiler must now support the C++11 keyword 'nullptr'. + configure checks for it. For GCC this means at least v4.6.0. +* build system: Boost's "rational" library is now required. + +## Other changes + +* mmg: The warning that no default duration/FPS has been given for AVC/H.264 tracks + has been removed. + + +# Version 5.3.0 "I could have danced" 2012-02-09 + +## New features and enhancements + +* mkvmerge: new feature: mkvmerge will parse and apply the audio encoder delay in MP4 + files that contain said information in the format that iTunes writes it. Fix for bug + 715. +* mkvmerge: new feature: Implemented support for treating several input files as if + they they had been concatenated binarily into a single big input file. Snytax is + "mkvmerge -o out.mkv ( in1.ts in2.ts in3.ts )". This feature has already been + present since version 5.1.0 but never been mentioned in the ChangeLog. Support for + this feature in mmg is still missing. +* mkvmerge: enhancement: Identification output for Matroska files: Added the track + number header field as "number" to the verbose identification mode. +* mkvmerge: enhancement: Identification output for Matroska files: Added a field + "content_encoding_algorithms" that contains a comma-separated list of encoding + algorithm IDs used for that track. For example, "content_encoding_algorithms:3" + would indicate that header removal compression is used. +* mkvmerge: enhancement: Identification output for Matroska files: Added several + fields to mkvmerge's verbose identification mode for tracks: UID, CodecID, length + and content (as a hex dump) of the codec private data. +* mkvmerge: enhancement: Added video pixel dimensions to the output of + "--identify-verbose" for Matroska files. + +## Bug fixes + +* mkvmerge: bug fix: Blocks with "BlockAdditions" will no longer be muxed as + "SimpleBlock" elements discarding the additions but instead as "BlockGroup" + elements. This applies to e.g. WAVPACK4 tracks with correction files as the + correction data is stored in "BlockAdditions". Fix for bug 713. +* mkvmerge: bug fix: Fixed some more issues with (E)AC-3 being misdtected as AVC + elementary streams. +* mmg: bug fix: The header editor was sometimes creating two instances of an element if + an element was added to the second or one of the later tracks. Fix for bug 711. +* mkvpropedit, mmg: bug fix: Trying to modify a file located in a path mounted with GVFS + SFTP will no longer crash the programs. Instead an error message is output if an error + occurs. Fix for bug 710. +* mkvmerge: bug fix: Fixed integer underflows in the read caching code resulting in + invalid memory access. Happened in broken or incomplete files only. Fix for bug 709. +* mkvmerge: bug fix: Appending AVI, Matroska or MPEG program stream files with DTS + audio tracks will not result in a warning that the appended DTS tracks might not be + compatible. Fix for bug 705. +* mkvextract: bug fix for the "time codes_v2" mode: mkvextract will write one more + time code than there are frames in the file. The last time code written will be the the + sum of the last frame's time code and duration with the "last frame" being the one with + the highest time code. Fix for bug 691. +* mkvmerge: bug fix: Fixed writing into paths on which a drive is mounted on Windows. + Fix for bug 701. +* mkvmerge: bug fix: Fixed a segmentation fault in the DTS detection code. Fix for bug + 698. +* mkvextract: bug fix: The track IDs used in the "time codes_v2" extraction mode are + consistent again with the IDs that mkvmerge's identification reports and that + mkvextract's "tracks" extraction mode uses. Fix for bugs 689 and 694. + + +# Version 5.2.1 "A Far Off Place" 2012-01-02 + +## New features and enhancements + +* mkvmerge: enhancement: Removed the posix_fadvise() code. The application is + using its own caching code which caused bad performance if the OS caching provided + via posix_fadvise() is used as well. + +## Bug fixes + +* mkvmerge: bug fix: Fixed certain DTS files being mis-detected as AC-3. Fix for bug + 693. +* all: bug fix: Fixed compilation if gettext/libintl is not available. +* mkvmerge: bug fix: The MPEG program stream reader was reporting wrong progress + percentage if multiple files were used since v5.1.0. +* mkvmerge: bug fix: If an MP4 file contains chapters encoded in a different charset + than UTF-8 and --chapter-charset is not used then the error message shown is a lot + clearer why mkvmerge aborts muxing. Before the error message was a generic + "mm_text_io_c::read_next_char(): invalid UTF-8 character. The first byte:..." +* mkvmerge: bug fix: MPEG program streams in which a track suddenly ends and others + continue or in which a track has huge gaps will no longer cause mkvmerge to try to read + the whole file at once. This could lead to excessive swapping and finally mkvmerge + crashing if no more memory was available. +* mkvextract: bug fix: The track IDs used for extraction are consistent again with the + IDs that mkvmerge's identification reports. Fix for bug 689. +* mkvmerge: bug fix: Fix compilation if FLAC is not available. Fix for issue #13. + +## Build system changes + +* build system: Added an option "--without-gettext" that allows for building + without support for translations even if gettext itself is installed. +* build system: Added an option "--without-curl" that allows for building without + CURL support even if CURL itself is installed. + + +# Version 5.2.0 "I can't explain" 2011-12-18 + +## New features and enhancements + +* documentation: enhancement: Added a Ukrainian translation for mkvextract's man + page. +* mkvmerge: enhancement: The VP8 output module will always re-derive frame types + (key frame vs. non-key frame). +* mkvmerge, mkvextract: enhancement: Implemented input file buffering in mkvmerge + and improved/implemented output file buffering in other tools. +* mmg, mkvinfo's GUI: enhancement: Added new icons based on the work of Alexandr + Grigorcea (see AUTHORS). + +## Bug fixes + +* mkvmerge, mmg: bug fix: Automatic MIME type recognition for TrueType fonts will + result in "application/x-truetype-font" again instead of + "application/x-font-ttf". Fix for bug 682. +* mkvinfo: bug fix: Various elements used to have a space between their names and their + value's hex dump. In v5.1.0 that space was accentally removed. It has been added + again. Fix for bug 583. +* mkvmerge: bug fix: Turn off input file buffering for badly interleaved MP4 files. +* mkvmerge: bug fix: Changed how mkvmerge assigns IDs to tracks in source files for + Matroska and MP4 files. That way files whose headers contain the same ID for multiple + tracks will work correctly. Fix for bug 681. +* mkvmerge: bug fix: VP8 read from AVI could not be put into WebM compatible files. +* mkvmerge: bug fix: Fixed a rare audio type mis-detection of MP2/MP3 audio tracks in + MPEG program streams causing mkvmerge to abort with an error message. +* mmg: bug fix: Fixed a memory leak in mmg's header editor that caused the "open file" + function to stop working after opening a few files. Fix for bug 679. + + +# Version 5.1.0 "And so it goes" 2011-11-28 + +## New features and enhancements + +* all: enhancement: Made all EXEs declare their required access level privileges for + Windows' User Access Control. +* mmg: enhancement: Made mmg DPI-aware on Windows (tested up to 144 DPI). +* mmg: enhancement: Added "ogv" to the list of known file extensions for "Ogg/OGM + audio/video files". Implements bug 667. +* mkvmerge: enhancement: Added support for reading AAC tracks from MPEG transport + streams. +* mkvmerge: enhancement: The verbose identification mode will add the properties + "default_duration", "audio_sampling_frequency" and "audio_channels" if + appropriate and if the corresponding header elements are present. +* mkvmerge: enhancement: "Castilan" has been merged with "Spanish" into "Spanish; + Castillan" in the ISO 639 language list as both share the same ISO 639-2 code "spa". + +## Bug fixes + +* mkvmerge: bug fix: Fixed more time code handling issues for video tracks in MPEG + transport streams whose PES packets sometimes don't have a time code. +* mkvmerge: bug fix: mkvmerge will no longer create folders on drives it shouldn't + create them on on Windows. +* mkvmerge: bug fix: Fixed bogus huge time codes sometimes occurring for AVC/H.264 + video tracks read from MPEG transport streams. +* mmg: bug fix: mmg will append ".xml" to the file name entered when saving from the + chapter editor if no extension was given. +* mkvinfo: bug fix: Improved skipping broken data on all operating systems. +* mkvmerge, mkvextract: bug fix: Skipping broken data in Matroska file often caused + the program to abort on Windows. This has been fixed so that processing continues + after the broken part. Fix for bug 668. +* mkvmerge: bug fix: Fixed reading VC-1 video tracks from Matroska files that don't + use VC-1 start markers (0x00 0x00 0x01 ...). +* mmg: bug fix: A utility function for breaking a line into multiple ones was accessing + invalid memory in rare situations causing mmg to crash. Could happen e.g. when + adding a job to the job queue. +* mkvmerge: bug fix: mkvmerge will use DTS instead of PTS for VC-1 video tracks read + from MPEG transport streams. +* mkvmerge: bug fix: Fixed reading MPEG transport streams on big endian systems. +* mkvmerge: bug fix: Relaxed the compatibility checks when concatenating VP8 video + tracks. +* mkvmerge: bug fix: Fixed PCM audio in WAV sometimes being detected as DTS. + +## Build system changes + +* build system: Boost's "Range" library is now required. +* build system: Boost v1.46.0 or newer is now required. As a consequence included + copies of some of Boost's libraries have been removed (foreach, property tree). +* build system: The C++ compiler must now support several features of the C++11 + standard: initializer lists, range-based 'for' loops, right angle brackets, the + 'auto' keyword and lambda functions. configure checks for each of these. For GCC + this means at least v4.6.0. + +## Other changes + +* examples: Added XSLT 2.0 stylesheets in the "examples/stylesheets" directory for + turning Matroska chapters into cue sheet and split points for "shntool" (useful for + situations in which you have e.g. a live recording from a concert including chapters + and want to create one audio file per song). +* Packaging: In v5.0.1 mmg's guide was accidentally moved into the "mkvtoolnix" + Debian/Ubuntu package. It has been moved back into "mkvtoolnix-gui" again. + + +# Version 5.0.1 "Es ist Sommer" 2011-10-09 + +## New features and enhancements + +* mkvmerge: enhancement: Implemented support for yet another way of storing E-AC-3 + and DTS in MPEG transport streams. + +## Bug fixes + +* mkvinfo: bug fix: Track information was not reset when opening more than one file in + the GUI. +* mkvmerge: bug fix: The PGS subtitle output module was not outputting any packet in + certain cases due to uninitialized variables. +* mkvmerge: bug fix: Fixed mkvmerge not finding any track in TS streams whose first PMT + packet could not be parsed (e.g. invalid CRC). +* mkvmerge: bug fix: Fixed detection of TS streams that only contain one PAT or PMT + packet within the first few KB but no others within the first 10 MB. + +## Build system changes + +* build system: Updated the Debian/Ubuntu files to debhelper v7/quilt 3.0 format. + + +# Version 5.0.0 "Die Wahre Liebe" 2011-09-26 + +## New features and enhancements + +* mkvmerge: new feature: MPEG TS: mkvmerge will extract the track languages from a + corresponding clpi (clip info) file. That file is searched for in the same directory + and in ../CLIPINF and must have the same base name but with the ".clpi" extension. +* mkvmerge: enhancement: Added new stereo mode options to match the current specs. + The new options are "anaglyph_green_magenta" (12), + "both_eyes_laced_left_first" (13) and "both_eyes_laced_right_first" (14). +* mkvmerge: enhancement: MPEG TS: Added support for HDMV PGS subtitles. +* mkvmerge: enhancement: MPEG TS: Added support for DTS HD Master Audio tracks. +* mkvmerge: enhancement: MPEG TS: Streams that are mentioned in the PMT but do not + actually contain data are neither reported during identification nor muxed. +* mkvmerge: new feature: MPEG TS: Added support for reading the language code. +* mmg: enhancement: Added MPEG transport streams to the "add file" dialog file + selector. +* mkvmerge: new feature: MPEG TS: Added support for normal DTS tracks. +* all: Added an Lithuanian translation by Mindaugas Baranauskas (see AUTHORS). +* mkvmerge: new feature: Implemented a MPEG transport stream demuxer. +* mkvmerge: enhancement: When looking for MPEG files with the same base name as a + source file mkvmerge will be stricter what it accepts. The file name must consist of + at least one char followed by "-" or "_" followed by a number. That will match + VTS_01_1.VOB but not e.g. "some_series_s03e10.mpg". +* mkvmerge: enhancement: Sped up file identification by caching read operations. + +## Bug fixes + +* mkvmerge: bug fix: The "writing application" element will not be localized but + always be written in English. +* mkvextract: bug fix: Fixed attachment number displayed during extraction. Fix for + bug 663. +* mkvmerge: Tons of fixes and additions to the MPEG transport stream demuxer. +* mkvmerge: bug fix: Opening MPEG files with numbers in their name from folders with + e.g. Cyrillic names failed on Windows. +* mkvmerge: bug fix: Several elements are not written when creating WebM compliant + files. In the segment headers: SegmentUID, SegmentFamily, ChapterTranslate, + PreviousSegmentUID, NextSegmentUID. In the track headers: MinCache, MaxCache + and MaxBlockAdditionID. +* mkvmerge: bug fix: Fixed identifying QuickTime/MP4 files that start with a 'skip' + atom. +* mkvmerge: bug fix: Fixed a crash when reading AVI files with DTS audio tracks that do + not contain valid headers in the first couple of packets. Fix for bug 646. + +## Build system changes + +* build system: libEBML 1.2.2 and libMatroska 1.3.0 are required for building. If + external versions are not found or if they're too old then the included versions will + be used as a fallback. +* build system: configure will accept external versions of libEBML and libMatroska + again. Minimum required versions are libEBML 1.2.1 and libMatroska 1.1.0. + +## Other changes + +* mkvmerge: The --stereo-mode named option "anaglyph" was renamed to + "anaglyph_cyan_red" to match the specs. The numerical value (10) remains + unchanged. +* All: Updated the French translation with a complete set by DenB (see AUTHORS). +* mmg: mmg respects the XDG Base Directory Specification regarding its + configuration files (environment variable $XDG_CONFIG_HOME/mkvtoolnix if set, + otherwise ~/.config/mkvtoolnix). + + +# Version 4.9.1 "Ich will" 2011-07-11 + +## Bug fixes + +* mkvmerge: bug fix: Fixed endless loop when reading AVI files on Windows if + MKVToolNix was compiled with a gcc mingw cross compiler v4.4.x. Fix for bug 642. +* mkvmerge: bug fix: Fixed long file identification time caused by DV detection. Fix + for bug 641. + + +# Version 4.9.0 "Grüner" 2011-07-10 + +## New features and enhancements + +* all: Added an Italian translation by Roberto Boriotti and Matteo Angelino (see + AUTHORS). + +## Bug fixes + +* mkvmerge: bug fix: DV files are recognized as an unsupported container type. Fix for + bug 630. +* mkvmerge: bug fix: Fixed handling block groups in Matroska files with a duration of + 0. +* mmg: Various compatibility fixes for use with wxWidgets 2.9.x. +* mmg: bug fix: Fixed building with Sun Studio's C compiler. +* mkvmerge: bug fix: ISO 639-2 terminology language codes are converted to the + corresponding bibliography code upon file identification (e.g. 'deu' is + converted to 'ger'). +* mkvinfo: bug fix: The time code scale is retrieved first before applying it to the + segment duration. +* mmg: bug fix: Fixed populating the 'compression' drop down box according to what + mkvmerge was compiled with. +* mkvmerge: bug fix: When a DTS track is read from a source file that provides time codes + (e.g. Matroska files) then those time codes will be preserved. +* mkvmerge: Fixed remuxing certain VC-1 video tracks from Matroska files. Fix for bug + 636. + + +# Version 4.8.0 "I Got The..." 2011-05-23 + +## New features and enhancements + +* mkvmerge: enhancement: Added support for VobSub IDX files with negative "delay" + fields. +* mkvpropedit: new feature: Added support for adding, replacing and removing + chapters. +* mkvmerge: enhancement: File identification for tracks read from Matroska files + with a codec ID of "A_MS/ACM" will show the track's format tag field if it is unknown to + mkvmerge. Implements bug 624. +* mkvmerge: new feature: Track, tag and attachment selection via --audio-tracks, + --video-tracks etc. can have their meaning reversed by prefixing the list of IDs + with "!". If it is then mkvmerge will copy all tracks/tags/attachments but the ones + with the IDs given to the option (e.g. "--attachments !3,6"). + +## Bug fixes + +* mmg: bug fix (Windows): mmg will no longer convert the "mkvmerge executable" from + just "mkvmerge" into a full path name when writing its preferences to the registry + upon existing. +* mkvmerge: bug fix: The 'doc type read version' EBML header field is only set to 2 even + if a stereo mode other than 'none' is used for at least one video track. Fix for bug 625. +* mkvmerge: bug fix: Reading DTS files stored in 14-to-16 mode were read partially. +* mkvmerge: enhancement: mkvmerge will rederive frame types for VC-1 video tracks + stored in Matroska files instead of relying on the container information. This + fixes files created by e.g. MakeMKV that mark all frames as key frames even if they + aren't. +* mkvmerge: bug fix: Fixed detection of AAC files with ADIF headers. Fix for bug 626. +* mkvmerge: bug fix: The 'doc type version' and 'doc type read version' EBML header + fields are only set to 3 if a stereo mode other than 'none' is used for at least one video + track. Fix for bug 625. +* mkvmerge: bug fix: Fixed handling AVIs with AAC audio format tag 0x706d and bogus + private data size. Fix for bug 623. + +## Other changes + +* All: Avoided a segmentation fault in gcc by not including a pre-compiled header if + FLAC or CURL support is disabled. + + +# Version 4.7.0 "Just Like You Imagined" 2011-04-20 + +## New features and enhancements + +* mkvmerge: enhancement: Added support for WAV and AVI files that use a + WAVEFORMATEXTENSIBLE structure (wFormatTag == 0xfffe). Fix for bug 614. +* mkvmerge: enhancement: The EBML header values "doc type version" and "doc type read + version" are both set to 3 if at least one of the video tracks uses the stereo mode + parameter. + +## Bug fixes + +* mkvmerge: bug fix: Fixed appending time code calculation for appended subtitle + tracks if the subtitle tracks are read from complex containers (e.g. Matroska, MP4, + AVI etc). Fix for bug 620. +* mkvextract: bug fix: Fixed extraction of MPEG-1/2 video tracks whose sequence + headers change mid-stream but whose key frames are not all prefixed with a sequence + header. Fix for bug 556. +* mkvmerge: bug fix: Fixed reading AAC tracks from AVI files with 7 bytes long codec + data. Fix for bug 613. +* mmg: bug fix: The output file name extension will be updated on each track selection + changed as well. The extension is based on the actually selected tracks, not on the + presence of tracks of certain types. Fix for bug 615. +* mkvmerge: bug fix: mkvmerge was dropping the last full DTS packet from a DTS files if + that file was not encoded in "14-in-16" mode and if the file size was not divisible by + 16. +* mkvmerge: bug fix: Fixed huge slowdown when splitting by size is active with certain + kinds of input files. Fix for bug 611. +* mkvinfo: bug fix: Fixed redirecting the output into a file with + "--redirect-output"/"-r" and verbosity levels of 2 and higher. +* mkvpropedit, mmg header/chapter editor: bug fix: Fixed parsing Matroska files if + mkvtoolnix is compiled with newer versions of libebml/libmatroska (SVN revisions + after the releases of libebml 1.2.0/libmatroska 1.1.0). +* mkvmerge: bug fix: WAV files with unsupported format tags are rejected instead of + being treated like containing PCM. Fix for bug 610. + +## Build system changes + +* build system: For the time being the build system will always build and link + statically against the internal versions of libEBML and libMatroska. + + +# Version 4.6.0 "Still Crazy After All These Years" 2011-03-09 + +## New features and enhancements + +* mkvmerge: enhancement: HD-DVD subtitles are recognized as being an unsupported + file format. This makes the error message presented to the user a bit clearer. Fix for + bug 600. +* mkvpropedit: new feature: Added support for adding, replacing and removing tags. +* all: Added a translation for the programs into Turkish by ßouЯock (see AUTHORS). + +## Bug fixes + +* build system: Fixed building the Qt version of mkvinfo's GUI (again). Fix for bug + 576. +* mmg: bug fix: If the header editor finds 'language' elements with ISO-639-1 codes + (e.g. "fra" instead of "fre" for "French") then it will map the code to the + corresponding ISO-639-2 code. Fix for bug 598. +* mmg: bug fix: Fixed one of the issues causing mmg to report that it is configured to use + an unsupported version of mkvmerge when the reported version was actually empty. +* build: Boost 1.36.0 or newer is required (up from 1.34.0). Also fixed building with + v3 of Boost's filesystem library, e.g. with Boost 1.46.0 Beta 1 or newer. +* build system: Fixed compilation if configure choses the internal versions of + libebml and libmatroska while older versions are still installed in a location + named with "-I..." or "-L..." in CFLAGS/CXXFLAGS/LDFLAGS or with configure's + "--with-extra-includes" and "--with-extra-libs" options. + + +# Version 4.5.0 "Speed of Light" 2011-01-31 + +## New features and enhancements + +* mkvinfo: new feature: Added an option "--track-info" (short: "-t") that displays + one-line statistics about each track at the end of the output. The statistics + include the track's total size, duration, approximate bitrate and number of + packets/frames. +* mmg: enhancement: The output file name extension is automatically set to ".mk3d" if + the stereo mode parameter for any video track is changed to anything else than "mono" + or the default value. +* mmg: enhancement: Added ".mk3d" to the list of known file name extensions for + Matroska files. +* mkvmerge, mmg: enhancement: Updated the "stereo mode" parameter to match the + current Matroska specifications. +* mkvmerge: enhancement: If mkvmerge encounters invalid UTF-8 strings in certain + files or command line arguments then those strings will simply be cut short. Before + mkvmerge was exiting with an error ("Invalid UTF-8 sequence encountered"). +* all: new feature: Added online update checks. The command line tools know a new + parameter "--check-for-updates". mmg has a new menu entry ("Help" -\> "Check for + updates") and checks automatically when it starts, but at most once in 24 hours. Can + be turned off in the preferences. This function requires libcurl and is not built if + libcurl is not available. +* mkvmerge: new feature: Added support for reading VP8 video from Ogg files. + Implements bug 584. +* mkvextract: enhancement: mkvextract will exit with an error if the user specifies + track IDs that do not exist in the source file. This works in the "tracks" and "time + codes_v2" extraction modes. Fix for bug 583. +* mkvmerge: new feature: The "default duration" header field is set for DTS audio + tracks. + +## Bug fixes + +* mkvmerge: bug fix: Fixed an infinite loop when reading program stream maps in MPEG + program streams. Part of a fix for bug 589. +* mkvinfo: bug fix: The hexdump mode was accessing invalid memory if the data to dump + was shorter than 16 bytes. It was also outputting the values as characters instead of + hexadecimal numbers. Patch by ykar@list.ru. Fix for bug 591. +* mkvmerge: bug fix: Avoid a crash due to invalid memory access if a source file name + contains numbers (happens only if mkvtoolnix is built with MS Visual Studio). Fix + for bug 585. +* docs: mkvextract's man page has been updated to match the program's expected + command line syntax for the "time codes_v2" mode. Fix for bug 583. +* build system: Fixed building the Qt version of mkvinfo's GUI. Fix for bug 576. +* mkvmerge, mmg: bug fix: Option files could not contain options that started with '#' + as they were interpreted as comment lines. +* mmg: bug fix: On macOS X the application type is set to a foreground application + preventing issues like the GUI never getting focus. + +## Build system changes + +* build: Building mkvtoolnix now requires libebml v1.2.0 and libmatroska v1.1.0 or + later. +* build: enhancement: mkvtoolnix now includes libebml and libmatroska. The + configure script will use them if either no installed versions of them is found or if + the installed version is too old. +* build system: mmg's guide and its images are installed into the location given by + configure's "docdir" variable. Patch by Cristian Morales Vega (see AUTHORS). + +## Other changes + +* all: Made the French translation selectable in all programs. + + +# Version 4.4.0 "Die Wiederkehr" 2010-10-31 + +## New features and enhancements + +* mkvmerge: new feature: If the name of an input file starts with '=' then mkvmerge will + not try to open other files with the same name (e.g. 'VTS_01_1.VOB', + 'VTS_01_2.VOB', 'VTS_01_3.VOB') from the same directory. A single '=' as an + argument disables this as well for the next input file. Implements bug 570. +* mmg: new feature: Added an option to disable extra compression when adding tracks by + default. +* mkvmerge: enhancement: The warning about subtitle entries that are skipped + because their start time is greater than their end time now includes the subtitle + number. +* mkvmerge: enhancement: When appending two Matroska files which both contain + chapters the chapter entries of all editions will be merged even if the edition's + UIDs were different to begin with. This is done based on the order of the edition. If + both files contain three editions each then the chapters from the first edition in + the second file will be put into the first edition from the first file; the chapters + from the second edition into the second edition and so on. +* all: Added a translation of the programs into French by Trinine (see AUTHORS). + +## Bug fixes + +* build system: bug fix: Installation no longer fails if xsltproc is available but the + DocBook stylesheets aren't. Fix for bug 575. +* mkvmerge: bug fix: Made file type detection stricter for MP3, AC-3 and AAC files. + This prevents mis-detection of other file types as one of these for certain files. + Fix for bug 574. +* mkvmerge: bug fix: Fixed the usage of iterators with the STL "deque" template class. + This caused mkvmerge to abort on systems which did not use the GNU implementation of + the standard template library, e.g. OpenSolaris with the SunStudio compiler. Fix + for bug 567. +* Build system: bug fix: 'drake install' did not work if the login shell was not POSIX + compatible (e.g. fish). Fix for bug 559. +* mkvmerge: bug fix: The MPEG ES reader was accessing uninitialized data. This could + lead to crashes or source files not being read correctly. +* mkvmerge: bug fix: Using "--no-video" on AVI files caused the video track to be + mistaken for an audio track and included anyway. Fix for bug 558. + + +# Version 4.3.0 "Escape from the Island" 2010-09-04 + +## New features and enhancements + +* mkvmerge: enhancement: Attachments will be rendered at the beginning of the file + again. Fix for bug 516. +* mkvinfo: new feature: mkvinfo will show the H.264 profile and level for AVC/H.264 + tracks along with the CodecPrivate element. +* mkvextract, mkvinfo, mkvpropedit: new feature: Added the option "-q" and its long + version "--quiet". With "--quiet" active only warnings and errors are output. Fix + for bug 527. + +## Bug fixes + +* mkvmerge: bug fix: Appending tracks which would normally be compressed (e.g. with + header removal compression) and turning off compression for those tracks with + "--compression TID:none" (or the corresponsing option in mmg) was resulting in the + second and all following appended tracks to be compressed all the same. +* mkvextract: bug fix: Errors such as 'file does not exist' did not cause mkvextract to + quit. Instead it continued and exited with the result code 0. +* mkvmerge: bug fix: Certain frames in certain AVC/H.264 raw tracks were handled + wrong, e.g. files created by x264 versions starting with revision 1665. The + situation occurred if an IDR slice comes immedtiately after a non-IDR slice and the + IDR slice has its frame_num and pic_order_count_lsb fields set to 0. +* mkvpropedit, mmg's header editor: Fixed a crash corrupting files in certain + situations. If the updated header fields required filling exactly one byte with an + EbmlVoid element and if the next Matroska element's "size" was already written with + its maximum length (8 bytes) then the crash would occur. Such files are written by + e.g. lavf. Fix for bug 536. +* All: bug fix: Fixed a couple of format strings in translations which could cause the + programs to crash. +* mkvmerge: bug fix: Video tracks with a width or height of 0 are not read from AVI files + anymore. Fix for bug 538. +* mkvmerge: bug fix: Fixed an error with losing packets (error message "packet queue + not empty") when reading IVF (VP8) files using --default-duration on it. +* mkvmerge: bug fix: Fixed access to uninitialized memory in the MPEG-2 ES parser. +* mmg: bug fix: The 'total remaining time' shown by the job manager was totally wrong. + Fix for bug 529. +* mmg header editor: bug fix: If a file was loaded that did not contain 'track language' + elements and those elements were unchanged then they would be set to 'und' upon + saving. Now they're left as-is, and when adding them to the file the drop-down box + defaults to 'eng' being selected as per Matroska default value specifications. Fix + for bug 525. +* mkvmerge: bug fix: The option "--quiet" was not working properly. +* mkgmerge: bug fix: mkvmerge was treating SSA/ASS subtitle files as audio files for + the purpose of track selection (--no-subtitles / --no-audio). Fix for bug 526. + +## Build system changes + +* build system: The build system has been changed from "make" to "rake", the Ruby based + build tool. MKVToolNix includes its own copy of it so all you need is to have Ruby + itself installed. The build proecss has been tested with Ruby 1.8.6, 1.8.7 and + 1.9.1. Building is pretty much the same as before: "./configure", "./drake", "sudo + ./drake install". Most of the build targets have similar if not identical names, + e.g. "./drake install". You can override variables just like with make, e.g. + "./drake prefix=/somewhere install". + + +# Version 4.2.0 "No Talking" 2010-07-28 + +## New features and enhancements + +* mkvmerge: enhancement: Reading Matroska files: DisplayWidth & DisplayHeight + values that are obviously not meant to represent pixels but only to be used for aspect + ratio calculation (e.g. 16x9) are converted into proper ranges based on the track's + PixelWidth & PixelHeight values and the quotient of DisplayWidth / DisplayHeight. +* mkvmerge: enhancement: Attachments will be rendered at the end of the file instead + of at the beginning. The attachments will be placed after the cues but before the + chapters. Fix for bug 516. +* mkvmerge: enhancement: Header removal compression has been enabled by default for + MPEG-4 part 10 (AVC/H.264) video tracks with a NALU size field length of four bytes. +* mmg: enhancement: The taskbar progress is reset as soon as mkvmerge finishes/as + soon as all jobs are done (Windows 7). +* mkvmerge: enhancement: Improved reading text files that use mixed end-of-line + styles (DOS & Unix mixed). + +## Bug fixes + +* mkvmerge: bug fix: mkvmerge was accessing invalid memory In certain cases, e.g. + when appending Matroska files that use compression while turning compression off. +* mkvmerge: bug fix: Splitting output files by size was basing its decision when to + create a new file on an uninitialized variable. This caused effects like a lot of + small files being created with sizes much smaller than the intended split size. +* mkvmerge: bug fix: The speed with which mkvmerge skips garbage in DTS tracks has been + greatly improved. +* mkvmerge: bug fix: Header removal compression has been deactivated for MPEG-4 part + 2 (aka DivX/Xvid) video tracks due to incompatibility with packed bitstreams. +* mkvmerge: bug fix: Fixed reading AVC/H.264 tracks from AVI files if they're stored + without NALUs inside the AVI. Was broken by a fix for handling AVC/H.264 in NALUs + inside AVI. +* mkvmerge: bug fix: All readers that only handled file formats which do not contain + more than one track did not respect the "--no-audio / --no-video / --no-subtitles" + options. This applied to the following readers: AAC, AC-3, AVC/H.264, + CorePicture, Dirac, DTS, FLAC, IVF, MP3, MPEG ES, PGS/SUP, SRT, SSA, TrueHD, TTA, + VC-1, WAV and WavPack. +* mkvmerge: bug fix: Fixed invalid memory access in the PCM packetizer. Fix for bug + 510. +* mmg: bug fix: When mmg starts it will check the entries in the file and chapter menu's + list of recently used files and remove those entries that no longer exist. Fix for bug + 509. +* mkvmerge: bug fix: Fixed a crash when reading Matroska files that were damaged in a + certain way. + + +# Version 4.1.1 "Bouncin' Back" 2010-07-03 + +## Bug fixes + +* mkvmerge: bug fix: Fixed invalid memory access in the header removal compressor. + Fix for bug 508. +* mmg: bug fix: mmg will no longer add .mmg files opened by the job runner to the file + menu's list of recently opened files. Fix for bug 509. + + +# Version 4.1.0 "Boiling Point" 2010-07-01 + +## New features and enhancements + +* mkvmerge: enhancement: mkvmerge will report if it finds data errors in a Matroska + file (e.g. due to storage failure or bad downloads). The position is reported as well + as a periodic update as long as mkvmerge re-syncs to the next Matroska element. +* mmg: enhancement: The "compression" drop down box is enabled for all track types. + That way "no compression" can be forced for those tracks mkvmerge uses "header + removal" compression for. +* mkvmerge: enhancement: mkvmerge will start a new cluster before a key frame of the + first video track. Fix for bug 500. +* mkvmerge: enhancement: The default cluster length has been increased to five + seconds (up from two seconds). +* mkvmerge: enhancement: Implemented write caching resulting in faster muxes + especially on Windows writing to network shares. +* mkvmerge: new feature: Added support for reading PGS subtitles from PGS/SUP files. +* mkvmerge: enhancement: mkvmerge uses header removal compression by default for + AC-3, DTS, MP3, Dirac and MPEG-4 part 2 tracks. +* all: Added a translation of the programs into Spanish by Isra Lucas (see AUTHORS). +* docs: Added a Dutch translation for the man pages by René Maassen (see AUTHORS). + +## Bug fixes + +* mkvmerge: bug fix: Fixed reading AVC/H.264 tracks from AVI files if they're stored + in NALUs inside the AVI. +* mmg: bug fix: Matroska files read from/written to by the header and chapter editors + will no longer be kept opened and locked. Fix for bug 498. +* mmg: bug fix: If mmg was called with "--edit-headers filename.mkv" then it crashed + when the header editor was closed. +* mkvmerge: bug fix: mkvmerge will no longer report nonsensical progress reports + (e.g. -17239182%) when reading Matroska files with all the flags "--no-audio + --no-video --no-subtitles" enabled. Fix for bug 505. +* mmg: bug fix: Fixed a crash in the job runner when the total time was very big due to a + division by zero. +* mkvmerge: bug fix: Specifying an FPS with "--default-duration" for AVC/h264 + tracks in AVI files did not work. Fix for bug 492. +* mkvmerge: bug fix: Fixed an invalid memory access possibly causing a crash in the + AC-3 detection code. +* mmg: bug fix: Changing mmg's interface language did not change the entries in the + "command line options" dialog if that dialog had been opened prior to the language + change. +* mkvmerge: bug fix: Fixed access to uninitialized memory when reading DTS tracks + from AVI and Matroska files. +* mkvmerge: bug fix: The Matroska reader will use the MPEG audio packetizer for MP2 + tracks instead of the passthrough packetizer. +* mkvmerge: bug fix: The Matroska reader did not handle compressed tracks correctly + if the passthrough packetizer was used. +* mkvmerge: bug fix: The handling of Matroska files in which the 'default track flag' + is not present has been fixed. + +## Build system changes + +* Build system: enhancement: Improved the error reporting if certain Boost + libraries are not found. + +## Other changes + +* all: Added desktop files for mmg/mkvinfo, a MIME type file for .mmg files and icons to + the installation procedure on Linux. Most files were contributed by Cristian + Morales Vega (see AUTHORS). + + +# Version 4.0.0 "The Stars were mine" 2010-06-05 + +## New features and enhancements + +* mmg: new feature: Added the estimated remaining time to the mux and job dialogs. +* all: Added a translation of the programs into Dutch by René Maassen (see AUTHORS). +* mmg: enhancement: The "mkvmerge executable" input in the preferences dialog is not + read-only anymore. Final part of a fix for bug 490. +* mkvmerge: Added support for reading IVF files with VP8 video tracks. +* mkvextract: Added support for extracting VP8 video tracks into IVF files. +* mkvinfo: new feature: Added an option ("-z" / "--size") for displaying each + element's size property. Elements with an unknown/infinite size are shown as "size + is unknown". +* mmg: new feature: Added a checkbox for enabling "WebM" mode. This will also enable + the same limitations that mkvmerge enables: Only VP8 and Vorbis tracks, no + chapters, no tags. The output file name extension will be changed to ".webm" upon + enabling the mode. +* mkvmerge: new feature: Neither chapters nor tags will be written to WebM compliant + files. Warnings are issued if chapters or tags are found and not disabled. +* mmg: enhancement: Added "WebM" with the extension "webm" to the list of known file + types. +* mkvmerge: new feature: Added support for muxing VP8 video tracks. +* mkvmerge: enhancement: mkvmerge will no longer put all clusters into a meta seek + element resulting in smaller file size. The parameter + "--no-clusters-in-meta-seek" has been renamed to "--clusters-in-meta-seek" + and its meaning reverted. +* mkvmerge: enhancement: WebM compatibility mode will be turned on automatically if + the output file name's extension is '.webm', '.webma' or '.webmv'. +* mkvinfo GUI: enhancement: Added "webm" to the list of known file name extensions for + WebM files both for the "Open file" dialog and the drag & drop support. +* mkvmerge: new feature: Added options "--webm"/"--web-media" that enable the WebM + compatibility mode. In this mode only Vorbis audio tracks and VP8 video tracks are + allowed. Neither chapters nor tags are allowed. The DocType element is set to + "webm". + +## Bug fixes + +* all command line tools: bug fix: Fixed the output of eastern languages like Japanese + or Chinese under cmd.exe on Windows. +* mkvmerge: bug fix: Fixed support for reading FLAC tracks from Ogg files following + the FLAC-in-Ogg-mapping established with FLAC v1.1.1. Fix for bug 488. +* mmg: bug fix: mmg will output a warning if it is used with a mkvmerge executable whose + version differs from mmg's version. Part of a fix for bug 490. +* mmg: bug fix: If adding a file fails mkvmerge's error message will be shown in a + scrollable dialog instead of a normal message box. Part of a fix for bug 490. +* mkvmerge, mkvinfo, mkvextract: bug fix: Fixed handling of clusters missing a + cluster time code element. +* mkvinfo GUI: bug fix: Frames for simple blocks were shown at the wrong place in the + element tree. +* mkvmerge, mkvextract: Fixed handling of clusters with an unknown size. +* mkvinfo: bug fix: Fixed handling clusters with an unknown size. +* mkvmerge: bug fix: Matroska files without clusters are accepted as valid input + files again. +* mkvinfo GUI: bug fix: Opening more than one file without restarting mkvinfo GUI + could result in wrong time codes due to variables not being reinitialized. +* mkvinfo: bug fix: Binary elements shorter than 10 bytes were not output correctly. +* Build system: bug fix: The man page installation process only installed the English + originals instead of the Japanese and Chinese translations. + +## Build system changes + +* build: Building mkvtoolnix now requires libebml v1.0.0 and libmatroska v1.0.0 or + later. + +## Other changes + +* mkvextract: feature removal: Removed support for extracting FLAC tracks into Ogg + FLAC files. Instead they're always written into raw FLAC files. The option + "--no-ogg" has been removed as well. +* mkvmerge: feature removal: Removed support for the FLAC library older than v1.1.1. +* mmg: Added 'IVF' files to the list of known input file types. +* mkvmerge: change: mkvmerge will not write track header elements whose actual value + equals their default value anymore. + + +# Version 3.4.0 "Rapunzel" 2010-05-14 + +## New features and enhancements + +* all: Added a translation into Ukrainian by Serj (see AUTHORS). +* Windows installer: Added the choice to run the installer in the same languages that + the GUIs support. Patch by Serj (see AUTHORS) with modifications by myself. +* all: Added a translation into Russian by Serj (see AUTHORS). + +## Bug fixes + +* mkvmerge: bug fix: Fixed the handling of non-spec compliant AVC/H.264 elementary + streams in Matroska files with the CodecID V_ISO/MPEG4/AVC. Fix for bug 486. +* mkvmerge: bug fix: mkvmerge will not output a message that it has extracted the + display dimensions from AVC/H.264 bitstream if the source container (e.g. + Matroska) overrides that setting. Fix for bug 485. +* mmg's header editor, mkvpropedit: Fixed crashes with files created by Haali's GS + Muxer containing "content encoding" header elements. +* mkvextract: bug fix: Extracting SSA/ASS files which miss the "Text" column + specifier in the "Format:" line are handled correctly. Fix for bug 483. +* mkvmerge: bug fix: Fixed a segfault when reading Matroska files containing level 1 + elements other than clusters with a size of 0. +* mkvmerge: bug fix: Fixed a tiny memory leak. Fix for bug 481. + +## Build system changes + +* build: Building mkvtoolnix now requires libebml v0.8.0 and libmatroska v0.9.0 or + later. +* Build system: The LINGUAS environment variable determines which man page and guide + translations will be installed. + + +# Version 3.3.0 "Language" 2010-03-24 + +## New features and enhancements + +* mkvmerge: enhancement: Added a message in verbosity level 2 to the splitting code. + It reports before which time code and after what file size a new file is started. +* All: enhancement: Added support for old Mac-style line endings (only '\r' without + '\n') in text files. +* mmg: enhancement: Added the values "4483M" and "8142M" to the "split after this + size" drop down box. +* mkvmerge, mkvextract: enhancement: Improved the error resilience when dealing + with damaged Matroska files. When a damaged part is encountered reading will + continue at the next cluster. +* mkvmerge: enhancement: Some Matroska files contain AVC/H.264 tracks lacking + their CodecPrivate element (e.g. files created by gstreamer's muxer). For such + tracks the CodecPrivate element (the AVCC) is re-created from the bitstream. Fix + for bug 470. + +## Bug fixes + +* mkvmerge: bug fix: Fixed the default duration for interlaced MPEG-1/2 video + tracks. Also added the 'interlaced' flag for such tracks. Patches by Xavier Duret + (see AUTHORS). Fix for bug 479. +* mkvmerge: bug fix: Specifying a FourCC with spaces at the end will not result in an + error anymore. Fix for bug 480. +* mkvmerge: bug fix: Time Codes for MPEG-1/2 tracks are calculated properly, + especially for B frames. Patch by Xavier Duret (see AUTHORS). Fix for bug 475. +* mkvmerge: bug fix: Fixed a crash when reading Matroska files that contain Vorbis + audio with in MS compatibility mode (CodecID A_MS/ACM). Fix for bug 477. +* mmg: bug fix: Fixed compilation if gettext is not available. +* Build system: Added project files and fixes for compilation with Microsoft Visual + Studio 8. Patches by David Player (see AUTHORS). +* Installer: bug fix: A couple of start menu links to pieces of the documentation were + broken. Added missing start menu links to translations of the documentation. +* mkvmerge: bug fix: The SRT reader skips empty lines at the beginning of the file. +* Build system: bug fix: Fixed the configure script and compilation on OpenSolaris. +* Installer: bug fix: The "jobs" directory in the application data folder is removed + during uninstallation if the user requests it. Fix for bug 474. +* mkvextract: bug fix: Fixed granulepos calculation when extracting Vorbis tracks + into Ogg files. Fix for bug 473. +* All: bug fix: The programs will no longer abort with an error message if a selected + interface translation is not available. The "C" locale is used instead. Fix for bug + 472. +* mkvmerge: bug fix: Fixed the handling of UTF-16 encoded chapter names in MP4/MOV + files. +* mkvmerge: bug fix: MP4 files that do contain edit lists but whose edit lists do not + span the entire file are processed properly. Such files are created by current x264 + builds. Fix for bug 469. +* Build system: Fixed configure for systems on which 'echo' does not support the '-n' + parameter (e.g. macOS). + +## Build system changes + +* Build system: Sped up builds by using pre-compiled headers. Patches by Steve Lhomme + (see AUTHORS) and myself. + +## Other changes + +* All: A lot of changes preparing mkvtoolnix for use with the upcoming + libebml2/libmatroska2 versions were applied. Patches by Steve Lhomme (see + AUTHORS). + + +# Version 3.2.0 "Beginnings" 2010-02-11 + +## New features and enhancements + +* docs: Added a Chinese Simplified translation for the man pages by Dean Lee (see + AUTHORS). +* mmg: enhancement: Added an input field for the segment info XML file (mkvmerge's + "--segmentinfo" option) on the "global" tab. +* mmg: enhancement: Changing the interface language does not require a restart + anymore. +* mkvinfo: enhancement: Added the "EBML maximum size length" element to the list of + known elements. Fix for bug 464. +* mmg: new feature: Added a control for mkvmerge's "--cropping" parameter. +* mmg: enhancement: Added the file extensions ".dtshd", ".dts-hd", ".truehd" and + ".true-hd" to mmg's"'add/append file" dialogs. + +## Bug fixes + +* mmg, mkvpropedit: Fixed another bug causing a crash writing chapters/other + elements to existing Matroska files. +* Build system: bug fix: Improved detection of Boost::Filesystem for newer Boost + versions. +* mkvmerge: bug fix: Outputting error messages about invalid XML files will not cause + mkvmerge to crash on Windows anymore. +* mmg: bug fix: The jobs will be saved in the 'mkvtoolnix/jobs' sub-directory of the + 'application data' folder instead of the 'jobs' folder in the current directory. On + Windows this is the special 'application data' folder inside the user's profile + directory, e.g. 'C:\Users\mbunkus\AppData\mkvtoolnix'. On non-Windows + systems this is the folder '.mkvtoolnix' in the user's home directory. mmg's + configuration file has also been moved from ~/.mkvmergeGUI to + ~/.mkvtoolnix/config on non-Windows systems. Fix for bug 466. +* mkvextract: bug fix: Files are only opened for reading, not for writing, so that + mkvextract will work on files the user only has read-only permissions for. +* mkvextract: bug fix: Modes 'attachments', 'chapters', 'tags' and 'cuesheet': + mkvextract will output an error message if the file cannot be opened (e.g. because it + does not exist or due to lack of access). +* mkvmerge: bug fix: Reading VOB files bigger than 4 GB was broken in v3.1.0 on 32bit + platforms. +* mmg: bug fix: Tooltips were not word-wrapped on Windows. +* mkvextract: bug fix: "mkvextract --version" was only writing an empty string. Fix + for bug 463. + +## Build system changes + +* Build requirements changed: The GUIs for mkvtoolnix now require wxWidgets 2.8.0 or + newer. + + +# Version 3.1.0 "Happy Up Here" 2010-01-19 + +## New features and enhancements + +* documentation: Added a Chinese Simplified translation for mmg's guide by Dean Lee + (see AUTHORS). +* documentation: Added a Japanese translation for the man pages by Katsuhiko + Nishimra (see AUTHORS). +* mmg: enhancement: After muxing the "abort" button is changed to "open folder" which + opens the explorer on the output file's folder. This only happens on Windows. +* mmg: enhancement: When constructing the output file name mmg will only suggest + names that don't exist already by appending a number to the file name (e.g. resulting + in "/path/file (1).mkv"). +* mkvmerge: new feature: Added support for reading chapters from MP4 files that are + stored in tracks with subtype 'text'. Such files are used e.g. on iPods/iPhones and + can be created by HandBrake. Fix for bug 454. +* mkvmerge: enhancement: SRT files with negative time codes will are not rejected + anymore. Negative time codes will be adjusted to start at 00:00:00.000. +* mkvextract: new feature: Added support for extracting Blu-Ray subtitles (CodecID + "S_HDMV/PGS"). +* mkvmerge/mmg: enhancement: Added an option '--segment-uid' for specifying the + segment UIDs to use instead of having to use an XML file and '--segmentinfo'. + +## Bug fixes + +* mkvmerge: bug fix: If the first input file was a Quicktime/MP4 file and all tracks + from that file were deselected for muxing then mkvmerge would crash. Fix for bug 458. +* mmg: bug fix: The option 'AAC is SBR/HE-AAC' was not honored for appended AAC tracks. + This could lead to mkvmerge aborting with an error that the track parameters did not + match if it itself could not detect HE-AAC in the second file. +* mmg: bug fix: The output file name is checked for invalid characters before the + muxing process is started. Fix for bug 455. +* mkvpropedit, mmg: bug fix: Files with an infinite segment size are handled + correctly now. Fix for bug 438. +* mkvmerge: bug fix: Matroska files which have its 'tracks' element located behind + the clusters are read correctly now. +* mmg: bug fix: The "tags" input box on the "general track options" tab was not updated + when a track was selected. Fix for bug 453. +* mkvmerge, mmg: new feature: If a MPEG-2 program stream file is added to mkvmerge + whose base name ends in a number then mkvmerge will automatically read and process + all other files in the same directory with the same base name, same extension and + different numbers. Those files are treated as if they were a single big file. This + applies e.g. to VOB files from DVD images that are named VTS_01_1.VOB, + VTS_01_2.VOB, VTS_01_3.VOB etc. mmg will output an error message if the user tries + to add or append one of the other files that mkvmerge will process automatically + (e.g. if the user has added VTS_01_1.VOB already and tries to append VTS_01_2.VOB). + This also fixes bug 437. +* mkvmerge: bug fix: Zero-length frames in Theora bitstreams as created by libtheora + v1.1 and later were dropped. Fix for bug 450. +* mmg: bug fix: On Windows 2000/XP the 'add/append file' dialog was not showing files + with certain extensions (e.g. ".srt" or ".mp4") if the option "all supported media + files" was selected. Fix for bug 448. + +## Build system changes + +* Build requirements changed: mkvtoolnix requires Boost v1.34.0 or later. It + requires the Boost::Filesystem library (with all Boost versions) and the + Boost::System libraries (starting with Boost v1.35.0). + +## Other changes + +* Installer: The installer will no longer offer to run mmg after it has been installed. + On Windows setups where a normal user account doesn't have administrator + privileges this caused mmg to be run as the user "Administrator" instead of the + normal user account causing confusion and some things not to work, e.g. drag & drop. + + +# Version 3.0.0 "Hang Up Your Hang-Ups" 2009-12-12 + +## New features and enhancements + +* mmg: enhancement: Added support for showing the muxing progress for both normal + muxes and the job manager in Windows 7's taskbar. +* all: enhancement for Windows platforms: If one of the mkvtoolnix components is run + without having been installed before then translations will be read from the + directory the .exe is run from. +* configure: Added an option ('--without-build-timestamp') that omits the build + timestamp from all version information so that two builds of mkvtoolnix can be + byte-identical. + +## Bug fixes + +* all: bug fix: The charset for output in cmd.exe for non-English interface languages + has been fixed on Windows Vista and Windows 7. +* mkvpropedit, mmg: bug fix: Editing headers of files created by HandBrake would + cause crashes and/or corrupted files after saving. Fix for bug 445. + + +# Version 2.9.9 "Tutu" 2009-11-25 + +## New features and enhancements + +* mkvmerge: enhancement: A single '+' causes the next file to be appended just like + putting the '+' in front of the file name. +* mmg: enhancement: The file dialogs for 'add file'/'append file' will show files + with extensions in all uppercase as well. This only applies to file systems that + distinguish between case (e.g. most of the non-Windows, non-FAT world). Fix for bug + 433. + +## Bug fixes + +* mmg: bug fix: The warning that no FPS has been entered for AVC/H.264 elementary + streams is not shown anymore for appended tracks (only once for the first track that + they're appended to). +* mkvmerge: bug fix: The pixel cropping parameters were not kept when muxing from + Matroska files. +* mkvmerge: bug fix: The display width/height parameters were not kept when muxing + from Matroska files if the bitstream of the track contained different aspect ratio + information. Now the order is "command line" first, "source container" second and + "bitstream" last. +* mkvmerge: bug fix: Fixed the subtitle track selection for AVI files. +* mkvmerge: bug fix: The integrated help ('--help') contained wrong information + about the '--sync' option. Fix for bug 435. +* mkvmerge: bug fix: Missing ChapterLanguage elements were assumed to be set to + "und". They're now assumed to be "eng" in accordance with the Matroska + specifications. + +## Other changes + +* Added a new program 'mkvpropedit' that can modify certain properties of existing + Matroska files. It is mmg's header editor, just for the command line. + + +# Version 2.9.8 "C'est le bon" 2009-08-13 + +## New features and enhancements + +* mmg/header editor: enhancement: Implemented a considerable speedup in the + processing of large files. +* mkvinfo: enhancement: Implemented speed-ups of up to 50% for middle to larger + files. + +## Bug fixes + +* mmg: bug fix: The inputs for time code files and the language are deactivated if the + user has selected a track that will be appended to another track. Fix for bug 432. +* mmg: bug fix: mmg will handle multiple consecutive spaces in the options given with + "add command line options" properly and not cause mkvmerge to exit with misleading + error messages anymore. The "add command line options" dialog has been reordered, + and the drop down box in it is now read-only. Fixes for bug 429. +* doc, mmg: bug fix: The tooltip and documentation for the 'delay' option was + misleading. Fix for bug 420. +* mmg/header editor: bug fix: The header editor copes better with files that do not + contain all mandatory header fields. The missing ones are added or assumed to be + default values. +* all: bug fix: Selecting the translations with the "--ui-language" option did not + work on macOS X. +* mkvmerge: bug fix: Fixed an invalid memory access in the VobSub reader module. Fix + for bug 426. +* mmg: bug fix: Tracks added from Matroska files did not get their 'default track' drop + down box set correctly if the flag was 'off' in the source file and no other track of its + kind hat its 'default track' flag set. +* mkvmerge: bug fix: mkvmerge was wrongly turning the 'default track' flag back on for + the first subtitle track muxed from a Matroska file if none of the subtitle tracks + muxed had their 'default track' flag set in their source files and if the user didn't + use the '--default-track' option for setting that flag explicitely. +* mmg: bug fix: Running mkvmerge on Windows from an installation directory with two + spaces in the path (e.g. "C:\Program Files\Video tools\mkvtolnix") crashed mmg + when the user started muxing. Fix for bug 419. +* mmg: bug fix: Files for which all tracks were disabled were left out from mkvmerge's + command line so that tags, chapters and attachments were not copied from such files + either. +* mkvmerge: bug fix: Appending MPEG4 part 2 video tracks from Matroska files which + contain aspect ratio information will not result in an error message "connected_to + \> 0" anymore. Fix for bug 427. +* mkvmerge: bug fix: Fixed the audio sync for tracks read from AVI files containing + garbage at the beginning. Fix for bug 421. +* mmg: bug fix: Trying to save chapters that contain editions without a single chapter + entry does no longer result in a crash but a descriptive error message instead. + Saving empty chapters to a Matroska file will remove all chapters contained in the + file instead of not doing anything. Fixes for bug 422. +* mkvmerge: bug fix: Fixed reading AVC/H.264 video tracks from OGM files. Fix for bug + 418. +* mmg: bug fix: The chapter language for chapters copied from source files (e.g. + Matroska, MP4 or OGM files) is only changed if the user has selected any language + other than "und". Fix for bug 420. +* mmg: bug fix: mmg will no longer show an error message if the user has not selected a + country in the "chapters" tab of the preferences dialog. + + +# Version 2.9.7 "Tenderness" 2009-07-01 + +## New features and enhancements + +* mmg: new feature: The list of common languages can be configured by the user via the + 'preferences' dialog. +* mkvmerge, mmg: new feature: The language for chapters read from files such as OGM and + MP4 files can be chosen with the --chapter-language command line option. Fix for bug + 399. +* mkvmerge, mmg: new feature: Chapter and tag information contained in source files + are now shown in the "track" selection box and can be toggled individually. The user + can set the charset for chapters if the source file's chapters are not encoded in + UTF-8 (e.g. in some OGM/MP4 files). The old file specific checkboxes "no tags" and + "no chapters" have been removed. Fix for bug 400. +* mmg: enhancement: If the user selects the option "Verify" from the "Chapters" menu + then a message will be shown even if the validation succeeded. Fix for bug 410. + +## Bug fixes + +* mkvmerge: bug fix: The handling of NVOPs in native MPEG4 part 2 video storage has been + improved. NVOPs are dropped again both from packed and non-packed bitstreams, and + time codes are adjusted to match the number of dropped frames. +* mkvmerge: bug fix: The I frame detection for AVC/H.264 video has been fixed. + Sometimes a single I frame was recognized as two or more consecutive I frames + resulting in garbled display and wrong timestamps. Fix for bug 415. +* all: bug fix: The programs do not try to close iconv handles -1 anymore which resulted + in segfault during uninitialization on some platforms (e.g. FreeBSD, macOS X). Fix + for bug 412. +* mkvmerge: bug fix: Complete rewrite of the code for the native storage mode for MPEG4 + part 2 video tracks. Fix for bug 298. +* mkvmerge: bug fix: Made the detection rules for raw MP3, AC-3 and AAC audio files more + strict. This avoids a mis-detection of certain files, e.g. AVC/H.264 ES files being + misdetected as MP3 files. Fix for bug 414. +* mkvmerge: bug fix: Appending MP4 or OGM files with chapters will merge the chapters + from all appended files and not just take the chapters from the first file and discard + the chapters from the following files. Fix for bug 397. +* mmg: bug fix: The chapter editor was corrupting Matroska files if the chapters were + saved to a file twice in a row without reloading them from the Matroska file. +* mmg/mkvmerge: bug fix: Adding MP4 files with chapter entries that are not encoded in + UTF-8 will not result in mkvmerge aborting with a message about invalid UTF-8 + sequences anymore. Fix for bug 408. + +## Other changes + +* mmg: The "preferences" dialog has been split up into several tabs. Some other + preferences available in other dialogs have been merged into the "preferences" + dialog. + + +# Version 2.9.5 "Tu es le soul" 2009-06-06 + +## New features and enhancements + +* mkvmerge: new feature: Improved the control over which tags get copied from a source + file to the output file. The old option "--no-tags" was replaced with the new options + "--no-global-tags" which causes global tags not to be copied and + "--no-track-tags" which causes track specific tags to not be copied. The new option + "--track-tags" can be used to select tracks for which tags will be copied. The + default is still to copy all existing tags. +* mkvmerge: new feature: Included chapters, global and track specific tracks in the + output of mkvmerge's identification mode. +* mkvmerge: new feature: Added support for the FourCCs ".mp3" and "XVID" in QuickTime + files. + +## Bug fixes + +* mkvmerge: bug fix: The handling of TrueHD/MLP audio in MPEG program streams was + broken resulting in many dropped packets. +* all: bug fix: There was the possibility that invalid memory access occurred and e.g. + mkvmerge crashed on systems with the posix_fadvise() function (mainly Linux) if + mkvmerge was opening several files from certain file systems (e.g. VFAT). Apart + from obvious crashes the only other side effect was that the posix_fadvise() + function would not be used resulting in slightly worse I/O performance. +* mkvmerge: bug fix: The sequence header of MPEG-1/2 video tracks is put into the + CodecPrivate again while still leaving sequence headers in the bitstream as well. + This is more compatible with some existing parsers. +* mmg: bug fix: Removed the check if the user has added tracks and files before starting + mkvmerge because mkvmerge itself is able to create track-less files (e.g. chapters + only). Fix for bug 402. +* mkvmerge: bug fix: Improved the handling of consecutive AC-3 packets with the same + time code (e.g. if AC-3 is read from MP4 files). Fix for bug 403. +* mkvmerge: bug fix: Fixed an endless loop in the TrueHD code occuring when the TrueHD + stream is damaged somewhere. +* mkvmerge: bug fix: Fixed the detection of MPEG transport streams with other packet + sizes than 188 bytes (e.g. 192 and 204 bytes). +* mkvmerge: bug fix: The detection of invalid padding packet lengths in the MPEG + program stream reader was improved to not produce as many false positives. Patch by + Todd Schmuland (see AUTHORS). Fix for bug 393. +* mmg: bug fix: Pressing 'return' in the job dialog will close the dialog on Windows, + too. Fix for bug 392. +* mmg: bug fix: Fixed the behaviour of how mmg sets the output file name automatically + if the option is enabled. If the user adds more than one file then the extension of the + output file name is set each time a file is added and not only when the first one is. The + full file name and path will only be set when the first file is added. Fix for bug 391. + +## Other changes + +* mkvmerge: Renamed a couple of command line options to make the command line + interface more consistent: "--no-audio", "--no-video", "--no-subtitles", + "--no-buttons", "--audio-tracks", "--video-tracks", "--subtitle-tracks", + "--button-tracks". The old versions of these options "--noaudio", "--novideo", + "--nosubs", "--nobuttons", "--atracks", "--vtracks", "--stracks" and + "--btracks" still work. + + +# Version 2.9.0 "Moanin'" 2009-05-22 + +## New features and enhancements + +* all: Added a translation to Traditional Chinese by Dean Lee (see AUTHORS). +* mkvmerge: new feature: Added a hack ('vobsub_subpic_stop_cmds') that causes + mkvmerge to add 'stop display' commands to VobSub subtitle packets that do not have a + duration field. Patch by Todd Schmuland (see AUTHORS). +* mmg: enhancement: Changed how mmg sets the output file name automatically if the + option is enabled. If the user adds more than one file then the output file name is set + each time a file is added and not only when the first one is unless the user has changed + the output file name manually. Fix for bug 229. +* mkvmerge: enhancement: Improved support for QuickTime audio tracks with version 2 + of the STSD sound descriptor. +* mkvmerge: enhancement: The MPEG program stream reader will now detect invalid + padding packets and skip only to the next 2048 byte packet boundary instead of + skipping several good packets. Patch by Todd Schmuland (see AUTHORS). +* mmg: enhancement: The "no chapters" checkbox can now be used for QuickTime/MP4 + files and OGM files as well. +* mkvmerge: enhancement: The OGM reader will only print the warning that no chapter + charset has been set by the user if the title or the chapter information contained in + the OGM file is actually used and not overwritten with '--title ...' or + '--no-chapters'. +* mkvmerge: new feature: Added support for handling MPEG-1/-2 video in AVI files. Fix + for bug 388. +* mkvmerge: enhancement: Implemented small speedups for some common memory + operation (affects e.g. the MPEG program stream parser). +* mkvmerge: new feature: Added support for reading chapters from MP4 files. Fix for + bug 385. + +## Bug fixes + +* mkvmerge: bug fix: mkvmerge was not handling dropped frames well when converting + from VfW-mode MPEG-4 part 2 to native mode MPEG-4 part 2 (with '--engage + native_mpeg4'). This resulted in time codes being to low which in turn resulted in + the loss of audio/video synchronization. Fix for bug 236. +* mkvextract: bug fix: The modes 'chapters', 'cuesheet' and 'tags' did not honor the + '--redirect-output' option and where always writing to the standard output. +* mmg: bug fix: The "remove all" button was sometimes disabled even though there were + still files left to be removed. +* mkvextract: bug fix: The VobSub extraction was made more compatible with most + applications. Fix for bug 245. Patch by Todd Schmuland (see AUTHORS). +* mkvmerge: bug fix: Fixed support for Windows systems that use code pages that are not + supported by the iconv library (e.g. code page 720). mkvmerge was exiting with + warnings causing mmg to report that file identification had failed. Fix for bug 376. +* all: bug fix: Global variables are deconstructed in a pre-defined way no longer + causing segfaults when the programs are about to exit. +* mkvmerge: bug fix: Fixed potential and actual segmentation faults occuring when + appending VC-1 video tracks, Dirac video tracks and DTS audio tracks. +* mmg: bug fix: The header and chapter editors will no longer crash the application if + the user wants to open a file that's locked by another process and show an error + message instead. +* mkvmerge: enhancement: Invalid VobSub packets whose internal SPU length field + differs from its actual length are patched so that the SPU length field matches the + actual length. This fixes playback issues with several players and filters. Fix for + bug 383. + + +# Version 2.8.0 "The Tree" 2009-05-09 + +## New features and enhancements + +* all: Added a translation to Chinese (simplified) by Dean Lee (see AUTHORS). +* mkvmerge: enhancement: Added support for handling AC-3 audio in MP4 files with the + FourCC "sac3" (as created by e.g. Nero Recode v3/4). Fix for bug 384. +* mkvmerge, mmg: enhancement: Made mmg's "FPS" input field available for all video + tracks. mkvmerge's corresponding option "--default-duration" now not only + modifies the track header field but affects the frame time codes as well. +* mmg: enhancement: Added "60000/1001" as a pre-defined option to the "FPS" + drop-down box. +* mmg: new feature: Added an option for clearing all inputs after a successful muxing + run. + +## Bug fixes + +* mkvmerge: bug fix: The VobSub reader was dropping the very last MPEG packet possibly + resulting in the very last subtitle entry being garbled or discarded completely. + Patch by Todd Schmuland. +* mmg (header editor): bug fix: The header editor controls on the right stopped + responding after the second file had been loaded or the "reload file" feature had + been used. Fix for bug 372. +* mkvmerge: bug fix: Made the AAC detection code stricter in what it accepts. This + results in fewer mis-detections. Fix for bugs 373 and 374. +* mkvmerge: bug fix: Splitting without the option "--engage no_simpleblocks" + resulted in broken files: all frames were marked as B frames. Fix for bug 371. +* mkvinfo: bug fix: Time Codes of SimpleBlock elements that were output formatted in + summary mode were too small by a factor of 1000000. +* mkvmerge: bug fix: The duration of subtitle frames was overwritten with the + difference between the next frame's time code and the current frame's time code if a + time code file was used for that track. Fix for bug 286. +* mmg: bug fix: Removed the option "always use simple blocks" from the preferences + dialog as this option was already removed from mkvmerge. Fix for bug 370. + + +# Version 2.7.0 "Do It Again" 2009-04-14 + +## New features and enhancements + +* mkvmerge, mmg: new feature: Added support for the "forced track" flag. Fix for bug + 128. +* mmg: new feature: Added drag & drop support for the header editor (files can be opened + by dropping them on the header editor). +* mkvmerge: new feature: Added support for reading the track language from + QuickTime/MP4 files. Thanks to Eduard Bloch for the code for unpacking the language + string. +* mkvmerge, mkvextract: new feature: Added support for MLP audio. +* mkvmerge, mkvetract: new feature: Added support for TrueHD audio (read from raw + streams with or without embedded AC-3 frames, MPEG program streams). + +## Bug fixes + +* mmg: bug fix: The header editor and chapter editor will not write zero bytes anymore + if there's not enough space to write an EbmlVoid element when saving to Matroska + files. +* mkvmerge: bug fix: Fixed the aspect ratio extraction for AVC/H.264 video by adding + three more pre-defined sample aspect ratios. Mkvmerge also only assumes "free + aspect ratio" if the aspect ratio type information indicates it and not if the type + information is unknown. +* mmg: bug fix: All arguments are shell escaped and quoted instead of only those with + spaces in them. Only applies to the menu options "show command line", "save command + line to file" and "copy command line to clipboard". Fix for bug 364. +* mmg: bug fix: When adding a file with colons in the segment title all colons were + replaced with the letter 'c'. +* mmg: bug fix: The job manager's status output was garbled if mmg was run with another + language as English. +* mmg: bug fix: The progress bar for each individual job in the job dialog wasn't + updated if mmg was run with another language as English. +* mmg: bug fix: The time codes in the job queue editor were off by one month. The "added + job on" was additionally off by an amount depending on the user's time zone. Fix for + bug 362. +* mkvmerge: bug fix: The MPEG program stream (VOB/EVO) reader was sometimes reading + the time codes wrong resulting in bad audio/video synchronization. Fix for bug 337. + +## Build system changes + +* Build requirements changed: mkvtoolnix requires Boost v1.32.0 or later. + +## Other changes + +* mkvmerge: mkvmerge will now use SimpleBlock elements instead of normal BlockGroup + elements by default. +* mkvmerge: By default mkvmerge keeps the aspect ratio information in AVC/H.264 + video bitstreams now (equivalent to specifying "--engage + keep_bitstream_ar_info" in earlier versions). A new option "--engage + remove_bitstream_ar_info" is available that restores the previous behaviour. + + +# Version 2.6.0 "Kelly watch the Stars" 2009-03-24 + +## New features and enhancements + +* mmg: new feature: Added a header editor for Matroska files. +* all: Added a Japanese translation by Hiroki Taniura (see AUTHORS). +* mkvinfo: enhancement: If mkvinfo is started in GUI mode on Windows then the console + that was started with it will be closed. + +## Bug fixes + +* mkvextract: bug fix: The "simple" chapter extraction mode (OGM style chapter + output) outputs strings converted to the system's current charset by default now + instead of always converting to UTF-8. This can be overridden with the + "--output-charset" command line option. Fix for bug 359. +* mkvmerge: bug fix: QuickTime audio tracks will be stored with the CodecID + "A_QUICKTIME". The CodecPrivate element contains the full "STSD" element from the + QuickTime file (just like V_QUICKTIME). This method is used for all audio tracks + which don't have a well-defined storage spec for Matroska (e.g. AAC, AC-3, MP2/3 are + still stored as A_AC3, A_AAC etc). Hopefully a fix for bugs 354 and 357. +* mkvmerge: bug fix: The CodecPrivate element for QuickTime video tracks like + Sorenson Video Codecs contained wrong data. Fix for bug 355. +* mkvmerge: bug fix: Fixed detection of little endian PCM tracks in MOV files. Fix for + bug 356. +* mkvextract: bug fix: The charset for text output was not initialized correctly + resulting in garbled display of non-ASCII characters in non-UTF-8 locales. +* all: bug fix: A couple of translated strings were converted from the wrong locale + when they were displayed. +* all: bug fix: The tools use the API call "GetOEMCP()" on Windows instead of + "GetACP()". This should make messages output in cmd.exe come out correctly for + Windows versions for which cmd.exe uses a different code page than the rest (e.g. on + German Windows). +* mkvinfo: bug fix: Chapter names and tag elements were recoded to the wrong charset + resulting in garbled output. Fix for bug 353. + +## Other changes + +* mmg, mkvinfo: The GUIs now require an Unicode-enabled version of wxWidgets. + + +# Version 2.5.3 "Boogie" 2009-03-07 + +## Bug fixes + +* mkvmerge, mkvextract, mmg: bug fix: If the environment variables LANG, LC_ALL, + LC_MESSAGES contained a locale that was supported by the system but for which + mkvtoolnix did not contain a translation (e.g. fr_FR, it_IT, en_AU) then the + programs would abort with an error message. Fix for bug 338. +* mkvmerge: bug fix: Appending raw AVC/ES files resulted in segmentation faults. Fix + for bug 344. +* mkvmerge: bug fix: When mkvmerge was run with the --attachments option to copy only + some of the attachments in a Matroska file then any attachment with an ID larger than + the first skipped attachment ID was not copied into the new file. Fix for bug 346. + + +# Version 2.5.2 "Stranger in your Soul" 2009-02-28 + +## New features and enhancements + +* mmg: new feature: Added two buttons "enable all" and "disable all" to the list of + attached files that enable / disable all attached files. +* mkvinfo: new feature: Made mkvinfo's GUI translatable. Added a German translation + for the GUI. + +## Bug fixes + +* installer: bug fix: If the installer is run in silent mode (switch "/S") then it will + not ask the user whether or not to place a shortcut on the desktop, and that shortcut + will not be created. Fix for bug 345. +* mmg: bug fix: The action "File" -\> "New" did not clear the internal list of attached + files resulting in unexpected behaviour if files with attachments where added + afterwards. +* mmg: bug fix: The button "remove all files" did not clear the list of attached files. +* mmg: On Linux wxWidgets 2.8.0 and newer uses the GTK combo boxes which suck. A lot. + Therefore mmg uses wxBitmapComboBoxes for wxWidgets \>= 2.8.0 on Linux and normal + wxComboBoxes in all other cases. wxBitmapComboBoxes are still drawn by wxWidgets + itself (just like wxComboBoxes before 2.8.0) and offer much better functionality. + Fix for bug 339. +* mkvmerge, mmg: bug fix: The MIME type autodetection for attachments was broken for + paths with non-ASCII characters on non-UTF-8 encoded systems (mostly on Windows). + Fix for bug 340. +* source: various fixes for compilation with wxWidgets 2.9. +* all programs: bug fix: The locale was not detected properly often resulting in the + program aborting with the message that "the locale could not be set properly". Fix + for bug 338. + + +# Version 2.5.1 "He Wasn't There" 2009-02-22 + +## Bug fixes + +* mmg: bug fix: Fixed the selection of the translation to use if the LC_MESSAGES + environment variable has been set on Windows. + + +# Version 2.5.0 "Back To The Start" 2009-02-21 + +## New features and enhancements + +* mkvmerge, mkvinfo, mkvextract, mmg: Made all those programs nearly completly + translatable. Added a German translation for all four programs (only for the + programs, not for the static documentation: man pages, the guide to mmg etc). +* mkvmerge, mmg: new feature: Added options ('-m' / '--attachments' and its + counterparts '-M' / '--no-attachments') to mkvmerge for selecting which + attachments to copy and which to skip and the corresponding controls to mmg. + +## Bug fixes + +* mmg: bug fix: Fixed a crash during the check if files could be overwritten by the next + mux. Possible fix for bugs 335 and 336. +* mkvmerge: bug fix: Fixed the detection of AAC files whose first AAC header does not + start on the first byte of the file. +* mmg: bug fix: It was possible to crash mmg by clicking onto the root element in the + chapter editor. +* mkvextract: bug fix: During time code extraction mkvextract wrote large time codes + in scientific notation. + + +# Version 2.4.2 "Oh My God" 2009-01-17 + +## New features and enhancements + +* mkvmerge, mmg: enhancement: Implemented MIME type detection for attachments with + libmagic on Windows. +* mkvmerge: enhancement: Decreased the time mkvmerge needs for parsing + Quicktime/MP4 header fields. +* mkvmerge: new feature: Added support for reading the pixel aspect ratio from Theora + video tracks. + +## Bug fixes + +* mkvmerge: bug fix: If subtitle files are appended to separate video files (e.g. two + AVI and two SRT files) then the subtitle time codes of the second and all following + subtitle files were based on the last time code in the first subtitle file instead of + the last time code in the first video file. Fix for bug 325. +* mkvmerge: bug fix: Due to uninitialized variables mkvmerge would report OGM files + as having arbitrary display dimensions. Fix for bug 326. +* mkvmerge: bug fix: If a Matroska file containing attachments was used as an input + file and splitting was enabled then the attachments were only written to the first + output file. Now they're written to each output file. Partial fix for bug 324. +* mkvmerge: bug fix: The parser for the simple chapter format (CHAPTERxx=...) can now + handle more than 100 chapters. Fix for bug 320. +* mmg: bug fix: The commands "Save command line" and "Create option file" did not save + mmg's current state but the state it was in when the command "Show command line" was + last used or when mmg was started. +* mkvmerge: bug fix: Fixed a crash (segfault) with MPEG-4 part 2 video if "--engage + native_mpeg4" is used. Fix for bug 318. +* Windows installer: The installer cleans up leftovers from old installations + during an upgrade. It doesn't write registry entries for an exe called + "AppMainExe.exe" anymore. It asks whether or not the user wants a shortcut on the + desktop. It does not install the document for base64tool anymore because + base64tool itself isn't installed anymore either. Fixes for bugs 314, 315, 316 and + 317. +* mmg: bug fix: Fixed a compilation problem with non-Unicode enabled wxWidgets. Fix + for bug 313. + + +# Version 2.4.1 "Use Me" 2008-12-04 + +## New features and enhancements + +* mkvmerge: new feature: Added support for reading SRT and SSA/ASS subtitles from AVI + files (fix for bug 64). + +## Bug fixes + +* Build system: bug fix: Configure does not use "uname -m" for the detection of the + Boost libraries anymore but configure's "$target" environment variable. This + fixes the Boost detection for cross compilation builds. Fix for bug 311. Patch by + Dominik Mierzejewski (see AUTHORS). +* mkvmerge: bug fix: PCM audio tracks bigger than approximately 8 GB were cut off after + approximately 8 GB. +* mkvmerge: bug fix: mkvmerge recognizes SRT subtitle files with time codes that + contain spaces between the colons and the digits and time codes whose numbers are not + exactly two or three digits long. +* mmg: bug fix: mmg processes window events much more often during muxing. +* mmg: bug fix: Split time codes with more than three decimals were not allowed even + though the docs say that they are. They are now, as mkvmerge supports such time codes. +* mkvmerge: bug fix: Changed the way mkvmerge calculates the time codes when + appending files. Should result in better audio/video synchronization. +* mkvmerge: bug fix: mkvmerge's LZO compressor would segfault if mkvmerge was + compiled against v2 of the LZO library and the v1 LZO headers were not present. +* mkvmerge: bug fix: SRT subtitle files are also handled correctly if the time code + lines do not have spaces around the arrow between the start and end time codes. +* mkvextract: bug fix: Matroska elements with binary data were output as garbage in + XML files. + +## Other changes + +* all: Updated the language code list from the offical ISO 639-2 standard. + + +# Version 2.4.0 "Fumbling Towards Ecstasy" 2008-10-11 + +## New features and enhancements + +* mkvmerge: enhancement: mkvmerge will use the time codes provided by the MPEG + program stream source file for VC-1 video tracks. +* mkvextract: new feature: Added support for handling SimpleBlocks for time code + extraction. +* mkvmerge: new feature: Added support for Dirac video tracks. +* mmg: enhancement: Added the extensions "evo", "evob" and "vob" to mmg's "add file" + dialog. +* mkvmerge: new feature: Added support for muxing VC-1 video tracks read from MPEG + program streams (EVOBs) or raw VC-1 elementary streams (e.g. as produced by + EVODemux). +* mkvmerge: new feature: Added support for 7.1 channel E-AC-3 files. Fix for bug 301. +* mkvextract: new feature: Added support for extracting Theora video tracks into Ogg + files. Fix for bug 298. + +## Bug fixes + +* mmg: bug fix: The chapter editor's function "save to Matroska file" was corrupting + the target file in some cases. Fix for bug 307. +* mkvmerge: bug fix: mkvmerge was only writing one reference block for real B frames. + Patch by Daniel Glöckner. Fix for bug 306. +* all: bug fix: The Windows uninstaller was not removing all start menu entries during + uninstallation on Windows Vista. The installer now creates the start menu entries + for all users instead of the current user only. Fix for bug 305. +* mmg: bug fix: The "language" drop down box contained some entries twice or more. Fix + for bug 304. +* mkvmerge: bug fix: Incorrect usage of the iconv library caused some conversions to + omit the last character of each converted entry (e.g. for the conversion from Hebrew + to UTF-8). Fix for bug 302. +* mkvmerge: bug fix: Reading EVOBs with multiple VC-1 video tracks was broken (all + packets where put into a single video track). +* mkvmerge: bug fix: Reading raw (E)AC-3 files bigger than 2 GB was broken. +* mkvmerge: bug fix: Improved the detection of MPEG-1/-2 and AVC/H.264 video tracks + in MPEG program streams (VOBs/EVOBs). +* mkvmerge: bug fix: Fixed reading DTS audio tracks from MPEG program streams + (VOBs/EVOBs). +* mkvmerge: bug fix: Revision 3831 (the change to the "--delay" and "--sync" options) + caused mkvmerge to no longer respect the delay caused by garbage at the beginning of + MP3 and AC-3 audio tracks in AVI files. The time codes of such tracks are now delayed + appropriately again. Fix for bug 300. +* mkvmerge: bug fix: Unknown stream types in Ogg files (e.g. skeleton tracks) don't + cause mkvmerge to abort anymore. They're simply ignored. Fix for bug 299. +* mkvmerge: bug fix: Fixed the frame type (key or non-key frame) detection for Theora + tracks. + +## Other changes + +* mkvmerge: all: On Unix/Linux rpath linker flags have been removed again (they were + actually removed before the release of v2.3.0). + + +# Version 2.3.0 "Freak U" 2008-09-07 + +## New features and enhancements + +* mkvmerge: new feature: Added support for Vorbis in AVI (format tag 0x566f). Fix for + bug 271. +* mkvmerge: new feature: Added support for PCM tracks with floating point numbers + (CodecID A_PCM/FLOAT/IEEE). Patch by Aurelien Jacobs (see AUTHORS). +* mkvmerge: new feature: Added support for Ogg Kate subtitles. Patch by + ogg.k.ogg.k@googlemail.com. +* mkvmerge: enhancement: mmg outputs a more informative error message for known but + unsupported input file types (e.g. ASF, FLV, MPEG TS) instead of the cryptic "file + identification failed". +* mkvmerge: new feature: Improved support for WAV files bigger than 4 GB which only + contain a single DATA chunk and a wrong length field for this DATA chunk (e.g. eac3to + creates such files). +* mkvmerge: all: On Unix/Linux rpath linker flags are added for library paths given in + LDFLAGS and configure's "--with-extra-libs" options. +* mkvmerge: new feature: Added support for skipping ID3 tags in AAC and AC-3 files. Fix + for bug 204. +* mkvmerge: new feature: Added support for DTS-HD (both "master audio" and "high + resolution"). + +## Bug fixes + +* mkvmerge: bug fix: improved the time code calculation for MP3 tracks read from MP4 + files. Another part of the fix for bug 165. +* mkvmerge: bug fix: mkvmerge honors the time code offsets of all streams in a MPEG + program stream (e.g. VOB file) fixing audio/video desynchronization. Fix for bug + 295. +* mkvmerge: bug fix: DTS-in-WAV handling (14 to 16 bit expansion) was flawed. Fix for + bug 288. +* mkvmerge: bug fix: The fix to the time code handling for AVC tracks in MP4 files from + 2008-04-16 caused certain other MP4 files to not be read correctly. The video tracks + were found, but no frames were read. Fix for bug 294. +* mkvmerge, mmg: The option "--delay" was removed. The option "--sync" now only + modifies the time codes of a given track. mkvmerge does not pad audio tracks with + silence. "--sync" works with all track types now, but using a stretch factor other + than 1 with audio tracks might not work too well during playback. mmg's inputs for + "Delay" and "Stretch by" can be used with all track types. Fix for bug 287. +* mkvmerge: bug fix: The VobSub reader would sometimes read too many bytes for a single + SPU packet. Part of a fix for bug 245. +* mkvmerge: bug fix: Using BZIP2 compression resulted in broken streams. Patch by + Aurelien Jacobs (see AUTHORS). +* mkvmerge: bug fix: Certain Matroska files with dis-continuous streams (e.g. + subtitles) caused huge memory consumption. Fix for bug 281. +* mkvmerge: bug fix: mkvmerge will output a proper error message if it is called with + ASF/WMV files instead of detecting other kinds of streams (e.g. AVC ES streams). Fix + for bug 280. +* mkvmerge: bug fix: Fixed an assertion in the OGM reader occuring for OGM files with + embedded chapters. Fix for bug 279. +* mkvmerge: bug fix: Fixed wrong time codes for MP4 files that contain video tracks + with B frames and edit lists. Fix for bug 277. Patch by Damiano Galassi (see AUTHORS). +* mkvmerge: bug fix: mkvmerge will not strip leading spaces in SRT subtitles anymore. +* mkvmerge: bug fix: Tuned the file type detection for MPEG ES streams. Fix for bug 265. +* mkvmerge: bug fix: Fixed writing to UNC paths on Windows. Fix for bug 275. + +## Other changes + +* mkvmerge: Switched from the PCRE regular expression library to Boost's RegEx + library. + + +# Version 2.2.0 "Turn It On Again" 2008-03-04 + +## New features and enhancements + +* mkvmerge: new feature: Added support for handling AC-3 in WAV in ACM mode. +* mkvmerge: new feature: Added support for reading AC-3 from QuickTime/MP4 files. + Fix for bug 254. +* mkvmerge: new feature: Added support for handling AC-3 in WAV in IEC 61937 + compatible streams (aka SPDIF mode). +* mkvmerge: new feature: Added support for WAV files with multiple data chunks. +* mkvmerge: new feature: Added support for AAC-in-AVI with CodecID 0x706d as created + by mencoder. Fix for bug 266. +* mkvmerge: enhancement: SRT files that contain coordinates in the time code line are + supported. The coordinates are discarded automatically (as S_TEXT/SRT doesn't + support them), and a warning is shown. + +## Bug fixes + +* mkvmerge: bug fix: Fixed a cause for the error message "no data chunk found" by fixing + the skipping of 'fmt ' chunks. +* mkvmerge: bug fix: Rewrote the OGM reader code. Another part of a fix for bug 267. +* mkvmerge: bug fix: Rewrote the time code application code. Additionally force the + "previous cluster time codes" that libmatroska uses to the current time code. This + seems to get rid of libmatroska's assertions about the local time code being to + small/big to fit into an int16. It also seems to get rid of some of mkvmerge's errors + about the packet queue not being empty, and it fixes a couple of crashes with file + splitting. +* mkvmerge: bug fix: OGM files with non-Theora video tracks caused mkvmerge to fail + since 2.1.0, or the resulting file was unplayable. Fix for bug 267. +* mkvmerge: bug fix: Accept other Theora header versions than 3.2.0 as long as the + major version is 3 and the minor 2. Fix for bug 262. +* mkvmerge: bug fix: MPEG PS reader: Fixed the resyncing mechanism during normal + reads. Another fix for bug 259. +* mkvmerge: bug fix: MPEG PS reader: mkvmerge tries to resync to the next MPEG start + code in case of error during stream detection. Fix for bug 259. +* mkvmerge: SVQ1 video tracks read from QuickTime files are output as + V_MS/VFW/FOURCC tracks and not as V_QUICKTIME tracks. Fix for bug 257. +* avilib: bug fix: Fixed a segmentation fault if reading the first part of an index + failed but a second/other index part is present. Fix for bug 256. + + +# Version 2.1.0 "Another Place To Fall" 2007-08-19 + +## New features and enhancements + +* mkvmerge: enhancement: Added support for reading MP2 audio tracks from OGM files. + Patch by Mihail Zenkov (see AUTHORS). +* mkvextract: enhancement: Added support for extracting Dolby Digital Plus + (E-AC-3) tracks. +* mmg: enhancement: Added another option how mmg choses the directory if automatic + output filename creation is on. Implements all suggestions as listed in bug 248. +* mmg: enhancement: Moved the complete 'settings' tab to its own dialog accessible + via the 'Settings' option in the 'File' menu. +* mmg: new feature: Added a buton 'remove all' which removes all input files and tracks + leaving all other options as they are. Fix for bug 248. +* mmg: new feature: Added an option for setting the default output directory if the + automatic setting of the output file name is turned on. Fix for bug 248. +* mkvmerge: enhancement: DTS code: Some tools (e.g. Surcode) can create DTS files + which are padded with zero bytes after each DTS frame. These zero bytes are now + skipped without printing a warning. +* mmg: enhancement: mmg can now be called with any file name as an argument. If it ends + with 'mmg' then the file will be loaded as a 'mmg settings file'. Otherwise mmg will + 'add' it. Fix for bug 243. +* mkvmerge: enhancement: The OGM reader now uses the AVC/H.264 video packetizer for + AVC/H.264 tracks so that the aspect ratio can be extracted from it. +* mkvmerge: new feature: Added better checks if two tracks can be appended to the + passthrough packetizer so that tracks that are otherwise not known to mkvmerge can + still be appended (e.g. V_VC1). Fix for bug 244. +* mkvextract: new feature: Added support for the 'header removal' encoding scheme. +* mkvmerge: new feature: The NALU size length of an AVC/H.264 track can now be changed + even if the source is not an elementary stream (e.g. for MP4 and Matroska files). +* mkvmerge: enhancement: Added support for RealAudio v3 in RealMedia files. Patch by + Aurelian Jacobs. Fix for bug 246. +* mkvmerge: enhancement: The SRT reader allows "." as the decimal separator as well as + ",". +* mkvmerge: enhancement: Implemented a major speed-up for reading MPEG-1/2 and + AVC/H.264 tracks from MPEG program streams. +* mkvmerge: new feature: Added support for handling AVC/H.264 tracks in MPEG program + streams. +* mkvmerge: new feature: Added support for E-AC-3 tracks in MPEG program streams. +* mkvmerge: new feature: Added support for E-AC-3/DD+ (Dolby Digital Plus) files and + tracks (raw E-AC-3 files or inside Matroska with CodecID A_EAC-3). + +## Bug fixes + +* mkvmerge: bug fix: SPS and PPS NALUs are no longer removed from AVC/H.264 streams. + Hopefully a fix for bug 231. +* mkvmerge: enhancement: Fixed SSA/ASS detection for files produced by Aegis Sub + which doesn't include a line with '[script info]' in the file. +* mkvmerge: bug fix: The OGM reader uses the OGM's timestamps for video tracks. Before + it would just use the current frame number multiplied by the FPS. +* mkvmerge: bug fixes: Fixed a couple of memory leaks. +* mkvmerge: bug fix: The 'default track' flag was set to 'yes' for tracks read from + Matroska files even if 'no' was specified on the command line. +* mkvmerge: bug fix: Another bug fix for handling various AC-3 and E-AC-3 files in MPEG + program streams. +* mkvmerge: bug fix: Added support for handling SEI NALUs in AVC/H.264 elementary + streams so that "key frames" can be detected even if no IDR slices are present. +* mkvmerge: bug fix: Fixed the VobSub reader so that "delay:" lines with negative time + codes are accepted. Fix for bug 241. +* mkvmerge: bug fix: Improved the file type detection code for MPEG transport + streams. +* mkvmerge: bug fix: Fixed a problem reading normal AC-3 tracks from MPEG program + streams. +* mkvmerge: bug fix: Fixed an issue with negative/huge time codes after splitting + AVC/H.264 video. +* mkvmerge: bug fix: Fixed a problem with concatenating more than two subtitle files. +* mkvmerge: enhancement: Fixed the MPEG PS reader so that it will just skip blocks + whose headers it cannot parse instead of aborting. + +## Other changes + +* mmg: The NALU size length can now be chosen for all AVC tracks, not only for those that + are handled by the 'AVC ES packetizer'. +* mmg: Moved the command line to a separate dialog and reduced the main window's + height. +* mkvmerge: The MPEG program stream reader will now sort the tracks it finds first by + their type (video \> audio \> subs) and then by their stream ID. +* mkvmerge: Disabled the support for DTS tracks in MPEG program streams because DTS HD + is not supported yet. + + +# Version 2.0.2 "You're My Flame" 2007-02-21 + +## New features and enhancements + +* mkvmerge: enhancement: Added support for DTS files which use only 14 out of every 16 + bits and which are not stored inside a WAV file. +* mkvmerge, mmg: new feature: Extended the option "--default-track" so that it can be + forced to "off" allowing the user to create a file for which no track has its "default" + flag set. Fix for bug #224. +* mkvmerge, mkvextract, mkvinfo: new feature: Added support for using CodecState + for signaling changes to CodecPrivate. It is used for MPEG-1/-2 video if it is turned + on with "--engage use_codec_state". + +## Bug fixes + +* mkvmerge: bug fix: Fixed suppoert for DTS-in-WAV files which are encoded with 14 + bits per word. +* mkvmerge: bug fix: File type detection for Qt/MP4 files which start with a "wide" + atom has been fixed. +* mmg: bug fix: The "NALU size length" drop down box is now also enabled for H.264 tracks + read from AVIs and for H.264 tracks stored in "VfW compatibility mode" in Matroska + files. +* mkvmerge: bug fix: Fixed the wrong "default duration" if the user used + "--default-duration ...23.976fps". +* mkvmerge: bug fix: The AVC/H.264 ES reader was losing frames if the file size was an + exact multiple of 1048576 bytes. +* mkvmerge: bug fix: The AVC/H.264 ES packetizer produced invalid CodecPrivate data + if the AVCC did not contain the aspect ratio information. Fix for Bugzilla bug #225. +* mkvmerge: bug fix: The Matroska reader passes the correct track number down to the + AVC/H.264 ES packetizer in the case of "AVC in Matroska stored in VfW mode". +* mkvmerge: bug fix: Fixed a crash (segmentation fault) in the AVC/H.264 ES handling + code. + +## Other changes + +* mkvmerge: Reintroduced the "--engage allow_avc_in_vfw_mode" hack. +* mkvmerge, mmg: Changed the default for the "NALU size length" to "4" and added a + warning if "3" is used. + + +# Version 2.0.0 "After The Rain Has Fallen" 2007-01-13 + +## New features and enhancements + +* mmg: new feature: Added another tab for each track in which the user can add arbitrary + track options. +* mkvextract: enhancement: mkvextract will now also print which container format it + uses for each track. +* mkvextract: new feature: Added support for extracting MPEG-1/2 video to MPEG-1/2 + program streams. +* mkvmerge: enhancement: mkvmerge now handles the first frames in AVC/H.264 ES + streams properly, especially for files for which it did not find a key frame at the + beginning in earlier versions. +* mkvmerge: enhancement: Improved the detection of AVC/H.264 ES streams with + garbage at the beginning. +* mmg: enhancements to the job management dialog: There's a minimum width for the + columns. The "up" and "down" buttons are disabled if all entries are selected. + Pressing "Ctrl-A" selects all entries. +* mmg: enhancements: "File -\> New" will also focus the "input" tab. +* mmg: enhancements: The job manager can be opened with "Ctrl-J". The last directory + from which a file is added is saved even if the file identification failed. The + automatically generated output file name uses the extension ".mka" if no video + track is found and ".mks" if neither a video nor an audio track is found in the first + file. +* mmg: enhancement: Added an input for the new "NALU size length" parameter. +* mkvmerge: enhancement: Added "x264" to the list of recognized FourCCs for + AVC/H.264 video in AVI and Matroska files. +* mkvmerge: new feature: Added support for proper muxing of AVC/H.264 tracks in + Matroska files that were stored in the MS compatibility mode (CodecID + V_MS/VFW/FOURCC instead of V_MPEG4/ISO/AVC). +* mkvmerge: new feature: Added support for proper muxing of AVC/H.264 tracks in AVI + files. +* mkvmerge: new feature: Added support for reading AVC/H.264 elementary streams. +* mmg: enhancement: All inputs and controls are cleared and deactivated if the user + select "File -\> New". +* mmg: enhancement: The user can switch between the "generic" and "format specific + options" pages even if no track is selected. + +## Bug fixes + +* mkvmerge: bug fix: Fixed the file type detection for MPEG-1/2 ES files with a single + frame inside. +* mkvmerge: bug fix: MPEG-1/2 video: The sequence and GOP headers are not removed from + the bitstream anymore. This should fix the blockiness if the sequence headers + change mid-stream. Fix for Bugzilla bug #167. +* mkvmerge: bug fix: Fixed the aspect ratio extraction for raw AVC/H.264 ES tracks. +* mkvmerge: bug fix: If a raw AVC/H.264 ES file does not start with a key frame then all + the frames before the first key frame are skipped, and mkvmerge does not abort + anymore. +* mkvmerge: bug fix: AVC/H.264 ES parser: Fixed wrong NALU size length information in + the AVCC. +* mkvmerge: bug fix: AVC/H.264 ES parser: Fixed the decision if a NALU belongs to a + previous frame or starts a new one. +* mkvmerge: bug fix: The NALU size length can be overridden for AVC/H.264 elementary + streams. It defaults to 2 which might not be enough for larger frames/slices. +* mkvmerge: bug fix: Support for AVC/H.264 elementary streams with short markers + (0x00 0x00 0x01 instead of 0x00 0x00 0x00 0x01). +* mkvmerge: bug fix: Fixed invalid memory access in the AVC ES parser. +* mkvmerge: bug fix: mkvmerge would not write frame durations if "--engage + use_simpleblock" was used resulting in unplayable and unextractable subtitle + tracks. +* mkvmerge: bug fix: Added a workaround for RealAudio tracks for which the key frame + flag is never set. +* mmg: bug fix: Fixed a segfault that occurred if the user had a track selected and its the + file the track was read from is removed. +* mmg: bug fix: Fixed the behaviour of a couple of ComboBoxes on Windows after + selecting "File -\> New". E.g. if the user selected "700M" in the "split after this + size" ComboBox, selected "File -\> New" and selected "700M" again, then it would not + show up in the command line window until he selected another option and returned to + the "700M" afterwards. + +## Other changes + +* mkvmerge: Removed the "--engage allow_avc_in_vfw_mode" hack. + + +# Version 1.8.1 "Little By Little" 2006-11-25 + +## New features and enhancements + +* configure: new feature: Allow the user to tell configure which "wx-config" + executable to use ("--with-wx-config=..."). +* mkvmerge/mmg: new feature: If ATDS AAC tracks are added to mmg and the AAC track's + sample rate is \<= 24000 Hz then mkvmerge and mmg assume that the AAC is a SBR track and + mmg will check the "AAC is SBR" checkbox automatically. +* mmg: new feature: Made the "set the delay input field from the file name" feature + disengageable. + +## Bug fixes + +* mmg: bug fix: Some input controls (like "subtitle charset") where disabled for + appended tracks even though the user can and sometimes has to change those settings. + Fixes Anthill bug 216. +* mmg: bug fix: The "aspect ratio" box was losing its input when the user switched + tracks. +* mkvmerge: bug fix: Quicktime/MP4 files with AVC video tracks and missing CTTS atoms + caused mkvmerge to crash after the recent changes to the Quicktime/MP4 time code + handling. +* mkvmerge: bug fix: Fixed a segfault if the file specified with "--attach-file" does + not exist. Bugfix for Anthill bug 213 and Debian bug 393984. +* mmg: bug fix: Fixed a crash on loading XML chapters after having saved XML chapters. + + +# Version 1.8.0 "Wise Up" 2006-11-10 + +## New features and enhancements + +* mkvmerge: new feature: Added support for the "stereo mode" flag for video tracks. +* mkvmerge: Added support for API changes in the upcoming FLAC library v1.1.3. Patch + by Josh Coalson (see AUTHORS). +* mmg: new feature: Added an option for always using simple blocks. +* mmg: new feature: Pre-set the "delay" input field for audio tracks if the file name + contains something like "DELAY XX" where XX is a number. + +## Bug fixes + +* mkvmerge: bug fix: For MP4 files with certain CTTS contents mkvmerge would use + negative time codes for a couple of frames. Those frames were dropped and mkvmerge + often ended up eating huge amounts of memory and crashing afterwards. +* mkvmerge: bug fix: AAC-in-MP4 with the LC profile was sometimes misdetected as + having a SBR extension and an output sampling frequency of 96000 Hz. Fixes Anthill + bug 210. +* mkvmerge: bug fix: Fixed the random number generation on Windows. On Windows 9x/ME + mkvmerge would simply hang. On newer versions the function was accessing invalid + memory and was generally buggy. +* mkvmerge: bug fix: SSA/ASS subtitles with comments before the "[script info]" line + were not identified. +* mkvmerge: bug fix: Made the checks for SRT time codes a bit less strict (e.g. allow + fewer than three digits after the comma). +* mkvmerge: bug fix: Comments in OGM files were not handled if mkvmerge was called in + identification mode. One obvious result was that neither the track language nor the + file title was imported into mmg. +* mmg: bug fix: The "stretch" input box was not accepting the same syntax that + mkvmerge's "--sync" parameter accepts. +* mkvmerge: bug fix: PCM audio data with 4 bits per Sample caused mkvmerge to allocate + all available memory. Patch by Robert Millan (see AUTHORS). +* mmg: bug fix: Mixed up two tool tips on the "settings" tab. +* Build system: bug fix: Moved some @...@ style variables from configure.in to + Makefile.in where they belong (very recent autoconf versions were choking on + those). +* mkvmerge: bug fix: mkvmerge will no longer create empty files (meaning neither + input files nor things like chapters etc have been added). + +## Other changes + +* mkvmerge: Changed the CodecID for AAC audio tracks to "A_AAC" by default. The + CodecPrivate contains the same initialization data that are stored in the ESDS in + MP4 files for AAC tracks. The old CodecIDs (e.g. "A_AAC/MPEG4/SBR") can be turned on + again with "--engage old_aac_codecid". +* mmg: Reworked the "input tab" and split track options into two sub-pages. Also added + an input for the "stereo mode" parameter for video tracks. +* mmg: enchancement: After adding files with drag&drop the next "open file" dialog + will start in the directory the last file came from. + + +# Version 1.7.0 "What Do You Take Me For" 2006-04-28 + +## New features and enhancements + +* mkvmerge: enhancement: Added support for MIME type detection via libmagic (patch + by Robert Millan with heavy modifications by myself). +* mmg: enhancement: The 'adjust time codes' function accepts time codes like + 'XXXXXunit' with 'unit' being 'ms', 'us', 'ns' or 's'. +* mkvmerge: enhancement: mkvmerge will no longer refuse to concatenate files with + differing Codec Private contents and only issue a warning in such cases. +* mkvmerge: new feature: Added support for the "Delay:" feature and for negative time + codes in VobSub IDX files. +* mmg: new feature: If mmg is set to automatically fill in the output file name then it + will clear the output file name once all input files have been removed. + +## Bug fixes + +* mkvmerge: bug fix: Theora headers were not handled correctly. +* mkvmerge: bug fix: The WavPack reader was broken on 64bit systems (e.g. AMD64). +* mkvmerge: bug fix: The Theora time code handling was broken, and Ogg/Theora files + were not identified correctly (they showed up as "unknown" in mmg). +* mkvmerge: bug fix: Quicktime/MP4 reader: Added support for version 1 media headers + ('mdhd' atom) with 64bit fields. Fixed the duration of the last packet passed + downstream. Fixed overflow issues during re-scaling from the Quicktime/MP4's + time scale to nano seconds used by mkvmerge. +* mkvmerge: bug fix: Muxing wasn't working Windows 9x/ME because mkvmerge was trying + to use Unicode file access functions when determining which directories to create. + Fixes Anthill bug #177. +* mmg: bug fix: Fixed a crash that occurred if the user removed an attachment and clicked + somewhere in the empty space in the attachment list. Occured only on Windows. +* mmg: bug fix: Re-added Chinese to the list of popular languages (those are listed + first in the language drop down boxes). +* mkvmerge: bug fix: The last change to the ISO 639 language handling broke the VobSub + reader so that it reported the wrong language codes. This also caused mmg to not + display the correct language after adding a VobSub file. + + +# Version 1.6.5 "Watcher of the Skies" 2005-12-07 + +## New features and enhancements + +* source: new feature: Added support for linking against liblzo2 (same compression + algorithm, just a new library version). Patch by Diego Pettenò (see AUTHORS). +* mkvextract: new feature: attachment extraction mode: Made the output file name + optional. If it is missing (e.g. "mkvextract attachments source.mkv 92385: + 124981:") then the name of the attachment inside the Matroska file is chosen + instead. Patch by Sergey Hakobyan (see AUTHORS). +* mkvmerge: new feature: If an output file name contains directories that don't exist + then they're created. Patch by Sergey Hakobyan (see AUTHORS) with modifications by + myself. +* mkvmerge, mmg: new feature: The names of attached files can be set with a new option + --attachment-name or on mmg's "Attachments" page. +* mkvmerge: new feature: Added support for Ogg/Theora. +* mkvinfo: new feature: The sub elements of the EBML head are now shown. +* mkvinfo: new feature: Added support for the new SimpleBlock. +* mkvextract: new feature: Added support for the new SimpleBlock. + +## Bug fixes + +* source: bug fix: Changed the list of ISO 639 languages so that the terminology + versions are converted into the bibliography versions of the 639-2 codes (e.g. use + "ger" instead of "deu" for the German language). Converted almost all pieces of + mkvmerge and mmg to accept ISO 639-1, 639-2 codes (both bibliography and + terminology versions) and the languages' English names. Those will always be + converted to the 639-2 code. Fixes Anthill bug #171. +* mkvmerge: bug fix: The country code used in XML chapter files was checked against the + list of ISO 639-1 codes and not against the list of ccTLDs. Partial bugfix for Anthill + bug #171. +* mkvmerge: bug fix: When appending tracks and using time codes the time codes were + only used for the first track in a chain of tracks. This has been changed so that you + must specify only one time code file in such cases (e.g. "mkvmerge ... --time codes + 0:my_time codes.txt part1.avi +part2.avi"). mmg has already been working like + this. Fixes Anthill bug #162. +* mkvmerge: new feature: Added a workaround for files created by Gabest's DirectShow + Matroska muxer with slightly broken frame references. Fixes Anthill bug #172. +* mkvmerge: bug fix: Don't abort reading a Matroska if the next element is not a + cluster. This is the case for e.g. files produced by Haali's muxer which writes the + segment tracks element in intervals. Fixes Anthill bug #169. +* mmg: bug fix: Fixed a problem with the selection of language codes for chapters in the + chapter editor. +* mkvmerge: bug fix: If at least or more attachments were present and the user used + --attachment-name for each of them (as mmg does) then mkvmerge was wrongly + outputting a warning about multiple uses of --attachment-name for a single + attachment. +* mkvmerge: new feature: Added limited support for edit lists in MP4/QuickTime + files. Fixes Anthill bug #151. +* mkvmerge: bug fix: MP4/QuickTime files which contain another atom before the + 'avcC' atom in the video track headers weren't correctly remuxed. +* mkvmerge: bug fix: mkvmerge will now refuse to append AVC/H.264 video tracks whose + codec initialization data blocks do not match. Invalidates Anthill bug #163. +* mkvmerge: bug fix: Fixed a crash If the granulepos (the time codes) reset in the + middle of an Ogg/OGM file. Fixes Anthill bug #166. +* mkvmerge: bug fix: Fixed a division-by-zero error in the RealMedia demuxer. Fixes + Anthill bug #161. +* mkvmerge: bug fix: Fixed a couple of potential (and actual) segmentation faults by + accessing invalid memory addresses. Initial patch for the VobSub reader by Issa on + Doom9's forum. +* mkvmerge: bug fix: Fixed another bug when appending AVC/H.264 tracks that would + mkvmerge cause to die with "bref_packet == NULL". Fixes Anthill bug #160. +* mmg: bug fix: When the user saved the muxing output in a log file that file didn't use + Windows line endings (CR LF) on Windows. +* mmg: bug fix: Appending tracks was broken because the track numbers in the command + line were incorrect. Fixes Anthill bug #160. +* mkvmerge, mmg: new feature: Added support for the new SimpleBlock instead of + BlockGroups (only available via "--engage use_simpleblock" for now). Patch by + Steve Lhomme (see AUTHORS) with fixes by myself. + +## Other changes + +* mkvmerge: Changed the CodecID for AAC audio tracks to "A_AAC" by default The + CodecPrivate contains the same initialization data that are stored in the ESDS in + MP4 files for AAC tracks. The old CodecIDs (e.g. "A_AAC/MPEG4/SBR") can be turned on + again with "--engage old_aac_codecid". + + +# Version 1.6.0 "Ist das so" 2005-10-14 + +## New features and enhancements + +* mkvmerge: new feature: Implemented the new header removal compression: + compression for native MPEG-4 part 2, decompression for all types (don't use it yet, + folks!). + +## Bug fixes + +* mkvextract: bug fix: Extra codec data wasn't written to AVI files if it was present + (e.g. for the HuffYuv codec). Fixes bug 157. +* mkvmerge: bug fix: mkvmerge was choking on AVIs with a single frame inside. Fixes bug + 156. +* mkvmerge: bug fix: Changed how AVC video frames are referenced. This is not ideal + yet, but at least references are kept intact when reading AVC from Matroska files. + Should fix bug 154. +* mkvmerge: bug fix: Appending AVC video tracks was broken if they contained aspect + ratio information that the user overwrote on the command line. +* mmg: bug fix: If a video track was selected that was appended to another track then the + aspect ratio drop down box was still active. +* mkvmerge: new feature: MPEG-4 part 2 streams are searched for the pixel + width/height values. Those are taken if they differ from those values in the source + container. This is a work-around for buggy muxers, e.g. broken video camera + firmwares writing bad MP4 files. Fixes bug 149. +* mkvmerge: bug fix: Appending files with RealVideo was broken. +* mkvmerge, mkvextract: bug fix: ASS files sometimes use a column called 'Actor' + instead of 'Name', but both should be mapped to the 'name' column in a Matroska file. + + +# Version 1.5.6 "Breathe Me" 2005-09-07 + +## New features and enhancements + +* mkvmerge: new feature: mkvmerge will remove the aspect ratio information from a + AVC/H.264 video track bitstream and put it into the display dimensions (until now + the AR information was kept on the bitstream level). The reason is that in Matroska + the container AR is supposed to take precedence over bitstream AR, but some decoder + programmers ignore the container AR in favour of bitstream AR. + +## Bug fixes + +* mmg: bug fix: If the user selected an aspect ratio for a video track, then chose "File + -\> new", added a file, selected another video track and chose the same aspect ratio as + before then it wasn't added to the command line. Fixes Anthill bugs 132 and 146. +* mkvmerge: bug fix: Support Qt/MP4 files with 64bit offset tables ('co64' atom + instead of 'stco' atom). +* mkvinfo: bug fix: The GUI couldn't open files with non-ASCII chars in the file name. +* mkvmerge: bug fix: Display dimensions were reported for all tracks, even if they + weren't present. In that case they allegedly were "0x0" which caused mmg to add + "--display-dimensions ...:0x0" for each track read from a Matroska file, even if + the tracks were not video tracks. +* mkvextract: bug fix: The extracted time codes were wrong for blocks with laced + frames. +* mkvmerge: bug fix: If a Matroska file with a MPEG-4 part 2 video track was muxed into a + Matroska file and the source file did not contain the display width/height elements + for that track then the aspect ratio was extracted from the video data itself which + clashes with the Matroska specs which say that display width/height default to the + pixel width/height if they're not present. +* mkvmerge: bug fix: Native MPEG-4 ASP storage was still bugged: time codes were + assigned twice, frames referenced themselves. +* mkvmerge: bug fix: Embedded fonts and pictures in a SSA/ASS file are not discarded + any longer. They are converted to Matroska attachments instead. Other sections + that were discarded are added to the CodecPrivate data as are "Comment:" lines in the + "[Events]" section. Those comment lines still lose their association for which + "Dialogue:" line they were meant, but that cannot be changed. +* mkvmerge: bug fix: --delay was not working at all. +* mkvmerge: bug fix: Single digit numbers followed by 's' were not recognized as valid + numbers with a unit (e.g. in '--delay 0:9s'). + + +# Version 1.5.5 "Another White Dash" 2005-08-21 + +## New features and enhancements + +* mkvextract: new feature: Added a new extraction mode for outputting time codes in a + time code v2 format file. It is called "time code_v2" and takes the same arguments as + the "tracks" extraction mode. +* mkvinfo: new feature: Added a command line switch "--output-charset" which sets + the charset that strings read from Matroska files are output in (e.g. if you want the + output in UTF-8 and not your system's local charset). +* mkvinfo: new feature: Added a command line switch "-o" for redirecting the output to + a file (for systems which re-interpret stdout). +* mkvextract: new feature: Added support for extracting H.264 / AVC tracks into + proper H.264 ES streams supported by e.g. MP4Box. Patch by Matt Rice (see AUTHORS). + +## Bug fixes + +* mkvtoolnix: bug fix: On Windows the command line output was terminated with CR CR NL + instead of just CR NL. +* mkvmerge: bug fix: The Quicktime/MP4 reader wasn't skipping unknown elements + correctly. +* mkvmerge: bug fix: The combination of using external time code files and video + tracks with B frames was not working as intended. The user had to order the time codes + in the time code file just like the frames were ordered (meaning the time codes for a + IPBBP sequence with 25 FPS had to be "0", "120", "40, "80"...). This has been fixed. + They have to be ascending again and mkvmerge will assign them properly. +* mkvinfo: bug fix: Files with non-ASCII chars weren't opened because conversion to + UTF-8 was done before the charset routines were initialized. +* mkvmerge: bug fix: Fixed a crash if a track in a MP4/QuickTime file did not contain a + STCO atom (chunk table) but a STSC atom (chunk map table). +* mkvmerge: bug fix: Very large values were not kept correctly for a lot of elements + (meaning they were truncated to 16 or 32 bits). +* mkvinfo: bug fix: Very large values were not displayed correctly for a lot of + elements (meaning they were truncated to 16 or 32 bits prior to displaying). +* mkvmerge: bug fix: AVC/H.264 references were wrong, and muxing of AVC from Matroska + files with proper references resulted in unplayable files. +* mkvmerge: bug fix: Fixed support for USF subtitles stored in UTF-16 and UTF-32. + Added support for USF subtitles stored in UTF-8 without a BOM. + +## Other changes + +* mkvtoolnix: Disabled storing AVC/H.264 video tracks in VfW mode. + + +# Version 1.5.0 "It's alright, Baby" 2005-07-01 + +## New features and enhancements + +* mmg: new feature: Added an input box for mkvmerge's new "split after these time + codes" feature. +* mkvmerge: new feature: Added splitting after specific time codes. +* mkvextract: new feature: Implemented the extraction of USF subtitles. +* mkvmerge: new feature: Implemented the muxing of USF subtitles. +* mkvmerge: new feature: Added support for the ChapterSegmentUID element. + +## Bug fixes + +* mkvmerge: bug fix: The track language read from old Matroska files was wrongfully + set to "und" if it was not written although the specs say that "eng" is the default + value. +* mkvmerge: bug fix: USF subtitles: If identical tags were nested (e.g. "font") and + both were closed right after each other then the result looked like "\</font/\>". +* mkvmerge: bug fix: Native MPEG-4 was not working if read from OGM files. +* mkvmerge: bug fixes: Improved the native MPEG-4 generation a lot (thanks to Haali + for testing and pushing me). The codec version string inside the MPEG-4 + initialization data is now checked if it indicates "DivX packed bitstream" and + changed to not indicate it anymore. +* mmg: bug fix: If mmg was minimized when it was closed (e.g. with Windows' "Show + desktop" function) then it didn't show up after a restart and could only be shown by + maximizing it. +* mkvmerge: bug fix: If a OGM style chapter file contains empty chapter names + ('CHAPTER01NAME=' without something after the '=') then this chapter's time code + is used as the name instead of aborting. +* mkvmerge, mkvinfo, mkvextract: bug fix: Inifite sized segments were not handled + correctly. +* mmg: bug fix: On Windows mmg could be crashed by adding a file and clicking into the + empty space in the "track" selection box. Fixes Anthill bug 133. +* mkvextract: bug fix: The MPEG packets are now padded to 2048 byte boundaries as some + programs require them to be. Patch by Mike Matsnev (see AUTHORS). +* mkvinfo: bug fix: Removed the restriction of max. ten levels of nested elements. +* mmg: bug fix: If splitting was enabled and "splitting by time" selected and the user + chose "new" from the "File" menu then "splitting by time" was not selectable + anymore. This happened only on Windows. Fixes Anthill bug 131. +* mkvextract: bug fix: Use the native newline style when extracting text subtitles + (\r\n on Windows and \n on all other systems). +* mkvextract: bug fix: SSA/ASS text was missing in the output if the "Format=" line + contained newlines at the end of the CodecPrivate data (e.g. our old Mew Mew sample + file). +* mkvmerge: bug fix: Support WAV files that use other RIFF chunks than the usual "fmt " + followed by "data". +* mkvmerge: bug fix: Remuxing MPEG1/2 tracks resulted in a failing "assert(0)". + + +# Version 1.4.2 "Jimi Thing" 2005-04-16 + +## New features and enhancements + +* mkvextract: new feature: Added the extraction of the raw data with the "--raw" and + "--fullraw" flags. Patch by Steve Lhomme (see AUTHORS). + +## Bug fixes + +* mkvmerge: bug fix: In rare occasions involving B frames mkvmerge freed data too + early. In such a case it was eating more and more memory finally exiting with a message + about not finding a packet for a "bref". +* all: bug fix: My output functions did not work on AMD64 systems. Fixes Anthill bug + 120. +* mkvextract: bug fix: WAVPACK extraction did not update the "number of samples" + header field. Patch by Steve Lhomme (see AUTHORS). +* mkvmerge: bug fix: RealMedia files contain a "FPS" field in their track headers. + Unfortunately this field does not always contain the actual FPS of a video track but + the maximum number of FPS that the encoder has output or should output. Therefore + mkvmerge does not use a "default duration" element for RealVideo tracks anymore. + Fixes Anthill bug 113. +* mkvmerge: bug fix: Failing calls to posix_fadvise upon adding a file to mmg caused + mmg to think that the file identification failed. Now warnings for posix_fadvise + are not output anymore, and posix_fadvise is silently switched off for that file. + Fixes Anthill bug 123. +* mkvmerge: bug fix: Appending files that were created with mkvmerge's "--link" + option was broken. The time codes for both the chapters and the actual media data + blocks were not adjusted correctly. Fixes Anthill bugs 115 and 116. +* mkvmerge: bug fix: If chapters are present in several appended files and there were + atoms who shared the same UID then those entries were present multiple times in the + output files. Now such entries are merged into one chapter entry. Fixes the second + part of Anthill bug 122. +* mkvmerge: bug fix: If chapters were present and splitting was enabled then mkvmerge + would not treat chapters correctly that spanned across several files. Now the + spanning chapters are kept in all files, and their start time codes are adjusted + accordingly. Fixes the first part of Anthill bug 122. +* mkvinfo: bug fix: On Windows mkvinfo was linked without the console subsystem + resulting in no output at all if run without the GUI (-g). Fixes Anthill Bug 118. +* mkvmerge: bug fix: Due to the compiler doing some strange number conversion + mkvextract seemed to hang on Windows with certain files. +* mkvmerge: bug fix: Appending VobSubs with more than one track in a .idx file and video + files at the same time was broken resulting in parts of some of the VobSub tracks not + ending up in the resulting Matroska file. Fixes Anthill bug 114. +* mkvmerge: bug fix: The track numbers were assigned wrongly when appending tracks + (this is more or less cosmetic). +* mkvmerge: bug fix: Splitting by time was broken for audio-only files. Fixes Anthill + bug 112. +* mkvmerge: bug fix: The --fourcc switch was not working. +* mmg: bug fix: Tracks that were not selected on saving the settings file were selected + after loading a settings file. + + +# Version 1.4.1 "Cherry Lips" 2005-03-15 + +## Bug fixes + +* mkvmerge: bug fix: AC-3 detection was broken in rare cases. +* mmg: bug fix: If the TEMP environment variable contains spaces then the calls to + mkvmerge when adding files failed. +* mkvmerge: bug fix: Extracting the FPS from some AVC MP4 files did not work. +* mkvmerge: bug fix: Appending + splitting was segfaulting if used together and at + least one split occurred after a track has been appended. +* mkvmerge: bug fix: A failing call to posix_fadvise will only turn its usage off for + that one file and not abort mkvmerge completely. +* mmg: bug fix: When "appending" a file all tracks where added to the end of the track + list making it unnecessarily difficult to concatenate similar structured files. + Now the tracks from the "appended" files are inserted into the track list after their + counterparts from the file this new one is appended to. +* mmg: bug fix: An "appended" file could not be removed if there were two tracks that we + not separated by a track from another file in the track list box. +* mmg: bug fix: The check whether or not a file might be overwritten while splitting is + active has been fixed. +* mmg: bug fix: Improved the word wrapping of the tooltips on Windows. +* mmg: bug fix: It was possible to select a file for appending even though no file was + added first. +* mkvmerge: bug fix: mkvmerge was wrongly outputting large numbers of warnings when + Remuxing AVC/H.264 video from a Matroska file. +* mmg: bug fix: The job queue was not loaded on startup on Windows Unicode builds + (another wxWidgets 2.5.3 problem). +* mmg: bug fix: The job status in the job runner dialog was broken on Unicode builds on + all systems. +* mmg: bug fix: "Splitting by time" was not selectable on Windows Unicode builds + (problem with wxWidgets 2.5.3). +* mmg: bug fix: mkvmerge's output during muxing was not converted from UTF-8. +* mmg: bug fix: The default extension added when the user doesn't give one is different + in wxWidgets 2.4.x and 2.5.x. It should always be .mkv and not .mka. + +## Other changes + +* mkvmerge: Added more descriptive error messages if two tracks cannot be + concatenated because "their parameters do not match". + + +# Version 1.4.0 "Cornflake Girl" 2005-02-26 + +## New features and enhancements + +* mmg: new feature: The "default track" checkboxes are set properly when a Matroska + file is added. +* mmg: new feature: Added a warning right before the muxing starts if the chapter + editor contains entries but no chapter file has been selected (can be turned off). +* mkvextract: new feature: Added VobSub extraction based on Mike Matsnev's code. + +## Bug fixes + +* mkvmerge: bug fix: Track names could not be set to be empty. + + +# Version 1.0.2 "Elephant's Foot" 2005-02-06 + +## Important notes + +* mkvmerge: bug fix: mkvmerge did not accept XML chapter files created with older + mkvtoolnix versions due to deprecated chapter elements. Such elements are now + skipped. + +## New features and enhancements + +* mkvmerge: new feature: Use the posix_fadvise function on *nix systems. This + results in a considerable speed up for the whole muxing process. As the function call + seems to be buggy on at least Linux kernels 2.4.x it can be disabled completely during + configure. It will only be used on Linux with a kernel from the 2.6.x series or newer. +* mkvmerge: new feature: Added some more possible formats for binary data in XML files + besides Base64 encoded data: hex encoded and ASCII "encoded". +* mkvmerge: new feature: Hex values accept more formats (like optional white space + between numbers or the "0x" prefix). +* mmg: new feature: Made the mkvmerge GUI guide available by pressing F1 or selecting + "Help" from the "Help" menu. +* mmg: new feature: Added support for mkvmerge's new "appending tracks" feature. +* mkvmerge: new feature: Added support for reading the pixel aspect ratio from + AVC/h264 video data. +* mkvmerge: new feature: Added AVC/h264 muxing from MP4. +* mkvmerge: new feature: Added a MPEG PS demuxer. +* mkvinfo: new feature: Added a couple new elements (silent tracks). Patch by Steve + Lhomme (see AUTHORS). +* mkvextract: new feature: Added WAVPACK4 extraction. Patch by Steve Lhomme (see + AUTHORS). +* mkvmerge: new feature: Added WAVPACK4 muxing. Patch by Steve Lhomme (see AUTHORS). +* mkvmerge: new feature: Added VobButton muxing. Patch by Steve Lhomme (see + AUTHORS). + +## Bug fixes + +* mkvmerge: bug fix: Empty video frames in AVIs right at the beginning were breaking + the MPEG-4 aspect ratio extraction and caused problems in other parts, too. +* mmg: bug fix: It was possible to create chapter entries with invalid or even empty + language entries. Not only are those invalid, such XML files can also not be loaded by + mmg. +* mmg: bug fix: Overwriting a chapter file did not erase the previous file. So if the + previous file was bigger than the current chapters then garbage remained at the end + of the file. +* mmg: bug fix: The "stretch" input box tooltip was wrong. The resulting command line + was broken, too. +* mkvextract: bug fix: ASS/SSA extraction was broken in some rare cases. +* mmg: bug fix: Again the window handling. Hopefully this is better than the other + attempts. +* mmg: bug fix: One was able to crash mmg by pressing 'ok' in the muxing dialog right + after muxing finished, especially if the 'abort' button was hit before. This mostly + happened on Linux. +* mkvmerge: bug fix: Fixed negative audio displacement for a couple of formats. + +## Other changes + +* mkvmerge: Changed the AVC/H.264 time code handling to include the time code offsets + from the CTTS atom. +* mmg: Reformatted the HTML guide and updated the screenshots. It should be more + readable for those whose desktop is not 1200 pixels wide. + + +# Version 1.0.1 "October Road" 2004-12-13 + +## New features and enhancements + +* mmg: new feature: The window position is saved and restored when mmg is started the + next time. +* mkvmerge: Implemented concatenating files with chapters. + +## Bug fixes + +* mmg: Fixed some layout issues with wxWidgets 2.5.3 and newer. +* mmg: bug fix: Fixed a crash/memory corruption showing weird characters in the input + boxes. This happened when the user removed a file from mmg while mmg was updating the + command line. +* mmg: bug fix: mmg now has an icon associated with it while it is running instead of the + generic Windows application icon (Windows only). +* mmg: bug fix: The main window is now minimized during muxing. This allows to hide both + of the windows while muxing is running and restoring them later, even if they were + iconized when muxing finished (Windows only). +* mkvmerge: bug fix: The first packet of an AAC track read from Real containers might + not start at the time code 0. This offset was ignored by mkvmerge. +* mmg: bug fix: Made the muxing dialog ("mkvmerge is running") modal all the time. This + prevents the user from hitting the main window's minimize button. On Windows this + makes mmg stuck in iconized mode if it was iconized when muxing finished. +* mkvmerge: bug fix: Fixed a buffer overflow in the UTF-8 file reading routines. + +## Other changes + +* mkvmerge: Changed the "progress" output. It's now correct for file concatenation, + too. + + +# Version 1.0 "Soul Food To Go" 2004-11-17 + +## New features and enhancements + +* mkvmerge: new feature: Concatenating/appending files is now possible. A lot of + things aren't tested, and others simply don't work yet (chapter merging, duplicate + tag elimination, proper progress report, support in mmg just to name a few), but the + basic functionality seems to work. +* mkvmerge: new feature: Added reading DTS from AVIs and from Matroska files. +* mmg: enhancement: Made mmg's main window properly resizable. + +## Bug fixes + +* mkvmerge: bug fix: The Matroska reader doesn't insist on having a default duration ( + = FPS) for video tracks in the "AVI compatibility mode" ( = with the CodecID + "V_MS/VFW/FOURCC"). This enables re-muxing of Matroska files created from MP4 + files. +* mmg: bug fix: File names with non-ASCII characters were not working if mmg was + compiled against a Unicode enabled wxWidgets. +* mkvmerge: bug fix: A variable initialization was missing which very recent gcc + versions (3.4.2) did not like very much. Also fixed a small compilation bug. +* mkvmerge: bug fix: The handling of external time code files was still not correct but + should be OK now. +* mkvmerge: bug fix: If LFE is on for DTS then the number of channels is one more than what + the DTS frame header says. +* mkvmerge: bug fix: Time Codes for Vorbis were wrong on rare occasions (when reading + laced Vorbis from a Matroska file and changing the lacing, e.g. when splitting for + the second and all following files). +* mkvmerge/mkvinfo/mkvextract: bug fix: The chapter and tag element tables were not + always intialized correctly depending on the compiler and the optimization flags + used. +* mkvmerge: bug fix: The OGM reader was broken if at least one track was not to be copied + from the file (happened between 0.9.5 and 0.9.6). +* mmg: bug fix: After loading saved mmg settings the track input box listed the tracks + always coming from the last input file and not from the one they really came from. +* mkvmerge: Rewrote the code for the external time code files. This also fixes bug 99: + The durations for the individual tracks were not correct for those tracks for which + --time codes was used. +* mmg: bug fix: Crash when saving chapters from the chapter editor. Same as the mkvinfo + issue below but on all OS. +* mkvinfo: bug fix: The chapter and tag element tables were not initialized on Windows + resulting in a crash when one of those elements was encountered. + +## Other changes + +* mmg: Added an error message if the user selects 'mmg' as the 'mkvmerge executable' + because that would lead to an infinite number of 'mmg's being spawned. + + +# Version 0.9.6 "Every Little Kiss" 2004-10-07 + +## Important notes + +* mkvmerge, mkvextract, mkvinfo: feature removed: Dropped support for the very old + and deprecated tagging system. No one used it anyway. + +## New features and enhancements + +* mkvmerge: enhancement: Converted the raw FLAC reader to use another interface to + the FLAC libraries. This results in a speedup of up to 50%. Thanks to Josh Coalson for + telling me about its existence. +* mkvmerge: new feature: Added two warnings. One about invalid track IDs that were + used on the command line but that don't correspond to an available track in a file and + one if no track will be copied from a source file. Both warnings hint at bad command + line arguments. +* mkvmerge: new feature: The CUE sheet parser now accepts INDEX lines with indices + from 00 up to 99 and implements the Red Book specification for audio CDs that way. + Patch by Vegard Pettersen \<vegard_p at broadpark adot no\>. +* mkvmerge: new feature: Added a new parameter --aspect-ratio-factor. +* mkvmerge: new feature: Added support for MP2 (and maybe MP3) audio in MP4 + containers. +* mkvmerge: new feature: The chapter and tag parsers accept XML element attributes + instead of sub-elements for those sub-elements that only contain data. Example for + a "simple tag": \<Simple Name="ARTIST" String="Tori Amos"/\> +* mkvmerge, mkvinfo: new feature: Added the four new PixelCrop elements. +* mkvmerge, mkvextract, mkvinfo: new feature: Added 'TargetTypeValue' as a + supported tagging element. +* mkvmerge: new feature: Allow the use of two-letter ISO 639-1 country codes in for the + '--language' parameter. Those will be converted to the corresponding ISO 639-2 + language code automatically. +* mkvmerge, mkvinfo, mkvextract: new feature: Added support for the 'TargetType' + tag element (which I meant to add before the 0.9.5 release...). + +## Bug fixes + +* mkvextract: bug fix: The track extraction was creating the output file twice if the + Matroska file contained a copy of the track headers. This resulted in the first + extracted file being overwritten at the end of extraction. +* mmg: bug fix: If the file title is read from an input file, not modified by the user and + that input file is removed again then the file title will be unset. +* mkvmerge, mkvextract: bug fix: ASS was handled like SSA which is not correct in each + case, especially when extracting it. +* mkvextract: bug fix: The WAV writer was not endian safe. +* mkvmerge: bug fix: The charset was not set correctly on Solaris. +* mkvmerge: bug fix: mkvmerge crashed when reading Matroska files that contain an + empty tag list. +* mkvmerge: bug fix: Some Matroska files that e.g. have had their time codes offset + with the Matroska Stream Editor or other means may contain time codes that caused + mkvmerge to print a warning about "time code \< last_time code". A new fix implements a + workaround and a warning message with a proper explanation for this case. +* mkvmerge: bug fix: Older Matroska files containing chapters caused mkvmerge to + abort muxing. +* mkvmerge: bug fix: mkvmerge was only copying the last tag of a list of tags applying to + a track from a Matroska file. +* mkvmerge: bug fix: mkvmerge will show a nice warning if the entries in a SRT have + non-continuous timestamps. It'll also sort the entries by their start timestamp + instead of throwing the generic "time code \< previous time code" warning. +* mmg: bug fix: The 'Matroska file analysis' window that occurs when reading chapters + from a Matroska file did not disappear if it was minimized when the process finished. +* mkvinfo: bug fix: Strings from chapters and tags were shown in UTF-8 instead of the + local charset. This bug was introduced around 2004-08-28. +* mkvmerge: bug fix: Not all chapter elements were copied correctly from a source + Matroska file. +* mkvmerge: bug fix: The Matroska reader was not handling very big cluster time codes + correctly. Those can occur when the time code scale factor is very small. +* mkvmerge: bug fix: Empty clusters in Matroska files no longer make mkvmerge think + that file has been read completely. +* mkvmerge: bug fix: The automatic MIME type detection based on the file name + extension was using the file name extension as the MIME type. +* mkvmerge: bug fix: The MP3 handling was broken on weird and rare occasions when + reading MP3 from a Matroska file. +* mkvmerge: bug fix: Removed a bogus warning about an attachment's MIME type having + been given more than once. + +## Other changes + +* mkvmerge: Only write the segment duration as a 64bit float if there is no video track + present. This way users won't have to update their DirectShow filter/apps for most + files. Only audio-only files need this precision anyway. +* mkvmerge: Changed the Ogg/OGM reader to use the stream number and not its serial + number as the track ID (meaning the track IDs will be 0, 1, 2... etc. instead of the + random numbers oggenc uses as the serial numbers). +* mkvextract: Sped up the extraction of attachments, chapters, cuesheets and tags by + using the seek head information and not parsing the full file each time. +* mkvmerge, mkvextract, mkvinfo: Complete rewrite of the chapter and tag parsing and + output functions. Additions will be much easier now. + + +# Version 0.9.5 "The Na Na Song" 2004-08-21 + +## New features and enhancements + +* mkvmerge, mkvinfo, mkvextract: new feature: Added support for the new + 'EditionFlagHidden', 'EditionFlagDefault' and 'EditionManaged' elements. +* mkvmerge, mkvinfo, mkvextract: Added support for the new tag elements ('tag + language' and 'default/original language'). +* mkvmerge: new feature: If there was no MIME type given for an attachment then + mkvmerge will try to guess it based on the file's extension just like mmg. +* mkvmerge/mkvextract: new feature: Use the new EditionUID entries when convert CUE + sheets to chapters and tracks. This is in preparation for 'multiple CDs to single + Matroska file' conversions. +* mkvmerge: new feature: Abort muxing if the output file name is the same as the name of + one of the input files. +* mkvmerge: new feature: Implemented sample-precision for timestamps and + durations on audio only files. +* mkvextract: new feature: Limited support for extracting chapters as CUE sheets + that haven't been created by using a CUE sheet with mkvmerge's "--chapters" option. + +## Bug fixes + +* mkvmerge: bug fix: WAV files which contained a 'PAD ' chunk before the 'data' chunk + were not processed at all. +* mkvmerge: bug fix: Use 'setjmp' and 'longjmp' Instead of throwing a C++ exception + during the chapter parsing stage. Otherwise libexpat will abort with a + non-descriptive error message on Windows. +* mkvmerge: bug fix: SSA/ASS subs with the old codec ID 'S_SSA' and 'S_ASS' were + accepted, but their codec ID was kept. It is now correctly changed to 'S_TEXT/SSA' + and 'S_TEXT/ASS'. +* mkvmerge: Added 'EditionUID' to valid elements below '\<Targets\>' in XML tags. + Fixed the creation of the 'Targets' with --global-tags and --tags. +* mmg: bug fix: The 'down' button on the 'input' tab was not working correctly in all + cases. +* mkvinfo, mmg: bug fix: Fixed compilation with Unicode enabled versions of + wxWidgets. +* mkvmerge: bug fix: Try to guess whether tags read from OGM files (for automatic + language tag setting and for copying chapter information) are already in UTF-8 or + not. If not try to convert them from the current system's charset. +* mkvmerge: bug fix: use the same UID for the EditionUID in the chapters and in the tag + targets when parsing a CUE sheet. +* mkvextract: bug fix: The CUE extraction wrote UTF-8 characters but no UTF-8 BOM + (byte order marker) at the beginning. +* mkvmerge: bug fix: Handle TTA files with ID3 tags correctly ( = skip the ID3 tags). +* mkvmerge: bug fix: There was an illegal free() in the OGM reader. +* mkvextract: bug fix: The subtitle track extraction used the wrong duration in + 0.9.4. +* mkvmerge: bug fix: Block durations with 0s length (e.g. entries in a SSA file) were + not written. +* mkvmerge: bug fix: The FLAC packetizer gets the duration from the FLAC packet + itself. +* mkvmerge: bug fix: The word 'TAG' occuring in e.g. SRT subs caused the ID3/MP3 frame + detection to be stuck n an endless loop. + +## Other changes + +* mkvmerge, mkvextract, mmg: Changes to the chapter handling. EditionUIDs are + always created. mkvextract outputs EditionUIDs and ChapterUIDs normally. + mkvmerge tries to keep EditionUIDs and ChapterUIDs but replaces them if they aren't + unique. + + +# Version 0.9.4 2004-07-25 + +## New features and enhancements + +* mkvextract: new feature: Added support for extracting TTA tracks to TTA files. +* mkvextract: new feature: Implemented the extraction of chapter information and + tags as a CUE sheet which is the reverse operation to using a CUE sheet with mkvmerge's + '--chapters' parameter. +* mmg: new feature: Added support for the two flags 'hidden' and 'enabled' in the + chapter editor. +* mkvmerge: new feature: The pregap from a CUE sheet is converted into two + sub-chapters (one for "INDEX 00", one for "INDEX 01"). These sub-chapters have + their 'hidden' flag set. + +## Bug fixes + +* mkvmerge: bug fix: SRT file recognition failed if the file contained spaces at the + end of the first line. +* mkvmerge: bug fix: Broken VobSub .idx files which contain timestamps going + backwards no longer crash mkvmerge. A warning will be printed for such + inconsistencies. +* mkvmerge: bug fix: The Matroska reader contained a nice little illegal memory + access (introduced in 0.9.3 with the fixes to the 'default track' handling). +* mkvmerge: bug fix: The SSA reader was segfaulting if a line contained an empty text + field. +* mkvinfo: bug fix: Fixed compilation for MATROSKA_VERSION = 2. +* mkvinfo: bug fix: Fixed compilation with gcc 3.2. +* mkvmerge: bug fix: The CUE sheet parser interpreted a timestamp as HH:MM:SS (hours, + minutes, seconds). The correct spec is HH:MM:FF (hours, minutes, frames with 1 + frame = 1/75 second). + + +# Version 0.9.3 2004-07-18 + +## New features and enhancements + +* mkvmerge: new feature: When using a CUE sheet as a chapter file mkvmerge will + automatically convert some of the entries to tags. +* mkvmerge: new feature: Added support for TTA lossless audio files. + +## Bug fixes + +* mmg: bug fix: The 'default track' checkbox was broken. +* mkvmerge: bug fix: Using '--cues ...:all' was broken for audio tracks that use + lacing. +* mkvmerge: bug fix: The latest OpenDML AVI files generated by mencoder were not read + correctly. Only the first RIFF chunk was processed. +* mkvmerge: bug fix: The default track feature did not work correctly with the new + --track-order. + +## Other changes + +* mkvmerge: If the user does not specify a --language for a track 'und' ('undefined') + will now be used instead of 'eng'. The user can use the new option + '--default-language' to change that. + + +# Version 0.9.2 2004-06-29 + +## New features and enhancements + +* mmg: new feature: Added 'minimize' buttons to the two 'mkvmerge is running' + dialogs. +* mmg: new feature: Added an option for automatically calling 'File -\> new' after a job + has been added to the job queue. +* mkvmerge, mmg: new feature: --track-order now controls the track creation order + globally, meaning that it isn't used for each file but only once. This allows the + tracks to be created in ANY order (before it was first ordered by file, then by track). + For mmg this means that the track list contains all available tracks and that there + are no 'up' and 'down' buttons in the file list anymore. +* mmg: new feature: Line wrap the tooltips on Windows. +* mmg: new feature: Suggest a name for a new job based on the output file name. +* mmg: new feature: Temporarily disaable 'always on top' if the muxing or the job + dialog are visible. +* mmg: new feature: Ask for confirmation before adding a job if there's already an old + job with the same description. +* mkvmerge: new feature: You can specifiy the time after which to split with ms + precision. + +## Bug fixes + +* mkvextract: bug fix: Video extraction was not working correctly on big endian + systems. +* mmg: bug fix: The job manager did not always catch all of mkvmerge's output, + especially if a job failed. +* mmg: bug fix: The functions 'move up', 'move down' and 'delete' in the 'job' dialog + were not working correctly on Windows. +* mkvmerge: bug fix: Fixed more of that 'garbage at the beginning of MP3 streams' + issue. +* mmg: bug fix: The 'always on top' option was ignored when starting mmg. +* mkvmerge: bug fix: Reading of broken / unfinished AVI files was broken on Windows. + +## Other changes + +* mmg: Updated the mkvmerge GUI guide to reflect changes and additions. + + +# Version 0.9.1 2004-06-13 + +## New features and enhancements + +* mmg: new feature: The action 'delete job' in the job manager will also delete the file + in the 'jobs' subdirectory. +* mmg: new feature: Added an option to make mmg stay always on top (only on Windows). +* mkvmerge: new feature: mmg will set the 'display dimensions' automatically for AVI + files whose video track is MPEG4 and has the pixel aspect ratio stored in the + bitstream. +* mmg: new feature: Added a dialog for adding arbitrary command line options which + includes a list of advanced options to chose from. +* mkvmerge: new feature: Added support for the audio/video synchronization method + used by NanDub (garbage at the beginning of audio tracks inside an AVI) for AC-3 and + MPEG audio tracks. In other words: If an AVI is read and an audio track contains + garbage right at the beginning then the corresponding audio delay is calculated and + used instead of simply discarding the garbage. +* mkvmerge: new feature: Enabled reading MPEG4 video from MP4 files (nope, they're + not stored in Matroska's native mode yet). + +## Bug fixes + +* mmg: bug fix: The job manager did not handle the conversion of non-ASCII characters + correctly. +* mkvmerge: bug fix: The improved MP3 garbage detection was broken resulting in an + error message from mkvmerge in some weird situations. +* mkvmerge: bug fix: Matroska tracks can use lacing (several frames inside one + Matroska block with only one time code for the whole block). mkvmerge did not + recreate the time codes for the frames 1..n in the lacing correctly. +* mkvmerge: bug fix: The OGM fix in 0.9.0 broke handling for non-broken OGM files a bit. + +## Other changes + +* mkvmerge: Dropped supoprt for 'aviclasses' (one of the two libraries for accessing + AVI files). This mostly affects the Windows users as I've used aviclasses and not + avilib on Windows so far. The 0.9.0-pre-builds so far haven't shown any problems, + though, so I hope this doesn't break anything. +* mkvmerge: feature removed: Dropped support for 'time slices'. They were not used, + didn't offer the player any additional value and caused massive increase in + overhead. + + +# Version 0.9.0 2004-05-31 + +## Bug fixes + +* mkvmerge: bug fix: Improved handling for OGM files. Streams that are lacking the + comment packet are handled better. +* mkvmerge: bug fix: Some MP3 streams are padded in the front with trash (mostly those + in AVI files). This trash might contain valid MP3 headers which do not match the + remaining headers for the actual track. Both the MP3 reader and the MP3 packetizer + can now skip up to one of those bogus headers in the trash. +* mmg: bug fix: On some occasions the chapter editor thought there was no language + associated with a chapter name and complained about that. +* mkvmerge: bug fix: The OGM reader was not endian safe. +* mmg: bug fix: The chapter editor did not honor the values selected for 'country' and + 'language'. +* mkvmerge: bug fix: Audio sync for Vorbis was partially broken for positive offsets. +* mmg: Fix for compilation with wxWindows \< 2.4.2. + +## Other changes + +* mmg: Removed the 'advanced' tab. Those options shouldn't be used anyway. +* mkvmerge: Rewrite of the VobSub handling code. + + +# Version 0.8.9 2004-05-06 + +## New features and enhancements + +* mmg: new feature: mmg will ask for confirmation before overwriting a file. This can + be turned off on the settings tab. +* mmg: new feature: Implement drag'n'drop of files onto the input, attachment and + chapter tabs. For the input and attachment tabs it works like pressing the 'add' + button. On the chapters tab it works like calling 'Chapter Editor -\> Open'. + +## Bug fixes + +* mkvmerge: Fixes for compilation with gcc 3.4. +* mkvmerge: bug fix: Some strings read from RealMedia files were not zero-terminated + resulting in broken track recognition for some files. + +## Other changes + +* mkvinfo/mmg: Enabled compilation with wxWidgets 2.5 and Unicode enabled builds of + wxWidgets. +* all: Increased the precision for time codes in chapter files to nanoseconds + (optionally, you can still use fewer digits after the '.'). + + +# Version 0.8.8 2004-04-23 + +## New features and enhancements + +* mmg: new feature: When adding Matroska files the video track's display dimensions + are displayed as well. +* mkvmerge: new feature: Implemented reading AAC from AVIs. + +## Bug fixes + +* mkvinfo: bug fix: mkvinfo was forcing libmatroska not to handle unknown elements + and crashed on those. +* mkvmerge: bug fix: The Flac packetizer was accessing uninitialized memory + resulting in a crash on Windows. +* avilib: bug fix: Fixed compilation on big endian systems. +* mkvmerge: bug fix: Fixed the handling of RealMedia files with 'multirate' tracks + (again). +* mkvmerge: bug fix: On some rare occasions chapters were not written correctly when + splitting was active. +* mmg: bug fix: On non-Windows systems some combinations of wxWindows and GTK caused + continuous 100% CPU usage after a special call to wxExecute. + +## Other changes + +* mkvtoolnix now depends on libebml 0.7.0 and libmatroska 0.7.0. + + +# Version 0.8.7 2004-04-05 + +## New features and enhancements + +* mkvinfo: new feature: Added a terse output format via '-s'. +* mkvmerge: new feature: If using MPEG4 video and no aspect ratio or display + dimensions are given mkvmerge will extract the aspect ratio information from the + stream and automatically set the display dimensions accordingly. +* mkvextract: new feature: Added extraction of RealAudio and RealVideo tracks to + RealMedia files. +* mmg: new feature: Added a 'job queue'. The current settings can be added as a new job, + and all pending jobs can be started for batch processing without user interaction. + +## Bug fixes + +* mkvmerge: bug fix: Using audio sync on AC-3 tracks read from Matroska files did not + work. + + +# Version 0.8.6 2004-03-13 + +## New features and enhancements + +* mkvmerge: new feature: Tags are being kept when reading Matroska files. +* mmg: new feature: Automatically set the output file name when the first file is added + to the same name but with a '.mkv' extension if it hasn't been set yet. Can be disabled + on the 'settings' page. +* mkvmerge/mmg: new feature: Made the process priority selectable on the 'settings' + page and default to 'normal' again (was 'lower' before). +* mmg: new feature: mmg will ask for confirmation before overwriting an existing + output file. + +## Bug fixes + +* mkvmerge: bug fix: OGMs created by Cyrius OGMuxer are missing comment packets for + some streams which mkvmerge choked on. +* mkvmerge/mmg: bug fix: The LANGUAGE and TITLE comments from OGM files were not set in + the GUI when adding such files. +* mmg: bug fix: If the FourCC was set for one track it had been used for each track you + selected as well. +* mkvmerge: bug fix: Large values for --sync (over 2100) would cause an integer + overflow resulting in no sync being done at all. +* mkvmerge: bug fix: The VobSub handling was broken if the .idx file contains an entry + for a track ("id: en") but no "timestamp:" entries for such a track. +* mkvmerge: bug fix: The segment UID was not generated if splitting was off. +* mkvmerge: bug fix: More of the non-ASCII character fixes (in --tags and --chapters + this time). +* mkvmerge: bug fix: No memory was allocated for the --attachment-description + resulting in weird descriptions or mkvmerge aborting with 'invalid UTF-8 + characters'. +* mkvmerge: bug fix: More of the non-ASCII characters fixes. +* mkvmerge: bug fix: File names with non-ASCII characters like Umlaute are handled + correctly. +* mkvmerge: bug fix: Some RealMedia files contain several tracks for multirate stuff + which are now ignored. Only tracks with known MIME types (audio/x-pn-realaudio and + video/x-pn-realvideo) are used. + +## Other changes + +* mmg: Added a list of 'popular' languages on top of all language drop down boxes. + + +# Version 0.8.5 2004-02-22 + +## Bug fixes + +* mkvmerge: bug fix: segfault in the RealMedia reader. +* mmg: bug fix: When adding a Matroska file that contains a track name or a title with + non-ASCII characters those would be displayed as UTF-8 in the appropriate input + boxes. This has been changed, but obviously it won't work if you add files with + Japanese characters on a system with a different locale. For full Unicode support + you'll have to wait quite a bit longer. +* mmg: bug fix: For some 'browse file' buttons the default directory was not set to the + last directory a file was selected from. +* mmg: new feature: Added a function for adjusting the chapter time codes by a fixed + amount. +* mkvmerge: bug fix: Splitting by size would sometimes abort directly after opening + the second file. +* mkvmerge: bug fix: Splitting by time was broken. + +## Other changes + +* all: A couple of changes that allow compilation on MacOS X. +* avilib: synchronized with transcode's current CVS version. + + +# Version 0.8.4 2004-02-11 + +## Bug fixes + +* mkvmerge: bug fix: When reading Matroska files the durations attached to blocks + were lost (e.g. for subtitle tracks). + + +# Version 0.8.3 2004-02-09 + +## New features and enhancements + +* mkvmerge: new feature: The LANGUAGE, TITLE tags and chapters are being kept when + reading OGM files. +* mkvmerge: new feature: Enabled reading of AAC from OGMs. + +## Bug fixes + +* mkvmerge: bug fix: VobSub durations were not converted from ms to ns precision + resulting in VERY short packets :) +* mkvmerge: bug fix: The change from ms to ns precision broke subtitle handling from + OGM. +* mkvmerge: bug fix: Segfault when using external time code v1 files. +* mkvmerge: bug fix: The AAC-in-Real stuff again. +* mkvmerge: bug fix: Fixed a couple of memory leaks, especially in the QuickTime/MP4 + parser. +* mkvmerge: bug fix: Proper handling for AAC read from RealMedia files (sample + rate/output sample rate were not assigned correctly). + +## Other changes + +* mkvmerge: Changed the meaning of '--global-tags'. They now apply to the complete + file. +* mkvmerge: Made "do not link files when splitting" the default, just like in mmg. +* mkvmerge: The VobSub reader will not discard packets that exceed a certain size + (64KB) anymore. +* mkvmerge: Improved some internal memory freeing decisions. This should help with + files/sections in which are only few keyframes. +* mkvmerge: Changed the two-pass splitting into a one-pass splitting. The resulting + files will always be a little bit larger than the desired size/length, but this + shouldn't matter. +* mmg: Rewrote the chapter editor. It now makes a lot more sense: You can have multiple + names for one chapter entry, and for each name there's only one language/country + association. +* mkvmerge: Changed the complete time code handling from ms precision to ns + precision. Expect some things to be broken by this change. +* mmg: Added some more extensions for RealMedia files. + + +# Version 0.8.2 2004-01-21 + +## New features and enhancements + +* mkvmerge: new feature: The track headers will be rendered completely including the + elements that are set to their default values. Causes less confusion and allows the + setting of e.g. the track language without having to remux the file completely. +* mmg: new feature: Automatically pre-set the attachment's MIME type if the file has a + known extension (e.g. 'text/plain' for '.txt'). +* mkvmerge: new feature: Unknown/unsupported track types can be copied 1:1 from + Matroska input files. +* mkvmerge: new feature: Added proper support for AAC-inside-RealMedia files. +* mkvmerge: new feature: Write cues for audio-only files as well (not more than one cue + entry during a two seconds period). +* mkvmerge: new feature: Added the two new chapter flags 'hidden' and 'enabled'. +* mkvmerge: new feature: Added a new format for the external time code files. + +## Bug fixes + +* mkvmerge: bug fix: The PCM handling was broken resulting in packets that did not end + on sample boundaries. +* mkvmerge: bug fix: AVIs with uncompressed sound were leading to buffer overflows. +* mkvmerge: bug fix: If remuxing a file that contains frames with a reference to the + same time code those references were lost turning such P frames into I frames. This + was the case for some RealAudio stuff. +* mkvmerge: bug fix: The default track flags could not be overriden on the command line + when reading Matroska files. +* mkvmerge: bug fix: The VobSub handling was on occasion putting SPU packets for the + wrong MPEG stream into the current stream resulting in that particular entity not + being displayed. + +## Other changes + +* mkvmerge/mmg: allow the track names to be empty so that you can remove them when + muxing Matroska files. Same for the file title. +* Windows binaries after v0.8.1 require a new runtime DLL archive. Please download it + from https://mkvtoolnix.download/ Thanks. + + +# Version 0.8.1 2004-01-06 + +## Bug fixes + +* mkvmerge: bug fix: The I/O classes were not initialized correctly on Windows + resulting in spontaneous strange error messages, especially when muxing VobSubs. +* mkvmerge: bug fix: For some special atom sizes in Quicktime and MP4 files the size was + not read correctly. This affected e.g. files created by Nero Digital. +* mkvmerge: bug fix: Segfault when muxing some video formats due to unchecked data + (includes RealVideo). + + +# Version 0.8.0 2004-01-01 + +## New features and enhancements + +* mkvmerge, mkvextract, mkvinfo: Added support for the new tagging system. + +## Bug fixes + +* mmg: bug fix: Fixed the "write chapters to Matroska file" feature. +* mmg: bug fix: Made mmg not abort but only display an error message when malformed XML + chapter files should be loaded. +* mkvmerge: bug fix: The timescodes for Vorbis were calculated one packet too early + (meaning that the first packet did not start at 0). +* mmg: bug fix: The default values for the chapter language and chapter country are now + applied when loading simple (OGM) style chapter files as well. +* mkvmerge: bug fix: The VobSub packetizer will assume MPEG2 if no MPEG version + identifier was found ("Unsupported MPEG version: 0x00..."). +* mkvextract: bug fix: Wrong display output and illegal memory access when + extracting FLAC files. +* mmg: bug fix: If one added a Matroska file and the track name or language of a track + consisted of only blanks then mmg would segfault. +* mmg: bug fix: The chapter editor did not properly escape the chapter names resulting + in invalid XML files if the special characters &, \< or \> were used. +* mkvmerge: bug fix: If splitting was active then a wrong CodecID was written to the + second and all following files for MP2 tracks. + +## Other changes + +* mmg: Made "don't link" ON by default because some players might have problems with + the second and all following files if they don't expect them not to start at 0. +* mkvmerge: There are MP4 files that actually contain HE-AAC but don't have the 5 byte + identifier. mkvmerge will also assume SBR if there's only the 2 byte identifier with + a sampling frequency \< 44100Hz. +* mmg: The input box will automatically select the first track when a file is selected. + Upon track selection the input focus is set to the track name input box. +* mmg: The chapter editor automatically focuses the chapter name input box whenever a + chapter entry is selected. + + +# Version 0.7.9 2003-12-11 + +## New features and enhancements + +* mmg: new feature: Added "up" and "down" buttons for the tracks, too. +* mmg: new feature: Added a menu option, 'set output file', that can be used as an + alternative to the "browse" button at the bottom (for those poor users with nothing + more than 800x600 ;)). +* mkvmerge: new feature: The user can alter the order in which the tracks for an input + file are put into the output file with the new "--track-order" option. +* mmg: new feature: Added buttons for moving input files up and down in the input file + box. + +## Bug fixes + +* mmg: bug fix: Removed the Ctrl-v and Ctrl-c accelerators that I used for mmg + functions which overrode the usual 'paste' and 'copy' functionality. +* mkvmerge: bug fix: Negative track IDs in Ogg files were reported incorrectly for + mkvmerge -i (which affected the GUI). +* mkvmerge: bug fix: Internal changes had messed up the --language and --track-name + functionality. +* mmg: bug fix: The "AAC is SBR" check box was grayed out for AAC inside MP4 files. +* mmg: bug fix: The "load settings" function did not load all settings, and some + strings were not allocated at all resulting in a crash when a track was removed after + loading these settings. +* mkvmerge: bug fix: The AAC packetizer was not working if packets were being read from + a raw AAC file (it worked fine from MP4 and Matroska files). +* mkvmerge: bug fix: Avoid deadlocks when parsing broken SPU packets from VobSubs. + +## Other changes + +* mkvmerge: Set the thread priority to BELOW_NORMAL on Windows (mkvmerge was already + nice(2)'d on Unix systems). +* mmg: Command line arguments are put into an option file which is then handed over to + mkvmerge. This allows really long command lines, even on Windows. + + +# Version 0.7.8 2003-12-02 + +## New features and enhancements + +* mmg: new feature: You can set the values for the language and/or country codes for a + chapter and all its children with the push of one button (the new "Set values" + button). +* mmg: new feature: You can set default values for the language and the country codes in + the chapter editor (Chapter menu -\> Set default values). +* mkvmerge: new feature: Added an option '--display-dimensions' which allows the + direct setting of the display dimensions. It is mutually exclusive with + '--aspect-ratio', of course. +* mkvmerge: Added an option for dumpig all split points including file size and + timestamp information after the first splitting pass. + +## Bug fixes + +* mkvmerge: bug fix: Display dimensions were sometimes off by one, e.g. 640x479 + instead of 640x480. This should not happen anymore for sane pixel dimensions. +* mmg: bug fix: The language combo box was not correctly set on Windows. +* mmg: bug fix: Quotes were missing if the time code file's name contained spaces. +* everything: Committed a lot of cross-OS compatibility fixes (thanks to Haali and + thedj). + +## Other changes + +* mkvmerge: Changed the options '--fourcc' and '--aspect-ratio'. They now take a + track ID just like all the other track specific options. +* mkvmerge: Rewrote the SPU packet parsing code. It should not abort anymore. + + +# Version 0.7.7 2003-11-16 + +## New features and enhancements + +* mkvmerge: Added full support for FLAC (both raw FLAC and OggFLAC are supported, even + though raw FLAC is very slow). +* mmg: Added an input field for the 'time codes' file to the track options. +* mkvmerge: new feature: CUE sheets can be used for chapters. +* mkvmerge: Added support for --sync for VobSub tracks. +* mmg: When a file is being added then some information from it (languages, track + names, file title) are kept, and the appropriate input boxes are pre-set with these + values. Works only for formats that support such information (Matroska, VobSub). + +## Bug fixes + +* mkvmerge: bug fix: Reworked the audio sychronization which did not work correctly + for Matroska source files. +* mkvmerge: bug fix: Increased the size of the space reserved for the first meta seek + element (see mkvmerge.1 for an explanation). In some situations (with tags, + chapters, attachements and very big file) it might not have been enough in order to + contain all elements. +* mkvmerge: bug fix: When reading MP3 audio tracks from a Matroska file with the + A_MS/ACM CodecID (MS compatibility mode) the layer was not identified correctly. +* mkvmerge: Implemented a lot of fixes for big endian systems and processors that + don't allow non-aligned memory access for word or bigger sized objects. +* mkvmerge: bug fix: If running in identification mode (-i, used by mmg a lot) then + don't output any warnings or mmg will not accept this file. + +## Other changes + +* mkvextract: Added extraction of FLAC to raw FLAC or OggFLAC files. +* mmg: Added an input field for the 'CUE sheet to chapter name' conversion format. +* mkvmerge: Improved the file type detection for AC-3 and AAC files a bit. +* mmg: Made mmg accept return codes of 1 when 'mkvmerge -i' is run when an input file is + added. This way mmg won't reject mkvmerge's output if mkvmerge only printed some + warnings which will result in a return code of 1 instead of 0. +* mkvtoolnix: Re-worked the configure script. Removed all the lib specific + --with-...-include and --with-...-lib options. The --with-extra-includes and + --with-extra-libs options can be used instead. +* mkvmerge: Sped up the reading of VobSub .idx files. + + +# Version 0.7.5 2003-11-05 + +## New features and enhancements + +* mkvmerge: new feature: Added the ability to read time codes from text files which + override the time codes mkvmerge calculates normally. +* mmg: new feature: Added a new menu entry "File -\> new" which will clear all the current + muxing settings. +* mmg: Added support for VobSub subtitles including their compression options. + Added the .m4a extension to the 'add file' dialog. +* mkvmerge: new feature: Implemented generic support for frame compression (mostly + useful for VobSub subtitles but could also be used for others) and the complete + framework for handling content encodings in the Matroska reader. +* mkvinfo: new feature: Dump unknown elements recursively. + +## Bug fixes + +* mkvmerge: bug fix: The VobSub .idx parser was dividing by 0 if a track only contained + one entry. +* mkvmerge: Fixed the time code reader code and made it a bit more flexible. Added more + documentation for this feature along with an example file (examples/example-time + codes.txt). +* mmg: bug fix: When 'default track' is selected then all other tracks of the same type + will have their 'default track' flag cleared. +* mkvextract: bug fix: Add all the mandatory elements when extracting chapters so + that the resulting XML can always be used directly with mkvmerge again without + having to manually add e.g. ChapterLanguage. +* mkvmerge: bug fix; Handle audio tracks from Matroska files with the CodecID + A_MS/ACM correctly. +* mkvmerge: bug fix: The VobSub .idx parser was mis-calculating the subtitle entry + frame sizes. +* mkvmerge: bug fix: The Vorbis packetizer was miscalculating the number of samples + to add/remove when using audio sync. +* mmg: bug fix: Made the input boxes for file names (tags and chapters) editable so that + their contents can be deleted. +* mkvmerge: bug fix: Made the SRT reader more tolerant regarding empty lines. + +## Other changes + +* mkvmerge: SPU packets belonging to the same time code are grouped together, and the + duration is extracted directly from the SPU stream. +* mkvmerge: The VobSubs are now stripped of the MPEG program stream, and only the SPU + packets are kept. +* mkvmerge, mkvextract: The Matroska reader and the OGM reader (mkvmerge) as well as + mkvextract will discard empty or 'cleaning only' subtitle packets as they are + appear in OGMs in order to mark the end of an entry. +* mkvmerge: Changes to use libmatroska's new lacing code. +* mkvmerge: Adjusted the compression handling to the final content encoding specs. + + +# Version 0.7.2 2003-10-14 + +## New features and enhancements + +* mkvmerge: Implemented some speedups for a couple of container formats and track + types (mainly AVI reader, MP3/AC-3/AAC packetizers). Especially noticeable when + splitting is active as well. + +## Bug fixes + +* mkvmerge: bug fix: If 'no linking' and splitting was active mkvmerge would abort on + the start of the second output file due to time codes that were calculated + incorrectly. +* mkvextract: bug fix: Support for extracting SBR AAC (previous 'fix' did not + actually fix this). +* mkvextract: bug fix: All extracted subtitles where written to the first output file + given, not to the one they were supposed to be written to. +* mmg: bug fix: The 'abort' button was doing nothing under Windows. +* mmg: bug fix: Audio, video and subtitle track selection was translated into the + wrong command line options. + +## Other changes + +* mkvmerge: Replaced the avilib based AVI reading functions with AVI classes from + Cyrius. + + +# Version 0.7.1 2003-10-03 + +## New features and enhancements + +* mkvmerge: new feature: Attachments are kept when reading Matroska files. +* mmg: new feature: Added a (nearly) full-featured chapter editor. +* mkvmerge: new feature: RealAudio can be read from Matroska files. + +## Bug fixes + +* mkvmerge: bug fix: XML chapters were not parsed correctly. +* mkvmerge: bug fix/new feature: Rewrote the complete MP3 handling. Now files with + ID3 tags (both v1 and v2) are handled correctly. All MPEG-1 audio files (all layers) + should be handled correctly now. +* mkvextract: new feature: Support for extract HE-AAC tracks to .aac files. Bug fix: + Missing elements (default values) are handled correctly for audio tracks. +* mkvmerge: bugfix: If attachments were given with path components then the path + component wasn't discarded for the attachment's description on Windows (normally + only the file name should be used as the attachment's name). +* mmg: Fixed wrong order of the options --chapters, --chapter-language and + --chapter-charset. +* mmg: bugfix: Moved the aspect ratio and FourCC input fields from the global tab to the + input tab where they belong to. +* mkvmerge: bugfix: RealVideo was not read correctly from Matroska files. +* mkvmerge: bugfix: The SRT reader would abort if there was more than one empty line + between subtitle entries line. +* mkvextract: bugfix: Proper BOMs are written according to the desired charset when + extracting text subtitles. + +## Other changes + +* Added a guide for mmg including some pictures. +* mkvmerge: Changed the lacing strategy again. New defaults are NOT to write duration + elements for all blocks, NOT to use time slices and to USE lacing for most audio + tracks. This will save some space. The downside is that the laced frames 'lose' their + precise time code information. Current demuxers don't care and will work + nevertheless. More sophisticated applications that make use of these advanced + information (duration elements, time slices) are not available at the moment. All + these options can be toggled by the user with the new/modified options + --disable-lacing, --enable-durations and --enable-timeslices. +* mmg: Added a lot of checks on the data given by the user so that invalid data is reported + by mmg and not by mkvmerge. +* mmg: Made the app a GUI app which gets rid of the "DOS box" on Windows. + + +# Version 0.7.0 2003-09-16 + +## New features and enhancements + +* mkvmerge: Implemented an experimental VobSub reader and packetizer. No specs + exist for these yet, though. +* mkvmerge: Added support for XML based chapter files. + +## Other changes + +* mkvextract: Add an UTF-8 BOM to extracted SSA/ASS and SRT subtitle files. Print + warnings for missing durations for text subtitle tracks. +* Added a complete GUI for mkvmerge, mkvmergeGUI (mmg) based on the work of Florian + Wagner. +* mkvmerge: Support for setting the track names. +* mkvmerge: For Matroska source files: If the source contains chapters then these are + kept unless the user specified chapters with --chapters. +* mkvmerge: Improved the support for Matroska files with tracks with big gaps between + entries, e.g. subtitle tracks whose entries are a minute or more apart. +* mkvmerge: When splitting is active and the source is a Matroska file then + splitpoints were borked, and the first pass was slow as your average mole. +* mkvmerge: The track UIDs are kept when reading Matroska files even when splitting is + active. +* mkvmerge: Added a QuickTime/MP4 reader. Can handle several QuickTime video and + QuickTime audio formats as well as AAC (both 'normal' AAC and SBR AAC). +* mkvmerge: DisplayWidth and DisplayHeight are kept intact when reading from a + Matroska file but can be overridden with --aspect-ratio. +* Wrote documentation, XML examples and the DTD for the XML chapter files. +* mkvinfo: Rewrote mkvinfo to use libebml's Read() function instead of manually + reading each and every element. + + +# Version 0.6.5 2003-08-29 + +## Bug fixes + +* mkvmerge: On Windows the 'isspace()' function used to trim leading and trailing + white spaces from tags considered some parts of valid UTF-8 character sequences to + be white spaces as well. Fixed by replacing 'isspace()' with 'isblank()'. Reported + by Liisachan. +* mkvmerge: Real reader: For RV40 the actual dimensions were also used for the aspect + ratio/display dimensions. This has been fixed: the actual dimensions are used for + PixelWidth/PixelHeight, the dimensions stored in the RM container are used for the + aspect ratio/DisplayWidth & DisplayHeight. Reported by Karl Lillevold. + +## Other changes + +* mkvmerge: Support for chosing the charset and language used in simple chapter + files. Suggestion by Liisachan. +* Rewrote the UTF-8 conversion routines. They should now handle U+8000 characters + correctly. Reported by Liisachan. + + +# Version 0.6.4 2003-08-27 + +## New features and enhancements + +* mkvmerge: Meta seek element is split into two elements. The first's located at the + start of the file containing only a small number of level 1 elements. The clusters are + referenced in a second meta seek element located at the end of the file. Removed the + options "--meta-seek-size" and "--no-meta-seek". Added the option to disable + that second meta seek entry, "--no-clusters-in-meta-seek". +* mkvinfo: Added support for the following elements: KaxPrevFilename, + KaxNextFilename, KaxTrackFlagEnabled, KaxTrackName, KaxCodecName, + KaxCodecSettings, KaxCodecInfoURL, KaxCodecDownloadURL, KaxCodecDecodeAll, + KaxTrackOverlay, KaxAudioPosition, KaxAudioOutputSamplingFreq, + KaxVideoDisplayUnit, KaxVideoColourSpace, KaxVideoGamma, + KaxVideoFlagInterlaced, KaxVideoStereoMode, KaxVideoAspectRatio, + KaxClusterPosition, KaxClusterPrevSize, KaxBlockVirtual, + KaxBlockAdditions, KaxBlockMore, KaxBlockAddID, KaxBlockAdditional, + KaxReferenceVirtual, KaxSliceBlockAddID, KaxChapters, KaxEditionEntry, + KaxChapterAtom, KaxChapterUID, KaxChapterTimeStart, KaxChapterTimeEnd, + KaxChapterTrack, KaxChapterTrackNumber, KaxChapterDisplay, + KaxChapterString, KaxChapterLanguage, KaxChapterCountry + +## Bug fixes + +* mkvmerge: Fixed some missing default values in the Matroska reader (e.g. mono audio + files). Reported by Liisachan. +* mkvmerge: Bugfix: If a subtitle packet was the last packet in a cluster then its + duration was not written resulting in a broken file. + +## Other changes + +* mkvextract: Support for re-creating dropped frames when extracting video to an + AVI. Works only well if the frame durations in the source file are multiples of the + frame rate, of course. +* mkvmerge: The MP3 packetizer did not start at 0 with its time codes. It does now. + Reported by alexnoe. +* mkvmerge: Proper support for dropped frames when reading AVI files. Reported by + alley_cat, Horváth István. +* mkvmerge: Improved all command line parsing error messages. +* mkvmerge: Improved the error message for the XML tag file parser if an invalid + &-sequence is found. +* mkvextract: Strings are postprocessed so that the special characters &, \<, \>, " are + replaced by their HTML equivalents &, <, > and ". +* mkvmerge: Disabled lacing by default and renamed --no-lacing to --enable-lacing. + With all the proper info about the laced frames lacing is actually producing larger + files than without lacing. +* mkvextract: Backwards compatibility: Accepts S_SSA and S_ASS as valid CodecIDs + (new CodecIDs are S_TEXT/SSA and S_TEXT/ASS). + + +# Version 0.6.3 2003-08-20 + +## New features and enhancements + +* mkvmerge: Implemented a switch that has to be used for SBR AAC / AAC+ / HE-AAC if the + source file is an AAC file and the AAC file contains SBR AAC data (no automatic + detection possible in this case!). + +## Bug fixes + +* Windows versions: Fixed a bug with files bigger than 2GB not being recognized. The + accompanying error message was "File NAME has unknown type. Please have a look at the + supported file types..." +* all tools: Fixed a bug which would only allow Matroska files up to 4GB to be read. The + accompanying error message was "No segment found" or something similar. + +## Other changes + +* mkvmerge: The Real reader accepts incomplete video packets and tries to + re-assemble them instead of aborting with 'die: len != total'. +* mkvmerge: Low bitrate AC-3 tracks from Real's DNET are identified as A_AC3/BSID9 or + A_AC3/BSID10. +* mkvmerge: The RealMedia reader takes the number of packets into account when + reading which results in better end-of-file detection. +* mkvinfo: Unknown elements are properly skipped now. +* mkvmerge: For RV40 (RealVideo 9) the actual video dimensions are decoded from the + first video frame. + + +# Version 0.6.2 2003-08-11 + +## Other changes + +* mkvmerge: Video aspect ratio was set wrong if the user did not specify any. + + +# Version 0.6.1 2003-08-11 + +## New features and enhancements + +* mkvinfo: Added Adler-32 calculation and display for frame contents with the -c + option. + +## Bug fixes + +* mkvmerge: Fixed support for reading MultiComment tags from XML tag files. +* mkvmerge: Fixed a bug with chapters and splitting which would crash mkvmerge if no + chapter belonged into the output file. + +## Other changes + +* mkvmerge: RealVideo: Support for all kinds of frames including "short" and + "merged" frames (results are identical to Gabest's output). +* mkvmerge: The aspect ratio setting will only cause upscaling of the current video + dimensions which are then put into KaxVideoDisplayWidth and + KaxVideoDisplayHeight. +* mkvextract: Changed how the global elements are handled by taking the parent's size + into account. This re-enables processing of files produced with the latest + VirtualDubMod. +* mkvmerge: Changed how the Matroska reader handles global elements by taking the + parent's size into account. This re-enables processing of files produced with the + latest VirtualDubMod. +* mkvinfo: Changed how mkvinfo handles global elements by taking the parent's size + into account. Hopefully this is now correct. +* mkvextract: Support for MultiComment tags. +* mkvmerge: Allow some slightly broken Matroska files to be processed correctly if + the reference blocks are off by at most 1ms. +* mkvmerge: MP3: Better support for other MPEG versions and layers (number of samples + per packet). +* mkvmerge: RealAudio: "dnet" is actually byte-swapped AC-3 and is being treated as + such (re-swapped and output as AC-3). +* Changes for compilation with gcc 2.95. + + +# Version 0.6.0 2003-08-04 + +## New features and enhancements + +* mkvmerge: Added support for simple chapter files (CHAPTER01=..., + CHAPTER01NAME=Hello World etc). +* mkvmerge: Added support tags based on XML files. +* mkvextract: Rewrote the command line syntax. Added extracting attachments and + tags as new options. +* mkvmerge: Added support for the "SegmentTitle" (general title of the file + written). +* mkvmerge: Added support for UTF-8 and UTF-16 encoded text files for the SRT and + SSA/ASS readers. +* mkvmerge: Added support for attaching files to the output file(s). +* mkvinfo: Added support for the rest of the tags: KaxTagMultiComment, + KaxTagMultiCommentName, KaxTagMultiCommentComments and + KaxTagMultiCommentLanguage. Almost all tags have been successfully tested. +* mkvinfo: Added support for allmost all tags (totally untested): KaxTag + KaxTagArchivalLocation KaxTagAudioEncryption KaxTagAudioGain + KaxTagAudioGenre KaxTagAudioPeak KaxTagAudioSpecific KaxTagBibliography + KaxTagBPM KaxTagCaptureDPI KaxTagCaptureLightness + KaxTagCapturePaletteSetting KaxTagCaptureSharpness KaxTagChapterUID + KaxTagCommercial KaxTagCropped KaxTagDate KaxTagDiscTrack KaxTagEncoder + KaxTagEncodeSettings KaxTagEntity KaxTagEqualisation KaxTagFile + KaxTagGeneral KaxTagGenres KaxTagIdentifier KaxTagImageSpecific + KaxTagInitialKey KaxTagKeywords KaxTagLanguage KaxTagLegal KaxTagMood + KaxTagMultiCommercial KaxTagMultiCommercialAddress + KaxTagMultiCommercialEmail KaxTagMultiCommercialType + KaxTagMultiCommercialURL KaxTagMultiDate KaxTagMultiDateDateBegin + KaxTagMultiDateDateEnd KaxTagMultiDateType KaxTagMultiEntity + KaxTagMultiEntityAddress KaxTagMultiEntityEmail KaxTagMultiEntityName + KaxTagMultiEntityType KaxTagMultiEntityURL KaxTagMultiIdentifier + KaxTagMultiIdentifierBinary KaxTagMultiIdentifierString + KaxTagMultiIdentifierType KaxTagMultiLegal KaxTagMultiLegalAddress + KaxTagMultiLegalType KaxTagMultiLegalURL KaxTagMultiPrice + KaxTagMultiPriceAmount KaxTagMultiPriceCurrency KaxTagMultiPricePriceDate + KaxTagMultiTitle KaxTagMultiTitleAddress KaxTagMultiTitleEdition + KaxTagMultiTitleEmail KaxTagMultiTitleLanguage KaxTagMultiTitleName + KaxTagMultiTitleSubTitle KaxTagMultiTitleType KaxTagMultiTitleURL + KaxTagOfficialAudioFileURL KaxTagOfficialAudioSourceURL + KaxTagOriginalDimensions KaxTagOriginalMediaType KaxTagPlayCounter + KaxTagPopularimeter KaxTagProduct KaxTagRating KaxTagRecordLocation KaxTags + KaxTagSetPart KaxTagSource KaxTagSourceForm KaxTagSubGenre KaxTagSubject + KaxTagTargets KaxTagTitle KaxTagTrackUID KaxTagVideoGenre +* mkvmerge: Implemented time slice durations , default block duration and block + durations for slices where necessary. + +## Bug fixes + +* mkvmerge: Fixed a bug in the SRT reader which would not always handle Unix/DOS style + new line cases correctly. +* mkvmerge: Fixed some infinite-reading-from-a-file bug that occurred on Windows + when reading SSA/ASS files. +* mkvmerge: Fixed a bug which would mostly appear with subtitles that have very long ( \> + 60s) gaps between entries. Here the cluster would not been rendered properly + leaving mkvmerge either comatose ( = endless loop) or just plain dead ( = crashing). + +## Other changes + +* base64tool: Added a tool for Base64 encoding/decoding needed for binary elements + in the tags. +* mkvextract: Support for extracting chapter information. +* mkvmerge: The SSA/ASS reader ignored the --sub-charset option and always used the + current charset to recode the subtitles. +* mkvinfo: Support for the elements dealing with attachments (KaxAttachments, + KaxAttached, KaxFileDescription, KaxFileName, KaxMimeType, KaxFileData). +* mkvmerge: Changed the RealVideo packaging method: Subpackets are assembled into + complete packets so the demuxer does not have to do that anymore. +* mkvmerge: DisplayWidth and DisplayHeight, which form the display aspect ratio, + are now always written to ease changing them later without having to completely + remux the file. +* Added a RealMedia demuxer that can handle both RealVideo and RealAudio (all + codecs). +* mkvmerge: Support for handling native video tracks (e.g. B frames) when reading + Matroska files. +* mkvinfo: Support for KaxSegmentFilename, KaxTitle, KaxSlices, KaxTimeSlice, + KaxSliceLaceNumber, KaxSliceFrameNumber, KaxSliceDelay and + KaxSliceDuration. + + +# Version 0.5.0 2003-06-22 + +## Important notes + +* Made the AAC reader automatically recognize if a MPEG4 AAC file contains the + emphasis header (deprecated) or not (current standard). + +## Bug fixes + +* Fixed a double free() on cleanup (after writing the cues) which resulted in a + segfault sometimes. + +## Other changes + +* Added 'ReferencePriority' element to the known elements for mkvinfo. +* Removed "(mkvinfo) " from mkvinfo's output in order to improve readability and save + space. +* --sub-charset now also needs a track ID. +* Modified the verbosity levels for mkvinfo: The seek head subentries and cue + subentries will only be shown at level 2 to make the output easier to read. +* The language and default track settings are now kept again if not overridden when + reading from Matroska files. +* Added mkvextract which can extract tracks from a Matroska file into other files. +* Switched from cygwin to MinGW32 for the Windows binaries. +* Added a SSA/ASS reader. +* Support for reading text subtitles from Matroska files. + + +# Version 0.4.4 2003-06-15 + +## New features and enhancements + +* Added an option for identifying input files and their track types. + +## Other changes + +* Several options now need an explicity track ID to specify which tracks of an input + file the option should be applied to. These options include --atracks, --vtracks, + --stracks, --sync, --default-track, --cues and --language. +* The Matroska reader now handles track selection correctly. + + +# Version 0.4.3 2003-06-12 + +## New features and enhancements + +* Added support for splitting output files by size or by time and limiting the number of + output files. +* Added support for the segment UID/next segment UID/previous segment UID. +* Implemented stricter content based file type identification for MP3 and AC-3 files + so that those won't be mis-identified. +* Some improvements to the mkvinfo GUI (thanks to jcsston for the patch/the ideas). + +## Other changes + +* Support for proper linking of segments via the segment UIDs. The first and last files + created can be manually linked to given UIDs. +* A lot of changes to comply with libmatroska/libebml 0.4.4. + + +# Version 0.4.2 2003-05-29 + +## Bug fixes + +* Fixed a segfault in the Matroska reader. + +## Other changes + +* Support for some more tags in both mkvmerge and mkvinfo. +* Removed the '--sub-type' switch as all text subtitles will be stored in UTF-8 + format. Made iconv mandatory in the configure checks for this very reason. +* Added a GUI to mkvinfo. + + +# Version 0.4.1 2003-05-23 + +## Other changes + +* A lot of changes regarding file I/O. Files bigger than 2GB should now be handled + correctly on both Linux and Windows. +* Added checks for MP4/Quicktime files which will abort mkvmerge. +* Support for reading AAC tracks from Matroska files. + + +# Version 0.4.0 2003-05-22 + +## New features and enhancements + +* Some internal changes and enhancements. Code requires libebml and libmatroska + 0.4.3 now. +* Added support for AAC files (only those with ADTS headers at the moment). + +## Bug fixes + +* Fixed a bug with mono MP3 files. + +## Other changes + +* ADTS headers are stripped from the AAC streams. This is what I'd call 'proper AAC + support'. +* Better support for DTS streams in general and for DTS-in-WAV in particular (patch by + Peter Niemayer \<niemayer AT isg.de\>). +* Renamed '--no-utf8-subs' to '--sub-type utf8'. Polished the man page regarding + subtitle handling. + + +# Version 0.3.3 2003-05-15 + +## Bug fixes + +* Fixed a bug with the AC-3 time code calculation (patch by Peter Niemayer \<niemayer AT + isg.de\>). + +## Other changes + +* If an error occurs while writing to the destination file the error is reported and + mkvmerge aborts with a non-zero exit code. +* The OGM reader reported I frames as P frames and vice versa round making seeking not + really nice ;) +* Support for reading DTS files & putting them into Matroska (main patch by Peter + Niemayer \<niemayer AT isg.de\>, a few things by me). + + +# Version 0.3.2 2003-05-11 + +## New features and enhancements + +* Added support for aspect ratio. + +## Bug fixes + +* Fixed the huge memory need if reading from AVI files (introduced on 2003-05-06 with + the internal changes). + +## Other changes + +* Proper handling of the 'default track' flag and the language for the Matroska + reader. +* Proper handling of the 'default track' flag for all the packetizers. +* Made mkvtoolnix compile under cygwin. +* Subtitle charsets can be specified with --sub-charset and do not rely on the current + locale anymore. +* For the last packet of each track its duration is now stored. +* A lot of internal changes - I hope nothing has broken... (See ChangeLog.cvs for + details.) +* The matroska reader calculated wrong header lengths for Vorbis tracks. +* mkvinfo reports the FourCC for video tracks with a CodecID of V_MS/VFW/FOURCC and + the format tag for audio tracks with a CodecID of A_MS/ACM. + + +# Version 0.3.1 2003-05-03 + +## New features and enhancements + +* Added support for EbmlVoid everywhere to mkvinfo. + +## Other changes + +* Tracks read from a Matroska file will keep their UID if it hasn't been used yet. +* Support for reading text subtitle streams from OGM files. +* Support for KaxTrackLanguage and ISO 639 languages. + + +<!-- Local Variables: --> +<!-- fill-column: 78 --> +<!-- End: --> diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/README.txt b/mm_avh_working_space/bin/mkvtoolnix/doc/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..65ecff254dab38cf31dedcba27d0964c016d8c6e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/README.txt @@ -0,0 +1,466 @@ +MKVToolNix 76.0 +================= + +# Table of contents + +1. [Introduction](#1-introduction) +2. [Installation](#2-installation) + 1. [Requirements](#21-requirements) + 1. [Hard requirements](#211-hard-requirements) + 2. [Requirements with bundled fallbacks](#212-requirements-with-bundled-fallbacks) + 2. [Optional components](#22-optional-components) + 3. [Building libEBML and libMatroska](#23-building-libebml-and-libmatroska) + 4. [Building MKVToolNix](#24-building-mkvtoolnix) + 1. [Getting and building a development snapshot](#241-getting-and-building-a-development-snapshot) + 2. [Configuration and compilation](#242-configuration-and-compilation) + 5. [Notes for compilation on (Open)Solaris](#25-notes-for-compilation-on-opensolaris) + 6. [Unit tests](#26-unit-tests) +3. [Reporting bugs & getting support](#3-reporting-bugs-getting-support) + 1. [Reporting bugs](#31-reporting-bugs) + 2. [Getting support](#32-getting-support) +4. [Test suite and continuous integration tests](#4-test-suite-and-continuous-integration-tests) +5. [Code of Conduct](#5-code-of-conduct) +6. [Included third-party components and their licenses](#6-included-third-party-components-and-their-licenses) + 1. [avilib](#61-avilib) + 2. [libEBML](#63-libebml) + 3. [libMatroska](#64-libmatroska) + 4. [librmff](#65-librmff) + 5. [nlohmann's JSON](#66-nlohmanns-json) + 6. [pugixml](#67-pugixml) + 7. [utf8-cpp](#68-utf8-cpp) + 8. [Oxygen icons and sound files](#69-oxygen-icons-and-sound-files) + 9. [MKVToolNix icons](#610-mkvtoolnix-icons) + 10. [QtWaitingSpinner](#611-qtwaitingspinner) + 11. [Fancy tab widget](#612-fancy-tab-widget) + 12. [fmt](#613-fmt) + 13. [QgsCollapsibleGroupBox](#613-qgscollapsiblegroupbox) + +----------------- + +# 1. Introduction + +With these tools one can get information about (via mkvinfo) Matroska +files, extract tracks/data from (via mkvextract) Matroska files and create +(via mkvmerge) Matroska files from other media files. Matroska is a new +multimedia file format aiming to become THE new container format for +the future. You can find more information about it and its underlying +technology, the Extensible Binary Meta Language (EBML), at + +http://www.matroska.org/ + +The full documentation for each command is now maintained in its +man page only. Type `mkvmerge -h` to get you started. + +This code comes under the GPL v2 (see www.gnu.org or the file COPYING). +Modify as needed. + +The icons are based on the work of Alexandr Grigorcea and modified by +Eduard Geier. They're licensed under the terms of the +[Creative Commons Attribution 3.0 Unported license](http://creativecommons.org/licenses/by/3.0/). + +The newest version can always be found at +https://mkvtoolnix.download/ + +Moritz Bunkus <moritz@bunkus.org> + + +# 2. Installation + +If you want to compile the tools yourself, you must first decide +if you want to use a 'proper' release version or the current +development version. As both Matroska and MKVToolNix are under heavy +development, there might be features available in the git repository +that are not available in the releases. On the other hand the git +repository version might not even compile. + +## 2.1. Requirements + +### 2.1.1. Hard requirements + +In order to compile MKVToolNix, you need a couple of libraries. Most of +them should be available pre-compiled for your distribution. The +programs and libraries you absolutely need are: + +- A C++ compiler that supports several features of the C++11, C++14 + and C++17 standards: initializer lists, range-based `for` loops, + right angle brackets, the `auto` keyword, lambda functions, the + `nullptr` keyword, tuples, alias declarations, `std::make_unique()`, + digit separators, binary literals, generic lambdas, user-defined + literals for `std::string`, `[[maybe_unused]]` attribute, nested + namespace definition, structured bindings, `std::optional`, + `std::regex`. Others may be needed, too. For GCC this means at least + v8; for clang v7 or later. + +- [libOgg](http://downloads.xiph.org/releases/ogg/) and + [libVorbis](http://downloads.xiph.org/releases/vorbis/) for access to Ogg/OGM + files and Vorbis support + +- [zlib](http://www.zlib.net/) — a compression library + +- [Boost](http://www.boost.org/) — Several of Boost's libraries are + used, e.g. `filesystem`, `multi-precision`, `operators`, + `system`. At least v1.66.0 is required. + +- [libxslt's xsltproc binary](http://xmlsoft.org/libxslt/) and + [DocBook XSL stylesheets](https://sourceforge.net/projects/docbook/files/docbook-xsl/) + — for creating man pages from XML documents + +You also need the `rake` or `drake` build program. I suggest `rake` +v10.0.0 or newer (this is included with Ruby 2.1) as it offers +parallel builds out of the box. If you only have an earlier version of +`rake`, you can install and use the `drake` gem for the same gain. + +### 2.1.2. Requirements with bundled fallbacks + +Several required libraries might not be available for your +distribution. Therefore they're bundled with the MKVToolNix source +code. The `configure` script will look for those libraries and use +existing versions if present. If not, the bundled versions are used +instead. + +It is highly recommended to install the versions provided by your +distribution instead of relying on the bundled versions. + +These libraries are: + +- [fmt](http://fmtlib.net/) — a small, safe and fast formatting + library. Version 6.1.0 or later is required. + +- [libEBML v1.4.4](http://dl.matroska.org/downloads/libebml/) or later + and [libMatroska v1.7.1](http://dl.matroska.org/downloads/libmatroska/) + or later for low-level access to Matroska files. Instructions on how to + compile them are a bit further down in this file. + +- [librmff](https://www.bunkus.org/videotools/librmff/index.html) — a + library for accessing RealMedia files + +- [nlohmann's JSON](https://github.com/nlohmann/json) — JSON for + Modern C++ + +- [Qt](http://www.qt.io/) v5.9.0 or newer — a cross-platform library + including a UI toolkit. The library is needed for all programs, even + if you decide not to build MKVToolNix GUI. + +- [pugixml](http://pugixml.org/) — light-weight, simple and fast XML + parser for C++ with XPath support + +- [utf8-cpp](http://utfcpp.sourceforge.net/) — UTF-8 with C++ in a + Portable Way + +## 2.2. Optional components + +Other libraries are optional and only limit the features that are +built. These include: + +- [cmark](https://github.com/commonmark/cmark) — the CommonMark + parsing and rendering library in C is required when building + MKVToolNix GUI. + +- [libFLAC](http://downloads.xiph.org/releases/flac/) for FLAC + support (Free Lossless Audio Codec) + +- [po4a](https://po4a.alioth.debian.org/) for building the translated + man pages + +## 2.3. Building libEBML and libMatroska + +This is optional as MKVToolNix comes with its own set of the +libraries. It will use them if no version is found on the system. + +Start by either downloading the latest releases of +[libEBML](http://dl.matroska.org/downloads/libebml/) and +[libMatroska](http://dl.matroska.org/downloads/libmatroska/) or by +getting fresh copies from their git repositories: + + git clone https://github.com/Matroska-Org/libebml.git + git clone https://github.com/Matroska-Org/libmatroska.git + +First build and install libEBML according to the included +instructions. Afterwards do the same for libMatroska. + +## 2.4. Building MKVToolNix + +Either download the current release from +[the MKVToolNix home page](https://mkvtoolnix.download/) +and unpack it or get a development snapshot from my Git repository. + +### 2.4.1. Getting and building a development snapshot + +You can ignore this subsection if you want to build from a release +tarball. + +All you need for Git repository access is to download a Git client +from the Git homepage at http://git-scm.com/. There are clients +for both Unix/Linux and Windows. + +First clone my Git repository with this command: + + git clone https://gitlab.com/mbunkus/mkvtoolnix.git + +Now change to the MKVToolNix directory with `cd mkvtoolnix` and run +`./autogen.sh` which will generate the "configure" script. You need +the GNU "autoconf" utility for this step. + +### 2.4.2. Configuration and compilation + +If you have run `make install` for both libraries, then `configure` +should automatically find the libraries' position. Otherwise you need +to tell `configure` where the libEBML and libMatroska include and +library files are: + + ./configure \ + --with-extra-includes=/where/i/put/libebml\;/where/i/put/libmatroska \ + --with-extra-libs=/where/i/put/libebml/make/linux\;/where/i/put/libmatroska/make/linux + +Now run `rake` and, as "root", `rake install`. + +### 2.4.3. If things go wrong + +By default the commands executed by the build system aren't +output. You can change that by adding `V=1` as an argument to the +`rake` command. + +If `rake` executes too many processes at once, then you've stumbled +across a known bug in `rake`. In that case you should install the +`drake` Ruby gem and use the command `drake` instead of +`rake`. `drake` supports parallelism properly and doesn't try to +execute all jobs at once. + +## 2.5. Notes for compilation on (Open)Solaris + +You can compile MKVToolNix with Sun's sunstudio compiler, but you need +additional options for `configure`: + + ./configure --prefix=/usr \ + CXX="/opt/sunstudio12.1/bin/CC -library=stlport4" \ + CXXFLAGS="-D_POSIX_PTHREAD_SEMANTICS" \ + --with-extra-includes=/where/i/put/libebml\;/where/i/put/libmatroska \ + --with-extra-libs=/where/i/put/libebml/make/linux\;/where/i/put/libmatroska/make/linux + +## 2.6. Unit tests + +Building and running unit tests is completely optional. If you want to +do this, you have to follow these steps: + +1. Download the "googletest" framework from + https://github.com/google/googletest/ (at the time of writing the + file to download was "googletest-release-1.8.0.tar.gz") + +2. Extract the archive somewhere and create a symbolic link to its + `googletest-release-1.8.0/googletest` sub-directory + inside MKVToolNix' `lib` directory and call it `gtest`, e.g. like this: + + `ln -s /path/to/googletest-release-1.8.0/googletest lib/gtest` + +3. Configure MKVToolNix normally. + +4. Build the unit test executable and run it with + + rake tests:run_unit + + +# 3. Reporting bugs & getting support + +# 3.1. Reporting bugs + +If you're sure you've found a bug — e.g. if one of my programs crashes +with an obscur error message, or if the resulting file is missing part +of the original data, then by all means submit a bug report. + +I use [GitLab's issue system](https://gitlab.com/mbunkus/mkvtoolnix/issues) +as my bug database. You can submit your bug reports there. Please be as +verbose as possible — e.g. include the command line, if you use Windows +or Linux etc.pp. + +If at all possible, please include sample files as well so that I can +reproduce the issue. If they are larger than 1 MB, please upload +them somewhere and post a link in the issue. You can also upload them +to my FTP server. Details on how to connect can be found in the +[MKVToolNix FAQ](https://gitlab.com/mbunkus/mkvtoolnix/wikis/FTP-server). + +# 3.2. Getting support + +The issue tracker above is not meant for general support which you can +find in the following places: + +* The [MKVToolNix sub-Reddit](https://www.reddit.com/r/mkvtoolnix) is + suitable for all kinds of questions. +* The MKVToolNix thread on [Doom9's + forum](http://forum.doom9.org/showthread.php?t=155732) is more + suited for in-depth technical questions. +* There's also the IRC channel `#matroska` on the [Freenode IRC + network](https://freenode.net/) where we hang out. The main + MKVToolNix author Moritz Bunkus is known as "mosu" there. + + +# 4. Test suite and continuous integration tests + +MKVToolNix contains a lot of test cases in order to detect regressions +before they're released. Regressions include both compilation issues +as well as changes from expected program behavior. + +As mentioned in section 2.6., MKVToolNix comes with a set of unit +tests based on the Google Test library in the `tests/unit` +sub-directory that you can run yourself. These cover only a small +amount of code, and any effort to extend them would be most welcome. + +A second test suite exists that targets the program behavior, e.g. the +output generated by mkvmerge when specific options are used with +specific input files. These are the test cases in the `tests` +directory itself. Unfortunately the files they run on often contain +copyrighted material that I cannot distribute. Therefore you cannot +run them yourself. + +A third pillar of the testing effort is the +[continuous integration tests](https://buildbot.mkvtoolnix.download/) +run on a Buildbot instance. These are run automatically for each +commit made to the git repository. The tests include: + + * building of all the packages for Linux distributions that I + normally provide for download myself in both 32-bit and 64-bit + variants + * building of the Windows installer and portable packages in both + 32-bit and 64-bit variants + * building with both g++ and clang++ + * building and running the unit tests + * building and running the test file test suite + * building with all optional features disabled + +# 5. Code of Conduct + +Please note that this project is released with a +[Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project +you agree to abide by its terms. + +# 6. Included third-party components and their licenses + +MKVToolNix includes and uses the following libraries & artwork: + +## 6.1. avilib + +Reading and writing AVI files. Originally part of the `transcode` +package. + + * Copyright: 1999 Rainer Johanni <Rainer@Johanni.de> + * License: GNU General Public License v2 or later + * URL: the `transcode` project doesn't seem to have a home page anymore + * Corresponding files: `lib/avilib-0.6.10/*` + +## 6.2. libEBML + +A C++ library to parse EBML files + + * Copyright: 2002-2021 Steve Lhomme et. al. + * License: GNU Lesser General Public License v2.1 or later (see `doc/licenses/LGPL-2.1.txt`) + * URL: http://www.matroska.org/ + * Corresponding files: `lib/libebml/*` + +## 6.3. libMatroska + +A C++ library to parse Matroska files + + * Copyright: 2002-2020 Steve Lhomme et. al. + * License: GNU Lesser General Public License v2.1 or later (see `doc/licenses/LGPL-2.1.txt`) + * URL: http://www.matroska.org/ + * Corresponding files: `lib/libmatroska/*` + +## 6.4. librmff + +librmff is short for 'RealMedia file format access library'. It aims +at providing the programmer an easy way to read and write RealMedia +files. + + * Copyright: Moritz Bunkus + * License: GNU Lesser General Public License v2.1 or later (see `doc/licenses/LGPL-2.1.txt`) + * URL: https://www.bunkus.org/videotools/librmff/index.html + * Corresponding files: `lib/librmff/*` + +## 6.5. nlohmann's JSON + +JSON for Modern C++ + + * Copyright: 2013-2021 Niels Lohmann + * License: MIT (see `doc/licenses/nlohmann-json-MIT.txt`) + * URL: https://github.com/nlohmann/json + * Corresponding files: `lib/nlohmann-json/*` + +## 6.6. pugixml + +An XML processing library + + * Copyright: 2006–2020 by Arseny Kapoulkine <arseny.kapoulkine@gmail.com> + * License: MIT (see `doc/licenses/pugixml-MIT.txt`) + * URL: https://pugixml.org/ + * Corresponding files: `lib/pugixml/*` + +## 6.7. utf8-cpp + +UTF-8 with C++ in a Portable Way + + * Copyright: 2006-2021 Nemanja Trifunovic + * License: Boost Software License 1.0 (see `doc/licenses/Boost-1.0.txt`) + * URL: https://github.com/nemtrif/utfcpp/ + * Corresponding files: `lib/utf8-cpp/*` + +## 6.8. Oxygen icons and sound files + +A lot of the icons included in this package originate from the Oxygen +Project. These include all files in the `share/icons/oxygen` +sub-directory. + +All of the sound files in the `share/sounds` sub-directory originate +from the Oxygen project. + + * License: GNU Lesser General Public License v3 (see `doc/licenses/LGPL-3.0.txt`) + * URL: https://techbase.kde.org/Projects/Oxygen + * Corresponding files: + * `share/icons/oxygen/*` + * `share/sounds/*` + +## 6.9. MKVToolNix icons + + * Copyright: + * 2011 Alexandr Grigorcea <cahr.gr@gmail.com> + * 2012 Eduard Geier <edu.g@online.de> + * 2012 Ben Humpert <ben@an3k.de> + * License: Creative Commons Attribution 3.0 Unported (CC BY 3.0) (see `doc/licenses/CC-BY-3.0.txt`) + * Corresponding files: `share/icons/*/mkv*` + +## 6.10. QtWaitingSpinner + +A highly configurable, custom Qt widget for showing "waiting" or +"loading" spinner icons in Qt applications + + * Copyright: + * 2012–2014 by Alexander Turkin + * 2014 by William Hallatt + * 2015 by Jacob Dawid + * License: MIT (see `doc/licenses/QtWaitingSpinner-MIT.txt`) + * URL: https://github.com/snowwlex/QtWaitingSpinner + * Corresponding files: `src/mkvtoolnix-gui/util/waiting_spinning_widget.{h,cpp}` + +## 6.11. Fancy tab widget + +A beefed-up tab widget class for Qt extracted from the Qt Creator project + + * Copyright: 2011 Nokia Corporation and/or its subsidiary(-ies). + * License: GNU General Public License v2 (see `COPYING`) + * Corresponding files: `src/mkvtoolnix-gui/util/fancy_tab_widget.{h,cpp}` + +## 6.12. fmt + +Small, safe and fast formatting library + + * Copyright: 2012–present by Victor Zverovich + * License: BSD (see `doc/licenses/fmt-BSD.txt`) + * URL: https://fmt.dev/latest/ + * Corresponding files: `lib/fmt/*` + +## 6.13. QgsCollapsibleGroupBox + +A groupbox that collapses/expands when toggled. Extracted from the QGIS project. + + * Copyright: 2012–present by Etienne Tourigny + * License: GNU General Public License v2 or later (see `COPYING`) + * URL: https://github.com/qgis/QGIS + * Corresponding files: `src/mkvtoolnix-gui/util/qgs_collapsible_group_box.{h,cpp}` diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..2be7ccb7245a619706c9f01383e795b63a987365 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvextract.html @@ -0,0 +1,1341 @@ +<!DOCTYPE html + PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <title>mkvextract -- извличане на медийни пътечки (tracks) от Matroska файлове в други файлове + + + +
mkvextract -- извличане на медийни пътечки (tracks) от Matroska(tm) файлове в други файлове +
+
+ +
+

1. Резюме

+ + +
mkvextract {source-filename} {mode1} options extraction-spec1 mode2 options extraction-spec2 … +
+ +

2. Описание

+ + +

+ Тази програма извлича отделни части от даден Matroska(tm) файл в други полезни + формати. Първият аргумент е името на файла източник, който задължително + трябва да е Matroska(tm) файл. + +

+ + +

+ All other arguments either switch to a certain extraction mode, change + options for the currently active mode or specify what to extract into which + file. Multiple modes can be used in the same invocation of mkvextract + allowing the extraction of multiple things in a single pass. Most options + can only be used in certain modes with a few options applying to all modes. + +

+ + +

+ Към момента се поддържа извличането на медийни пътечки (tracks), + тагове, прикачени файлове, епизоди (chapters), CUE sheets, времеви клейма + (timestamps) и cues. + +

+ + +

2.1. Общи опции

+ + + +

+ Следващите опции са налични във всички режими и са описани само веднъж в + тази секция. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ Sets the parse mode to 'full'. The default mode does not parse the whole + file but uses the meta seek elements for locating the required elements of a + source file. In 99% of all cases this is enough. But for files that do not + contain meta seek elements or which are damaged the user might have to use + this mode. A full scan of a file can take a couple of minutes while a fast + scan only takes seconds. + +

+ +
--command-line-charset + набор-от-символи + +

+ Sets the character set to convert strings given on the command line from. It + defaults to the character set given by system's current locale. + +

+ +
--output-charset набор-от-символи + +

+ Sets the character set to which strings are converted that are to be + output. It defaults to the character set given by system's current locale. + +

+ +
-r, --redirect-output име на + файла + +

+ Writes all messages to the file file-name instead of + to the console. While this can be done easily with output redirection there + are cases in which this option is needed: when the terminal reinterprets the + output before writing it to a file. The character set set with --output-charset + is honored. + +

+ +
--flush-on-close + +

+ Tells the program to flush all data cached in memory to storage when closing + files opened for writing. This can be used to prevent data loss on power + outages or to circumvent certain problems in the operating system or + drivers. The downside is that multiplexing will take longer as mkvmerge + will wait until all data has been written to the storage before exiting. + See issues #2469 and #2480 on the MKVToolNix bug tracker for in-depth + discussions on the pros and cons. + +

+ +
--ui-language код + +

+ Forces the translations for the language code to be + used (e.g. 'de_DE' for the German + translations). Entering 'list' as the + code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Казва на програмата да прекрати работа непосредствено след появата на + първото предупреждение. Изходният код на програмата ще бъде 1. + +

+ +
--debug тема + +

+ Включи дебъгването за конкретна функция. Тази опция е полезна само за + разработчици. + +

+ +
--engage функция + +

+ Включване на експериментални функции. Списък с наличните функции може да + бъде поискан с mkvextract --engage list. По принцип тези + функции не са предназначени за използване при нормални обстоятелства. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that + can tell a controlling GUI what's happening. These messages follow the + format '#GUI#message'. The message may be followed by + key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the + messages nor the keys are ever translated and always output in English. + +

+ +
-v, --verbose + +

+ Be verbose and show all the important Matroska(tm) elements as they're read. + +

+ +
-h, --help + +

+ Покажи информацията за употребата и излез. + +

+ +
-V, --version + +

+ Покажи информация за версията и излез. + +

+ +
@файл-с-опции.json + +

+ Reads additional command line arguments from the file + options-file. For a full explanation on the supported + formats for such files see the section called "Option files" in the + mkvmerge(1) man page. + +

+ +
+ + + +

2.2. Режим за извличане на медийни пътечки (tracks)

+ + + +

+ Синтаксис: mkvextract source-filename + tracks [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + +

+ The following command line options are available for each track in the + 'tracks' extraction mode. They have to appear in front + of the track specification (see below) they should be applied to. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c набор-от-символи + +

+ Sets the character set to convert the next text subtitle track to. Only + valid if the next track ID targets a text subtitle track. It defaults to + UTF-8. + +

+ +
--blockadd ниво + +

+ Keep only the BlockAdditions up to this level. The default is to keep all + levels. This option only affects certain kinds of codecs like WAVPACK4. + +

+ +
--cuesheet + +

+ Causes mkvextract(1) to extract a CUE sheet from the chapter + information and tag data for the following track into a file whose name is + the track's output name with '.cue' appended to it. + +

+ +
--raw + +

+ Extracts the raw data into a file without any container data around it. + Unlike the --fullraw + flag this flag does not cause the contents of the + CodecPrivate element to be written to the file. This + mode works with all CodecIDs, even the ones that + mkvextract(1) doesn't support otherwise, but the resulting files might not be + usable. + +

+ +
--fullraw + +

+ Extracts the raw data into a file without any container data around it. The + contents of the CodecPrivate element will be written + to the file first if the track contains such a header element. This mode + works with all CodecIDs, even the ones that + mkvextract(1) doesn't support otherwise, but the resulting files might not be + usable. + +

+ +
TID:outname + +

+ Causes extraction of the track with the ID TID into + the file outname if such a track exists in the source + file. This option can be given multiple times. The track IDs are the same as + the ones output by mkvmerge(1)'s --identify option. + +

+ + +

+ Each output name should be used only once. The exception are RealAudio and + RealVideo tracks. If you use the same name for different tracks then those + tracks will be saved in the same file. Example: + +

+ +
$ mkvextract input.mkv tracks 0:video.h264 2:output-two-vobsub-tracks.idx 3:output-two-vobsub-tracks.idx
+
+ + + +

2.3. Режим за извличане на прикачени файлове

+ + + +

+ Синтаксис: mkvextract source-filename + attachments + [options] + AID1:outname1 + [AID2:outname2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:outname + +

+ Causes extraction of the attachment with the ID AID + into the file outname if such an attachment exists in + the source file. If the outname is left empty then + the name of the attachment inside the source Matroska(tm) file is used + instead. This option can be given multiple times. The attachment IDs are + the same as the ones output by mkvmerge(1)'s --identify + option. + +

+ +
+ + + +

2.4. Режим за извличане на епизоди (chapters)

+ + + +

+ Синтаксис: mkvextract source-filename + chapters + [options] + output-filename.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ Exports the chapter information in the simple format used in the + OGM tools (CHAPTER01=..., CHAPTER01NAME=...). In this mode + some information has to be discarded. Default is to output the chapters in + XML format. + +

+ +
--simple-language language + +

+ If the simple format is enabled then mkvextract(1) will only output a single + entry for each chapter atom encountered even if a chapter atom contains more + than one chapter name. By default mkvextract(1) will use the first chapter + name found for each atom regardless of its language. + +

+ + +

+ Using this option allows the user to determine which chapter names are + output if atoms contain more than one chapter name. The + language parameter must be an ISO 639-1 or ISO 639-2 + code. + +

+ +
+ + +

+ The chapters are written to specified output file. By default the XML + format understood by mkvmerge(1) is used. If no chapters are found in the + file, the output file is not created. + +

+ + + +

2.5. Режим за извличане на тагове

+ + + +

+ Синтаксис: mkvextract source-filename + tags [options] + output-filename.xml + +

+ + +

+ The tags are written to specified output file in the XML format understood + by mkvmerge(1). If no tags are found in the file, the output file is not + created. + +

+ + + +

2.6. Режим за извличане не cue sheet

+ + + +

+ Синтаксис: mkvextract source-filename + cuesheet + [options] + output-filename.cue + +

+ + +

+ The cue sheet is written to specified output file. If no chapters or tags + are found in the file, the output file is not created. + +

+ + + +

2.7. Режим за извличане на времево клеймо

+ + + +

+ Синтаксис: mkvextract source-filename + timestamps_v2 + [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:outname + +

+ Causes extraction of the timestamps for the track with the ID + TID into the file outname if + such a track exists in the source file. This option can be given multiple + times. The track IDs are the same as the ones output by mkvmerge(1)'s + --identify option. + +

+ + +

+ Пример: + +

+ +
$ mkvextract input.mkv timestamps_v2 1:ts-track1.txt 2:ts-track2.txt
+
+ + + +

2.8. Режим за извличане на индексиране (cues)

+ + + +

+ Синтаксис: mkvextract source-filename + cues [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:dest-filename + +

+ Causes extraction of the cues for the track with the ID + TID into the file outname if + such a track exists in the source file. This option can be given multiple + times. The track IDs are the same as the ones output by mkvmerge(1)'s + --identify option and not the numbers contained in the + CueTrack element. + +

+ +
+ + +

+ The format output is a simple text format: one line per + CuePoint element with key=value + pairs. If an optional element is not present in a + CuePoint (e.g. CueDuration) + then a dash will be output as the value. + +

+ + +

+ Пример: + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

Възможните ключове са:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
времево клеймо + +

The cue point's timestamp with nanosecond precision. The format is + HH:MM:SS.nnnnnnnnn. This element is always set. +

+ +
времетраене + +

The cue point's duration with nanosecond precision. The format is + HH:MM:SS.nnnnnnnnn. +

+ +
cluster_position + +

The absolute position in bytes inside the Matroska(tm) file where the cluster + containing the referenced element starts. +

+ + +
+

Note:

+ +

Inside the Matroska(tm) file the CueClusterPosition is + relative to the segment's data start offset. The value output by + mkvextract(1)'s cue extraction mode, however, contains that offset already + and is an absolute offset from the beginning of the file. +

+ +
+ +
relative_position + +

The relative position in bytes inside the cluster where the + BlockGroup or SimpleBlock + element the cue point refers to starts. +

+ + +
+

Note:

+ +

Inside the Matroska(tm) file the CueRelativePosition is + relative to the cluster's data start offset. The value output by + mkvextract(1)'s cue extraction mode, however, is relative to the cluster's + ID. The absolute position inside the file can be calculated by adding + cluster_position and + relative_position. +

+ +
+ +
+ + +

+ Пример: + +

+ +
$ mkvextract input.mkv cues 1:cues-track1.txt 2:cues-track2.txt
+ +

3. Примери

+ + + +

+ Едновременно извличане на епизоди (chapters) и тагове в съответните XML + формати: + +

+ +
$ mkvextract movie.mkv chapters movie-chapters.xml tags movie-tags.xml
+ +

+ Едновременно извличане на няколко медийни пътечки (trakcs) и съответните им + времеви клейма (timestamps): + +

+ +
$ mkvextract "Another Movie.mkv" tracks 0:video.h265 "1:main audio.aac" "2:director's comments.aac" timestamps_v2 "0:timestamps video.txt" "1:timestamps main audio.txt" "2:timestamps director's comments.txt"
+ +

+ Extracting chapters in the Ogg/OGM format and re-encoding a text subtitle + track to another character set: + +

+ +
$ mkvextract "My Movie.mkv" chapters --simple "My Chapters.txt" tracks -c MS-ANSI "2:My Subtitles.srt"
+

4. Текстови файлове и конвертирания на набори от символи

+ + + +

+ For an in-depth discussion about how all tools in the MKVToolNix suite + handle character set conversions, input/output encoding, command line + encoding and console encoding please see the identically-named section in + the mkvmerge(1) man page. + +

+ +

5. Файлови разширения на изходните файлове

+ + + +

+ Какво ще е файловото разширение се определя от типа на медийната пътечка, а + не от разширението, използвано в името на изходния файл. Към момента се + поддържат следните типове медийни-писни (tracks): + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ Всички AAC файлове ще бъдат комбинирани в + AAC файл с ADTS headers преди всеки + пакет. ADTS headers няма да съдържат остарялото акцентиращо + поле. + +

+ +
A_AC3, A_EAC3 + +

+ Тези ще бъдат извлечени като сурови AC-3 файлове. + +

+ +
A_ALAC + +

+ Медийните пътечки от тип „ALAC“ се записват в + CAF файлове. + +

+ +
A_DTS + +

+ Тези ще бъдат извлечени като сурови DTS файлове. + +

+ +
A_FLAC + +

+ Медийните пътечки от тип „FLAC“ се записват като сурови + FLAC файлове. + +

+ +
A_MPEG/L2 + +

+ Стриймовете от тип „MPEG-1 Audio Layer II“ ще бъдат извлечени като сурови + MP2 файлове. + +

+ +
A_MPEG/L3 + +

+ Тези ще бъдат извлечени като сурови MP3 файлове. + +

+ +
A_OPUS + +

+ Медийните пътечки от тип „Opus(tm)“ се записват в + OggOpus(tm) файлове. + +

+ +
A_PCM/INT/LIT, A_PCM/INT/BIG + +

+ Необработените PCM аудиоданни ще бъдат записани в + WAV файл. Междувременно целочислените big-endian данни ще + бъдат конвертирани в little-endian данни. + +

+ +
A_REAL/* + +

+ Медийните пътечки от тип „RealAudio(tm)“ се записват + в RealMedia(tm) файлове. + +

+ +
A_TRUEHD, A_MLP + +

+ Тези ще бъдат извлечени като сурови + TrueHD/MLP файлове. + +

+ +
A_TTA1 + +

+ TrueAudio(tm) tracks are written to + TTA files. Please note that due to Matroska(tm)'s limited + timestamp precision the extracted file's header will be different regarding + two fields: data_length (the total number of samples in + the file) and the CRC. + +

+ +
A_VORBIS + +

+ Vorbis аудио ще бъде записано в OggVorbis(tm) файл. + +

+ +
A_WAVPACK4 + +

+ WavPack(tm) пътечки се записват в WV + файлове. + +

+ +
S_HDMV/PGS + +

+ PGS субтитрите ще бъдат записани като SUP + файлове. + +

+ +
S_HDMV/TEXTST + +

+ TextST субтитрите ще бъдат записани в специален файлов + формат, измислен специално за mkvmerge(1) и mkvextract(1). + +

+ +
S_KATE + +

+ Kate(tm) стриймовете ще бъдат записани в + Ogg(tm) контейнер. + +

+ +
S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS + +

+ SSA и ASS текстови субтитри ще бъдат + записани съответно като SSA/ASS файлове. + +

+ +
S_TEXT/UTF8, S_TEXT/ASCII + +

+ Обикновените текстови субтитри ще бъдат записани като SRT + файлове. + +

+ +
S_VOBSUB + +

+ VobSub(tm) субтитрите ще бъдат записани като + SUB файлове заедно със съответните индексни файлове, от + рода на IDX. + +

+ +
S_TEXT/USF + +

+ USF текстовите субтитри ще бъдат записани като + USF файлове. + +

+ +
S_TEXT/WEBVTT + +

+ WebVTT текстовите субтитри ще бъдат записани като + WebVTT файлове. + +

+ +
V_MPEG1, V_MPEG2 + +

+ MPEG-1 и MPEG-2 видеопътечките ще бъдат + записани като MPEG elementary streams. + +

+ +
V_MPEG4/ISO/AVC + +

+ H.264 / AVC video tracks are written to + H.264 elementary streams which can be processed further + with e.g. MP4Box(tm) from the + GPAC(tm) package. + +

+ +
V_MPEG4/ISO/HEVC + +

+ H.265 / HEVC video tracks are written to + H.265 elementary streams which can be processed further + with e.g. MP4Box(tm) from the + GPAC(tm) package. + +

+ +
V_MS/VFW/FOURCC + +

+ Fixed FPS video tracks with this + CodecID are written to AVI files. + +

+ +
V_REAL/* + +

+ RealVideo(tm) пътечките се записват като + RealMedia(tm) файлове. + +

+ +
V_THEORA + +

+ Theora(tm) стриймовете биват записани в + Ogg(tm) контейнер + +

+ +
V_VP8, V_VP9 + +

+ VP8 / VP9 пътечките се записват като + IVF файлове. + +

+ +
Тагове + +

+ Таговете се конвертират в XML формат. Форматът е същият, който mkvmerge(1) + поддържа за четене на тагове. + +

+ +
Прикачени файлове + +

+ Прикачените файлове се извличат както са си. Не се случва никакво + преформатиране или от сорта. + +

+ +
Епизоди (chapters) + +

+ Chapters are converted to a XML format. This format is the same that + mkvmerge(1) supports for reading chapters. Alternatively a stripped-down + version can be output in the simple OGM style format. + +

+ +
Времеви клейма (timestamps) + +

+ Timestamps are first sorted and then output as a timestamp v2 format + compliant file ready to be fed to mkvmerge(1). The extraction to other + formats (v1, v3 and v4) is not supported. + +

+ +
+ +

6. Кодове за изход

+ + + +

+ mkvextract(1) завършва с един от следните три изходни кода: + +

+ + +
    + +
  • + +

    + 0 -- Този изходен код означава, че извличането е + завършило успешно. + +

    + +
  • + + +
  • + +

    + 1 -- In this case mkvextract(1) has output at least one + warning, but extraction did continue. A warning is prefixed with the text + 'Warning:'. Depending on the issues involved the + resulting files might be ok or not. The user is urged to check both the + warning and the resulting files. + +

    + +
  • + + +
  • + +

    + 2 -- This exit code is used after an error occurred. + mkvextract(1) aborts right after outputting the error message. Error + messages range from wrong command line arguments over read/write errors to + broken files. + +

    + +
  • + +
+ +

7. Променливи на средата

+ + + +

+ mkvextract(1) използва променливите по подразбиране, определящи езиковата + променлива на системата (например LANG и от групата + LC_*). Допълнителни променливи: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG и + кратката форма MTX_DEBUG + +

Съдържанието се третира като все едно че е минато през --debug + опцията. +

+ +
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE и + кратката форма MTX_ENGAGE + +

Съдържанието се третира като все едно че е минато през --engage + опцията. +

+ +
+ +

8. Виж също

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. Уебсайт

+ + +

+ Най-новата версия винаги може да бъде намерена на началната страница на MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..6563b7e5222268c0e9abc6eab19ce7b6dd7c98da --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvinfo.html @@ -0,0 +1,514 @@ + + + + + mkvinfo -- Показва информация за елементите в Matroska файловете + + + +
mkvinfo -- Показва информация за елементите в Matroska(tm) файловете +
+
+ +
+

1. Резюме

+ + +
mkvinfo опции {име-на-файл-източник} +
+ +

2. Описание

+ + +

+ Тази програма показва списък с всички елементи, съдържащи се в Matroska(tm) + файл. Показаните данни може да бъдат ограничени до списък с медийни пътечки + във файла, включващ информация за използваните кодеци. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ By default mkvinfo(1) stops when it encounters the first cluster. + Additionally it doesn't show certain often occurring elements. With this + option mkvinfo(1) will continue processing regardless of the verbosity level + and show all elements. + +

+ +
-c, --checksums + +

+ Изчислява и показва контролните Adler-32 суми за всеки + кадър. Полезно единствено при дебъгване. + +

+ +
-o, --continue + +

+ By default mkvinfo(1) stops when it encounters the first cluster. With this + option mkvinfo(1) will continue processing regardless of the verbosity level. + +

+ +
-p, --hex-positions + +

+ Show the positions of all elements in hexadecimal regardless of the + verbosity level. + +

+ +
-P, --positions + +

+ Show the positions of all elements in decimal regardless of the verbosity + level. + +

+ +
-s, --summary + +

+ Покажи само кратко резюме на намереното от mkvinfo(1), а не всеки елемент. + +

+ +
-t, --track-info + +

+ Show statistics for each track in verbose mode. Also sets verbosity to 1 if + it was at level 0 before. + +

+ +
-x, --hexdump + +

+ Покажи първите 16 байта на всеки кадър в шестнадесетичен вид. + +

+ +
-X, --full-hexdump + +

+ Покажи всички байтове на всеки кадър в шестнадесетичен вид. + +

+ +
-z, --size + +

+ Покажи размера на всеки елемент, включително заглавието му. + +

+ +
--command-line-charset + набор-от-символи + +

+ Sets the character set to convert strings given on the command line from. It + defaults to the character set given by system's current locale. + +

+ +
--output-charset набор-от-символи + +

+ Sets the character set to which strings are converted that are to be + output. It defaults to the character set given by system's current locale. + +

+ +
-r, --redirect-output име на + файла + +

+ Writes all messages to the file file-name instead of + to the console. While this can be done easily with output redirection there + are cases in which this option is needed: when the terminal reinterprets the + output before writing it to a file. The character set set with --output-charset + is honored. + +

+ +
--ui-language код + +

+ Forces the translations for the language code to be + used (e.g. 'de_DE' for the German + translations). Entering 'list' as the + code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Казва на програмата да прекрати работа непосредствено след появата на + първото предупреждение. Изходният код на програмата ще бъде 1. + +

+ +
--debug тема + +

+ Включи дебъгването за конкретна функция. Тази опция е полезна само за + разработчици. + +

+ +
--engage функция + +

+ Включване на експериментални функции. Списък с наличните функции може да + бъде поискан с mkvinfo --engage list. По принцип тези + функции не са предназначени за използване при нормални обстоятелства. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that + can tell a controlling GUI what's happening. These messages follow the + format '#GUI#message'. The message may be followed by + key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the + messages nor the keys are ever translated and always output in English. + +

+ +
-v, --verbose + +

+ Бъди по-многословен. Виж раздела за нива на многословие за описание на + това каква информация на кое ниво излиза. + +

+ +
-h, --help + +

+ Покажи информацията за употребата и излез. + +

+ +
-V, --version + +

+ Покажи информация за версията и излез. + +

+ +
@файл-с-опции.json + +

+ Reads additional command line arguments from the file + options-file. For a full explanation on the supported + formats for such files see the section called "Option files" in the + mkvmerge(1) man page. + +

+ +
+ +

3. Нива на многословие

+ + + +

+ The -v + option can be used to increase mkvinfo(1)'s verbosity level and print more + information about the current file. + +

+ + +

+ At level 0 mkvinfo(1) will print only the track headers it finds and their + types. mkvinfo(1) will exit as soon as the headers are parsed completely + (more technical: as soon as the first cluster is encountered). In this level + the seek head entries and the cues will not be displayed -- even if they're + located in front of the track information. + +

+ + +

+ At level 1 mkvinfo(1) will also print all Matroska(tm) elements encountered for + the complete file but the seek head entries and the cue entries. If the + summary mode is enabled then mkvinfo(1) will output the frame position as + well. + +

+ + +

+ Същото нещо може да се постигне и с опцията --continue. + +

+ + +

+ At level 2 mkvinfo(1) will also print the seek head entries, the cue entries + and the file position at which each Matroska(tm) element can be found at. + +

+ + +

+ Същото нещо може да се постигне и с опциите --all + --positions. + +

+ + +

+ At level 3 and above mkvinfo(1) will print some information that is not + directly connected to a Matroska(tm) element. All other elements only print + stuff about the elements that were just found. Level 3 adds meta information + to ease debugging (read: it's intended for developers only). All lines + written by level 3 are enclosed in square brackets to make filtering them + out easy. + +

+ +

4. Текстови файлове и конвертирания на набори от символи

+ + + +

+ For an in-depth discussion about how all tools in the MKVToolNix suite + handle character set conversions, input/output encoding, command line + encoding and console encoding please see the identically-named section in + the mkvmerge(1) man page. + +

+ +

5. Кодове за изход

+ + + +

+ mkvinfo(1) завършва с един от следните три изходни кода: + +

+ + +
    + +
  • + +

    + 0 -- Този код за изход означава, че заданието е + завършило успешно. + +

    + +
  • + + +
  • + +

    + 1 -- In this case mkvinfo(1) has output at least one + warning, but the run did continue. A warning is prefixed with the text + 'Warning:'. + +

    + +
  • + + +
  • + +

    + 2 -- This exit code is used after an error occurred. + mkvinfo(1) aborts right after outputting the error message. Error messages + range from wrong command line arguments over read/write errors to broken + files. + +

    + +
  • + +
+ +

6. Променливи на средата

+ + + +

+ mkvinfo(1) използва променливите по подразбиране, определящи езиковата + променлива на системата (например LANG и от групата + LC_*). Допълнителни променливи: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUG, MKVTOOLNIX_DEBUG и + кратката форма MTX_DEBUG + +

Съдържанието се третира като все едно че е минато през --debug опцията. +

+ +
MKVINFO_ENGAGE, MKVTOOLNIX_ENGAGE и + кратката форма MTX_ENGAGE + +

Съдържанието се третира като все едно че е минато през --engage + опцията. +

+ +
+ +

7. Виж също

+ + +

+ mkvmerge(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. Уебсайт

+ + +

+ Най-новата версия винаги може да бъде намерена на началната страница на MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..ce9954e7112f843d8cbae2383e011cbd254649ae --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvmerge.html @@ -0,0 +1,5239 @@ + + + + + mkvmerge -- Обединяване на мултимедийни потоци в Matroska файл + + + +
mkvmerge -- Обединяване на мултимедийни потоци в Matroska(tm) файл +
+
+ +
+

1. Резюме

+ + +
mkvmerge глобални опции {-o + out} опции1 {файл1} опции2 {файл2} @файл-с-опции.json +
+ +

2. Описание

+ + +

+ Тази програма приема входни данни от няколко медийни файла и обединява + техните потоци (всички или само избраните) в Matroska(tm) файл; виж уебсайта на Matroska. + +

+ + +
+

Important:

+ +

+ Редът на параметрите в командния ред е от съществено значение. Моля, + прочетете раздела „Ред на + опциите“, ако нямате опит с програмата. + +

+ +
+ + +

2.1. Глобални опции

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

Увеличаване на многословието (verbosity-то).

+ +
-q, --quiet + +

Заглушаване на изхода за състояние.

+ +
-o, --output име на + файла + +

Записване във файла име на файла. Ако се използва + разделяне, тогава този параметър се третира по малко по-различен начин. Виж + обяснението на опцията --split за + повече информация. +

+ +
-w, --webm + +

Създаване на съвместим с WebM стандарта файл. Тази опция автоматично бива + включена, когато разширението на целевия файл е „webm“. Този режим налага + някои ограничения. Единствените позволени кодеци за видео са VP8 и VP9, за + аудио – Opus и Vorbis. Атрибутът „DocType header“ бива променен на „webm“. + +

+ + +

+ За епизоди и тагове само някои елементи са разрешени. mkvmerge(1) автоматично + ще премахне всички неразрешени от спецификацията елементи. + +

+ +
--title заглавие + +

Задава общото заглавие на изходния файл, това може да е например името на + филма. +

+ +
--default-language езиков-код + +

Задава кода на езика по подразбиране, който ще се използва за пътечки, за + които не е зададен език с опцията --language и + за които в оригиналния контейнер не е посочен език. +

+ + +

Езиковият код по подразбиране е „und“, което означава + „undetermined“ (неопределен). +

+ +
+ + + +

2.2. Боравене с информация за сегмента (глобални опции)

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo име-на-файла.xml + +

+ Read segment information from an XML file. This file can + contain the segment family UID, segment + UID, previous and next segment UID + elements. An example file and a DTD are included in the + MKVToolNix distribution. + +

+ + +

+ Виж секцията за XML файлове с + информация за сегмента по-долу за повече информация. + +

+ +
--segment-uid SID1,SID2,... + +

+ Sets the segment UIDs to use. This is a comma-separated list of 128-bit + segment UIDs in the usual UID form: hex numbers with or without the + "0x" prefix, with or without spaces, exactly 32 digits. + +

+ + +

+ If SID starts with = then its rest is interpreted as the name of a Matroska + file whose segment UID is read and used. + +

+ + +

+ Each file created contains one segment, and each segment has one segment + UID. If more segment UIDs are specified than segments are created then the + surplus UIDs are ignored. If fewer UIDs are specified than segments are + created then random UIDs will be created for them. + +

+ +
+ + + +

2.3. Боравене с епизоди и тагове (глобални опции)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language езиков-код + +

+ Sets the ISO 639-2 language code that is written for each chapter entry. + Defaults to 'eng'. See the section about chapters below for details. + +

+ + +

+ This option can be used both for simple chapter files and for source files + that contain chapters but no information about the chapters' language, + e.g. MP4 and OGM files. + +

+ + +

+ Езикът, зададен с тази опция, също се използва и при генериране на епизоди с + опцията --generate-chapters. + +

+ +
--chapter-charset набор-от-символи + +

+ Sets the character set that is used for the conversion to UTF-8 for simple + chapter files. See the section about text files and character + sets for an explanation how mkvmerge(1) converts between character + sets. + +

+ + +

+ This switch does also apply to chapters that are copied from certain + container types, e.g. Ogg/OGM and MP4 files. See the section about chapters + below for details. + +

+ +
--chapter-sync + d[,o[/p]] + +

+ Adjust the timestamps of the chapters in the following source file by + d ms. Alternatively you can use the + --sync option with the special track ID + -2 (see section special track IDs). + +

+ + +

+ o/p: adjust the timestamps by + o/p to fix linear + drifts. p defaults to 1 if omitted. Both + o and p can be floating point + numbers. + +

+ + +

+ По подразбиране: без ръчна корекция на синхронизацията (което съответства на + d = 0 и + o/p = + 1.0). + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--generate-chapters режим + +

+ mkvmerge(1) може автоматично да създава епизоди. Към момента се поддържат + следните два режима: + +

+ + +
    + +
  • + +

    + „when-appending“ – Този режим създава епизод в началото и + по един епизод за всеки разширяващ файл. + +

    + + +

    + Този режим работи също и при режимите за разделяне + „parts:“ и „parts-frames:“. При тези + режими един епизод (chapter) ще бъде генериран за всяко следващо разширение + от диапазон с времеви клейма (тези, преди чиито времеви клейма има + „+“). + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1) requires a video or an audio track to be present in order to be + able to determine when a new file is appended. If one or more video tracks + are muxed the first one is used. Otherwise the first audio track is used. + +

    + +
    + +
  • + + +
  • + +

    + 'interval:time-spec' – This mode + creates one chapter at fixed intervals given by + time-spec. The format is either the form + HH:MM:SS.nnnnnnnnn or a number followed by one of the + units 's', 'ms' or + 'us'. + +

    + + +

    + Пример: --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ The names for the new chapters are controlled by the option --generate-chapters-name-template. + The language is set with --chapter-language + which must occur before --generate-chapters. + +

+ +
--generate-chapters-name-template + шаблон + +

+ This sets the name template for chapter names generated by the option --generate-chapters. + If the option is not used then default 'Chapter + <NUM:2>' will be used. + +

+ + +

+ There are several variables that can be used in the template that are + replaced by their actual values when a chapter is generated. The string + '<NUM>' will be replaced by the chapter number. The + string '<START>' will be replaced by the chapter's + start timestamp. + +

+ + +

+ The strings '<FILE_NAME>' and + '<FILE_NAME_WITH_EXT>' are only filled when + generating chapters for appended files. They will be replaced by the + appended file's name without respectively with its extension. Note that + only the file's base name and extension are inserted, not its directory or + drive components. + +

+ + +

+ You can specify a minimum number of places for the chapter number with + '<NUM:places>', + e.g. '<NUM:3>'. The resulting number will be + padded with leading zeroes if the number of places is less than specified. + +

+ + +

+ Може да контролирате формата, използван за началното времево клеймо, със + <START:формат>. Форматът по подразбиране е + „%H:%M:%S“, ако не е посочено друго. Валидни кодове за + формата са: + +

+ + +
    + +
  • + +

    %h – часове +

    + +
  • + +
  • + +

    %H – часове, с водеща нула +

    + +
  • + +
  • + +

    %m – минути +

    + +
  • + +
  • + +

    %M – минути, с водеща нула +

    + +
  • + +
  • + +

    %s – секунди +

    + +
  • + +
  • + +

    %S – секунди, с водеща нула +

    + +
  • + +
  • + +

    %n – наносекунди с девет цифри +

    + +
  • + +
  • + +

    %<1-9>n – наносекунди с до девет цифри (например + три цифри с %3n) +

    + +
  • + +
+ +
--cue-chapter-name-format формат + +

+ mkvmerge(1) supports reading CUE sheets for audio files as + the input for chapters. CUE sheets usually contain the + entries PERFORMER and TITLE for each + index entry. mkvmerge(1) uses these two strings in order to construct the + chapter name. With this option the format used for this name can be set. + +

+ + +

+ If this option is not given then mkvmerge(1) defaults to the format '%p + - %t' (the performer, followed by a space, a dash, another space and + the title). + +

+ + +

+ If the format is given then everything except the following meta characters + is copied as-is, and the meta characters are replaced like this: + +

+ + +
    + +
  • + +

    %p is replaced by the current entry's + PERFORMER string, +

    + +
  • + +
  • + +

    %t is replaced by the current entry's + TITLE string, +

    + +
  • + +
  • + +

    %n is replaced by the current track number and +

    + +
  • + +
  • + +

    %N is replaced by the current track number padded + with a leading zero if it is < 10. +

    + +
  • + +
+ +
--chapters име на файла + +

+ Четене на информация за епизоди от име-на-файла. Виж + секцията за епизоди (chapters) + по-долу за повече информация. + +

+ +
--global-tags име на файла + +

+ Четене на глобални тагове от име-на-файла. Виж + секицята за тагове по-долу за повече + информация. + +

+ +
+ + + +

2.4. Общ контрол на изхода (разширени глобални опции)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order + FID1:TID1,FID2:TID2,... + +

+ This option changes the order in which the tracks for an input file are + created. The argument is a comma separated list of pairs IDs. Each pair + contains first the file ID (FID1) which is simply the + number of the file on the command line starting at 0. The second is a track + ID (TID1) from that file. If some track IDs are + omitted then those tracks are created after the ones given with this option + have been created. + +

+ +
--cluster-length spec + +

+ Limit the number of data blocks or the duration of data in each cluster. The + spec parameter can either be a number + n without a unit or a number d + postfixed with 'ms'. + +

+ + +

+ If no unit is used then mkvmerge(1) will put at most n + data blocks into each cluster. The maximum number of blocks is 65535. + +

+ + +

+ If the number d is postfixed with + 'ms' then mkvmerge(1) puts at most + d milliseconds of data into each cluster. The minimum + for d is '100ms', and the maximum + is '32000ms'. + +

+ + +

+ mkvmerge(1) defaults to putting at most 65535 data blocks and 5000ms of data + into a cluster. + +

+ + +

+ Programs trying to find a certain frame can only seek directly to a cluster + and have to read the whole cluster afterwards. Therefore creating larger + clusters may lead to imprecise or slow seeking. + +

+ +
--clusters-in-meta-seek + +

+ Tells mkvmerge(1) to create a meta seek element at the end of the file + containing all clusters. See also the section about the Matroska file layout. + +

+ +
--timestamp-scale factor + +

+ Forces the timestamp scale factor to factor. Valid + values are in the range + 1000..10000000 or the special + value -1. + +

+ + +

+ Normally mkvmerge(1) will use a value of 1000000 which + means that timestamps and durations will have a precision of 1ms. For files + that will not contain a video track but at least one audio track mkvmerge(1) + will automatically chose a timestamp scale factor so that all timestamps and + durations have a precision of one audio sample. This causes bigger overhead + but allows precise seeking and extraction. + +

+ + +

+ If the special value -1 is used then mkvmerge(1) will + use sample precision even if a video track is present. + +

+ +
--enable-durations + +

+ Write durations for all blocks. This will increase file size and does not + offer any additional value for players at the moment. + +

+ +
--no-cues + +

+ Tells mkvmerge(1) not to create and write the cue data which can be compared + to an index in an AVI. Matroska(tm) files can be played back without the cue + data, but seeking will probably be imprecise and slower. Use this only if + you're really desperate for space or for testing purposes. See also option + --cues + which can be specified for each input file. + +

+ +
--no-date + +

+ By default mkvmerge(1) sets the "date" segment information field to the time + & date when multiplexing started. With this option that field is not + written at all. + +

+ +
--disable-lacing + +

+ Disables lacing for all tracks. This will increase the file's size, + especially if there are many audio tracks. This option is not intended for + everyday use. + +

+ +
--disable-track-statistics-tags + +

+ Normally mkvmerge(1) will write certain tags with statistics for each + track. If such tags are already present then they will be overwritten. The + tags are BPS, DURATION, + NUMBER_OF_BYTES and + NUMBER_OF_FRAMES. + +

+ + +

+ Enabling this option prevents mkvmerge(1) from writing those tags and from + touching any existing tags with same names. + +

+ +
--disable-language-ietf + +

+ Обикновено mkvmerge(1) ще записва новите IETF BCP 47 езикови елементи в + допълнение на старите езикови елементи при header-ите на пътечките, + епизодите и таговете. Ако тази опция се използва, само старите (legacy) + елементи ще бъдат записани. + +

+ +
--normalize-language-ietf режим + +

+ Enables normalizing all IETF BCP 47 language tags to either their canonical + form with mode 'canonical', to their extended language + subtags form with mode 'extlang' or turns it off with + mode 'off'. By default normalization to the canonical + form is applied. + +

+ + +

+ In the canonical form all subtags for which preferred values exist are + replaced by those preferred values. This converts + e.g. 'zh-yue-jyutping' to + 'yue-jyutping' or 'fr-FX' to + 'fr-FR'. + +

+ + +

+ For the extended language subtags form the canonical form is built + first. Afterwards all primary languages for which an extended language + subtag exists are replaced by that extended language subtag and its + prefix. This converts e.g. 'yue-jyutping' back to + 'zh-yue-jyutping' but has no effect on + 'fr-FR' as 'fr' is not an extended + language subtag. + +

+ +
--stop-after-video-ends + +

+ Stops processing after the primary video track ends, discarding any + remaining packets of other tracks. + +

+ +
+ + + +

2.5. Разделяне, свързване, разширяване и залепяне на файлове (още глобални опции)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split specification + +

+ Splits the output file after a given size or a given time. Please note that + tracks can only be split right before a key frame. Therefore the split + point may be a bit off from what the user has specified. + +

+ + +

+ Към момента, mkvmerge(1) поддържа следните режими: + +

+ + +
    + +
  1. + +

    + Разделяне на интервали от размер. + +

    + + +

    + Синтаксис: --split + [size:]d[k|m|g] + +

    + + +

    + Примери: --split size:700m или --split 150000000 + +

    + + +

    + The parameter d may end with 'k', + 'm' or 'g' to indicate that the size + is in KB, MB or GB respectively. Otherwise a size in bytes is assumed. + After the current output file has reached this size limit a new one will be + started. + +

    + + +

    + Префиксът „size:“ може да бъде пропуснат (от съображения + за съвместимост). + +

    + +
  2. + + +
  3. + +

    + Разделяне след продължителност. + +

    + + +

    + Синтаксис: --split + [duration:]ЧЧ:ММ:СС.ннннннннн|ds + +

    + + +

    + Примери: --split duration:00:60:00.000 или --split + 3600s + +

    + + +

    + The parameter must either have the form + HH:MM:SS.nnnnnnnnn for specifying the duration in up + to nano-second precision or be a number d followed by + the letter 's' for the duration in + seconds. HH is the number of hours, + MM the number of minutes, SS + the number of seconds and nnnnnnnnn the number of + nanoseconds. Both the number of hours and the number of nanoseconds can be + omitted. There can be up to nine digits after the decimal point. After the + duration of the contents in the current output has reached this limit a new + output file will be started. + +

    + + +

    + Префиксът „duration:“ може да бъде пропуснат (от + съображения за съвместимост). + +

    + +
  4. + + +
  5. + +

    + Разделяне след специфични времеви клейма. + +

    + + +

    + Синтаксис: --split + timestamps:A[,B[,C...]] + +

    + + +

    + Пример: --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + The parameters A, B, + C etc must all have the same format as the ones used + for the duration (see above). The list of timestamps is separated by + commas. After the input stream has reached the current split point's + timestamp a new file is created. Then the next split point given in this + list is used. + +

    + + +

    + Префиксът „timestamps:“ не трябва да бъде пропуснат. + +

    + +
  6. + + +
  7. + +

    + Запазване частите в посочените времеви диапазони, премахване на останалото. + +

    + + +

    + Синтаксис: --split + parts:начало1-край1[,[+]начало2-край2[,[+]начало3-край3...]] + +

    + + +

    + Примери: +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + Режимът parts казва на mkvmerge(1) да запази определени + диапазони от времеви клейма, премахвайки други. Диапазоните за запазване + трябва да бъдат изброени в списък непосредствено след ключовата дума + parts: и да бъдат разделени със запетайки. Даден диапазон + се състои от начално и крайно времево клеймо в същия формат, който и другите + варианти на --split приемат + (00:01:20 и 80s обозначават едно и + също времево клеймо). + +

    + + +

    + Ако начално времево клеймо бъде пропуснато, тогава по подразбиране се взима + крайното времево клеймо от предходния диапазон. Ако няма предходен диапазон, + тогава по подразбиране се взима началото на файла (виж пример 3). + +

    + + +

    + Ако крайно времево клеймо бъде пропуснато, тогава по подразбиране се взима + края на файловете източници, т.е. mkvmerge(1) запазва всичко до края (виж + пример 3). + +

    + + +

    + Normally each range will be written to a new file. This can be changed so + that consecutive ranges are written to the same file. For that the user has + to prefix the start timestamp with a +. This tells + mkvmerge(1) not to create a new file and instead append the range to the same + file the previous range was written to. Timestamps will be adjusted so that + there will be no gap in the output file even if there was a gap in the two + ranges in the input file. + +

    + + +

    + В пример 1 mkvmerge(1) ще създаде два файла. Първият ще съдържа всичко от + 00:01:20 до 00:02:45. Вторият ще + съдържа всичко от 00:05:50 до + 00:10:30. + +

    + + +

    + В пример 2 mkvmerge(1) ще създаде само един файл. Файлът ще съдържа всичко от + 00:01:20 до 00:02:45 и от + 00:05:50 до 00:10:30. + +

    + + +

    + В пример 3 mkvmerge(1) ще създаде два файла. Първият ще съдържа всичко от + началото на файловете-източници до 00:02:45. Вторият ще + съдържа всичко от 00:05:50 до края на + файловете-източници. + +

    + + +
    +

    Note:

    + +

    + Note that mkvmerge(1) only makes decisions about splitting at key frame + positions. This applies to both the start and the end of each range. So even + if an end timestamp is between two key frames mkvmerge(1) will continue + outputting the frames up to but excluding the following key frame. + +

    + +
    + +
  8. + + +
  9. + +

    + Keeping specific parts by specifying frame/field number ranges while + discarding others. + +

    + + +

    + Синтаксис: --split + parts-frames:начало1-край1[,[+]начало2-край2[,[+]начало3-край3...]] + +

    + + +

    + Примери: +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + The parts-frames mode tells mkvmerge(1) to keep certain + ranges of frame/field numbers while discarding others. The ranges to keep + have to be listed after the parts-frames: keyword and be + separated by commas. A range itself consists of a start and an end + frame/field number. Numbering starts at 1. + +

    + + +

    + If a start number is left out then it defaults to the previous range's end + number. If there was no previous range then it defaults to the start of the + file (see example 3). + +

    + + +

    + If an end number is left out then it defaults to the end of the source files + which basically tells mkvmerge(1) to keep the rest (see example 3). + +

    + + +

    + Normally each range will be written to a new file. This can be changed so + that consecutive ranges are written to the same file. For that the user has + to prefix the start number with a +. This tells + mkvmerge(1) not to create a new file and instead append the range to the same + file the previous range was written to. Timestamps will be adjusted so that + there will be no gap in the output file even if there was a gap in the two + ranges in the input file. + +

    + + +
    +

    Note:

    + +

    + Note that mkvmerge(1) only makes decisions about splitting at key frame + positions. This applies to both the start and the end of each range. So even + if an end frame/field number is between two key frames mkvmerge(1) will + continue outputting the frames up to but excluding the following key frame. + +

    + +
    + + +

    + In example 1 mkvmerge(1) will create two files. The first will contain the + content starting from the first key frame at or after 137 + up to but excluding the first key frame at or after + 258. The second file will contain the content starting + from 548 until 1211. + +

    + + +

    + In example 2 mkvmerge(1) will create only one file. This file will contain + both the content starting from 733 until + 912 and the content starting from 1592 + until 2730. + +

    + + +

    + In example 3 mkvmerge(1) will create two files. The first will contain the + content from the start of the source files until 430. The + second file will contain the content starting from 2512 + until the end of the source files. + +

    + + +

    + This mode considers only the first video track that is output. If no video + track is output no splitting will occur. + +

    + + +
    +

    Note:

    + +

    + The numbers given with this argument are interpreted based on the number of + Matroska(tm) blocks that are output. A single Matroska(tm) block contains + either a full frame (for progressive content) or a single field (for + interlaced content). mkvmerge does not distinguish between those two and + simply counts the number of blocks. For example: If one wanted to split + after the 25th full frame with interlaced content one would have to use + 50 (two fields per full frame) as the split point. + +

    + +
    + +
  10. + + +
  11. + +

    + Splitting after specific frames/fields. + +

    + + +

    + Синтаксис: --split + frames:А[,Б[,В...]] + +

    + + +

    + Пример: --split frames:120,237,891 + +

    + + +

    + The parameters A, B, + C etc must all be positive integers. Numbering + starts at 1. The list of frame/field numbers is separated by commas. After + the input stream has reached the current split point's frame/field number a + new file is created. Then the next split point given in this list is used. + +

    + + +

    + The 'frames:' prefix must not be omitted. + +

    + + +

    + This mode considers only the first video track that is output. If no video + track is output no splitting will occur. + +

    + + +
    +

    Note:

    + +

    + The numbers given with this argument are interpreted based on the number of + Matroska(tm) blocks that are output. A single Matroska(tm) block contains + either a full frame (for progressive content) or a single field (for + interlaced content). mkvmerge does not distinguish between those two and + simply counts the number of blocks. For example: If one wanted to split + after the 25th full frame with interlaced content one would have to use + 50 (two fields per full frame) as the split point. + +

    + +
    + +
  12. + + +
  13. + +

    + Splitting before specific chapters. + +

    + + +

    + Синтаксис: --split chapters:all или + --split + chapters:А[,Б[,В...]] + +

    + + +

    + Пример: --split chapters:5,8 + +

    + + +

    + The parameters A, B, + C etc must all be positive integers. Numbering + starts at 1. The list of chapter numbers is separated by commas. Splitting + will occur right before the first key frame whose timestamp is equal to or + bigger than the start timestamp for the chapters whose numbers are listed. + A chapter starting at 0s is never considered for splitting and discarded + silently. + +

    + + +

    + Може да бъде използвана ключовата дума all, вместо ръчно + да се изреждат номерата на всички епизоди. + +

    + + +

    + The 'chapters:' prefix must not be omitted. + +

    + + +
    +

    Note:

    + +

    + The Matroska(tm) file format supports arbitrary deeply nested chapter + structures called 'edition entries' and 'chapter atoms'. However, this mode + only considers the top-most level of chapters across all edition entries. + +

    + +
    + +
  14. + +
+ + +

+ For this splitting mode the output filename is treated differently than for + the normal operation. It may contain a printf like + expression '%d' including an optional field width, + e.g. '%02d'. If it does then the current file number will be + formatted appropriately and inserted at that point in the filename. If + there is no such pattern then a pattern of '-%03d' is assumed + right before the file's extension: '-o output.mkv' would result + in 'output-001.mkv' and so on. If there's no extension then + '-%03d' will be appended to the name. + +

+ + +

+ Another possible pattern is '%c' which will be replaced by the + name of the first chapter in the file. Note that when '%c' is + present, the pattern '-%03d' will not be added automatically. + +

+ +
--link + +

+ Link files to one another when splitting the output file. See the section on + file linking below for details. + +

+ +
--link-to-previous UID-на-сегмент + +

+ Links the first output file to the segment with the segment UID given by the + segment-UID parameter. See the section on file linking below for details. + +

+ + +

+ If SID starts with = then its rest is interpreted as the name of a Matroska + file whose segment UID is read and used. + +

+ +
--link-to-next UID-на-сегмент + +

+ Links the last output file to the segment with the segment UID given by the + segment-UID parameter. See the section on file linking below for details. + +

+ + +

+ If SID starts with = then its rest is interpreted as the name of a Matroska + file whose segment UID is read and used. + +

+ +
--append-mode режим + +

+ Determines how timestamps are calculated when appending files. The + parameter mode can have two values: + 'file' which is also the default and + 'track'. + +

+ + +

+ When mkvmerge appends a track (called 'track2_1' from now + on) from a second file (called 'file2') to a track + (called 'track1_1') from the first file (called + 'file1') then it has to offset all timestamps for + 'track2_1' by an amount. For 'file' + mode this amount is the highest timestamp encountered in + 'file1' even if that timestamp was from a different track + than 'track1_1'. In track mode the offset is the highest + timestamp of 'track1_1'. + +

+ + +

+ Unfortunately mkvmerge cannot detect which mode to use reliably. Therefore + it defaults to 'file' mode. 'file' + mode usually works better for files that have been created independently of + each other; e.g. when appending AVI or MP4 + files. 'track' mode may work better for sources that are + essentially just parts of one big file, e.g. for VOB and + EVO files. + +

+ + +

+ Subtitle tracks are always treated as if 'file' mode were + active even if 'track' mode actually is. + +

+ +
--append-to + SFID1:STID1:DFID1:DTID1[,...] + +

+ This option controls to which track another track is appended. Each spec + contains four IDs: a file ID, a track ID, a second file ID and a second + track ID. The first pair, "source file ID" and "source track ID", + identifies the track that is to be appended. The second pair, "destination + file ID" and "destination track ID", identifies the track the first one is + appended to. + +

+ + +

+ If this option has been omitted then a standard mapping is used. This + standard mapping appends each track from the current file to a track from + the previous file with the same track ID. This allows for easy appending if + a movie has been split into two parts and both file have the same number of + tracks and track IDs with the command mkvmerge -o output.mkv + part1.mkv +part2.mkv. + +

+ +
+ + +

+ A single '+' causes the next file to be appended instead of added. The '+' + can also be put in front of the next file name. Therefore the following two + commands are equivalent: + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv file1.mkv +file2.mkv
+
[ файл1 файл2 + ] + +

+ If multiple file names are contained in a pair of square brackets then the + second and all following files will be appended to the first file named + within the brackets. + +

+ + +

+ This is an alternative syntax to using '+' between the file names. Therefore + the following two commands are equivalent: + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv '[' file1.mkv file2.mkv ']'
+
= + +

+ For certain file types (MPEG program streams = VOBs) mkvmerge(1) normally + looks for files in the same directory as an input file that have the same + base name and only differ in their running number (e.g. 'VTS_01_1.VOB', + 'VTS_01_2.VOB', 'VTS_01_3.VOB' etc) and treats all of those files as if they + were concatenated into a single big file. This option, a single '=', causes + mkvmerge not to look for those additional files. + +

+ + +

+ The '=' can also be put in front of the next file name. Therefore the + following two commands are equivalent: + +

+ +
$ mkvmerge -o full.mkv = file1.vob
+$ mkvmerge -o full.mkv =file1.vob
+
( файл1 файл2 + ) + +

+ If multiple file names are contained in a pair of parenthesis then those + files will be treated as if they were concatenated into a single big file + consisting of the content of each of the files one after the other. + +

+ + +

+ This can be used for e.g. VOB files coming from a DVD or MPEG transport + streams. It cannot be used if each file contains its own set of headers + which is usually the case with stand-alone files like AVI or MP4. + +

+ + +

+ Putting a file name into parenthesis also prevents mkvmerge(1) from looking + for additional files with the same base name as described in option + =. Therefore these two command lines are equivalent: + +

+ +
$ mkvmerge -o out.mkv = file.mkv
+$ mkvmerge -o out.mkv '(' file.mkv ')'
+ +

+ Трябва да бъдат отбелязани няколко неща: + +

+ + +
    + +
  1. + +

    + There must be spaces both after the opening and before the closing + parenthesis. + +

    + +
  2. + + +
  3. + +

    + Every parameter between parenthesis is interpreted as a file name. Therefore + all options applying to this logical file must be listed before the opening + parenthesis. + +

    + +
  4. + + +
  5. + +

    + Some shells treat parenthesis as special characters. Hence you must escape + or quote them as shown in the example above. + +

    + +
  6. + +
+ +
+ + + + +

2.6. Поддръжка на прикачени файлове (още глобални опции)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description описание + +

+ Plain text description of the following attachment. Applies to the next + --attach-file + or --attach-file-once option. + + +

+ +
--attachment-mime-type MIME тип + +

+ MIME type of the following attachment. Applies to the next + --attach-file + or --attach-file-once + option. A list of officially recognized MIME types can be + found e.g. at the + IANA homepage. The MIME type is mandatory for an + attachment. + +

+ + +

+ If no MIME type is given a for an attachment, its type will + be detected automatically. + +

+ +
--attachment-name име + +

+ Sets the name that will be stored in the output file for this attachment. + If this option is not given then the name will be derived from the file name + of the attachment as given with the --attach-file + or the --attach-file-once + option. + +

+ +
+ --attach-file име на файла, + --attach-file-once име на файла + + +

+ Creates a file attachment inside the Matroska(tm) file. The + MIME type must have been set before this option can + used. The difference between the two forms is that during splitting the + files attached with --attach-file are attached to all + output files while the ones attached with + --attach-file-once are only attached to the first file + created. If splitting is not used then both do the same. + +

+ + +

+ mkvextract(1) can be used to extract attached files from a Matroska(tm) file. + +

+ +
--enable-legacy-font-mime-types + +

+ Enables the use of legacy MIME types for certain types of + font attachments. For example, + 'application/x-truetype-font' will be used for TrueType + fonts instead of 'fonts/ttf'. + +

+ + +

+ This affects both new attachments if its MIME type is + detected automatically and existing attachments whose stored + MIME types will be remapped to the legacy ones. + +

+ + +

+ The affected MIME types are 'font/sfnt', + 'font/ttf' and 'font/collection' which + are all mapped to 'application/x-truetype-fonts' and + 'font/otf' which is mapped to + 'application/vnd.ms-opentype'. + +

+ +
+ + + +

2.7. Опции, които могат да се използват за всеки файл-източник

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks + [!]н,м,... + +

+ Copy the audio tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch. They're not simply the track numbers (see section track IDs). Default: copy all audio + tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ Default: copy all tracks of this kind. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-d, --video-tracks + [!]н,м,... + +

+ Copy the video tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch. They're not simply the track numbers (see section track IDs). Default: copy all video + tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-s, --subtitle-tracks + [!]н,м,... + +

+ Copy the subtitle tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch. They're not simply the track numbers (see section track IDs). Default: copy all subtitle + tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-b, --button-tracks + [!]н,м,... + +

+ Copy the button tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch. They're not simply the track numbers (see section track IDs). Default: copy all button + tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
--track-tags + [!]н,м,... + +

+ Copy the tags for tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch (see section track IDs). + They're not simply the track numbers. Default: copy tags for all tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy everything but the IDs listed after the !. + +

+ +
-m, --attachments + [!]n[:all|first],m[:all|first],... + +

+ Copy the attachments with the IDs n, + m etc to all or only the first output file. Each ID + can be followed by either ':all' (which is the default if + neither is entered) or ':first'. If splitting is active + then those attachments whose IDs are specified with + ':all' are copied to all of the resulting output files + while the others are only copied into the first output file. If splitting is + not active then both variants have the same effect. + +

+ + +

+ The default is to copy all attachments to all output files. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy everything but the IDs listed after the !. + +

+ +
-A, --no-audio + +

+ Не копирай никоя аудио пътечка от този файл. + +

+ +
-D, --no-video + +

+ Не копирай никоя видео пътечка от този файл. + +

+ +
-S, --no-subtitles + +

+ Не копирай никоя пътечка със субтитри от този файл. + +

+ +
-B, --no-buttons + +

+ Не копирай никоя пътечка с бутони от този файл. + +

+ +
-T, --no-track-tags + +

+ Не копирай никакви специфични за пътечката тагове от този файл. + +

+ +
--no-chapters + +

+ Не копирай епизоди (chapters) от този файл. + +

+ +
-M, --no-attachments + +

+ Не копирай прикачените файлове от този файл. + +

+ +
--no-global-tags + +

+ Не копирай глобални тагове от този файл. + +

+ +
-y, --sync + TID:d[,o[/p]] + +

+ Adjust the timestamps of the track with the id TID by + d ms. The track IDs are the same as the ones given + with --identify + (see section track IDs). + +

+ + +

+ o/p: adjust the timestamps by + o/p to fix linear + drifts. p defaults to 1 if omitted. Both + o and p can be floating point + numbers. + +

+ + +

+ По подразбиране: без ръчна корекция на синхронизацията (което съответства на + d = 0 и + o/p = + 1.0). + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--cues TID:none|iframes|all + +

+ Controls for which tracks cue (index) entries are created for the given + track (see section track + IDs). 'none' inhibits the creation of cue + entries. For 'iframes' only blocks with no backward or + forward references ( = I frames in video tracks) are put into the cue + sheet. 'all' causes mkvmerge(1) to create cue entries for + all blocks which will make the file very big. + +

+ + +

+ The default is 'iframes' for video and subtitle tracks + and 'none' for audio tracks. See also option --no-cues + which inhibits the creation of cue entries regardless of the + --cues options used. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--default-track-flag + TID[:bool] + +

+ Sets the "default track" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. The flag will be set if the source container doesn't + provide that information and the user doesn't specify it via this option. + +

+ + +

+ If the user does not explicitly select a track during playback, the player + should select one of the tracks that has its "default track" flag + set, taking user preferences such as their preferred language into account. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--track-enabled-flag + TID[:bool] + +

+ Sets the "track enabled" flag for the given track (see section + track IDs) to the given value + bool (0 or 1; defaults to 1 if not specified). + Tracks are enabled by default if no option is specified for them and the + source container doesn't provide this information either. + +

+ + +

+ Само пътечки със зададен флаг „включено“ би трябвало да бъдат взимани + предвид при възпроизвеждане. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--forced-display-flag + TID[:bool] + +

+ Sets the "forced display" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. Use this for tracks containing onscreen text or + foreign-language dialogue. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--hearing-impaired-flag + TID[:bool] + +

+ Sets the "hearing impaired" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track is suitable for users + with hearing impairments. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--visual-impaired-flag + TID[:bool] + +

+ Sets the "visual impaired" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track is suitable for users + with visual impairments. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--text-descriptions-flag + TID[:bool] + +

+ Sets the "text descriptions" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track contains textual + descriptions of video content suitable for playback via a text-to-speech + system for a visually-impaired user. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--original-flag + TID[:bool] + +

+ Sets the "original language" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track is in the content's + original language (not a translation). + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--commentary-flag + TID[:bool] + +

+ Sets the "commentary" flag for the given track (see section track IDs) if the optional argument + bool is set to 1 or if it isn't + present. This flag can be set if the track contains commentary. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--track-name TID:име + +

+ Sets the track name for the given track (see section track IDs) to + name. + +

+ +
--language TID:език + +

+ Sets the language for the given track (see section track IDs). Both ISO 639-2 language + codes and ISO 639-1 country codes are allowed. The country codes will be + converted to language codes automatically. All languages including their + ISO 639-2 codes can be listed with the --list-languages + option. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
-t, --tags + TID:име-на-файла + +

+ Чете тагове от пътечката с номер TID от файла + име-на-файла. Виж секцията относно тагове по-долу за повече информация. + +

+ +
--aac-is-sbr + TID[:0|1] + +

+ Tells mkvmerge(1) that the track with the ID TID is + SBR AAC (also known as HE-AAC or + AAC+). This options is needed if a) the source file is an + AAC file (not for a Matroska(tm) file) + and b) the AAC file contains SBR AAC + data. The reason for this switch is that it is technically impossible to + automatically tell normal AAC data from SBR + AAC data without decoding a complete AAC frame. As + there are several patent issues with AAC decoders + mkvmerge(1) will never contain this decoding stage. So for SBR + AAC files this switch is mandatory. The resulting file might not + play back correctly or even not at all if the switch was omitted. + +

+ + +

+ If the source file is a Matroska(tm) file then the + CodecID should be enough to detect SBR + AAC. However, if the CodecID is wrong then + this switch can be used to correct that. + +

+ + +

+ If mkvmerge wrongfully detects that an AAC file is + SBR then you can add ':0' to the track + ID. + +

+ +
--audio-emphasis TID:n|symbolic-name + +

+ Sets the emphasis for the audio track with the track ID + TID. The mode can either be a number + n (certain values between 0 and + 16) or a symbolic name. All valid numbers & + symbolic names can be listed with the --list-audio-emphasis + option. + +

+ +
--reduce-to-core TID + +

+ Some audio codecs have a lossy core and optional extensions that implement + lossless decoding. This option tells mkvmerge(1) to only copy the core but + not the extensions. By default mkvmerge(1) copies both the core and the + extensions. + +

+ + +

+ Currently only DTS tracks are affected by this + option. TrueHD tracks that contain an embedded AC-3 core + are instead presented as two separate tracks for which the user can select + which track to copy. For DTS such a scheme would not work + as the HD extensions cannot be decoded by themselves – unlike the TrueHD + data. + +

+ +
--remove-dialog-normalization-gain + TID + +

+ Some audio codecs contain header fields that tell the decoder or player to + apply a (usually negative) gain for dialog normalization. This option tells + mkvmerge(1) to remove or minimize that gain by modifying the corresponding + header fields. + +

+ + +

+ Към момента единствено AC-3, DTS и + TrueHD пътечките са засегнати от тази опция. + +

+ +
--timestamps TID:име-на-файла + +

+ Read the timestamps to be used for the specific track ID from + file-name. These timestamps forcefully override the + timestamps that mkvmerge(1) normally calculates. Read the section about external timestamp files. + +

+ +
--default-duration TID:х + +

+ Forces the default duration of a given track to the specified value. Also + modifies the track's timestamps to match the default duration. The argument + x must be postfixed with 's', + 'ms', 'us', 'ns', + 'fps', 'p' or 'i' + to specify the default duration in seconds, milliseconds, microseconds, + nanoseconds, 'frames per second', 'progressive frames per second' or + 'interlaced frames per second' respectively. The number + x itself can be a floating point number or a + fraction. + +

+ + +

+ If the default duration is not forced then mkvmerge will try to derive the + track's default duration from the container and/or the encoded bitstream for + certain track types, e.g. AVC/H.264 or MPEG-2. + +

+ + +

+ This option can also be used to change the FPS of video + tracks without having to use an external timestamp file. + +

+ +
--fix-bitstream-timing-information + TID[:0|1] + +

+ Normally mkvmerge(1) does not change the timing information (frame/field + rate) stored in the video bitstream. With this option that information is + adjusted to match the container timing information. The container timing + information can come from various sources: from the command line (see option + --default-duration), + the source container or derived from the bitstream. + +

+ + +
+

Note:

+ +

Засега тази опция е имплементирана само за AVC/H.264 видео пътечки.

+ +
+ +
--compression TID:н + +

+ Selects the compression method to be used for the track. Note that the + player also has to support this method. Valid values are + 'none', 'zlib' and + 'mpeg4_p2'/'mpeg4p2'. + +

+ +

+ The compression method + 'mpeg4_p2'/'mpeg4p2' is a special + compression method called 'header removal' that is only available for + MPEG4 part 2 video tracks. + +

+ +

+ The default for some subtitle types is 'zlib' + compression. This compression method is also the one that most if not all + playback applications support. Support for other compression methods other + than 'none' is not assured. + +

+ +
+ + + +

2.8. Опции, които се прилагат само за видео пътечки

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc + TID:FourCC + +

+ Forces the FourCC to the specified value. Works only + for video tracks in the 'MS compatibility mode'. + +

+ +
--display-dimensions + TID:широчинаxвисочина + +

+ Matroska(tm) files contain two values that set the display properties that a + player should scale the image on playback to: display width and display + height. These values can be set with this option, + e.g. '1:640x480'. + +

+ + +

+ Another way to specify the values is to use the --aspect-ratio + or the --aspect-ratio-factor + option (see below). These options are mutually exclusive. + +

+ +
--aspect-ratio + TID:пропорция|широчина/височина + +

+ Matroska(tm) files contain two values that set the display properties that a + player should scale the image on playback to: display width and display + height. With this option mkvmerge(1) will automatically calculate the + display width and display height based on the image's original width and + height and the aspect ratio given with this option. The ratio can be given + either as a floating point number ratio or as a + fraction 'width/height', + e.g. '16/9'. + +

+ + +

+ Another way to specify the values is to use the --aspect-ratio-factor + or --display-dimensions + options (see above and below). These options are mutually exclusive. + +

+ +
--aspect-ratio-factor + TID:коефициент|n/d + +

+ Another way to set the aspect ratio is to specify a + factor. The original aspect ratio is first multiplied + with this factor and used as the target aspect ratio + afterwards. + +

+ + +

+ Another way to specify the values is to use the --aspect-ratio + or --display-dimensions + options (see above). These options are mutually exclusive. + +

+ +
--cropping TID:ляво,горе,дясно,долу + +

+ Sets the pixel cropping parameters of a video track to the given values. + +

+ +
--color-matrix-coefficients TID:n + +

+ Sets the matrix coefficients of the video used to derive luma and chroma + values from red, green and blue color primaries. The parameter + n is an integer rangeing from 0 + and 10. + +

+ + +

+ Валидни стойности и техните значения са: + +

+ + +

+ 0: GBR, 1: BT709, + 2: unspecified, 3: reserved, + 4: FCC, 5: BT470BG, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 non-constant + luminance, 10: BT2020 constant luminance + +

+ +
--color-bits-per-channel TID:н + +

+ Sets the number of coded bits for a color channel. A value of + 0 indicates that the number of bits is unspecified. + +

+ +
--chroma-subsample TID:хори,верт + +

+ The amount of pixels to remove in the Cr and Cb channels for every pixel not + removed horizontally/vertically. + +

+ + +

+ Example: For video with 4:2:0 chroma subsampling, the parameter should be + set to + TID:1,1. + +

+ +
--cb-subsample TID:хори,верт + +

+ The amount of pixels to remove in the Cb channel for every pixel not removed + horizontally/vertically. This is additive with + --chroma-subsample. + +

+ + +

+ Example: For video with 4:2:1 chroma subsampling, the parameter + --chroma-subsample should be set to + TID:1,0 + and Cb-subsample should be set to + TID:1,0. + +

+ +
--chroma-siting TID:хори,верт + +

+ Sets how chroma is sited horizontally/vertically (0: + unspecified, 1: top collocated, 2: + half). + +

+ +
--color-range TID:н + +

+ Sets the clipping of the color ranges (0: unspecified, + 1: broadcast range, 2: full range + (no clipping), 3: defined by + MatrixCoefficients/TransferCharacteristics). + +

+ +
--color-transfer-characteristics + TID:н + +

+ The transfer characteristics of the video. + +

+ + +

+ Валидни стойности и техните значения са: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: gamma 2.2 curve, 5: gamma 2.8 + curve, 6: SMPTE 170M, 7: SMPTE + 240M, 8: linear, 9: log, + 10: log sqrt, 11: IEC 61966-2-4, + 12: ITU-R BT.1361 extended color gamut, + 13: IEC 61966-2-1, 14: ITU-R + BT.2020 10 bit, 15: ITU-R BT.2020 12 bit, + 16: SMPTE ST 2084, 17: SMPTE ST + 428-1; 18: ARIB STD-B67 (HLG) + +

+ +
--color-primaries TID:н + +

+ Sets the color primaries of the video. + +

+ + +

+ Валидни стойности и техните значения са: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: ITU-R BT.470M, 5: ITU-R + BT.470BG, 6: SMPTE 170M, 7: SMPTE + 240M, 8: FILM, 9: ITU-R BT.2020, + 10: SMPTE ST 428-1, 22: JEDEC P22 + phosphors + +

+ +
--max-content-light TID:н + +

+ Sets the maximum brightness of a single pixel (Maximum Content Light Level) + in candelas per square meter (cd/m²). The value of n + should be a non-negtive integer. + +

+ +
--max-frame-light TID:н + +

+ Sets the maximum brightness of a single full frame (Maximum Frame-Average + Light Level) in candelas per square meter (cd/m²). The value of + n should be a non-negtive integer. + +

+ +
--chromaticity-coordinates + TID:red-x,red-y,green-x,green-y,blue-x,blue-y + +

+ Sets the red/green/blue chromaticity coordinates as defined by CIE 1931. + +

+ +
--white-color-coordinates TID:x,y + +

+ Sets the white color chromaticity coordinates as defined by CIE 1931. + +

+ +
--max-luminance TID:float + +

+ Sets the maximum luminance in candelas per square meter (cd/m²). The value + should be less than 9999.99. + +

+ +
--min-luminance TID:float + +

+ Sets the minimum luminance in candelas per square meter (cd/m²). The value + should be less than 999.9999. + +

+ +
--projection-type TID:метод + +

+ Sets the video projection method used. Valid values are 0 (rectangular + projection), 1 (equirectangular projection), 2 (cubemap projection) and 3 + (mesh projection). + +

+ +
--projection-private TID:data + +

+ Sets private data that only applies to a specific projection. Data must be + given as hex numbers with or without the "0x" prefix, with or + without spaces. + +

+ +
--projection-pose-yaw TID:float + +

+ Задава завъртане на отклонението към прожекцията. + +

+ +
--projection-pose-pitch TID:float + +

+ Задава завъртане на стъпката към прожекцията. + +

+ +
--projection-pose-roll TID:float + +

+ Задава завъртане на наклона към прожекцията. + +

+ +
--field-order TID:н + +

+ Sets the field order for the video track with the track ID + TID. The order must be one of the following numbers: + +

+ + +

+ 0: progressive; 1: interlaced with + top field displayed first and top field stored first; + 2: undetermined field order; 6: + interlaced with bottom field displayed first and bottom field stored first; + 9: interlaced with bottom field displayed first and top + field stored first; 14: interlaced with top field + displayed first and bottom field stored first + +

+ +
--stereo-mode TID:n|symbolic-name + +

+ Sets the stereo mode for the video track with the track ID + TID. The mode can either be a number + n between 0 and + 14 or a symbolic name. All valid numbers & names + can be listed with the --list-stereo-modes + option. + +

+ +
+ + + +

2.9. Опции, които се прилагат само за пътечки с текстови субтитри

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset TID:набор-от-символи + +

+ Sets the character set for the conversion to UTF-8 for UTF-8 subtitles for + the given track ID. If not specified the charset will be derived from the + current locale settings. Note that a charset is not needed for subtitles + read from Matroska(tm) files or from Kate streams, as these are always stored + in UTF-8. See the section about text files and character + sets for an explanation how mkvmerge(1) converts between character + sets. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
+ + + +

2.10. Други опции

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify + име-на-файла + +

+ Will let mkvmerge(1) probe the single file and report its type, the tracks + contained in the file and their track IDs. If this option is used then the + only other option allowed is the filename. + +

+ + +

The output format used for the result can be changed with the option --identification-format. +

+ +
-J име на файла + +

+ Това е удобен псевдоним за „--identification-format json --identify + file-name“. + +

+ +
-F, --identification-format + формат + +

+ Determines the output format used by the --identify + option. The following formats are supported: text + (the default if this option isn't used) and json. + +

+ + +
    + +
  1. + +

    The text format is short and human-readable. It consists + of one line per item found (container, tracks, attachments etc.). +

    + + +

    This format is not meant to be parsed. The output will be translated into + the language mkvmerge(1) uses (see also --ui-language). +

    + +
  2. + + +
  3. + +

    + The json format outputs a machine-readable JSON + representation. This format follows the JSON schema described in the + following file: + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + Всички версии на JSON схемата са налични и онлайн на сайта, и в архивите на + изходния код на програмата. + +

    + +
  4. + +
+ +
--probe-range-percentage процент + +

+ File types such as MPEG program and transport streams + (.vob, .m2ts) require parsing a + certain amount of data in order to detect all tracks contained in the file. + This amount is 0.3% of the source file's size or 10 MB, whichever is higher. + +

+ + +

+ If tracks are known to be present but not found then the percentage to probe + can be changed with this option. The minimum of 10 MB is built-in and + cannot be changed. + +

+ +
--list-audio-emphasis + +

+ Lists all valid numbers & their corresponding symbolic names for the + --audio-emphasis + option. + +

+ +
--list-languages + +

+ Lists all languages and their ISO 639-2 code which can be used with the + --language + option. + +

+ +
--list-stereo-modes + +

+ Lists all valid numbers & their corresponding symbolic names for the + --stereo-mode + option. + +

+ +
-l, --list-types + +

+ Извежда списък с поддържаните входни файлови формати. + +

+ +
--priority приоритет + +

+ Sets the process priority that mkvmerge(1) runs with. Valid values are + 'lowest', 'lower', + 'normal', 'higher' and + 'highest'. If nothing is given then + 'normal' is used. On Unix like systems mkvmerge(1) will + use the + nice(2) + function. Therefore only the super user can use 'higher' + and 'highest'. On Windows all values are useable for + every user. + +

+ + +

Selecting 'lowest' also causes mkvmerge(1) to select idle + I/O priority in addition to the lowest possible process priority. +

+ +
--command-line-charset + набор-от-символи + +

+ Sets the character set to convert strings given on the command line from. It + defaults to the character set given by system's current locale. This + settings applies to arguments of the following options: --title, --track-name + and --attachment-description. + +

+ +
--output-charset набор-от-символи + +

+ Sets the character set to which strings are converted that are to be + output. It defaults to the character set given by system's current locale. + +

+ +
-r, --redirect-output име на + файла + +

+ Writes all messages to the file file-name instead of + to the console. While this can be done easily with output redirection there + are cases in which this option is needed: when the terminal reinterprets the + output before writing it to a file. The character set set with --output-charset + is honored. + +

+ +
--flush-on-close + +

+ Tells the program to flush all data cached in memory to storage when closing + files opened for writing. This can be used to prevent data loss on power + outages or to circumvent certain problems in the operating system or + drivers. The downside is that multiplexing will take longer as mkvmerge + will wait until all data has been written to the storage before exiting. + See issues #2469 and #2480 on the MKVToolNix bug tracker for in-depth + discussions on the pros and cons. + +

+ +
--ui-language код + +

+ Forces the translations for the language code to be + used (e.g. 'de_DE' for the German + translations). Entering 'list' as the + code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Казва на програмата да прекрати работа непосредствено след появата на + първото предупреждение. Изходният код на програмата ще бъде 1. + +

+ +
--deterministic seed + +

+ Enables the creation of byte-identical files if the same version of + mkvmerge(1) is used with the same source files, the same set of options and + the same seed. Note that the "date" segment information field is not + written in this mode. + +

+ + +

The seed can be an arbitrary string and does not have to be a number.

+ + +

+ The result of byte-identical files is only guaranteed under the following + conditions: + +

+ + +
    + +
  1. + +

    The same version of mkvmerge(1) built with the same versions of libEBML and + libMatroska is used. +

    + +
  2. + + +
  3. + +

    The source files used are byte-identical.

    + +
  4. + + +
  5. + +

    The same command line options are used in the same order (with the notable + exception of --output …). +

    + +
  6. + +
+ + +

+ Using other versions of mkvmerge(1) or other command-line options may result + in the same byte-identical file but is not guaranteed to do so. + +

+ +
--debug тема + +

+ Включи дебъгването за конкретна функция. Тази опция е полезна само за + разработчици. + +

+ +
--engage функция + +

+ Включване на експериментални функции. Списък с наличните функции може да + бъде поискан с mkvmerge --engage list. По принцип тези + функции не са предназначени за използване при нормални обстоятелства. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that + can tell a controlling GUI what's happening. These messages follow the + format '#GUI#message'. The message may be followed by + key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the + messages nor the keys are ever translated and always output in English. + +

+ +
@файл-с-опции.json + +

+ Reads additional command line arguments from the file + options-file. See the section about option files for further information. + +

+ +
--capabilities + +

+ Lists information about optional features that have been compiled in and + exit. The first line output will be the version information. All following + lines contain exactly one word whose presence indicates that the feature has + been compiled in. These features are: + +

+ + +
    + +
  • + +

    + 'FLAC' -- reading raw FLAC files and + handling FLAC tracks in other containers, + e.g. Ogg(tm) or Matroska(tm). + +

    + +
  • + +
+ +
-h, --help + +

+ Покажи информацията за употребата и излез. + +

+ +
-V, --version + +

+ Покажи информация за версията и излез. + +

+ +
+ + +

3. Употреба

+ + +

+ За всеки файл потребителят може да избере кои пътечки да вземе mkvmerge(1). + С -o всички биват сложени в посочения файл. Списък с + известни (и поддържани) формати на източници може да бъде получен чрез + опцията -l. + +

+ + +
+

Important:

+ +

+ Редът на параметрите в командния ред е от съществено значение. Моля, + прочетете раздела „Ред на + опциите“, ако нямате опит с програмата. + +

+ +
+ +

4. Ред на опциите

+ + + +

+ Последователността, в която опциите биват въвеждани, е от съществено + значение за някои опции. Опциите могат условно да се разделят на две + категории: + +

+ + +
    + +
  1. + +

    + Options that affect the whole program and are not tied to any input + file. These include but are not limited to + --command-line-charset, --output or + --title. These can appear anywhere on the command line. + +

    + +
  2. + + +
  3. + +

    + Options that affect a single input file or a single track in an input + file. These options all apply to the following input file on the command + line. All options applying to the same input (or to tracks from the same + input file) file can be written in any order as long as they all appear + before that input file's name. Examples for options applying to an input + file are --no-chapters or + --chapter-charset. Examples for options applying to a + single track are --default-duration or + --language. + +

    + +
  4. + +
+ + +

+ Опциите се обработват от ляво надясно. Ако дадена опция се появи няколко + пъти в рамките на един и същи обсег, тогава последното появяване ще бъде + използвано. Следователно, заглавието в примера по-долу ще бъде зададено на + „Нещо друго“: + +

+ +
$ mkvmerge -o изход.mkv --title 'Това онова' вход.avi --title 'Нещо друго'
+ +

+ The following example shows that using the --language + option twice is OK because they're used in different scopes. Even though + they apply to the same track ID they apply to different input files and + therefore have different scopes: + +

+ +
$ mkvmerge -o изход.mkv --language 0:fre français.ogg --language 0:bul български.ogg
+

5. Примери

+ + +

+ Да предположим, че имаш файл с име МоятФилм.avi и аудиопътечка в отделен + файл, например „МоятФилм.wav“. Първо искаш да + преформатираш аудиото в OggVorbis(tm): + +

+ +
$ oggenc -q4 -o МоетоКлипче.ogg МоетоКлипче.wav
+ +

+ След няколко минути можеш да обединиш видеото и аудиото: + +

+ +
$ mkvmerge -o МоетоКлипче-със-звук.mkv МоетоКлипче.avi МоетоКлипче.ogg
+ +

+ Ако AVI файлът ти вече съдържа аудио пътечка, то тогава тя + също ще бъде копирана (ако mkvmerge(1) поддържа аудио формата). За да + избегнеш това, можеш просто да направиш + +

+ +
$ mkvmerge -o МоетоКлипче-със-звук.mkv -A МоетоКлипче.avi МоетоКлипче.ogg
+ +

+ След още обмисляне решаваш да извлечеш друга аудио пътечка, било то + „коментарите на режисьора“ или друг език, в + „МоетоКлипче-добави-аудио.wav“. Пак го преформатирай и + обедини с другия файл: + +

+ +
$ oggenc -q4 -o МоетоКлипче-добави-аудио.ogg МоетоКлипче-добави-аудио.wav
+$ mkvmerge -o МК-завършено.mkv МоетоКлипче-със-звук.mkv МоетоКлипче-добави-аудио.ogg
+ +

+ Същият резултат може да бъде постигнат и с + +

+ +
$ mkvmerge -o МК-завършено.mkv -A МоетоКлипче.avi МоетоКлипче.ogg МоетоКлипче-добави-аудио.ogg
+ +

+ Now fire up mplayer(tm) and enjoy. If you have + multiple audio tracks (or even video tracks) then you can tell + mplayer(tm) which track to play with the + '-vid' and '-aid' options. These are + 0-based and do not distinguish between video and audio. + +

+ + +

+ If you need an audio track synchronized you can do that easily. First find + out which track ID the Vorbis track has with + +

+ +
$ mkvmerge --identify outofsync.ogg
+ +

+ Now you can use that ID in the following command line: + +

+ +
$ mkvmerge -o goodsync.mkv -A source.avi -y 12345:200 outofsync.ogg
+ +

+ This would add 200ms of silence at the beginning of the audio track with the + ID 12345 taken from 'outofsync.ogg'. + +

+ + +

+ Some movies start synced correctly but slowly drift out of sync. For these + kind of movies you can specify a delay factor that is applied to all + timestamps -- no data is added or removed. So if you make that factor too + big or too small you'll get bad results. An example is that an episode I + transcoded was 0.2 seconds out of sync at the end of + the movie which was 77340 frames long. At + 29.97fps 0.2 seconds correspond to + approx. 6 frames. So I did + +

+ +
$ mkvmerge -o goodsync.mkv -y 23456:0,77346/77340 outofsync.mkv
+ +

+ Резултатът си беше наред. + +

+ + +

+ Опциите за синхронизация могат да бъдат използвани и за субтитри по същия + начин. + +

+ + +

+ For text subtitles you can either use some Windows software (like + SubRipper(tm)) or the + subrip(tm) package found in + transcode(1)'s + sources in the 'contrib/subrip' directory. The general + process is: + +

+ + +
    + +
  1. + +

    extract a raw subtitle stream from the source:

    +
    $ tccat -i /path/to/copied/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o mymovie
    +
  2. + + +
  3. + +

    convert the resulting PGM images to text with gocr:

    +
    $ pgm2txt mymovie
    +
  4. + + +
  5. + +

    spell-check the resulting text files:

    +
    $ ispell -d american *txt
    +
  6. + + +
  7. + +

    convert the text files to a SRT file:

    +
    $ srttool -s -w -i mymovie.srtx -o mymovie.srt
    +
  8. + +
+ + +

+ The resulting file can be used as another input file for mkvmerge(1): + +

+ +
$ mkvmerge -o mymovie.mkv mymovie.avi mymovie.srt
+ +

+ If you want to specify the language for a given track then this is easily + done. First find out the ISO 639-2 code for your language. mkvmerge(1) can + list all of those codes for you: + +

+ +
$ mkvmerge --list-languages
+ +

+ Search the list for the languages you need. Let's assume you have put two + audio tracks into a Matroska(tm) file and want to set their language codes and + that their track IDs are 2 and 3. This can be done with + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut without-lang-codes.mkv
+ +

+ As you can see you can use the --language + switch multiple times. + +

+ + +

+ Maybe you'd also like to have the player use the Dutch language as the + default language. You also have extra subtitles, e.g. in English and French, + and want to have the player display the French ones by default. This can be + done with + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut --default-track-flag 3 without-lang-codes.mkv --language 0:eng english.srt --default-track-flag 0 --language 0:fre french.srt
+ +

+ If you do not see the language or default track flags that you've specified + in mkvinfo(1)'s output then please read the section about default values. + +

+ + +

+ Turn off the compression for an input file. + +

+ +
$ mkvmerge -o no-compression.mkv --compression -1:none MyMovie.avi --compression -1:none mymovie.srt
+ +

6. ID-та на пътечки

+ + + +

6.1. Обикновени ID-та на пътечки

+ + + +

+ Some of the options for mkvmerge(1) need a track ID to specify which track + they should be applied to. Those track IDs are printed by the readers when + demuxing the current input file, or if mkvmerge(1) is called with the --identify + option. An example for such output: + +

+ +
$ mkvmerge -i v.mkv
+File 'v.mkv': container: Matroska
+Track ID 0: video (V_MS/VFW/FOURCC, DIV3)
+Track ID 1: audio (A_MPEG/L3)
+ +

+ Do not confuse the track IDs that are assigned to the tracks that are placed + in the output MKV file with the track IDs of the input files. Only the input + file track IDs are used for options needing these values. + +

+ + +

+ Also note that each input file has its own set of track IDs. Therefore the + track IDs for file 'file1.ext' as reported by + 'mkvmerge --identify' do not change no matter how many + other input files are there or in which position + 'file1.ext' is used. + +

+ + +

+ Track IDs are assigned like this: + +

+ + +
    + +
  • + +

    + AVI files: The video track has the ID 0. The audio tracks + get IDs in ascending order starting at 1. + +

    + +
  • + + +
  • + +

    + AAC, AC-3, MP3, + SRT and WAV files: The one 'track' in that + file gets the ID 0. + +

    + +
  • + + +
  • + +

    + Most other files: The track IDs are assigned in order the tracks are found + in the file starting at 0. + +

    + +
  • + +
+ + +

+ The options that use the track IDs are the ones whose description contains + 'TID'. The following options use track IDs as well: + --audio-tracks, --video-tracks, + --subtitle-tracks, --button-tracks and + --track-tags. + +

+ + + +

6.2. Специални ID-та на пътечки

+ + + +

+ There are several IDs that have special meaning and do not occur in the + identification output. + +

+ + +

+ The special track ID '-1' is a wild card and applies + the given switch to all tracks that are read from an input file. + +

+ + +

+ The special track ID '-2' refers to the chapters in a + source file. Currently only the --sync option uses this + special ID. As an alternative to --sync -2:… the option + --chapter-sync … can be used. + +

+ + +

7. Language handling

+ + + +

+ Matroska(tm) has support for two different types of language elements: the + old, deprecated "Language" element containing ISO 639-2 alpha 3 codes and + the new "LanguageIETF" tags containing IETF BCP 47 language tags. All of + mkvmerge(1)'s options that accept a language accept a BCP 47 language + tag. mkvmerge(1) will derive the value for the deprecated "Language" element + from the BCP 47 language tags wherever possible. + +

+ + +

+ When identifying a file in JSON mode, existing "LanguageIETF" track header + elements will be output as the language_ietf track + property. + +

+ + +

+ When writing a file mkvmerge(1) will always write the "LanguageIETF", + "ChapLanguageIETF" and "TagLanguageIETF" elements (the latter two only if + chapters or tags are written respectively). In addition to those elements + the corresponding old elements will be written; they'll be set to the ISO + 639-2 code portion of the BCP 47 language tag. For example, when the track + language is set to sr-Cyrl-RS "LanguageIETF" will be set + to sr-Cyrl-RS and the old "Language" element will be set + to srp. + +

+ + +

+ When reading existing files (Matroska files, XML chapter or tag files etc.) + that already contain "…LanguageIETF" elements the existing elements will be + kept. Otherwise "…LanguageIETF" elements will be added based on command-line + options and other existing deprecated "…Language" elements. + +

+ + +

+ The creation of the new elements can be disabled completely with the + command-line option --disable-language-ietf which operates + on all three new elements. + +

+ + +

+ You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. + +

+ +

8. Текстови файлове и конвертирания на набори от символи

+ + +
+

Note:

+ +

+ Този раздел се отнася за всички програми в MKVToolNix, въпреки че споменава + само mkvmerge(1). + +

+ +
+ + +

8.1. Въведение

+ + +

+ All text in a Matroska(tm) file is encoded in UTF-8. This means that + mkvmerge(1) has to convert every text file it reads as well as every text + given on the command line from one character set into UTF-8. In return this + also means that mkvmerge(1)'s output has to be converted back to that + character set from UTF-8, e.g. if a non-English translation is used with + --ui-language + or for text originating from a Matroska(tm) file. + +

+ + +

+ mkvmerge(1) does this conversion automatically based on the presence of a + byte order marker (short: BOM) or the system's current + locale. How the character set is inferred from the locale depends on the + operating system that mkvmerge(1) is run on. + +

+ + + +

8.2. Byte order markers (BOM) – знакове за байтов порядък

+ + + +

+ Text files that start with a BOM are already encoded in one representation + of UTF. mkvmerge(1) supports the following five modes: UTF-8, UTF-16 Little + and Big Endian, UTF-32 Little and Big Endian. Text files with a BOM are + automatically converted to UTF-8. Any of the parameters that would otherwise + set the character set for such a file (e.g. --sub-charset) + is silently ignored. + +

+ + + +

8.3. Linux и Unix-базирани операционни системи, в това число и macOS

+ + + +

+ On Unix-like systems mkvmerge(1) uses the + setlocale(3) + system call which in turn uses the environment variables + LANG, LC_ALL and + LC_CYPE. The resulting character set is often one of + UTF-8 or the ISO-8859-* family and is used for all text file operations and + for encoding strings on the command line and for output to the console. + +

+ + + +

8.4. Операционна система „Windows“

+ + + +

+ On Windows the default character set used for converting text files is + determined by a call to the GetACP() system call. + +

+ + +

+ Reading the command line is done with the + GetCommandLineW() function which already returns a + Unicode string. Therefore the option --command-line-charset + is ignored on Windows. + +

+ + +

+ Output to the console consists of three scenarios: + +

+ + +
    + +
  1. + +

    + If the output is redirected with the option --redirect-output + then the default charset is UTF-8. This can be changed with --output-charset. + +

    + +
  2. + + +
  3. + +

    + If the output is redirected with cmd.exe itself, + e.g. with mkvinfo file.mkv > info.txt, then the + charset is always UTF-8 and cannot be changed. + +

    + +
  4. + + +
  5. + +

    + Otherwise (when writing directly to the console) the Windows function + WriteConsoleW() is used and the option --output-charset + is ignored. The console should be able to output all Unicode characters for + which the corresponding language support is installed (e.g. Chinese + characters might not be displayed on English Windows versions). + +

    + +
  6. + +
+ + + +

8.5. Опции в командния ред

+ + + +

+ Съществуват следните опции, които позволяват задаване на набори от символи: + +

+ + +
    + +
  • + +

    + --sub-charset + for text subtitle files and for text subtitle tracks stored in container + formats for which the character set cannot be determined unambiguously + (e.g. Ogg files), + +

    + +
  • + + +
  • + +

    + --chapter-charset + for chapter text files and for chapters and file titles stored in container + formats for which the character set cannot be determined unambiguously + (e.g. Ogg files for chapter information, track and file titles etc; MP4 + files for chapter information), + +

    + +
  • + + +
  • + +

    + --command-line-charset + за целия текст в командния ред, + +

    + +
  • + + +
  • + +

    + --output-charset + for all strings written to the console or to a file if the output has been + redirected with the --redirect-output + option. On non-Windows systems the default for the output charset is the + system's current charset. On Windows it defaults to UTF-8 both for + redirecting with --redirect-output + and with cmd.exe itself, e.g. mkvinfo file.mkv + > info.txt. + +

    + +
  • + +
+ + +

9. Файлове с опции

+ + + +

+ An option file is a file mkvmerge(1) can read additional command line + arguments from. This can be used in order to circumvent certain limitations + of the shell or the operating system when executing external programs like a + limited command line length. + +

+ + +

+ An option file contains JSON-formatted data. Its content must be a valid + JSON array consisting solely of JSON strings. The file's encoding must be + UTF-8. The file should not start with a byte order marker + (BOM), but if one exists, it will be skipped. + +

+ + +

+ The rules for escaping special characters inside JSON are the ones in the + official JSON specification, RFC 7159. + +

+ + +

+ The option file's name itself must be specified as a command line argument + prefixed with a '@' character. + +

+ + +

+ Командата 'mkvmerge -o "моят файл.mkv" -A "филмче.avi" + звук.ogg' би могла да бъде преобразувана в следния JSON файл с + опции, казващ се примерно 'опции.json': + +

+ +
[
+  "-o",
+  "c:\\Matroska\\моят файл.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "филмче.avi",
+  "звук.ogg"
+]
+ +

+ Съответстващата команда е 'mkvmerge @опции.json'. + +

+ +

10. Свързване на файлове

+ + +

+ Matroska(tm) supports file linking which simply says that a specific file is + the predecessor or successor of the current file. To be precise, it's not + really the files that are linked but the Matroska(tm) segments. As most files + will probably only contain one Matroska(tm) segment the following explanations + use the term 'file linking' although 'segment linking' would be more + appropriate. + +

+ + +

+ Each segment is identified by a unique 128 bit wide segment UID. This UID is + automatically generated by mkvmerge(1). The linking is done primarily via + putting the segment UIDs (short: SID) of the previous/next + file into the segment header information. mkvinfo(1) prints these + SIDs if it finds them. + +

+ + +

+ If a file is split into several smaller ones and linking is used then the + timestamps will not start at 0 again but will continue where the last file + has left off. This way the absolute time is kept even if the previous files + are not available (e.g. when streaming). If no linking is used then the + timestamps should start at 0 for each file. By default mkvmerge(1) does not + use file linking. If you want that you can turn it on with the + --link option. This option is only useful if splitting is + activated as well. + +

+ + +

+ Regardless of whether splitting is active or not the user can tell + mkvmerge(1) to link the produced files to specific + SIDs. This is achieved with the options + --link-to-previous and --link-to-next. + These options accept a segment SID in the format that + mkvinfo(1) outputs: 16 hexadecimal numbers between 0x00 + and 0xff prefixed with '0x' each, + e.g. '0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 0x5e + 0xca 0xb3 0x93'. Alternatively a shorter form can be used: 16 + hexadecimal numbers between 0x00 and + 0xff without the '0x' prefixes and + without the spaces, e.g. '41da7366d9cfb21eae78ebb45ecab393'. + +

+ + +

+ If splitting is used then the first file is linked to the + SID given with --link-to-previous and the + last file is linked to the SID given with + --link-to-next. If splitting is not used then the one + output file will be linked to both of the two SIDs. + +

+ +

11. Стойности по подразбиране

+ + +

+ Спецификацията на Matroska(tm) казва, че някои елементи имат стойност по + подразбиране. Обикновено елемент, чиято стойност е равна на тази по + подразбиране, не бива записван във файла, за да се спести място. Елементите, + които потребителят може да пропусне в информацията от mkvinfo(1), са + език и флаг „пътечка по + подразбиране“. Стойността по подразбиране за + език е английски („eng“), + стойността по подразбиране за флаг „пътечка по + подразбиране“ е true. Ето защо, ако се + използва --language 0:eng за пътечка, то тя няма да се + появи в изхода на mkvinfo(1). + +

+ +

12. Прикачени файлове

+ + +

+ Maybe you also want to keep some photos along with your Matroska(tm) file, or + you're using SSA subtitles and need a special + TrueType(tm) font that's really rare. In these cases + you can attach those files to the Matroska(tm) file. They will not be just + appended to the file but embedded in it. A player can then show those files + (the 'photos' case) or use them to render the subtitles (the + 'TrueType(tm) fonts' case). + +

+ + +

+ Here's an example how to attach a photo and a + TrueType(tm) font to the output file: + +

+ +
$ mkvmerge -o output.mkv -A video.avi sound.ogg \
+  --attachment-description "Me and the band behind the stage in a small get-together" \
+  --attachment-mime-type image/jpeg \
+  --attach-file me_and_the_band.jpg \
+  --attachment-description "The real rare and unbelievably good looking font" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file really_cool_font.ttf
+ +

+ If a Matroska(tm) containing attachments file is used as an input file then + mkvmerge(1) will copy the attachments into the new file. The selection which + attachments are copied and which are not can be changed with the options + --attachments + and --no-attachments. + +

+ +

13. Епизоди (chapters)

+ + +

+ The Matroska(tm) chapter system is more powerful than the old known system + used by OGM files. The full specifications can be found at + the Matroska website. + +

+ + +

+ mkvmerge(1) supports two kinds of chapter files as its input. The first + format, called 'simple chapter format', is the same format that the + OGM tools expect. The second format is a XML based + chapter format which supports all of Matroska(tm)'s chapter functionality. + +

+ + +

+ Apart from dedicated chapter files mkvmerge(1) can also read chapters from + other file formats (e.g. MP4, Ogg, Blu-rays or DVDs). + +

+ + +

13.1. Простият формат за епизоди

+ + + +

+ This format consists of pairs of lines that start with + 'CHAPTERxx=' and 'CHAPTERxxNAME=' + respectively. The first one contains the start timestamp while the second + one contains the title. Here's an example: + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=Intro
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=Baby prepares to rock
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=Baby rocks the house
+ +

+ mkvmerge(1) will transform every pair or lines into one Matroska(tm) + ChapterAtom. It does not set any + ChapterTrackNumber which means that all chapters + apply to all tracks in the file. + +

+ + +

+ As this is a text file character set conversion may need to be done. See the + section about text files + and character sets for an explanation how mkvmerge(1) converts between + character sets. + +

+ + + +

13.2. XML-базирания файлов формат за епизоди

+ + +

+ XML-базираният файлов формат за епизоди изглежда по следния начин: + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>Кратък епизод</ChapterString>
+        <ChapterLanguage>bul</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>Част от този кратък епизод</ChapterString>
+          <ChapterLanguage>bul</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ With this format three things are possible that are not possible with the + simple chapter format: + +

+ + +
    + +
  1. +

    The timestamp for the end of the chapter can be set,

    +
  2. + +
  3. +

    chapters can be nested,

    +
  4. + +
  5. +

    the language and country can be set.

    +
  6. + +
+ + +

+ The mkvtoolnix distribution contains some sample files in the + doc subdirectory which can be used as a basis. + +

+ + +

+ The following lists the supported XML tags, their data types and, where + appropriate, the valid range for their values: + +

+ +
Chapters (master)
+  EditionEntry (master)
+    EditionUID (unsigned integer, valid range: 1 <= value)
+    EditionFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagDefault (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagOrdered (unsigned integer, valid range: 0 <= value <= 1)
+    ChapterAtom (master)
+      ChapterAtom (master)
+      ChapterUID (unsigned integer, valid range: 1 <= value)
+      ChapterTimeStart (unsigned integer)
+      ChapterTimeEnd (unsigned integer)
+      ChapterFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterFlagEnabled (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterSegmentUID (binary, valid range: 1 <= length in bytes)
+      ChapterSegmentEditionUID (unsigned integer, valid range: 1 <= value)
+      ChapterPhysicalEquiv (unsigned integer)
+      ChapterTrack (master)
+        ChapterTrackNumber (unsigned integer, valid range: 1 <= value)
+      ChapterDisplay (master)
+        ChapterString (UTF-8 string)
+        ChapterLanguage (UTF-8 string)
+        ChapterCountry (UTF-8 string)
+      ChapterProcess (master)
+        ChapterProcessCodecID (unsigned integer)
+        ChapterProcessPrivate (binary)
+        ChapterProcessCommand (master)
+          ChapterProcessTime (unsigned integer)
+          ChapterProcessData (binary)
+ + +

13.3. Четене на епизоди от Blu-ray дискове

+ + + +

+ mkvmerge(1) може да чете епизоди от некриптирани Blu-ray дискове. За целта + може да използваш пътечката към някой от MPLS плейлистите с + параметъра--chapters. + +

+ + +

+ Пример: --chapters + /srv/bluray-ове/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. Четене на епизоди от DVD-та

+ + + +

+ When MKVToolNix is compiled with the libdvdread(tm) + library, mkvmerge(1) can read chapters from DVDs. For that you can use the + path to one of the folders or files on the DVD with the + --chapters parameter. As DVDs can contain more than + one title and each title has its own set of chapters, you can append a colon + and the desired title number to the end of the file name argument. The title + number defaults to 1. + +

+ + +

+ Пример: --chapters /srv/dvd-та/BigBuckBunny/VIDEO_TS:2 + +

+ + + +

13.5. Общи бележки

+ + +

+ When splitting files mkvmerge(1) will correctly adjust the chapters as + well. This means that each file only includes the chapter entries that apply + to it, and that the timestamps will be offset to match the new timestamps of + each output file. + +

+ + +

+ mkvmerge(1) is able to copy chapters from Matroska(tm) source files unless this + is explicitly disabled with the --no-chapters + option. The chapters from all sources (Matroska(tm) files, Ogg files, + MP4 files, chapter text files) are usually not merged but + end up in separate ChapterEditions. Only if chapters + are read from several Matroska(tm) or XML files that share the same edition + UIDs will chapters be merged into a single + ChapterEdition. If such a merge is desired in other + situations as well then the user has to extract the chapters from all + sources with mkvextract(1) first, merge the XML files manually and mux them + afterwards. + +

+ + +

14. Тагове

+ + + +

14.1. Въведение

+ + + +

+ Системата за тагове на Matroska(tm)'s е подобна на тази на другите контейнери: + набор от КЛЮЧ=СТОЙНОСТ двойки. Обаче, при Matroska(tm) + тези тагове могат да бъдат вложени – и КЛЮЧ и + СТОЙНОСТ са си самостоятелни елементи. Примерният + файл example-tags-2.xml показва как се използва тази + система. + +

+ + + +

14.2. Обсег на таговете

+ + + +

+ Matroska(tm) tags do not automatically apply to the complete file. They can, + but they also may apply to different parts of the file: to one or more + tracks, to one or more chapters, or even to a combination of both. The + Matroska + specification gives more details about this fact. + +

+ + +

+ One important fact is that tags are linked to tracks or chapters with the + Targets Matroska(tm) tag element, and that the UIDs + used for this linking are not the track IDs mkvmerge(1) + uses everywhere. Instead the numbers used are the UIDs which mkvmerge(1) + calculates automatically (if the track is taken from a file format other + than Matroska(tm)) or which are copied from the source file if the track's + source file is a Matroska(tm) file. Therefore it is difficult to know which + UIDs to use in the tag file before the file is handed over to mkvmerge(1). + +

+ + +

+ mkvmerge(1) knows two options with which you can add tags to Matroska(tm) + files: The --global-tags + and the --tags + options. The difference is that the former option, --global-tags, + will make the tags apply to the complete file by removing any of those + Targets elements mentioned above. The latter option, + --tags, + automatically inserts the UID that mkvmerge(1) generates for the tag + specified with the TID part of the --tags option. + +

+ + + +

14.3. Пример

+ + +

+ Let's say that you want to add tags to a video track read from an + AVI. mkvmerge --identify file.avi tells + you that the video track's ID (do not mix this ID with the UID!) is 0. So + you create your tag file, leave out all Targets + elements and call mkvmerge(1): + +

+ +
$ mkvmerge -o file.mkv --tags 0:tags.xml file.avi
+ + +

14.4. Файлов формат за тагове

+ + +

+ mkvmerge(1) supports a XML based tag file format. The format is very + closely modeled after the Matroska + specification. Both the binary and the source distributions of + MKVToolNix come with a sample file called + example-tags-2.xml which simply lists all known tags + and which can be used as a basis for real life tag files. + +

+ + +

+ Основните неща са: + +

+ + +
    + +
  • +

    Най-външният елемент трябва да е <Tags>. +

    +
  • + +
  • + +

    Един логически таг се съдържа в една двойка от + <Tag> XML тагове. +

    + +
  • + +
  • +

    Разстоянията директно преди и след съдържанието на тага се игнорират.

    +
  • + +
+ + + +

14.5. Типове данни

+ + +

+ The new Matroska(tm) tagging system only knows two data types, a UTF-8 string + and a binary type. The first is used for the tag's name and the + <String> element while the binary type is used + for the <Binary> element. + +

+ + +

+ As binary data itself would not fit into a XML file mkvmerge(1) supports + two other methods of storing binary data. If the contents of a XML tag + starts with '@' then the following text is treated as a + file name. The corresponding file's content is copied into the Matroska(tm) + element. + +

+ + +

+ Otherwise the data is expected to be Base64 encoded. This is an encoding + that transforms binary data into a limited set of ASCII + characters and is used e.g. in email programs. mkvextract(1) will output + Base64 encoded data for binary elements. + +

+ + +

+ The deprecated tagging system knows some more data types which can be found + in the official Matroska(tm) tag specs. As mkvmerge(1) does not support this + system anymore these types aren't described here. + +

+ + + +

14.6. Известни тагове за XML файловия формат

+ + + +

+ The following lists the supported XML tags, their data types and, where + appropriate, the valid range for their values: + +

+ +
Tags (master)
+  Tag (master)
+    Targets (master)
+      TargetTypeValue (unsigned integer)
+      TargetType (UTF-8 string)
+      TrackUID (unsigned integer)
+      EditionUID (unsigned integer)
+      ChapterUID (unsigned integer)
+      AttachmentUID (unsigned integer)
+    Simple (master)
+      Simple (master)
+      Name (UTF-8 string)
+      TagLanguage (UTF-8 string)
+      DefaultLanguage (unsigned integer)
+      String (UTF-8 string)
+      Binary (binary)
+ +

15. Информация за сегмента

+ + + +

+ With a segment info XML file it is possible to set certain values in the + "segment information" header field of a Matroska(tm) file. All of + these values cannot be set via other command line options. + +

+ + +

+ Other "segment information" header fields can be set via command + line options but not via the XML file. This includes e.g. the --title and the + --timestamp-scale + options. + +

+ + +

+ There are other elements that can be set neither via command line options + nor via the XML files. These include the following elements: + DateUTC (also known as the "muxing date"), + MuxingApp, WritingApp and + Duration. They're always set by mkvmerge(1) itself. + +

+ + +

+ The following lists the supported XML tags, their data types and, where + appropriate, the valid range for their values: + +

+ +
Info (master)
+  SegmentUID (binary, valid range: length in bytes == 16)
+  SegmentFilename (UTF-8 string)
+  PreviousSegmentUID (binary, valid range: length in bytes == 16)
+  PreviousSegmentFilename (UTF-8 string)
+  NextSegmentUID (binary, valid range: length in bytes == 16)
+  NextSegmentFilename (UTF-8 string)
+  SegmentFamily (binary, valid range: length in bytes == 16)
+  ChapterTranslate (master)
+    ChapterTranslateEditionUID (unsigned integer)
+    ChapterTranslateCodec (unsigned integer)
+    ChapterTranslateID (binary)
+

16. Оформление на Matroska файлове

+ + +

+ The Matroska(tm) file layout is quite flexible. mkvmerge(1) will render a file + in a predefined way. The resulting file looks like this: + +

+ + +

+ [EBML head] [segment {meta seek #1} [segment information] [track + information] {attachments} {chapters} [cluster 1] {cluster 2} ... {cluster + n} {cues} {meta seek #2} {tags}] + +

+ + +

+ The elements in curly braces are optional and depend on the contents and + options used. A couple of notes: + +

+ + +
    + +
  • + +

    + meta seek #1 includes only a small number of level 1 elements, and only if + they actually exist: attachments, chapters, cues, tags, meta seek #2. Older + versions of mkvmerge(1) used to put the clusters into this meta seek element + as well. Therefore some imprecise guessing was necessary to reserve enough + space. It often failed. Now only the clusters are stored in meta seek #2, + and meta seek #1 refers to the meta seek element #2. + +

    + +
  • + + +
  • + +

    Attachment, chapter and tag elements are only present if they were added.

    + +
  • + +
+ + +

+ The shortest possible Matroska(tm) file would look like this: + +

+ + +

+ [EBML head] [segment [segment information] [track information] [cluster 1]] + +

+ + +

+ This might be the case for audio-only files. + +

+ +

17. Външни файлове с времеви клейма

+ + +

+ mkvmerge(1) allows the user to chose the timestamps for a specific track + himself. This can be used in order to create files with variable frame rate + video or include gaps in audio. A frame in this case is the unit that + mkvmerge(1) creates separately per Matroska(tm) block. For video this is + exactly one frame, for audio this is one packet of the specific audio + type. E.g. for AC-3 this would be a packet containing + 1536 samples. + +

+ + +

+ Timestamp files that are used when tracks are appended to each other must + only be specified for the first part in a chain of tracks. For example if + you append two files, v1.avi and v2.avi, and want to use timestamps then + your command line must look something like this: + +

+ +
$ mkvmerge ... --timestamps 0:my_timestamps.txt v1.avi +v2.avi
+ +

+ Съществуват четири формата, които mkvmerge(1) разпознава. Първият ред винаги + съдържа номера на версията. Празни редове, редове съдържащи единствено + шпации и редове започващи с „#“ се игнорират. + +

+ + +

17.1. Файлов формат с времеви клейма v1

+ + +

+ This format starts with the version line. The second line declares the + default number of frames per second. All following lines contain three + numbers separated by commas: the start frame (0 is the + first frame), the end frame and the number of frames in this range. The + FPS is a floating point number with the dot + '.' as the decimal point. The ranges can contain gaps for + which the default FPS is used. An example: + +

+ +
# timestamp format v1
+assume 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. Файлов формат с времеви клейма v2

+ + + +

+ In this format each line contains a timestamp for the corresponding frame. + This timestamp must be given in millisecond precision. It can be a floating + point number, but it doesn't have to be. You have to + give at least as many timestamp lines as there are frames in the track. The + timestamps in this file must be sorted. Example for 25fps: + +

+ +
# timestamp format v2
+0
+40
+80
+ + +

17.3. Файлов формат с времеви клейма v3

+ + +

+ In this format each line contains a duration in seconds followed by an + optional number of frames per second. Both can be floating point numbers. + If the number of frames per second is not present the default one is used. + For audio you should let the codec calculate the frame timestamps itself. + For that you should be using 0.0 as the number of + frames per second. You can also create gaps in the stream by using the + 'gap' keyword followed by the duration of the gap. + Example for an audio file: + +

+ +
# timestamp format v3
+assume 0.0
+25.325
+7.530,38.236
+gap, 10.050
+2.000,38.236
+ + +

17.4. Файлов формат с времеви клейма v4

+ + +

+ Този формат е идентичен на v2 формата. Единствената разлика е, че времевите + клейма не е нужно да се сортират. Този формат почти никога не трябва да се + използва. + +

+ + +

18. Кодове за изход

+ + + +

+ mkvmerge(1) завършва с един от следните три изходни кода: + +

+ + +
    + +
  • + +

    + 0 -- Този изходен код означава, че смесването е + приключило успешно. + +

    + +
  • + + +
  • + +

    + 1 -- In this case mkvmerge(1) has output at least one + warning, but muxing did continue. A warning is prefixed with the text + 'Warning:'. Depending on the issues involved the + resulting file might be ok or not. The user is urged to check both the + warning and the resulting file. + +

    + +
  • + + +
  • + +

    + 2 -- This exit code is used after an error occurred. + mkvmerge(1) aborts right after outputting the error message. Error messages + range from wrong command line arguments over read/write errors to broken + files. + +

    + +
  • + +
+ +

19. Променливи на средата

+ + + +

+ mkvmerge(1) използва променливите по подразбиране, определящи езиковата + променлива на системата (например LANG и от групата + LC_*). Допълнителни променливи: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG and + its short form MTX_DEBUG + +

Съдържанието се третира като все едно че е минато през --debug + опцията. +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE and + its short form MTX_ENGAGE + +

Съдържанието се третира като все едно че е минато през --engage + опцията. +

+ +
+ +

20. Виж също

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. Уебсайт

+ + +

+ Най-новата версия винаги може да бъде намерена на началната страница на MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..2029b2c2d1201ca86cbd17b64d29e6b240c8c260 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvpropedit.html @@ -0,0 +1,1312 @@ + + + + + mkvpropedit -- Редактиране на свойствата на Matroska файлове без да се налага изцяло нов + remux + + + + +
mkvpropedit -- Редактиране на свойствата на Matroska(tm) файлове без да се налага изцяло нов + remux +
+
+ +
+

1. Резюме

+ + +
mkvpropedit options {source-filename} {actions} +
+ +

2. Описание

+ + +

+ This program analyses an existing Matroska(tm) file and modifies some of its + properties. Then it writes those modifications to the existing file. Among + the properties that can be changed are the segment information elements + (e.g. the title) and the track headers (e.g. the language code, 'default + track' flag or the name). + +

+ + +

+ Опции: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ Lists all known and editable property names, their type (string, integer, + boolean etc) and a short description. The program exits + afterwards. Therefore the source-filename parameter + does not have to be supplied. + +

+ +
-p, --parse-mode + режим + +

+ Sets the parse mode. The parameter 'mode' can either + be 'fast' (which is also the default) or + 'full'. The 'fast' mode does not parse + the whole file but uses the meta seek elements for locating the required + elements of a source file. In 99% of all cases this is enough. But for files + that do not contain meta seek elements or which are damaged the user might + have to set the 'full' parse mode. A full scan of a file + can take a couple of minutes while a fast scan only takes seconds. + +

+ +
+ + +

+ Actions that deal with track and segment info properties: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit селектор + +

+ Sets the Matroska(tm) file section (segment information or a certain track's + headers) that all following add, set and delete actions operate + on. This option can be used multiple times in order to make modifications to + more than one element. + +

+ + +

+ By default mkvpropedit(1) will edit the segment information section. + +

+ + +

+ See the section about edit + selectors for a full description of the syntax. + +

+ +
-a, --add + име=стойност + +

+ Adds a property name with the value + value. The property will be added even if such a + property exists already. Note that most properties are unique and cannot + occur more than once. + +

+ +
-s, --set + име=стойност + +

+ Sets all occurrences of the property name to the + value value. If no such property exists then it will + be added. + +

+ +
-d, --delete име + +

+ Deletes all occurrences of the property name. Note + that some properties are required and cannot be deleted. + +

+ +
+ + +

+ Actions that deal with tags and chapters: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags + селектор:име_на_файл + +

+ Add or replace tags in the file with the ones from + filename or remove them if + filename is empty. mkvpropedit(1) reads the same XML tag + format that mkvmerge(1) reads as well. + +

+ + +

+ The selector must be one of the words + all, global or + track. For all mkvpropedit(1) will + replace or remove all tags in a file. With global only + global tags will be replaced or removed. + +

+ + +

+ With track mkvpropedit(1) will replace tags for a + specific track. Additionally the tags read from + filename will be assigned to the same track. The track + is specified in the same way edit + selectors are specified (see below), e.g. --tags + track:a1:new-audio-tags.xml. + +

+ +
--add-track-statistics-tags + +

+ Calculates statistics for all tracks in a file and adds new statistics tags + for them. If the file already contains such tags then they'll be updated. + +

+ +
--delete-track-statistics-tags + +

+ Deletes all existing track statistics tags from a file. If the file doesn't + contain track statistics tags then it won't be modified. + +

+ +
-c, --chapters име на + файла + +

+ Add or replace chapters in the file with the ones from + filename or remove them if + filename is empty. mkvpropedit(1) reads the same XML and + simple chapter formats that mkvmerge(1) reads as well. + +

+ +
+ + +

+ Действия за боравене с прикачени файлове: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment име на файл + +

+ Adds a new attachment from filename. + +

+ + +

+ If the option --attachment-name has been used prior to this + option then its value is used as the new attachment's name. Otherwise it is + derived from filename. + +

+ + +

+ If the option --attachment-mime-type has been used prior to + this option then its value is used as the new attachment's MIME + type. Otherwise it is auto-detected from the content of + filename. + +

+ + +

+ If the option --attachment-description has been used prior + to this option then its value is used as the new attachment's + description. Otherwise no description will be set. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is used as the new attachment's UID. Otherwise a + random UID will be generated automatically. + +

+ +
--replace-attachment + селектор:име_на_файл + +

+ Replaces one or more attachments that match selector + with the file filename. If more than one existing + attachment matches selector then all of their + contents will be replaced by the content of filename. + +

+ + +

+ The selector can have one of four forms. They're + explained below in the section attachment selectors. + +

+ + +

+ If the option --attachment-name has been used prior to this + option then its value is set as the new name for each modified + attachment. Otherwise the names aren't changed. + +

+ + +

+ If the option --attachment-mime-type has been used prior to + this option then its value is set as the new MIME type for each modified + attachment. Otherwise the MIME types aren't changed. + +

+ + +

+ If the option --attachment-description has been used prior + to this option then its value is set as the new description for each + modified attachment. Otherwise the descriptions aren't changed. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is set as the new UID for each modified + attachment. Otherwise the UIDs aren't changed. + +

+ +
--update-attachment селектор + +

+ Sets the properties of one or more attachments that match + selector. If more than one existing attachment + matches selector then all of their properties will be + updated. + +

+ + +

+ The selector can have one of four forms. They're + explained below in the section attachment selectors. + +

+ + +

+ If the option --attachment-name has been used prior to this + option then its value is set as the new name for each modified + attachment. Otherwise the names aren't changed. + +

+ + +

+ If the option --attachment-mime-type has been used prior to + this option then its value is set as the new MIME type for each modified + attachment. Otherwise the MIME types aren't changed. + +

+ + +

+ If the option --attachment-description has been used prior + to this option then its value is set as the new description for each + modified attachment. Otherwise the descriptions aren't changed. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is set as the new UID for each modified + attachment. Otherwise the UIDs aren't changed. + +

+ +
--delete-attachment селектор + +

+ Deletes one or more attachments that match selector. + +

+ + +

+ The selector can have one of four forms. They're + explained below in the section attachment selectors. + +

+ +
+ + +

+ Options for attachment actions: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name име + +

+ Sets the name to use for the following --add-attachment or + --replace-attachment operation. + +

+ +
--attachment-mime-type mime-тип + +

+ Sets the MIME type to use for the following + --add-attachment or --replace-attachment + operation. + +

+ +
--attachment-description описание + +

+ Sets the description to use for the following + --add-attachment or --replace-attachment + operation. + +

+ +
--enable-legacy-font-mime-types + +

+ Enables the use of legacy MIME types for certain types of + font attachments. For example, + 'application/x-truetype-font' will be used for TrueType + fonts instead of 'fonts/ttf'. + +

+ + +

+ This affects both adding new attachments and replacing existing attachments, + but only if the new MIME type isn't specified. Other + existing attachments aren't changed. + +

+ + +

+ The affected MIME types are 'font/sfnt', + 'font/ttf' and 'font/collection' which + are all mapped to 'application/x-truetype-fonts' and + 'font/otf' which is mapped to + 'application/vnd.ms-opentype'. + +

+ +
+ + +

+ Други опции: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ Normally when the user requests changes to the 'language' + track header property, mkvpropedit(1) will apply the same change to the new + LanguageIETF track header element in addition to the + legacy Language element. If this option is used, the + change is only applied to the legacy Language + element. + +

+ + +

+ This option does not affect changes requested via the + 'language-ietf' track header property. + +

+ +
--normalize-language-ietf режим + +

+ Enables normalizing all IETF BCP 47 language tags to either their canonical + form with mode 'canonical', to their extended language + subtags form with mode 'extlang' or turns it off with + mode 'off'. By default normalization to the canonical + form is applied. + +

+ + +

+ In the canonical form all subtags for which preferred values exist are + replaced by those preferred values. This converts + e.g. 'zh-yue-jyutping' to + 'yue-jyutping' or 'fr-FX' to + 'fr-FR'. + +

+ + +

+ For the extended language subtags form the canonical form is built + first. Afterwards all primary languages for which an extended language + subtag exists are replaced by that extended language subtag and its + prefix. This converts e.g. 'yue-jyutping' back to + 'zh-yue-jyutping' but has no effect on + 'fr-FR' as 'fr' is not an extended + language subtag. + +

+ + +

+ This normalization is only applied to elements that are actually changed: + +

+ + +
    + +
  • + +

    + When editing track headers only those track language elements that are set + via edit specifications are affected. Languages of tracks that aren't edited + aren't changed. Editing a track but setting only properties other than the + language won't affect the language either. + +

    + +
  • + + +
  • + +

    + When editing chapters all language elements of all chapter elements are + affected as existing chapters are always fully replaced. + +

    + +
  • + + +
  • + +

    + When editing tags only the language elements of the tags that are actually + replaced are affected. For example, when you replace global tags then + existing track tags aren't affected. + +

    + +
  • + +
+ + +

+ The best way to normalize all existing language tags in a file is to remux + it with mkvmerge(1) and set its + '--normalize-language-ietf' option to the desired mode. + +

+ +
--command-line-charset + набор-от-символи + +

+ Sets the character set to convert strings given on the command line from. It + defaults to the character set given by system's current locale. + +

+ +
--output-charset набор-от-символи + +

+ Sets the character set to which strings are converted that are to be + output. It defaults to the character set given by system's current locale. + +

+ +
-r, --redirect-output име на + файла + +

+ Writes all messages to the file file-name instead of + to the console. While this can be done easily with output redirection there + are cases in which this option is needed: when the terminal reinterprets the + output before writing it to a file. The character set set with --output-charset + is honored. + +

+ +
--ui-language код + +

+ Forces the translations for the language code to be + used (e.g. 'de_DE' for the German + translations). Entering 'list' as the + code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Казва на програмата да прекрати работа непосредствено след появата на + първото предупреждение. Изходният код на програмата ще бъде 1. + +

+ +
--debug тема + +

+ Включи дебъгването за конкретна функция. Тази опция е полезна само за + разработчици. + +

+ +
--engage функция + +

+ Включване на експериментални функции. Списък с наличните функции може да + бъде поискан с mkvpropedit --engage list. По принцип тези + функции не са предназначени за използване при нормални обстоятелства. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that + can tell a controlling GUI what's happening. These messages follow the + format '#GUI#message'. The message may be followed by + key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the + messages nor the keys are ever translated and always output in English. + +

+ +
-v, --verbose + +

+ Be verbose and show all the important Matroska(tm) elements as they're read. + +

+ +
-h, --help + +

+ Покажи информацията за употребата и излез. + +

+ +
-V, --version + +

+ Покажи информация за версията и излез. + +

+ +
@файл-с-опции.json + +

+ Reads additional command line arguments from the file + options-file. For a full explanation on the supported + formats for such files see the section called "Option files" in the + mkvmerge(1) man page. + +

+ +
+ +

3. Селектори за редактиране

+ + +

+ The --edit option + sets the Matroska(tm) file section (segment information or a certain track's + headers) that all following add, set and delete actions operate + on. This stays valid until the next --edit option + is found. The argument to this option is called the edit selector. + +

+ + +

+ By default mkvpropedit(1) will edit the segment information section. + +

+ + +

3.1. Информация за сегмента

+ + +

+ The segment information can be selected with one of these three words: + 'info', 'segment_info' or + 'segmentinfo'. It contains properties like the segment + title or the segment UID. + +

+ + + +

3.2. Track headers

+ + +

+ Track headers can be selected with a slightly more complex selector. All + variations start with 'track:'. The track header + properties include elements like the language code, 'default track' flag or + the track's name. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ If the parameter n is a number then the + nth track will be selected. The track order is the + same that mkvmerge(1)'s --identify option outputs. + +

+ + +

+ Броенето започва от 1. + +

+ +
track:tn + +

+ If the parameter starts with a single character t + followed by a n then the nth + track of a specific track type will be selected. The track type parameter + t must be one of these four characters: + 'a' for an audio track, 'b' for a + button track, 's' for a subtitle track and + 'v' for a video track. The track order is the same that + mkvmerge(1)'s --identify option outputs. + +

+ + +

+ Броенето започва от 1. + +

+ +
track:=uid + +

+ If the parameter starts with a '=' followed by a number + uid, the track whose track UID + element equals the given uid will be selected. Track + UIDs can be obtained with mkvinfo(1). + +

+ +
track:@номер + +

+ If the parameter starts with a '@' followed by a number + number, the track whose track number element equals + this number will be selected. Track numbers can be + obtained with mkvinfo(1). + +

+ +
+ + + +

3.3. Бележки

+ + +

+ Due to the nature of the track edit selectors it is possible that several + selectors actually match the same track headers. In such cases all actions + for those edit selectors will be combined and executed in the order in which + they're given on the command line. + +

+ + +

4. Селектори за прикачени файлове

+ + + +

+ An attachment selector is used with the two actions --replace-attachment + and --delete-attachment. + It can have one of the following four forms: + +

+ + +
    + +
  1. + +

    + Selection by attachment ID. In this form the selector is simply a number, + the attachment's ID as output by mkvmerge(1)'s identification command. + +

    + +
  2. + + +
  3. + +

    + Selection by attachment UID (unique ID). In this form the selector is the + equal sign = followed by a number, the attachment's + unique ID as output by mkvmerge(1)'s verbose identification command. + +

    + +
  4. + + +
  5. + +

    + Selection by attachment name. In this form the selector is the literal word + name: followed by the existing attachment's name. If this + selector is used with --replace-attachment then colons + within the name to match must be escaped as \c. + +

    + +
  6. + + +
  7. + +

    + Selection by MIME type. In this form the selector is the literal word + mime-type: followed by the existing attachment's MIME + type. If this selector is used with --replace-attachment + then colons within the MIME type to match must be escaped as + \c. + +

    + +
  8. + +
+ +

5. Language handling

+ + + +

+ mkvpropedit(1) mostly tries to do the right thing by default. Therefore + changes to the language property will cause mkvpropedit(1) + to apply the same change to both the new "LanguageIETF" element as well as + the old "Language" element similar to how mkvmerge(1) applies the language to + both elements. For example, when using mkvpropedit movie.mkv --edit + track:2 --set language=zh-TW the "LanguageIETF" element will be + set to zh-TW and the old "Language" element to + chi. + +

+ + +

+ Additionally there's a new track header property named + language-ietf that can be set or removed. Changes to this + property only apply to the new "LanguageIETF" track header element. A caveat + is that the old "Language" track header element is a mandatory element in + Matroska — meaning even if it isn't present in the file it still has an + implied value. When the user only sets the language-ietf + property but not the language property, mkvpropedit(1) will + therefore add the old "Language" element in certain cases & set it to + und (meaning "undetermined") as the user didn't specify a + value for it. + +

+ + +

When reading XML chapter or tag files mkvpropedit(1) works like mkvmerge(1) + does. +

+ + +

The creation of the new elements can be disabled completely with the + command-line option `--disable-language-ietf` which operates on all three + new elements. +

+ + +

You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. +

+ +

6. Примери

+ + +

+ The following example edits a file called 'movie.mkv'. It + sets the segment title and modifies the language code of an audio and a + subtitle track. Note that this example can be shortened by leaving out the + first --edit option + because editing the segment information element is the default for all + options found before the first --edit option + anyway. + +

+ +
$ mkvpropedit клипче.mkv --edit info --set "title=Заглавие на филма" --edit track:a1 --set language=fre --edit track:a2 --set language=bul
+ +

+ The second example removes the 'default track flag' from the first subtitle + track and sets it for the second one. Note that mkvpropedit(1), unlike + mkvmerge(1), does not set the 'default track flag' of other tracks to '0' if + it is set to '1' for a different track automatically. + +

+ +
$ mkvpropedit клипче.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ Replacing the tags for the second subtitle track in a file looks like this: + +

+ +
$ mkvpropedit клипче.mkv --tags track:s2:нови-тагове-за-субтитри.xml
+ +

+ Removing all tags requires leaving out the file name: + +

+ +
$ mkvpropedit клипче.mkv --tags all:
+ +

+ Replacing the chapters in a file looks like this: + +

+ +
$ mkvpropedit клипче.mkv --chapters нови-епизоди.xml
+ +

+ Removing all chapters requires leaving out the file name: + +

+ +
$ mkvpropedit клипче.mkv --chapters ''
+ +

+ Добавяне на шрифт (Arial.ttf) като прикачен файл: + +

+ +
$ mkvpropedit клипче.mkv --add-attachment Arial.ttf
+ +

+ Adding a font file (89719823.ttf) as an attachment and + providing some information as it really is just Arial: + +

+ +
$ mkvpropedit клипче.mkv --attachment-name Arial.ttf --attachment-description 'Шрифтът Arial като TrueType шрифт' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ Replacing one attached font (Comic.ttf) file with another + one (Arial.ttf): + +

+ +
$ mkvpropedit клипче.mkv --attachment-name Arial.ttf --attachment-description 'Шрифтът Arial като TrueType шрифт' --replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ Deleting the second attached file, whatever it may be: + +

+ +
$ mkvpropedit клипче.mkv --delete-attachment 2
+ +

+ Изтриване на всички прикачени шрифтове по MIME тип: + +

+ +
$ mkvpropedit клипче.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. Кодове за изход

+ + + +

+ mkvpropedit(1) завършва с един от следните три изходни кода: + +

+ + +
    + +
  • + +

    + 0 -- Този изходен код означава, че модифицирането е + завършило успешно. + +

    + +
  • + + +
  • + +

    + 1 -- In this case mkvpropedit(1) has output at least one + warning, but the modification did continue. A warning is prefixed with the + text 'Warning:'. Depending on the issues involved the + resulting files might be ok or not. The user is urged to check both the + warning and the resulting files. + +

    + +
  • + + +
  • + +

    + 2 -- This exit code is used after an error occurred. + mkvpropedit(1) aborts right after outputting the error message. Error + messages range from wrong command line arguments over read/write errors to + broken files. + +

    + +
  • + +
+ +

8. Текстови файлове и конвертирания на набори от символи

+ + + +

+ For an in-depth discussion about how all tools in the MKVToolNix suite + handle character set conversions, input/output encoding, command line + encoding and console encoding please see the identically-named section in + the mkvmerge(1) man page. + +

+ +

9. Променливи на средата

+ + + +

+ mkvpropedit(1) използва променливите по подразбиране, определящи езиковата + променлива на системата (например LANG и от групата + LC_*). Допълнителни променливи: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG + and its short form MTX_DEBUG + +

Съдържанието се третира като все едно че е минато през --debug + опцията. +

+ +
MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE + and its short form MTX_ENGAGE + +

Съдържанието се третира като все едно че е минато през --engage + опцията. +

+ +
+ +

10. Виж също

+ + +

+ mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1) + +

+ +

11. Уебсайт

+ + +

+ Най-новата версия винаги може да бъде намерена на началната страница на MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..97d092539505b9bcf79ef340a3c1abdd875c0757 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/bg/mkvtoolnix-gui.html @@ -0,0 +1,163 @@ + + + + + mkvtoolnix-gui -- графичен потребителски интерфейс за mkvmerge1, включващ редактор на епизоди + (chapters) и редактор на метаданни + + + + +
mkvtoolnix-gui -- графичен потребителски интерфейс за mkvmerge(1), включващ редактор на епизоди + (chapters) и редактор на метаданни +
+
+ +
+

1. Резюме

+ + +
mkvtoolnix-gui [[конфигурационен-файл.mtxcfg] | [файл-източник.ext] | [матрьошка-файл.mkv] | [chapter-файл.ext] | [матрьошка-файл.mkv]] +
+ +

2. Описание

+ + +

+ mkvtoolnix-gui(1) e Qt(tm)-базиран + ГПИ (графичен потребителски интерфейс) за mkvmerge(1). Също + реализира и функционалностите на mkvinfo(1) и mkvpropedit(1), а в бъдеще ще + покрива и mkvextract(1). Всички настройки (например файлове-източници, опции + за пътечките и т.н.) могат да бъдат съхранени и възстановени. + +

+ + +

+ Конфигурационни файлове с разширението .mtxcfg карат + програмата да ги зареди в съответния инструмент. Всяко друго подадено + файлово име бива добавено като файл-източник за мултиплексиране, отворено в + инфо инструмента, редактора на метаданни или редактора на епизоди, в + зависимост от посочения режим. Режимът може да бъде посочен чрез + --merge, --info, + --edit-chapters или --edit-headers. По + подразбиране файловете биват добавени за мултиплексиране. + +

+ + +

+ Трябва да се отбележи, че ако инстанция на приложението вече се изпълнява, + то при повторно стартиране всички подадени имена на файлове в командния ред + ще бъдат отворени от вече вече изпълняващата се инстанция. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

Всички последвали файлове ще бъдат добавени като файлове-източници към + текущата мултиплекс задача. Това е режимът по подразбиране. +

+ +
--info + +

Всички последвали файлове ще бъдат отворени в инфо инструмента.

+ +

В допълнение, инфо инструментът ще бъде избран още при стартиране, вместо + мултиплексор инструмента. +

+ +
--edit-chapters + +

Всички последвали файлове ще бъдат отворени в редактора на епизоди.

+ +

В допълнение, редакторът на епизоди ще бъде избран още при стартиране, + вместо мултиплексор инструмента. +

+ +
--edit-headers + +

Всички последвали файлове ще бъдат отворени в редактора на метаданни.

+ +

В допълнение, редакторът на метаданни ще бъде избран още при стартиране, + вместо мултиплексор инструмента. +

+ +
-h, --help + +

+ Покажи информацията за употребата и излез. + +

+ +
-V, --version + +

+ Покажи информация за версията и излез. + +

+ +
+ +

3. Виж също

+ + +

+ mkvmerge(1), mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. Уебсайт

+ + +

+ Най-новата версия винаги може да бъде намерена на началната страница на MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..7b55b9eeafb6cb190e9f3a5f13271a8c9c6af2da --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvextract.html @@ -0,0 +1,1358 @@ + + + + + mkvextract -- Extreu les pistes des de fitxers Matroska a altres fitxers + + + +
mkvextract -- Extreu les pistes des de fitxers Matroska(tm) a altres fitxers +
+
+ +
+

1. Sinopsis

+ + +
mkvextract {nom-fitxer_origen} {mode1} opcions extracció-especificacions1 mode2 opcions extracció-especificacions2 … +
+ +

2. Descripció

+ + +

+ Aquest programa extreu parts específiques d'un fitxer Matroska(tm) a altres + formats útils. El primer argument és el nom del fitxer d'origen que haurà de + ser un fitxer Matroska(tm). + +

+ + +

+ Tots els altres arguments canviaran a un determinat mode d'extracció, + canviaran les opcions per al mode actual o s'especifcarà extreure a quin + fitxer. Es poden usar múltiples modes en la mateixa invocació del + «mkvextract», el qual permet l'extracció de múltiples coses en un sol + pas. La majoria de les opcions només es poden usar en determinats modes amb + algunes opcions que s'apliquen a tots els modes. + +

+ + +

+ Actualment s'admet l'extracció de pistes, etiquetes, adjunts, capítols, fulls de muntatge CUE, + codis de temps i + índexs. + +

+ + +

2.1. Opcions comunes

+ + + +

+ Les següents opcions estan disponibles en tots els modes i només es + descriuran en aquesta secció. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ Estableix el mode d'anàlisi a «full» (Completa). El mode per omissió no + analitzarà tot el fitxer, ja que empra la meta de cerca dels elements per a + localitzar els elements requerits d'un fitxer d'origen. En el 99% dels casos + n'hi ha prou. Però per a fitxers que no contenen elements meta de cerca o + que estan malmesos, l'usuari hauria d'emprar aquest mode. L'anàlisi completa + d'un fitxer pot requerir força temps, mentre que una anàlisi ràpida només + porta segons. + +

+ +
--command-line-charset + joc_de_caràcters + +

+ Estableix el joc de caràcters al qual convertir les cadenes indicades des de + la línia d'ordres. Per omissió serà el joc de caràcters donat per la + configuració regional actual del sistema. + +

+ +
--output-charset joc_de_caràcters + +

+ Estableix el joc de caràcters al qual convertir les cadenes de la + sortida. Per omissió serà el joc de caràcters donat per la configuració + regional actual del sistema. + +

+ +
-r, --redirect-output + nom_fitxer + +

+ Escriu tots els missatges al nom_fitxer en lloc de a + la consola. Si bé això es pot fer fàcilment amb la redirecció de la sortida, + hi ha casos en què cal aquesta opció: quan el terminal torna a interpretar + la sortida abans d'escriure-la a un fitxer. Es respectarà el joc de + caràcters establert amb --output-charset. + +

+ +
--flush-on-close + +

+ Li indica al programa que buidi totes les dades emmagatzemades a la memòria + cau de l'emmagatzematge en tancar els fitxers oberts per a escriure. Això es + pot usar per a evitar la pèrdua de dades en interrupcions d'electricitat o + per a evitar certs problemes en el sistema operatiu o els + controladors. L'inconvenient és que la multiplexació trigarà més, ja que el + «mkvmerge» esperarà fins que totes les dades s'hagin escrit a + l'emmagatzematge abans de sortir. Vegeu els problemes número 2469 i 2480 en + el seguiment d'errors del MKVToolNix per a un debat en profunditat sobre els + pros i els contres. + +

+ +
--ui-language codi + +

+ Força l'ús de les traduccions per al codi d'idioma + (p. ex., «de_DE» per a les traduccions en + alemany). Introduint «list» com a + codi, es farà que el programa ofereixi a la sortida + una llista de les traduccions disponibles. + +

+ +
--abort-on-warnings + +

+ Indica al programa que interrompi després d'emetre el primer avís. El codi + de sortida del programa serà 1. + +

+ +
--debug tema + +

+ Activa la depuració per a una característica específica. Aquesta opció només + és útil per als desenvolupadors. + +

+ +
--engage característica + +

+ Activa les característiques experimentals. Es pot sol·licitar una llista de + les característiques disponibles amb mkvextract --engage + list. Aquestes característiques no estan destinades a ser emprades + en situacions normals. + +

+ +
--gui-mode + +

+ Activa el mode IGU. En aquest mode, les línies surten amb un format especial + que pot explicar-vos el que està succeint per tal de controlar la + IGU. Aquests missatges segueixen el format + «#IGU#missatge». El missatge pot estar seguit per parells + clau/valor com + «#IGU#missatge#clau1=valor1#clau2=valor2…». Ni els + missatges ni les claus seran traduïdes, sempre sortiran en anglès. + +

+ +
-v, --verbose + +

+ Serà detallat i mostrarà tots els elements importants del Matroska(tm) a + mesura que es llegeixin. + +

+ +
-h, --help + +

+ Mostra la informació d'ús i surt. + +

+ +
-V, --version + +

+ Mostra la informació sobre la versió i surt. + +

+ +
@fitxer_d_opcions.json + +

+ Llegeix els arguments addicionals per a la línia d'ordres des del fitxer + fitxer_d_opcions. Per a més informació sobre els + formats admesos, vegeu la secció anomenada «Fitxers d'opcions» a la pàgina + man del mkvmerge(1). + +

+ +
+ + + +

2.2. Mode extracció de la pista

+ + + +

+ Sintaxi: mkvextract nom-fitxer_origen + tracks [opcions] + TID1:nom-fitxer_destinació1 + [TID2:nom-fitxer_destinació2 + ...] + +

+ + +

+ Hi ha disponibles les següents opcions de línia d'ordres per a cada pista en + el mode d'extracció «tracks» (pistes). Hauran d'aparèixer + al davant de l'especificació de la pista on s'hagin d'aplicar (vegeu a + sota). + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c joc_de_caràcters + +

+ Estableix el joc de caràcters per a convertir el text de la següent pista de + subtítols. Només serà vàlida si l'objectiu de l'ID es correspon amb una + pista de subtítols de text. Per omissió s'empra UTF-8. + +

+ +
--blockadd nivell + +

+ Només manté «BlockAdditions» fins aquest nivell. Per omissió ho manté en + tots els nivells. Aquesta opció només afectarà certs tipus de còdecs com + WAVPACK4. + +

+ +
--cuesheet + +

+ Fa que el mkvextract(1) extregui un full de muntatge (CUE + sheet) des de la informació dels capítols i les dades de les etiquetes per a + la següent pista a dins d'un fitxer el nom del qual serà el nom de sortida + de la pista amb un prefix «.cue». + +

+ +
--raw + +

+ Extreu les dades en RAW a un fitxer sense contenidor. A diferència de + l'etiqueta --fullraw, + aquesta etiqueta no causa que el contingut de l'element + CodecPrivate s'escrigui al fitxer. Aquest mode + funciona amb tots els CodecID, fins i tot amb els que + el mkvextract(1) no permet, però els fitxers resultants podrien no ser + usables. + +

+ +
--fullraw + +

+ Extreu les dades en RAW a un fitxer sense contenidor. El contingut de + l'element CodecPrivate s'escriurà en el primer fitxer + si la pista conté aquest element a la capçalera. Aquest mode funciona amb + tots els CodecID, fins i tot amb els que el + mkvextract(1) no permet, però els fitxers resultants podrien no ser usables. + +

+ +
TID:nom_sortida + +

+ Causa l'extracció de la pista amb l'ID TID al fitxer + nom_sortida, si aquesta pista existeix al fitxer + d'origen. Aquesta opció es pot emprar múltiples vegades. Els ID de les + pistes són els mateixos que mostra el mkvmerge(1) amb l'opció + --identify. + +

+ + +

+ Cada nom de sortida només s'ha d'emprar una vegada. L'única excepció són les + pistes RealAudio i RealVideo. Si empreu el mateix nom per a pistes + diferents, llavors aquestes seran emmagatzemades en el mateix + fitxer. Exemple: + +

+ +
$ mkvextract entrada.mkv tracks 0:video.h264 2:sortida-dues-pistes-vobsub.idx 3:sortida-dues-pistes-vobsub.idx
+
+ + + +

2.3. Mode extracció dels adjunts

+ + + +

+ Sintaxi: mkvextract nom-fitxer_origen + attachments + [opcions] + AID1:nom_sortida1 + [AID2:nom_sortida2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:nom_sortida + +

+ Causa l'extracció de l'adjunt amb l'ID AID al fitxer + nom_sortida, si aquest adjunt existeix al fitxer + d'origen. Si es deixa buit el nom_sortida, llavors + s'emprarà el nom de l'adjunt al fitxer Matroska(tm) d'origen. Aquesta opció es + pot emprar múltiples vegades. Els ID dels adjunts són els mateixos que + mostra el mkvmerge(1) amb l'opció --identify. + +

+ +
+ + + +

2.4. Mode extracció dels capítols

+ + + +

+ Sintaxi: mkvextract nom-fitxer_origen + chapters + [opcions] + nom-fitxer_sortida.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ Exporta la informació dels capítols en un format senzill, emprat en les + eines OGM (CHAPTER01=«...», CHAPTER01NAME=«...»). En aquest + mode es descartarà alguna informació. Per omissió la sortida dels capítols + serà en el format XML. + +

+ +
--simple-language idioma + +

+ Si el format senzill està habilitat, llavors el mkvextract(1) simplement + mostrarà una única entrada per a cada àtom de capítol trobat, fins i tot si + un àtom de capítol conté més d'un nom de capítol. Per omissió, el + mkvextract(1) emprarà el primer nom de capítol trobat per a cada àtom, + independentment del seu idioma. + +

+ + +

+ L'ús d'aquesta opció permet a l'usuari determinar quins són els noms dels + capítols de sortida si els àtoms contenen més d'un nom de capítol. El + paràmetre language ha de ser un codi ISO 639-1 o ISO + 639-2. + +

+ +
+ + +

+ Els capítols s'escriuran en un fitxer de sortida especificat. Per omissió, + s'utilitzarà el format XML entès pel mkvmerge(1). Si no es troba cap + capítol al fitxer, el fitxer de sortida no serà creat. + +

+ + + +

2.5. Mode extracció de les etiquetes

+ + + +

+ Sintaxi: mkvextract nom-fitxer_origen + tags [opcions] + nom-fitxer_sortida.xml + +

+ + +

+ Les etiquetes s'escriuran en un fitxer de sortida especificat, s'utilitzarà + el format XML entès pel mkvmerge(1). Si no es troba cap etiqueta al fitxer, + el fitxer de sortida no serà creat. + +

+ + + +

2.6. Mode extracció del full de muntatge

+ + + +

+ Sintaxi: mkvextract nom-fitxer_origen + cuesheet + [opcions] + nom-fitxer_sortida.cue + +

+ + +

+ El full de muntatge s'escriurà en un fitxer de sortida especificat. Si no es + troba cap capítol o etiqueta al fitxer, no es crearà el fitxer de sortida. + +

+ + + +

2.7. Mode extracció del codi de temps

+ + + +

+ Sintaxi: mkvextract nom-fitxer_origen + codis_de_temps_v2 + [opcions] + TID1:nom-fitxer_destinació1 + [TID2:nom-fitxer_destinació2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:nom_sortida + +

+ Causa l'extracció dels codis de temps per a la pista amb l'ID + TID al fitxer nom_sortida, si + aquesta pista existeix al fitxer d'origen. Aquesta opció es pot emprar + múltiples vegades. Els ID de les pistes són els mateixos que mostra el + mkvmerge(1) amb l'opció --identify. + +

+ + +

+ Exemple: + +

+ +
$ mkvextract entrada.mkv codis_de_temps_v2 1:pista-ts1.txt 2:pista-ts2.txt
+
+ + + +

2.8. Mode extracció dels índexs

+ + + +

+ Sintaxi: mkvextract nom-fitxer_origen + cues [opcions] + TID1:nom-fitxer_destinació1 + [TID2:nom-fitxer_destinació2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:nom_fitxer_destinació + +

+ Causa l'extracció dels índexs per a la pista amb l'ID + TID al fitxer nom_sortida, si + aquesta pista existeix al fitxer d'origen. Aquesta opció es pot emprar + múltiples vegades. Els ID de les pistes són els mateixos que mostra el + mkvmerge(1) amb l'opció --identify i no els números + continguts en l'element CueTrack. + +

+ +
+ + +

+ El format de la sortida és un senzill format de text: una línia per a cada + element CuePoint amb un parell + clau=valor. Si un element opcional no és present en un + CuePoint (p. ex., + CueDuration), llavors es retornarà un guió com a + valor. + +

+ + +

+ Exemple: + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

Les claus possibles són:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
timestamp + +

El codi de temps del punt de l'índex amb una precisió de nanosegons. El + format és HH:MM:SS.nnnnnnnnn. Aquest element s'establirà + sempre. +

+ +
duration + +

La durada del punt de l'índex amb una precisió de nanosegons. El format és + HH:MM:SS.nnnnnnnnn. +

+ +
cluster_position + +

La posició absoluta en bytes dins del fitxer Matroska(tm), on comença el + clúster que conté l'element de referència. +

+ + +
+

Note:

+ +

Dins del fitxer Matroska(tm), el CueClusterPosition es + refereix a la compensació a l'inici de les dades del segment. El valor de la + sortida és donat pel mode d'extracció de l'índex del mkvextract(1), però ja + conté aquesta compensació, la qual és absoluta a partir del començament del + fitxer. +

+ +
+ +
relative_position + +

La posició relativa en bytes dins del clúster on l'element + BlockGroup o SimpleBlock és el + punt de l'índex al qual es refereix al començament. +

+ + +
+

Note:

+ +

Dins del fitxer Matroska(tm), el CueRelativePosition es + refereix a la compensació a l'inici de les dades del clúster. El valor de + sortida serà donat pel mode d'extracció de l'índex del mkvextract(1), però és + relatiu a l'ID del clúster. La posició absoluta dins del fitxer es pot + calcular afegint cluster_position i + relative_position. +

+ +
+ +
+ + +

+ Exemple: + +

+ +
$ mkvextract entrada.mkv cues 1:índexs-pista1.txt 2:índexs-pista2.txt
+ +

3. Exemples

+ + + +

+ Extreure alhora els capítols i les etiquetes en els seus respectius formats + en XML: + +

+ +
$ mkvextract peli.mkv chapters capítols_peli.xml tags etiquetes_peli.xml
+ +

+ Extreure alhora un parell de pistes i els seus respectius codis de temps: + +

+ +
$ mkvextract "Una altra peli.mkv" tracks 0:video.h265 "1:àudio principal.aac" "2:comentaris del director.aac" codis_de_tempss_v2 "0:codis_de_temps del vídeo.txt" "1:codis_de_temps de l'àudio principal.txt" "2:codis_de_temps per als comentaris del director.txt"
+ +

+ Extreure capítols en el format Ogg/OGM i tornar a codificar una pista amb + subtítols de text a un altre joc de caràcters: + +

+ +
$ mkvextract "La meva peli.mkv" chapters --simple "Els meus capítols.txt" tracks -c MS-ANSI "2:Els meus subtítols.srt"
+

4. Conversió per a fitxers de text i jocs de caràcters

+ + + +

+ Per a un debat en profunditat sobre com manipula la suite MKVToolNix les + conversions entre els jocs de caràcters, codifica l'entrada/sortida, + codifica la línia d'ordres i codifica a la consola, si us plau, vegeu la + secció anomenada de la mateixa manera a la pàgina man del mkvmerge(1). + +

+ +

5. Formats per als fitxers de sortida

+ + + +

+ La decisió sobre el format de la sortida es basa en el tipus de pista, i no + en l'extensió usada en el nom del fitxer de sortida. Per ara, s'admeten els + següents tipus de pista: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ Tots els fitxers AAC s'escriuran en un fitxer + AAC amb capçaleres ADTS abans de cada + paquet. Les capçaleres ADTS no contindran l'obsolet camp + d'èmfasi. + +

+ +
A_AC3, A_EAC3 + +

+ Aquests s'extreuran als fitxers AC-3 en RAW. + +

+ +
A_ALAC + +

+ Les pistes ALAC s'escriuran en fitxers + CAF. + +

+ +
A_DTS + +

+ Aquests s'extreuran als fitxers DTS en RAW. + +

+ +
A_FLAC + +

+ Les pistes FLAC s'escriuran en fitxers + FLAC en RAW. + +

+ +
A_MPEG/L2 + +

+ Els fluxos d'àudio MPEG-1 nivell II s'extrauran a fitxers + MP2 en RAW. + +

+ +
A_MPEG/L3 + +

+ Aquests s'extreuran als fitxers MP3 en RAW. + +

+ +
A_OPUS + +

+ Les pistes Opus(tm) s'escriuran en fitxers + OggOpus(tm). + +

+ +
A_PCM/INT/LIT, A_PCM/INT/BIG + +

+ Les dades PCM sense processar s'escriuran en un fitxer + WAV. Les dades dels sencers big-endian es convertiran + durant el procès en dades little-endian. + +

+ +
A_REAL/* + +

+ Les pistes RealAudio(tm) s'escriuran en fitxers + RealMedia(tm). + +

+ +
A_TRUEHD, A_MLP + +

+ Aquests s'extreuran a fitxers TrueHD/MLP + sense processar. + +

+ +
A_TTA1 + +

+ Les pistes TrueAudio(tm) s'escriuran en fitxers + TTA. Si us plau, tingueu en compte que a causa de la + limitada precisió dels codis de temps del Matroska(tm), la capçalera extreta + del fitxer serà diferent pel que fa a dos camps: + data_length (el nombre total de fluxos en el fitxer) i la + CRC. + +

+ +
A_VORBIS + +

+ L'àudio Vorbis s'escriurà en un fitxer OggVorbis(tm). + +

+ +
A_WAVPACK4 + +

+ Les pistes WavPack(tm) s'escriuran en fitxers + WV. + +

+ +
S_HDMV/PGS + +

+ Els subtítols PGS s'escriuran com a fitxers + SUP. + +

+ +
S_HDMV/TEXTST + +

+ Els subtítols TextST s'escriuran com un format de fitxer + especial inventat per al mkvmerge(1) i mkvextract(1). + +

+ +
S_KATE + +

+ Els fluxos Kate(tm) s'escriuran dins d'un contenidor + Ogg(tm). + +

+ +
S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS + +

+ Els subtítols de text SSA i ASS + s'escriuran com a fitxers SSA/ASS + respectivament. + +

+ +
S_TEXT/UTF8, S_TEXT/ASCII + +

+ Els subtítols de text senzill s'escriuran com a fitxers + SRT. + +

+ +
S_VOBSUB + +

+ Els subtítols VobSub(tm) s'escriuran com a fitxers + SUB juntament amb els fitxers d'índex respectius, com a + fitxers IDX. + +

+ +
S_TEXT/USF + +

+ Els subtítols de text USF s'escriuran com a fitxers + USF. + +

+ +
S_TEXT/WEBVTT + +

+ Els subtítols WebVTT s'escriuran com a fitxers + WebVTT. + +

+ +
V_MPEG1, V_MPEG2 + +

+ Les pistes de vídeo MPEG-1 i MPEG-2 + s'escriuran com a fluxos elementals MPEG. + +

+ +
V_MPEG4/ISO/AVC + +

+ Les pistes de vídeo H.264 / AVC + s'escriuran en fluxos elementals H.264 que posteriorment es + poden processar, p. ex., amb MP4Box(tm) del paquet + GPAC(tm). + +

+ +
V_MPEG4/ISO/HEVC + +

+ Les pistes de vídeo H.265 / HEVC + s'escriuran a fluxos elementals H.265, els quals es poden + processar encara més, p. ex. MP4Box(tm) des del + paquet GPAC(tm). + +

+ +
V_MS/VFW/FOURCC + +

+ Les pistes de vídeo amb FPS fixos amb aquest + CodecID s'escriuran en fitxers AVI. + +

+ +
V_REAL/* + +

+ Les pistes RealVideo(tm) s'escriuran en fitxers + RealMedia(tm). + +

+ +
V_THEORA + +

+ Els fluxos Theora(tm) s'escriuran dins d'un + contenidor Ogg(tm). + +

+ +
V_VP8, V_VP9 + +

+ Les pistes VP8 / VP9 s'escriuran en + fitxers IVF. + +

+ +
Etiquetes + +

+ Les etiquetes es convertiran al format XML. Aquest és el mateix format que + admet el mkvmerge(1) per a llegir-les. + +

+ +
Adjunts + +

+ Els adjunts s'escriuran al fitxer de sortida tal com estan. No es realitzarà + cap mena de conversió. + +

+ +
Capítols + +

+ Els capítols es convertiran al format XML. Aquest és el mateix format que + admet el mkvmerge(1) per a llegir-los. Altrament, es pot generar una versió + reduïda amb un format senzill a l'estil OGM. + +

+ +
Codis de temps + +

+ Els codis de temps primer estan ordenats i després la sortida genera un + fitxer compatible amb un format de codis de temps v2 preparat per a ser + proporcionat al mkvmerge(1). L'extracció a altres formats (v1, v3 i v4) no és + admesa. + +

+ +
+ +

6. Codis de sortida

+ + + +

+ El mkvextract(1) sortirà amb un d'aquests tres codis de sortida: + +

+ + +
    + +
  • + +

    + 0 -- Aquest codi de sortida significa que l'extracció + s'ha realitzat correctament. + +

    + +
  • + + +
  • + +

    + 1 -- En aquest cas, el mkvextract(1) ha generat una + sortida amb almenys un avís, però l'extracció ha continuat. Un avís és + prefixat amb el text «Avís:». Depenent de les qüestions + involucrades, els fitxers resultants seran o no correctes. L'usuari serà + instat a revisar tant els avisos com els fitxers resultants. + +

    + +
  • + + +
  • + +

    + 2 -- Aquest codi de sortida s'empra després de + produir-se un error. El mkvextract(1) interromprà el procés just després de + mostrar el missatge d'error. L'interval dels missatges d'error va des + d'arguments incorrectes a la línia d'ordres fins a errors de + lectura/escriptura en fitxers malmesos. + +

    + +
  • + +
+ +

7. Variables d'entorn

+ + + +

+ El mkvextract(1) empra les variables per omissió que es determinen a la + configuració regional del sistema (p. ex., LANG i la + família LC_*). Variables addicionals: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG i + la seva forma abreujada MTX_DEBUG + +

El contingut es tractarà com si s'hagués passat l'opció --debug. +

+ +
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE i + la seva forma abreujada MTX_ENGAGE + +

El contingut es tractarà com si s'hagués passat l'opció --engage. +

+ +
+ +

8. Vegeu també

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. WWW

+ + +

+ Sempre trobareu l'última versió a la pàgina de les MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..b141cdbd88f8cadf2c543f6dcc7bf96fc88aa150 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvinfo.html @@ -0,0 +1,521 @@ + + + + + mkvinfo -- Imprimeix la informació quant als elements en els fitxers Matroska + + + +
mkvinfo -- Imprimeix la informació quant als elements en els fitxers Matroska(tm)
+
+ +
+

1. Sinopsis

+ + +
mkvinfo opcions {nom_fitxer_origen} +
+ +

2. Descripció

+ + +

+ Aquest programa mostra una llista de tots els elements continguts en un + fitxer Matroska(tm). La sortida es pot limitar a una llista de pistes en el + fitxer incloent informació sobre els còdecs emprats. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ De manera predeterminada, el mkvinfo(1) s'atura quan troba el primer + clúster. A més, no mostra certs elements que ocorren amb freqüència. Amb + aquesta opció, el mkvinfo(1) continuarà processant independentment del nivell + de verbositat i mostrarà tots els elements. + +

+ +
-c, --checksums + +

+ Calcula i mostra la suma de verificació Adler-32 per a + cada fotograma. Només és d'utilitat per a la depuració. + +

+ +
-o, --continue + +

+ De manera predeterminada, el mkvinfo(1) s'atura quan troba el primer + clúster. Amb aquesta opció, el mkvinfo(1) continuarà processant + independentment del nivell de verbositat. + +

+ +
-p, --hex-positions + +

+ Mostra les posicions de tots els elements en hexadecimal independentment del + nivell de verbositat. + +

+ +
-P, --positions + +

+ Mostra les posicions de tots els elements en decimal independentment del + nivell de verbositat. + +

+ +
-s, --summary + +

+ Només mostra un breu resum de què troba o no el mkvinfo(1) per a cada + element. + +

+ +
-t, --track-info + +

+ Mostra les estadístiques per a cada pista en el mode loquaç. També estableix + la loquacitat a 1 si abans era 0. + +

+ +
-x, --hexdump + +

+ Mostra els primers 16 bytes de cada fotograma com un bolcat hexadecimal. + +

+ +
-X, --full-hexdump + +

+ Mostra tots els bytes de cada fotograma com un bolcat hexadecimal. + +

+ +
-z, --size + +

+ Mostra la mida de cada element inclosa la seva capçalera. + +

+ +
--command-line-charset + joc_de_caràcters + +

+ Estableix el joc de caràcters al qual convertir les cadenes indicades des de + la línia d'ordres. Per omissió serà el joc de caràcters donat per la + configuració regional actual del sistema. + +

+ +
--output-charset joc_de_caràcters + +

+ Estableix el joc de caràcters al qual convertir les cadenes de la + sortida. Per omissió serà el joc de caràcters donat per la configuració + regional actual del sistema. + +

+ +
-r, --redirect-output + nom_fitxer + +

+ Escriu tots els missatges al nom_fitxer en lloc de a + la consola. Si bé això es pot fer fàcilment amb la redirecció de la sortida, + hi ha casos en què cal aquesta opció: quan el terminal torna a interpretar + la sortida abans d'escriure-la a un fitxer. Es respectarà el joc de + caràcters establert amb --output-charset. + +

+ +
--ui-language codi + +

+ Força l'ús de les traduccions per al codi d'idioma + (p. ex., «de_DE» per a les traduccions en + alemany). Introduint «list» com a + codi, es farà que el programa ofereixi a la sortida + una llista de les traduccions disponibles. + +

+ +
--abort-on-warnings + +

+ Indica al programa que interrompi després d'emetre el primer avís. El codi + de sortida del programa serà 1. + +

+ +
--debug tema + +

+ Activa la depuració per a una característica específica. Aquesta opció només + és útil per als desenvolupadors. + +

+ +
--engage característica + +

+ Activa les característiques experimentals. Es pot sol·licitar una llista de + les característiques disponibles amb mkvinfo --engage + list. Aquestes característiques no estan destinades a ser emprades + en situacions normals. + +

+ +
--gui-mode + +

+ Activa el mode IGU. En aquest mode, les línies surten amb un format especial + que pot explicar-vos el que està succeint per tal de controlar la + IGU. Aquests missatges segueixen el format + «#IGU#missatge». El missatge pot estar seguit per parells + clau/valor com + «#IGU#missatge#clau1=valor1#clau2=valor2…». Ni els + missatges ni les claus seran traduïdes, sempre sortiran en anglès. + +

+ +
-v, --verbose + +

+ Ser més loquaç. Vegeu la secció sobre els nivells de loquacitat per a + una descripció de quina informació sortirà en cada nivell. + +

+ +
-h, --help + +

+ Mostra la informació d'ús i surt. + +

+ +
-V, --version + +

+ Mostra la informació sobre la versió i surt. + +

+ +
@fitxer_d_opcions.json + +

+ Llegeix els arguments addicionals per a la línia d'ordres des del fitxer + fitxer_d_opcions. Per a més informació sobre els + formats admesos, vegeu la secció anomenada «Fitxers d'opcions» a la pàgina + man del mkvmerge(1). + +

+ +
+ +

3. Nivells de loquacitat

+ + + +

+ L'opció -v es pot + emprar per a incrementar el nivell de loquacitat del mkvinfo(1) i imprimir + més informació sobre el fitxer actual. + +

+ + +

+ En el nivell 0, el mkvinfo(1) només imprimirà les capçaleres de la pista que + troba i els seus tipus. El mkvinfo(1) sortirà tan aviat com s'hagin analitzat + completament les capçaleres (més tècnic: tan aviat com es trobi el primer + clúster). En aquest nivell, la cerca d'entrades de capçalera i els índexs no + seràn mostrats -encara que es trobin al capdavant de la informació de la + pista-. + +

+ + +

+ En el nivell 1, el mkvinfo(1) també imprimirà tots els elements Matroska(tm) + trobats en tot el fitxer mentre es realitzava la cerca d'entrades de + capçalera i de l'índex. Si està habilitat el mode resum, llavors el + mkvinfo(1) també generarà la posició del fotograma. + +

+ + +

+ Es pot aconseguir el mateix efecte amb l'opció --continue. + +

+ + +

+ En el nivell 2, el mkvinfo(1) també imprimirà la cerca de les entrades de + capçalera, les entrades de l'índex i la posició en el fitxer en la que s'ha + trobat cada element del Matroska(tm). + +

+ + +

+ Es pot aconseguir el mateix efecte amb les opcions --all + --positions. + +

+ + +

+ En el nivell 3 i superiors, el mkvinfo(1) imprimirà alguna informació que no + està directament relacionada amb l'element del Matroska(tm). De la resta + d'elements només s'imprimiran dades sobre que s'han trobat. El nivell 3 + també afegeix meta informació per tal de facilitar la depuració (llegiu: + està indicat per a desenvolupadors). Totes les línies escrites per al nivell + 3 estan tancades entre claudàtors per a facilitar-ne el filtratge. + +

+ +

4. Conversió per a fitxers de text i jocs de caràcters

+ + + +

+ Per a un debat en profunditat sobre com manipula la suite MKVToolNix les + conversions entre els jocs de caràcters, codifica l'entrada/sortida, + codifica la línia d'ordres i codifica a la consola, si us plau, vegeu la + secció anomenada de la mateixa manera a la pàgina man del mkvmerge(1). + +

+ +

5. Codis de sortida

+ + + +

+ El mkvinfo(1) sortirà amb un d'aquests tres codis de sortida: + +

+ + +
    + +
  • + +

    + 0 -- Aquest codi de sortida significa que l'execució + s'ha realitzat correctament. + +

    + +
  • + + +
  • + +

    + 1 -- En aquest cas, el mkvinfo(1) ha generat una sortida + amb almenys un avís, però continua executant-se. Un avís és prefixat amb el + text «Avís:». + +

    + +
  • + + +
  • + +

    + 2 -- Aquest codi de sortida s'empra després de + produir-se un error. El mkvinfo(1) interromprà el procés just després de + mostrar el missatge d'error. L'interval dels missatges d'error va des + d'arguments incorrectes a la línia d'ordres fins a errors de + lectura/escriptura en fitxers malmesos. + +

    + +
  • + +
+ +

6. Variables d'entorn

+ + + +

+ El mkvinfo(1) empra les variables per omissió que es determinen a la + configuració regional del sistema (p. ex., LANG i la + família LC_*). Variables addicionals: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUG, MKVTOOLNIX_DEBUG i la + seva forma abreujada MTX_DEBUG + +

El contingut es tractarà com si s'hagués passat l'opció --debug. +

+ +
MKVINFO_ENGAGE, MKVTOOLNIX_ENGAGE i la + seva forma abreujada MTX_ENGAGE + +

El contingut es tractarà com si s'hagués passat l'opció --engage. +

+ +
+ +

7. Vegeu també

+ + +

+ mkvmerge(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. WWW

+ + +

+ Sempre trobareu l'última versió a la pàgina de les MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..be36e462fe02617202b9e7842e8b6c89e7dbb42a --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvmerge.html @@ -0,0 +1,5374 @@ + + + + + mkvmerge -- Fusiona fluxos multimèdia dins d'un fitxer Matroska + + + +
mkvmerge -- Fusiona fluxos multimèdia dins d'un fitxer Matroska(tm)
+
+ +
+

1. Sinopsis

+ + +
mkvmerge opcions_globals {-o + sortida} opcions_1 {fitxer_1} opcions_2 {fitxer_2} @fitxer_d_opcions.json +
+ +

2. Descripció

+ + +

+ Aquest programa pren l'entrada des de diversos fitxers multimèdia d'entrada + i uneix els seus fluxos (tots o només els seleccionats) en un fitxer + Matroska(tm); vegeu el lloc web del + Matroska. + +

+ + +
+

Important:

+ +

+ L'ordre de les opcions a la línia d'ordres és important. Si us plau, si sou + novell emprant aquest programa, llegiu la secció «L'ordre de les opcions». + +

+ +
+ + +

2.1. Opcions globals

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

Incrementa la loquacitat.

+ +
-q, --quiet + +

Suprimeix la sortida sobre l'estat.

+ +
-o, --output + nom_fitxer + +

Escriu al nom_fitxer. Si s'empra la divisió, llavors + aquest paràmetre es tractarà de manera un xic diferent. Per a més detalls, + vegeu l'explicació sobre l'opció --split. +

+ +
-w, --webm + +

Crea un fitxer compatible amb WebM. També s'activa si l'extensió del nom del + fitxer de sortida és "webm". Aquest mode força diverses + restriccions. Els únics còdecs permesos són el vídeo VP8, VP9 i les pistes + d'àudio Opus, Vorbis. L'element de capçalera DocType es canviarà a + "webm". + +

+ + +

+ Per a capítols i etiquetes, només es permet un subconjunt d'elements. El + «mkvmerge(1)» eliminarà automàticament tots els elements no permesos per + l'especificació. + +

+ +
--title títol + +

Estableix el títol general per al fitxer de sortida, p. ex., el nom de la + pel·lícula. +

+ +
--default-language codi_idioma + +

Estableix el codi d'idioma per omissió que s'emprarà per a les pistes on no + s'hagi establert l'idioma amb l'opció --language i + per a les quals el contenidor d'origen no proporciona un idioma. +

+ + +

El codi d'idioma per omissió és «und» per a + «undetermined» (sense determinar). +

+ +
+ + + +

2.2. Informació quant a la manipulació del segment (opcions globals)

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo nom_fitxer.xml + +

+ Llegeix la informació del segment a partir d'un fitxer en + XML. Aquest fitxer pot contenir l'UID de + la família del segment, l'UID del segment, + l'UID del segment anterior i l'UID del + segment següent. Un fitxer i una DTD d'exemple estan + inclosos en la distribució de les MKVToolNix. + +

+ + +

+ Per a més detalls, vegeu més endavant la secció sobre els fitxers d'informació del segment en + XML. + +

+ +
--segment-uid SID1,SID2... + +

+ Estableix els UID dels segments a emprar. Aquesta és una llista separada per + comes dels UID dels segments de 128 bits en la forma usual de l'UID: nombres + hexadecimals, amb el prefix «0x» o sense, amb espais o sense, exactament 32 + dígits. + +

+ + +

+ Si el SID comença amb el signe =, llavors la resta s'interpretarà com el nom + d'un fitxer Matroska, es llegirà i emprarà l'UID del segment. + +

+ + +

+ Cada fitxer creat conté un segment, i cada segment té un UID del segment. Si + s'especifiquen més UID que segments, llavors els UID que sobrin seran + ignorats. Si s'especifiquen menys UID que segments, llavors es crearan de + manera aleatòria els UID que faltin. + +

+ +
+ + + +

2.3. Manipulació dels capítols i les etiquetes (opcions globals)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language codi_idioma + +

+ Estableix el codi d'idioma ISO 639-2 que s'escriurà en cada entrada de + capítol. Per omissió és «eng». Per a més detalls, vegeu + més endavant la secció sobre els + capítols. + +

+ + +

+ Aquesta opció es pot emprar tant per a senzills fitxers de capítols, com per + a fitxers d'origen que continguin capítols sense informació sobre l'idioma, + p. ex., fitxers MP4 i OGM. + +

+ + +

+ L'idioma establert amb aquesta opció també s'usarà quan es generin els + capítols amb l'opció --generate-chapters. + +

+ +
--chapter-charset joc_de_caràcters + +

+ Estableix el joc de caràcters que es farà servir per a la conversió a UTF-8 + per a senzills fitxers de capítols. Vegeu la secció sobre la conversió per a fitxers de + text i jocs de caràcters, per a veure una explicació sobre com + realitza el mkvmerge(1) la conversió entre diferents jocs de caràcters. + +

+ + +

+ Aquest ajustament també s'aplica als capítols que es copien des de certs + tipus de contenidors, p. ex., fitxers Ogg/OGM i MP4. Per a més detalls, + vegeu més endavant la secció sobre els capítols. + +

+ +
--chapter-sync + d[,o[/p]] + +

+ Ajusta els codis de temps dels capítols en el fitxer d'origen en + d ms. De manera alternativa, podeu utilitzar l'opció + --sync amb l'ID -2 de pista especial + (vegeu la secció sobre els ID + de pista especial). + +

+ + +

+ o/p: ajusta els codis de temps + en o/p, per a fixar + desfasaments lineals. Si s'omet, p per omissió serà + 1. Tant o com p poden ser + nombres decimals. + +

+ + +

+ Per omissió: no hi haurà cap correcció de sincronització manual (el qual és + el mateix que d = 0 i + o/p = + 1.0). + +

+ + +

+ Aquesta opció es pot emprar múltiples vegades per a un fitxer d'entrada + aplicant-la a diverses pistes, seleccionant els diferents ID de les pistes + cada vegada. + +

+ +
--generate-chapters mode + +

+ El mkvmerge(1) pot crear capítols de forma automàtica. Actualment estan + suportats els dos modes següents: + +

+ + +
    + +
  • + +

    + «when-appending» – Aquest mode crearà un capítol al + començament i un cada vegada que s'annexi un fitxer. + +

    + + +

    + Aquest mode també funciona amb els modes de divisió + 'parts:' i 'parts-frames:'. Per a + aquests modes, es generarà un capítol per a cada interval de la marca de + temps adjunta (aquestes marques del temps d'inici tenen el prefix + '+'). + +

    + + +
    +

    Note:

    + +

    + El mkvmerge(1) requereix que hi hagi una pista de vídeo o d'àudio present per + tal de poder determinar quan s'annexa un fitxer nou. Si es multiplexen una o + més pistes de vídeo, s'emprarà la primera. D'altra manera s'emprarà la + primera pista d'àudio. + +

    + +
    + +
  • + + +
  • + +

    + «interval:temps-especificat» – + Aquest mode crearà un capítol a intervals fixos donats per un + temps-especificat. El format segueix la forma + HH:MM:SS.nnnnnnnnn o com un número seguit per una de + les unitats «s», «ms» o + «us». + +

    + + +

    + Exemple: --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ Els noms per als capítols nous es controlen mitjançant l'opció --generate-chapters-name-template. + L'idioma s'estableix amb --chapter-language, + el qual haurà d'anar abans que --generate-chapters. + +

+ +
--generate-chapters-name-template + plantilla + +

+ Això estableix la plantilla del nom per als noms dels capítols generats per + l'opció --generate-chapters. + Si no s'empra aquesta opció, llavors s'emprarà el «Chapter + <NUM:2>» predeterminat. + +

+ + +

+ Hi ha diverses variables que es poden usar a la plantilla que seran + substituïdes amb els valors reals quan es generi un capítol. La cadena + «<NUM>» serà substituïda pel número de capítol. La + cadena «<START>» serà substituïda pel codi de temps + d'inici del capítol. + +

+ + +

+ Les cadenes «<FILE_NAME>» i + «<FILE_NAME_WITH_EXT>», que només funcionen quan es + generen capítols per a fitxers adjunts. Seran, respectivament substituïdes + pel nom del fitxer adjuntat, amb la seva extensió i sense. Recordeu que + només s'inseriran el nom base i l'extensió del fitxer, no el seu directori o + components de la unitat. + +

+ + +

+ Podeu especificar un nombre mínim de llocs per al número de capítol amb + «<NUM:places>», + p. ex. «<NUM:3>». El nombre resultant serà emplenat + amb zeros a l'esquerra si el nombre de posicions és menor que l'especificat. + +

+ + +

+ Podeu controlar el format emprat per al codi de temps d'inici amb + <START:format>. Si no s'indica cap, el format + predeterminat és «%H:%M:%S». Els codis de format vàlids + són: + +

+ + +
    + +
  • + +

    %h – hores +

    + +
  • + +
  • + +

    %H – hora de dos dígits farcida amb zeros +

    + +
  • + +
  • + +

    %m – minuts +

    + +
  • + +
  • + +

    %M – minuts de dos dígits farcits amb zeros +

    + +
  • + +
  • + +

    %s – segons +

    + +
  • + +
  • + +

    %S – segons de dos dígits farcits amb zeros +

    + +
  • + +
  • + +

    %n – nanosegons amb nou dígits +

    + +
  • + +
  • + +

    %<1-9>n – nanosegons amb fins a nou dígits (p. ex., + tres dígits amb %3n) +

    + +
  • + +
+ +
--cue-chapter-name-format format + +

+ El mkvmerge(1) pot llegir fulls de muntatge (CUE sheets) per + a fitxers d'àudio com a entrada per als capítols. Els fulls de muntatge + normalment contenen les entrades PERFORMER i + TITLE per a cada entrada de l'índex. El mkvmerge(1) usa + aquestes dues cadenes per a construir el nom del capítol. Amb aquesta opció, + es pot establir el format emprat per a aquest nom. + +

+ + +

+ Si no s'indica aquesta opció, llavors el mkvmerge(1) emprarà per omissió el + format «%p - %t» (l'artista, seguit per un espai, un guió, un + altre espai i el títol). + +

+ + +

+ Si s'indica el format, llavors es copiarà tot tal com està excepte els + següents meta caràcters que seran substituïts així: + +

+ + +
    + +
  • + +

    %p serà substituït per la cadena + PERFORMER a l'entrada, +

    + +
  • + +
  • + +

    %t serà substituït per la cadena + TITLE a l'entrada, +

    + +
  • + +
  • + +

    %n serà substituït pel número de la pista actual i, +

    + +
  • + +
  • + +

    %N serà substituït pel número de la pista actual + afegint-li un zero a l'esquerra si aquest número és menor que 10. +

    + +
  • + +
+ +
--chapters nom_fitxer + +

+ Llegeix la informació del capítol des del + nom_fitxer. Per a més detalls, vegeu més endavant la + secció sobre els capítols. + +

+ +
--global-tags nom_fitxer + +

+ Llegeix les etiquetes globals des del nom_fitxer. Per + a més detalls, vegeu més endavant la secció sobre les etiquetes. + +

+ +
+ + + +

2.4. Control general de la sortida (opcions globals avançades)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order FID1:TID1,FID2:TID2... + +

+ Aquesta opció canvia l'ordre en el qual es creen les pistes a partir d'un + fitxer d'entrada. L'argument és una llista separada per comes de parells + d'ID. Cada parell conté primer l'ID del fitxer + (FID1), el qual només és el número del fitxer a la + línia d'ordres partint de 0. El segon és un ID de pista + (TID1) d'aquest fitxer. Si s'ometen alguns ID de les + pistes, llavors aquestes pistes seran creades després de les establertes amb + aquesta opció. + +

+ +
--cluster-length especificació + +

+ Limita el nombre de blocs de dades o la durada de les dades en cada + clúster. El paràmetre especificació pot ser un número + n sense una unitat o un número + d amb el sufix «ms». + +

+ + +

+ Si no s'empra cap unitat, llavors el mkvmerge(1) tindrà com a màxim + n blocs d'informació a cada clúster. El nombre màxim + de blocs és 65535. + +

+ + +

+ Si el número d té el sufix «ms», + llavors el mkvmerge(1) posarà com a màxim d + mil·lisegons d'informació de dades en cada clúster. El valor mínim per a + d és «100ms», i el màxim és + «32000ms». + +

+ + +

+ Per omissió, el mkvmerge(1) posarà com a màxim 65535 blocs de dades i 5000ms + d'informació de dades a cada clúster. + +

+ + +

+ Els programes que intenten trobar un cert fotograma només poden cercar + directament a un clúster i posteriorment llegir tot el clúster. Per tant, el + fet de crear clústers molt grans podria comportar una cerca lenta i poc + precisa. + +

+ +
--clusters-in-meta-seek + +

+ Li indica al mkvmerge(1) que crei un element meta de cerca al final del + fitxer que contindrà tots els clústers. Vegeu també la secció sobre la disposició en els fitxers + Matroska. + +

+ +
--timestamp-scale factor + +

+ Força el factor d'escala dels codis de temps amb + factor. Els valors admesos estan compresos en + l'interval 1000..10000000 o el + valor especial -1. + +

+ + +

+ Normalment, el mkvmerge(1) emprarà el valor 1000000, el + qual vol dir que els codis de temps i durades tindran una precisió d'1 + ms. Per als fitxers que no continguin una pista de vídeo, però sí almenys + una d'àudio, el mkvmerge(1) triarà automàticament un factor d'escala per als + codis de temps, de manera tots els codis de temps i durades tindran una + precisió d'una mostra d'àudio. Això causarà una major sobrecàrrega, però + permetrà que la cerca i extracció siguin més precises. + +

+ + +

+ Si s'usa el valor especial -1, llavors el mkvmerge(1) + emprarà la precisió de la mostra, encara que hi hagi una pista de vídeo. + +

+ +
--enable-durations + +

+ Escriu les durades per a tots els blocs. Això incrementarà la mida del + fitxer, i al moment no oferirà cap valor addicional als reproductors. + +

+ +
--no-cues + +

+ Li indica al mkvmerge(1) que no crei i escrigui les dades de l'índex, el qual + es pot comparar amb l'índex d'un AVI. Els fitxers Matroska(tm) es poden + reproduir sense les dades de l'índex, però la cerca probablement serà poc + precisa i lenta. Empreu això només si realment esteu desesperat per a + estalviar espai o amb finalitat de proves. Vegeu també que l'opció --cues es pot + especificar per a cada fitxer d'entrada. + +

+ +
--no-date + +

+ De manera predeterminada, el mkvmerge(1) establirà el camp d'informació del + segment «data» a la data i hora de quan s'ha iniciat la multiplexació. Amb + aquesta opció, aquest camp no s'escriurà mai. + +

+ +
--disable-lacing + +

+ Inhabilita el lligam per a les pistes. Això incrementarà la mida del fitxer, + especialment si hi ha moltes pistes d'àudio. Aquesta opció no ha estat + dissenyada per a un ús freqüent. + +

+ +
--disable-track-statistics-tags + +

+ Normalment, el mkvmerge(1) escriu algunes etiquetes amb estadístiques per a + cada pista. Si aquestes etiquetes ja estan presents, llavors se + sobreescriuran. Les etiquetes són BPS, + DURATION, NUMBER_OF_BYTES i + NUMBER_OF_FRAMES. + +

+ + +

+ El fet d'habilitar aquesta opció impedeix que el mkvmerge(1) escrigui i editi + les etiquetes existents que tinguin els mateixos noms. + +

+ +
--disable-language-ietf + +

+ Normalment, el mkvmerge(1) escriurà els elements nous d'idioma BCP 47 de la + IETF a més dels elements heretats d'idioma en les capçaleres de les + pistes. Si s'utilitza aquesta opció, només s'escriuran els elements + heretats. + +

+ +
--normalize-language-ietf mode + +

+ Permet normalitzar totes les etiquetes d'idioma BCP 47 de la IETF a la seva + forma canònica amb el mode «canonical», a la seva forma + d'idioma estès amb el mode «extLang» o la desactiva amb + el mode «off». Per defecte, s'aplicarà la normalització a + la forma canònica. + +

+ + +

+ En la forma canònica, totes les subetiquetes per a les quals existeixen els + valors preferits se substitueixen per aquells valors preferits. Això es + converteix, p. ex. «zh-yue-jyutping» a + «yue-jyutping» o «fr-FX» a + «fr-FR». + +

+ + +

+ Per a la forma de les subetiquetes d'idioma estès, primer es construeix la + forma canònica. Després, tots els idiomes principals per als quals existeix + una subetiqueta d'idioma estès se substitueixen per aquesta subetiqueta i el + seu prefix d'idioma estès. Això converteix, + p. ex. «yue-jyutping» torna a + «zh-yue-jyutping», però no té cap efecte sobre + «fr-FR» ja que «fr» no és una + subetiqueta d'idioma estès. + +

+ +
--stop-after-video-ends + +

+ Deixa de processar una vegada finalitzi la pista de víde principal, + descartant els paquets restants d'altres pistes. + +

+ +
+ + + +

2.5. Divisió, vinculació, annexat i concatenació dels fitxers (més opcions + globals)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split especificació + +

+ Divideix el fitxer de sortida després d'una mida o temps especificat. Si us + plau, tingueu en compte que aquestes pistes només es poden dividir just + abans d'un fotograma clau. Per tant, el punt de divisió podria ser un xic + diferent de l'especificat per l'usuari. + +

+ + +

+ Fins ara, el mkvmerge(1) admet els modes següents: + +

+ + +
    + +
  1. + +

    + Divisió per la mida. + +

    + + +

    + Sintaxi: --split + [size:]d[k|m|g] + +

    + + +

    + Exemples: --split size:700m o --split 150000000 + +

    + + +

    + El paràmetre d pot acabar amb «k», + «m» o «g» per a indicar que la mida és + en KB, MB o GB respectivament. D'altra manera, s'assumirà que la mida és en + bytes. Una vegada el fitxer de sortida actual abasti la mida límit, + començarà la creació d'un altre fitxer. + +

    + + +

    + El prefix «size:» es pot ometre per motius de + compatibilitat. + +

    + +
  2. + + +
  3. + +

    + Divisió després d'una durada. + +

    + + +

    + Sintaxi: --split + [duration:]HH:MM:SS.nnnnnnnnn|ds + +

    + + +

    + Exemples: --split duration:00:60:00.000 o --split + 3600s + +

    + + +

    + El paràmetre pot tenir la forma HH:MM:SS.nnnnnnnnn + per a especificar la durada amb una precisió de nanosegons, o pot ser un + número d seguit per la lletra «s» + per a una durada en segons. HH és el número de les + hores, MM és el dels minuts, + SS és el dels segons i + nnnnnnnnn és el dels nanosegons. Tant el número de + les hores com el dels nanosegons es poden ometre. Hi ha fins a nou dígits + després del punt decimal. Una vegada el fitxer de sortida actual abasti la + durada límit, començarà la creació d'un altre fitxer. + +

    + + +

    + El prefix «duration:» es pot ometre per motius de + compatibilitat. + +

    + +
  4. + + +
  5. + +

    + Divisió després d'uns codis de temps específics. + +

    + + +

    + Sintaxi: --split + timestamps:A[,B[,C...]] + +

    + + +

    + Exemple: --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + Els paràmetres A, B, + C, etc. poden tenir el mateix format que l'emprat per + a la durada (vegeu més amunt). La llista dels codis de temps està separada + per comes. Una vegada el flux d'entrada abasti el punt de divisió per al + codi de temps actual, es crearà un fitxer nou. Llavors s'emparà el següent + punt de divisió especificat a la llista. + +

    + + +

    + El prefix «timestamps:» no es pot ometre. + +

    + +
  6. + + +
  7. + +

    + Manté les parts específiques per als intervals de codis de temps + especificats mentre que les altres seran descartades. + +

    + + +

    + Sintaxi: --split + parts:inici_1-final_1[,[+]inici_2-final_2[,[+]inici_3-final_3...]] + +

    + + +

    + Exemples: +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + El mode parts li indica al mkvmerge(1) que mantingui certs + intervals de codis de temps mentre es descarten altres. Els intervals a + mantenir s'han de llistar després de la paraula clau + parts: i s'han de separar amb comes. Un interval, en si + mateix, consisteix d'un inici i un final, en el mateix format i altres + variacions que accepta --split (p. ex., tant + 00:01:20 com 80s es refereixen al + mateix codi de temps). + +

    + + +

    + Si s'omet un codi de temps d'inici, llavors per omissió s'emprarà el codi de + temps final de l'interval anterior. Si no hi ha un interval anterior, + llavors per omissió s'emprarà el d'inici del fitxer (vegeu l'exemple 3). + +

    + + +

    + Si s'omet el codi de temps final, llavors per omissió es prendrà el valor + final dels fitxers d'origen. El qual bàsicament li indicarà al mkvmerge(1) + que mantingui la resta (vegeu l'exemple 3). + +

    + + +

    + Normalment, cada interval serà escrit a un fitxer nou. Això es pot canviar + de manera que els intervals consecutius s'escriguin en el mateix fitxer. Per + a fer-ho, l'usuari haurà d'assignar el prefix + al codi + de temps d'inici. Això li indicarà al mkvmerge(1) que no creï un fitxer nou i + en comptes d'això, que annexi l'interval després de l'últim interval escrit + al fitxer. Els codis de temps seran ajustats de manera que no hi hagi + discontinuïtats en el fitxer de sortida, fins i tot si n'hi havia una entre + dos intervals al fitxer d'entrada. + +

    + + +

    + En l'exemple 1, el mkvmerge(1) crearà dos fitxers. El primer abastarà el + contingut a partir de 00:01:20 fins a + 00:02:45. El segon abastarà el contingut a partir de + 00:05:50 fins a 00:10:30. + +

    + + +

    + En l'exemple 2, el mkvmerge(1) crearà un únic fitxer. Aquest abastarà ambdós, + el contingut a partir de 00:01:20 fins a + 00:02:45 i el contingut a partir de + 00:05:50 fins a 00:10:30. + +

    + + +

    + En l'exemple 3, el mkvmerge(1) crearà dos fitxers. El primer abastarà el + contingut des del començament dels fitxers d'origen fins a + 00:02:45. El segon abastarà el contingut a partir de + 00:05:50 fins al final dels fitxers d'origen. + +

    + + +
    +

    Note:

    + +

    + Recordeu que el mkvmerge(1) només pren decisions sobre la divisió a les + posicions dels fotogrames clau. Això és aplicable tant a l'inici com al + final de cada interval. De manera que si un codi de temps final es troba + entre dos fotogrames clau, el mkvmerge(1) continuarà amb la sortida dels + fotogrames fins al final, però excloent el següent fotograma clau. + +

    + +
    + +
  8. + + +
  9. + +

    + Manté les parts específiques per als intervals del número de fotograma/camp + especificats mentre que les altres seran descartades. + +

    + + +

    + Sintaxi: --split + parts-frames:inici_1-final_1[,[+]inici_2-final_2[,[+]inici_3-final_3...]] + +

    + + +

    + Exemples: +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + El mode parts-frames li indica al mkvmerge(1) que + mantingui certs intervals numèrics de fotogrames/camps, mentre es descarten + altres. Els intervals a mantenir s'han d'especificar després de la paraula + clau parts-frames: i separar-los amb comes. Un interval + consisteix en un número de fotograma/camp d'inici i final. La numeració + comença per l'1. + +

    + + +

    + Si s'omet un número d'inici, llavors per omissió s'emprarà el número final + de l'interval anterior. Si no hi ha un interval anterior, llavors per + omissió s'emprarà el d'inici del fitxer (vegeu l'exemple 3). + +

    + + +

    + Si s'omet el número final, llavors per omissió es prendrà el valor final + dels fitxers d'origen. El qual bàsicament li indicarà al mkvmerge(1) que + mantingui la resta (vegeu l'exemple 3). + +

    + + +

    + Normalment, cada interval serà escrit a un fitxer nou. Això es pot canviar + de manera que els intervals consecutius s'escriguin en el mateix fitxer. Per + a fer-ho, l'usuari haurà d'assignar el prefix + al número + d'inici. Això li indicarà al mkvmerge(1) que no creï un fitxer nou i en + comptes d'això, que annexi l'interval després de l'últim interval escrit al + fitxer. Els codis de temps seran ajustats de manera que no hi hagi + discontinuïtats en el fitxer de sortida, fins i tot si n'hi havia una entre + dos intervals al fitxer d'entrada. + +

    + + +
    +

    Note:

    + +

    + Recordeu que el mkvmerge(1) només pren decisions sobre la divisió a les + posicions dels fotogrames clau. Això és aplicable tant a l'inici com al + final de cada interval. De manera que si un número de fotograma/camp final + es troba entre dos fotogrames clau, el mkvmerge(1) continuarà amb la sortida + dels fotogrames fins al final, però excloent el següent fotograma clau. + +

    + +
    + + +

    + En l'exemple 1, el mkvmerge(1) crearà dos fitxers. El primer abastarà el + contingut a partir del primer fotograma clau o després del + 137, però sense incloure el primer fotograma clau o + després del 258. El segon abastarà el contingut a partir + del 548 fins al 1211. + +

    + + +

    + En l'exemple 2, el mkvmerge(1) crearà un únic fitxer. Aquest abastarà ambdós, + el contingut a partir del 733 fins al + 912 i el contingut a partir del 1592 + fins al 2730. + +

    + + +

    + En l'exemple 3, el mkvmerge(1) crearà dos fitxers. El primer abastarà el + contingut des del començament dels fitxers d'origen fins al + 430. El segon abastarà el contingut a partir del + 2512 fins al final dels fitxers d'origen. + +

    + + +

    + Aquest mode només considerarà la primera pista de vídeo que es genera. Si no + hi ha cap pista de vídeo a la sortida, no es produirà cap divisió. + +

    + + +
    +

    Note:

    + +

    + Els números indicats amb aquest argument són interpretats partint del nombre + de blocs Matroska(tm) que es generen. Un únic bloc Matroska(tm) conté tot un + fotograma (per a contingut progressiu) o només un camp (per a contingut + entrellaçat). El mkvmerge(1) no fa distincions entre els dos i només compta + el nombre de blocs. Per exemple: Si es vol dividir després del 25è fotograma + amb material entrellaçat, llavors s'haurà d'emprar 50 + (dos camps per a tot un fotograma) com a punt de tall. + +

    + +
    + +
  10. + + +
  11. + +

    + Divisió després d'uns fotogrames/camps específics. + +

    + + +

    + Sintaxi: --split + frames:A[,B[,C...]] + +

    + + +

    + Exemple: --split frames:120,237,891 + +

    + + +

    + Els paràmetres A, B, + C, etc. hauran de ser tots sencers positius. La + numeració comença per l'1. La llista de números de fotograma/camp estarà + separada per comes. Una vegada el flux d'entrada hagi abastat el número de + fotograma/camp del punt de tall actual, es crearà un fitxer nou. Després + s'emprarà el següent punt de tall indicat a la llista. + +

    + + +

    + El prefix «frames:» no es pot ometre. + +

    + + +

    + Aquest mode només considerarà la primera pista de vídeo que es genera. Si no + hi ha cap pista de vídeo a la sortida, no es produirà cap divisió. + +

    + + +
    +

    Note:

    + +

    + Els números indicats amb aquest argument són interpretats partint del nombre + de blocs Matroska(tm) que es generen. Un únic bloc Matroska(tm) conté tot un + fotograma (per a contingut progressiu) o només un camp (per a contingut + entrellaçat). El mkvmerge(1) no fa distincions entre els dos i només compta + el nombre de blocs. Per exemple: Si es vol dividir després del 25è fotograma + amb material entrellaçat, llavors s'haurà d'emprar 50 + (dos camps per a tot un fotograma) com a punt de tall. + +

    + +
    + +
  12. + + +
  13. + +

    + Dividir abans de capítols específics. + +

    + + +

    + Sintaxi: --split chapters:all o + --split + chapters:A[,B[,C...]] + +

    + + +

    + Exemple: --split chapters:5,8 + +

    + + +

    + Els paràmetres A, B, + C, etc. hauran de ser tots sencers positius. La + numeració comença per l'1. La llista de capítols estarà separada per + comes. La divisió succeirà just abans del primer fotograma clau on el codi + de temps sigui igual o major que el codi de temps d'inici per als capítols + dels números llistats. Un capítol que comença al 0 s mai es tindrà en compte + per a la divisió i serà omès silenciosament. + +

    + + +

    + La paraula clau «all» es pot emprar en lloc d'una llista + manual de tots els números de capítols. + +

    + + +

    + El prefix «chapters:» no es pot ometre. + +

    + + +
    +

    Note:

    + +

    + El format de fitxer Matroska(tm) admet estructures de capítols arbitràries i + aniuades profundament, anomenades «entrades de l'edició» (edition entries) i + «àtoms del capítol» (chapter atoms). No obstant això, aquest mode només + tindrà en compte el nivell més alt dels capítols al llarg de totes les + entrades de l'edició. + +

    + +
    + +
  14. + +
+ + +

+ En aquest mode de divisió, el nom del fitxer de sortida serà tractat de + manera diferent que amb el funcionament normal. Pot contenir un + printf com l'expressió «%d», incloent-hi + una amplada de camp opcional, p. ex., «%02d». Si es fa després + del número del fitxer actual, serà formatat adequadament i inserit en aquest + punt del nom del fitxer. Si no hi ha aquest patró, llavors s'assumirà + «-%03d» com a patró just abans de l'extensió del fitxer: + «-o sortida.mkv» resultaria en «sortida-001.mkv» i + així en endavant. Si no hi ha extensió, llavors s'annexarà + «-%03d» al nom. + +

+ + +

+ Un altre possible patró és «%c», el qual serà substituït pel + nom del primer capítol en el fitxer. Recordeu que quan es troba present + «%c», el patró «-%03d» no s'afegirà + automàticament. + +

+ +
--link + +

+ Els fitxers es vinculen a altres quan es divideix el fitxer de sortida. Per + a més detalls, vegeu la següent secció sobre vincular els fitxers. + +

+ +
--link-to-previous UID_segment + +

+ Vincula el primer fitxer de sortida al segment amb l'UID del segment indicat + mitjançant el paràmetre UID_segment. Per a més + detalls, vegeu la següent secció sobre vincular els fitxers. + +

+ + +

+ Si el SID comença amb el signe =, llavors la resta s'interpretarà com el nom + d'un fitxer Matroska, es llegirà i emprarà l'UID del segment. + +

+ +
--link-to-next UID_segment + +

+ Vincula l'últim fitxer de sortida al segment amb l'UID del segment indicat + mitjançant el paràmetre UID_segment. Per a més + detalls, vegeu la següent secció sobre vincular els fitxers. + +

+ + +

+ Si el SID comença amb el signe =, llavors la resta s'interpretarà com el nom + d'un fitxer Matroska, es llegirà i emprarà l'UID del segment. + +

+ +
--append-mode mode + +

+ Determina com es calcularan els codis de temps en annexar els fitxers. El + paràmetre mode pot tenir dos valors: + «file» (fitxer) que és l'opció per omissió i + «track» (pista). + +

+ + +

+ Quan el mkvmerge annexa una pista (anomenada «pista2_1» + d'ara endavant) des d'un segon fitxer (anomenat + «fitxer_2») a una pista (anomenada + «pista1_1») des del primer fitxer (anomenat + «fitxer_1») llavors compensarà una quantitat en tots els + codis de temps per a la «pista2_1». En el mode + «file» aquesta quantitat serà el codi de temps més gran + trobat en el «fitxer_1», fins i tot si aquest codi de + temps provingués d'una pista diferent de «pista1_1». En + el mode «track», la compensació serà el codi de temps més + gran de la «pista1_1». + +

+ + +

+ Malauradament, el mkvmerge(1) no pot detectar quin mode és més oportú + emprar. Per tant, per omissió emprarà el mode + «file». Aquest mode, en general funciona millor per a + fitxers que es creen de manera independent els uns dels altres; p. ex., quan + s'annexen fitxers AVI o MP4. El mode + «track» podria funcionar millor per a orígens que + essencialment només formen part d'un fitxer gran, p. ex., per a fitxers + VOB i EVO. + +

+ + +

+ Les pistes de subtítols sempre seran tractades com si estigués actiu el mode + «file», fins i tot si el que està actiu és el mode + «track». + +

+ +
--append-to + SFID1:STID1:DFID1:DTID1[...] + +

+ Aquesta opció controla quina pista és annexada a una altra. Cada + especificació conté quatre ID: un identificador de fitxer (SFID1), un + identificador de pista (STID1), un segon identificador de fitxer (DFID1) i + un segon identificador de pista (DTID1). El primer parell, l'«ID del fitxer + d'origen» i l'«ID de la pista de l'origen», identifiquen la pista que s'ha + d'annexar. El segon parell, l'«ID del fitxer de destinació» i l'«ID de la + pista de destinació», identifiquen la pista a la qual s'ha d'annexar la + primera. + +

+ + +

+ Si s'omet aquesta opció, llavors s'emprarà un mapatge estàndard. Aquest, + annexarà cada pista del fitxer actual a una pista del fitxer anterior amb el + mateix ID de pista. Això permet annexar amb facilitat dos fitxers que havien + estat dividits a partir d'una pel·lícula, si tenen el mateix nombre de + pistes i ID de les pistes, amb l'ordre: mkvmerge -o sortida.mkv + part1.mkv +part2.mkv. + +

+ +
+ + +

+ Un únic signe «+» causarà que s'annexi el fitxer següent en comptes + d'afegir-lo. El signe «+» també es pot posar davant del nom de fitxer + següent. Per tant, les dues ordres següents són equivalents: + +

+ +
$ mkvmerge -o complet.mkv fitxer_1.mkv + fitxer_2.mkv
+$ mkvmerge -o complet.mkv fitxer_1.mkv +fitxer_2.mkv
+
[ fitxer_1 + fitxer_2 ] + +

+ Si hi ha entre claudàtors múltiples noms de fitxer, llabors el segon fitxer + i tots els següents seran annexats al primer fitxer. + +

+ + +

+ Aquesta és una sintaxi alternativa a l'ús del caràcter «+» entre els noms de + fitxer. Per tant, les dues ordres següents són equivalents: + +

+ +
$ mkvmerge -o complet.mkv fitxer_1.mkv + fitxer_2.mkv
+$ mkvmerge -o complet.mkv '[' fitxer_1.mkv fitxer_2.mkv ']'
+
= + +

+ Per a certs tipus de fitxers (els fluxos de programes MPEG = VOB) el + mkvmerge(1) normalment cercarà els fitxers en el mateix directori que un + fitxer d'entrada que tingui el mateix nom base i només difereixen en el seu + número d'execució (p. ex., «VTS_01_1.VOB», «VTS_01_2.VOB», «VTS_01_3.VOB», + etc.) i els tractarà tots com si estiguessin concatenats (units) en un únic + gran fitxer. Aquesta opció, un únic «=», fa que el mkvmerge no cerqui + aquests fitxers addicionals. + +

+ + +

+ El signe «=» també es pot posar davant del nom de fitxer següent. Per tant, + les dues ordres següents són equivalents: + +

+ +
$ mkvmerge -o complet.mkv = fitxer_1.vob
+$ mkvmerge -o complet.mkv =fitxer_1.vob
+
( fitxer_1 + fitxer_2 ) + +

+ Si hi ha entre parèntesis múltiples noms de fitxer, llavors aquests seran + tractats com si estiguessin concatenats (units) en un únic gran fitxer, el + qual consistirà en el contingut de cadascun dels fitxers, l'un darrere + l'altre. + +

+ + +

+ Per exemple, això es pot emprar amb fitxers VOB procedents d'un DVD o fluxos + de transport MPEG. No es pot emprar si cada fitxer conté el seu propi + conjunt de capçaleres, el qual sol ser el cas amb fitxers com AVI o MP4. + +

+ + +

+ Posar el nom del fitxer entre parèntesis, també evitarà que el mkvmerge(1) + cerqui fitxers addicionals amb el mateix nom base tal com s'ha descrit en + l'opció + =. Per tant, aquestes dues línies d'ordres són + equivalents: + +

+ +
$ mkvmerge -o sortida.mkv = fitxer.mkv
+$ mkvmerge -o sortida.mkv '(' fitxer.mkv ')'
+ +

+ Hi ha diverses coses que s'han de tenir en compte: + +

+ + +
    + +
  1. + +

    + Hi ha d'haver un espai després d'obrir i abans de tancar els signes de + parèntesi. + +

    + +
  2. + + +
  3. + +

    + Cada paràmetre entre parèntesis s'interpretarà com un nom de fitxer. Per + tant, totes les opcions que s'hagin d'aplicar a aquest fitxer, per lògica + s'hauran d'introduir abans del signe d'obertura del parèntesi. + +

    + +
  4. + + +
  5. + +

    + Alguns intèrprets d'ordres tracten els parèntesis com a caràcters + especials. Per tant, s'hauran d'escapar o posar entre cometes senzilles tal + com es mostra en l'exemple anterior. + +

    + +
  6. + +
+ +
+ + + + +

2.6. Implementació per a adjunts (més opcions globals)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description descripció + +

+ Descripció en text pla del següent adjunt. S'aplicarà a la següent opció + --attach-file + o --attach-file-once. + + +

+ +
--attachment-mime-type tipus_MIME + +

+ El tipus MIME del següent adjunt. S'aplicarà a la següent + opció --attach-file + o --attach-file-once. + Es pot trobar una llista oficial de tipus MIME reconeguts + a, p. ex., la + pàgina web de la IANA. El tipus MIME és obligatori + per a un adjunt. + +

+ + +

+ Si no s'indica cap tipus MIME per a un adjunt, el seu tipus + es detectarà automàticament. + +

+ +
--attachment-name nom + +

+ Estableix el nom per a aquest adjunt que s'emmagatzemarà al fitxer de + sortida. Si no s'especifica aquesta opció, llavors el nom derivarà del nom + del fitxer de l'adjunt especificat amb l'opció --attach-file + o --attach-file-once. + +

+ +
+ --attach-file nom_fitxer, + --attach-file-once nom_fitxer + + +

+ Crea un fitxer adjunt dins del fitxer Matroska(tm). Abans que es pugui emprar + aquesta opció, s'haurà d'establir el tipus MIME. La + diferència entre les dues formes és que durant la divisió, els fitxers + adjunts amb --attach-file seran adjuntats a tots els + fitxers de sortida mentre que amb --attach-file-once només + s'adjuntaran al primer fitxer creat. Si no s'empra la divisió, llavors les + dues opcions faran el mateix. + +

+ + +

+ Es pot emprar el mkvextract(1) per a extreure els fitxers adjunts des d'un + fitxer Matroska(tm). + +

+ +
--enable-legacy-font-mime-types + +

+ Permet l'ús de tipus MIME llegats per a determinats tipus + d'adjunts de lletra. Per exemple, s'usarà + «application/x-truetype-font» per a tipus de lletra + TrueType en lloc de «fonts/ttf». + +

+ + +

+ Això afectarà a dos adjunts nous si el seu tipus MIME es + detecta automàticament i els adjunts existents del tipus + MIME emmagatzemat seran reassignats al llegat. + +

+ + +

+ Els tipus MIME afectats son «font/sfnt», + «font/ttf» i «font/collection» els + quals seran tots assignats a + «application/x-truetype-fonts» i + «font/otf» el qual serà assignat a + «application/vnd.ms-opentype». + +

+ +
+ + + +

2.7. Opcions que es poden emprar per a cada fitxer d'entrada

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks + [!]n,m... + +

+ Copia les pistes d'àudio n, m, + etc. Els números són els ID de les pistes que es poden obtenir amb l'opció + --identify. + No són simplement els números de la pista (vegeu la secció sobre els ID de les pistes). Per omissió: + copiarà totes les pistes d'àudio. + +

+ + +

+ En comptes dels ID de les pistes, també podeu especificar els codis d'idioma + ISO 639-2. Això només funcionarà per a fitxers d'origen que proveeixen + etiquetes d'idioma per a les seves pistes. + +

+ + +

+ Per omissió: copiarà totes les pistes d'aquest tipus. + +

+ + +

+ Si els ID estan prefixats amb el signe !, llavors + s'indicarà el contrari: copiarà totes les pistes d'aquest tipus excepte les + llistades després del signe !. + +

+ +
-d, --video-tracks + [!]n,m... + +

+ Copia les pistes de vídeo n, + m, etc. Els números són els ID de les pistes que es + poden obtenir amb l'opció --identify. + No són simplement els números de la pista (vegeu la secció sobre els ID de les pistes). Per omissió: + copiarà totes les pistes de vídeo. + +

+ + +

+ En comptes dels ID de les pistes, també podeu especificar els codis d'idioma + ISO 639-2. Això només funcionarà per a fitxers d'origen que proveeixen + etiquetes d'idioma per a les seves pistes. + +

+ + +

+ Si els ID estan prefixats amb el signe !, llavors + s'indicarà el contrari: copiarà totes les pistes d'aquest tipus excepte les + llistades després del signe !. + +

+ +
-s, --subtitle-tracks + [!]n,m... + +

+ Copia les pistes de subtítols n, + m, etc. Els números són els ID de les pistes que es + poden obtenir amb l'opció --identify. + No són simplement els números de la pista (vegeu la secció sobre els ID de les pistes). Per omissió: + copiarà totes les pistes de subtítols. + +

+ + +

+ En comptes dels ID de les pistes, també podeu especificar els codis d'idioma + ISO 639-2. Això només funcionarà per a fitxers d'origen que proveeixen + etiquetes d'idioma per a les seves pistes. + +

+ + +

+ Si els ID estan prefixats amb el signe !, llavors + s'indicarà el contrari: copiarà totes les pistes d'aquest tipus excepte les + llistades després del signe !. + +

+ +
-b, --button-tracks + [!]n,m... + +

+ Copia les pistes de botons n, + m, etc. Els números són els ID de les pistes que es + poden obtenir amb l'opció --identify. + No són simplement els números de la pista (vegeu la secció sobre els ID de les pistes). Per omissió: + copiarà totes les pistes de botons. + +

+ + +

+ En comptes dels ID de les pistes, també podeu especificar els codis d'idioma + ISO 639-2. Això només funcionarà per a fitxers d'origen que proveeixen + etiquetes d'idioma per a les seves pistes. + +

+ + +

+ Si els ID estan prefixats amb el signe !, llavors + s'indicarà el contrari: copiarà totes les pistes d'aquest tipus excepte les + llistades després del signe !. + +

+ +
--track-tags + [!]n,m... + +

+ Copia les etiquetes per a les pistes n, + m, etc. Els números són els ID de les pistes que es + poden obtenir amb l'opció --identify. + No són simplement els números de la pista (vegeu la secció sobre els ID de les pistes). Per omissió: + copiarà les etiquetes per a totes les pistes. + +

+ + +

+ Si els ID estan prefixats amb el signe !, llavors + s'indicarà el contrari: copia-ho tot, excepte els ID llistats després del + signe !. + +

+ +
-m, --attachments + [!]n[:all|first],m[:all|first]... + +

+ Copia els adjunts amb els ID n, + m, etc. a tots (all) o només al primer fitxer generat + (first). Cada ID pot estar seguit per «:all» (la qual és + l'opció per omissió) o «:first». Si està activada la + divisió, llavors aquells adjunts on els ID s'han especificat amb + «:all» seran copiats a tots els fitxers de sortida + resultants, mentre que els altres només seran copiats dins del primer fitxer + de sortida. Si la divisió no està activada, llavors les dues variants + produiran el mateix efecte. + +

+ + +

+ El comportament per omissió és copiar tots els adjunts a tots els fitxers de + sortida. + +

+ + +

+ Si els ID estan prefixats amb el signe !, llavors + s'indicarà el contrari: copia-ho tot, excepte els ID llistats després del + signe !. + +

+ +
-A, --no-audio + +

+ No copiar cap pista d'àudio des d'aquest fitxer. + +

+ +
-D, --no-video + +

+ No copiar cap pista de vídeo des d'aquest fitxer. + +

+ +
-S, --no-subtitles + +

+ No copiar cap pista de subtítols des d'aquest fitxer. + +

+ +
-B, --no-buttons + +

+ No copiar cap pista de botó des d'aquest fitxer. + +

+ +
-T, --no-track-tags + +

+ No copiar cap etiqueta específica de pista des d'aquest fitxer. + +

+ +
--no-chapters + +

+ No copiar cap capítol des d'aquest fitxer. + +

+ +
-M, --no-attachments + +

+ No copiar cap adjunt des d'aquest fitxer. + +

+ +
--no-global-tags + +

+ No copiar cap etiqueta global des d'aquest fitxer. + +

+ +
-y, --sync + TID:d[,o[/p]] + +

+ Ajusta els codis de temps de la pista amb l'ID TID en + d ms. Els ID de les pistes són els mateixos que es + mostren amb l'opció --identify + (vegeu la secció sobre els ID de les + pistes). + +

+ + +

+ o/p: ajusta els codis de temps + en o/p, per a fixar + desfasaments lineals. Si s'omet, p per omissió serà + 1. Tant o com p poden ser + nombres decimals. + +

+ + +

+ Per omissió: no hi haurà cap correcció de sincronització manual (el qual és + el mateix que d = 0 i + o/p = + 1.0). + +

+ + +

+ Aquesta opció es pot emprar múltiples vegades per a un fitxer d'entrada + aplicant-la a diverses pistes, seleccionant els diferents ID de les pistes + cada vegada. + +

+ +
--cues TID:none|iframes|all + +

+ Controla quines entrades dels índexs de les pistes (cue) es crearan per a + una pista indicada (vegeu la secció sobre els ID de les + pistes). «none» inhibeix la creació de les + entrades de l'índex. Amb «iframes» només s'inseriran al + full de muntatge els blocs sense referències anteriors o posteriors (= + fotogrames I en les pistes de vídeo). «all» fa que el + mkvmerge(1) crei les entrades de l'índex per a tots els blocs, el qual farà + que el fitxer sigui molt més gran. + +

+ + +

+ Per omissió és «iframes» per a les pistes de vídeo i + subtítols, i «none» per a les pistes d'àudio. Vegeu també + l'opció --no-cues, la + qual inhibeix la creació de les entrades de l'índex malgrat emprar les + opcions --cues. + +

+ + +

+ Aquesta opció es pot emprar múltiples vegades per a un fitxer d'entrada + aplicant-la a diverses pistes, seleccionant els diferents ID de les pistes + cada vegada. + +

+ +
--default-track-flag + TID[:booleà] + +

+ Estableix l'etiqueta de «Pista per omissió» a la pista indicada (vegeu la + secció sobre els ID de les pistes) + si l'argument opcional booleà s'ha establert a + 1 o si no està present. Aquesta etiqueta es pot + establir si el contenidor d'origen no proporciona aquesta informació i + l'usuari no l'especifica a través d'aquesta opció. + +

+ + +

+ Si l'usuari no selecciona explícitament una pista durant la reproducció, el + reproductor seleccionarà una de les pistes que tingui establerta l'etiqueta + «Pista per omissió», tenint en compte les preferències de l'usuari així com + el seu idioma preferit. + +

+ + +

+ Aquesta opció es pot emprar múltiples vegades per a un fitxer d'entrada + aplicant-la a diverses pistes, seleccionant els diferents ID de les pistes + cada vegada. + +

+ +
--track-enabled-flag + TID[:booleà] + +

+ Estableix l'etiqueta «Pista habilitada» en la pista indicada (vegeu la + secció Els ID de les pstes) al + valor donat booleà (0 o 1; de manera predeterminada + serà 1 si no s'especifica). Si no s'especifica cap opció per i el contenidor + d'origen tampoc proporciona aquesta informació, les pistes estaran activades + de manera predeterminada. + +

+ + +

+ Només es tindran en compte per a reproduir les pistes on s'estableixi + l'etiqueta «Pista habilitada». + +

+ + +

+ Aquesta opció es pot emprar múltiples vegades per a un fitxer d'entrada + aplicant-la a diverses pistes, seleccionant els diferents ID de les pistes + cada vegada. + +

+ +
--forced-display-flag + TID[:booleà] + +

+ Estableix l'etiqueta de «Força el mostrar» a la pista indicada (vegeu la + secció sobre els ID de les pistes) + si l'argument opcional booleà està establert a + 1 o si no està present. Useu-ho per a les pistes que + continguin text en pantalla o algun diàleg en un idioma estranger. + +

+ + +

+ Aquesta opció es pot emprar múltiples vegades per a un fitxer d'entrada + aplicant-la a diverses pistes, seleccionant els diferents ID de les pistes + cada vegada. + +

+ +
--hearing-impaired-flag + TID[:booleà] + +

+ Estableix l'etiqueta de «Discapacitat auditiva» a la pista indicada (vegeu + la secció sobre els ID de les + pistes) si l'argument opcional booleà s'ha + establert a 1 o si no està present. Aquesta etiqueta es + pot establir si la pista és adequada per a usuaris amb discapacitat + auditiva. + +

+ + +

+ Aquesta opció es pot emprar múltiples vegades per a un fitxer d'entrada + aplicant-la a diverses pistes, seleccionant els diferents ID de les pistes + cada vegada. + +

+ +
--visual-impaired-flag + TID[:booleà] + +

+ Estableix l'etiqueta de «Discapacitat visual» a la pista indicada (vegeu la + secció sobre els ID de les pistes) + si l'argument opcional booleà s'ha establert a + 1 o si no està present. Aquesta etiqueta es pot + establir si la pista és adequada per a usuaris amb discapacitat visual. + +

+ + +

+ Aquesta opció es pot emprar múltiples vegades per a un fitxer d'entrada + aplicant-la a diverses pistes, seleccionant els diferents ID de les pistes + cada vegada. + +

+ +
--text-descriptions-flag + TID[:booleà] + +

+ Estableix l'etiqueta de «Descripcions de text» a la pista indicada (vegeu la + secció sobre els ID de les pistes) + si l'argument opcional booleà s'ha establert a + 1 o si no està present. Aquesta etiqueta es pot + establir si la pista conté alguna descripció textual per al contingut del + vídeo adequada per a la seva reproducció a través d'un sistema de conversió + de text a veu per a un usuari amb discapacitat visual. + +

+ + +

+ Aquesta opció es pot emprar múltiples vegades per a un fitxer d'entrada + aplicant-la a diverses pistes, seleccionant els diferents ID de les pistes + cada vegada. + +

+ +
--original-flag + TID[:booleà] + +

+ Estableix l'etiqueta d'«Idioma original» a la pista indicada (vegeu la + secció sobre els ID de les pistes) + si l'argument opcional booleà s'ha establert a + 1 o si no està present. Aquesta etiqueta es pot + establir si la pista està en l'idioma original del contingut (no una + traducció). + +

+ + +

+ Aquesta opció es pot emprar múltiples vegades per a un fitxer d'entrada + aplicant-la a diverses pistes, seleccionant els diferents ID de les pistes + cada vegada. + +

+ +
--commentary-flag + TID[:booleà] + +

+ Estableix l'etiqueta de «Comentari» a la pista indicada (vegeu la secció + sobre els ID de les pistes) si + l'argument opcional booleà s'ha establert a + 1 o si no està present. Aquesta etiqueta es pot + establir si la pista conté algun comentari. + +

+ + +

+ Aquesta opció es pot emprar múltiples vegades per a un fitxer d'entrada + aplicant-la a diverses pistes, seleccionant els diferents ID de les pistes + cada vegada. + +

+ +
--track-name TID:nom + +

+ Estableix el nom de la pista al nom indicat (vegeu la + secció sobre els ID de les + pistes). + +

+ +
--language TID:idioma + +

+ Estableix l'idioma de la pista indicada (vegeu la secció sobre els ID de les pistes). Estan permesos + tant els codis d'idioma ISO 639-2 com els codis de país ISO 639-1. Els codis + de país seran convertits a codis d'idioma automàticament. Tots els idiomes + inclosos els seus codis ISO 639-2 es poden llistar amb l'opció --list-languages. + +

+ + +

+ Aquesta opció es pot emprar múltiples vegades per a un fitxer d'entrada + aplicant-la a diverses pistes, seleccionant els diferents ID de les pistes + cada vegada. + +

+ +
-t, --tags + TID:nom_fitxer + +

+ Llegeix les etiquetes per a la pista amb el número + TID des del nom_fitxer. Per a + més detalls, vegeu més endavant la secció sobre les etiquetes. + +

+ +
--aac-is-sbr + TID[:0|1] + +

+ Li indica al mkvmerge(1) que la pista amb l'ID TID és + SBR AAC (AAC en SBR) (també coneguda com a + HE-AAC o AAC+). Aquestes opcions són + necessàries si: a) el fitxer d'origen és un fitxer AAC + (no per a un fitxer Matroska(tm)) i b) el fitxer + AAC conté dades SBR AAC. El motiu per a + aquesta opció, és que és tècnicament impossible distingir les dades + AAC de les dades SBR AAC sense + descodificar tot un fotograma AAC. Com hi ha diverses + qüestions de patents amb els descodificadors per a AAC, el + mkvmerge(1) mai contindrà aquesta etapa de la descodificació. De manera que, + per als fitxers SBR AAC aquesta opció és obligatòria. Si + s'omet aquesta opció, el fitxer generat podria no reproduir-se correctament, + o ni tan sols fer-ho. + +

+ + +

+ Si el fitxer d'origen és un fitxer Matroska(tm), llavors hi hauria d'haver + prou amb el CodecID per a detectar el SBR + AAC. No obstant això, si el CodecID és + erroni, llavors es pot emprar aquesta opció per a corregir-lo. + +

+ + +

+ Si el mkvmerge detecta erròniament que un fitxer AAC està + en SBR, llavors podeu afegir «:0» a l'ID + de la pista. + +

+ +
--audio-emphasis TID:n|symbolic-name + +

+ Estableix l'èmfasi per a la pista d’àudio amb l’ID de la pista + TID. El mode pot ser un número + n (certs valors entre 0 i + 16) o un nom simbòlic. Tots els números vàlids i els + noms simbòlics es poden llistar amb l'opció --list-audio-emphasis. + +

+ +
--reduce-to-core TID + +

+ Alguns còdecs d'àudio tenen un nucli amb pèrdues i extensions opcionals que + implementen una descodificació sense pèrdues. Aquesta opció li indica al + mkvmerge(1) que només copiï el nucli i no les extensions. Per omissió, el + mkvmerge(1) copiarà el nucli i les extensions. + +

+ + +

+ Actualment, aquesta opció només afecta a les pistes DTS. No + obstant això, les pistes TrueHD que contenen un nucli AC-3 + incrustat es presenten com a dues pistes independents de manera que l'usuari + pugui seleccionar quina pista vol copiar. Per a les DTS + això no funcionarà, ja que les extensions HD no es poden descodificar en si + mateixes -a diferència de les dades TrueHD-. + +

+ +
--remove-dialog-normalization-gain + TID + +

+ Alguns códec'àudio contenen camps de capçalera que indiquen al decodificador + o al reproductor quin guany aplicar (generalment negatiu) per al diàleg de + normalització. Aquesta opció indica al mkvmerge(1) que elimini o minimitzi + aquest guany modificant els camps de capçalera corresponents. + +

+ + +

+ En l'actualitat només es veuen afectades per a aquesta opció les pistes + AC-3, DTS i TrueHD. + +

+ +
--timestamps TID:nom_fitxer + +

+ Llegeix els codis de temps que s'empraran per a l'ID específic de la pista + des del nom_fitxer. Aquests codis de temps + substitueixen de manera forçosa els codis de temps que normalment calcula el + mkvmerge(1). Llegiu la secció sobre els fitxers externs per als + codis de temps. + +

+ +
--default-duration TID:x + +

+ Força la durada per omissió de la pista indicada a un valor específic. També + modificarà els codis de temps de la pista perquè coincideixin amb la durada + per omissió. L'argument x haurà de tenir el sufix + «s», «ms», «us», + «ns», «fps», «p» o + «i» per a especificar la durada per omissió en segons, + mil·lisegons, microsegons, nanosegons, «fotogrames per segon», «fotogrames + progressius per segon» o «fotogrames entrellaçats per segon», + respectivament. El número x en si mateix pot ser un + nombre decimal o una fracció. + +

+ + +

+ Si la durada per omissió no és forçada, llavors el mkvmerge intentarà + derivar la durada per omissió de la pista des del contenidor i/o flux de + bits codificat per a certs tipus de pista, p. ex., AVC/H.264 o MPEG-2. + +

+ + +

+ Aquesta opció també es pot emprar per a canviar els FPS de + les pistes de vídeo sense haver d'emprar un fitxer extern per als codis de + temps. + +

+ +
--fix-bitstream-timing-information + TID[:0|1] + +

+ Normalment, el mkvmerge(1) no canvia la informació del temps (taxa de + fotogrames/camps) emmagatzemada al flux de bits del vídeo. Amb aquesta + opció, dita informació s'ajustarà per a coincidir amb la informació del + temps al contenidor. La informació del temps al contenidor pot provenir de + diverses fonts: des de la línia d'ordres (vegeu l'opció --default-duration), + el contenidor de l'origen o derivat del flux de bits. + +

+ + +
+

Note:

+ +

Per ara, només s'ha implementat per a pistes de vídeo AVC/H.264.

+ +
+ +
--compression TID:n + +

+ Selecciona el mètode de compressió a emprar per a la pista. Recordeu que el + reproductor també haurà d'admetre aquest mètode. Els valors vàlids són + «none», «zlib» i + «mpeg4_p2»/«mpeg4p2». + +

+ +

+ El mètode de compressió + «mpeg4_p2»/«mpeg4p2» és un mètode + especial anomenat «eliminador de la capçalera» que només està disponible per + a les pistes de vídeo MPEG4 part 2. + +

+ +

+ La compressió per omissió per a alguns tipus de subtítols és + «zlib». Aquest mètode de compressió també és el més + implementat per gairebé totes, si no totes, les aplicacions de + reproducció. No es pot assegurar la implementació per a altres mètodes de + compressió que no sigui «none». + +

+ +
+ + + +

2.8. Opcions que només s'apliquen a les pistes de vídeo

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc + TID:FourCC + +

+ Força el FourCC al valor especificat. Només funciona + per a les pistes de vídeo en el mode compatibilitat amb MS. + +

+ +
--display-dimensions + TID:amplada_x_alçada + +

+ Els fitxers Matroska(tm) contenen dos valors que estableixen les propietats de + visualització que emprarà un reproductor per a escalar la imatge durant la + reproducció a: amplada i alçada de visualització. Aquests valors es poden + establir amb aquesta opció, p. ex., «1:640x480». + +

+ + +

+ Una altra manera d'especificar els valors és emprar l'opció --aspect-ratio + o --aspect-ratio-factor + (vegeu a continuació). Aquestes opcions són mútuament excloents. + +

+ +
--aspect-ratio + TID:relació|amplada/alçada + +

+ Els fitxers Matroska(tm) contenen dos valors que estableixen les propietats de + visualització que emprarà un reproductor per a escalar la imatge durant la + reproducció a: amplada i alçada de visualització. Amb aquesta opció, el + mkvmerge(1) calcularà automàticament l'amplada i alçada de reproducció + partint de l'amplada i alçada original de la imatge i la relació d'aspecte + indicada amb aquesta opció. La relació es pot indicar com un nombre decimal + per a la relació o com una fracció per a + l'«amplada/alçada», p. ex., + «16/9». + +

+ + +

+ Una altra manera d'especificar els valors és emprar l'opció --aspect-ratio-factor + o --display-dimensions + (vegeu anteriorment i a continuació). Aquestes opcions són mútuament + excloents. + +

+ +
--aspect-ratio-factor TID:factor|n/d + +

+ Una altra manera d'establir la relació d'aspecte és especificar un + factor. La relació d'aspecte original es multiplica + primer amb aquest factor i després s'empra com la + relació d'aspecte definitiva. + +

+ + +

+ Una altra manera d'especificar els valors és emprar l'opció --aspect-ratio + o --display-dimensions + (vegeu anteriorment). Aquestes opcions són mútuament excloents. + +

+ +
--cropping + TID:esquerra,a_dalt,dreta,a_baix + +

+ Estableix els valors indicats els paràmetres del retall dels píxels d'una + pista de vídeo. + +

+ +
--color-matrix-coefficients TID:n + +

+ Estableix els coeficients de la matriu del vídeo emprats per a derivar els + valors de luminància i de crominància dels colors primaris vermell, verd i + blau. El paràmetre n és un nombre enter que va des + del 0 al 10. + +

+ + +

+ Els valors vàlids i els seus significats són els següents: + +

+ + +

+ 0: GBR, 1: BT709, + 2: sense especificar, 3: reservat, + 4: FCC, 5: BT470BG, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 luminància no + constant, 10: BT2020 luminància constant + +

+ +
--color-bits-per-channel TID:n + +

+ Estableix el nombre de bits codificats per a un canal de color. Un valor de + 0 indica que el nombre de bits no està especificat. + +

+ +
--chroma-subsample TID:horit,vert + +

+ La quantitat de píxels per a eliminar en els canals Cr i Cb per a cada píxel + no eliminat horitzontalment i verticalment. + +

+ + +

+ Exemple: Per al vídeo amb submostreig cromàtic 4:2:0, el paràmetre s'haurà + d'establir a + TID:1,1. + +

+ +
--cb-subsample TID:horit,vert + +

+ La quantitat de píxels per a eliminar al canal Cb per a cada píxel no + eliminat horitzontalment i verticalment. Aquest és additiu amb + --chroma-subsample. + +

+ + +

+ Exemple: Per al vídeo amb submostreig cromàtic 4:2:1, el paràmetre + --chroma-subsample s'haurà d'establir a + TID:1,0 + i el submostreig Cb s'haurà d'establir a + TID:1,0. + +

+ +
--chroma-siting TID:horit,vert + +

+ Estableix com està situada la crominància, + horitzontalment/verticalment.(0: sense especificar, + 1: a dalt juxtaposats, 2: meitat). + +

+ +
--color-range TID:n + +

+ Estableix la retallada dels intervals de colors (0: + sense especificar, 1: interval de difusió, + 2: tot l'interval (sense retallat), + 3: definit pels coeficients de la + matriu/característiques de la transferència). + +

+ +
--color-transfer-characteristics + TID:n + +

+ Les característiques de la transferència del vídeo. + +

+ + +

+ Els valors vàlids i els seus significats són els següents: + +

+ + +

+ 0: reservat, 1: ITU-R BT.709, + 2: sense especificar, 3: reservat, + 4: interval de corba 2.2, 5: + interval de corba 2.8, 6: SMPTE 170M, + 7: SMPTE 240M, 8: lineal, + 9: registre, 10: registre sqrt, + 11: IEC 61966-2-4, 12: gamma de + colors estesa ITU-R BT.1361, 13: IEC 61966-2-1, + 14: ITU-R BT.2020 de 10 bits, 15: + ITU-R BT.2020 de 12 bits, 16: SMPTE ST 2084, + 17: SMPTE ST 428-1; 18: ARIB + STD-B67 (HLG) + +

+ +
--color-primaries TID:n + +

+ Estableix els colors primaris del vídeo. + +

+ + +

+ Els valors vàlids i els seus significats són els següents: + +

+ + +

+ 0: reservat, 1: ITU-R BT.709, + 2: sense especificar, 3: reservat, + 4: ITU-R BT.470M, 5: ITU-R + BT.470BG, 6: SMPTE 170M, 7: SMPTE + 240M, 8: FILM, 9: ITU-R BT.2020, + 10: SMPTE ST 428-1, 22: JEDEC P22 + llumins + +

+ +
--max-content-light TID:n + +

+ Estableix la brillantor màxima d'un únic píxel (el nivell màxim de llum que + conté) en candeles per metre quadrat (cd/m²). El valor de + n haurà de ser un nombre enter no negatiu. + +

+ +
--max-frame-light TID:n + +

+ Estableix la brillantor màxima de tot un marc (el nivell màxim de llum mitjà + del marc) en candeles per metre quadrat (cd/m²). El valor de + n haurà de ser un nombre enter no negatiu. + +

+ +
--chromaticity-coordinates + TID:vermell-x,vermell-y,verd-x,verd-y,blau-x,blau-y + +

+ Estableix les coordenades de la cromaticitat per al vermell/verd/blau com es + defineixen per la CIE 1931. + +

+ +
--white-color-coordinates TID:x,y + +

+ Estableix les coordenades cromàtiques del color blanc com es defineixen per + la CIE 1931. + +

+ +
--max-luminance TID:decimal + +

+ Estableix la luminància màxima en candeles per metre quadrat (cd/m²). El + valor haurà de ser inferior que 9999.99. + +

+ +
--min-luminance TID:decimal + +

+ Estableix la luminància mínima en candeles per metre quadrat (cd/m²). El + valor haurà de ser inferior que 999.9999. + +

+ +
--projection-type TID:mètode + +

+ Estableix el mètode de projecció del vídeo que s'utilitzarà. Els valors + vàlids són 0 (projecció rectangular), 1 (projecció equirectangular), 2 + (projecció mapa del cub) i 3 (projecció de malla). + +

+ +
--projection-private TID:dades + +

+ Estableix les dades privades que només s'aplicaran a una projecció + específica. Les dades s'han de proporcionar com a nombres hexadecimals amb + el prefix "0x" o sense, amb espais o sense. + +

+ +
--projection-pose-yaw TID:decimal + +

+ Especifica un gir de l'encaix a la projecció. + +

+ +
--projection-pose-pitch TID:decimal + +

+ Especifica un gir de la presentació a la projecció. + +

+ +
--projection-pose-roll TID:decimal + +

+ Especifica un gir del rotllo a la projecció. + +

+ +
--field-order TID:n + +

+ Estableix l'ordre del camp de vídeo amb l'ID de pista + TID. L'ordre haurà de ser un dels següents números: + +

+ + +

+ 0: progressiu; 1: entrellaçat del + primer camp superior mostrat i del primer camp superior emmagatzemat; + 2: ordre del camp sense determinar; + 6: entrellaçat del primer camp inferior mostrat i del + primer camp inferior emmagatzemat; 9: entrellaçat del + primer camp inferior mostrat i del primer camp superior emmagatzemat; + 14: entrellaçat del primer camp superior mostrat i del + primer camp inferior emmagatzemat + +

+ +
--stereo-mode TID:n|symbolic-name + +

+ Estableix el mode estèreo per a la pista d’àudio amb l’ID de la pista + TID. El mode pot ser un número + n entre 0 i + 14 o un nom simbòlic. Tots els números vàlids i els + noms simbòlics es poden llistar amb l'opció --list-stereo-modes. + +

+ +
+ + + +

2.9. Opcions que només s'apliquen a les pistes de subtítols de text

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset TID:joc_de_caràcters + +

+ Estableix el joc de caràcters per a la conversió a UTF-8 dels subtítols per + a un ID indicat de pista. Si no s'especifica el joc de caràcters, aquest + derivarà dels ajustaments per a la configuració regional. Tingueu en compte + que no és necessari un joc de caràcters per a llegir els subtítols des de + fitxers Matroska(tm) o des de fluxos Kate, ja que aquests sempre + s'emmagatzemen en UTF-8. Vegeu la secció sobre la conversió per a fitxers de + text i jocs de caràcters, per a una explicació sobre com realitza el + mkvmerge(1) la conversió entre els jocs de caràcters. + +

+ + +

+ Aquesta opció es pot emprar múltiples vegades per a un fitxer d'entrada + aplicant-la a diverses pistes, seleccionant els diferents ID de les pistes + cada vegada. + +

+ +
+ + + +

2.10. Altres opcions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify + nom_fitxer + +

+ Li permet al mkvmerge(1) sondejar el fitxer i informar del seu tipus, les + pistes que conté i els ID de les pistes. Si s'empra aquesta opció, llavors + l'única opció permesa serà el nom_fitxer. + +

+ + +

El format emprat a la sortida es pot canviar amb l'opció --identification-format. +

+ +
-J nom_fitxer + +

+ Aquest és un àlies pràctic per a «--identification-format json + --identify nom_fitxer». + +

+ +
-F, --identification-format + format + +

+ Determina el format de la sortida emprat per l'opció --identify. + S'admeten els següents formats: text (el valor per + omissió si no s'empra aquesta opció) i json. + +

+ + +
    + +
  1. + +

    El format text és curt i llegible. Consisteix en una + línia per a cada element trobat (contenidor, pistes, adjunts, etc.). +

    + + +

    Aquest format no està destinat a ser analitzat. La sortida serà traduïda a + l'idioma que empra el mkvmerge(1) (vegeu també l'opció --ui-language). +

    + +
  2. + + +
  3. + +

    + La sortida del format json és una representació JSON + llegible per la màquina. Aquest format segueix l'esquema JSON descrit en el + següent fitxer: + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + Totes les versions de l'esquema JSON estan disponibles tant en línia com en + els fitxers del codi font alliberat. + +

    + +
  4. + +
+ +
--probe-range-percentage percentage + +

+ Tipus de fitxers com fluxos de programa i de transport MPEG + (.vob, .m2ts) requereixen analitzar + una certa quantitat de dades per tal de detectar totes les pistes + contingudes al fitxer. Aquesta quantitat és el 0,3% de la mida del fitxer + d'origen o de 10 MB, el que sigui més gran. + +

+ + +

+ Si les pistes són conegudes per estar presents, però no s'han trobat, + llavors el percentatge per a provar es pot canviar amb aquesta opció. El + mínim de 10 MB es troba incorporat i no es pot canviar. + +

+ +
--list-audio-emphasis + +

+ Llista tots els números vàlids i els seus noms simbòlics corresponents per a + l'opció --audio-emphasis. + +

+ +
--list-languages + +

+ Llista tots els idiomes i el seu codi ISO 639-2 que es poden emprar amb + l'opció --language. + +

+ +
--list-stereo-modes + +

+ Llista tots els números vàlids i els seus noms simbòlics corresponents per a + l'opció --stereo-mode. + +

+ +
-l, --list-types + +

+ Llista els tipus de fitxer d'entrada admesos. + +

+ +
--priority prioritat + +

+ Estableix la prioritat del procés amb què s'executa el mkvmerge(1). Els + valors vàlids són «lowest» (Molt baixa), + «lower» (Baixa), «normal» (Normal), + «higher» (Alta) i «highest» (Molt + alta). Si no s'indica res, llavors s'emprarà «normal». En + sistemes com Unix, el mkvmerge(1) emprarà la funció + nice(2). + Per tant, només el superusuari podrà emprar «higher» i + «highest». Al Windows, tots els valors són usables per + part de tots els usuaris. + +

+ + +

La selecció de «lowest», farà que el mkvmerge(1) + seleccioni una prioritat d'E/S ociosa, a més de la prioritat de procés més + baixa possible. +

+ +
--command-line-charset + joc_de_caràcters + +

+ Estableix el joc de caràcters al qual convertir les cadenes indicades des de + la línia d'ordres. Per omissió serà el joc de caràcters donat per la + configuració regional actual del sistema. Aquest ajustament s'aplicarà als + arguments de les següents opcions: --title, --track-name + i --attachment-description. + +

+ +
--output-charset joc_de_caràcters + +

+ Estableix el joc de caràcters al qual convertir les cadenes de la + sortida. Per omissió serà el joc de caràcters donat per la configuració + regional actual del sistema. + +

+ +
-r, --redirect-output + nom_fitxer + +

+ Escriu tots els missatges al nom_fitxer en lloc de a + la consola. Si bé això es pot fer fàcilment amb la redirecció de la sortida, + hi ha casos en què cal aquesta opció: quan el terminal torna a interpretar + la sortida abans d'escriure-la a un fitxer. Es respectarà el joc de + caràcters establert amb --output-charset. + +

+ +
--flush-on-close + +

+ Li indica al programa que buidi totes les dades emmagatzemades a la memòria + cau de l'emmagatzematge en tancar els fitxers oberts per a escriure. Això es + pot usar per a evitar la pèrdua de dades en interrupcions d'electricitat o + per a evitar certs problemes en el sistema operatiu o els + controladors. L'inconvenient és que la multiplexació trigarà més, ja que el + «mkvmerge» esperarà fins que totes les dades s'hagin escrit a + l'emmagatzematge abans de sortir. Vegeu els problemes número 2469 i 2480 en + el seguiment d'errors del MKVToolNix per a un debat en profunditat sobre els + pros i els contres. + +

+ +
--ui-language codi + +

+ Força l'ús de les traduccions per al codi d'idioma + (p. ex., «de_DE» per a les traduccions en + alemany). Introduint «list» com a + codi, es farà que el programa ofereixi a la sortida + una llista de les traduccions disponibles. + +

+ +
--abort-on-warnings + +

+ Indica al programa que interrompi després d'emetre el primer avís. El codi + de sortida del programa serà 1. + +

+ +
--deterministic llavor + +

+ Permet la creació de fitxers amb bytes idèntics si s'usa la mateixa versió + mkvmerge(1) amb els mateixos fitxers d'origen, les mateixes opcions i la + mateixa llavor. Recordeu que en aquest mode el camp d'informació del segment + «data» no serà escrit. + +

+ + +

La llavor podrà ser una cadena arbitrària i no haurà de ser un número.

+ + +

+ El resultat de fitxers amb bytes idèntics només està garantit en les + següents condicions: + +

+ + +
    + +
  1. + +

    Si s'utilitza la mateixa versió del mkvmerge(1) construïda amb les mateixes + versions de la libEBML i la libMatroska. +

    + +
  2. + + +
  3. + +

    Si s'utilitzen fitxers d'origen amb bytes idèntics.

    + +
  4. + + +
  5. + +

    Si s'utilitzen les mateixes opcions de la línia d'ordres en el mateix ordre + (amb la notable excepció de --output «…»). +

    + +
  6. + +
+ + +

+ L'ús d'altres versions del mkvmerge(1) o altres opcions de la línia d'ordres + pot donar com a resultat el mateix fitxer amb bytes idèntics, però no es + garanteix que ho faci. + +

+ +
--debug tema + +

+ Activa la depuració per a una característica específica. Aquesta opció només + és útil per als desenvolupadors. + +

+ +
--engage característica + +

+ Activa les característiques experimentals. Es pot sol·licitar una llista de + les característiques disponibles amb mkvmerge --engage + list. Aquestes característiques no estan destinades a ser emprades + en situacions normals. + +

+ +
--gui-mode + +

+ Activa el mode IGU. En aquest mode, les línies surten amb un format especial + que pot explicar-vos el que està succeint per tal de controlar la + IGU. Aquests missatges segueixen el format + «#IGU#missatge». El missatge pot estar seguit per parells + clau/valor com + «#IGU#missatge#clau1=valor1#clau2=valor2…». Ni els + missatges ni les claus seran traduïdes, sempre sortiran en anglès. + +

+ +
@fitxer_d_opcions.json + +

+ Llegeix els arguments addicionals per a la línia d'ordres des del fitxer + fitxer_d_opcions. Per a més informació, vegeu la + secció sobre els fitxers + d'opcions. + +

+ +
--capabilities + +

+ Mostra informació sobre les característiques addicionals que s'han compilat + i surt. La primera línia de la sortida serà la informació de la versió. La + resta de les línies contenen exactament una paraula, la presència d'aquesta + indica que aquesta característica ha estat compilada. Aquestes + característiques són: + +

+ + +
    + +
  • + +

    + «FLAC» -- llegeix fitxers FLAC en RAW i + manipula les pistes FLAC en altres contenidors, p. ex., + Ogg(tm) o Matroska(tm). + +

    + +
  • + +
+ +
-h, --help + +

+ Mostra la informació d'ús i surt. + +

+ +
-V, --version + +

+ Mostra la informació sobre la versió i surt. + +

+ +
+ + +

3. Ús

+ + +

+ Per a cada fitxer, l'usuari pot seleccionar quines pistes haurà de prendre + el mkvmerge(1). Totes s'emmagatzemaran en un fitxer especificat amb + -o. Amb l'opció -l s'obtindrà una llista + dels formats coneguts (i implementats). + +

+ + +
+

Important:

+ +

+ L'ordre de les opcions a la línia d'ordres és important. Si us plau, si sou + novell emprant aquest programa, llegiu la secció «L'ordre de les opcions». + +

+ +
+ +

4. L'ordre de les opcions

+ + + +

+ L'ordre en el qual s'especifiquen les opcions és important per a algunes + opcions. Les opcions es divideixen en dues categories: + +

+ + +
    + +
  1. + +

    + Les opcions que afecten tot el programa i no estan vinculades a cap fitxer + d'entrada. Aquestes inclouen, però no es limiten a + --command-line-charset, --output o + --title. Aquestes poden aparèixer en qualsevol part de la + línia d'ordres. + +

    + +
  2. + + +
  3. + +

    + Les opcions que afecten un sol fitxer d'entrada o una sola pista en un + fitxer d'entrada. Aquestes opcions s'apliquen al següent fitxer a la línia + d'ordres. Totes les opcions que s'apliquen al mateix fitxer d'entrada (o les + pistes del mateix fitxer d'entrada) es poden escriure en qualsevol ordre, + sempre que totes apareguin abans del nom del fitxer d'entrada. Exemples per + a aplicar opcions a un fitxer d'entrada són --no-chapters o + --chapter-charset. Exemples per a aplicar opcions a una + única pista són --default-duration o + --language. + +

    + +
  4. + +
+ + +

+ Les opcions es processen d'esquerra a dreta. Si una opció apareix múltiples + vegades en el mateix àmbit, s'emprarà l'última ocurrència. Per tant, en el + següent exemple el títol s'establirà a «Qualsevulla»: + +

+ +
$ mkvmerge -o sortida.mkv --title 'Això i allò' entrada.avi --title 'Qualsevulla'
+ +

+ El següent exemple mostra com emprar dues vegades l'opció + --language, és correcte perquè són emprades en àmbits + diferents. Tot i que apliquen al mateix ID de pista, aquestes s'apliquen a + fitxers d'entrada diferents i per tant tenen àmbits diferents: + +

+ +
$ mkvmerge -o sortida.mkv --language 0:fre francès.ogg --language 0:deu holandès.ogg
+

5. Exemples

+ + +

+ Suposem que teniu un fitxer anomenat meva_peli.avi i la pista d'àudio en un + altre fitxer, p. ex., «meva_peli.wav». El primer que + voleu és codificar l'àudio a OggVorbis(tm): + +

+ +
$ oggenc -q4 -o meva_peli.ogg meva_peli.wav
+ +

+ Després d'uns minuts ja podreu unir l'àudio i el vídeo: + +

+ +
$ mkvmerge -o meva_peli-amb-so.mkv meva_peli.avi meva_peli.ogg
+ +

+ Si el vostre AVI ja conté una pista d'àudio, llavors també + serà copiada (si el mkvmerge(1) admet aquest format d'àudio). Per a + evitar-ho, simplement feu el següent: + +

+ +
$ mkvmerge -o meva_peli-amb-so.mkv -A meva_peli.avi meva_peli.ogg
+ +

+ Després d'alguns minuts considerant-ho decidiu afegir una altra pista + d'àudio, p. ex., els comentaris del director o un altre idioma a + «meva_peli-afegeix-àudio.wav». Es codifica una altra + vegada i s'afegeix a l'altre fitxer: + +

+ +
$ oggenc -q4 -o meva_peli-afegeix-àudio.ogg meva_peli-afegeix-àudio.wav
+$ mkvmerge -o MM-completa.mkv meva_peli-amb-so.mkv meva_peli-afegeix-àudio.ogg
+ +

+ Es pot aconseguir el mateix resultat amb: + +

+ +
$ mkvmerge -o MM-complet.mkv -A meva_peli.avi meva_peli.ogg meva_peli-afegeix_àudio.ogg
+ +

+ Ara obriu el mplayer(tm) i gaudiu-ne. Si teniu + múltiples pistes d'àudio (o fins i tot pistes de vídeo), llavors li podreu + indicar al mplayer(tm) quina pista ha de reproduir + amb les opcions «-vid» i «-aid». Aquestes + es basen en el 0 i no distingeixen entre el vídeo i l'àudio. + +

+ + +

+ Si necessiteu una pista d'àudio sincronitzada, ho podeu fer amb + facilitat. El primer és esbrinar quin ID de pista té la pista Vorbis, amb: + +

+ +
$ mkvmerge --identify sense_sincronitzar.ogg
+ +

+ Ara podeu emprar aquest ID a la línia d'ordres següent: + +

+ +
$ mkvmerge -o ben_sincronitzat.mkv -A origen.avi -y 12345:200 sense_sincronitzar.ogg
+ +

+ Això afegiria 200ms de silenci al començament de la pista d'àudio amb l'ID + 12345 obtingut des de + «sense_sincronitzar.ogg». + +

+ + +

+ Algunes pel·lícules comencen sincronitzades correctament, però a poc a poc + és desincronitzen. Per a aquest tipus de pel·lícules podeu especificar un + factor de desfasament que serà aplicat a tots els codis de temps -no + s'afegirà o suprimirà cap dada-. Si apliqueu un factor massa gran o petit el + resultat serà incorrecte. Un exemple seria un episodi codificat que té + 0,2 segons de desincronització al final de la + pel·lícula, la longitud és de 77340 fotogrames. A + 29,97 fps 0,2 segons corresponen + aproximadament 6 fotogrames. De manera que podeu fer: + +

+ +
$ mkvmerge -o ben_sincronitzat.mkv -y 23456:0,77346/77340 sense_sincronitzar.mkv
+ +

+ El resultat ha estat bo. + +

+ + +

+ Les opcions de sincronització també es poden emprar per a subtítols de la + mateixa manera. + +

+ + +

+ Per a subtítols de text podeu emprar algun programari per a Windows (com + SubRipper(tm)) o el paquet + subrip(tm) que es pot trobar en el codi font del + transcode(1) + al directori «contrib/subrip». El procés general és: + +

+ + +
    + +
  1. + +

    Extreure un flux de subtítols en RAW des de l'origen:

    +
    $ tccat -i /camí/on/copiar/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o meva_peli
    +
  2. + + +
  3. + +

    Convertir les imatges PGM resultants a text amb el «gocr»:

    +
    $ pgm2txt meva_peli
    +
  4. + + +
  5. + +

    Revisar l'ortografia dels fitxers de text resultants:

    +
    $ ispell -d american *txt
    +
  6. + + +
  7. + +

    Convertir els fitxers de text en un fitxer SRT:

    +
    $ srttool -s -w -i meva_peli.srtx -o meva_peli.srt
    +
  8. + +
+ + +

+ El fitxer resultant el pot emprar el mkvmerge(1) com un altre fitxer + d'entrada: + +

+ +
$ mkvmerge -o meva_peli.mkv meva_peli.avi meva_peli.srt
+ +

+ Si voleu especificar l'idioma per a una pista concreta, això és realment + fàcil. Primer cerqueu el codi ISO 639-2 per al vostre idioma. El mkvmerge(1) + pot llistar tots aquests codis: + +

+ +
$ mkvmerge --list-languages
+ +

+ Cerqueu a la llista els idiomes que necessiteu. Suposem que teniu dues + pistes d'àudio en un fitxer Matroska(tm) i voleu establir els seus codis + d'idioma, i que els seus ID de les pistes són 2 i 3. Això es pot fer amb: + +

+ +
$ mkvmerge -o amb_codis_d_idioma.mkv --language 2:ger --language 3:dut sense_codis_d_idioma.mkv
+ +

+ Com es pot veure, podeu emprar l'opció --language + múltiples vegades. + +

+ + +

+ Podria ser que vulgueu que el reproductor empri l'holandès com a idioma per + omissió. També teniu subtítols addicionals, p. ex., en anglès i francès, i + voleu que el reproductor mostri per omissió el francès. Això es pot fer amb: + +

+ +
$ mkvmerge -o amb_codis_d_idioma.mkv --language 2:ger --language 3:dut --default-track-flag 3 sense_codis_d_idioma.mkv --language 0:eng anglès.srt --default-track-flag 0 --language 0:fre francès.srt
+ +

+ Si no veieu al mkvinfo(1) les etiquetes d'idioma o de pista per omissió que + heu especificat, llavors llegiu la secció sobre els valors per omissió. + +

+ + +

+ Desactiva la compressió per a un fitxer d'entrada. + +

+ +
$ mkvmerge -o sense_compressió.mkv --compression -1:none meva_peli.avi --compression -1:none meva_peli.srt
+ +

6. Els ID de les pistes

+ + + +

6.1. Els ID de pista normal

+ + + +

+ Algunes opcions per al mkvmerge(1) necessiten un ID de pista per a + especificar a quina pista s'han d'aplicar. Aquests ID de pista són mostrats + pels lectors quan demultiplexen el fitxer d'entrada actual, o si el + mkvmerge(1) és invocat amb l'opció --identify. + Un exemple per a això: + +

+ +
$ mkvmerge -i v.mkv
+Fitxer «v.mkv»: contenidor: Matroska
+ID de la pista 0: video (V_MS/VFW/FOURCC, DIV3)
+ID de la pista 1: audio (A_MPEG/L3)
+ +

+ No s'han de confondre els ID de les pistes que s'assignen a les pistes que + s'escriuen al fitxer MKV de sortida amb els ID de les pistes dels fitxers + d'entrada. Només els ID de les pistes del fitxer d'entrada són emprats per a + les opcions que necessiten aquests valors. + +

+ + +

+ Tingueu també en compte que cada fitxer d'entrada té el seu propi conjunt + d'ID de les pistes. Per tant, els ID de les pistes per al fitxer + «fitxer_1.ext» tal com havia informat l'ordre + «mkvmerge --identify» no canviaran, no importa quants + fitxers d'entrada hi hagi o en quina posició es faci servir + «fitxer_1.ext». + +

+ + +

+ Els ID de les pistes són assignats així: + +

+ + +
    + +
  • + +

    + Fitxers AVI: La pista de vídeo té l'ID 0. Les pistes + d'àudio obtenen els seus ID en ordre ascendent començant des de l'1. + +

    + +
  • + + +
  • + +

    + Fitxers AAC, AC-3, MP3, + SRT i WAV: A l'única «pista» en aquest + fitxer se li assigna l'ID 0. + +

    + +
  • + + +
  • + +

    + La majoria de fitxers: Els ID de les pistes són assignats en l'ordre en el + qual es troben les pistes, començant des del número 0. + +

    + +
  • + +
+ + +

+ Les opcions que empren els ID de les pistes són aquelles en què la + descripció conté un «TID». Les següents opcions també + empren els ID de les pistes: --audio-tracks, + --video-tracks, --subtitle-tracks, + --button-tracks i --track-tags. + +

+ + + +

6.2. Els ID de pista normal

+ + + +

+ Hi ha diversos ID que tenen un significat especial i que no apareixen a la + sortida d'identificació. + +

+ + +

+ L'ID de pista especial «-1» és un comodí i aplica + l'opció indicada a totes les pistes que es llegeixen des d'un fitxer + d'entrada. + +

+ + +

+ L'ID «-2» de pista especial fa referència als capítols + en un fitxer d'origen. Actualment només l'opció --sync + utilitza aquest ID especial. Com a alternativa a --sync + -2:«...», es pot utilitzar l'opció --chapter-sync + «...». + +

+ + +

7. Gestió de l'idioma

+ + + +

+ El Matroska(tm) admet dos tipus diferents d'elements d'idioma: l'antic element + «Language» obsolet que conté els codis ISO 639-2 alfa 3 i les etiquetes + noves «LanguageIETF» que contenen les etiquetes d'idioma BCP 477 de la + IETF. Totes les opcions del mkvmerge(1) que admeten un idioma accepten una + etiqueta BCP 47. Sempre que sigui possible, el mkvmerge(1) derivarà el valor + per a l'element «Language» obsolet des de les etiquetes d'idioma BCP 47. + +

+ + +

+ Quan s'identifiqui un fitxer en mode JSON, els elements de capçalera de + pista «LanguageIETF» existents es mostraran com la propietat de pista + language_ietf. + +

+ + +

+ Quan s'escrigui un fitxer, el mkvmerge(1) sempre escriurà els elements + «LanguageIETF», «ChapLanguageIETF» i «TagLanguageIETF» (els dos últims només + si s'escriuen capítols o etiquetes respectivament). A més d'aquests + elements, s'escriuran els elements antics corresponents. S'establiran a la + part del codi ISO 639-2 de l'etiqueta d'idioma BCP 47. Per exemple, quan + l'idioma de la pista s'estableix a sr-Cyrl-RS, + «LanguageIETF» s'establirà a sr-Cyrl-RS i l'element antic + «Language» s'establirà a srp. + +

+ + +

+ Quan es llegeixin fitxers (fitxers Matroska, capítols XML o fitxers + d'etiquetes, etc.) que ja contenen elements «...LanguageIETF», es + conservaran els elements existents. En cas contrari, els elements + «...LanguageIETF» s'afegiran en funció de les opcions a la línia d'ordres, + així com els altres elements «...Language» obsolets existents. + +

+ + +

+ La creació d'elements nous es pot desactivar completament amb l'opció de la + línia d'ordres -disable-language-ietf, la qual opera sobre + els tres elements nous. + +

+ + +

+ Podeu triar el mètode de normalització aplicat a les subetiquetes d'idioma + estès amb el paràmetre --normalize-language-ietf. + +

+ +

8. Conversió per a fitxers de text i jocs de caràcters

+ + +
+

Note:

+ +

+ Aquesta secció s'aplica a tots els programes de les MKVToolNix, encara que + només s'esmenti el mkvmerge(1). + +

+ +
+ + +

8.1. Introducció

+ + +

+ Tot el text en un fitxer Matroska(tm) està codificat en UTF-8. Això implica + que el mkvmerge(1) converteixi cada fitxer de text que llegeix, així com cada + text indicat a la línia d'ordres, des d'un joc de caràcters a UTF-8. Per + contra, això també vol dir que la sortida del mkvmerge(1) s'ha de convertir + des d'UTF-8 a un joc de caràcters, p. ex., si s'empra una traducció no + anglesa amb --ui-language + o per a text que prové d'un fitxer Matroska(tm). + +

+ + +

+ El mkvmerge(1) realitzarà automàticament aquesta conversió en funció de la + presència d'un marcador d'ordre de byte (abreujat: BOM) o + de la configuració regional del sistema. Com el joc de caràcters es dedueix + de la configuració regional, dependrà del sistema operatiu on s'executi el + mkvmerge(1). + +

+ + + +

8.2. Marcadors d'ordre de byte (BOM -byte order markers-)

+ + + +

+ Els fitxers de text que comencen amb un BOM, ja estan codificats en una + representació d'UTF. El mkvmerge(1) admet els cinc modes següents: UTF-8, + UTF-16 Little i Big Endian, UTF-32 Little i Big Endian. Els fitxers de text + amb un BOM seran automàticament convertits a UTF-8. Qualsevol dels + paràmetres que d'una altra manera, estableixen el joc de caràcters d'un + fitxer com aquest (p. ex., --sub-charset) + seran ignorats silenciosament. + +

+ + + +

8.3. Sistemes Linux i Unix, inclòs el macOS

+ + + +

+ En sistemes com Unix, el mkvmerge(1) empra la crida del sistema + setlocale(3) + que al seu torn empra les variables d'entorn LANG, + LC_ALL and LC_CYPE. El joc de + caràcters resultant sovint serà un UTF-8 o de la família ISO-8859- *, i + s'emparà per a totes les operacions sobre fitxers de text i per a codificar + les cadenes a la línia d'ordres i per a la sortida de la consola. + +

+ + + +

8.4. Windows

+ + + +

+ Al Windows, el joc de caràcters per omissió emprat per a la conversió de + fitxers de text es determina per la crida del sistema + GetACP(). + +

+ + +

+ La lectura de la línia d'ordres es realitza amb la funció + GetCommandLineW() que ja retorna una cadena de text + Unicode. Per tant, a Windows s'ignorarà l'opció + --command-line-charset. + +

+ + +

+ La sortida a la consola consta de tres escenaris: + +

+ + +
    + +
  1. + +

    + Si la sortida es redirigeix amb l'opció --redirect-output, + llavors el joc de caràcters per omissió serà UTF-8. Es pot canviar amb --output-charset. + +

    + +
  2. + + +
  3. + +

    + Si es redirigeix la sortida amb cmd.exe, p. ex., amb + mkvinfo fitxer.mkv > informació.txt, llavors el joc de + caràcters sempre serà UTF-8 i no es pot canviar. + +

    + +
  4. + + +
  5. + +

    + D'altra manera, (quan s'escriu directament a la consola) s'emprarà la funció + de Windows WriteConsoleW() i l'opció --output-charset + serà ignorada. La consola hauria de ser capaç de generar tots els caràcters + Unicode per a l'idioma corresponent que està instal·lat (p. ex., els + caràcters xinesos podrien no ser mostrats en versions en anglès de Windows). + +

    + +
  6. + +
+ + + +

8.5. Opcions de la línia d'ordres

+ + + +

+ Les següents opcions permeten especificar els jocs de caràcters: + +

+ + +
    + +
  • + +

    + --sub-charset + per a fitxers i pistes de subtítols de text emmagatzemades en formats de + contenidor per als quals el joc de caràcters no es pot determinar sense + ambigüitat. (p. ex., fitxers Ogg), + +

    + +
  • + + +
  • + +

    + --chapter-charset + per a fitxers de text amb capítols i títols per a capítols i fitxers + emmagatzemats en formats de contenidor per als quals el joc de caràcters no + es pot determinar sense ambigüitat. (p. ex., fitxers Ogg per a informació de + capítols, pistes i títols dels fitxers, etc. fitxers MP4 per a informació + dels capítols), + +

    + +
  • + + +
  • + +

    + --command-line-charset + per a totes les cadenes a la línia d'ordres, + +

    + +
  • + + +
  • + +

    + --output-charset + per a totes les cadenes escrites a la consola o a un fitxer si la sortida ha + estat redirigida amb l'opció --redirect-output. + En els sistemes que no siguin Windows, el joc de caràcters per omissió serà + l'actual del sistema. En Windows, per omissió és a UTF-8, tant redirigint + amb --redirect-output + com amb cmd.exe, p. ex., mkvinfo fitxer.mkv > + informació.txt. + +

    + +
  • + +
+ + +

9. Fitxers d'opcions

+ + + +

+ Un fitxer d'opcions és un fitxer des d'on el mkvmerge(1) pot llegir arguments + addicionals de la línia d'ordres. Això es pot emprar per a eludir certes + limitacions de l'intèrpret d'ordres (shell) o del sistema operatiu, com una + longitud limitada de la línia d'ordres quan s'executen programes externs. + +

+ + +

+ Un fitxer d'opcions amb dades en el format JSON. El seu contingut haurà de + ser una matriu JSON vàlida que consisteixi únicament de cadenes JSON. La + codificació del fitxer haurà de ser en UTF-8. El fitxer no podrà començar + amb un marcador d'ordre de bytes (BOM), però si hi és, serà + omès. + +

+ + +

+ Les regles per a escapar caràcters especials dins del JSON són les mateixes + que hi ha a l'especificació oficial del JSON, RFC 7159. + +

+ + +

+ L'opció del nom de fitxer s'ha d'especificar com a argument de la línia + d'ordres prefixada amb un caràcter «@». + +

+ + +

+ La línia d'ordres «mkvmerge -o "meu_fitxer.mkv" -A "una_peli.avi" + so.ogg» es pot convertir en el següent fitxer d'opcions JSON + anomenat, p. ex., «opcions.json»: + +

+ +
[
+  "-o",
+  "c:\\Matroska\\fitxer_meu.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "una_peli.avi",
+  "so.ogg"
+]
+ +

+ Llavors, l'ordre corresponent seria «mkvmerge + @opcions.json». + +

+ +

10. Vincular els fitxers

+ + +

+ Matroska(tm) admet la vinculació dels fitxers, el qual simplement vol dir que + un fitxer en específic és el predecessor o successor del fitxer actual. Per + a ser precisos, els fitxers no estan realment vinculats sinó els segments + Matroska(tm). Com la majoria dels fitxers probablement només contenen un + segment del Matroska(tm), les següents explicacions empren el terme + «vinculació de fitxers» encara que en realitat seria més correcte + «vinculació de segments». + +

+ + +

+ Cada segment s'identifica amb un únic UID del segment de 128 bits de + longitud. Aquest UID és automàticament generat pel mkvmerge(1). La vinculació + es realitza principalment inserint els UID dels segments (abreujat: + SID) del fitxer anterior/següent a la informació de la + capçalera del segment. El mkvinfo(1) mostrarà aquests SID si + els troba. + +

+ + +

+ Si es divideix un fitxer en diversos fitxers més petits i després s'empra la + vinculació, llavors els codis de temps no començaran des de 0, sinó que + continuaran des d'on va quedar l'últim fitxer. D'aquesta manera, es + mantindrà el temps absolut fins i tot si els fitxers anteriors no estan + disponibles (p. ex., quan es transmeten). Si no s'empra la vinculació, + llavors els codis de temps de cada fitxer començaran des de 0. Per omissió, + el mkvmerge(1) no emprarà la vinculació de fitxers. Si voleu, la podeu + activar amb l'opció --link. Aquesta opció només és útil si + la divisió també està activa. + +

+ + +

+ Independentment de si la divisió està activa o no, l'usuari li pot indicar + al mkvmerge(1) que vinculi els fitxers generats a alguns SID + específics. Això s'aconsegueix amb les opcions + --link-to-previous i + --link-to-next. Aquestes opcions accepten un + SID del segment en el format que surt del mkvinfo(1): 16 + números hexadecimals entre 0x00 i + 0xFF prefixats cadascun amb «0x», + p. ex., «0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 + 0x5e 0xca 0xb3 0x93». De manera alternativa, es pot emprar una forma + curta: 16 nombres hexadecimals entre 0x00 i + 0xFF sense el prefix «0x» i sense + espais, p. ex., «41da7366d9cfb21eae78ebb45ecab393». + +

+ + +

+ Si s'empra la divisió, llavors el primer fitxer serà vinculat al + SID indicat amb --link-to-previous i + l'últim fitxer serà vinculat al SID indicat amb + --link-to-next. Si no s'empra la divisió, llavors el fitxer + serà vinculat a ambdós SID. + +

+ +

11. Valors per omissió

+ + +

+ L'especificació Matroska(tm) defineix que alguns elements tenen un valor + predeterminat. En general, si el valor és igual que el predeterminat, + llavors no serà escrit en el fitxer per tal d'estalviar espai. Els elements + que l'usuari podria trobar a faltar a la sortida del mkvinfo(1) són els + elements idioma i etiqueta de pista per + omissió. El valor predeterminat per a + l'idioma és anglès («eng»), i per + a l'etiqueta de pista per omissió és + true (cert). Per tant, si empreu --language + 0:eng per a una pista, llavors no es mostrarà a la sortida del + mkvinfo(1). + +

+ +

12. Adjunts

+ + +

+ Possiblement també voldreu conservar algunes fotografies juntament amb el + vostre fitxer Matroska(tm), o emprar subtítols SSA i + necessitareu un tipus de lletra TrueType(tm) especial + que és realment rar. En aquests casos els podeu adjuntar al fitxer + Matroska(tm). No seran simplement annexats, sinó que seran incrustats. Un + reproductor els podrà mostrar (en el cas de les «fotografies») o emprar-los + per a renderitzar els subtítols (en el cas dels tipus de lletra + «TrueType(tm)». + +

+ + +

+ Aquí hi ha un exemple de com adjuntar una fotografia i un tipus de lletra + TrueType(tm) al fitxer de sortida: + +

+ +
$ mkvmerge -o sortida.mkv -A vídeo.avi so.ogg \
+  --attachment-description "Jo i la banda darrere de l'escenari en una petita reunió" \
+  --attachment-mime-type image/jpeg \
+  --attach-file jo_i_la_banda.jpg \
+  --attachment-description "Un tipus de lletra veritablement rar i amb un aspecte increïblement bo" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file tipus_de_lletra_molt_fresc.ttf
+ +

+ Si s'empra un fitxer Matroska(tm) que conté adjunts com a fitxer d'entrada, + llavors el mkvmerge(1) copiarà tots els adjunts dins del fitxer nou. La + selecció de quins fitxers es copiaran, es pot canviar amb les opcions --attachments + i --no-attachments. + +

+ +

13. Capítols

+ + +

+ El sistema de capítols del Matroska(tm) és més poderós del que ho era l'antic + sistema emprat per als fitxers OGM. Les especificacions + completes es poden trobar a la pàgina + web del Matroska. + +

+ + +

+ El mkvmerge(1) admet dos tipus de fitxers de capítols com a entrada. El + primer format, anomenat «format de capítols senzill», és el mateix format + que s'espera en les eines OGM. El segon format es basa en + el format de capítols en XML, el qual implementa totes les funcionalitats + de capítols del Matroska(tm). + +

+ + +

+ A part dels fitxers de capítols dedicats, el mkvmerge(1) també pot llegir + capítols des d'altres formats de fitxer (p. ex., MP4, Ogg, Blu-ray o DVD). + +

+ + +

13.1. El format de capítols senzill

+ + + +

+ Aquest format consisteix en un parell de línies que comencen amb + «CHAPTERxx=» i «CHAPTERxxNAME=», + respectivament. La primera conté el codi de temps d'inici mentre que el + segon conté el títol. Heus aquí un exemple: + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=Introducció
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=El nen prepara un rock
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=El nen fa trontollar la casa
+ +

+ El mkvmerge(1) transformarà totes les parelles o línies en un i Matroska(tm) + ChapterAtom. No estableix cap + ChapterTrackNumber, el qual significa que tots els + capítols s'apliquen a totes les pistes en el fitxer. + +

+ + +

+ Com es tracta d'un fitxer de text, podria ser necessari realitzar una + conversió del joc de caràcters. Vegeu la secció sobre la conversió per a fitxers de + text i jocs de caràcters, per a veure una explicació sobre com + realitza el mkvmerge(1) la conversió entre diferents jocs de caràcters. + +

+ + + +

13.2. El format de capítols basat en XML

+ + +

+ El format de capítols basat en XML s'assembla a aquest exemple: + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>Un capítol curt</ChapterString>
+        <ChapterLanguage>cat</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>Una part d'aquest capítol curt</ChapterString>
+          <ChapterLanguage>cat</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ Amb aquest format es poden realitzar tres coses que no es poden amb el + format de capítol senzill: + +

+ + +
    + +
  1. +

    Es pot establir el codi de temps per al final del capítol,

    +
  2. + +
  3. +

    els capítols es poden aniuar,

    +
  4. + +
  5. +

    es poden establir l'idioma i el país.

    +
  6. + +
+ + +

+ La distribució de les mkvtoolnix conté alguns fitxers d'exemple en el + subdirectori doc que es poden emprar com a base. + +

+ + +

+ Tot seguit es mostra la llista de les etiquetes XML admeses, els seus tipus + de dades, a on corresponen i amb un interval vàlid per als seus valors: + +

+ +
Chapters (domina)
+  EditionEntry (domina)
+    EditionUID (enter sense signe, interval vàlid: 1 <= valor)
+    EditionFlagHidden (enter sense signe, interval vàlid: 0 <= valor <= 1)
+    EditionFlagDefault (enter sense signe, interval vàlid: 0 <= valor <= 1)
+    EditionFlagOrdered (enter sense signe, interval vàlid: 0 <= valor <= 1)
+    ChapterAtom (domina)
+      ChapterAtom (domina)
+      ChapterUID (enter sense signe, interval vàlid: 1 <= valor)
+      ChapterTimeStart (enter sense signe)
+      ChapterTimeEnd (enter sense signe)
+      ChapterFlagHidden (enter sense signe, interval vàlid: 0 <= valor <= 1)
+      ChapterFlagEnabled (enter sense signe, interval vàlid: 0 <= valor <= 1)
+      ChapterSegmentUID (binari, interval vàlid: 1 <= longitud en bytes)
+      ChapterSegmentEditionUID (enter sense signe, interval vàlid: 1 <= valor)
+      ChapterPhysicalEquiv (enter sense signe)
+      ChapterTrack (domina)
+        ChapterTrackNumber (enter sense signe, interval vàlid: 1 <= valor)
+      ChapterDisplay (domina)
+        ChapterString (cadena en UTF-8)
+        ChapterLanguage (cadena en UTF-8)
+        ChapterCountry (cadena en UTF-8)
+      ChapterProcess (domina)
+        ChapterProcessCodecID (enter sense signe)
+        ChapterProcessPrivate (binari)
+        ChapterProcessCommand (domina)
+          ChapterProcessTime (enter sense signe)
+          ChapterProcessData (binari)
+ + +

13.3. Lectura de capítols des de Blu-ray

+ + + +

+ El mkvmerge(1) pot llegir capítols des de Blu-ray sense encriptar. Per a + això, podreu utilitzar el camí a una de les llistes de reproducció MPLS amb + el paràmetre --chapters. + +

+ + +

+ Exemple: --chapters + /srv/blurays/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. Lectura de capítols des de DVD

+ + + +

+ Quan el MKVToolNix es compila amb la biblioteca + libdvdread(tm), el mkvmerge(1) podrà llegir els + capítols des dels DVD. Per a això, podreu utilitzarar el camí a una de les + carpetes o fitxers en el DVD amb el paràmetre + --chapters. Com els DVD poden contenir més d'un títol + i cada títol té el seu propi conjunt de capítols, podreu afegir dos punts i + el número de títol desitjat al final de l'argument amb el nom de fitxer. El + número de títol predeterminat és 1. + +

+ + +

+ Exemple: --chapters /srv/dvds/BigBuckBunny/VIDEO_TS:2 + +

+ + + +

13.5. Notes generals

+ + +

+ Quan es divideixen els fitxers, el mkvmerge(1) també ajustarà correctament + els capítols. Això vol dir que cada fitxer només inclourà les entrades dels + capítols que se li apliquin, i que es compensaran els codis de temps per a + que coincideixin amb el nou codi de temps de cada fitxer de sortida. + +

+ + +

+ El mkvmerge(1) és capaç de copiar els capítols des de fitxers d'origen + Matroska(tm), llevat que s'inhabiliti explícitament amb l'opció --no-chapters. + Els capítols de tots els orígens (fitxers Matroska(tm), fitxers Ogg, fitxers + MP4, fitxers de text amb capítols) en general no es + fusionen i acaben en ChapterEditions separats. Només + si els capítols són llegits des de diversos fitxers Matroska(tm) o XML, + aquests compartiran els mateixos UID d'edició, llavors els capítols seran + fusionats en un únic ChapterEdition. Si es desitja + una fusió com aquesta en altres situacions, l'usuari primer haurà d'extreure + els capítols de tots els orígens amb el mkvextract(1), fusionar els fitxers + en XML manualment i multiplexar-los després. + +

+ + +

14. Etiquetes

+ + + +

14.1. Introducció

+ + + +

+ El sistema d'etiquetes de Matroska(tm) és similar al d'altres contenidors: un + conjunt de parelles CLAU=VALOR. No obstant això, al + Matroska(tm), aquestes etiquetes també es poden aniuar, i tant la + CLAU com el VALOR són elements + propis. El fitxer d'exemple example-tags-2.xml mostra + com emprar aquest sistema. + +

+ + + +

14.2. Àmbit de les etiquetes

+ + + +

+ Les etiquetes del Matroska(tm) no s'apliquen automàticament a tot el + fitxer. És possible fer-ho, però també aplicar-les a diferents parts del + fitxer: a una o més pistes, a un o més capítols, o fins i tot en una + combinació d'ambdues. L'especificació + del Matroska proporciona més detalls sobre això. + +

+ + +

+ Una cosa important és que les etiquetes estan vinculades a pistes o capítols + amb l'element d'etiquetes Targets del Matroska(tm), a + més els UID emprats per a vincular no seran els ID de + les pistes que emprarà el mkvmerge(1) arreu. En canvi, els números emprats + seran els UID que calcularà automàticament el mkvmerge(1) (si la pista es + pren d'un altre format de fitxer que no sigui Matroska(tm)) o si es copia des + del fitxer d'origen, si el fitxer d'origen de la pista és un fitxer + Matroska(tm). Per tant, és complicat saber quins UID s'han emprat al fitxer + d'etiquetes abans que el fitxer fos proporcionat al mkvmerge(1). + +

+ + +

+ El mkvmerge(1) té dues opcions amb les quals es poden afegir etiquetes als + fitxers Matroska(tm): Les opcions --global-tags + i --tags. La + diferència és que la primera opció, --global-tags, + farà que les etiquetes s'apliquin a tot el fitxer eliminant qualsevol + d'aquests elements Targets esmentats + anteriorment. L'última opció, --tags, insereix + automàticament l'UID que genera el mkvmerge(1) per a l'etiqueta especificada + amb la part TID de l'opció --tags. + +

+ + + +

14.3. Exemple

+ + +

+ Diguem que voleu afegir etiquetes a una pista de vídeo llegida des d'un + fitxer AVI. mkvmerge --identify + fitxer.avi informa que l'ID de la pista de vídeo (no confondre + aquest ID amb l'UID!) és 0. De manera que creareu el fitxer d'etiquetes, + deixant de banda tots els elements Targets i cridareu + el mkvmerge(1): + +

+ +
$ mkvmerge -o fitxer.mkv --tags 0:etiquetes.xml fitxer.avi
+ + +

14.4. Format del fitxer d'etiquetes

+ + +

+ El mkvmerge(1) admet un format de fitxer d'etiquetes basat en XML. El + format és molt similar al model de l'especificació + del Matroska. Tant la distribució binària com el codi font de les + MKVToolNix, vénen acompanyades d'un fitxer d'exemple anomenat + example-tags-2.xml, el qual simplement llista totes les + etiquetes conegudes i es pot emprar com a base per als fitxers d'etiquetes. + +

+ + +

+ Els fonaments són: + +

+ + +
    + +
  • +

    L'element més extern haurà de ser <Tags>. +

    +
  • + +
  • + +

    Una etiqueta lògica estarà continguda dins d'un parell d'etiquetes + <Tag> en XML. +

    + +
  • + +
  • +

    Els espais en blanc, directament abans i després del contingut de + l'etiqueta, seran ignorats. +

    +
  • + +
+ + + +

14.5. Tipus de dades

+ + +

+ El nou sistema d'etiquetatge del Matroska(tm) només reconeix dos tipus de + dades, una cadena en UTF-8 i un tipus binari. La primera s'empra per al nom + de l'etiqueta i l'element <String>, mentre que + el tipus binari s'empra per a l'element + <Binary>. + +

+ + +

+ Com a dada binària, en si mateixa, no té sentit dins d'un fitxer en XML, + el mkvmerge(1) admet dos altres mètodes per a emmagatzemar dades binàries. Si + el contingut d'una etiqueta XML comença amb un signe + «@», llavors el text que segueix serà tractat com un nom + de fitxer. El contingut del fitxer corresponent es copiarà dins de l'element + del Matroska(tm). + +

+ + +

+ Altrament, les dades s'esperen codificades en Base64. Aquesta és una + codificació que transforma les dades binàries en un conjunt limitat de + caràcters ASCII i s'empra, p. ex., en programes de correu + electrònic. El mkvextract(1) generarà dades codificades en Base64 per als + elements binaris. + +

+ + +

+ L'obsolet sistema d'etiquetatge coneix més tipus de dades que es poden + trobar a les especificacions oficials per a etiquetes del Matroska(tm). Com + que el mkvmerge(1) ja no admet aquest sistema, aquests tipus no es descriuran + aquí. + +

+ + + +

14.6. Etiquetes conegudes per al format de fitxer en XML

+ + + +

+ Tot seguit es mostra la llista de les etiquetes XML admeses, els seus tipus + de dades, a on corresponen i amb un interval vàlid per als seus valors: + +

+ +
Tags (domina)
+  Tag (domina)
+    Targets (domina)
+      TargetTypeValue (enter sense signe)
+      TargetType (cadena en UTF-8)
+      TrackUID (enter sense signe)
+      EditionUID (enter sense signe)
+      ChapterUID (enter sense signe)
+      AttachmentUID (enter sense signe)
+    Simple (domina)
+      Simple (domina)
+      Name (cadena en UTF-8)
+      TagLanguage (cadena en UTF-8)
+      DefaultLanguage (enter sense signe)
+      String (cadena en UTF-8)
+      Binary (binari)
+ +

15. Informació del segment

+ + + +

+ Amb un fitxer en XML amb informació dels segments és possible establir certs + valors en el camp de la capçalera «segment information» d'un fitxer + Matroska(tm). Tots aquests valors no es poden establir a través d'altres + opcions de la línia d'ordres. + +

+ + +

+ Es poden establir altres camps de la capçalera «segment information» a + través de les opcions de la línia d'ordres, però no mitjançant el fitxer en + XML. Això inclou, p. ex., les opcions --title i --timestamp-scale. + +

+ + +

+ Hi ha altres elements que no es poden establir a través de la línia d'ordres + ni mitjançant els fitxers en XML. Això inclou els següents elements: + DateUTC (també conegut com la «muxing date»), + MuxingApp, WritingApp i + Duration. Sempre les estableix el mkvmerge(1) mateix. + +

+ + +

+ Tot seguit es mostra la llista de les etiquetes XML admeses, els seus tipus + de dades, a on corresponen i amb un interval vàlid per als seus valors: + +

+ +
Info (domina)
+  SegmentUID (binari, interval vàlid: longitud en bytes == 16)
+  SegmentFilename (cadena en UTF-8)
+  PreviousSegmentUID (binari, interval vàlid: longitud en bytes == 16)
+  PreviousSegmentFilename (cadena en UTF-8)
+  NextSegmentUID (binari, interval vàlid: longitud en bytes == 16)
+  NextSegmentFilename (cadena en UTF-8)
+  SegmentFamily (binari, interval vàlid: longitud en bytes == 16)
+  ChapterTranslate (domina)
+    ChapterTranslateEditionUID (enter sense signe)
+    ChapterTranslateCodec (enter sense signe)
+    ChapterTranslateID (binari)
+

16. Disposició dels fitxers Matroska

+ + +

+ La disposició d'un fitxer Matroska(tm) és força flexible. El mkvmerge(1) crearà + un fitxer d'una manera predefinida. El fitxer resultant tindrà una aparença + com aquesta: + +

+ + +

+ [EBML head] [segment {meta seek #1} [segment information] [track + information] {attachments} {chapters} [cluster 1] {cluster 2} «...» + {cluster n} {cues} {meta seek #2} {tags}] + +

+ + +

+ Els elements que estan entre claudàtors són opcionals, i depenen del + contingut i opcions emprades. Uns quants apunts: + +

+ + +
    + +
  • + +

    + La meta de cerca núm. 1 (meta seek #1) només inclou un petit nombre + d'elements de nivell 1, i només si en realitat existeixen: adjunts, + capítols, índexs, etiquetes, meta de cerca núm. 2. Les versions antigues del + mkvmerge(1) també col·loquen els clústers dins d'aquests elements meta de + cerca. Per tant, en alguns casos imprecisos era necessari reservar prou + espai. Això fallava sovint. Ara només els clústers són emmagatzemats a la + meta de cerca núm. 2, i la meta de cerca núm. 1 es refereix a l'element meta + de cerca núm. 2. + +

    + +
  • + + +
  • + +

    Els elements adjunts, capítols i etiquetes només estan presents si s'han + afegit. +

    + +
  • + +
+ + +

+ El fitxer Matroska(tm) més curt possible s'assemblaria a això: + +

+ + +

+ [EBML head] [segment [segment information] [track information] [cluster 1]] + +

+ + +

+ Aquest podria ser el cas per als fitxers amb només àudio. + +

+ +

17. Fitxers externs per als codis de temps

+ + +

+ El mkvmerge(1) permet a l'usuari triar els codis de temps per a una pista + específica. Es pot emprar per a crear fitxers de vídeo amb una taxa de + fotogrames variable (VFR) o per a incloure discontinuïtats en l'àudio. En + aquest cas, un fotograma serà la unitat emprada pel mkvmerge(1) per a crear + cada bloc del Matroska(tm). Per al vídeo és exactament un fotograma, per a + l'àudio això és un paquet d'un tipus d'àudio específic. P. ex., per a + AC-3 això seria un paquet que conté + 1536 mostres. + +

+ + +

+ Els fitxers de codis de temps que s'empren quan s'annexen les pistes a les + altres, només s'han d'especificar a la primera part en una cadena de + pistes. Per exemple, si annexeu dos fitxers, v1.avi i v2.avi, i voleu emprar + codis de temps, llavors la vostra línia d'ordres serà quelcom a això: + +

+ +
$ mkvmerge «...» --timestamps 0:codis_de_temps.txt v1.avi +v2.avi
+ +

+ Hi ha quatre formats que són reconeguts pel mkvmerge(1). La primera línia + sempre conté el número de la versió. Les línies buides, les línies que només + contenen espais en blanc i les que comencen amb un caràcter + «#» seran ignorades. + +

+ + +

17.1. Format v1 per al fitxer del codi de temps

+ + +

+ Aquest format comença amb la línia de la versió. La segona línia declara el + nombre per omissió de fotogrames per segon. Totes les línies següents + contenen tres números separats per comes: el fotograma d'inici + (0 és el primer fotograma), el fotograma final i el + nombre de fotogrames en aquest interval. Els FPS + (fotogrames per segon) són un nombre decimal amb un signe de punt + «.» com a punt decimal. Els intervals poden contenir + discontinuïtats per als FPS emprats per omissió. Un + exemple: + +

+ +
# Format v1 per al codi de temps
+assume 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. Format v2 per al fitxer del codi de temps

+ + + +

+ En aquest format cada línia conté un codi de temps per al fotograma + corresponent. Aquest codi de temps s'ha d'especificar amb una precisió de + mil·lisegons. Pot ser o no un nombre decimal. S'han + d'especificar com a mínim tantes línies de codis de temps com fotogrames hi + ha a la pista. Els codis de temps en aquest fitxer han d'estar ordenats. Un + exemple per a 25 fps: + +

+ +
# Format v2 per al codi de temps
+0
+40
+80
+ + +

17.3. Format v3 per al fitxer del codi de temps

+ + +

+ En aquest format cada línia conté una durada en segons seguida per un nombre + opcional de fotogrames per segon. Ambdós camps poden ser nombres + decimals. Si no s'especifica el nombre de fotogrames per segon, s'emprarà el + valor per omissió. Per a l'àudio s'hauria de deixar calcular al còdec els + codis de temps dels fotogrames. Per a això, haureu d'emprar + 0.0 com el nombre de fotogrames per segon. També podeu + crear discontinuïtats en el flux emprant la paraula clau + «gap» seguida per la durada de la discontinuïtat. Un + exemple per a un fitxer d'àudio: + +

+ +
# Format v3 per al codi de temps
+assume 0.0
+25.325
+7.530,38.236
+gap, 10.050
+2.000,38.236
+ + +

17.4. Format v4 per al fitxer del codi de temps

+ + +

+ Aquest format és idèntic al format v2. L'única diferència és que els codis + de temps no s'han d'ordenar. Aquest format no s'hauria d'emprar gairebé mai. + +

+ + +

18. Codis de sortida

+ + + +

+ El mkvmerge(1) sortirà amb un d'aquests tres codis de sortida: + +

+ + +
    + +
  • + +

    + 0 -- Aquest codi de sortida significa que el + multiplexat s'ha realitzat correctament. + +

    + +
  • + + +
  • + +

    + 1 -- En aquest cas, el mkvmerge(1) ha generat una + sortida amb almenys un avís, però el multiplexat ha continuat. Un avís és + prefixat amb el text «Avís:». Depenent de les qüestions + involucrades, el fitxer resultant serà o no correcte. L'usuari serà instat a + revisar tant els avisos com el fitxer. + +

    + +
  • + + +
  • + +

    + 2 -- Aquest codi de sortida s'empra després de + produir-se un error. El mkvmerge(1) interromprà el procés just després de + mostrar el missatge d'error. L'interval dels missatges d'error va des + d'arguments incorrectes a la línia d'ordres fins a errors de + lectura/escriptura en fitxers malmesos. + +

    + +
  • + +
+ +

19. Variables d'entorn

+ + + +

+ El mkvmerge(1) empra les variables per omissió que es determinen a la + configuració regional del sistema (p. ex., LANG i la + família LC_*). Variables addicionals: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG i la + seva forma abreujada MTX_DEBUG + +

El contingut es tractarà com si s'hagués passat l'opció --debug. +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE i + la seva forma abreujada MTX_ENGAGE + +

El contingut es tractarà com si s'hagués passat l'opció --engage. +

+ +
+ +

20. Vegeu també

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. WWW

+ + +

+ Sempre trobareu l'última versió a la pàgina de les MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..224d001543ae15fb577e7b6a1ccdec591a258d07 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvpropedit.html @@ -0,0 +1,1344 @@ + + + + + mkvpropedit -- Modifica les propietats dels fitxers Matroska existents sense un + multiplexat complet + + + + +
mkvpropedit -- Modifica les propietats dels fitxers Matroska(tm) existents sense un + multiplexat complet +
+
+ +
+

1. Sinopsis

+ + +
mkvpropedit opcions {nom_fitxer_origen} {accions} +
+ +

2. Descripció

+ + +

+ Aquest programa analitza un fitxer Matroska(tm) i modifica algunes de les + seves propietats. Després escriu aquestes modificacions en el fitxer + existent. Entre les propietats que es poden modificar es troben els elements + sobre la informació del segment (p. ex., el títol), les capçaleres de les + pistes (p. ex., el codi de l'idioma, l'etiqueta «Pista per omissió» o el + nom). + +

+ + +

+ Opcions: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ Llista tots els noms de propietat coneguts i editables, el seu tipus + (cadena, enter, booleà, etc.) i una petita descripció. El programa després + sortirà. Per tant, el paràmetre nom_fitxer_origen no + té per què subministrar-se. + +

+ +
-p, --parse-mode + mode + +

+ Estableix el mode d'anàlisi. El paràmetre «mode» pot + ser «fast» (ràpida, el qual és el predeterminat) o + «full» (completa). El mode «fast» no + analitzarà tot el fitxer, però emprarà els elements meta de cerca per a + localitzar els elements requerits d'un fitxer d'origen. En el 99% dels casos + n'hi haurà prou. No obstant això, per als fitxers que no contenen elements + meta de cerca o que estan malmesos, l'usuari hauria d'emprar el mode + d'anàlisi «full». L'anàlisi completa d'un fitxer pot + trigar alguns minuts, mentre que una anàlisi ràpida només prendrà alguns + segons. + +

+ +
+ + +

+ Accions que tenen a veure amb les propietats d'informació de la pista i del + segment: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit selector + +

+ Estableix la secció del fitxer Matroska(tm) (informació del segment o una + certa capçalera d'una pista) sobre la qual se centraran les següents + accions: add (afegir), + set (establir) i delete (suprimir). Aquesta + opció es pot emprar múltiples vegades de manera que es pot modificar més + d'un element alhora. + +

+ + +

+ Per omissió, el mkvpropedit(1) editarà la secció d'informació del segment. + +

+ + +

+ Vegeu la secció sobre els + selectors per a l'edició, per a una completa descripció de la + sintaxi. + +

+ +
-a, --add + nom=valor + +

+ Afegeix una propietat nom amb el contingut de + valor. Aquesta propietat serà afegida fins i tot si + ja existeix. Tingueu en compte que la majoria de les propietats són úniques + i només es troben una vegada. + +

+ +
-s, --set + nom=valor + +

+ Estableix totes les ocurrències de la propietat nom + amb el contingut de valor. Si no existeix dita + propietat, llavors serà afegida. + +

+ +
-d, --delete nom + +

+ Suprimeix totes les ocurrències de la propietat + nom. Tingueu en compte que algunes propietats són + requerides i no es poden suprimir. + +

+ +
+ + +

+ Accions que tenen a veure amb les etiquetes i capítols: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags + selector:nom_fitxer + +

+ Afegeix o substitueix les etiquetes al nom_fitxer o + l'elimina si està buit. El mkvpropedit(1) llegirà els mateixos formats + d'etiquetes en XML que pugui llegir el mkvmerge(1). + +

+ + +

+ El selector serà una de les paraules + all, global o + track. Per a all, el mkvpropedit(1) + substituirà o eliminarà totes les etiquetes en un fitxer. Amb + global només se substituiran o eliminaran les etiquetes + globals. + +

+ + +

+ Amb track, el mkvpropedit(1) substituirà les etiquetes + d'una pista específica. A més, les etiquetes llegides des de + nom_fitxer seran assignades a la mateixa pista. La + pista s'especifica de la mateixa manera que amb els selectors per a l'edició (vegeu + a continuació), p. ex., --tags + track:a1:etiquetes_d_àudio_noves.xml. + +

+ +
--add-track-statistics-tags + +

+ Calcula les estadístiques per a totes les pistes en un fitxer i hi afegeix + etiquetes d'estadístiques noves. Si el fitxer ja conté dites etiquetes, + llavors seran actualitzades. + +

+ +
--delete-track-statistics-tags + +

+ Suprimeix totes les etiquetes d'estadístiques existents a la pista d'un + fitxer. Si el fitxer no conté etiquetes d'estadístiques de la pista, llavors + no serà modificat. + +

+ +
-c, --chapters + nom_fitxer + +

+ Afegeix o substitueix els capítols al nom_fitxer o els + elimina si està buit. El mkvpropedit(1) llegirà els mateixos formats de + capítols senzills i en XML que pugui llegir el mkvmerge(1). + +

+ +
+ + +

+ Accions per a manejar els adjunts: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment nom_fitxer + +

+ Afegeix un adjunt nou des de nom_fitxer. + +

+ + +

+ Si s'ha emprat abans l'opció --attachment-name, llavors + s'emprarà el seu valor com a nom del nou adjunt. D'altra manera, derivarà + del nom_fitxer. + +

+ + +

+ Si s'ha emprat abans l'opció --attachment-mime-type, + llavors s'emprarà el seu valor com a tipus MIME del nou adjunt. D'altra + manera, es detectarà automàticament del contingut de + nom_fitxer. + +

+ + +

+ Si s'ha emprat abans l'opció --attachment-description, + llavors s'emprarà el seu valor com a descripció del nou adjunt. D'altra + manera, no s'establirà cap descripció. + +

+ + +

+ Si s'ha emprat abans l'opció --attachment-uid, llavors + s'emprarà el seu valor com a UID del nou adjunt. D'altra manera, es generarà + automàticament un UID aleatori. + +

+ +
--replace-attachment + selector:nom_fitxer + +

+ Substitueix un o més adjunts que coincideixin amb el + selector del nom_fitxer. Si + coincideix més d'un adjunt, llavors tot el seu contingut serà substituït per + al contingut del nom_fitxer. + +

+ + +

+ El selector pot tenir una d'entre quatre + formes. Estan explicades a continuació, a la secció els selectors per a + l'adjunt. + +

+ + +

+ Si s'ha emprat abans l'opció --attachment-name, llavors + s'emprarà el seu valor com a nom per a cada adjunt modificat. D'altra + manera, no es canviarà cap nom. + +

+ + +

+ Si s'ha emprat abans l'opció --attachment-mime-type, + llavors s'emprarà el seu valor com a tipus MIME per a cada adjunt + modificat. D'altra manera, no es canviarà cap tipus MIME. + +

+ + +

+ Si s'ha emprat abans l'opció --attachment-description, + llavors s'emprarà el seu valor com a descripció per a cada adjunt + modificat. D'altra manera, no es canviarà cap descripció. + +

+ + +

+ Si s'ha emprat abans l'opció --attachment-uid, llavors + s'emprarà el seu valor com a UID per a cada adjunt modificat. D'altra + manera, no es canviarà cap UID. + +

+ +
--update-attachment selector + +

+ Estableix les propietats d'un o més adjunts que coincideixen amb el + selector. Si coincideix més d'un adjunt, llavors + s'actualitzaran totes les seves propietats. + +

+ + +

+ El selector pot tenir una d'entre quatre + formes. Estan explicades a continuació, a la secció els selectors per a + l'adjunt. + +

+ + +

+ Si s'ha emprat abans l'opció --attachment-name, llavors + s'emprarà el seu valor com a nom per a cada adjunt modificat. D'altra + manera, no es canviarà cap nom. + +

+ + +

+ Si s'ha emprat abans l'opció --attachment-mime-type, + llavors s'emprarà el seu valor com a tipus MIME per a cada adjunt + modificat. D'altra manera, no es canviarà cap tipus MIME. + +

+ + +

+ Si s'ha emprat abans l'opció --attachment-description, + llavors s'emprarà el seu valor com a descripció per a cada adjunt + modificat. D'altra manera, no es canviarà cap descripció. + +

+ + +

+ Si s'ha emprat abans l'opció --attachment-uid, llavors + s'emprarà el seu valor com a UID per a cada adjunt modificat. D'altra + manera, no es canviarà cap UID. + +

+ +
--delete-attachment selector + +

+ Suprimeix un o més adjunts que coincideixin amb el + selector. + +

+ + +

+ El selector pot tenir una d'entre quatre + formes. Estan explicades a continuació, a la secció els selectors per a + l'adjunt. + +

+ +
+ + +

+ Opcions per a les accions en els adjunts: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name nom + +

+ Estableix el nom a emprar per a les opcions + --add-attachment o --replace-attachment. + +

+ +
--attachment-mime-type tipus_MIME + +

+ Estableix el tipus MIME a emprar per a les opcions + --add-attachment o --replace-attachment. + +

+ +
--attachment-description descripció + +

+ Estableix la descripció a emprar per a les opcions + --add-attachment o --replace-attachment. + +

+ +
--enable-legacy-font-mime-types + +

+ Permet l'ús de tipus MIME llegats per a determinats tipus + d'adjunts de lletra. Per exemple, s'usarà + «application/x-truetype-font» per a tipus de lletra + TrueType en lloc de «fonts/ttf». + +

+ + +

+ Això afecta tan a afegir adjunts nous aixi com a substituir els existents, + però només si no s'especifica el tipus MIME nou. No es + canviaran els altres adjunts existents. + +

+ + +

+ Els tipus MIME afectats son «font/sfnt», + «font/ttf» i «font/collection» els + quals seran tots assignats a + «application/x-truetype-fonts» i + «font/otf» el qual serà assignat a + «application/vnd.ms-opentype». + +

+ +
+ + +

+ Altres opcions: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ Normalment, quan l'usuari sol·licita canvis en la propietat de la capçalera + «Language» de la pista, el mkvpropedit(1) aplicarà el + mateix canvi al nou element de la capçalera + LanguageIETF de la pista a més de l'element + Language heretat. Si s'utilitza aquesta opció, el + canvi només s'aplicarà a l'element Language heretat. + +

+ + +

+ Aquesta opció no afectarà els canvis sol·licitats mitjançant la propietat de + la capçalera «language-IETF» de la pista. + +

+ +
--normalize-language-ietf mode + +

+ Permet normalitzar totes les etiquetes d'idioma BCP 47 de la IETF a la seva + forma canònica amb el mode «canonical», a la seva forma + d'idioma estès amb el mode «extLang» o la desactiva amb + el mode «off». Per defecte, s'aplicarà la normalització a + la forma canònica. + +

+ + +

+ En la forma canònica, totes les subetiquetes per a les quals existeixen els + valors preferits se substitueixen per aquells valors preferits. Això es + converteix, p. ex. «zh-yue-jyutping» a + «yue-jyutping» o «fr-FX» a + «fr-FR». + +

+ + +

+ Per a la forma de les subetiquetes d'idioma estès, primer es construeix la + forma canònica. Després, tots els idiomes principals per als quals existeix + una subetiqueta d'idioma estès se substitueixen per aquesta subetiqueta i el + seu prefix d'idioma estès. Això converteix, + p. ex. «yue-jyutping» torna a + «zh-yue-jyutping», però no té cap efecte sobre + «fr-FR» ja que «fr» no és una + subetiqueta d'idioma estès. + +

+ + +

+ Aquesta normalització només s'aplica als elements que realment es + modifiquen: + +

+ + +
    + +
  • + +

    + Quan editeu les capçaleres de les pistes, només es veuran afectats els + elements d'idioma de les pistes que s'estableixen mitjançant especificacions + d'edició. Els idiomes de les pistes que no s'editen no es + canviaran. L'edició d'una pista, però configurant només propietats diferents + de l'idioma, tampoc no afectarà a l'idioma. + +

    + +
  • + + +
  • + +

    + Quan editeu els capítols, es veuran afectats tots els elements d'idioma de + tots els elements del capítol, ja que els capítols existents sempre se + substitueixen completament. + +

    + +
  • + + +
  • + +

    + Quan editeu les etiquetes, només es veuran afectats els elements d'idioma de + les etiquetes que realment se substitueixen. Per exemple, quan substituïu + les etiquetes globals, les etiquetes de pista existents no es veuran + afectades. + +

    + +
  • + +
+ + +

+ La millor manera de normalitzar totes les etiquetes d'idioma existents en un + fitxer és fer un multiplexat amb mkvmerge(1) i establir la seva opció + «--normalize-language-ietf» al mode desitjat. + +

+ +
--command-line-charset + joc_de_caràcters + +

+ Estableix el joc de caràcters al qual convertir les cadenes indicades des de + la línia d'ordres. Per omissió serà el joc de caràcters donat per la + configuració regional actual del sistema. + +

+ +
--output-charset joc_de_caràcters + +

+ Estableix el joc de caràcters al qual convertir les cadenes de la + sortida. Per omissió serà el joc de caràcters donat per la configuració + regional actual del sistema. + +

+ +
-r, --redirect-output + nom_fitxer + +

+ Escriu tots els missatges al nom_fitxer en lloc de a + la consola. Si bé això es pot fer fàcilment amb la redirecció de la sortida, + hi ha casos en què cal aquesta opció: quan el terminal torna a interpretar + la sortida abans d'escriure-la a un fitxer. Es respectarà el joc de + caràcters establert amb --output-charset. + +

+ +
--ui-language codi + +

+ Força l'ús de les traduccions per al codi d'idioma + (p. ex., «de_DE» per a les traduccions en + alemany). Introduint «list» com a + codi, es farà que el programa ofereixi a la sortida + una llista de les traduccions disponibles. + +

+ +
--abort-on-warnings + +

+ Indica al programa que interrompi després d'emetre el primer avís. El codi + de sortida del programa serà 1. + +

+ +
--debug tema + +

+ Activa la depuració per a una característica específica. Aquesta opció només + és útil per als desenvolupadors. + +

+ +
--engage característica + +

+ Activa les característiques experimentals. Es pot sol·licitar una llista de + les característiques disponibles amb mkvpropedit --engage + list. Aquestes característiques no estan destinades a ser emprades + en situacions normals. + +

+ +
--gui-mode + +

+ Activa el mode IGU. En aquest mode, les línies surten amb un format especial + que pot explicar-vos el que està succeint per tal de controlar la + IGU. Aquests missatges segueixen el format + «#IGU#missatge». El missatge pot estar seguit per parells + clau/valor com + «#IGU#missatge#clau1=valor1#clau2=valor2…». Ni els + missatges ni les claus seran traduïdes, sempre sortiran en anglès. + +

+ +
-v, --verbose + +

+ Serà detallat i mostrarà tots els elements importants del Matroska(tm) a + mesura que es llegeixin. + +

+ +
-h, --help + +

+ Mostra la informació d'ús i surt. + +

+ +
-V, --version + +

+ Mostra la informació sobre la versió i surt. + +

+ +
@fitxer_d_opcions.json + +

+ Llegeix els arguments addicionals per a la línia d'ordres des del fitxer + fitxer_d_opcions. Per a més informació sobre els + formats admesos, vegeu la secció anomenada «Fitxers d'opcions» a la pàgina + man del mkvmerge(1). + +

+ +
+ +

3. Selectors per a l'edició

+ + +

+ L'opció --edit + estableix la secció del fitxer Matroska(tm) (informació del segment o certes + capçaleres d'una pista) sobre la qual se centraran les següents accions: + add, set i delete. Aquestes seran + vàlides fins que es trobi la següent opció --edit. + L'argument per a aquesta opció s'anomena selector per a l'edició. + +

+ + +

+ Per omissió, el mkvpropedit(1) editarà la secció d'informació del segment. + +

+ + +

3.1. Informació del segment

+ + +

+ La informació del segment es pot seleccionar amb una d'aquestes tres + paraules: «info», «segment_info» o + «segmentinfo». Aquestes contenen propietats com el títol + o l'UID del segment. + +

+ + + +

3.2. Capçaleres de la pista

+ + +

+ Les capçaleres de la pista es poden seleccionar amb un selector lleugerament + més complex. Totes les variants comencen amb + «track:». Les propietats de la capçalera de la pista + inclouen elements com el codi d'idioma, l'etiqueta de «pista per omissió» o + el nom de la pista. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ Si el paràmetre n és un número, llavors se + seleccionarà la pista amb el número n. L'ordre de les + pistes és el mateix que surt amb l'opció --identify del + mkvmerge(1). + +

+ + +

+ La numeració comença per l'1. + +

+ +
track:tn + +

+ Si el paràmetre comença amb un únic caràcter t seguit + per n, llavors se seleccionarà la pista número + n d'un tipus de pista específica. El paràmetre del + tipus de pista t, haurà de ser un d'aquests quatre + caràcters: «a» per a una pista d'àudio, + «b» per a una pista de botó, «s» per a + una pista de subtítols i «v» per a una pista de + vídeo. L'ordre de les pistes és el mateix que surt amb l'opció + --identify del mkvmerge(1). + +

+ + +

+ La numeració comença per l'1. + +

+ +
track:=UID + +

+ Si el paràmetre comença amb un signe «=» seguit per un + número UID, llavors se seleccionarà la pista on + l'element UID de la pista sigui igual que aquest + UID. L'UID de la pista es pot + obtenir amb el mkvinfo(1). + +

+ +
track:@número + +

+ Si el paràmetre comença amb un signe «@» seguit per un + número, llavors se seleccionarà la pista on l'element + número de la pista sigui igual que aquest número. El + número de la pista es pot obtenir amb el mkvinfo(1). + +

+ +
+ + + +

3.3. Notes

+ + +

+ A causa de la naturalesa dels selectors per a l'edició de la pista, és + possible que realment alguns selectors coincideixin amb les mateixes + capçaleres de les pistes. En molts casos, totes les accions d'aquests + selectors per a l'edició seran combinades i executades en l'ordre en el qual + es van indicar a la línia d'ordres. + +

+ + +

4. Selectors per a l'adjunt

+ + + +

+ Un selector per a l'adjunt s'empra amb les dues accions --replace-attachment + i --delete-attachment. + Aquest pot tenir una de les quatre formes següents: + +

+ + +
    + +
  1. + +

    + Selecció mitjançant l'ID de l'adjunt. D'aquesta forma, el selector és un + senzill número, l'ID de l'adjunt tal com surt amb l'ordre d'identificació + del mkvmerge(1). + +

    + +
  2. + + +
  3. + +

    + Selecció mitjançant l'UID de l'adjunt (ID únic). D'aquesta forma, el + selector és el signe = seguit per un número, l'ID únic de + l'adjunt tal com surt amb l'ordre d'identificació del mkvmerge(1). + +

    + +
  4. + + +
  5. + +

    + Selecció mitjançant el nom de l'adjunt. D'aquesta forma el selector és la + paraula literal name: seguida pel nom de l'adjunt + existent. Si aquest selector és emprat amb + --replace-attachment, llavors per a que pugui coincidir + s'haurà d'escapar el signe dels dos punts amb \c. + +

    + +
  6. + + +
  7. + +

    + Selecció mitjançant el tipus MIME de l'adjunt. D'aquesta forma el selector + és la paraula literal mime-type: seguida pel tipus MIME + de l'adjunt existent. Si aquest selector és emprat amb + --replace-attachment, llavors per a que pugui coincidir + s'haurà d'escapar el signe dels dos punts amb \c. + +

    + +
  8. + +
+ +

5. Gestió de l'idioma

+ + + +

+ El mkvpropedit(1) majoritàriament tracta de fer el correcte de manera + predeterminada. Per tant, els canvis a la propietat + language faran que el mkvpropedit(1) apliqui el mateix canvi + tant a l'element nou «LanguageIETF» com a l'element antic «Language» de + manera similar a com el mkvmerge(1) aplica l'idioma a ambdós elements. Per + exemple, quan utilitzeu mkvpropedit peli.mkv --edit track:2 --set + language=zh-TW, l'element «LanguageIETF» s'establirà a + zh-TW i l'element antic «Language» a + chi. + +

+ + +

+ A més, hi ha una propietat nova de capçalera de pista anomenada + language-ietf que es pot establir o eliminar. Els canvis en + aquesta propietat només s'aplicaran a l'element nou de capçalera de pista + «LanguageIETF». Un avís és que l'element antic de capçalera de pista + «Language» és un element obligatori a Matroska -el qual significa que fins i + tot si no és present en el fitxer, encara tindrà un valor implícit-. Quan + l'usuari només estableix la propietat language-ietf, però + no la propietat language, per tant, el mkvpropedit(1) + afegirà l'element antic «Language» en certs casos i l'establirà a + und (significa «indeterminat») ja que l'usuari no ha + especificat un valor. + +

+ + +

Quan es llegeixen capítols XML o fitxers d'etiquetes, el mkvpropedit(1) + funcionarà com ho fa el mkvmerge(1). +

+ + +

La creació d'elements nous es pot desactivar completament amb l'opció de la + línia d'ordres «--disable-language-ietf», la qual opera sobre els tres + elements nous. +

+ + +

Podeu triar el mètode de normalització aplicat a les subetiquetes d'idioma + estès amb el paràmetre --normalize-language-ietf. +

+ +

6. Exemples

+ + +

+ El següent exemple edita un fitxer anomenat + «peli.mkv». Estableix el títol del segment i modifica el + codi d'idioma d'una pista d'àudio i d'una pista de subtítols. Tingueu en + compte que aquest exemple es pot escurçar llevant la primera opció --edit, ja + que editar l'element d'informació del segment està inclòs per omissió per a + totes les opcions trobades abans de la primera opció --edit. + +

+ +
$ mkvpropedit peli.mkv --edit info --set "title=La pel·lícula" --edit track:a1 --set language=cat --edit track:a2 --set language=ita
+ +

+ El segon exemple elimina l'«etiqueta de pista per omissió» de la primera + pista de subtítols i l'estableix per a la segona. Tingueu present que el + mkvpropedit(1), a diferència del mkvmerge(1), no estableix automàticament a + «0» el valor de l'«etiqueta de pista per omissió» quan una pista diferent + s'ha establert a «1». + +

+ +
$ mkvpropedit peli.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ Substituir les etiquetes per a la segona pista de subtítols en un fitxer es + veu així: + +

+ +
$ mkvpropedit peli.mkv --tags track:s2:etiquetes_subtítols_noves.xml
+ +

+ Eliminar totes les etiquetes requereix ometre el nom del fitxer d'etiquetes: + +

+ +
$ mkvpropedit peli.mkv --tags all:
+ +

+ Substituir els capítols en un fitxer es veu així: + +

+ +
$ mkvpropedit peli.mkv --chapters capítols_nous.xml
+ +

+ Eliminar tots els capítols requereix ometre el nom del fitxer: + +

+ +
$ mkvpropedit peli.mkv --chapters ''
+ +

+ Afegir un fitxer de tipus de lletra (Arial.ttf) com un + adjunt: + +

+ +
$ mkvpropedit peli.mkv --add-attachment Arial.ttf
+ +

+ Afegir un fitxer de tipus de lletra (89719823.ttf) com un + adjunt i proporcionar alguna informació de com és aquest tipus de lletra: + +

+ +
$ mkvpropedit peli.mkv --attachment-name Arial.ttf --attachment-description 'El tipus de lletra Arial com a tipus de lletra TrueType' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ Substituir un fitxer de tipus de lletra adjuntat + (Comic.ttf) per un altre (Arial.ttf): + +

+ +
$ mkvpropedit peli.mkv --attachment-name Arial.ttf --attachment-description 'El tipus de lletra Arial com a tipus de lletra TrueType' --replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ Suprimir el segon fitxer adjuntat, sigui el que sigui: + +

+ +
$ mkvpropedit peli.mkv --delete-attachment 2
+ +

+ Suprimir tots els tipus de lletra adjuntats segons el tipus MIME: + +

+ +
$ mkvpropedit peli.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. Codis de sortida

+ + + +

+ El mkvpropedit(1) sortirà amb un d'aquests tres codis de sortida: + +

+ + +
    + +
  • + +

    + 0 -- Aquest codi de sortida significa que la + modificació s'ha realitzat correctament. + +

    + +
  • + + +
  • + +

    + 1 -- En aquest cas, el mkvpropedit(1) ha generat una + sortida amb almenys un avís, però la modificació ha continuat. Un avís és + prefixat amb el text «Avís:». Depenent de les qüestions + involucrades, els fitxers resultants seran o no correctes. L'usuari serà + instat a revisar tant els avisos com els fitxers. + +

    + +
  • + + +
  • + +

    + 2 -- Aquest codi de sortida s'empra després de + produir-se un error. El mkvpropedit(1) interromprà el procés just després de + mostrar el missatge d'error. L'interval dels missatges d'error va des + d'arguments incorrectes a la línia d'ordres fins a errors de + lectura/escriptura en fitxers malmesos. + +

    + +
  • + +
+ +

8. Conversió per a fitxers de text i jocs de caràcters

+ + + +

+ Per a un debat en profunditat sobre com manipula la suite MKVToolNix les + conversions entre els jocs de caràcters, codifica l'entrada/sortida, + codifica la línia d'ordres i codifica a la consola, si us plau, vegeu la + secció anomenada de la mateixa manera a la pàgina man del mkvmerge(1). + +

+ +

9. Variables d'entorn

+ + + +

+ El mkvpropedit(1) empra les variables per omissió que es determinen a la + configuració regional del sistema (p. ex., LANG i la + família LC_*). Variables addicionals: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG i + la seva forma abreujada MTX_DEBUG + +

El contingut es tractarà com si s'hagués passat l'opció --debug. +

+ +
MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE + i la seva forma abreujada MTX_ENGAGE + +

El contingut es tractarà com si s'hagués passat l'opció --engage. +

+ +
+ +

10. Vegeu també

+ + +

+ mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1) + +

+ +

11. WWW

+ + +

+ Sempre trobareu l'última versió a la pàgina de les MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..e74b7979589c080f0cf9785cbedf8f96a6160918 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ca/mkvtoolnix-gui.html @@ -0,0 +1,161 @@ + + + + + mkvtoolnix-gui -- Una IGU per al mkvmerge1 que inclou un editor de capítols i de la capçalera + + + +
mkvtoolnix-gui -- Una IGU per al mkvmerge(1) que inclou un editor de capítols i de la capçalera +
+
+
+

Table of contents

+ +
+
+

1. Sinopsis

+ + +
mkvtoolnix-gui [[nom_fitxer_configuració.mtxcfg] | [fitxer_origen.ext] | [fitxer_matroska.mkv] | [fitxer_capítols.ext] | [fitxer_matroska.mkv]] +
+ +

2. Descripció

+ + +

+ El mkvtoolnix-gui(1) és una IGU basada en les + Qt(tm) per al mkvmerge(1). També implementa la + funcionalitat del mkvinfo(1) i el mkvpropedit(1) i evolucionarà per a cobrir + el mkvextract(1). Es poden desar i restaurar tots els ajustaments (p. ex., + fitxers d'origen, opcions de les pistes, etc.) + +

+ + +

+ El fet de llistar noms de fitxer de configuració amb l'extensió + .mtxcfg farà que la IGU els carregui a l'eina + corresponent. Qualsevol altre nom de fitxer serà afegit com un fitxer + d'origen per a multiplexar, obert a l'eina d'informació, l'editor de + capítols o a l'editor de la capçalera -en funció del mode actual-. El mode + actual es pot canviar amb les opcions --merge, + --info, --edit-chapters o + --edit-headers. El mode per omissió és afegir fitxers per + al multiplexat. + +

+ + +

+ Tingueu en compte que si ja s'està executant una instància de l'aplicació + quan es llança una segona instància, tots els noms de fitxer indicats a la + línia d'ordres restaran a càrrec de la primera instància. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

Tots els noms de fitxer que segueixen s'afegiran com a fitxers d'origen a la + tasca de multiplexat actual. Aquest és el mode per omissió. +

+ +
--info + +

Tots els següents noms de fitxer s'obriran a l'eina d'informació.

+ +

A més, se seleccionarà a l'inici l'eina d'informació en lloc de l'eina + multiplexador. +

+ +
--edit-chapters + +

Tots els noms de fitxer que segueixen s'obriran a l'editor de capítols.

+ +

A més, se seleccionarà a l'inici l'editor de capítols en lloc de l'eina + multiplexador. +

+ +
--edit-headers + +

Tots els noms de fitxer que segueixen s'obriran a l'editor de la capçalera.

+ +

A més, se seleccionarà a l'inici l'editor de la capçalera en lloc de l'eina + multiplexador. +

+ +
-h, --help + +

+ Mostra la informació d'ús i surt. + +

+ +
-V, --version + +

+ Mostra la informació sobre la versió i surt. + +

+ +
+ +

3. Vegeu també

+ + +

+ mkvmerge(1), mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. WWW

+ + +

+ Sempre trobareu l'última versió a la pàgina de les MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/command_line_references.html b/mm_avh_working_space/bin/mkvtoolnix/doc/command_line_references.html new file mode 100644 index 0000000000000000000000000000000000000000..fc73789026c979b91709fecacb7da5801bca1e48 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/command_line_references.html @@ -0,0 +1,111 @@ + + + + + MKVToolNix documentation + + + +
MKVToolNix documentation
+
+ +
+ +

Command line references

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LanguageCommand line reference
Englishmkvmergemkvinfomkvextractmkvpropeditmkvtoolnix-gui
Deutsch (German)mkvmergemkvinfomkvextractmkvpropeditmkvtoolnix-gui
Nederlands (Dutch)mkvmergemkvinfomkvextractmkvpropeditmkvtoolnix-gui
简体中文 (Chinese Simplified)mkvmergemkvinfomkvextractmkvpropeditmkvtoolnix-gui
日本語 (Japanese)mkvmergemkvinfomkvextractmkvpropeditmkvtoolnix-gui
Український (Ukrainian)mkvmergemkvinfomkvextractmkvpropeditmkvtoolnix-gui
+ +

Other documentation

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
TopicFile
What has changed recently?NEWS.txt
Generic information about MKVToolNixREADME.txt
GNU General Public License v2COPYING.txt
+
+ + diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..705efa74bb8fc410d27c136cfb20d2b69af8b32a --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvextract.html @@ -0,0 +1,1367 @@ + + + + + mkvextract -- extrahiert Spuren aus Matroska-Dateien in andere Dateien. + + + +
mkvextract -- extrahiert Spuren aus Matroska(tm)-Dateien in andere Dateien. +
+
+ +
+

1. Übersicht

+ + +
mkvextract {Quelldateiname} {Modus1} Optionen Extraktionsangabe1 Modus2 Optionen Extraktionsangabe2 … +
+ +

2. Beschreibung

+ + +

+ Dieses Programm extrahiert bestimmte Teile einer Matroska(tm)-Datei in andere + nützliche Formate. Das erste Argument ist der Name der Quelldatei, die eine + Matroska(tm)-Datei sein muss. + +

+ + +

+ Alle anderen Argumente wechseln entweder den Modus, ändern Optionen für den + momentan aktiven Modus oder geben an, was in welche Datei extrahiert werden + soll. Mehrere Modi können im selben Aufruf von mkvextract benutzt werden, + wodurch man mehrere Dinge in einem einzigen Durchlauf extrahieren kann. Die + meisten Optionen können nur in bestimmten Modi verwendet werden, wobei + einige wenige in allen Modi gültig sind. + +

+ + +

+ Derzeit wird das Extrahieren von Spuren, Tags, Anhängen, Kapiteln, Cuesheets, Zeitstempel und Indexelemente unterstützt. + +

+ + +

2.1. Gemeinsame Optionen

+ + + +

+ Die folgenden Optionen sind in allen Modi verfügbar und werden nur einmal in + diesem Abschnitt beschrieben. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ Setzt den Auswertungsmodus auf »full«. Der Standardmodus wertet nicht die + ganze Datei aus, benutzt aber Metasuchelemente zum Orten der benötigten + Elemente der Quelldatei. In 99% der Fälle reicht dies. Aber für Dateien, die + keine Metasuchelemente enthalten oder beschädigt sind, kann es notwendig + sein, diesen Modus zu aktivieren. Ein vollständiger Scan einer Datei kann + ein paar Minuten in Anspruch nehmen, während ein schneller Scan nur Sekunden + dauert. + +

+ +
--command-line-charset Zeichensatz + +

+ Setzt den Zeichensatz, um auf der Befehlszeile angegebene Zeichenketten + umzuwandeln. Voreinstellung ist der Zeichensatz der aktuellen Locale des + Systems. + +

+ +
--output-charset Zeichensatz + +

+ Setzt den Zeichensatz, in den Zeichenketten zur Ausgabe umgewandelt + werden. Voreinstellung ist der Zeichensatz der aktuellen Locale des Systems. + +

+ +
-r, --redirect-output + Dateiname + +

+ Schreibt alle Nachrichten in die Datei Dateiname, + statt auf die Konsole. Obwohl dies einfach durch Ausgabeumleitung erledigt + werden kann, gibt es Fälle, in denen diese Option benötigt wird: wenn das + Terminal die Ausgabe vor dem Schreiben in eine Datei neu auswertet. Der mit + --output-charset + gesetzte Zeichensatz wird dabei berücksichtigt. + +

+ +
--flush-on-close + +

+ Weist mkvmerge an, alle gepufferten Daten auf den Datenspeicher zu + schreiben, wenn eine zum Schreiben geöffnete Datei geschlossen wird. Das + kann benutzt werden, um Datenverlust bei Stromausfall vorzubeugen oder + bestimmte Probleme im Betriebssystem oder Treibern zu vermeiden. Der + Nachteil ist, dass das Multiplexen länger dauert, da mkvmerge vor dem + Beenden wartet, bis alle Daten auf den Datenspeicher geschrieben wurden. + Siehe Probleme #2469 und #2480 im MKVToolNix-Bugtracker für eine + tiefergehende Diskussion der Vor- und Nachteile. + +

+ +
--ui-language Code + +

+ Erzwingt, dass die Übersetzungen für die Sprache Code + benutzt werden (z.B. »de_DE« für die deutschen + Übersetzungen). Bei der Eingabe von »list« als + Code gibt das Programm eine Liste der verfügbaren + Übersetzungen aus. + +

+ +
--abort-on-warnings + +

+ Weist das Programm an abzubrechen, nachdem die erste Warnung ausgegeben + wurde. Der Rückgabewert des Programms wird in dem Fall 1 sein. + +

+ +
--debug Thema + +

+ Schaltet die Fehlersuche für eine bestimmte Funktionalität ein. Diese Option + ist nur für Entwickler nützlich. + +

+ +
--engage Funktionalität + +

+ Schaltet experimentelle Funktionalitäten ein. Eine Liste verfügbarer + Funktionalitäten kann mit mkvextract --engage list + abgefragt werden. Diese Funktionalitäten sind nicht für die Verwendung in + Alltagssituationen gedacht. + +

+ +
--gui-mode + +

+ Schaltet den Modus für graphische Benutzeroberflächen an. In diesem Modus + können auf bestimmte Art formatierte Zeilen ausgegeben werden, die einem + aufrufenden Programm mitteilen, was mkvmerge(1) gerade tut. Diese Nachrichten + haben das folgende Format: '#GUI#Nachricht'. Der + Nachricht folgen potenziell Schlüssel/Wert-Paare wie + z.B. + '#GUI#Nachricht#schluessel1=wert1#schluessel2=wert2…'. + Weder die Nachricht selber noch die Schlüssel werden jemals übersetzt + sondern immer in Englisch ausgegeben. + +

+ +
-v, --verbose + +

+ Aktiviert detaillierte Ausgabe und zeigt alle wichtigen Matroska(tm)-Elemente + an, sobald sie gelesen wurden. + +

+ +
-h, --help + +

+ Zeigt Benutzungsinformationen und beendet sich. + +

+ +
-V, --version + +

+ Zeigt Versionsinformationen und beendet sich. + +

+ +
@Optionsdatei.json + +

+ Liest zusätzliche Befehlszeilenargumente aus der Datei + Optionsdatei. Eine ausführliche Erläuterunge über die + unterstützten Formate finden Sie im Abschnitt "Optionsdateien" in der + Handbuchseite zu mkvmerge(1). + +

+ +
+ + + +

2.2. Spurextrahierungsmodus

+ + + +

+ Syntax: mkvextract Quelldateiname + tracks [Optionen] + TID1:Zieldateiname1 + [TID2:Zieldateiname2 …] + +

+ + +

+ Die folgenden Befehlszeilenoptionen sind für jede Spur im Extrahierungsmodus + »tracks« verfügbar. Sie müssen vor der + Spurenspezifikation, auf die sie angewandt werden sollen, erscheinen (siehe + unten). + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c Zeichensatz + +

+ Setzt den Zeichensatz in den die nächste Textuntertitelspur umgewandelt + werden soll. Nur gültig, falls die nächste Spur-ID auf eine Untertitelspur + verweist. Voreinstellung ist UTF-8. + +

+ +
--blockadd Stufe + +

+ Behält nur die BlockAdditions bis hinauf zu dieser Stufe. Standardäßig + werden alle Stufen behalten. Diese Option beeinflusst nur einge Codec-Arten + wie WAVPACK4. + +

+ +
--cuesheet + +

+ Veranlasst mkvextract(1) ein CUEsheet aus den + Kapitelinformationen zu extrahieren und Daten für die folgende Spur in einer + Datei zu kennzeichnen, deren Name der Ausgabename der Spur mit angehängtem + ».cue« ist. + +

+ +
--raw + +

+ Extrahiert die rohen Daten in eine Datei ohne irgendwelche umgebenden + Container-Daten. Im Gegensatz zum Schalter --fullraw + veranlasst dieser Schalter nicht, dass der Inhalt des Elements + CodecPrivate in die Datei geschrieben wird. Dieser + Modus funktioniert mit allen CodecIDs, sogar mit + denen, die mkvextract(1) ansonsten nicht unterstützt, aber die resultierenden + Dateien sind möglicherweise nicht benutzbar. + +

+ +
--fullraw + +

+ Extrahiert die rohen Daten in eine Datei ohne irgendwelche umgebenden + Container-Daten. Der Inhalt des Elements CodecPrivate + wird in die erste Datei geschrieben, falls die Spur solch ein Kopfelement + enthält. Dieser Modus funktioniert mit allen + CodecIDs, sogar mit denen, die mkvextract(1) ansonsten + nicht unterstützt, aber die resultierenden Dateien sind möglicherweise nicht + benutzbar. + +

+ +
TID:Ausgabename + +

+ Veranlasst das Extrahieren der Spur mit der ID TID in + die Datei Ausgabename, falls eine derartige Spur in + der Quelldatei existiert. Diese Option kann mehrfach angegeben werden. Die + Spur-IDs sind dieselben wie die, die durch mkvmerge(1)s Option + --identify ausgegeben werden. + +

+ + +

+ Jeder Ausgabename sollte nur einmal benutzt werden. Eine Ausnahme bilden + RealAudio- und RealVideo-Spuren. Falls Sie den gleichen Namen für + unterschiedliche Spuren verwenden, dann werden diese Spuren in der selben + Datei gespeichert. Beispiel: + +

+ +
$ mkvextract Eingabe.mkv tracks 0:Video.h264 2:Ausgabe-zwei-VobSub-Spuren.idx 3:Ausgabe-zwei-VobSub-Spuren.idx
+
+ + + +

2.3. Extrahierungsmodus für Anhänge

+ + + +

+ Syntax: mkvextract Quelldateiname + attachments + [Optionen] + AID1:Zieldateiname1 + [AID2:Zieldateiname2 …] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:Ausgabename + +

+ Veranlasst das Extrahieren des Anhangs mit der ID AID + in die Datei Ausgabename, falls ein derartiger Anhang + in der Quelldatei existiert. Wenn der Ausgabename + leer gelassen wird, dann wird stattdessen der Name des Anhangs innerhalb der + Matroska(tm)-Datei benutzt. Diese Option kann mehrfach angegeben werden. Die + IDs der Anhänge sind dieselben wie die, die durch mkvmerge(1)s Option + --identify ausgegeben werden. + +

+ +
+ + + +

2.4. Kapitelextrahierungsmodus

+ + + +

+ Syntax: mkvextract Quelldateiname + chapters + [Optionen] + Ausgabedateiname.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ Exportiert die Kapitelinformationen in das einfache, von den + OGM-Werkzeugen benutzte Format (CHAPTER01=…, + CHAPTER01NAME=…). In diesem Modus müssen einige Informationen verworfen + werden. Standardmäßig werden die Kapitel im XML-Format ausgegeben. + +

+ +
--simple-language Sprache + +

+ Falls das einfache Kapitelformat aktiviert ist, gibt mkvextract(1) pro + gefundenem Kapitel genau einen Eintrag ausgeben, auch wenn das Kapitel + mehrere Kapitelnamen besitzt. Standardmäßig gibt mkvextract(1) für jedes + Kapitel den jeweils als erstes gefundenen Namen unabhängig von seiner + Sprache aus. + +

+ + +

+ Das Benutzen dieser Option erlaubt es festzulegen, welche Kapitelnamen + ausgegeben werden, falls die Kapitel mehr als einen Namen besitzen. Der + Sprache-Parameter muss ein ISO-639-1- oder + ISO-639-2-Code sein. + +

+ +
+ + +

+ Die Kapitel werden in die angegebene Ausgabedatei geschrieben. Standardmäßig + wird das von mkvmerge(1) verstandene XML-Format benutzt. Falls in der Datei + keine Kapitel gefunden werden, so wird auch keine Ausgabedatei erzeugt. + +

+ + + +

2.5. Extrahierungsmodus für Tags

+ + + +

+ Syntax: mkvextract Quelldateiname + tags [Optionen] + Ausgabedateiname.xml + +

+ + +

+ Die Tags werden im von mkvmerge(1) verstandenen XML-Format in die + angegebene Ausgabedatei geschrieben. Falls in der Datei keine Tags gefunden + werden, so wird auch keine Ausgabedatei erzeugt. + +

+ + + +

2.6. Extrahierungsmodus für Cuesheets

+ + + +

+ Syntax: mkvextract Quelldateiname + cuesheet + [Optionen] + Ausgabedateiname.cue + +

+ + +

+ Das Cuesheet wird in die angegebene Ausgabedatei geschrieben. Falls in der + Datei keine Kapitel oder keine Tags gefunden werden, so wird auch keine + Ausgabedatei erzeugt. + +

+ + + +

2.7. Zeitstempelextrahierungsmodus

+ + + +

+ Syntax: mkvextract Ausgabedateiname + timestamps_v2 + [Optionen] + TID1:Zieldateiname1 + [TID2:Zieldateiname2 …] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:Ausgabename + +

+ Veranlasst das Extrahieren der Zeitstempel für die Spur mit der ID + TID in die Datei Ausgabename, + falls eine derartige Spur in der Quelldatei existiert. Diese Option kann + mehrfach angegeben werden. Die IDs der Spuren sind dieselben wie die, die + durch mkvmerge(1)s Option --identify ausgegeben werden. + +

+ + +

+ Beispiel: + +

+ +
$ mkvextract Eingabe.mkv timestamps_v2 1:Zeitstempel-Spur1.txt 2:Zeitstempel-Spur2.txt
+
+ + + +

2.8. Extrahierungsmodus für Indexelemente

+ + + +

+ Syntax: mkvextract Quelldateiname + cues [Optionen] + TID1:Zieldateiname1 + [TID2:Zieldateiname2 …] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:Zielname + +

+ Veranlasst das Extrahieren der Indexelemente für die Spur mit der ID + TID in die Datei Ausgabename, + falls eine derartige Spur in der Quelldatei existiert. Diese Option kann + mehrfach angegeben werden. Die IDs der Spuren sind dieselben wie die, die + durch mkvmerge(1)s Option --identify ausgegeben werden und + nicht die Nummern, die in den CueTrack-Elementen + enthalten sind. + +

+ +
+ + +

+ Das Ausgabeformat ist ein einfaches Textformat: eine Zeile pro + CuePoint-Element, die + schluessel=wert-Paare enthält. Falls ein optionales + Element in einem CuePoint nicht enthalten ist + (z.B. CueDuration), so wird ein Bindestrich als Wert + ausgegeben. + +

+ + +

+ Beispiel: + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

Die möglichen Schlüsselwörter sind:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
Zeitstempel + +

Der Zeitstempel des Indexelementes mit Nanosekunden-Präzision. Das Format + lautet HH:MM:SS.nnnnnnnnn. Dieses Element ist immer + gesetzt. +

+ +
duration + +

Die Dauer des Indexelements mit Nanosekunden-Präzision. Das Format lautet + HH:MM::SS.nnnnnnnnn. +

+ +
cluster_position + +

Die absolute Position in Bytes innerhalb der Matroska(tm)-Datei, an der der + Cluster beginnt, der das referenzierte Element enthält. +

+ + +
+

Note:

+ +

Innerhalb der Matroska(tm)-Datei ist das + CueClusterPosition-Element relativ zum Anfang des + Datenbereiches des Segments. Der von mkvextract(1)s Indexelement-Modus + ausgegebene Wert enthält diesen Offset allerdings bereits ind ist daher ein + absoluter Offset, der sich auf den Anfang der ganzen Datei bezieht. +

+ +
+ +
relative_position + +

Die relative Position in Bytes innerhalb des Clusters, an der das + BlockGroup- oder + SimpleBlock-Element beginnt, auf das sich der + Indexeintrag bezieht. +

+ + +
+

Note:

+ +

Innerhalb der Matroska(tm)-Datei ist das + CueRelativePosition-Element relativ zum Anfang des + Datenbereiches des Clusters. Der von mkvextract(1)s Indexelement-Modus + ausgegebene Wert ist allerdings relativ zum Start der + Cluster-Element-ID. Die absolute Position innerhalb der Datei kann daher + durch Addition von cluster_position und + relative_position ermittelt werden. +

+ +
+ +
+ + +

+ Beispiel: + +

+ +
$ mkvextract Eingabe.mkv cues 1:Index-Spur1.txt 2:Index-Spur2.txt
+ +

3. Beispiele

+ + + +

+ Gleichzeitig sowohl Kapitel als auch Tags in ihren jeweiligen XML-Formaten + extrahieren: + +

+ +
$ mkvextract Film.mkv chapters Film-Kapitel.xml tags Film-Tags.xml
+ +

+ Gleichzeitig ein paar Spuren und ihre jeweiligen Zeitstempel extrahieren: + +

+ +
$ mkvextract "Ein weiterer Film.mkv" tracks 0:Video.h265 "1:Haupt-Audiospur.aac" "2:Kommentar der Regisseurin.aac" timestamps_v2 "0:Zeitstempel Video.txt" "1:Zeitstempel Haupt-Audiospur.txt" "2:Zeitstempel Kommentar der Regisseurin.txt"
+ +

+ Kapitel im Ogg/OGM-Format extrahieren und eine Text-Untertitel-Spur in einen + anderen Zeichensatz wandeln: + +

+ +
$ mkvextract "Mein Film.mkv" chapters --simple "Meine Kapitel.txt" tracks -c MS-ANSI "2:Meine Untertitel.srt"
+

4. Umwandlungen von Textdateien und Zeichensätzen

+ + + +

+ Für eine tiefer gehende Diskussion darüber, wie die Programme in der + MKVToolNix-Sammlung die Umwandlung von Zeichensätzen, + Eingabe-/Ausgabecodierung, Kommandozeilenzeichensätze und + Konsolenzeichensätze handhaben, sei auf den Abschnitt »Umwandlungen von + Textdateien und Zeichensätzen« in der Handbuchseite von mkvmerge(1) + verwiesen. + +

+ +

5. Ausgabedateiformate

+ + + +

+ Die Entscheidung über das Ausgabeformat basiert auf dem Spurtyp, nicht auf + der für den Ausgabedateinamen benutzen Dateiendung. Die folgenden Spurtypen + werden derzeit unterstützt: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ Alle AAC-Dateien werden in eine AAC-Datei + mit ADTS-Kopfdaten vor jedem Paket geschrieben. Die + ADTS-Kopfdaten werden nicht das missbilligte Feld + »emphasis« enthalten. + +

+ +
A_AC3, A_EAC3 + +

+ Diese werden in rohe AC-3-Dateien extrahiert. + +

+ +
A_ALAC + +

+ ALAC-Spuren werden in CAF-Dateien + geschrieben. + +

+ +
A_DTS + +

+ Diese werden in rohe DTS-Dateien extrahiert. + +

+ +
A_FLAC + +

+ FLAC-Spuren werden in FLAC-Dateien + geschrieben. + +

+ +
A_MPEG/L2 + +

+ MPEG-1-Audio-Layer-II-Datenströme werden in rohe + MP2-Dateien extrahiert. + +

+ +
A_MPEG/L3 + +

+ Diese werden in rohe MP3-Dateien extrahiert. + +

+ +
A_OPUS + +

+ Opus(tm)-Spuren werden in + OggOpus(tm)-Dateien geschrieben. + +

+ +
A_PCM/INT/LIT, A_PCM/INT/BIG + +

+ Rohe PCM-Daten werden in eine WAV-Datei + geschrieben. Dabei werden Big-Endian-Integer-Daten in Little-Endian-Daten + umgewnadelt. + +

+ +
A_REAL/* + +

+ RealAudio(tm)-Spuren werden in + RealMedia(tm)-Dateien geschrieben. + +

+ +
A_TRUEHD, A_MLP + +

+ Diese werden in rohe TrueHD-/MLP-Dateien + extrahiert. + +

+ +
A_TTA1 + +

+ TrueAudio(tm)-Spuren werden in + TTA-Dateien geschrieben. Bitte beachten Sie, dass die + extrahierten Dateikopfdaten wegen der begrenzten Zeitstempelgenauigkeit von + Matroska(tm) in Bezug auf zwei Felder unterschiedlich sind: + data_length (die Gesamtzahl der Samples in der Datei) und + der CRC. + +

+ +
A_VORBIS + +

+ Vorbis-Audio wird in eine OggVorbis(tm)-Datei geschrieben. + +

+ +
A_WAVPACK4 + +

+ WavPack-Spuren werden in WV-Dateien + geschrieben. + +

+ +
S_HDMV/PGS + +

+ PGS-Untertitel werden als SUP-Dateien + geschrieben. + +

+ +
S_HDMV/TEXTST + +

+ TextST-Untertitel werden in einem speziellen Format + geschrieben, das für mkvmerge(1) und mkvextract(1) erfunden wurde. + +

+ +
S_KATE + +

+ Kate(tm)-Datenströme werden innerhalb eines + Ogg(tm)-Containers geschrieben. + +

+ +
S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS + +

+ SSA- und ASS-Textuntertitel werden als + SSA- beziehungsweise ASS-Dateien + geschrieben. + +

+ +
S_TEXT/UTF8, S_TEXT/ASCII + +

+ Einfache Textuntertitel werden in SRT-Dateien geschrieben. + +

+ +
S_VOBSUB + +

+ VobSub(tm)-Untertitel werden als + SUB-Dateien geschrieben, zusammen mit den jeweiligen + Indexdateien als IDX-Dateien. + +

+ +
S_TEXT/USF + +

+ USF-Textuntertitel werden als USF-Dateien + geschrieben. + +

+ +
S_TEXT/WEBVTT + +

+ WebVTT-Textuntertitel werden als + WebVTT-Dateien geschrieben. + +

+ +
V_MPEG1, V_MPEG2 + +

+ MPEG-1-/MPEG-2-Videospuren werden in + MPEG-Elementarstrom-Dateien geschrieben. + +

+ +
V_MPEG4/ISO/AVC + +

+ H.264-/AVC-Videospuren werden in einfache + H.264-Datenströme geschrieben, die später z.B. mit + MP4Box(tm) aus dem Paket + GPAC(tm) bearbeitet werden können. + +

+ +
V_MPEG4/ISO/HEVC + +

+ H.265-/HEVC-Videospuren werden in einfache + H.265-Datenströme geschrieben, die später z.B. mit + MP4Box(tm) aus dem Paket + GPAC(tm) bearbeitet werden können. + +

+ +
V_MS/VFW/FOURCC + +

+ Feste BpS-Videospuren mit dieser + CodecID werden in AVI-Dateien + geschrieben. + +

+ +
V_REAL/* + +

+ RealVideo(tm)-Spuren werden in + RealMedia(tm)-Dateien geschrieben. + +

+ +
V_THEORA + +

+ Theora(tm)-Datenströme werden innerhalb eines + Ogg(tm)-Containers geschrieben. + +

+ +
V_VP8, V_VP9 + +

+ VP8-/VP9-Spuren werden in + IVF-Dateien geschrieben. + +

+ +
Tags + +

+ Tags werden in ein XML-Format umgewandelt. Dieses Format ist dasselbe, das + mkvmerge(1) zum Lesen der Tags unterstützt. + +

+ +
Anhänge + +

+ Anhänge werden, so wie sie sind, in ihre Ausgabedatei geschrieben. Es wird + keine Umwandlung in irgendeiner Art durchgeführt. + +

+ +
Kapitel + +

+ Kapitel werden in ein XML-Format umgewandelt. Dieses Format ist dasselbe, + das mkvmerge(1) zum Lesen der Kapitel unterstützt. Alternativ kann eine + heruntergekürzte Version im einfachen OGM-Formatstil + ausgegeben werden. + +

+ +
Zeitstempel + +

+ Zeitstempel werden zuerst sortiert und dann als eine Datei ausgegeben, die + konform zum Zeitstempelformat v2 und fertig zur Eingabe in mkvmerge(1) + ist. Das Extrahieren in andere Formate (v1, v3 und v4) wird nicht + unterstützt. + +

+ +
+ +

6. Rückgabewerte

+ + + +

+ mkvextract(1) wird mit einem von drei Rückgabewerten beendet: + +

+ + +
    + +
  • + +

    + 0 – dieser Rückgabewert bedeutet, dass das Extrahieren + erfolgreich abgeschlossen wurde. + +

    + +
  • + + +
  • + +

    + 1 – in diesem Fall hat mkvextract(1) mindestens eine + Warnung ausgegeben, das Extrahieren wurde aber fortgesetzt. Einer Warnung + wird der Text »Warning:« vorangestellt. Abhängig von den + aufgetretenen Problemen können die resultierenden Dateien in Ordnung oder + nicht sein. Es wird nachdrücklich geraten, sowohl die Warnung als auch die + resultierenden Dateien zu überprüfen. + +

    + +
  • + + +
  • + +

    + 2 – dieser Rückgabewert wird benutzt, nachdem ein + Fehler aufgetreten ist. mkvextract(1) wird gleich nach der Ausgabe der + Fehlermeldung abgebrochen. Fehlermeldungen reichen von falschen + Befehlszeilenargumenten über Lese-/Schreibfehler bis hin zu beschädigten + Dateien. + +

    + +
  • + +
+ +

7. Umgebungsvariablen

+ + + +

+ mkvextract(1) verwendet die Standardvariablen, um die Locale des Systems zu + bestimmen (z.B. LANG und die + LC_*-Familie). Zusätzliche Variablen: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG und + ihre Kurzform MTX_DEBUG + +

Der Inhalt wird behandelt, als ob er mit der Option --debug + übergeben worden wäre. +

+ +
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE + und ihre Kurzform MTX_ENGAGE + +

Der Inhalt wird behandelt, als ob er mit der Option --engage + übergeben worden wäre. +

+ +
+ +

8. Siehe auch

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. WWW

+ + +

+ Die neuste Version kann immer auf der MKVToolNix-Homepage gefunden + werden. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..6f5171eb12518c93f95740689401aa401b6db263 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvinfo.html @@ -0,0 +1,529 @@ + + + + + mkvinfo -- Gibt Informationen über Elemente der Matroska-Dateien aus. + + + +
mkvinfo -- Gibt Informationen über Elemente der Matroska(tm)-Dateien aus. +
+
+ +
+

1. Übersicht

+ + +
mkvinfo Optionen {Quelldateiname} +
+ +

2. Beschreibung

+ + +

+ Dieses Programm führt alle in Matroska(tm)-Dateien enthaltenen Elemente + auf. Die Ausgabe kann kann auf eine Liste von Spuren in der Datei, + einschließlich Informationen über die benutzten Codecs, begrenzt werden. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ Standardmäßig hält mkvinfo(1) an, wenn es auf den ersten Cluster trifft. + Weiterhin zeigt es bestimmte oft auftretende Elemente nicht an. Mit dieser + Option wird mkvinfo(1) die Bearbeitung unabhängig von der Detailstufe + fortsetzen und alle Elemente anzeigen. + +

+ +
-c, --checksums + +

+ Berechnet für jedes Bild die Adler-32-Prüfsumme und + zeigt sie an. Nur nützlich zur Fehlersuche. + +

+ +
-o, --continue + +

+ Standardmäßig hält mkvinfo(1) an, wenn es auf den ersten Cluster trifft. Mit + dieser Option wird mkvinfo(1) die Bearbeitung unabhängig von der Detailstufe + fortsetzen. + +

+ +
-p, --hex-positions + +

+ Zeige die Positionen aller Elemente unabhängig von der Detailstufe + hexadezimal an. + +

+ +
-P, --positions + +

+ Zeige die Positionen aller Elemente unabhängig von der Detailstufe dezimal + an. + +

+ +
-s, --summary + +

+ Zeigt nur eine knappe Zusammenfassung, was mkvinfo(1) findet und nicht jedes + Element. + +

+ +
-t, --track-info + +

+ Zeigt detailliert Statistiken für jede Spur an. Außerdem wird die + Detailstufe auf 1 gesetzt, falls sie vorher auf 0 war. + +

+ +
-x, --hexdump + +

+ Zeigt die ersten 16 Byte jedes Bilds als hexadezimale Ausgabe an. + +

+ +
-X, --full-hexdump + +

+ Zeigt alle Byte von jedem Bild als hexadezimale Ausgabe an. + +

+ +
-z, --size + +

+ Zeigt die Größe jedes Elements einschließlich seiner Kopfdaten an. + +

+ +
--command-line-charset Zeichensatz + +

+ Setzt den Zeichensatz, um auf der Befehlszeile angegebene Zeichenketten + umzuwandeln. Voreinstellung ist der Zeichensatz der aktuellen Locale des + Systems. + +

+ +
--output-charset Zeichensatz + +

+ Setzt den Zeichensatz, in den Zeichenketten zur Ausgabe umgewandelt + werden. Voreinstellung ist der Zeichensatz der aktuellen Locale des Systems. + +

+ +
-r, --redirect-output + Dateiname + +

+ Schreibt alle Nachrichten in die Datei Dateiname + statt auf die Konsole. Obwohl dies einfach durch Ausgabeumleitung erledigt + werden kann, gibt es Fälle, in denen diese Option benötigt wird: wenn das + Terminal die Ausgabe vor dem Schreiben in eine Datei neu auswertet. Der mit + --output-charset + gesetzte Zeichensatz wird dabei berücksichtigt. + +

+ +
--ui-language Code + +

+ Erzwingt, dass die Übersetzungen für die Sprache Code + benutzt werden (z.B. »de_DE« für die deutschen + Übersetzungen). Bei der Eingabe von »list« als + Code gibt das Programm eine Liste der verfügbaren + Übersetzungen aus. + +

+ +
--abort-on-warnings + +

+ Weist das Programm an abzubrechen, nachdem die erste Warnung ausgegeben + wurde. Der Rückgabewert des Programms wird in dem Fall 1 sein. + +

+ +
--debug Thema + +

+ Schaltet die Fehlersuche für eine bestimmte Funktionalität ein. Diese Option + ist nur für Entwickler nützlich. + +

+ +
--engage Funktionalität + +

+ Schaltet experimentelle Funktionalitäten ein. Eine Liste verfügbarer + Funktionalitäten kann mit mkvinfo --engage list abgefragt + werden. Diese Funktionalitäten sind nicht für die Verwendung in + Alltagssituationen gedacht. + +

+ +
--gui-mode + +

+ Schaltet den Modus für graphische Benutzeroberflächen an. In diesem Modus + können auf bestimmte Art formatierte Zeilen ausgegeben werden, die einem + aufrufenden Programm mitteilen, was mkvmerge(1) gerade tut. Diese Nachrichten + haben das folgende Format: '#GUI#Nachricht'. Der + Nachricht folgen potenziell Schlüssel/Wert-Paare wie + z.B. + '#GUI#Nachricht#schluessel1=wert1#schluessel2=wert2…'. + Weder die Nachricht selber noch die Schlüssel werden jemals übersetzt + sondern immer in Englisch ausgegeben. + +

+ +
-v, --verbose + +

+ Erhöht die Detailstufe. Welche Beschreibung auf welcher Stufe ausgegeben + wird, finden Sie im Abschnitt Detailstufen. + +

+ +
-h, --help + +

+ Zeigt Benutzungsinformationen und beendet sich. + +

+ +
-V, --version + +

+ Zeigt Versionsinformationen und beendet sich. + +

+ +
@Optionsdatei.json + +

+ Liest zusätzliche Befehlszeilenargumente aus der Datei + Optionsdatei. Eine ausführliche Erläuterunge über die + unterstützten Formate finden Sie im Abschnitt "Optionsdateien" in der + Handbuchseite zu mkvmerge(1). + +

+ +
+ +

3. Detailstufen

+ + + +

+ Die Option -v kann + benutzt werden, um die Detailstufe von mkvinfo(1) zu erhöhen und weitere + Informationen über die aktuelle Datei auszugeben. + +

+ + +

+ Auf Stufe 0 wird mkvinfo(1) nur die Spurkopfdaten, die es findet und deren + Typen, ausgeben. Sobald die Kopfdaten vollständig ausgewertet sind, wird + sich mkvinfo(1) beenden (technischer ausgedrückt: sobald der erste Cluster + gefunden wird). Auf dieser Stufe werden die Suchkopfeinträge und Indizes + nicht angezeigt – selbst wenn sie vor den Spurinformationen liegen. + +

+ + +

+ Auf Stufe 1 wird mkvinfo(1) ebenfalls alle für die vollständige Datei + gefundenen Matroska(tm)-Elemente außer den Suchkopf- und Indexeinträgen + ausgeben. Falls der Zusammenfassungsmodus aktiviert ist, wird mkvinfo(1) + obendrein die Bildposition ausgeben. + +

+ + +

+ Der selbe Effekt kann mit der Option --continue erzielt + werden. + +

+ + +

+ Auf Stufe 2 wird mkvinfo(1) auch die Suchkopfeinträge, die Indexeinträge und + die Dateiposition ausgeben, an der jedes Matroska(tm)-Element gefunden werden + kann. + +

+ + +

+ Der selbe Effekt kann mit den Optionen --all --positions + erzielt werden. + +

+ + +

+ Auf Stufe 3 und darüber wird mkvinfo(1) einige Informationen ausgeben, die + nicht direkt mit einem Matroska(tm)-Element verbunden sind. Alle anderen + Elemente geben nur Zeug über Elemente aus, die soeben gefunden wurden. Stufe + 3 fügt Metainformationen zur Erleichterung der Fehlersuche hinzu (sprich: + Sie ist nur für Entwickler gedacht). Alle Zeilen, die durch Stufe 3 + geschrieben werden, sind in eckige Klammern eingeschlossen, um ihre + Filterung zu erleichtern. + +

+ +

4. Umwandlungen von Textdateien und Zeichensätzen

+ + + +

+ Für eine tiefer gehende Diskussion darüber, wie die Programme in der + MKVToolNix-Sammlung die Umwandlung von Zeichensätzen, + Eingabe-/Ausgabecodierung, Kommandozeilenzeichensätze und + Konsolenzeichensätze handhaben, sei auf den Abschnitt »Umwandlungen von + Textdateien und Zeichensätzen« in der Handbuchseite von mkvmerge(1) + verwiesen. + +

+ +

5. Rückgabewerte

+ + + +

+ mkvinfo(1) beendet sich mit einem von drei Rückgabewerten: + +

+ + +
    + +
  • + +

    + 0 – dieser Rückgabewert bedeutet, dass der Durchlauf + erfolgreich abgeschlossen wurde. + +

    + +
  • + + +
  • + +

    + 1 – in diesem Fall hat mkvinfo(1) mindestens eine + Warnung ausgegeben, die Ausführung wurde aber fortgesetzt. Einer Warnung + wird der Text »Warning:« vorangestellt. + +

    + +
  • + + +
  • + +

    + 2 – dieser Rückgabewert wird benutzt, nachdem ein + Fehler aufgetreten ist. mkvinfo(1) wird gleich nach der Ausgabe der + Fehlermeldung abgebrochen. Fehlermeldungen reichen von falschen + Befehlszeilenargumenten über Lese-/Schreibfehler bis hin zu beschädigten + Dateien. + +

    + +
  • + +
+ +

6. Umgebungsvariablen

+ + + +

+ mkvinfo(1) verwendet die Standardvariablen, um die Locale des Systems zu + bestimmen (z.B. LANG und die + LC_*-Familie). Zusätzliche Variablen: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUG, MKVTOOLNIX_DEBUG und + ihre Kurzform MTX_DEBUG + +

Der Inhalt wird behandelt, als ob er mit der Option --debug + übergeben worden wäre. +

+ +
MKVINFO_ENGAGE, MKVTOOLNIX_ENGAGE und + ihre Kurzform MTX_ENGAGE + +

Der Inhalt wird behandelt, als ob er mit der Option --engage + übergeben worden wäre. +

+ +
+ +

7. Siehe auch

+ + +

+ mkvmerge(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. WWW

+ + +

+ Die neuste Version kann immer auf der MKVToolNix-Homepage gefunden + werden. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..a34bb1fe76a1439ae2336bb46608f8011772e238 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvmerge.html @@ -0,0 +1,5402 @@ + + + + + mkvmerge -- Fügt Multimedia-Datenströme in eine Matroska-Datei zusammen. + + + +
mkvmerge -- Fügt Multimedia-Datenströme in eine Matroska(tm)-Datei zusammen. +
+
+ +
+

1. Übersicht

+ + +
mkvmerge globale Optionen {-o + Ausgabe} Optionen1 {Datei1} Optionen2 {Datei2} @Optionendatei.json +
+ +

2. Beschreibung

+ + +

+ Dieses Programm nimmt die Eingabe von mehreren Mediendateien und vereinigt + ihre Datenströme (alle oder nur eine Auswahl) in eine + Matroska(tm)-Datei. Siehe die + Matroska-Website. + +

+ + +
+

Important:

+ +

+ Die Reihenfolge der Befehlszeilenoptionen ist wichtig. Bitte lesen Sie den + Abschnitt »Reihenfolge der + Optionen«, falls sie ein neuer Nutzer des Programms sind. + +

+ +
+ + +

2.1. Globale Optionen

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

Erhöht die Detailstufe.

+ +
-q, --quiet + +

Unterdrückt die Statusausgabe.

+ +
-o, --output + Dateiname + +

Schreibt in die Datei Dateiname. Falls Aufteilung + benutzt wird, wird dieser Parameter etwas anders behandelt. Einzelheiten + finden Sie in der Erläuterung der Option --split. +

+ +
-w, --webm + +

Erstellt eine WebM-konforme Datei. Dies wird auch eingeschaltet, falls die + Namensendung der Ausgabedatei »webm« ist. Dieser Modus erzwingt mehrere + Einschränkungen. Die einzigen erlauben Codecs sind VP8-, VP9-Video und + Opus-, Vorbis-Tonspuren. Das Kopfelement DocType wird in »webm« geändert. + +

+ + +

+ Bei Kapiteln und Tags ist nur eine Untermenge aller Elemente + erlaubt. mkvmerge(1) entfernt automatisch alle Elemente, die laut + Spezifikation nicht erlaubt sind. + +

+ +
--title Titel + +

Setzt den allgemeinen Titel für die Ausgabedatei, z.B. den Namen des Films.

+ +
--default-language Sprachcode + +

Setzt das Standard-Sprachkürzel, das für alle Spuren benutzt wird, für die + keine Sprache mit der Option --language + angegeben wurde und für die der Quellcontainer keine Sprache bereitstellt. +

+ + +

Das Standard-Sprachkürzel ist das für »nicht spezifiziert« stehende + »und«. +

+ +
+ + + +

2.2. Handhabung von Segmentinformationen (globale Optionen)

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo Dateiname.xml + +

+ Liest Segmentinformationen aus einer XML-Datei. Diese Datei + kann die Segmentfamilie UID enthalten, die + Segment-UID und die vorherigen und nächsten + Segment-UID-Elemente. Eine Beispieldatei und ein + DTD sind in dem veröffentlichten MKVToolNix enthalten. + +

+ + +

+ Einzelheiten finden Sie im Abschnitt weiter unten über Segmentinformations-XML-Dateien. + +

+ +
--segment-uid SID1,SID2,… + +

+ Setzt die zu verwendenden UIDs. Dies ist eine durch Kommas getrennte Liste + von 128-Bit-Sgement-UIDs in der gewöhnlichen UID-Form: Hexadezimalzahlen mit + oder ohne Präfix »0x«, mit oder ohne Leerzeichen, exakt 32 Ziffern lang. + +

+ + +

+ Falls SID mit einem = beginnt, so wird der Rest als Name einer + Matroska-Datei interpretiert, deren Segment-UID gelesen und benutzt wird. + +

+ + +

+ Jede erstellte Datei enthält ein Segment und jedes Segment hat eine + Segment-UID. Falls mehr Segment-UIDs angegeben als Segmente erstellt werden, + werden die überschüssigen UIDs ignoriert. Falls weniger Segment-UIDs + angegeben als Segmente erstellt werden, dann werden für diese Segmente + zufällige UIDs erzeugt. + +

+ +
+ + + +

2.3. Handhabung von Kapiteln und Tags (globale Optionen)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language Sprachcode + +

+ Setzt den ISO-639-2-Sprachcode, der für jeden Kapiteleintrag geschrieben + wurde. Voreinstellung ist »eng«. Einzelheiten finden Sie + im nachfolgenden Abschnitt über Kapitel. + +

+ + +

+ Diese Option kann sowohl für einfache Kapiteldateien als auch für + Quelldateien benutzt werden, die Kapitel enthalten, aber keine Informationen + über die Sprache der Kapitel, z.B. MP4- und OGM-Dateien. + +

+ + +

+ Die mit dieser Option gesetzte Sprache wird ebenfalls beim Erzeugen von + Kapiteln mit Hilfe der Option --generate-chapters + benutzt. + +

+ +
--chapter-charset Zeichensatz + +

+ Setzt den Zeichensatz, der für die Umwandlung einfacher Kapiteldateien in + UTF-8 verwendet wird. Eine Erklärung, wie mkvmerge(1) Zeichensätze umwandelt, + finden Sie im Abschnitt über Textdateien und + Zeichensätze. + +

+ + +

+ Dieser Schalter gilt auch für Kapitel, die aus bestimmten Containertypen + kopiert werden, z.B. Ogg/OGM- und MP4-Dateien. Einzelheiten finden Sie im + nachfolgenden Abschnitt über Kapitel. + +

+ +
--chapter-sync + d[,o[/p]] + +

+ Passt die Zeitstempel von Kapiteln in der folgenden Quelldatei um + d ms an. Alternativ kann die Option + --sync mit der speziellen Spur-ID -2 + benutzt werden (siehe Abschnitt Spezielle Spur-IDs)." + +

+ + +

+ o/p: passen die Zeitstempel um + o/p an, um lineare + Verschiebungen zu beheben. Falls p weggelassen wird, + ist sie standardmäßig 1. Sowohl o als auch + p können Fließkommazahlen sein. + +

+ + +

+ Voreinstellung: keine manuelle Synchronisationskorrektur (was dasselbe wie + d = 0 und + o/p = + 1.0ist). + +

+ + +

+ Diese Option kann mehrfach für eine Eingabedatei benutzt werden und gilt für + mehrere Spuren, indem jedesmal eine andere Spur-ID ausgewählt wird. + +

+ +
--generate-chapters Modus + +

+ mkvmerge(1) kann automatisch Kapitel erzeugen. Die folgenden zwei Modi + werden momentan unterstützt: + +

+ + +
    + +
  • + +

    + 'when-appending' – Dieser Modus erzeugt ein Kapitel am + Anfang sowie ein weiteres Kapitel jedes Mal, wenn eine Datei angehängt wird. + +

    + + +

    + Dieser Modus funktioniert ebenfalls mit den Aufteilungsmodi + »parts:« und »parts-frames:«. Für + diese Modi wird je ein Kapitel für jeden angehängten Zeitstempelbereich + erzeugt (diejenigen, deren Startzeitstempel mit »+« + beginnt). + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1) benötigt eine Video- oder Audio-Spur, um feststellen zu können, + wann eine neue Datei angehängt wird. Falls eine oder mehr Videospuren + gemuxt werden, so wird die erste davon benutzt. Andernfalls wird die erste + Audio-Spur benutzt. + +

    + +
    + +
  • + + +
  • + +

    + 'interval:Zeit-Spec' – Dieser + Modus erzeugt ein Kapitel in festen Zeitabständen, die durch + Zeit-Spec angegeben werden. Das Format folgt + entweder der Form HH:MM:SS.nnnnnnnnn, oder es ist + eine Zahl gefolgt von einer der Einheiten 's', + 'ms' oder 'us'. + +

    + + +

    + Beispiel: --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ Die Namen der neu erzeugten Kapitel werden durch die Option --generate-chapters-name-template + kontrolliert. Die Sprache wird mittels der Option --chapter-language + festgelegt, welche vor --generate-chapters erscheinen muss. + +

+ +
--generate-chapters-name-template + Vorlage + +

+ Dies setzt die Vorlage für durch die Option --generate-chapters + erzeugte Kapitelnamen. Falls die Option nicht angegeben wurde, wird der + Standardwert 'Kapitel <NUM:2>' benutzt. + +

+ + +

+ Es gibt mehrere Variablen, die in der Vorlage benutzt werden können und die + durch ihre tatsächlichen Werte ersetzt werden, sobald ein Kapitel erzeugt + wird. Die Zeichenkette '<NUM>' wird durch die + Kapitelnummer ersetzt. Die Zeichenkette '<START>' + wird durch den Startzeitpunkt des Kapitels ersetzt. + +

+ + +

+ Die Zeichenketten »>FILE_NAME>« und + »<FILE_NAME_WITH_EXT>« sind nur bei der + Kapitelerzeugung beim Anhängen von Dateien gesetzt. Sie werden durch den + Namen der gerade angehängten Datei ohne bzw. mit der Erweiterung ersetzt. + Beachten Sie, dass ausschließlich der Basisname und Erweiterung eingefügt + werden, nicht aber die Verzeichnis- oder Laufwerkskomponenten. + +

+ + +

+ Sie können mit »<NUM:Stellen>« eine Mindestanzahl von Stellen für die + Kapitelnummer angeben, z.B. »<NUM:3>«. Die Nummer wird mit führenden + Nullen aufgefüllt, falls die Stellenanzahl geringer als angegeben ist. + +

+ + +

+ Sie können das für den Startzeitstempel benutzte Format mit + <START:format> anpassen. Als Format wird standardmäßig + '%H:%M:%S' genommen, falls keines angegeben wird. + Gültige Formatanweisungen sind: + +

+ + +
    + +
  • + +

    %h – Stunden +

    + +
  • + +
  • + +

    %H – Stunden, mit Nullen auf zwei Stellen aufgefüllt +

    + +
  • + +
  • + +

    %m – Minuten +

    + +
  • + +
  • + +

    %M – Minuten, mit Nullen auf zwei Stellen aufgefüllt +

    + +
  • + +
  • + +

    %s – Sekunden +

    + +
  • + +
  • + +

    %S – Sekunden, mit Nullen auf zwei Stellen aufgefüllt +

    + +
  • + +
  • + +

    %n – Nanosekunden mit neun Stellen +

    + +
  • + +
  • + +

    %<1-9>n – Nanosekunden mit bis zu neun Stellen + (z.B. drei Stellen mit %3n) +

    + +
  • + +
+ +
--cue-chapter-name-format Format + +

+ mkvmerge(1) unterstützt das Lesen von CUEsheets für + Audiodateien als Eingabe für Kapitel. CUEsheets enthalten + normalerweise für jeden Indexeintrag die Einträge + PERFORMER (»Interpret«) und TITLE + (»Titel«). mkvmerge(1) benutzt diese beiden Zeichenketten, um den + Kapitelnamen aufzubauen. Mit dieser Option kann das für diesen Namen + verwendete Format gesetzt werden. + +

+ + +

+ Falls diese Option nicht angegeben wurde, ist das Format »%p - + %t« (der Interpret gefolgt von einem Leerzeichen, einem + Gedankenstrich, einem weiteren Leerzeichen und dem Titel) die Voreinstellung + von mkvmerge(1). + +

+ + +

+ Falls das Format angegeben wurde, dann wird alles außer den folgenden + Metazeichen, so wie es ist, kopiert und die Metazeichen werden wie folgt + ersetzt: + +

+ + +
    + +
  • + +

    %p wird durch die Zeichenkette + PERFORMER des aktuellen Eintrags ersetzt, +

    + +
  • + +
  • + +

    %t wird durch die Zeichenkette + TITLE des aktuellen Eintrags ersetzt, +

    + +
  • + +
  • + +

    %n wird durch die aktuelle Spurnummer ersetzt und +

    + +
  • + +
  • + +

    %N wird durch die aktuelle Spurnummer, aufgefüllt mit + einer führenden Null, falls sie kleiner als zehn ist, ersetzt. +

    + +
  • + +
+ +
--chapters Dateiname + +

+ Liest Kapitelinformationen aus der Datei + Dateiname. Einzelheiten finden Sie im nachfolgenden + Abschnitt über Kapitel. + +

+ +
--global-tags Dateiname + +

+ Liest globale Tags aus der Datei + Dateiname. Einzelheiten finden Sie im nachfolgenden + Abschnitt über Tags. + +

+ +
+ + + +

2.4. Allgemeine Ausgabesteuerung (fortgeschrittene globale Optionen)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order FID1:TID1,FID2:TID2,… + +

+ Diese Option ändert die Reihenfolge, in der die Spuren für eine Eingabedatei + erstellt werden. Das Argument ist eine durch Kommas getrennte Liste von + ID-Paaren. Jedes Paar enthält zuerst die Datei-ID + (FID1), die einfach die Zahl ist, an welcher Stelle + auf der Befehlszeile, beginnend bei 0, die Datei erscheint. Als zweites + kommt die Spur-ID (TID1) dieser Datei. Falls + irgendwelche Spuren weggelassen werden, dann werden diese Spuren erstellt, + nachdem die mit dieser Option angegebenen erstellt wurden. + +

+ +
--cluster-length Spezifikation + +

+ Begrenzt die Anzahl von Datenblöcken oder die Laufzeit von Daten in jedem + Cluster. Der Parameter Spezifikation kann entweder + eine Zahl n ohne eine Einheit oder eine Zahl + d sein, der »ms« folgt. + +

+ + +

+ Falls keine Einheit benutzt wird, wird mkvmerge(1) höchstens + n Datenblöcke in jeden Cluster ablegen. Die maximale + Anzahl von Blöcken liegt bei 65535. + +

+ + +

+ Falls der Zahl d ein »ms« folgt, + dann wird mkvmerge(1) höchstens d Millisekunden Daten + in jeden Cluster ablegen. Das Minimum für d liegt bei + »100ms« und das Maximum bei »32000ms«. + +

+ + +

+ Standardmäßig legt mkvmerge(1) höchstens 65535 Datenblöcke und 5000 ms Daten + in einen Cluster. + +

+ + +

+ Programme, die versuchen, ein bestimmtes Bild zu finden, können nur einen + Cluster direkt suchen und müssen danach den ganzen Cluster lesen. Daher kann + das Erstellen großer Cluster zu ungenauem oder langsamem Durchsuchen führen. + +

+ +
--clusters-in-meta-seek + +

+ Sagt mkvmerge(1), dass es ein Metasuchelement am Ende der Datei erstellen + soll, das alle Cluster enthält. Siehe auch den Abschnitt über das Matroska-Datei-Layout. + +

+ +
--timestamp-scale Faktor + +

+ Erzwingt den Faktor Faktor für die + Zeitstempelskala. Gültige Werte sind im Bereich + 1000..10000000 und der Spezialwert + -1. + +

+ + +

+ Normalerweise wird mkvmerge(1) einen Wert von 1000000 + benutzen. Das bedeutet, dass Zeitstempel und Laufzeiten die Genauigkeit von + 1 ms haben. Für Dateien, die keine Videospuren aber mindestens eine Tonspur + enthalten, wird mkvmerge(1) automatisch einen Faktor der Zeitstempelskala so + wählen, dass alle Zeitstempel und Laufzeiten die Genauigkeit eines + Audio-Samples bekommen. Dies verursacht einen größeren Aufwand, ermöglicht + aber genaueres Suchen und Extrahieren. + +

+ + +

+ Falls der Spezialwert -1 benutzt wird, dann wird + mkvmerge(1) die Genauigkeit des Samples auch dann verwenden, wenn eine + Videospur vorhanden ist. + +

+ +
--enable-durations + +

+ Schreibt die Laufzeiten für alle Blöcke. Dies erhöht die Größe der Datei und + bietet dem, der es abspielt, im Moment keinen zusätzlichen Wert. + +

+ +
--no-cues + +

+ Teilt mkvmerge(1) mit, dass es die Indexdaten nicht erzeugen und schreiben + soll, die mit einem Index in einem AVI verglichen werden + können. Matroska(tm)-Dateien können ohne die Indexdaten abgespielt werden, + aber das Durchsuchen ist möglicherweise ungenauer und langsamer. Benutzen + Sie dies nur, falls Sie wirklich dringend Platz brauchen oder für + Testzwecke. Siehe auch die Option --cues, die für + jede Eingabedatei angegeben werden kann. + +

+ +
--no-date + +

+ Standardmäßig setzt mkvmerge(1) das "Datum"-Segment-Informationen-Feld auf + die Uhrzeit & Datum, als das Multiplexen gestartet wurde. Mit dieser + Option wird das Feld gar nicht geschrieben. + +

+ +
--disable-lacing + +

+ Deaktiviert das Zusammenbinden aller Spuren, Dies erhöht die Größe der + Datei, insbesondere dann, wenn es viele Tonspuren gibt. Diese Option ist + nicht für den täglichen Gebrauch gedacht. + +

+ +
--disable-track-statistics-tags + +

+ Normalerweise schreibt mkvmerge(1) bestimmte Tags mit Statistiken für jede + Spur. Falls solche Tags bereits existieren, werden sie überschrieben. Die + Tags lauten BPS, DURATION, + NUMBER_OF_BYTES und + NUMBER_OF_FRAMES. + +

+ + +

+ Mit dieser Option wird mkvmerge(1) angewiesen, keine solchen Tags zu + schreiben und bereits existierende Tags mit denselben Namen nicht zu + verändern. + +

+ +
--disable-language-ietf + +

+ Normalerweise schreibt mkvmerge(1) die neuen IETF-BCP-47-Sprachelemente + Ergänzung zu den alten Sprachelementen in Spurkopfdaten, Kapiteln und + Tags. Wenn diese Option benutzt wird, so werden nur die alten Elemente + geschrieben. + +

+ +
--normalize-language-ietf Modus + +

+ Aktiviert die Normalisierung aller IETF-BCP-47-Sprach-Tags zu entweder ihrer + kanonischen Form mit Modus »canonical«, zu ihrer + Erweiterte-Sprach-Unterelemente-Form mit Modus »extlang« + oder deaktiviert die Normalisierung mit Modus + »off«. Standardmäßig wird eine Normalisierung zur + kanonischen Form durchgeführt. + +

+ + +

+ In der kanonischen Form werden alle Unterelemente, für die bevorzugte Werte + existieren, durch diese bevorzugten Werte ersetzt. Dies wandelt + z.B. »zh-yue-jyutping« in + »yue-jyutping« oder »fr-FX« in + »fr-FR« um. + +

+ + +

+ Für die Erweiterte-Sprach-Unterelemente-Form wird zuerst die kanonische Form + gebildet. Anschließend werden alle primären Sprachelemente, für die es + erweiterte Sprach-Unterlemente gibt, durch diese erweiterten + Sprach-Unterelemente und das dazugehörige Präfix ersetzt. Dies wandelt + z.B. »yue-jyutping« zurück in + »zh-yue-jyutping« um, hat aber keine Auswirkung auf + »fr-FR«, weil es für »fr« kein + erweitertes Sprach-Unterelement gibt. + +

+ +
--stop-after-video-ends + +

+ Stoppt die Verarbeitung, nachdem das Ende der primären Videospur erreicht + wurde, und verwirft alle ausstehenden Pakete anderer Spuren. + +

+ +
+ + + +

2.5. Datei aufteilen, verknüpfen, anhängen und verketten (weitere globale + Optionen)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split Spezifikation + +

+ Teilt die Ausgabedatei nach der angegebenen Größe oder Zeit auf. Bitte + beachten Sie, dass Spuren nur direkt vor einem Schlüsselbild geteilt werden + können. Daher kann sich der Aufteilungspunkt ein wenig von dem + unterscheiden, der angegeben wurde. + +

+ + +

+ Derzeit unterstützt mkvmerge(1) die folgenden Modi: + +

+ + +
    + +
  1. + +

    + Aufteilen anhand der Größe + +

    + + +

    + Syntax: --split + [size:]d[k|m|g] + +

    + + +

    + Beispiele: --split size:700m oder --split + 150000000 + +

    + + +

    + Der Parameter d kann mit »k«, + »m« oder »g« enden, um anzuzeigen, ob + die Größe in kB, MB beziehungsweise GB vorliegt. Andernfalls wird von einer + Größe in Byte ausgegangen. Nachdem die aktuelle Ausgabedatei diese + Größenbegrenzung erreicht hat, wird eine neue angefangen. + +

    + + +

    + Das Präfix »size:« kann aus Kompatibilitätsgründen + weggelassen werden. + +

    + +
  2. + + +
  3. + +

    + Aufteilen nach einer Laufzeit + +

    + + +

    + Syntax: --split + [duration:]HH:MM:SS.nnnnnnnnn|ds + +

    + + +

    + Beispiele: --split duration:00:60:00.000 oder --split + 3600s + +

    + + +

    + Der Parameter muss entweder die Form + HH:MM:SS.nnnnnnnnn haben, um die Laufzeit mit einer + Genauigkeit bis zu einer Nanosekunde anzugeben, oder eine Zahl + d gefolgt vom Buchstaben »s« sein, + um eine Laufzeit in Sekunden anzugeben. HH ist die + Anzahl der Stunden, MM die Anzahl der Minuten, + SS die Anzahl der Sekunden und + nnnnnnnnn die Anzahl der Nanosekunden. Sowohl die + Zahl der Stunden als auch die der Nanosekunden kann weggelassen werden. Es + könnnen bis zu neun Nachkommastellen vorliegen. Nachdem der Laufzeit des + Inhalts in der aktuellen Ausgabe diese Begrenzung erreicht hat, wird eine + neue Ausgabedatei begonnen. + +

    + + +

    + Das Präfix »duration:« darf aus Kompatibilitätsgründen + weggelassen werden. + +

    + +
  4. + + +
  5. + +

    + Aufteilen nach bestimmten Zeitstempeln + +

    + + +

    + Syntax: --split + timestamps:A[,B[,C…]] + +

    + + +

    + Beispiel: --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + Die Parameter A, B, + C etc. müssen alle das gleiche Format wie das haben, + das für die Laufzeit benutzt wurde (siehe oben). Die Liste der Zeitstempel + wird durch Kommas getrennt. Nachdem der Eingabestrom den Zeitstempel des + nächsten Aufteilungspunkts erreicht hat, wird eine neue Datei erstellt. Dann + wird der nächste Aufteilungspunkt in der Liste benutzt. + +

    + + +

    + Das Präfix »timestamps:« darf nicht weggelassen werden. + +

    + +
  6. + + +
  7. + +

    + Aufbewahren bestimmter Teile durch die Angabe von Zeitstempelbereichen, + während andere verworfen werden + +

    + + +

    + Syntax: --split + parts:Start1-Ende1[,[+]Start2-Ende2[,[+]Start3-Ende3…]] + +

    + + +

    + Beispiele: +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + Der Modus parts teilt mkvmerge(1) mit, dass bestimmte + Zeitstempelbereiche aufbewahrt werden, während andere verworfen werden. Die + Bereiche, die aufbewahrt werden sollen, müssen nach dem Schlüsselwort + parts: aufgeführt und durch Kommas getrennt werden. Ein + Bereich selbst besteht aus einem Start- und Endzeitstempel im selben Format, + wie dem, das andere Variationen von --split + akzeptieren (z.B. beziehen sich sowohl 00:01:20 als auch + 80s auf den selben Zeitstempel). + +

    + + +

    + Falls ein Startzeitstempel weggelassen wurde, wird er standardmäßig auf das + Ende des vorherigen Zeitstempelbereichs gesetzt. Falls es keinen vorherigen + Bereich gab, dann wird er standardmäßig auf den Dateianfang gesetzt (siehe + Beispiel 3). + +

    + + +

    + Falls ein Endzeitstempel weggelassen wird, dann wird dies standardmäßig das + Ende der Quelldateien, wodurch mkvmerge(1) im Prinzip mitgeteilt wird, dass + es den Rest behalten soll (siehe Beispiel 3). + +

    + + +

    + Normalerweise wird jeder Bereich in eine neue Datei geschrieben. Dies kann + so geändert werden, dass aufeinanderfolgende Bereiche in dieselbe Datei + geschrieben werden. Dafür muss man dem Startzeitstempel ein + + voranstellen. Dies teilt mkvmerge(1) mit, dass es keine + neue Datei erstellen und den Bereich stattdessen an dieselbe Datei anhängen + soll, in die der letzte Bereich geschrieben wurde. Zeitstempel werden + angepasst, so dass es in der Ausgabedatei keine Lücke gibt, selbst wenn es + in den beiden Bereichen in der Eingabedatei eine Lücke gab. + +

    + + +

    + Im Beispiel 1 wird mkvmerge(1) zwei Dateien erstellen. Die erste wird den + Inhalt beginnend bei 00:01:20 bis + 00:02:45 enthalten. Die zweite Datei wird den Inhalt von + 00:05:50 bis 00:10:30 enthalten. + +

    + + +

    + Im Beispiel 2 wird mkvmerge(1) nur eine Datei erstellen. Diese Datei wird + den Inhalt beginnend bei 00:01:20 bis + 00:02:45 und den Inhalt beginnend bei + 00:05:50 bis 00:10:30 enthalten. + +

    + + +

    + Im Beispiel 3 wird mkvmerge(1) zwei Dateien erstellen. Die erste wird den + Inhalt vom Anfang der Quelldateien bis 00:02:45 + enthalten. Die zweite Datei wird den Inhalt beginnend bei + 00:05:50 bis zum Ende der Quelldatei enthalten. + +

    + + +
    +

    Note:

    + +

    + Beachten Sie, dass mkvmerge(1) nur Entscheidungen über das Aufteilen an + Schlüsselbildpositionen trifft. Dies gilt sowohl für den Anfang als auch das + Ende von jedem Bereich. Daher wird mkvmerge(1) sogar dann mit der Ausgabe der + Bilder bis vor das nächste Bild fortfahren, wenn der Zeitstempel zwischen + zwei Schlüsselbildern liegt. + +

    + +
    + +
  8. + + +
  9. + +

    + Aufbewahren bestimmter Teile durch Angabe von Bild-/Feldnummerbereichen + während andere verworfen werden + +

    + + +

    + Syntax: --split + parts-frames:Start1-Ende1[,[+]Start2-Ende2[,[+]Start3-Ende3…]] + +

    + + +

    + Beispiele: +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + Der Modus parts-frames teilt mkvmerge(1) mit, dass + bestimmte Bereiche von Bild-/Feldnummern aufbewahrt werden, während andere + verworfen werden. Die Bereiche, die aufbewahrt werden sollen, müssen nach + dem Schlüsselwort parts-frames: aufgeführt und durch + Kommas getrennt werden. Ein Bereich selbst besteht aus einer Start- und + Endbildnummer. Die Nummerierung beginnt bei 1. + +

    + + +

    + Falls eine Startnummer weggelassen wird, wird sie standardmäßig auf die + Endnummer des vorherigen Bereichs gesetzt. Falls es keinen vorherigen + Bereich gibt, wird sie standardmäßig zum Dateianfang (siehe Beispiel 3). + +

    + + +

    + Falls eine Endnummer weggelassen wird, dann wird dies standardmäßig das Ende + der Quelldateien, wodurch mkvmerge(1) im Prinzip mitgeteilt wird, dass es den + Rest behalten soll (siehe Beispiel 3). + +

    + + +

    + Normalerweise wird jeder Bereich in eine neue Datei geschrieben. Dies kann + so geändert werden, dass aufeinanderfolgende Bereiche in dieselbe Datei + geschrieben werden. Dafür muss man der Startnummer ein + + voranstellen. Dies teilt mkvmerge(1) mit, dass es keine neue Datei erstellen + und den Bereich stattdessen an dieselbe Datei anhängen soll, in die der + letzte Bereich geschrieben wurde. Zeitstempel werden so angepasst, dass es + in der Ausgabedatei keine Lücke gibt, auch dann nicht, wenn es in den beiden + Bereichen in der Eingabedatei eine Lücke gab. + +

    + + +
    +

    Note:

    + +

    + Beachten Sie, dass mkvmerge(1) nur Entscheidungen über das Aufteilen an + Schlüsselbildpositionen trifft. Dies gilt sowohl für den Anfang als auch das + Ende jedes Bereichs. Daher wird mkvmerge(1) sogar dann mit der Ausgabe der + Bilder bis vor das nächste Bild fortfahren, wenn die Bild-/Feldnummer + zwischen zwei Schlüsselbildern liegt. + +

    + +
    + + +

    + Im Beispiel 1 wird mkvmerge(1) zwei Dateien erstellen. Die erste wird den + Inhalt beginnend beim ersten Schlüsselbild bei oder nach + 137 bis vor das erste Schlüsselbild bei oder nach + 258 enthalten. Die zweite Datei wird den Inhalt beginnend + bei 548 bis 1211 enthalten. + +

    + + +

    + Im Beispiel 2 wird mkvmerge(1) nur eine Datei erstellen. Diese Datei wird den + Inhalt beginnend bei 733 bis 912 und + den Inhalt beginnend bei 1592 bis 2730 + enthalten. + +

    + + +

    + Im Beispiel 3 wird mkvmerge(1) zwei Dateien erstellen. Die erste wird den + Inhalt vom Anfang der Quelldateien bis 430 enthalten. Die + zweite Datei wird den Inhalt beginnend bei 2512 bis zum + Ende der Quelldatei enthalten. + +

    + + +

    + Dieser Modus betrachtet nur die erste Videospur, die ausgegeben wird. Falls + keine Videospur ausgegeben wird, wird es keine Aufteilung geben. + +

    + + +
    +

    Note:

    + +

    + Die mit diesem Argument angegebenen Zahlen werden basierend auf der Zahl der + ausgegebenen Matroska(tm)-Blöcke interpretiert. Ein einzelner Matroska(tm)-Block + enthält entweder ein komplettes Bild (für fortlaufenden Inhalt) oder ein + einzelnes Feld (für Inhalt im Halbbildverfahren). mkvmerge(1) unterscheidet + nicht zwischen diesen beiden und zählt einfach nur die Anzahl der + Blöcke. Zum Beispiel: Falls jemand nach dem 25. kompletten Bild bei Inhalt + im Halbbildverfahren aufteilen möchte, müsste er 50 als + Aufteilungspunkt benutzen (zwei Felder pro komplettem Bild). + +

    + +
    + +
  10. + + +
  11. + +

    + Aufteilen nach bestimmten Bildern/Feldern + +

    + + +

    + Syntax: --split + frames:A[,B[,C…]] + +

    + + +

    + Beispiel: --split frames:120,237,891 + +

    + + +

    + Die Parameter A, B, + C etc. müssen jeweils positive Ganzzahlen sein. Die + Nummerierung beginnt bei 1. Die Liste der Bild-/Feldnummern wird durch + Kommas getrennt. Nachdem der Eingabedatenstrom die Bild-/Feldnummer des + aktuellen Aufteilungspunkts erreicht hat, wird eine neue Datei + erstellt. Dann wird der nächste in der Liste angegebene Aufteilungspunkt + benutzt. + +

    + + +

    + Das Präfix »frames:« darf nicht weggelassen werden. + +

    + + +

    + Dieser Modus betrachtet nur die erste Videospur, die ausgegeben wird. Falls + keine Videospur ausgegeben wird, wird es keine Aufteilung geben. + +

    + + +
    +

    Note:

    + +

    + Die mit diesem Argument angegebenen Zahlen werden basierend auf der Zahl der + ausgegebenen Matroska(tm)-Blöcke interpretiert. Ein einzelner Matroska(tm)-Block + enthält entweder ein komplettes Bild (für fortlaufenden Inhalt) oder ein + einzelnes Feld (für Inhalt im Halbbildverfahren). mkvmerge(1) unterscheidet + nicht zwischen diesen beiden und zählt einfach nur die Anzahl der + Blöcke. Zum Beispiel: Falls jemand nach dem 25. kompletten Bild bei Inhalt + im Halbbildverfahren aufteilen möchte, müsste er 50 als + Aufteilungspunkt benutzen (zwei Felder pro komplettem Bild). + +

    + +
    + +
  12. + + +
  13. + +

    + Aufteilen vor bestimmten Kapiteln + +

    + + +

    + Syntax: --split chapters:all oder + --split + chapters:A[,B[,C…]] + +

    + + +

    + Beispiel: --split chapters:5,8 + +

    + + +

    + Die Parameter A, B, + C etc. müssen jeweils positive Ganzzahlen sein. Die + Nummerierung beginnt bei 1. Die Liste der Kapitel wird durch Kommas + getrennt. Die Aufteilung wird kurz vor dem ersten Schlüsselbild auftreten, + dessen Zeitstempel größer oder gleich dem Startzeitstempel für die Kapitel + ist, deren Nummern aufgelistet wurden. Ein Kapitel, das bei 0s beginnt, wird + niemals für das Aufteilen berücksichtigt und stillschweigend verworfen. + +

    + + +

    + Anstatt alle Kapitelnummern manuell aufzuführen, kann das Schlüsselwort + all benutzt werden. + +

    + + +

    + Das Präfix »chapters:« darf nicht weggelassen werden. + +

    + + +
    +

    Note:

    + +

    + Das Matroska-Dateiformat unterstützt beliebig tief verschachtelte + Kapitelstrukturen, »Editionseinträge« und »Kapitelelemente« genannt. Dieser + Modus betrachtet allerdings nur die obersten Ebenen der Kapitel über alle + Editionseinträge hinweg. + +

    + +
    + +
  14. + +
+ + +

+ Bei diesem Aufteilungsmodus wird der Ausgabedateiname anderes als im + normalen Betrieb behandelt. Er kann einen Ausdruck »%d« + enthalten, ähnlich wie printf, einschließlich einer + Feldbreite, z.B. »%02d«. Falls dies der Fall ist, wird die + aktuelle Dateizahl entsprechend formatiert und an der Stelle im Dateinamen + eingesetzt. Falls kein derartiges Muster vorkommt, dann wird vom Muster + »-%03d« direkt vor der Dateinamenserweiterung ausgegangen: + »-o Ausgabe.mkv« würde zu »Ausgabe-001.mkv« führen + und so weiter. Falls es keine Dateinamenserweiterung gibt, wird + »-%03d« an den Namen angehängt. + +

+ + +

+ Ein weiterer möglicher Ausdruck ist »%c«, der durch den Namen + des ersten Kapitels in der Datei ersetzt wird. Beachten Sie, dass der + Ausdruck »-%03d« nicht automatisch hinzugefügt wird, falls + »%c« bereits vorhanden ist. + +

+ +
--link + +

+ Verknüpft Dateien mit anderen, wenn die Ausgabedatei aufgeteilt + wird. Einzelheiten finden Sie im nachfolgenden Kapitel über das Verknüpfen von Dateien. + +

+ +
--link-to-previous Segment-UID + +

+ Verknüpft die erste Ausgabedatei an das Segment mit der durch den Parameter + Segment-UID angegebenen Segment-UID. Einzelheiten + finden Sie im nachfolgenden Abschnitt über das Verknüpfen von Dateien. + +

+ + +

+ Falls SID mit einem = beginnt, so wird der Rest als Name einer + Matroska-Datei interpretiert, deren Segment-UID gelesen und benutzt wird. + +

+ +
--link-to-next Segment-UID + +

+ Verknüpft die letzte Ausgabedatei an das Segment mit der durch den Parameter + Segment-UID angegebenen Segment-UID. Einzelheiten + finden Sie im nachfolgenden Kapitel über das Verknüpfen von Dateien. + +

+ + +

+ Falls SID mit einem = beginnt, so wird der Rest als Name einer + Matroska-Datei interpretiert, deren Segment-UID gelesen und benutzt wird. + +

+ +
--append-mode Modus + +

+ Legt fest, wie Zeitstempel beim Anhängen von Dateien berechnet werden. Der + Parameter Modus kann zwei Werte annehmen: + »file«, der auch die Voreinstellung ist, und + »track«. + +

+ + +

+ Wenn mkvmerge(1) eine Spur (von nun an »track2_1« genannt) + von einer zweiten Datei (»file2« genannt) an eine Spur + (»track1_1« genannt) von der ersten Datei + (»file1« genannt) anhängt, dann müssen alle Zeitstempel + für »track2_1« um einen Betrag versetzt werden. Im Modus + »file« ist dies der höchste in »file1« + aufgetretene Betrag, auch wenn dieser Zeitstempel von einer anderen Spur als + »track1_1« stammt. Im Modus »track« ist der Versatz der + höchste Zeitstempel aus »track1_1«. + +

+ + +

+ Unglücklicherweise kann mkvmerge(1) nicht bestimmen, welcher Modus + zuverlässig benutzt werden kann. Daher ist der Modus + »file« die Voreinstellung. Der Modus + »file« funktioniert normalerweise bei Dateien besser, die + unabhängig von anderen erstellt wurden, z.B. wenn AVI- oder + MP4-Dateien angehängt werden. Der Modus + »track« funktioniert möglicherweise besser bei Quellen, + die eigentlich nur Teile einer großen Datei sind, z.B. bei + VOB- und EVO-Dateien. + +

+ + +

+ Untertitelspuren werden immer so behandelt, als sei der Modus + »file« aktiv, sogar dann, wenn tatsächlich der Modus + »track« aktiv ist. + +

+ +
--append-to + SFID1:STID1:DFID1:DTID1[,…] + +

+ Diese Option steuert, an welche Spur eine andere Spur angehängt wird. Jede + Spezifikation enthält vier IDs: eine Datei-ID, eine Spur-ID, eine zweite + Datei-ID und eine zweite Spur-ID. Das erste Paar aus »Quelldatei-ID« und + »Quellspur-ID« kennzeichnet die Spur, die angehängt wird. Das zweite Paar + aus »Zieldatei-ID« und »Zielspur-ID« kennzeichnet die Spur, an die die erste + angehängt wird. + +

+ + +

+ Falls diese Option weggelassen wurde, wird eine Standardzuordnung + benutzt. Diese Standardzuordnung hängt jede Spur der aktuellen Datei an eine + Spur der vorherigen Datei mit derselben Spur-ID an. Dies ermöglicht + einfaches Anhängen mit dem Befehl mkvmerge -o Ausgabe.mkv Teil1.mkv + +Teil2.mkv, falls ein Film in zwei Teile geschnitten wurde und + beide Dateien dieselbe Anzahl von Spuren und Spur-IDs haben. + +

+ +
+ + +

+ Ein einzelnes »+« führt dazu, dass die nächste Datei angehängt statt + hinzugefügt wird. Das »+« kann außerdem vor den nächsten Dateinamen gesetzt + werden. Daher sind die beiden folgenden Befehle identisch: + +

+ +
$ mkvmerge -o vollständig.mkv Datei1.mkv + Datei2.mkv
+$ mkvmerge -o vollständig.mkv Datei1.mkv +Datei2.mkv
+
[ Datei1 + Datei2 ] + +

+ Falls mehrere Dateinamen in eckigen Klammern stehen, dann werden die zweite + und alle folgenden Dateien an die erste in den Klammern stehende Datei + angehängt. + +

+ + +

+ Dies ist eine alternative Syntax dafür, Dateinamen mit »+« zwischen ihnen + aufzulisten. Deshalb sind die zwei folgenden Befehle gleichwertig: + +

+ +
$ mkvmerge -o vollständig.mkv Datei1.mkv + Datei2.mkv
+$ mkvmerge -o vollständig.mkv '[' Datei1.mkv Datei2.mkv ']'
+
= + +

+ Für bestimmte Dateitypen (MPEG Programmströme = VOBs) sucht mkvmerge(1) + normalerweise im selben Verzeichnis nach Dateien wie eine Eingabedatei, die + den gleichen Basisnamen hat und sich nur in ihrer fortlaufenden Nummer + unterscheidet (z.B. »VTS_01_1.VOB«, »VTS_01_2.VOB«, »VTS_01_3.VOB«, etc.) + und behandelt alle diese Dateien, als ob sie zu einer einzigen großen Datei + verbunden wären. Diese Option, ein einzelnes »=«, veranlasst mkvmerge(1), + nicht nach diesen zusätzlichen Dateien zu suchen. + +

+ + +

+ Das »=« kann kann außerdem vor den nächsten Dateinamen gesetzt werden. Daher + entsprechen die beiden folgenden Befehle einander: + +

+ +
$ mkvmerge -o vollständig.mkv = Datei1.vob
+$ mkvmerge -o vollständig.mkv =Datei1.vob
+
( Datei1 + Datei2 ) + +

+ Falls mehrere Dateinamen in runden Klammern stehen, dann werden diese + Dateien so behandelt, als ob sie in einer einzigen großen Datei verbunden + wären, die aus dem Inhalt jeder der Dateien besteht, einer nach der anderen. + +

+ + +

+ Dies kann z.B. für VOB-Dateien benutzt werden, die von einer DVD oder + MPEG-Transportdatenströmen stammen. Es kann nicht verwendet werden, falls + jede Datei einen eigenen Kopfdatensatz enthält, was normalerweise bei + eigenständigen Dateien wie AVI oder MP4 der Fall ist. + +

+ + +

+ Einen Dateinamen in runde Klammern zu stecken verhindert auch, dass + mkvmerge(1) nach zusätzlichen Dateien mit dem selben Basisnamen sucht. Dies + wird bei der Option + = beschrieben. Daher entsprechen die beiden + folgenden Befehlszeilen einander: + +

+ +
$ mkvmerge -o Ausgabe.mkv = Datei.mkv
+$ mkvmerge -o Ausgabe.mkv '(' Datei.mkv ')'
+ +

+ Es ist auf mehrere Dinge zu achten: + +

+ + +
    + +
  1. + +

    + Sowohl nach der öffnenden als auch vor der schließenden runden Klammer + müssen Leerzeichen stehen. + +

    + +
  2. + + +
  3. + +

    + Jeder Parameter in runden Klammern wird als Dateiname interpretiert. Daher + müssen alle Optionen, die auf diese logische Datei angewandt werden, vor der + öffnenden runden Klammer aufgeführt werden. + +

    + +
  4. + + +
  5. + +

    + Einige Shells behandeln runde Klammern als Sonderzeichen. Daher müssen Sie + sie maskieren oder wie im oben gezeigten Beispiel in Anführungszeichen + setzen. + +

    + +
  6. + +
+ +
+ + + + +

2.6. Unterstützung von Anhängen (weitere globale Optionen)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description + Beschreibung + +

+ Klarschriftbeschreibung des folgenden Anhangs. Gilt für die nächste Option + --attach-file + oder --attach-file-once. + + +

+ +
--attachment-mime-type MIME-Typ + +

+ MIME-Typ des folgenden Anhangs. Gilt für die nächste Option + --attach-file + oder --attach-file-once. + Eine Liste offiziell anerkannter MIME-Typen kann z.B. auf + der IANA-Homepage + gefunden werden. Der MIME-Typ ist für einen Anhang + vorgeschrieben. + +

+ + +

+ Falls für einen Dateianhang kein MIME-Typ angegeben wird, + wird sein Typ automatisch erkannt. + +

+ +
--attachment-name Name + +

+ Setzt den Namen, der in der Ausgabedatei für diesen Anhang gespeichert + wird. Falls diese Option nicht angegeben ist, wird der Name vom Dateinamen + des Anhangs abgeleitet, der mit der Option --attach-file + oder der Option --attach-file-once + vorgegeben wird. + +

+ +
+ --attach-file Dateiname, + --attach-file-once Dateiname + + +

+ Erstellt einen Dateianhang innerhalb der Matroska(tm)-Datei. Der + MIME-Typ muss gesetzt worden sein, bevor diese Option + benutzt werden kann. Der Unterschied zwischen diesen beiden Formen besteht + darin, dass während der Aufteilung die mit --attach-file + angehängten Dateien an alle Ausgabedateien angehängt werden, während die mit + der Option --attach-file-once angehängten nur an die erste + erstellte Datei angehängt werden. Falls keine Aufteilung benutzt wird, tun + beide dasselbe. + +

+ + +

+ mkvextract(1) kann benutzt werden, um angehängte Dateien aus einer + Matroska(tm)-Datei zu extrahieren. + +

+ +
--enable-legacy-font-mime-types + +

+ Aktiviert die Nutzung veralteter MIME-Typen für bestimme + Arten von Schriftart-Dateianhängen. Beispielsweise wird + »application/x-truetype-font« für TrueType-Schriftarten + anstelle von »fonts/ttf« benutzt." + +

+ + +

+ Dies betrifft sowohl neue Dateianhänge, sofern deren + MIME-Typ automatisch erkannt wird, als auch existierende + Dateianhänge, deren gespeicherte MIME-Typen durch die + veralteten ersetzt werden. + +

+ + +

+ Die betroffenen MIME-Typen sind + »font/sfnt«, »font/ttf« und + »font/collection«, die alle durch + »application/x-truetype-fonts« ersetzt werden, sowie + »font/otf«, das durch + »application/vnd.ms-opentype« ersetzt wird." + +

+ +
+ + + +

2.7. Optionen, die für jede Eingabedatei verwendet werden können

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks + [!]n,m,… + +

+ Kopiert die Tonspuren n, m + etc. Die Zahlen sind Spur-IDs, die über den Schalter --identify + abgefragt werden können. Sie sind nicht nur einfach die Spurnummern (siehe + den Abschnitt Spur-IDs). Voreinstellung: alle + Tonspuren kopieren. + +

+ + +

+ Anstelle von Spur-IDs können auch ISO 639-2-Sprachcodes verwendet + werden. Dies funktioniert nur bei Quelldateien, die Sprachcodes für ihre + Spuren bereithalten. + +

+ + +

+ Standard: alle Spuren diesen Typs kopieren + +

+ + +

+ Falls den IDs ein ! vorangestellt ist, ist ihre Bedeutung + umgekehrt: alle Spuren dieses Typs kopieren außer den nach + ! aufgeführten. + +

+ +
-d, --video-tracks + [!]n,m,… + +

+ Kopiert die Videospuren n, m + etc. Die Zahlen sind Spur-IDs, die über den Schalter --identify + abgefragt werden können. Sie sind nicht nur einfach die Spurnummern (siehe + den Abschnitt Spur-IDs). Voreinstellung: alle + Videospuren kopieren. + +

+ + +

+ Anstelle von Spur-IDs können auch ISO 639-2-Sprachcodes verwendet + werden. Dies funktioniert nur bei Quelldateien, die Sprachcodes für ihre + Spuren bereithalten. + +

+ + +

+ Falls den IDs ein ! vorangestellt ist, ist ihre Bedeutung + umgekehrt: alle Spuren dieses Typs kopieren außer den nach + ! aufgeführten. + +

+ +
-s, --subtitle-tracks + [!]n,m,… + +

+ Kopiert die Untertitelspuren n, + m etc. Die Zahlen sind Spur-IDs, die über den + Schalter --identify + abgefragt werden können. Sie sind nicht nur einfach die Spurnummern (siehe + den Abschnitt Spur-IDs). Voreinstellung: alle + Untertitelspuren kopieren. + +

+ + +

+ Anstelle von Spur-IDs können auch ISO 639-2-Sprachcodes verwendet + werden. Dies funktioniert nur bei Quelldateien, die Sprachcodes für ihre + Spuren bereithalten. + +

+ + +

+ Falls den IDs ein ! vorangestellt ist, ist ihre Bedeutung + umgekehrt: alle Spuren dieses Typs kopieren außer den nach + ! aufgeführten. + +

+ +
-b, --button-tracks + [!]n,m,… + +

+ Kopiert die Button-Spuren n, m + etc. Die Zahlen sind Spur-IDs, die über den Schalter --identify + abgefragt werden können. Sie sind nicht nur einfach die Spurnummern (siehe + den Abschnitt Spur-IDs). Voreinstellung: alle + Button-Spuren kopieren. + +

+ + +

+ Anstelle von Spur-IDs können auch ISO 639-2-Sprachcodes verwendet + werden. Dies funktioniert nur bei Quelldateien, die Sprachcodes für ihre + Spuren bereithalten. + +

+ + +

+ Falls den IDs ein ! vorangestellt ist, ist ihre Bedeutung + umgekehrt: alle Spuren dieses Typs kopieren außer den nach + ! aufgeführten. + +

+ +
--track-tags + [!]n,m,… + +

+ Kopiert die Tags für Spuren n, + m etc. Die Zahlen sind Spur-IDs, die über den + Schalter --identify + abgefragt werden können. Sie sind nicht nur einfach die Spurnummern (siehe + den Abschnitt Spur-IDs). Voreinstellung: Tags für alle + Spuren kopieren. + +

+ + +

+ Falls den IDs ein ! vorangestellt ist, ist ihre Bedeutung + umgekehrt: alles kopieren außer den nach ! aufgeführten + IDs. + +

+ +
-m, --attachments + [!]n[:all|first],m[:all|first],… + +

+ Kopiert die Anhänge mit den IDs n, + m etc. in alle Ausgabedateien oder nur in die + erste. Jeder ID kann entweder »:all« folgen (was + Voreinstellung ist, wenn nichts eingegeben wird) oder + »:first«. Falls Aufteilen aktiv ist, dann werden diese + Anhänge, deren IDs mit »:all« angegeben wurden, in alle + resultierenden Ausgabedateien kopiert, während die anderen nur in die erste + Ausgabedatei kopiert werden. Falls kein Aufteilen aktiv ist, dann haben + beide Varianten dieselben Auswirkungen. + +

+ + +

+ Standardmäßig werden alle Anhänge in alle Ausgabedateien kopiert. + +

+ + +

+ Falls den IDs ein ! vorangestellt ist, ist ihre Bedeutung + umgekehrt: alles kopieren außer den nach ! aufgeführten + IDs. + +

+ +
-A, --no-audio + +

+ Keine Tonspur aus dieser Datei kopieren + +

+ +
-D, --no-video + +

+ Keine Videospur aus dieser Datei kopieren + +

+ +
-S, --no-subtitles + +

+ Keine Untertitelspur aus dieser Datei kopieren + +

+ +
-B, --no-buttons + +

+ Keine Button-Spur aus dieser Datei kopieren + +

+ +
-T, --no-track-tags + +

+ Keine spurspezifischen Tags aus dieser Datei kopieren + +

+ +
--no-chapters + +

+ Keine Kapitel aus dieser Datei kopieren + +

+ +
-M, --no-attachments + +

+ Keine Anhänge aus dieser Datei kopieren + +

+ +
--no-global-tags + +

+ Keine globalen Tags aus dieser Datei kopieren + +

+ +
-y, --sync + TID:d[,o[/p]] + +

+ Passt die Zeitstempel der Spur mit der ID TID um + d ms an. Die Spur-IDs sind dieselben, wie die mit + --identify + angegebenen (siehe den Abschnitt Spur-IDs). + +

+ + +

+ o/p: passen die Zeitstempel um + o/p an, um lineare + Verschiebungen zu beheben. Falls p weggelassen wird, + ist sie standardmäßig 1. Sowohl o als auch + p können Fließkommazahlen sein. + +

+ + +

+ Voreinstellung: keine manuelle Synchronisationskorrektur (was dasselbe wie + d = 0 und + o/p = + 1.0ist). + +

+ + +

+ Diese Option kann mehrfach für eine Eingabedatei benutzt werden und gilt für + mehrere Spuren, indem jedesmal eine andere Spur-ID ausgewählt wird. + +

+ +
--cues TID:none|iframes|all + +

+ Steuert, für welchen Spurenindex Einträge für die angegebene Spur erstellt + werden (siehe den Abschnitt Spur-IDs). »none« + verhindert das Erstellen von Indexeinträgen. Für + »iframes« werden nur Blöcke ohne Vorwärts- oder + Rückwärtsbezüge (= IFrames in Videospuren) in das Cuesheet + abgelegt. »all« veranlasst mkvmerge(1), Indexeinträge für + alle Blöcke zu erstellen, wodurch die Datei sehr groß wird. + +

+ + +

+ Für Video- und Untertitelspuren ist die Voreinstellung + »iframes«, für Audiospuren + »none«. Siehe auch die Option --no-cues, + die das Erstellen von Indexeinträgen verhindert, ohne die benutzten + --cues-Optionen zu berücksichtigen. + +

+ + +

+ Diese Option kann mehrfach für eine Eingabedatei benutzt werden und gilt für + mehrere Spuren, indem jedesmal eine andere Spur-ID ausgewählt wird. + +

+ +
--default-track-flag + TID[:bool] + +

+ Setzt den »Standardspur«-Schalter für die angegebene Spur (siehe den + Abschnitt Spur-IDs), falls das + optionale Argument bool nicht vorhanden ist. Der + Schalter wird gesetzt, sofern der Quellcontainer dafür keine Informationen + bereitstellt und auch die Benutzerin bzw. der Benutzer sie nicht über diese + Option angibt. + +

+ + +

+ Wenn die Benutzerin bzw. der Benutzer keine explizite Spur zum Abspielen + festlegt, so sollte das Abspielprogramm eine derjenigen Spuren auswählen, + die den &Standardspur"-Schalter gesetzt haben und dabei + Voreinstellungen wie die präferierte Sprache berücksichtigen. + +

+ + +

+ Diese Option kann mehrfach für eine Eingabedatei benutzt werden und gilt für + mehrere Spuren, indem jedesmal eine andere Spur-ID ausgewählt wird. + +

+ +
--track-enabled-flag + TID[:bool] + +

+ Setzt den »Spur aktiviert«-Schalter für die angegebene Spur (siehe den + Abschnitt Spur-IDs) auf den Wert + bool (0 oder 1; 1 falls nicht angegeben). Spuren sind + standardmäßig aktiviert, sofern für sie keine Option angegeben wird und auch + der Quellcontainer diese Informationen für sie nicht bereitstellt. + +

+ + +

+ Nur Spuren, deren »Spur aktiviert«-Schalter gesetzt ist, sollten beim + Abspielen berücksichtigt werden. + +

+ + +

+ Diese Option kann mehrfach für eine Eingabedatei benutzt werden und gilt für + mehrere Spuren, indem jedesmal eine andere Spur-ID ausgewählt wird. + +

+ +
--forced-display-flag + TID[:bool] + +

+ Setzt den »Abspielen erzwingen«-Schalter für die angegebene Spur (siehe den + Abschnitt Spur-IDs), falls das + optionale Argument bool auf 1 + gesetzt oder nicht vorhanden ist. Kann für Spuren genutzt werden, die auf + dem Bildschirm angezeigten Text oder Dialoge in fremden Sprachen beinhalten. + +

+ + +

+ Diese Option kann mehrfach für eine Eingabedatei benutzt werden und gilt für + mehrere Spuren, indem jedesmal eine andere Spur-ID ausgewählt wird. + +

+ +
--hearing-impaired-flag + TID[:bool] + +

+ Setzt den »Hörgeschädigt«-Schalter für die angegebene Spur (siehe den + Abschnitt Spur-IDs), falls das + optionale Argument bool auf 1 + gesetzt oder nicht vorhanden ist. Kann gesetzt werden, wenn die Spur für + Hörgeschädigte geeignet ist. + +

+ + +

+ Diese Option kann mehrfach für eine Eingabedatei benutzt werden und gilt für + mehrere Spuren, indem jedesmal eine andere Spur-ID ausgewählt wird. + +

+ +
--visual-impaired-flag + TID[:bool] + +

+ Setzt den »Sehbehindert«-Schalter für die angegebene Spur (siehe den + Abschnitt Spur-IDs), falls das + optionale Argument bool nicht vorhanden ist. Kann + gesetzt werden, wenn die Spur für Sehbehinderte geeignet ist. + +

+ + +

+ Diese Option kann mehrfach für eine Eingabedatei benutzt werden und gilt für + mehrere Spuren, indem jedesmal eine andere Spur-ID ausgewählt wird. + +

+ +
--text-descriptions-flags + TID[:bool] + +

+ Setzt den »Textbeschreibung«-Schalter für die angegebene Spur (siehe den + Abschnitt Spur-IDs), falls das + optionale Argument bool auf 1 + gesetzt oder nicht vorhanden ist. Kann gesetzt werden, wenn die Spur eine + schriftliche Beschreibung des Videoinhalts enthält, die für die Wiedergabe + über ein Sprachsynthese-System für Sehbehinderte geeignet ist. + +

+ + +

+ Diese Option kann mehrfach für eine Eingabedatei benutzt werden und gilt für + mehrere Spuren, indem jedesmal eine andere Spur-ID ausgewählt wird. + +

+ +
--original-flag + TID[:bool] + +

+ Setzt den »Originalsprache«-Schalter für die angegebene Spur (siehe den + Abschnitt Spur-IDs), falls das + optionale Argument bool auf 1 + gesetzt oder nicht vorhanden ist. Kann gesetzt werden, wenn die Spur in der + Originalsprache (nicht in einer Übersetzung) gehalten ist. + +

+ + +

+ Diese Option kann mehrfach für eine Eingabedatei benutzt werden und gilt für + mehrere Spuren, indem jedesmal eine andere Spur-ID ausgewählt wird. + +

+ +
--commentary-flag + TID[:bool] + +

+ Setzt den »Kommentar«-Schalter für die angegebene Spur (siehe den Abschnitt + Spur-IDs), falls das optionale + Argument bool auf 1 gesetzt oder + nicht vorhanden ist. Kann gesetzt werden, wenn die Spur Kommentare enthält. + +

+ + +

+ Diese Option kann mehrfach für eine Eingabedatei benutzt werden und gilt für + mehrere Spuren, indem jedesmal eine andere Spur-ID ausgewählt wird. + +

+ +
--track-name TID:Name + +

+ Setzt den Spurnamen für die angegebene Spur (siehe den Abschnitt Spur-IDs) auf + Name. + +

+ +
--language TID:Sprache + +

+ Setzt die Sprache der angegebenen Spur (siehe den Abschnitt Spur-IDs). Es sind sowohl ISO + 639-2-Sprachcodes als auch ISO 639-1-Ländercodes erlaubt. Die Ländercodes + werden automatisch in die Sprachcodes umgewandelt. Alle Sprachcodes + einschließlich ihrer ISO 639-2-Codes können mit der Option --list-languages + aufgeführt werden. + +

+ + +

+ Diese Option kann mehrfach für eine Eingabedatei benutzt werden und gilt für + mehrere Spuren, indem jedesmal eine andere Spur-ID ausgewählt wird. + +

+ +
-t, --tags + TID:Dateiname + +

+ Liest Tags für die Spur mit der Nummer TID aus der + Datei Dateiname. Einzelheiten finden Sie im + nachfolgenden Abschnitt über Tags. + +

+ +
--aac-is-sbr + TID[:0|1] + +

+ Teilt mkvmerge(1) mit, dass die Spur mit der ID TID + vom Typ SBR AAC ist (auch als HE-AAC oder + AAC+ bekannt). Diese Option wird benötigt, falls a) die + Quelldatei eine AAC-Datei ist (nicht + für eine Matroska(tm)-Datei) und b) die AAC-Datei + »SBR AAC«-Daten enthält. Der Grund für diesen Schalter ist, + dass es technisch unmöglich ist, normale AAC-Daten von + SBR AAC zu unterscheiden, ohne das komplette + AAC-Bild zu entschlüsseln. Da es mehrere Patentprobleme mit + AAC-Entschlüsselungsprogrammen gibt, wird mkvmerge(1) diese + Entschlüsselungsstufe niemals enthalten. Daher ist dieser Schalter für + SBR AAC-Dateien zwingend notwendig. Die resultierende Datei + kann möglicherweise nicht korrekt oder gar nicht wiedergegeben werden, wenn + der Schalter weggelassen wird. + +

+ + +

+ Falls die Quelldatei eine Matroska(tm)-Datei ist, sollte die + CodecID ausreichen, um SBR AAC zu + bestimmen. Falls die CodecID jedoch falsch ist, kann + der Schalter benutzt werden, um dies zu korrigieren. + +

+ + +

+ Falls mkvmerge(1) fälschlicherweise feststellt, dass eine + AAC SBR ist, können Sie + »:0« zur Spur-ID hinzufügen. + +

+ +
--audio-emphasis + TID:n|symbolischer-Name + +

+ Setzt die Vorverzerrung für die Audiospur mit der Spur-ID + TID. Der Modus kann entweder eine Zahl + n (bestimmte Werte zwischen 0 + und 16) oder ein symbolischer Name sein. Alle gültigen + Nummern & symbolische Namen können mit der Option --list-audio-emphasis + aufgelistet werden. + +

+ +
--reduce-to-core TID + +

+ Einige Audio-Codecs enthalten einen verlustbehafteten Kern und + implementieren verlustfreies Decodieren durch Erweiterungen. Diese Option + weist mkvmerge(1) an, nur den Kern zu kopieren, nicht aber die + Erweiterungen. Standardmäßig kopiert mkvmerge(1) sowohl den Kern als auch die + Erweiterungen. + +

+ + +

+ Momentan werden nur DTS-Spuren von dieser Option + beeinflusst. TrueHD-Spuren, die einen eingebetteten + AC-3-Kern enthalten, werden statt dessen als zwei einzelne + Spuren präsentiert, für die separat entschieden werden kann, welche kopiert + werden sollen. Bei DTS würde das nicht funktionen, da + HD-Erweiterungen nicht alleinstehend decodiert werden können – anders als + bei TrueHD-Daten. + +

+ +
--remove-dialog-normalization-gain + TID + +

+ Einige Audio-Codecs enthalten Kopfdatenfelder, die den Decoder oder das + Abspielprogramm anweisen, eine (normalerweise negative) Signalverstärkung + für Dialognormalisierung anzuwenden. Diese Option weist mkvmerge(1) an, diese + Signalverstärkung zu entfernen oder zu minimieren, indem die entsprechenden + Kopfdatenfelder verändert werden. + +

+ + +

+ Momentan werden nur AC-3-, DTS- und + TrueHD-Spuren von dieser Option beeinflusst. + +

+ +
--timestamps TID:Dateiname + +

+ Die Zeitstempel, die für eine bestimmte Spur-ID von + Dateiname benutzt werden, werden gelesen. Diese + Zeitstempel erzwingen das Überschreiben der normalerweise von mkvmerge(1) + berechneten Zeitstempel. Lesen Sie den Abschnitt über externe + Zeitstempeldateien. + +

+ +
--default-duration TID:x + +

+ Erzwingt, dass die Standarddauer einer gegebenen Spur den angegebenen Wert + annimmt. Außerdem werden die Zeitstempel der Spur so geändert, dass sie zur + Standarddauer passen. Dem Argument x muss + »s«, »ms«, »us«, + »ns«, »fps«, »p« + oder »i« folgen, um die Dauer in Sekunden, Millisekunden, + Mikrosekunden, Nanosekunden, Bildern pro Sekunde, fortlaufenden Bildern pro + Sekunde beziehungsweise Halbbildern pro Sekunde anzugeben. Die Zahl + x selbst kann eine Fließkommazahl oder ein Bruch + sein. + +

+ + +

+ Falls die Standarddauer nicht erzwungen wird, dann wird mkvmerge(1) + versuchen, die Standarddauer der Spur, des Containers und/oder des codierten + Bitstroms bei bestimmten Spurtypen, z.B. AVC/H.264 oder MPEG-2, abzuleiten. + +

+ + +

+ Diese Option kann auch benutzt werden, um die BpS von + Videospuren zu ändern, ohne eine externe Zeitstempeldatei zu verwenden. + +

+ +
--fix-bitstream-timing-information + TID[:0|1] + +

+ Normalerweise ändert mkvmerge(1) nicht die Zeiteinteilungsinformation + (Bild-/Feldrate), die im Video-Bitstrom gespeichert ist. Mit dieser Option + wird diese Information angepasst, damit sie zur Zeiteinteilungsinformation + des Containers passt. Die Zeiteinteilungsinformation des Containers kann aus + verschiedenen Quelle stammen: von der Befehlszeile (siehe die Option --default-duration), + dem Quell-Container oder kann aus dem Bitstrom abgeleitet sein. + +

+ + +
+

Note:

+ +

Dies wurde bisher nur für AVC/H.264-Videospuren implementiert.

+ +
+ +
--compression TID:n + +

+ Wählt die Komprimierungsmethode aus, die für diese Spur benutzt + wird. Beachten Sie, dass das Abspielprogramm diese Methode ebenfalls + unterstützen muss. Gültige Werte sind »none«, + »zlib« und + »mpeg4_p2«/»mpeg4p2«. + +

+ +

+ Die Komprimierungsmethode + »mpeg4_p2«/»mpeg4p2« ist eine + besondere Komprimierungsmethode, genannt »Kopfdaten entfernen«, die nur für + MPEG4-Teil-2-Videospuren verfügbar ist. + +

+ +

+ Für einige Untertiteltypen ist die Voreinstellung + »zlib«-Komprimierung. Diese Komprimierungsmethode ist + außerdem jene, die die meisten, wenn nicht sogar alle Abspielprogramme + unterstützen. Für andere Komprimierungsmethoden außer + »none« kann keine Unterstützung zugesichert werden. + +

+ +
+ + + +

2.8. Optionen, die nur für Videospuren gelten

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc + TID:FourCC + +

+ Erzwingt, dass FourCC den angegebenen Wert annimmt; + funktioniert nur bei Videospuren im »MS-Kompatibilitätsmodus«. + +

+ +
--display-dimensions TID:BreitexHöhe + +

+ Matroska(tm)-Dateien enthalten zwei Werte, die die Anzeigeeigenschaften + setzen, auf die ein Abspielprogramm das Bild bei der Wiedergabe skalieren + sollte: Anzeigebreite und Anzeigehöhe. Diese Werte können mit dieser Option + gesetzt werden, z.B. »1:640x480«. + +

+ + +

+ Eine weitere Möglichkeit, die Werte anzugeben, ist die Verwendung der Option + --aspect-ratio + oder --aspect-ratio-factor + (siehe unten). Diese Optionen schließen sich gegenseitig aus. + +

+ +
--aspect-ratio + TID:Verhältnis|Breite/Höhe + +

+ Matroska(tm)-Dateien enthalten zwei Werte, die die Anzeigeeigenschaften + setzen, auf die ein Abspielprogramm das Bild bei der Wiedergabe skalieren + sollte: Anzeigebreite und Anzeigehöhe. Mit dieser Option wird mkvmerge(1) + automatisch die Anzeigebreite und Anzeigehöhe basierend auf der + Originalbreite und -höhe berechnen und das mit dieser Option angegebene + Seitenverhältnis berücksichtigen. Das Verhältnis kann entweder als + Fließkommazahl Verhältnis oder als Bruch + »Breite/Höhe«, + z.B. »16/9«, angegeben werden. + +

+ + +

+ Eine weitere Möglichkeit, die Werte anzugeben, ist die Verwendung der Option + --aspect-ratio-factor + oder --display-dimensions + (siehe oben und unten). Diese Optionen schließen sich gegenseitig aus. + +

+ +
--aspect-ratio-factor TID:Faktor|n/d + +

+ Eine weitere Möglichkeit, das Seitenverhältnis zu setzen, ist die Angabe + eines Faktors. Das Originalseitenverhältnis wird + zuerst mit diesem Faktor multipliziert und hinterher + als Zielseitenverhältnis benutzt. + +

+ + +

+ Eine weitere Möglichkeit, die Werte anzugeben, ist die Verwendung der Option + --aspect-ratio + oder --display-dimensions + (siehe oben). Diese Optionen schließen sich gegenseitig aus. + +

+ +
--cropping + TID:links,oben,rechts,unten + +

+ Setzt die Parameter für das Abschneiden von Bildpunkten einer Videospur auf + die angegebenen Werte. + +

+ +
--color-matrix-coefficients TID:n + +

+ Setzt die Matrix-Koeffizienten des Videos, die benutzt werden, um + Helligkeits- und Farbton-/Sättigungs-Werte von den Primärfarben Rot, Grün + und Blau abzuleiten. Der Parameter n ist eine + Ganzzahl zwischen 0 und 10 + inklusive. + +

+ + +

+ Gültige Werte und ihre Bedeutung sind: + +

+ + +

+ 0: GBR, 1: BT709, + 2: nicht spezifiziert, 3: + reserviert, 4: FCC, 5: BT470BG, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 nicht + konstante Helligkeit, 10: BT2020 konstante Helligkeit + +

+ +
--color-bits-per-channel TID:n + +

+ Setzt die Anzahl codierter Bits für einen Farbkanal. Der Wert + 0 zeigt an, dass die Anzahl nicht spezifiziert ist. + +

+ +
--chroma-subsample TID:hori,vert + +

+ Die Anzahl der in den Cr- und Cb-Kanälen horizontal und vertikal zu + entfernenden Pixel für jeden nicht entfernten Pixel. + +

+ + +

+ Beispiel: Für ein Video mit 4:2:0-Farbon-/Sättigungs-Unterabtastung sollte + der Parameter auf + TID:1,1 + gesetzt werden. + +

+ +
--cb-subsample TID:hori,vert + +

+ Die Anzahl der im Cb-Kanal horizontal und vertikal zu entfernenden Pixel für + jeden nicht entfernten Pixel. Dies gilt zuzüglich zu + --chroma-subsample. + +

+ + +

+ Beispiel: für ein Video mit 4:2:1-Farbon-/Sättigungs-Unterabtastung sollte + der Parameter --chroma-subsample auf + TID:1,0 + und Cb-Unterabtastung auf + TID:1,0 + gesetzt werden. + +

+ +
--chroma-siting TID:hori,vert + +

+ Setzt, wie Farbton/Sättigung horizontal und vertikal positioniert ist + (0: nicht spezifiziert, 1: oben + angeordnet, 2: halb). + +

+ +
--color-range TID:n + +

+ Setzt das Abschneiden des Farbbereiches (0: nicht + spezifiziert, 1: Broadcast-Bereich, + 2: voller Bereich (kein Abschneiden), + 3: durch Matrix-Koeffizienten/Transfer-Charakteristiken + definiert). + +

+ +
--color-transfer-characteristics + TID:n + +

+ Die Charakteristiken der Farbton-Übertragung. + +

+ + +

+ Gültige Werte und ihre Bedeutung sind: + +

+ + +

+ 0: reserviert, 1: ITU-R BT.709, + 2: nicht spezifiziert, 3: + reserviert, 4: Gamma-2.2-Kurve, 5: + Gamma-2.8-Kurve, 6: SMPTE 170M, 7: + SMPTE 240M, 8: linear, 9: + logarithmisch, 10: logarithmisch Quadratwurzel, + 11: IEC 61966-2-4, 12: ITU-R + BT.1361 erweiterte Farbskala, 13: IEC 61966-2-1, + 14: ITU-R BT.2020 10 bit, 15: + ITU-R BT.2020 12 bit, 16: SMPTE ST 2084, + 17: SMPTE ST 428-1; 18: ARIB + STD-B67 (HLG) + +

+ +
--color-primaries TID:n + +

+ Setzt die Primärfarben des Videos. + +

+ + +

+ Gültige Werte und ihre Bedeutung sind: + +

+ + +

+ 0: reserviert, 1: ITU-R BT.709, + 2: nicht spezifiziert, 3: + reserviert, 4: ITU-R BT.470M, 5: + ITU-R BT.470BG, 6: SMPTE 170M, 7: + SMPTE 240M, 8: FILM, 9: ITU-R + BT.2020, 10: SMPTE ST 428-1, 22: + JEDEC P22 phosphors + +

+ +
--max-content-light TID:n + +

+ Maximale Helligkeit eines einzelnen Pixels (maximales Lichtlevel des + Inhalts) in Candela pro Quadratmeter (cd/m²). Der Wert + n sollte eine nicht negative ganze Zahl sein. + +

+ +
--max-frame-light TID:n + +

+ Maximaler Durchschnittswert für das Lichtlevel eines vollen Bildes in + Candela pro Quadratmeter (cd/m²). Der Wert n sollte + eine nicht negative ganze Zahl sein. + +

+ +
--chromaticity-coordinates + TID:rot-x,rot-y,grün-x,grün-y,blau-x,blau-y + +

+ Setzt die Rot-/Grün-/Blau-Koordinaten für Farbton & Sättigung, wie sie + in CIE 1931 definiert werden. + +

+ +
--white-color-coordinates TID:x,y + +

+ Setzt die Koordinaten der weißen Farbe, wie sie in CIE 1931 definiert sind. + +

+ +
--max-luminance TID:Fließkommazahl + +

+ Setzt die maximale Helligkeit in Candela pro Quadratmeter (cd/m²). Der Wert + sollte kleiner als 9999.99 sein. + +

+ +
--min-luminance TID:Fließkommazahl + +

+ Setzt die minimale Helligkeit in Candela pro Quadratmeter (cd/m²). Der Wert + sollte kleiner als 999.9999 sein. + +

+ +
--projection-type TID:Methode + +

+ Setzt die benutzte Videoprojektionsmethode. Gültige Werte sind 0 + (Rektangularprojektion), 1 (gleichseitige Rektangularprojektion), 2 + (Würfelprojektion) und 3 (Gitterprojektion). + +

+ +
--projection-private TID:Daten + +

+ Setzt private Daten, die nur zu einer bestimmten Projektion gehören. Die + Daten müssen als Hexadezimalzahlen mit oder ohne Präfix »0x«, mit oder ohne + Leerzeichen angegeben werden. + +

+ +
--projection-pose-yaw + TID:Fließkommazahl + +

+ Gibt einen Gierwinkel zur Projektion an. + +

+ +
--projection-pose-pitch + TID:Fließkommazahl + +

+ Gibt einen Drehwinkel zur Projektion an. + +

+ +
--projection-pose-roll + TID:Fließkommazahl + +

+ Gibt einen Rollwinkel zur Projektion an. + +

+ +
--field-order TID:n + +

+ Setzt die Feldreihenfolge für die Videospur mit der Spur-ID + TID. Die Reihenfolge muss eine der folgenden Zahlen + sein: + +

+ + +

+ 0: progressiv; 1: + Halbbildverfahren mit oberem Feld zuerst angezeigt und oberem Feld zuerst + gespeichert; 2: nicht spezifizierte Feldreihenfolge; + 6: Halbbildverfahren mit unterem Feld zuerst angezeigt + und unterem Feld zuerst gespeichert; 9: + Halbbildverfahren mit unterem Feld zuerst angezeigt und oberem Feld zuerst + gespeichert; 14: Halbbildverfahren mit oberem Feld + zuerst angezeigt und unterem Feld zuerst gespeichert + +

+ +
--stereo-mode + TID:n|symbolischer-Name + +

+ Setzt den Stereomodus für die Videospur mit der Spur-ID + TID. Der Modus kann entweder eine Zahl + n zwischen 0 und + 14 oder ein symbolischer Name sein. Alle gültigen + Nummern & Namen können mit der Option --list-stereo-mdoes + aufgelistet werden. + +

+ +
+ + + +

2.9. Optionen, die nur für Untertitelspuren gelten

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset TID:Zeichensatz + +

+ Setzt den Zeichensatz für die Umwandlung nach UTF-8 für UTF-8-Untertitel der + angegebenen Spur-ID. Ist er nicht angegeben, wird der Zeichensatz von den + aktuellen Locale-Einstellungen abgeleitet. Beachten Sie, dass für + Untertitel, die aus Matroska(tm)-Dateien oder Kate-Datenströmen stammen, kein + Zeichensatz erforderlich ist, da diese immer in UTF-8 gespeichert + werden. Ein Erklärung, wie mkvmerge(1) Zeichensätze umwandelt, finden Sie im + Abschnitt über Textdateien + und Zeichensätze. + +

+ + +

+ Diese Option kann mehrfach für eine Eingabedatei benutzt werden und gilt für + mehrere Spuren, indem jedesmal eine andere Spur-ID ausgewählt wird. + +

+ +
+ + + +

2.10. Weitere Optionen

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify + Dateiname + +

+ Wird mkvmerge(1) veranlassen, die einzelne Datei eingehend zu untersuchen und + ihren Typ, die in der Datei enthaltenen Spuren und ihre Spur-IDs zu + melden. Falls diese Option benutzt wird, ist der Dateiname die einzige + weitere erlaubte Option. + +

+ + +

Das für die Ergebnisse benutze Ausgabeformat kann mit der Option --identification-format + geändert werden. +

+ +
-J Dateiname + +

+ Dies ist ein bequemer Alias für "--identification-format json + --identify Dateiname". + +

+ +
-F, --identification-format + Format + +

+ Legt das Format für die Ausgabe der Option --identify + fest. Die folgenden Formate werden unterstützt: text (das + Standardformat, wenn diese Option nicht genutzt wird) und + json. + +

+ + +
    + +
  1. + +

    Das Format text ist kurz und menschenlesbar. Es aus einer + Zeile pro gefundenem Element (Container, Spuren, Anhänge etc.). +

    + + +

    Dieses Format wurde nicht dafür entworfen, geparset zu werden. Die Ausgabe + wird in die von mkvmerge(1) benutzte Sprache übersetzt (siehe auch --ui-language). +

    + +
  2. + + +
  3. + +

    + Das Format json ist eine maschinenlesbares + JSON-Repräsentation. Dieses Format folgt dem JSON-Schema, das in der + folgenden Datei beschrieben wird: + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + Alle Versionen des JSON-Schemas sind sowohl online als auch in den + veröffentlichen Quellcodearchiven verfügbar. + +

    + +
  4. + +
+ +
--probe-range-percentage Prozentsatz + +

+ Dateitypen wie MPEG Programm- und Transportströme (.vob, + .m2ts) erfordern, dass eine gewisse Menge Daten + untersucht werden, um alle Spuren zu erkennen, die in der Datei enthalten + sind. Diese Menge ist standardmäßig 0.3% der Quelldateigröße bzw. 10 MB, je + nachdem, welcher Werte höher ist. + +

+ + +

+ Falls Spuren bekanntermaßen enthalten sind aber nicht gefunden werden, so + kann der zu untersuchende Prozentsatz hier geändert werden. Das Minimum von + 10 MB ist fest eingebaut und kann nicht geändert werden. + +

+ +
--list-audio-emphasis + +

+ Listet alle gültigen Nummern & ihre entsprechenden symbolischen Namen + für die Option --audio-emphasis + auf." + +

+ +
--list-languages + +

+ Führt alle Sprachen und ihren ISO 639-2-Code auf, die mit der Option --language + benutzt werden können. + +

+ +
--list-stereo-modes + +

+ Listet alle gültigen Nummern & ihre entsprechenden symbolischen Namen + für die Option --stereo-mode + auf." + +

+ +
-l, --list-types + +

+ Führt unterstützte Eingabedateitypen auf. + +

+ +
--priority Priorität + +

+ Setzt die Prozesspriorität, mit der mkvmerge(1) ausgeführt wird. Gültige + Werte sind »lowest«, »lower«, + »normal«, »higher« und + »highest«. Falls nichts angegeben wurde, wird + »normal« benutzt. Auf Unix-ähnlichen Systemen wird + mkvmerge(1) die Funktion + nice(2) + verwenden. Daher kann man »higher« und + »highest« nur mit erhöhten Rechten nutzen. Auf Windows + sind alle Werte unabhängig der Rechte nutzbar. + +

+ + +

Die Auswahl von »lowest« veranlasst mkvmerge(1) außerdem, + zusätzlich zur niedrigsten möglichen Prozesspriorität eine + Leerlauf-E/A-Priorität zu wählen. +

+ +
--command-line-charset Zeichensatz + +

+ Setzt den Zeichensatz, um auf der Befehlszeile angegebene Zeichenketten + umzuwandeln. Voreinstellung ist der Zeichensatz der aktuellen Locale des + Systems. Diese Einstellung gilt für Argumente der folgenden Optionen: --title, --track-name + und --attachment-description. + +

+ +
--output-charset Zeichensatz + +

+ Setzt den Zeichensatz, in den Zeichenketten zur Ausgabe umgewandelt + werden. Voreinstellung ist der Zeichensatz der aktuellen Locale des Systems. + +

+ +
-r, --redirect-output + Dateiname + +

+ Schreibt alle Nachrichten in die Datei Dateiname + statt auf die Konsole. Obwohl dies einfach durch Ausgabeumleitung erledigt + werden kann, gibt es Fälle, in denen diese Option benötigt wird: wenn das + Terminal die Ausgabe vor dem Schreiben in eine Datei neu auswertet. Der mit + --output-charset + gesetzte Zeichensatz wird dabei berücksichtigt. + +

+ +
--flush-on-close + +

+ Weist mkvmerge an, alle gepufferten Daten auf den Datenspeicher zu + schreiben, wenn eine zum Schreiben geöffnete Datei geschlossen wird. Das + kann benutzt werden, um Datenverlust bei Stromausfall vorzubeugen oder + bestimmte Probleme im Betriebssystem oder Treibern zu vermeiden. Der + Nachteil ist, dass das Multiplexen länger dauert, da mkvmerge vor dem + Beenden wartet, bis alle Daten auf den Datenspeicher geschrieben wurden. + Siehe Probleme #2469 und #2480 im MKVToolNix-Bugtracker für eine + tiefergehende Diskussion der Vor- und Nachteile. + +

+ +
--ui-language Code + +

+ Erzwingt, dass die Übersetzungen für die Sprache Code + benutzt werden (z.B. »de_DE« für die deutschen + Übersetzungen). Bei der Eingabe von »list« als + Code gibt das Programm eine Liste der verfügbaren + Übersetzungen aus. + +

+ +
--abort-on-warnings + +

+ Weist das Programm an abzubrechen, nachdem die erste Warnung ausgegeben + wurde. Der Rückgabewert des Programms wird in dem Fall 1 sein. + +

+ +
--deterministic Initialwert + +

+ Aktiviert das Erzeugen von Byte für Byte identischen Dateien, sofern die + selbe Version von mkvmerge(1) mit den selben Quelldateien, den selben + Optionen und dem selben Initialwert benutzt werden. Beachten Sie, dass das + "Datum"-Segment-Informationen-Feld in diesem Modus nicht geschrieben wird. + +

+ + +

Der Initialwert kann eine beliebige Zeichenkette und muss keine Zahl sein.

+ + +

+ Das Ergebnis von Byte für Byte identischen Dateien wird nur unter den + folgenden Bedingungen garantiert: + +

+ + +
    + +
  1. + +

    Die selbe Version von mkvmerge(1), gebaut mit den selben Versionen von + libEBML und libMatroska, wird benutzt. +

    + +
  2. + + +
  3. + +

    Die Quelldateien sind Byte für Byte identisch.

    + +
  4. + + +
  5. + +

    Die selben Kommandozeilenoptionen werden in der selben Reihenfolge benutzt + (mit der expliziten Ausnahme der Option --output …). +

    + +
  6. + +
+ + +

+ Die Nutzung anderer Versionen von mkvmerge(1) oder andere + Kommandozeilenoptionen kann ebenfalls zu einer Byte für Byte identischen + Datei führen, was aber nicht garantiert wird. + +

+ +
--debug Thema + +

+ Schaltet die Fehlersuche für eine bestimmte Funktionalität ein. Diese Option + ist nur für Entwickler nützlich. + +

+ +
--engage Funktionalität + +

+ Schaltet experimentelle Funktionalitäten ein. Eine Liste verfügbarer + Funktionalitäten kann mit mkvmerge --engage list + abgefragt werden. Diese Funktionalitäten sind nicht für die Verwendung in + Alltagssituationen gedacht. + +

+ +
--gui-mode + +

+ Schaltet den Modus für graphische Benutzeroberflächen an. In diesem Modus + können auf bestimmte Art formatierte Zeilen ausgegeben werden, die einem + aufrufenden Programm mitteilen, was mkvmerge(1) gerade tut. Diese Nachrichten + haben das folgende Format: '#GUI#Nachricht'. Der + Nachricht folgen potenziell Schlüssel/Wert-Paare wie + z.B. + '#GUI#Nachricht#schluessel1=wert1#schluessel2=wert2…'. + Weder die Nachricht selber noch die Schlüssel werden jemals übersetzt + sondern immer in Englisch ausgegeben. + +

+ +
@Optionsdatei.json + +

+ Liest zusätzliche Befehlszeilenargumente aus der Datei + Optionsdatei. Weitere Informationen finden Sie im + Abschnitt über Optionsdateien. + +

+ +
--capabilities + +

+ Führt Informationen über optionale Funktionalitäten auf, die einkompiliert + wurden, und beendet sich. Die erste ausgegebene Zeile wird die + Versionsinformation sein. Alle folgenden Zeilen enthalten genau ein Wort, + dessen Vorhandensein anzeigt, dass die Funktionalität einkompiliert + wurde. Diese Funktionalitäten sind: + +

+ + +
    + +
  • + +

    + »FLAC« – Lesen roher FLAC-Dateien und + Handhabung von FLAC-Spuren in anderen Containern, + z.B. Ogg(tm) oder Matroska(tm). + +

    + +
  • + +
+ +
-h, --help + +

+ Zeigt Benutzungsinformationen und beendet sich. + +

+ +
-V, --version + +

+ Zeigt Versionsinformationen und beendet sich. + +

+ +
+ + +

3. Aufruf

+ + +

+ Für jede Datei kann auswählt werden, welche Spuren mkvmerge(1) nehmen + soll. Sie alle werden in eine mit -o angegebene Datei + abgelegt. Eine Liste bekannter (und unterstützter) Quellformate kann mit der + Option -l abgefragt werden. + +

+ + +
+

Important:

+ +

+ Die Reihenfolge der Befehlszeilenoptionen ist wichtig. Bitte lesen Sie den + Abschnitt »Reihenfolge der + Optionen«, falls sie ein neuer Nutzer des Programms sind. + +

+ +
+ +

4. Reihenfolge der Optionen

+ + + +

+ Die Reihenfolge, in der die Optionen eingegeben werden, ist für einige + Optionen wichtig. Optionen fallen unter zwei Kategorien: + +

+ + +
    + +
  1. + +

    + Optionen, die das ganze Programm beeinflussen und nicht an irgendeine + Eingabedatei gebunden sind. Dies sind unter anderem + --command-line-charset, --output oder + --title. Diese können überall auf der Befehlszeile + erscheinen. + +

    + +
  2. + + +
  3. + +

    + Optionen, die eine einzelne Eingabedatei oder eine einzelne Spur in einer + Eingabedatei beeinflussen. Diese Optionen gelten für die auf der + Befehlszeile folgende Datei. Alle Optionen, die für dieselbe Eingabedatei + (oder für Spuren derselben Eingabedatei) gelten, können in jeder Reihenfolge + geschrieben werden, solange sie alle vor dem Namen dieser Eingabedatei + erschienen. Beispiele für Optionen, die für eine Eingabedatei gelten, sind + --no-chapters oder + --chapter-charset. Beispiele für Optionen, die für eine + einzelne Spur gelten, sind --default-duration oder + --language. + +

    + +
  4. + +
+ + +

+ Die Optionen werden von links nach rechts verarbeitet. Falls eine Option + mehrfach innerhalb desselben Geltungsbereichs erscheint, dann wird das + letzte Auftreten benutzt. Daher wird der Titel im folgenden Beispiel auf + »Etwas anderes« gesetzt: + +

+ +
$ mkvmerge -o Ausgabe.mkv --title 'Dies und das' Eingabe.avi --title 'Etwas anderes'
+ +

+ Das folgende Beispiel zeigt die zweimalige Verwendung der Option + --language, die in Ordnung ist, da sie in unterschiedlichen + Geltungsbereichen liegen. Obwohl sie für dieselbe Spur-ID gelten, gelten sie + für verschiedene Eingabedateien und haben daher unterschiedliche + Geltungsbereiche: + +

+ +
$ mkvmerge -o Ausgabe.mkv --language 0:fre français.ogg --language 0:deu deutsch.ogg
+

5. Beispiele

+ + +

+ Angenommen, Sie haben eine Datei namens MeinFilm.avi und die Tonspur in + einer separaten Datei, z.B. »MeinFilm.wav«. Als erstes + möchten Sie den Ton in OggVorbis(tm) codieren: + +

+ +
$ oggenc -q4 -oMeinFilm.ogg MeinFilm.wav
+ +

+ Nach ein paar Minuten können Sie Video und Ton kombinieren: + +

+ +
$ mkvmerge -o MeinFilm-mit-Ton.mkv MeinFilm.avi MeinFilm.ogg
+ +

+ Falls Ihr AVI bereits eine Tonspur enthält, dann wird sie + ebenfalls kopiert (wenn mkvmerge(1) das Audioformat unterstützt). Um dies zu + verhindern, tun Sie einfach Folgendes: + +

+ +
$ mkvmerge -o MeinFilm-mit-Ton.mkv -A MeinFilm.avi MeinFilm.ogg
+ +

+ Nach einigen Minuten Überlegung rippen Sie eine andere Tonspur, z.B. die + Kommentare des Regisseurs oder eine weitere Sprache für + MeinFilm-fügt-Ton-hinzu.wav. Codieren Sie ihn erneut und + kombinieren Sie ihn mit der anderen Datei: + +

+ +
$ oggenc -q4 -oMeinFilm-fügt-Ton-hinzu.ogg MeinFilm-fügt-Ton-hinzu.wav
+$ mkvmerge -o MM-komplett.mkv MeinFilm-mit-Ton.mkv MeinFilm-fügt-Ton-hinzu.ogg
+ +

+ Dasselbe Ergegnis kann erzielt werden durch + +

+ +
$ mkvmerge -o MM-komplett.mkv -A MeinFilm.avi MeinFilm.ogg MeinFilm-fügt-Ton-hinzu.ogg
+ +

+ Werfen Sie nun mplayer(tm) an und genießen Sie. Falls + Sie mehrere Tonspuren (oder sogar Videospuren) haben, dann können Sie + mplayer(tm) mit den Optionen »-vid + und »-aid« sagen, welche Spuren er abspielen soll. Diese + sind nullbasiert und unterscheiden nicht zwischen Video und Ton. + +

+ + +

+ Falls Sie eine synchronisierte Tonspur benötigen, können Sie dies einfach + erledigen. Finden Sie zuerst die Spur-ID der Vorbis-Spur heraus mittels + +

+ +
$ mkvmerge --identify Unsynchron.ogg
+ +

+ Nun können Sie diese ID in der folgenden Befehlszeile benutzen: + +

+ +
$ mkvmerge -o Synchron.mkv -A Quelle.avi -y 12345:200 Unsynchron.ogg
+ +

+ Dies würde 200 ms Stille an den Anfang der Tonspur mit der ID + 12345, die aus »Unsynchron.ogg« + stammt, hinzufügen. + +

+ + +

+ Einige Filme starten korrekt synchronisiert, verlieren jedoch langsam ihre + Synchronisierung. Für diese Art von Filmen können Sie einen + Verzögerungsfaktor angeben, der für alle Zeitstempel gilt – es werden keine + Daten hinzugefügt oder entfernt. Falls Sie diesen Faktor zu groß oder zu + klein wählen, erhalten Sie schlechte Ergebnisse. Ein Beispiel war eine + umcodierte Episode, die am Ende des 77340 Bilder langen + Films um 0,2 Sekunden von der Synchronizität + abwich. Bei 29,97 BpS entsprechen + 0,2 Sekunden ungefähr 6 + Bildern. Also machte ich Folgendes: + +

+ +
$ mkvmerge -o Synchron.mkv -y 23456:0,77346/77340 Unsynchron.mkv
+ +

+ Das Resultat war gut. + +

+ + +

+ Die Synchronisationsoptionen können auf die gleiche Weise auch für + Untertitel benutzt werden. + +

+ + +

+ Für Textuntertitel können Sie entweder irgendwelche Windows-Software (wie + SubRipper(tm)) oder das Paket + subrip(tm) nehmen, das Sie in den Quellen von + transcode(1) + im Verzeichnis »contrib/subrip« finden. Allgemein läuft + dies so ab: + +

+ + +
    + +
  1. + +

    Extrahieren eines rohen Untertiteldatenstroms aus der Quelle:

    +
    $ tccat -i /Pfad/zur/kopierten/DVD/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o MeinFilm
    +
  2. + + +
  3. + +

    Umwandlung der resultierenden PGM-Bilder in Text mit Gocr:

    +
    $ pgm2txt MeinFilm
    +
  4. + + +
  5. + +

    Rechtschreibprüfung der resultierenden Textdateien:

    +
    $ ispell -d american *txt
    +
  6. + + +
  7. + +

    Umwandlung der Textdateien in eine SRT-Datei:

    +
    $ srttool -s -w -i MeinFilm.srtx -o MeinFilm.srt
    +
  8. + +
+ + +

+ Die resultierende Datei kann als weitere Eingabedatei für mkvmerge(1) benutzt + werden: + +

+ +
$ mkvmerge -o MeinFilm.mkv MeinFilm.avi MeinFilm.srt
+ +

+ Falls Sie die Sprache für eine gegebene Spur angeben möchten, geht dies + einfach. Finden Sie zuerst den ISO 639-2-Sprachcode Ihrer Sprache + heraus. mkvmerge(1) kann all diese Codes für Sie aufführen: + +

+ +
$ mkvmerge --list-languages
+ +

+ Durchsuchen Sie die Liste nach den Sprachen, die Sie benötigen. Angenommen, + Sie haben zwei Tonspuren in eine Matroska(tm)-Datei abgelegt, möchten ihre + Sprachcodes setzen und wollen, dass ihre Spur-IDs 2 und 3 sind. Dies können + Sie wie folgt erreichen: + +

+ +
$ mkvmerge -o mit-Sprachcodes.mkv --language 2:ger --language 3:dut ohne_Sprachcodes.mkv
+ +

+ Wie Sie sehen, können Sie den Schalter --language + mehrfach verwenden. + +

+ + +

+ Vielleicht wollen Sie auch, dass das Abspielprogramm die niederländische + Sprache als Standardsprache verwendet. Sie haben außerdem zusätzliche + Untertitel, z.B. auf Englisch und Französisch und möchten, dass das + Abspielprogramm sie standardmäßig auf Französisch anzeigt. Dies können Sie + wie folgt erreichen: + +

+ +
$ mkvmerge -o mit-Sprachcodes.mkv --language 2:ger --language 3:dut --default-track-flag 3 ohne-Sprachcodes.mkv --language 0:eng english.srt --default-track-flag 0 --language 0:fre french.srt
+ +

+ Falls Sie in der Ausgabe von mkvinfo(1) nicht die Sprache oder die + Standardspurschalter sehen, die Sie angegeben haben, dann lesen Sie bitte + den Abschnitt über Vorgabewerte. + +

+ + +

+ Schalten Sie die Komprimierung für eine Eingabedatei aus. + +

+ +
$ mkvmerge -o Unkomprimiert.mkv --compression -1:none MeinFilm.avi --compression -1:none MeinFilm.srt
+ +

6. Spur-IDs

+ + + +

6.1. Normale Spur-IDs

+ + + +

+ Einige der Optionen für mkvmerge(1) benötigen eine Spur-ID als Angabe, für + welche Spur sie gelten. Diese Spur-IDs werden durch die Leseprogramme beim + demuxen (Trennen der Datenströme) der aktuellen Datei oder wenn mkvmerge(1) + mit der Option --identify + aufgerufen wird, ausgegeben. Ein Beispiel für einer derartige Ausgabe: + +

+ +
$ mkvmerge -i v.mkv
+Datei »v.mkv«: Container: Matroska
+Spur-ID 0: Video (V_MS/VFW/FOURCC, DIV3)
+Spur-ID 1: Ton (A_MPEG/L3)
+ +

+ Verwechseln Sie nicht die Spur-IDs, die den Spuren zugewiesen sind, die in + der Ausgabe-MKV-Datei abgelegt wurden mit den Spur-IDs der + Eingabedateien. Nur die Spur-IDs der Eingabedateien werden für Optionen + benutzt, die diese Werte benötigen. + +

+ + +

+ Beachten Sie auch, dass jede Eingabedatei ihre eigene Gruppe von Spur-IDs + hat. Daher ändert sich die Spur-ID für die Datei + »Datei1.ext«, die von »mkvmerge + --identify« gemeldet wurde, nicht, unabhängig davon, wie viele + andere Eingabedateien es gibt oder an welcher Stelle + »Datei1.ext« benutzt wird. + +

+ + +

+ Spur-IDs werden wie folgt zugeteilt: + +

+ + +
    + +
  • + +

    + AVI-Dateien: Die Videospur hat die ID 0. Die Tonspuren + bekommen IDs in aufsteigender Reihenfolge, beginnend bei 1. + +

    + +
  • + + +
  • + +

    + AAC-, AC-3-, MP3-, + SRT- und WAV-Dateien: Die einzige »Spur« + der Datei erhält die ID 0. + +

    + +
  • + + +
  • + +

    + Die meisten anderen Dateien: Die Spur-IDs werden in der Reihenfolge + zugeteilt, in der die Spuren in der Datei gefunden werden, beginnend bei 0. + +

    + +
  • + +
+ + +

+ Die Optionen, die die Spur-IDs benutzen, enthalten in der Beschreibung + »TID«. Die folgenden Optionen verwenden die Spur-IDs + ebenfalls: --audio-tracks, --video-tracks, + --subtitle-tracks, --button-tracks und + --track-tags. + +

+ + + +

6.2. Spezielle Spur-IDs

+ + + +

+ Es gibt mehrere IDs, die eine spezielle Bedeutung haben und nicht in der + Ausgabe während der Identifikation auftauchen. + +

+ + +

+ Die spezielle Spur-ID »-1« ist ein Platzhalter und + wendet den angegebenen Schalter auf alle Spuren an, die aus einer + Eingabedatei gelesen werden. + +

+ + +

+ Die spezielle Spur-ID »-2« bezieht sich auf die Kapitel + einer Quelldatei. Momentan unterstützt nur die Option + --sync diese spezielle ID. Die Option + --chapter-sync … kann alternativ zu --sync + -2:… benutzt werden. + +

+ + +

7. Umgang mit Sprachen

+ + + +

+ Matroska(tm) unterstützt zwei unterschiedliche Elementtypen für Sprachen: das + veraltete "Language"-Element, das Codes nach ISO 639-2 alpha 3 enthält, und + neue "LanguageIETF"-Elemente, die IETF BCP 47 Sprachelemente enthalten. Alle + von mkvmerge(1) Optionen, die eine Sprache akzeptieren, akzeptieren BCP 47 + Sprachelemente. mkvmerge(1) leitet die Werte für veraltete + "Language"-Elemente von den BCP 47-Sprachelementen ab, wann immer das + möglich ist. + +

+ + +

+ Bei Dateiidentifizierung im JSON-Modus werden existierende + "LanguageIETF"-Spurkopfelemente als Spureigenschaft + language_ietf ausgegeben. + +

+ + +

+ Beim Schreiben einer Datei schreibt mkvmerge(1) immer die Elemente + "LanguageIETF", "ChapLanguageIETF" und "TagLanguageIETF" (die letzten beiden + nur, wenn Kapitel respektive Tags geschrieben werden). Zusätzlich zu diesen + Elementen werden auch die dazugehörigen veralteten Elemente geschrieben. Sie + werden auf den Wert des ISO 639-2-Anteils des BCP 47-Sprachelements + gesetzt. Beispielsweise: wenn die Spursprache auf + sr-Cyrl-RS gesetzt wird, wird "LanguageIETF" auf + sr-Cyrl-RS gesetzt und das veraltete "Language" auf + srp. + +

+ + +

+ Beim Lesen existierender Dateien (Matroska-Dateien, XML-Kapitel- oder + -Tag-Dateien etc.), die bereits "…LanguageIETF"-Elemente enthalten, werden + die existierenden Werte beibehalten. Andernfalls werden + "…LanguageIETF"-Elemente basierend auf Kommandozeilenoptionen und + existierenden, veralteten "…Language"-Elementen hinzugefügt. + +

+ + +

+ Das Erzeugen der neuen Elemente kann mit der Kommandozeilenoption + --disable-language-ietf vollständig deaktiviert werden. Sie + wirkt sich auf alle neuen Sprachelemente aus. + +

+ + +

+ Sie können die angewendete Normalisierungsmethode, die auf erweiterte + Sprach-Unter-Tags angewendet wird, mit der --normalize-language-ietf + auswählen. + +

+ +

8. Umwandlungen von Textdateien und Zeichensätzen

+ + +
+

Note:

+ +

+ Dieser Abschnitt gilt für alle Programme in MKVToolNix, wenn auch nur von + mkvmerge(1) die Rede ist. + +

+ +
+ + +

8.1. Einleitung

+ + +

+ Jedweder Text in einer Matroska(tm)-Datei wird in UTF-8 codiert. Das bedeutet, + dass mkvmerge(1) jede Textdatei, die es liest, ebenso wie jeden auf der + Befehlszeile angegebenen Text, von einem Zeichensatz nach UTF-8 umwandeln + muss. Im Umkehrschluss bedeutet das auch, dass die Ausgaben von mkvmerge(1) + von UTF-8 in diesen Zeichensatz zurück umgewandelt werden müssen, z.B. falls + eine nicht englische Übersetzung mit --ui-language + benutzt wird oder für einen Text, der aus einer Matroska(tm)-Datei stammt. + +

+ + +

+ mkvmerge(1) erledigt dies automatisch, basierend auf dem Vorhandensein einer + Byte-Reihenfolgenmarkierung, kurz BOM (Byte Order Marker) + oder der aktuellen Locale des Systems. Wie der Zeichensatz von der Locale + geschlussfolgert wird, hängt vom Betriebssystem ab, auf dem mkvmerge(1) + läuft. + +

+ + + +

8.2. Byte-Reihenfolge-Markierungen (engl. BOM)

+ + + +

+ Textdateien, die mit einem BOM beginnen, sind bereits in einer + Erscheinungsform von UTF codiert. mkvmerge(1) untersützt die folgenden fünf + Modi: UTF-8, UTF-16 Little und Big Endian sowie UTF-32 Little- und Big + Endian. Textdateien mit einem BOM werden automatisch in UTF-8 + umgewandelt. Alle Parameter, die andernfalls den Zeichensatz einer solchen + Datei ändern würden (z.B. --sub-charset), + werden stillschweigend irgnoriert. + +

+ + + +

8.3. Linux und Unixoide Betriebssysteme inklusive macOS

+ + + +

+ Auf UNIX-artigen Systemen benutzt mkvmerge(1) den Systemaufruf + setlocale(3), + der wiederum die Umgebungsvariablen LANG, + LC_ALL und LC_CYPE verwendet. Der + resultierende Zeichensatz stammt oft aus der UTF-8- oder der + ISO-8859-*-Familie und wird für alle Textdateitransaktionen und für das + Codieren aller Zeichenketten auf der Befehlszeile, sowie die Ausgabe an die + Konsole benutzt. + +

+ + + +

8.4. Windows

+ + + +

+ Unter Windows wird der für die Konvertierung von Textdateien benutzte + Zeichensatz durch einen Aufruf der Systemfunktion + GetACP() ermittelt. + +

+ + +

+ Das Auslesen der Kommandozeile geschieht mit der Funktion + GetCommandLineW(), die bereits eine + Unicode-Zeichenkette zurückliefert. Deshalb wird die Option + --command-line-charset unter Windows ignoriert. + +

+ + +

+ Die Konsolenausgabe umfasst drei Szenarien: + +

+ + +
    + +
  1. + +

    + Falls die Ausgabe mittels der Option --redirect-output + umgeleitet wurde, so ist der Zeichensatz UTF-8. Dies kann mit der Option + --output-charset + geändert werden. + +

    + +
  2. + + +
  3. + +

    + Falls die Ausgabe durch cmd.exe selber umgeleitet wurde, + wie z.B. mit mkvinfo file.mkv > info.txt, dann wird + immer der Zeichensatz UTF-8 benutzt, was nicht geändert werden kann. + +

    + +
  4. + + +
  5. + +

    + Wenn hingegen direkt auf die Konsole geschrieben wird, so wird die + Windows-Funktion WriteConsoleW() dafür benutzt, und die + Option --output-charset + wird ignoriert. Die Konsole sollte in der Lage sein, alle Unicode-Zeichen + auszugeben, für deren entsprechende Sprache Sprachunterstützung installiert + ist (z.B. könnten chinesische Zeichen in englischen Windows-Versionen nicht + ausgegeben werden). + +

    + +
  6. + +
+ + + +

8.5. Kommandozeilenoptionen

+ + + +

+ Die folgenden Optionen, die die Angabe des Zeichensatzes ermöglichen, + existieren: + +

+ + +
    + +
  • + +

    + --sub-charset + für Textuntertiteldateien und -spuren, die in Containerformaten gespeichert + sind, deren Zeichensatz nicht eindeutig bestimmt werden können + (z.B. OGG-Dateien), + +

    + +
  • + + +
  • + +

    + --chapter-charset + für Kapiteltextdateien, sowie Kapitel- und Dateititel, die in + Containerformaten gespeichert sind, deren Zeichensatz nicht eindeutig + bestimmt werden kann (z.B. Ogg-Dateien für Kapitelinformationen, Spur- und + Dateititel etc.; MP4-Dateien für Kapitelinformationen), + +

    + +
  • + + +
  • + +

    + --command-line-charset + für alle Zeichenketten auf der Befehlszeile, + +

    + +
  • + + +
  • + +

    + --output-charset + für alle auf die Konsole oder in eine Datei geschriebenen Zeichenketten, + falls die Ausgabe mit der Option --redirect-output + umgeleitet wurde. Auf anderen Systemen als Windows ist der + Standardzeichensatz derjenige, den das System aktuell verwendet. Unter + Windows ist der Standard sowohl für die Umleitung mittels --redirect-output + als auch durch cmd.exe selber, e.g. mkvinfo + file.mkv > info.txt, der Zeichensatz UTF-8. + +

    + +
  • + +
+ + +

9. Optionsdateien

+ + + +

+ Ein Optionsdatei ist eine Datei aus der mkvmerge(1) zusätzliche + Befehlszeilenargumente lesen kann. Diese kann benutzt werden, um bestimmte + Beschränkungen der Shell oder des Betriebssystems wie eine begrenzte Länge + der Befehlszeile zu umgehen, wenn externe Programme ausgeführt werden. + +

+ + +

+ Eine Options-Datei enthält Daten im JSON-Format. Ihr Inhalt muss aus einem + gültigen JSON-Array bestehen, das ausschließlich JSON-Zeichenketten + enthält. Der Kodierung der Datei muss UTF-8 sein. Die Datei sollte nicht mit + einer Byte-Reihenfolgemarkierung (BOM) beginnen; tut sie es + aber doch, so wird die Markierung übersprungen. + +

+ + +

+ Die Regeln für das Maskieren spezieller Zeichen innerhalb der JSON-Daten + sind diejenigen, die in der offiziellen JSON-Spezifikation (RFC 7159) genannt werden. + +

+ + +

+ Der Name der Optionsdatei selber muss auf der Kommandozeile mit einem + vorangestellten »@«-Zeichen angegeben werden. + +

+ + +

+ Die Befehlszeile »mkvmerge -o "Meine Datei.mkv" -A "ein Film.avi" + Ton.ogg« kann in die folgende JSON-Optionsdatei mit z.B. dem Namen + 'Optionen.json' umgewandelt werden: + +

+ +
[
+  "-o",
+  "c:\\Matroska\\meine Datei.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "ein Film.avi",
+  "Ton.ogg"
+]
+ +

+ Der entsprechende Befehl wäre dann »mkvmerge + @Optionen.json«. + +

+ +

10. Verknüpfen von Dateien

+ + +

+ Matroska(tm) unterstützt das Verknüpfen von Dateien, was einfach heißt, dass + eine bestimmte Datei der Vorgänger oder Nachfolger der aktuellen Datei + ist. Genauer ausgedrückt werden die Dateien nicht wirklich verknüpft, + sondern die Matroska(tm)-Segmente. Da die meisten Dateien wahrscheinlich nur + ein Matroska(tm)-Segment enthalten werden, benutzen die folgenden Erklärungen + den Begriff »Verknüpfen von Dateien«, obwohl es eigentlich »Verknüpfen von + Segmenten« heißen müsste. + +

+ + +

+ Jedes Segment wird durch eine eindeutige 128 Bit lange Segment-UID + bezeichnet. Diese UID wird automatisch von mkvmerge(1) erzeugt. Das + Verknüpfen wird in erster Linie durch Ablegen der Segment-UIDs (kurz: + SID) der vorherigen/nächsten Datei in die + Segmentkopfdateninformationen erledigt. mkvinfo(1) gibt diese + SIDs aus, falls es sie findet. + +

+ + +

+ Falls eine Datei in mehrere kleinere unterteilt wurde und Verknüpfen + verwendet wird, dann werden die Zeitstempel nicht wieder bei 0 beginnen. Sie + werden dort fortfahren, wo die letzte Datei aufhörte. Auf diese Weise wird + auch dann die absolute Zeit vorgehalten, wenn die vorhergehenden Dateien + nicht verfügbar sind (z.B. beim Übertragen). Falls kein Verknüpfen verwendet + wird, dann sollten die Zeitstempel für jede Datei bei 0 + beginnen. Standardmäßig verwendet mkvmerge(1) kein Verknüpfen von + Dateien. Falls Sie es einschalten möchten, können Sie dies mit der Option + --link einschalten. Diese Option ist nur nützlich, falls + das Aufteilen ebenfalls aktiviert ist. + +

+ + +

+ Unabhängig davon, ob Aufteilung aktiv ist oder nicht, kann man mkvmerge(1) + mitteilen, dass die erstellten Dateien mit speziellen SIDs + verknüpft werden sollen. Dies kann mit den Optionen + --link-to-previous und --link-to-next + erreicht werden. Diese Optionen akzeptieren eine + Segment-SID in dem von mkvinfo(1) ausgegebenen Format: 16 + hexadezimalen Zahlen zwischen 0x00 und + 0xff, denen jeweils »0x« + vorangestellt wurde, z.B. »0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e + 0xae 0x78 0xeb 0xb4 0x5e 0xca 0xb3 0x93«. Alternativ kann eine + kürzere Form benutzt werden: 16 hexadezimalen Zahlen zwischen + 0x00 und 0xff ohne das + vorangestellte »0x« und ohne die Leerzeichen, + z.B. »41da7366d9cfb21eae78ebb45ecab393«. + +

+ + +

+ Falls Aufteilen benutzt wird, dann wird die erste Datei mit der durch + --link-to-previous und die letzte mit der durch + --link-to-next angegebenen SID + verknüpft. Falls kein Aufteilen benutzt wird, dann wird die einzige + Ausgabedatei mit beiden SIDs verknüpft. + +

+ +

11. Vorgabewerte

+ + +

+ Die Matroska(tm)-Spezifikation legt fest, dass einige Elemente Vorgabewerte + haben. Normalerweise wird ein Element, um Platz zu sparen, nicht in die + Datei geschrieben, falls sein Wert dem Vorgabewert entspricht. Die Elemente, + die in der Ausgabe von mkvinfo(1) vielleicht vermisst werden, sind + Sprache und + Standardspurschalter. Der Vorgabewert für die + Sprache ist Englisch (»eng«) und + der Vorgabewert für den Standardspurschalter ist + true. Daher wird eine Spur, falls Sie + --language 0:eng dafür verwenden, nicht in der Ausgabe von + mkvinfo(1) erscheinen. + +

+ +

12. Anhänge

+ + +

+ Vielleicht wollen Sie ein paar Fotos zusammen mit Ihrer Matroska(tm)-Datei + aufbewahren oder Sie benutzen SSA-Untertitel und benötigen + eine bestimmte TrueType(tm)-Schrift, die wirklich + selten vorkommt. In diesen Fällen können Sie die Dateien an die + Matroska(tm)-Datei anhängen. Sie werden nicht nur an die Datei angehängt, + sondern darin eingebettet. Ein Abspielprogramm kann dann diese Dateien (im + Fall mit den Fotos) anzeigen oder sie zum Rendern der Untertitel (im Fall + mit der TrueType(tm)-Schrift) verwenden. + +

+ + +

+ Hier nun ein Beispiel, wie eine Foto und eine + TrueType(tm)-Schrift an die Ausgabedatei angehängt + werden: + +

+ +
$ mkvmerge -o Ausgabe.mkv -A Video.avi Ton.ogg \
+  --attachment-description "Die Band und ich hinter der Bühne bei einer kleinen Zusammenkunft" \
+  --attachment-mime-type image/jpeg \
+  --attach-file Die_Band_und_ich.jpg \
+  --attachment-description "Die wirkliche seltene und unglaublich gutaussehende Schrift" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file wirkliche_coole_Schrift.ttf
+ +

+ Falls eine Matroska(tm)-Datei, die Anhänge enthält, als Eingabedatei benutzt + wird, dann wird mkvmerge(1) die Anhänge in die neue Datei kopieren. Die + Auswahl, welche Anhänge kopiert werden, kann mit den Optionen --attachments + und --no-attachments + geändert werden. + +

+ +

13. Kapitel

+ + +

+ Das Matroska(tm)-Kapitelsystem ist leistungsfähiger als das alte bekannte + System, das von OGM-Dateien benutzt wird. Die vollständige + Spezifikation ist auf der + Matroska-Website zu finden. + +

+ + +

+ mkvmerge(1) unterstützt als Eingabe zwei Arten von Kapiteldateien. Das erste + Format, »einfaches Kapitelformat« genannt, ist dasselbe, das die + OGM-Werkzeuge erwarten. Das zweite Format ist ein + XML-basiertes Kapitelformat, das alle Kapitelfunktionalitäten von + Matroska(tm) unterstützt. + +

+ + +

+ Abgesehen von dedizierten Kapiteldateien kann mkvmerge(1) Kapitel auch aus + anderen Dateiformaten lesen (z.B. MP4, Ogg, Blu-rays oder DVDs). + +

+ + +

13.1. Das einfache Kapitelformat

+ + + +

+ Dieses Format besteht aus Zeilenpaaren, die mit + »CHAPTERxx=« beziehungsweise + »CHAPTERxxNAME=« beginnen. Das erste enthält den + Startzeitstempel, während das zweite den Titel enthält. Hier ein Beispiel: + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=Einleitung
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=Baby bereitet sich vor zu rocken
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=Baby stellt das Haus auf den Kopf
+ +

+ mkvmerge(1) wird jedes Zeilenpaar in ein + Matroska(tm)-ChapterAtom umwandeln. Es setzt keine + ChapterTrackNumber, was bedeutet, dass alle Kapitel + für alle Spuren in der Datei gelten. + +

+ + +

+ Falls dies eine Textdatei ist, muss möglicherweise eine Umwandlung des + Zeichensatzes durchgeführt werden. Eine Erklärung, wie mkvmerge(1) + Zeichensätze umwandelt, finden Sie im Abschnitt über Textdateien und + Zeichensätze. + +

+ + + +

13.2. Das XML-basierte Kapitelformat

+ + +

+ Das XML-basierte Kapitelformat sieht wie in diesem Beispiel aus: + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "Matroska-Kapitel.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>Ein kurzes Kapitel</ChapterString>
+        <ChapterLanguage>eng</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>Ein Teil dieses kurzen Kapitels</ChapterString>
+          <ChapterLanguage>eng</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ Mit diesem Format sind drei Dinge möglich, die mit dem einfachen + Kapitelformat nicht möglich sind: + +

+ + +
    + +
  1. +

    Der Zeitstempel für das Ende des Kapitels kann gesetzt werden.

    +
  2. + +
  3. +

    Kapitel können verschachtelt werden.

    +
  4. + +
  5. +

    Die Sprache und das Land können gesetzt werden.

    +
  6. + +
+ + +

+ Die Mkvtoolnix-Distribution enthält einige Beispieldateien im + Unterverzeichnis doc, die als Basis benutzt werden + können. + +

+ + +

+ Im Folgenden werden unterstützte XML-Tags, ihre Datentypen und, falls + zweckmäßig, der gültige Bereich für ihre Werte aufgeführt: + +

+ +
Chapters (master)
+  EditionEntry (master)
+    EditionUID (unsigned integer, valid range: 1 <= value)
+    EditionFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagDefault (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagOrdered (unsigned integer, valid range: 0 <= value <= 1)
+    ChapterAtom (master)
+      ChapterAtom (master)
+      ChapterUID (unsigned integer, valid range: 1 <= value)
+      ChapterTimeStart (unsigned integer)
+      ChapterTimeEnd (unsigned integer)
+      ChapterFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterFlagEnabled (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterSegmentUID (binary, valid range: 1 <= length in bytes)
+      ChapterSegmentEditionUID (unsigned integer, valid range: 1 <= value)
+      ChapterPhysicalEquiv (unsigned integer)
+      ChapterTrack (master)
+        ChapterTrackNumber (unsigned integer, valid range: 1 <= value)
+      ChapterDisplay (master)
+        ChapterString (UTF-8 string)
+        ChapterLanguage (UTF-8 string)
+        ChapterCountry (UTF-8 string)
+      ChapterProcess (master)
+        ChapterProcessCodecID (unsigned integer)
+        ChapterProcessPrivate (binary)
+        ChapterProcessCommand (master)
+          ChapterProcessTime (unsigned integer)
+          ChapterProcessData (binary)
+ + +

13.3. Kapitel von Blu-rays lesen

+ + + +

+ mkvmerge(1) kann Kapitel aus unverschlüsselten Blu-rays lesen. Dafür können + Sie den Pfad zu einer der MPLS-Abspiellisten mit dem Parameter + --chapters angeben. + +

+ + +

+ Beispiel: --chapters + /srv/blurays/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. Kapitel von DVDs lesen

+ + + +

+ Wenn MKVToolNix mit der libdvdread(tm)-Bibliothek + compiliert wurde, kann mkvmerge(1) Kapitel von DVDs lesen. Dafür können Sie + den Pfad zu einer der Dateien oder Ordner auf der DVD mit dem Parameter + --chapters angeben. Da DVDs mehr als einen Titel + enthalten können und jeder Titel seinen eigenen Satz an Kapitel enthält, + können Sie einen Doppelpunkt und die gewünschte Titelnummer an das Ende des + Dateinamenarguments anhängen. Die Titelnummer ist standardmäßig 1. + +

+ + +

+ Beispiel: --chapters /srv/dvds/BigBuckBunny/VIDEO_TS:2 + +

+ + + +

13.5. Allgemeine Hinweise

+ + +

+ Beim Aufteilen von Dateien wird mkvmerge(1) die Kapitel ebenfalls korrekt + anpassen. Dies bedeutet, dass jede Datei nur die Kapiteleinträge beinhaltet, + die für die gelten, und dass die Zeitstempel versetzt werden, damit sie zu + den neuen Zeitstempeln jeder Ausgabedatei passen. + +

+ + +

+ mkvmerge(1) kann Kapitel aus Matroska(tm)-Quelldateien kopieren, es sei denn, + dies wurde explizit mit der Option --no-chapters + deaktiviert. Die Kapitel aus allen Quellen (Matroska(tm)-Dateien, Ogg-Dateien, + MP4-Dateien, Kapiteltextdateien) werden üblicherweise nicht + zusammengefügt, landen aber in separaten + ChapterEditions. Nur falls Kapitel aus mehreren + Matroska(tm)- oder XML-Dateien gelesen werden, die dieselbe Fassung von UIDs + gemeinsam benutzen, werden Kapitel in eine einzige + ChapterEdition-Datei zusammengefügt. Falls ein + derartiges Zusammenfügen in anderen Situationen ebenfalls erwünscht ist, + dann müssen zuerst die Kapitel aus allen Quellen mit mkvextract(1) extrahiert + und die XML-Dateien manuell zusammenfügt werden, bevor sie hinterher + gemultiplext werden können. + +

+ + +

14. Tags

+ + + +

14.1. Einleitung

+ + + +

+ Matroska(tm)s Tag-System ist den von anderen Containern verwendeten Systemen + ähnlich: ein Satz aus SCHLÜSSEL=WERT-Paaren. In + Matroska(tm) können diese Tags jedoch ebenfalls verschachtelt werden, und + sowohl SCHLÜSSEL als auch WERT + sind Elemente für sich. Die Beispieldatei + example-tags-2.xml zeigt, wie dieses System benutzt + wird. + +

+ + + +

14.2. Geltungsbereich der Tags

+ + + +

+ Matroska(tm)-Tags gelten nicht automatisch für die gesamte Datei. Sie können, + aber sie können auch für unterschiedliche Teile der Datei gelten: für eine + oder mehrere Spuren, für ein oder mehrere Kapitel oder sogar für eine + Kombination von beiden. Die Matroska-Spezifikation + liefert weitere Einzelheiten zu diesem Umstand. + +

+ + +

+ Eine wichtige Tatsache ist, dass Tags mit Spuren oder Kapiteln anhand des + Tag-Elements Targets verknüpft werden und dass die + für diese Verknüpfungen verwendeten UIDs nicht die + sonst überall von mkvmerge(1) benutzten Spur-IDs sind. Stattdessen sind die + verwendeten Nummern die UIDs, die mkvmerge(1) automatisch berechnet (falls + die Spur aus einer Datei stammt, die ein anderes Format als Matroska(tm) hat) + oder die aus der Quelldatei kopiert wurden, falls die Quelldatei der Spur + eine Matroska(tm)-Datei ist. Daher ist es schwierig zu wissen, welche UIDs in + dem Tag benutzt werden sollen, bevor die Datei an mkvmerge(1) übergeben + wurde. + +

+ + +

+ mkvmerge(1) kennt zwei Optionen, mit denen Sie Matroska(tm)-Dateien Tags + hinzufügen können: die Optionen --global-tags + und --tags. Der + Unterschied besteht darin, dass erstere, --global-tags, + dafür sorgen wird, dass die Tags für die gesamte Datei gelten, indem diese + oben erwähnten Targets-Elemente entfernt werden. Die + letztere Option, --tags, fügt + automatisch die UID hinzu, die mkvmerge(1) für den mit dem + TID-Teil der Option --tags + angegebenen Tag erzeugt. + +

+ + + +

14.3. Beispiel

+ + +

+ Sagen wir mal, Sie möchten einer aus einem AVI gelesenen + Videospur Tags hinzufügen. mkvmerge --identify Datei.avi + teilt Ihnen mit, dass die ID der Videospur 0 ist (verwechseln Sie diese ID + nicht mit der UID). Deshalb erstellen Sie Ihre Tag-Datei, lassen alle + Targets-Elemente weg und rufen mkvmerge(1) auf: + +

+ +
$ mkvmerge -o Datei.mkv --tags 0:Tags.xml Datei.avi
+ + +

14.4. Format der Tag-Datei

+ + +

+ mkvmerge(1) unterstützt ein XML-basiertes Tag-Dateifomat. Das Format ist + sehr eng an die Matroska-Spezifikation + angelehnt. Sowohl die Binär- als auch die Quelldistribution von MKVToolNix + bringen eine Musterdatei namens example-tags-2.xml mit, + die einfach alle bekannten Tags aufführt und als Basis für Tag-Dateien in + der Praxis benutzt werden kann. + +

+ + +

+ Die Grundlagen sind: + +

+ + +
    + +
  • +

    Das äußerste Element muss <Tags> sein. +

    +
  • + +
  • + +

    Ein logischer Tag ist innerhalb eines Paares von + <Tag>-XML-Tags enthalten. +

    + +
  • + +
  • +

    Leerzeichen direkt vor und hinter Tag-Inhalt werden ignoriert.

    +
  • + +
+ + + +

14.5. Datentypen

+ + +

+ Das neue Tag-System vom Matroska(tm) kennt nur zwei Datentypen, eine + UTF-8-Zeichenkette und einen binären Typ. Erstere wird für den Namen und das + Element <String> des Tags benutzt, während der + binäre Typ für das Element <Binary> verwendet + wird. + +

+ + +

+ Da die binären Daten selbst nicht in eine XML-Datei passen würden, + unterstützt mkvmerge(1) zwei weitere Methoden zum Speichern binärer + Daten. Falls der Inhalt eines XML-Tags mit einem »@« + beginnt, wird der folgende Text als ein Dateiname angesehen. Der zugehörige + Inhalt der Datei wird in das Matroska(tm)-Element kopiert. + +

+ + +

+ Andernfalls wird erwartet, dass die Daten Base64-codiert vorliegen. Dies ist + eine Codierung, die binäre Daten in einen eingeschränkten Satz von + ASCII-Zeichen umwandelt und z.B. in E-Mail-Programmen + benutzt wird. mkvextract(1) wird für binäre Elemente Base64-codierte Daten + ausgeben. + +

+ + +

+ Das missbilligte Tag-System kennt ein paar weitere Datentypen, die in der + offiziellen Matroska(tm)-Tag-Spezifikation zu finden sind. Da mkvmerge(1) + dieses System nicht mehr unterstützt, werden diese Typen hier nicht + beschrieben. + +

+ + + +

14.6. Bekannte Tags des XML-Dateiformats

+ + + +

+ Im Folgenden werden unterstützte XML-Tags, ihre Datentypen und, falls + zweckmäßig, der gültige Bereich für ihre Werte aufgeführt: + +

+ +
Tags (master)
+  Tag (master)
+    Targets (master)
+      TargetTypeValue (unsigned integer)
+      TargetType (UTF-8 string)
+      TrackUID (unsigned integer)
+      EditionUID (unsigned integer)
+      ChapterUID (unsigned integer)
+      AttachmentUID (unsigned integer)
+    Simple (master)
+      Simple (master)
+      Name (UTF-8 string)
+      TagLanguage (UTF-8 string)
+      DefaultLanguage (unsigned integer)
+      String (UTF-8 string)
+      Binary (binary)
+ +

15. Segmentinformation

+ + + +

+ Mit einer Segmentinformations-XML-Datei ist es möglich, bestimmte Werte im + Kopffeld »segment information« einer Matroska(tm)-Datei zu setzen. Alle diese + Werte können nicht über andere Befehlszeilenoptionen gesetzt werden. + +

+ + +

+ Andere »segment information«s-Kopffelder können über Befehlszeilenoptionen + gesetzt werden, jedoch nicht über die XML-Datei. Dies umfasst z.B. die + Optionen --title und + --timestamp-scale. + +

+ + +

+ Es gibt andere Elemente, die weder über Befehlszeilenoptionen noch über die + XML-Dateien gesetzt werden können. Dies beinhaltet die folgenden Elemente: + DateUTC (auch als »muxing date« bekannt), + MuxingApp, WritingApp und + Duration. Sie werden immer von mkvmerge(1) selbst gesetzt. + +

+ + +

+ Im Folgenden werden unterstützte XML-Tags, ihre Datentypen und, falls + zweckmäßig, der gültige Bereich für ihre Werte aufgeführt: + +

+ +
Info (master)
+  SegmentUID (binary, valid range: length in bytes == 16)
+  SegmentFilename (UTF-8 string)
+  PreviousSegmentUID (binary, valid range: length in bytes == 16)
+  PreviousSegmentFilename (UTF-8 string)
+  NextSegmentUID (binary, valid range: length in bytes == 16)
+  NextSegmentFilename (UTF-8 string)
+  SegmentFamily (binary, valid range: length in bytes == 16)
+  ChapterTranslate (master)
+    ChapterTranslateEditionUID (unsigned integer)
+    ChapterTranslateCodec (unsigned integer)
+    ChapterTranslateID (binary)
+

16. Matroska-Dateilayout

+ + +

+ Das Matroska(tm)-Dateilayout ist ziemlich flexibel. mkvmerge(1) wird eine Datei + auf eine vordefinierte Art erzeugen. Die resultierende Datei sieht wie folgt + aus: + +

+ + +

+ [EBML head] [segment {meta seek #1} [segment information] [track + information] {attachments} {chapters} [cluster 1] {cluster 2} … {cluster n} + {cues} {meta seek #2} {tags}] + +

+ + +

+ Die Elemente in geschweiften Klammern sind optional und hängen vom Inhalt + und den benutzten Optionen ab. Ein paar Anmerkungen: + +

+ + +
    + +
  • + +

    + »meta seek #1« beinhaltet nur eine kleine Zahl von Elementen der Stufe eins + und das nur, falls sie tatsächlich existieren: Anhänge, Kapitel, Indizes, + Tags, »meta seek #2«. Ältere Versionen von mkvmerge(1) legten auch die + Cluster in dieses Metasuchelement ab. Daher wurden einige ungenaue Annahmen + nötig, um ausreichend Platz zu reservieren. Dies schlug oft fehl. Nun werden + nur die Cluster in »meta seek #2« gespeichert und »meta seek #1« verweist + auf das Metasuchelement #2. + +

    + +
  • + + +
  • + +

    Anhang-, Kapitel- und Tag-Elemente sind nur vorhanden, falls sie hinzugefügt + wurden. +

    + +
  • + +
+ + +

+ Die kürzest mögliche Matroska(tm)-Datei würde etwa so aussehen: + +

+ + +

+ [EBML head] [segment [segment information] [track information] [cluster 1]] + +

+ + +

+ Dies könnte bei reinen Tondateien der Fall sein. + +

+ +

17. Externe Zeitstempeldateien

+ + +

+ mkvmerge(1) erlaubt, die Zeitstempel für eine bestimmte Spur selbst + auszuwählen. Dies kann benutzt werden, um Dateien mit variabler + Videobildrate zu erstellen oder Lücken in den Ton einzuarbeiten. In diesem + Fall ist ein Bild die Einheit, die mkvmerge(1) separat pro Matroska(tm)-Block + erstellt. Für Video ist dies genau ein Bild, für Ton ist dies ein Paket des + speziellen Audiotyps. Dies wäre z.B. für AC-3 ein Paket, + das 1536-Samples enthält. + +

+ + +

+ Zeitstempeldateien, die benutzt werden, wenn Spuren aneinander angehängt + werden, dürfen nur für den ersten Teil in einer Kette von Spuren angegeben + werden. Falls Sie zum Beispiel zwei Dateien, v1.avi und v2.avi, anhängen und + dabei Zeitstempel verwenden möchten, muss Ihre Befehlszeile etwa so + aussehen: + +

+ +
$ mkvmerge … --timestamps 0:meine_Zeitstempel.txt v1.avi +v2.avi
+ +

+ Es gibt vier Formate, die mkvmerge(1) bekannt sind. Die erste Zeile enthält + immer die Versionsnummer. Leere Zeilen, Zeilen, die nur Leerräume enthalten + und Zeilen, die mit »#« beginnen, werden ignoriert. + +

+ + +

17.1. Zeitstempeldateiformat v1

+ + +

+ Dieses Format beginnt mit der Versionszeile. Die zweite Zeile deklariert die + Standardanzahl von Bildern pro Sekunde (BpS). Alle folgenden Zeilen + enthalten drei durch Kommas getrennte Zahlen: das Startbild + (0 ist das erste Bild), das Endbild und die Anzahl der + Bilder in diesem Bereich. Die BpS sind eine Fließkommazahl + mit dem Punkt ».« als Dezimalpunkt. Die Bereiche können + Lücken enthalten, für die die Standard-BpS benutzt + werden. Ein Beispiel: + +

+ +
# Zeitstempelformat v1
+assume 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. Zeitstempeldateiformat v2

+ + + +

+ In diesem Format enthält jede Zeile einen Zeitstempel für das zugehörige + Bild. Dieser Zeitstempel muss mit einer Genauigkeit von Millisekunden + angegeben werden. Er kann eine Fließkommazahl sein, muss aber nicht. Sie + müssen mindestens so viele Zeitstempelzeilen angeben, + wie es Bilder in der Spur gibt. Die Zeitstempel müssen sortiert + sein. Beispiel für 25 bps: + +

+ +
# Zeitstempelformat v2
+0
+40
+80
+ + +

17.3. Zeitstempeldateiformat v3

+ + +

+ In diesem Format enthält jede Zeile eine Dauer in Sekunden, gefolgt von + einer optionalen Zahl von Bildern pro Sekunde. Beide können Fließkommazahlen + sein. Falls die Zahl der Bilder pro Sekunde nicht vorliegt, wird die + Voreinstellung benutzt. Für Audio sollten Sie den Codec die Bildzeitstempel + selbst berechnen lassen. Dazu sollten Sie 0,0 als + Anzahl der Bilder pro Sekunde verwenden. Sie können auch Lücken im + Datenstrom erzeugen, indem Sie das Schlüsselwort »gap« + gefolgt von der Dauer der Lücke benutzen. Beispiel einer Audiodatei: + +

+ +
# Zeitstempelformat v3
+assume 0.0
+25.325
+7.530,38.236
+gap, 10.050
+2.000,38.236
+ + +

17.4. Zeitstempeldateiformat v4

+ + +

+ Dieses Format ist identisch mit dem Format v2. Der einzige Unterschied + besteht darin, dass Zeitstempel nicht sortiert werden müssen. Dieses Format + sollte so gut wie nie benutzt werden. + +

+ + +

18. Rückgabewerte

+ + + +

+ mkvmerge(1) beendet sich mit einem von drei Rückgabewerten: + +

+ + +
    + +
  • + +

    + 0 – dieser Rückgabewert bedeutet, dass das Muxing + erfolgreich abgeschlossen wurde. + +

    + +
  • + + +
  • + +

    + 1 – in diesem Fall hat mkvmerge(1) mindestens eine + Warnung ausgegeben, das Muxing wurde aber fortgesetzt. Einer Warnung wird + der Text »Warning:« vorangestellt. Abhängig von den + aufgetretenen Problemen können die resultierenden Dateien in Ordnung sein + oder nicht. Es wird nachdrücklich geraten, sowohl die Warnung als auch die + resultierende Datei zu überprüfen. + +

    + +
  • + + +
  • + +

    + 2 – dieser Rückgabewert wird benutzt, nachdem ein + Fehler aufgetreten ist. mkvmerge(1) wird gleich nach der Ausgabe der + Fehlermeldung abgebrochen. Fehlermeldungen reichen von falschen + Befehlszeilenargumenten über Lese-/Schreibfehler bis hin zu beschädigten + Dateien. + +

    + +
  • + +
+ +

19. Umgebungsvariablen

+ + + +

+ mkvmerge(1) verwendet die Standardvariablen, die die Locale des System + bestimmen (d.h. LANG und die + LC_*-Familie). Zusätzliche Variablen: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG und + ihre Kurzform MTX_DEBUG + +

Der Inhalt wird behandelt, als ob er mit der Option --debug + übergeben worden wäre. +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE und + ihre Kurzform MTX_ENGAGE + +

Der Inhalt wird behandelt, als ob er mit der Option --engage + übergeben worden wäre. +

+ +
+ +

20. Siehe auch

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. WWW

+ + +

+ Die neuste Version kann immer auf der MKVToolNix-Homepage gefunden + werden. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..2357bf910aba2d3a4898a15337e07b8770a8f5f4 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvpropedit.html @@ -0,0 +1,1355 @@ + + + + + mkvpropedit -- Ändert Eigenschaften von existierenden Matroska-Dateien ohne ein komplett + neues Muxing. + + + + +
mkvpropedit -- Ändert Eigenschaften von existierenden Matroska(tm)-Dateien ohne ein komplett + neues Muxing. +
+
+ +
+

1. Übersicht

+ + +
mkvpropedit Optionen {Quelldateiname} {Aktionen} +
+ +

2. Beschreibung

+ + +

+ Dieses Programm analysiert eine existierende Matroska(tm)-Datei und ändert + einige ihrer Eigenschaften. Dann schreibt es diese Änderungen in die + existierende Datei. Unter den Eigenschaften, die geändert werden können, + sind die Segmentinformationselemente (z.B. der Titel) und die + Spurenkopfdaten (z.B. der Sprachcode, der Scahlter »Standardspur« oder der + Name). + +

+ + +

+ Optionen: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ Führt alle bekannten und bearbeitbaren Eigenschaftsnamen, ihren Typ + (Zeichenkette, Ganzzahl, Boolean etc.) und eine kurze Beschreibung auf. Das + Programm beendet sich anschließend. Daher muss der Parameter + Quelldateiname nicht mitgegeben werden. + +

+ +
-p, --parse-mode + Modus + +

+ Setzt den Auswertungsmodus. Der Parameter Modus kann + entweder »fast« (was auch die Voreinstellung ist) oder + »full« sein. Der Modus »fast« wertet + nicht die ganze Datei aus, benutzt aber die Metasuchelemente zum Orten der + benötigten Elemente der Quelldatei. In 99% der Fälle reicht dies. Aber für + Dateien, die keine Metasuchelemente enthalten oder beschädigt sind, kann es + notwendig sein, dass der Auswertungsmodus »full« benutzt + wird. Ein vollständiger Scan einer Datei kann ein paar Minuten in Anspruch + nehmen, während ein schneller Scan nur Sekunden dauert. + +

+ +
+ + +

+ Aktionen, die mit Eigenschaften von Spur- und Segmentinformationen umgehen: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit Selektor + +

+ Setzt den Matroska(tm)-Dateiabschnitt (Segmentinformationen oder die Kopfdaten + einer bestimmten Spur), mit der alle nachfolgenden add-, set- und delete-Aktionen + arbeiten. Diese Option kann mehrfach benutzt werden, um Änderungen an mehr + als einem Element vorzunehmen. + +

+ + +

+ Standardmäßig wird mkvpropedit(1) den Segmentinformationsabschnitt + bearbeiten. + +

+ + +

+ Eine vollständige Beschreibung der Syntax finden Sie im Abschnitt über Selektoren zur Bearbeitung. + +

+ +
-a, --add + Name=Wert + +

+ Fügt die Eigenschaft Name mit dem Wert + Wert hinzu. Die Eigenschaft wird selbst dann + hinzugefügt, wenn eine derartige Eigenschaft bereits existiert. Beachten + Sie, dass die meisten Eigenschaften eindeutig sind und nicht öfter als + einmal auftreten können. + +

+ +
-s, --set + Name=Wert + +

+ Setzt alle Vorkommen der Eigenschaft Name auf den + Wert Wert. Falls keine derartige Eigenschaft + existiert, wird sie hinzugefügt. + +

+ +
-d, --delete Name + +

+ Löscht alle Vorkommen der Eigenschaft Name. Beachten + Sie, dass einige Eigenschaften benötigt werden und nicht gelöscht werden + können. + +

+ +
+ + +

+ Aktionen, die mit Tags und Kapitel umgehen: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags + Selektor:Dateiname + +

+ Fügt in der Datei Tags hinzu, ersetzt sie durch die aus + Dateiname oder entfernt sie, falls + Dateiname leer ist. mkvpropedit(1) liest dasselbe + XML-Tag-Format, das auch mkvmerge(1) liest. + +

+ + +

+ Der Selektor muss eines der Wörter + all, global oder + track sein. Bei all wird + mkvpropedit(1) alle Tags in einer Datei ersetzen oder entfernen. Bei + global werden nur globale Tags ersetzt oder entfernt. + +

+ + +

+ Bei track wird mkvpropedit(1) Tags für eine bestimmte + Spur ersetzen. Zusätzlich werden die aus Dateiname + gelesenen Tags derselben Spur zugeteilt. Die Spur wird auf dieselbe Weise + angegeben wie die Selektoren zur + Bearbeitung (siehe unten), z.B. --tags + track:a1:neue-Audio-Tags.xml. + +

+ +
--add-track-statistics-tags + +

+ Berechnet Statistiken für alle Spuren in einer Datei und legt für sie neue + Statistik-Tags an. Wenn die Datei solche Tags bereits enthält, so werden sie + aktuelisiert. + +

+ +
--delete-track-statistics-tags + +

+ Löscht alle vorhandenen Tags mit Spur-Statistiken aus einer Datei. Falls die + Datei keine Spur-Statistik-Tags enthält, so wird sie nicht verändert. + +

+ +
-c, --chapters + Dateiname + +

+ Fügt in der Datei Kapitel aus Dateiname hinzu, + ersetzt sie dadurch oder entfernt sie, falls + Dateiname leer ist. mkvpropedit(1) liest dieselben + XML- und Kapitelformate, die auch mkvmerge(1) liest. + +

+ +
+ + +

+ Aktionen für den Umgang mit Anhängen: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment Dateiname + +

+ Fügt einen neuen Anhang aus Dateiname hinzu. + +

+ + +

+ Falls die Option --attachment-name vor dieser Option + benutzt wurde, wird ihr Wert als Name des neuen Anhangs + verwendet. Andernfalls wird er aus Dateiname + abgeleitet. + +

+ + +

+ Falls die Option --attachment-mime-type vor dieser Option + benutzt wurde, wird ihr Wert als MIME-Typ des neuen Anhangs + verwendet. Andernfalls wird er automatisch anhand des Inhalts von + Dateiname bestimmt. + +

+ + +

+ Falls die Option --attachment-description vor dieser Option + benutzt wurde, wird ihr Wert als Beschreibung des neuen Anhangs + verwendet. Andernfalls wird keine Beschreibung hinterlegt. + +

+ + +

+ Falls die Option --attachment-uid vor dieser Option benutzt + wurde, wird ihr Wert als UID des neuen Anhangs verwendet. Andernfalls wird + automatisch eine zufällige UID erzeugt. + +

+ +
--replace-attachment + Selektor:Dateiname + +

+ Ersetzt einen oder mehrere Anhänge, die zum Selektor + passen, durch die Datei Dateiname. Falls mehr als ein + existierender Anhang zum Selektor passt, werden alle + ihre Inhalte durch den Inhalt von Dateiname ersetzt. + +

+ + +

+ Der Selektor kann eine von vier Formen haben. Sie + werden unten im Abschnitt Anhangauswahlpunkte + erklärt. + +

+ + +

+ Falls die Option --attachment-name vor dieser Option + benutzt wurde, wird ihr Wert als Name für alle veränderten Anhänge + verwendet. Andernfalls werden die Namen nicht geändert. + +

+ + +

+ Falls die Option --attachment-mime-type vor dieser Option + benutzt wurde, wird ihr Wert als MIME-Typ aller veränderten Anhänge + verwendet. Andernfalls werden die MIME-Typen nicht geändert. + +

+ + +

+ Falls die Option --attachment-description vor dieser Option + benutzt wurde, wird ihr Wert als Beschreibung aller veränderten Anhänge + verwendet. Andernfalls werden die Beschreibungen nicht geändert. + +

+ + +

+ Falls die Option --attachment-uid vor dieser Option benutzt + wurde, wird ihr Wert als UID aller veränderten Anhänge + verwendet. Andernfalls werden die UIDs nicht geändert. + +

+ +
--update-attachment Selektor + +

+ Aktualisiert die Eigenschaften eines oder mehrere Anhänge, die zum + Selektor passen. Falls mehr als ein existierender + Anhang zum Selektor passt, werden all ihre + Eigenschaften aktualisiert. + +

+ + +

+ Der Selektor kann eine von vier Formen haben. Sie + werden unten im Abschnitt Anhangauswahlpunkte + erklärt. + +

+ + +

+ Falls die Option --attachment-name vor dieser Option + benutzt wurde, wird ihr Wert als Name für alle veränderten Anhänge + verwendet. Andernfalls werden die Namen nicht geändert. + +

+ + +

+ Falls die Option --attachment-mime-type vor dieser Option + benutzt wurde, wird ihr Wert als MIME-Typ aller veränderten Anhänge + verwendet. Andernfalls werden die MIME-Typen nicht geändert. + +

+ + +

+ Falls die Option --attachment-description vor dieser Option + benutzt wurde, wird ihr Wert als Beschreibung aller veränderten Anhänge + verwendet. Andernfalls werden die Beschreibungen nicht geändert. + +

+ + +

+ Falls die Option --attachment-uid vor dieser Option benutzt + wurde, wird ihr Wert als UID aller veränderten Anhänge + verwendet. Andernfalls werden die UIDs nicht geändert. + +

+ +
--delete-attachment Selektor + +

+ Löscht einen oder mehrere Anhänge, die zum Selektor + passen. + +

+ + +

+ Der Selektor kann eine von vier Formen haben. Sie + werden unten im Abschnitt Anhangauswahlpunkte + erklärt. + +

+ +
+ + +

+ Optionen für Aktionen mit Anhängen: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name Name + +

+ Setzt den Namen, der für die nachfolgende --add-attachment- + oder --replace-attachment-Transaktion benutzt wird. + +

+ +
--attachment-mime-type MIME-Typ + +

+ Setzt den MIME-Typ, der für die nachfolgende + -add-attachment- oder + --replace-attachment-Transaktion benutzt wird. + +

+ +
--attachment-description + Beschreibung + +

+ Setzt die Beschreibung, die für die nachfolgende + -add-attachment- oder + --replace-attachment-Transaktion benutzt wird. + +

+ +
--enable-legacy-font-mime-types + +

+ Aktiviert die Nutzung veralteter MIME-Typen für bestimme + Arten von Schriftart-Dateianhängen. Beispielsweise wird + »application/x-truetype-font« für TrueType-Schriftarten + anstelle von »fonts/ttf« benutzt." + +

+ + +

+ Dies betrifft sowohl das Hinzufügen neuer Dateianhänge als auch das Ersetzen + vorhandener Anhänge, aber nur, wenn der MIME-Typ nicht + angegeben wurde. Andere existierende Dateianhänge werden nicht verändert. + +

+ + +

+ Die betroffenen MIME-Typen sind + »font/sfnt«, »font/ttf« und + »font/collection«, die alle durch + »application/x-truetype-fonts« ersetzt werden, sowie + »font/otf«, das durch + »application/vnd.ms-opentype« ersetzt wird." + +

+ +
+ + +

+ Weitere Optionen: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ Wenn Änderungen an der Eigenschaft »language« vorgenommen + werden, nimmt mkvpropedit(1) normalerweise dieselben Änderungen am neuen + LanguageIETF-Spurkopfdaten-Element in Ergänzung zum + alten Language-Element vor. Wenn diese Option benutzt + wird, so wird die Änderung nur auf das alte + Language-Element angewendet. + +

+ + +

+ Diese Option hat keinen Einfluss auf Änderungen, die über die + Spurkopfdaten-Eigenschaft »language-ietf« angefragt + werden. + +

+ +
--normalize-language-ietf Modus + +

+ Aktiviert die Normalisierung aller IETF-BCP-47-Sprach-Tags zu entweder ihrer + kanonischen Form mit Modus »canonical«, zu ihrer + Erweiterte-Sprach-Unterelemente-Form mit Modus »extlang« + oder deaktiviert die Normalisierung mit Modus + »off«. Standardmäßig wird eine Normalisierung zur + kanonischen Form durchgeführt. + +

+ + +

+ In der kanonischen Form werden alle Unterelemente, für die bevorzugte Werte + existieren, durch diese bevorzugten Werte ersetzt. Dies wandelt + z.B. »zh-yue-jyutping« in + »yue-jyutping« oder »fr-FX« in + »fr-FR« um. + +

+ + +

+ Für die Erweiterte-Sprach-Unterelemente-Form wird zuerst die kanonische Form + gebildet. Anschließend werden alle primären Sprachelemente, für die es + erweiterte Sprach-Unterlemente gibt, durch diese erweiterten + Sprach-Unterelemente und das dazugehörige Präfix ersetzt. Dies wandelt + z.B. »yue-jyutping« zurück in + »zh-yue-jyutping« um, hat aber keine Auswirkung auf + »fr-FR«, weil es für »fr« kein + erweitertes Sprach-Unterelement gibt. + +

+ + +

+ Diese Normalisierung wird nur auf Elemente angewendet, die tatsächlich + verändert werden: + +

+ + +
    + +
  • + +

    + Beim Bearbeiten von Spurkopfdaten sind nur Sprachelemente von Spuren + betroffen, die über Bearbeitungs-Spezifikationen gesetzt werden. Sprachen + von Spuren, die gar nicht bearbeitet werden, werden nicht geändert. Wird + eine Spur bearbeitet, aber nur andere Elemente als die Sprache geändert, hat + dies ebenfalls keine Auswirkung auf die Sprache. + +

    + +
  • + + +
  • + +

    + Beim Bearbeiten von Kapiteln sind die Sprachelemente aller Kapitelelemente + betroffen, da Kapitel nur als Ganzes ersetzt werden. + +

    + +
  • + + +
  • + +

    + Beim Bearbeiten von Tags sind nur Sprachelemente derjenigen Tags betroffen, + die tatsächlich ersetzt werden. Werden beispielsweise globale Tags ersetzt, + so sind existierenden Spur-Tags nicht betroffen. + +

    + +
  • + +
+ + +

+ Der beste Weg zur Normalisierung aller vorhandenen Sprachelemente ist, die + Datei mit mkvmerge(1) zu remuxen und dabei die Option + »--normalize-language-ietf« auf den gewünschten Modus zu + setzen. + +

+ +
--command-line-charset Zeichensatz + +

+ Setzt den Zeichensatz, um auf der Befehlszeile angegebene Zeichenketten + umzuwandeln. Voreinstellung ist der Zeichensatz der aktuellen Locale des + Systems. + +

+ +
--output-charset Zeichensatz + +

+ Setzt den Zeichensatz, in den Zeichenketten zur Ausgabe umgewandelt + werden. Voreinstellung ist der Zeichensatz der aktuellen Locale des Systems. + +

+ +
-r, --redirect-output + Dateiname + +

+ Schreibt alle Nachrichten in die Datei Dateiname + statt auf die Konsole. Obwohl dies einfach durch Ausgabeumleitung erledigt + werden kann, gibt es Fälle, in denen diese Option benötigt wird: wenn das + Terminal die Ausgabe vor dem Schreiben in eine Datei neu auswertet. Der mit + --output-charset + gesetzte Zeichensatz wird dabei berücksichtigt. + +

+ +
--ui-language Code + +

+ Erzwingt, dass die Übersetzungen für die Sprache Code + benutzt werden (z.B. »de_DE« für die deutschen + Übersetzungen). Bei der Eingabe von »list« als + Code gibt das Programm eine Liste der verfügbaren + Übersetzungen aus. + +

+ +
--abort-on-warnings + +

+ Weist das Programm an abzubrechen, nachdem die erste Warnung ausgegeben + wurde. Der Rückgabewert des Programms wird in dem Fall 1 sein. + +

+ +
--debug Thema + +

+ Schaltet die Fehlersuche für eine bestimmte Funktionalität ein. Diese Option + ist nur für Entwickler nützlich. + +

+ +
--engage Funktionalität + +

+ Schaltet experimentelle Funktionalitäten ein. Eine Liste verfügbarer + Funktionalitäten kann mit mkvpropedit --engage list + abgefragt werden. Diese Funktionalitäten sind nicht für die Verwendung in + Alltagssituationen gedacht. + +

+ +
--gui-mode + +

+ Schaltet den Modus für graphische Benutzeroberflächen an. In diesem Modus + können auf bestimmte Art formatierte Zeilen ausgegeben werden, die einem + aufrufenden Programm mitteilen, was mkvmerge(1) gerade tut. Diese Nachrichten + haben das folgende Format: '#GUI#Nachricht'. Der + Nachricht folgen potenziell Schlüssel/Wert-Paare wie + z.B. + '#GUI#Nachricht#schluessel1=wert1#schluessel2=wert2…'. + Weder die Nachricht selber noch die Schlüssel werden jemals übersetzt + sondern immer in Englisch ausgegeben. + +

+ +
-v, --verbose + +

+ Aktiviert detaillierte Ausgabe und zeigt alle wichtigen Matroska(tm)-Elemente + an, sobald sie gelesen wurden. + +

+ +
-h, --help + +

+ Zeigt Benutzungsinformationen und beendet sich. + +

+ +
-V, --version + +

+ Zeigt Versionsinformationen und beendet sich. + +

+ +
@Optionsdatei.json + +

+ Liest zusätzliche Befehlszeilenargumente aus der Datei + Optionsdatei. Eine ausführliche Erläuterunge über die + unterstützten Formate finden Sie im Abschnitt "Optionsdateien" in der + Handbuchseite zu mkvmerge(1). + +

+ +
+ +

3. Selektoren zur Bearbeitung

+ + +

+ Die Option --edit setzt + den Matroska(tm)-Dateiabschnitt (Segmentinformationen oder die Kopfdaten einer + bestimmten Spur) so, dass alle nachfolgenden add-, set- und delete-Aktionen damit + arbeiten. Dies bleibt gültig, bis die nächste --edit-Option + gefunden wird. Das Argument für diese Option wird Selektor zur Bearbeitung + genannt. + +

+ + +

+ Standardmäßig wird mkvpropedit(1) den Segmentinformationsabschnitt + bearbeiten. + +

+ + +

3.1. Segmentinformation

+ + +

+ Die Segmentinformation kann mit einem dieser drei Wörter ausgewählt werden: + »info«, »segment_info« oder + »segmentinfo«. Sie enthält Eigenschaften wie den + Segmenttitel oder die UID des Segments. + +

+ + + +

3.2. Spurenkopfdaten

+ + +

+ Spurenkopfdaten können mit einem etwas komplexeren Selektor ausgewählt + werden. Alle Varianten beginnen mit »track:«. Die + Spurenkopfdaten beinhalten Elemente wie den Sprachcode, den + »Standardspur«-Schalter oder den Namen der Spur. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ Falls der Parameter n eine Zahl ist, wird die + n. Spur ausgewählt. Die Reihenfolge der Spuren ist + dieselbe, die die Option --identify von mkvmerge(1) ausgibt. + +

+ + +

+ Die Nummerierung beginnt bei 1. + +

+ +
track:tn + +

+ Falls der Parameter mit einem einzelnen Zeichen t + gefolgt von einem n beginnt, wird die + n. Spur eines speziellen Spurtyps ausgewählt. Der + Spurtypparameter t muss eines der folgenden Zeichen + sein: »a« für eine Tonspur, »b« für + eine Button-Spur »s« für eine Untertitelspur und + »v« für eine Videospur. Die Reihenfolge der Spuren ist + diesselbe wie die der Ausgabe der mkvmerge(1)-Option + --identify. + +

+ + +

+ Die Nummerierung beginnt bei 1. + +

+ +
track:=UID + +

+ Falls der Parameter mit einem »=« gefolgt von einer Zahl + UID beginnt, wird die Spur ausgewählt, deren + Spur-UID dieser UID + entspricht. Spur-UIDs können mit mkvinfo(1) abgefragt + werden. + +

+ +
track:@Nummer + +

+ Falls der Parameter mit einem »@« gefolgt von einer + Nummer Nummer beginnt, wird die Spur ausgewählt, + deren Spurnummer dieser Nummer + entspricht. Spurnummern können mit mkvinfo(1) abgefragt werden. + +

+ +
+ + + +

3.3. Hinweise

+ + +

+ Aufgrund der Natur der Spurauswahlpunkte zur Bearbeitung ist es möglich, + dass tatsächlich mehrere Selektoren zu den Kopfdaten derselben Spur + passen. In diesen Fällen werden alle Aktionen für diese Selektoren zur + Bearbeitung kombiniert und in der Reihenfolge ausgeführt, in der sie auf der + Befehlszeile angegeben wurden. + +

+ + +

4. Selektoren für Anhänge

+ + + +

+ Ein Selektor für Anhänge wird in den beiden Aktionen --replace-attachment + und --delete-attachment + benutzt. Er kann eine der folgenden vier Formen haben: + +

+ + +
    + +
  1. + +

    + Auswahl über die ID des Anhangs. In dieser Form ist der Selektor einfach + eine Nummer, die ID des Anhangs, wie sie vom Identifizierungsbefehl von + mkvmerge(1) ausgegeben wird. + +

    + +
  2. + + +
  3. + +

    + Auswahl über die UID (eindeutig ID) des Anhangs. In dieser Form ist der + Selektor das Gleichheitszeichen = gefolgt von einer + Nummer, der eindeutigen ID des Anhangs, wie sie vom Identifizierungsbefehl + von mkvmerge(1) ausgegeben wird. + +

    + +
  4. + + +
  5. + +

    + Auswahl über den Namen des Anhangs. In dieser Form ist der Selektor das Wort + name: gefolgt vom existierenden Namen des Anhangs. Falls + dieser Selektor mit --replace-attachment benutzt wird, + müssen Doppelpunkte innerhalb des Namens als \c maskiert + werden. + +

    + +
  6. + + +
  7. + +

    + Auswahl über den MIME-Typ. In dieser Form ist der Selektor das Wort + mime-type: gefolgt vom existierenden MIME-Typ des + Anhangs. Falls dieser Selektor mit --replace-attachment + benutzt wird, müssen Doppelpunkte innerhalb des MIME-Typs als + \c maskiert werden. + +

    + +
  8. + +
+ +

5. Umgang mit Sprachen

+ + + +

+ mkvpropedit(1) versucht, standardmäßig das Richtige zu tun. Daher wird + mkvpropedit(1) bei Änderungen der language-Eigenschaft die + Änderung sowohl auf das neue "LanguageIETF"-Element als auch das veraltete + "Language"-Element anwenden. Wenn beispielsweise der Befehl + mkvpropedit movie.mkv --edit track:2 --set language=zh-TW + benutzt wird, so wird das "LanguageIETF"-Element auf + zh-TW und das veraltete "Language"-Element auf + chi gesetzt. + +

+ + +

+ Zusätzlich gibt es eine neue Spurkopfdaten-Eigenschaft namens + language-ietf die gesetzt oder entfernt werden + kann. Änderungen an dieser Eigenschaften wirken sich nur auf das + »LanguageIETF«-Spurkopfdaten-Element aus. Eine Besonderheit ist, dass das + veraltete »Language«-Element ein obligatorisches Element in Matroska ist — + was bedeutet, dass es selbst dann, wenn es nicht vorhanden ist, einen + impliziten Wert hat. Wenn nur die Eigenschaft language-ietf + aber nicht die Eigenschaft language gesetzt wird, wird + mkvpropedit(1) daher in gewissen Situationen auch das veraltete + »Language«-Element hinzufügen & es auf den Wert und + (bedeutet »undetermined«, auf deutsch »unbestimmt«) setzen, da für das + Element kein Wert angegeben wurde. + +

+ + +

Beim Lesen von XML-Kapitel- oder -Tag-Dateien funktioniert mkvpropedit(1) wie + mkvmerge(1). +

+ + +

Das Erzeugen der neuen Elemente kann mit der Kommandozeilenoption + --disable-language-ietf vollständig deaktiviert werden. Sie + wirkt sich auf alle neuen Sprachelemente aus. +

+ + +

Sie können die angewendete Normalisierungsmethode, die auf erweiterte + Sprach-Unter-Tags angewendet wird, mit der + --normalize-language-ietf auswählen. +

+ +

6. Beispiele

+ + +

+ Das folgende Beispiel bearbeitet eine Datei namens + »Film.mkv«. Es setzt den Segmenttitel und ändert den + Sprachcode einer Ton- und Untertitelspur. Beachten Sie, dass dieses Beispiel + durch Weglassen der ersten Option --edit + verkürzt werden kann, da das Bearbeiten der Segmentinformation ohnehin für + alle Optionen, die vor dem ersten --edit + gefunden werden, die Voreinstellung ist. + +

+ +
$ mkvpropedit Film.mkv --edit info --set "title=Der Film" --edit track:a1 --set language=fre --edit track:a2 --set language=ita
+ +

+ Das zweite Beispiel entfernt den Standardspurschalter« von der ersten + Untertitelspur und setzt ihn für die zweite. Beachten Sie, dass + mkvpropedit(1) im Gegensatz zu mkvmerge(1) nicht den »Standardspurschalter« + von anderen Spuren auf »0« setzt, falls es für eine andere Spur automatisch + auf »1« gesetzt wird. + +

+ +
$ mkvpropedit Film.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ Das Ersetzen der Tags für die zweite Untertitelspur in einer Datei sieht so + aus: + +

+ +
$ mkvpropedit Film.mkv --tags track:s2:Neue-Untertitel-Tags.xml
+ +

+ Entfernen aller Tags erfordert das Weglassen des Dateinamens: + +

+ +
$ mkvpropedit Film.mkv --tags all:
+ +

+ Das Ersetzen der Kapitel in einer Datei sieht so aus: + +

+ +
$ mkvpropedit Film.mkv --chapters Neue-Kapitel.xml
+ +

+ Entfernen aller Kapitel erfordert das Weglassen des Dateinamens: + +

+ +
$ mkvpropedit Film.mkv --chapters ''
+ +

+ Hinzufügen einer Schriftdatei (Arial.ttf) als Anhang: + +

+ +
$ mkvpropedit Film.mkv --add-attachment Arial.ttf
+ +

+ Hinzufügen einer Schriftdatei (89719823.ttf) als Anhang + und Bereitstellen von ein paar Informationen, dass es sich wirklich nur um + Arial handelt: + +

+ +
$ mkvpropedit Film.mkv --attachment-name Arial.ttf --attachment-description 'Die Schrift Arial als eine TrueType-Schrift' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ Ersetzen einer angehängten Schriftdatei (Comic.ttf) durch + eine andere (Arial.ttf): + +

+ +
$ mkvpropedit Film.mkv --attachment-name Arial.ttf --attachment-description 'Die Schrift Arial als eine TrueType-Schrift' --replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ Löschen der zweiten angehängten Datei, egal worum es sich handelt: + +

+ +
$ mkvpropedit Film.mkv --delete-attachment 2
+ +

+ Löschen aller angehängten Schriften anhand des MIME-Typs: + +

+ +
$ mkvpropedit Film.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. Rückgabewerte

+ + + +

+ mkvpropedit(1) beendet sich mit einem von drei Rückgabewerten: + +

+ + +
    + +
  • + +

    + 0 – dieser Rückgabewert bedeutet, dass die Änderung + erfolgreich abgeschlossen wurde. + +

    + +
  • + + +
  • + +

    + 1 – in diesem Fall hat mkvpropedit(1) mindestens eine + Warnung ausgegeben, das Ändern wurde aber fortgesetzt. Einer Warnung wird + der Text »Warning:« vorangestellt. Abhängig von den + aufgetretenen Problemen können die resultierenden Dateien in Ordnung sein + oder nicht. Es wird nachdrücklich geraten, sowohl die Warnung als auch die + resultierenden Dateien zu überprüfen. + +

    + +
  • + + +
  • + +

    + 2 – dieser Rückgabewert wird benutzt, nachdem ein + Fehler aufgetreten ist. mkvpropedit(1) wird gleich nach der Ausgabe der + Fehlermeldung abgebrochen. Fehlermeldungen reichen von falschen + Befehlszeilenargumenten über Lese-/Schreibfehler bis hin zu beschädigten + Dateien. + +

    + +
  • + +
+ +

8. Umwandlungen von Textdateien und Zeichensätzen

+ + + +

+ Für eine tiefer gehende Diskussion darüber, wie die Programme in der + MKVToolNix-Sammlung die Umwandlung von Zeichensätzen, + Eingabe-/Ausgabecodierung, Kommandozeilenzeichensätze und + Konsolenzeichensätze handhaben, sei auf den Abschnitt »Umwandlungen von + Textdateien und Zeichensätzen« in der Handbuchseite von mkvmerge(1) + verwiesen. + +

+ +

9. Umgebungsvariablen

+ + + +

+ mkvpropedit(1) verwendet die Standardvariablen, die die Locale des System + bestimmen (d.h. LANG und die + LC_*-Familie). Zusätzliche Variablen: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG + und ihre Kurzform MTX_DEBUG + +

Der Inhalt wird behandelt, als ob er mit der Option --debug + übergeben worden wäre. +

+ +
MKVPROPEDIT_DEBUG, MKVTOOLNIX_ENGAGE + und ihre Kurzform MTX_ENGAGE + +

Der Inhalt wird behandelt, als ob er mit der Option --engage + übergeben worden wäre. +

+ +
+ +

10. Siehe auch

+ + +

+ mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1) + +

+ +

11. WWW

+ + +

+ Die neuste Version kann immer auf der MKVToolNix-Homepage gefunden + werden. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..9efcac6fa0057daa140bf47f7440e97fa98afeab --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/de/mkvtoolnix-gui.html @@ -0,0 +1,165 @@ + + + + + mkvtoolnix-gui -- eine grafische Benutzeroberfläche für mkvmerge1 einschließlich eines + Editors für Kapitel und Kopfdaten + + + + +
mkvtoolnix-gui -- eine grafische Benutzeroberfläche für mkvmerge(1) einschließlich eines + Editors für Kapitel und Kopfdaten +
+
+
+

Table of contents

+ +
+
+

1. Übersicht

+ + +
mkvtoolnix-gui [[Konfigurationsdateiname.mtxcfg] | [Quelldatei.ext] | [Matroska-Datei.mkv] | [Kapiteldatei.ext] | [Matroska-Datei.mkv]] +
+ +

2. Beschreibung

+ + +

+ mkvtoolnix-gui(1) ist eine auf Qt(tm) basierende + graphische Benutzeroberfläche für mkvmerge(1). Weiterhin implementiert sie + die Funktionalität von mkvinfo(1) und mkvpropedit(1) und wird in Zukunft auch + mkvextract(1) abdecken. Alle Einstellungen (z.B. Quelldateien, Spuroptionen + etc.) können gespeichert und wiederhergestellt werden. + +

+ + +

+ Das Aufführen von Konfigurationsdateinamen mit der Endung + .mtxcfg sorgt dafür, dass die GUI diese + Konfigurationsdateien im dazugehörigen Werkzeug lädt. Jeglicher anderer + Dateiname wird abhängig vom aktuellen Modus als Quelldatei zum Multiplexen + hinzugefügt, im Info-Werkzeug, im Kapiteleditor oder im Kopfdateneditor + geöffnet. Der aktuelle Modus kann mit --merge, + --info, --edit-chapters oder + --edit-headers geändert werden. Der Standardmodus ist das + Hinzufügen zum Multiplexen. + +

+ + +

+ Beachten Sie, dass, wenn bereits eine Instanz der Anwendung läuft und eine + zweite Instanz mit angegebenen Dateinamen gestartet wird, die Dateinamen in + der bereits laufenden, ersten Instanz behandelt werden. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

Alle folgenden Dateinamen werden als Quelldateien zum aktuellen + Multiplex-Job hinzugefügt. Dies ist der Standardmodus. +

+ +
--info + +

Alle folgenden Dateinamen werden im Info-Werkzeug geöffnet.

+ +

Zusätzlich wird beim Programmstart das Info-Werkzeug anstelle des + Multiplexer-Werkzeugs angezeigt. +

+ +
--edit-chapters + +

Alle folgenden Dateinamen werden im Kapiteleditor geöffnet.

+ +

Zusätzlich wird beim Programmstart der Kapiteleditor anstelle des + Multiplexer-Werkzeugs angezeigt. +

+ +
--edit-headers + +

Alle folgenden Dateinamen werden im Kopfdateneditor geöffnet.

+ +

Zusätzlich wird beim Programmstart der Kopfdateneditor anstelle des + Multiplexer-Werkzeugs angezeigt. +

+ +
-h, --help + +

+ Zeigt Benutzungsinformationen und beendet sich. + +

+ +
-V, --version + +

+ Zeigt Versionsinformationen und beendet sich. + +

+ +
+ +

3. Siehe auch

+ + +

+ mkvmerge(1), mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. WWW

+ + +

+ Die neuste Version kann immer auf der MKVToolNix-Homepage gefunden + werden. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..52a82516a623b8f9527a414c3257b7d1e0e3b588 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvextract.html @@ -0,0 +1,1241 @@ + + + + + mkvextract -- extract tracks from Matroska files into other files + + + +
mkvextract -- extract tracks from Matroska(tm) files into other files +
+
+ +
+

1. Synopsis

+ + +
mkvextract {source-filename} {mode1} options extraction-spec1 mode2 options extraction-spec2 … +
+ +

2. Description

+ + +

+ This program extracts specific parts from a Matroska(tm) file to other useful formats. The first argument is the name of the source file + which must be a Matroska(tm) file. + +

+ + +

+ All other arguments either switch to a certain extraction mode, change options for + the currently active mode or specify what to extract into which file. + Multiple modes can be used in the same invocation of mkvextract allowing the extraction + of multiple things in a single pass. + Most options can only be used in certain modes with a few options applying to all + modes. + +

+ + +

+ Currently supported is the extraction of tracks, tags, attachments, chapters, CUE sheets, timestamps and cues. + +

+ + +

2.1. Common options

+ + + +

+ The following options are available in all modes and only described once in this section. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ Sets the parse mode to 'full'. The default mode does not parse the whole file but + uses the meta seek elements for locating the + required elements of a source file. In 99% of all cases this is enough. But for files + that do not contain meta seek elements or which + are damaged the user might have to use this mode. A full scan of a file can take a + couple of minutes while a fast scan only takes + seconds. + +

+ +
--command-line-charset character-set + +

+ Sets the character set to convert strings given on the command line from. It defaults + to the character set given by system's current + locale. + +

+ +
--output-charset character-set + +

+ Sets the character set to which strings are converted that are to be output. It defaults + to the character set given by system's + current locale. + +

+ +
-r, --redirect-output file-name + +

+ Writes all messages to the file file-name instead of to the console. While this can be done easily with + output redirection there are cases in which this option is needed: when the terminal + reinterprets the output before writing it to a + file. The character set set with --output-charset is honored. + +

+ +
--flush-on-close + +

+ Tells the program to flush all data cached in memory to storage when closing files + opened for writing. + This can be used to prevent data loss on power outages or to circumvent certain problems + in the operating system or drivers. + The downside is that multiplexing will take longer as mkvmerge will wait until all + data has been written to the storage before exiting. + See issues #2469 and #2480 on the MKVToolNix bug tracker for in-depth discussions + on the pros and cons. + +

+ +
--ui-language code + +

+ Forces the translations for the language code to be used (e.g. 'de_DE' for the German + translations). Entering 'list' as the code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Tells the program to abort after the first warning is emitted. The program's exit + code will be 1. + +

+ +
--debug topic + +

+ Turn on debugging for a specific feature. This option is only useful for developers. + +

+ +
--engage feature + +

+ Turn on experimental features. A list of available features can be requested with + mkvextract --engage list. These + features are not meant to be used in normal situations. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that can tell + a controlling GUI what's happening. These + messages follow the format '#GUI#message'. The message may be followed by key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the messages nor the keys are ever translated and always output + in English. + +

+ +
-v, --verbose + +

+ Be verbose and show all the important Matroska(tm) elements as they're read. + +

+ +
-h, --help + +

+ Show usage information and exit. + +

+ +
-V, --version + +

+ Show version information and exit. + +

+ +
@options-file.json + +

+ Reads additional command line arguments from the file options-file. For a full explanation on the supported + formats for such files see the section called "Option files" in the mkvmerge(1) man page. + +

+ +
+ + + +

2.2. Track extraction mode

+ + + +

+ Syntax: mkvextract source-filename tracks [options] TID1:dest-filename1 [TID2:dest-filename2 ...] + +

+ + +

+ The following command line options are available for each track in the 'tracks' extraction mode. They have to appear + in front of the track specification (see below) they should be applied to. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c character-set + +

+ Sets the character set to convert the next text subtitle track to. Only valid if the + next track ID targets a text subtitle track. It defaults to UTF-8. + +

+ +
--blockadd level + +

+ Keep only the BlockAdditions up to this level. The default is to keep all levels. + This option only affects certain kinds of codecs + like WAVPACK4. + +

+ +
--cuesheet + +

+ Causes mkvextract(1) to extract a CUE sheet from the chapter information and tag data for the following track into a + file whose name is the track's output name with '.cue' appended to it. + +

+ +
--raw + +

+ Extracts the raw data into a file without any container data around it. Unlike the + --fullraw flag this flag does not cause the contents of the + CodecPrivate element to be written to the file. This mode works with all CodecIDs, even + the ones that mkvextract(1) doesn't support otherwise, but the resulting files might not be usable. + +

+ +
--fullraw + +

+ Extracts the raw data into a file without any container data around it. The contents + of the CodecPrivate + element will be written to the file first if the track contains such a header element. + This mode works with all + CodecIDs, even the ones that mkvextract(1) doesn't support otherwise, but the resulting files might not be + usable. + +

+ +
TID:outname + +

+ Causes extraction of the track with the ID TID into the file + outname if such a track exists in the source file. This option can be + given multiple times. The track IDs are the same as the ones output by + mkvmerge(1)'s --identify option. + +

+ + +

+ Each output name should be used only once. The exception are RealAudio and RealVideo + tracks. If you use the same name for different + tracks then those tracks will be saved in the same file. Example: + +

+ +
$ mkvextract input.mkv tracks 0:video.h264 2:output-two-vobsub-tracks.idx 3:output-two-vobsub-tracks.idx
+
+ + + +

2.3. Attachments extraction mode

+ + + +

+ Syntax: mkvextract source-filename attachments [options] AID1:outname1 [AID2:outname2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:outname + +

+ Causes extraction of the attachment with the ID AID into the file outname if such an + attachment exists in the source file. If the outname is left empty then the name of the attachment inside the + source Matroska(tm) file is used instead. This option can be given multiple times. The attachment IDs + are the same as the ones output + by mkvmerge(1)'s --identify option. + +

+ +
+ + + +

2.4. Chapters extraction mode

+ + + +

+ Syntax: mkvextract source-filename chapters [options] output-filename.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ Exports the chapter information in the simple format used in the OGM tools + (CHAPTER01=..., CHAPTER01NAME=...). In this mode some information has to be + discarded. Default is to output the chapters in XML format. + +

+ +
--simple-language language + +

+ If the simple format is enabled then mkvextract(1) will only output a single entry for each chapter atom encountered even if a chapter + atom contains more than one chapter name. + By default mkvextract(1) will use the first chapter name found for each atom regardless of its language. + +

+ + +

+ Using this option allows the user to determine which chapter names are output if atoms + contain more than one chapter name. + The language parameter must be an ISO 639-1 or ISO 639-2 code. + +

+ +
+ + +

+ The chapters are written to specified output file. By default the XML format understood by mkvmerge(1) is used. If no chapters are found in the file, the output file is not created. + +

+ + + +

2.5. Tags extraction mode

+ + + +

+ Syntax: mkvextract source-filename tags [options] output-filename.xml + +

+ + +

+ The tags are written to specified output file in the XML format understood by mkvmerge(1). If no tags are found in the file, the output file is not created. + +

+ + + +

2.6. Cue sheet extraction mode

+ + + +

+ Syntax: mkvextract source-filename cuesheet [options] output-filename.cue + +

+ + +

+ The cue sheet is written to specified output file. If no chapters or tags are found + in the file, the output file is not created. + +

+ + + +

2.7. Timestamp extraction mode

+ + + +

+ Syntax: mkvextract source-filename timestamps_v2 [options] TID1:dest-filename1 [TID2:dest-filename2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:outname + +

+ Causes extraction of the timestamps for the track with the ID TID into the file outname + if such a track exists in the source file. This option can be given multiple times. + The track IDs are the same as the ones output by + mkvmerge(1)'s --identify option. + +

+ + +

+ Example: + +

+ +
$ mkvextract input.mkv timestamps_v2 1:ts-track1.txt 2:ts-track2.txt
+
+ + + +

2.8. Cues extraction mode

+ + + +

+ Syntax: mkvextract source-filename cues [options] TID1:dest-filename1 [TID2:dest-filename2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:dest-filename + +

+ Causes extraction of the cues for the track with the ID TID into the file outname + if such a track exists in the source file. This option can be given multiple times. + The track IDs are the same as the ones output by + mkvmerge(1)'s --identify option and not the numbers contained in the CueTrack element. + +

+ +
+ + +

+ The format output is a simple text format: one line per CuePoint element with key=value + pairs. If an optional element is not present in a CuePoint (e.g. CueDuration) then a dash + will be output as the value. + +

+ + +

+ Example: + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

The possible keys are:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
timestamp + +

The cue point's timestamp with nanosecond precision. The format is HH:MM:SS.nnnnnnnnn. This element is always set. +

+ +
duration + +

The cue point's duration with nanosecond precision. The format is HH:MM:SS.nnnnnnnnn. +

+ +
cluster_position + +

The absolute position in bytes inside the Matroska(tm) file where the cluster containing the referenced element starts. +

+ + +
+

Note:

+ +

Inside the Matroska(tm) file the CueClusterPosition is relative to the segment's data start offset. The + value output by mkvextract(1)'s cue extraction mode, however, contains that offset already and is an absolute offset + from the + beginning of the file. +

+ +
+ +
relative_position + +

The relative position in bytes inside the cluster where the BlockGroup or + SimpleBlock element the cue point refers to starts. +

+ + +
+

Note:

+ +

Inside the Matroska(tm) file the CueRelativePosition is relative to the cluster's data start + offset. The value output by mkvextract(1)'s cue extraction mode, however, is relative to the cluster's ID. The absolute position + inside the file can be calculated by adding cluster_position and relative_position. +

+ +
+ +
+ + +

+ Example: + +

+ +
$ mkvextract input.mkv cues 1:cues-track1.txt 2:cues-track2.txt
+ +

3. Examples

+ + + +

+ Extracting both chapters and tags in their respective XML formats at the same time: + +

+ +
$ mkvextract movie.mkv chapters movie-chapters.xml tags movie-tags.xml
+ +

+ Extracting a couple of tracks and their respective timestamps at the same time: + +

+ +
$ mkvextract "Another Movie.mkv" tracks 0:video.h265 "1:main audio.aac" "2:director's comments.aac" timestamps_v2 "0:timestamps video.txt" "1:timestamps main audio.txt" "2:timestamps director's comments.txt"
+ +

+ Extracting chapters in the Ogg/OGM format and re-encoding a text subtitle track to + another character set: + +

+ +
$ mkvextract "My Movie.mkv" chapters --simple "My Chapters.txt" tracks -c MS-ANSI "2:My Subtitles.srt"
+

4. Text files and character set conversions

+ + + +

+ For an in-depth discussion about how all tools in the MKVToolNix suite handle character + set conversions, input/output encoding, command + line encoding and console encoding please see the identically-named section in the + mkvmerge(1) man page. + +

+ +

5. Output file formats

+ + + +

+ The decision about the output format is based on the track type, not on the extension + used for the output file name. The following track + types are supported at the moment: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ All AAC files will be written into an AAC file with ADTS headers before each + packet. The ADTS headers will not contain the deprecated emphasis field. + +

+ +
A_AC3, A_EAC3 + +

+ These will be extracted to raw AC-3 files. + +

+ +
A_ALAC + +

+ ALAC tracks are written to CAF files. + +

+ +
A_DTS + +

+ These will be extracted to raw DTS files. + +

+ +
A_FLAC + +

+ FLAC tracks are written to raw FLAC files. + +

+ +
A_MPEG/L2 + +

+ MPEG-1 Audio Layer II streams will be extracted to raw MP2 files. + +

+ +
A_MPEG/L3 + +

+ These will be extracted to raw MP3 files. + +

+ +
A_OPUS + +

+ Opus(tm) tracks are written to OggOpus(tm) files. + +

+ +
A_PCM/INT/LIT, A_PCM/INT/BIG + +

+ Raw PCM data will be written to a WAV file. Big-endian integer data will be converted to little-endian data in the process. + +

+ +
A_REAL/* + +

+ RealAudio(tm) tracks are written to RealMedia(tm) files. + +

+ +
A_TRUEHD, A_MLP + +

+ These will be extracted to raw TrueHD/MLP files. + +

+ +
A_TTA1 + +

+ TrueAudio(tm) tracks are written to TTA files. Please note that due to Matroska(tm)'s limited + timestamp precision the extracted file's header will be different regarding two fields: + data_length (the total + number of samples in the file) and the CRC. + +

+ +
A_VORBIS + +

+ Vorbis audio will be written into an OggVorbis(tm) file. + +

+ +
A_WAVPACK4 + +

+ WavPack(tm) tracks are written to WV files. + +

+ +
S_HDMV/PGS + +

+ PGS subtitles will be written as SUP files. + +

+ +
S_HDMV/TEXTST + +

+ TextST subtitles will be written as a special file format invented for mkvmerge(1) and mkvextract(1). + +

+ +
S_KATE + +

+ Kate(tm) streams will be written within an Ogg(tm) container. + +

+ +
S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS + +

+ SSA and ASS text subtitles will be written as SSA/ASS files + respectively. + +

+ +
S_TEXT/UTF8, S_TEXT/ASCII + +

+ Simple text subtitles will be written as SRT files. + +

+ +
S_VOBSUB + +

+ VobSub(tm) subtitles will be written as SUB files along with the + respective index files, as IDX files. + +

+ +
S_TEXT/USF + +

+ USF text subtitles will be written as USF files. + +

+ +
S_TEXT/WEBVTT + +

+ WebVTT text subtitles will be written as WebVTT files. + +

+ +
V_MPEG1, V_MPEG2 + +

+ MPEG-1 and MPEG-2 video tracks will be written as MPEG elementary streams. + +

+ +
V_MPEG4/ISO/AVC + +

+ H.264 / AVC video tracks are written to H.264 elementary streams which can be + processed further with e.g. MP4Box(tm) from the GPAC(tm) package. + +

+ +
V_MPEG4/ISO/HEVC + +

+ H.265 / HEVC video tracks are written to H.265 elementary streams which can be + processed further with e.g. MP4Box(tm) from the GPAC(tm) package. + +

+ +
V_MS/VFW/FOURCC + +

+ Fixed FPS video tracks with this CodecID are written to AVI files. + +

+ +
V_REAL/* + +

+ RealVideo(tm) tracks are written to RealMedia(tm) files. + +

+ +
V_THEORA + +

+ Theora(tm) streams will be written within an Ogg(tm) container + +

+ +
V_VP8, V_VP9 + +

+ VP8 / VP9 tracks are written to IVF files. + +

+ +
Tags + +

+ Tags are converted to a XML format. This format is the same that mkvmerge(1) supports for reading tags. + +

+ +
Attachments + +

+ Attachments are written to the output file as they are. No conversion whatsoever is + done. + +

+ +
Chapters + +

+ Chapters are converted to a XML format. This format is the same that mkvmerge(1) supports for reading chapters. Alternatively a + stripped-down version can be output in the simple OGM style format. + +

+ +
Timestamps + +

+ Timestamps are first sorted and then output as a timestamp v2 format compliant file + ready to be fed to mkvmerge(1). The extraction to + other formats (v1, v3 and v4) is not supported. + +

+ +
+ +

6. Exit codes

+ + + +

+ mkvextract(1) exits with one of three exit codes: + +

+ + +
    + +
  • + +

    + 0 -- This exit code means that extraction has completed successfully. + +

    + +
  • + + +
  • + +

    + 1 -- In this case mkvextract(1) has output at least one warning, but extraction did continue. A warning is + prefixed with the text 'Warning:'. Depending on the issues involved the resulting files might be ok or not. The + user is urged to check both the warning and the resulting files. + +

    + +
  • + + +
  • + +

    + 2 -- This exit code is used after an error occurred. mkvextract(1) aborts right after outputting the error message. + Error messages range from wrong command line arguments over read/write errors to broken + files. + +

    + +
  • + +
+ +

7. Environment variables

+ + + +

+ mkvextract(1) uses the default variables that determine the system's locale (e.g. LANG and the LC_* + family). Additional variables: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG and its short form MTX_DEBUG + +

The content is treated as if it had been passed via the --debug option. +

+ +
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE and its short form MTX_ENGAGE + +

The content is treated as if it had been passed via the --engage option. +

+ +
+ +

8. See also

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. WWW

+ + +

+ The latest version can always be found at the MKVToolNix homepage. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..91ed9ccf8562961fde2a8b066cc2e81e2222ae85 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvinfo.html @@ -0,0 +1,490 @@ + + + + + mkvinfo -- Print information about elements in Matroska files + + + +
mkvinfo -- Print information about elements in Matroska(tm) files +
+
+ +
+

1. Synopsis

+ + +
mkvinfo options {source-filename} +
+ +

2. Description

+ + +

+ This program lists all elements contained in a Matroska(tm). The output can be limited to a list of tracks in the file including + information about the codecs used. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ By default mkvinfo(1) stops when it encounters the first cluster. Additionally it doesn't show certain + often occurring elements. With + this option mkvinfo(1) will continue processing regardless of the verbosity level and show all elements. + +

+ +
-c, --checksums + +

+ Calculates and display the Adler-32 checksum for each frame. Useful for debugging only. + +

+ +
-o, --continue + +

+ By default mkvinfo(1) stops when it encounters the first cluster. With this option mkvinfo(1) will continue processing regardless of + the verbosity level. + +

+ +
-p, --hex-positions + +

+ Show the positions of all elements in hexadecimal regardless of the verbosity level. + +

+ +
-P, --positions + +

+ Show the positions of all elements in decimal regardless of the verbosity level. + +

+ +
-s, --summary + +

+ Only show a terse summary of what mkvinfo(1) finds and not each element. + +

+ +
-t, --track-info + +

+ Show statistics for each track in verbose mode. Also sets verbosity to 1 if it was + at level 0 before. + +

+ +
-x, --hexdump + +

+ Show the first 16 bytes of each frame as a hex dump. + +

+ +
-X, --full-hexdump + +

+ Show all bytes of each frame as a hex dump. + +

+ +
-z, --size + +

+ Show the size of each element including its header. + +

+ +
--command-line-charset character-set + +

+ Sets the character set to convert strings given on the command line from. It defaults + to the character set given by system's current + locale. + +

+ +
--output-charset character-set + +

+ Sets the character set to which strings are converted that are to be output. It defaults + to the character set given by system's + current locale. + +

+ +
-r, --redirect-output file-name + +

+ Writes all messages to the file file-name instead of to the console. While this can be done easily with + output redirection there are cases in which this option is needed: when the terminal + reinterprets the output before writing it to a + file. The character set set with --output-charset is honored. + +

+ +
--ui-language code + +

+ Forces the translations for the language code to be used (e.g. 'de_DE' for the German + translations). Entering 'list' as the code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Tells the program to abort after the first warning is emitted. The program's exit + code will be 1. + +

+ +
--debug topic + +

+ Turn on debugging for a specific feature. This option is only useful for developers. + +

+ +
--engage feature + +

+ Turn on experimental features. A list of available features can be requested with + mkvinfo --engage list. These + features are not meant to be used in normal situations. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that can tell + a controlling GUI what's happening. These + messages follow the format '#GUI#message'. The message may be followed by key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the messages nor the keys are ever translated and always output + in English. + +

+ +
-v, --verbose + +

+ Be more verbose. See the section about verbosity levels for a description which + information will be output at which level. + +

+ +
-h, --help + +

+ Show usage information and exit. + +

+ +
-V, --version + +

+ Show version information and exit. + +

+ +
@options-file.json + +

+ Reads additional command line arguments from the file options-file. For a full explanation on the supported + formats for such files see the section called "Option files" in the mkvmerge(1) man page. + +

+ +
+ +

3. Verbosity levels

+ + + +

+ The -v option can be used to increase mkvinfo(1)'s verbosity level + and print more information about the current file. + +

+ + +

+ At level 0 mkvinfo(1) will print only the track headers it finds and their types. mkvinfo(1) will exit as soon as the headers are parsed + completely (more technical: as soon as the first cluster is encountered). In this + level the seek head entries and the cues will not be + displayed -- even if they're located in front of the track information. + +

+ + +

+ At level 1 mkvinfo(1) will also print all Matroska(tm) elements encountered for the complete file but the seek head entries and the cue + entries. If the summary mode is enabled then mkvinfo(1) will output the frame position as well. + +

+ + +

+ The same effect can be achieved with the option --continue. + +

+ + +

+ At level 2 mkvinfo(1) will also print the seek head entries, the cue entries and the file position at which + each Matroska(tm) element can be + found at. + +

+ + +

+ The same effect can be achieved with the options --all --positions. + +

+ + +

+ At level 3 and above mkvinfo(1) will print some information that is not directly connected to a Matroska(tm) element. All other elements + only print stuff about the elements that were just found. Level 3 adds meta information + to ease debugging (read: it's intended for + developers only). All lines written by level 3 are enclosed in square brackets to + make filtering them out easy. + +

+ +

4. Text files and character set conversions

+ + + +

+ For an in-depth discussion about how all tools in the MKVToolNix suite handle character + set conversions, input/output encoding, command + line encoding and console encoding please see the identically-named section in the + mkvmerge(1) man page. + +

+ +

5. Exit codes

+ + + +

+ mkvinfo(1) exits with one of three exit codes: + +

+ + +
    + +
  • + +

    + 0 -- This exit code means that the run has completed successfully. + +

    + +
  • + + +
  • + +

    + 1 -- In this case mkvinfo(1) has output at least one warning, but the run did continue. A warning is + prefixed with the text 'Warning:'. + +

    + +
  • + + +
  • + +

    + 2 -- This exit code is used after an error occurred. mkvinfo(1) aborts right after outputting the error message. + Error messages range from wrong command line arguments over read/write errors to broken + files. + +

    + +
  • + +
+ +

6. Environment variables

+ + + +

+ mkvinfo(1) uses the default variables that determine the system's locale (e.g. LANG and the LC_* + family). Additional variables: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUG, MKVTOOLNIX_DEBUG and its short form MTX_DEBUG + +

The content is treated as if it had been passed via the --debug option. +

+ +
MKVINFO_ENGAGE, MKVTOOLNIX_ENGAGE and its short form MTX_ENGAGE + +

The content is treated as if it had been passed via the --engage option. +

+ +
+ +

7. See also

+ + +

+ mkvmerge(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. WWW

+ + +

+ The latest version can always be found at the MKVToolNix homepage. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..f7678a8618ac3244e0525cc020ec8e05f25f90ff --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvmerge.html @@ -0,0 +1,4894 @@ + + + + + mkvmerge -- Merge multimedia streams into a Matroska file + + + +
mkvmerge -- Merge multimedia streams into a Matroska(tm) file +
+
+ +
+

1. Synopsis

+ + +
mkvmerge global options {-o out} options1 {file1} options2 {file2} @options-file.json +
+ +

2. Description

+ + +

+ This program takes the input from several media files and joins their streams (all + of them or just a selection) into + a Matroska(tm) file; see the Matroska website. + +

+ + +
+

Important:

+ +

+ The order of command line options is important. Please read the section "Option + order" if you're new to the program. + +

+ +
+ + +

2.1. Global options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

Increase verbosity.

+ +
-q, --quiet + +

Suppress status output.

+ +
-o, --output file-name + +

Write to the file file-name. If splitting is used then this parameter is treated a bit differently. See + the explanation for the --split option for details. +

+ +
-w, --webm + +

Create a WebM compliant file. This is also turned on if the output file name's extension + is "webm". This mode enforces + several restrictions. The only allowed codecs are VP8, VP9 video and Opus, Vorbis + audio tracks. The DocType header item is changed to + "webm". + +

+ + +

+ For chapters and tags only a subset of elements are allowed. mkvmerge(1) will automatically remove all elements not allowed by the + specification. + +

+ +
--title title + +

Sets the general title for the output file, e.g. the movie name.

+ +
--default-language language-code + +

Sets the default language code that will be used for tracks for which no language + is set with the --language option and for which the source container doesn't provide a + language. +

+ + +

The default language code is 'und' for 'undetermined'. +

+ +
+ + + +

2.2. Segment info handling (global options)

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo filename.xml + +

+ Read segment information from an XML file. This file can contain the segment family UID, segment + UID, previous and next segment UID elements. An example file and a DTD are included + in the MKVToolNix distribution. + +

+ + +

+ See the section about segment info XML files below for details. + +

+ +
--segment-uid SID1,SID2,... + +

+ Sets the segment UIDs to use. This is a comma-separated list of 128-bit segment UIDs + in the usual UID form: hex numbers with or without + the "0x" prefix, with or without spaces, exactly 32 digits. + +

+ + +

+ If SID starts with = then its rest is interpreted as the name of a Matroska file whose + segment UID is read and used. + +

+ + +

+ Each file created contains one segment, and each segment has one segment UID. If more + segment UIDs are specified than segments are + created then the surplus UIDs are ignored. If fewer UIDs are specified than segments + are created then random UIDs will be created for + them. + +

+ +
+ + + +

2.3. Chapter and tag handling (global options)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language language-code + +

+ Sets the ISO 639-2 language code that is written for each chapter entry. Defaults + to 'eng'. See the section about + chapters below for details. + +

+ + +

+ This option can be used both for simple chapter files and for source files that contain + chapters but no information about the + chapters' language, e.g. MP4 and OGM files. + +

+ + +

+ The language set with this option is also used when chapters are generated with the + --generate-chapters option. + +

+ +
--chapter-charset character-set + +

+ Sets the character set that is used for the conversion to UTF-8 for simple chapter + files. See the section about text files and character sets for an explanation how mkvmerge(1) converts between + character sets. + +

+ + +

+ This switch does also apply to chapters that are copied from certain container types, + e.g. Ogg/OGM and MP4 files. + See the section about chapters below for details. + +

+ +
--chapter-sync d[,o[/p]] + +

+ Adjust the timestamps of the chapters in the following source file by d ms. Alternatively you can use the + --sync option with the special track ID -2 (see section special track IDs). + +

+ + +

+ o/p: adjust the timestamps by o/p to fix + linear drifts. p defaults to 1 if omitted. Both o and p can be + floating point numbers. + +

+ + +

+ Defaults: no manual sync correction (which is the same as d = 0 and + o/p = 1.0). + +

+ + +

+ This option can be used multiple times for an input file applying to several tracks + by selecting different track IDs each time. + +

+ +
--generate-chapters mode + +

+ mkvmerge(1) can create chapters automatically. The following two modes are currently supported: + +

+ + +
    + +
  • + +

    + 'when-appending' – This mode creates one chapter at the start and one chapter whenever a file is + appended. + +

    + + +

    + This mode also works with split modes 'parts:' and 'parts-frames:'. For these modes one + chapter will be generated for each appended timestamp range (those whose start timestamps + are prefixed with + '+'). + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1) requires a video or an audio track to be present in order to be able to determine + when a new file is appended. If one or + more video tracks are muxed the first one is used. Otherwise the first audio track + is used. + +

    + +
    + +
  • + + +
  • + +

    + 'interval:time-spec' – This mode creates one chapter at fixed intervals given by + time-spec. The format is either the form HH:MM:SS.nnnnnnnnn or a number followed by + one of the units 's', 'ms' or 'us'. + +

    + + +

    + Example: --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ The names for the new chapters are controlled by the option --generate-chapters-name-template. The language is set with + --chapter-language which must occur before + --generate-chapters. + +

+ +
--generate-chapters-name-template template + +

+ This sets the name template for chapter names generated by the option --generate-chapters. If the option is not used then default 'Chapter + <NUM:2>' will be used. + +

+ + +

+ There are several variables that can be used in the template that are replaced by + their actual values when a chapter is generated. + The string '<NUM>' will be replaced by the chapter number. The string '<START>' + will be replaced by the chapter's start timestamp. + +

+ + +

+ The strings '<FILE_NAME>' and '<FILE_NAME_WITH_EXT>' are only filled when + generating chapters for appended files. They will be replaced by the appended file's + name without respectively with its extension. + Note that only the file's base name and extension are inserted, not its directory + or drive components. + +

+ + +

+ You can specify a minimum number of places for the chapter number with '<NUM:places>', e.g. '<NUM:3>'. + The resulting number will be padded with leading zeroes if the number of places is + less than specified. + +

+ + +

+ You can control the format used by the start timestamp with <START:format>. The format defaults to + '%H:%M:%S' if none is given. Valid format codes are: + +

+ + +
    + +
  • + +

    %h – hours +

    + +
  • + +
  • + +

    %H – hours zero-padded to two places +

    + +
  • + +
  • + +

    %m – minutes +

    + +
  • + +
  • + +

    %M – minutes zero-padded to two places +

    + +
  • + +
  • + +

    %s – seconds +

    + +
  • + +
  • + +

    %S – seconds zero-padded to two places +

    + +
  • + +
  • + +

    %n – nanoseconds with nine places +

    + +
  • + +
  • + +

    %<1-9>n – nanoseconds with up to nine places (e.g. three places with %3n) +

    + +
  • + +
+ +
--cue-chapter-name-format format + +

+ mkvmerge(1) supports reading CUE sheets for audio files as the input for chapters. CUE sheets usually + contain the entries PERFORMER and TITLE for each index entry. mkvmerge(1) uses these two strings + in order to construct the chapter name. With this option the format used for this + name can be set. + +

+ + +

+ If this option is not given then mkvmerge(1) defaults to the format '%p - %t' (the performer, followed by a space, a dash, + another space and the title). + +

+ + +

+ If the format is given then everything except the following meta characters is copied + as-is, and the meta + characters are replaced like this: + +

+ + +
    + +
  • + +

    %p is replaced by the current entry's PERFORMER string, +

    + +
  • + +
  • + +

    %t is replaced by the current entry's TITLE string, +

    + +
  • + +
  • + +

    %n is replaced by the current track number and +

    + +
  • + +
  • + +

    %N is replaced by the current track number padded with a leading zero if + it is < 10. +

    + +
  • + +
+ +
--chapters file-name + +

+ Read chapter information from the file file-name. See the section about chapters below for details. + +

+ +
--global-tags file-name + +

+ Read global tags from the file file-name. See the section about tags below + for details. + +

+ +
+ + + +

2.4. General output control (advanced global options)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order FID1:TID1,FID2:TID2,... + +

+ This option changes the order in which the tracks for an input file are created. The + argument is a comma separated list of pairs + IDs. Each pair contains first the file ID (FID1) which is simply the number of the file on the command line + starting at 0. The second is a track ID (TID1) from that file. If some track IDs are omitted then those tracks + are created after the ones given with this option have been created. + +

+ +
--cluster-length spec + +

+ Limit the number of data blocks or the duration of data in each cluster. The spec parameter can either be a + number n without a unit or a number d postfixed with 'ms'. + +

+ + +

+ If no unit is used then mkvmerge(1) will put at most n data blocks into each cluster. The maximum number of + blocks is 65535. + +

+ + +

+ If the number d is postfixed with 'ms' then mkvmerge(1) puts at most d + milliseconds of data into each cluster. The minimum for d is '100ms', and the maximum is + '32000ms'. + +

+ + +

+ mkvmerge(1) defaults to putting at most 65535 data blocks and 5000ms of data into a cluster. + +

+ + +

+ Programs trying to find a certain frame can only seek directly to a cluster and have + to read the whole cluster afterwards. Therefore + creating larger clusters may lead to imprecise or slow seeking. + +

+ +
--clusters-in-meta-seek + +

+ Tells mkvmerge(1) to create a meta seek element at the end of the file containing all clusters. See + also the section about the + Matroska file layout. + +

+ +
--timestamp-scale factor + +

+ Forces the timestamp scale factor to factor. Valid values are in the range + 1000..10000000 or the special value -1. + +

+ + +

+ Normally mkvmerge(1) will use a value of 1000000 which means that timestamps and durations will have a precision of + 1ms. For files that will not contain a video track but at least one audio track mkvmerge(1) will automatically chose a timestamp scale + factor so that all timestamps and durations have a precision of one audio sample. + This causes bigger overhead but allows precise + seeking and extraction. + +

+ + +

+ If the special value -1 is used then mkvmerge(1) will use sample precision even if a video track is present. + +

+ +
--enable-durations + +

+ Write durations for all blocks. This will increase file size and does not offer any + additional value for players at the moment. + +

+ +
--no-cues + +

+ Tells mkvmerge(1) not to create and write the cue data which can be compared to an index in an AVI. + Matroska(tm) files can be played back + without the cue data, but seeking will probably be imprecise and slower. Use this + only if you're really desperate for space or for + testing purposes. See also option --cues which can be specified for + each input file. + +

+ +
--no-date + +

+ By default mkvmerge(1) sets the "date" segment information field to the time & date when multiplexing started. + With this option + that field is not written at all. + +

+ +
--disable-lacing + +

+ Disables lacing for all tracks. This will increase the file's size, especially if + there are many audio tracks. This option is not + intended for everyday use. + +

+ +
--disable-track-statistics-tags + +

+ Normally mkvmerge(1) will write certain tags with statistics for each track. If such tags are already + present then they will be + overwritten. The tags are BPS, DURATION, NUMBER_OF_BYTES and + NUMBER_OF_FRAMES. + +

+ + +

+ Enabling this option prevents mkvmerge(1) from writing those tags and from touching any existing tags with same names. + +

+ +
--disable-language-ietf + +

+ Normally mkvmerge(1) will write the new IETF BCP 47 language elements in addition to the legacy language + elements in track headers, + chapters and tags. If this option is used, only the legacy elements are written. + +

+ +
--normalize-language-ietf mode + +

+ Enables normalizing all IETF BCP 47 language tags to either their canonical form with + mode 'canonical', to their + extended language subtags form with mode 'extlang' or turns it off with mode 'off'. By default + normalization to the canonical form is applied. + +

+ + +

+ In the canonical form all subtags for which preferred values exist are replaced by + those preferred values. This converts + e.g. 'zh-yue-jyutping' to 'yue-jyutping' or 'fr-FX' to 'fr-FR'. + +

+ + +

+ For the extended language subtags form the canonical form is built first. Afterwards + all primary languages for which an extended + language subtag exists are replaced by that extended language subtag and its prefix. + This converts + e.g. 'yue-jyutping' back to 'zh-yue-jyutping' but has no effect on 'fr-FR' + as 'fr' is not an extended language subtag. + +

+ +
--stop-after-video-ends + +

+ Stops processing after the primary video track ends, discarding any remaining packets + of other tracks. + +

+ +
+ + + +

2.5. File splitting, linking, appending and concatenation (more global options)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split specification + +

+ Splits the output file after a given size or a given time. Please note that tracks + can only be split right before a key frame. + Therefore the split point may be a bit off from what the user has specified. + +

+ + +

+ At the moment mkvmerge(1) supports the following modes: + +

+ + +
    + +
  1. + +

    + Splitting by size. + +

    + + +

    + Syntax: --split [size:]d[k|m|g] + +

    + + +

    + Examples: --split size:700m or --split 150000000 + +

    + + +

    + The parameter d may end with 'k', 'm' or 'g' to + indicate that the size is in KB, MB or GB respectively. Otherwise a size in bytes + is assumed. After the current output file has + reached this size limit a new one will be started. + +

    + + +

    + The 'size:' prefix may be omitted for compatibility reasons. + +

    + +
  2. + + +
  3. + +

    + Splitting after a duration. + +

    + + +

    + Syntax: --split [duration:]HH:MM:SS.nnnnnnnnn|ds + +

    + + +

    + Examples: --split duration:00:60:00.000 or --split 3600s + +

    + + +

    + The parameter must either have the form HH:MM:SS.nnnnnnnnn for specifying the duration in up to nano-second + precision or be a number d followed by the letter 's' for the duration in + seconds. HH is the number of hours, MM the number of minutes, + SS the number of seconds and nnnnnnnnn the number of nanoseconds. Both the number of + hours and the number of nanoseconds can be omitted. There can be up to nine digits + after the decimal point. After the duration of + the contents in the current output has reached this limit a new output file will be + started. + +

    + + +

    + The 'duration:' prefix may be omitted for compatibility reasons. + +

    + +
  4. + + +
  5. + +

    + Splitting after specific timestamps. + +

    + + +

    + Syntax: --split timestamps:A[,B[,C...]] + +

    + + +

    + Example: --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + The parameters A, B, C etc must all have the same format as the + ones used for the duration (see above). The list of timestamps is separated by commas. + After the input stream has reached the + current split point's timestamp a new file is created. Then the next split point given + in this list is used. + +

    + + +

    + The 'timestamps:' prefix must not be omitted. + +

    + +
  6. + + +
  7. + +

    + Keeping specific parts by specifying timestamp ranges while discarding others. + +

    + + +

    + Syntax: --split parts:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + Examples: + +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + The parts mode tells mkvmerge(1) to keep certain ranges of timestamps while discarding others. The ranges to keep + have to be listed after the parts: keyword and be separated by commas. A range itself consists of a start and an + end timestamp in the same format the other variations of --split accept (e.g. both + 00:01:20 and 80s refer to the same timestamp). + +

    + + +

    + If a start timestamp is left out then it defaults to the previous range's end timestamp. + If there was no previous range then it + defaults to the start of the file (see example 3). + +

    + + +

    + If an end timestamp is left out then it defaults to the end of the source files which + basically tells mkvmerge(1) to keep the rest (see + example 3). + +

    + + +

    + Normally each range will be written to a new file. This can be changed so that consecutive + ranges are written to the same file. For + that the user has to prefix the start timestamp with a +. This tells mkvmerge(1) not to create a new file and + instead append the range to the same file the previous range was written to. Timestamps + will be adjusted so that there will be no + gap in the output file even if there was a gap in the two ranges in the input file. + +

    + + +

    + In example 1 mkvmerge(1) will create two files. The first will contain the content starting from 00:01:20 until + 00:02:45. The second file will contain the content starting from 00:05:50 until + 00:10:30. + +

    + + +

    + In example 2 mkvmerge(1) will create only one file. This file will contain both the content starting from + 00:01:20 + until 00:02:45 and the content starting from 00:05:50 until 00:10:30. + +

    + + +

    + In example 3 mkvmerge(1) will create two files. The first will contain the content from the start of the source + files until + 00:02:45. The second file will contain the content starting from 00:05:50 until the end of + the source files. + +

    + + +
    +

    Note:

    + +

    + Note that mkvmerge(1) only makes decisions about splitting at key frame positions. This applies to both + the start and the end of + each range. So even if an end timestamp is between two key frames mkvmerge(1) will continue outputting the frames up to but + excluding the following key frame. + +

    + +
    + +
  8. + + +
  9. + +

    + Keeping specific parts by specifying frame/field number ranges while discarding others. + +

    + + +

    + Syntax: --split parts-frames:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + Examples: + +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + The parts-frames mode tells mkvmerge(1) to keep certain ranges of frame/field numbers while discarding + others. The ranges to keep have to be listed after the parts-frames: keyword and be separated by commas. A range + itself consists of a start and an end frame/field number. Numbering starts at 1. + +

    + + +

    + If a start number is left out then it defaults to the previous range's end number. + If there was no previous range then it defaults + to the start of the file (see example 3). + +

    + + +

    + If an end number is left out then it defaults to the end of the source files which + basically tells mkvmerge(1) to keep the rest (see + example 3). + +

    + + +

    + Normally each range will be written to a new file. This can be changed so that consecutive + ranges are written to the same file. For + that the user has to prefix the start number with a +. This tells mkvmerge(1) not to create a new file and + instead append the range to the same file the previous range was written to. Timestamps + will be adjusted so that there will be no + gap in the output file even if there was a gap in the two ranges in the input file. + +

    + + +
    +

    Note:

    + +

    + Note that mkvmerge(1) only makes decisions about splitting at key frame positions. This applies to both + the start and the end of + each range. So even if an end frame/field number is between two key frames mkvmerge(1) will continue outputting the frames up to + but excluding the following key frame. + +

    + +
    + + +

    + In example 1 mkvmerge(1) will create two files. The first will contain the content starting from the first + key frame at or after + 137 up to but excluding the first key frame at or after 258. The second file will contain the + content starting from 548 until 1211. + +

    + + +

    + In example 2 mkvmerge(1) will create only one file. This file will contain both the content starting from + 733 + until 912 and the content starting from 1592 until 2730. + +

    + + +

    + In example 3 mkvmerge(1) will create two files. The first will contain the content from the start of the source + files until + 430. The second file will contain the content starting from 2512 until the end of the source + files. + +

    + + +

    + This mode considers only the first video track that is output. If no video track + is output no splitting will occur. + +

    + + +
    +

    Note:

    + +

    + The numbers given with this argument are interpreted based on the number of Matroska(tm) blocks that are output. A single Matroska(tm) + block contains either a full frame (for progressive content) or a single field (for + interlaced content). mkvmerge does not + distinguish between those two and simply counts the number of blocks. For example: + If one wanted to split after the 25th full + frame with interlaced content one would have to use 50 (two fields per full frame) as the split point. + +

    + +
    + +
  10. + + +
  11. + +

    + Splitting after specific frames/fields. + +

    + + +

    + Syntax: --split frames:A[,B[,C...]] + +

    + + +

    + Example: --split frames:120,237,891 + +

    + + +

    + The parameters A, B, C etc must all be positive integers. + Numbering starts at 1. The list of frame/field numbers is separated by commas. After + the input stream has reached the current + split point's frame/field number a new file is created. Then the next split point + given in this list is used. + +

    + + +

    + The 'frames:' prefix must not be omitted. + +

    + + +

    + This mode considers only the first video track that is output. If no video track + is output no splitting will occur. + +

    + + +
    +

    Note:

    + +

    + The numbers given with this argument are interpreted based on the number of Matroska(tm) blocks that are output. A single Matroska(tm) + block contains either a full frame (for progressive content) or a single field (for + interlaced content). mkvmerge does not + distinguish between those two and simply counts the number of blocks. For example: + If one wanted to split after the 25th full + frame with interlaced content one would have to use 50 (two fields per full frame) as the split point. + +

    + +
    + +
  12. + + +
  13. + +

    + Splitting before specific chapters. + +

    + + +

    + Syntax: --split chapters:all or --split + chapters:A[,B[,C...]] + +

    + + +

    + Example: --split chapters:5,8 + +

    + + +

    + The parameters A, B, C etc must all be positive integers. + Numbering starts at 1. The list of chapter numbers is separated by commas. Splitting + will occur right before the first key frame + whose timestamp is equal to or bigger than the start timestamp for the chapters whose + numbers are listed. A chapter starting at 0s + is never considered for splitting and discarded silently. + +

    + + +

    + The keyword all can be used instead of listing all chapter numbers manually. + +

    + + +

    + The 'chapters:' prefix must not be omitted. + +

    + + +
    +

    Note:

    + +

    + The Matroska(tm) file format supports arbitrary deeply nested chapter structures called 'edition entries' + and 'chapter atoms'. + However, this mode only considers the top-most level of chapters across all edition + entries. + +

    + +
    + +
  14. + +
+ + +

+ For this splitting mode the output filename is treated differently than for the normal + operation. It may contain a + printf like expression '%d' including an optional field width, + e.g. '%02d'. If it does then the current file number will be formatted appropriately and inserted + at that point + in the filename. If there is no such pattern then a pattern of '-%03d' is assumed right before the file's + extension: '-o output.mkv' would result in 'output-001.mkv' and so on. If there's no extension + then '-%03d' will be appended to the name. + +

+ + +

+ Another possible pattern is '%c' which will be replaced by the name of the first chapter in the file. Note that when + '%c' is present, the pattern '-%03d' will not be added automatically. + +

+ +
--link + +

+ Link files to one another when splitting the output file. See the section on file linking + below for details. + +

+ +
--link-to-previous segment-UID + +

+ Links the first output file to the segment with the segment UID given by the segment-UID parameter. See the + section on file linking below for details. + +

+ + +

+ If SID starts with = then its rest is interpreted as the name of a Matroska file whose + segment UID is read and used. + +

+ +
--link-to-next segment-UID + +

+ Links the last output file to the segment with the segment UID given by the segment-UID parameter. See the + section on file linking below for details. + +

+ + +

+ If SID starts with = then its rest is interpreted as the name of a Matroska file whose + segment UID is read and used. + +

+ +
--append-mode mode + +

+ Determines how timestamps are calculated when appending files. The parameter mode can have two values: + 'file' which is also the default and 'track'. + +

+ + +

+ When mkvmerge appends a track (called 'track2_1' from now on) from a second file (called + 'file2') to a track (called 'track1_1') from the first file (called 'file1') + then it has to offset all timestamps for 'track2_1' by an amount. For 'file' mode this amount is + the highest timestamp encountered in 'file1' even if that timestamp was from a different track than + 'track1_1'. In track mode the offset is the highest timestamp of 'track1_1'. + +

+ + +

+ Unfortunately mkvmerge cannot detect which mode to use reliably. Therefore it defaults + to 'file' + mode. 'file' mode usually works better for files that have been created independently of each + other; e.g. when + appending AVI or MP4 files. 'track' mode may work better for sources that are + essentially just parts of one big file, e.g. for VOB and EVO files. + +

+ + +

+ Subtitle tracks are always treated as if 'file' mode were active even if 'track' mode actually + is. + +

+ +
--append-to SFID1:STID1:DFID1:DTID1[,...] + +

+ This option controls to which track another track is appended. Each spec contains + four IDs: a file ID, a track ID, a second file ID + and a second track ID. The first pair, "source file ID" and "source track ID", identifies + the track that is to be appended. The + second pair, "destination file ID" and "destination track ID", identifies the track + the first one is appended to. + +

+ + +

+ If this option has been omitted then a standard mapping is used. This standard mapping + appends each track from the current file to a + track from the previous file with the same track ID. This allows for easy appending + if a movie has been split into two parts and both + file have the same number of tracks and track IDs with the command mkvmerge -o output.mkv part1.mkv +part2.mkv. + +

+ +
+ + +

+ A single '+' causes the next file to be appended instead of added. The '+' can also + be put in front of the next file name. Therefore + the following two commands are equivalent: + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv file1.mkv +file2.mkv
+
[ file1 file2 ] + +

+ If multiple file names are contained in a pair of square brackets then the second + and all following files will be appended to the first file named within the brackets. + +

+ + +

+ This is an alternative syntax to using '+' between the file names. Therefore the following + two commands are equivalent: + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv '[' file1.mkv file2.mkv ']'
+
= + +

+ For certain file types (MPEG program streams = VOBs) mkvmerge(1) normally looks for files in the same directory as an input file that + have the same base name and only differ in their running number (e.g. 'VTS_01_1.VOB', + 'VTS_01_2.VOB', 'VTS_01_3.VOB' etc) and treats + all of those files as if they were concatenated into a single big file. This option, + a single '=', causes mkvmerge not to look for + those additional files. + +

+ + +

+ The '=' can also be put in front of the next file name. Therefore the following two + commands are equivalent: + +

+ +
$ mkvmerge -o full.mkv = file1.vob
+$ mkvmerge -o full.mkv =file1.vob
+
( file1 file2 ) + +

+ If multiple file names are contained in a pair of parenthesis then those files will + be treated as if they were concatenated into a + single big file consisting of the content of each of the files one after the other. + +

+ + +

+ This can be used for e.g. VOB files coming from a DVD or MPEG transport streams. It + cannot be used if each file contains its own set + of headers which is usually the case with stand-alone files like AVI or MP4. + +

+ + +

+ Putting a file name into parenthesis also prevents mkvmerge(1) from looking for additional files with the same base name as described + in option =. Therefore these two command lines are + equivalent: + +

+ +
$ mkvmerge -o out.mkv = file.mkv
+$ mkvmerge -o out.mkv '(' file.mkv ')'
+ +

+ Several things should be noted: + +

+ + +
    + +
  1. + +

    + There must be spaces both after the opening and before the closing parenthesis. + +

    + +
  2. + + +
  3. + +

    + Every parameter between parenthesis is interpreted as a file name. Therefore all options + applying to this logical file must be listed before the opening parenthesis. + +

    + +
  4. + + +
  5. + +

    + Some shells treat parenthesis as special characters. Hence you must escape or quote + them as shown in the example above. + +

    + +
  6. + +
+ +
+ + + + +

2.6. Attachment support (more global options)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description description + +

+ Plain text description of the following attachment. Applies to the next --attach-file or --attach-file-once option. + + +

+ +
--attachment-mime-type MIME type + +

+ MIME type of the following attachment. Applies to the next --attach-file or --attach-file-once option. A list of officially recognized + MIME types can be found e.g. at the IANA + homepage. The MIME type is mandatory for an attachment. + +

+ + +

+ If no MIME type is given a for an attachment, its type will be detected automatically. + +

+ +
--attachment-name name + +

+ Sets the name that will be stored in the output file for this attachment. If this + option is not given then the name will be derived + from the file name of the attachment as given with the --attach-file or the --attach-file-once option. + +

+ +
+ --attach-file file-name, + --attach-file-once file-name + + +

+ Creates a file attachment inside the Matroska(tm) file. The MIME type must have been set before this option can used. The + difference between the two forms is that during splitting the files attached with + --attach-file are attached to all + output files while the ones attached with --attach-file-once are only attached to the first file created. If + splitting is not used then both do the same. + +

+ + +

+ mkvextract(1) can be used to extract attached files from a Matroska(tm) file. + +

+ +
--enable-legacy-font-mime-types + +

+ Enables the use of legacy MIME types for certain types of font attachments. For example, + 'application/x-truetype-font' will be used for TrueType fonts instead of 'fonts/ttf'. + +

+ + +

+ This affects both new attachments if its MIME type is detected automatically and existing attachments whose stored + MIME types will be remapped to the legacy ones. + +

+ + +

+ The affected MIME types are 'font/sfnt', 'font/ttf' and + 'font/collection' which are all mapped to 'application/x-truetype-fonts' and + 'font/otf' which is mapped to 'application/vnd.ms-opentype'. + +

+ +
+ + + +

2.7. Options that can be used for each input file

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks [!]n,m,... + +

+ Copy the audio tracks n, m etc. The numbers are track IDs which can be obtained with the + --identify switch. They're not simply the track numbers (see + section track IDs). Default: copy all audio tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This will only + work for source files that provide language tags + for their tracks. + +

+ + +

+ Default: copy all tracks of this kind. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is reversed: copy all tracks of this kind but the ones listed + after the !. + +

+ +
-d, --video-tracks [!]n,m,... + +

+ Copy the video tracks n, m etc. The numbers are track IDs which can be obtained with the + --identify switch. They're not simply the track numbers (see + section track IDs). Default: copy all video tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This will only + work for source files that provide language tags + for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is reversed: copy all tracks of this kind but the ones listed + after the !. + +

+ +
-s, --subtitle-tracks [!]n,m,... + +

+ Copy the subtitle tracks n, m etc. The numbers are track IDs which can be obtained with + the --identify switch. They're not simply the track numbers (see + section track IDs). Default: copy all subtitle tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This will only + work for source files that provide language tags + for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is reversed: copy all tracks of this kind but the ones listed + after the !. + +

+ +
-b, --button-tracks [!]n,m,... + +

+ Copy the button tracks n, m etc. The numbers are track IDs which can be obtained with + the --identify switch. They're not simply the track numbers (see + section track IDs). Default: copy all button tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This will only + work for source files that provide language tags + for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is reversed: copy all tracks of this kind but the ones listed + after the !. + +

+ +
--track-tags [!]n,m,... + +

+ Copy the tags for tracks n, m etc. The numbers are track IDs which can be obtained with + the --identify switch (see section track IDs). They're not simply the track numbers. Default: copy tags for all tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is reversed: copy everything but the IDs listed after the + !. + +

+ +
-m, --attachments [!]n[:all|first],m[:all|first],... + +

+ Copy the attachments with the IDs n, m etc to all or only the first output file. Each ID + can be followed by either ':all' (which is the default if neither is entered) or ':first'. If + splitting is active then those attachments whose IDs are specified with ':all' are copied to all of the resulting + output files while the others are only copied into the first output file. If splitting + is not active then both variants have the same + effect. + +

+ + +

+ The default is to copy all attachments to all output files. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is reversed: copy everything but the IDs listed after the + !. + +

+ +
-A, --no-audio + +

+ Don't copy any audio track from this file. + +

+ +
-D, --no-video + +

+ Don't copy any video track from this file. + +

+ +
-S, --no-subtitles + +

+ Don't copy any subtitle track from this file. + +

+ +
-B, --no-buttons + +

+ Don't copy any button track from this file. + +

+ +
-T, --no-track-tags + +

+ Don't copy any track specific tags from this file. + +

+ +
--no-chapters + +

+ Don't copy chapters from this file. + +

+ +
-M, --no-attachments + +

+ Don't copy attachments from this file. + +

+ +
--no-global-tags + +

+ Don't copy global tags from this file. + +

+ +
-y, --sync TID:d[,o[/p]] + +

+ Adjust the timestamps of the track with the id TID by d ms. The track IDs are the same as + the ones given with --identify (see section track IDs). + +

+ + +

+ o/p: adjust the timestamps by o/p to fix + linear drifts. p defaults to 1 if omitted. Both o and p can be + floating point numbers. + +

+ + +

+ Defaults: no manual sync correction (which is the same as d = 0 and + o/p = 1.0). + +

+ + +

+ This option can be used multiple times for an input file applying to several tracks + by selecting different track IDs each time. + +

+ +
--cues TID:none|iframes|all + +

+ Controls for which tracks cue (index) entries are created for the given track (see + section track + IDs). 'none' inhibits the creation of cue entries. For 'iframes' only blocks with + no backward or forward references ( = I frames in video tracks) are put into the cue + sheet. 'all' causes + mkvmerge(1) to create cue entries for all blocks which will make the file very big. + +

+ + +

+ The default is 'iframes' for video and subtitle tracks and 'none' for audio tracks. See also + option --no-cues which inhibits the creation of cue entries + regardless of the --cues options used. + +

+ + +

+ This option can be used multiple times for an input file applying to several tracks + by selecting different track IDs each time. + +

+ +
--default-track-flag TID[:bool] + +

+ Sets the "default track" flag for the given track (see section track IDs) if the + optional argument bool is set to 1 or if it isn't present. The flag will be set if the + source container doesn't provide that information and the user doesn't specify it + via this option. + +

+ + +

+ If the user does not explicitly select a track during playback, the player should + select one of the tracks that has its "default + track" flag set, taking user preferences such as their preferred language into account. + +

+ + +

+ This option can be used multiple times for an input file applying to several tracks + by selecting different track IDs each time. + +

+ +
--track-enabled-flag TID[:bool] + +

+ Sets the "track enabled" flag for the given track (see section track IDs) to the + given value bool (0 or 1; defaults to 1 if not specified). Tracks are enabled by default if no option + is + specified for them and the source container doesn't provide this information either. + +

+ + +

+ Only tracks whose "track enabled" flag is set should be considered for playback. + +

+ + +

+ This option can be used multiple times for an input file applying to several tracks + by selecting different track IDs each time. + +

+ +
--forced-display-flag TID[:bool] + +

+ Sets the "forced display" flag for the given track (see section track IDs) if the + optional argument bool is set to 1 or if it isn't present. Use this for tracks + containing onscreen text or foreign-language dialogue. + +

+ + +

+ This option can be used multiple times for an input file applying to several tracks + by selecting different track IDs each time. + +

+ +
--hearing-impaired-flag TID[:bool] + +

+ Sets the "hearing impaired" flag for the given track (see section track IDs) if the + optional argument bool is set to 1 or if it isn't present. This flag can be set if the + track is suitable for users with hearing impairments. + +

+ + +

+ This option can be used multiple times for an input file applying to several tracks + by selecting different track IDs each time. + +

+ +
--visual-impaired-flag TID[:bool] + +

+ Sets the "visual impaired" flag for the given track (see section track IDs) if the + optional argument bool is set to 1 or if it isn't present. This flag can be set if the + track is suitable for users with visual impairments. + +

+ + +

+ This option can be used multiple times for an input file applying to several tracks + by selecting different track IDs each time. + +

+ +
--text-descriptions-flag TID[:bool] + +

+ Sets the "text descriptions" flag for the given track (see section track IDs) if + the optional argument bool is set to 1 or if it isn't present. This flag can be set if + the track contains textual descriptions of video content suitable for playback via + a text-to-speech system for a visually-impaired + user. + +

+ + +

+ This option can be used multiple times for an input file applying to several tracks + by selecting different track IDs each time. + +

+ +
--original-flag TID[:bool] + +

+ Sets the "original language" flag for the given track (see section track IDs) if + the optional argument bool is set to 1 or if it isn't present. This flag can be set if + the track is in the content's original language (not a translation). + +

+ + +

+ This option can be used multiple times for an input file applying to several tracks + by selecting different track IDs each time. + +

+ +
--commentary-flag TID[:bool] + +

+ Sets the "commentary" flag for the given track (see section track IDs) if the + optional argument bool is set to 1 or if it isn't present. This flag can be set if the + track contains commentary. + +

+ + +

+ This option can be used multiple times for an input file applying to several tracks + by selecting different track IDs each time. + +

+ +
--track-name TID:name + +

+ Sets the track name for the given track (see section track IDs) to + name. + +

+ +
--language TID:language + +

+ Sets the language for the given track (see section track IDs). Both ISO 639-2 language codes + and ISO 639-1 country codes are allowed. The country codes will be converted to language + codes automatically. All languages including + their ISO 639-2 codes can be listed with the --list-languages option. + +

+ + +

+ This option can be used multiple times for an input file applying to several tracks + by selecting different track IDs each time. + +

+ +
-t, --tags TID:file-name + +

+ Read tags for the track with the number TID from the file file-name. See the section + about tags below for details. + +

+ +
--aac-is-sbr TID[:0|1] + +

+ Tells mkvmerge(1) that the track with the ID TID is SBR AAC (also known as + HE-AAC or AAC+). This options is needed if a) the source file is an AAC file + (not for a Matroska(tm) file) and b) the AAC file contains SBR AAC data. The + reason for this switch is that it is technically impossible to automatically tell + normal AAC data from SBR + AAC data without decoding a complete AAC frame. As there are several patent issues with AAC + decoders mkvmerge(1) will never contain this decoding stage. So for SBR AAC files this switch is mandatory. The + resulting file might not play back correctly or even not at all if the switch was + omitted. + +

+ + +

+ If the source file is a Matroska(tm) file then the CodecID should be enough to detect SBR + AAC. However, if the CodecID is wrong then this switch can be used to correct that. + +

+ + +

+ If mkvmerge wrongfully detects that an AAC file is SBR then you can add + ':0' to the track ID. + +

+ +
--audio-emphasis TID:n|symbolic-name + +

+ Sets the emphasis for the audio track with the track ID TID. The mode can either be a number + n (certain values between 0 and 16) or a symbolic name. All valid + numbers & symbolic names can be listed with the --list-audio-emphasis option. + +

+ +
--reduce-to-core TID + +

+ Some audio codecs have a lossy core and optional extensions that implement lossless + decoding. This option tells mkvmerge(1) to only + copy the core but not the extensions. By default mkvmerge(1) copies both the core and the extensions. + +

+ + +

+ Currently only DTS tracks are affected by this option. TrueHD tracks that contain an embedded AC-3 + core are instead presented as two separate tracks for which the user can select which + track to copy. For DTS such a + scheme would not work as the HD extensions cannot be decoded by themselves – unlike + the TrueHD data. + +

+ +
--remove-dialog-normalization-gain TID + +

+ Some audio codecs contain header fields that tell the decoder or player to apply a + (usually negative) gain for dialog + normalization. This option tells mkvmerge(1) to remove or minimize that gain by modifying the corresponding header fields. + +

+ + +

+ Currently only AC-3, DTS and TrueHD tracks are affected by this option. + +

+ +
--timestamps TID:file-name + +

+ Read the timestamps to be used for the specific track ID from file-name. These timestamps forcefully override + the timestamps that mkvmerge(1) normally calculates. Read the section about external + timestamp files. + +

+ +
--default-duration TID:x + +

+ Forces the default duration of a given track to the specified value. Also modifies + the track's timestamps to match the default + duration. The argument x must be postfixed with 's', 'ms', + 'us', 'ns', 'fps', 'p' or 'i' to + specify the default duration in seconds, milliseconds, microseconds, nanoseconds, + 'frames per second', 'progressive frames per + second' or 'interlaced frames per second' respectively. The number x itself can be a floating point number or + a fraction. + +

+ + +

+ If the default duration is not forced then mkvmerge will try to derive the track's + default duration from the container and/or the + encoded bitstream for certain track types, e.g. AVC/H.264 or MPEG-2. + +

+ + +

+ This option can also be used to change the FPS of video tracks without having to use an external timestamp file. + +

+ +
--fix-bitstream-timing-information TID[:0|1] + +

+ Normally mkvmerge(1) does not change the timing information (frame/field rate) stored in the video bitstream. + With this option that + information is adjusted to match the container timing information. The container timing + information can come from various sources: + from the command line (see option --default-duration), + the source container or derived from the bitstream. + +

+ + +
+

Note:

+ +

This has only been implemented for AVC/H.264 video tracks so far.

+ +
+ +
--compression TID:n + +

+ Selects the compression method to be used for the track. Note that the player also + has to support this method. Valid values are + 'none', 'zlib' and 'mpeg4_p2'/'mpeg4p2'. + +

+ +

+ The compression method 'mpeg4_p2'/'mpeg4p2' is a special compression method called 'header + removal' that is only available for MPEG4 part 2 video tracks. + +

+ +

+ The default for some subtitle types is 'zlib' compression. This compression method is also the one that most if + not all playback applications support. Support for other compression methods other + than 'none' is not assured. + +

+ +
+ + + +

2.8. Options that only apply to video tracks

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc TID:FourCC + +

+ Forces the FourCC to the specified value. Works only for video tracks in the 'MS compatibility mode'. + +

+ +
--display-dimensions TID:widthxheight + +

+ Matroska(tm) files contain two values that set the display properties that a player should scale + the image on playback to: display width + and display height. These values can be set with this option, e.g. '1:640x480'. + +

+ + +

+ Another way to specify the values is to use the --aspect-ratio or the --aspect-ratio-factor option (see below). These options + are mutually exclusive. + +

+ +
--aspect-ratio TID:ratio|width/height + +

+ Matroska(tm) files contain two values that set the display properties that a player should scale + the image on playback to: display width + and display height. With this option mkvmerge(1) will automatically calculate the display width and display height based on the + image's original width and height and the aspect ratio given with this option. The + ratio can be given either as a floating point + number ratio or as a fraction 'width/height', + e.g. '16/9'. + +

+ + +

+ Another way to specify the values is to use the --aspect-ratio-factor or --display-dimensions options (see above and below). These + options are mutually exclusive. + +

+ +
--aspect-ratio-factor TID:factor|n/d + +

+ Another way to set the aspect ratio is to specify a factor. The original aspect ratio is first multiplied with + this factor and used as the target aspect ratio afterwards. + +

+ + +

+ Another way to specify the values is to use the --aspect-ratio or --display-dimensions options (see above). These options are + mutually exclusive. + +

+ +
--cropping TID:left,top,right,bottom + +

+ Sets the pixel cropping parameters of a video track to the given values. + +

+ +
--color-matrix-coefficients TID:n + +

+ Sets the matrix coefficients of the video used to derive luma and chroma values from + red, green and blue color primaries. The + parameter n is an integer rangeing from 0 and 10. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: GBR, 1: BT709, 2: unspecified, 3: reserved, + 4: FCC, 5: BT470BG, 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 non-constant luminance, 10: BT2020 constant + luminance + +

+ +
--color-bits-per-channel TID:n + +

+ Sets the number of coded bits for a color channel. A value of 0 indicates that the number of bits is + unspecified. + +

+ +
--chroma-subsample TID:hori,vert + +

+ The amount of pixels to remove in the Cr and Cb channels for every pixel not removed + horizontally/vertically. + +

+ + +

+ Example: For video with 4:2:0 chroma subsampling, the parameter should be set to + TID:1,1. + +

+ +
--cb-subsample TID:hori,vert + +

+ The amount of pixels to remove in the Cb channel for every pixel not removed horizontally/vertically. + This is additive with + --chroma-subsample. + +

+ + +

+ Example: For video with 4:2:1 chroma subsampling, the parameter --chroma-subsample should be set to + TID:1,0 and Cb-subsample should be set to + TID:1,0. + +

+ +
--chroma-siting TID:hori,vert + +

+ Sets how chroma is sited horizontally/vertically (0: unspecified, 1: top collocated, + 2: half). + +

+ +
--color-range TID:n + +

+ Sets the clipping of the color ranges (0: unspecified, 1: broadcast range, + 2: full range (no clipping), 3: defined by MatrixCoefficients/TransferCharacteristics). + +

+ +
--color-transfer-characteristics TID:n + +

+ The transfer characteristics of the video. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, 2: unspecified, 3: + reserved, 4: gamma 2.2 curve, 5: gamma 2.8 curve, 6: SMPTE 170M, + 7: SMPTE 240M, 8: linear, 9: log, 10: log sqrt, + 11: IEC 61966-2-4, 12: ITU-R BT.1361 extended color gamut, 13: IEC + 61966-2-1, 14: ITU-R BT.2020 10 bit, 15: ITU-R BT.2020 12 bit, 16: + SMPTE ST 2084, 17: SMPTE ST 428-1; 18: ARIB STD-B67 (HLG) + +

+ +
--color-primaries TID:n + +

+ Sets the color primaries of the video. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, 2: unspecified, 3: + reserved, 4: ITU-R BT.470M, 5: ITU-R BT.470BG, 6: SMPTE 170M, + 7: SMPTE 240M, 8: FILM, 9: ITU-R BT.2020, 10: + SMPTE ST 428-1, 22: JEDEC P22 phosphors + +

+ +
--max-content-light TID:n + +

+ Sets the maximum brightness of a single pixel (Maximum Content Light Level) in candelas + per square meter (cd/m²). The value of + n should be a non-negtive integer. + +

+ +
--max-frame-light TID:n + +

+ Sets the maximum brightness of a single full frame (Maximum Frame-Average Light Level) + in candelas per square meter (cd/m²). The + value of n should be a non-negtive + integer. + +

+ +
--chromaticity-coordinates + TID:red-x,red-y,green-x,green-y,blue-x,blue-y + +

+ Sets the red/green/blue chromaticity coordinates as defined by CIE 1931. + +

+ +
--white-color-coordinates TID:x,y + +

+ Sets the white color chromaticity coordinates as defined by CIE 1931. + +

+ +
--max-luminance TID:float + +

+ Sets the maximum luminance in candelas per square meter (cd/m²). The value should + be less than 9999.99. + +

+ +
--min-luminance TID:float + +

+ Sets the minimum luminance in candelas per square meter (cd/m²). The value should + be less than 999.9999. + +

+ +
--projection-type TID:method + +

+ Sets the video projection method used. Valid values are 0 (rectangular projection), + 1 (equirectangular projection), 2 (cubemap projection) and 3 (mesh projection). + +

+ +
--projection-private TID:data + +

+ Sets private data that only applies to a specific projection. Data must be given as + hex numbers with or without the "0x" prefix, with or without spaces. + +

+ +
--projection-pose-yaw TID:float + +

+ Specifies a yaw rotation to the projection. + +

+ +
--projection-pose-pitch TID:float + +

+ Specifies a pitch rotation to the projection. + +

+ +
--projection-pose-roll TID:float + +

+ Specifies a roll rotation to the projection. + +

+ +
--field-order TID:n + +

+ Sets the field order for the video track with the track ID TID. The order must be one of the following numbers: + +

+ + +

+ 0: progressive; 1: interlaced with top field displayed first and top field stored first; + 2: undetermined field order; 6: interlaced with bottom field displayed first and bottom + field stored first; 9: interlaced with bottom field displayed first and top field stored first; + 14: interlaced with top field displayed first and bottom field stored first + +

+ +
--stereo-mode TID:n|symbolic-name + +

+ Sets the stereo mode for the video track with the track ID TID. The mode can either be a number + n between 0 and 14 or a symbolic name. All valid numbers & names + can be listed with the --list-stereo-modes option. + +

+ +
+ + + +

2.9. Options that only apply to text subtitle tracks

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset TID:character-set + +

+ Sets the character set for the conversion to UTF-8 for UTF-8 subtitles for the given + track ID. If not specified the charset will be + derived from the current locale settings. Note that a charset is not needed for subtitles + read from Matroska(tm) files or from Kate + streams, as these are always stored in UTF-8. See the section about text files and + character sets for an explanation how mkvmerge(1) converts between character sets. + +

+ + +

+ This option can be used multiple times for an input file applying to several tracks + by selecting different track IDs each time. + +

+ +
+ + + +

2.10. Other options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify file-name + +

+ Will let mkvmerge(1) probe the single file and report its type, the tracks contained in the file and their + track IDs. If this option is + used then the only other option allowed is the filename. + +

+ + +

The output format used for the result can be changed with the option --identification-format. +

+ +
-J file-name + +

+ This is a convenient alias for "--identification-format json --identify file-name". + +

+ +
-F, --identification-format format + +

+ Determines the output format used by the --identify + option. The following formats are supported: text (the default if this option isn't used) and + json. + +

+ + +
    + +
  1. + +

    The text format is short and human-readable. It consists of one line per item found (container, + tracks, attachments etc.). +

    + + +

    This format is not meant to be parsed. The output will be translated into the language + mkvmerge(1) uses (see also --ui-language). +

    + +
  2. + + +
  3. + +

    + The json format outputs a machine-readable JSON representation. This format follows the JSON + schema described in + the following file: + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + All versions of the JSON schema are available both online and in the released source + code archives. + +

    + +
  4. + +
+ +
--probe-range-percentage percentage + +

+ File types such as MPEG program and transport streams (.vob, .m2ts) require parsing a certain + amount of data in order to detect all tracks contained in the file. This amount is + 0.3% of the source file's size or 10 MB, + whichever is higher. + +

+ + +

+ If tracks are known to be present but not found then the percentage to probe can be + changed with this option. The minimum of 10 MB + is built-in and cannot be changed. + +

+ +
--list-audio-emphasis + +

+ Lists all valid numbers & their corresponding symbolic names for the --audio-emphasis option. + +

+ +
--list-languages + +

+ Lists all languages and their ISO 639-2 code which can be used with the --language option. + +

+ +
--list-stereo-modes + +

+ Lists all valid numbers & their corresponding symbolic names for the --stereo-mode option. + +

+ +
-l, --list-types + +

+ Lists supported input file types. + +

+ +
--priority priority + +

+ Sets the process priority that mkvmerge(1) runs with. Valid values are 'lowest', 'lower', + 'normal', 'higher' and 'highest'. If nothing is given then + 'normal' is used. On Unix like systems mkvmerge(1) will use the + nice(2) function. Therefore only the super user can + use 'higher' and 'highest'. On Windows all values are useable for every user. + +

+ + +

Selecting 'lowest' also causes mkvmerge(1) to select idle I/O priority in addition to the lowest possible + process priority. +

+ +
--command-line-charset character-set + +

+ Sets the character set to convert strings given on the command line from. It defaults + to the character set given by system's current + locale. This settings applies to arguments of the following options: --title, --track-name and --attachment-description. + +

+ +
--output-charset character-set + +

+ Sets the character set to which strings are converted that are to be output. It defaults + to the character set given by system's + current locale. + +

+ +
-r, --redirect-output file-name + +

+ Writes all messages to the file file-name instead of to the console. While this can be done easily with output + redirection there are cases in which this option is needed: when the terminal reinterprets + the output before writing it to a file. + The character set set with --output-charset is honored. + +

+ +
--flush-on-close + +

+ Tells the program to flush all data cached in memory to storage when closing files + opened for writing. + This can be used to prevent data loss on power outages or to circumvent certain problems + in the operating system or drivers. + The downside is that multiplexing will take longer as mkvmerge will wait until all + data has been written to the storage before exiting. + See issues #2469 and #2480 on the MKVToolNix bug tracker for in-depth discussions + on the pros and cons. + +

+ +
--ui-language code + +

+ Forces the translations for the language code to be used (e.g. 'de_DE' for the German + translations). Entering 'list' as the code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Tells the program to abort after the first warning is emitted. The program's exit + code will be 1. + +

+ +
--deterministic seed + +

+ Enables the creation of byte-identical files if the same version of mkvmerge(1) is used with the same source files, the same set of + options and the same seed. Note that the "date" segment information field is not + written in this mode. + +

+ + +

The seed can be an arbitrary string and does not have to be a number.

+ + +

+ The result of byte-identical files is only guaranteed under the following conditions: + +

+ + +
    + +
  1. + +

    The same version of mkvmerge(1) built with the same versions of libEBML and libMatroska is used. +

    + +
  2. + + +
  3. + +

    The source files used are byte-identical.

    + +
  4. + + +
  5. + +

    The same command line options are used in the same order (with the notable exception + of --output …). +

    + +
  6. + +
+ + +

+ Using other versions of mkvmerge(1) or other command-line options may result in the same byte-identical file but is not + guaranteed to do so. + +

+ +
--debug topic + +

+ Turn on debugging for a specific feature. This option is only useful for developers. + +

+ +
--engage feature + +

+ Turn on experimental features. A list of available features can be requested with + mkvmerge --engage list. These + features are not meant to be used in normal situations. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that can tell + a controlling GUI what's happening. These + messages follow the format '#GUI#message'. The message may be followed by key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the messages nor the keys are ever translated and always output + in English. + +

+ +
@options-file.json + +

+ Reads additional command line arguments from the file options-file. See the section about option files for further information. + +

+ +
--capabilities + +

+ Lists information about optional features that have been compiled in and exit. The + first line output will be the version + information. All following lines contain exactly one word whose presence indicates + that the feature has been compiled in. These + features are: + +

+ + +
    + +
  • + +

    + 'FLAC' -- reading raw FLAC files and handling FLAC tracks in other containers, + e.g. Ogg(tm) or Matroska(tm). + +

    + +
  • + +
+ +
-h, --help + +

+ Show usage information and exit. + +

+ +
-V, --version + +

+ Show version information and exit. + +

+ +
+ + +

3. Usage

+ + +

+ For each file the user can select which tracks mkvmerge(1) should take. They are all put into the file specified with + -o. A list of known (and supported) source formats can be obtained with the -l option. + +

+ + +
+

Important:

+ +

+ The order of command line options is important. Please read the section "Option + order" if you're new to the program. + +

+ +
+ +

4. Option order

+ + + +

+ The order in which options are entered is important for some options. Options fall + into two categories: + +

+ + +
    + +
  1. + +

    + Options that affect the whole program and are not tied to any input file. These include + but are not limited to + --command-line-charset, --output or --title. These can appear anywhere on the + command line. + +

    + +
  2. + + +
  3. + +

    + Options that affect a single input file or a single track in an input file. These + options all apply to the following input file on the + command line. All options applying to the same input (or to tracks from the same input + file) file can be written in any order as long + as they all appear before that input file's name. Examples for options applying to + an input file are --no-chapters or + --chapter-charset. Examples for options applying to a single track are --default-duration or + --language. + +

    + +
  4. + +
+ + +

+ The options are processed from left to right. If an option appears multiple times + within the same scope then the last occurrence will be + used. Therefore the title will be set to "Something else" in the following example: + +

+ +
$ mkvmerge -o output.mkv --title 'This and that' input.avi --title 'Something else'
+ +

+ The following example shows that using the --language option twice is OK because they're used in different scopes. Even + though they apply to the same track ID they apply to different input files and therefore + have different scopes: + +

+ +
$ mkvmerge -o output.mkv --language 0:fre français.ogg --language 0:deu deutsch.ogg
+

5. Examples

+ + +

+ Let's assume you have a file called MyMovie.avi and the audio track in a separate + file, e.g. 'MyMovie.wav'. First you + want to encode the audio to OggVorbis(tm): + +

+ +
$ oggenc -q4 -oMyMovie.ogg MyMovie.wav
+ +

+ After a couple of minutes you can join video and audio: + +

+ +
$ mkvmerge -o MyMovie-with-sound.mkv MyMovie.avi MyMovie.ogg
+ +

+ If your AVI already contains an audio track then it will be copied as well (if mkvmerge(1) supports the audio format). To + avoid that simply do + +

+ +
$ mkvmerge -o MyMovie-with-sound.mkv -A MyMovie.avi MyMovie.ogg
+ +

+ After some minutes of consideration you rip another audio track, e.g. the director's + comments or another language to + 'MyMovie-add-audio.wav'. Encode it again and join it up with the other file: + +

+ +
$ oggenc -q4 -oMyMovie-add-audio.ogg MyMovie-add-audio.wav
+$ mkvmerge -o MM-complete.mkv MyMovie-with-sound.mkv MyMovie-add-audio.ogg
+ +

+ The same result can be achieved with + +

+ +
$ mkvmerge -o MM-complete.mkv -A MyMovie.avi MyMovie.ogg MyMovie-add-audio.ogg
+ +

+ Now fire up mplayer(tm) and enjoy. If you have multiple audio tracks (or even video tracks) then you can + tell + mplayer(tm) which track to play with the '-vid' and '-aid' options. These are + 0-based and do not distinguish between video and audio. + +

+ + +

+ If you need an audio track synchronized you can do that easily. First find out which + track ID the Vorbis track has with + +

+ +
$ mkvmerge --identify outofsync.ogg
+ +

+ Now you can use that ID in the following command line: + +

+ +
$ mkvmerge -o goodsync.mkv -A source.avi -y 12345:200 outofsync.ogg
+ +

+ This would add 200ms of silence at the beginning of the audio track with the + ID 12345 taken from 'outofsync.ogg'. + +

+ + +

+ Some movies start synced correctly but slowly drift out of sync. For these kind of + movies you can specify a delay factor that is applied + to all timestamps -- no data is added or removed. So if you make that factor too big + or too small you'll get bad results. An example is + that an episode I transcoded was 0.2 seconds out of sync at the end of the movie which was + 77340 frames long. At 29.97fps 0.2 seconds correspond to + approx. 6 frames. So I did + +

+ +
$ mkvmerge -o goodsync.mkv -y 23456:0,77346/77340 outofsync.mkv
+ +

+ The result was fine. + +

+ + +

+ The sync options can also be used for subtitles in the same manner. + +

+ + +

+ For text subtitles you can either use some Windows software (like SubRipper(tm)) or the + subrip(tm) package found in + transcode(1)'s sources in the + 'contrib/subrip' directory. The general process is: + +

+ + +
    + +
  1. + +

    extract a raw subtitle stream from the source:

    +
    $ tccat -i /path/to/copied/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o mymovie
    +
  2. + + +
  3. + +

    convert the resulting PGM images to text with gocr:

    +
    $ pgm2txt mymovie
    +
  4. + + +
  5. + +

    spell-check the resulting text files:

    +
    $ ispell -d american *txt
    +
  6. + + +
  7. + +

    convert the text files to a SRT file:

    +
    $ srttool -s -w -i mymovie.srtx -o mymovie.srt
    +
  8. + +
+ + +

+ The resulting file can be used as another input file for mkvmerge(1): + +

+ +
$ mkvmerge -o mymovie.mkv mymovie.avi mymovie.srt
+ +

+ If you want to specify the language for a given track then this is easily done. First + find out the ISO 639-2 code for your + language. mkvmerge(1) can list all of those codes for you: + +

+ +
$ mkvmerge --list-languages
+ +

+ Search the list for the languages you need. Let's assume you have put two audio tracks + into a Matroska(tm) file and want to set their + language codes and that their track IDs are 2 and 3. This can be done with + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut without-lang-codes.mkv
+ +

+ As you can see you can use the --language switch multiple times. + +

+ + +

+ Maybe you'd also like to have the player use the Dutch language as the default language. + You also have extra subtitles, e.g. in English + and French, and want to have the player display the French ones by default. This can + be done with + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut --default-track-flag 3 without-lang-codes.mkv --language 0:eng english.srt --default-track-flag 0 --language 0:fre french.srt
+ +

+ If you do not see the language or default track flags that you've specified in mkvinfo(1)'s output then please read the + section about default values. + +

+ + +

+ Turn off the compression for an input file. + +

+ +
$ mkvmerge -o no-compression.mkv --compression -1:none MyMovie.avi --compression -1:none mymovie.srt
+ +

6. Track IDs

+ + + +

6.1. Regular track IDs

+ + + +

+ Some of the options for mkvmerge(1) need a track ID to specify which track they should be applied to. Those track IDs + are printed by the + readers when demuxing the current input file, or if mkvmerge(1) is called with the --identify option. An example for such output: + +

+ +
$ mkvmerge -i v.mkv
+File 'v.mkv': container: Matroska
+Track ID 0: video (V_MS/VFW/FOURCC, DIV3)
+Track ID 1: audio (A_MPEG/L3)
+ +

+ Do not confuse the track IDs that are assigned to the tracks that are placed in the + output MKV file with the track IDs of the input + files. Only the input file track IDs are used for options needing these values. + +

+ + +

+ Also note that each input file has its own set of track IDs. Therefore the track IDs + for file 'file1.ext' as + reported by 'mkvmerge --identify' do not change no matter how many other input files are there or in which position + 'file1.ext' is used. + +

+ + +

+ Track IDs are assigned like this: + +

+ + +
    + +
  • + +

    + AVI files: The video track has the ID 0. The audio tracks get IDs in ascending order + starting at 1. + +

    + +
  • + + +
  • + +

    + AAC, AC-3, MP3, SRT and WAV files: The one 'track' + in that file gets the ID 0. + +

    + +
  • + + +
  • + +

    + Most other files: The track IDs are assigned in order the tracks are found in the + file starting at 0. + +

    + +
  • + +
+ + +

+ The options that use the track IDs are the ones whose description contains 'TID'. The following options use track IDs + as well: --audio-tracks, --video-tracks, --subtitle-tracks, + --button-tracks and --track-tags. + +

+ + + +

6.2. Special track IDs

+ + + +

+ There are several IDs that have special meaning and do not occur in the identification + output. + +

+ + +

+ The special track ID '-1' is a wild card and applies the given switch to all tracks that are read from an + input + file. + +

+ + +

+ The special track ID '-2' refers to the chapters in a source file. Currently only the --sync + option uses this special ID. As an alternative to --sync -2:… the option --chapter-sync … can be used. + +

+ + +

7. Language handling

+ + + +

+ Matroska(tm) has support for two different types of language elements: the old, deprecated "Language" + element containing ISO 639-2 alpha 3 + codes and the new "LanguageIETF" tags containing IETF BCP 47 language tags. All of + mkvmerge(1)'s options that accept a language accept a + BCP 47 language tag. mkvmerge(1) will derive the value for the deprecated "Language" element from the BCP 47 language + tags wherever possible. + +

+ + +

+ When identifying a file in JSON mode, existing "LanguageIETF" track header elements + will be output as the + language_ietf track property. + +

+ + +

+ When writing a file mkvmerge(1) will always write the "LanguageIETF", "ChapLanguageIETF" and "TagLanguageIETF" elements + (the latter two + only if chapters or tags are written respectively). In addition to those elements + the corresponding old elements will be written; they'll + be set to the ISO 639-2 code portion of the BCP 47 language tag. For example, when + the track language is set to + sr-Cyrl-RS "LanguageIETF" will be set to sr-Cyrl-RS and the old "Language" element will be set to + srp. + +

+ + +

+ When reading existing files (Matroska files, XML chapter or tag files etc.) that already + contain "…LanguageIETF" elements the existing + elements will be kept. Otherwise "…LanguageIETF" elements will be added based on command-line + options and other existing deprecated + "…Language" elements. + +

+ + +

+ The creation of the new elements can be disabled completely with the command-line + option --disable-language-ietf which + operates on all three new elements. + +

+ + +

+ You can chose the normalization method applied to extended language sub-tags with + the parameter --normalize-language-ietf. + +

+ +

8. Text files and character set conversions

+ + +
+

Note:

+ +

+ This section applies to all programs in MKVToolNix even if it only mentions mkvmerge(1). + +

+ +
+ + +

8.1. Introduction

+ + +

+ All text in a Matroska(tm) file is encoded in UTF-8. This means that mkvmerge(1) has to convert every text file it reads as well as every + text given on the command line from one character set into UTF-8. In return this also + means that mkvmerge(1)'s output has to be converted + back to that character set from UTF-8, e.g. if a non-English translation is used with + --ui-language or for text originating from a Matroska(tm) file. + +

+ + +

+ mkvmerge(1) does this conversion automatically based on the presence of a byte order marker (short: + BOM) or the system's + current locale. How the character set is inferred from the locale depends on the operating + system that mkvmerge(1) is run on. + +

+ + + +

8.2. Byte order markers (BOM)

+ + + +

+ Text files that start with a BOM are already encoded in one representation of UTF. + mkvmerge(1) supports the following five modes: UTF-8, + UTF-16 Little and Big Endian, UTF-32 Little and Big Endian. Text files with a BOM + are automatically converted to UTF-8. Any of the + parameters that would otherwise set the character set for such a file (e.g. --sub-charset) is silently ignored. + +

+ + + +

8.3. Linux and Unix-like systems including macOS

+ + + +

+ On Unix-like systems mkvmerge(1) uses the setlocale(3) + system call which in turn uses the environment variables LANG, LC_ALL and + LC_CYPE. The resulting character set is often one of UTF-8 or the ISO-8859-* family and is + used for all text file + operations and for encoding strings on the command line and for output to the console. + +

+ + + +

8.4. Windows

+ + + +

+ On Windows the default character set used for converting text files is determined + by a call to the GetACP() system + call. + +

+ + +

+ Reading the command line is done with the GetCommandLineW() function which already returns a Unicode + string. Therefore the option --command-line-charset is ignored on Windows. + +

+ + +

+ Output to the console consists of three scenarios: + +

+ + +
    + +
  1. + +

    + If the output is redirected with the option --redirect-output then the default charset is UTF-8. This can + be changed with --output-charset. + +

    + +
  2. + + +
  3. + +

    + If the output is redirected with cmd.exe itself, e.g. with mkvinfo file.mkv > info.txt, then + the charset is always UTF-8 and cannot be changed. + +

    + +
  4. + + +
  5. + +

    + Otherwise (when writing directly to the console) the Windows function WriteConsoleW() is used and the option + --output-charset is ignored. The console should be able to + output all Unicode characters for which the corresponding language support is installed + (e.g. Chinese characters might not be + displayed on English Windows versions). + +

    + +
  6. + +
+ + + +

8.5. Command line options

+ + + +

+ The following options exist that allow specifying the character sets: + +

+ + +
    + +
  • + +

    + --sub-charset for text subtitle files and for text subtitle + tracks stored in container formats for which the character set cannot be determined + unambiguously (e.g. Ogg files), + +

    + +
  • + + +
  • + +

    + --chapter-charset for chapter text files and for chapters + and file titles stored in container formats for which the character set cannot be + determined unambiguously (e.g. Ogg files for chapter + information, track and file titles etc; MP4 files for chapter information), + +

    + +
  • + + +
  • + +

    + --command-line-charset for all strings on the command + line, + +

    + +
  • + + +
  • + +

    + --output-charset for all strings written to the console or + to a file if the output has been redirected with the --redirect-output option. On non-Windows systems the default for + the output charset is the system's current charset. On Windows it defaults to UTF-8 + both for redirecting with --redirect-output and with cmd.exe itself, + e.g. mkvinfo file.mkv > info.txt. + +

    + +
  • + +
+ + +

9. Option files

+ + + +

+ An option file is a file mkvmerge(1) can read additional command line arguments from. This can be used in order to circumvent + certain + limitations of the shell or the operating system when executing external programs + like a limited command line length. + +

+ + +

+ An option file contains JSON-formatted data. Its content must be a valid JSON array + consisting solely of JSON strings. The file's + encoding must be UTF-8. The file should not start with a byte order marker (BOM), but if one exists, it will be skipped. + +

+ + +

+ The rules for escaping special characters inside JSON are the ones in the official + JSON specification, RFC 7159. + +

+ + +

+ The option file's name itself must be specified as a command line argument prefixed + with a '@' character. + +

+ + +

+ The command line 'mkvmerge -o "my file.mkv" -A "a movie.avi" sound.ogg' could be converted into the following + JSON option file called e.g. 'options.json': + +

+ +
[
+  "-o",
+  "c:\\Matroska\\my file.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "a movie.avi",
+  "sound.ogg"
+]
+ +

+ The corresponding command would then be 'mkvmerge @options.json'. + +

+ +

10. File linking

+ + +

+ Matroska(tm) supports file linking which simply says that a specific file is the predecessor or + successor of the current file. To be precise, + it's not really the files that are linked but the Matroska(tm) segments. As most files will probably only contain one Matroska(tm) segment the + following explanations use the term 'file linking' although 'segment linking' would + be more appropriate. + +

+ + +

+ Each segment is identified by a unique 128 bit wide segment UID. This UID is automatically + generated by mkvmerge(1). The linking is done + primarily via putting the segment UIDs (short: SID) of the previous/next file into the segment header + information. mkvinfo(1) prints these SIDs if it finds them. + +

+ + +

+ If a file is split into several smaller ones and linking is used then the timestamps + will not start at 0 again but will continue where the + last file has left off. This way the absolute time is kept even if the previous files + are not available (e.g. when streaming). If no + linking is used then the timestamps should start at 0 for each file. By default mkvmerge(1) does not use file linking. If you want that you + can turn it on with the --link option. This option is only useful if splitting is activated as well. + +

+ + +

+ Regardless of whether splitting is active or not the user can tell mkvmerge(1) to link the produced files to specific + SIDs. This is achieved with the options --link-to-previous and --link-to-next. These + options accept a segment SID in the format that mkvinfo(1) outputs: 16 hexadecimal numbers between + 0x00 and 0xff prefixed with '0x' each, e.g. '0x41 0xda 0x73 0x66 + 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 0x5e 0xca 0xb3 0x93'. Alternatively a shorter form can be used: 16 hexadecimal numbers + between 0x00 and 0xff without the '0x' prefixes and without the spaces, e.g. + '41da7366d9cfb21eae78ebb45ecab393'. + +

+ + +

+ If splitting is used then the first file is linked to the SID given with --link-to-previous and the + last file is linked to the SID given with --link-to-next. If splitting is not used then the one output + file will be linked to both of the two SIDs. + +

+ +

11. Default values

+ + +

+ The Matroska(tm) specification states that some elements have a default value. Usually an element + is not written to the file if its value + is equal to its default value in order to save space. The elements that the user might + miss in mkvinfo(1)'s output are the + language and the default track flag elements. The default value for the + language is English ('eng'), and the default value for the default track + flag is true. Therefore if you used --language 0:eng for a track then it will not + show up in mkvinfo(1)'s output. + +

+ +

12. Attachments

+ + +

+ Maybe you also want to keep some photos along with your Matroska(tm) file, or you're using SSA subtitles and need a + special TrueType(tm) font that's really rare. In these cases you can attach those files to the Matroska(tm) + file. They will not be just appended to the file but embedded in it. A player can + then show those files (the 'photos' case) or use them + to render the subtitles (the 'TrueType(tm) fonts' case). + +

+ + +

+ Here's an example how to attach a photo and a TrueType(tm) font to the output file: + +

+ +
$ mkvmerge -o output.mkv -A video.avi sound.ogg \
+  --attachment-description "Me and the band behind the stage in a small get-together" \
+  --attachment-mime-type image/jpeg \
+  --attach-file me_and_the_band.jpg \
+  --attachment-description "The real rare and unbelievably good looking font" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file really_cool_font.ttf
+ +

+ If a Matroska(tm) containing attachments file is used as an input file then mkvmerge(1) will copy the attachments into the new file. The + selection which attachments are copied and which are not can be changed with the options + --attachments and --no-attachments. + +

+ +

13. Chapters

+ + +

+ The Matroska(tm) chapter system is more powerful than the old known system used by OGM files. The full specifications can + be found at the Matroska website. + +

+ + +

+ mkvmerge(1) supports two kinds of chapter files as its input. The first format, called 'simple + chapter format', is the same format that + the OGM tools expect. The second format is a XML based chapter format which supports all of Matroska(tm)'s chapter + functionality. + +

+ + +

+ Apart from dedicated chapter files mkvmerge(1) can also read chapters from other file formats (e.g. MP4, Ogg, Blu-rays or DVDs). + +

+ + +

13.1. The simple chapter format

+ + + +

+ This format consists of pairs of lines that start with 'CHAPTERxx=' and 'CHAPTERxxNAME=' + respectively. The first one contains the start timestamp while the second one contains + the title. Here's an example: + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=Intro
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=Baby prepares to rock
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=Baby rocks the house
+ +

+ mkvmerge(1) will transform every pair or lines into one Matroska(tm) ChapterAtom. It does not set any + ChapterTrackNumber which means that all chapters apply to all tracks in the file. + +

+ + +

+ As this is a text file character set conversion may need to be done. See the section + about text files and character sets for an explanation how mkvmerge(1) converts between + character sets. + +

+ + + +

13.2. The XML based chapter format

+ + +

+ The XML based chapter format looks like this example: + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>A short chapter</ChapterString>
+        <ChapterLanguage>eng</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>A part of that short chapter</ChapterString>
+          <ChapterLanguage>eng</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ With this format three things are possible that are not possible with the simple chapter + format: + +

+ + +
    + +
  1. +

    The timestamp for the end of the chapter can be set,

    +
  2. + +
  3. +

    chapters can be nested,

    +
  4. + +
  5. +

    the language and country can be set.

    +
  6. + +
+ + +

+ The mkvtoolnix distribution contains some sample files in the doc subdirectory which can be used as a basis. + +

+ + +

+ The following lists the supported XML tags, their data types and, where appropriate, + the valid range for their values: + +

+ +
Chapters (master)
+  EditionEntry (master)
+    EditionUID (unsigned integer, valid range: 1 <= value)
+    EditionFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagDefault (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagOrdered (unsigned integer, valid range: 0 <= value <= 1)
+    ChapterAtom (master)
+      ChapterAtom (master)
+      ChapterUID (unsigned integer, valid range: 1 <= value)
+      ChapterTimeStart (unsigned integer)
+      ChapterTimeEnd (unsigned integer)
+      ChapterFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterFlagEnabled (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterSegmentUID (binary, valid range: 1 <= length in bytes)
+      ChapterSegmentEditionUID (unsigned integer, valid range: 1 <= value)
+      ChapterPhysicalEquiv (unsigned integer)
+      ChapterTrack (master)
+        ChapterTrackNumber (unsigned integer, valid range: 1 <= value)
+      ChapterDisplay (master)
+        ChapterString (UTF-8 string)
+        ChapterLanguage (UTF-8 string)
+        ChapterCountry (UTF-8 string)
+      ChapterProcess (master)
+        ChapterProcessCodecID (unsigned integer)
+        ChapterProcessPrivate (binary)
+        ChapterProcessCommand (master)
+          ChapterProcessTime (unsigned integer)
+          ChapterProcessData (binary)
+ + +

13.3. Reading chapters from Blu-rays

+ + + +

+ mkvmerge(1) can read chapters from unencrypted Blu-rays. For that you can use the path to one + of the MPLS play lists with the + --chapters parameter. + +

+ + +

+ Example: --chapters /srv/blurays/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. Reading chapters from DVDs

+ + + +

+ When MKVToolNix is compiled with the libdvdread(tm) library, mkvmerge(1) can read chapters from DVDs. For that you + can use the path to one of the folders or files on the DVD with the --chapters parameter. As DVDs can contain + more than one title and each title has its own set of chapters, you can append a colon + and the desired title number to the end of the + file name argument. The title number defaults to 1. + +

+ + +

+ Example: --chapters /srv/dvds/BigBuckBunny/VIDEO_TS:2 + +

+ + + +

13.5. General notes

+ + +

+ When splitting files mkvmerge(1) will correctly adjust the chapters as well. This means that each file only includes + the chapter entries + that apply to it, and that the timestamps will be offset to match the new timestamps + of each output file. + +

+ + +

+ mkvmerge(1) is able to copy chapters from Matroska(tm) source files unless this is explicitly disabled with the --no-chapters option. The chapters from all sources (Matroska(tm) files, + Ogg files, MP4 files, chapter text files) are usually not merged but end up in separate + ChapterEditions. Only if chapters are read from several Matroska(tm) or XML files that share the + same edition UIDs will chapters be merged into a single ChapterEdition. If such a merge is desired in other + situations as well then the user has to extract the chapters from all sources with + mkvextract(1) first, merge the XML + files manually and mux them afterwards. + +

+ + +

14. Tags

+ + + +

14.1. Introduction

+ + + +

+ Matroska(tm)'s tag system is similar to that of other containers: a set of KEY=VALUE pairs. However, in Matroska(tm) + these tags can also be nested, and both the KEY and the VALUE are elements of their + own. The example file example-tags-2.xml shows how to use this system. + +

+ + + +

14.2. Scope of the tags

+ + + +

+ Matroska(tm) tags do not automatically apply to the complete file. They can, but they also may + apply to different parts of the file: to one + or more tracks, to one or more chapters, or even to a combination of both. The Matroska specification gives more details about this fact. + +

+ + +

+ One important fact is that tags are linked to tracks or chapters with the Targets Matroska(tm) tag element, and + that the UIDs used for this linking are not the track IDs mkvmerge(1) uses everywhere. Instead the numbers used are + the UIDs which mkvmerge(1) calculates automatically (if the track is taken from a file format other than Matroska(tm)) or which are copied + from the source file if the track's source file is a Matroska(tm) file. Therefore it is difficult to know which UIDs to use in the tag + file before the file is handed over to mkvmerge(1). + +

+ + +

+ mkvmerge(1) knows two options with which you can add tags to Matroska(tm) files: The --global-tags and the --tags options. The difference is that the former option, --global-tags, will make the tags apply to the complete file by + removing any of those Targets elements mentioned above. The latter option, --tags, automatically inserts the UID that mkvmerge(1) generates for the tag + specified with the TID part of the --tags + option. + +

+ + + +

14.3. Example

+ + +

+ Let's say that you want to add tags to a video track read from an AVI. mkvmerge --identify file.avi + tells you that the video track's ID (do not mix this ID with the UID!) is 0. So you + create your tag file, leave out all + Targets elements and call mkvmerge(1): + +

+ +
$ mkvmerge -o file.mkv --tags 0:tags.xml file.avi
+ + +

14.4. Tag file format

+ + +

+ mkvmerge(1) supports a XML based tag file format. The format is very closely modeled after the Matroska specification. Both the binary and the source distributions + of MKVToolNix come with a sample file called example-tags-2.xml which simply lists all known tags and which can be + used as a basis for real life tag files. + +

+ + +

+ The basics are: + +

+ + +
    + +
  • +

    The outermost element must be <Tags>. +

    +
  • + +
  • + +

    One logical tag is contained inside one pair of <Tag> XML tags. +

    + +
  • + +
  • +

    White spaces directly before and after tag contents are ignored.

    +
  • + +
+ + + +

14.5. Data types

+ + +

+ The new Matroska(tm) tagging system only knows two data types, a UTF-8 string and a binary type. The first + is used for the tag's name and + the <String> element while the binary type is used for the <Binary> element. + +

+ + +

+ As binary data itself would not fit into a XML file mkvmerge(1) supports two other methods of storing binary data. If the contents of a + XML tag starts with '@' then the following text is treated as a file name. The corresponding file's content + is + copied into the Matroska(tm) element. + +

+ + +

+ Otherwise the data is expected to be Base64 encoded. This is an encoding that transforms + binary data into a limited set of + ASCII characters and is used e.g. in email programs. mkvextract(1) will output Base64 encoded data for binary elements. + +

+ + +

+ The deprecated tagging system knows some more data types which can be found in the + official Matroska(tm) tag specs. As mkvmerge(1) does not + support this system anymore these types aren't described here. + +

+ + + +

14.6. Known tags for the XML file format

+ + + +

+ The following lists the supported XML tags, their data types and, where appropriate, + the valid range for their values: + +

+ +
Tags (master)
+  Tag (master)
+    Targets (master)
+      TargetTypeValue (unsigned integer)
+      TargetType (UTF-8 string)
+      TrackUID (unsigned integer)
+      EditionUID (unsigned integer)
+      ChapterUID (unsigned integer)
+      AttachmentUID (unsigned integer)
+    Simple (master)
+      Simple (master)
+      Name (UTF-8 string)
+      TagLanguage (UTF-8 string)
+      DefaultLanguage (unsigned integer)
+      String (UTF-8 string)
+      Binary (binary)
+ +

15. Segment information

+ + + +

+ With a segment info XML file it is possible to set certain values in the "segment + information" header field of a Matroska(tm) + file. All of these values cannot be set via other command line options. + +

+ + +

+ Other "segment information" header fields can be set via command line options but + not via the XML file. This includes e.g. the + --title and the --timestamp-scale options. + +

+ + +

+ There are other elements that can be set neither via command line options nor via + the XML files. These include the following elements: + DateUTC (also known as the "muxing date"), MuxingApp, WritingApp + and Duration. They're always set by mkvmerge(1) itself. + +

+ + +

+ The following lists the supported XML tags, their data types and, where appropriate, + the valid range for their values: + +

+ +
Info (master)
+  SegmentUID (binary, valid range: length in bytes == 16)
+  SegmentFilename (UTF-8 string)
+  PreviousSegmentUID (binary, valid range: length in bytes == 16)
+  PreviousSegmentFilename (UTF-8 string)
+  NextSegmentUID (binary, valid range: length in bytes == 16)
+  NextSegmentFilename (UTF-8 string)
+  SegmentFamily (binary, valid range: length in bytes == 16)
+  ChapterTranslate (master)
+    ChapterTranslateEditionUID (unsigned integer)
+    ChapterTranslateCodec (unsigned integer)
+    ChapterTranslateID (binary)
+

16. Matroska file layout

+ + +

+ The Matroska(tm) file layout is quite flexible. mkvmerge(1) will render a file in a predefined way. The resulting file looks like this: + +

+ + +

+ [EBML head] [segment {meta seek #1} [segment information] [track information] {attachments} + {chapters} [cluster 1] {cluster 2} ... + {cluster n} {cues} {meta seek #2} {tags}] + +

+ + +

+ The elements in curly braces are optional and depend on the contents and options used. + A couple of notes: + +

+ + +
    + +
  • + +

    + meta seek #1 includes only a small number of level 1 elements, and only if they actually + exist: attachments, chapters, cues, tags, meta + seek #2. Older versions of mkvmerge(1) used to put the clusters into this meta seek element as well. Therefore some imprecise + guessing + was necessary to reserve enough space. It often failed. Now only the clusters are + stored in meta seek #2, and meta seek #1 refers to + the meta seek element #2. + +

    + +
  • + + +
  • + +

    Attachment, chapter and tag elements are only present if they were added.

    + +
  • + +
+ + +

+ The shortest possible Matroska(tm) file would look like this: + +

+ + +

+ [EBML head] [segment [segment information] [track information] [cluster 1]] + +

+ + +

+ This might be the case for audio-only files. + +

+ +

17. External timestamp files

+ + +

+ mkvmerge(1) allows the user to chose the timestamps for a specific track himself. This can be + used in order to create files with variable + frame rate video or include gaps in audio. A frame in this case is the unit that mkvmerge(1) creates separately per Matroska(tm) block. For + video this is exactly one frame, for audio this is one packet of the specific audio + type. E.g. for AC-3 this would be a + packet containing 1536 samples. + +

+ + +

+ Timestamp files that are used when tracks are appended to each other must only be + specified for the first part in a chain of tracks. For + example if you append two files, v1.avi and v2.avi, and want to use timestamps then + your command line must look something like this: + +

+ +
$ mkvmerge ... --timestamps 0:my_timestamps.txt v1.avi +v2.avi
+ +

+ There are four formats that are recognized by mkvmerge(1). The first line always contains the version number. Empty lines, lines + containing only whitespace and lines beginning with '#' are ignored. + +

+ + +

17.1. Timestamp file format v1

+ + +

+ This format starts with the version line. The second line declares the default number + of frames per second. All following lines contain + three numbers separated by commas: the start frame (0 is the first frame), the end frame and the number of frames + in this range. The FPS is a floating point number with the dot '.' as the decimal point. The ranges + can contain gaps for which the default FPS is used. An example: + +

+ +
# timestamp format v1
+assume 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. Timestamp file format v2

+ + + +

+ In this format each line contains a timestamp for the corresponding frame. This timestamp + must be given in millisecond precision. It can + be a floating point number, but it doesn't have to be. You have to give at least as many timestamp lines as there + are frames in the track. The timestamps in this file must be sorted. Example for + 25fps: + +

+ +
# timestamp format v2
+0
+40
+80
+ + +

17.3. Timestamp file format v3

+ + +

+ In this format each line contains a duration in seconds followed by an optional number + of frames per second. Both can be floating point + numbers. If the number of frames per second is not present the default one is used. + For audio you should let the codec calculate the + frame timestamps itself. For that you should be using 0.0 as the number of frames per second. You can also create + gaps in the stream by using the 'gap' keyword followed by the duration of the gap. Example for an audio file: + +

+ +
# timestamp format v3
+assume 0.0
+25.325
+7.530,38.236
+gap, 10.050
+2.000,38.236
+ + +

17.4. Timestamp file format v4

+ + +

+ This format is identical to the v2 format. The only difference is that the timestamps + do not have to be sorted. This format should + almost never be used. + +

+ + +

18. Exit codes

+ + + +

+ mkvmerge(1) exits with one of three exit codes: + +

+ + +
    + +
  • + +

    + 0 -- This exit code means that muxing has completed successfully. + +

    + +
  • + + +
  • + +

    + 1 -- In this case mkvmerge(1) has output at least one warning, but muxing did continue. A warning is prefixed + with + the text 'Warning:'. Depending on the issues involved the resulting file might be ok or not. The user + is urged to + check both the warning and the resulting file. + +

    + +
  • + + +
  • + +

    + 2 -- This exit code is used after an error occurred. mkvmerge(1) aborts right after outputting the error message. + Error messages range from wrong command line arguments over read/write errors to broken + files. + +

    + +
  • + +
+ +

19. Environment variables

+ + + +

+ mkvmerge(1) uses the default variables that determine the system's locale (e.g. LANG and the LC_* + family). Additional variables: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG and its short form MTX_DEBUG + +

The content is treated as if it had been passed via the --debug option. +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE and its short form MTX_ENGAGE + +

The content is treated as if it had been passed via the --engage option. +

+ +
+ +

20. See also

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. WWW

+ + +

+ The latest version can always be found at the MKVToolNix homepage. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..38ca31e2aab40e104b1634df86acee212ee7eba3 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvpropedit.html @@ -0,0 +1,1214 @@ + + + + + mkvpropedit -- Modify properties of existing Matroska files without a complete remux + + + +
mkvpropedit -- Modify properties of existing Matroska(tm) files without a complete remux +
+
+ +
+

1. Synopsis

+ + +
mkvpropedit options {source-filename} {actions} +
+ +

2. Description

+ + +

+ This program analyses an existing Matroska(tm) file and modifies some of its properties. Then it writes those modifications to the + existing + file. Among the properties that can be changed are the segment information elements + (e.g. the title) and the track headers (e.g. the + language code, 'default track' flag or the name). + +

+ + +

+ Options: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ Lists all known and editable property names, their type (string, integer, boolean + etc) and a short description. The program exits + afterwards. Therefore the source-filename parameter does not have to be supplied. + +

+ +
-p, --parse-mode mode + +

+ Sets the parse mode. The parameter 'mode' can either be 'fast' (which is also the default) + or 'full'. The 'fast' mode does not parse the whole file but uses the meta seek elements for + locating the required elements of a source file. In 99% of all cases this is enough. + But for files that do not contain meta seek + elements or which are damaged the user might have to set the 'full' parse mode. A full scan of a file can take a + couple of minutes while a fast scan only takes seconds. + +

+ +
+ + +

+ Actions that deal with track and segment info properties: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit selector + +

+ Sets the Matroska(tm) file section (segment information or a certain track's headers) that all following + add, set and delete actions operate on. This option can be used multiple times in order to make + modifications to more than one element. + +

+ + +

+ By default mkvpropedit(1) will edit the segment information section. + +

+ + +

+ See the section about edit selectors for a full description of the syntax. + +

+ +
-a, --add name=value + +

+ Adds a property name with the value value. The property will be added even if such a + property exists already. Note that most properties are unique and cannot occur more + than once. + +

+ +
-s, --set name=value + +

+ Sets all occurrences of the property name to the value value. If no such property exists + then it will be added. + +

+ +
-d, --delete name + +

+ Deletes all occurrences of the property name. Note that some properties are required and cannot be deleted. + +

+ +
+ + +

+ Actions that deal with tags and chapters: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags selector:filename + +

+ Add or replace tags in the file with the ones from filename or remove them if filename is + empty. mkvpropedit(1) reads the same XML tag format that mkvmerge(1) reads as well. + +

+ + +

+ The selector must be one of the words all, global or + track. For all mkvpropedit(1) will replace or remove all tags in a file. With + global only global tags will be replaced or removed. + +

+ + +

+ With track mkvpropedit(1) will replace tags for a specific track. Additionally the tags read from + filename will be assigned to the same track. The track is specified in the same way edit selectors are specified (see below), e.g. --tags + track:a1:new-audio-tags.xml. + +

+ +
--add-track-statistics-tags + +

+ Calculates statistics for all tracks in a file and adds new statistics tags for them. + If the file already contains such tags then they'll be updated. + +

+ +
--delete-track-statistics-tags + +

+ Deletes all existing track statistics tags from a file. If the file doesn't contain + track statistics tags then it won't be modified. + +

+ +
-c, --chapters filename + +

+ Add or replace chapters in the file with the ones from filename or remove them if filename is + empty. mkvpropedit(1) reads the same XML and simple chapter formats that mkvmerge(1) reads as well. + +

+ +
+ + +

+ Actions for handling attachments: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment filename + +

+ Adds a new attachment from filename. + +

+ + +

+ If the option --attachment-name has been used prior to this option then its value is used as the new attachment's + name. Otherwise it is derived from filename. + +

+ + +

+ If the option --attachment-mime-type has been used prior to this option then its value is used as the new + attachment's MIME type. Otherwise it is auto-detected from the content of filename. + +

+ + +

+ If the option --attachment-description has been used prior to this option then its value is used as the new + attachment's description. Otherwise no description will be set. + +

+ + +

+ If the option --attachment-uid has been used prior to this option then its value is used as the new attachment's + UID. Otherwise a random UID will be generated automatically. + +

+ +
--replace-attachment selector:filename + +

+ Replaces one or more attachments that match selector with the file filename. If more + than one existing attachment matches selector then all of their contents will be replaced by the content of + filename. + +

+ + +

+ The selector can have one of four forms. They're explained below in the section attachment selectors. + +

+ + +

+ If the option --attachment-name has been used prior to this option then its value is set as the new name for each + modified attachment. Otherwise the names aren't changed. + +

+ + +

+ If the option --attachment-mime-type has been used prior to this option then its value is set as the new MIME type + for each modified attachment. Otherwise the MIME types aren't changed. + +

+ + +

+ If the option --attachment-description has been used prior to this option then its value is set as the new + description for each modified attachment. Otherwise the descriptions aren't changed. + +

+ + +

+ If the option --attachment-uid has been used prior to this option then its value is set as the new UID for each + modified attachment. Otherwise the UIDs aren't changed. + +

+ +
--update-attachment selector + +

+ Sets the properties of one or more attachments that match selector. If more than one existing attachment + matches selector then all of their properties will be updated. + +

+ + +

+ The selector can have one of four forms. They're explained below in the section attachment selectors. + +

+ + +

+ If the option --attachment-name has been used prior to this option then its value is set as the new name for each + modified attachment. Otherwise the names aren't changed. + +

+ + +

+ If the option --attachment-mime-type has been used prior to this option then its value is set as the new MIME type + for each modified attachment. Otherwise the MIME types aren't changed. + +

+ + +

+ If the option --attachment-description has been used prior to this option then its value is set as the new + description for each modified attachment. Otherwise the descriptions aren't changed. + +

+ + +

+ If the option --attachment-uid has been used prior to this option then its value is set as the new UID for each + modified attachment. Otherwise the UIDs aren't changed. + +

+ +
--delete-attachment selector + +

+ Deletes one or more attachments that match selector. + +

+ + +

+ The selector can have one of four forms. They're explained below in the section attachment selectors. + +

+ +
+ + +

+ Options for attachment actions: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name name + +

+ Sets the name to use for the following --add-attachment or --replace-attachment operation. + +

+ +
--attachment-mime-type mime-type + +

+ Sets the MIME type to use for the following --add-attachment or --replace-attachment operation. + +

+ +
--attachment-description description + +

+ Sets the description to use for the following --add-attachment or --replace-attachment operation. + +

+ +
--enable-legacy-font-mime-types + +

+ Enables the use of legacy MIME types for certain types of font attachments. For example, + 'application/x-truetype-font' will be used for TrueType fonts instead of 'fonts/ttf'. + +

+ + +

+ This affects both adding new attachments and replacing existing attachments, but only + if the new MIME type isn't + specified. Other existing attachments aren't changed. + +

+ + +

+ The affected MIME types are 'font/sfnt', 'font/ttf' and + 'font/collection' which are all mapped to 'application/x-truetype-fonts' and + 'font/otf' which is mapped to 'application/vnd.ms-opentype'. + +

+ +
+ + +

+ Other options: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ Normally when the user requests changes to the 'language' track header property, mkvpropedit(1) will apply the same + change to the new LanguageIETF track header element in addition to the legacy Language + element. If this option is used, the change is only applied to the legacy Language element. + +

+ + +

+ This option does not affect changes requested via the 'language-ietf' track header property. + +

+ +
--normalize-language-ietf mode + +

+ Enables normalizing all IETF BCP 47 language tags to either their canonical form with + mode 'canonical', to their + extended language subtags form with mode 'extlang' or turns it off with mode 'off'. By default + normalization to the canonical form is applied. + +

+ + +

+ In the canonical form all subtags for which preferred values exist are replaced by + those preferred values. This converts + e.g. 'zh-yue-jyutping' to 'yue-jyutping' or 'fr-FX' to 'fr-FR'. + +

+ + +

+ For the extended language subtags form the canonical form is built first. Afterwards + all primary languages for which an extended + language subtag exists are replaced by that extended language subtag and its prefix. + This converts + e.g. 'yue-jyutping' back to 'zh-yue-jyutping' but has no effect on 'fr-FR' as + 'fr' is not an extended language subtag. + +

+ + +

+ This normalization is only applied to elements that are actually changed: + +

+ + +
    + +
  • + +

    + When editing track headers only those track language elements that are set via edit + specifications are affected. Languages of tracks + that aren't edited aren't changed. Editing a track but setting only properties other + than the language won't affect the language + either. + +

    + +
  • + + +
  • + +

    + When editing chapters all language elements of all chapter elements are affected as + existing chapters are always fully replaced. + +

    + +
  • + + +
  • + +

    + When editing tags only the language elements of the tags that are actually replaced + are affected. For example, when you replace + global tags then existing track tags aren't affected. + +

    + +
  • + +
+ + +

+ The best way to normalize all existing language tags in a file is to remux it with + mkvmerge(1) and set its + '--normalize-language-ietf' option to the desired mode. + +

+ +
--command-line-charset character-set + +

+ Sets the character set to convert strings given on the command line from. It defaults + to the character set given by system's current + locale. + +

+ +
--output-charset character-set + +

+ Sets the character set to which strings are converted that are to be output. It defaults + to the character set given by system's + current locale. + +

+ +
-r, --redirect-output file-name + +

+ Writes all messages to the file file-name instead of to the console. While this can be done easily with + output redirection there are cases in which this option is needed: when the terminal + reinterprets the output before writing it to a + file. The character set set with --output-charset is honored. + +

+ +
--ui-language code + +

+ Forces the translations for the language code to be used (e.g. 'de_DE' for the German + translations). Entering 'list' as the code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Tells the program to abort after the first warning is emitted. The program's exit + code will be 1. + +

+ +
--debug topic + +

+ Turn on debugging for a specific feature. This option is only useful for developers. + +

+ +
--engage feature + +

+ Turn on experimental features. A list of available features can be requested with + mkvpropedit --engage list. These + features are not meant to be used in normal situations. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that can tell + a controlling GUI what's happening. These + messages follow the format '#GUI#message'. The message may be followed by key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the messages nor the keys are ever translated and always output + in English. + +

+ +
-v, --verbose + +

+ Be verbose and show all the important Matroska(tm) elements as they're read. + +

+ +
-h, --help + +

+ Show usage information and exit. + +

+ +
-V, --version + +

+ Show version information and exit. + +

+ +
@options-file.json + +

+ Reads additional command line arguments from the file options-file. For a full explanation on the supported + formats for such files see the section called "Option files" in the mkvmerge(1) man page. + +

+ +
+ +

3. Edit selectors

+ + +

+ The --edit option sets the Matroska(tm) file section (segment + information or a certain track's headers) that all following add, set and delete actions operate + on. This stays valid until the next --edit option is found. The + argument to this option is called the edit selector. + +

+ + +

+ By default mkvpropedit(1) will edit the segment information section. + +

+ + +

3.1. Segment information

+ + +

+ The segment information can be selected with one of these three words: 'info', 'segment_info' or + 'segmentinfo'. It contains properties like the segment title or the segment UID. + +

+ + + +

3.2. Track headers

+ + +

+ Track headers can be selected with a slightly more complex selector. All variations + start with 'track:'. The track + header properties include elements like the language code, 'default track' flag or + the track's name. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ If the parameter n is a number then the nth track will be selected. The track order is + the same that mkvmerge(1)'s --identify option outputs. + +

+ + +

+ Numbering starts at 1. + +

+ +
track:tn + +

+ If the parameter starts with a single character t followed by a n then the + nth track of a specific track type will be selected. The track type parameter t must be + one of these four characters: 'a' for an audio track, 'b' for a button track, + 's' for a subtitle track and 'v' for a video track. The track order is the same that + mkvmerge(1)'s --identify option outputs. + +

+ + +

+ Numbering starts at 1. + +

+ +
track:=uid + +

+ If the parameter starts with a '=' followed by a number uid, the track whose track + UID element equals the given uid will be selected. Track UIDs can be + obtained with mkvinfo(1). + +

+ +
track:@number + +

+ If the parameter starts with a '@' followed by a number number, the track whose track + number element equals this number will be selected. Track numbers can be obtained with mkvinfo(1). + +

+ +
+ + + +

3.3. Notes

+ + +

+ Due to the nature of the track edit selectors it is possible that several selectors + actually match the same track headers. In such cases + all actions for those edit selectors will be combined and executed in the order in + which they're given on the command line. + +

+ + +

4. Attachment selectors

+ + + +

+ An attachment selector is used with the two actions --replace-attachment and --delete-attachment. It can have one of the following four + forms: + +

+ + +
    + +
  1. + +

    + Selection by attachment ID. In this form the selector is simply a number, the attachment's + ID as output by mkvmerge(1)'s + identification command. + +

    + +
  2. + + +
  3. + +

    + Selection by attachment UID (unique ID). In this form the selector is the equal sign + = followed by a number, the + attachment's unique ID as output by mkvmerge(1)'s verbose identification command. + +

    + +
  4. + + +
  5. + +

    + Selection by attachment name. In this form the selector is the literal word name: followed by the existing + attachment's name. If this selector is used with --replace-attachment then colons within the name to match must be + escaped as \c. + +

    + +
  6. + + +
  7. + +

    + Selection by MIME type. In this form the selector is the literal word mime-type: followed by the existing + attachment's MIME type. If this selector is used with --replace-attachment then colons within the MIME type to match + must be escaped as \c. + +

    + +
  8. + +
+ +

5. Language handling

+ + + +

+ mkvpropedit(1) mostly tries to do the right thing by default. Therefore changes to the language property will cause + mkvpropedit(1) to apply the same change to both the new "LanguageIETF" element as well as the old + "Language" element similar to how + mkvmerge(1) applies the language to both elements. For example, when using mkvpropedit movie.mkv --edit track:2 --set + language=zh-TW the "LanguageIETF" element will be set to zh-TW and the old "Language" element to + chi. + +

+ + +

+ Additionally there's a new track header property named language-ietf that can be set or removed. Changes to this + property only apply to the new "LanguageIETF" track header element. A caveat is that + the old "Language" track header element is a + mandatory element in Matroska — meaning even if it isn't present in the file it still + has an implied value. When the user only sets the + language-ietf property but not the language property, mkvpropedit(1) will therefore add the old + "Language" element in certain cases & set it to und (meaning "undetermined") as the user didn't specify a value + for it. + +

+ + +

When reading XML chapter or tag files mkvpropedit(1) works like mkvmerge(1) does. +

+ + +

The creation of the new elements can be disabled completely with the command-line + option `--disable-language-ietf` which operates on + all three new elements. +

+ + +

You can chose the normalization method applied to extended language sub-tags with + the parameter + --normalize-language-ietf. +

+ +

6. Examples

+ + +

+ The following example edits a file called 'movie.mkv'. It sets the segment title and modifies the language code of an + audio and a subtitle track. Note that this example can be shortened by leaving out + the first --edit option because editing the segment information element is the + default for all options found before the first --edit option anyway. + +

+ +
$ mkvpropedit movie.mkv --edit info --set "title=The movie" --edit track:a1 --set language=fre --edit track:a2 --set language=ita
+ +

+ The second example removes the 'default track flag' from the first subtitle track + and sets it for the second one. Note that + mkvpropedit(1), unlike mkvmerge(1), does not set the 'default track flag' of other tracks to '0' if it is set to '1' + for a different track + automatically. + +

+ +
$ mkvpropedit movie.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ Replacing the tags for the second subtitle track in a file looks like this: + +

+ +
$ mkvpropedit movie.mkv --tags track:s2:new-subtitle-tags.xml
+ +

+ Removing all tags requires leaving out the file name: + +

+ +
$ mkvpropedit movie.mkv --tags all:
+ +

+ Replacing the chapters in a file looks like this: + +

+ +
$ mkvpropedit movie.mkv --chapters new-chapters.xml
+ +

+ Removing all chapters requires leaving out the file name: + +

+ +
$ mkvpropedit movie.mkv --chapters ''
+ +

+ Adding a font file (Arial.ttf) as an attachment: + +

+ +
$ mkvpropedit movie.mkv --add-attachment Arial.ttf
+ +

+ Adding a font file (89719823.ttf) as an attachment and providing some information as it really is just Arial: + +

+ +
$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'The Arial font as a TrueType font' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ Replacing one attached font (Comic.ttf) file with another one (Arial.ttf): + +

+ +
$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'The Arial font as a TrueType font' --replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ Deleting the second attached file, whatever it may be: + +

+ +
$ mkvpropedit movie.mkv --delete-attachment 2
+ +

+ Deleting all attached fonts by MIME type: + +

+ +
$ mkvpropedit movie.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. Exit codes

+ + + +

+ mkvpropedit(1) exits with one of three exit codes: + +

+ + +
    + +
  • + +

    + 0 -- This exit code means that the modification has completed successfully. + +

    + +
  • + + +
  • + +

    + 1 -- In this case mkvpropedit(1) has output at least one warning, but the modification did continue. A warning is + prefixed with the text 'Warning:'. Depending on the issues involved the resulting files might be ok or not. The + user is urged to check both the warning and the resulting files. + +

    + +
  • + + +
  • + +

    + 2 -- This exit code is used after an error occurred. mkvpropedit(1) aborts right after outputting the error message. + Error messages range from wrong command line arguments over read/write errors to broken + files. + +

    + +
  • + +
+ +

8. Text files and character set conversions

+ + + +

+ For an in-depth discussion about how all tools in the MKVToolNix suite handle character + set conversions, input/output encoding, command + line encoding and console encoding please see the identically-named section in the + mkvmerge(1) man page. + +

+ +

9. Environment variables

+ + + +

+ mkvpropedit(1) uses the default variables that determine the system's locale (e.g. LANG and the LC_* + family). Additional variables: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG and its short form MTX_DEBUG + +

The content is treated as if it had been passed via the --debug option. +

+ +
MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE and its short form MTX_ENGAGE + +

The content is treated as if it had been passed via the --engage option. +

+ +
+ +

10. See also

+ + +

+ mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1) + +

+ +

11. WWW

+ + +

+ The latest version can always be found at the MKVToolNix homepage. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..0d7c6879db30da0a28e58fa970dea3a96e5533c6 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/en/mkvtoolnix-gui.html @@ -0,0 +1,156 @@ + + + + + mkvtoolnix-gui -- a GUI for mkvmerge1 including a chapter and a header editor + + + +
mkvtoolnix-gui -- a GUI for mkvmerge(1) including a chapter and a header editor +
+
+
+

Table of contents

+ +
+
+

1. Synopsis

+ + +
mkvtoolnix-gui [[configuration-file-name.mtxcfg] | [source-file.ext] | [matroska-file.mkv] | [chapter-file.ext] | [matroska-file.mkv]] +
+ +

2. Description

+ + +

+ mkvtoolnix-gui(1) is a Qt(tm) based GUI for mkvmerge(1). It also implements mkvinfo(1)'s and + mkvpropedit(1)'s functionality and will evolve to cover mkvextract(1) as well. All settings (e.g. source files, track options etc) can be + saved and restored. + +

+ + +

+ Listing configuration file names with the extension .mtxcfg causes the GUI to load the those configuration files in + the appropriate tool. Any other file name is added as a source file for multiplexing, + opened in the info tool, the chapter editor or in + the header editor depending on the current mode. The current mode can be changed with + --merge, --info, + --edit-chapters or --edit-headers. The default mode is adding files for multiplexing. + +

+ + +

+ Note that if an instance of the application is already running when the application + is started a second time, all file names given on the + command line are handled by the already-running instance. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

All following file names will be added as source files to the current multiplex job. + This is the default mode. +

+ +
--info + +

All following file names will be opened in the info tool.

+ +

Additionally the info tool will be selected on startup instead of the multiplexer + tool. +

+ +
--edit-chapters + +

All following file names will be opened in the chapter editor.

+ +

Additionally the chapter editor will be selected on startup instead of the multiplexer + tool. +

+ +
--edit-headers + +

All following file names will be opened in the header editor.

+ +

Additionally the header editor will be selected on startup instead of the multiplexer + tool. +

+ +
-h, --help + +

+ Show usage information and exit. + +

+ +
-V, --version + +

+ Show version information and exit. + +

+ +
+ +

3. See also

+ + +

+ mkvmerge(1), mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. WWW

+ + +

+ The latest version can always be found at the MKVToolNix homepage. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..0a254a49af7e08fe88b6484979c050e9aaaa3622 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvextract.html @@ -0,0 +1,1365 @@ + + + + + mkvextract -- extrae las pistas de los archivos Matroska a otros archivos + + + +
mkvextract -- extrae las pistas de los archivos Matroska(tm) a otros archivos +
+
+ +
+

1. Sinopsis

+ + +
mkvextract {source-filename} {mode1} options extraction-spec1 mode2 options extraction-spec2 … +
+ +

2. Descripción

+ + +

+ Este programa extrae partes específicas de un archivo Matroska(tm) a otros + formatos. El primer argumento es el nombre del archivo origen que debe ser + un archivo Matroska(tm). + +

+ + +

+ Todos los argumentos cambian a un modo de extracción concreto, cambian las + opciones del modo actualmente activo o especifican qué extraer a cierto + archivo. Varios modos se pueden usar en la misma invocación de mkvextract + permitiendo la extracción de múltiples elementos de una sola vez. La mayoría + de las opciones sólo se pueden usar en ciertos modos con algunas opciones + que se aplican a todos los modos. + +

+ + +

+ Actualmente permite la extracción de pistas, etiquetas, adjuntos, capítulos, CUE sheets -tabla de + contenidos-, códigos de tiempo + ecues -registros-. + +

+ + +

2.1. Opciones comunes

+ + + +

+ Las siguientes opciones están disponibles en todos los modos y sólo se + describirán en esta sección. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ Establece el modo de análisis a 'completo'. El modo predeterminado no + analiza el archivo entero pues usa la búsqueda de elementos de metadatos + para localizar los elementos necesarios de un archivo origen. En un 99% de + todos los casos es suficiente. Pero para archivos que no contienen elementos + de metadatos o que están dañados, el usuario debería usar este modo. Un + análisis completo de un archivo puede requerir bastantes minutos mientras + que un análisis rápido sólo lleva unos segundos. + +

+ +
--command-line-charset + conjunto-caracteres + +

+ Establece el conjunto de caracteres a convertir las cadenas de texto dadas + desde la línea de comandos. Por defecto, se ajusta al conjunto de caracteres + dado por la configuración local del sistema. + +

+ +
--output-charset conjunto-caracteres + +

+ + + Establece el conjunto de caracteres para convertir las cadenas de texto que + serán usadas en el archivo de salida. Por defecto, se ajusta al conjunto de + caracteres dado por la configuración local del sistema. + +

+ +
-r, --redirect-output + nombre-archivo + +

+ Escribe todos los mensajes al archivo nombre-archivo + en vez de en la consola. Aunque esto se puede hacer fácilmente con la opción + de redirección hay casos en los que es necesaria esta opción: cuando el + terminal reinterpreta la salida antes de escribirlo al archivo. El conjunto + de caracteres establecido con --output-charset + se respeta. + +

+ +
--flush-on-close + +

+ Le dice al programa que libere de datos la memoria cache cuando se cierren + los archivos para su escritura. Esto se puede usar para evitar la pérdida de + datos en cortes de energía o para evitar ciertos problemas en el sistema + operativo o los controladores. La desventaja es que el multiplexado tardará + más, ya que mkvmerge deberá esperar hasta que todos los datos se hayan + escrito en el almacenamiento antes de salir. Ver falos #2469 y #2480 en el + servidor de MKVToolNix para analizar los pros y los contras en profundidad. + +

+ +
--ui-language código + +

+ Fuerza la traducción al código de idioma que será + usado (p.e. 'de_DE' para la traducción al + Alemán). Introduciendo 'list' como + código provocará que el programa muestre una lista de + las traducciones disponibles. + +

+ +
--abort-on-warnings + +

+ Le dice al programa que cancele después de emitir la primera advertencia. El + código de salida del programa será 1. + +

+ +
--debug topic + +

+ Habilita la depuración para una característica concreta. Esta opción sólo es + útil para desarrolladores. + +

+ +
--engage característica + +

+ Habilita características experimentales. Una lista de características + disponibles puede ser solicitada con la instrucción mkvextract + --engage list. Estas características no están indicadas para ser + usadas en situaciones normales. + +

+ +
--gui-mode + +

+ Habilita el modo GUI. En este modo las líneas especialmente formateadas + pueden ser generadas para decirle a un control de la GUI lo que está + pasando. Estos mensajes se rigen bajo el formato + '#GUI#mensaje'. El mensaje puede ser continuado por pares + de valores/claves como en + '#GUI#mensaje#clave1=valor1#clave2=valor2…'. Ni los + mensajes ni las claves pueden ser traducidas y siempre se generan en + inglés. + +

+ +
-v, --verbose + +

+ Habilita el modo detallado y muestra todos los elementos Matroska(tm) + importantes que pueden ser leídos. + +

+ +
-h, --help + +

+ Muestra información de uso y sale. + +

+ +
-V, --version + +

+ Muestra la información de la versión y sale. + +

+ +
@options-file.json + +

+ Lee argumentos adicionales de la línea de comandos desde el archivo + archivo-opciones. Para más información sobre los + formatos admitidos para esos archivos consulte la sección acerca de + "archivos de opciones" en la página del manual de mkvmerge(1) + +

+ +
+ + + +

2.2. Modo de extracción de pista

+ + + +

+ Sintaxis: mkvextract nombre-archivo + tracks [opciones] + TID1:nombre-destino1 + [TID2:nombre-destino2 + ...] + +

+ + +

+ Las siguientes opciones de línea de comandos están disponibles para cada + pista en el modo de extracción de pistas + ('tracks'). Tienen que aparecer delante de la + especificación de pista a las que se deben aplicar (ver abajo). + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c conjunto-caracteres + +

+ Establece el conjunto de caracteres para convertir el texto de la siguiente + pista de subtítulo. Sólo es válido si el ID de la siguiente pista + corresponde a un subtítulo. Por defecto usa UTF-8. + +

+ +
--blockadd nivel + +

+ Conserva el BlockAdditions sólo hasta este nivel. Por defecto conserva todos + los niveles. Esta opción sólo afecta a ciertos tipos de códecs como + WAVPACK4. + +

+ +
--cuesheet + +

+ Provoca que mkvextract(1) extraiga un CUE sheet desde la + información de capítulos y etiquetas para la siguiente pista, a un archivo + cuyo nombre es el del archivo de salida junto con la extensión + '.cue' del archivo unido. + +

+ +
--raw + +

+ Extrae los datos en bruto (raw) a un archivo sin contenedor. A diferencia de + --fullraw + esta opción no provoca que el contenido del elemento + CodecPrivate se escriba en el archivo. Este modo + funciona sólo con todos los CodecIDs, incluso con los + que mkvextract(1) no sea compatible pero los archivos resultantes podrían ser + inutilizables. + +

+ +
--fullraw + +

+ Extrae los datos en bruto (raw) a un archivo sin contenedor. El contenido + del elemento CodecPrivate se escribirá en el primer + archivo si la pista contiene ese elemento en el encabezado. Este modo + funciona sólo con todos los CodecIDs, incluso con los + que mkvextract(1) no sea compatible pero los archivos resultantes podrían ser + inutilizables. + +

+ +
TID:nombre-salida + +

+ Provoca la extracción de la pista con el ID TID a un + archivo con el nombre-salida si dicha pista existe en + el archivo fuente. Esta opción puede ser usada múltiples veces. Los IDs de + la pista son los mismos que muestra mkvmerge(1) con la opción + --identify. + +

+ + +

+ Cada nombre de salida sólo debe ser usado una vez. La única excepción son + las pistas RealAudio y RealVideo. Si usas el mismo nombre para pistas + diferentes entonces estas pistas serán almacenadas en el mismo + archivo. Ejemplo: + +

+ +
$ mkvextract entrada.mkv tracks 0:video.h264 2:salida-2-pistas-vobsub.idx 3:salida-2-pistas-vobsub.idx
+
+ + + +

2.3. Modo de extracción de adjuntos

+ + + +

+ Sintaxis: mkvextract nombre-archivo + attachments + [opciones] + AID1:nombre-destino1 + [AID2:nombre-destino2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:nombre-salida + +

+ Provoca la extracción del adjunto con el ID AID a un + archivo con el nombre-salida si dicho adjunto existe + en el archivo fuente. Si el nombre-salida se deja + vacío entonces será usado el nombre del adjunto en el archivo + Matroska(tm). Esta opción puede ser usada múltiples veces. Los IDs de los + adjuntos son los mismos que muestra mkvmerge(1) con la opción + --identify. + +

+ +
+ + + +

2.4. Modo de extracción de capitulos

+ + + +

+ Sintaxis: mkvextract nombre-archivo + chapters + [opciones] + nombre-destino.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ Exporta la información de capítulos en un formato simple usado en las + herramientas de OGM (CAPITULO01=..., + CAPITULO01NOMBRE=...). En este modo alguna información será descartada. Por + defecto la salida de los capítulos están en formato XML. + +

+ +
--simple-language idioma + +

+ Si se habilita el formato simple entonces mkvextract(1) sólo generará una + única entrada de cada capítulo atom encontrado incluso si un capítulo atom + contiene más de un nombre de capítulos. Por defecto mkvextract(1) usará el + primer nombre de capítulos que encuentre para cada atom, independientemente + de su idioma. + +

+ + +

+ Usar esta opción permite al usuario determinar que nombres de capítulos se + generan si los atoms contienen más de un nombre de capítulos. El parámetro + language debe ser un código ISO 639-1 o ISO 639-2. + +

+ +
+ + +

+ Los capítulos se escriben a un archivo de salida especificado. Por defecto, + se utiliza el formato XML que es interpretado por mkvmerge(1). Si en el + archivo no hay capítulos, el archivo de salida no será creado. + +

+ + + +

2.5. Modo de extracción de etiquetas

+ + + +

+ Sintaxis: mkvextract nombre-archivo + tags [opciones] + nombre-destino.xml + +

+ + +

+ Las etiquetas se escriben a un archivo de salida especificado en el formato + XML que es interpretado por mkvmerge(1). Si en el archivo no hay etiquetas, + el archivo de salida no será creado. + +

+ + + +

2.6. Modo de extracción de Cue sheet

+ + + +

+ Sintaxis: mkvextract nombre-archivo + cuesheet + [opciones] + nombre-destino.cue + +

+ + +

+ La tabla de contenidos -cue sheet- se escribe a un archivo de salida + especificado. Si en el archivo no hay capítulos o etiquetas, el archivo de + salida no será creado. + +

+ + + +

2.7. Modo de extracción de códigos de tiempo

+ + + +

+ Sintaxis: mkvextract nombre-archivo + timestamps_v2 + [opciones] + TID1:nombre-destino1 + [TID2:nombre-destino2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:nombre-salida + +

+ Provoca la extracción de los timestamps para la pista con el ID + TID a un archivo con el + nombre-salida si dicha pista existe en el archivo + origen. Esta opción puede ser usada múltiples veces. Los IDs de la pista son + los mismos que muestra mkvmerge(1) con la opción --identify. + +

+ + +

+ Ejemplo: + +

+ +
$ mkvextract entrada.mkv timestamps_v2 1:ct-pista1.txt 2:ct-pista2.txt
+
+ + + +

2.8. Modo de extracción de Cues

+ + + +

+ Sintaxis: mkvextract nombre-archivo + cues [opciones] + TID1:nombre-destino1 + [TID2:nombre-destino2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:nombrearchivo-dest + +

+ Provoca la extracción de los cues (índices) para la pista con el ID + TID a un archivo con el + nombre-salida si dicha pista existe en el archivo + origen. Esta opción puede ser usada múltiples veces. Los IDs de la pista son + los mismos que muestra mkvmerge(1) con la opción --identify + y no los números contenidos en el elemento CueTrack. + +

+ +
+ + +

+ El formato de salida es un simple formato de texto: una línea por cada + elemento CuePoint con + clave=valor. Si un elemento opcional no existe en un + CuePoint (p.e. CueDuration) + entonces un guión será devuelto como valor. + +

+ + +

+ Ejemplo: + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

Las claves posibles son:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
timestamp + +

El código de tiempo del cue point con precisión de nanosegundos. El formato + es HH:MM:SS.nnnnnnnnn. Este elemento siempre se + establece. +

+ +
duration + +

La duración del cue point con precisión de nanosegundos. El formato es + HH:MM:SS.nnnnnnnnn. +

+ +
cluster_position + +

La posición absoluta en bytes dentro del archivo Matroska(tm) en dónde + comienza el clúster que contiene el elemento de referencia. +

+ + +
+

Note:

+ +

Dentro del archivo Matroska(tm) el CueClusterPosition + se refiere a la compensación (offset) de los datos de inicio del + segmento. El valor de salida es dado por el modo de extracción de cue de + mkvextract(1), sin embargo ya contiene esa compensación y que es absoluta a + partir del inicio del archivo. +

+ +
+ +
relative_position + +

La posición relativa en bytes dentro del clúster en donde el elemento + BlockGroup o SimpleBlock es el + cue point que se refiere al inicio. +

+ + +
+

Note:

+ +

Dentro del archivo Matroska(tm) el CueRelativePosition + se refiere a la compensación de los datos de inicio del clúster. El valor de + salida es dado por el modo de extracción de cue de mkvextract(1), sin embargo + es relativo al ID del clúster. La posición absoluta dentro del archivo puede + ser calculada por añadir cluster_position y + relative_position. +

+ +
+ +
+ + +

+ Ejemplo: + +

+ +
$ mkvextract entrada.mkv cues 1:cues-pista1.txt 2:cues-pista2.txt
+ +

3. Ejemplos

+ + + +

+ Extrayendo tanto capítulos como etiquetas en sus respectivos formatos XML + a la vez; + +

+ +
$ mkvextract pelicula.mkv chapters capitulos-pelicula.xml tags etiquetas-pelicula.xml
+ +

+ Extrayendo un par de pistas y sus respectivos códigos de tiempo a la vez: + +

+ +
$ mkvextract "Otra pelicula.mkv" tracks 0:video.h265 "1:audio principal.aac" "2:comentarios del director.aac" timestamps_v2 "0:marcas tiempo del video.txt" "1:marcas de tiempo del audio principal.txt" "2:marcas de tiempo de los comentarios del director.txt"
+ +

+ Extrayendo capítulos en el formato Ogg/OGM y recodificando el texto de una + pista de subtítulos a otro conjunto de caracteres: + +

+ +
$ mkvextract "Mi pelicula.mkv" chapters --simple "Mis capitulos.txt" tracks -c MS-ANSI "2:Mis subtitulos.srt"
+

4. Conversión de archivos de texto y conjunto de caracteres

+ + + +

+ Para una discusión en profundidad sobre como la suite de MkvToolNix manipula + las conversiones de caracteres, la codificación entrada/salida y la + codificación de la línea de comandos y consola, por favor consulte la + sección llamada de igual manera en la pagina del manual para mkvmerge(1). + +

+ +

5. Formatos de salida

+ + + +

+ La decisión sobre el tipo de formato se basa en el tipo de pista y no en la + extensión usada en el nombre del archivo de salida. Por ahora, los + siguientes tipos de pista son compatibles: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ Todos los archivos AAC se escribirán en un archivo + AAC con encabezados ADTS antes de cada + paquete. Los encabezados ADTS no contendrán el obsoleto + campo de énfasis. + +

+ +
A_AC3, A_EAC3 + +

+ Serán extraídos a archivos AC-3 sin procesar. + +

+ +
A_ALAC + +

+ Las pistas ALAC se escriben en archivos + CAF. + +

+ +
A_DTS + +

+ Serán extraídos a archivos DTS sin procesar. + +

+ +
A_FLAC + +

+ Las pistas FLAC se escriben en archivos en bruto + FLAC. + +

+ +
A_MPEG/L2 + +

+ Las secuencias de audio MPEG-1 Layer II serán extraídas a archivos en bruto + MP2. + +

+ +
A_MPEG/L3 + +

+ Serán extraídos a archivos MP3 sin procesar. + +

+ +
A_OPUS + +

+ Las pistas Opus(tm) se escribe en archivos + OggOpus(tm). + +

+ +
A_PCM/INT/LIT, A_PCM/INT/BIG + +

+ Los datos PCM sin procesar serán escritos al archivo + WAV. Los datos enteros big-endian se convertirán en datos + little-endian en el proceso. + +

+ +
A_REAL/* + +

+ Las pistas RealAudio(tm) se escriben en archivos + RealMedia(tm). + +

+ +
A_TRUEHD, A_MLP + +

+ Serán extraídos a archivos TrueHD/MLP sin + procesar. + +

+ +
A_TTA1 + +

+ Las pistas TrueAudio(tm) se escriben en archivos + TTA. Por favor, tenga en cuenta que debido a la precisión + limitada de los códigos de tiempo de Matroska(tm), el encabezado del archivo + extraído será diferente con respecto a dos campos: + data_length (el número total de muestras en el archivo) y + el CRC. + +

+ +
A_VORBIS + +

+ El audio Vorbis se escribirá en un archivo OggVorbis(tm). + +

+ +
A_WAVPACK4 + +

+ Las pistas WavPack(tm) se escriben en archivos + WV. + +

+ +
S_HDMV/PGS + +

+ Los subtítulos PGS se escribirán como archivos + SUP. + +

+ +
S_HDMV/TEXTST + +

+ Los subtítulos TextST serán escritos como un formato + especial de archivo inventado para mkvmerge(1) y mkvextract(1). + +

+ +
S_KATE + +

+ Las secuencias Kate(tm) se escribirán dentro de un + contenedor Ogg(tm). + +

+ +
S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS + +

+ Los subtítulos de texto SSA y ASS se + escribirán como archivos SSA/ASS, + respectivamente. + +

+ +
S_TEXT/UTF8, S_TEXT/ASCII + +

+ Los subtítulos de texto simple se escribirán como archivos + SRT. + +

+ +
S_VOBSUB + +

+ Los subtítulos VobSub(tm) se escribirán como archivos + SUB junto con sus respectivos archivos de índice + IDX. + +

+ +
S_TEXT/USF + +

+ Los subtítulos de texto USF se escribirán como archivos + USF. + +

+ +
S_TEXT/WEBVTT + +

+ Los subtítulos de texto WebVTT serán escritos como archivos + WebVTT. + +

+ +
V_MPEG1, V_MPEG2 + +

+ Las pistas de video MPEG-1 y MPEG-2 serán + escritas como secuencias básicas MPEG. + +

+ +
V_MPEG4/ISO/AVC + +

+ Las pistas de video H.264 / AVC se + escriben en secuencias elementales H.264 que pueden ser + procesadas posteriormente, por ejemplo con MP4Box(tm) + del paquete GPAC(tm). + +

+ +
V_MPEG4/ISO/HEVC + +

+ Las pistas de video H.265/HEVC serán + escritas a secuencias básicas H.265 que pueden ser + procesadas posteriormente, por ejemplo, con + MP4Box(tm) del paquete + GPAC(tm). + +

+ +
V_MS/VFW/FOURCC + +

+ Las pistas de video con FPS fijadas con este + CodecID se escriben en los archivos + AVI. + +

+ +
V_REAL/* + +

+ Las pistas RealVideo(tm) se escriben en archivos + RealMedia(tm). + +

+ +
V_THEORA + +

+ Las secuencias Theora(tm) se escribirán en un + contenedor Ogg(tm). + +

+ +
V_VP8, V_VP9 + +

+ Las pistas VP8 / VP9 se escriben en + archivos IVF. + +

+ +
Tags + +

+ Las etiquetas se convierten a formato XML. Este formato es el mismo que + mkvmerge(1) admite para leer etiquetas. + +

+ +
Attachments + +

+ Los adjuntos se escriben en el archivo de salida tal y como están. No se + realiza ningún tipo de conversión. + +

+ +
Chapters + +

+ Los capítulos se convierten a formato XML. Este formato es el mismo que + mkvmerge(1) admite para leer capítulos. Alternativamente, una versión + reducida puede ser generada a un simple formato de estilo + OGM. + +

+ +
Timestamps + +

+ Los códigos de tiempo se ordenan de principio a fin, y entonces se genera un + archivo compatible con el formato timestamp v2 preparado para ser + proporcionado a mkvmerge(1). La extracción a otros formatos (v1, v3 y v4) no + son compatibles. + +

+ +
+ +

6. Códigos de salida

+ + + +

+ mkvextract(1) finaliza con uno de estos tres códigos de salida: + +

+ + +
    + +
  • + +

    + 0 -- Este código de salida significa que la extracción + se ha realizado correctamente. + +

    + +
  • + + +
  • + +

    + 1 -- En este caso mkvextract(1) genera una salida con al + menos una advertencia, pero la extracción continuó. Una advertencia es + prefijada con el texto 'Advertencia:'. Dependiendo de los + fallos involucrados los archivos creados serán correctos o no. El usuario es + instado a que revise tanto las advertencias como los archivos creados. + +

    + +
  • + + +
  • + +

    + 2 -- Este código de salida es usado después de que + ocurra un error. mkvextract(1) aborta el proceso justo después de mostrar el + mensaje de error. El rango de los mensajes de error va desde los argumentos + de la línea de comandos, por delante de los errores de lectura/escritura, + hasta los archivos erróneos. + +

    + +
  • + +
+ +

7. Variables de entorno

+ + + +

+ mkvextract(1) usa las variables predefinidas que se determinan en la + configuración local del sistema (p.e. LANG y la familia + LC_*). Variables adicionales: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG y + su forma abreviadaMTX_DEBUG + +

El contenido se trata como si se hubiese pasado a través de la opción --debug. +

+ +
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE y + su forma abreviada MTX_ENGAGE + +

El contenido se trata como si se hubiese pasado a través de la opción --engage. +

+ +
+ +

8. Vea también

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. WWW

+ + +

+ La última versión se puede encontrar siempre en la página de MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..6131aee80b47bd66a7b5294f8eb8c31038091ab9 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvinfo.html @@ -0,0 +1,529 @@ + + + + + mkvinfo -- Imprime la información respecto a los elementos de los archivos Matroska + + + +
mkvinfo -- Imprime la información respecto a los elementos de los archivos Matroska(tm)
+
+ +
+

1. Sinopsis

+ + +
mkvinfo opciones {nombre-archivo} +
+ +

2. Descripción

+ + +

+ Este programa muestra una lista de todos los elementos contenidos en un + archivo Matroska(tm). La salida puede ser limitada a una lista de pistas en un + archivo incluyendo información acerca de los códecs usados. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ Por defecto mkvinfo(1) se detiene cuando encuentra un primer clúster. Además, + no muestra ciertos elementos que ocurren con frecuencia. Con esta opción + mkvinfo(1) continuará el proceso sin importar el nivel de verbosidad + mostrando todos los elementos. + +

+ +
-c, --checksums + +

+ Calcula y muestra el checksum Adler-32 para cada + fotograma. Útil sólo para depuración. + +

+ +
-o, --continue + +

+ Por defecto mkvinfo(1) se detiene cuando encuentra un primer clúster. Con + esta opción mkvinfo(1) continuará el proceso sin importar el nivel de + verbosidad. + +

+ +
-p, --hex-positions + +

+ Muestra en hexadecimal las posiciones de todos los elementos sin importar el + nivel de verbosidad. + +

+ +
-P, --positions + +

+ Muestra en decimal las posiciones de todos los elementos sin importar el + nivel de verbosidad. + +

+ +
-s, --summary + +

+ Sólo muestra un breve resumen de lo que mkvinfo(1) encuentra y no de cada + elemento. + +

+ +
-t, --track-info + +

+ Muestra la estadística de cada pista en el modo detallado. También establece + la verbosidad a 1 si antes era 0. + +

+ +
-x, --hexdump + +

+ Muestra los primeros 16 bytes de cada fotograma como un dump (volcado) + hexadecimal. + +

+ +
-X, --full-hexdump + +

+ + + Muestra todos los bytes de cada fotograma como un dump (volcado) + hexadecimal. + +

+ +
-z, --size + +

+ Muestra el tamaño de cada elemento incluyendo su encabezado. + +

+ +
--command-line-charset + conjunto-caracteres + +

+ Establece el conjunto de caracteres a convertir las cadenas de texto dadas + desde la línea de comandos. Por defecto, se ajusta al conjunto de caracteres + dado por la configuración local del sistema. + +

+ +
--output-charset conjunto-caracteres + +

+ + + Establece el conjunto de caracteres para convertir las cadenas de texto que + serán usadas en el archivo de salida. Por defecto, se ajusta al conjunto de + caracteres dado por la configuración local del sistema. + +

+ +
-r, --redirect-output + nombre-archivo + +

+ Escribe todos los mensajes al archivo nombre-archivo + en vez de en la consola. Mientras esto puede ser realizado fácilmente con + una redirección de salida hay casos en el que esta opción es necesaria: + cuando el terminal reinterpreta la salida antes la escribe a un archivo. El + conjunto de caracteres establecidos con --output-charset + se respeta. + +

+ +
--ui-language código + +

+ Fuerza la traducción al código de idioma que será + usado (p.e. 'de_DE' para la traducción al + Alemán). Introduciendo 'list' como + código provocará que el programa muestre una lista de + las traducciones disponibles. + +

+ +
--abort-on-warnings + +

+ Le dice al programa que cancele después de emitir la primera advertencia. El + código de salida del programa será 1. + +

+ +
--debug topic + +

+ Habilita la depuración para una característica concreta. Esta opción sólo es + útil para desarrolladores. + +

+ +
--engage característica + +

+ Activa características experimentales. Una lista de características + disponibles pueden ser solicitada con mkvinfo --engage + list. Estas características no están destinadas para ser + utilizadas en situaciones normales. + +

+ +
--gui-mode + +

+ Habilita el modo GUI. En este modo las líneas especialmente formateadas + pueden ser generadas para decirle a un control de la GUI lo que está + pasando. Estos mensajes se rigen bajo el formato + '#GUI#mensaje'. El mensaje puede ser continuado por pares + de valores/claves como en + '#GUI#mensaje#clave1=valor1#clave2=valor2…'. Ni los + mensajes ni las claves pueden ser traducidas y siempre se generan en + inglés. + +

+ +
-v, --verbose + +

+ Ser más detallado. Consulte la sección acerca de niveles de detalle para una + descripción de que información será generada en cada nivel. + +

+ +
-h, --help + +

+ Muestra información de uso y sale. + +

+ +
-V, --version + +

+ Muestra la información de la versión y sale. + +

+ +
@options-file.json + +

+ Lee argumentos adicionales de la línea de comandos desde el archivo + archivo-opciones. Para más información sobre los + formatos admitidos para esos archivos consulte la sección acerca de + "archivos de opciones" en la página del manual de mkvmerge(1) + +

+ +
+ +

3. Niveles de detalle

+ + + +

+ La opción -v puede ser + usada para incrementar el nivel de verbosidad mkvinfo(1) e imprimir más + información sobre al archivo actual. + +

+ + +

+ En el nivel 0 mkvinfo(1) imprimirá sólo los encabezados de la pista que + encuentra y sus tipos. mkvinfo(1) saldrá tan pronto como los encabezados sean + analizados completamente (más técnico: tan pronto como el primer clúster sea + encontrado). En este nivel, la búsqueda de entradas del encabezado y los + índices no será mostrados -- incluso si ellos están localizados al principio + de la información de la pista. + +

+ + +

+ En el nivel 1 mkvinfo(1) también imprimirá todos los elementos encontrados + Matroska(tm) en todo el archivo al buscar las entradas del encabezado y del + índice. Si el modo resumen está habilitado entonces mkvinfo(1) también + generará la posición del fotograma. + +

+ + +

+ Se puede lograr el mismo efecto con la opción --continue. + +

+ + +

+ En el nivel 2 mkvinfo(1) también imprimirá las entradas buscadas del + encabezado, las del índice y la posición en el archivo en el que cada + elemento Matroska(tm) pudo ser encontrado. + +

+ + +

+ Se puede lograr el mismo efecto con las opciones --all + --positions. + +

+ + +

+ En el nivel 3 y superiores mkvinfo(1) imprimirá algo de información que no + está directamente relacionada al elemento Matroska(tm). El resto de elementos + sólo imprimirá datos sobre los elementos que fueron encontrados. El nivel 3 + añade meta información para facilitar la depuración (leer: está indicado + para desarrolladores). Todas las líneas escritas por el nivel 3 están + cerradas entre corchetes para facilitar el filtrado. + +

+ +

4. Conversión de archivos de texto y conjunto de caracteres

+ + + +

+ Para una discusión en profundidad sobre como la suite de MkvToolNix manipula + las conversiones de caracteres, la codificación entrada/salida y la + codificación de la línea de comandos y consola, por favor consulte la + sección llamada de igual manera en la pagina del manual para mkvmerge(1). + +

+ +

5. Códigos de salida

+ + + +

+ mkvinfo(1) finaliza con uno de estos tres códigos de salida: + +

+ + +
    + +
  • + +

    + 0 -- Este código de salida significa que la extracción + se ha realizado correctamente. + +

    + +
  • + + +
  • + +

    + 1 -- En este caso mkvinfo(1) genera una salida con al + menos una advertencia, pero la extracción continuó. Una advertencia es + prefijada con el texto 'Advertencia:'. + +

    + +
  • + + +
  • + +

    + 2 -- Este código de salida es usado después de que + ocurra un error. mkvinfo(1) aborta el proceso justo después de mostrar el + mensaje de error. El rango de los mensajes de error va desde los argumentos + de la línea de comandos, por delante de los errores de lectura/escritura, + hasta los archivos erróneos. + +

    + +
  • + +
+ +

6. Variables de entorno

+ + + +

+ mkvinfo(1) usa las variables predefinidas que se determinan en la + configuración local del sistema (p.e. LANG y la familia + LC_*). Variables adicionales: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUG, MKVTOOLNIX_DEBUG y su + forma abreviada MTX_DEBUG + +

El contenido se trata como si se hubiese pasado a través de la opción --debug. +

+ +
MKVINFO_ENGAGE, MKVTOOLNIX_ENGAGE y su + forma abreviada MTX_ENGAGE + +

El contenido se trata como si se hubiese pasado a través de la opción --engage. +

+ +
+ +

7. Vea también

+ + +

+ mkvmerge(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. WWW

+ + +

+ La última versión se puede encontrar siempre en la página de MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..6e86da2546fec933b8fc79a02fe78779d626702d --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvmerge.html @@ -0,0 +1,5406 @@ + + + + + mkvmerge -- Multiplexa secuencias multimedia en un archivo Matroska + + + +
mkvmerge -- Multiplexa secuencias multimedia en un archivo Matroska(tm)
+
+ +
+

1. Sinopsis

+ + +
mkvmerge opciones globales {-o salida} opciones1 {archivo1} opciones2 {archivo2} @archivo-opciones.json +
+ +

2. Descripción

+ + +

+ Este programa toma de la entrada diversos archivos multimedia y une sus + secuencias (todas ellas o sólo las seleccionadas) en un archivo Matroska(tm); + mire la página web de + Matroska. + +

+ + +
+

Important:

+ +

+ El orden de las opciones en la línea de comandos es importante. Por favor, + lea la sección "Orden de + opciones" si eres nuevo usando el programa. + +

+ +
+ + +

2.1. Opciones generales

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

Incrementa el detalle (verbose).

+ +
-q, --quiet + +

Suprime la salida.

+ +
-o, --output + nombre-archivo + +

Escribe el nombre-archivo. Si la división es usada + entonces este parámetro es tratado de distinta manera. Mire la explicación + sobre la opción --split para + obtener más detalles. +

+ +
-w, --webm + +

Crea un archivo compatible WebM. Esto también se habilita si el nombre de la + extensión del archivo de salida es "webm". Este modo impone + ciertas restricciones. Los únicos códecs permitidos son VP8, VP9 para video + y Opus, Vorbis para pistas de audio. La entrada DocType de la cabecera se + cambia a "webm". + +

+ + +

+ Para capítulos y etiquetas sólo se permite un subconjunto de + elementos. mkvmerge(1) eliminará automáticamente todos los elementos no + permitidos por la especificación. + +

+ +
--title título + +

Establece el título general para el archivo de salida, p.e. el nombre de la + película. +

+ +
--default-language código-lenguaje + +

Establece el código de lenguaje predefinido que será usado para todas las + pistas a menos que se sobrescriban con la opción --language. +

+ + +

El código de idioma predefinido es 'und' para + 'indeterminado'. +

+ +
+ + + +

2.2. Manipulación de información del segmento (opciones generales)

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo nombre-archivo.xml + +

+ Lee la información del segmento a partir de un archivo + XML. Este archivo puede contener el UID de + la familia del segmento: el UID del segmento, los elementos + UID del segmento anterior y siguiente. Un archivo de + ejemplo así como un DTD están incluidos en el paquete de + MKVToolNix. + +

+ + +

+ Consulte la sección de más adelante sobre los archivos XML de información del + segmento para más detalles. + +

+ +
--segment-uid SID1,SID2,... + +

+ Establece los UIDs del segmento que se usarán. Esto es una lista separada + por comas con UIDs del segmento con una longitud de 128 bits en la forma + típica del UID: números hexadecimales con o sin el prefijo "0x" + con o sin espacios y siendo 32 dígitos exactos. + +

+ + +

+ Si el SID comienza con = entonces el resto se interpreta como el nombre de + un archivo Matroska cuyo UID del segmento es leído y usado. + +

+ + +

+ Cada archivo creado contiene un segmento, y cada segmento tiene un SID (UID + del segmento). Si se especifican más SIDs que segmentos entonces los UIDs + que sobren son ignorados. Si se especifican menos UIDs que segmentos + entonces se crearán de manera aleatoria los UIDs que faltan. + +

+ +
+ + + +

2.3. Manipulación de capítulos y etiquetas (opciones generales)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language código-idioma + +

+ Establece el código de idioma ISO 639-2 que se escribe en cada entrada de + capítulo. Por defecto se establece a 'eng'. Consulte la + sección de más adelante sobre los + capítulos para obtener más detalles. + +

+ + +

+ Esta opción puede ser usada tanto para archivos simples de capítulos como + para archivos de entrada que contengan capítulos sin información del idioma + de los capítulos, p.e. archivos MP4 y OGM. + +

+ + +

+ El idioma establecido con esta opción se usa también cuando los capítulos se + generan con la --generate-chapters + opción. + +

+ +
--chapter-charset + conjunto-caracteres + +

+ Establece el conjunto de caracteres que se usará para la conversión a UTF-8 + para archivos simples de capítulos. Consulte la sección sobre la conversión de archivos de + texto y conjunto de caracteres para ver una explicación sobre cómo + mkvmerge(1) realiza la conversión entre conjunto de caracteres. + +

+ + +

+ Este ajuste también se aplica a los capítulos que se copian desde ciertos + tipos de contenedores, p.e. archivos Ogg/OGM y MP4. Consulte la sección de + más adelante sobre capítulos para obtener más detalles. + +

+ +
--chapter-sync + d[,o[/p]] + +

+ Ajusta los códigos de tiempo de los capítulos en el siguiente archivo de + origen en d ms. Como alternativa, se puede usar la + opción --sync con el ID -2 de pista + especial (consulte la sección IDs de pista especiales) + +

+ + +

+ o/p: ajusta las marcas de + tiempo por o/p para fijar + desfases lineales. Si se omite, p por defecto es + 1. Tanto o y p pueden ser + números decimales. + +

+ + +

+ Por defecto: no hay ninguna sincronización manual (que es lo mismo que + d = 0 y + o/p = + 1.0). + +

+ + +

+ Esta opción se puede utilizar varias veces para un archivo de entrada + aplicándola a diversas pistas seleccionando IDs de pista diferente de pista + cada vez. + +

+ +
--generate-chapters modo + +

+ mkvmerge(1) puede crear capítulos automáticamente. Actualmente, se admiten + los siguientes dos modos: + +

+ + +
    + +
  • + +

    + 'when-appending' – Este modo crea un capítulo al inicio y + cada vez que se une un archivo. + +

    + + +

    + Este modo también funciona con los tipos de corte + 'partes:' y 'partes-fotogramas:'. Para + estos modos se generará un capitulo por cada rango de marcas de tiempo + unidas (aquellos cuyas marcas de tiempo inicien con '+'). + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1) requiere una pista de video o audio a fin de poder determinar + cuando se une un nuevo archivo. Si una o más pistas de vídeo se multiplexan, + se utiliza la primera. Por el contrario, se utiliza la primera pista de + audio. + +

    + +
    + +
  • + + +
  • + +

    + 'interval:time-spec' – Este modo + crea un capítulo conforme a un intervalo establecido mediante + time-spec. El formato es + HH:MM:SS.nnnnnnnnn o un número seguido por una unidad + 's', 'ms' o 'us'. + +

    + + +

    + Ejemplo: --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ Los nombres para los nuevos capítulos se controlan con la opción --generate-chapters-name-template. + El idioma se establece con --chapter-language + que se debe establecer antes de --generate-chapters. + +

+ +
--generate-chapters-name-template + plantilla + +

+ Esto establece el nombre de la plantilla para los nombres de los capítulos + creados con la opción --generate-chapters. + Si no se usa la opción entonces se usa por defecto 'Chapter + <NUM:2>'. + +

+ + +

+ Hay diversas variables que se pueden usar en la plantilla que son + reemplazadas por sus valores correspondientes cuando se genera un + capítulo. La cadena de texto '<NUM>' será + reemplazada por el número de capítulo. La cadena de texto + '<START>' será reemplazada por la marca de tiempo + inicial del capítulo. + +

+ + +

+ Las cadenas '<FILE_NAME>' y + '<FILE_NAME_WITH_EXT>' sólo se rellenan cuando se + generan capítulos para los archivos anexados. Serán reemplazados por el + nombre del archivo anexado con su extensión, no respectivamente. Tenga en + cuenta que sólo se insertan el nombre base y la extensión del archivo, no + sus componentes de directorio o unidad. + +

+ + +

+ Puede especificar el número mínimo de dígitos del número del capítulo con + '<NUM:places>', + p.e. '<NUM:3>'. Se le añadirán ceros a la + izquierda si el número resultante tiene menos dígitos de los especificados. + +

+ + +

+ Puede controlar el formato a usar según la marca de tiempo inicial con + <START:format>. Por defecto, se usará + '%H:%M:%S'. Los códigos válidos de formato son: + +

+ + +
    + +
  • + +

    %h – horas +

    + +
  • + +
  • + +

    %H – horas con dos dígitos que admiten ceros a la + izquierda +

    + +
  • + +
  • + +

    %m – minutos +

    + +
  • + +
  • + +

    %M – minutos con dos dígitos que admiten ceros a la + izquierda +

    + +
  • + +
  • + +

    %s – segundos +

    + +
  • + +
  • + +

    %S – segundos con dos dígitos que admiten ceros a la + izquierda +

    + +
  • + +
  • + +

    %n – nanosegundos con nueve digitos +

    + +
  • + +
  • + +

    %<1-9>n – nanosegundos con hasta nueve dígitos + (p.e. tres dígitos con %3n) +

    + +
  • + +
+ +
--cue-chapter-name-format formato + +

+ mkvmerge(1) puede leer CUE sheets de archivos de audio como + entrada para capítulos. Los CUE sheets normalmente contiene + las entradas PERFORMER y TITLE para + cada entrada del índice. mkvmerge(1) usa estos dos textos a fin de construir + el nombre del capítulo. Con esta opción, se puede configurar el formato + usado para este nombre. + +

+ + +

+ Si esta opción no se establece entonces mkvmerge(1) usa por defecto el + formato '%p - %t' (el artista, seguido por un espacio, una + barra, otro espacio y el título). + +

+ + +

+ Si el formato está establecido entonces todo es copiado tal y como está + excepto los siguientes meta caracteres que serán reemplazados por: + +

+ + +
    + +
  • + +

    %p es reemplazado por el texto de la entrada + PERFORMER, +

    + +
  • + +
  • + +

    %t es reemplazado por el texto de la entrada + TITLE, +

    + +
  • + +
  • + +

    %n es reemplazado por el número de la pista y, +

    + +
  • + +
  • + +

    %N es reemplazado por el número de la pista, + agregándole un cero a la izquierda si el número es menor de 10. +

    + +
  • + +
+ +
--chapters nombre-archivo + +

+ Lee la información de capítulo de + nombre-archivo. Consulte la sección de más adelante + sobre capítulos para obtener más + detalles. + +

+ +
--global-tags nombre-archivo + +

+ Lee las etiquetas globales de + nombre-archivo. Consulte la sección de más adelante + sobre etiquetas para obtener más + detalles. + +

+ +
+ + + +

2.4. Control general de salida (opciones generales avanzadas)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order + FID1:TID1,FID2:TID2,... + +

+ Esta opción cambia el orden en el que se crean las pistas de un archivo de + entrada. El argumento es una lista separada por comas de pares de IDs. Cada + par contiene primero el ID de archivo (FID1) que es + tan sólo es el número del archivo en la línea de comandos partiendo de + cero. El segundo es el ID de pista (TID1) de ese + archivo. Si algunos IDs de pista son omitidos entonces esas pistas se crean + después de que se hayan creado las establecidas con esta opción. + +

+ +
--cluster-length especificación + +

+ Limita el número de bloques de datos o la duración de los datos en cada + clúster. El parámetro especificación puede ser un + número n sin unidad o un número + d con el sufijo 'ms'. + +

+ + +

+ Si no se usa ninguna unidad entonces mkvmerge(1) pondrá como máximo + n bloques de información en cada clúster. El número + máximo de bloques es 65535. + +

+ + +

+ Si el número d tiene el sufijo + 'ms' entonces mkvmerge(1) pondrá como máximo + d milisegundos de información en cada clúster. El + valor mínimo para d es '100ms', y + el máximo es '32000ms'. + +

+ + +

+ mkvmerge(1) por defecto pone como máximo 65535 bloques de información y + 5000ms de información en cada clúster. + +

+ + +

+ Los programas al tratar de encontrar cierto fotograma tan sólo pueden buscar + directamente un clúster y posteriormente leer todo el clúster. Por lo tanto, + crear clústeres muy grandes podría conllevar una búsqueda lenta e + imprecisa. + +

+ +
--clusters-in-meta-seek + +

+ Le dice a mkvmerge(1) crear un elemento meta seek al final del archivo que + contendrá todos los clústeres. Consulte también la sección sobre diseño de archivos Matroska. + +

+ +
--timestamp-scale factor + +

+ Fuerza el factor de escala de los códigos de tiempo con + factor. Los valores admitidos están comprendidos en + el rango 1000..10000000 o el valor + especial -1. + +

+ + +

+ Normalmente, mkvmerge(1) usará el valor 1000000 lo que + significa que los códigos de tiempo y duraciones tendrán una precisión de + 1ms. Para los archivos que no vayan a contener una pista de video pero si al + menos una de audio entonces mkvmerge(1) elegirá automáticamente un factor de + escala de códigos de tiempo por lo que todos los códigos de tiempo y + duraciones tendrán una precisión de una muestra (sample) de audio. Esto + causa una sobrecarga mayor pero permite que la búsqueda y extracción sea más + precisa. + +

+ + +

+ Si se usa el valor especial -1 entonces mkvmerge(1) + usará la precisión de la muestra incluso si existe una pista de video. + +

+ +
--enable-durations + +

+ Escribe las duraciones para todos los bloques. Esto incrementará el tamaño + del archivo y por ahora, no ofrece ningún valor adicional para los + reproductores. + +

+ +
--no-cues + +

+ Le dice a mkvmerge(1) no crear y escribir la información del índice (cue) que + puede ser comparada al índice de un AVI. Los archivos Matroska(tm) se pueden + reproducir sin la información del índice, pero la búsqueda será + probablemente imprecisa y lenta. Usa esto tan sólo si realmente estás + desesperado por ahorrar espacio o con fines de testeo. Mire también la + opción --cues que puede + ser especificada para cada archivo de entrada. + +

+ +
--no-date + +

+ Por defecto mkvmerge(1) establece en el campo "fecha" de información del + segmento el tiempo & fecha del inicio del multiplexado. Con esta opción, + este campo no será escrito. + +

+ +
--disable-lacing + +

+ + + Deshabilita el lacing para todas las pistas. Esto incrementará el tamaño del + archivo, especialmente si hay muchas pistas de audio. Esta opción no está + diseñada para su uso frecuente. + +

+ +
--disable-track-statistics-tags + +

+ Normalmente, mkvmerge(1) escribirá algunas etiquetas con estadísticas para + cada pista. Si dichas etiquetas ya están presentes entonces serán + sobrescritas. Las etiquetas BPS, + DURATION, NUMBER_OF_BYTES y + NUMBER_OF_FRAMES. + +

+ + +

+ Habilitar esta opción impide que mkvmerge(1) escriba y edite las etiquetas + existentes con los mismos nombres. + +

+ +
--disable-language-ietf + +

+ Normalmente mkvmerge(1) escribirá los nuevos elementos de idioma IETF BCP 47 + junto con los elementos de idioma heredados en los encabezados de pista, + capítulos y etiquetas. Si se usa esta opción, únicamente serán escritos los + elementos heredados. + +

+ +
--normalize-language-ietf modo + +

+ Habilita la normalización de todas las etiquetas de idioma IETF BCP 47 a su + forma canónica con el modo 'canonical', a su forma de + sub-etiquetas de idioma extendido con el modo 'extlang' o + lo desactiva con el modo 'off'. Por defecto, se aplica la + normalización a la forma canónica. + +

+ + +

+ En la forma canónica todas las sub-etiquetas para las que existe valores + preferidos se reemplazan por esos valores preferidos. Por ejemplo, convierte + esto 'zh-yue-jyutping' a + 'yue-jyutping' o 'fr-FX' a + 'fr-FR'. + +

+ + +

+ Para las sub-etiquetas de idioma extendido, primero se crea la forma + canónica. Después se reemplazan por esa sub-etiqueta de idioma extendido y + su prefijo todos los idiomas principales para los que existe una + sub-etiqueta de idioma extendido. Por ejemplo, esto convierte + 'yue-jyutping' a 'zh-yue-jyutping' y + no sucede nada en 'fr-FR' ya que 'fr' + no es una sub-etiqueta de idioma extendido. + +

+ +
--stop-after-video-ends + +

+ Detiene el procesamiento una vez finalizada la pista de vídeo principal, + descartando los paquetes restantes de otras pistas. + +

+ +
+ + + +

2.5. División, vinculación, unión y concatenación de archivos (más opciones + generales)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split especificación + +

+ Divide el archivo generado después de un tamaño o tiempo especificado. Por + favor, tenga en cuenta que estas pistas sólo pueden ser divididas justo + antes de un fotograma clave. Por lo tanto, el punto de división podría ser + algo distinto del especificado por el usuario. + +

+ + +

+ Por el momento mkvmerge(1) soporta los siguientes modos: + +

+ + +
    + +
  1. + +

    + División por tamaño. + +

    + + +

    + Sintaxis: --split + [size:]d[k|m|g] + +

    + + +

    + Ejemplos: --split size:700m or --split 150000000 + +

    + + +

    + El parámetro d puede acabar con 'k', + 'm' o 'g' para indicar que el + tamaño están en KB, MB o GB, respectivamente. De cualquier otro modo, se + asume el tamaño en bytes. Después de que el archivo de salida alcance el + tamaño limite, comienza la creación de otro archivo. + +

    + + +

    + El prefijo 'size:' se puede omitir por motivos de + compatibilidad. + +

    + +
  2. + + +
  3. + +

    + División por duración. + +

    + + +

    + Sintaxis: --split + [duration:]HH:MM:SS.nnnnnnnnn|ds + +

    + + +

    + Ejemplos: --split duration:00:60:00.000 o --split + 3600s + +

    + + +

    + El parámetro puede tener la forma HH:MM:SS.nnnnnnnnn + para especificar la duración en precisión de nanosegundos o puede ser un + número d seguido por la letra + 's' para una duración en + segundos. HH es el número de las horas, + MM el de los minutos, SS para + los segundos y nnnnnnnnn son los nanosegundos. Tanto + los números de las horas como los nanosegundos pueden ser omitidos. Hay + hasta nueve dígitos después del punto decimal. Después de que la duración + del contenido, en el archivo actual, alcance este límite comienza la + creación de otro archivo. + +

    + + +

    + El prefijo 'duration:' puede ser omitido por motivos de + compatibilidad. + +

    + +
  4. + + +
  5. + +

    + División por códigos de tiempo. + +

    + + +

    + Sintaxis: --split + timestamps:A[,B[,C...]] + +

    + + +

    + Ejemplo: --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + Los parámetros A, B, + C, etc... pueden tener el mismo formato que el usado + para la división por duración (mire más arriba). La lista de códigos de + tiempo están separados por comas. Tras alcanzar, en la secuencia de entrada, + el código de tiempo del punto de división actual se crea un nuevo + archivo. Entonces se usa el siguiente punto de división especificado en la + lista. + +

    + + +

    + El prefijo 'timestamps:' no puede ser omitido. + +

    + +
  6. + + +
  7. + +

    + Conservar las partes especificadas por los rangos de códigos de tiempo + especificados mientras que las otras que son descartadas. + +

    + + +

    + Sintaxis: --split + parts:inicio1-fin1[,[+]inicio2-fin2[,[+]inicio3-fin3...]] + +

    + + +

    + Ejemplos: +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + El modo parts le dice a mkvmerge(1) conservar ciertos + rangos de códigos de tiempo mientras se descartan otros. Los rangos a + conservar tienen que ser listados después de la palabra clave + parts: y separados por comas. Un rango, en sí mismo, + consiste en un inicio y un fin, en el mismo formato y formas que acepta + --split (p.e. tanto 00:01:20 y + 80s se refieren al mismo código de tiempo). + +

    + + +

    + Si el código de tiempo de inicio se omite entonces por defecto lo toma del + valor del código de tiempo final del rango anterior. Si no existe un rango + anterior entonces por defecto lo toma el valor del inicio del archivo (mire + el ejemplo 3). + +

    + + +

    + Si el código de tiempo final se omite entonces por defecto lo toma del valor + final de los archivos entrada que básicamente le dice a mkvmerge(1) que + conserve el resto (mire el ejemplo 3). + +

    + + +

    + Por lo general, cada rango será escrito a un nuevo archivo. Esto se puede + cambiar para que los rangos consecutivos se escriban en el mismo + archivo. Por eso el usuario tiene que asignar el prefijo + + al código de tiempo de inicial. Esto le dice a + mkvmerge(1) que no cree un nuevo archivo y, en vez de eso, concatene el rango + después del último rango escrito en el archivo. Los códigos de tiempo serán + ajustados para que no existan discontinuidades en el archivo de salida + incluso si había un espacio sin abarcar entre dos rangos del archivo de + entrada. + +

    + + +

    + En el ejemplo 1 mkvmerge(1) creará dos archivos. El primero abarca el + contenido a partir de 00:01:20 hasta + 00:02:45. El segundo archivo comprende el contenido a + partir de 00:05:50 hasta 00:10:30. + +

    + + +

    + En el ejemplo 2 mkvmerge(1) creará sólo un archivo. Este archivo abarcará + tanto el contenido a partir de 00:01:20 hasta + 00:02:45, como el contenido a partir de + 00:05:50 hasta 00:10:30. + +

    + + +

    + En el ejemplo 3 mkvmerge(1) creará dos archivos. El primero abarcará el + contenido desde el inicio del archivo de entrada hasta + 00:02:45. El segundo archivo abarca el contenido a partir + de 00:05:50 hasta el final del archivo de entrada. + +

    + + +
    +

    Note:

    + +

    + Tenga en cuenta que mkvmerge(1) sólo realiza divisiones en fotogramas + claves. Esto es aplicable tanto al inicio como al final de cada rango. Así + que si un código de tiempo final está entre dos fotogramas claves, + mkvmerge(1) continuará el procesamiento de los fotogramas hasta el final pero + excluirá el siguiente fotograma clave. + +

    + +
    + +
  8. + + +
  9. + +

    + Conservar partes concretas especificando rangos numéricos de + fotogramas/campos mientras se descartan otros. + +

    + + +

    + Sintaxis: --split + parts-frames:inicio1-fin1[,[+]inicio2-fin2[,[+]inicio3-fin3...]] + +

    + + +

    + Ejemplos: +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + El modo parts-frames le dice a mkvmerge(1) para conservar + ciertos rangos numéricos de fotogramas/campos mientras se descartan + otros. Los rangos a conservan tienen que ser especificados después de la + palabra clave parts-frames: y separados por comas. Un + rango, en si mismo, es un número de un fotograma/campo inicial y final. La + numeración comienza en 1. + +

    + + +

    + Si el número inicial se omite entonces por defecto lo toma del número final + del rango anterior. Si no existe un rango anterior entonces por defecto lo + toma del inicio del archivo (mire el ejemplo 3). + +

    + + +

    + Si el número final se omite entonces por defecto lo toma del final del + archivo de entrada que básicamente le dice a mkvmerge(1) que conserve el + resto (mire el ejemplo 3). + +

    + + +

    + Por lo general, cada rango será escrito a un nuevo archivo. Esto se puede + cambiar para que los rangos consecutivos se escriban en el mismo + archivo. Por eso el usuario tiene que asignar el prefijo + + al código de tiempo de inicial. Esto le dice a + mkvmerge(1) que no cree un nuevo archivo y, en vez de eso, concatene el rango + después del último rango escrito en el archivo. Los códigos de tiempo serán + ajustados para que no existan discontinuidades en el archivo de salida + incluso si había un espacio sin abarcar entre dos rangos del archivo de + entrada. + +

    + + +
    +

    Note:

    + +

    + Tenga en cuenta que mkvmerge(1) sólo realiza divisiones en fotogramas + claves. Esto es aplicable tanto al inicio como al final de cada rango. Así + que si un código de tiempo final está entre dos fotogramas claves, + mkvmerge(1) continuará el procesamiento de los fotogramas hasta el final pero + excluirá el siguiente fotograma clave. + +

    + +
    + + +

    + En el ejemplo 1 mkvmerge(1) creará dos archivos. El primero abarca el + contenido a partir del primer fotograma clave anterior, posterior o el mismo + 137 hasta el primer fotograma clave anterior o el mismo + 258. El segundo abarca el contenido a partir del + 548 hasta el 1211. + +

    + + +

    + En el ejemplo 2 mkvmerge(1) creará sólo un archivo. Este archivo contendrá + tanto el contenido a partir del 733 hasta el + 912 como el contenido a partir del + 1592 hasta el 2730. + +

    + + +

    + En el ejemplo 3 mkvmerge(1) creará dos archivos. El primero abarcará el + contenido a partir del inicio del archivo de entrada hasta el + 430. El segundo archivo abarcará el contenido a partir + del 2512 hasta el final del archivo de entrada. + +

    + + +

    + Este modo sólo toma en cuenta la primera pista de video que se genera. Si no + se genera ninguna pista de video entonces la división no ocurrirá. + +

    + + +
    +

    Note:

    + +

    + Los números especificados con este argumento son interpretados en base al + número de bloques Matroska(tm) que se generan. Un único bloque Matroska(tm) + contiene un fotograma completo (material progresivo) o sólo un + campo(material entrelazado). Mkvmerge no hace distinciones entre estos dos y + tan sólo cuenta el número de bloques. Por ejemplo: Si se quiere dividir + después del 25º fotograma con material entrelazado, entonces tendría que + usar 50 (dos campos por fotograma) como punto de corte. + +

    + +
    + +
  10. + + +
  11. + +

    + División después fotogramas/campos específicos. + +

    + + +

    + Sintaxis: --split + frames:A[,B[,C...]] + +

    + + +

    + Ejemplo: --split frames:120,237,891 + +

    + + +

    + Los parámetros A, B, + C, etc... deben ser todos enteros positivos. La + numeración comienza por 1. La lista de números de fotograma/campo está + separada por comas. Después de que la secuencia de entrada haya alcanzado el + número de fotograma/campo establecido como punto de división, se crea un + nuevo archivo. Entonces se usa el siguiente punto de división especificado + en la lista. es usado. + +

    + + +

    + El prefijo 'frames:' no puede ser omitido. + +

    + + +

    + Este modo sólo toma en cuenta la primera pista de video que se genera. Si no + se genera ninguna pista de video entonces la división no ocurrirá. + +

    + + +
    +

    Note:

    + +

    + Los números especificados con este argumento son interpretados en base al + número de bloques Matroska(tm) que se generan. Un único bloque Matroska(tm) + contiene un fotograma completo (material progresivo) o sólo un + campo(material entrelazado). Mkvmerge no hace distinciones entre estos dos y + tan sólo cuenta el número de bloques. Por ejemplo: Si se quiere dividir + después del 25º fotograma con material entrelazado, entonces tendría que + usar 50 (dos campos por fotograma) como punto de corte. + +

    + +
    + +
  12. + + +
  13. + +

    + División antes de capítulos específicos. + +

    + + +

    + Sintaxis: --split chapters:all o + --split + chapters:A[,B[,C...]] + +

    + + +

    + Ejemplo: --split chapters:5,8 + +

    + + +

    + Los parámetros A, B, + C, etc... deben ser todos enteros positivos. La + numeración comienza por 1. La lista de capítulos está separada por comas. La + división ocurrirá justo antes del primer fotograma clave cuyo código de + tiempo sea igual o mayor que el código de tiempo inicial para los capítulos + cuyos números están listados. Un capítulo que comienza a los 0s nunca se + tiene en cuenta para la división siendo omitido silenciosamente. + +

    + + +

    + La palabra clave all puede ser usado en vez de una lista + de todos los números de los capítulos. + +

    + + +

    + El prefijo 'chapters:' no puede ser omitido. + +

    + + +
    +

    Note:

    + +

    + El formato del archivo Matroska(tm) soporta estructuras arbitrarias y + profundamente anidadas de capítulos llamadas 'edition entries' y 'chapter + atoms'. Sin embargo, esta modalidad sólo tiene en cuenta el nivel más alto + de los capítulos a través de todas las entradas de la edición. + +

    + +
    + +
  14. + +
+ + +

+ En el modo de división el nombre del archivo generado se trata de manera + diferente que con el funcionamiento normal. Puede contener un + printf como expresión '%d' incluyendo un + ancho de campo opcional, p.e. '%02d'. Si se hace entonces el + número de archivo actual es formateado apropiadamente e insertado en ese + punto del nombre del archivo. Si no existe dicho patrón entonces se asume + '-%03d' como patrón justo antes de la extensión del archivo: + '-o salida.mkv' resultaría en 'salida-001.mkv' y + así en adelante. Si no hay extensión entonces '-%03d' será + agregado al nombre. + +

+ + +

+ Otro posible patrón es '%c' que será reemplazado por el nombre + del primer capítulo del archivo. Tenga en cuenta que cuando figure + '%c', el patrón '-%03d' no será añadido + automáticamente. + +

+ +
--link + +

+ Archivos vinculados a otros cuando se divide el archivo generado. Consulte + la siguiente sección vinculación de + archivos para más detalles. + +

+ +
--link-to-previous segmento-UID + +

+ Vincula el primer archivo generado al segmento con el UID del segmento + especificado mediante el parámetro + segmento-UID. Consulte la siguiente sección vinculación de archivos para más + detalles. + +

+ + +

+ Si el SID comienza con = entonces el resto se interpreta como el nombre de + un archivo Matroska cuyo UID del segmento es leído y usado. + +

+ +
--link-to-next segmento-UID + +

+ Vincula el último archivo generado al segmento con el UID del segmento + especificado por el parámetro segmento-UID. Consulte + la siguiente sección vinculación de + archivos para más detalles. + +

+ + +

+ Si el SID comienza con = entonces el resto se interpreta como el nombre de + un archivo Matroska cuyo UID del segmento es leído y usado. + +

+ +
--append-mode modo + +

+ Establece cómo se calculan los códigos de tiempo al unir archivos. El + parámetro modo puede tener dos valores: + 'file' que es la opción por defecto y + 'track'. + +

+ + +

+ Cuando mkvmerge realiza la unión de una pista (llamada + 'pista2_1' de ahora en adelante) procedente de un segundo + archivo llamado 'archivo2') a una pista (llamada + 'pista1_1') del primer archivo (llamado + 'archivo1') entonces tiene que compensar cierta cantidad + en todos los códigos de tiempo de 'pista2_1'. En el modo + 'file' esta cantidad es el mayor código de tiempo + encontrado en el 'archivo1' incluso si ese código de + tiempo proviniera de una pista diferente a 'pista1_1'. En + el modo track la compensación es el mayor código de + tiempo de 'pista1_1'. + +

+ + +

+ Por desgracia, mkvmerge no puede detectar qué modo es más conveniente para + ser utilizado. Por lo tanto, por defecto usa el modo + 'file'. El modo 'file' por lo general + funciona mejor para archivos que fueron creados independientemente los unos + de los otros; p.e. cuando se unen archivos AVI o + MP4. El modo 'track' podría funcionar + mejor para fuentes que esencialmente son partes de un archivo, p.e. para + archivos VOB y EVO. + +

+ + +

+ Las pistas de subtítulos siempre son tratadas como si el modo + 'file' estuviese activado incluso si el que está activado + es el modo 'track'. + +

+ +
--append-to + SFID1:STID1:DFID1:DTID1[,...] + +

+ Esta opción controla que pista es unida a otra. Cada especificación contiene + cuatro IDs: un ID de archivo (FID), un ID de pista (TID), un segundo ID de + archivo y un segundo ID de pista. El primera par, "Source File ID" y "Source + Track ID", identifica la pista que va a ser unida. El segundo par, + "Destination File ID" y "Destination Track ID", identifica la pista a la que + será unida la primera. + +

+ + +

+ Si se omite esta opción entonces se usa un mapeo estándar. Este mapeo + estándar une cada pista del archivo actual a una pista del anterior archivo + con el mismo ID de pista. Esto permite unir fácilmente dos archivos que + habían sido divididos a partir de una película, si tienen el mismo número de + pistas y el ID de pista, con ayuda del comando: mkvmerge -o + salida.mkv parte1.mkv +parte2.mkv. + +

+ +
+ + +

+ Un único '+' provoca que el siguiente archivo es unido en vez de añadido. El + '+' también se puede poner delante del siguiente nombre del archivo. Por lo + tanto, los dos comandos siguientes son equivalentes: + +

+ +
mkvmerge -o completo.mkv archivo1.mkv + archivo2.mkv
+mkvmerge -o completo.mkv archivo1.mkv +archivo2.mkv
+
[ archivo1 + archivo2 ] + +

+ Si varios nombres de archivos están entre corchetes entonces el segundo y + los restantes archivos serán añadidos al primer archivo que esté editado + entre corchetes. + +

+ + +

+ Esta es una sintaxis alternativa a usar '+' entre los nombres de + archivos. Por lo tanto, los dos siguientes comandos son equivalentes: + +

+ +
$ mkvmerge -o completo.mkv archivo1.mkv + archivo2.mkv
+$ mkvmerge -o completo.mkv '[' archivo1.mkv archivo2.mkv ']'
+
= + +

+ Para algunos tipos de archivos (secuencias de programa MPEG = VOBs) + mkvmerge(1) normalmente busca archivos en el mismo directorio del archivo de + entrada que tiene el mismo nombre base y solo difiere en su número de + ejecución (p.e. 'VTS_01_1.VOB', 'VTS_01_2.VOB', 'VTS_01_3.VOB' etc) y trata + a todos esos archivos como si estuviesen concatenados en un único gran + archivo. Esta opción, un único '=', provoca que mkvmerge no busque esos + archivos adicionales. + +

+ + +

+ El '=' también se puede poner delante del siguiente nombre del archivo. Por + lo tanto, los dos comandos siguientes son equivalentes: + +

+ +
$ mkvmerge -o completo.mkv = archivo1.vob
+$ mkvmerge -o completo.mkv =archivo1.vob
+
( archivo1 + archivo2 ) + +

+ Si múltiples nombres de archivos están entre paréntesis entonces estos + archivos serán tratados como si estuviesen unidos en un único archivo, el + cual consiste en el contenido de cada uno de los archivos uno detrás de + otro. + +

+ + +

+ Por ejemplo, esto se puede usar con archivos VOB procedentes de de un DVD o + de MPEG-TS (transport streams). No se puede usar si cada archivo contiene su + propio conjunto de encabezados que suele ser el caso con archivos como AVI o + MP4. + +

+ + +

+ Poner el nombre del archivo entre paréntesis también evita que mkvmerge(1) + busque archivos adicionales con el mismo nombre base tal y como se ha + descrito en opción + =. Por lo tanto, los dos comandos siguientes son + equivalentes: + +

+ +
mkvmerge -o salida.mkv = archivo.mkv
+mkvmerge -o salida.mkv "(" archivo.mkv ")"
+ +

+ Varias cosas se deben tener en cuenta: + +

+ + +
    + +
  1. + +

    + Debe haber espacios antes y después de los signos de paréntesis. + +

    + +
  2. + + +
  3. + +

    + Cada parámetro entre paréntesis se interpreta como un nombre de archivo. Por + lo tanto, todas las opciones que se deban aplicar a este archivo lógico + deben ser introducidas antes del signo de apertura del paréntesis. + +

    + +
  4. + + +
  5. + +

    + Algunos entornos tratan a los paréntesis como caracteres especiales. Por lo + tanto, deben ser escapados o entrecomillados tal y como se muestra en el + ejemplo anterior. + +

    + +
  6. + +
+ +
+ + + + +

2.6. Soporte de adjuntos (más opciones globales)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description descripción + +

+ + + Descripción en texto sin formato del siguiente adjunto. Esto afecta a la + opción --attach-file + o --attach-file-once option. + + +

+ +
--attachment-mime-type Tipo MIME + +

+ Tipo MIME del siguiente adjunto. Se aplica a una de las + siguientes opciones --attach-file + o --attach-file-once. + Una lista oficial de tipos MIME que son reconocidos se + pueden encontrar en la página web de IANA. El tipo + MIME es obligatorio para un adjunto. + +

+ + +

+ Si no especifica el tipo MIME para un adjunto, su tipo se + detecterá automáticamente. + +

+ +
--attachment-name nombre + +

+ Establece el nombre de este adjunto que será almacenado en el archivo de + salida. Si no se especificó esta opción entonces el nombre será generado a + partir del nombre del archivo del adjunto especificado con la opción --attach-file + o --attach-file-once. + +

+ +
+ --attach-file nombre-archivo, + --attach-file-once nombre-archivo + + +

+ Crea un archivo adjunto dentro del archivo Matroska(tm). El tipo + MIME debe establecerse antes de que esta opción pueda ser + utilizada. La diferencia entre las dos formas es que durante la división los + archivos adjuntos con --attach-file son adjuntados a todos + los archivos de salida mientras que con --attach-file-once + tan sólo se adjuntan al primer archivo creado. Si no se usa la división + entonces ambas opciones hacen lo mismo. + +

+ + +

+ mkvextract(1) puede ser utilizado para extraer los archivos adjuntos de un + archivo Matroska(tm). + +

+ +
--enable-legacy-font-mime-types + +

+ Habilita el uso de tipos MIME heredados para ciertos tipos + de fuentes adjuntas. Por ejemplo, + 'application/x-truetype-font' se usará para fuentes + TrueType en vez de 'fonts/ttf'. + +

+ + +

+ Esto afecta tanto a los nuevos adjuntos, si su tipo MIME se + detecta automáticamente, como a los adjuntos existentes cuyos tipos + MIMEalmacenados serán reasignados a los heredados. + +

+ + +

+ Los tipos MIME afectados son + 'font/sfnt', 'font/ttf' y + 'font/collection' los cuales están asignados a + 'application/x-truetype-fonts' y + 'font/otf', que está asignado a + 'application/vnd.ms-opentype'. + +

+ +
+ + + +

2.7. Opciones que se pueden usar para cada archivo de entrada

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks + [!]n,m,... + +

+ Copia las pistas de audio n, + m, etc. Los números son los ID de pista que pueden + ser obtenidos con la opción --identify. + No son los números de la pista (consulte la sección IDs de pista). Por defecto: copia todas + las pistas de audio. + +

+ + +

+ En lugar del ID de pista también se puede especificar el código de idioma + ISO 639-2. Esto sólo funciona para archivos de entrada que ofrecen etiquetas + de idioma para sus pistas. + +

+ + +

+ Por defecto: copia todas las pistas de este tipo. + +

+ + +

+ Si los IDs están prefijados con ! entonces significa lo + contrario: copia todas las pistas de este tipo excepto las enumeradas + después del !. + +

+ +
-d, --video-tracks + [!]n,m,... + +

+ Copia las pistas de video n, + m, etc. Los números son los ID de pista que pueden + ser obtenidos con la opción --identify. + No son los números de la pista (consulte la sección IDs de pista). Por defecto: copia todas + las pistas de video. + +

+ + +

+ En lugar del ID de pista también se puede especificar el código de idioma + ISO 639-2. Esto sólo funciona para archivos de entrada que ofrecen etiquetas + de idioma para sus pistas. + +

+ + +

+ Si los IDs están prefijados con ! entonces significa lo + contrario: copia todas las pistas de este tipo excepto las enumeradas + después del !. + +

+ +
-s, --subtitle-tracks + [!]n,m,... + +

+ Copia las pistas de subtítulos n, + m, etc. Los números son los ID de pista que pueden + ser obtenidos con la opción --identify. + No son los números de la pista (consulte la sección IDs de pista). Por defecto: copia todas + las pistas de subtítulos. + +

+ + +

+ En lugar del ID de pista también se puede especificar el código de idioma + ISO 639-2. Esto sólo funciona para archivos de entrada que ofrecen etiquetas + de idioma para sus pistas. + +

+ + +

+ Si los IDs están prefijados con ! entonces significa lo + contrario: copia todas las pistas de este tipo excepto las enumeradas + después del !. + +

+ +
-b, --button-tracks + [!]n,m,... + +

+ Copia las pistas de botón n, + m, etc. Los números son los ID de pista que pueden + ser obtenidos con la opción --identify. + No son los números de la pista (consulte la sección IDs de pista). Por defecto: copia todas + las pistas de botón. + +

+ + +

+ En lugar del ID de pista también se puede especificar el código de idioma + ISO 639-2. Esto sólo funciona para archivos de entrada que ofrecen etiquetas + de idioma para sus pistas. + +

+ + +

+ Si los IDs están prefijados con ! entonces significa lo + contrario: copia todas las pistas de este tipo excepto las enumeradas + después del !. + +

+ +
--track-tags + [!]n,m,... + +

+ Copia las etiquetas de las pistas n, + m, etc. Los números son los ID de pista que pueden + ser obtenidos con la opción --identify. + No son los números de la pista (consulte la sección --identify). + Por defecto: copia las etiquetas de todas las pistas. + +

+ + +

+ Si los IDs están prefijados con ! entonces significa lo + contrario: copia todas las pistas de este tipo excepto las enumeradas + después del !. + +

+ +
-m, --attachments + [!]n[:all|first],m[:all|first],... + +

+ Copia los adjuntos con los IDs n, + m, etc... a todos (all) o sólo al primer archivo + generado (first). A cada ID se le puede añadir ':all' + (que es la opción predeterminada) o ':first'. Si la + división está activada entonces estos adjuntos cuyos IDs especificados con + ':all' serán copiados a todos los archivos generados + mientras que los especificados con ':first' sólo serán + copiados al primer archivo generado. Si la división no está activada + entonces ambas variantes producen el mismo efecto. + +

+ + +

+ Por defecto todos los adjuntos se copian a todos los archivos generados. + +

+ + +

+ Si los IDs están prefijados con ! entonces significa lo + contrario: copia todas las pistas de este tipo excepto las enumeradas + después del !. + +

+ +
-A, --no-audio + +

+ No copia ninguna pista de audio de este archivo. + +

+ +
-D, --no-video + +

+ No copia ninguna pista de video de este archivo. + +

+ +
-S, --no-subtitles + +

+ No copia ninguna pista de subtítulos de este archivo. + +

+ +
-B, --no-buttons + +

+ No copia ninguna pista de botón de este archivo. + +

+ +
-T, --no-track-tags + +

+ No copia ninguna etiqueta de la pista especificada de este archivo. + +

+ +
--no-chapters + +

+ No copia ningún capítulo de este archivo. + +

+ +
-M, --no-attachments + +

+ + + No copia ningún adjunto de este archivo. + +

+ +
--no-global-tags + +

+ No copia las etiquetas globales de este archivo. + +

+ +
-y, --sync + TID:d[,o[/p]] + +

+ Ajusta los códigos de tiempo de la pista con el ID + TID por d ms. Los IDs de la + pista son los mismos que se muestran con la opción --identify. + (consulte la sección IDs de + pista). + +

+ + +

+ o/p: ajusta las marcas de + tiempo por o/p para fijar + desfases lineales. Si se omite, p por defecto es + 1. Tanto o y p pueden ser + números decimales. + +

+ + +

+ Por defecto: no hay ninguna sincronización manual (que es lo mismo que + d = 0 y + o/p = + 1.0). + +

+ + +

+ Esta opción se puede utilizar varias veces para un archivo de entrada + aplicándola a diversas pistas seleccionando IDs de pista diferente de pista + cada vez. + +

+ +
--cues TID:none|iframes|all + +

+ Controla qué entradas del índice (cue) de la pistas se crean para una pista + concreta (consulte la sección IDs de + pista). 'None' evita la creación de entradas del + índice. Sólo los bloques 'iframes' sin referencias + anteriores o posteriores ( = fotogramas I en pistas de video) se insertan en + el cue sheet. 'All' provoca que mkvmerge(1) genere las + entradas del índice para todos los bloques lo que hará que el archivo sea + más grande. + +

+ + +

+ Por defecto es 'iframes' para pistas de video y + subtítulos, y 'none' para las pistas de audio. Mire + también la opción --no-cues que + evita la creación de entradas del índice a pesar de las opciones + --cues utilizadas. + +

+ + +

+ Esta opción se puede utilizar varias veces para un archivo de entrada + aplicándola a diversas pistas seleccionando IDs de pista diferente de pista + cada vez. + +

+ +
--default-track-flag + TID[:bool] + +

+ Establece el indicador de "pista predefinida" en la pista + especificada (consulte la sección IDs de + pista) si el argumento opcional bool está + establecido a 1 o si no está presente. Si el contenedor + de origen no proporciona esa información, y el usuario no la especifica + mediante esta opción, se establecerá el indicador. + +

+ + +

+ Si el usuario no selecciona de forma explícita una pista durante la + visualización, el reproductor debe seleccionar una de las pistas que tenga + configurado el indicador de "pista predefinida", teniendo en + cuenta las preferencias de usuario, como su idioma preferido. + +

+ + +

+ Esta opción se puede utilizar varias veces para un archivo de entrada + aplicándola a diversas pistas seleccionando IDs de pista diferente de pista + cada vez. + +

+ +
--track-enabled-flag + TID[:bool] + +

+ Establece el indicador de "pista habilitada" para la pista + proporcionada (consulte la sección IDs de + pista) conforme al valorbool definido (0 o 1; + si no se especifica por defecto es 1). Las pistas se habilitan por defecto + si ninguna opción se especifica para ellas y el contenedor de origen tampoco + no facilita esta información. + +

+ + +

+ Sólo aquellas pistas con indicador de "pista habilitada" + configurado se tendrán en cuenta para su reproducción. + +

+ + +

+ Esta opción se puede utilizar varias veces para un archivo de entrada + aplicándola a diversas pistas seleccionando IDs de pista diferente de pista + cada vez. + +

+ +
--forced-display-flag + TID[:bool] + +

+ Establece el indicador de "visualización forzada" en la pista + especificada (consulte la sección IDs de + pista) si el argumento opcional bool está + establecido a 1 o si no está presente. Úselo para las + pistas que incluyan texto en pantalla o diálogos en un idioma extranjero. + +

+ + +

+ Esta opción se puede utilizar varias veces para un archivo de entrada + aplicándola a diversas pistas seleccionando IDs de pista diferente de pista + cada vez. + +

+ +
--hearing-impaired-flag + TID[:bool] +   + +

+ Establece el indicador de "discapacidad auditiva" en la pista + especificada (consulte la sección IDs de + pista) si el argumento opcional bool está + establecido a 1 o si no está presente. Este indicador + permite configurar si la pista es apta para usuarios con discapacidad + auditiva. + +

+ + +

+ Esta opción se puede utilizar varias veces para un archivo de entrada + aplicándola a diversas pistas seleccionando IDs de pista diferente de pista + cada vez. + +

+ +
--visual-impaired-flag + TID[:boleano] + +

+ Establece el indicador de "discapacidad visual" en la pista + especificada (consulte la sección IDs de + pista) si el argumento opcional bool está + establecido a 1 o si no está presente. Este indicador + permite configurar si la pista es apta para usuarios con discapacidad + visual. + +

+ + +

+ Esta opción se puede utilizar varias veces para un archivo de entrada + aplicándola a diversas pistas seleccionando IDs de pista diferente de pista + cada vez. + +

+ +
--text-descriptions-flag + TID[:boleano] + +

+ Establece el indicador de "descripciones de texto" en la pista + especificada (consulte la sección IDs de + pista) si el argumento opcional bool está + establecido a 1 o si no está presente. Este indicador + permite configurar si la pista incluye descripciones textuales del contenido + del video aptas para reproducirse mediante un sistema de conversión de texto + a voz para usuarios con discapacidad visual. + +

+ + +

+ Esta opción se puede utilizar varias veces para un archivo de entrada + aplicándola a diversas pistas seleccionando IDs de pista diferente de pista + cada vez. + +

+ +
--original-flag + TID[:boleano] + +

+ Establece el indicador de "idioma original" en la pista + especificada (consulte la sección IDs de + pista) si el argumento opcional bool está + establecido a 1 o si no está presente. Este indicador + se puede configurar si la pista está en el idioma original del contenido (no + una traducción). + +

+ + +

+ Esta opción se puede utilizar varias veces para un archivo de entrada + aplicándola a diversas pistas seleccionando IDs de pista diferente de pista + cada vez. + +

+ +
--commentary-flag + TID[:boleano] + +

+ Establece el indicador de "comentario" en la pista especificada + (consulte la sección IDs de pista) + si el argumento opcional bool está establecido a + 1 o si no está presente. Este indicador permite + configurar si la pista contiene comentarios. + +

+ + +

+ Esta opción se puede utilizar varias veces para un archivo de entrada + aplicándola a diversas pistas seleccionando IDs de pista diferente de pista + cada vez. + +

+ +
--track-name TID:nombre + +

+ Establece el nombre de la pista especificada al dado en + nombre (consulte la sección IDs de pista). + +

+ +
--language TID:idioma + +

+ Establece el idioma de la pista especificada (consulte la sección IDs de pista). Tanto los códigos de + idioma ISO 639-2 y los códigos de país ISO 639-1 están permitidos. Los + códigos de los países serán convertidos a códigos de idioma + automáticamente. Todos los idiomas incluidos sus códigos ISO 639-2 pueden + ser listados con la opción --list-languages. + +

+ + +

+ Esta opción se puede utilizar varias veces para un archivo de entrada + aplicándola a diversas pistas seleccionando IDs de pista diferente de pista + cada vez. + +

+ +
-t, --tags + TID:nombre-archivo + +

+ Lee las etiquetas para la pista con el número TID del + archivo nombre-archivo. Consulte la sección de más + adelante acerca de las etiquetas para + más detalles. + +

+ +
--aac-is-sbr + TID[:0|1] + +

+ Le dice a mkvmerge(1) que la pista con el ID TID es + SBR AAC (también conocido como HE-AAC o + AAC+). Estas opciones son necesarias si: a) el archivo de + entrada es un archivo AAC (no para un archivo Matroska(tm)) y + b) el archivo AAC contiene datos SBR + AAC. La razón para esta opción es que es técnicamente imposible + distinguir los datos AAC de los datos SBR + AAC sin decodificar un fotograma completo de + AAC. Cómo hay diversos problemas de patentes con los + decodificadores AAC, mkvmerge(1) nunca realizará esta fase + de decodificación. Por lo que, para archivos SBR AAC esta + opción es obligatoria. El archivo generado podría no reproducirse + correctamente, o ni si quiera hacerlo, si esta opción es omitida. + +

+ + +

+ Si el archivo de entrada es un archivo Matroska(tm) entonces el + CodecID debería ser suficiente para detectar + SBR AAC. Sin embargo, si el CodecID + es erróneo entonces esta opción puede ser usada para corregirlo. + +

+ + +

+ Si mkvmerge detecta erróneamente que es un archivo AAC es + SBR entonces puedes añadir ':0' al ID de + pista. + +

+ +
--audio-emphasis + TID:n|nombre-simbólico + +

+ Establece el énfasis para la pista de audio con el ID de pista + TID. El modo puede ser un número + n (ciertos valores entre 0 y + 16) o un nombre simbólico. Todos los números válidos + & los nombres simbólicos pueden ser listados con la opción --list-audio-emphasis. + +

+ +
--reduce-to-core TID + +

+ Algunos códecs de audio tienen un núcleo (core) con pérdidas y una extensión + adicional que realiza una decodificación sin pérdidas. Esta opción le dice a + mkvmerge(1) que sólo copie el núcleo y no la extensión. Por defecto, + mkvmerge(1) copia tanto el núcleo como la extensión. + +

+ + +

+ Actualmente sólo a las pistas DTS les afecta esta + opción. Sin embargo, las pistas TrueHD que contienen un núcleo + AC-3 se presentan como dos pistas independientes para que + el usuario puede seleccionar que pista quiere copiar. Para un + DTS esto no funcionaría ya que las extensiones HD no puede + ser decodificadas en si misma - a diferencia de lo que pasa con los datos + TrueHD. + +

+ +
--remove-dialog-normalization-gain + TID + +

+ Algunos códecs de audio contienen campos de cabecera que informan al + decodificador o reproductor la ganancia (normalmente negativa) a aplicar + para la normalización de diálogo. Esta opción le dice a mkvmerge(1) que + elimine o minimice esa ganancia al modificar el correspondiente campo de la + cabecera. + +

+ + +

+ Actualmente sólo las pistas AC-3, DTS y + TrueHD están relacionadas con esta opción. + +

+ +
--timestamps TID:nombre-archivo + +

+ Lee los códigos de tiempo que se utilizarán para el ID de pista especificado + de nombre-archivo. Estos códigos de tiempo reemplazan + de manera forzosa los códigos de tiempo que mkvmerge(1) normalmente + calcula. Lea la sección acerca de archivos de códigos de tiempo + externos. + +

+ +
--default-duration TID:x + +

+ Fuerza la duración predeterminada de una pista a un valor + específico. También modifica los códigos de tiempo para que coincidan con la + duración predeterminada. El argumento x debe tener el + sufijo 's', 'ms', + 'us', 'ns', 'fps', + 'p' o 'i' para especificar la duración + predeterminada en segundos, milisegundos, microsegundos, nanosegundos, + 'fotogramas por segundo', 'fotogramas progresivos por segundo', o + 'fotogramas entrelazados por segundo, respectivamente. El número + x en si mismo puede ser un número decimal o + fracción. + +

+ + +

+ Si no se fuerza la duración predeterminada entonces mkvmerge intentará + generar la duración predeterminada de la pista a partir del contenedor y/o + el bitstream codificado para ciertos tipos de pista, p.e. AVC/H.264 o + MPEG-2. + +

+ + +

+ Esta opción también puede ser utilizado para cambiar los + FPS de las pistas de video sin tener que usar códigos de + tiempo externos. + +

+ +
--fix-bitstream-timing-information + TID[:0|1] + +

+ Por lo general, mkvmerge(1) no cambia la información del tiempo (frecuencia + de fotograma/campo) almacenada en el bitstream de video. Con esta opción esa + información se ajusta para coincidir con la información del tiempo. La + información del tiempo del contenedor puede provenir de varias fuentes: + desde la línea de comandos (consulte la sección --default-duration), + el contenedor de la fuente o generado a partir del bitstream. + +

+ + +
+

Note:

+ +

Por ahora, sólo ha sido implementado para pistas AVC/H.264.

+ +
+ +
--compression TID:n + +

+ Selecciona el método de compresión que se usará para la pista. Tenga en + cuenta que el reproductor debe soportar este método. Los valores válidos son + 'none', 'zlib' y + 'mpeg4_p2'/'mpeg4p2'. + +

+ +

+ El método de compresión + 'mpeg4_p2'/'mpeg4p2' es un método + especial llamado 'eliminador de encabezado' que sólo está disponible para + pistas de video MPEG4 part 2. + +

+ +

+ La compresión por defecto para algunas pistas de subtítulos es + 'zlib'. Este método de compresión es para el que casi + todas, si no todas, las aplicaciones de reproducción son compatibles. No se + puede asegurar la compatibilidad para otros métodos de compresión que no sea + 'ninguna'. + +

+ +
+ + + +

2.8. Opciones que sólo afectan a pistas de video

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc + TID:FourCC + +

+ Fuerza el FourCC a un valor especificado. Sólo + funciona para pistas de video en el modo 'modo compatibilidad de MS'. + +

+ +
--display-dimensions TID:anchoxalto + +

+ Los archivos Matroska(tm) contienen dos valores que establecen las propiedades + de visualización a las que un reproductor debería usar para redimensionar la + imagen en la reproducción a: ancho y alto de visualización. Estos valores + pueden ser establecidos con esta opción, + p.e. '1:640x480'. + +

+ + +

+ Otra manera de especificar los valores de visualización es usar la opción + --aspect-ratio + o --aspect-ratio-factor + (mire más abajo). Estas opciones son mutuamente excluyentes. + +

+ +
--aspect-ratio + TID:proporción|ancho/alto + +

+ Los archivos Matroska(tm) contienen dos valores que establecen las propiedades + de visualización que un reproductor debería usar para redimensionar la + imagen para reproducir a: ancho y alto de visualización. Con esta opción + Matroska(tm) calculará automáticamente el ancho y alto de reproducción basado + en el ancho y alto original de la imagen y la relación de aspecto + especificada con esta opción. La relación de aspecto puede ser especificada + como un número decimal de proporción o una fracción + 'ancho/alto', + p.e. '16/9'. + +

+ + +

+ Otra manera de especificar los valores de visualización es usar la opción + --aspect-ratio-factor + o --display-dimensions + (mire más abajo). Estas opciones son mutuamente excluyentes. + +

+ +
--aspect-ratio-factor TID:factor|n/d + +

+ Otra manera de establecer la relación de aspecto es especificar un + factor. La relación de aspecto original es primero + multiplicada por este factor y después se usa como la + relación de aspecto definitiva. + +

+ + +

+ Otra manera de especificar los valores de visualización es usar la opción + --aspect-ratio + o --display-dimensions + (mire más abajo). Estas opciones son mutuamente excluyentes. + +

+ +
--cropping + TID:izquierda,arriba,derecha,abajo + +

+ Establece los valores especificados como los parámetros de recorte de + píxeles para una pista de video. + +

+ +
--color-matrix-coefficients TID:n + +

+ Establece los coeficientes matriciales del video para generar los valores de + luminancia y crominancia a partir de los colores primarios rojo, verde y + azul. El parámetro n es un número entero entre + 0 y 10. + +

+ + +

+ Los valores válidos y su significado son: + +

+ + +

+ 0: GBR, 1: BT709, + 2: indeterminado, 3: reservado, + 4: FCC, 5: BT470BG, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 luminancia no + constante, 10: BT2020 luminancia constante + +

+ +
--color-bits-per-channel TID:n + +

+ Establece el número de bits codificados para un canal de color. Un valor de + 0 indica que el número de bits no se ha especificado. + +

+ +
--chroma-subsample TID:hori,vert + +

+ La cantidad de píxeles a eliminar en los canales Cr y Cb por cada pixel no + eliminado horizontal/verticalmente. + +

+ + +

+ Ejemplo: Para un video con submuestreo de crominancia 4:2:0, el parámetro se + debe establecer a + TID:1,1. + +

+ +
--cb-subsample TID:hori,vert + +

+ La cantidad de píxeles a eliminar en el canal Cb por cada pixel no eliminado + horizontal/verticalmente. Esto se adiciona a la opción + --chroma-subsample. + +

+ + +

+ Ejemplo: Para un video con submuestreo de crominancia 4:2:1, el parámetro + --chroma-subsample se debe establecer a + TID:1,0 + y el submuestreo de Cb se debe establecer a + TID:1,0. + +

+ +
--chroma-siting TID:hori,vert + +

+ Establece como se situa horizontal/verticalmente la crominancia + (0: indeterminado, 1: arriba, + 2: mitad). + +

+ +
--color-range TID:n + +

+ Establece los valores de recorte -clipping- de los rangos de color + (0: indeterminado, 1: rango de + retransmisión, 2: rango completo (sin recorte), + 3: definido por + CoeficientesMatriciales/CaracterísticasTransferencia). + +

+ +
--color-transfer-characteristics + TID:n + +

+ Las características de transferencia del video. + +

+ + +

+ Los valores válidos y su significado son: + +

+ + +

+ 0: reservado, 1: ITU-R BT.709, + 2: indeterminado, 3: reservado, + 4: curva gamma 2.2, 5: curva gamma + 2.8, 6: SMPTE 170M, 7: SMPTE 240M, + 8: lineal, 9: logarítmica, + 10: raiz cuadrada logarítmica, 11: + IEC 61966-2-4, 12: ITU-R BT.1361 gama de color + extendida, 13: IEC 61966-2-1, 14: + ITU-R BT.2020 10 bit, 15: ITU-R BT.2020 12 bit, + 16: SMPTE ST 2084, 17: SMPTE ST + 428-1; 18: ARIB STD-B67 (HLG) + +

+ +
--color-primaries TID:n + +

+ Establece los colores primarios del video. + +

+ + +

+ Los valores válidos y su significado son: + +

+ + +

+ 0: reservado, 1: ITU-R BT.709, + 2: indeterminado, 3: reservado, + 4: ITU-R BT.470M, 5: ITU-R + BT.470BG, 6: SMPTE 170M, 7: SMPTE + 240M, 8: FILM, 9: ITU-R BT.2020, + 10: SMPTE ST 428-1, 22: JEDEC P22 + fósforo + +

+ +
--max-content-light TID:n + +

+ Establece el brillo máximo de un único pixel (Nivel Máximo de Contenido de + Luz) en candelas por metro cuadrado (cd/m²). El valor de + n debe ser un número entero positivo. + +

+ +
--max-frame-light TID:n + +

+ Establece el brillo máximo de un único fotograma (Nivel Máximo de Luz del + Promedio del Fotograma ) en candelas por metro cuadrado (cd/m²). El valor de + n debe ser un número entero positivo. + +

+ +
--chromaticity-coordinates + TID:rojoj-x,rojo-y,verde-x,verde-y,azul-x,azul-y + +

+ Establece las coordenadas cromáticas del color rojo/verde/azul definidas por + CIE 1931. + +

+ +
--white-color-coordinates TID:x,y + +

+ Establece las coordenadas cromáticas del color blanco definidas por CIE + 1931. + +

+ +
--max-luminance TID:decimal + +

+ Establece la luminancia máxima en candelas por metro cuadrado (cd/m²). El + valor debe ser menor de 9999.99. + +

+ +
--min-luminance TID:decimal + +

+ Establece la luminancia mínima en candelas por metro cuadrado (cd/m²). El + valor debe ser menor de 999.9999. + +

+ +
--projection-type TID:método + +

+ Establece el método usado de la proyección del video. Los valores admitidos + son 0 (proyección rectangular), 1 (proyección equirectangular), 2 + (proyección de mapeo cúbico) y 3 (proyección de malla). + +

+ +
--projection-private TID:data + +

+ Establece los datos privados que sólo se aplican a una proyección en + concreto. Los datos deben ser números hexadecimales con o sin el prefijo + "0x", con o sin espacios. + +

+ +
--projection-pose-yaw TID:decimal + +

+ Especifica la rotación vertical de la proyección. + +

+ +
--projection-pose-pitch TID:decimal + +

+ Especifica la rotación transversal de la proyección. + +

+ +
--projection-pose-roll TID:decimal + +

+ Especifica la rotación longitudinal de la proyección. + +

+ +
--field-order TID:n + +

+ Establece el orden de campos para la pista de video con el ID de pista + TID. El orden debe ser uno de los siguientes números: + +

+ + +

+ 0: progresivo; 1: entrelazado con + campo superior mostrado y almacenado primero; 2: orden + de campo indeterminado; 6: entrelazado con campo + inferior mostrado y almacenado primero; 9: entrelazado + con campo inferior mostrado primero y campo superior almacenado primero; + 14: entrelazado con campo superior mostrado primero y + campo inferior almacenado primero + +

+ +
--stereo-mode TID:n|nombre-simbólico + +

+ Establece el modo estéreo para la pista de vídeo con el ID de pista + TID. El modo puede ser un número + n entre 0 y + 14 o un nombre simbólico. Todos los números válidos + & los nombres pueden ser listados con la opción --list-stereo-modes. + +

+ +
+ + + +

2.9. Opciones que sólo afectan a pistas de subtítulos

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset + TID:conjunto-caracteres + +

+ Establece el conjunto de caracteres para realizar la conversión a UTF-8 para + los subtítulos UTF-8 de un ID de pista especificada. Si no se especifica el + conjunto de caracteres será generado a partir de la configuración regional + actual. Tenga en cuenta que un conjunto de caracteres no es necesario para + leer subtítulos desde archivos mkvmerge(1) o desde secuencias Kate, ya que + estos siempre se almacenan en UTF-8. Consulte la sección acerca de archivos de texto y conjunto de + caracteres para una explicación sobre cómo mkvmerge(1) realiza la + conversión entre conjunto de caracteres. + +

+ + +

+ Esta opción se puede utilizar varias veces para un archivo de entrada + aplicándola a diversas pistas seleccionando IDs de pista diferente de pista + cada vez. + +

+ +
+ + + +

2.10. Otras opciones

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify + nombre-archivo + +

+ Le permitirá a mkvmerge(1) analizar el archivo e informar de qué tipo es, las + pistas que contiene y los IDs de pista. Si se usa esta opción entonces la + unica opción permitida es el nombre-archivo. + +

+ + +

El formato de salida usado para el resultado se puede cambiar con la opción + --identification-format. +

+ +
--chapters nombre-archivo + +

+ Este es un alias apropiado para "--identification-format json + --identify file-name". + +

+ +
-F, --identification-format + formato + +

+ Determina el formato de salida usado por la opción --identify. + Los siguientes formatos son válidos: text (el valor por + defecto si esta opción no se usa), y json. + +

+ + +
    + +
  1. + +

    El formato de text es corto y legíble. Se compone de una + línea por cada elemento encontrado (contenedor, pistas, adjuntos, etc...). +

    + + +

    Este formato no está pensado para ser analizado. La salida se traducirá en + el idioma que mkvmerge(1) utiliza (mire también --ui-language). +

    + +
  2. + + +
  3. + +

    + El formatojson genera una representación JSON legible por + máquina. Este formato sigue el esquema JSON descrito en el siguiente + archivo: + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + Todas las versión del esquema JSON están disponibles online y en los + archivos del código fuente liberado. + +

    + +
  4. + +
+ +
--probe-range-percentage porcentaje + +

+ Algunos tipos de archivos tales como secuencias de programa MPEG y + transporte (.vob, .m2ts), necesitan + analizar cierta cantidad de datos para detectar todas las pistas almacenadas + en el archivo. Esta cantidad es un 0.3% del tamaño del archivo original o 10 + MB, dependiendo cual sea mayor. + +

+ + +

+ Si se conocen las pistas presentes en el archivo pero no son encontradas, + entonces se puede cambiar el porcentaje de exploración con esta opción. El + mínimo de 10 MB está definido por defecto y no se puede cambiar. + +

+ +
--list-audio-emphasis + +

+ Enumera todos los números válidos & sus correspondientes nombres + simbólicos para la opción --audio-emphasis. + +

+ +
--list-languages + +

+ Muestra una lista de idiomas y sus códigos ISO 639-2 que se pueden utilizar + con la opción --language. + +

+ +
--list-stereo-modes + +

+ Enumera todos los números válidos & sus correspondientes nombres + simbólicos para la opción --stereo-mode. + +

+ +
-l, --list-types + +

+ Muestra una lista de archivos de entrada compatibles. + +

+ +
--priority prioridad + +

+ Establece la prioridad de procesamiento con la que mkvmerge(1) se + ejecutará. Los valores válidos son 'muy baja', + 'baja', 'normal', + 'alta' y 'muy alta'. Si no se + especifica nada entonces se usa la opción 'normal'. En sistemas basados en + Unix, mkvmerge(1) usará la función + nice(2). + Por lo tanto, sólo el súper usuario puede usar 'alta' y + 'muy alta'. En Windows todos los valores pueden se usados + por todos los usuarios. + +

+ + +

Seleccionando 'muy baja' también provocará que mkvmerge(1) + seleccione la más baja prioridad de entrada y salida, así como la de + procesamiento. +

+ +
--command-line-charset + conjunto-caracteres + +

+ Establece el conjunto de caracteres para convertir las cadenas de texto + especificadas en la línea de comandos. Por defecto, el conjunto de + caracteres está especificado por la configuración regional actual. Esta + configuración se aplica a los argumentos de las siguientes opciones: --title, --track-name + y --attachment-description. + +

+ +
--output-charset conjunto-caracteres + +

+ + + Establece el conjunto de caracteres para convertir las cadenas de texto que + serán usadas en el archivo de salida. Por defecto, se ajusta al conjunto de + caracteres dado por la configuración local del sistema. + +

+ +
-r, --redirect-output + nombre-archivo + +

+ Escribe todos los mensajes al archivo nombre-archivo + en vez de en la consola. Aunque esto se puede hacer fácilmente con la opción + de redirección hay casos en los que es necesaria esta opción: cuando el + terminal reinterpreta la salida antes de escribirlo al archivo. El conjunto + de caracteres establecido con --output-charset + se respeta. + +

+ +
--flush-on-close + +

+ Le dice al programa que libere de datos la memoria cache cuando se cierren + los archivos para su escritura. Esto se puede usar para evitar la pérdida de + datos en cortes de energía o para evitar ciertos problemas en el sistema + operativo o los controladores. La desventaja es que el multiplexado tardará + más, ya que mkvmerge deberá esperar hasta que todos los datos se hayan + escrito en el almacenamiento antes de salir. Ver falos #2469 y #2480 en el + servidor de MKVToolNix para analizar los pros y los contras en profundidad. + +

+ +
--ui-language código + +

+ Fuerza la traducción al código de idioma que será + usado (p.e. 'de_DE' para la traducción al + Alemán). Introduciendo 'list' como + código provocará que el programa muestre una lista de + las traducciones disponibles. + +

+ +
--abort-on-warnings + +

+ Le dice al programa que cancele después de emitir la primera advertencia. El + código de salida del programa será 1. + +

+ +
--deterministic valor inicial + +

+ Habilita la creación de archivos idénticos en bytes si se usa la misma + versión de mkvmerge(1) con los mismos archivos de origen, el mismo conjunto + de opciones y valor inicial. Tenga en cuenta que el campo "fecha" de + información del segmento no se escribe en este modo. + +

+ + +

El valor inicial puede ser una cadena arbitraria sin tener que ser un + número. +

+ + +

+ Únicamente se garantiza la obtención de archivos idénticos en bytes bajo las + siguientes condiciones: + +

+ + +
    + +
  1. + +

    Si utiliza una versión de mkvmerge(1) construída con las mismas versiones de + libEBML y libMatroska. +

    + +
  2. + + +
  3. + +

    Los archivos de origen son idénticos en bytes.

    + +
  4. + + +
  5. + +

    Las mismas opciones de la línea de comandos se utilizan en el mismo orden + (con la especial excepción de --output …). +

    + +
  6. + +
+ + +

+ Al usar otras versiones de mkvmerge(1) u otras opciones de la línea de + comandos, puede que obtenga el mismo archivo con idénticos bytes pero no se + puede asegurar. + +

+ +
--debug topic + +

+ Habilita la depuración para una característica concreta. Esta opción sólo es + útil para desarrolladores. + +

+ +
--engage característica + +

+ Habilita características experimentales. Una lista de características + disponibles puede ser solicitada con la instrucción mkvmerge + --engage list. Estas características no están indicadas para ser + usadas en situaciones normales. + +

+ +
--gui-mode + +

+ Habilita el modo GUI. En este modo las líneas especialmente formateadas + pueden ser generadas para decirle a un control de la GUI lo que está + pasando. Estos mensajes se rigen bajo el formato + '#GUI#mensaje'. El mensaje puede ser continuado por pares + de valores/claves como en + '#GUI#mensaje#clave1=valor1#clave2=valor2…'. Ni los + mensajes ni las claves pueden ser traducidas y siempre se generan en + inglés. + +

+ +
@options-file.json + +

+ Lee argumentos adicionales de la línea de comandos desde el archivo + archivo-opciones. Consulte la sección acerca de archivos de opciones para más + información. + +

+ +
--capabilities + +

+ Muestra información sobre las características adicionales que han sido + compiladas y sale. La primera línea generada será la información de la + versión. El resto de líneas contienen exactamente una palabra cuya presencia + indica que esa característica ha sido compilada. Estas características son: + +

+ + +
    + +
  • + +

    + 'FLAC' -- lee archivos en bruto FLAC y + manipula pistas FLAC en otros + contenedores. p.e. Ogg(tm) o Matroska(tm). + +

    + +
  • + +
+ +
-h, --help + +

+ Muestra información de uso y sale. + +

+ +
-V, --version + +

+ Muestra la información de la versión y sale. + +

+ +
+ + +

3. Uso

+ + +

+ Para cada archivo, el usuario puede seleccionar qué pistas mkvmerge(1) debe + tomar. Todos se almacenan en un archivo especificado con + -o. Una lista de formatos conocidos (y soportados) se + pueden obtener con la opción -l. + +

+ + +
+

Important:

+ +

+ El orden de las opciones en la línea de comandos es importante. Por favor, + lea la sección "Orden de + opciones" si eres nuevo usando el programa. + +

+ +
+ +

4. Orden de opciones

+ + + +

+ El orden en el qué las opciones son especificadas son importantes para + algunas opciones. Las opciones se dividen en dos categorías: + +

+ + +
    + +
  1. + +

    + Opciones que afectan a todo el programa y no están vinculadas a ningún + archivo de entrada. Estas son, entre otras, + --command-line-charset, --output o + --titlee. Estas pueden aparecer en cualquier parte de la + línea de comandos. + +

    + +
  2. + + +
  3. + +

    + Opciones que afectan a un solo archivo de entrada o una sola pista de un + archivo de entrada. Estas opciones se aplican al siguiente archivo en la + línea de comandos. Todas las opciones que se aplican al mismo archivo de + entrada (o las pistas del mismo archivo de entrada) se pueden especificar en + cualquier orden, siempre y cuando, todas aparezcan antes del nombre del + archivo de entrada. Ejemplos para las opciones que se aplican a un archivo + de entrada son --no-chapters o + --chapter-charset. Ejemplos para las opciones que se + aplican a una única pista son --default-duration o + --language. + +

    + +
  4. + +
+ + +

+ Las opciones se procesan de izquierda a derecha. Si una opción aparece + varias veces en el mismo ámbito, se utilizará la última. Por lo tanto, el + título se establecerá a "Otra cosa" en el siguiente ejemplo: + +

+ +
mkvmerge -o salida.mkv --title "Esto y eso" entrada.avi --title "Algo más"
+ +

+ El siguiente ejemplo muestra como usando dos veces la opción + --language todo es correcto ya que son usadas en diferentes + ámbitos. A pesar de que se aplican al mismo ID de pista, estas se aplican a + diferentes archivos de entrada y por lo tanto tienen diferentes ámbitos: + +

+ +
mkvmerge -o salida.mkv --language 0:spa español.ac3 --language 0:jpn japones.ac3
+

5. Ejemplos

+ + +

+ Supongamos que tienes un archivo llamado MiPelícula.avi y una pista de audio + en otro archivo, p.e. 'MiPelícula.wav'. Lo primero que + necesitas es codificar el audio a OggVorbis(tm): + +

+ +
oggenc -q4 -o MiPelícula.ogg MiPelícula.wav
+ +

+ Después de unos minutos ya puedes unir el audio y el video: + +

+ +
mkvmerge -o MiPelícula-con-sonido.mkv MiPelícula.avi MiPelícula.ogg
+ +

+ Si tu AVI ya contiene una pista de audio entonces también + será copiada (si mkvmerge(1) soporta el formato de ese audio). Para evitar + esto, simplemente hacer lo siguiente: + +

+ +
mkvmerge -o MiPelícula-con-sonido.mkv -A MiPelícula.avi MiPelícula.ogg
+ +

+ Después de unos minutos decides ripear otra pista de audio, p.e. los + comentarios del director u otro idioma, + 'MiPelícula-añadir-audio.wav'. La codificas de nuevo y la + añades al anterior archivo: + +

+ +
oggenc -q4 -o MiPelícula-añadir-audio.ogg MiPelícula-añadir-audio.wav
+mkvmerge -o MM-completa.mkv MiPelícula-con-sonido.mkv MiPelícula-añadir-audio.ogg
+ +

+ El mismo resultado se puede lograr con: + +

+ +
mkvmerge -o MM-completa.mkv -A MiPelícula.avi MiPelícula.ogg MiPelícula-añadir-audio.ogg
+ +

+ Ahora abra el mplayer(tm) y disfruta. Si tienes + múltiples pistas de audios (o incluso pistas de video) entonces le puedes + decir a mplayer(tm) que pista debe reproducir con las + opciones '-vid' y '-aid'. Estos están en + base y no distinguen entre video y audio (el índice comienza en el cero). + +

+ + +

+ Si necesitas una pista de audio sincronizada puedes hacerlo fácilmente. Lo + primero es averiguar que ID de pista tiene la pista Vorbis, con: + +

+ +
mkvmerge --identify desincronizado.ogg
+ +

+ Ahora pues usar ese ID en la siguiente línea de comandos: + +

+ +
mkvmerge -o sincronizado.mkv -A entrada.avi -y 12345:200ms desincronizado.ogg
+ +

+ Esto añadiría 200ms de silencio al inicio de la pista de audio con el ID + 12345 obtenido de + 'desincronizado.ogg'. + +

+ + +

+ Algunas películas comienzan sincronizadas correctamente pero poco a poco se + desincronizan. Para este tipo de películas se puede especificar un factor de + desfase que será aplicado a todas las marcas de tiempo (timestamps) -- + ningún dato es añadido o eliminado. Si se aplicas un factor muy grande o + pequeño el resultado puede ser incorrecto. Un ejemplo sería un episodio + transcodificado que tiene 0.2 segundos de + desincronización al final de la película, y cuya longitud total es de + 77340 fotogramas. Si el framerate es + 29.97fps, 0.2 segundos + corresponden aproximadamente a 6 fotogramas. Así que se + puede hacer: + +

+ +
mkvmerge -o sincronizado.mkv -y 23456:0,77346/77340 desincronizado.mkv
+ +

+ El resultado fue bueno. + +

+ + +

+ Las opciones de sincronización también pueden ser usadas para subtítulos de + igual modo. + +

+ + +

+ Para subtítulos de texto puede utilizar cualquier programa para Windows + (como SubRipper(tm)) o el paquete + subrip(tm) que se puede encontrar en fuentes de + transcodificación(1) + en el directorio 'contrib/subrip'. El proceso general es: + +

+ + +
    + +
  1. + +

    Extraer una secuencia de subtítulos en bruto para la fuente:

    +
    tccat -i /ruta/a/copiar/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtítulo2pgm -o MiPelícula
    +
  2. + + +
  3. + +

    Convertir las imágenes PGM generadas a texto con gocr:

    +
    pgm2txt MiPelícula
    +
  4. + + +
  5. + +

    Revisar el resultado de los archivos de texto:

    +
    ispell -d americano *txt
    +
  6. + + +
  7. + +

    Convertir los archivos de texto a un archivo SRT:

    +
    srttool -s -w -i MiPelícula.srtx -o MiPelícula.srt
    +
  8. + +
+ + +

+ El archivo generado puede ser utilizado como otro archivo de entrada para + mkvmerge(1): + +

+ +
mkvmerge -o MiPelícula.mkv MiPelícula.avi MiPelícula.srt
+ +

+ Si necesitas especificar un idioma para una pista concreta, esto es + realmente fácil. Primero busca tu idioma en el código ISO 639-2. mkvmerge(1) + puede mostrarte todos esos códigos para ti: + +

+ +
mkvmerge --list-languages
+ +

+ Busca en la lista de los idiomas el que necesites. Supongamos que tienes dos + pistas de audio en un archivo Matroska(tm) y necesitas establecer sus códigos + de idioma, y que sus IDs de pista son 2 y 3. Esto se puede hacer con: + +

+ +
mkvmerge -o con-códigos-idioma.mkv --language 2:spa --language 3:jpn sin-códigos-idioma.mkv
+ +

+ Como puedes ver puedes usar la opción --language + varias veces. + +

+ + +

+ Es posible que quiera que el reproductor use el holandés como el idioma + predeterminado. También tiene subtítulos adicionales, p.e. en inglés y + francés, y desea que el programa de reproducción muestre por defecto en + francés. Esto se puede hacer con: + +

+ +
mkvmerge -o con-códigos-idioma.mkv --language 2:ger --language 3:dut --default-track-flag 3 sin-códigos-idioma.mkv --language 0:eng inglés.srt --default-track-flag 0 --language 0:fre francés.srt
+ +

+ Si no ves en la salida de mkvinfo(1), los flags del idioma o pista + predeterminada que ha especificado, por favor lea la sección acerca de valores predeterminados. + +

+ + +

+ Deshabilita la compresión para un archivo de entrada. + +

+ +
mkvmerge -o sin-compresión.mkv --compression -1:none MiPelícula.avi --compression -1:none MiPelícula.srt
+ +

6. IDs de pista

+ + + +

6.1. IDs de pista normal

+ + + +

+ Algunas opciones para mkvmerge(1) necesitan un ID de pista para especificar a + qué pista se le tienen que aplicar. Estos IDs de pista son mostrados por los + lectores cuando desmultiplexan el archivo de entrada actual, o si mkvmerge(1) + es invocado con la opción --identify. + Un ejemplo para esto: + +

+ +
mkvmerge -i v.mkv
+File 'v.mkv': container: Matroska
+Track ID 0: video (V_MS/VFW/FOURCC, DIV3)
+Track ID 1: audio (A_MPEG/L3)
+ +

+ No debe confundir los IDs de pista que se asignan a las pistas, que se + escriben en el archivo MKV generado, con los IDs de pista del archivo de + entrada. Sólo los IDs de pista del archivo de entrada se utilizan para las + opciones que necesitan estos valores. + +

+ + +

+ También tenga en cuenta que cada archivo de entrada tiene su propio conjunto + de IDs de pista. Por lo tanto, los IDs de pista para el archivo + 'archivo1.ext', tal y como había reportado + 'mkvmerge --identify' no cambian, no importa cuántos + otros archivos de entrada existan o en qué posición se use + 'archivo1.ext'. + +

+ + +

+ Los IDs de pista son asignados como estos: + +

+ + +
    + +
  • + +

    + Archivos AVI: La pista de video tiene el ID 0. Las pistas + de audio obtienen sus IDs en orden creciente empezando desde el 1. + +

    + +
  • + + +
  • + +

    + Los archivos AAC, AC-3, + MP3, SRT y WAV: La única + 'pista' en ese archivo se le asigna el ID 0. + +

    + +
  • + + +
  • + +

    + La mayoría de archivos: Los IDs de pista son asignados en el orden en el qué + se encuentran, empezando desde el número 0. + +

    + +
  • + +
+ + +

+ Las opciones que utilizan los IDs de pista son aquellos cuya descripción + contiene un 'TID'. Las siguientes opciones también + utilizan IDs de pista: --audio-tracks, + --video-tracks, --subtitle-tracks, + --button-tracks y --track-tags. + +

+ + + +

6.2. IDs de pista especial

+ + + +

+ Existen diversos IDs que tienen un significado especial y no aparecen en la + identificación de salida. + +

+ + +

+ El ID de pista especial '-1' es un comodín y aplica la + opción especificada a todas las pistas que se leen del archivo de entrada. + +

+ + +

+ El ID de pista especial '-2' se refiere a los capítulos + en un archivo de origen. Actualmente sólo la opción --sync + usa este ID especial. Como alternativa a la opción --sync + -2:… se puede usar --chapter-sync …. + +

+ + +

7. Manipulador de idiomas

+ + + +

+ Matroska(tm) admite dos tipos diferentes de elementos de idioma: el antiguo y + obsoleto elemento "Language", que contiene códigos ISO 639-2 alfa 3, y las + nuevas etiquetas "LanguageIETF", que contienen etiquetas de idioma BCP 47 + del IETF. Todas las opciones de mkvmerge(1) que aceptan un idioma también + admiten una etiqueta de idioma BCP 47. mkvmerge(1) obtendrá, siempre que sea + posible, el valor del elemento "Idioma" obsoleto a partir de las etiquetas + de idioma BCP 47. + +

+ + +

+ Al identificar un archivo en modo JSON, los elementos existentes de cabecera + de pista "LanguageIETF" se mostrarán como la propiedad de pista + language_ietf. + +

+ + +

+ Al escribir un archivo mkvmerge(1) siempre escribirá los elementos + "LanguageIETF", "ChapLanguageIETF" y "TagLanguageIETF" (los dos últimos sólo + si se escriben capítulos o etiquetas respectivamente). Además de esos + elementos, se escribirán los elementos antiguos correspondientes; se + ajustarán a la parte del código ISO 639-2 de la etiqueta de idioma BCP + 47. Por ejemplo, cuando el idioma de la pista se establece a + sr-Cyrl-RS "LanguageIETF" se establecerá + asr-Cyrl-RS y el antiguo elemento "Language" se + establecerá asrp. + +

+ + +

+ Al leer archivos existentes (archivos Matroska, archivos de capítulos o + etiquetas XML, etc.) que ya contengan elementos "...LanguageIETF", se + conservarán los elementos previos. En caso contrario, se añadirán elementos + "...LanguageIETF" en función de las opciones de la línea de comandos y de + otros elementos "...Language" obsoletos existentes. + +

+ + +

+ La creación de los nuevos elementos puede desactivarse por completo con la + opción de línea de comandos --disable-language-ietf, que + actúa sobre los tres nuevos elementos. + +

+ + +

+ Puede elegir el método de normalización aplicado a las subetiquetas de + idioma extendidas con el parámetro --normalize-language-ietf. + +

+ +

8. Conversión de archivos de texto y conjunto de caracteres

+ + +
+

Note:

+ +

+ Esta sección se aplica a todos los programas de MKVToolNix aunque sólo se + mencione mkvmerge(1). + +

+ +
+ + +

8.1. Introducción

+ + +

+ Todos los textos en un archivo Matroska(tm) están codificados en UTF-8. Esto + implica que mkvmerge(1) convierte cada archivo de texto que lee, así como + cada texto dado en la línea de comandos, desde un conjunto de caracteres a + UTF-8. Por contra, esto también significa que la salida de mkvmerge(1) tiene + que ser convertida desde UTF-8 a un conjunto de caracteres, p.e. si una + traducción no inglesa se usa con --ui-language + o para texto que proviene desde un archivo Matroska(tm). + +

+ + +

+ mkvmerge(1) realiza esta conversión automáticamente en función de la + presencia de un Marcador de Orden Bytes (abreviado: BOM) o de la + configuración regional actual. Cómo el conjunto de caracteres se deduce de + la configuración regional depende del sistema operativo donde se ejecute + mkvmerge(1) + +

+ + + +

8.2. Marcador de Orden Bytes (BOM)

+ + + +

+ Los archivos de texto que comienzan con un BOM ya están codificados en una + representación de UTF. mkvmerge(1) admite los siguientes cinco modos: UTF-8, + UTF-16 Little y Big Endian, UTF-32 Little y Big Endian. Los archivos de + texto con un BOM son convertidos automáticamente a UTF-8. Todos los + parámetros que, de otra manera, cambian el conjunto de caracteres de un + archivo de este tipo (p.e. --sub-charset) + son ignorados silenciosamente. + +

+ + + +

8.3. Sistemas Linux y Unix-like incluido macOS

+ + + +

+ El sistemas Unix, mkvmerge(1) usa la llamada al sistema + setlocale(3) + que a su vez utiliza las variables de entorno LANG, + LC_ALL y LC_CYPE. El conjunto de + caracteres resultante es a menudo uno de UTF-8 o de la familia ISO-8859-* y + se utiliza para todas las operaciones del archivo de texto y para codificar + las cadenas de texto en la línea de comandos y la salida de la consola. + +

+ + + +

8.4. Windows

+ + + +

+ En Windows el juego de caracteres predeterminado utilizado para la + conversión de archivos de texto se determina mediante una llamada a la + GetACP() del sistema. + +

+ + +

+ La lectura de la línea de comandos se realiza con la función + GetCommandLineW() que ya devuelve una cadena de texto + Unicode. Por lo tanto, en Windows la opción + --command-line-charset se ignora. + +

+ + +

+ La salida a la consola se presenta en tres escenarios: + +

+ + +
    + +
  1. + +

    + Si la salida se redirige con la opción --redirect-output + entonces el conjunto de caracteres predeterminado es UTF-8. Se puede cambiar + con --output-charset. + +

    + +
  2. + + +
  3. + +

    + Si la salida se redirige con cmd.exe, p.e. con + mkvinfo archivo.mkv > info.txt, entonces el conjunto + de caracteres siempre es UTF-8 y no se puede cambiar. + +

    + +
  4. + + +
  5. + +

    + De otra manera, (cuando se escribe directamente a la consola) la función de + Windows WriteConsoleW() se utiliza y la opción --output-charset + se ignora. La consola debería ser capaz de generar todos los caracteres + Unicode del correspondiente idioma que está instalado (p.e. los caracteres + chinos podrían no ser mostrados en versiones inglesas de Windows). + +

    + +
  6. + +
+ + + +

8.5. Opciones de línea de comandos

+ + + +

+ Las siguientes opciones permiten especificar los conjuntos de caracteres: + +

+ + +
    + +
  • + +

    + --sub-charset + para archivos y pistas de subtítulos de textos almacenadas en formatos de + contenedores para las que el conjunto de caracteres no se puede determinar + sin ambigüedad. (p.e. archivo Ogg), + +

    + +
  • + + +
  • + +

    + --chapter-charset + para archivos y pistas de capítulos de texto almacenadas en formatos de + contenedores para las que el conjunto de caracteres no se puede determinar + sin ambigüedad. (p.e. archivos Ogg para información de capítulos, pista y + archivos, etc..; archivos MP4 para información del capítulos), + +

    + +
  • + + +
  • + +

    + --command-line-charset + para todas las cadenas de texto en la línea de comandos, + +

    + +
  • + + +
  • + +

    + --output-charset + para todas las cadenas de texto escritas en la consola o a un archivo si la + salida ha sido redirigida con la opción --redirect-output. + En los sistemas que no sean Windows, el conjunto de caracteres por defecto, + es el del sistema actual. En windows por defecto es a UTF-8, tanto + redirigiendo con --redirect-output + como con cmd.exe, p.e. mkvinfo archivo.mkv > + info.txt. + +

    + +
  • + +
+ + +

9. Archivos de opciones

+ + + +

+ Un archivo de opciones es un archivo que mkvmerge(1) puede leer argumentos + adicionales de la línea de comandos. Esto se puede utilizar para eludir + ciertas limitaciones en el shell (entorno) o el sistema operativo como una + longitud limitada de la línea de comandos cuando se ejecutan programas + externos. + +

+ + +

+ Un archivo de opciones que contiene datos con formato JSON. El contenido + debe ser un vector JSON compuesto únicamente de cadenas de caracteres + JSON. El archivo debe estar codificado en formato UTF-8. El archivo no debe + comenzar con un marcador de orden de bits (BOM), pero si + lo hiciese, será omitido. + +

+ + +

+ Las reglas de los caracteres especiales de escape dentro de JSON son las + unicas que existen en la especificación oficial JSON, RFC 7159. + +

+ + +

+ El nombre del archivo de opciones debe especificarse como un argumento de + línea de comandos con el carácter '@' como prefijo. + +

+ + +

+ La línea de comandos 'mkvmerge -o "mi archivo.mkv" -A "una + película.avi" audio.ogg' se podría convertir al siguiente archivo + de opciones JSON llamado p.e. 'opciones.json': + +

+ +
[
+  "-o",
+  "c:\\Matroska\\mi archivo.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "una película.avi",
+  "audio.ogg"
+]
+ +

+ El comando correspondiente debería ser entonces 'mkvmerge + @options.json'. + +

+ +

10. Vinculación de archivos

+ + +

+ Matroska(tm) admite la vinculación de archivos que simplemente lo que + significa que un archivo en especifico es el predecesor o sucesor del + archivo actual. Para ser precisos, los archivos están realmente vinculados + sino los segmentos Matroska(tm). Como la mayoría de archivos probablemente + sólo contienen un segmento Matroska(tm) las siguientes explicaciones usan el + término 'vinculación de archivos' aunque realmente 'vinculación de + segmentos' sería lo más correcto. + +

+ + +

+ Cada segmento se identifica por un único UID del segmento de 128 bits de + longitud. Este UID es automáticamente generado por mkvmerge(1). La + vinculación se realiza principalmente insertando los UIDs del segmento + (abreviado: SID) del anterior/siguiente archivo en la + información del encabezado del segmento. mkvinfo(1) muestra estos + SIDs si los encuentra. + +

+ + +

+ Si un archivo se divide en varios archivos más pequeños y se utiliza la + vinculación, entonces los códigos de tiempo no comenzarán por 0 si no que + continuará desde dónde el último archivo lo dejó. De esta manera el tiempo + absoluto se mantiene incluso si los archivos anteriores no están disponibles + p.e. cuando se transmiten). Si no se utiliza la vinculación entonces los + códigos de tiempo de cada archivo comenzarán desde 0. Por defecto, + mkvmerge(1) no usa la vinculación de archivos. Si lo necesita podrá activarlo + con la opción --link. Esta opción sólo es útil si la + división también se activa. + +

+ + +

+ Independientemente de si la división se activa o no, el usuario le puede + decir a mkvmerge(1) que vincule los archivos generados a un especifico + SIDs. Esto se consigue con las opciones + --link-to-previous y --link-to-next. Estas + opciones aceptan un segmento SID en el formato que + mkvinfo(1) genera: 16 números hexadecimales comprendidos entre + 0x00 y 0xff, cada uno con el + prefijo '0x', p.e. '0x41 0xda 0x73 0x66 0xd9 0xcf + 0xb2 0x1e 0xae 0x78 0xeb 0xb4 0x5e 0xca 0xb3 0x93'. De manera + alternativa, se puede utilizar una forma más simple: 16 números + hexadecimales comprendidos entre 0x00 y + 0xff, sin el prefijo '0x' y sin + espacios, p.e. '41da7366d9cfb21eae78ebb45ecab393'. + +

+ + +

+ Si se utiliza la división entonces el primer archivo se vincula al + SID especificado con SID y el último + archivo se vincula al SID especificado con + --link-to-next. Si no se utiliza la división entonces el + archivo será vinculado a ambos SIDs. + +

+ +

11. Valores predeterminados

+ + +

+ La especificación Matroska(tm) establece que algunos elementos tienen un valor + predeterminado. Por lo general, si el valor es igual al predeterminado + entonces no será escrito en el archivo a fin de ahorrar espacio. Los + elementos que el usuario podría echar en falta en la salida de mkvinfo(1) son + los elementos idioma y flag de pista + predefinida. El valor predeterminado para el + idioma es Inglés ('eng'), y para flag de + pista predefinida es true. Por lo tanto, + si utiliza --language 0:eng para una pista entonces no se + mostrará en la salida de mkvinfo(1). + +

+ +

12. Attachments

+ + +

+ Es posible que desee conservar algunas fotos junto con su archivo + Matroska(tm), o usar subtítulos SSA que requieren de una + fuente especial SSA que es realmente rara. En estos casos + puede adjuntar estos archivos al archivo Matroska(tm). No sólo son añadidos al + archivo sino que son embebidos. Un reproductor puede entonces mostrar estos + archivos (en el caso de las 'fotos') o usarlos para renderizar los + subtítulos (en el caso de las fuentes + 'TrueType(tm)'). + +

+ + +

+ Aquí está un ejemplo de cómo adjuntar una foto y fuente + TrueType(tm) al archivo generado: + +

+ +
$ mkvmerge -o salida.mkv -A video.avi audio.ogg \
+  --attachment-description "Yo y la banda detrás del escenario en una reunión" \
+  --attachment-mime-type image/jpeg \
+  --attach-file yo_y_la_banda.jpg \
+  --attachment-description "La rara e increible fuente de la belleza" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file fuente_guay.ttf
+ +

+ Si un archivo Matroska(tm) contiene adjuntos se utiliza como archivo de + entrada entonces mkvmerge(1) copiará todos los adjuntos en el nuevo + archivo. La selección de qué archivos serán copiados o no, puede ser + cambiada con las opciones --attachments + y --no-attachments. + +

+ +

13. Chapters

+ + +

+ El sistema de capítulos de Matroska(tm) es más potente que el antiguo sistema + utilizado con los archivos OGM. Las completas + especificaciones se pueden encontrar en la página web de Matroska. + +

+ + +

+ mkvmerge(1) admite dos tipos de archivos de capítulos como entrada. El primer + formato, denominado 'formato simple de capítulos', que es el mismo formato + que se encuentra en las herramientas OGM. El segundo + formato se basa en el formato de capítulos XML que son admitidos por todas + las funcionalidades de capítulos de Matroska(tm). + +

+ + +

+ Aparte de los archivos de capítulos propios de mkvmerge(1) También puede leer + capítulos de otros formatos de archivo (por ejemplo, MP4, Ogg, Blu-rays o + DVD). + +

+ + +

13.1. El formato simple de capítulos

+ + + +

+ Este formato consiste en un par de líneas que comienzan con + 'CHAPTERxx=' y 'CHAPTERxxNAME=', + respectivamente. La primera contiene el código de tiempo inicial mientras + que el segundo lo hace al títlo. Ejemplo: + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=Intro
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=El niño se prepara para el rock
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=El niño sacude la casa
+ +

+ mkvmerge(1) transformará cada par o líneas en un Matroska(tm) + ChapterAtom. No establece ningún + ChapterTrackNumber lo que significa que todos los + capítulos se aplican a todas las pistas del archivo. + +

+ + +

+ Como se trata de un archivo de texto, podría ser necesaria realizar una + conversión del conjunto de caracteres. Consulte la sección acerca de archivos de texto y conjunto de + caracteres para una explicación sobre cómo mkvmerge(1) realiza la + conversión entre conjunto de caracteres. + +

+ + + +

13.2. El formato de capítulos basados en XML

+ + +

+ El formato de capítulos basados en XML es similar a este ejemplo: + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>Un capítulo corto</ChapterString>
+        <ChapterLanguage>spa</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>Una parte de un capítulo corto</ChapterString>
+          <ChapterLanguage>spa</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ Con este formato, se pueden realizar tres cosas que con el formato simple no + se puede: + +

+ + +
    + +
  1. +

    Se puede establecer la marca de tiempo para el final del capítulo,

    +
  2. + +
  3. +

    los capítulos se pueden anidar,

    +
  4. + +
  5. +

    el idioma y país también.

    +
  6. + +
+ + +

+ La distribución mkvtoolnix contiene algunos archivos a modo de ejemplo en el + subdirectorio doc que se pueden usar como base. + +

+ + +

+ A continuación, se muestran las etiquetas soportadas por XML, sus tipos de + datos y, en dónde corresponda, el rango válido para sus valores: + +

+ +
Chapters (maestro)
+  EditionEntry (maestro)
+    EditionUID (entero sin signo, rango válido: 1 <= valor)
+    EditionFlagHidden (entero sin signo, rango válido: 0 <= valor <= 1)
+    EditionFlagDefault (entero sin signo, rango válido: 0 <= valor <= 1)
+    EditionFlagOrdered (entero sin signo, rango válido: 0 <= valor <= 1)
+    ChapterAtom (maestro)
+      ChapterAtom (maestro)
+      ChapterUID (entero sin signo, rango válido: 1 <= valor)
+      ChapterTimeStart (entero sin signo)
+      ChapterTimeEnd (entero sin signo)
+      ChapterFlagHidden (entero sin signo, rango válido: 0 <= valor <= 1)
+      ChapterFlagEnabled (entero sin signo, rango válido: 0 <= valor <= 1)
+      ChapterSegmentUID (binario, rango válido: 1 <= tamaño en bytes)
+      ChapterSegmentEditionUID (entero sin signo, rango válido: 1 <= valor)
+      ChapterPhysicalEquiv (entero sin signo)
+      ChapterTrack (maestro)
+        ChapterTrackNumber (entero sin signo, rango válido: 1 <= valor)
+      ChapterDisplay (maestro)
+        ChapterString (cadena de texto UTF-8)
+        ChapterLanguage (cadena de texto UTF-8)
+        ChapterCountry (cadena de texto UTF-8)
+      ChapterProcess (maestro)
+        ChapterProcessCodecID (entero sin signo)
+        ChapterProcessPrivate (binario)
+        ChapterProcessCommand (maestro)
+          ChapterProcessTime (entero sin signo)
+          ChapterProcessData (binario)
+ + +

13.3. Leyendo capítulos del Blu-ray

+ + + +

+ mkvmerge(1) puede leer capítulos de Blu-rays sin encriptar. Por lo que puedes + usar la ruta a uno de las listas de reproducción MPLS con el parámetro + --chapters. + +

+ + +

+ Ejemplo: --chapters + /srv/blurays/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. Leyendo capítulos del DVDs

+ + + +

+ Cuando MKVToolNix se compila con la librería + libdvdread(tm), mkvmerge(1) puede leer capítulos de + DVDs. Por lo que puede usar la ruta a una de las carpetas o archivos del DVD + con el parámetro --chapters. Como los DVDs puede + contener más de un título y cada título tiene su propio conjunto de + capítulos, puedes añadir dos puntos, al final del nombre del argumento, + junto con el número del título que necesite. El número del título por + defecto es 1. + +

+ + +

+ Ejemplo: --chapters /srv/dvds/BigBuckBunny/VIDEO_TS:2 + +

+ + + +

13.5. Notas generales

+ + +

+ Cuando se dividen los archivos, mkvmerge(1) también ajustará correctamente + los capítulos. Esto significa que cada archivo sólo incluye las entradas de + capítulo que se aplican a él, y que se compensará el código de tiempo para + que coincida con el nuevo código de tiempo de cada archivo generado. + +

+ + +

+ mkvmerge(1) es capaz de copiar los capítulos de los archivos de entrada + mkvmerge(1) a menos que explícitamente se deshabilite con la opción --no-chapters. + Los capítulos procedentes de todas las fuentes (archivos Matroska(tm), Ogg, + Matroska(tm), archivos de texto de capítulos) por lo general no se fusionan y + acaban en ChapterEditions independientes. Sólo si los + capítulos que se leen de diversos archivos Matroska(tm) o XML, comparten el + mismo UID de edición, entonces los capítulos se fusionarán en un único + ChapterEdition. Si dicha fusión también se desea + realizar en otras situaciones, el usuario tiene que extraer primero los + capítulos de todas las fuentes con mkvextract(1), y fusionar los archivos + XML manualmente para multiplexarlos después. + +

+ + +

14. Tags

+ + + +

14.1. Introducción

+ + + +

+ El sistema de etiquetas de Matroska(tm) es parecido al de otros contenedores: + un conjunto de pares KEY=VALUE. Sin embargo, en + Matroska(tm) estas etiquetas también se pueden anidar, y tanto + KEY comoVALUE son elementos + propios. El archivo de ejemplo example-tags-2.xml + muestra cómo usar este sistema. + +

+ + + +

14.2. Alcance de las etiquetas

+ + + +

+ Las etiquetas Matroska(tm) no se aplican automáticamente a todo el archivo. Se + puede hacer, pero también a diferentes partes del archivo: a una o más + pistas, a una o más capítulos, o incluso a una combinación de ambas. La especificación + de Matroska proporciona más detalles sobre esto. + +

+ + +

+ Una cosa importante es que las etiquetas están vinculadas a pistas o + capítulos con el elemento de etiquetas Targets de + Matroska(tm), además los UIDs usados para vincularlos no + son los IDs de la pista que mkvmerge(1) utiliza en todas partes. En cambio, + los números usados son los UIDs que mkvmerge(1) calcula automáticamente (si + la pista se toma de otro formato de archivo que no sea Matroska(tm) o que se + copian desde el archivo de origen si el archivo de origen de la pista es un + archivo Matroska(tm). Por lo tanto, es complicado saber que UIDs se van a usar + en el archivo de etiquetas antes de que el archivo se proporcione a + mkvmerge(1). + +

+ + +

+ mkvmerge(1) tiene dos opciones con las que se pueden añadir etiquetas a los + archivos Matroska(tm): las opciones --global-tags + y --tags. La + diferencia es que la opción anterior, --global-tags, + hará que las etiquetas se apliquen al archivo entero mediante la eliminación + de cualquiera de los elementos Targets mencionados + anteriormente. La última opción, --tags, inserta + automáticamente el UID que mkvmerge(1) genera para la etiqueta especificada + con la parte TID de la opción --tags. + +

+ + + +

14.3. Ejemplo

+ + +

+ Supongamos que necesitas añadir etiquetas a una pista de video leída desde + un archivo AVI. Mkvmerge --identify + archivo.avi informa que el ID de la pista de video (¡No confundir + este ID con el UID!) es 0. Así que creará el archivo de etiquetas, dejando a + un lado todos los elementos Targets e invocar a + mkvmerge(1): + +

+ +
mkvmerge -o archivo.mkv --tags 0:etiquetas.xml archivo.avi
+ + +

14.4. Formato del archivo de etiquetas

+ + +

+ mkvmerge(1) admite el formato de archivos de etiquetas basadas en XML. El + formato es muy similar al modelo de la especificación + Matroska. Tanto la distribución binaria como la fuente de MKVToolNix + vienen acompañadas de un archivo de ejemplo llamado + example-tags-2.xml que enumera simplemente todas las + etiquetas conocidas y que pueden ser usadas como base para las etiquetas de + la vida real. + +

+ + +

+ Las básicas son: + +

+ + +
    + +
  • +

    El elemento más externo debe ser <Tags>. +

    +
  • + +
  • + +

    Una etiqueta lógica está contenido dentro de un par de etiquetas XML + <Tag>. +

    + +
  • + +
  • +

    Los espacios en blanco, directamente antes y después del contenido de la + etiqueta, se ignoran. +

    +
  • + +
+ + + +

14.5. Tipos de datos

+ + +

+ El nuevo sistema de etiquetado de Matroska(tm) sólo conoce dos tipos de datos, + una cadena de texto UTF-8 y un tipo binario. El primero se usa para el + nombre de la etiqueta junto con el elemento + <String> mientras que el tipo binario se usa + para el elemento <Binary>. + +

+ + +

+ Como dato binario, en si mismo, no tendría sentido en un archivo XML, + mkvmerge(1) admite otros dos métodos para almacenar datos binarios. Si el + contenido de una etiqueta XML comienza con '@' entonces + el texto siguiente se trata como un nombre de archivo. El contenido del + archivo correspondiente se copia en el elemento Matroska(tm). + +

+ + +

+ De lo contrario, se espera que la información se codifique en Base64. Esta + es una codificación que transforma datos binarios en un conjunto limitado de + caracteres ASCII y p.e. se usa en programas de + mensajería. mkvextract(1) generará datos codificados en Base64 para elementos + binarios. + +

+ + +

+ El obsoleto sistema de etiquetado conoce más tipos de datos que se pueden + encontrar en las especificaciones oficiales de etiquetas Matroska(tm). Como + mkvmerge(1) ya no admite este sistema estos tipos no serán descritos. + +

+ + + +

14.6. Etiquetas conocidas para el formato de archivos XML

+ + + +

+ A continuación, se muestran las etiquetas soportadas por XML, sus tipos de + datos y, en dónde corresponda, el rango válido para sus valores: + +

+ +
Tags (maestro)
+  Tag (maestro)
+    Targets (maestro)
+      TargetTypeValue (entero sin signo)
+      TargetType (cadena de texto UTF-8)
+      TrackUID (entero sin signo)
+      EditionUID (entero sin signo)
+      ChapterUID (entero sin signo)
+      AttachmentUID (entero sin signo)
+    Simple (maestro)
+      Simple (maestro)
+      Name (cadena de texto UTF-8)
+      TagLanguage (cadena de texto UTF-8)
+      DefaultLanguage (entero sin signo)
+      String (cadena de texto UTF-8)
+      Binary (binario)
+ +

15. Información del segmento

+ + + +

+ Con archivos XML de información del segmento es posible establecer ciertos + valores en el campo del encabezado de "información del segmento" + de un archivo Matroska(tm). Todos estos valores no se pueden establecer a + través de otras opciones de la línea de comandos. + +

+ + +

+ Otros campos del encabezado de "información del segmento" se + pueden establecer a través de las opciones de la línea de comandos pero no + mediante archivos XML. Eso afecta p.e. las opciones --title y --timestamp-scale. + +

+ + +

+ Hay otros elementos que no pueden establecerse a través de la línea de + comandos ni mediante archivos XML. Eso afecta a los siguientes elementos: + DateUTC (también conocido como "fecha + multiplexado"), MuxingApp, + WritingApp y Duration. Estas siempre + se establecen mediante mkvmerge(1), en si mismo. + +

+ + +

+ A continuación, se muestran las etiquetas soportadas por XML, sus tipos de + datos y, en dónde corresponda, el rango válido para sus valores: + +

+ +
Info (maestro)
+  SegmentUID (binario, rango válido: tamaño en bytes == 16)
+  SegmentFilename (cadena de texto UTF-8)
+  PreviousSegmentUID (binario, rango válido: tamaño en bytes == 16)
+  PreviousSegmentFilename (cadena de texto UTF-8)
+  NextSegmentUID (binario, rango válido: tamaño en bytes == 16)
+  NextSegmentFilename (cadena de texto UTF-8)
+  SegmentFamily (binario, rango válido: tamaño en bytes == 16)
+  ChapterTranslate (maestro)
+    ChapterTranslateEditionUID (entero sin signo)
+    ChapterTranslateCodec (entero sin signo)
+    ChapterTranslateID (binario)
+

16. Diseño de archivo matroska

+ + +

+ El diseño de archivo Matroska(tm) es bastante flexible. mkvmerge(1) realizará + un archivo de una manera concreta. El archivo creado tendrá una apariencia + como esta: + +

+ + +

+ [Encabezado EBML] [segmento {meta seek #1} [información segmento] + [información pista] {adjuntos} {capítulos} [clúster 1] {clúster 2} + ... {clúster n} {índices} {meta seek #2} {etiquetas}] + +

+ + +

+ Los elementos que están entre llaves son opcionales, y dependen del contexto + y opciones utilizadas. Unos cuantos apuntes: + +

+ + +
    + +
  • + +

    + meta seek #1 sólo incluye un pequeño número de elementos de nivel 1, y sólo + si realmente existen: adjuntos, capítulos, índices, etiquetas, meta seek + #2. Las versiones anteriores de mkvmerge(1) también colocan los clústers en + estos elementos meta seek. Por lo tanto, en algunos casos imprecisos era + necesario reservar suficiente espacio. Esto a veces fallaba. Ahora sólo los + clústeres son almacenados en meta seek#2, y meta seek #1 se refiere al + elemento meta seek #2. + +

    + +
  • + + +
  • + +

    Los elementos de adjuntos, capítulos y etiquetas sólo están presentes si se + han añadidos. +

    + +
  • + +
+ + +

+ El archivo Matroska(tm) más corto posible se parecería a esto: + +

+ + +

+ [Encabezado EBML] [segmento [información segmento] [información pista] + [clúster 1]] + +

+ + +

+ Este podría ser el caso para archivos de audio. + +

+ +

17. Archivos de códigos de tiempo externos

+ + +

+ mkvmerge(1) permite al usuario elegir los códigos de tiempo para una pista en + concreto. Se puede usar para crear archivos con video de tasa de fotogramas + variable (VFR) o incluir discontinuidades en el audio. En este caso, un + fotograma es la unidad que mkvmerge(1) utiliza por cada bloque Matroska(tm) + creado. Para el video es exactamente un fotograma, para audio esto es un + paquete de un especifico tipo de audio. P.e. para AC-3 esto + sería un paquete que contiene 1536 muestras. + +

+ + +

+ Los archivos de códigos de tiempo que se utilizan cuando las pistas se unen + a otras, sólo se deben especificar a la primera parte de una sucesión de + pistas. Por ejemplo, si unes dos archivos, video1.avi y video2.avi, y deseas + usar códigos de tiempo entonces tu línea de comandos se debería parecer a + esto: + +

+ +
mkvmerge ... --timestamps 0:códigos_tiempo.txt video1.avi +video2.avi
+ +

+ Hay cuatro formatos que son reconocidos por mkvmerge(1). La primera línea + siempre contiene el número de la versión. Las líneas vacías, con sólo + espacios y las que comienzan con '#' se ignoran. + +

+ + +

17.1. Formato de archivo de código de tiempo v1

+ + +

+ Este formato comienza la línea de la versión. La segunda línea declara el + número por defecto de fotogramas por segundo. El resto de líneas contienen + tres números separados por comas: el fotograma inicial + (0 es el primer fotograma), el último fotograma y el + número de fotogramas para este rango. Los Fotogramas Por Segundo + (FPS) es un número con un punto decimal + '.'. Los rangos pueden contener discontinuidades para el + FPS usado por defecto. Un ejemplo: + +

+ +
# Formato de código de tiempo v1
+assume 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. Formato de archivo de código de tiempo v2

+ + + +

+ En este formato cada línea contiene un código de tiempo para el fotograma + correspondiente. Este código de tiempo se debe especificar con una precisión + de milisegundos. Puede ser un número decimal o no. Se + deben especificar como mínimo tantas líneas de códigos + de tiempo como fotogramas tiene la pista. Los códigos de tiempo deben estar + ordenados. Por ejemplo para 25fps: + +

+ +
# Formato de código de tiempo v2
+0
+40
+80
+ + +

17.3. Formato de archivo de código de tiempo v3

+ + +

+ En este formato cada línea contiene una duración en segundos seguida por un + número opcional de fotogramas por segundo. Ambos campos pueden ser números + decimales. Si el número de fotogramas por segundo no se especifica se + utiliza el valor predeterminado. Para el audio se debería dejar al códec + calcular, por si mismo, el código de tiempo del fotograma. Para eso, debería + utilizar 0.0 como el número de fotogramas por + segundo. También es posible crear discontinuidades en la secuencia usando la + palabra clave 'gap' seguida por la duración de la + discontinuidad. Un ejemplo para el archivo de audio: + +

+ +
# Formato de código de tiempo v3
+assume 0.0
+25.325
+7.530,38.236
+gap, 10.050
+2.000,38.236
+ + +

17.4. Formato de archivo de código de tiempo v4

+ + +

+ Este formato es idéntico al formato v2. La única diferencia es que los + códigos de tiempo no tiene que estar ordenados. Este formato casi nunca se + debería utilizar. + +

+ + +

18. Códigos de salida

+ + + +

+ mkvmerge(1) finaliza con uno de estos tres códigos de salida: + +

+ + +
    + +
  • + +

    + 0 -- Este código de salida significa que el + multiplexado se ha realizado correctamente. + +

    + +
  • + + +
  • + +

    + 1 -- En este caso mkvmerge(1) genera una salida con al + menos una advertencia, pero la la extracción continuó. Una advertencia es + prefijada con el texto 'Advertencia:'. Dependiendo de los + fallos involucrados los archivos creados serán correctos o no. El usuario es + instado a que revise tanto las advertencias como los archivos creados. + +

    + +
  • + + +
  • + +

    + 2 -- Este código de salida es usado después de que + ocurra un error. mkvmerge(1) aborta el proceso justo después de mostrar el + mensaje de error. El rango de los mensajes de error va desde los argumentos + de la línea de comandos, por delante de los errores de lectura/escritura, + hasta los archivos erróneos. + +

    + +
  • + +
+ +

19. Variables de entorno

+ + + +

+ mkvmerge(1) usa las variables predefinidas que se determinan en la + configuración local del sistema (p.e. LANG y la familia + LC_*). Variables adicionales: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG y su + forma abreviada MTX_DEBUG + +

El contenido se trata como si se hubiese pasado a través de la opción --debug. +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE y + su forma abreviada MTX_ENGAGE + +

El contenido se trata como si se hubiese pasado a través de la opción --engage. +

+ +
+ +

20. Vea también

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. WWW

+ + +

+ La última versión se puede encontrar siempre en la página de MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..1ce05e27ad30e6173dd3e1fd4dbb1188c37c06bc --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvpropedit.html @@ -0,0 +1,1348 @@ + + + + + mkvpropedit -- Modifica las propiedades existentes en archivos Matroska sin multiplexar + + + +
mkvpropedit -- Modifica las propiedades existentes en archivos Matroska(tm) sin multiplexar +
+
+ +
+

1. Sinopsis

+ + +
mkvpropedit opciones {archivo-origen} {acciones} +
+ +

2. Descripción

+ + +

+ Este programa analiza un archivo Matroska(tm) y modifica alguna de sus + propiedades. Entonces escribe estas modificaciones en el archivo + existente. Entre las propiedades que pueden ser modificadas están los + elementos de la información del segmento (p.e. el título) y los encabezados + de pista (p.e. el código del idioma, el flag de 'pista predefinida' o el + nombre). + +

+ + +

+ Opciones: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ + + Enumera todos los conocidos y editables nombres, su tipo (texto, entero, + booleano, etc...) y una pequeña descripción. El programa después sale. Por + lo tanto, el parámetro nombre-archivo no tiene que + ser suministrado. + +

+ +
-p, --parse-mode + modo + +

+ Establece el modo de análisis. El parámetro 'modo' + puede ser 'fast' (que es el predeterminado) o + 'full'. El modo 'fast' no analiza el + archivo entero pero usa los elementos de meta búsqueda para localizar los + elementos necesarios del archivo original. En el 99% de los casos es + suficiente. Sin embargo, para archivos que no contienen elementos de meta + búsqueda o que están dañados, el usuario debería de usar el modo de análisis + 'full'. Un análisis completo de un archivo puede llevar + bastantes minutos mientras que un análisis rápido sólo lleva unos segundos. + +

+ +
+ + +

+ Acciones que tienen que ver con las propiedades de información de la pista y + segmento: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit selector + +

+ Establece la sección del archivo Matroska(tm) (información del segmento o + ciertos encabezados de pista) sobre la que se centrarán todas las acciones: + add, set y delete. Esta opción puede + ser múltiples veces de manera que puede ser modificado más de un elemento a + la vez. + +

+ + +

+ Por defecto, mkvpropedit(1) editará la sección de información del segmento. + +

+ + +

+ Consulte la sección sobre selectores de edición para una + completa descripción de la sintaxis. + +

+ +
-a, --add + name=valor + +

+ Añade una propiedad name con el contenido de + valor. Esta propiedad será añadida incluso si dicha + propiedad ya existe. Tenga en cuenta que la mayoría de propiedades son + únicas y sólo existe una instancia de ellas. + +

+ +
-s, --set + name=valor + +

+ Establece todas las instancias de la propiedad name + con el contenido valor. Si no existe dicha propiedad + entonces será añadida. + +

+ +
-d, --delete nombre + +

+ Borra todas las instancias de la propiedad + name. Tenga en cuenta que algunas propiedades son + necesarias y no pueden ser eliminadas. + +

+ +
+ + +

+ Acciones que tienen que ver con las etiquetas y capítulos: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags + selector:nombre + +

+ Reemplaza o añade las etiquetas del archivo llamado + nombre o las elimina si nombre + está vacío. mkvpropedit(1) lee el mismo formato de etiquetas XML que + mkvmerge(1) también puede leer. + +

+ + +

+ El selector debe ser una de estas palabras: + all, global o + track. Para all, mkvpropedit(1) + reemplazará o eliminará todas las etiquetas del archivo. Con + global sólo las etiquetas globales serán reemplazadas o + eliminadas. Por ejemplo: + mkvpropedit "nombre-archivo.mkv" --tags global:etiquetas.xml + + mkvpropedit "nombre-archivo.mkv" --tags global: + +

+ + +

+ Con track, mkvpropedit(1) reemplazará las etiquetas de + la pista especificada. Además, las etiquetas leídas desde + nombre serán asignadas a la misma pista. La pista se + especifica de la misma manera que con los selectores de edición (mire + abajo). Por ejemplo: mkvpropedit "nombre-archivo.mkv" --tags + track:a1:nuevas-etiquetas-audio.xml. + +

+ +
--add-track-statistics-tags + +

+ Calcula las estadísticas de todas las pistas en un archivo y añade nuevas + etiquetas de estadística para ellas. Si el archivo ya contiene dichas + etiquetas entonces serán actualizadas. + +

+ +
--delete-track-statistics-tags + +

+ Elimina las etiquetas de estadística de todas las pistas de un archivo. Si + el archivo no contiene etiquetas de estadística, entonces no habrá ninguna + modificación. + +

+ +
-c, --chapters + nombre + +

+ Reemplaza o añade los capítulos del archivo llamado + nombre o las elimina si nombre + está vacío. mkvpropedit(1) lee el mismo formato de capítulos simple y XML que + mkvmerge(1) también puede leer. + +

+ +
+ + +

+ Acciones para manipular adjuntos: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment nombre-archivo + +

+ Añade un nuevo adjunto a nombre-archivo. + +

+ + +

+ Si la opción --attachment-name es usada antes de esta + opción entonces su valor es usado como el nuevo nombre del adjunto. Por el + contrario, se generará a partir del nombre-archivo. + +

+ + +

+ Si la opción --attachment-mime-type es usada antes de esta + opción entonces su valor es usado como el nuevo tipo MIME del adjunto. Por + el contrario, es auto-detectado a partir del contenido del + nombre-archivo. + +

+ + +

+ Si la opción --attachment-description es usada antes de + esta opción entonces su valor es usado como la nueva descripción del + adjunto. Por el contrario, ninguna descripción será establecida. + +

+ + +

+ Si la opción --attachment-uid se usa delante de esta opción + entonces su valor se usará como el nuevo UID del adjunto. De lo contrario, + un UID aleatorio se generará automáticamente. + +

+ +
--replace-attachment + selector:nombrearchivo + +

+ Reemplaza uno o más adjuntos que coincidan con el + selector del archivo + nombre-archivo. Si más de un adjunto existente + coincide con el selector entonces todo su contenido + será reemplazado por el contenido del + nombre-archivo. + +

+ + +

+ El selector puede tener una de estas cuatro formas: + ID, UID, Name y MIME type. Están explicadas más abajo en la sección selectores de adjuntos. + +

+ + +

+ Si la opción --attachment-name se usa delante de esta + opción entonces su valor se establece como el nuevo nombre para cada adjunto + modificado. De lo contrario, los nombres no se modificarán. + +

+ + +

+ Si la opción --attachment-mime-type se usa delante de esta + opción entonces su valor se establece como el nuevo tipo MIME para cada + adjunto modificado. De lo contrario, los tipo MIMES no se modificarán. + +

+ + +

+ Si la opción --attachment-description se usa delante de + esta opción entonces su valor se establece como la nueva descripción de cada + adjunto modificado. De lo contrario, las descripciones no se modificarán. + +

+ + +

+ Si la opción --attachment-uid se usa delante de esta opción + entonces su valor se establece como el nuevo UID para cada adjunto + modificado. De lo contrario, los UIDs no se modificarán. + +

+ +
--update-attachment selector + +

+ Establece las propiedades de uno o más adjuntos que coincidan con el + selector. Si más de un adjunto coincide con el + selector, entonces todas sus propiedades serán + actualizadas. + +

+ + +

+ El selector puede tener una de estas cuatro formas: + ID, UID, Name y MIME type. Están explicadas más abajo en la sección selectores de adjuntos. + +

+ + +

+ Si la opción --attachment-name se usa delante de esta + opción entonces su valor se establece como el nuevo nombre para cada adjunto + modificado. De lo contrario, los nombres no se modificarán. + +

+ + +

+ Si la opción --attachment-mime-type se usa delante de esta + opción entonces su valor se establece como el nuevo tipo MIME para cada + adjunto modificado. De lo contrario, los tipo MIMES no se modificarán. + +

+ + +

+ Si la opción --attachment-description se usa delante de + esta opción entonces su valor se establece como la nueva descripción de cada + adjunto modificado. De lo contrario, las descripciones no se modificarán. + +

+ + +

+ Si la opción --attachment-uid se usa delante de esta opción + entonces su valor se establece como el nuevo UID para cada adjunto + modificado. De lo contrario, los UIDs no se modificarán. + +

+ +
--delete-attachment selector + +

+ Elimina uno o más adjuntos que coincida con el + selector. + +

+ + +

+ El selector puede tener una de estas cuatro formas: + ID, UID, Name y MIME type. Están explicadas más abajo en la sección selectores de adjuntos. + +

+ +
+ + +

+ Opciones para acciones sobre adjuntos: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name nombre + +

+ Establece el nombre a usar en la operación --add-attachment + o --replace-attachment. + +

+ +
--attachment-mime-type mime-type + +

+ Establece el tipo MIME a usar en la operación + --add-attachment o --replace-attachment. + +

+ +
--attachment-description descripción + +

+ Establece la descripción a usar en la operación + --add-attachment o --replace-attachment. + +

+ +
--enable-legacy-font-mime-types + +

+ Habilita el uso de tipos MIME heredados para ciertos tipos + de fuentes adjuntas. Por ejemplo, + 'application/x-truetype-font' se usará para fuentes + TrueType en vez de 'fonts/ttf'. + +

+ + +

+ Esto afecta tanto al añadir nuevos adjuntos como al reemplazar los adjuntos + existentes, pero sólo si no se especifica el nuevo tipo + MIME. Otros adjuntos existentes no serán modificados. + +

+ + +

+ Los tipos MIME afectados son + 'font/sfnt', 'font/ttf' y + 'font/collection' los cuales están asignados a + 'application/x-truetype-fonts' y + 'font/otf', que está asignado a + 'application/vnd.ms-opentype'. + +

+ +
+ + +

+ Otras opciones: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ Normalmente cuando el usuario solicita realizar cambios en la propiedad de + cabecera de pista 'language' , mkvpropedit(1) aplicará el + mismo cambio en el nuevo elemento de cabecera de pista + LanguageIETF junto con el elemento heredado + Language. Si se usa esta opción, el cambio sólo es + aplicado en el elemento heredado Language. + +

+ + +

+ Esta opción no afecta a los cambios solicitados mediante la propiedad de + cabecera de pista 'language-ietf' . + +

+ +
--normalize-language-ietf modo + +

+ Habilita la normalización de todas las etiquetas de idioma IETF BCP 47 a su + forma canónica con el modo 'canonical', a su forma de + sub-etiquetas de idioma extendido con el modo 'extlang' o + lo desactiva con el modo 'off'. Por defecto, se aplica la + normalización a la forma canónica. + +

+ + +

+ En la forma canónica todas las sub-etiquetas para las que existe valores + preferidos se reemplazan por esos valores preferidos. Por ejemplo, convierte + esto 'zh-yue-jyutping' a + 'yue-jyutping' o 'fr-FX' a + 'fr-FR'. + +

+ + +

+ Para las sub-etiquetas de idioma extendido, primero se crea la forma + canónica. Después se reemplazan por esa sub-etiqueta de idioma extendido y + su prefijo todos los idiomas principales para los que existe una + sub-etiqueta de idioma extendido. Por ejemplo, esto convierte + 'yue-jyutping' a 'zh-yue-jyutping' y + no sucede nada en 'fr-FR' ya que 'fr' + no es una sub-etiqueta de idioma extendido. + +

+ + +

+ Esta normalización sólo se aplica a elementos que realmente han cambiado: + +

+ + +
    + +
  • + +

    + Al editar cabeceras de pista sólo se ven afectados los elementos del idioma + de la pista que se establecen a través de las especificaciones de + edición. Los idiomas de las pistas que no son editados no son + modificados. Editar una pista y sólo configurar distintas propiedades del + idioma tampoco afectará al idioma. + +

    + +
  • + + +
  • + +

    + Cuando se editan los capítulos todos los elementos del idioma, de todos los + elementos del capítulo, se ven afectados; ya que los capítulos existentes + siempre se reemplazan por completo. + +

    + +
  • + + +
  • + +

    + Al editar etiquetas sólo se ven afectados los elementos de idioma de las + etiquetas que realmente son sustituidos. Por ejemplo, cuando se reemplazan + las etiquetas globales no se ven afectadas las etiquetas de pista + existentes. + +

    + +
  • + +
+ + +

+ La mejor forma de normalizar todas las etiquetas de idioma existentes en un + archivo es volver a multiplexarlas con mkvmerge(1) y configurarles su opción + '--normalize-language-ietf' al modo deseado. + +

+ +
--command-line-charset + conjunto-caracteres + +

+ Establece el conjunto de caracteres a convertir las cadenas de texto dadas + desde la línea de comandos. Por defecto, se ajusta al conjunto de caracteres + dado por la configuración local del sistema. + +

+ +
--output-charset conjunto-caracteres + +

+ + + Establece el conjunto de caracteres para convertir las cadenas de texto que + serán usadas en el archivo de salida. Por defecto, se ajusta al conjunto de + caracteres dado por la configuración local del sistema. + +

+ +
-r, --redirect-output + nombre-archivo + +

+ Escribe todos los mensajes al archivo nombre-archivo + en vez de en la consola. Aunque esto se puede hacer fácilmente con la opción + de redirección hay casos en los que es necesaria esta opción: cuando el + terminal reinterpreta la salida antes de escribirlo al archivo. El conjunto + de caracteres establecido con --output-charset + se respeta. + +

+ +
--ui-language código + +

+ Fuerza la traducción al código de idioma que será + usado (p.e. 'de_DE' para la traducción al + Alemán). Introduciendo 'list' como + código provocará que el programa muestre una lista de + las traducciones disponibles. + +

+ +
--abort-on-warnings + +

+ Le dice al programa que cancele después de emitir la primera advertencia. El + código de salida del programa será 1. + +

+ +
--debug topic + +

+ Habilita la depuración para una característica concreta. Esta opción sólo es + útil para desarrolladores. + +

+ +
--engage característica + +

+ Habilita características experimentales. Una lista de características + disponibles puede ser solicitada con la instrucción mkvpropedit + --engage list. Estas características no están indicadas para ser + usadas en situaciones normales. + +

+ +
--gui-mode + +

+ Habilita el modo GUI. En este modo las líneas especialmente formateadas + pueden ser generadas para decirle a un control de la GUI lo que está + pasando. Estos mensajes se rigen bajo el formato + '#GUI#mensaje'. El mensaje puede ser continuado por pares + de valores/claves como en + '#GUI#mensaje#clave1=valor1#clave2=valor2…'. Ni los + mensajes ni las claves pueden ser traducidas y siempre se generan en + inglés. + +

+ +
-v, --verbose + +

+ Habilita el modo detallado y muestra todos los elementos Matroska(tm) + importantes que pueden ser leídos. + +

+ +
-h, --help + +

+ Muestra información de uso y sale. + +

+ +
-V, --version + +

+ Muestra la información de la versión y sale. + +

+ +
@options-file.json + +

+ Lee argumentos adicionales de la línea de comandos desde el archivo + archivo-opciones. Para más información sobre los + formatos admitidos para esos archivos consulte la sección acerca de + "archivos de opciones" en la página del manual de mkvmerge(1) + +

+ +
+ +

3. Selectores de edición

+ + +

+ La opción --edit + establece la sección del archivo Matroska(tm) (información del segmento o + ciertos encabezados de pista) sobre la que se centrarán todas las acciones: + add, set y delete. Esto es válido hasta + que se encuentra el siguiente parámetro --edit. El + argumento para esta opción se llama el selector de edición. + +

+ + +

+ Por defecto, mkvpropedit(1) editará la sección de información del segmento. + +

+ + +

3.1. Información del segmento

+ + +

+ La información del segmento puede ser seleccionada con una de estas tres + palabras: 'info', 'segment_info' o + 'segmentinfo'. Contiene propiedades como el título o el + UID del segmento . + +

+ + + +

3.2. Encabezados de pista

+ + +

+ Los encabezados de la pista pueden ser seleccionados con un selector + ligeramente más complejo. Todas las variantes comienzan con + 'track:'. Las propiedades del encabezado de pista incluye + elementos como el código de idioma, el flag de 'pista predefinida' o el + nombre de la pista. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ Si el parámetro n es un número entonces la pista con + número n será seleccionada. El orden de pista es el + mismo que se genera con la opción --identify de mkvmerge(1). + +

+ + +

+ La numeración empieza en 1. + +

+ +
track:tn + +

+ Si el parámetro empieza con el carácter t seguido por + n entonces la pista con número + n de un tipo específico de pista será + seleccionada. El parámetro del tipo de pista t debe + ser uno de estos cuatro caracteres: 'a' para una pista de + audio, 'b' para un pista de botón, 's' + para una pista de subtítulo y 'v' para una pista de + video. El orden de pista es el mismo que se genera con la opción + --identify de mkvmerge(1). + +

+ + +

+ La numeración empieza en 1. + +

+ +
track:=uid + +

+ Si el parámetro empieza con un '=' seguido por un número + de uid, se seleccionará la pista cuyo elemento + UID coincida con este uid. Los + UIDs de pista se pueden obtener con mkvinfo(1). + +

+ +
track:@número + +

+ Si el parámetro empieza con un '@' seguido por un + número, se seleccionará la pista cuyo número de + elemento coincida con este número. El número de pista + puede ser obtenido con mkvinfo(1). + +

+ +
+ + + +

3.3. Notas

+ + +

+ Debido a la naturaleza de los selectores de edición de pista es posible que + actualmente algunos selectores coincidan con los mismos encabezados de + pista. En muchos casos, todas las acciones para estos selectores de edición + serán combinados y ejecutados en el orden en el que fueron dadas en la línea + de comandos. + +

+ + +

4. Selectores de adjuntos

+ + + +

+ Un selector de adjuntos se utiliza con las dos acciones --replace-attachment + y --delete-attachment. + Puede tener una de las cuatros formas siguientes: + +

+ + +
    + +
  1. + +

    + Selección mediante el ID de adjunto. De esta forma el selector es un simple + número, el ID del adjunto tal y como se genera con el comando de + identificación de mkvmerge(1). + +

    + +
  2. + + +
  3. + +

    + Selección mediante el UID de adjunto (Único ID). De esta forma el selector + es el signo igual = acompañado por un número, el UID del + adjunto tal y como se genera con el comando de identificación detallado + (verbose) de mkvmerge(1). + +

    + +
  4. + + +
  5. + +

    + Selección mediante el name (nombre) de adjunto. De esta forma el selector es + la palabra literal name: seguida por el nombre del + adjunto. Si el selector es usado con --replace-attachment + entonces los dos puntos que pudiera contener el nombre deberán ser escapados + con \c. + +

    + +
  6. + + +
  7. + +

    + Selección mediante el MIME type (tipo MIME). De esta forma el selector es la + palabra mime-type: seguida por el tipo MIME del + adjunto. Si el selector es usado con --replace-attachment + entonces los dos puntos que pudiera contener el tipo MIME deberán ser + escapados con \c. + +

    + +
  8. + +
+ +

5. Manipulador de idiomas

+ + + +

+ mkvpropedit(1) intenta hacer lo correcto por defecto. Por lo tanto, los + cambios en la propiedad language harán que mkvpropedit(1) + aplique el mismo cambio tanto al nuevo elemento "LanguageIETF" así como al + antiguo elemento "Language" de forma similar a como mkvmerge(1) aplica el + idioma a ambos elementos. Por ejemplo, al utilizar mkvpropedit + movie.mkv --edit track:2 --set language=zh-TW el elemento + "LanguageIETF" se establecerá en zh-TW y el antiguo + elemento "Language" achi. + +

+ + +

+ Además, hay una nueva propiedad de cabecera de pista llamada + language-ietf que se puede establecer o eliminar. Los + cambios en esta propiedad sólo se aplican al nuevo elemento de cabecera de + pista "LanguageIETF". Hay que tener en cuenta que el antiguo elemento de + cabecera de pista "Language" es un elemento obligatorio en Matroska — lo que + significa que, aunque no esté presente en el archivo, tiene un valor + implícito. Cuando el usuario sólo establece la propiedad + language-ietf pero no la propiedad + language, mkvpropedit(1) añadirá el antiguo elemento + "Language" en algunos casos & lo establecerá en und + (que significa "indeterminado") ya que el usuario no especificó un valor + para él. + +

+ + +

Al leer archivos XML de capítulos o etiquetas mkvpropedit(1) funciona como lo + hace mkvmerge(1). +

+ + +

La creación de los nuevos elementos puede desactivarse por completo con la + opción de línea de comandos `--disable-language-ietf`, que actúa sobre los + tres nuevos elementos. +

+ + +

Puedes elegir el método de normalización aplicado a las subetiquetas de + idioma extendidas con el parámetro + --normalize-language-ietf. +

+ +

6. Ejemplos

+ + +

+ El siguiente ejemplo edita un archivo llamado + 'película.mkv'. Establece el título del segmento y + modifica el código de idioma de una pista de audio y subtítulo. Tenga en + cuenta que este ejemplo puede ser acortado al omitir la primera opción --edit ya que + editar el elemento de información del segmento está incluido por defecto + para todas las opciones encontradas antes de la primera opción --edit. + +

+ +
mkvpropedit película.mkv --edit info --set "title=La película" --edit track:a1 --set language=spa --edit track:a2 --set language=eng
+ +

+ El segundo ejemplo elimina 'flag de pista predefinida' de la primera pista + de subtítulo y la establece para la segunda. Tenga en cuenta que + mkvpropedit(1), a diferencia de mkvmerge(1), no establece automáticamente a + '0' el valor de 'flag de pista predefinida' cuando otra pista se ha + establecido a '1'. + +

+ +
mkvpropedit película.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ Reemplaza las etiquetas para la segunda pista de subtítulos de un archivo: + +

+ +
mkvpropedit película.mkv --tags track:s2:nuevas-etiquetas-subtítulo.xml
+ +

+ Elimina todas las etiquetas que hay en el archivo: + +

+ +
mkvpropedit película.mkv --tags all: 
+ +

+ Reemplaza los capítulos en un archivo: + +

+ +
mkvpropedit película.mkv --chapters nuevos-capítulos.xml
+ +

+ Elimina todos los capítulos del archivo: + +

+ +
mkvpropedit película.mkv --chapters ""
+ +

+ Añade un archivo de tipo fuente (Arial.ttf) como un + adjunto: + +

+ +
mkvpropedit película.mkv --add-attachment Arial.ttf
+ +

+ Añade un archivo de tipo fuente (89719823.ttf) como un + adjunto y proporciona información de como es la fuente Arial: + +

+ +
mkvpropedit película.mkv --attachment-name Arial.ttf --attachment-description "La fuente Arial como TrueType" 
+--attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ Reemplaza el archivo adjunto (Comic.ttf) del archivo por + otro (Arial.ttf): + +

+ +
mkvpropedit película.mkv --attachment-name Arial.ttf --attachment-description "La fuente Arial como TrueType"
+--replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ Elimina el segundo archivo adjunto: + +

+ +
mkvpropedit película.mkv --delete-attachment 2
+ +

+ Elimina todos las fuentes adjuntas por tipo MIME: + +

+ +
mkvpropedit película.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. Códigos de salida

+ + + +

+ Mkvpropedit(1) finaliza con uno de estos tres códigos de salida: + +

+ + +
    + +
  • + +

    + 0 -- Este código de salida significa que la + modificación se ha realizado correctamente. + +

    + +
  • + + +
  • + +

    + 1 -- En este caso mkvpropedit(1) genera una salida con + al menos una advertencia, pero la extracción continuó. Una advertencia es + prefijada con el texto 'Advertencia:'. Dependiendo de los + fallos involucrados los archivos creados serán correctos o no. El usuario es + instado a que revise tanto las advertencias como los archivos creados. + +

    + +
  • + + +
  • + +

    + 2 -- Este código de salida es usado después de que + ocurra un error. mkvpropedit(1) aborta el proceso justo después de mostrar el + mensaje de error. El rango de los mensajes de error va desde los argumentos + de la línea de comandos, por delante de los errores de lectura/escritura, + hasta los archivos erróneos. + +

    + +
  • + +
+ +

8. Conversión de archivos de texto y conjunto de caracteres

+ + + +

+ Para una discusión en profundidad sobre como la suite de MkvToolNix manipula + las conversiones de caracteres, la codificación entrada/salida y la + codificación de la línea de comandos y consola, por favor consulte la + sección llamada de igual manera en la pagina del manual para mkvmerge(1). + +

+ +

9. Variables de entorno

+ + + +

+ mkvpropedit(1) usa las variables predefinidas que se determinan en la + configuración local del sistema (p.e. LANG y la familia + LC_*). Variables adicionales: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG y + su forma abreviada MTX_DEBUG + +

El contenido se trata como si se hubiese pasado a través de la opción --debug. +

+ +
MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE + y su forma abreviada MTX_ENGAGE + +

El contenido se trata como si se hubiese pasado a través de la opción --engage. +

+ +
+ +

10. Vea también

+ + +

+ mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1) + +

+ +

11. WWW

+ + +

+ La última versión se puede encontrar siempre en la página de MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..c4d7dcd15dc913c63c77795cce55dadf015af61c --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/es/mkvtoolnix-gui.html @@ -0,0 +1,168 @@ + + + + + mkvtoolnix-gui -- una GUI para mkvmerge1 incluyendo un capítulo y editor de encabezado + + + +
mkvtoolnix-gui -- una GUI para mkvmerge(1) incluyendo un capítulo y editor de encabezado +
+
+
+

Table of contents

+ +
+
+

1. Sinopsis

+ + +
mkvtoolnix-gui [[archivo-configuración.mtxcfg] | [archivo-origen.ext] | [archivo-matroska.mkv] | [archivo-capítulos.ext] | [archivo-matroska.mkv]] +
+ +

2. Descripción

+ + +

+ mkvtoolnix-gui(1) es una GUI, basada en + Qt(tm), para mkvmerge(1). También tiene implementadas + las funcionalidades mkvinfo(1) y mkvpropedit(1) y evolucionará hasta cubrir + mkvextract(1). Todos los ajustes (p.e. archivos fuente, opciones de pista, + etc) pueden ser guardados y restaurados. + +

+ + +

+ Listar los archivos de configuración con la extensión + .mtxcfg provoca que la GUI cargue esos archivos de + configuración en la herramienta adecuada. Cualquier otro nombre de archivo + de configuración se añade como fuente para el multiplexado, o se abre en la + herramienta de información, el editor de capítulos o cabeceras, dependiendo + del modo actual. El modo actual se puede cambiar con + --merge, --info, + --edit-chapters o --edit-headers.. El modo + por defecto es añadir archivos para multiplexar. + +

+ + +

+ Tenga en cuenta que si una instancia de la aplicación ya se está ejecutando + cuando la aplicación se inicia por segunda vez, todos los nombres de los + archivos dados en la línea de comandos serán gestionados por la instancia + que se encuentra en ejecución. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

Todos los siguientes nombres de archivos serán añadidos como fuente de + archivos a la actual tarea de multiplexado. Este es el modo por defecto. +

+ +
--info + +

Los siguientes nombres de archivo serán abiertos en la herramienta de + información. +

+ +

Además, la herramienta de información será seleccionada al inicio en vez de + la herramienta de multiplexado. +

+ +
--edit-chapters + +

Los posteriores archivos de configuración serán abiertos en el editor de + capítulos. +

+ +

Además, el editor de capítulos será seleccionado al inicio en vez de la + herramienta de multiplexado. +

+ +
--edit-headers + +

Los posteriores archivos de configuración serán abiertos en el editor de + cabeceras. +

+ +

Además, el editor de cabecera será seleccionado al inicio en vez de la + herramienta de multiplexado. +

+ +
-h, --help + +

+ Muestra información de uso y sale. + +

+ +
-V, --version + +

+ Muestra la información de la versión y sale. + +

+ +
+ +

3. Vea también

+ + +

+ mkvmerge(1), mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. WWW

+ + +

+ La última versión se puede encontrar siempre en la página de MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..acd4158e59d180f17ba43b0d563749c2d67e8fa7 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvextract.html @@ -0,0 +1,1357 @@ + + + + + mkvextract -- extrait les pistes d'un fichier Matroska vers d'autres fichiers + + + +
mkvextract -- extrait les pistes d'un fichier Matroska(tm) vers d'autres fichiers +
+
+ +
+

1. Résumé

+ + +
mkvextract {source-filename} {mode1} options extraction-spec1 mode2 options extraction-spec2 … +
+ +

2. Description

+ + +

+ Ce logiciel extrait des parties spécifiques d'un fichier Matroska(tm) vers + d'autres formats utiles. Le premier argument est le nom du fichier source + qui doit être un fichier Matroska(tm). + +

+ + +

+ Tous les autres arguments soit basculent vers un mode d'extraction + particulier, soit modifient des options pour le mode en cours, soit + spécifient quoi extraire vers quel fichier. Plusieurs modes peuvent être + utilisés en même temps en invoquant mkvextract, ce qui permet d'extraire + plusieurs choses en une seule passe. La plupart des options peuvent + seulement être utilisées dans certains modes, avec quelques options qui + s'appliquent à tous les modes. + +

+ + +

+ Est actuellement prise en charge l'extraction des pistes, balises, pièces jointes, chapitres, feuilles de montage CUE, + horodatages et + points de montage. + +

+ + +

2.1. Options communes

+ + + +

+ Les options suivantes sont disponibles pour tous les modes et sont seulement + décrites une seule fois dans cette section. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ Définit le mode d'analyse à « complet ». Le mode par défaut n'analyse pas + entièrement le fichier nais utilise les méta-éléments de recherche pour + localiser les éléments requis d'un fichier source. Dans la grand majorité + des cas, cela est suffisant. Mais pour les fichiers qui ne contiennent pas + ces méta-éléments ou qui sont endommagés, l'utilisateur pourrait utiliser ce + mode. L'analyse complète d'un fichier peut prendre plusieurs minutes tandis + qu'une analyse rapide ne prend que quelques secondes. + +

+ +
--command-line-charset character-set + +

+ Définit le jeu de caractères utilisé pour la conversion des chaînes fournies + en ligne de commande. Par défaut, celui-ci correspond à celui donné par la + « locale » du système. + +

+ +
--output-charset character-set + +

+ Définit le jeu de caractères dans lequel les chaînes en sortie sont + converties. Par défaut, celui-ci correspond à celui donné par la « locale » + du système. + +

+ +
-r, --redirect-output + file-name + +

+ Écrit tous les messages dans le fichier file-name + plutôt que vers la console. Alors que cela peut être facilement fait avec la + redirection de la sortie, il y a des cas pour lesquels cette option est + nécessaire : quand le terminal réinterprète la sortie avant de l'écrire dans + un fichier. Le jeu de caractères défini avec --output-charset + est honoré. + +

+ +
--flush-on-close + +

+ Indique au programme d'envoyer toutes les données cachées en mémoire vers le + support de stockage lors de la fermeture de fichiers ouverts en + écriture. Ceci peut être utilisé pour éviter la perte de données lors de + coupures de courant ou pour contourner certains problèmes du système + d'exploitation ou de pilotes. L'inconvénient est que le multiplexage sera + plus long du fait que mkvmerge devra attendre que toutes les données soient + écrites sur le support de stockage avant de quitter. Voir les problèmes + #2469 et #2480 sur le suivi des bogues de MKVToolNix pour des discussions + approfondies sur les avantages et inconvénients. + +

+ +
--ui-language code + +

+ Force les traductions pour la langue code à utiliser + (par ex. 'fr_FR' pour les traductions françaises). Saisir + 'list' comme code obligera le + logiciel à générer la liste des traductions disponibles. + +

+ +
--abort-on-warnings + +

+ Demande au programme d'abandonner après le premier avertissement. Le code de + fermeture sera égal à 1. + +

+ +
--debug topic + +

+ Activer le débogage pour une fonctionnalité spécifique. Cette option est + utile uniquement pour les développeurs. + +

+ +
--engage feature + +

+ Active les fonctionnalités expérimentales. Une liste des fonctions + disponibles peut être demandée avec mkvextract --engage + list. Ces fonctionnalités ne devraient pas être utilisées en + situations normales. + +

+ +
--gui-mode + +

+ Active l'interface graphique utilisateur. Dans ce mode, des lignes + spécialement formatées peuvent être générées et informer une GUI de la + situation. Ces messages suivent le format + '#GUI#message'. Le message peut être suivi d'une paire + clé/valeur comme + '#GUI#message#key1=value1#key2=value2…'. Ni les messages + ni les clés ne sont traduits, et sont toujours générés en anglais. + +

+ +
-v, --verbose + +

+ Mode verbeux qui affiche tous les éléments Matroska(tm) importants à mesure + qu'ils sont lus. + +

+ +
-h, --help + +

+ Affiche les informations d'utilisation et quitte. + +

+ +
-V, --version + +

+ Affiche les informations de version et quitte. + +

+ +
@options-file.json + +

+ Lit des arguments supplémentaires en ligne de commande depuis le fichier + options-file. Pour une explication complète sur les + formats pris en charge pour de tels fichiers, voir la section nommée « + Fichiers d'options » sur la page man de mkvmerge(1). + +

+ +
+ + + +

2.2. Mode d'extraction des pistes

+ + + +

+ Syntaxe : mkvextract source-filename + tracks [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + +

+ Les options de ligne de commande suivantes sont disponibles pour chaque + piste en mode d'extraction de 'tracks'. Elles doivent + apparaître avant les spécifications de piste (voir ci-dessous) auxquelles + elles devraient s'appliquer. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c character-set + +

+ Définit le jeu caractère pour en convertir la prochaine piste de texte de + sous-titres. Seulement valide si l'ID de la nouvelle piste est une piste de + texte de sous-titres. Par défaut UTF-8. + +

+ +
--blockadd niveau + +

+ Conserve seulement les BlockAdditions jusqu'à ce niveau. Par défaut, tous + les niveaux. Cette option affecte seulement certains types de codecs comme + WAVPACK4. + +

+ +
--cuesheet + +

+ Oblige mkvextract(1) à extraire une feuille de montage CUE + à partir des données de balises et des informations de chapitres pour la + piste suivante dans le fichier dont le nom est le nom de piste cible terminé + par « .cue ». + +

+ +
--raw + +

+ Extrait les données brutes dans un fichier sans conteneur de données. À la + différence de l'indicateur --fullraw, + cet indicateur n'oblige pas les contenus de l'élément + CodecPrivate à être écrits vers le fichier. Ce mode + fonctionne avec tous les CodecIDs, même ceux que + mkvextract(1) ne prend pas en charge, mais les fichiers résultants pourraient + ne pas être utilisables. + +

+ +
--fullraw + +

+ Extrait les données brutes dans un fichier sans conteneur de données. Les + contenus de l'élément CodecPrivate seront écrits vers + le fichier en premier si la piste contient un tel élément d'entête. Ce mode + fonctionne avec tous les CodecIDs, même ceux que + mkvextract(1) ne prend pas en charge, mais les fichiers résultants pourraient + ne pas être utilisables. + +

+ +
TID:outname + +

+ Oblige l'extraction de la piste avec l'ID TID dans le + fichier outname si une telle piste existe dans le + fichier source. Cette option peut être donnée plusieurs fois. Les ID de + pistes sont les mêmes que celles données par l'option + --identify de mkvmerge(1). + +

+ + +

+ Chaque nom cible devrait n'être utilisé qu'une seule fois, à l'exception des + pistes RealAudio et RealVideo. Si le même nom est utilisé pour différentes + pistes, alors ces pistes seront enregistrées dans le même fichier. Exemple : + +

+ +
$ mkvextract input.mkv tracks 0:video.h264 2:output-two-vobsub-tracks.idx 3:output-two-vobsub-tracks.idx
+
+ + + +

2.3. Mode d'extraction des pièces jointes

+ + + +

+ Syntaxe : mkvextract source-filename + attachments + [options] + AID1:outname1 + [AID2:outname2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:outname + +

+ Oblige l'extraction de la pièce jointe avec l'ID AID + dans le fichier outname si une telle pièce jointe + existe dans le fichier source. Si outname est laissé + vide, alors le nom de la pièce jointe du fichier source Matroska(tm) est + utilisé. Cette option peut être donnée plusieurs fois. Les ID de pistes sont + les mêmes que celles données par l'option --identifyde + mkvmerge(1). + +

+ +
+ + + +

2.4. Mode d'extraction des chapitres

+ + + +

+ Syntaxe : mkvextract source-filename + chapters + [options] + output-filename.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ Exporte les informations de chapitres dans un format simple utilisé dans + l'outil OGM (CHAPTER01=..., CHAPTER01NAME=...). Dans ce + mode quelques information doivent être mises de côté. Par défaut, les + chapitres sont générés en format XML. + +

+ +
--simple-language langue + +

+ Si le format simple est activé, alors mkvextract(1) sortira seulement une + entrée unique pour chaque atome de chapitre rencontré même si un atome de + chapitre contient plus d'un nom de chapitre. Par défaut mkvextract(1) + utilisera le premier nom de chapitre trouvé pour chaque atome quelque soit + sa langue. + +

+ + +

+ Utiliser cette option permet à l'utilisateur de déterminer quels noms de + chapitres sont sortis si les atomes contiennent plus d'un nom de chapitre. + Le paramètre language doit être un code ISO 639-1 ou + ISO 639-2. + +

+ +
+ + +

+ Les chapitres sont écrits vers le fichier spécifié. Par défaut le format + XML compris par mkvmerge(1) est utilisé. Si aucun chapitre n'est trouvé + dans le fichier, le fichier source n'est pas créé. + +

+ + + +

2.5. Mode d'extraction des balises

+ + + +

+ Syntaxe : mkvextract source-filename + tags [options] + output-filename.xml + +

+ + +

+ Les balises sont écrites vers le fichier spécifié dans le format XML + compris par mkvmerge(1). Si aucune balise n'est trouvée dans le fichier, le + fichier source n'est pas créé. + +

+ + + +

2.6. Mode d'extraction de feuille de montage CUE

+ + + +

+ Syntaxe : mkvextract source-filename + cuesheet + [options] + output-filename.cue + +

+ + +

+ La feuille de montage est écrite vers le fichier spécifié. Si aucun chapitre + ou balise n'est trouvé dans le fichier, le fichier source n'est pas créé. + +

+ + + +

2.7. Mode d'extraction d'horodatage

+ + + +

+ Syntaxe : mkvextract source-filename + timestamps_v2 + [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:outname + +

+ Oblige l'extraction des horodatages pour la piste avec l'ID + TID dans le fichier outnamesi + une telle piste existe dans le fichier source. Cette option peut être donnée + plusieurs fois. Les ID de pistes sont les mêmes que celles données par + l'option --identify de mkvmerge(1). + +

+ + +

+ Exemple : + +

+ +
$ mkvextract input.mkv timestamps_v2 1:ts-track1.txt 2:ts-track2.txt
+
+ + + +

2.8. Mode d'extraction des feuilles de montage CUE

+ + + +

+ Syntaxe : mkvextract source-filename + cues [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:dest-filename + +

+ Oblige l'extraction des données de montage pour la piste avec l'ID + TID dans le fichier outname si + une telle piste existe dans le fichier source. Cette option peut être donnée + plusieurs fois. Les ID de pistes sont les mêmes que celles données par + l'option --identify de mkvmerge(1) et ne sont pas les + numéros contenus dans l'élément CueTrack. + +

+ +
+ + +

+ Le format de sortie est un simple format texte : une ligne par élément + CuePoint avec des pairs + key=value. Si un élément optionnel n'est pas présent dans + un CuePoint (par + ex. CueDuration), alors un tiret sera inscrit comme + valeur. + +

+ + +

+ Exemple : + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

Les clés possibles sont :

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
horodatage + +

L'horodatage du point de montage en précision nanoseconde. Le format est + HH:MM:SS.nnnnnnnnn. Cet élément est toujours défini. +

+ +
durée + +

La durée du point de montage en précision nanoseconde. Le format est + HH:MM:SS.nnnnnnnnn. +

+ +
cluster_position + +

La position absolue en octets dans le fichier Matroska(tm) où la grappe + contenant l'élément référencé commence. +

+ + +
+

Note:

+ +

Dans un fichier Matroska(tm) CueClusterPosition est + relatif au décalage du début des données de l'élément. Toutefois, la valeur + fournie par le mode d'extraction de données de montage de mkvextract(1) + contient déjà ce décalage et est un décalage absolu depuis le début du + fichier. +

+ +
+ +
relative_position + +

La position relative en octets dans la grappe où l'élément + BlockGroup ou SimpleBlock + auquel le point de montage se réfère commence. +

+ + +
+

Note:

+ +

Dans un fichier Matroska(tm) 1CueRelativePosition1 est relatif au décalage du + début des données de la grappe. Toutefois, la valeur fournie par le mode + d'extraction de données de montage de mkvextract(1) est relative à l'ID de la + grappe. La position absolue dans le fichier peut être calculée en ajoutant + cluster_position et relative_position. +

+ +
+ +
+ + +

+ Exemple : + +

+ +
$ mkvextract input.mkv cues 1:cues-track1.txt 2:cues-track2.txt
+ +

3. Exemples

+ + + +

+ Extraction de chapitres et balises dans leur formats XML respectifs en + même temps : + +

+ +
$ mkvextract movie.mkv chapters movie-chapters.xml tags movie-tags.xml
+ +

+ Extraction de quelques piste et leurs horodatages respectifs en même temps : + +

+ +
$ mkvextract "Un autre film.mkv" tracks 0:video.h265 "1:piste audio principale.aac" "2:commentaires du réalisateur.aac" timestamps_v2 "0:horodatages vidéo.txt" "1:horodatages piste audio principale.txt" "2:horodatages des commentaires du réalisateur.txt"
+ +

+ Extraction de chapitres dans le format Ogg/OGM et réencodage d'unepiste de + sous-titre texte dans un autre jeu de caractère : + +

+ +
$ mkvextract "Mon film.mkv" chapters --simple "Mes chapitres.txt" tracks -c MS-ANSI "2:Mes sous-titres.srt"
+

4. Fichiers texte et conversions de jeux de caractères

+ + + +

+ Pour une discussion approfondie sur la gestion des conversions de jeux de + caractères des outils de la suite MKVToolNix, de l'encodage source/cible, de + l'encodage de la ligne de commande, de l'encodage de la console, merci de + voir les sections respectives nommées pareillement des pages man de + mkvmerge(1). + +

+ +

5. Formats de fichier cible

+ + + +

+ La décision sur le format de sortie est basée sur le type de piste et non + sur l'extension utilisée pour le nom de fichier cible. Les types de pistes + suivantes sont prises en charge pour le moment : + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ Tous les fichiers AAC seront écrits dans un fichier + AAC avec des entêtes ADTS avant chaque + paquet. Les entêtes ADTS ne contiendront pas le champ + emphase obsolète. + +

+ +
A_AC3, A_EAC3 + +

+ Celles-ci seront extraites en fichiers bruts AC-3. + +

+ +
A_ALAC + +

+ Les pistes ALAC sont écrites en fichiers + CAF. + +

+ +
A_DTS + +

+ Celles-ci seront extraites en fichiers bruts DTS. + +

+ +
A_FLAC + +

+ Les pistes FLAC sont écrits en fichiers RAW + FLAC. + +

+ +
A_MPEG/L2 + +

+ Les flux MPEG-1 Audio Layer II seront extraits vers des fichiers raw + MP2. + +

+ +
A_MPEG/L3 + +

+ Celles-ci seront extraites en fichiers bruts MP3. + +

+ +
A_OPUS + +

+ Les pistes Opus(tm) sont écrites en fichiers + OggOpus(tm). + +

+ +
A_PCM/INT/LIT, A_PCM/INT/BIG + +

+ Les données brutes PCM seront écrites en fichier + WAV. Le données Big-endian entier seront converties en + données little-endian ce faisant. + +

+ +
A_REAL/* + +

+ Les pistes RealAudio(tm) sont écrites en fichiers + RealMedia(tm). + +

+ +
A_TRUEHD, A_MLP + +

+ Celles-ci seront extraites en fichiers bruts + TrueHD/MLP. + +

+ +
A_TTA1 + +

+ Les pistes TrueAudio(tm) sont écrites en fichiers + TTA. Merci de noter que du fait de la précision limitée de + l'horodatage Matroska(tm), l'entête extraite du fichier sera différente pour + ces deux champs : data_length (le nombre total + d'échantillons du fichier) et CRC. + +

+ +
A_VORBIS + +

+ Vorbis audio va être écrit dans un fichier OggVorbis(tm) . + +

+ +
A_WAVPACK4 + +

+ Les pistes WavPack(tm) sont écrites en fichiers + WV. + +

+ +
S_HDMV/PGS + +

+ Les sous-titres PGS seront écrits en fichiers + SUP. + +

+ +
S_HDMV/TEXTST + +

+ Les sous-titres TextST seront écrits en format de fichier + spécial inventé pour mkvmerge(1) et mkvextract(1). + +

+ +
S_KATE + +

+ Les flux Kate(tm) seront écrits en conteneur + Ogg(tm). + +

+ +
S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS + +

+ Les sous-titres texte SSA et ASS seront + respectivement écrits comme fichiers + SSA/ASS. + +

+ +
S_TEXT/UTF8, S_TEXT/ASCII + +

+ Les sous-titres texte simple seront écrits comme fichiers + SRT. + +

+ +
S_VOBSUB + +

+ Les sous-titres texte VobSub(tm) seront écrits comme + fichiers SUB avec les fichiers d'index respectifs, comme + fichiers IDX. + +

+ +
S_TEXT/USF + +

+ Les sous-titres texte USF seront écrits comme fichiers + USF. + +

+ +
S_TEXT/WEBVTT + +

+ Les sous-titres texte WebVTT seront écrits comme fichiers + WebVTT. + +

+ +
V_MPEG1, V_MPEG2 + +

+ Les pistes vidéo MPEG-1 and MPEG-2 seront + écrites comme flux élémentaires MPEG. + +

+ +
V_MPEG4/ISO/AVC + +

+ Les pistes vidéoH.264 / AVC sont écrites + comme flux élémentaires H.264 qui peuvent être post-traités + avec par ex. MP4Box(tm) du paquet + GPAC(tm). + +

+ +
V_MPEG4/ISO/HEVC + +

+ Les pistes vidéoH.265 / HEVC sont écrites + comme flux élémentaires H.265 qui peuvent être post-traités + avec par ex. MP4Box(tm) du paquet + GPAC(tm). + +

+ +
V_MS/VFW/FOURCC + +

+ Les pistes vidéo à FPS constant avec ce + CodecID sont écrites en fichiers + AVI. + +

+ +
V_REAL/* + +

+ Les pistes RealVideo(tm) sont écrites en fichiers + RealMedia(tm). + +

+ +
V_THEORA + +

+ Les flux Theora(tm) seront écrites en conteneur + Ogg(tm) + +

+ +
V_VP8, V_VP9 + +

+ VP8 / VP9 pistes sont écrites pour + IVF fichiers. + +

+ +
Balises + +

+ Les balises sont converties en format XML. Ce format est le même que + mkvmerge(1) gère en lecture. + +

+ +
Pièces jointes + +

+ Les pièces jointes sont écrites dans le fichier de sortie telles + quelles. Aucune conversion n'est effectuée. + +

+ +
Chapitres + +

+ Les chapitres sont convertis en format XML. Ce format est le même que + mkvmerge(1) gère pour lire les chapitres. Autrement une version dépouillée + peut être produite dans le format simple OGM. + +

+ +
Horodatages + +

+ Les codes temporels sont d'abord triés puis produits en fichier conforme + avec le format de code temporel v2 prêt à être envoyé à + mkvmerge(1). L'extraction vers d'autres formats (v1, v3 et v4) n'est pas + prise en charge. + +

+ +
+ +

6. Codes de fermeture

+ + + +

+ mkvextract(1) ferme avec l'un de ces 3 codes de fermeture : + +

+ + +
    + +
  • + +

    + 0 -- Ce code de sortie signifie que l'extraction s'est + correctement terminée. + +

    + +
  • + + +
  • + +

    + 1 -- Dans ce cas mkvpropedit(1) a émis au moins un + avertissement, mais la modification a continué. Un avertissement est préfixé + avec le texte 'Avertissement :'. Selon le problème, les + fichiers résultants pourront être OK ou pas. L'utilisateur est vivement + conseillé de vérifier et l'avertissement et les fichiers résultants. + +

    + +
  • + + +
  • + +

    + 2 -- Ce code de fermeture est utilisé lorsqu'une erreur + survient. mkvpropedit(1) abandonne juste après le message d'erreur. Les + messages d'erreurs vont des arguments erronés en ligne de commande aux + fichiers corrompus en passant par les erreurs en lecture/écriture. + +

    + +
  • + +
+ +

7. Variables d'environment

+ + + +

+ mkvmerge(1) utilise les variables par défaut qui déterminent la « locale » du + système (par ex. LANG et la famille + LC_*). Variables additionnelles : + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG et + sa forme courte MTX_DEBUG + +

Le contenu est traité comme s'il a été passé via l'option --debug. +

+ +
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE + et sa forme courte MTX_ENGAGE + +

Le contenu est traité comme s'il a été passé via l'option--engage. +

+ +
+ +

8. Voir aussi

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. WWW

+ + +

+ La dernière version peut toujours être trouvée à la page d'accueil de MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..bc6162933c65d9b63c58cf5eb010904f127535b5 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvinfo.html @@ -0,0 +1,520 @@ + + + + + mkvinfo -- Affiche des informations au sujet des éléments dans les fichiers Matroska + + + +
mkvinfo -- Affiche des informations au sujet des éléments dans les fichiers Matroska(tm)
+
+ +
+

1. Résumé

+ + +
mkvinfo options {source-filename} +
+ +

2. Description

+ + +

+ Ce logiciel liste tous les éléments contenus dans un Matroska(tm). La sortie + peut être limitée à une liste de pistes dans le fichier incluant des + informations sur les codecs utilisés. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ Par défaut mkvinfo(1) s'arrête quand il rencontre la première grappe. De plus + il n'affichera pas certains éléments répétitifs. Avec cette option mkvinfo(1) + continue l'exécution quel que soit le niveau de verbosité et affiche tous + les éléments. + +

+ +
-c, --checksums + +

+ Calcule et affiche la somme de contrôle Adler-32 pour + chaque trame. Seulement utile pour déboguer. + +

+ +
-o, --continue + +

+ Par défaut mkvinfo(1) s'arrête quand il rencontre la première grappe. Avec + cette option mkvinfo(1) continue l'exécution quel que soit le niveau de + verbosité. + +

+ +
-p, --hex-positions + +

+ Afficher les positions de tous les éléments en hexadécimal quelle que soit + la verbosité. + +

+ +
-P, --positions + +

+ Afficher les positions de tous les éléments en décimal quelle que soit la + verbosité. + +

+ +
-s, --summary + +

+ Affiche seulement un résumé succinct de ce que mkvinfo(1) trouve, et pas + chaque élément. + +

+ +
-t, --track-info + +

+ Affiche les statistiques de chaque piste en mode verbeux. Définit aussi la + verbosité à 1 si elle était au niveau 0 avant. + +

+ +
-x, --hexdump + +

+ Affiche les 16 premiers octets de chaque trame en hexadécimal. + +

+ +
-X, --full-hexdump + +

+ Affiche tous les octets de chaque trame en hexadécimal. + +

+ +
-z, --size + +

+ Affiche la taille de chaque élément y compris son entête. + +

+ +
--command-line-charset character-set + +

+ Définit le jeu de caractères utilisé pour la conversion des chaînes fournies + en ligne de commande. Par défaut, celui-ci correspond à celui donné par la + « locale » du système. + +

+ +
--output-charset character-set + +

+ Définit le jeu de caractères dans lequel les chaînes en sortie sont + converties. Par défaut, celui-ci correspond à celui donné par la « locale » + du système. + +

+ +
-r, --redirect-output + file-name + +

+ Écrit tous les messages dans le fichier file-name + plutôt que vers la console. Alors que cela peut être facilement fait avec la + redirection de la sortie, il y a des cas pour lesquels cette option est + nécessaire : quand le terminal réinterprète la sortie avant de l'écrire dans + un fichier. Le jeu de caractères défini avec --output-charset + est honoré. + +

+ +
--ui-language code + +

+ Force les traductions pour la langue code à utiliser + (par ex. 'fr_FR' pour les traductions françaises). Saisir + 'list' comme code obligera le + logiciel à générer la liste des traductions disponibles. + +

+ +
--abort-on-warnings + +

+ Demande au programme d'abandonner après le premier avertissement. Le code de + fermeture sera égal à 1. + +

+ +
--debug topic + +

+ Activer le débogage pour une fonctionnalité spécifique. Cette option est + utile uniquement pour les développeurs. + +

+ +
--engage feature + +

+ Active les fonctionnalités expérimentales. Une liste des fonctions + disponibles peut être demandée avec mkvinfo --engage + list. Ces fonctionnalités ne devraient pas être utilisées en + situations normales. + +

+ +
--gui-mode + +

+ Active l'interface graphique utilisateur. Dans ce mode, des lignes + spécialement formatées peuvent être générées et informer une GUI de la + situation. Ces messages suivent le format + '#GUI#message'. Le message peut être suivi d'une paire + clé/valeur comme + '#GUI#message#key1=value1#key2=value2…'. Ni les messages + ni les clés ne sont traduits, et sont toujours générés en anglais. + +

+ +
-v, --verbose + +

+ Plus de verbosité. Voir la section sur les niveaux de verbosité pour une + description des informations fournies par niveaux. + +

+ +
-h, --help + +

+ Affiche les informations d'utilisation et quitte. + +

+ +
-V, --version + +

+ Affiche les informations de version et quitte. + +

+ +
@options-file.json + +

+ Lit des arguments supplémentaires en ligne de commande depuis le fichier + options-file. Pour une explication complète sur les + formats pris en charge pour de tels fichiers, voir la section nommée « + Fichiers d'options » sur la page man de mkvmerge(1). + +

+ +
+ +

3. Niveaux de verbosité

+ + + +

+ L'option -v peut être + utilisée pour augmenter le niveau de verbosité de mkvinfo(1) et imprimer plus + d'informations sur le fichier actuel. + +

+ + +

+ Au niveau 0 mkvinfo(1) imprimera seulement les entêtes de piste qu'il trouve + et leurs types. mkvinfo(1) quittera dès que les entêtes sont totalement + analysées (techniquement dès que la première grappe est rencontrée). Dans ce + niveau, les entrées de positionnement de tête et les entrées de montage ne + sont pas affichées -- même si elles sont situées devant les informations de + piste. + +

+ + +

+ Au niveau 1 mkvinfo(1) imprimera aussi tous les éléments Matroska(tm) + rencontrés du fichier entier sauf les entrées de positionnement de tête et + les entrées de montage. Si le mode résumé est activé, alors mkvinfo(1) + générera aussi la position de trame. + +

+ + +

+ Le même effet peut être obtenu avec l'option --continue. + +

+ + +

+ Au niveau 2 mkvinfo(1) imprimera aussi les entrées de positionnement de tête, + les entrées de montage et la position du fichier à laquelle chaque élément + Matroska(tm) peut être trouvé. + +

+ + +

+ Le même effet peut être obtenu avec les options --all + --positions. + +

+ + +

+ Au niveau 3 et + mkvinfo(1) imprimera quelques informations non directement + reliées à un élément Matroska(tm). Tous les autres éléments imprimeront des + choses sur les éléments venant juste d'être trouvés. Le niveau 3 ajoute des + métadonnées pour faciliter le débogage (lire : il est seulement prévu pour + les développeurs). Toutes les lignes écrites au niveau 3 sont entourées de + crochets pour faciliter leur filtrage. + +

+ +

4. Fichiers texte et conversions de jeux de caractères

+ + + +

+ Pour une discussion approfondie sur la gestion des conversions de jeux de + caractères des outils de la suite MKVToolNix, de l'encodage source/cible, de + l'encodage de la ligne de commande, de l'encodage de la console, merci de + voir les sections respectives nommées pareillement des pages man de + mkvmerge(1). + +

+ +

5. Codes de fermeture

+ + + +

+ mkvinfo(1) ferme avec l'un de ces trois codes de fermeture : + +

+ + +
    + +
  • + +

    + 0 -- Ce code de sortie signifie que l'exécution s'est + correctement terminée. + +

    + +
  • + + +
  • + +

    + 1 -- Dans ce cas mkvpropedit(1) a émis au moins un + avertissement, mais l'exécution a continué. Un avertissement est préfixé + avec le texte 'Avertissement :'. + +

    + +
  • + + +
  • + +

    + 2 -- Ce code de fermeture est utilisé lorsqu'une erreur + survient. mkvpropedit(1) abandonne juste après le message d'erreur. Les + messages d'erreurs vont des arguments erronés en ligne de commande aux + fichiers défectueux en passant par les erreurs en lecture/écriture. + +

    + +
  • + +
+ +

6. Variables d'environment

+ + + +

+ mkvmerge(1) utilise les variables par défaut qui déterminent la « locale » du + système (par ex. LANG et la famille + LC_*). Variables additionnelles : + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUG, MKVTOOLNIX_DEBUG et sa + forme courte MTX_DEBUG + +

Le contenu est traité comme s'il a été passé via l'option --debug. +

+ +
MKVINFO_ENGAGE, MKVTOOLNIX_ENGAGE et + sa forme courte MTX_ENGAGE + +

Le contenu est traité comme s'il a été passé via l'option --engage. +

+ +
+ +

7. Voir aussi

+ + +

+ mkvmerge(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. WWW

+ + +

+ La dernière version peut toujours être trouvée à la page d'accueil de MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..76af44ba2d77a1f0265a94735ac6f2b10b7062ea --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvmerge.html @@ -0,0 +1,5368 @@ + + + + + mkvmerge -- Fusionne les flux multimédia en un fichier Matroska + + + +
mkvmerge -- Fusionne les flux multimédia en un fichier Matroska(tm)
+
+ +
+

1. Résumé

+ + +
mkvmerge global options {-o + out} options1 {file1} options2 {file2} @options-file.json +
+ +

2. Description

+ + +

+ Ce logiciel prend les entrées de plusieurs fichiers de médias et joint leurs + flux (tous ou une sélection) dans un fichier Matroska(tm) ; voir le site Web Matroska. + +

+ + +
+

Important:

+ +

+ L'ordre des options en ligne de commande est important. Les nouveaux + utilisateurs devraient lire la section "Ordre des options" . + +

+ +
+ + +

2.1. Options globales

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

Augmente la verbosité.

+ +
-q, --quiet + +

Supprime les messages d'état.

+ +
-o, --output + file-name + +

Écrit vers le fichier file-name. Si la scission est + utilisée, alors ce paramètre est traité un peu différemment. Voir + l'explication pour l'option --split pour + les détails. +

+ +
-w, --webm + +

Crée un fichier conforme WebM. C'est aussi activé si l'extension du nom de + fichier cible est "webm". Ce mode impose plusieurs + restrictions. Les seuls codecs permis sont VP8, VP9 pour la vidéo et les + pistes audio Opus, Vorbis. L'élément d'entête DocType est modifié en + "webm". + +

+ + +

+ Pour les chapitres et les balises, seule une partie des éléments est + permise. mkvmerge(1) retirera automatiquement tous les éléments non permis + par la spécification. + +

+ +
--title titre + +

Définit le titre général pour le fichier cible, par ex. le nom du film.

+ +
--default-language language-code + +

Définit le code langue par défaut qui sera utilisé pour les pistes pour + lesquelles aucune langue n'est définie avec l'option --language + et pour lesquelles le conteneur source ne fournit pas de langue. +

+ + +

Le code de langue par défaut pour « undetermined » est + « und ». +

+ +
+ + + +

2.2. Gestion des infos de segments (options globales)

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo filename.xml + +

+ Lit les informations de segment depuis un fichier XML. Ce + fichier peut contenir l'UID de famille de segment, + l'UID de segment, les éléments d'UID + suivants et précédents de segment. Un fichier d'exemple et un + DTD sont inclus dans la distribution MKVToolNix. + +

+ + +

+ Voir la section relative aux fichiers + XML d'infos de segments ci-dessous pour les détails. + +

+ +
--segment-uid SID1,SID2,... + +

+ Définit les UID de segment à utiliser. C'est une liste d'UID de segment de + 128 bits séparés par une virgule et sous leur forme habituelle : nombres + hexadécimaux avec ou sans le préfixe "0x", avec ou sans espaces et + d'exactement 32 chiffres. + +

+ + +

+ Si le SID commence avec =, alors son reste est interprété comme le nom d'un + fichier Matroska dont l'UID de segment est lu et utilisé. + +

+ + +

+ Chaque fichier créé contient un segment, et chaque segment a un UID de + segment. Si plus d'UID de segment sont spécifiés que de segments sont créés, + alors le surplus d'UID est ignoré. Si moins d'UID sont spécifiés que de + segments sont créés, alors des UID aléatoires seront créés pour eux. + +

+ +
+ + + +

2.3. Gestion des balises et des chapitres (options globales)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language language-code + +

+ Définit le code langue ISO 639-2 qui est écrit pour chaque entrée de + chapitre. « eng » par défaut. Voir la section à propos + des chapitres ci-dessous pour les + détails. + +

+ + +

+ Cette option peut être utilisée pour des fichiers de chapitres simples et + pour des fichiers source qui contiennent des chapitres mais pas + d'informations sur la langue des chapitres, par ex. les fichiers MP4 et OGM. + +

+ + +

+ La langue définie avec cette option est aussi utilisée quand les chapitres + sont générés avec --generate-chapters + comme option. + +

+ +
--chapter-charset character-set + +

+ Définit le jeu de caractères utilisé pour la conversion vers UTF-8 des + simples fichiers de chapitres. Voir la section à propos des fichiers texte et des jeux de + caractères pour savoir comment mkvmerge(1) convertit les jeux de + caractères. + +

+ + +

+ Ce commutateur s'appliquera aussi aux chapitres qui sont copiés depuis + certains types de conteneur, par ex. les fichiers Ogg/OGM et MP4. Voir la + section sur les chapitres ci-dessous pour les détails. + +

+ +
--chapter-sync + d[,o[/p]] + +

+ Ajuste les horodatages des chapitres dans les sources suivantes de + d ms. Alternativement, il est possible d'utiliser + l'option --sync avec l'ID de piste spécial + -2 (voir la section ID de pistes spéciaux). + +

+ + +

+ o/p : ajuste les horodatages + de o/p pour corriger les + dérives linéaires. p est par défaut 1 si + omis. o et p peuvent être des + nombre à virgules flottantes. + +

+ + +

+ Par défaut : aucune correction manuelle de la sync. (ce qui est la même + chose que d = 0 et + o/p = + 1.0). + +

+ + +

+ Cette option peut être utilisée de multiples fois pour un fichier source en + s'appliquant à plusieurs pistes par sélection de différents ID de pistes à + chaque fois. + +

+ +
--generate-chapters mode + +

+ mkvmerge(1) peut créer des chapitres automatiquement. Les deux modes suivants + sont actuellement pris en charge : + +

+ + +
    + +
  • + +

    + 'when-appending' – Ce mode crée un chapitre au début et + un chapitre quand un fichier est ajouté. + +

    + + +

    + Ce mode fonctionne aussi avec les modes de scission + « parts: » et « parts-frames: ». Pour + ces modes, un chapitre sera généré pour chaque plage d'horodatage ajoutée + (celles qui débutent les horodatages sont préfixées avec + « + »). + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1) nécessite une piste vidéo ou audio présente pour être en mesure + de déterminer quand un nouveau fichier est ajouté. Si une piste vidéo ou + plus sont mixées, la première est utilisée. Sinon la première piste audio + est utilisée. + +

    + +
    + +
  • + + +
  • + +

    + 'interval:time-spec' – Ce mode + crée un chapitre à intervalle fixe par time-spec. Le + format est soit la forme HH:MM:SS.nnnnnnnnn ou un + nombre suivi par une des unités 's', + 'ms' ou 'us'. + +

    + + +

    + Example : --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ Les noms pour les nouveaux chapitres sont contrôlés par l'option --generate-chapters-name-template. + La langue est définie avec --chapter-language + qui doit survenir avant --generate-chapters. + +

+ +
--generate-chapters-name-template + template + +

+ Ceci définit le motif de nom pour les noms de chapitres générés par l'option + --generate-chapters. + Si l'option n'est pas utilisée, alors la chaîne par défaut 'Chapter + <NUM:2>' sera utilisée. + +

+ + +

+ Il existe plusieurs variables qui peuvent être utilisées dans le motif et + qui sont remplacées par leurs valeus réelles quand un chapitre est + généré. La chaîne '<NUM>' sera remplacée par le + numéro de chapitre. La chaîne '<START>' sera + remplacée par l'horodatage de début de chapitre. + +

+ + +

+ Les chaînes '<FILE_NAME>' et + '<FILE_NAME_WITH_EXT>' sont seulement remplies à la + génération de chapitres sont générés pour les fichiers ajoutés. Elles seront + remplacées par le nom du fichier ajouté avec et sans son extension, + respectivement. Noter que seuls le nom de base du fichier et l'extension + sont insérés, pas son dossier ou les lettres ou composants du lecteur. + +

+ + +

+ Il est possible de spécifier un nombre minimal de chiffres pour les numéros + de chapitres avec '<NUM:places>', par + ex. '<NUM:3>'. Le numéro résultant sera préfixé de + zéros si le nombre de chiffres est moindre que spécifié. + +

+ + +

+ Il est possible de contrôler le format utilisé par l'horodatage de début + avec <START:format>. Le format est par défaut + '%H:%M:%S' si aucun n'est donné. Les codes de format + valides sont : + +

+ + +
    + +
  • + +

    %h – heures +

    + +
  • + +
  • + +

    %H – heures à deux chiffres +

    + +
  • + +
  • + +

    %m – minutes +

    + +
  • + +
  • + +

    %M – minutes à deux chiffres +

    + +
  • + +
  • + +

    %s – secondes +

    + +
  • + +
  • + +

    %S – secondes à deux chiffres +

    + +
  • + +
  • + +

    %n – nanosecondes à neuf chiffres +

    + +
  • + +
  • + +

    %<1-9>n – nanosecondes avec jusqu'à 9 chiffres (par + ex. 3 chiffres avec %3n) +

    + +
  • + +
+ +
--cue-chapter-name-format format + +

+ mkvmerge(1) prend en charge la lecture des feuilles de montage + CUE pour les fichiers audio comme source de chapitres. Les + feuilles de montage CUE contiennent habituellement les + entrées PERFORMER et TITLE pour chaque + entrée d'index. mkvmerge(1) utilise ces deux chaînes pour construire le nom + de chapitre. Avec cette option, le format utilisé pour ce nom peut être + défini. + +

+ + +

+ Si cette option n'est pas donnée, alors mkvmerge(1) utilise par défaut le + format '%p - %t' (l'artiste, suivi par une espace, un tiret, + une autre espace et le titre). + +

+ + +

+ Si le format est donnée, alors tout excepté les métacaractères suivants est + copié tel quel, et les métacaractères sont remplacés comme ceci : + +

+ + +
    + +
  • + +

    %p est remplacé par la chaîne du + PERFORMER de l'entrée actuelle, +

    + +
  • + +
  • + +

    %t st remplacé par la chaîne du + TITLE de l'entrée actuelle, +

    + +
  • + +
  • + +

    %n est remplacé par le numéro de la piste actuelle et +

    + +
  • + +
  • + +

    %N est remplacé par le numéro de la piste actuelle + précédé de 0 si < à 10. +

    + +
  • + +
+ +
--chapters file-name + +

+ Lit les informations de chapitres depuis le fichier + file-name. Voir la section sur les chapitres ci-dessous pour les détails. + +

+ +
--global-tags file-name + +

+ Lit les balises globales depuis le fichier + file-name. Voir la section sur les balises ci-dessous pour les détails. + +

+ +
+ + + +

2.4. Contrôle général en sortie (options globales avancées)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order + FID1:TID1,FID2:TID2,... + +

+ Cette option modifie l'ordre dans lequel les pistes d'un fichier source sont + créées. L'argument est une liste de paires d'ID séparées par virgule. Chaque + paire contient en premier l'ID fichier (FID1) qui est + simplement le numéro du fichier sur la ligne de commande et commençant à + 0. Le second est l'ID de piste (TID1) de ce + fichier. Si quelques ID de pistes sont omis, alors ces pistes sont créées + après que celles données par cette option ont été créées. + +

+ +
--cluster-length spec + +

+ Limite le nombre de blocs de données ou la durée des données dans chaque + grappe. Le paramètre spec peut soit être un nombre + n sans unité soit un nombre d + suivi de 'ms'. + +

+ + +

+ Si aucune unité n'est utilisée, alors mkvmerge(1) placera au plus + n blocs de données dans chaque grappe. Le nombre + maximal de blocs est 65535. + +

+ + +

+ Si le nombre d est suivi de 'ms', + alors mkvmerge(1) placera au plus d millisecondes de + données dans chaque grappe. Le minimum pour d est + '100 ms', et le maximum est '32000 + ms'. + +

+ + +

+ Par défaut mkvmerge(1) place au plus 65535 blocs et 5000 ms de données par + grappe. + +

+ + +

+ Les programmes essayant de trouver une certaine trame ne pourront effectuer + qu'un positionnement sur une grappe (cluster), après quoi ils devront lire + la grappe entière. Donc la création de grappes plus grandes pourrait + conduire à un positionnement lent ou imprécis. + +

+ +
--clusters-in-meta-seek + +

+ Indique à mkvmerge(1) de créer un élément de méta-positionnement à la fin du + fichier contenant toutes les grappes. Voir aussi la section sur la disposition des fichiers + Matroska. + +

+ +
--timestamp-scale factor + +

+ Force le facteur d'échelle de l'horodatage à + factor. Les valeurs valides sont dans l'intervalle + 1000..10000000 ou la valeur + spéciale -1. + +

+ + +

+ Normalement mkvmerge(1) utilisera une valeur de 1000000, + ce qui signifie que les horodatages et les durées auront une précision de 1 + ms. Pour les fichiers qui ne contiennent pas de piste vidéo mais au moins + une piste audio, mkvmerge(1) choisira automatiquement un facteur d'échelle de + code temporel de façon à ce que les horodatages et les durées aient une + précision de un échantillon audio. Cela permet un positionnement et une + extraction précise au prix de calculs plus importants. + +

+ + +

+ Si la valeur spéciale -1 est utilisée, alors mkvmerge(1) + utilisera la précision des échantillons même si une piste vidéo est + présente. + +

+ +
--enable-durations + +

+ Écrit les durées pour tous les blocs. Ceci va augmenter la taille du + fichier, et n'offre pour le moment aucun avantage pour les lecteurs. + +

+ +
--no-cues + +

+ Indique à mkvmerge(1) de ne pas créer et écrire de données de montage qui + peuvent être comparée à un index dans un AVI. Les fichiers Matroska(tm) + peuvent être lus sans données de montage, mais le positionnement sera + probablement imprécis et plus lent. À utiliser seulement en cas de + contrainte forte d'espace ou pour test.. Voir aussi l'option --cues qui peut + être spécifiée pour chaque fichier source. + +

+ +
--no-date + +

+ Par défaut mkvmerge(1) défini le champ d'information de segment « date » à la + date et heure courante quand le multiplexage débute. Avec cette option ce + champ n'est pas du tout écrit. + +

+ +
--disable-lacing + +

+ Désactive l'enlacement de toutes les pistes. Ceci va augmenter la taille du + fichier, particulièrement s'il y a beaucoup de pistes audio. Cette option + n'est pas destinée à être utilisée régulièrement. + +

+ +
--disable-track-statistics-tags + +

+ Normalement mkvmerge(1) écrira certaines balises avec des statistiques pour + chaque piste. Si de telles balises sont déjà présentes, alors elles seront + écrasées. Les balises sont BPS, + DURATION, NUMBER_OF_BYTES et + NUMBER_OF_FRAMES. + +

+ + +

+ Activer cette option empêchera mkvmerge(1) d'écrire ces balises et de + modifier toutes les balises existantes avec les mêmes noms. + +

+ +
--disable-language-ietf + +

+ mkvmerge(1) écrit normalement les nouveaux éléments de langue IETF BCP 47 en + plus des éléments traditionnels dans les entêtes de pistes, les chapitres et + les balises. Si cette option est utilisée, seuls les éléments traditionnels + sont écrits. + +

+ +
--normalize-language-ietf mode + +

+ Active la normalisation de toutes les étiquettes de langue IETF BCP 47 soit + en leur forme canonique avec le mode 'canonique', soit en + leur forme de sous-étiquettes de langue étendue avec le mode + 'extlang' soit en le désactivant avec le mode + 'off'. Par défaut la normalisation en forme canonique est + appliquée. + +

+ + +

+ Dans la forme canonique, toutes les sous-étiquettes avec des valeurs + préférées existantes sont remplacées par ces dernières. Ceci convertit par + ex. 'zh-yue-jyutping' en + 'yue-jyutping' ou 'fr-FX' en + 'fr-FR'. + +

+ + +

+ Pour la forme des sous-étiquettes de langue étendue, la forme canonique est + d'abord construite. Ensuite toutes les langues primaires pour lesquelles des + étiquettes de langue étendue existent sont remplacées par cette + sous-étiquettes de langue étendue et son préfixe. Ceci reconvertit par + ex. 'yue-jyutping' en + 'zh-yue-jyutping' mais n'a pas d'effet sur + 'fr-FR' car 'fr' n'est pas une + sous-étiquette de langue étendue. + +

+ +
--stop-after-video-ends + +

+ Arrête l'exécution à la fin de la première piste vidéo en ignorant les + paquets restants des autres pistes. + +

+ +
+ + + +

2.5. Scission, liage, ajout et concaténation de fichiers (plus d'options + globales)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split specification + +

+ Scinde le fichier cible après une taille ou une durée donnée. Merci de noter + que les pistes peuvent être seulement scindées après une trame clé. Le point + de scission peut donc être un peu décalé par rapport à ce que l'utilisateur + a spécifié. + +

+ + +

+ Pour le moment mkvmerge(1) prend en charge les modes suivants: + +

+ + +
    + +
  1. + +

    + Scission par taille. + +

    + + +

    + Syntaxe : --split + [size:]d[k|m|g] + +

    + + +

    + Exemples : --split size:700m ou --split 150000000 + +

    + + +

    + Le paramètre d peut se terminer avec + 'k', 'm' ou 'g' + pour indiquer que la taille est en ko, Mo ou Go, respectivement. Sinon une + taille en octets est supposée. Après que le fichier cible actuel a atteint + cette limite de taille, un nouveau est démarré. + +

    + + +

    + Le préfixe 'size:' peut être omis pour des raisons de + compatibilité. + +

    + +
  2. + + +
  3. + +

    + Scission après une durée. + +

    + + +

    + Syntaxe : --split + [duration:]HH:MM:SS.nnnnnnnnn|ds + +

    + + +

    + Exemples : --split duration:00:60:00.000 ou --split + 3600s + +

    + + +

    + Le paramètre doit soit avoir la forme + HH:MM:SS.nnnnnnnnn pour spécifié la durée en + précision à la nanoseconde soit être un chiffre d + suivi de la lettre 's' pour une durée en + secondes. HH est le nombre d'heures, + MM le nombre de minutes, SS le + nombre de secondes et nnnnnnnnn le nombre de + nanosecondes. Les nombres d'heures et de nanosecondes peuvent être omis tous + les deux. Il peut y avoir jusqu'à neuf chiffres de décimales. Après que la + durée du contenu de la cible actuelle a atteint cette limite, un nouveau + fichier cible est démarré. + +

    + + +

    + Le préfixe 'duration:' peut être omis pour des raisons de + compatibilité. + +

    + +
  4. + + +
  5. + +

    + Scission après des horodatages spécifiques. + +

    + + +

    + Syntaxe : --split + timestamps:A[,B[,C...]] + +

    + + +

    + Exemple : --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + Les paramètres A, B, + C etc. doivent tous avoir le même format que ceux + utilisés pour la durée (voir ci-dessus). La liste des horodatages est + séparée par des virgules. Après que le flux source a atteint le code + temporel du point de scission, un nouveau fichier est créé. Alors le point + de scission suivant dans cette liste est utilisé. + +

    + + +

    + Le préfixe 'timestamps:' ne doit pas être omis. + +

    + +
  6. + + +
  7. + +

    + Conservation de parties spécifiques en spécifiant des intervalles + d'horodatage tout en en rejetant d'autres. + +

    + + +

    + Syntaxe : --split + parts:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + Exemples : +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + Le mode parts indique à mkvmerge(1) de conserver certaines + plages d'horodatages et d'en rejeter d'autres. Les plages à conserver + doivent être listées après le mot clé parts: et être + séparées par des virgules. Une plage elle-même consiste en un horodatage de + début et de fin dans le même format que les autres variations de + --split acceptent (par + ex. 00:01:20 et 80s réfère au même + horodatage). + +

    + + +

    + Si un horodatage de début est omis, alors il sera par défaut défini selon + l'horodatage de fin de la plage précédente. En l'absence, il sera par défaut + défini au début du fichier (voir exemple 3) + +

    + + +

    + Si un horodatage de fin est omis, alors il sera par défaut défini à la fin + des fichiers sources, ce qui indique simplement à mkvmerge(1) de conserver le + reste (voir exemple 3) + +

    + + +

    + Normalement chaque plage sera écrite dans un nouveau fichier. Ceci peut être + modifié de telle manière que des plages consécutives puissent être écrites + vers le même fichier. Pour cela, l'utilisateur doit préfixer l'horodatage de + début avec un +. Ceci indique à mkvmerge(1) de ne pas + créer de nouveau fichier et plutôt d'ajouter la plage au même fichier vers + lequel la plage précédente a été écrite. Les horodatages seront ajustés pour + qu'il n'y ait pas de blanc dans le fichier cible même s'il y avait un blanc + entre les deux plages dans le fichier source. + +

    + + +

    + Dans l'exemple 1 mkvmerge(1) va créer deux fichiers. Le premier contiendra le + contenu débutant à 00:01:20 jusqu'à + 00:02:45. Le second contiendra le contenu débutant à + 00:05:50 jusqu'à 00:10:30. + +

    + + +

    + Dans l'exemple 2 mkvmerge(1) va créer un seul fichier. Celui-ci contiendra et + le contenu débutant à 00:01:20 jusqu'à + 00:02:45 et le contenu débutant à + 00:05:50 jusqu'à 00:10:30. + +

    + + +

    + Dans l'exemple 3 mkvmerge(1) va créer deux fichiers. Le premier contiendra le + contenu depuis le début des fichiers sources jusqu'à + 00:02:45. Le second contiendra le contenu débutant à + 00:05:50 jusqu'à la fin des fichiers sources. + +

    + + +
    +

    Note:

    + +

    + Note : mkvmerge(1) prend seulement des décisions de scission aux positions + des trames clés. Ceci s'applique au début et à la fin de chaque plage. Donc + même si un horodatage de fin se situe entre deux trames clés, mkvmerge(1) + continuera d'extraire les trames jusqu'à la trame clé suivante exclue. + +

    + +
    + +
  8. + + +
  9. + +

    + Conservation de parties spécifiques en spécifiant des intervalles de + trames/champs tout en en rejetant d'autres. + +

    + + +

    + Syntaxe : --split + parts-frames:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + Exemples : +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + Le mode parts-frames indique à mkvmerge(1) de conserver + certaines plages de numéros de trame/champ tout en en rejetant d'autres. Les + plages à conserver doivent être listées près le mot clé + parts-frames: et être séparées par des virgules. Une + plage elle-même consite en un numéro de trame/champ de début et de fin. La + numérotation débute à 1. + +

    + + +

    + Si un numéro de début est omis, alors il est défini par défaut au numéro de + fin de la plage précédente. + +

    + + +

    + Si un numéro de fin est omis, alors il sera par défaut défini à la fin des + fichiers sources, ce qui indique simplement à mkvmerge(1) de conserver le + reste (voir l'exemple 3) + +

    + + +

    + Normalement chaque plage sera écrite dans un nouveau fichier. Ceci peut être + modifié de telle manière que des plages consécutive soient écrites dans le + même fichier. Pour cela, l'utilisateur doit préfixer le numéro de début avec + un +. Ceci indique à mkvmerge(1) de ne pas créer un + nouveau fichier mais d'ajouter la plage au même fichier dans lequel la plage + précédente a été écrite. Les horodatages seront ajustés de telle manière + qu'il n'y ait pas de blanc dans le fichier cible même s'il y en avait un + dans les deux plages du fichier source. + +

    + + +
    +

    Note:

    + +

    + Note : mkvmerge(1) prend seulement des décisions de scission aux positions de + trames clés. Ceci s'applique au début et à la fin de chaque plage. Donc même + si un numéro de trame/champ se situe entre deux trames clés, mkvmerge(1) + continuera de générer les trames jusqu'à la prochaine trame clé exclue. + +

    + +
    + + +

    + Dans l'exemple 1, mkvmerge(1) va créer deux fichiers. Le premier contiendra + le contenu depuis la première trame clé à ou après 137 + jusqu'à la première trame clé à ou après 258 exclue. Le + second contiendra le contenu débutant à 548 jusqu'à + 1211. + +

    + + +

    + Dans l'exemple 2, mkvmerge(1) va créer seulement un fichier. Ce fichier + contiendra les contenus débutant à 733 jusqu'à + 912 et débutant à 1592 jusqu'à + 2730. + +

    + + +

    + Dans l'exemple 3, mkvmerge(1) va créer deux fichiers. Le premier contiendra + le contenu depuis le début des fichiers sources jusqu'à + 430. Le second contiendra le contenu débutant à + 2512 jusqu'à la fin des fichiers sources. + +

    + + +

    + Ce mode considère seulement la première piste vidéo qui est générée. Si + aucune piste vidéo n'est générée, aucune scission n'est opérée. + +

    + + +
    +

    Note:

    + +

    + Les nombres donnés avec cet argument sont interprétés selon le nombre de + blocs Matroska(tm) en sortie. Un unique bloc Matroska(tm) contient soit une + trame complète (contenu progressif) soit un unique champ (contenu + entrelacé). mkvmerge ne distingue pas entre les deux et compte simplement le + nombre de blocs. Par exemple : si on veut scinder après la 25ème trame + complète avec du contenu entrelacé, on devrait utiliser + 50 (deux champs par trame complète) comme point de + scission. + +

    + +
    + +
  10. + + +
  11. + +

    + Scission après des trames/champs spécifiques. + +

    + + +

    + Syntaxe : --split + frames:A[,B[,C...]] + +

    + + +

    + Exemple : --split frames:120,237,891 + +

    + + +

    + Les paramètres A, B, + C etc. doivent tous être des entiers positifs. La + numérotation débute à 1. La liste des numéros de trame/champ est séparée par + des virgules. Après que le flux source a atteint le numéro actuel de + trame/champ du point de scission, un nouveau fichier est créé. Ensuite le + point de scission suivant donné par cette liste est utilisé. + +

    + + +

    + Le préfixe 'frames:' ne doit pas être omis. + +

    + + +

    + Ce mode considère seulement la première piste vidéo qui est générée. Si + aucune piste vidéo n'est générée, aucune scission n'est opérée. + +

    + + +
    +

    Note:

    + +

    + Les nombres donnés avec cet argument sont interprétés selon le nombre de + blocs Matroska(tm) en sortie. Un unique bloc Matroska(tm) contient soit une + trame complète (contenu progressif) soit un unique champ (contenu + entrelacé). mkvmerge ne distingue pas entre les deux et compte simplement le + nombre de blocs. Par exemple : si on veut scinder après la 25ème trame + complète avec du contenu entrelacé, on devrait utiliser + 50 (deux champs par trame complète) comme point de + scission. + +

    + +
    + +
  12. + + +
  13. + +

    + Scission avant des chapitres spécifiques. + +

    + + +

    + Syntaxe : --split chapters:all ou + --split + chapters:A[,B[,C...]] + +

    + + +

    + Exemple : --split chapters:5,8 + +

    + + +

    + Les paramètres A, B, + C etc. doivent tous être des entiers positifs. La + numérotation débute à 1. La liste des numéros de chapitres est séparée par + des virgules. La scission sera opérée juste avant la première trame clé dont + l'horodatage est égal ou supérieur à l'horodatage de début pour les + chapitres dont les numéros sont listés. Un chapitre débutant à 0 s n'est + jamais pris en compte pour la scission et est ignoré. + +

    + + +

    + Le mot clé all peut être utilisé plutôt que de lister + tous les numéros de chapitres manuellement. + +

    + + +

    + Le préfixe 'chapters:' ne doit pas être omis. + +

    + + +
    +

    Note:

    + +

    + Le format Matroska(tm) prend en charge une profondeur arbitraire de structures + de chapitres appelées « entrées d'édition » et « atomes de chapitre + ». Toutefois, ce mode considère uniquement le niveau le plus élevé des + chapitres parmi toutes les entrées d'édition. + +

    + +
    + +
  14. + +
+ + +

+ Pour ce mode de scission, le nom de fichier cible est traité différemment + qu'en opération normale. Il peut contenir un printf + comme l'expression '%d' et inclure une largeur de champ + facultative, par ex. '%02d'. Si c'est le cas, alors le numéro + de fichier actuel sera formaté de manière appropriée et inséré à ce point + dans le nom de fichier. S'il n'y a pas un tel motif, alors un motif de + '-%03d' est supposé juste avant l'extension de du fichier : + '-o output.mkv' résulterait en 'output-001.mkv' et + ainsi de suite. S'il n'y a pas d'extension, alors '-%03d' sera + ajouté au nom. + +

+ + +

+ Un autre motif possible est '%c' ; il sera remplacé par le nom + du premier chapitre du fichier. Noter que quand '%c' est + présent, le motif '-%03d' ne sera pas ajouté automatiquement. + +

+ +
--link + +

+ Lie les fichiers avec un autre lors de la scission du fichier cible. Voir la + section file linking ci-dessous + pour les détails. + +

+ +
--link-to-previous segment-UID + +

+ Lie le premier fichier cible au segment avec l'UID de segment UID donné par + le paramètresegment-UID. Voir la section file linking ci-dessous pour les + détails. + +

+ + +

+ Si le SID commence avec =, alors son reste est interprété comme le nom d'un + fichier Matroska dont l'UID de segment est lu et utilisé. + +

+ +
--link-to-next segment-UID + +

+ Lie le dernier fichier cible au segment avec l'UID de segment UID donné par + le paramètresegment-UID. Voir la section file linking ci-dessous pour les + détails. + +

+ + +

+ Si le SID commence avec =, alors son reste est interprété comme le nom d'un + fichier Matroska dont l'UID de segment est lu et utilisé. + +

+ +
--append-mode mode + +

+ Détermine comment les horodatages sont calculés quand des fichiers sont + ajoutés. Le paramètre mode peut avoir deux valeurs : + 'file' qui est aussi la valeur par défaut et + 'track'. + +

+ + +

+ Quand mkvmerge(1) ajoute une piste (appelée 'track2_1' à + partir de maintenant) depuis un second fichier (appelé + 'file2') à une piste (appelée + 'track1_1') depuis le premier fichier (appelé + 'file1'), alors il doit décaler tous les horodatages pour + 'track2_1' d'un certain montant. Pour le mode + 'file' ce montant est le plus haut horodatage rencontré + dans 'file1' même si cet horodatage provenait d'une piste + différente que 'track1_1'. En mode piste le décalage est + le plus haut horodatage de 'track1_1'. + +

+ + +

+ Malheureusement mkvmerge(1) ne peut pas détecter quel mode utiliser de + manière fiable. Par conséquent, le mode par défaut est + 'file'. Le mode 'file' fonctionne + habituellement mieux pour les fichiers ayant été créés indépendamment ; par + ex. en ajoutant des fichiers AVI ou + MP4. Le mode 'track' est susceptible de + mieux fonctionner pour les sources qui sont essentiellement juste des + parties d'un gros fichier, par ex. pour les fichiers VOB et + EVO. + +

+ + +

+ Les pistes de sous-titres sont toujours traitées comme si le mode + 'file' était actif même si c'est le mode + 'track' qui est actif. + +

+ +
--append-to + SFID1:STID1:DFID1:DTID1[,...] + +

+ Cette option contrôle à quelle piste une autre piste est ajoutée. Chaque + spéc. contient quatre ID : un ID de fichier, un ID de piste, un second ID de + fichier, et un second ID de piste. La première paire, « ID de fichier + source » et « ID de piste source », identifie la piste qui sera ajoutée. La + seconde paire, « ID de fichier destination » et « ID de piste destination », + identifie la piste à laquelle la première est ajoutée. + +

+ + +

+ Si cette option a été omise, alors un mappage standard est utilisé. Ce + mappage standard ajoute chaque piste du fichier actuel à une piste du + fichier précédent avec le même ID de piste. Cela rend l'ajout plus facile, + si un film a été scindé en deux parties et que les deux fichiers ont le même + nombre de pistes et d'ID de pistes, avec la commande mkvmerge -o + output.mkv part1.mkv +part2.mkv. + +

+ +
+ + +

+ Un unique « + » oblige le fichier suivant à être joint plutôt qu'ajouté. Le + « + » peut aussi être placé devant le nom du fichier suivant. Les deux + commandes suivantes sont donc équivalentes : + +

+ +
$ mkvmerge -o complet.mkv fichier1.mkv + fichier2.mkv
+$ mkvmerge -o complet.mkv fichier1.mkv +fichier2.mkv
+
[ file1 file2 + ] + +

+ Si plusieurs noms de fichiers sont contenus dans une paire de crochets, + alors le second fichier et tous les suivants seront joints au premier nom de + fichier entre les crochets. + +

+ + +

+ Ceci est une syntaxe alternative pour utiliser « + » entre les noms de + fichiers. Les deux commandes suivantes sont donc équivalentes : + +

+ +
$ mkvmerge -o complet.mkv fichier1.mkv + fichier2.mkv
+$ mkvmerge -o complet.mkv '[' fichier1.mkv fichier2.mkv ']'
+
= + +

+ Pour certains types de fichiers (flux programme MPEG = VOB) mkvmerge(1) + recherche normalement des fichiers dans le même dossier que le fichier + source, qui ont le même nom de base et diffèrent seulement par leur + numérotation (par ex. 'VTS_01_1.VOB', 'VTS_01_2.VOB', 'VTS_01_3.VOB' + etc.). Le programme traite tous ces fichiers comme s'ils étaient concaténés + en un seul gros fichier. Cette option, un unique « = », indique à mkvmerge + de ne pas rechercher ces fichiers additionnels. + +

+ + +

+ Le « = » peut également être placé devant le nom de fichier suivant. Par + conséquent, les deux commandes suivantes sont équivalentes : + +

+ +
$ mkvmerge -o full.mkv = file1.vob
+$ mkvmerge -o full.mkv =file1.vob
+
( file1 file2 + ) + +

+ Si de multiples noms de fichiers sont placés entre parenthèses, alors ces + fichiers seront traités comme s'ils étaient concaténés en un gros fichier + unique contenant chaque fichier l'un après l'autre. + +

+ + +

+ Ceci peut être utilisé pour par ex. les fichiers VOB provenant d'un DVD ou + de flux de transport MPEG. Il ne peut pas être utilisé si chaque fichier + contient son propre jeu d'entêtes, ce qui est habituellement le cas avec les + fichiers autonomes AVI ou MP4. + +

+ + +

+ Placer un nom de fichier entre parenthèses empêche aussi mkvmerge(1) de + rechercher d'autres fichiers avec le même nom de base tel que décrit dans + l'option + =. Par conséquent, ces deux lignes de commande sont + équivalentes : + +

+ +
$ mkvmerge -o out.mkv = file.mkv
+$ mkvmerge -o out.mkv '(' file.mkv ')'
+ +

+ Plusieurs choses devraient être notées : + +

+ + +
    + +
  1. + +

    + Il doit y avoir des espaces après la parenthèse ouvrante et avant celle + fermante. + +

    + +
  2. + + +
  3. + +

    + Chaque paramètre entre parenthèses est interprété comme un nom de + fichier. Par conséquent, toutes les options s'appliquant à ce fichier + logique doivent être listées avant la parenthèse ouvrante. + +

    + +
  4. + + +
  5. + +

    + Quelques interfaces en lignes de commandes traitent les parenthèses en + caractères spéciaux. Il faut donc les échapper ou les entourer de guillemets + comme dans l'exemple ci-dessus. + +

    + +
  6. + +
+ +
+ + + + +

2.6. Prise en charge des pièces jointes (plus d'options globales)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description description + +

+ La description texte de la pièce jointe suivante. S'applique à la prochaine + --attach-file + ou à l'option --attach-file-once. + + +

+ +
--attachment-mime-type MIME type + +

+ Type MIME de la pièce jointe suivante. S'applique à + l'option suivante --attach-file + ou --attach-file-once. + Une liste des types MIME officiellement reconnus peut être + trouvée sur la + page d’accueil IANA. Le type MIME est obligatoire + pour une pièce jointe. + +

+ + +

+ Si aucun type MIME n'est donné pour une pièce jointe, son + type sera détecté automatiquement. + +

+ +
--attachment-name name + +

+ Définit le nom qui sera stocké dans le fichier cible pour cette pièce + jointe. Si cette option n'est pas fournie, alors le nom sera dérivé du nom + de fichier de la pièce jointe tel que donné par l'option --attach-file + ou --attach-file-once. + +

+ +
+ --attach-file file-name, + --attach-file-once file-name + + +

+ Crée un fichier joint dans le fichier Matroska(tm). Le type + MIME doit avoir été défini avant que cette option puisse + être utilisée. La différence entre les deux formes est que pendant la + scission les fichiers joints avec --attach-file le sont à + tous les fichiers cibles alors que ceux joints avec + --attach-file-once le sont seulement au premier fichier + créé. Si la scission n'est pas utilisée, alors les deux font la même chose. + +

+ + +

+ mkvextract(1) peut être utilisé pour extraire les fichiers joints d'un + fichier Matroska(tm). + +

+ +
--enable-legacy-font-mime-types + +

+ Active l'utilisation des anciens types MIME pour certains + types de pièces jointes de polices de caractères. Par ex., + « application/x-truetype-font » sera utilisé pour les + polices TrueType au lieu de « fonts/ttf ». + +

+ + +

+ Ceci affecte les nouvelles pièces jointes si leur type MIME + est détecté automatiquement et celles existantes pour lesquelles les types + MIME stockés seront remplacés par les anciens. + +

+ + +

+ Les types MIME affectés sont + « font/sfnt », « font/ttf » et + « font/collection ». Ils sont tous remplacés par + « application/x-truetype-fonts ». + « font/otf » est remplacé par + « application/vnd.ms-opentype ». + +

+ +
+ + + +

2.7. Options pouvant être utilisée à chaque fichier source

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks + [!]n,m,... + +

+ Copie les pistes audio n, m + etc. Les numéros sont les ID de pistes qui peuvent être obtenus avec le + commutateur --identify. + Ce ne sont pas seulement des numéros de pistes (voir la section ID de pistes). Par défaut : copie toutes + les pistes audio. + +

+ + +

+ Au lieu des ID de piste il est possible de fournir des codes de langue ISO + 639-2. Cela ne fonctionnera que pour les fichiers sources fournissant des + balises de langue pour leurs pistes. + +

+ + +

+ Par défaut : copie toutes les pistes de ce type. + +

+ + +

+ Si les ID sont préfixés avec !, alors la signification + est inversée : copier toutes les pistes semblables sauf celles listées après + le !. + +

+ +
-d, --video-tracks + [!]n,m,... + +

+ Copie les pistes vidéo n, m + etc. Les numéros sont les ID de pistes qui peuvent être obtenus avec le + commutateur --identify. + Ce ne sont pas seulement des numéros de pistes (voir la section ID de pistes). Par défaut : copie toutes + les pistes vidéo. + +

+ + +

+ Au lieu des ID de piste il est possible de fournir des codes de langue ISO + 639-2. Cela ne fonctionnera que pour les fichiers sources fournissant des + balises de langue pour leurs pistes. + +

+ + +

+ Si les ID sont préfixés avec !, alors la signification + est inversée : copier toutes les pistes semblables sauf celles listées après + le !. + +

+ +
-s, --subtitle-tracks + [!]n,m,... + +

+ Copie les pistes de sous-titres n, + m etc. Les numéros sont les ID de pistes qui peuvent + être obtenus avec le commutateur --identify. + Ce ne sont pas seulement des numéros de pistes (voir la section ID de pistes). Par défaut : copie toutes + les pistes de sous-titres. + +

+ + +

+ Au lieu des ID de piste il est possible de fournir des codes de langue ISO + 639-2. Cela ne fonctionnera que pour les fichiers sources fournissant des + balises de langue pour leurs pistes. + +

+ + +

+ Si les ID sont préfixés avec !, alors la signification + est inversée : copier toutes les pistes semblables sauf celles listées après + le !. + +

+ +
-b, --button-tracks + [!]n,m,... + +

+ Copie les pistes de boutons n, + m etc. Les nombres sont des ID de pistes qui peuvent + être obtenus avec le commutateur --identify. + Ce ne sont pas simplement des numéros de pistes (voir la section ID de pistes). Par défaut : copier + toutes les pistes de boutons. + +

+ + +

+ Au lieu des ID de piste il est possible de fournir des codes de langue ISO + 639-2. Cela ne fonctionnera que pour les fichiers sources fournissant des + balises de langue pour leurs pistes. + +

+ + +

+ Si les ID sont préfixés avec !, alors la signification + est inversée : copier toutes les pistes semblables sauf celles listées après + le !. + +

+ +
--track-tags + [!]n,m,... + +

+ Copie les balises pour les pistes n, + m etc. Les numéros sont les ID de pistes qui peuvent + être obtenus avec le commutateur --identify. + Ce ne sont pas seulement des numéros de pistes (voir la section ID de pistes). Par défaut : copie toutes + les balises pour les pistes. + +

+ + +

+ Si les ID sont préfixés avec !, alors la signification + est inversée : copier toutes les pistes semblables sauf celles listées après + le !. + +

+ +
-m, --attachments + [!]n[:all|first],m[:all|first],... + +

+ Copie les pistes de pièces jointes avec les ID n, + m etc. vers tous les fichiers cibles ou seulement le + premier. Chaque ID peut être suivie soit par ':all' (par + défaut si rien n'est saisi) soit par ':first'. Si la + scission est active, alors les pièces jointes dont les ID sont spécifiées + avec ':all' sont copiées vers tous les fichiers cibles + résultant alors que les autres sont copiées seulement vers le premier + fichier cible. Si la scission n'est pas active, alors les deux variants ont + le même effet. + +

+ + +

+ Par défaut les pièces jointes sont copiées vers tous les fichiers cibles. + +

+ + +

+ Si les ID sont préfixés avec !, alors la signification + est inversée : copier toutes les pistes semblables sauf celles listées après + le !. + +

+ +
-A, --no-audio + +

+ Ne copie aucune piste audio de ce fichier. + +

+ +
-D, --no-video + +

+ Ne copie aucune piste vidéo de ce fichier. + +

+ +
-S, --no-subtitles + +

+ Ne copie aucune piste de sous-titres de ce fichier. + +

+ +
-B, --no-buttons + +

+ Ne copie aucune piste de boutons de ce fichier. + +

+ +
-T, --no-track-tags + +

+ Ne copie aucune balise spécifique de piste de ce fichier. + +

+ +
--no-chapters + +

+ Ne copie aucun chapitre de ce fichier. + +

+ +
-M, --no-attachments + +

+ Ne copie aucune pièce jointe de ce fichier. + +

+ +
--no-global-tags + +

+ Ne copie aucune balises globales de ce fichier. + +

+ +
-y, --sync + TID:d[,o[/p]] + +

+ Ajuste les horodatages de la piste avec l'ID TID de + d ms. Les ID de pistes sont les mêmes que ceux donnés + avec --identify + (voir la section ID de pistes). + +

+ + +

+ o/p : ajuste les horodatages + de o/p pour corriger les + dérives linéaires. p est par défaut 1 si + omis. o et p peuvent être des + nombre à virgules flottantes. + +

+ + +

+ Par défaut : aucune correction manuelle de la sync. (ce qui est la même + chose que d = 0 et + o/p = + 1.0). + +

+ + +

+ Cette option peut être utilisée de multiples fois pour un fichier source en + s'appliquant à plusieurs pistes par sélection de différents ID de pistes à + chaque fois. + +

+ +
--cues TID:none|iframes|all + +

+ Contrôle pour quelles pistes les entrées de montage (index) sont créées pour + la piste fournie (voir la section ID de + pistes). 'none' inhibe la création des entrées de + montage. Pour les 'iframes', seuls les blocs sans + références avance et retour ( = trames I dans les pistes vidéo) sont placées + dans la feuille de montage. 'all' oblige mkvmerge(1) à + créer des entrées de montage pour tous les blocs, ce qui rendra le fichier + très lourd. + +

+ + +

+ L'option par défaut est 'iframes' pour les pistes vidéo + et de sous-titres, et 'none' pour les pistes audio. Voir + aussi l'option --no-cues qui + inhibe la création d'entrées de montage CUES quelque soit l'option + --cues utilisée. + +

+ + +

+ Cette option peut être utilisée de multiples fois pour un fichier source en + s'appliquant à plusieurs pistes par sélection de différents ID de pistes à + chaque fois. + +

+ +
--default-track-flag + TID[:bool] + +

+ Pose l'indicateur « Piste par défaut » pour la piste donnée (voir section + ID de pistes) si l'argument + facultatif bool est défini à 1 + ou s'il n'est pas présent. Ce signal sera défini si le conteneur de la + source ne fournit pas cette information et si l'utilisateur ne le spécifie + pas via cette option. + +

+ + +

+ Si l'utilisateur ne sélectionne pas explicitement une piste lors de la + lecture, le lecteur devrait sélectionner une des pistes avec l'indicateur + « Piste par défaut » posé, prenant en compte les préférences utilisateurs + telle que la langue préférée. + +

+ + +

+ Cette option peut être utilisée de multiples fois pour un fichier source en + s'appliquant à plusieurs pistes par sélection de différents ID de pistes à + chaque fois. + +

+ +
--track-enabled-flag + TID[:bool] + +

+ Définit l'indicateur "piste activée" pour la piste donnée (voir la + section ID de piste) à la valeur + donnée par bool (0 ou 1 ; par défaut 1 si non + spécifiée). Les pistes sont activées par défaut si aucune option ne leur est + spécifiée et que le conteneur source ne fournit pas non plus l'information. + +

+ + +

+ Seules les pistes dont l'indicateur "piste activée" est posé + devraient être considérées pour la lecture. + +

+ + +

+ Cette option peut être utilisée de multiples fois pour un fichier source en + s'appliquant à plusieurs pistes par sélection de différents ID de pistes à + chaque fois. + +

+ +
--forced-display-flag + TID[:bool] + +

+ Pose l'indicateur « Affichage forcé » pour la piste donnée (voir la section + ID de pistes) si l'argument + facultatif bool n'est pas présent. Utiliser ceci + pour les pistes contenant du texte à l'écran ou des dialogues en langues + étrangères. + +

+ + +

+ Cette option peut être utilisée de multiples fois pour un fichier source en + s'appliquant à plusieurs pistes par sélection de différents ID de pistes à + chaque fois. + +

+ +
--hearing-impaired-flag + TID[:bool] + +

+ Pose l'indicateur « Malentendant » pour la piste donnée (voir la section + ID de pistes) si l'argument + facultatif bool est défini à 1 + ou s'il n'est pas présent. Ce signal peut être posé si la piste est adaptée + aux utilisateurs malentendants. + +

+ + +

+ Cette option peut être utilisée de multiples fois pour un fichier source en + s'appliquant à plusieurs pistes par sélection de différents ID de pistes à + chaque fois. + +

+ +
--visual-impaired-flag + TID[:bool] + +

+ Pose l'indicateur « Malvoyant » pour la piste donnée (voir la section ID de pistes) si l'argument facultatif + bool est défini à 1 ou s'il + n'est pas présent. Ce signal peut être posé si la piste est adaptée aux + utilisateurs malvoyants. + +

+ + +

+ Cette option peut être utilisée de multiples fois pour un fichier source en + s'appliquant à plusieurs pistes par sélection de différents ID de pistes à + chaque fois. + +

+ +
--text-descriptions-flag + TID[:bool] + +

+ Pose l'indicateur « Audiodescription » pour la piste donnée (voir la section + ID de pistes) si l'argument + facultatif bool est défini à 1 + ou s'il n'est pas présent. Ce signal peut être posé si la piste contient + l'audiodescription de contenu vidéo adaptée à la lecture vocale pour + l'utilisateur malvoyant + +

+ + +

+ Cette option peut être utilisée de multiples fois pour un fichier source en + s'appliquant à plusieurs pistes par sélection de différents ID de pistes à + chaque fois. + +

+ +
--original-flag + TID[:bool] + +

+ Pose l'indicateur « Langue d'origine  » pour la piste donnée (voir la + section ID de pistes) si + l'argument facultatif bool n'est pas présent. Ce + signal peut être posé si la piste est dans la langue d'origine du contenu + (pas une traduction). + +

+ + +

+ Cette option peut être utilisée de multiples fois pour un fichier source en + s'appliquant à plusieurs pistes par sélection de différents ID de pistes à + chaque fois. + +

+ +
--commentary-flag + TID[:bool] + +

+ Pose l'indicateur « Commentaire » pour la piste donnée (voir la section + ID de pistes) si l'argument + facultatif bool est défini à 1 + ou s'il n'est pas présent. Ce signal peut être posé si la piste contient des + commentaires. + +

+ + +

+ Cette option peut être utilisée de multiples fois pour un fichier source en + s'appliquant à plusieurs pistes par sélection de différents ID de pistes à + chaque fois. + +

+ +
--track-name TID:name + +

+ Définit le nom de piste pour la piste fournie (voir la section ID de pistes) à + name. + +

+ +
--langue TID:langue + +

+ Définit la langue pour la piste donnée (voir la section ID de pistes). Les codes langue ISO + 639-2 et de pays ISO 639-1 sont autorisés. Les codes de pays seront + convertis automatiquement en codes langue. Toutes les langues, ainsi que + leurs codes ISO 639-2, peuvent être listées avec l'option --list-languages. + +

+ + +

+ Cette option peut être utilisée de multiples fois pour un fichier source en + s'appliquant à plusieurs pistes par sélection de différents ID de pistes à + chaque fois. + +

+ +
-t, --tags + TID:file-name + +

+ Lit les balises pour la piste avec le numéro TID + depuis le fichier file-name. Voir la section balises ci-dessous pour les détails. + +

+ +
--aac-is-sbr + TID[:0|1] + +

+ Indique à mkvmerge(1) que la piste avec l'ID TID est + SBR AAC (aussi connu sous HE-AAC ou + AAC+). Cette option est nécessaire si a) le fichier source + file est un fichier AAC (pas pour un + fichier Matroska(tm)) et b) le fichier AAC contient des + données SBR AAC. La raison pour ce commutateur est qu'il + est techniquement impossible de distinguer automatiquement des données + normales AAC de données SBR AAC sans + décoder une trame AAC complète. Comme il y a plusieurs + problèmes de brevets avec les décodeurs AAC, mkvmerge(1) + n'assurera jamais cette phase de décodage. Donc pour les fichiersSBR + AAC ce commutateur est obligatoire. Le fichier résultant de + l'omission de ce commutateur pourrait ne pas être lu correctement ou du + tout. + +

+ + +

+ Si le fichier source est un fichier Matroska(tm), alors le + CodecID devrait être suffisant pour détecter + SBR AAC. Toutefois si CodecID est + faux, alors ce commutateur pourra être utilisé pour corriger cela.. + +

+ + +

+ Si mkvmerge(1) détecte incorrectement qu'un fichier AAC est + SBR, alors il est possible d'ajouter + ':0' à l'ID de piste. + +

+ +
--audio-emphasis TID:n|symbolic-name + +

+ Définit l'accentuation pour la piste audio avec l'ID de piste + TID. Le mode peut soit être un nombre + n (certaines valeurs entre 0 et + 16) soit un nom symbolique. Tous les nombres et noms + valides peuvent être listés avec l'option --list-audio-emphasis. + +

+ +
--reduce-to-core TID + +

+ Quelques codecs audio ont un cœur avec perte et des extensions facultatives + qui implémentent un décodage sans perte. Cette option indique à mkvmerge(1) + de copier seulement le cœur mais pas les extensions. Par défaut mkvmerge(1) + copie le cœur et les extensions. + +

+ + +

+ Actuellement, seules les pistes DTS sont affectées par + cette option. Les pistes TrueHD qui contiennent un cœur + AC-3 embarqué sont plutôt présentées en deux pistes + séparées que l'utilisateur peut sélectionner pour copier. Pour + DTS un tel schéma ne fonctionnerait pas parce que les + extensions HD ne peuvent pas être décodées par elles-mêmes – à la différence + des données TrueHD. + +

+ +
--remove-dialog-normalization-gain + TID + +

+ Quelques codecs audio ont des champs d'entêtes qui indiquent au décodeur ou + lecteur d'appliquer un gain (habituellement négatif) pour la normalisation + des dialogues. Cette option indique à mkvmerge(1) de retirer ou minimiser ce + gain en modifiant les champs d'entêtes correspondants. + +

+ + +

+ Seules les pistes AC-3, DTS et + TrueHD sont actuellement concernées par cette option. + +

+ +
--timestamps TID:file-name + +

+ Lit les horodatages à utiliser pour l'ID de piste spécifique depuis + file-name. Ces horodatages écrasent de force les + horodatages que mkvmerge(1) calcule normalement. Lire la section fichiers externes + d'horodatage. + +

+ +
--default-duration TID:x + +

+ Force la durée par défaut d'une piste donnée à la valeur spécifiée. Modifie + aussi les horodatage de la piste pour correspondre à la durée par + défaut. L'argument x doit être postfixé avec + 's', 'ms', 'us', + 'ns', 'fps', 'p' ou + 'i' pour spécifier la valeur de la durée par défaut en + secondes, millisecondes, microsecondes, nanosecondes, 'trames par seconde', + 'trames progressives par seconde' ou 'trames entrelacées par seconde' + respectivement. Le nombre x peut lui-même être un + nombre à virgule ou une fraction. + +

+ + +

+ Si la durée par défaut n'est pas forcée, alors mkvmerge essayera de dériver + la durée par défaut de la piste depuis le conteneur et/ou le flux binaire + encodé pour certains types de pistes, par ex. AVC/H.264 ou MPEG-2. + +

+ + +

+ Cette option peut aussi être utilisée pour modifier les FPS + des pistes vidéo sans avoir à utiliser un fichier externe d'horodatages. + +

+ +
--fix-bitstream-timing-information + TID[:0|1] + +

+ Normalement, mkvmerge(1) ne modifie pas l'information temporelle (vitesse de + trame/champ) stockée dans le flux binaire de données vidéo. Avec cette + option, cette information est ajustée pour correspondre celle du + conteneur. L'information de timing du conteneur peut provenir de sources + variées : de la ligne de commande (voir l'option --default-duration), + du conteneur source ou dérivée du flux binaire. + +

+ + +
+

Note:

+ +

Ceci a été implémenté pour les pistes vidéo AVC/H.264 pour le moment.

+ +
+ +
--compression TID:n + +

+ Sélectionne la méthode de compression à utiliser pour la piste. Note : le + lecteur doit aussi prendre en charge cette méthode. Les valeurs valides sont + 'none', 'zlib' et + 'mpeg4_p2'/'mpeg4p2'. + +

+ +

+ La méthode de compression « mpeg4_p2 »/« + mpeg4p2 » est une méthode spéciale de compression appelée + « header removal » qui n'est disponible que pour les pistes vidéo + MPEG4 part 2. + +

+ +

+ La compression par défaut pour certains types de sous-titres est + 'zlib'. Cette méthode de compression est aussi celle que + presque toutes les applications de lecture prennent en charge. La prise en + charge d'autres méthodes de compression que 'none' n'est + pas assurée. + +

+ +
+ + + +

2.8. Options ne s'appliquant qu'aux pistes vidéo

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc + TID:FourCC + +

+ Force le code FourCC à la valeur spécifiée. Ne + fonctionne que pour les pistes vidéo en « mode compatibilité MS ». + +

+ +
--display-dimensions + TID:widthxheight + +

+ Les fichiers Matroska(tm) contiennent deux valeurs qui définissent les + propriétés d'affichage qu'un lecteur devrait en compte pour la mise à + l'échelle de l'image : largeur et hauteur d'affichage. Ces valeurs peuvent + être définies avec cette option, par ex. '1:640x480'. + +

+ + +

+ Une autre manière de définir les valeurs est d'utiliser les options --aspect-ratio + ou --aspect-ratio-factor + (voir ci-dessous). Ces options sont mutuellement exclusives. + +

+ +
--aspect-ratio + TID:ratio|width/height + +

+ Les fichiers Matroska(tm) contiennent deux valeurs qui définissent les + propriétés d'affichage qu'un lecteur devrait prendre en compte pour la mise + à l'échelle de l'image : largeur et hauteur d'affichage. Avec cette option + mkvmerge(1) calculera automatiquement les largeur et hauteur d'affichage + selon les largeur et hauteur d'origine de l'image' et du ratio d'aspect + donné par cette option. Le ratio d'aspect peut être donné soit par un + ratio en nombre flottant soit par comme une fraction + de 'width/height', par + ex. '16/9'. + +

+ + +

+ Une autre manière de définir les valeurs est d'utiliser les options --aspect-ratio-factor + ou --display-dimensions + (voir ci-dessus et ci-dessous). Ces options sont mutuellement exclusives. + +

+ +
--aspect-ratio-factor TID:factor|n/d + +

+ Une autre manière de définir le ratio d'aspect est de spécifier un + factor. Le ratio d'aspect d'origine est d'abord + multiplié par ce factor puis est utilisé comme ratio + d'aspect cible par la suite. + +

+ + +

+ Une autre manière de définir les valeurs est d'utiliser les options --aspect-ratio + ou --display-dimensions + (voir ci-dessous). Ces options sont mutuellement exclusives. + +

+ +
--cropping TID:left,top,right,bottom + +

+ Définit les paramètres de déformation des pixels d'une piste vidéo sur les + valeurs données. + +

+ +
--color-matrix-coefficients TID:n + +

+ Définit les coefficients de matrice de la vidéo utilisés pour dériver les + valeurs de luma et de chroma depuis les couleurs primaires rouge, vert et + bleu. Le paramètre n est un entier allant de + 0 à 10. + +

+ + +

+ Les valeurs valides et leur signification sont : + +

+ + +

+ 0: GBR, 1: BT709, + 2: non spécifié, 3: réservé, + 4: FCC, 5: BT470BG, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 luminance non + constante, 10: BT2020 luminance constante + +

+ +
--color-bits-per-channel TID:n + +

+ Définit le nombre de bits codés pour un canal de couleur. Une valeur de + 0 indique que le nombre de bits n'est pas spécifié. + +

+ +
--chroma-subsample TID:hori,vert + +

+ La quantité de pixels à retirer dans les canaux Cr et Cb pour chaque pixel + non retiré horizontalement/verticalement. + +

+ + +

+ Exemple : pour une vidéo avec un sous-échantillonnage chroma 4:2:0, le + paramètre devrait être défini à + TID:1,1. + +

+ +
--cb-subsample TID:hori,vert + +

+ La quantité de pixels à retirer dans les canaux Cr et Cb pour chaque pixel + non retiré horizontalement/verticalement. Ceci s'additionne à + --chroma-subsample. + +

+ + +

+ Exemple : pour une vidéo avec un sous-échantillonnage chroma 4:2:1, le + paramètre --chroma-subsample devrait être défini à + TID:1,0 + et Cb-subsample devrait être défini à + TID:1,0. + +

+ +
--chroma-siting TID:hori,vert + +

+ Définit comment la chroma est localisée + horizontalement/verticalement. (0: non spécifié, + 1: co-localisé en haut, 2: + moitié). + +

+ +
--color-range TID:n + +

+ Définit l'écrêtage de l'intervalle de couleurs (0: non + spécifié, 1: intervalle broadcast, + 2: intervalle entier (pas d'écrêtage), + 3: défini par + MatrixCoefficients/TransferCharacteristics). + +

+ +
--color-transfer-characteristics + TID:n + +

+ Les caractéristiques de transfert de la vidéo. + +

+ + +

+ Les valeurs valides et leur signification sont : + +

+ + +

+ 0: réservé, 1: ITU-R BT.709, + 2: non spécifié, 3: réservé, + 4: courbe gamma 2.2, 5: courbe + gamma 2.8, 6: SMPTE 170M, 7: SMPTE + 240M, 8: linéaire, 9: log, + 10: racine de log, 11: IEC + 61966-2-4, 12: gamut de couleur étendu ITU-R BT.1361, + 13: IEC 61966-2-1, 14: ITU-R + BT.2020 10 bit, 15: ITU-R BT.2020 12 bit, + 16: SMPTE ST 2084, 17: SMPTE ST + 428-1; 18: ARIB STD-B67 (HLG) + +

+ +
--color-primaries TID:n + +

+ Définit les couleurs primaires de la vidéo. + +

+ + +

+ Les valeurs valides et leur signification sont : + +

+ + +

+ 0: réservé, 1: ITU-R BT.709, + 2: non spécifié, 3: réservé, + 4: ITU-R BT.470M, 5: ITU-R + BT.470BG, 6: SMPTE 170M, 7: SMPTE + 240M, 8: FILM, 9: ITU-R BT.2020, + 10: SMPTE ST 428-1, 22: phosphores + JEDEC P22 + +

+ +
--max-content-light TID:n + +

+ Définit la brillance maximale d'un pixel unique (Niveau de Contenu de + Lumière Maximal - Maximum Content Light Level) en candelas par mètre carré + (cd/m²). La valeur de n devrait être un entier non + négatif. + +

+ +
--max-frame-light TID:n + +

+ Définit la brillance maximale d'une trame complète unique (Niveau de Contenu + de Lumière Maximal - Maximum Content Light Level) en candelas par mètre + carré (cd/m²). La valeur def ndevrait être un entier + non négatif. + +

+ +
--chromaticity-coordinates + TID:red-x,red-y,green-x,green-y,blue-x,blue-y + +

+ Définit les coordonnées de chromaticité du rouge/vert/bleu définies selon + CIE 1931. + +

+ +
--white-color-coordinates TID:x,y + +

+ Définit les coordonnées de chromaticité du blanc définies selon CIE 1931. + +

+ +
--max-luminance TID:float + +

+ Définit la luminance maximale en candelas par mètre carré (cd/m²). La valeur + devrait être inférieure à 9999.99. + +

+ +
--min-luminance TID:float + +

+ Définit la luminance minimale en candelas par mètre carré (cd/m²). La valeur + devrait être inférieure à 999.9999. + +

+ +
--projection-type TID:method + +

+ Définit la méthode de projection vidéo utilisée. Les valeurs valides sont 0 + (projection rectangulaire), 1 (projection équirectangulaire), 2 (projection + en carte cubique) et 3 (projection en treillis). + +

+ +
--projection-private TID:data + +

+ Définit des données privées qui s'appliquent seulement à une projection + spécifique. Les données doivent être fournies en nombres hexadécimaux avec + ou sans le préfixe "0x" avec ou sans espaces. + +

+ +
--projection-pose-yaw TID:float + +

+ Spécifie une rotation en lacet de la projection. + +

+ +
--projection-pose-pitch TID:float + +

+ Spécifie une rotation en tangage de la projection. + +

+ +
--projection-pose-roll TID:float + +

+ Spécifie une rotation en roulis de la projection. + +

+ +
--field-order TID:n + +

+ Définit l'ordre de champ pour la piste vidéo avec l'ID de piste + TID. L'ordre doit être l'un de ces nombres : + +

+ + +

+ 0: progressif ; 1: entrelacé avec + le champ du haut affiché en premier et le champ du haut stocké en premier ; + 2: ordre de champ indéterminé ; 6: + entrelacé avec le champ du bas affiché en premier et le champ du bas stocké + en premier ; 9: entrelacé avec le champ du bas affiché + en premier et le champ du haut stocké en premier ; 14: + entrelacé avec le champ du haut affiché en premier et le champ du bas stocké + en premier + +

+ +
--stereo-mode TID:n|symbolic-name + +

+ Définit le mode stéréo pour la piste vidéo avec l'ID de piste + TID. Le mode peut soit être un nombre + n entre 0 et + 14 soit un nom symbolique. Tous les nombres et noms + valides peuvent être listés avec l'option --list-stereo-modes. + +

+ +
+ + + +

2.9. Options ne s'appliquant qu'aux pistes de sous-titres texte

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset TID:character-set + +

+ Définit le jeu de caractères pour la conversion vers UTF-8 des sous-titres + UTF-8 pour l'ID de piste donné. Si non spécifié, le jeu de caractères sera + déduit de la « locale » courante. Noter qu'un jeu de caractères n'est pas + requis pour les sous-titres lus depuis des fichiers Matroska(tm) ou des flux + Kate, car ils sont toujours stockés en UTF-8. Voir la section à propos des fichiers texte et des jeux de + caractères pour savoir comment mkvmerge(1) convertit les jeux de + caractères. + +

+ + +

+ Cette option peut être utilisée de multiples fois pour un fichier source en + s'appliquant à plusieurs pistes par sélection de différents ID de pistes à + chaque fois. + +

+ +
+ + + +

2.10. Autres options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify + file-name + +

+ Laissera mkvmerge(1) analyser le fichier unique et rapporter son type, les + pistes contenues dans le fichier et leurs ID de pistes. Si cette option est + utilisée, alors la seule autre option permise est le nom de fichier. + +

+ + +

Le format de sortie utilisé pour le résultat peut être modifié avec l'option + --identification-format. +

+ +
-J file-name + +

+ Ceci est un alias pratique pour "--identification-format json + --identify file-name". + +

+ +
-F, --identification-format + format + +

+ Détermine le format cible utilisé par l'option --identify + . Les formats suivants sont pris en charge : text + (par défaut si cette option n'est pas utilisée) et json. + +

+ + +
    + +
  1. + +

    Le format text est court et lisible. Il consiste en une + ligne par élément trouvé (conteneur, pistes, pièces jointes, etc.). +

    + + +

    Ce format n'est pas destiné à être analysé. La sortie sera traduite dans la + langue qu'mkvmerge(1) utilise (voir aussi --ui-language). +

    + +
  2. + + +
  3. + +

    + Le format json génère une représentation JSON lisible par + machine. Ce format suit le schéma JSON décrit dans le fichier suivant : + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + Toutes les versions du schéma JSON sont disponibles en ligne et dans les + archives publiées du code source. + +

    + +
  4. + +
+ +
--probe-range-percentage percentage + +

+ Les types de fichiers tels que les flux de programme et de transport MPEG + (.vob, .m2ts) nécessite une certaine + quantité de données à examiner afin de détecter toutes les pistes contenues + dans le fichier. Cette quantité est de 0.3% de la taille du fichier source + ou 10 Mo, selon la plus élevée. + +

+ + +

+ Si les pistes sont connues pour être présentes mais non trouvées, alors le + pourcentage à analyser peut être modifié avec cette option. Un minimum de 10 + Mo est requis et ne peut pas être modifié. + +

+ +
--list-audio-emphasis + +

+ Liste tous les nombres valides et leurs noms symboliques correspondants pour + l'option --audio-emphasis + option. + +

+ +
--list-languages + +

+ Liste toutes les langues et leurs codes ISO 639-2 qui peuvent être utilisées + avec l'option --language. + +

+ +
--list-stereo-modes + +

+ Liste tous les nombres valides et leurs noms symboliques correspondants pour + l'option --stereo-mode. + +

+ +
-l, --list-types + +

+ Liste les types de fichiers source pris en charge. + +

+ +
--priority priority + +

+ Définit la priorité du processus exécuté avec mkvmerge(1). Les valeurs + valides sont 'lowest', 'lower', + 'normal', 'higher' et + 'highest'. Si absente, alors 'normal' + est utilisé. Sur les systèmes Unix, mkvmerge(1) utilisera la fonction + nice(2). + Par conséquent, seulement le super utilisateur peut utiliser + 'higher' et 'highest'. Sur Windows, + toutes les valeurs sont utilisables par tous les utilisateurs. + +

+ + +

Sélectionner 'lowest' oblige aussi mkvmerge(1) à + sélectionner la priorité E/S ralentie en plus de la priorité processus la + plus petite possible. +

+ +
--command-line-charset character-set + +

+ Définit le jeu de caractères pour convertir les chaînes données en ligne de + commande. C'est par défaut le jeu de caractères fourni par la « locale » + actuelle du système. Ce paramètre s'applique aux arguments des options + suivantes : --title, --track-name + et --attachment-description. + +

+ +
--output-charset character-set + +

+ Définit le jeu de caractères dans lequel les chaînes en sortie sont + converties. Par défaut, celui-ci correspond à celui donné par la « locale » + du système. + +

+ +
-r, --redirect-output + file-name + +

+ Écrit tous les messages vers le fichier file-name + plutôt que vers la console. Alors que cela peut être fait facilement avec la + redirection de sortie, il y a des cas dans lesquels cette option est + nécessaire : quand le terminal réinterprète la sortie avant de l'écrire vers + un ficher. Le jeu de caractères défini avec --output-charset + est honoré. + +

+ +
--flush-on-close + +

+ Indique au programme d'envoyer toutes les données cachées en mémoire vers le + support de stockage lors de la fermeture de fichiers ouverts en + écriture. Ceci peut être utilisé pour éviter la perte de données lors de + coupures de courant ou pour contourner certains problèmes du système + d'exploitation ou de pilotes. L'inconvénient est que le multiplexage sera + plus long du fait que mkvmerge devra attendre que toutes les données soient + écrites sur le support de stockage avant de quitter. Voir les problèmes + #2469 et #2480 sur le suivi des bogues de MKVToolNix pour des discussions + approfondies sur les avantages et inconvénients. + +

+ +
--ui-language code + +

+ Force les traductions pour la langue code à utiliser + (par ex. 'fr_FR' pour les traductions françaises). Saisir + 'list' comme code obligera le + logiciel à générer la liste des traductions disponibles. + +

+ +
--abort-on-warnings + +

+ Demande au programme d'abandonner après le premier avertissement. Le code de + fermeture sera égal à 1. + +

+ +
--deterministic seed + +

+ Permet la création de fichiers identiques à l'octet près si la même version + de mkvmerge(1) est utilisée avec les mêmes fichiers source, le même jeu + d'options et la même amorce. Noter que le champ d'information de segment + « date » n'est pas écrit dans ce mode. + +

+ + +

L'amorce peut être une chaîne quelconque, pas nécessairement un nombre.

+ + +

+ L'obtention de fichiers identiques à l'octet près ne peut être garantie que + dans les conditions suivantes : + +

+ + +
    + +
  1. + +

    La même version de mkvmerge(1) construite avec les mêmes versions de libEBML + et de libMatroska est utilisée. +

    + +
  2. + + +
  3. + +

    Les fichiers source sont identiques à l'octet près.

    + +
  4. + + +
  5. + +

    Les mêmes options en ligne de commande sont utilisées dans le même ordre (à + l'exception notable de --output …). +

    + +
  6. + +
+ + +

+ Utiliser d'autres versions de mkvmerge(1) ou d'autres options en ligne de + commande peut résulter en un fichier identique à l'octet, mais ce n'est pas + garanti. + +

+ +
--debug topic + +

+ Activer le débogage pour une fonctionnalité spécifique. Cette option est + utile uniquement pour les développeurs. + +

+ +
--engage feature + +

+ Active les fonctionnalités expérimentales. Une liste des fonctionnalités + disponibles peut être demandée avec mkvmerge --engage + list. Ces fonctionnalités ne devraient pas être utilisées en + situations normales. + +

+ +
--gui-mode + +

+ Active l'interface graphique utilisateur. Dans ce mode, des lignes + spécialement formatées peuvent être générées et informer une GUI de la + situation. Ces messages suivent le format + '#GUI#message'. Le message peut être suivi d'une paire + clé/valeur comme + '#GUI#message#key1=value1#key2=value2…'. Ni les messages + ni les clés ne sont traduits, et sont toujours générés en anglais. + +

+ +
@options-file.json + +

+ Lit les arguments additionnels de ligne de commande depuis le fichier + options-file. Voir la section fichiers d'options pour d'autres + informations. + +

+ +
--capabilities + +

+ Liste les informations à propos des fonctionnalités optionnelles qui ont été + compilées et quitte. La première ligne de sortie sera l'information de + version. Toutes les lignes suivantes contiennent exactement un mot dont la + présence indique que la fonctionnalité a été compilée. Ces fonctionnalités + sont : + +

+ + +
    + +
  • + +

    + 'FLAC' -- lecture raw FLAC fichiers et + gestion + FLAC pistes dans d'autres conteneurs, e.g. + Ogg(tm) or Matroska(tm). + +

    + +
  • + +
+ +
-h, --help + +

+ Affiche les informations d'utilisation et quitte. + +

+ +
-V, --version + +

+ Affiche les informations de version et quitte. + +

+ +
+ + +

3. Utilisation

+ + +

+ Pour chaue fichier, l'utilisateur peut sélectionner quelle pistes mkvmerge(1) + devrait prendre. Elles sont toutes mises dans le fichier spécifié avec + -o. Une liste des formats source connus (et pris en charge) + peut être obtenue avec l'option -l. + +

+ + +
+

Important:

+ +

+ L'ordre des options en ligne de commande est important. Les nouveaux + utilisateurs devraient lire la section "Ordre des options" . + +

+ +
+ +

4. Ordre des options

+ + + +

+ L'ordre dans lequel les options sont saisies est important pour quelques + options. Les options appartiennent à deux catégories : + +

+ + +
    + +
  1. + +

    + Les options qui affectent le programme globalement et ne sont pas liées à un + fichier source. Ce sont en particulier, mais pas seulement, + --command-line-charset, --output ou + --title. Elles peuvent apparaître n'importe où sur la ligne + de commande. + +

    + +
  2. + + +
  3. + +

    + Les options qui affectent un fichier source unique ou une piste unique d'un + fichier source. Ces options s'appliquent toutes au fichier source suivant + sur la ligne de commande. Toutes les options s'appliquant au même fichier + source (ou aux pistes du même fichier source) peuvent être écrites dans un + ordre quelconque du moment qu'elles apparaissent avant ce nom de fichier + source. Des exemples pour des options s'appliquant à un fichier source sont + --no-chapters ou --chapter-charset. Des + exemples pour options s'appliquant à une piste unique sont + --default-duration ou --language. + +

    + +
  4. + +
+ + +

+ Les options sont traitées de la gauche vers la droite. Si une option + apparaît plusieurs fois dans le même contexte, alors la dernière sera + utilisée. Le titre sera donc défini à "Autre chose" dans l'exemple + suivant : + +

+ +
$ mkvmerge -o output.mkv --title 'This and that' input.avi --title 'Something else'
+ +

+ L'exemple suivant montre qu'utiliser l'option --language 2 + fois est correct parce qu'elles sont utilisées dans des contextes + différents. Même si on les applique à la même ID de piste, elles + s'appliquent à des fichiers source différents et donc des contextes + différents : + +

+ +
$ mkvmerge -o output.mkv --language 0:fre français.ogg --language 0:deu deutsch.ogg
+

5. Exemples

+ + +

+ Supposons un fichier appelé MyMovie.avi et la piste audio dans un fichier + séparé , par ex. 'MyMovie.wav'. On veut d'abord encoder + l'audio en OggVorbis(tm) : + +

+ +
$ oggenc -q4 -oMyMovie.ogg MyMovie.wav
+ +

+ Après quelques minutes, on peut joindre l'audio et la vidéo : + +

+ +
$ mkvmerge -o MyMovie-with-sound.mkv MyMovie.avi MyMovie.ogg
+ +

+ Si AVI contient déjà une piste audio alors elle sera aussi + copiée (si mkvmerge(1) prend en charge le format audio). Pour l'éviter, faire + simplement + +

+ +
$ mkvmerge -o MyMovie-with-sound.mkv -A MyMovie.avi MyMovie.ogg
+ +

+ Après réflexion, une autre piste audio est numérisée, par ex. les + commentaires du réalisateur ou une autre langue vers + 'MyMovie-add-audio.wav'. On peut l'encoder à nouveau et + la joindre aux autres fichiers : + +

+ +
$ oggenc -q4 -oMyMovie-add-audio.ogg MyMovie-add-audio.wav
+$ mkvmerge -o MM-complete.mkv MyMovie-with-sound.mkv MyMovie-add-audio.ogg
+ +

+ Un résultat similaire peut être obtenu avec + +

+ +
$ mkvmerge -o MM-complete.mkv -A MyMovie.avi MyMovie.ogg MyMovie-add-audio.ogg
+ +

+ Exécuter maintenant mplayer(tm) et apprécier. En cas + de pistes audio multiples (ou même vidéo) alors il est possible d'indiquer à + mplayer(tm) quelle piste jouer avec les options + '-vid' et '-aid'. Celles-ci sont basées + sur 0 et ne différencient pas la vidéo et l'audio. + +

+ + +

+ On peut obtenir un piste audio synchronisée facilement. D'abord déterminer + quel ID de piste la piste Vorbis a avec + +

+ +
$ mkvmerge --identify outofsync.ogg
+ +

+ Il est maintenant possible d'utiliser cet ID dans la ligne de commande + suivante : + +

+ +
$ mkvmerge -o goodsync.mkv -A source.avi -y 12345:200 outofsync.ogg
+ +

+ Cela ajouterait 200 ms de silence au début de la piste audio avec l'ID + 12345 issue de 'outofsync.ogg'. + +

+ + +

+ Quelques films débutent correctement synchronisés puis se désynchronisent + lentement subissent. Pour ces films, on peut spécifier un délai appliqué à + tous les horodatages -- aucune donnée ajoutée ou retirée. Si le délai est + trop petit/grand, le résultat est mauvais. Un exemple est un épisode + transcodé qui était décalé de 0.2 secondes à la séquence qui était longue de + 77340 trames. À 29.97 tps + 0.2 seconde correspond à approx. 6 + trames. Opération appliquée + +

+ +
$ mkvmerge -o goodsync.mkv -y 23456:0,77346/77340 outofsync.mkv
+ +

+ Le résultat était correct. + +

+ + +

+ Les options de synchronisation peuvent aussi être utilisées pour les + sous-titres de la même manière. + +

+ + +

+ Pour les sous-titres texte on peut soit utiliser un programme Windows (comme + SubRipper(tm)) ou le paquet + subrip(tm) de la source de + transcode(1)dans + le répertoire 'contrib/subrip'. L'opération générale est + : + +

+ + +
    + +
  1. + +

    extrait un flux de sous-titres brut depuis la source :

    +
    $ tccat -i /path/to/copied/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o mymovie
    +
  2. + + +
  3. + +

    convertit les images PGM résultantes en texte avec gocr :

    +
    $ pgm2txt mymovie
    +
  4. + + +
  5. + +

    vérifie l'orthographe des fichiers texte résultants :

    +
    $ ispell -d american *txt
    +
  6. + + +
  7. + +

    convertit les fichiers texte en fichier SRT :

    +
    $ srttool -s -w -i mymovie.srtx -o mymovie.srt
    +
  8. + +
+ + +

+ Le fichier résultant peut être utilisé comme fichier source pour mkvmerge(1) + : + +

+ +
$ mkvmerge -o mymovie.mkv mymovie.avi mymovie.srt
+ +

+ Il est facile de spécifier la langue d'une piste donnée. D'abord trouver le + code ISO 639-2 de la langue. mkvmerge(1) peut lister tous ces codes : + +

+ +
$ mkvmerge --list-languages
+ +

+ Trouver dans la liste la langue souhaitée. Supposons qu'il y a 2 pistes + audio dans un fichier Matroska(tm) dont il faut définir les codes langue et + que leurs ID de pistes sont 2 et 3. Cela peut être réalisé avec + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut without-lang-codes.mkv
+ +

+ On peut voir qu'on peut utiliser le commutateur --language + de multiples fois. + +

+ + +

+ Peut-être que vous aimeriez aussi que le lecteur utilise la langue + Néerlandaise comme langue par défaut. Vous avez également des sous-titres + supplémentaires, en Anglais et en Français, et que le lecteur désire + afficher les français par défaut. Cela peut être fait avec + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut --default-track-flag 3 without-lang-codes.mkv --language 0:eng english.srt --default-track-flag 0 --language 0:fre french.srt
+ +

+ Si les indicateurs de langue ou de « Piste par défaut » spécifiés dans la + sortie de mkvinfo(1) ne sont pas visibles, merci de lire la section relative + aux valeurs par défaut. + +

+ + +

+ Désactiver la compression d'un fichier source. + +

+ +
$ mkvmerge -o no-compression.mkv --compression -1:none MyMovie.avi --compression -1:none mymovie.srt
+ +

6. ID de pistes

+ + + +

6.1. ID de pistes normales

+ + + +

+ Quelques unes des options pour mkvmerge(1) nécessitent un ID de piste pour + spécifier à quelle piste elles devraient s'appliquer. Ces ID de pistes sont + imprimés par les lecteurs lors du démuxage du fichier source actuel., ou si + mkvmerge(1) est appelé avec l'option --identify. + Un exemple d'une telle sortie : + +

+ +
$ mkvmerge -i v.mkv
+File 'v.mkv': container: Matroska
+Track ID 0: video (V_MS/VFW/FOURCC, DIV3)
+Track ID 1: audio (A_MPEG/L3)
+ +

+ Ne pas confondre les ID de pistes qui sont assignés aux pistes placées dans + le fichier MKV cible avec les ID de pistes des fichiers sources. Seuls les + ID de pistes des fichiers sources sont utilisés pour les options nécessitant + ces valeurs. + +

+ + +

+ Noter aussi que chaque fichier source possède son propre jeu d'ID de + pistes. Par conséquent les ID de pistes pour le fichier + 'file1.ext' tels que rapportés par 'mkvmerge + --identify' ne changent pas quelque soit le nombre de fichiers + sources ou dans quelle position 'file1.ext' est + utilisé. + +

+ + +

+ Les ID de pistes sont assignées comme ceci : + +

+ + +
    + +
  • + +

    + Les fichiers AVI : la piste vidéo a l'ID 0. Les pistes + audio ont leurs ID par ordre croissant et débutant à 1. + +

    + +
  • + + +
  • + +

    + Fichiers AAC, AC-3, MP3, + SRT et WAV : la piste une de ce fichier + prend l'ID 0. + +

    + +
  • + + +
  • + +

    + La plupart des autres fichiers : les ID de pistes sont assignées dans + l'ordre des pistes dans le fichiers en débutant à 0. + +

    + +
  • + +
+ + +

+ Les options qui utilisent les ID de pistes sont celles dont la description + contient 'TID'. Les options suivantes utilisent aussi des + ID de pistes : --audio-tracks, + --video-tracks, --subtitle-tracks, + --button-tracks and --track-tags. + +

+ + + +

6.2. ID de pistes spéciales

+ + + +

+ Il existe plusieurs ID qui ont une signification spéciale et qui + n'apparaissent pas lors de l'identification. + +

+ + +

+ L'ID de piste spéciale '-1' est un joker et applique le + commutateur donné à toutes les pistes qui sont lues depuis un fichier + source. + +

+ + +

+ L'ID de piste spécial « -2 » fait référence aux + chapitres d'un fichier source. Actuellement seule l'option + --sync utilise cet ID spécial. Comme alternative à + --sync -2:…, l'option --chapter-sync … + peut être utilisée. + +

+ + +

7. Gestion des langues

+ + + +

+ Matroska(tm) prend en charge deux types différents d'éléments de langue : + l'ancien élément « Language​ » déprécié contenant des codes ISO 639-2 alpha + 3, et les nouvelles balises « LanguageIETF » qui contiennent des balises de + langue IETF BCP 47. Toutes les options de mkvmerge(1) qui acceptent une + langue acceptent la balise de langue BCP 47. Quand c'est possible, + mkvmerge(1) dérivera la valeur de l'élément « Language » déprécié à partir + des balises de langue BCP 47. + +

+ + +

+ Lors de l'identification d'un fichier en mode JSON, les éléments + « LanguageIETF » d'entête de piste existants seront convertis vers la + propriété de piste language_ietf. + +

+ + +

+ Lors de l'écriture d'un fichier, mkvmerge(1) écrira toujours les éléments + « LanguageIETF », « ChapLanguageIETF » et « TagLanguageIETF » (ces deux + derniers seulement si des chapitres ou des balises sont écrites, + respectivement). En plus de ces éléments, les anciens éléments + correspondants seront écrits ; ils seront définis comme la partie du code + ISO 639-2 de la balise de langue BCP 47. Par exemple quand la langue de + piste est définie en sr-Cyrl-RS, « LanguageIETF » sera + défini en sr-Cyrl-RS et l'ancien élément « Language » + sera défini en srp. + +

+ + +

+ Lors de la lecture de fichiers (Matroska, fichiers XML de balises ou de + chapitres, etc.) qui contiennent déjà des éléments « …LanguageIETF », ces + éléments seront conservés. Sinon les éléments « …LanguageIETF » seront + ajoutés selon les options en ligne de commande et les autres éléments + « …Language » existants dépréciés. + +

+ + +

+ a création des nouveaux éléments peut être complètement désactivée avec + l'option en ligne de commande --disable-language-ietf. Elle + prend effet sur les trois nouveaux éléments. + +

+ + +

+ Il est possible de choisir la méthode de normalisation appliquée aux + sous-balises de langue étendue avec le paramètre --normalize-language-ietf. + +

+ +

8. Fichiers texte et conversions de jeux de caractères

+ + +
+

Note:

+ +

+ Cette section s'applique à tous les logiciels de MKVToolNix même si elle ne + mentionne que mkvmerge(1). + +

+ +
+ + +

8.1. Introduction

+ + +

+ Tout le texte dans un fichier Matroska(tm) est encodé en UTF-8. Cela signifie + que mkvmerge(1) doit convertir chaque fichier texte lu et chaque texte donné + sur la ligne de commande d'un jeu de caractères en UTF-8. En corollaire, + cela signifie aussi que la sortie de mkvmerge(1) doit être convertie d'UTF-8 + vers ce jeu de caractères, par ex. si une traduction autre qu'Anglaise est + utilisée avec --ui-language + ou pour un texte provenant d'un fichier Matroska(tm). + +

+ + +

+ mkvmerge(1) effectue cette conversion automatiquement d'après la présence + d'un marqueur d'ordre d'octet (byte order marker, soit : + BOM) ou la « locale » du système. Le jeu de caractères + déduit de la « locale » dépend du système d'exploitation sur lequel est + exécuté mkvmerge(1). + +

+ + + +

8.2. Marqueur d'ordre d'octet (byte order markers ou BOM)

+ + + +

+ Les fichiers texte qui débutent avec un BOM sont déjà encodés avec une des + représentations UTF. mkvmerge(1) prend en charge les cinq modes suivant : + UTF-8, UTF-16 Little et Big Endian, UTF-32 Little et Big Endian. Les + fichiers texte avec un BOM sont automatiquement convertis en UTF-8. Tout + paramètre qui autrement définirait le jeu de caractères pour un tel fichier + (par ex. --sub-charset) + est silencieusement ignoré. + +

+ + + +

8.3. Linux et les systèmes de type Unix incluant macOS

+ + + +

+ Sur les systèmes de type Unix mkvmerge(1) utilise l'appel système + setlocale(3) + qui à son tour utilise les variables d'environnement + LANG, LC_ALL et + LC_CYPE. Le jeu de caractères résultant est souvent un de + la famille UTF-8 ou ISO-8859-* et est utilisé pour toutes les opérations de + fichier texte, pour l'encodage des chaînes sur la ligne de commande et pour + la sortie vers la console. + +

+ + + +

8.4. Windows

+ + + +

+ Sur Windows, le jeu de caractères par défaut utilisé pour convertir les + fichiers texte est déterminé par un appel au système d'appel + GetACP(). + +

+ + +

+ La lecture de la ligne de commande est effectuée avec la fonction + GetCommandLineW() qui retourne déjà une chaîne + Unicode. Par conséquent l'option --command-line-charset est + ignorée sur Windows. + +

+ + +

+ La sortie vers la console consiste en trois scénarios : + +

+ + +
    + +
  1. + +

    + Si la sortie est redirigée avec l'option --redirect-output, + alors le jeu de caractères par défaut est UTF-8. Ceci peut être modifié avec + --output-charset. + +

    + +
  2. + + +
  3. + +

    + Si la sortie est redirigée avec cmd.exe elle-même, par + ex. avec mkvinfo file.mkv > info.txt, alors le jeu de + caractères est toujours UTF-8 et ne peut pas être modifié. + +

    + +
  4. + + +
  5. + +

    + Sinon (à l'écriture directe vers la console) la fonction Windows + WriteConsoleW() est utilisée et l'option --output-charset + est ignorée. La console devrait être capable de sortir tous les caractères + Unicode pour lesquels la prise en charge de la langue correspondante est + assurée (par ex. les caractères Chinois ne devraient pas être affichés sur + les versions Anglaises de Windows). + +

    + +
  6. + +
+ + + +

8.5. Options de ligne de commande

+ + + +

+ Les options suivantes existent et permettent de spécifier les jeux de + caractères : + +

+ + +
    + +
  • + +

    + --sub-charset + pour les fichiers de sous-titres texte et les pistes de sous-titres texte + stockées dans des formats de conteneurs pour lesquels le jeu de caractères + ne peut pas être déterminé sans ambiguïté (par ex. les fichiers Ogg), + +

    + +
  • + + +
  • + +

    + --chapter-charset + pour les fichiers texte de chapitres et pour les chapitres et titres de + fichiers stockés dans des formats de conteneur pour lesquels le jeu de + caractères ne peut pas être déterminé sans ambiguïté (par ex. les fichiers + Ogg pour les informations de chapitres, les pistes et titres de fichiers + etc. ; les fichiers MP4 pour les informations de chapitres), + +

    + +
  • + + +
  • + +

    + --command-line-charset + pour toutes les chaînes sur la ligne de commande, + +

    + +
  • + + +
  • + +

    + --output-charset + pour toutes les chaînes écrites vers la console ou vers un fichier si la + sortie a été redirigée avec l'option --redirect-output. + Sue les système non Windows, le jeu de caractères par défaut pour la sortie + est celui actuel du système. Sur Windows c'est par défaut UTF-8 pour la + redirection avec --redirect-output + et avec cmd.exe elle-même, par ex. mkvinfo + file.mkv > info.txt. + +

    + +
  • + +
+ + +

9. Fichiers d'options

+ + + +

+ Un fichier d'options est un fichier où mkvmerge(1) peut lire des arguments en + ligne de commande supplémentaires. Ce peut être utilisé pour contourner + certaines limitations du shell ou du système d'exploitation à l'exécution de + programmes externes comme une longueur de ligne de commande limitée. + +

+ + +

+ Un fichier d'option contient des données formatées en JSON. Son contenu doit + être un tableau valide JSON comprenant seulement des chaînes + JSON. L'encodage du fichier doit être UTF-8. Le fichier ne devrait pas + débuter avec un marquer d'ordre d'octet (BOM), mais si + c'est le cas, il sera ignoré. + +

+ + +

+ Les règles pour échapper les caractères spéciaux en JSON sont celles de la + spécification JSON officielle, RFC 7159. + +

+ + +

+ Le nom de fichier d'option lui-même doit être spécifié comme argument en + ligne de commande et préfixé du caractère '@'. + +

+ + +

+ La ligne de commande 'mkvmerge -o "my file.mkv" -A "a movie.avi" + sound.ogg' pourrait être convertie en le fichier d'options JSON + suivant nommé par ex. 'options.json' : + +

+ +
[
+  "-o",
+  "c:\\Matroska\\my file.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "a movie.avi",
+  "sound.ogg"
+]
+ +

+ La commande correspondante serait alors 'mkvmerge + @options.json'. + +

+ +

10. Liage de fichiers

+ + +

+ Matroska(tm) prend en charge le liage de ficher qui indique simplement qu'un + fichier spécifique est le prédécesseur ou successeur du fichier + courant. Précisément, ce ne sont pas les fichiers qui sont liés mais les + segments Matroska(tm). Comme la plupart des fichiers ne contiendront + probablement qu'un segment Matroska(tm), les explications suivantes utilisent + l'expression « liage de ficher » bien que « liage de segment » serait plus + appropriée. + +

+ + +

+ Chaque segment est identifié par un UID de segment unique large de 128 + bit. Cet UID est automatiquement généré par mkvmerge(1). Le liage est + principalement réalisé en plaçant les UID de segment (abrévié en : + SID) du fichier précédent/suivant dans les informations + d'entête de segment. mkvinfo(1) affiche ces SID s'il les + trouve. + +

+ + +

+ Si un fichier est scindé en plusieurs plus petits et le liage est utilisé, + alors les horodatages ne recommenceront pas à 0 mais vont continuer où ils + se sont terminés dans le dernier fichier. Comme cela le temps absolu est + conservé même si les fichiers précédents ne sont pas disponibles (par ex. en + diffusion de flux). En l'absence de liage, les horodatages devraient + commencer à 0 pour chaque fichier. Par défaut mkvmerge(1) n'utilise pas le + liage de fichier. Pour l'utiliser, il faut l'activer avec l'option + --link. Cette option est seulement utile si la scission est + aussi activée. + +

+ + +

+ Que la scission soit active ou pas, l'utilisateur peut indiquer à mkvmerge(1) + de lier les fichiers produits à des SID spécifiques. Cela + est obtenu avec les options --link-to-previous et + --link-to-next. Ces options acceptent un segment + SID dans le format que mkvinfo(1) génère : 16 nombres + hexadécimaux entre 0x00 et 0xff + chacun préfixé avec '0x', par ex. '0x41 0xda 0x73 + 0x66 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 0x5e 0xca 0xb3 + 0x93'. Une forme raccourcie peut aussi être utilisée : 16 nombres + hexadécimaux entre 0x00 et 0xff + sans le préfixe '0x' et sans les espaces, par + ex. '41da7366d9cfb21eae78ebb45ecab393'. + +

+ + +

+ Si la scission est utilisée, alors le premier fichier est lié au + SID donné avec --link-to-previous et le + dernier fichier est lié au SID donné avec + --link-to-next. Si la scission n'est pas utilisée, alors le + fichier cible unique sera lié aux deux SIDs. + +

+ +

11. Valeurs par défaut

+ + +

+ La spécification Matroska(tm) dicte que certains éléments possèdent une + valeur par défaut. Habituellement un élément n'est pas écrit vers le fichier + si sa valeur est égale à la valeur par défaut afin de gagner de + l'espace. Les éléments que l'utilisateur pourraient manquer dans la sortie + de mkvinfo(1) sont les éléments langue et + l'indicateur de piste par défaut. La valeur par + défaut de la language est English + ('eng'), et la valeur par défaut de + l'indicateur de piste par défaut est + true. Par conséquent, si --language + 0:eng est utilisé pour une piste, alors il ne sera pas affiché dans + la sortie de mkvinfo(1). + +

+ +

12. Pièces jointes

+ + +

+ Peut-être l''utilisateur veut-il conserver quelques photos avec le fichier + Matroska(tm), ou utiliser des sous-titres SSA avec une police + de caractères TrueType(tm) spéciale qui est vraiment + rare. Dans ces cas-là, il faut joindre ces fichiers (= pièces) au fichier + Matroska(tm). Ils ne vont pas seulement y être ajoutés, mais aussi + embarqués. Un lecteur pourra alors afficher ces fichiers (cas des photos) ou + les utiliser pour rendre les sous-titres (cas des polices + TrueType(tm)). + +

+ + +

+ Voici un exemple comment joindre une photo et une police + TrueType(tm) au fichier cible : + +

+ +
$ mkvmerge -o output.mkv -A video.avi sound.ogg \
+  --attachment-description "Me and the band behind the stage in a small get-together" \
+  --attachment-mime-type image/jpeg \
+  --attach-file me_and_the_band.jpg \
+  --attachment-description "The real rare and unbelievably good looking font" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file really_cool_font.ttf
+ +

+ Si un Matroska(tm) contenant un fichier de pièces jointes est utilisé comme + fichier source, alors mkvmerge(1) copiera les pièces jointes dans le nouveau + fichier. La sélection des pièces jointes copiées ou non peut être modifiée + avec les options --attachments + et --no-attachments. + +

+ +

13. Chapitres

+ + +

+ Le système de chapitres de Matroska(tm) est plsu évolué que le vieux système + utilisé par les fichiers OGM. Les spécifications complètes + peuvent être trouvées sur le site Web + Matroska. + +

+ + +

+ mkvmerge(1) prend en charge 2 sortes de fichiers de chapitres comme + source. Le 1er format, appelé « simple format de chapitres », est le même + format que les outils OGM utilisent. Le 2nd format est une + format de chapitres en XML qui prend en charge toutes les fonctionnalités + de chapitres de Matroska(tm). + +

+ + +

+ En plus des fichiers de chapitres tels quels, mkvmerge(1) peut aussi lire les + chapitres d'autres formats de fichiers (par ex. MP4, Ogg, Blu-ray ou DVD). + +

+ + +

13.1. Le format de chapitres simple

+ + + +

+ Ce format consiste en paires de lignes qui débutent avec + 'CHAPTERxx=' et 'CHAPTERxxNAME=' + respectivement. La première contient l'horodatage de départ tandis que la + seconde contient le titre. Voici un exemple : + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=Intro
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=Baby prepares to rock
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=Baby rocks the house
+ +

+ mkvmerge(1) va transformer chaque paire ou lignes en un + ChapterAtom Matroska(tm). Il ne définit aucun + ChapterTrackNumber, ce qui signifie que tous les + chapitres s'appliquent tous à toutes les pistes du fichier. + +

+ + +

+ Comme c'est un fichier texte, une conversion du jeu de caractères pourrait + être nécessaire. Voir la section à propos des fichiers texte et jeux de + caractères pour savoir comment mkvmerge(1) convertit les jeux de + caractères. + +

+ + + +

13.2. Le format de chapitres basé sur XML

+ + +

+ Le format de chapitres basé sur XML ressemble à cet exemple : + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>A short chapter</ChapterString>
+        <ChapterLanguage>eng</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>A part of that short chapter</ChapterString>
+          <ChapterLanguage>eng</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ Avec ce format, trois choses sont possibles qui sont impossibles avec le + format de chapitres simple : + +

+ + +
    + +
  1. +

    L'horodatage de fin de chapitre peut être défini,

    +
  2. + +
  3. +

    les chapitres peuvent être imbriqués,

    +
  4. + +
  5. +

    la langue et le pays peuvent être définis.

    +
  6. + +
+ + +

+ La distribution mkvtoolnix contient quelques fichiers d'échantillon dans le + sous-dossier doc qui peuvent être utilisés comme point + de départ. + +

+ + +

+ La liste suivante montre les balises XML reconnues, leurs types de données + et, quand approprié, la plage valide pour leurs valeurs. + +

+ +
Chapters (master)
+  EditionEntry (master)
+    EditionUID (unsigned integer, valid range: 1 <= value)
+    EditionFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagDefault (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagOrdered (unsigned integer, valid range: 0 <= value <= 1)
+    ChapterAtom (master)
+      ChapterAtom (master)
+      ChapterUID (unsigned integer, valid range: 1 <= value)
+      ChapterTimeStart (unsigned integer)
+      ChapterTimeEnd (unsigned integer)
+      ChapterFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterFlagEnabled (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterSegmentUID (binary, valid range: 1 <= length in bytes)
+      ChapterSegmentEditionUID (unsigned integer, valid range: 1 <= value)
+      ChapterPhysicalEquiv (unsigned integer)
+      ChapterTrack (master)
+        ChapterTrackNumber (unsigned integer, valid range: 1 <= value)
+      ChapterDisplay (master)
+        ChapterString (UTF-8 string)
+        ChapterLanguage (UTF-8 string)
+        ChapterCountry (UTF-8 string)
+      ChapterProcess (master)
+        ChapterProcessCodecID (unsigned integer)
+        ChapterProcessPrivate (binary)
+        ChapterProcessCommand (master)
+          ChapterProcessTime (unsigned integer)
+          ChapterProcessData (binary)
+ + +

13.3. Lecture des chapitres de Blu-ray

+ + + +

+ mkvmerge(1) peut lire les chapitres de Blu-ray non protégés. Pour cela, il + faut utiliser le chemin d'une des listes de lecture MPLS avec le paramètre + --chapters. + +

+ + +

+ Exemple : --chapters + /srv/blurays/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. Lecture des chapitres des DVD

+ + + +

+ Quand MKVToolNix est compilé avec la bibliothèque + libdvdread(tm), mkvmerge(1) peut lire les chapitres de + DVD. Pour cela il faut utiliser le chemin d'un des dossiers ou fichiers sur + le DVD avec le paramètre--chapters. Comme un DVD peut + posséder plus d'un titre et que chaque titre a son propre ensemble de + chapitres, il est possible d'ajouter un double point suivi du numéro de + titre désiré à la fin de l'argument de nom de fichier. Le numéro de titre + par défaut est 1. + +

+ + +

+ Exemple : --chapters /srv/dvds/BigBuckBunny/VIDEO_TS:2 + +

+ + + +

13.5. Notes générales

+ + +

+ En scindant des fichiers, mkvmerge(1) ajustera correctement aussi les + chapitres. Cela signifie que chaque fichier inclue seulement les entrées de + chapitres qui s'y appliquent, et que les horodatages seront décalés pour + correspondre aux nouveaux horodatages de chaque fichier cible. + +

+ + +

+ mkvmerge(1) est capable de copier des chapitres de fichiers sources + Matroska(tm) à moins que cela soit explicitement désactivé avec l'option --no-chapters. + Les chapitres de tous les fichiers sources (fichiers Matroska(tm), fichiers + Ogg, fichiers MP4, fichiers texte de chapitres) ne sont + habituellement pas fusionnés mais laissés séparés en + ChapterEditions. C'est seulement si les chapitres + sont lus depuis plusieurs fichiers Matroska(tm) ou XML qui partagent les + mêmes UID d'édition que les chapitres seront fusionnés en un unique + ChapterEdition. Si cette fusion est aussi souhaitée + dans d'autres situations, alors l'utilisateur devra d'abord extraire les + chapitres de toutes les sources avec mkvextract(1), fusionner les fichiers + XML manuellement et enfin les multiplexer. + +

+ + +

14. Balises

+ + + +

14.1. Introduction

+ + + +

+ Le système de balises Matroska(tm) est similaire à celui des autres conteneurs + : un ensemble de paires KEY=VALUE. Cependant, dans + Matroska(tm) ces balises peuvent aussi être imbriquées, et + KEY et VALUE des éléments à + eux seuls. Le fichier d'exemple example-tags-2.xml + montre comment utiliser ce système. + +

+ + + +

14.2. Portée des balises

+ + + +

+ Les balises Matroska(tm) ne sont pas appliquées auto. au fichier + complet. C'est possible, mais elles peuvent aussi être appliquées à + différentes parties du fichier : à une ou plusieurs pistes, à un ou + plusieurs chapitres, voire à une combinaison des deux. La spécification + Matroska donne plus de détails sur cet état de fait. + +

+ + +

+ Un fait important est que les balises sont liées aux pistes ou aux chapitres + avec l'élément balise Matroska(tm) Targets, et que les + UID utilisés pour ce liage ne sont pas les ID de pistes + que mkvmerge(1) utilise partout. Les numéros utilisés sont plutôt les UID que + mkvmerge(1) calcule automatiquement (si la piste est issue d'un format de + fichier autre que Matroska(tm)) ou qui sont copiés du fichier source si la + piste du fichier source est un fichier Matroska(tm). Par conséquent il est + difficile de savoir quels UID utiliser dans le fichier de balises avant que + le fichier soit pris en charge par mkvmerge(1). + +

+ + +

+ mkvmerge(1) reconnaît deux options aveclesquelles on peut ajouter des balises + aux fichiers Matroska(tm) : les --global-tags + et the --tags. Le + différence est que la première, --global-tags, + fera les balises s'appliquer au fichier complet en retirant tous ces + éléments Targets mentionnés plus haut. La dernière + option, --tags, insérera + automatiquement l'UID que mkvmerge(1) génère pour la balise spécifiée avec la + partie TID de l'option --tags. + +

+ + + +

14.3. Exemple

+ + +

+ Disons qu'on veut ajouter des balises à une piste vidéo lue depuis un + fichier AVI. mkvmerge --identify + file.avi indique que cet ID de piste vidéo (à ne pas confondre + avec les UID !) est 0. À partir de là, on peut créer le fichier de balises + en laissant tous les éléments Targetset appeler + mkvmerge(1) : + +

+ +
$ mkvmerge -o file.mkv --tags 0:tags.xml file.avi
+ + +

14.4. Format de fichier de balises

+ + +

+ mkvmerge(1) prend en charge un format de fichier balises en XML. Le format + est très proche de la spécification + Matroska. Les distributions de binaires et sources de MKVToolNix + contiennent un échantillon de fichier appelé + example-tags-2.xml qui liste simplement toutes les + balises connues et qui peut être utilisé comme base pour des fichiers + balises réels. + +

+ + +

+ Les bases sont : + +

+ + +
    + +
  • +

    L'élément le plus externes doit être <Tags>. +

    +
  • + +
  • + +

    Une balise logique est contenue à l'intérieur d'une paire de balises XML + <Tag>. +

    + +
  • + +
  • +

    Les espaces blancs avant et après le contenu d'une balise sont ignorées.

    +
  • + +
+ + + +

14.5. Types de données

+ + +

+ Le nouveau système de balises Matroska(tm) reconnaît seulement deux types de + données, une chaîne UTF-8 et un type binaire. Le premier est utilisé pour le + nom de balise et l'élément <String> tandis que + le type binaire est utilisé pour l'élément + <Binary>. + +

+ + +

+ Comme les données binaires ne peuvent pas être stockées dans un fichier + XML, mkvmerge(1) prend en charge deux autres méthodes pour les stocker. Si + le contenu d'une balise XML débute avec '@', alors le + texte suivant est traité comme un nom de fichier. Le contenu du fichier + correspondant est copié dans l'élément Matroska(tm). + +

+ + +

+ Sinon les données sont attendues encodées en Base64. C'est un encodage qui + transforme les données binaires en un jeu limité de caractères + ASCII et qui est utilisé par ex. dans les programmes de + courriels. mkvextract(1) sortira des données encodées en Base64 pour les + éléments binaires. + +

+ + +

+ Le système de balises obsolète reconnaît d'autres types de données qui + peuvent être retrouvés dans les spécifications de balises Matroska(tm). Comme + mkvmerge(1) ne prend plus en charge ce système, ces types ne sont pas décrits + ici. + +

+ + + +

14.6. Balises connues pour le format de fichier XML

+ + + +

+ La liste suivante montre les balises XML reconnues, leurs types de données + et, quand approprié, la plage valide pour leurs valeurs. + +

+ +
Tags (master)
+  Tag (master)
+    Targets (master)
+      TargetTypeValue (unsigned integer)
+      TargetType (UTF-8 string)
+      TrackUID (unsigned integer)
+      EditionUID (unsigned integer)
+      ChapterUID (unsigned integer)
+      AttachmentUID (unsigned integer)
+    Simple (master)
+      Simple (master)
+      Name (UTF-8 string)
+      TagLanguage (UTF-8 string)
+      DefaultLanguage (unsigned integer)
+      String (UTF-8 string)
+      Binary (binary)
+ +

15. Informations de segment

+ + + +

+ Avec un fichier XML d'informations de segment, il est possible de définir + certaines valeurs dans le champ d'entête d'"informations de + segment" d'un fichier Matroska(tm). Toutes ces valeurs ne peuvent pas + être définies par d'autres options en ligne de commande. + +

+ + +

+ D'autres champs d'entête d'"informations de segment" peuvent être + définis via les options en ligne de commande mais pas via le fichier + XML. Ceci inclue par ex. les options --title et + --timestamp-scale. + +

+ + +

+ Il existe d'autres éléments qui ne peuvent être définis ni par des options + en ligne de commande ni par les fichiers XML. Ceux-ci incluent les éléments + suivants : DateUTC (aussi connu en "muxing + date"), MuxingApp, WritingApp et + Duration. Ils sont toujours définis par mkvmerge(1) + lui-même. + +

+ + +

+ La liste suivante montre les balises XML reconnues, leurs types de données + et, quand approprié, la plage valide pour leurs valeurs. + +

+ +
Info (master)
+  SegmentUID (binary, valid range: length in bytes == 16)
+  SegmentFilename (UTF-8 string)
+  PreviousSegmentUID (binary, valid range: length in bytes == 16)
+  PreviousSegmentFilename (UTF-8 string)
+  NextSegmentUID (binary, valid range: length in bytes == 16)
+  NextSegmentFilename (UTF-8 string)
+  SegmentFamily (binary, valid range: length in bytes == 16)
+  ChapterTranslate (master)
+    ChapterTranslateEditionUID (unsigned integer)
+    ChapterTranslateCodec (unsigned integer)
+    ChapterTranslateID (binary)
+

16. Disposition d'un fichier Matroska

+ + +

+ La disposition d'un fichier Matroska(tm) est assez flexible. mkvmerge(1) rendra + un fichier de manière prédéfinie. Le fichier résultant ressemble à ceci : + +

+ + +

+ [EBML head] [segment {meta seek #1} [segment information] [track + information] {attachments} {chapters} [cluster 1] {cluster 2} ... {cluster + n} {cues} {meta seek #2} {tags}] + +

+ + +

+ Les éléments entre accolades sont facultatifs et dépendent des contenus et + des options utilisées. Quelques remarques : + +

+ + +
    + +
  • + +

    + meta seek #1 inclut seulement un petit nombre d'éléments de niveau 1, et + seulement s'ils existent réellement : pièces jointes, chapitres, points de + montage, balises, meta seek #2. D'anciennes versions de mkvmerge(1) plaçaient + aussi les grappes dans cet élément meta seek. Par conséquent, il était + nécessaire de deviner de manière imprécise combien et assez d'espace à + réserver. Cela échouait souvent. Maintenant, seules les grappes sont + stockées dans meta seek #2, et meta seek #1 se réfère à l'élément meta seek + #2. + +

    + +
  • + + +
  • + +

    Les éléments de pièces jointes, de chapitres et de balises sont seulement + présents s'ils ont été ajoutés. +

    + +
  • + +
+ + +

+ Le fichier Matroska(tm) le plus petit possible devrait ressembler à ceci : + +

+ + +

+ [EBML head] [segment [segment information] [track information] [cluster 1]] + +

+ + +

+ Ceci devrait être le cas pour les fichiers audio seuls. + +

+ +

17. Fichiers externes d'horodatage

+ + +

+ mkvmerge(1) permet lui-même à l'utilisateur de choisir l'horodatage d'une + piste spécifique. Ceci peut être utilisé pour créer des fichiers avec une + vidéo à débit de trames variable ou inclure des blancs dans l'audio. une + trame dans ce cas est l'unité que mkvmerge(1) crée séparément par bloc + Matroska(tm). Pour la vidéo c'est exactement une trame, pour l'audio c'est un + paquet du type audio spécifique. Par ex. pour AC-3, cela + serait un paquet contenant 1536 échantillons. + +

+ + +

+ Les fichiers d'horodatage qui sont utilisés quand des pistes sont ajoutées + l'une à l'autre doivent seulement être spécifiés pour la première partie + dans une chaîne de pistes. Par ex., pour ajouter deux fichiers, v1.avi et + v2.avi, et utiliser les horodatages, alors la ligne de commande ressemblera + à ceci : + +

+ +
$ mkvmerge ... --timestamps 0:my_timestamps.txt v1.avi +v2.avi
+ +

+ mkvmerge(1) reconnaît quatre formats. La première ligne contient toujours le + numéro de version. Les lignes vides, les lignes ne contenant que des espaces + blanches et les lignes commençant avec '#' sont ignorées. + +

+ + +

17.1. Format de fichier d'horodatage v1

+ + +

+ Ce format débute avec la ligne de version. La seconde ligne déclare le + nombre par défaut de de trames par seconde. Toutes les lignes suivantes + contiennent trois chiffres séparés par une virgule : la trame de début + (0 est la première), la trame de fin et le nombre de + trames dans cette plage. Le nombre de FPS est un nombre + flottant avec un point '.' comme séparateur décimal. Les + plages peuvent contenir des blancs pour lesquels le FPS par + défaut est utilisé. Un exemple : + +

+ +
# format d'horodatage v1
+suppose 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. Format de fichier d'horodatage v2

+ + + +

+ Dans ce format chaque ligne contient un horodatage pour la trame + correspondante. Cet horodatage doit être donné en précision à la + milliseconde. Cela peut être un nombre flottant, sans obligation. Il + faut fournir au moins autant d'horodatage qu'il y a de + trames dans la piste. Les horodatages de ce fichier doivent être + triés. Exemple pour 25fps : + +

+ +
# format d'horodatage v2
+0
+40
+80
+ + +

17.3. Format de fichier d'horodatage v3

+ + +

+ Dans ce format chaque ligne contient une durée en secondes suivie par un + nombre facultatif de trames par seconde. Les deux peuvent être des nombres + flottants. Si le nombre de trames par seconde n'est pas présent, celui par + défaut est utilisé. Pour l'audio il est préférable de laisser le codec + calculer les horodatages de trames lui-même. Pour cela on devrait utiliser + 0.0 comme nombre de trames par seconde. Il est aussi + possible de créer des blancs dans le flux en utilisant les mot clé + 'gap' suivi par la durée de ce blanc. Exemple pour un + fichier audio : + +

+ +
# format d'horodatage v3
+suppose 0.0
+25.325
+7.530,38.236
+blanc, 10.050
+2.000,38.236
+ + +

17.4. Format de fichier d'horodatage v4

+ + +

+ Ce format esr identique au format v2. La seule différence est que les + horodatages n'ont pas à être triés. Ce format ne devrait presque jamais être + utilisé. + +

+ + +

18. Codes de fermeture

+ + + +

+ mkvmerge(1) quitte avec l'un de ces trois codes de fermeture : + +

+ + +
    + +
  • + +

    + 0 -- Ce code de sortie signifie que le multiplexage + s'est correctement terminé. + +

    + +
  • + + +
  • + +

    + 1 -- Dans ce cas mkvmerge(1) a émis au moins un + avertissement, mais le multiplexage s'est poursuivi. une avertissement est + préfixé avec le texte 'Avertissement :'. Selon les + problèmes le fichier résultant pourrait être OK ou pas. Il est fortement + recommandé à l'utilisateur de vérifier l'avertissement et le fichier + résultant. + +

    + +
  • + + +
  • + +

    + 2 -- Ce code de fermeture est utilisé après la survenue + d'une erreur. mkvmerge(1) abandonne juste après l'émission du message + d'erreur. Les messages d'erreur vont des arguments erronés en ligne de + commande aux erreurs de lecture/écriture en passant par les fichiers + corrompus. + +

    + +
  • + +
+ +

19. Variables d'environment

+ + + +

+ mkvmerge(1) utilise les variables par défaut qui déterminent la « locale » du + système (par ex. LANG et la famille + LC_*). Variables additionnelles : + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG et sa + forme courte MTX_DEBUG + +

Le contenu est traité comme s'il a été passé via l'option --debug. +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE et + sa forme courte MTX_ENGAGE + +

Le contenu est traité comme s'il a été passé via l'option --engage + option. +

+ +
+ +

20. Voir aussi

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. WWW

+ + +

+ La dernière version peut toujours être trouvée à la page d'accueil de MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..9367499078557c357d13e40a94196a512c1dddd8 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvpropedit.html @@ -0,0 +1,1341 @@ + + + + + mkvpropedit -- Modifier les propriétés des fichiers Matroska existants sans un remixage + complet + + + + +
mkvpropedit -- Modifier les propriétés des fichiers Matroska(tm) existants sans un remixage + complet +
+
+ +
+

1. Résumé

+ + +
mkvpropedit options {source-filename} {actions} +
+ +

2. Description

+ + +

+ Ce logiciel analyse un fichier Matroska(tm) existant et modifie quelques unes + de ses propriétés. Ensuite, il écrit ces modifications dans le fichier + existant. Parmi les propriétés qui peuvent être modifiées figurent les + éléments d'informations de segment (par ex. le titre) et les entêtes de + piste (par ex. le code langue, l'indicateur « Piste par défaut » ou le nom). + +

+ + +

+ Options : + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ Liste tous les noms de propriété connus et éditables, leur type (chaîne, + entier, booléen, etc.) et une courte description. Après quoi le logiciel + quitte. Par conséquent, le paramètre source-filename + n'a pas à être fourni. + +

+ +
-p, --parse-mode + mode + +

+ Définit le mode d'analyse. Le paramètre 'mode' peut + soit être 'fast' (aussi par défaut) ou + 'full'. Le mode 'fast' n'analyse pas + le fichier entier mais utilise les éléments de positionnement méta pour + situer les éléments nécessaires d'un fichier source. Dans 99% des cas, cela + est suffisant. Mais pour les fichiers qui ne contiennent pas d'éléments de + positionnement méta ou qui sont endommagés, l'utilisateur devrait définir le + mode d'analyse 'full'. L'analyse complète d'un fichier + peut prendre plusieurs minutes alors qu'une analyse rapide ne prend que + quelques secondes. + +

+ +
+ + +

+ Actions relatives aux pistes et propriétés d'informations de segment : + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit + selecteur + +

+ Définit la section de fichier Matroska(tm) (informations de segment ou + certaines entêtes de piste) sur lesquelles opèrent toutes les actions add, set et delete. Celle option peut + être utilisée de multiples fois afin de modifier plus d'un élément. + +

+ + +

+ Par défaut mkvpropedit(1) éditera la section d'informations de segment. + +

+ + +

+ Voir la section sélecteurs + d'édition pour une description complète de la syntaxe. + +

+ +
-a, --add + name=value + +

+ Ajoute une propriété name avec la valeur + value. La propriété sera ajoutée même si une telle + propriété existe déjà. Note : la plupart des propriétés sont uniques et ne + peuvent survenir plus d'une fois. + +

+ +
-s, --set + name=value + +

+ Définit toutes les occurrences de la proprété name à + la valeur value. Si une telle propriété n'existe pas, + alors elle sera ajoutée. + +

+ +
-d, --delete name + +

+ Supprime toutes les occurrences de lapropriété + name. Note : quelques propriétés sont requises et ne + peuvent être supprimées. + +

+ +
+ + +

+ Actions relatives aux balises et chapitres : + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags + selector:filename + +

+ Ajoute ou remplace des balises dans le fichier avec ceux de + filename ou les retire si filename + est vide. mkvpropedit(1) lit les mêmes formats de balises XML que mkvmerge(1). + +

+ + +

+ Le sélecteur doit être l'un de ces mots + all, global ou + track. pour all mkvpropedit(1) + remplacera ou retirera toutes les balises d'un fichier. Avec + global seules les balises globales seront remplacées ou + retirées. + +

+ + +

+ Avec track mkvpropedit(1) remplacera les balises pour + une piste spécifique. De plus les balises lues depuis + filename seront assignées à la même piste. La piste est + spécifiée comme les sélecteurs + d'édition sont spécifiés (voir ci-dessous), par ex. --tags + track:a1:new-audio-tags.xml. + +

+ +
--add-track-statistics-tags + +

+ Calcule les statistiques pour toutes les pistes dans un fichier et ajoute + des balises de statistiques pour elles. Si le fichier contient déjà de + telles balises, alors elles seront mises à jour. + +

+ +
--delete-track-statistics-tags + +

+ Supprime toutes les balises de statistiques de pistes du fichier. Si le + fichier n'en contient pas, alors il ne sera pas modifié. + +

+ +
-c, --chapters + filename + +

+ Ajoute ou remplace des chapitres dans le fichier avec ceux de + filename ou les retire si filename + est vide. mkvpropedit(1) lit les mêmes formats de chapitres XML et simples + que mkvmerge(1). + +

+ +
+ + +

+ Actions sur les pièces jointes : + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment filename + +

+ Ajoute une nouvelle pièce jointe depuis filename. + +

+ + +

+ Si l'option --attachment-name a été utilisée avant cette + option, alors sa valeur est utilisée comme nouveau nom de pièce + jointe. Sinon il est dérivé de filename. + +

+ + +

+ Si l'option --attachment-mime-type a été utilisée avant + cette option, alors sa valeur est utilisée comme nouveau type MIME de pièce + jointe. Sinon il est auto-détecté depuis le contenu de + filename. + +

+ + +

+ Si l'option --attachment-description a été utilisée avant + cette option, alors sa valeur est utilisée comme nouvelle description de + pièce jointe. Sinon aucune description ne sera définie. + +

+ + +

+ Si l'option --attachment-uid a été utilisée avant cette + option, alors sa valeur est utilisée comme nouvel UID de pièce jointe. Sinon + un UID aléatoire sera généré automatiquement. + +

+ +
--replace-attachment + selector:filename + +

+ Remplace une ou plusieurs pièces jointes qui correspondent au + selector avec le fichier + filename. S'il existe plus d'une correspondance avec + selector, alors tous leurs contenus seront remplacés + par le contenu de filename. + +

+ + +

+ Le sélecteur peut avoir une de 4 formes possibles qui + sont expliquées ci-dessous dans la section sélecteurs de pièce + jointe. + +

+ + +

+ Si l'option --attachment-name a été utilisée avant cette + option, alors sa valeur est définie comme nouveau nom pour chaque pièce + jointe modifiée. Sinon les noms ne sont pas modifiés. + +

+ + +

+ Si l'option --attachment-mime-type a été utilisée avant + cette option, alors sa valeur est définie comme nouveau type MIME pour + chaque pièce jointe modifiée. Sinon les types MIME ne sont pas modifiés. + +

+ + +

+ Si l'option --attachment-description a été utilisée avant + cette option, alors sa valeur est définie comme nouvelle description pour + chaque pièce jointe modifiée. Sinon les descriptions ne sont pas modifiées. + +

+ + +

+ Si l'option --attachment-uid a été utilisée avant cette + option, alors sa valeur est définie comme nouvel UID pour chaque pièce + jointe modifiée. Sinon les UID ne sont pas modifiés. + +

+ +
--update-attachment selector + +

+ Définit les propriétés d'une pièce jointe ou plus qui correspond à + selector. Si plus d'une pièce jointe existante + correspond à selector alors toutes leurs propriétés + seront mises à jour. + +

+ + +

+ Le sélecteur peut avoir une de 4 formes possibles qui + sont expliquées ci-dessous dans la section sélecteurs de pièce + jointe. + +

+ + +

+ Si l'option --attachment-name a été utilisée avant cette + option, alors sa valeur est définie comme nouveau nom pour chaque pièce + jointe modifiée. Sinon les noms ne sont pas modifiés. + +

+ + +

+ Si l'option --attachment-mime-type a été utilisée avant + cette option, alors sa valeur est définie comme nouveau type MIME pour + chaque pièce jointe modifiée. Sinon les types MIME ne sont pas modifiés. + +

+ + +

+ Si l'option --attachment-description a été utilisée avant + cette option, alors sa valeur est définie comme nouvelle description pour + chaque pièce jointe modifiée. Sinon les descriptions ne sont pas modifiées. + +

+ + +

+ Si l'option --attachment-uid a été utilisée avant cette + option, alors sa valeur est définie comme nouvel UID pour chaque pièce + jointe modifiée. Sinon les UID ne sont pas modifiés. + +

+ +
--delete-attachment selector + +

+ Supprime une pièce jointe ou plus qui correspond à + selector. + +

+ + +

+ Le sélecteur peut avoir une de 4 formes possibles qui + sont expliquées ci-dessous dans la section sélecteurs de pièce + jointe. + +

+ +
+ + +

+ Options pour les actions sur les pièces jointes : + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name name + +

+ Définit le nom à utiliser pour l'opération suivante + --add-attachment ou --replace-attachment. + +

+ +
--attachment-mime-type mime-type + +

+ Définit le type MIME à utiliser pour l'opération suivante + --add-attachment ou --replace-attachment. + +

+ +
--attachment-description description + +

+ Définit la description à utiliser pour l'opération suivante + --add-attachment ou --replace-attachment. + +

+ +
--enable-legacy-font-mime-types + +

+ Active l'utilisation des anciens types MIME pour certains + types de pièces jointes de polices de caractères. Par ex., + « application/x-truetype-font » sera utilisé pour les + polices TrueType au lieu de « fonts/ttf ». + +

+ + +

+ Ceci affecte l'ajout de nouvelles pièces jointes et le remplacement de + celles existantes, mais seulement si le nouveau type MIME + n'est pas spécifié. Les autres pièces jointes ne sont pas modifiées. + +

+ + +

+ Les types MIME affectés sont + « font/sfnt », « font/ttf » et + « font/collection ». Ils sont tous remplacés par + « application/x-truetype-fonts ». + « font/otf » est remplacé par + « application/vnd.ms-opentype ». + +

+ +
+ + +

+ Autres options : + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ Normalement quand l'utilisateur demande des modifications à la propriété + d'entête de piste « language », mkvpropedit(1) applique + les mêmes modifications au nouvel élément d'entête de piste + LanguageIETF en plus de l'élément traditionnel + Language. Si cette option est utilisée, la + modification s'applique seulement à l'élément traditionnel + Language. + +

+ + +

+ Cette option n'affecte pas les modifications demandées via la propriété + d'entête de piste « language-ietf ». + +

+ +
--normalize-language-ietf mode + +

+ Active la normalisation de toutes les étiquettes de langue IETF BCP 47 soit + en leur forme canonique avec le mode 'canonique', soit en + leur forme de sous-étiquettes de langue étendue avec le mode + 'extlang' soit en le désactivant avec le mode + 'off'. Par défaut la normalisation en forme canonique est + appliquée. + +

+ + +

+ Dans la forme canonique, toutes les sous-étiquettes avec des valeurs + préférées existantes sont remplacées par ces dernières. Ceci convertit par + ex. 'zh-yue-jyutping' en + 'yue-jyutping' ou 'fr-FX' en + 'fr-FR'. + +

+ + +

+ Pour la forme des sous-étiquettes de langue étendue, la forme canonique est + d'abord construite. Ensuite toutes les langues primaires pour lesquelles des + étiquettes de langue étendue existent sont remplacées par cette + sous-étiquettes de langue étendue et son préfixe. Ceci reconvertit par + ex. 'yue-jyutping' en + 'zh-yue-jyutping' mais n'a pas d'effet sur + 'fr-FR' car 'fr' n'est pas une + sous-étiquette de langue étendue. + +

+ + +

+ Cette normalisation est seulement appliquée aux éléments réellement + modifiés : + +

+ + +
    + +
  • + +

    + En édition des entêtes de pistes, seuls les éléments de langues de pistes + définis par d'édition des spécifications sont affectés. Les langues de + pistes qui ne sont pas éditées ne sont pas modifiées. Éditer une piste en + définissant seulement des propriétés autres que la langue n'affectera pas + cette langue non plus. + +

    + +
  • + + +
  • + +

    + En édition de chapitres, tous les éléments de langues de tous les éléments + de chapitres sont affectés parce que tous les chapitres existants sont + toujours entièrement remplacés. + +

    + +
  • + + +
  • + +

    + En édition d'étiquettes, seuls les éléments de langues des étiquettes + réellement remplacés sont affectés. Par exemple, en remplaçant les + étiquettes globales les étiquettes de pistes existantes ne sont pas + affectées. + +

    + +
  • + +
+ + +

+ La meilleure solution pour normaliser toutes les étiquettes existantes d'un + fichier est de le remixer avec mkvmerge(1) en définissant son option + « --normalize-language-ietf » selon le mode souhaité. + +

+ +
--command-line-charset character-set + +

+ Définit le jeu de caractères utilisé pour la conversion des chaînes fournies + en ligne de commande. Par défaut, celui-ci correspond à celui donné par la + « locale » du système. + +

+ +
--output-charset character-set + +

+ Définit le jeu de caractères dans lequel les chaînes en sortie sont + converties. Par défaut, celui-ci correspond à celui donné par la « locale » + du système. + +

+ +
-r, --redirect-output + file-name + +

+ Écrit tous les messages vers le fichier file-name + plutôt que vers la console. Bien que ceci puisse être réalisé facilement en + redirection de sortie, il y a des cas dans lesquels cette option est requise + : quand le terminal réinterprète la sortie avant de l'écrire vers un + fichier. Le jeu de caractères défini avec --output-charset + est honoré. + +

+ +
--ui-language code + +

+ Force les traductions pour la langue code à utiliser + (par ex. 'fr_FR' pour les traductions françaises). Saisir + 'list' comme code obligera le + logiciel à générer la liste des traductions disponibles. + +

+ +
--abort-on-warnings + +

+ Demande au programme d'abandonner après le premier avertissement. Le code de + fermeture sera égal à 1. + +

+ +
--debug topic + +

+ Activer le débogage pour une fonctionnalité spécifique. Cette option est + utile uniquement pour les développeurs. + +

+ +
--engage feature + +

+ Active les fonctionnalités expérimentales. Une liste des fonctionnalités + disponibles peut être demandées avec mkvpropedit --engage + list. Ces fonctionnalités ne devraient pas être utilisées en + situations normales. + +

+ +
--gui-mode + +

+ Active l'interface graphique utilisateur. Dans ce mode, des lignes + spécialement formatées peuvent être générées et informer une GUI de la + situation. Ces messages suivent le format + '#GUI#message'. Le message peut être suivi d'une paire + clé/valeur comme + '#GUI#message#key1=value1#key2=value2…'. Ni les messages + ni les clés ne sont traduits, et sont toujours générés en anglais. + +

+ +
-v, --verbose + +

+ Mode verbeux qui affiche tous les éléments Matroska(tm) importants à mesure + qu'ils sont lus. + +

+ +
-h, --help + +

+ Affiche les informations d'utilisation et quitte. + +

+ +
-V, --version + +

+ Affiche les informations de version et quitte. + +

+ +
@options-file.json + +

+ Lit des arguments supplémentaires en ligne de commande depuis le fichier + options-file. Pour une explication complète sur les + formats pris en charge pour de tels fichiers, voir la section nommée « + Fichiers d'options » sur la page man de mkvmerge(1). + +

+ +
+ +

3. Sélecteurs d'édition

+ + +

+ L'option --edit + définit la section de fichier Matroska(tm) (informations de segment ou + certaines entêtes de pistes) sur lesquelles opèrent toutes les actions add, set et delete. Ceci reste valide + jusqu'à temps que l'option suivante --edit soit + trouvée. L'argument de cette option est appelé le sélecteur d'édition. + +

+ + +

+ Par défaut mkvpropedit(1) éditera la section d'informations de segment. + +

+ + +

3.1. Informations de segment

+ + +

+ L' information de segment peut être sélectionnée avec de ces trois mots : + 'info', 'segment_info' ou + 'segmentinfo'. Il contient des propriétés comme le titre + de segment ou l'UID de segment. + +

+ + + +

3.2. Entêtes de piste

+ + +

+ Les entêtes de pistes peuvent être sélectionnées avec un sélecteur un peu + plus complexe. Toutes les variations débutent avec + 'track:'. Les propriétés d'entête de piste comprennent + des éléments comme le code langue, l'indicateur « Piste par défaut » ou le + nom de piste. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ Si le paramètre n est un chiffre, alors la + nième piste sera sélectionnée. L'ordre des pistes est + le même que l'option --identify de mkvmerge(1). + +

+ + +

+ La numérotation démarre à 1. + +

+ +
track:tn + +

+ Si le paramètre débute avec un unique caractère t + suivi par un n alors la nième + piste d'un type de piste spécifique sera sélectionnée. Le paramètre de type + de piste t doit être un de ces quatre caractères : + 'a' pour une piste audio, 'b' pour une + piste bouton, 's' pour une piste de sous-titre et + 'v' pour une piste vidéo. L'ordre des pistes est le même + que celui de l'option --identify de mkvmerge(1). + +

+ + +

+ La numérotation démarre à 1. + +

+ +
track:=uid + +

+ Si le paramètre débute avec un signe « = » suivi par un + chiffre uid, la piste dont l'élément + UID est égal à l'uid donné sera + sélectionnée. Les UIDs de pistes peuvent être obtenus avec + mkvinfo(1). + +

+ +
track:@number + +

+ Si le paramètre débute avec un signe « @ » suivi par un + chiffre chiffre, la piste dont le numéro est égal à + ce chiffre sera sélectionnée. Les numéros de pistes + peuvent être obtenus avec mkvinfo(1). + +

+ +
+ + + +

3.3. Notes

+ + +

+ Du fait de la nature des sélecteurs d'édition de piste, il est possible que + plusieurs sélecteurs correspondent réellement aux mêmes entêtes de + piste. Dans ces cas-là, toutes les actions pour ces sélecteurs d'édition + seront combinées et exécutées dans l'ordre dans lequel ils sont fournis en + ligne de commande. + +

+ + +

4. Sélecteurs de pièce jointe

+ + + +

+ Un sélecteur de pièce jointe est utilisé avec ces deux actions --replace-attachment + et --delete-attachment. + Il peut avoir une des quatre formes suivantes : + +

+ + +
    + +
  1. + +

    + Sélection par l'ID de pièce jointe. Dans cette forme, le sélecteur est + simplement un chiffre, l'ID de pièce jointe tel que donné par la commande + d'identification de mkvmerge(1). + +

    + +
  2. + + +
  3. + +

    + Sélection par l'UID (ID unique) de pièce jointe. Dans cette forme, le + sélecteur est le signe égal = suivi par un chiffre, l'UID + de pièce jointe tel que donné par la commande d'identification verbeuse de + mkvmerge(1). + +

    + +
  4. + + +
  5. + +

    + Sélection par le nom de pièce jointe. Dans cette forme, le sélecteur est le + mot littéral name: suivi par le nom de la pièce jointe + existante. Si ce sélecteur est utilisé avec + --replace-attachment alors les deux-points dans le nom à + correspondre devront être échappées avec \c. + +

    + +
  6. + + +
  7. + +

    + Sélection par le type MIME. Dans cette forme, le sélecteur est le mot + littéral mime-type: suivi par le type MIME de la pièce + jointe existante. Si ce sélecteur est utilisé avec + --replace-attachment alors les deux-points dans le type + MIME à correspondre devront être échappées avec \c. + +

    + +
  8. + +
+ +

5. Gestion des langues

+ + + +

+ Globalement, mkvpropedit(1) essaie de faire les choses correctement par + défaut : lors de modifications de la propriété de langue, + mkvpropedit(1) applique les mêmes modifications à l'élément « LanguageIETF » + qu'à l'ancien élément « Language », de la même façon que mkvmerge(1) applique + la langue à ces deux éléments. Par exemple, avec mkvpropedit + movie.mkv --edit track:2 --set language=zh-TW l'élément + « LanguageIETF » sera défini en zh-TW et l'ancien élément + « Language » en chi. + +

+ + +

+ De plus il existe une nouvelle propriété d'entête de piste nommée + language-ietf qui peut être définie ou retirée. Les + modifications de cette propriété s'appliquent seulement au nouvel élément + d'entête de piste « LanguageIETF ». Il faut noter ici que l'ancien élément + d'entête de piste « Language » est un élément requis pour Matroska — ce qui + signifie que même absent du fichier, il a une valeur implicite. Quand + l'utilisateur définit seulement la propriété language-ietf + mais pas la propriété language, mkvpropedit(1) ajoute + l'ancien élément « Language » dans certains cas, et la défini à + und (« undetermined », c'est-à-dire indéterminé) si + l'utilisateur n'en a pas spécifié une valeur. + +

+ + +

Lors de la lecture de fichiers XML de balises ou de chapitres, mkvpropedit(1) + fonctionne comme mkvmerge(1). +

+ + +

La création des nouveaux éléments peut être complètement désactivée avec + l'option en ligne de commande « --disable-language-ietf​ ». Elle prend effet + sur les trois nouveaux éléments. +

+ + +

Il est possible de choisir la méthode de normalisation appliquée aux + sous-balises de langue étendue avec le paramètre + --normalize-language-ietf. +

+ +

6. Exemples

+ + +

+ L'exemple suivant édite un fichier nommé 'movie.mkv'. Il + définit le titre du segment et modifie le code de langue d'une piste audio + et d'une piste de sous-titres. Noter que cet exemple peut être simplifié en + omettant la 1ère option --edit parce + que l'édition de l'élément d'information du segment est dans tous les cas + l'action par défaut pour toutes les options trouvées avant la 1ère option + --edit. + +

+ +
$ mkvpropedit movie.mkv --edit info --set "title=The movie" --edit track:a1 --set language=fre --edit track:a2 --set language=ita
+ +

+ Le deuxième exemple retire l'indicateur « Piste par défaut » de la 1ère + piste de sous-titres et le définit pour la 2nde. Noter que mkvpropedit(1), à + la différence de mkvmerge(1), ne définit pas l'indicateur « Piste par + défaut » des autres pistes à « 0 » s'il est définit automatiquement à « 1 » + pour une autres piste. + +

+ +
$ mkvpropedit movie.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ Remplacer les balises pour la 2nde piste de sous-titres dans un fichier + ressemble à ceci : + +

+ +
$ mkvpropedit movie.mkv --tags track:s2:new-subtitle-tags.xml
+ +

+ Supprimer toutes les balises nécessite d'omettre le nom de fichier : + +

+ +
$ mkvpropedit movie.mkv --tags all:
+ +

+ Remplacer les chapitres dans un fichier ressemble à ceci : + +

+ +
$ mkvpropedit movie.mkv --chapters new-chapters.xml
+ +

+ Suppression de tous les chapitres nécessite d'omettre le nom de fichier : + +

+ +
$ mkvpropedit movie.mkv --chapters ''
+ +

+ Ajout d'un fichier de police (Arial.ttf) en pièce jointe + : + +

+ +
$ mkvpropedit movie.mkv --add-attachment Arial.ttf
+ +

+ Ajout d'un fichier de police (89719823.ttf) en pièce + jointe et de quelques informations comme quoi ce n'est juste qu'Arial : + +

+ +
$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'La police Arial comme police TrueType' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ Remplacement d'un fichier de police (Comic.ttf) en pièce + jointe avec un autre (Arial.ttf) : + +

+ +
$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'La police Arial comme police TrueType' --replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ Suppression du second fichier en pièce jointe, quel qu'il soit : + +

+ +
$ mkvpropedit movie.mkv --delete-attachment 2
+ +

+ Suppression de toutes les polices en pièces jointes de type MIME : + +

+ +
$ mkvpropedit movie.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. Codes de fermeture

+ + + +

+ mkvpropedit(1) ferme avec l'un de ces 3 codes de fermeture : + +

+ + +
    + +
  • + +

    + 0 -- Ce code de sortie signifie que la modification + s'est correctement terminée. + +

    + +
  • + + +
  • + +

    + 1 -- Dans ce cas mkvpropedit(1) a émis au moins un + avertissement, mais la modification a continué. Un avertissement est préfixé + avec le texte 'Avertissement :'. Selon le problème les + fichiers résultants pourront être OK ou pas. L'utilisateur est vivement + conseillé de vérifier et l'avertissement et les fichiers résultants. + +

    + +
  • + + +
  • + +

    + 2 -- Ce code de fermeture est utilisé lorsqu'une erreur + survient. mkvpropedit(1) abandonne juste après le message d'erreur. Les + messages d'erreurs vont des arguments erronés en ligne de commande aux + fichiers corrompus en passant par les erreurs en lecture/écriture. + +

    + +
  • + +
+ +

8. Fichiers texte et conversions de jeux de caractères

+ + + +

+ Pour une discussion approfondie sur la gestion des conversions de jeux de + caractères des outils de la suite MKVToolNix, de l'encodage source/cible, de + l'encodage de la ligne de commande, de l'encodage de la console, merci de + voir les sections respectives nommées pareillement des pages man de + mkvmerge(1). + +

+ +

9. Variables d'environment

+ + + +

+ mkvpropedit(1) utilise les variables par défaut qui déterminent la « locale » + du système (par ex. LANG et la famille + LC_*). Variables additionnelles : + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG + and its short form MTX_DEBUG + +

Le contenu est traité comme s'il a été passé par l'option --debug. +

+ +
MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE + and its short form MTX_ENGAGE + +

Le contenu est traité comme s'il a été passé par l'option --engage. +

+ +
+ +

10. Voir aussi

+ + +

+ mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1) + +

+ +

11. WWW

+ + +

+ La dernière version peut toujours être trouvée à la page d'accueil de MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..88d03d696dcb194f45494f50f93330a75ad1dae4 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/fr/mkvtoolnix-gui.html @@ -0,0 +1,169 @@ + + + + + mkvtoolnix-gui -- une interface graphique utilisateur pour mkvmerge1 incluant un éditeur de + chapitres et d'entêtes + + + + +
mkvtoolnix-gui -- une interface graphique utilisateur pour mkvmerge(1) incluant un éditeur de + chapitres et d'entêtes +
+
+
+

Table of contents

+ +
+
+

1. Résumé

+ + +
mkvtoolnix-gui [[configuration-file-name.mtxcfg] | [source-file.ext] | [matroska-file.mkv] | [chapter-file.ext] | [matroska-file.mkv]] +
+ +

2. Description

+ + +

+ mkvtoolnix-gui(1) est une interface graphique basée sur + Qt(tm) pour mkvmerge(1). Elle implémente aussi les + fonctionnalités de mkvinfo(1) et mkvpropedit(1) et évoluera pour couvrir en + plus mkvextract(1). Tous les paramètres (par ex.. fichiers source, options de + piste, etc.) peuvent être enregistrés et restaurés. + +

+ + +

+ Lister les noms de fichiers de configuration avec l'extension + .mtxcfg oblige l'interface graphique à les charger dans + l'outil approprié. Tout autre nom de fichier est ajouté comme fichier source + pour multiplexage, ouvert dans l'outil d'information, l'éditeur de chapitres + ou d'entêtes selon le mode courant. Ce mode peut être modifié avec + --merge, --info, + --edit-chapters ou --edit-headers. Le mode + par défaut est l'ajout des fichiers pour le multiplexage. + +

+ + +

+ Remarque : si une instance de l'application est déjà exécutée quand elle est + lancée une seconde fois, tous les noms saisis sur le ligne de commande + seront pris en charge par l'instance déjà exécutée. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

Tous les noms de fichiers suivants seront ajoutés comme fichiers source à la + tâche actuelle de multiplexage. Mode par défaut. +

+ +
--info + +

Tous les noms de fichiers suivants seront ouverts dans l'outil + d'information. + + +

+ +

De plus l'outil d'informations sera sélectionné au démarrage au lieu de + l'outil de multiplexage. +

+ +
--edit-chapters + +

Tous les noms de fichier suivants seront ouverts dans l'éditeur de + chapitres. +

+ +

De plus l'éditeur de chapitres sera sélectionné au démarrage au lieu de + l'outil de multiplexage. +

+ +
--edit-headers + +

Tous les noms de fichier suivants seront ouverts dans l'éditeur d'entêtes.

+ +

De plus l'éditeur d'entêtes sera sélectionné au démarrage au lieu de l'outil + de multiplexage. +

+ +
-h, --help + +

+ Affiche les informations d'utilisation et quitte. + +

+ +
-V, --version + +

+ Affiche les informations de version et quitte. + +

+ +
+ +

3. Voir aussi

+ + +

+ mkvmerge(1), mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. WWW

+ + +

+ La dernière version peut toujours être trouvée à la page d'accueil de MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..2aeaa6537174ba1bcce6aeb19da04252ebf618d2 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvextract.html @@ -0,0 +1,1345 @@ + + + + + mkvextract -- estrai le tracce da Matroska negli altri file + + + +
mkvextract -- estrai le tracce da Matroska(tm) negli altri file +
+
+ +
+

1. Sinossi

+ + +
mkvextract {nome-file sorgente} {modalità1} opzioni extraction-spec1 modalità2 opzioni extraction-spec2 … +
+ +

2. Descrizione

+ + +

+ Questo programma estrae parti specifiche da un file Matroska(tm) in altri + formati utilizzabili. Il primo argomento è il nome del file sorgente che + deve essere un file Matroska(tm). + +

+ + +

+ Tutti gli altri argomenti abilitano una certa modalità di estrazione, + cambiano le opzioni per la modalità corrente attiva o specificano cosa + estrarre in che file. Modalità multiple possono essere richiamate abilitando + la possibilità di estrarre cose diverse in un solo comando. La maggior parte + delle opzioni possono essere usate solo in certe modalità con poche opzioni + applicabili a tutte le modalità. + +

+ + +

+ Supportata l'estrazione di tracce, tag, allegati, capitoli, CUE sheets, marcature orarie e + cues. + +

+ + +

2.1. Opzioni comuni

+ + + +

+ Le opzioni seguenti sono disponibili in tutte le modalità e sono descritte + in questa sezione. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ Imposta la modalità di analisi in 'totale'. La modalità di base non analizza + l'intero file ma usa gli elementi di meta-ricerca per localizzare gli + elementi richiesti del file sorgente. Nel 99% dei casi questo basta. Ma per + file che non contengono elementi di meta-ricerca o che sono danneggiati è + possibile utilizzare questa modalità. Una scansione totale può impiegare una + manciata di minuti mentre una scansione rapida ci mette qualche secondo. + +

+ +
--command-line-charset character-set + +

+ Imposta il set caratteri per convertire le stringhe date dalla riga di + comando. Di base è impostato dalla lingua di sistema. + +

+ +
--output-charset character-set + +

+ Imposta il set caratteri per le stringhe convertite date in output. Di base + è impostato dalla lingua di sistema. + +

+ +
-r, --redirect-output + file-name + +

+ Scrive tutti i messaggi nel file file-name invece che + sul terminale. Mentre questo può essere fatto con la redirezione + dell'output ci sono casi che questa opzione può essere necessaria: quando il + terminale reinterpreta l'output prima di scriverlo in un file. Il set + caratteri impostato con--output-charset + è onorato. + +

+ +
--flush-on-close + +

+ Indica al programma di scaricare tutti i dati memorizzati nella memoria + nello storage quando si chiudono i file aperti in scrittura. + Questo può essere usato per prevenire la perdita di dati in caso di + interruzioni di corrente o per eludere determinati problemi nel sistema + operativo o nei driver. + Il rovescio della medaglia è che il multiplexing richiederà più tempo poiché + mkvmerge attenderà fino a quando tutti i dati non saranno stati scritti + nella memoria prima di uscire. + Vedi riferimenti #2469 e #2480 nel tracker bug MKVToolNix per discussioni + approfondite su pro e contro. + +

+ +
--ui-language code + +

+ Forza le traduzioni per la lingua code da usare (per + esempio: 'it_IT' per le traduzioni in + Italiano). Immettendo 'list' come + code mostrerà la lista delle traduzioni disponibili. + +

+ +
--abort-on-warnings + +

+ Indica al programma di interrompere dopo il primo avviso. + Il codice di uscita del programma sarà 1. + +

+ +
--debug argomento + +

+ Abilita il debug per una funzionalità. Questa opzione è utile per gli + sviluppatori. + +

+ +
--engage funzionalità + +

+ Abilita le funzionalità sperimentali. La lista delle funzionalità + disponibili può essere mostrata col comando mkvextract --engage + list. Queste funzionalità non sono previste per l'utilizzo normale + del programma. + +

+ +
--gui-mode + +

+ Mostra la GUI (interfaccia grafica). In questa modalità a terminale ci + saranno delle righe specifiche su cosa sta succedendo. Questi messaggi + seguiranno il formato '#GUI#messaggio'. Il messaggio può + essere seguito da delle coppie chiave/valore come + '#GUI#messaggio#chiave1=valore1#chiave2=valore2…'. Né i + messaggi e né le chiavi saranno mai tradotte e l'output sarà sempre in + Inglese. + +

+ +
-v, --verbose + +

+ Sii prolisso e mostra tutti gli elementi Matroska(tm) importanti quando + vengono letti. + +

+ +
-h, --help + +

+ Mostra l'aiuto ed esci. + +

+ +
-V, --version + +

+ Mostra la versione ed esci. + +

+ +
@options-file.json + +

+ Legge gli argomenti a riga di comando dal file + options-file. Per una spiegazione completa sul + formato supportato vedere la sezione "File di Opzioni" nel manuale di + mkvmerge(1). + +

+ +
+ + + +

2.2. Modalità di estrazione traccia

+ + + +

+ Sintassi: mkvextract nomefile-sorgente + tracce [opzioni] + TID1:nomefile-destinazione1 + [TID2:nomefile-destinazione2 + ...] + +

+ + +

+ Le seguenti opzioni sono disponibili per ogni traccia nella modalità di + estrazione 'tracks. Devono apparire davanti alla traccia + specifica (vedi giù) a cui deve essere applicata. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c character-set + +

+ Imposta il set di caratteri da convertire nella traccia dei sottotitoli. È + valido se l'ID della traccia successiva è un sottotitolo. Di base è UTF-8. + +

+ +
--blockadd livello + +

+ Tieni solo il i BlockAdditions su questo livello. Di base è su tutti i + livelli. Questa opzione riguarda solo certi tipi di codec tipo il WAVPACK4. + +

+ +
--cuesheet + +

+ Causa mkvextract(1) di estrarre un CUE sheet dalle + informazioni del capitolo e dai dati tag per la seguente traccia in un file + il cui nome è il nome della traccia con l'estensione + '.cue'. + +

+ +
--raw + +

+ Estrae i dati raw in un file senza dati contenitore. Differentemente + dall'opzione --fullraw, + questa opzione non causa che i contenuti + dell'elementoCodecPrivate vengano scritti nel + file. Questa modalità funziona con tutti i CodecID, + pure quelli che mkvextract(1) non supporta, ma il risultato potrebbe non + essere utilizzabile. + +

+ +
--fullraw + +

+ Estrae i dati raw in un file senza dati contenitore. I contenuti + dell'elemento CodecPrivate saranno scritti nel file + per primi se la traccia contiene quell'elemento header. Questa modalità + funziona con tutti i CodecID, pure quelli che + mkvextract(1) non supporta, ma il risultato potrebbe non essere utilizzabile. + +

+ +
TID:outname + +

+ Causa l'estrazione della traccia con ID TID nel file + outname se quella traccia esiste file file + sorgente. Questa opzione può essere usata più volte. Gli ID della traccia + sono gli stessi dell'output dato dal risultato mkvmerge(1) + --identify. + +

+ + +

+ Ogni nome in output deve essere univoco. Le eccezioni sono le tracce + RealAudio e RealVideo. Se viene utilizzato lo stesso nome per tracce + differenti, quelle tracce verranno salvate nello stesso file. Per esempio: + +

+ +
$ mkvextract input.mkv tracks 0:video.h264 2:output-two-vobsub-tracks.idx 3:output-two-vobsub-tracks.idx
+
+ + + +

2.3. Modalità di estrazione allegati

+ + + +

+ Sintassi: mkvextract file-sorgente + allegati + [opzioni] + AID1:filediuscita1 + [AID2:filediuscita2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:filediuscita + +

+ Provoca l'estrazione dell'allegato con l'ID AID nel + file nomefiledestinazione se tale allegato esiste nel + file sorgente. Se nomedestinazione viene lasciato + vuoto, allora il nome dell'allegato all'interno della sorgente Matroska(tm) al + suo posto verrà usato il file. Questa opzione può essere data più volte. Gli + ID degli allegati sono gli stessi di quelli generati dall'opzione + --identify di mkvmerge(1). + +

+ +
+ + + +

2.4. Modalità di estrazione capitoli

+ + + +

+ Sintassi: mkvextract file-sorgente + capitoli + [opzioni] + file-di-uscita.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ Esporta le informazioni del capitolo nel formato semplificato dagli + strumenti OGM (CAPITOLO01=..., NOMECAPITOLO01=...). In + questa modalità alcune informazioni devono venire scartate. L'output + predefinito dei capitoli è in formato XML. + +

+ +
--simple-language lingua + +

+ Se il formato semplificato è abilitato allora mkvextract(1) creerà una voce + singola per ogni capitolo trovato, anche se un capitolo atom contiene più di + un nome per capitolo. Di base mkvextract(1) userà il primo capitolo trovato + per ogni atom a prescindere dalla lingua. + +

+ + +

+ Usando questa opzione si dà la possibilità all'utente di determinare quali + nomi dei capitoli vengono usati se l'atom contiene più di un nome per + capitolo. Il parametro lingua deve essere ISO 639-1 + oppure ISO 639-2. + +

+ +
+ + +

+ I capitoli vengono salvati in un file specifico. Il formato predefinito è + XML formato usato da mkvmerge(1). Se nessun capitolo viene trovato, questo + file non verrà creato. + +

+ + + +

2.5. Modalità di estrazione tag

+ + + +

+ Sintassi: mkvextract nomefile-sorgente + tags [opzioni] + filename-di-output.xml + +

+ + +

+ I tag vengono salvati in un file specifico. Il formato predefinito è XML + formato usato da mkvmerge(1). Se nessun tag viene trovato, questo file non + verrà creato. + +

+ + + +

2.6. Modalità di estrazione cue sheet

+ + + +

+ Sintassi: mkvextract file-sorgente + file-cue[opzioni] + file-di-uscita.cue + +

+ + +

+ Il file cue verrà salvato in un file specifico. Se nessun capitolo o tag + vengono trovati nel file, questo file non verrà creato. + +

+ + + +

2.7. Modalità di estrazione marche temporali

+ + + +

+ Sintassi: mkvextract file-sorgente + marcatemporale_v2 + [opzioni] + TID1:file-destinazione1 + [TID2:file-destinazione2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:outname + +

+ Causa l'estrazione delle marche temporali per la traccia con ID + TID nel file outname se la + traccia esiste nel file sorgente. Questa opzione può essere impostata più + volte. Gli ID delle tracce sono gli stessi di quelli forniti dal risultato + dell'opzione --identify di mkvmerge(1). + +

+ + +

+ Esempio: + +

+ +
$ mkvextract input.mkv timestamps_v2 1:ts-track1.txt 2:ts-track2.txt
+
+ + + +

2.8. Modalità di estrazione cue

+ + + +

+ Sintassi: mkvextract nomefile-sorgente + cue [opzioni] + TID1:file-destinazione1 + [TID2:file-destinazione2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:nome-file-destinazione + +

+ Causa l'estrazione dei metadati cue per la traccia con ID + TID nel file outname se la + traccia esiste nel file sorgente. Questa opzione può essere impostata più + volte. Gli ID delle tracce sono gli stessi di quelli forniti dal risultato + dell'opzione --identify di mkvmerge(1) e non i numeri + contenuti nell'elemento CueTrack. + +

+ +
+ + +

+ Il formato di output è in formato testo semplice: una linea per elemento + CuePoint con coppie + chiave=valore. Se un elemento non è presente in un + CuePoint (per esempio + CueDuration) allora un trattino sarà il valore di + output. + +

+ + +

+ Esempio: + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

Le chiavi possibili sono:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
data/ora + +

Punto cue della marca temporale con precisione al nanosecondo. Il formato è + HH:MM:SS.nnnnnnnnn. Questo elemento è sempre impostato. +

+ +
durata + +

Durata del punto cue con precisione al nanosecondo. Il formato è + HH:MM:SS.nnnnnnnnn. +

+ +
cluster_position + +

Posizione assoluta in byte all'interno del file Matroska(tm) dove il cluster + contenente l'elemento di riferimento inizia. +

+ + +
+

Note:

+ +

All'interno del file Matroska(tm) il CueClusterPosition + è relativo all'offset di inizio del segmento dati. Il valore di output della + modalità di estrazione di mkvextract(1), in ogni caso, contiene già + quell'offset ed è un offset assoluto dall'inizio del file. +

+ +
+ +
relative_position + +

La posizione relativa in byte all'interno del cluster in cui inizia + l'elemento BlockGroup o + SimpleBlock. +

+ + +
+

Note:

+ +

All'interno del file Matroska(tm) il + CueRelativePosition è relativo all'offset d'inizio + dei dati del cluster. Il valore di output della modalità di estrazione di + mkvextract(1), in ogni caso, è relativo all'ID del cluster. La posizione + assoluta all'interno del file può essere calcolata aggiungendo + cluster_position e relative_position. +

+ +
+ +
+ + +

+ Esempio: + +

+ +
$ mkvextract input.mkv cues 1:cues-track1.txt 2:cues-track2.txt
+ +

3. Esempi

+ + + +

+ Estrarre allo stesso tempo entrambi i capitoli e tag nei loro rispettivi + formati XML: + +

+ +
$ mkvextract film.mkv chapters capitoli-film.xml tags tag-film.xml
+ +

+ Estrarre allo stesso tempo un po' di tracce e le loro rispettive marcature + temporali: + +

+ +
$ mkvextract "Altro film.mkv" tracks 0:video.h265 "1:audio principale.aac" "2:commento del regista.aac" timestamps_v2 "0:marcature temporali video.txt" "1:marcature temporali audio principale.txt" "2:marcature temporali commenti del regista.txt"
+ +

+ Estrarre i capitoli nel formato Ogg/OGM e ricodificare una traccia + sottotitoli in un'altra codifica caratteri: + +

+ +
$ mkvextract "Mio Film.mkv" chapters --simple "Miei Capitoli.txt" tracks -c MS-ANSI "2:Miei Sottotitoli.srt"
+

4. File di testo e conversioni della codifica caratteri

+ + + +

+ Per una comprensione a fondo di come tutti gli strumenti presenti nella + suite di MKVToolNix gestiscono la conversione della codifica caratteri, + codifica input/output, codifica a riga di comando e console, vedere la + sezione con lo stesso nome nel manuale di mkvmerge(1). + +

+ +

5. Formati di uscita dei file

+ + + +

+ La decisione a proposito del formato di output è basata sul tipo di traccia, + non nell'estensione usata dal nome del file. Attualmente le seguenti tracce + sono supportate: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ Tutti i fileAAC saranno scritti in un file + AAC con intestazioni ADTS prima di ogni + pacchetto. L'intestazione ADTS non conterrà il deprecato + campo di enfasi. + +

+ +
A_AC3, A_EAC3 + +

+ Questi verranno estratti in file AC-3 grezzi. + +

+ +
A_ALAC + +

+ Le tracce ALAC sono scritte su file CAF. + +

+ +
A_DTS + +

+ Questi verrrano estratti su file grezzi DTS. + +

+ +
A_FLAC + +

+ Le tracce FLAC verranno scritte su file grezzi + FLAC. + +

+ +
A_MPEG/L2 + +

+ I flussi MPEG-1 Audio Layer II verranno estratti su file grezzi + MP2. + +

+ +
A_MPEG/L3 + +

+ Questi verrrano estratti su file grezzi MP3. + +

+ +
A_OPUS + +

+ Le tracce Opus(tm) verranno scritte su file + OggOpus(tm). + +

+ +
A_PCM/INT/LIT, A_PCM/INT/BIG + +

+ I dati grezzi PCM verranno scritti su file + WAV. I dati Big-endian verranno convertiti in dati + little-endian. + +

+ +
A_REAL/* + +

+ Le tracce RealAudio(tm) sono scritte su file + RealMedia(tm). + +

+ +
A_TRUEHD, A_MLP + +

+ Questi saranno estratti su file grezzi + TrueHD/MLP. + +

+ +
A_TTA1 + +

+ Le tracce TrueAudio(tm)sono scritte su file + TTA. Notare che a causa della limitata precisione della + marca temporale del formato Matroska(tm), l'intestazione del file estratto + sarà differente in due campi: data_lenght (numero totale + dei sample nel file) e il CRC. + +

+ +
A_VORBIS + +

+ L'audio Vorbis verrà scritto in un file OggVorbis(tm). + +

+ +
A_WAVPACK4 + +

+ Le tracce WavPack(tm) saranno scritte in file + WV. + +

+ +
S_HDMV/PGS + +

+ I sottotitoli PGS saranno scritti come file + SUP. + +

+ +
S_HDMV/TEXTST + +

+ I sottotitoli TextST saranno scritti in uno speciale + formato concepito per mkvmerge(1) e mkvextract(1). + +

+ +
S_KATE + +

+ I flussi Kate(tm) saranno scritti in un contenitore + Ogg(tm). + +

+ +
S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS + +

+ I sottotitoli SSA e ASS saranno scritti + rispettivamente come file SSA/ASS. + +

+ +
S_TEXT/UTF8, S_TEXT/ASCII + +

+ I sottotitoli in formato test saranno scritti come file + SRT. + +

+ +
S_VOBSUB + +

+ I sottotitoli VobSub(tm) saranno scritti come file + SUB insieme ai rispettivi file di indice come file + IDX. + +

+ +
S_TEXT/USF + +

+ I sottotitoli USF saranno scritti come file + USF. + +

+ +
S_TEXT/WEBVTT + +

+ I sottotitoli WebVTT saranno scritti su file + WebVTT. + +

+ +
V_MPEG1, V_MPEG2 + +

+ Le tracce video MPEG-1 e MPEG-2 saranno + scritti come flussi elementari MPEG. + +

+ +
V_MPEG4/ISO/AVC + +

+ Le tracce video H.264/AVC saranno scritte + su flussi elementari H.264 che potranno poi essere + processati con, per esempio, MP4Box(tm) dal pacchetto + GPAC(tm). + +

+ +
V_MPEG4/ISO/HEVC + +

+ Le tracce video H.265/HEVC saranno scritte + su flussi elementari H.265 che potranno poi essere + processati con, per esempio, MP4Box(tm) dal pacchetto + GPAC(tm). + +

+ +
V_MS/VFW/FOURCC + +

+ Le tracce video con FPS fissi con questo + CodecID saranno scritte su file AVI. + +

+ +
V_REAL/* + +

+ Le tracce RealVideo(tm) sono scritte su file + RealMedia(tm). + +

+ +
V_THEORA + +

+ I flussi Theora(tm) sono scritti in un contenitore + Ogg(tm) + +

+ +
V_VP8, V_VP9 + +

+ Le tracce VP8/VP9 saranno scritte su file + IVF. + +

+ +
Tag + +

+ I tag saranno convertiti in formato XML. Questo formato è lo stesso che + supporta mkvmerge(1) per la lettura dei tag. + +

+ +
Allegati + +

+ Gli allegati saranno scritti nel formato di output in cui sono. Nessuna + conversione verrà fatta. + +

+ +
Capitoli + +

+ I capitoli sono convertiti in formato XML. + Questo formato è lo stesso che supporta mkvmerge(1) per la lettura dei + capitoli. + Alternativamente una versione semplificata può essere in formato + OGM. + +

+ +
Marche temporali + +

+ Le marche temporali sono prima ordinate e poi convertite in formato conforme + alla marca temporale v2, pronte per essere processate con + mkvmerge(1). L'estrazione in altri formati (v1, v3 e v4) non è supportata. + +

+ +
+ +

6. Codici d'uscita

+ + + +

+ mkvextract(1) esce con uno di tre codici di uscita: + +

+ + +
    + +
  • + +

    + 0 -- Questo valore di uscita riporta che l'estrazione è + stata completata correttamente. + +

    + +
  • + + +
  • + +

    + 1 -- In questo caso mkvextract(1) ha almeno un avviso, + ma l'estrazione è continuata. L'avviso è prefissato con la dicitura + 'Avviso:'. A seconda del problema il risultato potrebbe + essere ok oppure no. L'utente è incoraggiato a controllare sia gli avvisi + che i file. + +

    + +
  • + + +
  • + +

    + 2 -- Questo valore di uscita è utilizzato dopo che si è + verificato un errore. mkvextract(1) si interrompe dopo aver segnalato il + messaggio di errore. I messaggi d'errore spaziano da un argomento della riga + di comando errato a errori di lettura/scrittura a file corrotti. + +

    + +
  • + +
+ +

7. Variabili d'ambiente

+ + + +

+ mkvextract(1) usa delle variabili predefinite che determinano la lingua di + sistema (per esempio: LANG e la famiglia + LC_*). Variabili addizionali sono: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG e + la sua forma contratta MTX_DEBUG + +

Il contenuto è elaborato come se fosse stata utilizzata l'opzione --debug. +

+ +
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE e + la sua forma contratta MTX_ENGAGE + +

Il contenuto è elaborato come se fosse stata utilizzata l'opzione --engage. +

+ +
+ +

8. Vedi anche

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. WWW

+ + +

+ La versioen aggironata è sempre disponibile nel sito web MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..30b6528958f44226060da3564f9674c1c7d4dc0e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvinfo.html @@ -0,0 +1,518 @@ + + + + + mkvinfo -- Stampa informazioni sugli elementi nel file Matroska + + + +
mkvinfo -- Stampa informazioni sugli elementi nel file Matroska(tm)
+
+ +
+

1. Sinossi

+ + +
mkvinfo opzioni {file-sorgente} +
+ +

2. Descrizione

+ + +

+ Questo programma elenca tutti gli elementi contenuti in a + Matroska(tm). L'output può essere limitato a un elenco di tracce nel file che + include informazioni sui codec usati. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ Come comportamento predefinito mkvinfo(1) si interrompe quando incontra il + primo cluster. Inoltre non mostra gli elementi che incontra spesso. Con + questa opzione mkvinfo(1) continuerà il processo indipendentemente dal + livello di verbosità e mostrerà tutti gli elementi. + +

+ +
-c, --checksums + +

+ Calcola e visualizza il checksum Adler-32 per ogni + frame. + Utile solo per il debug. + +

+ +
-o, --continue + +

+ Come comportamento predefinito mkvinfo(1) si interrompe quando incontra il + primo cluster. Con questa opzione mkvinfo(1) continuerà il processo + indipendentemente dal livello di verbosità. + +

+ +
-p, --hex-positions + +

+ Mostra la posizione di tutti gli elementi in esadecimale indipendentemente + dal livello di verbosità. + +

+ +
-P, --positions + +

+ Mostra la posizione di tutti gli elementi in decimale indipendentemente dal + livello di verbosità. + +

+ +
-s, --summary + +

+ Visualizza solo un breve riassunto di ciò che mkvinfo(1) trova e non ogni + elemento. + +

+ +
-t, --track-info + +

+ Visualizza le statistiche per ogni traccia in modalità dettagliata. + Imposta anche la verbosità su 1 se prima era al livello 0. + +

+ +
-x, --hexdump + +

+ Mostra i primi 16 byte di ogni frame come un dump hex. + +

+ +
-X, --full-hexdump + +

+ Visualizza tutti i byte di ogni frame come dump esadecimale. + +

+ +
-z, --size + +

+ Visualizza la dimensione di ogni elemento inclusa la sua intestazione. + +

+ +
--command-line-charset character-set + +

+ Imposta il set caratteri per convertire le stringhe date dalla riga di + comando. Di base è impostato dalla lingua di sistema. + +

+ +
--output-charset character-set + +

+ Imposta il set caratteri per le stringhe convertite date in output. Di base + è impostato dalla lingua di sistema. + +

+ +
-r, --redirect-output + file-name + +

+ Scrive tutti i messaggi nel file nome-file invece che + sul terminale. Mentre questo può essere fatto con la redirezione + dell'output ci sono casi dove questa opzione può essere necessaria: quando + il terminale reinterpreta l'output prima di scriverlo in un file. Il set + caratteri impostato con --output-charset + viene rispettato. + +

+ +
--ui-language code + +

+ Forza le traduzioni per la lingua code da usare (per + esempio: 'it_IT' per le traduzioni in + Italiano). Immettendo 'list' come + code mostrerà la lista delle traduzioni disponibili. + +

+ +
--abort-on-warnings + +

+ Indica al programma di interrompere dopo il primo avviso. + Il codice di uscita del programma sarà 1. + +

+ +
--debug argomento + +

+ Abilita il debug per una funzionalità. Questa opzione è utile per gli + sviluppatori. + +

+ +
--engage funzionalità + +

+ Abilita le funzionalità sperimentali. La lista di funzioni disponibili può + essere richiamata con mkvinfo --engage list. Queste + funzionalità non sono previste per l'utilizzo normale del programma. + +

+ +
--gui-mode + +

+ Mostra la GUI (interfaccia grafica). In questa modalità a terminale ci + saranno delle righe specifiche su cosa sta succedendo. Questi messaggi + seguiranno il formato '#GUI#messaggio'. Il messaggio può + essere seguito da delle coppie chiave/valore come + '#GUI#messaggio#chiave1=valore1#chiave2=valore2…'. Né i + messaggi e né le chiavi saranno mai tradotte e l'output sarà sempre in + Inglese. + +

+ +
-v, --verbose + +

+ Più verbosità. Vedere la sezione riguardo a livelli di verbosità per una + descrizione dei livelli. + +

+ +
-h, --help + +

+ Mostra l'aiuto ed esci. + +

+ +
-V, --version + +

+ Mostra la versione ed esci. + +

+ +
@options-file.json + +

+ Legge gli argomenti a riga di comando dal file + options-file. Per una spiegazione completa sul + formato supportato vedere la sezione "File di Opzioni" nel manuale di + mkvmerge(1). + +

+ +
+ +

3. Livello di verbosità

+ + + +

+ L'opzione -v può essere + utilizzata per aumentare il livello di verbosità di mkvinfo(1), quindi + stampare più informazioni riguardo al file corrente. + +

+ + +

+ Al livello 0 mkvinfo(1) mostrerà solamente le intestazioni delle tracce e + cercherà il tipo. mkvinfo(1) uscirà quando tutte le intestazioni verranno + completamente analizzate (in linguaggio tecnico: non appena il primo cluster + viene analizzato). In questo livello le intestazioni di ricerca e i metadati + cue non verranno mostrati -- anche se sono posizionati in testa alle + informazioni della traccia. + +

+ + +

+ Al livello 1 mkvinfo(1) stamperà tutti gli elementi Matroska(tm) trovati in + tutto il file, ma non le intestazioni di ricerca e i metadati cue. Se la + modalità riepilogo è abilitata, mkvinfo(1) stamperà anche la posizione del + fotogramma. + +

+ + +

+ Lo stesso risultato può essere ottenuto con l'opzione + --continue. + +

+ + +

+ Al livello 2 mkvinfo(1) stamperà anche le intestazioni di ricerca, i metadati + cue e la posizione del file dove ogni elemento Matroska(tm) può essere + trovato. + +

+ + +

+ Lo stesso risultato può essere ottenuto con l'opzione + --all-positions. + +

+ + +

+ Al livello 3 ed oltre mkvinfo(1) stamperà alcune informazioni non + direttamente relative all'elemento Matroska(tm). Tutti gli altri elementi + stamperanno informazioni relative agli elementi che sono stati trovati. Il + livello 3 aggiunge altre informazioni per facilitare il debug (leggasi: è + inteso solo per gli sviluppatori). Tutte le righe relative al livello 3 sono + racchiuse da parentesi quadre per facilitarne il filtraggio. + +

+ +

4. File di testo e conversioni della codifica caratteri

+ + + +

+ Per una comprensione a fondo di come tutti gli strumenti presenti nella + suite di MKVToolNix gestiscono la conversione della codifica caratteri, + codifica input/output, codifica a riga di comando e console, vedere la + sezione con lo stesso nome nel manuale di mkvmerge(1). + +

+ +

5. Codici d'uscita

+ + + +

+ mkvinfo(1) esce con uno di tre codici di uscita: + +

+ + +
    + +
  • + +

    + 0 -- Questo valore di uscita riporta che il processo è + stato completato correttamente. + +

    + +
  • + + +
  • + +

    + 1 -- In questo caso mkvinfo(1) ha almeno un avviso, ma + il processo è continuato. L'avviso è prefissato con la dicitura + 'Avviso:'. + +

    + +
  • + + +
  • + +

    + 2 -- Questo valore di uscita è utilizzato dopo che si è + verificato un errore. mkvinfo(1) si interrompe dopo aver segnalato il + messaggio di errore. I messaggi d'errore spaziano da un argomento della riga + di comando errato a errori di lettura/scrittura a file corrotti. + +

    + +
  • + +
+ +

6. Variabili d'ambiente

+ + + +

+ mkvinfo(1) usa le variabili d'ambiente che determinano la lingua di sistema + (per esempio: LANG e la famiglia + LC_*). Variabili addizionali sono: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUG, MKVTOOLNIX_DEBUG e la + sua forma contratta MTX_DEBUG + +

Il contenuto è elaborato come se fosse stata utilizzata l'opzione --debug. +

+ +
MKVINFO_ENGAGE, MKVTOOLNIX_ENGAGE e la + sua forma contratta MTX_ENGAGE + +

Il contenuto è elaborato come se fosse stata utilizzata l'opzione --engage. +

+ +
+ +

7. Vedi anche

+ + +

+ mkvmerge(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. WWW

+ + +

+ La versioen aggironata è sempre disponibile nel sito web MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..9dc6ca93e506d4b5c7b12c1c6047aae2269bed5b --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvmerge.html @@ -0,0 +1,5238 @@ + + + + + mkvmerge -- Unisci i flussi multimediali in un file Matroska + + + +
mkvmerge -- Unisci i flussi multimediali in un file Matroska(tm)
+
+ +
+

1. Sinossi

+ + +
mkvmerge opzioni globali {-o + file di uscita} opzione 1 {file 1} opzione 2 {file 2} @file_di_opzioni.json +
+ +

2. Descrizione

+ + +

+ Questo programma prende l'input di diversi file multimediali e unisce i loro + flussi (tutti oppure una selezione) in un file Matroska(tm). Per ulteriori + informazioni visitare il sito di + Matroska. + +

+ + +
+

Important:

+ +

+ L'ordine delle opzioni della riga di comando è importante. Leggere la + sezione "Opzioni" se + queste sono le prime volte che si utilizza il programma. + +

+ +
+ + +

2.1. Opzioni globali

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

Aumenta dettaglio messaggi.

+ +
-q, --quiet + +

Nascondi stato output.

+ +
-o, --output + nome-file + +

Scrive nel file nome-file. Se viene utilizzata la + suddivisione questo parametro è trattato in maniera differente. Leggere la + spiegazione per l'opzione --split per + ulteriori dettagli. +

+ +
-w, --webm + +

Crea un file conforme al formato WebM. Ciò è inoltre abilitato se + l'estensione del nome del file di output è "webm". Questa modalità + rafforza diverse restrizioni: i codec permessi sono soltanto VP8 e VP9 per + le tracce video e Opus e Vorbis per le tracce audio. L'intestazione del tipo + di documento (DocType) sarà cambiata in "webm". + +

+ + +

+ Solo un sottoinsieme di elementi sono permessi per capitoli e + tag. mkvmerge(1) automaticamente rimuoverà tutti gli elementi non permessi + dalle specifiche. + +

+ +
--title titolo + +

Imposta il titolo generale per il file destinazione, ad es. il nome del + film. +

+ +
--default-language codice-lingua + +

Imposta il codice della lingua predefinita che verrà usato per le tracce + dove nessuna lingua è impostata con l'opzione --language e + nelle quali il contenitore sorgente non provvede una lingua. +

+ + +

The default language code is 'und' for 'undetermined'. +

+ +
+ + + +

2.2. Gestione delle informazioni per il segmento (opzioni globali).

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo nomefile.xml + +

+ Legge le informazioni del segmento da un file XML. Questo + file può contenere gli UID della famiglia di segmenti, + UID del segmento e gli UID dei segmenti + precedenti e successivi. Un file d'esempio e un DTD sono + inclusi nella distribuzione di MKVToolNix. + +

+ + +

+ Vedere le sezione riguardo file XML di + informazioni segmento qui sotto per dettagli. + +

+ +
--segment-uid SID1,SID2,... + +

+ Imposta l'uso degli UID dei segmenti. Ciò è una lista separata da virgole di + UID dei segmenti a 128-bit nella forma: numeri esadecimali con o senza + prefisso "0x", con o senza spazi; esattamente 32 cifre. + +

+ + +

+ Se il SID comincia con = il resto è interpretato come nome per un file + Matroska il cui UID del segmento è letto e usato. + +

+ + +

+ Ogni file creato contiene un segmento e ogni segmento ha un UID. Se più UID + sono specificati rispetto ai segmenti creati allora gli UID in più verranno + ignorati. Se sono specificati meno UID rispetto ai segmenti verranno creati + per loro UID casuali. + +

+ +
+ + + +

2.3. Gestione capitoli e tag (opzioni globali)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language codice-lingua + +

+ Imposta il codice lingua ISO 639-2 che è scritto in ogni capitolo. Come + impostazione predefinita usa 'eng'. Vedere la sezione + riguardo a capitoli qui sotto per + dettagli. + +

+ + +

+ Questa opzione può essere utilizzata sia per file di capitolo, sia per file + sorgenti che contengono capitoli, ma senza informazioni riguardo la lingua + dei capitoli, per esempio file MP4 e OGM. + +

+ + +

+ La lingua impostata con questa opzione è usata anche quando i capitoli sono + generati con l'opzione --generate-chapters. + +

+ +
--chapter-charset character-set + +

+ Imposta la codifica caratteri che viene utilizzata per la conversione in + UTF-8 per file file di capitolo semplici. Vedere la sezione riguardo file di testo e codifiche + caratteri per una spiegazione su come mkvmerge(1) converte tra le + varie codifiche caratteri. + +

+ + +

+ Questa opzione si applica anche ai capitoli copiati da determinati tipi di + container, ad es. file Ogg / OGM e MP4. + Vedi la sezione sui capitoli di seguito per i dettagli. + +

+ +
--chapter-sync + d[,o[/p]] + +

+ Regola i timestamp dei capitoli nel seguente file sorgente di + d ms. + In alternativa è possibile utilizzare l'opzione --sync con + l'ID traccia speciale -2 (vedi la sezione ID traccia speciale). + +

+ + +

+ o/p regola i timestamp di + o/p per correggere le derive + lineari. p viene impostato automaticamente su 1 se + omesso. + Sia o che p possono essere + numeri in virgola mobile. + +

+ + +

+ Predefiniti: nessuna correzione manuale della sincronizzazione (che è la + stessa di d = 0 e + o/p = + 1.0) + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--generate-chapters modalità + +

+ mkvmerge(1) può creare capitoli automaticamente. + Attualmente sono supportate le seguenti modalità: + +

+ + +
    + +
  • + +

    + 'when-appending' – Questa modalità crea un capitolo + all’inizio e un capitolo quando un file viene aggiunto. + +

    + + +

    + This mode also works with split modes 'parts:' and + 'parts-frames:'. For these modes one chapter will be + generated for each appended timestamp range (those whose start timestamps + are prefixed with '+'). + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1) requires a video or an audio track to be present in order to be + able to determine when a new file is appended. If one or more video tracks + are muxed the first one is used. Otherwise the first audio track is used. + +

    + +
    + +
  • + + +
  • + +

    + 'interval:time-spec' – This mode + creates one chapter at fixed intervals given by + time-spec. The format is either the form + HH:MM:SS.nnnnnnnnn or a number followed by one of the + units 's', 'ms' or + 'us'. + +

    + + +

    + Esempio: --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ The names for the new chapters are controlled by the option --generate-chapters-name-template. + The language is set with --chapter-language + which must occur before --generate-chapters. + +

+ +
--generate-chapters-name-template + template + +

+ This sets the name template for chapter names generated by the option --generate-chapters. + If the option is not used then default 'Chapter + <NUM:2>' will be used. + +

+ + +

+ There are several variables that can be used in the template that are + replaced by their actual values when a chapter is generated. The string + '<NUM>' will be replaced by the chapter number. The + string '<START>' will be replaced by the chapter's + start timestamp. + +

+ + +

+ The strings '<FILE_NAME>' and + '<FILE_NAME_WITH_EXT>' are only filled when + generating chapters for appended files. They will be replaced by the + appended file's name without respectively with its extension. Note that + only the file's base name and extension are inserted, not its directory or + drive components. + +

+ + +

+ You can specify a minimum number of places for the chapter number with + '<NUM:places>', + e.g. '<NUM:3>'. The resulting number will be + padded with leading zeroes if the number of places is less than specified. + +

+ + +

+ You can control the format used by the start timestamp with + <START:format>. The format defaults to + '%H:%M:%S' if none is given. Valid format codes are: + +

+ + +
    + +
  • + +

    %h – ore +

    + +
  • + +
  • + +

    %H – hours zero-padded to two places +

    + +
  • + +
  • + +

    %m – minuti +

    + +
  • + +
  • + +

    %M – minutes zero-padded to two places +

    + +
  • + +
  • + +

    %s – secondi +

    + +
  • + +
  • + +

    %S – seconds zero-padded to two places +

    + +
  • + +
  • + +

    %n – nanosecondi con nove posizioni +

    + +
  • + +
  • + +

    %<1-9>n – nanoseconds with up to nine places + (e.g. three places with %3n) +

    + +
  • + +
+ +
--cue-chapter-name-format formato + +

+ mkvmerge(1) supports reading CUE sheets for audio files as + the input for chapters. CUE sheets usually contain the + entries PERFORMER and TITLE for each + index entry. mkvmerge(1) uses these two strings in order to construct the + chapter name. With this option the format used for this name can be set. + +

+ + +

+ If this option is not given then mkvmerge(1) defaults to the format '%p + - %t' (the performer, followed by a space, a dash, another space and + the title). + +

+ + +

+ If the format is given then everything except the following meta characters + is copied as-is, and the meta characters are replaced like this: + +

+ + +
    + +
  • + +

    %p is replaced by the current entry's + PERFORMER string, +

    + +
  • + +
  • + +

    %t is replaced by the current entry's + TITLE string, +

    + +
  • + +
  • + +

    %n è sostituito dal numero della traccia attuale e +

    + +
  • + +
  • + +

    %N is replaced by the current track number padded + with a leading zero if it is < 10. +

    + +
  • + +
+ +
--chapters nome-file + +

+ Read chapter information from the file file-name. See + the section about chapters below + for details. + +

+ +
--global-tags nome-file + +

+ Read global tags from the file file-name. See the + section about tags below for details. + +

+ +
+ + + +

2.4. General output control (advanced global options)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order + FID1:TID1,FID2:TID2,... + +

+ This option changes the order in which the tracks for an input file are + created. The argument is a comma separated list of pairs IDs. Each pair + contains first the file ID (FID1) which is simply the + number of the file on the command line starting at 0. The second is a track + ID (TID1) from that file. If some track IDs are + omitted then those tracks are created after the ones given with this option + have been created. + +

+ +
--cluster-length spec + +

+ Limit the number of data blocks or the duration of data in each cluster. The + spec parameter can either be a number + n without a unit or a number d + postfixed with 'ms'. + +

+ + +

+ If no unit is used then mkvmerge(1) will put at most n + data blocks into each cluster. The maximum number of blocks is 65535. + +

+ + +

+ If the number d is postfixed with + 'ms' then mkvmerge(1) puts at most + d milliseconds of data into each cluster. The minimum + for d is '100ms', and the maximum + is '32000ms'. + +

+ + +

+ mkvmerge(1) defaults to putting at most 65535 data blocks and 5000ms of data + into a cluster. + +

+ + +

+ Programs trying to find a certain frame can only seek directly to a cluster + and have to read the whole cluster afterwards. Therefore creating larger + clusters may lead to imprecise or slow seeking. + +

+ +
--clusters-in-meta-seek + +

+ Tells mkvmerge(1) to create a meta seek element at the end of the file + containing all clusters. See also the section about the Matroska file layout. + +

+ +
--timestamp-scale fattore + +

+ Forces the timestamp scale factor to factor. Valid + values are in the range + 1000..10000000 or the special + value -1. + +

+ + +

+ Normally mkvmerge(1) will use a value of 1000000 which + means that timestamps and durations will have a precision of 1ms. For files + that will not contain a video track but at least one audio track mkvmerge(1) + will automatically chose a timestamp scale factor so that all timestamps and + durations have a precision of one audio sample. This causes bigger overhead + but allows precise seeking and extraction. + +

+ + +

+ If the special value -1 is used then mkvmerge(1) will + use sample precision even if a video track is present. + +

+ +
--enable-durations + +

+ Write durations for all blocks. This will increase file size and does not + offer any additional value for players at the moment. + +

+ +
--no-cues + +

+ Tells mkvmerge(1) not to create and write the cue data which can be compared + to an index in an AVI. Matroska(tm) files can be played back without the cue + data, but seeking will probably be imprecise and slower. Use this only if + you're really desperate for space or for testing purposes. See also option + --cues + which can be specified for each input file. + +

+ +
--no-date + +

+ By default mkvmerge(1) sets the "date" segment information field to the time + & date when multiplexing started. With this option that field is not + written at all. + +

+ +
--disable-lacing + +

+ Disables lacing for all tracks. This will increase the file's size, + especially if there are many audio tracks. This option is not intended for + everyday use. + +

+ +
--disable-track-statistics-tags + +

+ Normally mkvmerge(1) will write certain tags with statistics for each + track. If such tags are already present then they will be overwritten. The + tags are BPS, DURATION, + NUMBER_OF_BYTES and + NUMBER_OF_FRAMES. + +

+ + +

+ Enabling this option prevents mkvmerge(1) from writing those tags and from + touching any existing tags with same names. + +

+ +
--disable-language-ietf + +

+ Normally mkvmerge(1) will write the new IETF BCP 47 language elements in + addition to the legacy language elements in track headers, chapters and + tags. If this option is used, only the legacy elements are written. + +

+ +
--normalize-language-ietf mode + +

+ Enables normalizing all IETF BCP 47 language tags to either their canonical + form with mode 'canonical', to their extended language + subtags form with mode 'extlang' or turns it off with + mode 'off'. By default normalization to the canonical + form is applied. + +

+ + +

+ In the canonical form all subtags for which preferred values exist are + replaced by those preferred values. This converts + e.g. 'zh-yue-jyutping' to + 'yue-jyutping' or 'fr-FX' to + 'fr-FR'. + +

+ + +

+ For the extended language subtags form the canonical form is built + first. Afterwards all primary languages for which an extended language + subtag exists are replaced by that extended language subtag and its + prefix. This converts e.g. 'yue-jyutping' back to + 'zh-yue-jyutping' but has no effect on + 'fr-FR' as 'fr' is not an extended + language subtag. + +

+ +
--stop-after-video-ends + +

+ Stops processing after the primary video track ends, discarding any + remaining packets of other tracks. + +

+ +
+ + + +

2.5. File splitting, linking, appending and concatenation (more global options)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split specifica + +

+ Splits the output file after a given size or a given time. Please note that + tracks can only be split right before a key frame. Therefore the split + point may be a bit off from what the user has specified. + +

+ + +

+ At the moment mkvmerge(1) supports the following modes: + +

+ + +
    + +
  1. + +

    + Suddivisione per dimensioni. + +

    + + +

    + Sintassi: --split + [size:]d[k|m|g] + +

    + + +

    + Esempi: --split size:700m or --split 150000000 + +

    + + +

    + The parameter d may end with 'k', + 'm' or 'g' to indicate that the size + is in KB, MB or GB respectively. Otherwise a size in bytes is assumed. + After the current output file has reached this size limit a new one will be + started. + +

    + + +

    + The 'size:' prefix may be omitted for compatibility + reasons. + +

    + +
  2. + + +
  3. + +

    + Suddivisione dopo una durata. + +

    + + +

    + Sintassi: --split + [duration:]HH:MM:SS.nnnnnnnnn|ds + +

    + + +

    + Esempi: --split duration:00:60:00.000 o --split + 3600s + +

    + + +

    + The parameter must either have the form + HH:MM:SS.nnnnnnnnn for specifying the duration in up + to nano-second precision or be a number d followed by + the letter 's' for the duration in + seconds. HH is the number of hours, + MM the number of minutes, SS + the number of seconds and nnnnnnnnn the number of + nanoseconds. Both the number of hours and the number of nanoseconds can be + omitted. There can be up to nine digits after the decimal point. After the + duration of the contents in the current output has reached this limit a new + output file will be started. + +

    + + +

    + The 'duration:' prefix may be omitted for compatibility + reasons. + +

    + +
  4. + + +
  5. + +

    + Splitting after specific timestamps. + +

    + + +

    + Sintassi: --split + timestamps:A[,B[,C...]] + +

    + + +

    + Esempio: --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + The parameters A, B, + C etc must all have the same format as the ones used + for the duration (see above). The list of timestamps is separated by + commas. After the input stream has reached the current split point's + timestamp a new file is created. Then the next split point given in this + list is used. + +

    + + +

    + The 'timestamps:' prefix must not be omitted. + +

    + +
  6. + + +
  7. + +

    + Keeping specific parts by specifying timestamp ranges while discarding + others. + +

    + + +

    + Syntax: --split + parts:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + Esempi: +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + The parts mode tells mkvmerge(1) to keep certain ranges of + timestamps while discarding others. The ranges to keep have to be listed + after the parts: keyword and be separated by commas. A + range itself consists of a start and an end timestamp in the same format the + other variations of --split accept (e.g. both + 00:01:20 and 80s refer to the same + timestamp). + +

    + + +

    + If a start timestamp is left out then it defaults to the previous range's + end timestamp. If there was no previous range then it defaults to the start + of the file (see example 3). + +

    + + +

    + If an end timestamp is left out then it defaults to the end of the source + files which basically tells mkvmerge(1) to keep the rest (see example 3). + +

    + + +

    + Normally each range will be written to a new file. This can be changed so + that consecutive ranges are written to the same file. For that the user has + to prefix the start timestamp with a +. This tells + mkvmerge(1) not to create a new file and instead append the range to the same + file the previous range was written to. Timestamps will be adjusted so that + there will be no gap in the output file even if there was a gap in the two + ranges in the input file. + +

    + + +

    + In example 1 mkvmerge(1) will create two files. The first will contain the + content starting from 00:01:20 until + 00:02:45. The second file will contain the content + starting from 00:05:50 until 00:10:30. + +

    + + +

    + In example 2 mkvmerge(1) will create only one file. This file will contain + both the content starting from 00:01:20 until + 00:02:45 and the content starting from + 00:05:50 until 00:10:30. + +

    + + +

    + In example 3 mkvmerge(1) will create two files. The first will contain the + content from the start of the source files until + 00:02:45. The second file will contain the content + starting from 00:05:50 until the end of the source files. + +

    + + +
    +

    Note:

    + +

    + Note that mkvmerge(1) only makes decisions about splitting at key frame + positions. This applies to both the start and the end of each range. So even + if an end timestamp is between two key frames mkvmerge(1) will continue + outputting the frames up to but excluding the following key frame. + +

    + +
    + +
  8. + + +
  9. + +

    + Keeping specific parts by specifying frame/field number ranges while + discarding others. + +

    + + +

    + Syntax: --split + parts-frames:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + Esempi: +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + The parts-frames mode tells mkvmerge(1) to keep certain + ranges of frame/field numbers while discarding others. The ranges to keep + have to be listed after the parts-frames: keyword and be + separated by commas. A range itself consists of a start and an end + frame/field number. Numbering starts at 1. + +

    + + +

    + If a start number is left out then it defaults to the previous range's end + number. If there was no previous range then it defaults to the start of the + file (see example 3). + +

    + + +

    + If an end number is left out then it defaults to the end of the source files + which basically tells mkvmerge(1) to keep the rest (see example 3). + +

    + + +

    + Normally each range will be written to a new file. This can be changed so + that consecutive ranges are written to the same file. For that the user has + to prefix the start number with a +. This tells + mkvmerge(1) not to create a new file and instead append the range to the same + file the previous range was written to. Timestamps will be adjusted so that + there will be no gap in the output file even if there was a gap in the two + ranges in the input file. + +

    + + +
    +

    Note:

    + +

    + Note that mkvmerge(1) only makes decisions about splitting at key frame + positions. This applies to both the start and the end of each range. So even + if an end frame/field number is between two key frames mkvmerge(1) will + continue outputting the frames up to but excluding the following key frame. + +

    + +
    + + +

    + In example 1 mkvmerge(1) will create two files. The first will contain the + content starting from the first key frame at or after 137 + up to but excluding the first key frame at or after + 258. The second file will contain the content starting + from 548 until 1211. + +

    + + +

    + In example 2 mkvmerge(1) will create only one file. This file will contain + both the content starting from 733 until + 912 and the content starting from 1592 + until 2730. + +

    + + +

    + In example 3 mkvmerge(1) will create two files. The first will contain the + content from the start of the source files until 430. The + second file will contain the content starting from 2512 + until the end of the source files. + +

    + + +

    + This mode considers only the first video track that is output. If no video + track is output no splitting will occur. + +

    + + +
    +

    Note:

    + +

    + The numbers given with this argument are interpreted based on the number of + Matroska(tm) blocks that are output. A single Matroska(tm) block contains + either a full frame (for progressive content) or a single field (for + interlaced content). mkvmerge does not distinguish between those two and + simply counts the number of blocks. For example: If one wanted to split + after the 25th full frame with interlaced content one would have to use + 50 (two fields per full frame) as the split point. + +

    + +
    + +
  10. + + +
  11. + +

    + Splitting after specific frames/fields. + +

    + + +

    + Sintassi: --split + frames:A[,B[,C...]] + +

    + + +

    + Esempio: --split frames:120,237,891 + +

    + + +

    + The parameters A, B, + C etc must all be positive integers. Numbering + starts at 1. The list of frame/field numbers is separated by commas. After + the input stream has reached the current split point's frame/field number a + new file is created. Then the next split point given in this list is used. + +

    + + +

    + Il prefisso 'frames:' non può essere omesso. + +

    + + +

    + This mode considers only the first video track that is output. If no video + track is output no splitting will occur. + +

    + + +
    +

    Note:

    + +

    + The numbers given with this argument are interpreted based on the number of + Matroska(tm) blocks that are output. A single Matroska(tm) block contains + either a full frame (for progressive content) or a single field (for + interlaced content). mkvmerge does not distinguish between those two and + simply counts the number of blocks. For example: If one wanted to split + after the 25th full frame with interlaced content one would have to use + 50 (two fields per full frame) as the split point. + +

    + +
    + +
  12. + + +
  13. + +

    + Splitting before specific chapters. + +

    + + +

    + Syntax: --split chapters:all or + --split + chapters:A[,B[,C...]] + +

    + + +

    + Esempio: --split chapters:5,8 + +

    + + +

    + The parameters A, B, + C etc must all be positive integers. Numbering + starts at 1. The list of chapter numbers is separated by commas. Splitting + will occur right before the first key frame whose timestamp is equal to or + bigger than the start timestamp for the chapters whose numbers are listed. + A chapter starting at 0s is never considered for splitting and discarded + silently. + +

    + + +

    + The keyword all can be used instead of listing all + chapter numbers manually. + +

    + + +

    + Il prefisso 'chapters:' non può essere omesso. + +

    + + +
    +

    Note:

    + +

    + The Matroska(tm) file format supports arbitrary deeply nested chapter + structures called 'edition entries' and 'chapter atoms'. However, this mode + only considers the top-most level of chapters across all edition entries. + +

    + +
    + +
  14. + +
+ + +

+ For this splitting mode the output filename is treated differently than for + the normal operation. It may contain a printf like + expression '%d' including an optional field width, + e.g. '%02d'. If it does then the current file number will be + formatted appropriately and inserted at that point in the filename. If + there is no such pattern then a pattern of '-%03d' is assumed + right before the file's extension: '-o output.mkv' would result + in 'output-001.mkv' and so on. If there's no extension then + '-%03d' will be appended to the name. + +

+ + +

+ Another possible pattern is '%c' which will be replaced by the + name of the first chapter in the file. Note that when '%c' is + present, the pattern '-%03d' will not be added automatically. + +

+ +
--link + +

+ Link files to one another when splitting the output file. See the section on + file linking below for details. + +

+ +
--link-to-previous segment-UID + +

+ Links the first output file to the segment with the segment UID given by the + segment-UID parameter. See the section on file linking below for details. + +

+ + +

+ Se il SID comincia con = il resto è interpretato come nome per un file + Matroska il cui UID del segmento è letto e usato. + +

+ +
--link-to-next segment-UID + +

+ Links the last output file to the segment with the segment UID given by the + segment-UID parameter. See the section on file linking below for details. + +

+ + +

+ Se il SID comincia con = il resto è interpretato come nome per un file + Matroska il cui UID del segmento è letto e usato. + +

+ +
--append-mode modalità + +

+ Determines how timestamps are calculated when appending files. The + parameter mode can have two values: + 'file' which is also the default and + 'track'. + +

+ + +

+ When mkvmerge appends a track (called 'track2_1' from now + on) from a second file (called 'file2') to a track + (called 'track1_1') from the first file (called + 'file1') then it has to offset all timestamps for + 'track2_1' by an amount. For 'file' + mode this amount is the highest timestamp encountered in + 'file1' even if that timestamp was from a different track + than 'track1_1'. In track mode the offset is the highest + timestamp of 'track1_1'. + +

+ + +

+ Unfortunately mkvmerge cannot detect which mode to use reliably. Therefore + it defaults to 'file' mode. 'file' + mode usually works better for files that have been created independently of + each other; e.g. when appending AVI or MP4 + files. 'track' mode may work better for sources that are + essentially just parts of one big file, e.g. for VOB and + EVO files. + +

+ + +

+ Subtitle tracks are always treated as if 'file' mode were + active even if 'track' mode actually is. + +

+ +
--append-to + SFID1:STID1:DFID1:DTID1[,...] + +

+ This option controls to which track another track is appended. Each spec + contains four IDs: a file ID, a track ID, a second file ID and a second + track ID. The first pair, "source file ID" and "source track ID", + identifies the track that is to be appended. The second pair, "destination + file ID" and "destination track ID", identifies the track the first one is + appended to. + +

+ + +

+ If this option has been omitted then a standard mapping is used. This + standard mapping appends each track from the current file to a track from + the previous file with the same track ID. This allows for easy appending if + a movie has been split into two parts and both file have the same number of + tracks and track IDs with the command mkvmerge -o output.mkv + part1.mkv +part2.mkv. + +

+ +
+ + +

+ A single '+' causes the next file to be appended instead of added. The '+' + can also be put in front of the next file name. Therefore the following two + commands are equivalent: + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv file1.mkv +file2.mkv
+
[ file1 file2 + ] + +

+ If multiple file names are contained in a pair of square brackets then the + second and all following files will be appended to the first file named + within the brackets. + +

+ + +

+ This is an alternative syntax to using '+' between the file names. Therefore + the following two commands are equivalent: + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv '[' file1.mkv file2.mkv ']'
+
= + +

+ For certain file types (MPEG program streams = VOBs) mkvmerge(1) normally + looks for files in the same directory as an input file that have the same + base name and only differ in their running number (e.g. 'VTS_01_1.VOB', + 'VTS_01_2.VOB', 'VTS_01_3.VOB' etc) and treats all of those files as if they + were concatenated into a single big file. This option, a single '=', causes + mkvmerge not to look for those additional files. + +

+ + +

+ The '=' can also be put in front of the next file name. Therefore the + following two commands are equivalent: + +

+ +
$ mkvmerge -o full.mkv = file1.vob
+$ mkvmerge -o full.mkv =file1.vob
+
( file1 file2 + ) + +

+ If multiple file names are contained in a pair of parenthesis then those + files will be treated as if they were concatenated into a single big file + consisting of the content of each of the files one after the other. + +

+ + +

+ This can be used for e.g. VOB files coming from a DVD or MPEG transport + streams. It cannot be used if each file contains its own set of headers + which is usually the case with stand-alone files like AVI or MP4. + +

+ + +

+ Putting a file name into parenthesis also prevents mkvmerge(1) from looking + for additional files with the same base name as described in option + =. Therefore these two command lines are equivalent: + +

+ +
$ mkvmerge -o out.mkv = file.mkv
+$ mkvmerge -o out.mkv '(' file.mkv ')'
+ +

+ Several things should be noted: + +

+ + +
    + +
  1. + +

    + There must be spaces both after the opening and before the closing + parenthesis. + +

    + +
  2. + + +
  3. + +

    + Every parameter between parenthesis is interpreted as a file name. Therefore + all options applying to this logical file must be listed before the opening + parenthesis. + +

    + +
  4. + + +
  5. + +

    + Some shells treat parenthesis as special characters. Hence you must escape + or quote them as shown in the example above. + +

    + +
  6. + +
+ +
+ + + + +

2.6. Attachment support (more global options)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description description + +

+ Plain text description of the following attachment. Applies to the next + --attach-file + or --attach-file-once option. + + +

+ +
--attachment-mime-type MIME type + +

+ MIME type of the following attachment. Applies to the next + --attach-file + or --attach-file-once + option. A list of officially recognized MIME types can be + found e.g. at the + IANA homepage. The MIME type is mandatory for an + attachment. + +

+ + +

+ If no MIME type is given a for an attachment, its type will + be detected automatically. + +

+ +
--attachment-name name + +

+ Sets the name that will be stored in the output file for this attachment. + If this option is not given then the name will be derived from the file name + of the attachment as given with the --attach-file + or the --attach-file-once + option. + +

+ +
+ --attach-file file-name, + --attach-file-once file-name + + +

+ Creates a file attachment inside the Matroska(tm) file. The + MIME type must have been set before this option can + used. The difference between the two forms is that during splitting the + files attached with --attach-file are attached to all + output files while the ones attached with + --attach-file-once are only attached to the first file + created. If splitting is not used then both do the same. + +

+ + +

+ mkvextract(1) can be used to extract attached files from a Matroska(tm) file. + +

+ +
--enable-legacy-font-mime-types + +

+ Enables the use of legacy MIME types for certain types of + font attachments. For example, + 'application/x-truetype-font' will be used for TrueType + fonts instead of 'fonts/ttf'. + +

+ + +

+ This affects both new attachments if its MIME type is + detected automatically and existing attachments whose stored + MIME types will be remapped to the legacy ones. + +

+ + +

+ The affected MIME types are 'font/sfnt', + 'font/ttf' and 'font/collection' which + are all mapped to 'application/x-truetype-fonts' and + 'font/otf' which is mapped to + 'application/vnd.ms-opentype'. + +

+ +
+ + + +

2.7. Options that can be used for each input file

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks + [!]n,m,... + +

+ Copy the audio tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch. They're not simply the track numbers (see section track IDs). Default: copy all audio + tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ Default: copy all tracks of this kind. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-d, --video-tracks + [!]n,m,... + +

+ Copy the video tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch. They're not simply the track numbers (see section track IDs). Default: copy all video + tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-s, --subtitle-tracks + [!]n,m,... + +

+ Copy the subtitle tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch. They're not simply the track numbers (see section track IDs). Default: copy all subtitle + tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-b, --button-tracks + [!]n,m,... + +

+ Copy the button tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch. They're not simply the track numbers (see section track IDs). Default: copy all button + tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
--track-tags + [!]n,m,... + +

+ Copy the tags for tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch (see section track IDs). + They're not simply the track numbers. Default: copy tags for all tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy everything but the IDs listed after the !. + +

+ +
-m, --attachments + [!]n[:all|first],m[:all|first],... + +

+ Copy the attachments with the IDs n, + m etc to all or only the first output file. Each ID + can be followed by either ':all' (which is the default if + neither is entered) or ':first'. If splitting is active + then those attachments whose IDs are specified with + ':all' are copied to all of the resulting output files + while the others are only copied into the first output file. If splitting is + not active then both variants have the same effect. + +

+ + +

+ The default is to copy all attachments to all output files. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy everything but the IDs listed after the !. + +

+ +
-A, --no-audio + +

+ Don't copy any audio track from this file. + +

+ +
-D, --no-video + +

+ Don't copy any video track from this file. + +

+ +
-S, --no-subtitles + +

+ Don't copy any subtitle track from this file. + +

+ +
-B, --no-buttons + +

+ Don't copy any button track from this file. + +

+ +
-T, --no-track-tags + +

+ Don't copy any track specific tags from this file. + +

+ +
--no-chapters + +

+ Don't copy chapters from this file. + +

+ +
-M, --no-attachments + +

+ Don't copy attachments from this file. + +

+ +
--no-global-tags + +

+ Don't copy global tags from this file. + +

+ +
-y, --sync + TID:d[,o[/p]] + +

+ Adjust the timestamps of the track with the id TID by + d ms. The track IDs are the same as the ones given + with --identify + (see section track IDs). + +

+ + +

+ o/p regola i timestamp di + o/p per correggere le derive + lineari. p viene impostato automaticamente su 1 se + omesso. + Sia o che p possono essere + numeri in virgola mobile. + +

+ + +

+ Predefiniti: nessuna correzione manuale della sincronizzazione (che è la + stessa di d = 0 e + o/p = + 1.0) + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--cues TID:none|iframes|all + +

+ Controls for which tracks cue (index) entries are created for the given + track (see section track + IDs). 'none' inhibits the creation of cue + entries. For 'iframes' only blocks with no backward or + forward references ( = I frames in video tracks) are put into the cue + sheet. 'all' causes mkvmerge(1) to create cue entries for + all blocks which will make the file very big. + +

+ + +

+ The default is 'iframes' for video and subtitle tracks + and 'none' for audio tracks. See also option --no-cues + which inhibits the creation of cue entries regardless of the + --cues options used. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--default-track-flag + TID[:bool] + +

+ Sets the "default track" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. The flag will be set if the source container doesn't + provide that information and the user doesn't specify it via this option. + +

+ + +

+ If the user does not explicitly select a track during playback, the player + should select one of the tracks that has its "default track" flag + set, taking user preferences such as their preferred language into account. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--track-enabled-flag + TID[:bool] + +

+ Sets the "track enabled" flag for the given track (see section + track IDs) to the given value + bool (0 or 1; defaults to 1 if not specified). + Tracks are enabled by default if no option is specified for them and the + source container doesn't provide this information either. + +

+ + +

+ Only tracks whose "track enabled" flag is set should be considered + for playback. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--forced-display-flag + TID[:bool] + +

+ Sets the "forced display" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. Use this for tracks containing onscreen text or + foreign-language dialogue. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--hearing-impaired-flag + TID[:bool] + +

+ Sets the "hearing impaired" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track is suitable for users + with hearing impairments. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--visual-impaired-flag + TID[:bool] + +

+ Sets the "visual impaired" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track is suitable for users + with visual impairments. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--text-descriptions-flag + TID[:bool] + +

+ Sets the "text descriptions" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track contains textual + descriptions of video content suitable for playback via a text-to-speech + system for a visually-impaired user. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--original-flag + TID[:bool] + +

+ Sets the "original language" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track is in the content's + original language (not a translation). + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--commentary-flag + TID[:bool] + +

+ Sets the "commentary" flag for the given track (see section track IDs) if the optional argument + bool is set to 1 or if it isn't + present. This flag can be set if the track contains commentary. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--track-name TID:nome + +

+ Sets the track name for the given track (see section track IDs) to + name. + +

+ +
--language TID:lingua + +

+ Sets the language for the given track (see section track IDs). Both ISO 639-2 language + codes and ISO 639-1 country codes are allowed. The country codes will be + converted to language codes automatically. All languages including their + ISO 639-2 codes can be listed with the --list-languages + option. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
-t, --tags + TID:file-name + +

+ Read tags for the track with the number TID from the + file file-name. See the section about tags below for details. + +

+ +
--aac-is-sbr + TID[:0|1] + +

+ Tells mkvmerge(1) that the track with the ID TID is + SBR AAC (also known as HE-AAC or + AAC+). This options is needed if a) the source file is an + AAC file (not for a Matroska(tm) file) + and b) the AAC file contains SBR AAC + data. The reason for this switch is that it is technically impossible to + automatically tell normal AAC data from SBR + AAC data without decoding a complete AAC frame. As + there are several patent issues with AAC decoders + mkvmerge(1) will never contain this decoding stage. So for SBR + AAC files this switch is mandatory. The resulting file might not + play back correctly or even not at all if the switch was omitted. + +

+ + +

+ If the source file is a Matroska(tm) file then the + CodecID should be enough to detect SBR + AAC. However, if the CodecID is wrong then + this switch can be used to correct that. + +

+ + +

+ If mkvmerge wrongfully detects that an AAC file is + SBR then you can add ':0' to the track + ID. + +

+ +
--audio-emphasis TID:n|symbolic-name + +

+ Sets the emphasis for the audio track with the track ID + TID. The mode can either be a number + n (certain values between 0 and + 16) or a symbolic name. All valid numbers & + symbolic names can be listed with the --list-audio-emphasis + option. + +

+ +
--reduce-to-core TID + +

+ Some audio codecs have a lossy core and optional extensions that implement + lossless decoding. This option tells mkvmerge(1) to only copy the core but + not the extensions. By default mkvmerge(1) copies both the core and the + extensions. + +

+ + +

+ Currently only DTS tracks are affected by this + option. TrueHD tracks that contain an embedded AC-3 core + are instead presented as two separate tracks for which the user can select + which track to copy. For DTS such a scheme would not work + as the HD extensions cannot be decoded by themselves – unlike the TrueHD + data. + +

+ +
--remove-dialog-normalization-gain + TID + +

+ Some audio codecs contain header fields that tell the decoder or player to + apply a (usually negative) gain for dialog normalization. This option tells + mkvmerge(1) to remove or minimize that gain by modifying the corresponding + header fields. + +

+ + +

+ Currently only AC-3, DTS and + TrueHD tracks are affected by this option. + +

+ +
--timestamps TID:file-name + +

+ Read the timestamps to be used for the specific track ID from + file-name. These timestamps forcefully override the + timestamps that mkvmerge(1) normally calculates. Read the section about external timestamp files. + +

+ +
--default-duration TID:x + +

+ Forces the default duration of a given track to the specified value. Also + modifies the track's timestamps to match the default duration. The argument + x must be postfixed with 's', + 'ms', 'us', 'ns', + 'fps', 'p' or 'i' + to specify the default duration in seconds, milliseconds, microseconds, + nanoseconds, 'frames per second', 'progressive frames per second' or + 'interlaced frames per second' respectively. The number + x itself can be a floating point number or a + fraction. + +

+ + +

+ If the default duration is not forced then mkvmerge will try to derive the + track's default duration from the container and/or the encoded bitstream for + certain track types, e.g. AVC/H.264 or MPEG-2. + +

+ + +

+ This option can also be used to change the FPS of video + tracks without having to use an external timestamp file. + +

+ +
--fix-bitstream-timing-information + TID[:0|1] + +

+ Normally mkvmerge(1) does not change the timing information (frame/field + rate) stored in the video bitstream. With this option that information is + adjusted to match the container timing information. The container timing + information can come from various sources: from the command line (see option + --default-duration), + the source container or derived from the bitstream. + +

+ + +
+

Note:

+ +

This has only been implemented for AVC/H.264 video tracks so far.

+ +
+ +
--compression TID:n + +

+ Selects the compression method to be used for the track. Note that the + player also has to support this method. Valid values are + 'none', 'zlib' and + 'mpeg4_p2'/'mpeg4p2'. + +

+ +

+ The compression method + 'mpeg4_p2'/'mpeg4p2' is a special + compression method called 'header removal' that is only available for + MPEG4 part 2 video tracks. + +

+ +

+ The default for some subtitle types is 'zlib' + compression. This compression method is also the one that most if not all + playback applications support. Support for other compression methods other + than 'none' is not assured. + +

+ +
+ + + +

2.8. Options that only apply to video tracks

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc + TID:FourCC + +

+ Forces the FourCC to the specified value. Works only + for video tracks in the 'MS compatibility mode'. + +

+ +
--display-dimensions + TID:widthxheight + +

+ Matroska(tm) files contain two values that set the display properties that a + player should scale the image on playback to: display width and display + height. These values can be set with this option, + e.g. '1:640x480'. + +

+ + +

+ Another way to specify the values is to use the --aspect-ratio + or the --aspect-ratio-factor + option (see below). These options are mutually exclusive. + +

+ +
--aspect-ratio + TID:ratio|width/height + +

+ Matroska(tm) files contain two values that set the display properties that a + player should scale the image on playback to: display width and display + height. With this option mkvmerge(1) will automatically calculate the + display width and display height based on the image's original width and + height and the aspect ratio given with this option. The ratio can be given + either as a floating point number ratio or as a + fraction 'width/height', + e.g. '16/9'. + +

+ + +

+ Another way to specify the values is to use the --aspect-ratio-factor + or --display-dimensions + options (see above and below). These options are mutually exclusive. + +

+ +
--aspect-ratio-factor TID:factor|n/d + +

+ Another way to set the aspect ratio is to specify a + factor. The original aspect ratio is first multiplied + with this factor and used as the target aspect ratio + afterwards. + +

+ + +

+ Another way to specify the values is to use the --aspect-ratio + or --display-dimensions + options (see above). These options are mutually exclusive. + +

+ +
--cropping TID:left,top,right,bottom + +

+ Sets the pixel cropping parameters of a video track to the given values. + +

+ +
--color-matrix-coefficients TID:n + +

+ Sets the matrix coefficients of the video used to derive luma and chroma + values from red, green and blue color primaries. The parameter + n is an integer rangeing from 0 + and 10. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: GBR, 1: BT709, + 2: unspecified, 3: reserved, + 4: FCC, 5: BT470BG, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 non-constant + luminance, 10: BT2020 constant luminance + +

+ +
--color-bits-per-channel TID:n + +

+ Sets the number of coded bits for a color channel. A value of + 0 indicates that the number of bits is unspecified. + +

+ +
--chroma-subsample TID:hori,vert + +

+ The amount of pixels to remove in the Cr and Cb channels for every pixel not + removed horizontally/vertically. + +

+ + +

+ Example: For video with 4:2:0 chroma subsampling, the parameter should be + set to + TID:1,1. + +

+ +
--cb-subsample TID:hori,vert + +

+ The amount of pixels to remove in the Cb channel for every pixel not removed + horizontally/vertically. This is additive with + --chroma-subsample. + +

+ + +

+ Example: For video with 4:2:1 chroma subsampling, the parameter + --chroma-subsample should be set to + TID:1,0 + and Cb-subsample should be set to + TID:1,0. + +

+ +
--chroma-siting TID:hori,vert + +

+ Sets how chroma is sited horizontally/vertically (0: + unspecified, 1: top collocated, 2: + half). + +

+ +
--color-range TID:n + +

+ Sets the clipping of the color ranges (0: unspecified, + 1: broadcast range, 2: full range + (no clipping), 3: defined by + MatrixCoefficients/TransferCharacteristics). + +

+ +
--color-transfer-characteristics + TID:n + +

+ The transfer characteristics of the video. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: gamma 2.2 curve, 5: gamma 2.8 + curve, 6: SMPTE 170M, 7: SMPTE + 240M, 8: linear, 9: log, + 10: log sqrt, 11: IEC 61966-2-4, + 12: ITU-R BT.1361 extended color gamut, + 13: IEC 61966-2-1, 14: ITU-R + BT.2020 10 bit, 15: ITU-R BT.2020 12 bit, + 16: SMPTE ST 2084, 17: SMPTE ST + 428-1; 18: ARIB STD-B67 (HLG) + +

+ +
--color-primaries TID:n + +

+ Sets the color primaries of the video. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: ITU-R BT.470M, 5: ITU-R + BT.470BG, 6: SMPTE 170M, 7: SMPTE + 240M, 8: FILM, 9: ITU-R BT.2020, + 10: SMPTE ST 428-1, 22: JEDEC P22 + phosphors + +

+ +
--max-content-light TID:n + +

+ Sets the maximum brightness of a single pixel (Maximum Content Light Level) + in candelas per square meter (cd/m²). The value of n + should be a non-negtive integer. + +

+ +
--max-frame-light TID:n + +

+ Sets the maximum brightness of a single full frame (Maximum Frame-Average + Light Level) in candelas per square meter (cd/m²). The value of + n should be a non-negtive integer. + +

+ +
--chromaticity-coordinates + TID:red-x,red-y,green-x,green-y,blue-x,blue-y + +

+ Sets the red/green/blue chromaticity coordinates as defined by CIE 1931. + +

+ +
--white-color-coordinates TID:x,y + +

+ Sets the white color chromaticity coordinates as defined by CIE 1931. + +

+ +
--max-luminance TID:float + +

+ Sets the maximum luminance in candelas per square meter (cd/m²). The value + should be less than 9999.99. + +

+ +
--min-luminance TID:float + +

+ Sets the minimum luminance in candelas per square meter (cd/m²). The value + should be less than 999.9999. + +

+ +
--projection-type TID:method + +

+ Sets the video projection method used. Valid values are 0 (rectangular + projection), 1 (equirectangular projection), 2 (cubemap projection) and 3 + (mesh projection). + +

+ +
--projection-private TID:data + +

+ Sets private data that only applies to a specific projection. Data must be + given as hex numbers with or without the "0x" prefix, with or + without spaces. + +

+ +
--projection-pose-yaw TID:float + +

+ Specifica lo spostamento della rotazione della proiezione. + +

+ +
--projection-pose-pitch TID:float + +

+ Specifica il passo della rotazione della proiezione. + +

+ +
--projection-pose-roll TID:float + +

+ Specifica una rotazione del rullo della proiezione. + +

+ +
--field-order TID:n + +

+ Sets the field order for the video track with the track ID + TID. The order must be one of the following numbers: + +

+ + +

+ 0: progressive; 1: interlaced with + top field displayed first and top field stored first; + 2: undetermined field order; 6: + interlaced with bottom field displayed first and bottom field stored first; + 9: interlaced with bottom field displayed first and top + field stored first; 14: interlaced with top field + displayed first and bottom field stored first + +

+ +
--stereo-mode TID:n|symbolic-name + +

+ Sets the stereo mode for the video track with the track ID + TID. The mode can either be a number + n between 0 and + 14 or a symbolic name. All valid numbers & names + can be listed with the --list-stereo-modes + option. + +

+ +
+ + + +

2.9. Options that only apply to text subtitle tracks

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset TID:character-set + +

+ Sets the character set for the conversion to UTF-8 for UTF-8 subtitles for + the given track ID. If not specified the charset will be derived from the + current locale settings. Note that a charset is not needed for subtitles + read from Matroska(tm) files or from Kate streams, as these are always stored + in UTF-8. See the section about text files and character + sets for an explanation how mkvmerge(1) converts between character + sets. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
+ + + +

2.10. Altre opzioni

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify + file-name + +

+ Will let mkvmerge(1) probe the single file and report its type, the tracks + contained in the file and their track IDs. If this option is used then the + only other option allowed is the filename. + +

+ + +

The output format used for the result can be changed with the option --identification-format. +

+ +
-J nome-file + +

+ This is a convenient alias for "--identification-format json + --identify file-name". + +

+ +
-F, --identification-format + format + +

+ Determines the output format used by the --identify + option. The following formats are supported: text + (the default if this option isn't used) and json. + +

+ + +
    + +
  1. + +

    The text format is short and human-readable. It consists + of one line per item found (container, tracks, attachments etc.). +

    + + +

    This format is not meant to be parsed. The output will be translated into + the language mkvmerge(1) uses (see also --ui-language). +

    + +
  2. + + +
  3. + +

    + The json format outputs a machine-readable JSON + representation. This format follows the JSON schema described in the + following file: + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + All versions of the JSON schema are available both online and in the + released source code archives. + +

    + +
  4. + +
+ +
--probe-range-percentage percentage + +

+ File types such as MPEG program and transport streams + (.vob, .m2ts) require parsing a + certain amount of data in order to detect all tracks contained in the file. + This amount is 0.3% of the source file's size or 10 MB, whichever is higher. + +

+ + +

+ If tracks are known to be present but not found then the percentage to probe + can be changed with this option. The minimum of 10 MB is built-in and + cannot be changed. + +

+ +
--list-audio-emphasis + +

+ Lists all valid numbers & their corresponding symbolic names for the + --audio-emphasis + option. + +

+ +
--list-languages + +

+ Lists all languages and their ISO 639-2 code which can be used with the + --language + option. + +

+ +
--list-stereo-modes + +

+ Lists all valid numbers & their corresponding symbolic names for the + --stereo-mode + option. + +

+ +
-l, --list-types + +

+ Lists supported input file types. + +

+ +
--priority priority + +

+ Sets the process priority that mkvmerge(1) runs with. Valid values are + 'lowest', 'lower', + 'normal', 'higher' and + 'highest'. If nothing is given then + 'normal' is used. On Unix like systems mkvmerge(1) will + use the + nice(2) + function. Therefore only the super user can use 'higher' + and 'highest'. On Windows all values are useable for + every user. + +

+ + +

Selecting 'lowest' also causes mkvmerge(1) to select idle + I/O priority in addition to the lowest possible process priority. +

+ +
--command-line-charset character-set + +

+ Sets the character set to convert strings given on the command line from. It + defaults to the character set given by system's current locale. This + settings applies to arguments of the following options: --title, --track-name + and --attachment-description. + +

+ +
--output-charset character-set + +

+ Imposta il set caratteri per le stringhe convertite date in output. Di base + è impostato dalla lingua di sistema. + +

+ +
-r, --redirect-output + file-name + +

+ Writes all messages to the file file-name instead of + to the console. While this can be done easily with output redirection there + are cases in which this option is needed: when the terminal reinterprets the + output before writing it to a file. The character set set with --output-charset + is honored. + +

+ +
--flush-on-close + +

+ Indica al programma di scaricare tutti i dati memorizzati nella memoria + nello storage quando si chiudono i file aperti in scrittura. + Questo può essere usato per prevenire la perdita di dati in caso di + interruzioni di corrente o per eludere determinati problemi nel sistema + operativo o nei driver. + Il rovescio della medaglia è che il multiplexing richiederà più tempo poiché + mkvmerge attenderà fino a quando tutti i dati non saranno stati scritti + nella memoria prima di uscire. + Vedi riferimenti #2469 e #2480 nel tracker bug MKVToolNix per discussioni + approfondite su pro e contro. + +

+ +
--ui-language code + +

+ Forza le traduzioni per la lingua code da usare (per + esempio: 'it_IT' per le traduzioni in + Italiano). Immettendo 'list' come + code mostrerà la lista delle traduzioni disponibili. + +

+ +
--abort-on-warnings + +

+ Indica al programma di interrompere dopo il primo avviso. + Il codice di uscita del programma sarà 1. + +

+ +
--deterministic seed + +

+ Enables the creation of byte-identical files if the same version of + mkvmerge(1) is used with the same source files, the same set of options and + the same seed. Note that the "date" segment information field is not + written in this mode. + +

+ + +

The seed can be an arbitrary string and does not have to be a number.

+ + +

+ The result of byte-identical files is only guaranteed under the following + conditions: + +

+ + +
    + +
  1. + +

    The same version of mkvmerge(1) built with the same versions of libEBML and + libMatroska is used. +

    + +
  2. + + +
  3. + +

    The source files used are byte-identical.

    + +
  4. + + +
  5. + +

    The same command line options are used in the same order (with the notable + exception of --output …). +

    + +
  6. + +
+ + +

+ Using other versions of mkvmerge(1) or other command-line options may result + in the same byte-identical file but is not guaranteed to do so. + +

+ +
--debug argomento + +

+ Abilita il debug per una funzionalità. Questa opzione è utile per gli + sviluppatori. + +

+ +
--engage funzionalità + +

+ Turn on experimental features. A list of available features can be requested + with mkvmerge --engage list. These features are not meant + to be used in normal situations. + +

+ +
--gui-mode + +

+ Mostra la GUI (interfaccia grafica). In questa modalità a terminale ci + saranno delle righe specifiche su cosa sta succedendo. Questi messaggi + seguiranno il formato '#GUI#messaggio'. Il messaggio può + essere seguito da delle coppie chiave/valore come + '#GUI#messaggio#chiave1=valore1#chiave2=valore2…'. Né i + messaggi e né le chiavi saranno mai tradotte e l'output sarà sempre in + Inglese. + +

+ +
@options-file.json + +

+ Reads additional command line arguments from the file + options-file. See the section about option files for further information. + +

+ +
--capabilities + +

+ Lists information about optional features that have been compiled in and + exit. The first line output will be the version information. All following + lines contain exactly one word whose presence indicates that the feature has + been compiled in. These features are: + +

+ + +
    + +
  • + +

    + 'FLAC' -- reading raw FLAC files and + handling FLAC tracks in other containers, + e.g. Ogg(tm) or Matroska(tm). + +

    + +
  • + +
+ +
-h, --help + +

+ Mostra l'aiuto ed esci. + +

+ +
-V, --version + +

+ Mostra la versione ed esci. + +

+ +
+ + +

3. Uso

+ + +

+ For each file the user can select which tracks mkvmerge(1) should take. They + are all put into the file specified with -o. A list of + known (and supported) source formats can be obtained with the + -l option. + +

+ + +
+

Important:

+ +

+ L'ordine delle opzioni della riga di comando è importante. Leggere la + sezione "Opzioni" se + queste sono le prime volte che si utilizza il programma. + +

+ +
+ +

4. Option order

+ + + +

+ The order in which options are entered is important for some + options. Options fall into two categories: + +

+ + +
    + +
  1. + +

    + Options that affect the whole program and are not tied to any input + file. These include but are not limited to + --command-line-charset, --output or + --title. These can appear anywhere on the command line. + +

    + +
  2. + + +
  3. + +

    + Options that affect a single input file or a single track in an input + file. These options all apply to the following input file on the command + line. All options applying to the same input (or to tracks from the same + input file) file can be written in any order as long as they all appear + before that input file's name. Examples for options applying to an input + file are --no-chapters or + --chapter-charset. Examples for options applying to a + single track are --default-duration or + --language. + +

    + +
  4. + +
+ + +

+ The options are processed from left to right. If an option appears multiple + times within the same scope then the last occurrence will be used. Therefore + the title will be set to "Something else" in the following + example: + +

+ +
$ mkvmerge -o output.mkv --title 'This and that' input.avi --title 'Something else'
+ +

+ The following example shows that using the --language + option twice is OK because they're used in different scopes. Even though + they apply to the same track ID they apply to different input files and + therefore have different scopes: + +

+ +
$ mkvmerge -o output.mkv --language 0:fre français.ogg --language 0:deu deutsch.ogg
+

5. Esempi

+ + +

+ Let's assume you have a file called MyMovie.avi and the audio track in a + separate file, e.g. 'MyMovie.wav'. First you want to + encode the audio to OggVorbis(tm): + +

+ +
$ oggenc -q4 -oMyMovie.ogg MyMovie.wav
+ +

+ After a couple of minutes you can join video and audio: + +

+ +
$ mkvmerge -o MyMovie-with-sound.mkv MyMovie.avi MyMovie.ogg
+ +

+ If your AVI already contains an audio track then it will be + copied as well (if mkvmerge(1) supports the audio format). To avoid that + simply do + +

+ +
$ mkvmerge -o MyMovie-with-sound.mkv -A MyMovie.avi MyMovie.ogg
+ +

+ After some minutes of consideration you rip another audio track, e.g. the + director's comments or another language to + 'MyMovie-add-audio.wav'. Encode it again and join it up + with the other file: + +

+ +
$ oggenc -q4 -oMyMovie-add-audio.ogg MyMovie-add-audio.wav
+$ mkvmerge -o MM-complete.mkv MyMovie-with-sound.mkv MyMovie-add-audio.ogg
+ +

+ The same result can be achieved with + +

+ +
$ mkvmerge -o MM-complete.mkv -A MyMovie.avi MyMovie.ogg MyMovie-add-audio.ogg
+ +

+ Now fire up mplayer(tm) and enjoy. If you have + multiple audio tracks (or even video tracks) then you can tell + mplayer(tm) which track to play with the + '-vid' and '-aid' options. These are + 0-based and do not distinguish between video and audio. + +

+ + +

+ If you need an audio track synchronized you can do that easily. First find + out which track ID the Vorbis track has with + +

+ +
$ mkvmerge --identify outofsync.ogg
+ +

+ Now you can use that ID in the following command line: + +

+ +
$ mkvmerge -o goodsync.mkv -A source.avi -y 12345:200 outofsync.ogg
+ +

+ This would add 200ms of silence at the beginning of the audio track with the + ID 12345 taken from 'outofsync.ogg'. + +

+ + +

+ Some movies start synced correctly but slowly drift out of sync. For these + kind of movies you can specify a delay factor that is applied to all + timestamps -- no data is added or removed. So if you make that factor too + big or too small you'll get bad results. An example is that an episode I + transcoded was 0.2 seconds out of sync at the end of + the movie which was 77340 frames long. At + 29.97fps 0.2 seconds correspond to + approx. 6 frames. So I did + +

+ +
$ mkvmerge -o goodsync.mkv -y 23456:0,77346/77340 outofsync.mkv
+ +

+ The result was fine. + +

+ + +

+ The sync options can also be used for subtitles in the same manner. + +

+ + +

+ For text subtitles you can either use some Windows software (like + SubRipper(tm)) or the + subrip(tm) package found in + transcode(1)'s + sources in the 'contrib/subrip' directory. The general + process is: + +

+ + +
    + +
  1. + +

    extract a raw subtitle stream from the source:

    +
    $ tccat -i /path/to/copied/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o mymovie
    +
  2. + + +
  3. + +

    convert the resulting PGM images to text with gocr:

    +
    $ pgm2txt mymovie
    +
  4. + + +
  5. + +

    spell-check the resulting text files:

    +
    $ ispell -d american *txt
    +
  6. + + +
  7. + +

    convert the text files to a SRT file:

    +
    $ srttool -s -w -i mymovie.srtx -o mymovie.srt
    +
  8. + +
+ + +

+ The resulting file can be used as another input file for mkvmerge(1): + +

+ +
$ mkvmerge -o mymovie.mkv mymovie.avi mymovie.srt
+ +

+ If you want to specify the language for a given track then this is easily + done. First find out the ISO 639-2 code for your language. mkvmerge(1) can + list all of those codes for you: + +

+ +
$ mkvmerge --list-languages
+ +

+ Search the list for the languages you need. Let's assume you have put two + audio tracks into a Matroska(tm) file and want to set their language codes and + that their track IDs are 2 and 3. This can be done with + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut without-lang-codes.mkv
+ +

+ As you can see you can use the --language + switch multiple times. + +

+ + +

+ Maybe you'd also like to have the player use the Dutch language as the + default language. You also have extra subtitles, e.g. in English and French, + and want to have the player display the French ones by default. This can be + done with + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut --default-track-flag 3 without-lang-codes.mkv --language 0:eng english.srt --default-track-flag 0 --language 0:fre french.srt
+ +

+ If you do not see the language or default track flags that you've specified + in mkvinfo(1)'s output then please read the section about default values. + +

+ + +

+ Turn off the compression for an input file. + +

+ +
$ mkvmerge -o no-compression.mkv --compression -1:none MyMovie.avi --compression -1:none mymovie.srt
+ +

6. ID delle tracce

+ + + +

6.1. Regular track IDs

+ + + +

+ Some of the options for mkvmerge(1) need a track ID to specify which track + they should be applied to. Those track IDs are printed by the readers when + demuxing the current input file, or if mkvmerge(1) is called with the --identify + option. An example for such output: + +

+ +
$ mkvmerge -i v.mkv
+File 'v.mkv': container: Matroska
+Track ID 0: video (V_MS/VFW/FOURCC, DIV3)
+Track ID 1: audio (A_MPEG/L3)
+ +

+ Do not confuse the track IDs that are assigned to the tracks that are placed + in the output MKV file with the track IDs of the input files. Only the input + file track IDs are used for options needing these values. + +

+ + +

+ Also note that each input file has its own set of track IDs. Therefore the + track IDs for file 'file1.ext' as reported by + 'mkvmerge --identify' do not change no matter how many + other input files are there or in which position + 'file1.ext' is used. + +

+ + +

+ Track IDs are assigned like this: + +

+ + +
    + +
  • + +

    + AVI files: The video track has the ID 0. The audio tracks + get IDs in ascending order starting at 1. + +

    + +
  • + + +
  • + +

    + AAC, AC-3, MP3, + SRT and WAV files: The one 'track' in that + file gets the ID 0. + +

    + +
  • + + +
  • + +

    + Most other files: The track IDs are assigned in order the tracks are found + in the file starting at 0. + +

    + +
  • + +
+ + +

+ The options that use the track IDs are the ones whose description contains + 'TID'. The following options use track IDs as well: + --audio-tracks, --video-tracks, + --subtitle-tracks, --button-tracks and + --track-tags. + +

+ + + +

6.2. Special track IDs

+ + + +

+ There are several IDs that have special meaning and do not occur in the + identification output. + +

+ + +

+ The special track ID '-1' is a wild card and applies + the given switch to all tracks that are read from an input file. + +

+ + +

+ The special track ID '-2' refers to the chapters in a + source file. Currently only the --sync option uses this + special ID. As an alternative to --sync -2:… the option + --chapter-sync … can be used. + +

+ + +

7. Language handling

+ + + +

+ Matroska(tm) has support for two different types of language elements: the + old, deprecated "Language" element containing ISO 639-2 alpha 3 codes and + the new "LanguageIETF" tags containing IETF BCP 47 language tags. All of + mkvmerge(1)'s options that accept a language accept a BCP 47 language + tag. mkvmerge(1) will derive the value for the deprecated "Language" element + from the BCP 47 language tags wherever possible. + +

+ + +

+ When identifying a file in JSON mode, existing "LanguageIETF" track header + elements will be output as the language_ietf track + property. + +

+ + +

+ When writing a file mkvmerge(1) will always write the "LanguageIETF", + "ChapLanguageIETF" and "TagLanguageIETF" elements (the latter two only if + chapters or tags are written respectively). In addition to those elements + the corresponding old elements will be written; they'll be set to the ISO + 639-2 code portion of the BCP 47 language tag. For example, when the track + language is set to sr-Cyrl-RS "LanguageIETF" will be set + to sr-Cyrl-RS and the old "Language" element will be set + to srp. + +

+ + +

+ When reading existing files (Matroska files, XML chapter or tag files etc.) + that already contain "…LanguageIETF" elements the existing elements will be + kept. Otherwise "…LanguageIETF" elements will be added based on command-line + options and other existing deprecated "…Language" elements. + +

+ + +

+ The creation of the new elements can be disabled completely with the + command-line option --disable-language-ietf which operates + on all three new elements. + +

+ + +

+ You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. + +

+ +

8. File di testo e conversioni della codifica caratteri

+ + +
+

Note:

+ +

+ This section applies to all programs in MKVToolNix even if it only mentions + mkvmerge(1). + +

+ +
+ + +

8.1. Introduzione

+ + +

+ All text in a Matroska(tm) file is encoded in UTF-8. This means that + mkvmerge(1) has to convert every text file it reads as well as every text + given on the command line from one character set into UTF-8. In return this + also means that mkvmerge(1)'s output has to be converted back to that + character set from UTF-8, e.g. if a non-English translation is used with + --ui-language + or for text originating from a Matroska(tm) file. + +

+ + +

+ mkvmerge(1) does this conversion automatically based on the presence of a + byte order marker (short: BOM) or the system's current + locale. How the character set is inferred from the locale depends on the + operating system that mkvmerge(1) is run on. + +

+ + + +

8.2. Byte order markers (BOM)

+ + + +

+ Text files that start with a BOM are already encoded in one representation + of UTF. mkvmerge(1) supports the following five modes: UTF-8, UTF-16 Little + and Big Endian, UTF-32 Little and Big Endian. Text files with a BOM are + automatically converted to UTF-8. Any of the parameters that would otherwise + set the character set for such a file (e.g. --sub-charset) + is silently ignored. + +

+ + + +

8.3. Linux and Unix-like systems including macOS

+ + + +

+ On Unix-like systems mkvmerge(1) uses the + setlocale(3) + system call which in turn uses the environment variables + LANG, LC_ALL and + LC_CYPE. The resulting character set is often one of + UTF-8 or the ISO-8859-* family and is used for all text file operations and + for encoding strings on the command line and for output to the console. + +

+ + + +

8.4. Windows

+ + + +

+ On Windows the default character set used for converting text files is + determined by a call to the GetACP() system call. + +

+ + +

+ Reading the command line is done with the + GetCommandLineW() function which already returns a + Unicode string. Therefore the option --command-line-charset + is ignored on Windows. + +

+ + +

+ Output to the console consists of three scenarios: + +

+ + +
    + +
  1. + +

    + If the output is redirected with the option --redirect-output + then the default charset is UTF-8. This can be changed with --output-charset. + +

    + +
  2. + + +
  3. + +

    + If the output is redirected with cmd.exe itself, + e.g. with mkvinfo file.mkv > info.txt, then the + charset is always UTF-8 and cannot be changed. + +

    + +
  4. + + +
  5. + +

    + Otherwise (when writing directly to the console) the Windows function + WriteConsoleW() is used and the option --output-charset + is ignored. The console should be able to output all Unicode characters for + which the corresponding language support is installed (e.g. Chinese + characters might not be displayed on English Windows versions). + +

    + +
  6. + +
+ + + +

8.5. Opzioni della riga di comando

+ + + +

+ The following options exist that allow specifying the character sets: + +

+ + +
    + +
  • + +

    + --sub-charset + for text subtitle files and for text subtitle tracks stored in container + formats for which the character set cannot be determined unambiguously + (e.g. Ogg files), + +

    + +
  • + + +
  • + +

    + --chapter-charset + for chapter text files and for chapters and file titles stored in container + formats for which the character set cannot be determined unambiguously + (e.g. Ogg files for chapter information, track and file titles etc; MP4 + files for chapter information), + +

    + +
  • + + +
  • + +

    + --command-line-charset + for all strings on the command line, + +

    + +
  • + + +
  • + +

    + --output-charset + for all strings written to the console or to a file if the output has been + redirected with the --redirect-output + option. On non-Windows systems the default for the output charset is the + system's current charset. On Windows it defaults to UTF-8 both for + redirecting with --redirect-output + and with cmd.exe itself, e.g. mkvinfo file.mkv + > info.txt. + +

    + +
  • + +
+ + +

9. Option files

+ + + +

+ An option file is a file mkvmerge(1) can read additional command line + arguments from. This can be used in order to circumvent certain limitations + of the shell or the operating system when executing external programs like a + limited command line length. + +

+ + +

+ An option file contains JSON-formatted data. Its content must be a valid + JSON array consisting solely of JSON strings. The file's encoding must be + UTF-8. The file should not start with a byte order marker + (BOM), but if one exists, it will be skipped. + +

+ + +

+ The rules for escaping special characters inside JSON are the ones in the + official JSON specification, RFC 7159. + +

+ + +

+ The option file's name itself must be specified as a command line argument + prefixed with a '@' character. + +

+ + +

+ The command line 'mkvmerge -o "my file.mkv" -A "a movie.avi" + sound.ogg' could be converted into the following JSON option file + called e.g. 'options.json': + +

+ +
[
+  "-o",
+  "c:\\Matroska\\my file.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "a movie.avi",
+  "sound.ogg"
+]
+ +

+ The corresponding command would then be 'mkvmerge + @options.json'. + +

+ +

10. File linking

+ + +

+ Matroska(tm) supports file linking which simply says that a specific file is + the predecessor or successor of the current file. To be precise, it's not + really the files that are linked but the Matroska(tm) segments. As most files + will probably only contain one Matroska(tm) segment the following explanations + use the term 'file linking' although 'segment linking' would be more + appropriate. + +

+ + +

+ Each segment is identified by a unique 128 bit wide segment UID. This UID is + automatically generated by mkvmerge(1). The linking is done primarily via + putting the segment UIDs (short: SID) of the previous/next + file into the segment header information. mkvinfo(1) prints these + SIDs if it finds them. + +

+ + +

+ If a file is split into several smaller ones and linking is used then the + timestamps will not start at 0 again but will continue where the last file + has left off. This way the absolute time is kept even if the previous files + are not available (e.g. when streaming). If no linking is used then the + timestamps should start at 0 for each file. By default mkvmerge(1) does not + use file linking. If you want that you can turn it on with the + --link option. This option is only useful if splitting is + activated as well. + +

+ + +

+ Regardless of whether splitting is active or not the user can tell + mkvmerge(1) to link the produced files to specific + SIDs. This is achieved with the options + --link-to-previous and --link-to-next. + These options accept a segment SID in the format that + mkvinfo(1) outputs: 16 hexadecimal numbers between 0x00 + and 0xff prefixed with '0x' each, + e.g. '0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 0x5e + 0xca 0xb3 0x93'. Alternatively a shorter form can be used: 16 + hexadecimal numbers between 0x00 and + 0xff without the '0x' prefixes and + without the spaces, e.g. '41da7366d9cfb21eae78ebb45ecab393'. + +

+ + +

+ If splitting is used then the first file is linked to the + SID given with --link-to-previous and the + last file is linked to the SID given with + --link-to-next. If splitting is not used then the one + output file will be linked to both of the two SIDs. + +

+ +

11. Valori predefiniti

+ + +

+ The Matroska(tm) specification states that some elements have a default + value. Usually an element is not written to the file if its value is equal + to its default value in order to save space. The elements that the user + might miss in mkvinfo(1)'s output are the language and + the default track flag elements. The default value + for the language is English + ('eng'), and the default value for the default + track flag is true. Therefore if you used + --language 0:eng for a track then it will not show up in + mkvinfo(1)'s output. + +

+ +

12. Allegati

+ + +

+ Maybe you also want to keep some photos along with your Matroska(tm) file, or + you're using SSA subtitles and need a special + TrueType(tm) font that's really rare. In these cases + you can attach those files to the Matroska(tm) file. They will not be just + appended to the file but embedded in it. A player can then show those files + (the 'photos' case) or use them to render the subtitles (the + 'TrueType(tm) fonts' case). + +

+ + +

+ Here's an example how to attach a photo and a + TrueType(tm) font to the output file: + +

+ +
$ mkvmerge -o output.mkv -A video.avi sound.ogg \
+  --attachment-description "Me and the band behind the stage in a small get-together" \
+  --attachment-mime-type image/jpeg \
+  --attach-file me_and_the_band.jpg \
+  --attachment-description "The real rare and unbelievably good looking font" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file really_cool_font.ttf
+ +

+ If a Matroska(tm) containing attachments file is used as an input file then + mkvmerge(1) will copy the attachments into the new file. The selection which + attachments are copied and which are not can be changed with the options + --attachments + and --no-attachments. + +

+ +

13. Capitoli

+ + +

+ The Matroska(tm) chapter system is more powerful than the old known system + used by OGM files. The full specifications can be found at + the Matroska website. + +

+ + +

+ mkvmerge(1) supports two kinds of chapter files as its input. The first + format, called 'simple chapter format', is the same format that the + OGM tools expect. The second format is a XML based + chapter format which supports all of Matroska(tm)'s chapter functionality. + +

+ + +

+ Apart from dedicated chapter files mkvmerge(1) can also read chapters from + other file formats (e.g. MP4, Ogg, Blu-rays or DVDs). + +

+ + +

13.1. The simple chapter format

+ + + +

+ This format consists of pairs of lines that start with + 'CHAPTERxx=' and 'CHAPTERxxNAME=' + respectively. The first one contains the start timestamp while the second + one contains the title. Here's an example: + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=Intro
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=Baby prepares to rock
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=Baby rocks the house
+ +

+ mkvmerge(1) will transform every pair or lines into one Matroska(tm) + ChapterAtom. It does not set any + ChapterTrackNumber which means that all chapters + apply to all tracks in the file. + +

+ + +

+ As this is a text file character set conversion may need to be done. See the + section about text files + and character sets for an explanation how mkvmerge(1) converts between + character sets. + +

+ + + +

13.2. The XML based chapter format

+ + +

+ The XML based chapter format looks like this example: + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>A short chapter</ChapterString>
+        <ChapterLanguage>eng</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>A part of that short chapter</ChapterString>
+          <ChapterLanguage>eng</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ With this format three things are possible that are not possible with the + simple chapter format: + +

+ + +
    + +
  1. +

    The timestamp for the end of the chapter can be set,

    +
  2. + +
  3. +

    chapters can be nested,

    +
  4. + +
  5. +

    the language and country can be set.

    +
  6. + +
+ + +

+ The mkvtoolnix distribution contains some sample files in the + doc subdirectory which can be used as a basis. + +

+ + +

+ The following lists the supported XML tags, their data types and, where + appropriate, the valid range for their values: + +

+ +
Chapters (master)
+  EditionEntry (master)
+    EditionUID (unsigned integer, valid range: 1 <= value)
+    EditionFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagDefault (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagOrdered (unsigned integer, valid range: 0 <= value <= 1)
+    ChapterAtom (master)
+      ChapterAtom (master)
+      ChapterUID (unsigned integer, valid range: 1 <= value)
+      ChapterTimeStart (unsigned integer)
+      ChapterTimeEnd (unsigned integer)
+      ChapterFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterFlagEnabled (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterSegmentUID (binary, valid range: 1 <= length in bytes)
+      ChapterSegmentEditionUID (unsigned integer, valid range: 1 <= value)
+      ChapterPhysicalEquiv (unsigned integer)
+      ChapterTrack (master)
+        ChapterTrackNumber (unsigned integer, valid range: 1 <= value)
+      ChapterDisplay (master)
+        ChapterString (UTF-8 string)
+        ChapterLanguage (UTF-8 string)
+        ChapterCountry (UTF-8 string)
+      ChapterProcess (master)
+        ChapterProcessCodecID (unsigned integer)
+        ChapterProcessPrivate (binary)
+        ChapterProcessCommand (master)
+          ChapterProcessTime (unsigned integer)
+          ChapterProcessData (binary)
+ + +

13.3. Reading chapters from Blu-rays

+ + + +

+ mkvmerge(1) can read chapters from unencrypted Blu-rays. For that you can use + the path to one of the MPLS play lists with the + --chapters parameter. + +

+ + +

+ Example: --chapters + /srv/blurays/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. Reading chapters from DVDs

+ + + +

+ When MKVToolNix is compiled with the libdvdread(tm) + library, mkvmerge(1) can read chapters from DVDs. For that you can use the + path to one of the folders or files on the DVD with the + --chapters parameter. As DVDs can contain more than + one title and each title has its own set of chapters, you can append a colon + and the desired title number to the end of the file name argument. The title + number defaults to 1. + +

+ + +

+ Example: --chapters /srv/dvds/BigBuckBunny/VIDEO_TS:2 + +

+ + + +

13.5. General notes

+ + +

+ When splitting files mkvmerge(1) will correctly adjust the chapters as + well. This means that each file only includes the chapter entries that apply + to it, and that the timestamps will be offset to match the new timestamps of + each output file. + +

+ + +

+ mkvmerge(1) is able to copy chapters from Matroska(tm) source files unless this + is explicitly disabled with the --no-chapters + option. The chapters from all sources (Matroska(tm) files, Ogg files, + MP4 files, chapter text files) are usually not merged but + end up in separate ChapterEditions. Only if chapters + are read from several Matroska(tm) or XML files that share the same edition + UIDs will chapters be merged into a single + ChapterEdition. If such a merge is desired in other + situations as well then the user has to extract the chapters from all + sources with mkvextract(1) first, merge the XML files manually and mux them + afterwards. + +

+ + +

14. Tag

+ + + +

14.1. Introduzione

+ + + +

+ Matroska(tm)'s tag system is similar to that of other containers: a set of + KEY=VALUE pairs. However, in Matroska(tm) these tags + can also be nested, and both the KEY and the + VALUE are elements of their own. The example file + example-tags-2.xml shows how to use this system. + +

+ + + +

14.2. Scope of the tags

+ + + +

+ Matroska(tm) tags do not automatically apply to the complete file. They can, + but they also may apply to different parts of the file: to one or more + tracks, to one or more chapters, or even to a combination of both. The + Matroska + specification gives more details about this fact. + +

+ + +

+ One important fact is that tags are linked to tracks or chapters with the + Targets Matroska(tm) tag element, and that the UIDs + used for this linking are not the track IDs mkvmerge(1) + uses everywhere. Instead the numbers used are the UIDs which mkvmerge(1) + calculates automatically (if the track is taken from a file format other + than Matroska(tm)) or which are copied from the source file if the track's + source file is a Matroska(tm) file. Therefore it is difficult to know which + UIDs to use in the tag file before the file is handed over to mkvmerge(1). + +

+ + +

+ mkvmerge(1) knows two options with which you can add tags to Matroska(tm) + files: The --global-tags + and the --tags + options. The difference is that the former option, --global-tags, + will make the tags apply to the complete file by removing any of those + Targets elements mentioned above. The latter option, + --tags, + automatically inserts the UID that mkvmerge(1) generates for the tag + specified with the TID part of the --tags option. + +

+ + + +

14.3. Esempio

+ + +

+ Let's say that you want to add tags to a video track read from an + AVI. mkvmerge --identify file.avi tells + you that the video track's ID (do not mix this ID with the UID!) is 0. So + you create your tag file, leave out all Targets + elements and call mkvmerge(1): + +

+ +
$ mkvmerge -o file.mkv --tags 0:tags.xml file.avi
+ + +

14.4. Tag file format

+ + +

+ mkvmerge(1) supports a XML based tag file format. The format is very + closely modeled after the Matroska + specification. Both the binary and the source distributions of + MKVToolNix come with a sample file called + example-tags-2.xml which simply lists all known tags + and which can be used as a basis for real life tag files. + +

+ + +

+ The basics are: + +

+ + +
    + +
  • +

    The outermost element must be <Tags>. +

    +
  • + +
  • + +

    One logical tag is contained inside one pair of + <Tag> XML tags. +

    + +
  • + +
  • +

    White spaces directly before and after tag contents are ignored.

    +
  • + +
+ + + +

14.5. Tipi di dati

+ + +

+ The new Matroska(tm) tagging system only knows two data types, a UTF-8 string + and a binary type. The first is used for the tag's name and the + <String> element while the binary type is used + for the <Binary> element. + +

+ + +

+ As binary data itself would not fit into a XML file mkvmerge(1) supports + two other methods of storing binary data. If the contents of a XML tag + starts with '@' then the following text is treated as a + file name. The corresponding file's content is copied into the Matroska(tm) + element. + +

+ + +

+ Otherwise the data is expected to be Base64 encoded. This is an encoding + that transforms binary data into a limited set of ASCII + characters and is used e.g. in email programs. mkvextract(1) will output + Base64 encoded data for binary elements. + +

+ + +

+ The deprecated tagging system knows some more data types which can be found + in the official Matroska(tm) tag specs. As mkvmerge(1) does not support this + system anymore these types aren't described here. + +

+ + + +

14.6. Known tags for the XML file format

+ + + +

+ The following lists the supported XML tags, their data types and, where + appropriate, the valid range for their values: + +

+ +
Tags (master)
+  Tag (master)
+    Targets (master)
+      TargetTypeValue (unsigned integer)
+      TargetType (UTF-8 string)
+      TrackUID (unsigned integer)
+      EditionUID (unsigned integer)
+      ChapterUID (unsigned integer)
+      AttachmentUID (unsigned integer)
+    Simple (master)
+      Simple (master)
+      Name (UTF-8 string)
+      TagLanguage (UTF-8 string)
+      DefaultLanguage (unsigned integer)
+      String (UTF-8 string)
+      Binary (binary)
+ +

15. Informazione segmento

+ + + +

+ With a segment info XML file it is possible to set certain values in the + "segment information" header field of a Matroska(tm) file. All of + these values cannot be set via other command line options. + +

+ + +

+ Other "segment information" header fields can be set via command + line options but not via the XML file. This includes e.g. the --title and the + --timestamp-scale + options. + +

+ + +

+ There are other elements that can be set neither via command line options + nor via the XML files. These include the following elements: + DateUTC (also known as the "muxing date"), + MuxingApp, WritingApp and + Duration. They're always set by mkvmerge(1) itself. + +

+ + +

+ The following lists the supported XML tags, their data types and, where + appropriate, the valid range for their values: + +

+ +
Info (master)
+  SegmentUID (binary, valid range: length in bytes == 16)
+  SegmentFilename (UTF-8 string)
+  PreviousSegmentUID (binary, valid range: length in bytes == 16)
+  PreviousSegmentFilename (UTF-8 string)
+  NextSegmentUID (binary, valid range: length in bytes == 16)
+  NextSegmentFilename (UTF-8 string)
+  SegmentFamily (binary, valid range: length in bytes == 16)
+  ChapterTranslate (master)
+    ChapterTranslateEditionUID (unsigned integer)
+    ChapterTranslateCodec (unsigned integer)
+    ChapterTranslateID (binary)
+

16. Matroska file layout

+ + +

+ The Matroska(tm) file layout is quite flexible. mkvmerge(1) will render a file + in a predefined way. The resulting file looks like this: + +

+ + +

+ [EBML head] [segment {meta seek #1} [segment information] [track + information] {attachments} {chapters} [cluster 1] {cluster 2} ... {cluster + n} {cues} {meta seek #2} {tags}] + +

+ + +

+ The elements in curly braces are optional and depend on the contents and + options used. A couple of notes: + +

+ + +
    + +
  • + +

    + meta seek #1 includes only a small number of level 1 elements, and only if + they actually exist: attachments, chapters, cues, tags, meta seek #2. Older + versions of mkvmerge(1) used to put the clusters into this meta seek element + as well. Therefore some imprecise guessing was necessary to reserve enough + space. It often failed. Now only the clusters are stored in meta seek #2, + and meta seek #1 refers to the meta seek element #2. + +

    + +
  • + + +
  • + +

    Attachment, chapter and tag elements are only present if they were added.

    + +
  • + +
+ + +

+ The shortest possible Matroska(tm) file would look like this: + +

+ + +

+ [EBML head] [segment [segment information] [track information] [cluster 1]] + +

+ + +

+ This might be the case for audio-only files. + +

+ +

17. External timestamp files

+ + +

+ mkvmerge(1) allows the user to chose the timestamps for a specific track + himself. This can be used in order to create files with variable frame rate + video or include gaps in audio. A frame in this case is the unit that + mkvmerge(1) creates separately per Matroska(tm) block. For video this is + exactly one frame, for audio this is one packet of the specific audio + type. E.g. for AC-3 this would be a packet containing + 1536 samples. + +

+ + +

+ Timestamp files that are used when tracks are appended to each other must + only be specified for the first part in a chain of tracks. For example if + you append two files, v1.avi and v2.avi, and want to use timestamps then + your command line must look something like this: + +

+ +
$ mkvmerge ... --timestamps 0:my_timestamps.txt v1.avi +v2.avi
+ +

+ There are four formats that are recognized by mkvmerge(1). The first line + always contains the version number. Empty lines, lines containing only + whitespace and lines beginning with '#' are ignored. + +

+ + +

17.1. Timestamp file format v1

+ + +

+ This format starts with the version line. The second line declares the + default number of frames per second. All following lines contain three + numbers separated by commas: the start frame (0 is the + first frame), the end frame and the number of frames in this range. The + FPS is a floating point number with the dot + '.' as the decimal point. The ranges can contain gaps for + which the default FPS is used. An example: + +

+ +
# timestamp format v1
+assume 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. Timestamp file format v2

+ + + +

+ In this format each line contains a timestamp for the corresponding frame. + This timestamp must be given in millisecond precision. It can be a floating + point number, but it doesn't have to be. You have to + give at least as many timestamp lines as there are frames in the track. The + timestamps in this file must be sorted. Example for 25fps: + +

+ +
# timestamp format v2
+0
+40
+80
+ + +

17.3. Timestamp file format v3

+ + +

+ In this format each line contains a duration in seconds followed by an + optional number of frames per second. Both can be floating point numbers. + If the number of frames per second is not present the default one is used. + For audio you should let the codec calculate the frame timestamps itself. + For that you should be using 0.0 as the number of + frames per second. You can also create gaps in the stream by using the + 'gap' keyword followed by the duration of the gap. + Example for an audio file: + +

+ +
# timestamp format v3
+assume 0.0
+25.325
+7.530,38.236
+gap, 10.050
+2.000,38.236
+ + +

17.4. Timestamp file format v4

+ + +

+ This format is identical to the v2 format. The only difference is that the + timestamps do not have to be sorted. This format should almost never be + used. + +

+ + +

18. Codici d'uscita

+ + + +

+ mkvmerge(1) esce con uno di tre codici di uscita: + +

+ + +
    + +
  • + +

    + 0 -- This exit code means that muxing has completed + successfully. + +

    + +
  • + + +
  • + +

    + 1 -- In this case mkvmerge(1) has output at least one + warning, but muxing did continue. A warning is prefixed with the text + 'Warning:'. Depending on the issues involved the + resulting file might be ok or not. The user is urged to check both the + warning and the resulting file. + +

    + +
  • + + +
  • + +

    + 2 -- This exit code is used after an error occurred. + mkvmerge(1) aborts right after outputting the error message. Error messages + range from wrong command line arguments over read/write errors to broken + files. + +

    + +
  • + +
+ +

19. Variabili d'ambiente

+ + + +

+ mkvmerge(1) uses the default variables that determine the system's locale + (e.g. LANG and the LC_* + family). Additional variables: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG and + its short form MTX_DEBUG + +

The content is treated as if it had been passed via the --debug option. +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE and + its short form MTX_ENGAGE + +

The content is treated as if it had been passed via the --engage + option. +

+ +
+ +

20. Vedi anche

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. WWW

+ + +

+ La versioen aggironata è sempre disponibile nel sito web MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..03ac3683e1565db620335798fb1528485e75b85b --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvpropedit.html @@ -0,0 +1,1309 @@ + + + + + mkvpropedit -- Modify properties of existing Matroska files without a complete remux + + + +
mkvpropedit -- Modify properties of existing Matroska(tm) files without a complete remux +
+
+ +
+

1. Sinossi

+ + +
mkvpropedit options {source-filename} {actions} +
+ +

2. Descrizione

+ + +

+ This program analyses an existing Matroska(tm) file and modifies some of its + properties. Then it writes those modifications to the existing file. Among + the properties that can be changed are the segment information elements + (e.g. the title) and the track headers (e.g. the language code, 'default + track' flag or the name). + +

+ + +

+ Opzioni: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ Lists all known and editable property names, their type (string, integer, + boolean etc) and a short description. The program exits + afterwards. Therefore the source-filename parameter + does not have to be supplied. + +

+ +
-p, --parse-mode + mode + +

+ Sets the parse mode. The parameter 'mode' can either + be 'fast' (which is also the default) or + 'full'. The 'fast' mode does not parse + the whole file but uses the meta seek elements for locating the required + elements of a source file. In 99% of all cases this is enough. But for files + that do not contain meta seek elements or which are damaged the user might + have to set the 'full' parse mode. A full scan of a file + can take a couple of minutes while a fast scan only takes seconds. + +

+ +
+ + +

+ Actions that deal with track and segment info properties: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit selector + +

+ Sets the Matroska(tm) file section (segment information or a certain track's + headers) that all following add, set and delete actions operate + on. This option can be used multiple times in order to make modifications to + more than one element. + +

+ + +

+ By default mkvpropedit(1) will edit the segment information section. + +

+ + +

+ See the section about edit + selectors for a full description of the syntax. + +

+ +
-a, --add + name=value + +

+ Adds a property name with the value + value. The property will be added even if such a + property exists already. Note that most properties are unique and cannot + occur more than once. + +

+ +
-s, --set + name=value + +

+ Sets all occurrences of the property name to the + value value. If no such property exists then it will + be added. + +

+ +
-d, --delete nome + +

+ Deletes all occurrences of the property name. Note + that some properties are required and cannot be deleted. + +

+ +
+ + +

+ Actions that deal with tags and chapters: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags + selector:filename + +

+ Add or replace tags in the file with the ones from + filename or remove them if + filename is empty. mkvpropedit(1) reads the same XML tag + format that mkvmerge(1) reads as well. + +

+ + +

+ The selector must be one of the words + all, global or + track. For all mkvpropedit(1) will + replace or remove all tags in a file. With global only + global tags will be replaced or removed. + +

+ + +

+ With track mkvpropedit(1) will replace tags for a + specific track. Additionally the tags read from + filename will be assigned to the same track. The track + is specified in the same way edit + selectors are specified (see below), e.g. --tags + track:a1:new-audio-tags.xml. + +

+ +
--add-track-statistics-tags + +

+ Calculates statistics for all tracks in a file and adds new statistics tags + for them. If the file already contains such tags then they'll be updated. + +

+ +
--delete-track-statistics-tags + +

+ Deletes all existing track statistics tags from a file. If the file doesn't + contain track statistics tags then it won't be modified. + +

+ +
-c, --chapters + nomefile + +

+ Add or replace chapters in the file with the ones from + filename or remove them if + filename is empty. mkvpropedit(1) reads the same XML and + simple chapter formats that mkvmerge(1) reads as well. + +

+ +
+ + +

+ Actions for handling attachments: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment nomefile + +

+ Adds a new attachment from filename. + +

+ + +

+ If the option --attachment-name has been used prior to this + option then its value is used as the new attachment's name. Otherwise it is + derived from filename. + +

+ + +

+ If the option --attachment-mime-type has been used prior to + this option then its value is used as the new attachment's MIME + type. Otherwise it is auto-detected from the content of + filename. + +

+ + +

+ If the option --attachment-description has been used prior + to this option then its value is used as the new attachment's + description. Otherwise no description will be set. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is used as the new attachment's UID. Otherwise a + random UID will be generated automatically. + +

+ +
--replace-attachment + selector:filename + +

+ Replaces one or more attachments that match selector + with the file filename. If more than one existing + attachment matches selector then all of their + contents will be replaced by the content of filename. + +

+ + +

+ The selector can have one of four forms. They're + explained below in the section attachment selectors. + +

+ + +

+ If the option --attachment-name has been used prior to this + option then its value is set as the new name for each modified + attachment. Otherwise the names aren't changed. + +

+ + +

+ If the option --attachment-mime-type has been used prior to + this option then its value is set as the new MIME type for each modified + attachment. Otherwise the MIME types aren't changed. + +

+ + +

+ If the option --attachment-description has been used prior + to this option then its value is set as the new description for each + modified attachment. Otherwise the descriptions aren't changed. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is set as the new UID for each modified + attachment. Otherwise the UIDs aren't changed. + +

+ +
--update-attachment selector + +

+ Sets the properties of one or more attachments that match + selector. If more than one existing attachment + matches selector then all of their properties will be + updated. + +

+ + +

+ The selector can have one of four forms. They're + explained below in the section attachment selectors. + +

+ + +

+ If the option --attachment-name has been used prior to this + option then its value is set as the new name for each modified + attachment. Otherwise the names aren't changed. + +

+ + +

+ If the option --attachment-mime-type has been used prior to + this option then its value is set as the new MIME type for each modified + attachment. Otherwise the MIME types aren't changed. + +

+ + +

+ If the option --attachment-description has been used prior + to this option then its value is set as the new description for each + modified attachment. Otherwise the descriptions aren't changed. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is set as the new UID for each modified + attachment. Otherwise the UIDs aren't changed. + +

+ +
--delete-attachment selector + +

+ Deletes one or more attachments that match selector. + +

+ + +

+ The selector can have one of four forms. They're + explained below in the section attachment selectors. + +

+ +
+ + +

+ Options for attachment actions: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name name + +

+ Sets the name to use for the following --add-attachment or + --replace-attachment operation. + +

+ +
--attachment-mime-type mime-type + +

+ Sets the MIME type to use for the following + --add-attachment or --replace-attachment + operation. + +

+ +
--attachment-description description + +

+ Sets the description to use for the following + --add-attachment or --replace-attachment + operation. + +

+ +
--enable-legacy-font-mime-types + +

+ Enables the use of legacy MIME types for certain types of + font attachments. For example, + 'application/x-truetype-font' will be used for TrueType + fonts instead of 'fonts/ttf'. + +

+ + +

+ This affects both adding new attachments and replacing existing attachments, + but only if the new MIME type isn't specified. Other + existing attachments aren't changed. + +

+ + +

+ The affected MIME types are 'font/sfnt', + 'font/ttf' and 'font/collection' which + are all mapped to 'application/x-truetype-fonts' and + 'font/otf' which is mapped to + 'application/vnd.ms-opentype'. + +

+ +
+ + +

+ Altre opzioni: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ Normally when the user requests changes to the 'language' + track header property, mkvpropedit(1) will apply the same change to the new + LanguageIETF track header element in addition to the + legacy Language element. If this option is used, the + change is only applied to the legacy Language + element. + +

+ + +

+ This option does not affect changes requested via the + 'language-ietf' track header property. + +

+ +
--normalize-language-ietf mode + +

+ Enables normalizing all IETF BCP 47 language tags to either their canonical + form with mode 'canonical', to their extended language + subtags form with mode 'extlang' or turns it off with + mode 'off'. By default normalization to the canonical + form is applied. + +

+ + +

+ In the canonical form all subtags for which preferred values exist are + replaced by those preferred values. This converts + e.g. 'zh-yue-jyutping' to + 'yue-jyutping' or 'fr-FX' to + 'fr-FR'. + +

+ + +

+ For the extended language subtags form the canonical form is built + first. Afterwards all primary languages for which an extended language + subtag exists are replaced by that extended language subtag and its + prefix. This converts e.g. 'yue-jyutping' back to + 'zh-yue-jyutping' but has no effect on + 'fr-FR' as 'fr' is not an extended + language subtag. + +

+ + +

+ This normalization is only applied to elements that are actually changed: + +

+ + +
    + +
  • + +

    + When editing track headers only those track language elements that are set + via edit specifications are affected. Languages of tracks that aren't edited + aren't changed. Editing a track but setting only properties other than the + language won't affect the language either. + +

    + +
  • + + +
  • + +

    + When editing chapters all language elements of all chapter elements are + affected as existing chapters are always fully replaced. + +

    + +
  • + + +
  • + +

    + When editing tags only the language elements of the tags that are actually + replaced are affected. For example, when you replace global tags then + existing track tags aren't affected. + +

    + +
  • + +
+ + +

+ The best way to normalize all existing language tags in a file is to remux + it with mkvmerge(1) and set its + '--normalize-language-ietf' option to the desired mode. + +

+ +
--command-line-charset character-set + +

+ Imposta il set caratteri per convertire le stringhe date dalla riga di + comando. Di base è impostato dalla lingua di sistema. + +

+ +
--output-charset character-set + +

+ Imposta il set caratteri per le stringhe convertite date in output. Di base + è impostato dalla lingua di sistema. + +

+ +
-r, --redirect-output + file-name + +

+ Writes all messages to the file file-name instead of + to the console. While this can be done easily with output redirection there + are cases in which this option is needed: when the terminal reinterprets the + output before writing it to a file. The character set set with --output-charset + is honored. + +

+ +
--ui-language code + +

+ Forza le traduzioni per la lingua code da usare (per + esempio: 'it_IT' per le traduzioni in + Italiano). Immettendo 'list' come + code mostrerà la lista delle traduzioni disponibili. + +

+ +
--abort-on-warnings + +

+ Indica al programma di interrompere dopo il primo avviso. + Il codice di uscita del programma sarà 1. + +

+ +
--debug argomento + +

+ Abilita il debug per una funzionalità. Questa opzione è utile per gli + sviluppatori. + +

+ +
--engage funzionalità + +

+ Turn on experimental features. A list of available features can be requested + with mkvpropedit --engage list. These features are not + meant to be used in normal situations. + +

+ +
--gui-mode + +

+ Mostra la GUI (interfaccia grafica). In questa modalità a terminale ci + saranno delle righe specifiche su cosa sta succedendo. Questi messaggi + seguiranno il formato '#GUI#messaggio'. Il messaggio può + essere seguito da delle coppie chiave/valore come + '#GUI#messaggio#chiave1=valore1#chiave2=valore2…'. Né i + messaggi e né le chiavi saranno mai tradotte e l'output sarà sempre in + Inglese. + +

+ +
-v, --verbose + +

+ Sii prolisso e mostra tutti gli elementi Matroska(tm) importanti quando + vengono letti. + +

+ +
-h, --help + +

+ Mostra l'aiuto ed esci. + +

+ +
-V, --version + +

+ Mostra la versione ed esci. + +

+ +
@options-file.json + +

+ Legge gli argomenti a riga di comando dal file + options-file. Per una spiegazione completa sul + formato supportato vedere la sezione "File di Opzioni" nel manuale di + mkvmerge(1). + +

+ +
+ +

3. Edit selectors

+ + +

+ The --edit option + sets the Matroska(tm) file section (segment information or a certain track's + headers) that all following add, set and delete actions operate + on. This stays valid until the next --edit option + is found. The argument to this option is called the edit selector. + +

+ + +

+ By default mkvpropedit(1) will edit the segment information section. + +

+ + +

3.1. Informazione segmento

+ + +

+ The segment information can be selected with one of these three words: + 'info', 'segment_info' or + 'segmentinfo'. It contains properties like the segment + title or the segment UID. + +

+ + + +

3.2. Intestazione tracce

+ + +

+ Track headers can be selected with a slightly more complex selector. All + variations start with 'track:'. The track header + properties include elements like the language code, 'default track' flag or + the track's name. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ If the parameter n is a number then the + nth track will be selected. The track order is the + same that mkvmerge(1)'s --identify option outputs. + +

+ + +

+ Numbering starts at 1. + +

+ +
track:tn + +

+ If the parameter starts with a single character t + followed by a n then the nth + track of a specific track type will be selected. The track type parameter + t must be one of these four characters: + 'a' for an audio track, 'b' for a + button track, 's' for a subtitle track and + 'v' for a video track. The track order is the same that + mkvmerge(1)'s --identify option outputs. + +

+ + +

+ Numbering starts at 1. + +

+ +
track:=uid + +

+ If the parameter starts with a '=' followed by a number + uid, the track whose track UID + element equals the given uid will be selected. Track + UIDs can be obtained with mkvinfo(1). + +

+ +
track:@number + +

+ If the parameter starts with a '@' followed by a number + number, the track whose track number element equals + this number will be selected. Track numbers can be + obtained with mkvinfo(1). + +

+ +
+ + + +

3.3. Note

+ + +

+ Due to the nature of the track edit selectors it is possible that several + selectors actually match the same track headers. In such cases all actions + for those edit selectors will be combined and executed in the order in which + they're given on the command line. + +

+ + +

4. Selettori allegato

+ + + +

+ An attachment selector is used with the two actions --replace-attachment + and --delete-attachment. + It can have one of the following four forms: + +

+ + +
    + +
  1. + +

    + Selection by attachment ID. In this form the selector is simply a number, + the attachment's ID as output by mkvmerge(1)'s identification command. + +

    + +
  2. + + +
  3. + +

    + Selection by attachment UID (unique ID). In this form the selector is the + equal sign = followed by a number, the attachment's + unique ID as output by mkvmerge(1)'s verbose identification command. + +

    + +
  4. + + +
  5. + +

    + Selection by attachment name. In this form the selector is the literal word + name: followed by the existing attachment's name. If this + selector is used with --replace-attachment then colons + within the name to match must be escaped as \c. + +

    + +
  6. + + +
  7. + +

    + Selection by MIME type. In this form the selector is the literal word + mime-type: followed by the existing attachment's MIME + type. If this selector is used with --replace-attachment + then colons within the MIME type to match must be escaped as + \c. + +

    + +
  8. + +
+ +

5. Language handling

+ + + +

+ mkvpropedit(1) mostly tries to do the right thing by default. Therefore + changes to the language property will cause mkvpropedit(1) + to apply the same change to both the new "LanguageIETF" element as well as + the old "Language" element similar to how mkvmerge(1) applies the language to + both elements. For example, when using mkvpropedit movie.mkv --edit + track:2 --set language=zh-TW the "LanguageIETF" element will be + set to zh-TW and the old "Language" element to + chi. + +

+ + +

+ Additionally there's a new track header property named + language-ietf that can be set or removed. Changes to this + property only apply to the new "LanguageIETF" track header element. A caveat + is that the old "Language" track header element is a mandatory element in + Matroska — meaning even if it isn't present in the file it still has an + implied value. When the user only sets the language-ietf + property but not the language property, mkvpropedit(1) will + therefore add the old "Language" element in certain cases & set it to + und (meaning "undetermined") as the user didn't specify a + value for it. + +

+ + +

When reading XML chapter or tag files mkvpropedit(1) works like mkvmerge(1) + does. +

+ + +

The creation of the new elements can be disabled completely with the + command-line option `--disable-language-ietf` which operates on all three + new elements. +

+ + +

You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. +

+ +

6. Esempi

+ + +

+ The following example edits a file called 'movie.mkv'. It + sets the segment title and modifies the language code of an audio and a + subtitle track. Note that this example can be shortened by leaving out the + first --edit option + because editing the segment information element is the default for all + options found before the first --edit option + anyway. + +

+ +
$ mkvpropedit movie.mkv --edit info --set "title=The movie" --edit track:a1 --set language=fre --edit track:a2 --set language=ita
+ +

+ The second example removes the 'default track flag' from the first subtitle + track and sets it for the second one. Note that mkvpropedit(1), unlike + mkvmerge(1), does not set the 'default track flag' of other tracks to '0' if + it is set to '1' for a different track automatically. + +

+ +
$ mkvpropedit movie.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ Replacing the tags for the second subtitle track in a file looks like this: + +

+ +
$ mkvpropedit movie.mkv --tags track:s2:new-subtitle-tags.xml
+ +

+ Removing all tags requires leaving out the file name: + +

+ +
$ mkvpropedit movie.mkv --tags all:
+ +

+ Replacing the chapters in a file looks like this: + +

+ +
$ mkvpropedit movie.mkv --chapters new-chapters.xml
+ +

+ Removing all chapters requires leaving out the file name: + +

+ +
$ mkvpropedit movie.mkv --chapters ''
+ +

+ Adding a font file (Arial.ttf) as an attachment: + +

+ +
$ mkvpropedit movie.mkv --add-attachment Arial.ttf
+ +

+ Adding a font file (89719823.ttf) as an attachment and + providing some information as it really is just Arial: + +

+ +
$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'The Arial font as a TrueType font' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ Replacing one attached font (Comic.ttf) file with another + one (Arial.ttf): + +

+ +
$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'The Arial font as a TrueType font' --replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ Deleting the second attached file, whatever it may be: + +

+ +
$ mkvpropedit movie.mkv --delete-attachment 2
+ +

+ Deleting all attached fonts by MIME type: + +

+ +
$ mkvpropedit movie.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. Codici d'uscita

+ + + +

+ mkvpropedit(1) esce con uno di tre codici di uscita: + +

+ + +
    + +
  • + +

    + 0 -- This exit code means that the modification has + completed successfully. + +

    + +
  • + + +
  • + +

    + 1 -- In this case mkvpropedit(1) has output at least one + warning, but the modification did continue. A warning is prefixed with the + text 'Warning:'. Depending on the issues involved the + resulting files might be ok or not. The user is urged to check both the + warning and the resulting files. + +

    + +
  • + + +
  • + +

    + 2 -- This exit code is used after an error occurred. + mkvpropedit(1) aborts right after outputting the error message. Error + messages range from wrong command line arguments over read/write errors to + broken files. + +

    + +
  • + +
+ +

8. File di testo e conversioni della codifica caratteri

+ + + +

+ Per una comprensione a fondo di come tutti gli strumenti presenti nella + suite di MKVToolNix gestiscono la conversione della codifica caratteri, + codifica input/output, codifica a riga di comando e console, vedere la + sezione con lo stesso nome nel manuale di mkvmerge(1). + +

+ +

9. Variabili d'ambiente

+ + + +

+ mkvpropedit(1) uses the default variables that determine the system's locale + (e.g. LANG and the LC_* + family). Additional variables: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG + and its short form MTX_DEBUG + +

The content is treated as if it had been passed via the --debug + option. +

+ +
MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE + and its short form MTX_ENGAGE + +

The content is treated as if it had been passed via the --engage + option. +

+ +
+ +

10. Vedi anche

+ + +

+ mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1) + +

+ +

11. WWW

+ + +

+ La versioen aggironata è sempre disponibile nel sito web MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..a7431901633ff4c059b444e9e20a610e2b8efaac --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/it/mkvtoolnix-gui.html @@ -0,0 +1,160 @@ + + + + + mkvtoolnix-gui -- a GUI for mkvmerge1 including a chapter and a header editor + + + +
mkvtoolnix-gui -- a GUI for mkvmerge(1) including a chapter and a header editor +
+
+
+

Table of contents

+ +
+
+

1. Sinossi

+ + +
mkvtoolnix-gui [[configuration-file-name.mtxcfg] | [source-file.ext] | [matroska-file.mkv] | [chapter-file.ext] | [matroska-file.mkv]] +
+ +

2. Descrizione

+ + +

+ mkvtoolnix-gui(1) is a Qt(tm) based + GUI for mkvmerge(1). It also implements mkvinfo(1)'s and + mkvpropedit(1)'s functionality and will evolve to cover mkvextract(1) as + well. All settings (e.g. source files, track options etc) can be saved and + restored. + +

+ + +

+ Listing configuration file names with the extension + .mtxcfg causes the GUI to load the those configuration + files in the appropriate tool. Any other file name is added as a source file + for multiplexing, opened in the info tool, the chapter editor or in the + header editor depending on the current mode. The current mode can be changed + with --merge, --info, + --edit-chapters or --edit-headers. The + default mode is adding files for multiplexing. + +

+ + +

+ Note that if an instance of the application is already running when the + application is started a second time, all file names given on the command + line are handled by the already-running instance. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

All following file names will be added as source files to the current + multiplex job. This is the default mode. +

+ +
--info + +

Tutti i nomi file seguenti verranno aperti nello strumento info.

+ +

Additionally the info tool will be selected on startup instead of the + multiplexer tool. +

+ +
--edit-chapters + +

Tutti i nomi file seguenti verranno aperti nell'editor capitolo.

+ +

Additionally the chapter editor will be selected on startup instead of the + multiplexer tool. +

+ +
--edit-headers + +

Tutti i nomi file seguenti verranno aperti nell'editor intestazione.

+ +

Additionally the header editor will be selected on startup instead of the + multiplexer tool. +

+ +
-h, --help + +

+ Mostra l'aiuto ed esci. + +

+ +
-V, --version + +

+ Mostra la versione ed esci. + +

+ +
+ +

3. Vedi anche

+ + +

+ mkvmerge(1), mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. WWW

+ + +

+ La versioen aggironata è sempre disponibile nel sito web MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..739c6ff7e99c102d48cd1f1fc52403954467107e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvextract.html @@ -0,0 +1,1174 @@ + + + + + mkvextract -- Matroskaファイルから、他の形式のファイルを抽出する + + + +
mkvextract -- Matroska(tm)ファイルから、他の形式のファイルを抽出する +
+
+ +
+

1. 書式

+ + +
mkvextract {原ファイル名} {モード1} オプション... 抽出仕様1 モード2 オプション... 抽出仕様2 ... +
+ +

2. 説明

+ + +

+ このプログラムはMatroska(tm)ファイルから特定部分を抽出して他の利便な形式に書き出します。第1引数は抽出する対象のファイル名であり、Matroska(tm)ファイルでなくてはなりません。 + +

+ + +

+ 残りの全引数はそれぞれ、特定の抽出モードに切り替えるか、現行で有効なモードのオプションを変更するか、または抽出する内容と書き出し先のファイルを指定します。mkvextractの同一呼出し内で複数のモードが利用でき、一度の実行で複数種類の内容を抽出できます。ほとんどのオプションは特定のモードでしか利用できませんが、いくつかのオプションは全てのモードに適用できます。 + +

+ + +

+ 現在次の抽出に対応しています。トラック標識附属品楽章CUE用紙時刻印および演奏指令。 + +

+ + +

2.1. 共通オプション

+ + + +

+ 以下のオプションは全てのモードで利用可能であり、この節で一度だけ説明します。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ 分析モードを「full」に設定します。原ファイルから要求された要素の位置を捜すのに、既定モードでは、ファイル全体を解析せずに高次送り出し要素を用います。99%の場合はこれで十分です。しかし、高次送り出し要素がないファイルや破損しているファイルに対しては、このモードを使う必要があるかもしれません。既定の高速走査には数秒しかからない一方で、この全体走査には数分かかることもあります。 + +

+ +
--command-line-charset 文字集合 + +

+ 命令行から与えた文字列を変換するのに用いる文字集合を設定します。既定では機構の現行地域特性で指定している文字集合になります。 + +

+ +
--output-charset 文字集合 + +

+ 出力される文字列を変換するのに用いる文字集合を設定します。既定では機構の現行地域特性で指定している文字集合になります。 + +

+ +
-r, + --redirect-outputファイル名 + +

+ 全ての通報を操作卓にではなくファイル名のファイルに書き出します。出力を転送することで同じことが簡単にできるものの、このオプションが必要な場合は存在します:ファイルに転送する前に端末が出力を再解釈してしまう場合です。--output-charsetで設定した文字集合を優先します。 + +

+ +
--flush-on-close + +

+ 書き込み用に開いたファイルを閉じる際に、プログラムが主記憶上に貯まった全データを補助記憶に排出 (flush) + するようにします。停電時のデータ損失を防いだり、運用機構や機器特有の問題を避ける目的で使えるでしょう。欠点として、mkvmergeが終了前に全データを補助記憶に書き込み終わるまで待機するせいで多重化に長い時間を要します。MKVToolNixの不具合追跡局の議題2469号および2480号に、この挙動の長短について詳細な議論があります。 + +

+ +
--ui-language 符号 + +

+ 用いる翻訳を指定した言語符号のものに強制します(例えば「de_DE」ならドイツ語翻訳です)。符号に「list」を指定すると利用可能な翻訳の一覧を出力します。 + +

+ +
--abort-on-warnings + +

+ 警告が発された後、プログラムが停止するようにします。プログラムの終了番号は1になります。 + +

+ +
--debug 機能 + +

+ 指定した機能の診断出力を有効にします。このオプションは開発者にとってのみ有用です。 + +

+ +
--engage 機能 + +

+ 実験的機能を有効にします。mkvextract --engage + listとすると利用可能な機能の一覧が得られます。これらの機能は通常状況での使用を意図されていません。 + +

+ +
--gui-mode + +

+ GUIモードに切り替えます。このモードではGUI操作の状況を伝える特殊な形式の行が出力されます。これらの通報は + '#GUI#通報内容' + という形式の後に続きます。'#GUI#通報内容#予約語1=値1#予約語2=値2...' + というように予約語・値の組が通報内容に続くことがあります。通知内容や予約語は翻訳されることなく常に英語で出力されます。 + +

+ +
-v, --verbose + +

+ 出力が冗長になり、Matroska(tm)の重要要素全てを、読み込まれるつど表示します。 + +

+ +
-h, --help + +

+ 使用法情報を出力して終了します。 + +

+ +
-V, --version + +

+ 版次情報を出力して終了します。 + +

+ +
@オプションファイル.json + +

+ オプションファイルから追加の命令行引数を読み込みます。こうしたファイルの対応形式についての詳細は、mkvmerge(1)便覧中の「オプションファイル」という節をご覧ください。 + +

+ +
+ + + +

2.2. トラック抽出モード

+ + + +

+ 構文: mkvextract 対象ファイル名 + tracks [オプション] + TID1:宛先ファイル名1 + [TID2:宛先ファイル名2 ...] + +

+ + +

+ 以下の命令行オプションは 'tracks' + 抽出モードにおける各トラックごとに利用可能です。これらのオプションは適用先のトラック指定(後述)の前に存在する必要があります。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c 文字集合 + +

+ 次の文字字幕トラックに変換する際の文字集合を設定します。次のトラック識別子の対象が文字字幕トラックである場合にのみ有効です。既定ではUTF-8になります。 + +

+ +
--blockadd 水準 + +

+ 指定した水準までのBlockAdditionのみを保持します。既定では全ての水準を保持します。このオプションの効果があるのはWAVPACK4といった特定の符号器のみです。 + +

+ +
--cuesheet + +

+ mkvextract(1)は直後のトラックの楽章情報と標識データからCUE用紙を抽出し、トラックの出力名に + '.cue' を付けた名前のファイルに書き出します。 + +

+ +
--raw + +

+ 生データを、コンテナ情報を全く含まずにファイルに出力します。--fullrawの指定下とは違い、この指定下ではCodecPrivate要素の内容をファイルに書き出すことはありません。このモードは、mkvextract(1)が対応していないものであっても全てのCodecIDsで動作しますが、結果のファイルが利用できるものとは限りません。 + +

+ +
--fullraw + +

+ 生データを、コンテナ情報を全く含まずにファイルに出力します。トラックがCodecPrivate頭部要素を含む場合、始めにその要素の内容をファイルに書き出します。このモードは、mkvextract(1)が対応していないものであっても全てのCodecIDsで動作しますが、結果のファイルが利用できるものとは限りません。 + +

+ +
TID:出力名 + +

+ 識別子がTIDのトラックが原ファイルに存在する場合、そのトラックを出力名ファイルに抽出するようにします。このオプションは複数回指定できます。トラック識別子はmkvmerge(1)--identifyオプションの出力結果と同じものです。 + +

+ + +

+ 各出力ファイル名は一度しか使用されません。RealAudio及びRealVideoトラックは例外です。異なるトラックに同じファイル名が指定された場合は、同一のファイルに保存されます。例: + +

+ +
$ mkvextract input.mkv tracks 0:video.h264 2:output-two-vobsub-tracks.idx 3:output-two-vobsub-tracks.idx
+
+ + + +

2.3. 添付ファイル抽出モード

+ + + +

+ 構文: mkvextract 原ファイル名 附属品 + [オプション] + AID1:出力名1 [AID2:出力名2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:出力名 + +

+ 識別子がTIDの添付ファイルが原ファイルに存在する場合、その添付ファイルを出力名ファイルに抽出するようにします。出力名が空の場合は、代わりに原Matroska(tm)ファイル内部の添付ファイルの名前を用います。このオプションは複数回指定できます。添付ファイル識別子はmkvmerge(1)--identifyオプションの出力結果と同じものです。 + +

+ +
+ + + +

2.4. 楽章抽出モード

+ + + +

+ 構文: mkvextract 原ファイル名 楽章 + [オプション] + 出力ファイル名.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ 楽章情報を、OGM操作機で用いられる単純形式(CHAPTER01=..., + CHAPTER01NAME=...)で輸出します。このモードでは一部の情報は破棄されます。既定では楽章をXML形式で出力します。 + +

+ +
--simple-language 言語 + +

+ 単純形式が有効の場合、mkvextract(1)はたとえ楽章素片が複数の楽章名を含んでいる場合でも、検出した楽章素片毎に一項目のみを出力します。既定では、言語に関係なく各素片で見付けた最初の楽章名を用います。 + +

+ + +

+ このオプションを用いることで、素片が複数の楽章名を含んでいた場合にどの楽章を出力するか定めることができます。言語属性はJIS + X 0412-1またはJIS X 0412-2に存在していなくてはなりません。 + +

+ +
+ + +

+ 楽章は指定した出力ファイルに書き込まれます。既定ではmkvmerge(1)が理解できるXML形式が用いられます。ファイル中に楽章が見付からなかった場合、出力ファイルを生成しません。 + +

+ + + +

2.5. 標識抽出モード

+ + + +

+ 構文: mkvextract 原ファイル名 標識 + [オプション] + 出力ファイル名.xml + +

+ + +

+ 標識は指定した出力ファイルに、mkvmerge(1)が理解できるXML形式で書き込まれます。ファイル中に標識が見付からなかった場合、出力ファイルを生成しません。 + +

+ + + +

2.6. 演奏指令用紙抽出モード

+ + + +

+ 構文: mkvextract 原ファイル名 + 演奏指令用紙 [オプション] + 出力ファイル名.cue + +

+ + +

+ 演奏指令用紙を指定した出力ファイルに書き込みます。ファイル中に楽章や標識が見付からなかった場合、出力ファイルを生成しません。 + +

+ + + +

2.7. 時刻印抽出モード

+ + + +

+ 構文: mkvextract 原ファイル名 時刻印v2 + [オプション] + TID1:宛先ファイル名1 + [TID2:宛先ファイル名2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:出力名 + +

+ 識別子がTIDのトラック時刻印が原ファイルに存在する場合、そのトラックを出力名ファイルに抽出するようにします。このオプションは複数回指定できます。トラック識別子はmkvmerge(1)--identifyオプションの出力結果と同じものです。 + +

+ + +

+ 例: + +

+ +
$ mkvextract input.mkv timestamps_v2 1:ts-track1.txt 2:ts-track2.txt
+
+ + + +

2.8. 演奏指令抽出モード

+ + + +

+ 構文: mkvextract 原ファイル名 演奏指令 + [オプション] + TID1:宛先ファイル名1 + [TID2:宛先ファイル名2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:宛先ファイル名 + +

+ 識別子がTIDのトラックの演奏指令が原ファイルに存在する場合、そのトラックを出力名ファイルに抽出するようにします。このオプションは複数回指定できます。トラック識別子はmkvmerge(1)--identifyオプションの出力結果と同じものであり、TID要素に含まれる数字ではありません。 + +

+ +
+ + +

+ 出力形式は単純な文章形式です: + 一行はCuePoint要素とkey=valueの組ごとに成ります。任意要素(例: + CueDuration)がCuePointに表われなかった場合、値として連字符を出力します。 + +

+ + +

+ 例: + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

指定できる予約語は次の通りです。

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
時刻印 + +

演奏指令点のナノ秒単位の時刻印。形式はHH:MM:SS.nnnnnnnnn。この要素は常に設定されています。 +

+ +
演奏時間 + +

演奏指令点のナノ秒単位の演奏時間。形式はHH:MM:SS.nnnnnnnnn。 +

+ +
群団位置 + +

被参照要素を含んだ群団が始まるMatroska(tm)ファイル内部の絶対バイト位置。 +

+ + +
+

Note:

+ +

Matroska(tm)ファイルの内部では、CueClusterPositionは余白開始位置の区分情報に相当します。mkvextract(1)の演奏指令抽出モードで出力する値は、しかしながら、その余白を既に加味しており、ファイル冒頭からの絶対バイト位置を表わします。 +

+ +
+ +
相対位置 + +

BlockGroupまたはSimpleBlock要素が開始するのに参照する指令位置である、群団内部の相対バイト位置。 +

+ + +
+

Note:

+ +

Matroska(tm)ファイルの内部では、CueClusterPositionは群団のデータ開始位置に依存します。mkvextract(1)の演奏指令抽出モードで出力する値は、しかしながら、群団識別子に依存します。ファイル内部の絶対位置は、群団位置相対位置を足し合わせて計算できます。 +

+ +
+ +
+ + +

+ 例: + +

+ +
$ mkvextract input.mkv cues 1:cues-track1.txt 2:cues-track2.txt
+ +

3. 例

+ + + +

+ 楽章および標識を各々のXML形式で同時に抽出する: + +

+ +
$ mkvextract movie.mkv chapters movie-chapters.xml tags movie-tags.xml
+ +

+ 複数のトラックと各々の時刻印を同時に抽出する: + +

+ +
$ mkvextract "Another Movie.mkv" tracks 0:video.h265 "1:main audio.aac" "2:director's comments.aac" timestamps_v2 "0:timestamps video.txt" "1:timestamps main audio.txt" "2:timestamps director's comments.txt"
+ +

+ 楽章をOgg/OGM形式で抽出し、文章字幕トラックを別の文字集合に再符号化します: + +

+ +
$ mkvextract "My Movie.mkv" chapters --simple "My Chapters.txt" tracks -c MS-ANSI "2:My Subtitles.srt"
+

4. 文章ファイルと文字集合変換

+ + + +

+ MKVToolNix一式の全ての操作機が文字集合変換、入出力、命令行、操作卓上の文字集合をどのように処理するかについての詳細な議論については、mkvmerge(1)の便覧にある同名の節をご覧ください。 + +

+ +

5. 出力ファイル形式

+ + + +

+ 出力ファイルの形式の決定はトラック種類に基いており、出力ファイル名の拡張子には基づいていません。現在対応しているトラック種別は次の通りです: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ 全てのAACファイルは、ADTS頭部を各パケットの前に追加されたうえでAACファイルに書き出されます。ADTS頭部には、非推奨の強調欄は含まれません。 + +

+ +
A_AC3, A_EAC3 + +

+ これらは生AC-3ファイルに抽出されます。 + +

+ +
A_ALAC + +

+ ALACトラックはCAFファイルに書き込まれます。 + +

+ +
A_DTS + +

+ これらは生DTSファイルに抽出されます。 + +

+ +
A_FLAC + +

+ FLACトラックはFLACファイルに書き込まれます。 + +

+ +
A_MPEG/L2 + +

+ MPEG-1音声層II流は生MP2ファイルに抽出されます。 + +

+ +
A_MPEG/L3 + +

+ これらは生MP3ファイルに抽出されます。 + +

+ +
A_OPUS + +

+ Opus(tm)トラックはOggOpus(tm)ファイルに書き込まれます。 + +

+ +
A_PCM/INT/LIT、A_PCM/INT/BIG + +

+ 生PCM情報はWAVファイルに書き込まれます。バイト昇順の情報は処理の過程でバイト降順に変換されます。 + +

+ +
A_REAL/* + +

+ RealAudio(tm)トラックはRealMedia(tm)ファイルに書き出されます。 + +

+ +
A_TRUEHD、A_MLP + +

+ これらは生TrueHD/MLPファイルに抽出されます。 + +

+ +
A_TTA1 + +

+ TrueAudio(tm)トラックはTTAファイルに書き出されます。注意: + Matroska(tm)の時刻印精度の上限のために、抽出されたファイル頭部の二欄、data_length(ファイルに含まれる総標本数)とCRCは元と異なったものになります。 + +

+ +
A_VORBIS + +

+ Vorbis音声はOggVorbis(tm)ファイルに書き出されます。 + +

+ +
A_WAVPACK4 + +

+ WavPack(tm)トラックはWVファイルに書き出されます。 + +

+ +
S_HDMV/PGS + +

+ PGS字幕はSUPファイルとして書き出されます。 + +

+ +
S_HDMV/TEXTST + +

+ TextST字幕はmkvmerge(1)およびmkvextract(1)の為に考案された特別なファイル形式として書き出されます。 + +

+ +
S_KATE + +

+ Kate(tm)流れはOgg(tm)コンテナに格納されます。 + +

+ +
S_TEXT/SSA、S_TEXT/ASS、S_SSA、S_ASS + +

+ SSAおよびASS文章字幕は、それぞれSSAASSファイルとして書き出されます。 + +

+ +
S_TEXT/UTF8、S_TEXT/ASCII + +

+ 単純文章字幕はSRTファイルに書き出されます。 + +

+ +
S_VOBSUB + +

+ VobSub(tm)字幕は対応する索引ファイルIDXに加えてSUBファイルとして書き出されます + +

+ +
S_TEXT/USF + +

+ USF文章字幕はUSFファイルとして書き出されます。 + +

+ +
S_TEXT/WEBVTT + +

+ WebVTT文章字幕はWebVTTファイルとして書き出されます。 + +

+ +
V_MPEG1、V_MPEG2 + +

+ MPEG-1およびMPEG-2映像トラックはMPEG初等流として書き出されます。 + +

+ +
V_MPEG4/ISO/AVC + +

+ H.264AVC映像トラックはH.264初等流に書き出されます。これは例えばGPAC(tm)梱包に収録のMP4Box(tm)で更に処理できます。 + +

+ +
V_MPEG4/ISO/HEVC + +

+ H.265HEVC映像トラックはH.265初等流に書き出されます。これは例えばGPAC(tm)梱包に収録のMP4Box(tm)で更に処理できます。 + +

+ +
V_MS/VFW/FOURCC + +

+ このCodecIDの固定FPS映像トラックはAVIファイルに書き出されます。 + +

+ +
V_REAL/* + +

+ RealVideo(tm)トラックはRealMedia(tm)ファイルに書き出されます。 + +

+ +
V_THEORA + +

+ Theora(tm)流はOgg(tm)コンテナ内に書き出されます。 + +

+ +
V_VP8、V_VP9 + +

+ VP8VP9トラックはIVFファイルに書き出されます。 + +

+ +
標識 + +

+ 標識はXML形式に変換されます。mkvmerge(1)が標識を読み込むのに対応しているものと同じ形式です。 + +

+ +
添付ファイル + +

+ 添付ファイルはそのままの形式で出力ファイルに書き出されます。変換等の処理は全く行われません。 + +

+ +
楽章 + +

+ 楽章はXML形式に変換されます。mkvmerge(1)が楽章を読み込むのに対応しているものと同じ形式です。替わりに、単純OGM様式の形式で簡易化して出力することもできます。 + +

+ +
時刻印 + +

+ 時刻印はまず整列され、mkvmerge(1)が読み込めるように時刻印v2形式準拠ファイルとして書き出されます。その他の形式(v1、v3およびv4)の抽出には対応していません。 + +

+ +
+ +

6. 終了番号

+ + + +

+ mkvextract(1)が返す終了番号には3種類あります: + +

+ + +
    + +
  • + +

    + 0 -- この終了番号は抽出が完了したことを意味します。 + +

    + +
  • + + +
  • + +

    + 1 -- この返り値は、一つ以上の警告が出力されたが抽出が続行されたことを意味します。警告は + 'Warning:' + という文字列を先頭にして出力されます。結果ファイルが無事かどうかは状況によります。出力ファイルを確認することを強く推奨します。 + +

    + +
  • + + +
  • + +

    + 2 -- + この返り値は、誤りが発生し、誤り通報を出力した直後にmkvextract(1)が終了したことを示します。誤り通報の原因は命令行の間違いやファイル読み/書き誤り、壊れたファイルなど多岐に渡ります。 + +

    + +
  • + +
+ +

7. 環境変数

+ + + +

+ mkvpropedit(1)は機構の地域特性を決める既定変数(例:LANGLC_*系列)を使用します。追加の変数: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUGMKVTOOLNIX_DEBUGとその省略形MTX_DEBUG + +

その内容を、あたかも--debugオプション経由で渡されたかのように扱います。 +

+ +
MKVEXTRACT_ENGAGE, + MKVTOOLNIX_ENGAGEとその短縮形MTX_ENGAGE + +

その内容を、あたかも--engageオプション経由で渡されたかのように扱います。 +

+ +
+ +

8. 関連項目

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. ウェブ

+ + +

+ 最新版は常にMKVToolNixの拠点で入手できます。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..c811a6dbf5ed910e3b4d23f32dc35fa549bcbb0e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvinfo.html @@ -0,0 +1,460 @@ + + + + + mkvinfo -- Matroskaファイル中の要素についての情報を表示します。 + + + +
mkvinfo -- Matroska(tm)ファイル中の要素についての情報を表示します。 +
+
+ +
+

1. 書式

+ + +
mkvinfo オプション {原ファイル名} +
+ +

2. 説明

+ + +

+ このプログラムは、Matroska(tm)ファイルに格納されている全ての要素の一覧を表示します。出力を制限して、使用している符号器についての情報を含むファイル中のトラックを一覧することもできます。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ 既定ではmkvinfo(1)は最初の群団を読み取ると停止します。加えて、mkvinfo(1)は要素の出現をしばしば明示しません。このオプションを指定すると、mkvinfo(1)は冗長度に拘わらず処理を続行し、全ての要素を表示します。 + +

+ +
-c, --checksums + +

+ 各齣毎にAdler-32検査合計を計算して表示します。不具合の調査目的のみに有用です。 + +

+ +
-o, --continue + +

+ 既定ではmkvinfo(1)は最初の群団を読み取ると停止します。このオプションを指定すると、mkvinfo(1)は冗長度に拘わらず処理を続行し、全ての要素を表示します。 + +

+ +
-p, --hex-positions + +

+ 冗長度に拘わらず全ての要素の位置を16進数で表示します。 + +

+ +
-P, --positions + +

+ 冗長度に拘わらず全ての要素の位置を10進数で表示します。 + +

+ +
-s, --summary + +

+ 各要素ではなくmkvinfo(1)の見つけたものの簡潔な要約だけを表示します。 + +

+ +
-t, --track-info + +

+ 各トラックの統計情報を冗長モードで表示します。また、冗長度が以前に0だった場合は1に設定します。 + +

+ +
-x, --hexdump + +

+ 各齣の最初の16バイトを16進数で表示します。 + +

+ +
-X, --full-hexdump + +

+ 各齣全バイトを16進数で表示します。 + +

+ +
-z, --size + +

+ 頭部も含めた各要素の寸法を表示します。 + +

+ +
--command-line-charset 文字集合 + +

+ 命令行から与えた文字列を変換するのに用いる文字集合を設定します。既定では機構の現行地域特性で指定している文字集合になります。 + +

+ +
--output-charset 文字集合 + +

+ 出力される文字列を変換するのに用いる文字集合を設定します。既定では機構の現行地域特性で指定している文字集合になります。 + +

+ +
-r, + --redirect-outputファイル名 + +

+ 全ての通報を操作卓にではなくファイル名のファイルに書き出します。出力を転送することで同じことが簡単にできるものの、このオプションが必要な場合は存在します:ファイルに転送する前に端末が出力を再解釈してしまう場合です。--output-charsetで設定した文字集合を優先します。 + +

+ +
--ui-language 符号 + +

+ 用いる翻訳を指定した言語符号のものに強制します(例えば「de_DE」ならドイツ語翻訳です)。符号に「list」を指定すると利用可能な翻訳の一覧を出力します。 + +

+ +
--abort-on-warnings + +

+ 警告が発された後、プログラムが停止するようにします。プログラムの終了番号は1になります。 + +

+ +
--debug 機能 + +

+ 指定した機能の診断出力を有効にします。このオプションは開発者にとってのみ有用です。 + +

+ +
--engage 機能 + +

+ 実験的機能を有効にします。mkvinfo --engage + listとすると利用可能な機能の一覧が得られます。これらの機能は通常状況での使用を意図されていません。 + +

+ +
--gui-mode + +

+ GUIモードに切り替えます。このモードではGUI操作の状況を伝える特殊な形式の行が出力されます。これらの通報は + '#GUI#通報内容' + という形式の後に続きます。'#GUI#通報内容#予約語1=値1#予約語2=値2...' + というように予約語・値の組が通報内容に続くことがあります。通知内容や予約語は翻訳されることなく常に英語で出力されます。 + +

+ +
-v, --verbose + +

+ 冗長モードになります。各冗長度で出力される情報の説明については、冗長度節をご覧ください。 + +

+ +
-h, --help + +

+ 使用法情報を出力して終了します。 + +

+ +
-V, --version + +

+ 版次情報を出力して終了します。 + +

+ +
@オプションファイル.json + +

+ オプションファイルから追加の命令行引数を読み込みます。こうしたファイルの対応形式についての詳細は、mkvmerge(1)便覧中の「オプションファイル」という節をご覧ください。 + +

+ +
+ +

3. 冗長度

+ + + +

+ -vオプションでmkvinfo(1)の冗長度を引き上げ、現行ファイルについてのより詳しい情報を表示させることができます。 + +

+ + +

+ 水準0では、見付けたトラック頭部とその種類のみを出力します。mkvinfo(1)は、頭部を完全に解析し終るとすぐ(技術的詳細: + 最初の群団を検出した直後)に終了します。この水準では送り出し要素頭部項目および演奏指令は、たとえトラック情報の前に位置していても表示されません。 + +

+ + +

+ 水準1では、ファイル全体に渡ってMatroska(tm)要素を全て表示しますが、送り出し要素頭部項目および演奏指令項目は表示しません。要約モードが有効であった場合は、mkvinfo(1)は齣位置も同様に出力します。 + +

+ + +

+ --continueオプションを指定することでも同じ効果を及ぼせます。 + +

+ + +

+ 水準2では、送り出し頭部項目、演奏指令項目、および見付けた各Matroska(tm)要素のファイル位置もまた表示します。 + +

+ + +

+ --positionsオプションを指定することでも同じ効果を及ぼせます。 + +

+ + +

+ 水準3以上では、Matroska(tm)要素に直接関係しない情報もいくつか表示します。その他の要素については、見付けたもののみ表示します。水準3では不具合調査をしやすいように高次情報を附加します(必読: + これはもっぱら開発者向けです)。水準3で書き出された全ての行は、篩に掛けやすいように角括弧で囲まれています。 + +

+ +

4. 文章ファイルと文字集合変換

+ + + +

+ MKVToolNix一式の全ての操作機が文字集合変換、入出力、命令行、操作卓上の文字集合をどのように処理するかについての詳細な議論については、mkvmerge(1)の便覧にある同名の節をご覧ください。 + +

+ +

5. 終了番号

+ + + +

+ mkvinfo(1)が返す終了番号には3種類あります: + +

+ + +
    + +
  • + +

    + 0 -- この終了番号は動作が完了したことを意味します。 + +

    + +
  • + + +
  • + +

    + 1 -- この返り値は、一つ以上の警告が出力されたが動作が続行されたことを意味します。警告は + 'Warning:' + という文字列を先頭にして出力されます。結果ファイルが無事かどうかは状況によります。出力ファイルを確認することを強く推奨します。 + +

    + +
  • + + +
  • + +

    + 2 -- + この返り値は、誤りが発生し、誤り通報を出力した直後にmkvinfo(1)が終了したことを示します。誤り通報の原因は命令行の間違いやファイル読み/書き誤り、壊れたファイルなど多岐に渡ります。 + +

    + +
  • + +
+ +

6. 環境変数

+ + + +

+ mkvinfo(1)は機構の地域特性を決める既定変数(例:LANGLC_*系列)を使用します。追加の変数: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUGMKVTOOLNIX_DEBUGとその省略形MTX_DEBUG + +

その内容を、あたかも--debugオプション経由で渡されたかのように扱います。 +

+ +
MKVINFO_ENGAGE, + MKVTOOLNIX_ENGAGEとその短縮形MTX_ENGAGE + +

その内容を、あたかも--engageオプション経由で渡されたかのように扱います。 +

+ +
+ +

7. 関連項目

+ + +

+ mkvmerge(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. ウェブ

+ + +

+ 最新版は常にMKVToolNixの拠点で入手できます。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..5efd65bf40bcb10dd54dbbb600a4b41fcbb41efc --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvmerge.html @@ -0,0 +1,4596 @@ + + + + + mkvmerge -- 複合媒体流をMatroskaファイルに格納します + + + +
mkvmerge -- 複合媒体流をMatroska(tm)ファイルに格納します +
+
+ +
+

1. 書式

+ + +
mkvmerge 広域オプション {-o 出力} オプション1 {ファイル1} オプション2 {ファイル2} @オプションファイル.json +
+ +

2. 説明

+ + +

+ このプログラムは複数の媒体ファイルを入力とし、それらの流れ(の全て、もしくは選択したもののみ)をMatroska(tm)ファイルへと結合します。Matroskaの本拠地をご覧ください。 + +

+ + +
+

Important:

+ +

+ 命令行オプションの順序は重要です。もしもプログラム初心者なら、「オプション順序」節を読んでください。 + +

+ +
+ + +

2.1. 広域オプション

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

冗長度を引き上げます。

+ +
-q, --quiet + +

状況出力を抑制します。

+ +
-o, --output ファイル名 + +

ファイル名で指定したファイルに書き込みます。ファイル分割が有効な場合は,このオプションは僅かに異なって取り扱われます。詳細は--splitオプションの説明をご覧ください。 +

+ +
-w, --webm + +

WebM準拠ファイルを生成します。出力ファイル名の拡張子が "webm" + の場合も有効になります。このモードでは幾つかの制限があります。受入れられる符号器はVP8,VP9動画およびOpus,Vorbis音声トラックのみです。文書型頭部の項目は + "webm" に変更されます。 + +

+ + +

+ 楽章および標識に対しては、要素の部分集合のみが許容されます。mkvmerge(1)は仕様が許可していない項目を全て消去します。 + +

+ +
--title 題名 + +

出力ファイル全体の題名を指定します。例: 映画名。

+ +
--default-language 言語コード + +

--languageオプションで言語が設定されていなかったり,原コンテナが言語を提供していないようなトラックで用いる既定言語コードを設定します。 +

+ + +

The default language code is 'und' for 'undetermined'. +

+ +
+ + + +

2.2. 区分情報の扱い (広域オプション)

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo ファイル名.xml + +

+ 区分情報をXMLファイルから読み取ります。このファイルには、区分族UID、区分UID、前および後の区分UID要素を含むことができます。MKVToolNixの配布物には、ファイル例とDTDを収録しています。 + +

+ + +

+ 詳細は、後述の区分情報XMLファイルについての節をご覧ください。 + +

+ +
--segment-uid SID1,SID2,... + +

+ 使用する区分UIDを設定します。これは読点区切りの羅列であり、通常のUID形式で記された128ビット区分UIDから成ります。通常のUID形式とは,"0x" + を任意で前置する,空白を任意に含むちょうど32桁の16進数です。 + +

+ + +

+ SIDが=で始まる場合は、読み取り使用した区分UIDを持つMatroska(tm)ファイルの名前として残りの部分を解釈します。 + +

+ + +

+ 作成される各ファイルには一つの区分があり,各区分には一つの区分UIDがあります。作成したものより多くの区分UIDを指定した場合は,余分なUIDは無視されます。作成したものより少ない区分UIDしか指定しなかった場合は,無作為なUIDを生成して補います。 + +

+ +
+ + + +

2.3. 楽章および標識の扱い(広域オプション)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language 言語コード + +

+ 各楽章項目に書き込むISO 639-2言語コードを設定します。既定は 'eng' です。詳細は楽章についての節をご覧ください。 + +

+ + +

+ 単一の楽章ファイルや,楽章があるがその楽章言語情報はない場合(例えばMP4やOGMファイル)に使用できるでしょう。 + +

+ + +

+ このオプションで設定した言語は--generate-chaptersオプションで生成した楽章にも用いられます。 + +

+ +
--chapter-charset 文字集合 + +

+ 単純楽章ファイルをUTF-8に変換する際に用いる文字集合を設定します。mkvmerge(1)が文字集合の間で行う変換についての説明は文章ファイルと文字集合についての節をご覧ください。 + +

+ + +

+ この切替は楽章が特定のコンテナ種別(例: + Ogg・OGMやMP4ファイル)から複製する際にも適用されます。詳細については後述の楽章についての節をご覧ください。 + +

+ +
--chapter-sync + d[,o[/p]] + +

+ 以降の原ファイル中の楽章の時刻印をdミリ秒単位で調整します。替わりに--syncオプションに特殊トラックID-2特殊トラックID節をご覧ください)を指定しても使えます。 + +

+ + +

+ o/p: + 時刻印をo/pだけ調整し,線型偏流を修正します。既定ではpを省略した場合1になります。oおよびp双方に浮動点小数を指定できます。 + +

+ + +

+ 既定: 手動同期修正なし(d = + 0でありo/p = + 1.0である場合と同じです)。 + +

+ + +

+ このオプションを一つの入力ファイルに対して複数回使用でき,毎回異なるトラックIDを指定することで複数のトラックを処理できます。 + +

+ +
--generate-chapters モード + +

+ mkvmerge(1)で楽章を自動生成することができます。現在,次の二つのモードに対応しています: + +

+ + +
    + +
  • + +

    + 「when-appending」モードでは,始めに一つの楽章を作り,ファイルが追加される都度一つ楽章を増やします。 + +

    + + +

    + このモードはまた分割モード 'parts:' + および'parts-frames:' + でも動作します。これらのモードでは,追加した時刻印(開始時点および'+' + が前置された時刻印)の範囲毎に一つの楽章を生成します。 + +

    + + +
    +

    Note:

    + +

    + ファイルを新しく追加した際にmkvmerge(1)が感知できるように,映像または音声トラックが存在する必要があります。複数の映像トラックが混在していた場合,始めのトラックを使用します。それ以外の場合,始めの音声トラックを使用します。 + +

    + +
    + +
  • + + +
  • + +

    + 「interval:time-spec」モードでは,time-specで指定した間隔ごとに一つの楽章を生成します。指定する形式は,HH:MM:SS.nnnnnnnnn形式か's','ms',またはus単位が続く数字のいずれかです。 + +

    + + +

    + 例: --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ 新規楽章の名前は--generate-chapters-name-templateオプションで制御します。言語は--chapter-languageで設定し,--generate-chaptersの後ろでなければなりません。 + +

+ +
--generate-chapters-name-template 雛形 + +

+ --generate-chaptersオプションで楽章を生成する際の雛形を設定します。このオプションを用いなかった場合は,既定で + 'Chapter <NUM:2>' を使用します。 + +

+ + +

+ 雛形では幾つかの変数が使用でき,それらは楽章が生成する際に実際の値に置き換わります。文字列 + '<NUM>' は楽章番号に置き換わります。文字列 + '<START>' は楽章の開始時刻印に置き換わります。 + +

+ + +

+ The strings '<FILE_NAME>' and + '<FILE_NAME_WITH_EXT>' are only filled when + generating chapters for appended files. They will be replaced by the + appended file's name without respectively with its extension. Note that + only the file's base name and extension are inserted, not its directory or + drive components. + +

+ + +

+ 楽章を設定する場所の最小値を「<NUM;場所>」という形式で指定できます(例: + <NUM:3>)。指定した数より場所が少ない場合は,番号をゼロ埋めして出力します。 + +

+ + +

+ <START:形式>によって開始する時刻表示の書式を制御できます。なにも指定されていない場合の既定の書式は「%H:%M:%S」です。有効な書式指定子は以下の通りです: + +

+ + +
    + +
  • + +

    %h – 時 +

    + +
  • + +
  • + +

    %H – ゼロ埋めした2桁の時 +

    + +
  • + +
  • + +

    %m – 分 +

    + +
  • + +
  • + +

    %M – ゼロ埋めした2桁の分 +

    + +
  • + +
  • + +

    %s – 秒 +

    + +
  • + +
  • + +

    %S – ゼロ埋めした2桁の秒 +

    + +
  • + +
  • + +

    %n – 9桁のナノ秒 +

    + +
  • + +
  • + +

    %<1-9>n – 9桁までのナノ秒(例: 3桁なら%3n) +

    + +
  • + +
+ +
--cue-chapter-name-format 書式指定子 + +

+ mkvmerge(1)は音声ファイル向けのCUE用紙から楽章情報を読み込むことができます。CUE用紙には通常PERFORMER項目及びTITLE項目が各目録項目に存在します。mkvmerge(1)はこれら二つの文字列を楽章の名前を生成するのに使用します。この形式をこのオプションで指定することができます。 + +

+ + +

+ このオプションが指定されていない場合、既定で'%p - %t'という形式が使用されます。 + +

+ + +

+ 形式が指定された場合、下のメタ文字以外はそのまま複製され、メタ文字は以下のように置換されます。 + +

+ + +
    + +
  • + +

    %pはその項目のPERFORMER文字列で置換されます。 +

    + +
  • + +
  • + +

    %tはその項目のTITLE文字列で置換されます。 +

    + +
  • + +
  • + +

    %nはその項目のトラック番号で置換されます。 +

    + +
  • + +
  • + +

    %Nは、その項目のトラック番号が10未満の場合0を前置して二桁にした数字で置換されます。 +

    + +
  • + +
+ +
--chapters ファイル名 + +

+ 楽章情報をファイル名で指定したファイルから読み込みます。詳細は楽章の節を参照してください。 + +

+ +
--global-tags ファイル名 + +

+ ファイル名で指定したファイルから広域標識を読み込みます。詳細は標識の節を参照してください。 + +

+ +
+ + + +

2.4. 出力一般の制御(高度な広域オプション)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order + FID1:TID1,FID2:TID2,... + +

+ このオプションは入力されたトラックが配置される順序を変更します。オプション引数は読点区切りのID組の列です。各組は最初を0として命令行の何番目に指定したファイルであるかを示すファイルID(FID1)と、そのファイルの中の何番目のトラックかを示すトラックID(TID1)からなります。ここで指定されなかったトラックは、指定されたトラックの後に配置されます。 + +

+ +
--cluster-length 指定子 + +

+ 群団ごとのデータ区画数もしくはデータの持続期間を制限します。specパラメータには単位なしの数字nもしくは、'ms'を後ろに付けた数字dを指定できます。 + +

+ + +

+ 単位が指定されなかった場合、群団ごとのデータ区画の最大個数はnに設定されます。上限は65535です。 + +

+ + +

+ 数字dに「ms」が後置されていた場合、mkvmerge(1)は各群団毎に最大でもdミリ秒分のデータしか格納しません。dの最小値は「100ms」、最大値は「32000ms」です。 + +

+ + +

+ mkvmerge(1)は既定で一つの群団に最大65535のデータ区画,5000msのデータを書き込みます。 + +

+ + +

+ プログラムがある齣を探索する際は,群団を直接読み出すことしかできず、その後に群団全体を読まなければなりません。そのため、群団を大きくすると、送り出しが不正確になったり、遅くなったりすることがあります。 + +

+ +
--clusters-in-meta-seek + +

+ 全ての群団を含む高次送り出し要素をファイルの終端に生成するようにします。Matroskaファイル割り付けの節も参照してください。 + +

+ +
--timestamp-scale 係数 + +

+ 時刻印の桁係数を係数に強制します。妥当な値は100010000000の範囲の数字か,もしくは特別値-1です。 + +

+ + +

+ mkvmerge(1)が通常用いる値は1000000です。これは時刻印と齣持続期間が1ミリ秒単位の精度を持つことを意味します。映像トラックを含まず、1つ以上の音声トラックを含むファイルでは、mkvmerge(1)は全ての時刻印と齣持続時間が標本音1つ分の精度を持つように時刻印の桁数係数を自動的に選択します。これによって処理負荷は増えますが、正確な送り出しと展開が可能になります。 + +

+ + +

+ 特殊値-1を指定した場合、映像トラックが存在している場合でも標本音の精度を使用します。 + +

+ +
--enable-durations + +

+ 全ての区画の長さを書き込みます。結果としてファイル容量は増大するうえに,今のところ再生機器に対する付加的価値も生みません。 + +

+ +
--no-cues + +

+ 演奏指令データ(AVIにおける目録のようなもの)を作成しないようにします。Matroska(tm)ファイルは演奏指令データなしでも再生できますが、送り出しは不正確で遅くなるでしょう。少しでもファイル容量を小さくしたいときや試験的な目的以外には使用しないでください。各入力ファイルごとに指定できる--cuesオプションも参照してください。 + +

+ +
--no-date + +

+ 既定では、mkvmerge(1)は多重化が開始された時刻と日付を "date" + 区分情報欄に書き込みます。このオプションを指定すると,この欄には何も書き込まれなくなります。 + +

+ +
--disable-lacing + +

+ すべてのトラックについて結合を無効化します。結果として,特に音声トラックが多い場合、ファイル容量が増大します。このオプションは日常的な用途を想定していません。 + +

+ +
--disable-track-statistics-tags + +

+ Normally mkvmerge(1) will write certain tags with statistics for each + track. If such tags are already present then they will be overwritten. The + tags are BPS, DURATION, + NUMBER_OF_BYTES and + NUMBER_OF_FRAMES. + +

+ + +

+ Enabling this option prevents mkvmerge(1) from writing those tags and from + touching any existing tags with same names. + +

+ +
--disable-language-ietf + +

+ Normally mkvmerge(1) will write the new IETF BCP 47 language elements in + addition to the legacy language elements in track headers, chapters and + tags. If this option is used, only the legacy elements are written. + +

+ +
--normalize-language-ietf mode + +

+ Enables normalizing all IETF BCP 47 language tags to either their canonical + form with mode 'canonical', to their extended language + subtags form with mode 'extlang' or turns it off with + mode 'off'. By default normalization to the canonical + form is applied. + +

+ + +

+ In the canonical form all subtags for which preferred values exist are + replaced by those preferred values. This converts + e.g. 'zh-yue-jyutping' to + 'yue-jyutping' or 'fr-FX' to + 'fr-FR'. + +

+ + +

+ For the extended language subtags form the canonical form is built + first. Afterwards all primary languages for which an extended language + subtag exists are replaced by that extended language subtag and its + prefix. This converts e.g. 'yue-jyutping' back to + 'zh-yue-jyutping' but has no effect on + 'fr-FR' as 'fr' is not an extended + language subtag. + +

+ +
--stop-after-video-ends + +

+ Stops processing after the primary video track ends, discarding any + remaining packets of other tracks. + +

+ +
+ + + +

2.5. ファイルの分割・紐付け・追加・連結(広域オプションの続き)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split specification + +

+ Splits the output file after a given size or a given time. Please note that + tracks can only be split right before a key frame. Therefore the split + point may be a bit off from what the user has specified. + +

+ + +

+ At the moment mkvmerge(1) supports the following modes: + +

+ + +
    + +
  1. + +

    + 指定サイズで分割します。 + +

    + + +

    + 書式: --split + [size:]d[k|m|g] + +

    + + +

    + 例: --split size:700m or --split 150000000 + +

    + + +

    + パラメータdの後ろには'k'・'m'・'g'を付けて、単位がそれぞれKB・MB・GBであることを示すことができます。付けない場合はバイト単位になります。出力中のファイルがこの上限に達したら、次の新しいファイルへの出力が開始されます。 + +

    + + +

    + 'size:'という接頭辞は、互換性のために省略できるようになっています。 + +

    + +
  2. + + +
  3. + +

    + 指定時間で分割します。 + +

    + + +

    + 書式: --split + [duration:]HH:MM:SS.nnnnnnnnn|ds + +

    + + +

    + 例: --split duration:00:60:00.000 or --split 3600s + +

    + + +

    + パラメータはHH:MM:SS.nnnnnnnnnという形式でナノ秒精度で長さを指定するか、数字dのあとに's'と書いて秒数で長さを指定しなければなりません。HHは時間、MMは分、SSは秒数でnnnnnnnnnナノ秒を示します。時間及びナノ秒は省略できます。小数点の後ろには9桁までの数字を指定できます。指定した長さだけ出力されたら、次のファイルへの出力が開始されます。 + +

    + + +

    + 'duration:'という接頭辞は、互換性のために省略できるようになっています。 + +

    + +
  4. + + +
  5. + +

    + 指定した各時刻印で分割します。 + +

    + + +

    + 書式: --split + timestamps:A[,B[,C...]] + +

    + + +

    + 例: --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + パラメータABC…は、期間を指定するのに用いる形式(上記参照)と同じ形式で指定しなければなりません。時刻印の一覧は読点で区切られます。入力流が現在の分割点に達すると次のファイルが作成され、この一覧から次の分割点が使用されます。 + +

    + + +

    + 'timestamps:'という接頭辞は省略してはなりません。 + +

    + +
  6. + + +
  7. + +

    + 指定した時刻印の範囲を残し、他の部分を切り捨てます。 + +

    + + +

    + 構文: --split + parts:開始1-終了1[,[+]開始2-終了2[,[+]開始3-終了3...]] + +

    + + +

    + 例: +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + The parts mode tells mkvmerge(1) to keep certain ranges of + timestamps while discarding others. The ranges to keep have to be listed + after the parts: keyword and be separated by commas. A + range itself consists of a start and an end timestamp in the same format the + other variations of --split accept (e.g. both + 00:01:20 and 80s refer to the same + timestamp). + +

    + + +

    + If a start timestamp is left out then it defaults to the previous range's + end timestamp. If there was no previous range then it defaults to the start + of the file (see example 3). + +

    + + +

    + If an end timestamp is left out then it defaults to the end of the source + files which basically tells mkvmerge(1) to keep the rest (see example 3). + +

    + + +

    + Normally each range will be written to a new file. This can be changed so + that consecutive ranges are written to the same file. For that the user has + to prefix the start timestamp with a +. This tells + mkvmerge(1) not to create a new file and instead append the range to the same + file the previous range was written to. Timestamps will be adjusted so that + there will be no gap in the output file even if there was a gap in the two + ranges in the input file. + +

    + + +

    + In example 1 mkvmerge(1) will create two files. The first will contain the + content starting from 00:01:20 until + 00:02:45. The second file will contain the content + starting from 00:05:50 until 00:10:30. + +

    + + +

    + In example 2 mkvmerge(1) will create only one file. This file will contain + both the content starting from 00:01:20 until + 00:02:45 and the content starting from + 00:05:50 until 00:10:30. + +

    + + +

    + In example 3 mkvmerge(1) will create two files. The first will contain the + content from the start of the source files until + 00:02:45. The second file will contain the content + starting from 00:05:50 until the end of the source files. + +

    + + +
    +

    Note:

    + +

    + Note that mkvmerge(1) only makes decisions about splitting at key frame + positions. This applies to both the start and the end of each range. So even + if an end timestamp is between two key frames mkvmerge(1) will continue + outputting the frames up to but excluding the following key frame. + +

    + +
    + +
  8. + + +
  9. + +

    + Keeping specific parts by specifying frame/field number ranges while + discarding others. + +

    + + +

    + Syntax: --split + parts-frames:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + 例: +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + The parts-frames mode tells mkvmerge(1) to keep certain + ranges of frame/field numbers while discarding others. The ranges to keep + have to be listed after the parts-frames: keyword and be + separated by commas. A range itself consists of a start and an end + frame/field number. Numbering starts at 1. + +

    + + +

    + If a start number is left out then it defaults to the previous range's end + number. If there was no previous range then it defaults to the start of the + file (see example 3). + +

    + + +

    + If an end number is left out then it defaults to the end of the source files + which basically tells mkvmerge(1) to keep the rest (see example 3). + +

    + + +

    + Normally each range will be written to a new file. This can be changed so + that consecutive ranges are written to the same file. For that the user has + to prefix the start number with a +. This tells + mkvmerge(1) not to create a new file and instead append the range to the same + file the previous range was written to. Timestamps will be adjusted so that + there will be no gap in the output file even if there was a gap in the two + ranges in the input file. + +

    + + +
    +

    Note:

    + +

    + Note that mkvmerge(1) only makes decisions about splitting at key frame + positions. This applies to both the start and the end of each range. So even + if an end frame/field number is between two key frames mkvmerge(1) will + continue outputting the frames up to but excluding the following key frame. + +

    + +
    + + +

    + In example 1 mkvmerge(1) will create two files. The first will contain the + content starting from the first key frame at or after 137 + up to but excluding the first key frame at or after + 258. The second file will contain the content starting + from 548 until 1211. + +

    + + +

    + In example 2 mkvmerge(1) will create only one file. This file will contain + both the content starting from 733 until + 912 and the content starting from 1592 + until 2730. + +

    + + +

    + In example 3 mkvmerge(1) will create two files. The first will contain the + content from the start of the source files until 430. The + second file will contain the content starting from 2512 + until the end of the source files. + +

    + + +

    + This mode considers only the first video track that is output. If no video + track is output no splitting will occur. + +

    + + +
    +

    Note:

    + +

    + The numbers given with this argument are interpreted based on the number of + Matroska(tm) blocks that are output. A single Matroska(tm) block contains + either a full frame (for progressive content) or a single field (for + interlaced content). mkvmerge does not distinguish between those two and + simply counts the number of blocks. For example: If one wanted to split + after the 25th full frame with interlaced content one would have to use + 50 (two fields per full frame) as the split point. + +

    + +
    + +
  10. + + +
  11. + +

    + Splitting after specific frames/fields. + +

    + + +

    + Syntax: --split + frames:A[,B[,C...]] + +

    + + +

    + Example: --split frames:120,237,891 + +

    + + +

    + The parameters A, B, + C etc must all be positive integers. Numbering + starts at 1. The list of frame/field numbers is separated by commas. After + the input stream has reached the current split point's frame/field number a + new file is created. Then the next split point given in this list is used. + +

    + + +

    + 接頭辞「frames:」は省略できません。 + +

    + + +

    + This mode considers only the first video track that is output. If no video + track is output no splitting will occur. + +

    + + +
    +

    Note:

    + +

    + The numbers given with this argument are interpreted based on the number of + Matroska(tm) blocks that are output. A single Matroska(tm) block contains + either a full frame (for progressive content) or a single field (for + interlaced content). mkvmerge does not distinguish between those two and + simply counts the number of blocks. For example: If one wanted to split + after the 25th full frame with interlaced content one would have to use + 50 (two fields per full frame) as the split point. + +

    + +
    + +
  12. + + +
  13. + +

    + 指定した各楽章で分割します。 + +

    + + +

    + 書式: --split + chapters:all又は--split + chapters:A[,B[,C...]] + +

    + + +

    + 例: --split chapters:5,8 + +

    + + +

    + A, B, + C等のパラメータは正整数でなくてはなりません。番号は1始まりです。複数の楽章番号はコンマで区切られます。分割が行なわれるのは、指定された番号の各楽章が開始するタイムスタンプと等しい又はより大きいタイムスタンプである最初のキーこまの直前です。0秒から開始する楽章は分割されることなく、通知なしに破棄されます。 + +

    + + +

    + 全ての楽章番号を手で入力する代わりに、allキーワードが使えます。 + +

    + + +

    + 接頭辞「chapters:」は省略できません。 + +

    + + +
    +

    Note:

    + +

    + The Matroska(tm) file format supports arbitrary deeply nested chapter + structures called 'edition entries' and 'chapter atoms'. However, this mode + only considers the top-most level of chapters across all edition entries. + +

    + +
    + +
  14. + +
+ + +

+ この分割モードでは、出力ファイル名は通常の操作とは異なる扱いを受けます。このモードでは出力ファイル名はprintfのように'%d'というパターンを含むことができます。'%02d'のように幅指定を追加することもできます。出力ファイル名がこのパターンを含む場合、ファイル番号が適切な形式で指定された位置に挿入されます。含まない場合、'-%03d'というパターンがファイルの拡張子の直前に指定されたものとみなされ、例えば'-o + output.mkv'を指定した場合、'output-001.mkv'等のファイル名に出力されます。拡張子が存在しない場合、'-%03d'はファイル名の末尾に追加されます。 + +

+ + +

+ Another possible pattern is '%c' which will be replaced by the + name of the first chapter in the file. Note that when '%c' is + present, the pattern '-%03d' will not be added automatically. + +

+ +
--link + +

+ 分割された出力ファイルを相互に紐付けします。詳細はファイル紐付けのセクションを参照してください。 + +

+ +
--link-to-previous segment-UID + +

+ 最初の出力ファイルをsegment-UIDで指定したセグメントUIDに紐付けします。詳細はファイル紐付けのセクションを参照してください。 + +

+ + +

+ SIDが=で始まる場合は、読み取り使用した区分UIDを持つMatroska(tm)ファイルの名前として残りの部分を解釈します。 + +

+ +
--link-to-next segment-UID + +

+ 最後の出力ファイルをsegment-UIDで指定したセグメントUIDに紐付けします。詳細はファイル紐付けのセクションを参照してください。 + +

+ + +

+ SIDが=で始まる場合は、読み取り使用した区分UIDを持つMatroska(tm)ファイルの名前として残りの部分を解釈します。 + +

+ +
--append-mode mode + +

+ ファイルを結合する際に、時刻印がどのように計算されるかを決定します。パラメータmodeは'file'(既定)、'trackの二つの値を取り得ます。 + +

+ + +

+ mkvmergeが二つめのファイル(以後'file2'と呼ぶ)のトラック(以後'track2_1'と呼ぶ)を、一つめのファイル(以後'file1'と呼ぶ)のトラック(以後'track1_1'と呼ぶ)と結合する際、'track2_1'の時刻印は一定量だけずらす必要があります。'file'モードでは、ずらす量は'file1'の中の'track1_1'以外のトラックを含む全てのトラックの中で一番大きい時刻印の値になります。'track'モードでは、'track1_1'の中で一番大きい時刻印の値になります。 + +

+ + +

+ 残念ながら、mkvmergeはどちらのモードが適切であるか判断はできません。既定は'file'モードになっています。'file'モードは独立に作られたファイル同士を結合する際、例えばAVI又はMP4ファイルを結合する際に、通常はより上手く働きます。'track'モードは、例えばVOBEVOファイルなどの大きなファイルの一部がソースの場合より上手く働くかもしれません。 + +

+ + +

+ 字幕トラックは'track'モードが指定された場合でも、常に'file'が指定されたかのように処理されます。 + +

+ +
--append-to + SFID1:STID1:DFID1:DTID1[,...] + +

+ このオプションは、どのトラックがどのトラックに追加されるのかを制御します。ファイルID、トラックID、追加するファイルID、追加するトラックIDの4つのIDで一組の指定を構成します。最初のファイルIDとトラックIDの組み合わせは、追加される対象のトラックを指定します。次のファイルIDとトラックIDは、そのトラックに追加されるトラックを指定します。 + +

+ + +

+ このオプションが指定されない場合、標準のマッピングが使用されます。この場合、前のファイルのトラックに、現在のファイルのトラックIDが同じであるトラックが追加されます。これにより、動画が二つのファイルに分割されており、かつ同じトラック数とトラックIDを持つ場合、mkvmerge + -o output.mkv part1.mkv +part2.mkvのようにして簡単に結合することができます。 + +

+ +
+ + +

+ '+'一文字を指定すると、次に指定されたファイルは追加ではなく結合されます。'+'は次のファイル名の直前に置くこともできます。よって、次の2つの命令は等価です。 + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv file1.mkv +file2.mkv
+
[ file1 file2 + ] + +

+ If multiple file names are contained in a pair of square brackets then the + second and all following files will be appended to the first file named + within the brackets. + +

+ + +

+ This is an alternative syntax to using '+' between the file names. Therefore + the following two commands are equivalent: + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv '[' file1.mkv file2.mkv ']'
+
= + +

+ For certain file types (MPEG program streams = VOBs) mkvmerge(1) normally + looks for files in the same directory as an input file that have the same + base name and only differ in their running number (e.g. 'VTS_01_1.VOB', + 'VTS_01_2.VOB', 'VTS_01_3.VOB' etc) and treats all of those files as if they + were concatenated into a single big file. This option, a single '=', causes + mkvmerge not to look for those additional files. + +

+ + +

+ '='は次のファイル名の直前に置くこともできます。よって、次の2つの命令は等価です。 + +

+ +
$ mkvmerge -o full.mkv = file1.vob
+$ mkvmerge -o full.mkv =file1.vob
+
( file1 file2 + ) + +

+ 複数のファイル名が括弧の中に含まれている場合、それらのファイルは、各ファイルの内容によって順々に構成される1つの大きなファイルへと連結されているかのように扱われます。 + +

+ + +

+ これは、例えばDVDのVOBファイルやMPEGトランスポートストリーム等のために使用することができます。通常AVIやMP4のようなスタンドアローンのファイルの場合ですが、各ファイルが自身の頭部を一通り含んでいる場合には使用することができません。 + +

+ + +

+ ファイル名を括弧で括るのは、オプション=で説明されているように同じ基底名を持つファイルをmkvmerge(1)に検索させない効果もあります。 + よって、これらの2つの命令行は同値です: + +

+ +
$ mkvmerge -o out.mkv = file.mkv
+$ mkvmerge -o out.mkv '(' file.mkv ')'
+ +

+ いくつか注意事項があります: + +

+ + +
    + +
  1. + +

    + 開く括弧の後と閉じる括弧の前の両方に空白が必要です。 + +

    + +
  2. + + +
  3. + +

    + 括弧内の全てのパラメータはファイル名として解釈されます。よって、この論理上のファイルに適用される全てのオプションは、開く括弧の前に記述する必要があります。 + +

    + +
  4. + + +
  5. + +

    + 括弧を特殊文字として扱うシェルもあります。よって、上の例で示されているように括弧をエスケープするかクォーテーションで囲む必要があります。 + +

    + +
  6. + +
+ +
+ + + + +

2.6. 添付ファイルへの対応(広域オプションの続き)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description description + +

+ 次の添付ファイルを説明するプレーン文章を指定します。次の--attach-fileオプション又は--attach-file-onceオプションで指定した添付ファイルに適用されます。 + + +

+ +
--attachment-mime-type MIME type + +

+ 次の添付ファイルのMIMEタイプを指定します。--attach-file及び--attach-file-onceオプションに適用されます。公式に認知されているMIMEタイプは例えばIANAのホームページに掲載されています。MIMEタイプは添付ファイルに必須です。 + +

+ + +

+ If no MIME type is given a for an attachment, its type will + be detected automatically. + +

+ +
--attachment-name name + +

+ この添付ファイルの、出力ファイル内での名前を指定します。このオプションが指定されなかった場合、--attach-fileまたは--attach-file-onceで指定されたファイル名がそのまま使用されます。 + +

+ +
+ --attach-file file-name, + --attach-file-once file-name + + +

+ Matroska(tm)ファイルの内部に添付ファイルを作成します。これらのオプションを使用するには、MIMEタイプをこれらのオプションより前に指定しなければなりません。二つのオプションの違いは、出力ファイルを分割する際に、--attach-fileでは全ての出力ファイルに添付されますが、--attach-file-onceでは最初に作成されたファイルにしか添付されない点です。分割が使用されない場合、2つは等価です。 + +

+ + +

+ mkvextract(1)Matroska(tm)ファイルから添付ファイルを抽出することができます。 + +

+ +
--enable-legacy-font-mime-types + +

+ Enables the use of legacy MIME types for certain types of + font attachments. For example, + 'application/x-truetype-font' will be used for TrueType + fonts instead of 'fonts/ttf'. + +

+ + +

+ This affects both new attachments if its MIME type is + detected automatically and existing attachments whose stored + MIME types will be remapped to the legacy ones. + +

+ + +

+ The affected MIME types are 'font/sfnt', + 'font/ttf' and 'font/collection' which + are all mapped to 'application/x-truetype-fonts' and + 'font/otf' which is mapped to + 'application/vnd.ms-opentype'. + +

+ +
+ + + +

2.7. 各入力ファイルに指定できるオプション

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks + [!]n,m,... + +

+ 音声トラックnm…を複製します。番号は--identifyオプションで得られるトラックIDであり,単にトラック番号を示すものではありません(「トラックID」節を参照)。既定: 全ての音声トラックを複製します。 + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ Default: copy all tracks of this kind. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-d, --video-tracks + [!]n,m,... + +

+ 映像トラックnm…を複製します。数字は--identifyオプションで得られるトラックIDであり,単にトラック番号を示すものではありません(「トラックID」節を参照)。既定: 全ての映像トラックを複製します。 + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-s, --subtitle-tracks + [!]n,m,... + +

+ 字幕トラックnm…を複製します。番号は--identifyオプションで得られるトラックIDであり,単にトラック番号を示すものではありません(「トラックID」節を参照)。既定: 全ての字幕トラックを複製します。 + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-b, --button-tracks + [!]n,m,... + +

+ ボタントラックnm…を複製します。番号は--identifyオプションで得られるトラックIDであり,単にトラック番号を示すものではありません(「トラックID」節を参照)。既定: 全てのボタントラックを複製します。 + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
--track-tags + [!]n,m,... + +

+ トラックnm…の標識を複製します。番号は--identifyオプションで得られるトラックIDであり,単にトラック番号を示すものではありません(「トラックID」節を参照)。既定: 全てのトラックの標識を複製します。 + +

+ + +

+ もしIDに!が接頭していた場合には、意味が逆転します,すなわち,!の後に列挙されたIDを除く全てのトラック標識を複製します。 + +

+ +
-m, --attachments + [!]n[:all|first],m[:all|first],... + +

+ IDがnm…の添付ファイルを全ての、または最初の出力ファイルに複製します。各IDの後ろには、':all'(既定)又は':first'を指定することができます。出力ファイル分割が有効の場合、':all'をつけたIDの添付ファイルは全ての出力ファイルに複製され、':first'をつけた場合は最初の出力ファイルにのみ複製されます。分割が有効でない場合は二つは同等です。 + +

+ + +

+ 既定では、全ての添付ファイルが全ての出力ファイルに複製されます。 + +

+ + +

+ もしIDに!が接頭していた場合には、意味が逆転します,すなわち,!の後に列挙されたIDを除く全てのトラック標識を複製します。 + +

+ +
-A, --no-audio + +

+ このファイルから音声トラックを複製しません。 + +

+ +
-D, --no-video + +

+ このファイルから映像トラックを複製しません。 + +

+ +
-S, --no-subtitles + +

+ このファイルから字幕トラックを複製しません。 + +

+ +
-B, --no-buttons + +

+ このファイルからボタントラックを複製しません。 + +

+ +
-T, --no-track-tags + +

+ このファイルから音声トラックを複製しません。 + +

+ +
--no-chapters + +

+ このファイルから楽章を複製しません。 + +

+ +
-M, --no-attachments + +

+ このファイルから添付ファイルを複製しません。 + +

+ +
--no-global-tags + +

+ このファイルから広域標識を複製しません。 + +

+ +
-y, --sync + TID:d[,o[/p]] + +

+ トラックIDがTIDのトラックの時刻印をdミリ秒だけ調整します。トラックIDは--identifyオプションで得られるものと同じです(「トラックID」節を参照)。 + +

+ + +

+ o/p: + 時刻印をo/pだけ調整し,線型偏流を修正します。既定ではpを省略した場合1になります。oおよびp双方に浮動点小数を指定できます。 + +

+ + +

+ 既定: 手動同期修正なし(d = + 0でありo/p = + 1.0である場合と同じです)。 + +

+ + +

+ このオプションを一つの入力ファイルに対して複数回使用でき,毎回異なるトラックIDを指定することで複数のトラックを処理できます。 + +

+ +
--cues TID:none|iframes|all + +

+ 指定されたトラックについて、どのトラック演奏指令(目録)項目が作成されるのかを指定します(「トラックID」節を参照)。「none」を指定すると演奏指令項目を作成しません。「iframes」を指定すると前方参照及び後方参照を含まない区画(映像トラックではI齣)のみが演奏指令用紙に挿入されます。「all」を指定するとmkvmerge(1)は全ての区画に対して演奏指令項目を作成し、非常に大きなファイルが出力されます。 + +

+ + +

+ The default is 'iframes' for video and subtitle tracks + and 'none' for audio tracks. See also option --no-cues + which inhibits the creation of cue entries regardless of the + --cues options used. + +

+ + +

+ このオプションを一つの入力ファイルに対して複数回使用でき,毎回異なるトラックIDを指定することで複数のトラックを処理できます。 + +

+ +
--default-track-flag + TID[:bool] + +

+ Sets the "default track" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. The flag will be set if the source container doesn't + provide that information and the user doesn't specify it via this option. + +

+ + +

+ If the user does not explicitly select a track during playback, the player + should select one of the tracks that has its "default track" flag + set, taking user preferences such as their preferred language into account. + +

+ + +

+ このオプションを一つの入力ファイルに対して複数回使用でき,毎回異なるトラックIDを指定することで複数のトラックを処理できます。 + +

+ +
--track-enabled-flag + TID[:bool] + +

+ Sets the "track enabled" flag for the given track (see section + track IDs) to the given value + bool (0 or 1; defaults to 1 if not specified). + Tracks are enabled by default if no option is specified for them and the + source container doesn't provide this information either. + +

+ + +

+ Only tracks whose "track enabled" flag is set should be considered + for playback. + +

+ + +

+ このオプションを一つの入力ファイルに対して複数回使用でき,毎回異なるトラックIDを指定することで複数のトラックを処理できます。 + +

+ +
--forced-display-flag + TID[:真偽値] + +

+ 任意引数真偽値1を設定あるいは何も設定しなかった場合に,所与のトラック(「トラックID」節参照)に対して、「強制表示」標旗を設定します。画面表示文や外国語の会話文があるトラックに使用してください。 + +

+ + +

+ このオプションを一つの入力ファイルに対して複数回使用でき,毎回異なるトラックIDを指定することで複数のトラックを処理できます。 + +

+ +
--hearing-impaired-flag + TID[:bool] + +

+ Sets the "hearing impaired" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track is suitable for users + with hearing impairments. + +

+ + +

+ このオプションを一つの入力ファイルに対して複数回使用でき,毎回異なるトラックIDを指定することで複数のトラックを処理できます。 + +

+ +
--visual-impaired-flag + TID[:真偽値] + +

+ 任意引数bool1を設定あるいは何も設定しなかった場合に,所与のトラック(「トラックID」節参照)に対して、「視覚障害」標旗を設定します。当トラックが視覚障害者に適しているなら,この標旗を設定するといいでしょう。 + +

+ + +

+ このオプションを一つの入力ファイルに対して複数回使用でき,毎回異なるトラックIDを指定することで複数のトラックを処理できます。 + +

+ +
--text-descriptions-flag + TID[:真偽値] + +

+ Sets the "text descriptions" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track contains textual + descriptions of video content suitable for playback via a text-to-speech + system for a visually-impaired user. + +

+ + +

+ このオプションを一つの入力ファイルに対して複数回使用でき,毎回異なるトラックIDを指定することで複数のトラックを処理できます。 + +

+ +
--original-flag + TID[:bool] + +

+ Sets the "original language" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track is in the content's + original language (not a translation). + +

+ + +

+ このオプションを一つの入力ファイルに対して複数回使用でき,毎回異なるトラックIDを指定することで複数のトラックを処理できます。 + +

+ +
--commentary-flag + TID[:bool] + +

+ Sets the "commentary" flag for the given track (see section track IDs) if the optional argument + bool is set to 1 or if it isn't + present. This flag can be set if the track contains commentary. + +

+ + +

+ このオプションを一つの入力ファイルに対して複数回使用でき,毎回異なるトラックIDを指定することで複数のトラックを処理できます。 + +

+ +
--track-name TID:name + +

+ 指定したトラックのトラック名をnameにします(トラックIDのセクションも参照)。 + +

+ +
--language TID:language + +

+ 指定したトラックの言語を設定します(トラックIDのセクションも参照)。ISO 639-2 言語コード及び ISO + 639-1 国別コードが使用できます。国別コードは言語コードへ自動的に変換されます。ISO 639-2 に含まれる全てのコードは--list-languagesオプションで一覧できます。 + +

+ + +

+ このオプションを一つの入力ファイルに対して複数回使用でき,毎回異なるトラックIDを指定することで複数のトラックを処理できます。 + +

+ +
-t, --tags + TID:file-name + +

+ file-nameで指定したファイルから広域標識を読み込みます。詳細は標識のセクションを参照してください。 + +

+ +
--aac-is-sbr + TID[:0|1] + +

+ mkvmerge(1)にIDがTIDのトラックがSBR AAC + (別名HE-AAC又はAAC+)であることを教えます。このオプションは、 a) + ソースファイルが(Matroska(tm)ファイルではなく)AACファイルでありかつ + b) AACファイルがSBR + AACデータを含む場合に必要です。このスイッチが存在する理由は、通常のAACファイルとSBR + AACファイルを自動的に区別することは、AACこまを完全にデコードしなければ技術的に不可能であるためです。AACはいくつかの特許問題を抱えているため、mkvmerge(1)は将来的にもこのデコードステージを含むことはありません。よって、SBR + AACにはこのスイッチが必須となります。このスイッチが指定されなかった場合、出力ファイルは正常に再生ができなくなるか、完全に再生不能になるでしょう。 + +

+ + +

+ ソースファイルがMatroska(tm)ファイルの場合、CodecIDによりSBR + AACを検知できます。しかし、CodecIDが不正な場合、このスイッチで修正することができます。 + +

+ + +

+ もし、mkvmergeがAACファイルを間違ってSBRと認識してしまった場合、トラックIDに':0'を指定できます。 + +

+ +
--audio-emphasis TID:n|symbolic-name + +

+ Sets the emphasis for the audio track with the track ID + TID. The mode can either be a number + n (certain values between 0 and + 16) or a symbolic name. All valid numbers & + symbolic names can be listed with the --list-audio-emphasis + option. + +

+ +
--reduce-to-core TID + +

+ Some audio codecs have a lossy core and optional extensions that implement + lossless decoding. This option tells mkvmerge(1) to only copy the core but + not the extensions. By default mkvmerge(1) copies both the core and the + extensions. + +

+ + +

+ Currently only DTS tracks are affected by this + option. TrueHD tracks that contain an embedded AC-3 core + are instead presented as two separate tracks for which the user can select + which track to copy. For DTS such a scheme would not work + as the HD extensions cannot be decoded by themselves – unlike the TrueHD + data. + +

+ +
--remove-dialog-normalization-gain + TID + +

+ Some audio codecs contain header fields that tell the decoder or player to + apply a (usually negative) gain for dialog normalization. This option tells + mkvmerge(1) to remove or minimize that gain by modifying the corresponding + header fields. + +

+ + +

+ Currently only AC-3, DTS and + TrueHD tracks are affected by this option. + +

+ +
--timestamps TID:file-name + +

+ 指定したトラックIDの時刻印を、file-nameから読み込みます。これらの時刻印はmkvmerge(1)が通常計算する時刻印を強制的に上書きします。外部時刻印ファイルのセクションを参照してください。 + +

+ +
--default-duration TID:x + +

+ 指定したトラックの default duration を強制的に設定します。トラックのトラックの時刻印も、 default duration + に合うように変更されます。引数xは's'、'ms'、'us'、'ns'、'fps'、p'。'iのうちどれか一つを後置されていなければなりません。それぞれ、 + default duration + は秒、ミリ秒、マイクロ秒、ナノ秒、'fps'、1秒あたりのプログレッシブこま、1秒あたりのインターレスのこま数単位で指定されます。xは小数または分数で指定できます。 + +

+ + +

+ 既定のこま持続時間が指定されなかった場合は、mkvmergeはそのトラックの既定のこま持続時間を、コンテナと、AVC/H.264やMPEG-2のような特定のトラックタイプの場合はエンコードされたビットストリームから取得しようと試みます。 + +

+ + +

+ このオプションは、外部時刻印ファイルを使用せずに映像トラックのFPSを変更するのにも使えます。 + +

+ +
--fix-bitstream-timing-information + TID[:0|1] + +

+ Normally mkvmerge(1) does not change the timing information (frame/field + rate) stored in the video bitstream. With this option that information is + adjusted to match the container timing information. The container timing + information can come from various sources: from the command line (see option + --default-duration), + the source container or derived from the bitstream. + +

+ + +
+

Note:

+ +

This has only been implemented for AVC/H.264 video tracks so far.

+ +
+ +
--compression TID:n + +

+ Selects the compression method to be used for the track. Note that the + player also has to support this method. Valid values are + 'none', 'zlib' and + 'mpeg4_p2'/'mpeg4p2'. + +

+ +

+ 'mpeg4_p2'/'mpeg4p2'圧縮法は、 + MPEG4 part2 映像トラックにのみ適用できる、'header removal'と呼ばれる特殊な圧縮法です。 + +

+ +

+ The default for some subtitle types is 'zlib' + compression. This compression method is also the one that most if not all + playback applications support. Support for other compression methods other + than 'none' is not assured. + +

+ +
+ + + +

2.8. 映像トラックにのみ適用されるオプション

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc + TID:FourCC + +

+ FourCCを指定した値に強制設定します。映像トラックが'MS互換モード'である場合にのみ有効です。 + +

+ +
--display-dimensions + TID:widthxheight + +

+ Matroska(tm)ファイルは再生時の画像スケールを決定するための二つの値を持ちます。表示幅と表示高さです。これらの値をこのオプションで、例えば'1:640x480'のように指定できます。 + +

+ + +

+ これらの値を設定する別の方法として、--aspect-ratio又は--aspect-ratio-factorオプションが使用できます(下記参照)。これらのオプションは互いに排他的です。 + +

+ +
--aspect-ratio + TID:ratio|width/height + +

+ Matroska(tm)ファイルは再生時の画像スケールを決定するための二つの値を持ちます。表示幅と表示高さです。これらの値をこのオプションで、例えば'1:640x480'のように指定できます。このオプションを指定すると、mkvmerge(1)は自動的に表示幅及び表示高さを、画像の元の幅と高さ、そして指定されたアスペクト比から自動的に計算します。アスペクト比は、小数ratioまたは分数'width/height'(例: + '16/9')の形式で指定できます。 + +

+ + +

+ これらの値を設定する別の方法として、--aspect-ratio-factor又は--display-dimensionsオプションが使用できます(上記及び下記参照)。これらのオプションは互いに排他的です。 + +

+ +
--aspect-ratio-factor TID:factor|n/d + +

+ アスペクト比を設定するもうひとつの方法は、元のアスペクト比からの係数を指定する方法です。元のアスペクト比に、factorを乗じたものが新しいアスペクト比として使用されます。 + +

+ + +

+ これらの値を設定する別の方法として、--aspect-ratio又は--display-dimensionsオプションが使用できます(上記参照)。これらのオプションは互いに排他的です。 + +

+ +
--cropping TID:left,top,right,bottom + +

+ 映像トラックのピクセルクロッピングのパラメータを指定した値に設定します。 + +

+ +
--color-matrix-coefficients TID:n + +

+ Sets the matrix coefficients of the video used to derive luma and chroma + values from red, green and blue color primaries. The parameter + n is an integer rangeing from 0 + and 10. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: GBR, 1: BT709, + 2: unspecified, 3: reserved, + 4: FCC, 5: BT470BG, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 non-constant + luminance, 10: BT2020 constant luminance + +

+ +
--color-bits-per-channel TID:n + +

+ Sets the number of coded bits for a color channel. A value of + 0 indicates that the number of bits is unspecified. + +

+ +
--chroma-subsample TID:hori,vert + +

+ The amount of pixels to remove in the Cr and Cb channels for every pixel not + removed horizontally/vertically. + +

+ + +

+ Example: For video with 4:2:0 chroma subsampling, the parameter should be + set to + TID:1,1. + +

+ +
--cb-subsample TID:hori,vert + +

+ The amount of pixels to remove in the Cb channel for every pixel not removed + horizontally/vertically. This is additive with + --chroma-subsample. + +

+ + +

+ Example: For video with 4:2:1 chroma subsampling, the parameter + --chroma-subsample should be set to + TID:1,0 + and Cb-subsample should be set to + TID:1,0. + +

+ +
--chroma-siting TID:hori,vert + +

+ Sets how chroma is sited horizontally/vertically (0: + unspecified, 1: top collocated, 2: + half). + +

+ +
--color-range TID:n + +

+ Sets the clipping of the color ranges (0: unspecified, + 1: broadcast range, 2: full range + (no clipping), 3: defined by + MatrixCoefficients/TransferCharacteristics). + +

+ +
--color-transfer-characteristics + TID:n + +

+ The transfer characteristics of the video. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: gamma 2.2 curve, 5: gamma 2.8 + curve, 6: SMPTE 170M, 7: SMPTE + 240M, 8: linear, 9: log, + 10: log sqrt, 11: IEC 61966-2-4, + 12: ITU-R BT.1361 extended color gamut, + 13: IEC 61966-2-1, 14: ITU-R + BT.2020 10 bit, 15: ITU-R BT.2020 12 bit, + 16: SMPTE ST 2084, 17: SMPTE ST + 428-1; 18: ARIB STD-B67 (HLG) + +

+ +
--color-primaries TID:n + +

+ Sets the color primaries of the video. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: ITU-R BT.470M, 5: ITU-R + BT.470BG, 6: SMPTE 170M, 7: SMPTE + 240M, 8: FILM, 9: ITU-R BT.2020, + 10: SMPTE ST 428-1, 22: JEDEC P22 + phosphors + +

+ +
--max-content-light TID:n + +

+ Sets the maximum brightness of a single pixel (Maximum Content Light Level) + in candelas per square meter (cd/m²). The value of n + should be a non-negtive integer. + +

+ +
--max-frame-light TID:n + +

+ Sets the maximum brightness of a single full frame (Maximum Frame-Average + Light Level) in candelas per square meter (cd/m²). The value of + n should be a non-negtive integer. + +

+ +
--chromaticity-coordinates + TID:red-x,red-y,green-x,green-y,blue-x,blue-y + +

+ Sets the red/green/blue chromaticity coordinates as defined by CIE 1931. + +

+ +
--white-color-coordinates TID:x,y + +

+ Sets the white color chromaticity coordinates as defined by CIE 1931. + +

+ +
--max-luminance TID:float + +

+ Sets the maximum luminance in candelas per square meter (cd/m²). The value + should be less than 9999.99. + +

+ +
--min-luminance TID:float + +

+ Sets the minimum luminance in candelas per square meter (cd/m²). The value + should be less than 999.9999. + +

+ +
--projection-type TID:method + +

+ Sets the video projection method used. Valid values are 0 (rectangular + projection), 1 (equirectangular projection), 2 (cubemap projection) and 3 + (mesh projection). + +

+ +
--projection-private TID:data + +

+ Sets private data that only applies to a specific projection. Data must be + given as hex numbers with or without the "0x" prefix, with or + without spaces. + +

+ +
--projection-pose-yaw TID:float + +

+ Specifies a yaw rotation to the projection. + +

+ +
--projection-pose-pitch TID:float + +

+ Specifies a pitch rotation to the projection. + +

+ +
--projection-pose-roll TID:float + +

+ Specifies a roll rotation to the projection. + +

+ +
--field-order TID:n + +

+ Sets the field order for the video track with the track ID + TID. The order must be one of the following numbers: + +

+ + +

+ 0: progressive; 1: interlaced with + top field displayed first and top field stored first; + 2: undetermined field order; 6: + interlaced with bottom field displayed first and bottom field stored first; + 9: interlaced with bottom field displayed first and top + field stored first; 14: interlaced with top field + displayed first and bottom field stored first + +

+ +
--stereo-mode TID:n|symbolic-name + +

+ Sets the stereo mode for the video track with the track ID + TID. The mode can either be a number + n between 0 and + 14 or a symbolic name. All valid numbers & names + can be listed with the --list-stereo-modes + option. + +

+ +
+ + + +

2.9. 文章字幕トラックにのみ適用されるオプション

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset TID:character-set + +

+ 指定したIDの示すトラックのUTF-8字幕をUTF-8へ変換する際の文字コードを指定します。既定では、現在のロケールの設定が使用されます。mkvmerge(1)の文字コード変換については、文章ファイルと文字コードのセクションを参照してください。 + +

+ + +

+ このオプションを一つの入力ファイルに対して複数回使用でき,毎回異なるトラックIDを指定することで複数のトラックを処理できます。 + +

+ +
+ + + +

2.10. その他のオプション

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify + file-name + +

+ mkvmerge(1)に、単一のファイルを探査してその種類と、ファイルに含まれるトラック及びそのトラックIDを表示させます。このオプションを指定した場合、他に指定できるのはファイル名のみです。 + +

+ + +

The output format used for the result can be changed with the option --identification-format. +

+ +
-J file-name + +

+ This is a convenient alias for "--identification-format json + --identify file-name". + +

+ +
-F, --identification-format + 形式 + +

+ --identify + オプションが用いる出力形式を定めます。次の形式に対応しています: + text(このオプションが指定されなかった場合の既定)とjson。 + +

+ + +
    + +
  1. + +

    text形式は短かく,人間にとって読みやすいです。見付かった項目(コンテナ,トラック,添付ファイル等)ごとの行で構成されます。 +

    + + +

    この形式は解析を意図していません。出力はmkvmerge(1)が用いる言語に翻訳されます(--ui-languageもご覧ください)。 +

    + +
  2. + + +
  3. + +

    + json形式は機械可読なJSON表現を出力します。この形式は次述の記事で説明しているJSON模式に準じています: + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + JSON模式の全版はWeb上でも公開版ソースコード書庫でも利用できます。 + +

    + +
  4. + +
+ +
--probe-range-percentage 度合い + +

+ MPEGプログラムや転送流 (.vob, .m2ts) + といったファイル種別においては,ファイルに含まれる全てのトラックを検出する為に一定量の情報を解析する必要が生じます。解析量は原ファイルの0.3%か10MBか大きい方です。 + +

+ + +

+ トラックの存在を認識しているのに見付けられなかった場合は,このオプションを用いて探測の度合いを変更することができます。最低値10MBは組み込まれており変更することはできません。 + +

+ +
--list-audio-emphasis + +

+ Lists all valid numbers & their corresponding symbolic names for the + --audio-emphasis + option. + +

+ +
--list-languages + +

+ --languageオプションに指定できる言語とそのISO + 639-2コードを一覧します。 + +

+ +
--list-stereo-modes + +

+ Lists all valid numbers & their corresponding symbolic names for the + --stereo-mode + option. + +

+ +
-l, --list-types + +

+ 対応している入力ファイル種別を列挙します。 + +

+ +
--priority 優先度 + +

+ mkvmerge(1)を実行する際のプロセス優先度を指定します。有効な値は'lowest'、'lower'、'normal'、'higher'、および + 'highest'です。指定されない場合、'normal'が使用されます。Unix系の機構では、mkvmerge(1)はnice(2)関数を使用するので、'higher' + 及び + 'highest'は特権利用者のみが指定できます。Windowsでは全ての利用者が優先度を自由に指定できます。 + +

+ + +

'lowest' を選択することはまた,mkvmerge(1)のプロセス優先度に加えて入出力優先度も最低にします。 +

+ +
--command-line-charset 文字集合 + +

+ 出力される文字列を変換するのに用いる文字集合を設定します。既定では機構の現行地域特性で指定している文字集合になります。この設定は次のオプションの引数に適用されます: + --title--track-name、および--attachment-description。 + +

+ +
--output-charset 文字集合 + +

+ 出力される文字列を変換するのに用いる文字集合を設定します。既定では機構の現行地域特性で指定している文字集合になります。 + +

+ +
-r, + --redirect-outputファイル名 + +

+ 全ての通報を操作卓にではなくファイル名のファイルに書き出します。出力を転送することで同じことが簡単にできるものの、このオプションが必要な場合は存在します:ファイルに転送する前に端末が出力を再解釈してしまう場合です。--output-charsetで設定した文字集合を優先します。 + +

+ +
--flush-on-close + +

+ 書き込み用に開いたファイルを閉じる際に、プログラムが主記憶上に貯まった全データを補助記憶に排出 (flush) + するようにします。停電時のデータ損失を防いだり、運用機構や機器特有の問題を避ける目的で使えるでしょう。欠点として、mkvmergeが終了前に全データを補助記憶に書き込み終わるまで待機するせいで多重化に長い時間を要します。MKVToolNixの不具合追跡局の議題2469号および2480号に、この挙動の長短について詳細な議論があります。 + +

+ +
--ui-language 符号 + +

+ 用いる翻訳を指定した言語符号のものに強制します(例えば「de_DE」ならドイツ語翻訳です)。符号に「list」を指定すると利用可能な翻訳の一覧を出力します。 + +

+ +
--abort-on-warnings + +

+ 警告が発された後、プログラムが停止するようにします。プログラムの終了番号は1になります。 + +

+ +
--deterministic 初期種 + +

+ 同一の原ファイルを,同一のオプション群で,同一の初期種と共にmkvmerge(1)を実行した場合に,バイト単位で同一のファイルを生成できるようにします。注意: + "data" 区分情報欄はこのモードでは書き出されません。 + +

+ + +

初期種は任意の文字列で,数値であってはなりません。

+ + +

+ 結果ファイルのバイト同一性が保証されるのは次述の条件下に限ります: + +

+ + +
    + +
  1. + +

    同一版のmkvmerge(1)であり,使用してるlibEBMLとlibMatroskaも同一版である。 +

    + +
  2. + + +
  3. + +

    原ファイルはバイト単位で同一である。

    + +
  4. + + +
  5. + +

    同一の命令行オプションが同一の順序で用いられている(注意: --output ...は例外です)。 +

    + +
  6. + +
+ + +

+ 違う版のmkvmerge(1)や,異なる命令行オプションを使用していても結果としてファイルがバイト同一である場合があるますが,保証外です。 + +

+ +
--debug 機能 + +

+ 指定した機能の診断出力を有効にします。このオプションは開発者にとってのみ有用です。 + +

+ +
--engage 機能 + +

+ 実験的機能を有効にします。mkvmerge --engage + listとすると利用可能な機能の一覧が得られます。これらの機能は通常状況での使用を意図されていません。 + +

+ +
--gui-mode + +

+ GUIモードに切り替えます。このモードではGUI操作の状況を伝える特殊な形式の行が出力されます。これらの通報は + '#GUI#通報内容' + という形式の後に続きます。'#GUI#通報内容#予約語1=値1#予約語2=値2...' + というように予約語・値の組が通報内容に続くことがあります。通知内容や予約語は翻訳されることなく常に英語で出力されます。 + +

+ +
@オプションファイル.json + +

+ ファイルoptions-fileから追加の命令行引数を読み込みます。詳細はオプションファイルのセクションを参照してください。 + +

+ +
--capabilities + +

+ 翻訳時に組込まれた追加機能を一覧して終了します。出力の一行目は版情報になります。以降の全ての行はちょううど一語だけから成り,その機能が組込まれていることを示します。機能は: + +

+ + +
    + +
  • + +

    + 'FLAC' -- 生FLACファイルの読み込みおよび他コンテナ(例: + Ogg(tm)またはMatroska(tm))にあるFLACトラックの取り扱い。 + +

    + +
  • + +
+ +
-h, --help + +

+ 使用法情報を出力して終了します。 + +

+ +
-V, --version + +

+ 版次情報を出力して終了します。 + +

+ +
+ + +

3. 使用法

+ + +

+ 各ファイルについて、利用者はmkvmerge(1)が取り出すべきトラックを選択できます。取り出されたトラックは、すべて-oで指定されたファイルに書き出されます。既知の(サポート済の)入力ファイル形式は-lオプションで取得できます。 + +

+ + +
+

Important:

+ +

+ 命令行オプションの順序は重要です。もしもプログラム初心者なら、「オプション順序」節を読んでください。 + +

+ +
+ +

4. オプション順序

+ + + +

+ いくつかのオプションでは、入力の順番が重要です。オプションは二種類に大別されます: + +

+ + +
    + +
  1. + +

    + プログラム全体に影響し、どの入力ファイルにも関連付けられていないオプション。--command-line-charset--output--titleなどが該当しますが,これらに限りません。これらのオプションは命令行のどこに書いても構いません。 + +

    + +
  2. + + +
  3. + +

    + 1つの入力ファイルのみ、もしくは入力ファイル中の1つのトラックのみに影響するオプション。これらのオプションは全て、命令行でその後ろに続く入力ファイルに適用されます。同じ入力ファイル(または同じ入力ファイル中のトラック)に適用される全てのオプションは、その入力ファイルのファイル名の前に書きさえすれば、どんな順番でも構いません。1つの入力ファイルに適用されるオプションの例を挙げると、--no-chapters--chapter-charsetなどがあります。1つのトラックのみに適用されるオプションには、例えば--default-duration--languageがあります。 + +

    + +
  4. + +
+ + +

+ オプションは左から右へと処理されます。もし同じスコープ内に1つのオプションが2回以上出てきた場合には、最後のものが使われます。よって、次の例ではタイトルは"Something + else"に設定されます。 + +

+ +
$ mkvmerge -o output.mkv --title 'This and that' input.avi --title 'Something else'
+ +

+ 次の例は、違うスコープ内で使われているので--languageオプションを2回使ってもよいということを示しています。それらは同じトラックIDに適用されますが、違う入力ファイルに適用されるので違うスコープを持っているのです。 + +

+ +
$ mkvmerge -o output.mkv --language 0:fre français.ogg --language 0:deu deutsch.ogg
+

5. 例

+ + +

+ あなたは、 MyMovie.avi というファイルを持っていて、また音声トラックが別の、例えば + 'MyMovie.wav'というファイルに入っているとします。あなたは、まず音声をOggVorbis(tm)でエンコードしたいと思います。 + +

+ +
$ oggenc -q4 -oMyMovie.ogg MyMovie.wav
+ +

+ 数分後、映像と音声を結合できます。 + +

+ +
$ mkvmerge -o MyMovie-with-sound.mkv MyMovie.avi MyMovie.ogg
+ +

+ AVIファイルが既に音声トラックを持っていた場合(そしてmkvmerge(1)がその形式に対応していた場合),そのトラックも複製されます。これを避けるには、下のようにしてください。 + +

+ +
$ mkvmerge -o MyMovie-with-sound.mkv -A MyMovie.avi MyMovie.ogg
+ +

+ ちょっと考えて、あなたはもうひとつの音声トラック(例えば音声コメンタリや吹替えなど)を'MyMovie-add-audio.wavにリッピングしました。再びエンコードして、新しいファイルにまとめます。 + +

+ +
$ oggenc -q4 -oMyMovie-add-audio.ogg MyMovie-add-audio.wav
+$ mkvmerge -o MM-complete.mkv MyMovie-with-sound.mkv MyMovie-add-audio.ogg
+ +

+ 同じことは、次のようにしても可能です。 + +

+ +
$ mkvmerge -o MM-complete.mkv -A MyMovie.avi MyMovie.ogg MyMovie-add-audio.ogg
+ +

+ あとはmplayer(tm)を立ち上げて動画を楽しむだけです。もし、複数の音声トラック(もしかすると映像トラックも)がある場合は、再生するトラックを'-vid'と'-aid'オプションでmplayer(tm)に指定できます。ゼロベースで、映像と音声の区別をしないIDを指定します。 + +

+ + +

+ もし、音声トラックの同期をとる必要がある場合も、簡単にとることができます。まず、次のようにしてVorbisトラックのトラックIDを取得します。 + +

+ +
$ mkvmerge --identify outofsync.ogg
+ +

+ 次に、このIDを使って、次のような命令行を実行します。 + +

+ +
$ mkvmerge -o goodsync.mkv -A source.avi -y 12345:200 outofsync.ogg
+ +

+ 上のようにすると、'outofsync.ogg'に入っている、IDが + 12345 の音声トラックの最初に200msの無音を挿入します。 + +

+ + +

+ 最初は同期がとれているのにだんだんとずれていく動画もあります。このような動画には、全ての時刻印に適用される遅れ係数を指定することができます。データは追加も削除もされないので、あまり大きな、またはあまりに小さな係数を指定するとまずい結果になるでしょう。例として、私が変換したある動画は、全長が77340こまで、最終的に0.2秒ずれていました。29.97fpsでは、0.2は約6こまに相当します。よって、私は次のような命令を実行しました。 + +

+ +
$ mkvmerge -o goodsync.mkv -y 23456:0,77346/77340 outofsync.mkv
+ +

+ 結果は良好でした。 + +

+ + +

+ 同期オプションは字幕にも同様に使用できます。 + +

+ + +

+ 文章字幕を生成するには、SubRipper(tm)のようなWindowsソフトウェアを使用するか、transcode(1)のソースコードの、contrib/subrip'ディレクトリの中にあるsubrip(tm)パッケージが使用できます。一般的なプロセスは以下の通りです。 + +

+ + +
    + +
  1. + +

    ソースから生字幕流を抽出:

    +
    $ tccat -i /path/to/copied/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o mymovie
    +
  2. + + +
  3. + +

    出力されたPGMイメージをgocrで文章化:

    +
    $ pgm2txt mymovie
    +
  4. + + +
  5. + +

    出力された文書ファイルを校正:

    +
    $ ispell -d american *txt
    +
  6. + + +
  7. + +

    文章ファイルをSRTファイルに変換:

    +
    $ srttool -s -w -i mymovie.srtx -o mymovie.srt
    +
  8. + +
+ + +

+ 出力されたファイルをmkvmerge(1)の入力ファイルとして使用する: + +

+ +
$ mkvmerge -o mymovie.mkv mymovie.avi mymovie.srt
+ +

+ もし、あるトラックに言語コードを指定したいならば、簡単に指定できます。まず、指定する言語のISO + 639-2コードを調べます。次のようにすればmkvmerge(1)に全ての言語コードを一覧表示させることができます。 + +

+ +
$ mkvmerge --list-languages
+ +

+ 必要な言語をリストの中から探してください。Matroska(tm)ファイルの中に、二つの音声トラックがあり、トラックIDは2と3だとします。この二つに言語コードを指定するには、次のようにします。 + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut without-lang-codes.mkv
+ +

+ このように、--languageスイッチを複数回使うことができます。 + +

+ + +

+ プレイヤーに既定でオランダ語を再生させたいときもあるでしょう。さらに、例えば英語とフランス語の字幕があって、フランス語を既定で再生させたいと仮定します。これは、次のようにすれば可能です。 + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut --default-track-flag 3 without-lang-codes.mkv --language 0:eng english.srt --default-track-flag 0 --language 0:fre french.srt
+ +

+ もし、指定したはずの言語や既定フラグがmkvinfo(1)の出力に見当たらない場合は、既定値のセクションを参照してください。 + +

+ + +

+ 入力ファイルの圧縮をオフにします。 + +

+ +
$ mkvmerge -o no-compression.mkv --compression -1:none MyMovie.avi --compression -1:none mymovie.srt
+ +

6. トラックID

+ + + +

6.1. Regular track IDs

+ + + +

+ mkvmerge(1)のオプションの中には、どのトラックに適用するかを特定するために、トラックIDを指定する必要なものがあります。このトラックIDは、入力ファイルがdemuxされる際に表示されるほか、mkvmerge(1)に--identifyオプションを指定して表示させることもできます。この場合の出力は次のようになります。 + +

+ +
$ mkvmerge -i v.mkv
+File 'v.mkv': container: Matroska
+Track ID 0: video (V_MS/VFW/FOURCC, DIV3)
+Track ID 1: audio (A_MPEG/L3)
+ +

+ 出力されるMKVファイルの中に配置されるトラックに割り当てられるトラックIDと、入力ファイルのトラックIDを混同しないでください。これらの値が必要なオプションに使われるのは、入力ファイルのトラックIDだけです。 + +

+ + +

+ また、各入力ファイルは、それ固有のトラックIDの組を持っていることにも注意してください。従って、'mkvmerge + --identify'で報告される'file1.ext'のトラックIDは、他にいくつ入力ファイルがあっても、また、'file1.ext'がどの位置で使われようとも、変わることはありません。 + +

+ + +

+ トラックIDは次のように割り当てられます: + +

+ + +
    + +
  • + +

    + AVIファイル: 映像トラックのIDは0になります。音声トラックのIDは1から昇順に割り当てられます。 + +

    + +
  • + + +
  • + +

    + AACAC-3MP3SRT、及びWAVファイル: + ファイル中の唯一のトラックがID 0 を割り当てられます。 + +

    + +
  • + + +
  • + +

    + その他の殆どのファイル:トラックIDは、トラックがファイル中で見つかった順番に0から割り当てられます。 + +

    + +
  • + +
+ + +

+ トラックIDを使用するオプションの説明には、'TID'が含まれています。また、--audio-tracks--video-tracks--subtitle-tracks--button-tracks及び--track-tagsオプションもトラックIDを使用します。 + +

+ + + +

6.2. 特殊トラックID

+ + + +

+ 識別出力には表われない、特別な意味を持つIDが幾つかあります。 + +

+ + +

+ 特殊トラックID '-1' は全称的で,指定した切替を入力ファイルから読み込まれる全てのトラックに適用します。 + +

+ + +

+ 特殊トラックID '-2' + は原ファイル中の楽曲を指し示します。現在,--syncオプションのみがこの特殊IDを用いています。--sync + -2:...の替わりに,オプション--chapter-sync ...を使うことができます。 + +

+ + +

7. Language handling

+ + + +

+ Matroska(tm) has support for two different types of language elements: the + old, deprecated "Language" element containing ISO 639-2 alpha 3 codes and + the new "LanguageIETF" tags containing IETF BCP 47 language tags. All of + mkvmerge(1)'s options that accept a language accept a BCP 47 language + tag. mkvmerge(1) will derive the value for the deprecated "Language" element + from the BCP 47 language tags wherever possible. + +

+ + +

+ When identifying a file in JSON mode, existing "LanguageIETF" track header + elements will be output as the language_ietf track + property. + +

+ + +

+ When writing a file mkvmerge(1) will always write the "LanguageIETF", + "ChapLanguageIETF" and "TagLanguageIETF" elements (the latter two only if + chapters or tags are written respectively). In addition to those elements + the corresponding old elements will be written; they'll be set to the ISO + 639-2 code portion of the BCP 47 language tag. For example, when the track + language is set to sr-Cyrl-RS "LanguageIETF" will be set + to sr-Cyrl-RS and the old "Language" element will be set + to srp. + +

+ + +

+ When reading existing files (Matroska files, XML chapter or tag files etc.) + that already contain "…LanguageIETF" elements the existing elements will be + kept. Otherwise "…LanguageIETF" elements will be added based on command-line + options and other existing deprecated "…Language" elements. + +

+ + +

+ The creation of the new elements can be disabled completely with the + command-line option --disable-language-ietf which operates + on all three new elements. + +

+ + +

+ You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. + +

+ +

8. 文章ファイルと文字集合変換

+ + +
+

Note:

+ +

+ この節の事柄は,mkvmerge(1)にのみ言及している場合でも,MKVToolNixの全てのプログラムに当て嵌まります。 + +

+ +
+ + +

8.1. はじめに

+ + +

+ Matroska(tm)ファイルに格納されている文章の文字コードは全てUTF-8です。よって、mkvmerge(1)が文章ファイルを読み込む際には全てをUTF-8に文字コード変換する必要があります。代わりに、mkvmerge(1)が例えば--ui-languageによって非英語翻訳が使用される際や、Matroska(tm)ファイルに格納されていた文章を出力する際には、UTF-8から指定された文字コードに変換すればよいということになります。 + +

+ + +

+ mkvmerge(1)はこの変換をバイト・オーダー・マーク(BOM)の有無、又はシステムのロケールに基づいて自動的に行ないます。ロケールからどのように文字コードが推測されるかは、mkvmerge(1)を実行するシステムに依存します。 + +

+ + + +

8.2. バイト順記号 (BOM)

+ + + +

+ BOMで始まる文章ファイルは、既にUTFエンコーディングの一種でエンコードされています。mkvmerge(1)はUTF-8、UTF-16リトルエンディアン及びビッグエンディアン、UTF-32リトルエンディアン及びビッグエンディアンの五つのモードをサポートします。BOMで始まる文章ファイルは自動的にUTF-8に変換されます。この場合、文章ファイルの文字コードを指定するパラメータ(例: + --sub-charset)は全て黙殺されます。 + +

+ + + +

8.3. Linux、及びmacOSを含むUnix系システム

+ + + +

+ UNIX系システム上では、mkvmerge(1)はsetlocale(3)システムコールを使うので、LANGLC_ALL及びLC_CYPE環境変数を使用します。大抵は、UTF-8かISO-8859-*ファミリのどれかが全ての文章ファイルと命令行文字列の処理、及びコンソールへの出力の文字コードとして使用されます。 + +

+ + + +

8.4. Windows

+ + + +

+ Windowsにおいては、文章ファイルを変換するのに用いられる既定の文字コードはシステム呼出しGetACP()を呼び出すことで決定されます。 + +

+ + +

+ Reading the command line is done with the + GetCommandLineW() function which already returns a + Unicode string. Therefore the option --command-line-charset + is ignored on Windows. + +

+ + +

+ Output to the console consists of three scenarios: + +

+ + +
    + +
  1. + +

    + If the output is redirected with the option --redirect-output + then the default charset is UTF-8. This can be changed with --output-charset. + +

    + +
  2. + + +
  3. + +

    + If the output is redirected with cmd.exe itself, + e.g. with mkvinfo file.mkv > info.txt, then the + charset is always UTF-8 and cannot be changed. + +

    + +
  4. + + +
  5. + +

    + Otherwise (when writing directly to the console) the Windows function + WriteConsoleW() is used and the option --output-charset + is ignored. The console should be able to output all Unicode characters for + which the corresponding language support is installed (e.g. Chinese + characters might not be displayed on English Windows versions). + +

    + +
  6. + +
+ + + +

8.5. Command line options

+ + + +

+ 次のような文字コードを指定するオプションがあります。 + +

+ + +
    + +
  • + +

    + --sub-charsetは、文章字幕ファイルの文字コードと、他のコンテナに格納された文章字幕トラックの文字コードが曖昧さなく決定できない場合(例: + Oggファイル)の文字コードを指定します。 + +

    + +
  • + + +
  • + +

    + --chapter-charsetは、楽章文章ファイルの文字コードと、他のコンテナ形式に格納されている楽章及びタイトルの文字コードを曖昧さなく決定できない場合(例: + Oggファイルの楽章情報、トラックとファイルのタイトル等、及びMP4ファイルの楽章情報)の文字コードを指定します。 + +

    + +
  • + + +
  • + +

    + --command-line-charsetは全ての命令行文字列の文字コードを指定します。 + +

    + +
  • + + +
  • + +

    + --output-charset + for all strings written to the console or to a file if the output has been + redirected with the --redirect-output + option. On non-Windows systems the default for the output charset is the + system's current charset. On Windows it defaults to UTF-8 both for + redirecting with --redirect-output + and with cmd.exe itself, e.g. mkvinfo file.mkv + > info.txt. + +

    + +
  • + +
+ + +

9. オプションファイル:

+ + + +

+ オプションファイルとは、mkvmerge(1)が追加の命令行の引数をそれから読み込むことができるものです。これは、命令行の長さ制限等の、外部プログラムを実行する際のシェルやオペレーティングシステムの特定の制限を回避するために使用することができます。 + +

+ + +

+ An option file contains JSON-formatted data. Its content must be a valid + JSON array consisting solely of JSON strings. The file's encoding must be + UTF-8. The file should not start with a byte order marker + (BOM), but if one exists, it will be skipped. + +

+ + +

+ The rules for escaping special characters inside JSON are the ones in the + official JSON specification, RFC 7159. + +

+ + +

+ The option file's name itself must be specified as a command line argument + prefixed with a '@' character. + +

+ + +

+ The command line 'mkvmerge -o "my file.mkv" -A "a movie.avi" + sound.ogg' could be converted into the following JSON option file + called e.g. 'options.json': + +

+ +
[
+  "-o",
+  "c:\\Matroska\\my file.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "a movie.avi",
+  "sound.ogg"
+]
+ +

+ The corresponding command would then be 'mkvmerge + @options.json'. + +

+ +

10. ファイル紐付け

+ + +

+ Matroska(tm)はファイル紐付けをサポートします。ファイル紐付けとは、単純に現在のファイルの前の、又は次のファイルを指定する機能です。正確に言うと、本当に紐付けされるのはファイルではなくMatroska(tm)セグメントです。ほとんどのファイルはMatroska(tm)セグメントを一つしか持たないので、以降の説明ではより正確な'セグメント紐付け'という用語ではなく、'ファイル紐付け'という用語を使用します。 + +

+ + +

+ 各セグメントはユニークな128-bit幅のセグメントUIDを持ちます。このUIDはmkvmerge(1)が自動的に生成します。紐付けは基本的にセグメントUID(略してSID)を頭部情報の中に挿入することで行われます。mkvinfo(1)はこのSIDを、存在する場合は表示します。 + +

+ + +

+ もしひとつのファイルがいくつかの小さなファイルに分割されて紐付けされる場合、時刻印は0から始まらず、前のファイルの続きから始まります。この方式では、前のファイルが無い場合も絶対時間が保たれます(例: + ストリーミングを使用している際)。もし、紐付けが使用されない場合、時刻印は各ファイルで0から始まります。既定ではmkvmerge(1)はファイル紐付けを使用しません。ファイル紐付けを使用したい場合は、--linkオプションを使用する必要があります。このオプションはファイル分割が有効な場合以外には無効です。 + +

+ + +

+ ファイル分割が有効か無効かに関わらず、利用者はmkvmerge(1)に、生成したファイルを特定のSIDに紐付けすることができます。これは--link-to-previousオプションと--link-to-nextオプションにより可能です。これらのオプションはmkvinfo(1)が出力する形式(16個の0x00から0xffまでの、'0x'を頭につけた16進数)のSIDを受け付けます(例: + '0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 0x5e 0xca + 0xb3 + 0x93')。もしくは短い形式('0x'及び数字の間のスペースを省いた0x00から0xffまでの16進数の数字)を指定することもできます。例: + '41da7366d9cfb21eae78ebb45ecab393' + +

+ + +

+ もしファイル分割が有効の場合、最初のファイルが--link-to-previousオプションで指定したSIDに紐付けされ、最後のファイルが--link-to-nextオプションで指定したSIDに紐付けされます。ファイル分割が無効の場合、一つの出力ファイルが両方のSIDに紐付けされます。 + +

+ +

11. 既定値

+ + +

+ Matroska(tm)ファイルの仕様には、既定値を持つ要素の存在が明記されています。通常、既定値と等しい値をもつ要素はファイルサイズを抑えるためファイルに書き込まれません。mkvinfo(1)では表示されないかもしれない要素は、言語既定トラックフラグ要素です。言語要素の既定値は英語('eng')で、既定トラックフラグ要素の既定値はtrueです。よって、あるトラックに--language: + 0:engを指定した場合には、mkvinfo(1)の出力には現れません。 + +

+ +

12. 添付ファイル

+ + +

+ Matroska(tm)ファイルに写真を入れておきたいということや、非常に稀でしょうがSSA字幕を使っていてTrueType(tm)フォントを使用したいということがあるかもしれません。このような場合には、Matroska(tm)ファイルにファイルを添付することができます。添付されるファイルはMatroska(tm)ファイルにただ単純に追加されるのではなく、埋め込まれます。よって、プレイヤーはこれらのファイルを表示したり(写真の場合)、字幕を描画するのに使用したり(フォントの場合)できます。 + +

+ + +

+ 下に、出力ファイルに写真とTrueType(tm)フォントを添付する方法の例を示します。 + +

+ +
$ mkvmerge -o output.mkv -A video.avi sound.ogg \
+  --attachment-description "Me and the band behind the stage in a small get-together" \
+  --attachment-mime-type image/jpeg \
+  --attach-file me_and_the_band.jpg \
+  --attachment-description "The real rare and unbelievably good looking font" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file really_cool_font.ttf
+ +

+ 添付ファイルつきのMatroska(tm)ファイルが入力ファイルとして使われた場合、mkvmerge(1)はその添付ファイルを新しいファイルに複製します。添付ファイルの複製するか否かは,--attachments及び--no-attachmentsオプションを使って切り替えることができます。 + +

+ +

13. 楽章

+ + +

+ Matroska(tm)楽章システムは、OGMファイルで使用されていた従来のシステムより強力です。その仕様の全ては、Matroskaのウェブサイトに記されています。 + +

+ + +

+ mkvmerge(1)は2種類の楽章ファイルを入力としてサポートしています。一つ目は'シンプル楽章ファイル'と呼ばれるもので、OGM + toolsが想定しているものと同じ形式です。二つ目はXMLベースの楽章形式で、Matroska(tm)の楽章機能の全てをサポートしています。 + +

+ + +

+ Apart from dedicated chapter files mkvmerge(1) can also read chapters from + other file formats (e.g. MP4, Ogg, Blu-rays or DVDs). + +

+ + +

13.1. シンプル楽章形式

+ + + +

+ この形式は、'CHAPTERxx='で始まる行と'ChapterxxNAME='で始まる行のペアから成ります。前者の行は開始時刻印を含み、後者はタイトルを含みます。下に例を示します。 + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=Intro
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=Baby prepares to rock
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=Baby rocks the house
+ +

+ mkvmerge(1) will transform every pair or lines into one Matroska(tm) + ChapterAtom. It does not set any + ChapterTrackNumber which means that all chapters + apply to all tracks in the file. + +

+ + +

+ このときに文章ファイルの文字コードが必要になります。mkvmerge(1)の文字コード変換については文章ファイルと文字コードのセクションを参照してください。 + +

+ + + +

13.2. XML楽章形式

+ + +

+ XML楽章形式の例を以下に示します。 + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>A short chapter</ChapterString>
+        <ChapterLanguage>eng</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>A part of that short chapter</ChapterString>
+          <ChapterLanguage>eng</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ この形式では、シンプル楽章形式では不可能な、3つのことが可能です。 + +

+ + +
    + +
  1. +

    楽章の終了時刻印を指定できます。

    +
  2. + +
  3. +

    ネストした楽章を作成できます。

    +
  4. + +
  5. +

    言語及び国を設定できます。

    +
  6. + +
+ + +

+ mkvtoolnixは、テンプ速度となるサンプルファイルと一緒に配布されています。サンプルファイルはdocサブディレクトリの中にあります。 + +

+ + +

+ 以下にサポートされているXML標識、そのデータタイプ、そして適切な場所では、その値の有効な範囲を挙げます: + +

+ +
Chapters (master)
+  EditionEntry (master)
+    EditionUID (unsigned integer, valid range: 1 <= value)
+    EditionFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagDefault (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagOrdered (unsigned integer, valid range: 0 <= value <= 1)
+    ChapterAtom (master)
+      ChapterAtom (master)
+      ChapterUID (unsigned integer, valid range: 1 <= value)
+      ChapterTimeStart (unsigned integer)
+      ChapterTimeEnd (unsigned integer)
+      ChapterFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterFlagEnabled (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterSegmentUID (binary, valid range: 1 <= length in bytes)
+      ChapterSegmentEditionUID (unsigned integer, valid range: 1 <= value)
+      ChapterPhysicalEquiv (unsigned integer)
+      ChapterTrack (master)
+        ChapterTrackNumber (unsigned integer, valid range: 1 <= value)
+      ChapterDisplay (master)
+        ChapterString (UTF-8 string)
+        ChapterLanguage (UTF-8 string)
+        ChapterCountry (UTF-8 string)
+      ChapterProcess (master)
+        ChapterProcessCodecID (unsigned integer)
+        ChapterProcessPrivate (binary)
+        ChapterProcessCommand (master)
+          ChapterProcessTime (unsigned integer)
+          ChapterProcessData (binary)
+ + +

13.3. Reading chapters from Blu-rays

+ + + +

+ mkvmerge(1) can read chapters from unencrypted Blu-rays. For that you can use + the path to one of the MPLS play lists with the + --chapters parameter. + +

+ + +

+ Example: --chapters + /srv/blurays/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. Reading chapters from DVDs

+ + + +

+ When MKVToolNix is compiled with the libdvdread(tm) + library, mkvmerge(1) can read chapters from DVDs. For that you can use the + path to one of the folders or files on the DVD with the + --chapters parameter. As DVDs can contain more than + one title and each title has its own set of chapters, you can append a colon + and the desired title number to the end of the file name argument. The title + number defaults to 1. + +

+ + +

+ Example: --chapters /srv/dvds/BigBuckBunny/VIDEO_TS:2 + +

+ + + +

13.5. 注意

+ + +

+ mkvmerge(1)は出力ファイルを分割する際、楽章も適切に処理します。つまり、分割された各ファイルはそのファイルに関係する楽章のみを含み、時刻印には適切なオフセットがかかります。 + +

+ + +

+ mkvmerge(1)は、--no-chaptersオプションで明示的に無効化されていなければ、Matroska(tm)原ファイルから楽章を複製できます。全ての原ファイル(Matroska(tm)ファイル、Oggファイル、MP4ファイル、楽章文章ファイル)から読み取られた楽章は,通常は結合されず,別々のChapterEditionsが作成されます。楽章の読み取り元が,同じ編次UIDを共有するMatroska(tm)あるいはXMLファイル郡であった場合のみ,楽章は一つのChapterEditionに結合されます。そのような場合以外で結合を行いたい場合は、利用者はまず全ての原ファイルからmkvextract(1)で楽章を抽出し、手動でXMLファイルを結合した後に多重化を行なわなければなりません。 + +

+ + +

14. 標識

+ + + +

14.1. はじめに

+ + + +

+ Matroska(tm)'s tag system is similar to that of other containers: a set of + KEY=VALUE pairs. However, in Matroska(tm) these tags + can also be nested, and both the KEY and the + VALUE are elements of their own. The example file + example-tags-2.xml shows how to use this system. + +

+ + + +

14.2. 標識のスコープ

+ + + +

+ Matroska(tm)標識は自動的にはファイル全体に適用はされません。適用することもできますが、ファイルの異る部分々々に適用することもできます。一つ、もしくは複数のトラック、一つ、もしくは複数の楽章、さらにはその組み合わせにも適用することが可能です。Matroskaの仕様に、このことの詳細が記述されています。 + +

+ + +

+ 重要なことは、標識はTargetsMatroska(tm)標識要素によってトラック及び楽章に紐付けられますが、この際に使用されるUIDはmkvmerge(1)が色々な所で使用するトラックIDではないということです。その代わりに,(Matroska(tm)以外のファイル形式から取得されたトラックの場合は)自動的に計算したUIDあるいは(トラックの原ファイルがMatroska(tm)ファイルの場合は)原ファイルから複製されたUIDが用いられます。そのため,mkvmerge(1)がファイルを読み込む前に,標識ファイルで使用されるUIDはかなり難しくなります。 + +

+ + +

+ mkvmerge(1)はMatroska(tm)ファイルに標識を追加する二つのオプションを認識します。--global-tags--tagsオプションです。この二つの違いは、前者の--global-tagsは、上述のTargets要素を全て取り除くことで、標識がファイル全体に適用されるようにします。後者の--tagsオプションは、mkvmerge(1)が + of the --tagsに指定したTIDの示すトラックに対して自動的に計算したUIDを挿入します。 + +

+ + + +

14.3. 例

+ + +

+ あなたは、AVIから読み込まれる映像トラックに標識をつけたいと仮定しましょう。mkvmerge + --identify + file.aviを実行すると、映像トラックのトラックID(このIDをUIDと混同しないでください!)は0であると教えてくれます。よって、あなたは全てのTargets要素を記入しない標識ファイルを作成し、mkvmerge(1)を以下のように実行します。 + +

+ +
$ mkvmerge -o file.mkv --tags 0:tags.xml file.avi
+ + +

14.4. 標識ファイル形式

+ + +

+ mkvmerge(1)はXMLベースの標識ファイル形式をサポートします。この形式はMatroskaの仕様に非常に近いデザインになっています。MKVToolNixのバイナリ、及びソースディストリビューションはどちらも、既知の標識をただリストしただけの、実際の標識ファイルのテンプ速度として使用できるexample-tags-2.xmlというサンプルファイルを含んでいます。 + +

+ + +

+ 基本的には、以下の様な構成です。 + +

+ + +
    + +
  • +

    最も外側の要素は<Tags>でなければなりません。 +

    +
  • + +
  • + +

    一個の論理標識は<Tag>XML標識の内部に包含されます。 +

    + +
  • + +
  • +

    標識の中身の直前・直後のスペースは無視されます。

    +
  • + +
+ + + +

14.5. データタイプ

+ + +

+ 新しいMatroska(tm)標識システムは、UTF-8文字列とバイナリの二つのデータタイプしか認識しません。前者は標識の名前と<String>要素に使用され、後者は<Binary>要素に使用されます。 + +

+ + +

+ バイナリデータは、そのままではXMLファイルに格納できません。mkvmerge(1)は二つのバイナリデータ格納方法に対応しています。XML要素の中身が「@」で始まる場合、そのあとの文字列をファイル名として解釈し,そのファイルの中身をMatroska(tm)要素に複製します。 + +

+ + +

+ もう一つの方法では、データはBase64エンコードされる必要があります。これは、バイナリデータをASCIIキャラクタの一部だけで表現するためのエンコードで、例えばEメールなどに使用されています。mkvextract(1)は、バイナリ要素をBase64エンコードされたデータとして出力します。 + +

+ + +

+ 古い標識システムは、公式のMatroska(tm)の仕様に示されているように、もっと多くのデータタイプを認識していました。mkvmerge(1)はもはやこのシステムをサポートしないので、それらのタイプについてはここでは説明しません。 + +

+ + + +

14.6. XMLファイル形式で知られている標識

+ + + +

+ 以下にサポートされているXML標識、そのデータタイプ、そして適切な場所では、その値の有効な範囲を挙げます: + +

+ +
Tags (master)
+  Tag (master)
+    Targets (master)
+      TargetTypeValue (unsigned integer)
+      TargetType (UTF-8 string)
+      TrackUID (unsigned integer)
+      EditionUID (unsigned integer)
+      ChapterUID (unsigned integer)
+      AttachmentUID (unsigned integer)
+    Simple (master)
+      Simple (master)
+      Name (UTF-8 string)
+      TagLanguage (UTF-8 string)
+      DefaultLanguage (unsigned integer)
+      String (UTF-8 string)
+      Binary (binary)
+ +

15. セグメント情報

+ + + +

+ 区分情報を、Matroska(tm)ファイルの「区分情報」頭部欄にある特定の値として指定可能なXMLファイルに書き込みます。これらの値は全て他の命令行オプションを介しては設定できません。 + +

+ + +

+ 他の「区分情報」頭部欄は命令行オプションを介して設定できますが、XMLファイルを介してはできません。例えば--title--timestamp-scaleオプションが該当します。 + +

+ + +

+ 他にも命令行オプション経由でもXMLファイル経由でも設定できない要素があります。これらには以下のものが含まれます:DateUTC + (別名"muxing + date")、MuxingAppWritingApp、そしてDurationです。それらは常にmkvmerge(1)自身によって設定されます。 + +

+ + +

+ 以下にサポートされているXML標識、そのデータタイプ、そして適切な場所では、その値の有効な範囲を挙げます: + +

+ +
Info (母体)
+  SegmentUID (バイナリ、妥当な範囲: 16バイト長)
+  SegmentFilename (UTF-8文字列)
+  PreviousSegmentUID (バイナリ、妥当な範囲: 16バイト長)
+  PreviousSegmentFilename (UTF-8文字列)
+  NextSegmentUID (バイナリ、妥当な範囲: 16バイト長)
+  NextSegmentFilename (UTF-8文字列)
+  SegmentFamily (バイナリ、妥当な範囲: 16バイト長)
+  ChapterTranslate (母体)
+    ChapterTranslateEditionUID (符号無し整数)
+    ChapterTranslateCodec (符号無し整数)
+    ChapterTranslateID (バイナリ)
+

16. Matroskaファイル割付け

+ + +

+ Matroska(tm)ファイル割付けは非常に柔軟です。mkvmerge(1)はファイルを事前定義された方法で描画します。結果ファイルはこのようになります: + +

+ + +

+ [EBML頭部] [区分 {高次送り出し#1} [区分情報] [トラック情報] {添付ファイル} {楽章} [群団 1] {群団 2} ... {群団 + n} {演奏指令} {高次送り出し#2} {標識}] + +

+ + +

+ 波括弧でくくられた要素は省略可能で、コンテンツと指定されたオプションに依存します。いくつか注釈があります。 + +

+ + +
    + +
  • + +

    + 高次送り出し要素#1には,少数の水準1要素(添付ファイル、楽章,演奏指令,標識,高次送り出し要素#2)が,実際に存在する場合のみ含まれます。古い版次のmkvmerge(1)では、この高次送り出し要素に群団も挿入していました。そのため、十分な格納領域を確保するために不正確な推測をせざるえず,しばしば失敗していました。現在では、群団のみを高次送り出し要素#2に格納し,高次送り出し要素#1は高次送り出し要素#2を参照します。 + +

    + +
  • + + +
  • + +

    添付ファイル、楽章、及び標識要素はそれらが存在するときにのみ追加されます。

    + +
  • + +
+ + +

+ The shortest possible Matroska(tm) file would look like this: + +

+ + +

+ [EBML頭部] [セグメント [セグメント情報] [トラック情報] [団体1]] + +

+ + +

+ 音声のみのファイルはこのようになるでしょう。 + +

+ +

17. 外部時刻印ファイル

+ + +

+ 利用者は、特定のトラックの時刻印を自分でmkvmerge(1)に指定することができます。これは可変こま速度映像を含むファイルを作成するときや、音声に無音を挿入するときに使用できます。この場合、こまはMatroska(tm)区画を作成する際の単位となります。映像では、これはちょうど1こまとなり、音声ではこれは各音声タイプの1パケットとなります。例えば、AC-3では、これは1536サンプルを含む1パケットとなります。 + +

+ + +

+ 結合されたトラックに時刻印ファイルを指定する場合は、各結合されるトラックチェインの最初の部分にのみ指定してください。例えばv1.avi、v2.aviの二つのファイルを結合し、時刻印を使用したいときの命令行は次のようになります。 + +

+ +
$ mkvmerge ... --timestamps 0:my_timestamps.txt v1.avi +v2.avi
+ +

+ mkvmerge(1)は、4つの形式を認識します。最初の1行は常にバージョン番号を含みます。空行、空白のみを含む行、及び'#'で始まる行は無視されます。 + +

+ + +

17.1. 時刻印ファイル形式 v1

+ + +

+ この形式はバージョン行から始まります。2行目は既定こま速度を宣言します。残りの全ての行は、コンマで区切られた3つの数字を含みます。開始こま(0が最初のこまです)、終了こま、そしてこの範囲で適用されるこま速度です。FPSは、ドット'.'を小数点として持つ小数です。こま範囲は既定FPSが使用されるギャップを含むこともあります。例を下に示します。 + +

+ +
# timestamp format v1
+assume 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. 時刻印ファイル形式 v2

+ + + +

+ この形式では、各行は対応するこまの時刻印を含みます。この時刻印はミリ秒単位の精度で指定しなければなりません。小数を指定することができますが、小数でなくてもかまいません。最低でも、トラックに含まれるこま数と同数の時刻印行を含まなければなりません。このファイル内の時刻印は整列されていなければなりません。例えば、25fpsでは以下のようになります。 + +

+ +
# timestamp format v2
+0
+40
+80
+ + +

17.3. 時刻印ファイル形式 v3

+ + +

+ この形式では、各行は秒単位の持続時間と、省略可能なこま速度を含みます。この二つは両方とも小数を指定できます。もし、こま速度が指定されない場合は既定の値が使用されます。音声では符号器に時刻印を計算させるべきです。このためには、こま速度として0.0を指定してください。また、'gap'キーワードの後に持続時間を指定して、無音を指定することもできます。音声ファイル用の例を示します。 + +

+ +
# timestamp format v3
+assume 0.0
+25.325
+7.530,38.236
+gap, 10.050
+2.000,38.236
+ + +

17.4. 時刻印ファイル形式 v4

+ + +

+ この形式はv2形式と同一です。唯一の違いは、時刻印が整列されていなくてもいいという点です。この形式が使われることはほぼ無いでしょう。 + +

+ + +

18. 終了番号

+ + + +

+ mkvmerge(1)は下の3つの返り値を返します。 + +

+ + +
    + +
  • + +

    + 0 -- この返り値はMUXが正常に終了したことを示します。 + +

    + +
  • + + +
  • + +

    + 1 -- この返り値は、一つ以上の警告が出力されましたが、抽出が続行されたことを意味します。警告は + '警告:' + という文字列を先頭につけて出力されます。出力ファイルが無事であるかどうかは、場合によります。出力ファイルを確認することを強く推奨します。 + +

    + +
  • + + +
  • + +

    + 2 -- + この返り値は、エラーが発生し、エラーメッセージを出力した後にmkvmerge(1)が処理を中断したことを示します。エラーメッセージは不正な命令行やファイルI/Oエラー、壊れたファイルなど様々です。 + +

    + +
  • + +
+ +

19. 環境変数

+ + + +

+ mkvmerge(1)はシステムのロケールを決める既定の変数(例:LANGLC_*系)を使用します。追加の変数は以下の通りです: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG and + its short form MTX_DEBUG + +

その内容は、あたかも--debugオプション経由で渡されたかのように扱われます。 +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE and + its short form MTX_ENGAGE + +

その内容は、あたかも--engageオプション経由で渡されたかのように扱われます。 +

+ +
+ +

20. 関連項目

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. ウェブ

+ + +

+ 最新版は常にMKVToolNixの拠点で入手できます。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..99ac482f00e452ade663a36cf74356ca9d4ac7f2 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvpropedit.html @@ -0,0 +1,1196 @@ + + + + + mkvpropedit -- 再MUXすることなく、既存のMatroskaファイルのプロパティを修正する + + + +
mkvpropedit -- 再MUXすることなく、既存のMatroska(tm)ファイルのプロパティを修正する +
+
+ +
+

1. 書式

+ + +
mkvpropedit options {source-filename} {actions} +
+ +

2. 説明

+ + +

+ このプログラムは、既存のMatroska(tm)ファイルを解析し、そのプロパティのいくつかを修正します。そして、それらの修正を既存のファイルに書き込みます。プロパティの中で変更可能なのは、セグメント情報要素(例えばタイトル)と、トラック頭部(例えば言語コードや'既定トラック'フラグ、トラック名)です。 + +

+ + +

+ オプション: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ 既知の編集可能なプロパティの名前、型(文字列、整数、真偽値等)、短い説明を一覧表示します。その後、プログラムは終了します。よって、source-filenameパラメータを指定する必要はありません。 + +

+ +
-p, --parse-mode + mode + +

+ 解析モードを設定します。「mode」パラメータは「fast」(既定)と「full」のどちらかを指定できます。「fast」モードはファイル全体を解析するのではなく、高次送り出し要素を使って原ファイル内の必要な要素を探します。99%の場合これで十分です。しかし、高次送り出し要素を含まないファイルや破損したファイルに対しては「full」解析モードを指定する必要があるかもしれません。「full」走査には数分かかることがありますが、「fast」走査には数秒しかかかりません。 + +

+ +
+ + +

+ Actions that deal with track and segment info properties: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit selector + +

+ このオプション以降のaddsetdeleteアクションが適用されるMatroska(tm)ファイルセクション(セグメント情報または特定のトラックの頭部)を指定します。このオプションは、複数の要素を修正するために、複数回指定することができます。 + +

+ + +

+ 既定では、mkvpropedit(1)はセグメント情報のセクションを編集します。 + +

+ + +

+ 文法の完全な説明は、編集選択子のセクションを参照してください。 + +

+ +
-a, --add + name=value + +

+ nameで指定された名前のプロパティをvalueで指定した値で追加します。プロパティは、既にその名前のプロパティが存在する場合も追加されます。ほとんどのプロパティは一意的で、複数回追加できないことに注意してください。 + +

+ +
-s, --set + name=value + +

+ 見付けた全ての、プロパティ名がnameであるプロパティの値を、valueに設定します。そのようなプロパティが存在しないときは、プロパティは追加されます。 + +

+ +
-d, --delete name + +

+ 見付けた全ての、プロパティ名がnameであるプロパティを削除します。いくつかのプロパティは必須で、削除できないことに注意してください。 + +

+ +
+ + +

+ Actions that deal with tags and chapters: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags + selector:filename + +

+ ファイル名からの標識を、このファイル中の標識に追加、あるいは置換します。もしファイル名が空白なら、標識を削除します。mkvpropedit(1)は、mkvmerge(1)が読み込むのと同じXML標識形式を読み込みます。 + +

+ + +

+ 選択子は、allglobal、またはtrackのうちどれか一つを指定してください。allを指定すると、mkvpropedit(1)はファイル中の全ての標識を置換あるいは削除します。globalを指定すると、広域標識だけが置換あるいは削除されます。 + +

+ + +

+ trackを指定すると、mkvpropedit(1)は特定のトラックの標識を置換します。また、filenameから読み込まれた標識は、同じトラックに割り当てられます。edit + selectorsが指定されるのと同じ様に(下を参照してください)、トラックは指定されます。(see below), + e.g. --tags track:a1:new-audio-tags.xml. + +

+ +
--add-track-statistics-tags + +

+ Calculates statistics for all tracks in a file and adds new statistics tags + for them. If the file already contains such tags then they'll be updated. + +

+ +
--delete-track-statistics-tags + +

+ Deletes all existing track statistics tags from a file. If the file doesn't + contain track statistics tags then it won't be modified. + +

+ +
-c, --chapters + filename + +

+ ファイル名からの楽章を、このファイル中の標識に追加、あるいは置換します。もしファイル名が空白なら、楽章を削除します。mkvpropedit(1)は、mkvmerge(1)が読み込むのと同じXMLまたはシンプル楽章形式を読み込みます。 + +

+ +
+ + +

+ Actions for handling attachments: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment filename + +

+ Adds a new attachment from filename. + +

+ + +

+ If the option --attachment-name has been used prior to this + option then its value is used as the new attachment's name. Otherwise it is + derived from filename. + +

+ + +

+ If the option --attachment-mime-type has been used prior to + this option then its value is used as the new attachment's MIME + type. Otherwise it is auto-detected from the content of + filename. + +

+ + +

+ If the option --attachment-description has been used prior + to this option then its value is used as the new attachment's + description. Otherwise no description will be set. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is used as the new attachment's UID. Otherwise a + random UID will be generated automatically. + +

+ +
--replace-attachment + selector:filename + +

+ Replaces one or more attachments that match selector + with the file filename. If more than one existing + attachment matches selector then all of their + contents will be replaced by the content of filename. + +

+ + +

+ The selector can have one of four forms. They're + explained below in the section attachment selectors. + +

+ + +

+ If the option --attachment-name has been used prior to this + option then its value is set as the new name for each modified + attachment. Otherwise the names aren't changed. + +

+ + +

+ If the option --attachment-mime-type has been used prior to + this option then its value is set as the new MIME type for each modified + attachment. Otherwise the MIME types aren't changed. + +

+ + +

+ If the option --attachment-description has been used prior + to this option then its value is set as the new description for each + modified attachment. Otherwise the descriptions aren't changed. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is set as the new UID for each modified + attachment. Otherwise the UIDs aren't changed. + +

+ +
--update-attachment selector + +

+ Sets the properties of one or more attachments that match + selector. If more than one existing attachment + matches selector then all of their properties will be + updated. + +

+ + +

+ The selector can have one of four forms. They're + explained below in the section attachment selectors. + +

+ + +

+ If the option --attachment-name has been used prior to this + option then its value is set as the new name for each modified + attachment. Otherwise the names aren't changed. + +

+ + +

+ If the option --attachment-mime-type has been used prior to + this option then its value is set as the new MIME type for each modified + attachment. Otherwise the MIME types aren't changed. + +

+ + +

+ If the option --attachment-description has been used prior + to this option then its value is set as the new description for each + modified attachment. Otherwise the descriptions aren't changed. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is set as the new UID for each modified + attachment. Otherwise the UIDs aren't changed. + +

+ +
--delete-attachment selector + +

+ Deletes one or more attachments that match selector. + +

+ + +

+ The selector can have one of four forms. They're + explained below in the section attachment selectors. + +

+ +
+ + +

+ Options for attachment actions: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name name + +

+ Sets the name to use for the following --add-attachment or + --replace-attachment operation. + +

+ +
--attachment-mime-type mime-type + +

+ Sets the MIME type to use for the following + --add-attachment or --replace-attachment + operation. + +

+ +
--attachment-description description + +

+ Sets the description to use for the following + --add-attachment or --replace-attachment + operation. + +

+ +
--enable-legacy-font-mime-types + +

+ Enables the use of legacy MIME types for certain types of + font attachments. For example, + 'application/x-truetype-font' will be used for TrueType + fonts instead of 'fonts/ttf'. + +

+ + +

+ This affects both adding new attachments and replacing existing attachments, + but only if the new MIME type isn't specified. Other + existing attachments aren't changed. + +

+ + +

+ The affected MIME types are 'font/sfnt', + 'font/ttf' and 'font/collection' which + are all mapped to 'application/x-truetype-fonts' and + 'font/otf' which is mapped to + 'application/vnd.ms-opentype'. + +

+ +
+ + +

+ その他のオプション: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ Normally when the user requests changes to the 'language' + track header property, mkvpropedit(1) will apply the same change to the new + LanguageIETF track header element in addition to the + legacy Language element. If this option is used, the + change is only applied to the legacy Language + element. + +

+ + +

+ This option does not affect changes requested via the + 'language-ietf' track header property. + +

+ +
--normalize-language-ietf mode + +

+ Enables normalizing all IETF BCP 47 language tags to either their canonical + form with mode 'canonical', to their extended language + subtags form with mode 'extlang' or turns it off with + mode 'off'. By default normalization to the canonical + form is applied. + +

+ + +

+ In the canonical form all subtags for which preferred values exist are + replaced by those preferred values. This converts + e.g. 'zh-yue-jyutping' to + 'yue-jyutping' or 'fr-FX' to + 'fr-FR'. + +

+ + +

+ For the extended language subtags form the canonical form is built + first. Afterwards all primary languages for which an extended language + subtag exists are replaced by that extended language subtag and its + prefix. This converts e.g. 'yue-jyutping' back to + 'zh-yue-jyutping' but has no effect on + 'fr-FR' as 'fr' is not an extended + language subtag. + +

+ + +

+ This normalization is only applied to elements that are actually changed: + +

+ + +
    + +
  • + +

    + When editing track headers only those track language elements that are set + via edit specifications are affected. Languages of tracks that aren't edited + aren't changed. Editing a track but setting only properties other than the + language won't affect the language either. + +

    + +
  • + + +
  • + +

    + When editing chapters all language elements of all chapter elements are + affected as existing chapters are always fully replaced. + +

    + +
  • + + +
  • + +

    + When editing tags only the language elements of the tags that are actually + replaced are affected. For example, when you replace global tags then + existing track tags aren't affected. + +

    + +
  • + +
+ + +

+ The best way to normalize all existing language tags in a file is to remux + it with mkvmerge(1) and set its + '--normalize-language-ietf' option to the desired mode. + +

+ +
--command-line-charset 文字集合 + +

+ 命令行から与えた文字列を変換するのに用いる文字集合を設定します。既定では機構の現行地域特性で指定している文字集合になります。 + +

+ +
--output-charset 文字集合 + +

+ 出力される文字列を変換するのに用いる文字集合を設定します。既定では機構の現行地域特性で指定している文字集合になります。 + +

+ +
-r, + --redirect-outputファイル名 + +

+ 全てのメッセージをコンソールではなくfile-nameで指定したファイルに書き出します。出力リダイレクトによっても同じことが簡単にできますが、このオプションが必要な場合もあります。ターミナルがファイルに書き込む前に出力を処理してしまう場合などです。--output-charsetによって指定された文字コードは尊重されます。 + +

+ +
--ui-language 符号 + +

+ 用いる翻訳を指定した言語符号のものに強制します(例えば「de_DE」ならドイツ語翻訳です)。符号に「list」を指定すると利用可能な翻訳の一覧を出力します。 + +

+ +
--abort-on-warnings + +

+ 警告が発された後、プログラムが停止するようにします。プログラムの終了番号は1になります。 + +

+ +
--debug 機能 + +

+ 指定した機能の診断出力を有効にします。このオプションは開発者にとってのみ有用です。 + +

+ +
--engage 機能 + +

+ 実験的機能をオンにします。利用可能な機能のリストはmkvpropedit --engage + listで得られます。これらの機能は通常の状況で利用されることは意図されていません。 + +

+ +
--gui-mode + +

+ GUIモードに切り替えます。このモードではGUI操作の状況を伝える特殊な形式の行が出力されます。これらの通報は + '#GUI#通報内容' + という形式の後に続きます。'#GUI#通報内容#予約語1=値1#予約語2=値2...' + というように予約語・値の組が通報内容に続くことがあります。通知内容や予約語は翻訳されることなく常に英語で出力されます。 + +

+ +
-v, --verbose + +

+ 出力が冗長になり、Matroska(tm)の重要要素全てを、読み込まれるつど表示します。 + +

+ +
-h, --help + +

+ 使用法情報を出力して終了します。 + +

+ +
-V, --version + +

+ 版次情報を出力して終了します。 + +

+ +
@オプションファイル.json + +

+ オプションファイルから追加の命令行引数を読み込みます。こうしたファイルの対応形式についての詳細は、mkvmerge(1)便覧中の「オプションファイル」という節をご覧ください。 + +

+ +
+ +

3. 編集選択子

+ + +

+ --editオプションは、以降のaddset及びdeleteアクションが適用されるMatroska(tm)ファイルセクション(セグメント情報または特定のトラック頭部)を設定します。これは次の--editオプションが見付かるまでずっと有効です。このオプションへの引数は編集選択子と呼ばれます。 + +

+ + +

+ 既定では、mkvpropedit(1)はセグメント情報のセクションを編集します。 + +

+ + +

3.1. セグメント情報

+ + +

+ セグメント情報は次の3つの単語によって選択されます。'info'、'segment_info'または'segmentinfo'です。これはセグメントタイトルやセグメントUIDなどのプロパティを格納しています。 + +

+ + + +

3.2. トラック頭部

+ + +

+ トラック頭部はもうちょっとだけ複雑な選択子で選択されます。全ての場合で選択子は'track:'で始まります。トラック頭部プロパティには、言語コード、'既定トラック'フラグやトラック名のような要素があります。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ 引数nが数字の場合は,n番目のトラックを選択します。トラックの順序はmkvmerge(1)での--identifyオプションの出力と同じです。 + +

+ + +

+ 付番は1から始まります。 + +

+ +
track:tn + +

+ 引数が単一の文字tに続くnで始まる場合は,特定のトラック種別のn番目のトラックを選択します。トラック種別引数tは次の4つのうち1つでなくてはなりません:'a'は音声トラック,'b'はボタントラック,パラメータが一文字の英字tで始まり、次にnが続く場合、あるトラックタイプでn番目のトラックが選択されます。トラックタイプパラメータtは、音声トラックを示す'a'、ボタントラックを示す'b'、字幕トラックを示す's'、映像トラックを示す'v'の四つのうちの一つでなければなりません。トラックの順番はmkvmerge(1)--identifyオプションで出力される順番と同じです。 + +

+ + +

+ 付番は1から始まります。 + +

+ +
track:=uid + +

+ 引数が '=' + に続く数字uidであれば,指定されたuidと等しいトラックUID要素を持つトラックを選択します。トラックUIDmkvinfo(1)で確認できます。 + +

+ +
track:@number + +

+ 引数が '@' + に続く数字numberであれば,このnumberに等しいトラック番号要素を持つトラックを選択します。トラック番号はmkvinfo(1)で確認できます。 + +

+ +
+ + + +

3.3. 注意

+ + +

+ トラック編集選択子の性質から、複数の選択子が同じトラック頭部に合致し得ます。こうした場合、それらの編集選択子への全作用を一つにまとめ、命令行で与えた順に実行します。 + +

+ + +

4. 添付ファイル選択子

+ + + +

+ 添付ファイル選択子は--replace-attachmentおよび--delete-attachmentの二作用と共に使います。 + +

+ + +
    + +
  1. + +

    + 添付ファイル識別子での選択。この形式では、選択子は単に数字であり、mkvmerge(1)の識別命令が出力する添付ファイル識別子と同じものです。 + +

    + +
  2. + + +
  3. + +

    + 添付ファイル固有識別子での選択。この形式では、選択子は等号=に続く数字であり、mkvmerge(1)の識別命令が出力する添付ファイル固有識別子と同じものです。 + +

    + +
  4. + + +
  5. + +

    + 添付ファイル名による選択。この形式では、選択子は即値語name:に続く存在する添付ファイルの名前です。この選択子を--replace-attachmentと共に用いる場合は、合致する名前中のコロンは\cと退避させなくてはなりません。 + +

    + +
  6. + + +
  7. + +

    + MIME種別による選択。この形式では、選択子は即値語mime-type:に続く存在する添付ファイルのMIME種別です。この選択子を--replace-attachmentと共に用いる場合は、合致するMIME種別中のコロンは\cと退避させなくてはなりません。 + +

    + +
  8. + +
+ +

5. Language handling

+ + + +

+ mkvpropedit(1) mostly tries to do the right thing by default. Therefore + changes to the language property will cause mkvpropedit(1) + to apply the same change to both the new "LanguageIETF" element as well as + the old "Language" element similar to how mkvmerge(1) applies the language to + both elements. For example, when using mkvpropedit movie.mkv --edit + track:2 --set language=zh-TW the "LanguageIETF" element will be + set to zh-TW and the old "Language" element to + chi. + +

+ + +

+ Additionally there's a new track header property named + language-ietf that can be set or removed. Changes to this + property only apply to the new "LanguageIETF" track header element. A caveat + is that the old "Language" track header element is a mandatory element in + Matroska — meaning even if it isn't present in the file it still has an + implied value. When the user only sets the language-ietf + property but not the language property, mkvpropedit(1) will + therefore add the old "Language" element in certain cases & set it to + und (meaning "undetermined") as the user didn't specify a + value for it. + +

+ + +

When reading XML chapter or tag files mkvpropedit(1) works like mkvmerge(1) + does. +

+ + +

The creation of the new elements can be disabled completely with the + command-line option `--disable-language-ietf` which operates on all three + new elements. +

+ + +

You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. +

+ +

6. 例

+ + +

+ 'movie.mkv' + というファイルを編集する例を以下に示します。区分題名を設定し、音声トラックおよび字幕トラックの言語コードを修正しています。注意: + この例では、最初の--editオプションを省いて短縮できます。なぜなら、結局最初の--editオプションが見付かる前の全てのオプションは、既定で区分情報要素を編集するからです。 + +

+ +
$ mkvpropedit movie.mkv --edit info --set "title=The movie" --edit track:a1 --set language=fre --edit track:a2 --set language=ita
+ +

+ 二番目の例では、最初の字幕トラックから「既定のトラック標旗」を削除し二番目の字幕トラックに設定します。注意: + mkvpropedit(1)はmkvmerge(1)とは異なり,他のトラックの既定標旗が「1」に自動設定されていても,違うトラックの既定標旗を「0」に設定しません。 + +

+ +
$ mkvpropedit movie.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ ファイル中2番目の字幕トラックの標識を置換するには、以下のようにします: + +

+ +
$ mkvpropedit movie.mkv --tags track:s2:new-subtitle-tags.xml
+ +

+ 標識を削除したいときはファイル名を省きます: + +

+ +
$ mkvpropedit movie.mkv --tags all:
+ +

+ ファイル中の楽章を置換するには、以下のようにします: + +

+ +
$ mkvpropedit movie.mkv --chapters new-chapters.xml
+ +

+ 全ての楽章を削除したいときはファイル名を省きます: + +

+ +
$ mkvpropedit movie.mkv --chapters ''
+ +

+ フォントファイル(Arial.ttf)を添付ファイルとして追加する。 + +

+ +
$ mkvpropedit movie.mkv --add-attachment Arial.ttf
+ +

+ フォントファイル(89719823.ttf)を添付ファイルとして追加し、それがまさにArialであるという情報を提供する: + +

+ +
$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'The Arial font as a TrueType font' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ 附属のフォントファイル(Comic.ttf)を別のもの + (Arial.ttf) に置き換える: + +

+ +
$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'The Arial font as a TrueType font' --replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ 2番目の添付ファイルを、それが何であれ削除する。 + +

+ +
$ mkvpropedit movie.mkv --delete-attachment 2
+ +

+ MIME種別を指定することで全ての附属フォントを削除する: + +

+ +
$ mkvpropedit movie.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. 終了番号

+ + + +

+ mkvpropedit(1)は下の3つの終了番号を返します。 + +

+ + +
    + +
  • + +

    + 0 -- この終了番号は変更が成功したことを示します。 + +

    + +
  • + + +
  • + +

    + 1 -- この終了番号は、一つ以上の警告が出力されたが抽出が続行されたことを意味します。警告は + 'Warning:' + という文字列を先頭にして出力されます。結果ファイルが無事かどうかは状況によります。出力ファイルを確認することを強く推奨します。 + +

    + +
  • + + +
  • + +

    + 2 -- + この終了番号は、誤りが発生し、誤り通報を出力した直後にmkvpropedit(1)が終了したことを示します。誤り通報の原因は命令行の間違いやファイル読み/書き誤り、壊れたファイルなど多岐に渡ります。 + +

    + +
  • + +
+ +

8. 文章ファイルと文字集合変換

+ + + +

+ MKVToolNix一式の全ての操作機が文字集合変換、入出力、命令行、操作卓上の文字集合をどのように処理するかについての詳細な議論については、mkvmerge(1)の便覧にある同名の節をご覧ください。 + +

+ +

9. 環境変数

+ + + +

+ mkvpropedit(1)は機構の地域特性を決める既定変数(例:LANGLC_*系列)を使用します。追加の変数: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, + MKVTOOLNIX_DEBUGとその短縮形MTX_DEBUG + +

その内容を、あたかも--debugオプション経由で渡されたかのように扱います。 +

+ +
MKVPROPEDIT_ENGAGE, + MKVTOOLNIX_ENGAGEとその短縮形MTX_ENGAGE + +

その内容を、あたかも--engageオプション経由で渡されたかのように扱います。 +

+ +
+ +

10. 関連項目

+ + +

+ mkvmerge(1)mkvinfo(1)mkvextract(1)mkvtoolnix-gui(1) + +

+ +

11. ウェブ

+ + +

+ 最新版は常にMKVToolNixの拠点で入手できます。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..e28113e33398b15aca7e382fba39c36c1f8dee5d --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ja/mkvtoolnix-gui.html @@ -0,0 +1,140 @@ + + + + + mkvtoolnix-gui -- mkvmerge1の楽章・頭部編集機能付きGUI + + + +
mkvtoolnix-gui -- mkvmerge(1)の楽章・頭部編集機能付きGUI +
+
+
+

Table of contents

+ +
+
+

1. 書式

+ + +
mkvtoolnix-gui [[設定ファイル名.mtxcfg] | [原ファイル.ext] | [Matroskaファイル.mkv] | [楽章ファイル.ext] | [Matroskaファイル.mkv]] +
+ +

2. 説明

+ + +

+ mkvtoolnix-gui(1)はQt(tm)に基づいたmkvmerge(1)GUIです。mkvinfo(1)mkvpropedit(1)の機能も実装しており、同様にmkvextract(1)の機能実装も視野に入れています。全ての設定(例えば原ファイルやトラックのオプション等)は保存・復元できます。 + +

+ + +

+ .mtxcfg拡張子のファイル名を列挙すると、GUIは列挙した設定ファイルを適切な器具で読み込みます。残りのファイル名は、現行モードに従って、多重化の原曲として、情報操作機で、楽章編集機で、あるいは頭部編集機で開くように追加されます。現行のモードは--merge--info--edit-chaptersまたは--edit-headersで変更できます。既定のモードではファイルを多重化用に追加します。 + +

+ + +

+ 注意: + 既にmkvtoolnix-gui(1)実体が起動している状態でmkvtoolnix-gui(1)を新しく立ち上げた場合は、命令行で指定した全てのファイル名が既存の実体に渡されて処理されます。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

以降に続く全てのファイル名が現在の多重化作業への原曲として追加されます。これは既定のモードです。

+ +
--info + +

以降に続く全てのファイル名が情報操作機で開かれます。

+ +

加えて、開始時には多重化装置ではなく情報操作機が選択されます。

+ +
--edit-chapters + +

以降に続く全てのファイル名が楽章編集機で開かれます。

+ +

加えて、開始時には多重化装置ではなく楽章編集機が選択されます。

+ +
--edit-headers + +

以降に続く全てのファイル名が頭部編集機で開かれます。

+ +

加えて、開始時には多重化装置ではなく頭部編集機が選択されます。

+ +
-h, --help + +

+ 使用法情報を出力して終了します。 + +

+ +
-V, --version + +

+ 版次情報を出力して終了します。 + +

+ +
+ +

3. 関連項目

+ + +

+ mkvmerge(1) mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. ウェブ

+ + +

+ 最新版は常にMKVToolNixの拠点で入手できます。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..7149f86a217dbf9cb1569ad88463000a3c3d4a25 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvextract.html @@ -0,0 +1,1248 @@ + + + + + mkvextract -- Matroska 파일에서 다른 파일로 트랙 추출 + + + +
mkvextract -- Matroska(tm) 파일에서 다른 파일로 트랙 추출 +
+
+ +
+

1. 개요

+ + +
mkvextract {소스-파일명} {모드1} 옵션 추출-스펙1 모드2 옵션 추출-스펙2 … +
+ +

2. 설명

+ + +

+ 이 프로그램은 Matroska(tm) 파일에서 특정 부분을 다른 유용한 형식으로 추출합니다. 첫 번째 인수는 소스 파일의 이름이며 + Matroska(tm) 파일이어야 합니다. + +

+ + +

+ 다른 모든 인수는 특정 추출 모드로 전환하거나, 현재 활성 모드에 대한 옵션을 변경하거나, 무엇을 어떤 파일에 추출할 것인지를 + 지정합니다. Mkvextract의 동일한 호출에서 여러 모드를 사용하여 한 번에 여러 항목을 추출할 수 있습니다. 대부분의 옵션은 + 모든 모드에 적용되는 몇 가지 옵션이 있는 특정 모드에서만 사용할 수 있습니다. + +

+ + +

+ 현재 지원되는 것은 트랙, 태그, 첨부 파일, 챕터, 큐 시트, 타임스탬프의 추출입니다. + +

+ + +

2.1. 공통 옵션

+ + + +

+ 다음 옵션은 모든 모드에서 사용 가능하고 이 부분에서 단 한번만 설명합니다. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ 분석 모드를 '전부'로 설정합니다. 기본 모드는 전체 파일을 분석하지 않지만 소스 파일의 필요한 요소를 찾기 위해 메타 탐색 요소를 + 사용합니다. 이것은 99% 가량의 모든 경우에 충분합니다. 그러나 메타 탐색 요소를 포함하지 않거나 손상된 파일에서 사용자는 이 모드를 + 사용해야 할 지 모릅니다. 빠른 스캔은 몇 초밖에 안 걸리지만, 파일 전체 스캔은 이 삼분 걸릴 수 있습니다. + +

+ +
--command-line-charset 문자셋 + +

+ 명령행에 주어진 문자열을 변환할 문자셋을 정합니다. 기본값은 현재 시스템 로케일에 따른 문자셋입니다. + +

+ +
--output-charset 문자셋 + +

+ 출력할 문자열을 변환할 문자셋을 정합니다. 기본값은 현재 시스템 로케일에 따른 문자셋입니다. + +

+ +
-r, --redirect-output + 파일명 + +

+ 모든 메시지를 콘솔 화면 대신 파일명 파일에 기록합니다. 이것은 출력 방향 전환으로 쉽게 할 수 + 있지만 이 옵션이 필요한 경우가 있습니다: 터미널이 파일에 출력하기 전에 출력을 재해석할 때. 문자셋 설정은 --output-charset + 을 준수합니다. + +

+ +
--flush-on-close + +

+ 쓰기 위해 열린 파일을 닫을 경우 메모리에 캐시된 모든 데이터를 플러시 하도록 프로그램에게 지시합니다. 이를 통해 정전 시 데이터 손실을 + 방지하거나 운영 체제 또는 드라이버의 특정 문제를 방지할 수 있습니다. mkvmerge는 모든 데이터가 저장소에 기록될 때까지 기다리기 + 때문에 멀티플렉싱 시간이 더 오래 걸린다는 단점이 있습니다. 장단점에 대한 자세한 내용은 MKVToolNix 버그 트래커의 #2469 및 + #2480호를 참조하십시오. + +

+ +
--ui-language 코드 + +

+ 언어 코드의 번역을 강제로 사용합니다 (예: 강제 사용할 독일어 번역 코드는 + 'de_DE'). 'list'를 + 코드로 입력하면 mkvextract(1) 에서 이용 가능한 번역 목록을 출력할 것입니다. + +

+ +
--abort-on-warnings + +

+ 첫 번째 경고가 발생한 후 프로그램을 중단하도록 지시합니다. 프로그램의 종료 코드는 1입니다. + +

+ +
--debug 토픽 + +

+ 특정 기능에 대해 디버깅을 켭니다. 이 기능은 개발자에게만 유용합니다. + +

+ +
--engage 기능 + +

+ 실험적인 기능을 켭니다. 이용 가능한 기능 목록은 mkvextract --engage list로 요청할 + 수 있습니다. 이 기능들은 보통 상황에서는 사용하면 안 됩니다. + +

+ +
--gui-mode + +

+ GUI 모드를 켭니다. 이 모드에서는 GUI 동작시 무슨 일이 일어나는지 알려줄 수 있는 특별하게 형식화된 줄을 출력할 것입니다. 이 + 메시지들은 '#GUI#message' 형식을 따릅니다. 이 메시지 뒤에 + '#GUI#message#key1=value1#key2=value2…' 형태의 키/값 쌍이 붙을 수 + 있습니다. 메시지나 키값들은 결코 번역되지 않고 항상 영어로 출력됩니다. + +

+ +
-v, --verbose + +

+ 읽어들인 모든 중요한 Matroska(tm) 요소를 자세하게 보여 줍니다. + +

+ +
-h, --help + +

+ 사용법에 관한 정보를 표시하고 종료합니다. + +

+ +
-V, --version + +

+ 버전 정보를 표시하고 종료합니다. + +

+ +
@옵션 파일.json + +

+ 추가 명령행 인수는 옵션-파일 파일에서 읽어보세요. 이러한 파일용 지원 형식에 대한 자세한 + 설명은 mkvmerge(1) man page에서 "옵션 파일"이라는 섹션을 참고하세요. + +

+ +
+ + + +

2.2. 트랙 추출 모드

+ + + +

+ 구문: mkvextract 소스-파일명 트랙 + [옵션] + TID1:대상-파일명1 + [TID2:대상-파일명2 ...] + +

+ + +

+ 다음 명령행 옵션은 '트랙' 추출 모드에서 각 트랙에 대해 사용할 수 있습니다. 이 옵션들은 적용이 + 되야 하는 트랙 사양(아래 참고) 의 앞쪽에 나타나야 합니다. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c 문자셋 + +

+ 다음 자막 트랙을 변환할 문자셋을 설정합니다. 다음 트랙 ID가 텍스트 자막 트랙을 대상으로 하는 경우에만 유효합니다. 기본값은 + UTF-8. + +

+ +
--blockadd 수준 + +

+ 이 수준까지만 BlockAddition을 유지합니다. 기본값은 모든 수준을 유지하는 것입니다. 이 옵션은 WAVPACK4같은 특정한 + 코덱에만 효과가 있습니다. + +

+ +
--cuesheet + +

+ mkvextract(1)로 시트를 챕터 정보에서 추출하고 다음 트랙의 데이터를 파일명이 트랙의 출력 + 이름이고 확장자가 '.cue' 인 파일에 태그로 기록합니다. + +

+ +
--raw + +

+ 컨테이너에서 원시 데이터를 파일로 추출합니다. --fullraw + 플래그와 다르게 이 플래그는 CodecPrivate 요소의 내용이 그 파일에 기록되지 + 않습니다. 이 모드는 모든 CodecIDs와 동작합니다. 그 외에 mkvextract(1)가 + 지원하지 않는 CodecIDs에서도 동작이 됩니다. 다만 그 결과로 나오는 파일은 아마도 + 사용하지 못할 것입니다. + +

+ +
--fullraw + +

+ 원시 데이터를 컨테이너에 넣지 않고 단순한 파일로 추출합니다. CodecPrivate 요소의 + 내용은 만약 트랙이 그런 헤더 요소를 포함하고 있으면 파일에 먼저 기록될 것입니다. 이 모드는 모든 + CodecIDsmkvextract(1) 가 지원하지 않는 + CodecIDs에서도 동작하지만 그 결과로 나오는 파일은 아마도 사용하지 못할 것입니다. + +

+ +
TID:출력이름 + +

+ 소스 파일에 TID ID의 트랙이 있으면 출력이름 + 파일로 추출합니다. 이 옵션은 여러 번 사용할 수 있습니다. 트랙 ID는 mkvmerge(1)'s + --identify 옵션으로 나오는 것과 같습니다. + +

+ + +

+ 각 출력 이름은 한 번만 사용해야 합니다. RealAudio와 RealVideo 트랙은 예외적입니다. 다른 트랙들에 같은 이름을 사용하면 + 해당 트랙들은 같은 파일에 저장이 될 것입니다. 예: + +

+ +
$ mkvextract input.mkv tracks 0:video.h264 2:output-two-vobsub-tracks.idx 3:output-two-vobsub-tracks.idx
+
+ + + +

2.3. 첨부 파일 추출 모드

+ + + +

+ 구문: mkvextract 소스-파일명 + attachments [옵션] + AID1:출력명1 [AID2:출력명2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:출력이름 + +

+ 소스 파일에 ID AID의 첨부 파일이 있으면 출력이름 + 파일로 추출합니다. 출력이름이 없으면 소스 Matroska(tm) 파일 안의 첨부 파일명을 대신 + 사용합니다. 이 옵션은 여러 번 사용할 수 있습니다. 첨부 파일 ID는 mkvmerge(1)'s + --identify 옵션으로 나오는 출력과 같습니다. + +

+ +
+ + + +

2.4. 챕터 추출 모드

+ + + +

+ 구문: mkvextract 소스-파일명 챕터 + [옵션] + 출력-파일명.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ 챕터 정보를 OGM 도구에서 사용되는 단순 + 형식(CHAPTER01=... CHAPTER01NAME=...)으로 내보냅니다. 이 모드에서 몇몇 정보는 폐기되어야만 합니다. 기본값은 + 챕터를 XML 형식으로 출력하는 것입니다. + +

+ +
--simple-language 언어 + +

+ 간단한 형식이 활성화된 경우 mkvextract(1)는 챕터 아톰에 두 개 이상의 챕터 이름이 있어도, 마주치는 각 챕터 아톰에 대해 단일 + 항목만 출력합니다. 기본적으로 mkvextract(1)는 그 언어와 상관없이 각 아톰에 대해 찾은 첫 번째 챕터 이름을 사용합니다. + +

+ + +

+ 이 옵션을 사용시 아톰이 둘 이상의 챕터 이름을 포함하는 경우, 출력할 챕터 이름을 결정할 수 + 있습니다. 언어 매개 변수는 ISO 639-1 또는 ISO 639-2 코드여야 합니다. + +

+ +
+ + +

+ 챕터는 지정된 출력 파일에 기록됩니다. 기본적으로 mkvmerge(1)가 이해하는 XML 형식이 사용됩니다. 파일에 챕터가 없으면 출력 + 파일이 작성되지 않습니다. + +

+ + + +

2.5. 태그 추출 모드

+ + + +

+ 구문: mkvextract 소스-파일명 태그 + [옵션] + 출력-파일명.xml + +

+ + +

+ 태그는 mkvmerge(1)가 이해하는 XML 형식으로 지정된 출력 파일에 기록됩니다. 파일에 태그가 없으면 출력 파일이 생성되지 + 않습니다. + +

+ + + +

2.6. 큐시트 추출 모드

+ + + +

+ 구문: mkvextract 소스-파일명 큐 시트 + [옵션] + 출력-파일명.cue + +

+ + +

+ 큐 시트는 지정된 출력 파일에 기록됩니다. 파일에 챕터나 태그가 없으면 출력 파일이 생성되지 않습니다. + +

+ + + +

2.7. 타임스탬프 추출 모드

+ + + +

+ 구문: mkvextract 소스-파일명 + 타임스탬프_v2 [옵션] + TID1:대상-파일명1 + [TID2:대상-파일명2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:출력이름 + +

+ 소스 파일에 TID ID의 트랙이 있으면 출력이름 + 파일로 추출합니다. 이 옵션은 여러 번 사용할 수 있습니다. 트랙 ID는 mkvmerge(1)'s + --identify 옵션으로 나오는 것과 같습니다. + +

+ + +

+ 예: + +

+ +
$ mkvextract input.mkv timestamps_v2 1:ts-track1.txt 2:ts-track2.txt
+
+ + + +

2.8. 큐 추출 모드

+ + + +

+ 구문: mkvextract 소스-파일명 + [옵션] + TID1:대상-파일명1 + [TID2:대상-파일명2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:대상 파일명 + +

+ ID가 TID인 트랙에 대한 큐가 소스 파일에 있는 경우 해당 트랙이 + outname 파일로 추출됩니다. 이 옵션은 여러 번 지정할 수 있습니다. 트랙 ID는 + mkvmerge(1)--identify 옵션에 의해 출력되는 ID와 동일하며 + CueTrack 요소에 포함된 번호가 아닙니다. + +

+ +
+ + +

+ 형식 출력은 key=value 쌍이 있는 CuePoint + 요소당 한 줄씩의 간단한 텍스트 형식입니다. 옵션 요소가 CuePoint(예: + CueDuration)에 없는 경우 대시가 값으로 출력됩니다. + +

+ + +

+ 예: + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

가능한 키:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
타임스탬프 + +

나노초 정밀도로 큐 포인트의 타임스탬프입니다. 형식은 HH:MM:SS.nnnnnnnnn입니다. 이 + 요소는 항상 설정됩니다. +

+ +
지속 시간 + +

나노초 정밀도로 큐 포인트의 타임스탬프입니다. 형식은 HH:MM:SS.nnnnnnnnn입니다. +

+ +
클러스터_위치 + +

참조된 요소를 포함하는 클러스터가 시작되는 Matroska(tm) 파일 내의 절대 위치(바이트 단위). +

+ + +
+

Note:

+ +

Matroska(tm) 파일 내에서 CueClusterPosition은 세그먼트의 데이터 시작 + 오프셋에 상대적입니다. 그러나 mkvextract(1)의 큐 추출 모드에 의해 출력되는 값은 이미 오프셋을 포함하고 있으며 파일의 시작부터 + 절대 오프셋입니다. +

+ +
+ +
상대적인_위치 + +

큐 포인트가 참조하는 BlockGroup 또는 + SimpleBlock 요소가 시작되는 클러스터 내의 상대 위치(바이트 단위). +

+ + +
+

Note:

+ +

Matroska(tm) 파일 내 Cue Relative Position은 클러스터의 데이터 시작 + 오프셋을 기준으로 합니다. 그러나 mkvextract(1)의 큐 추출 모드에 의해 출력되는 값은 클러스터의 ID에 상대적입니다. 파일 내의 + 절대 위치는 cluster_position과 + relative_position을 추가하여 계산할 수 있습니다. +

+ +
+ +
+ + +

+ 예: + +

+ +
$ mkvextract input.mkv cues 1:cues-track1.txt 2:cues-track2.txt
+ +

3. 보기

+ + + +

+ 챕터와 태그를 각각 XML 형식으로 동시에 추출: + +

+ +
$ mkvextract movie.mkv chapters movie-chapters.xml tags movie-tags.xml
+ +

+ 트랙 두 개 및 해당 타임스탬프를 동시에 추출: + +

+ +
$ mkvextract "Another Movie.mkv" tracks 0:video.h265 "1:main audio.aac" "2:director's comments.aac" timestamps_v2 "0:timestamps video.txt" "1:timestamps main audio.txt" "2:timestamps director's comments.txt"
+ +

+ Ogg/OGM 형식의 장을 추출하고 텍스트 자막 트랙을 다른 문자 집합으로 다시 인코딩하는 방법: + +

+ +
$ mkvextract "My Movie.mkv" chapters --simple "My Chapters.txt" tracks -c MS-ANSI "2:My Subtitles.srt"
+

4. 텍스트 파일과 문자셋 변환

+ + + +

+ MKVToolNix 제품군의 모든 도구가 문자 집합 변환, 입력/출력 인코딩, 명령줄 인코딩 및 콘솔 인코딩을 처리하는 방법에 대한 + 자세한 내용은 mkvmerge(1) 매뉴얼 페이지에서 동일한 이름의 섹션을 참조하십시오. + +

+ +

5. 출력 파일 형식

+ + + +

+ 출력 형식에 대한 결정은 출력 파일 이름에 사용된 확장자가 아니라 트랙 유형에 따라 결정됩니다. 현재 지원되는 트랙 유형은 다음과 + 같습니다. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ 모든 AAC 파일은 각 패킷 전에 ADTS 헤더가 있는 + AAC 파일에 기록됩니다. ADTS 헤더에는 사용되지 않는 강조 필드가 + 포함되지 않습니다. + +

+ +
A_AC3, A_EAC3 + +

+ 이 파일은 원본 AC-3 파일로 압축 해제됩니다. + +

+ +
A_ALAC + +

+ ALAC트랙은 CAF파일에 쓰여집니다. + +

+ +
A_DTS + +

+ 이 파일은 원본 DTS 파일로 압축 해제됩니다. + +

+ +
A_FLAC + +

+ FLAC트랙은 원본FLAC파일에 쓰여집니다. + +

+ +
A_MPEG/L2 + +

+ MPEG-1 오디오 레이어 II 스트림이 원본 MP2 파일로 추출됩니다. + +

+ +
A_MPEG/L3 + +

+ 이것들은 원본 MP3 파일로 압축 해제됩니다. + +

+ +
A_OPUS + +

+ Opus(tm)트랙은 OggOpus(tm)파일에 + 쓰여집니다. + +

+ +
A_PCM/INT/LIT, A_PCM/INT/BIG + +

+ 원본PCM데이터는 WAV파일에 쓰여집니다. Big-endian 정수 데이터는 + 이 과정에서 little-endian 데이터로 변환됩니다. + +

+ +
A_REAL/* + +

+ RealAudio(tm)트랙은 + RealMedia(tm)파일에 쓰여집니다. + +

+ +
A_TRUEHD, A_MLP + +

+ 이것들은 원본 TrueHD/MLP 파일로 압축 해제됩니다. + +

+ +
A_TTA1 + +

+ TrueAudio(tm)트랙은 TTA파일에 + 쓰여집니다. Matroska(tm)의 제한된 타임스탬프 정밀도로 인해 추출된 파일의 헤더는 + data_length(파일에 있는 샘플의 총 수)와 CRC의 두 필드에 + 대해 다릅니다. + +

+ +
A_VORBIS + +

+ Vorbis 오디오는 OggVorbis(tm) 파일로 기록될 것입니다. + +

+ +
A_WAVPACK4 + +

+ WavPack(tm)트랙은 WV(tm)파일에 + 쓰여집니다. + +

+ +
S_HDMV/PGS + +

+ PGS자막은 SUP파일에 쓰여집니다. + +

+ +
S_HDMV/TEXTST + +

+ Text ST 자막은 mkvmerge(1)mkvextract(1)용으로 개발된 특별한 파일 형식으로 + 작성될 것입니다. + +

+ +
S_KATE + +

+ Kate(tm)스트림은 Ogg(tm)컨테이너에 + 쓰여집니다. + +

+ +
S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS + +

+ SSAASS 텍스트 자막은 각각 + SSA/ASS 파일로 작성됩니다. + +

+ +
S_TEXT/UTF8, S_TEXT/ASCII + +

+ 간단한 텍스트 자막은 SRT파일에 쓰여집니다. + +

+ +
S_VOBSUB + +

+ VobSub(tm) 자막은 각 인덱스 파일과 함께 SUB 파일로 + 작성되며, IDX 파일로 작성됩니다. + +

+ +
S_TEXT/USF + +

+ USF 텍스트 자막은 USF 파일에 쓰여집니다. + +

+ +
S_TEXT/WEBVTT + +

+ WebVTT 텍스트 자막은 WebVTT 파일에 쓰여집니다. + +

+ +
V_MPEG1, V_MPEG2 + +

+ MPEG-1MPEG-2 비디오 트랙은 + MPEG 기본 스트림으로 작성됩니다. + +

+ +
V_MPEG4/ISO/AVC + +

+ H.264 / AVC 비디오 트랙은 H.264 + 기본 스트림에 기록되며, GPAC(tm) 패키지의 + MP4Box(tm)와 같이 추가로 처리할 수 있습니다. + +

+ +
V_MPEG4/ISO/HEVC + +

+ H.265 / HEVC 비디오 트랙은 + H.265 기본 스트림에 기록되며, GPAC(tm) 패키지의 + MP4Box(tm)와 같이 추가로 처리할 수 있습니다. + +

+ +
V_MS/VFW/FOURCC + +

+ 코덱으로 고정된 FPS 비디오 트랙 수정ID'는 + AVI 파일에 기록됩니다. + +

+ +
V_REAL/* + +

+ RealVideo(tm)트랙은 + RealMedia(tm)파일에 쓰여집니다. + +

+ +
V_THEORA + +

+ Theora(tm)스트림은 Ogg(tm)컨테이너에 + 쓰여집니다. + +

+ +
V_VP8, V_VP9 + +

+ VP8 / VP9트랙은 IVF파일에 + 쓰여집니다. + +

+ +
태그 + +

+ 태그가 XML 형식으로 변환됩니다. 이 형식은 mkvmerge(1)가 태그 읽기에 지원하는 형식과 동일합니다. + +

+ +
첨부 파일 + +

+ 첨부 파일은 출력 파일에 그대로 기록됩니다. 어떠한 변환도 수행되지 않습니다. + +

+ +
챕터 + +

+ 챕터는 XML 형식으로 변환됩니다. 이 형식은 mkvmerge(1)가 챕터 읽기에 지원하는 형식과 동일합니다. 또는 스트립된 버전을 + 간단한 OGM 스타일 형식으로 출력할 수 있습니다. + +

+ +
타임스탬프 + +

+ 타임스탬프가 먼저 정렬된 다음 mkvmerge(1)에 공급될 준비가 된 타임스탬프 v2 형식 호환 파일로 출력됩니다. 다른 형식(v1, + v3 및 v4)으로의 추출은 지원되지 않습니다. + +

+ +
+ +

6. 종료 코드

+ + + +

+ mkvextract(1) 종료 코드 세 개 중 하나로 종료: + +

+ + +
    + +
  • + +

    + 0 -- 이 종료 코드는 추출이 성공적으로 완료되었음을 의미합니다. + +

    + +
  • + + +
  • + +

    + 1 -- 이 경우 mkvextract(1)는 경고를 하나 이상 출력했지만 추출은 계속되었습니다. 경고 + 앞에 'Warning:'이라는 텍스트가 붙습니다. 관련된 문제에 따라 결과 파일이 정상 또는 그렇지 + 않을 수 있습니다. 사용자는 경고와 결과 파일을 모두 확인해야 합니다. + +

    + +
  • + + +
  • + +

    + 2 -- 오류가 발생한 후 이 종료 코드가 사용됩니다. 오류 메시지를 출력한 후 + mkvextract(1)가 바로 중단됩니다. 오류 메시지는 읽기/쓰기 오류에 대한 잘못된 명령줄 인수에서 손상된 파일에 이르기까지 + 다양합니다. + +

    + +
  • + +
+ +

7. 환경 변수

+ + + +

+ mkvextract(1)는 시스템의 로케일을 결정하는 기본 변수(예: LANG 및 + LC_* 제품군)를 사용합니다. 추가 변수: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG 와 그 + 간략한 형태인MTX_DEBUG + +

내용은 --debug 옵션을 + 통해 전달된 것으로 간주됩니다. +

+ +
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE 와 + 그 간략한 형태인 MTX_ENGAGE + +

내용은 --engage 옵션을 + 통해 전달된 것으로 간주됩니다. +

+ +
+ +

8. 더 보기

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. WWW

+ + +

+ 이전 버전은 언제나 MKVToolNix + 홈페이지에서 찾을 수 있습니다. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..2a7500aae050d3c2c3cc587bef07b1b58b5fc314 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvinfo.html @@ -0,0 +1,477 @@ + + + + + mkvinfo -- Matroska 파일의 요소에 대한 정보 인쇄 + + + +
mkvinfo -- Matroska(tm) 파일의 요소에 대한 정보 인쇄 +
+
+ +
+

1. 개요

+ + +
mkvinfo options {source-filename} +
+ +

2. 설명

+ + +

+ 이 프로그램은 Matroska(tm)에 포함된 모든 요소를 나열합니다. 출력은 사용된 코덱에 대한 정보를 포함하는 파일의 트랙 목록으로 + 제한될 수 있습니다. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ 기본적으로 mkvinfo(1)는 첫 번째 클러스터가 발견되면 중지됩니다. 또한 자주 발생하는 특정 요소를 보여주지 않습니다. 이 옵션을 + 사용하면 mkvinfo(1)는 만유도 레벨에 관계없이 처리를 계속하고 모든 요소를 표시합니다. + +

+ +
-c, --checksums + +

+ 각 프레임에 대한 Adler-32 체크섬을 계산하고 표시합니다. 디버깅에만 유용합니다. + +

+ +
-o, --continue + +

+ 기본적으로 mkvinfo(1)는 첫 번째 클러스터가 발견되면 중지됩니다. 이 옵션을 사용하면 mkvinfo(1)는 verbosity 레벨에 + 관계없이 처리를 계속합니다. + +

+ +
-p, --hex-positions + +

+ 동사성 수준에 관계없이 모든 요소의 위치를 16진수로 표시합니다. + +

+ +
-P, --positions + +

+ 동사성 수준에 관계없이 모든 요소의 위치를 10진수로 표시합니다. + +

+ +
-s, --summary + +

+ mkvinfo(1)가 발견한 내용에 대한 간단한 요약만 표시하고 각 요소는 표시하지 않습니다. + +

+ +
-t, --track-info + +

+ 상세 모드에서 각 트랙에 대한 통계를 표시합니다. 또한 이전 레벨 0인 경우 verboy를 1로 설정합니다. + +

+ +
-x, --hexdump + +

+ 각 프레임의 처음 16바이트를 16진수 덤프로 표시합니다. + +

+ +
-X, --full-hexdump + +

+ 각 프레임의 모든 바이트를 16진수 덤프로 표시합니다. + +

+ +
-z, --size + +

+ 헤더를 포함한 각 요소의 크기를 표시합니다. + +

+ +
--command-line-charset 문자셋 + +

+ 명령행에 주어진 문자열을 변환할 문자셋을 정합니다. 기본값은 현재 시스템 로케일에 따른 문자셋입니다. + +

+ +
--output-charset 문자셋 + +

+ 출력할 문자열을 변환할 문자셋을 정합니다. 기본값은 현재 시스템 로케일에 따른 문자셋입니다. + +

+ +
-r, --redirect-output + 파일명 + +

+ 모든 메시지를 콘솔 화면 대신 파일명 파일에 기록합니다. 이것은 출력 방향 전환으로 쉽게 할 수 + 있지만 이 옵션이 필요한 경우가 있습니다: 터미널이 파일에 출력하기 전에 출력을 재해석할 때. 문자셋 설정은 --output-charset + 을 준수합니다. + +

+ +
--ui-language 코드 + +

+ 언어 코드의 번역을 강제로 사용합니다 (예: 강제 사용할 독일어 번역 코드는 + 'de_DE'). 'list'를 + 코드로 입력하면 mkvextract(1) 에서 이용 가능한 번역 목록을 출력할 것입니다. + +

+ +
--abort-on-warnings + +

+ 첫 번째 경고가 발생한 후 프로그램을 중단하도록 지시합니다. 프로그램의 종료 코드는 1입니다. + +

+ +
--debug 토픽 + +

+ 특정 기능에 대해 디버깅을 켭니다. 이 기능은 개발자에게만 유용합니다. + +

+ +
--engage 기능 + +

+ 실험적인 기능을 켭니다. 이용 가능한 기능 목록은 mkvinfo --engage list로 요청할 수 + 있습니다. 이 기능들은 보통 상황에서는 사용하면 안 됩니다. + +

+ +
--gui-mode + +

+ GUI 모드를 켭니다. 이 모드에서는 GUI 동작시 무슨 일이 일어나는지 알려줄 수 있는 특별하게 형식화된 줄을 출력할 것입니다. 이 + 메시지들은 '#GUI#message' 형식을 따릅니다. 이 메시지 뒤에 + '#GUI#message#key1=value1#key2=value2…' 형태의 키/값 쌍이 붙을 수 + 있습니다. 메시지나 키값들은 결코 번역되지 않고 항상 영어로 출력됩니다. + +

+ +
-v, --verbose + +

+ 좀 더 상세해집니다. 어느 수준에서 어떤 정보가 출력될지에 대한 설명은 동사성 수준에 대한 절을 참조하십시오. + +

+ +
-h, --help + +

+ 사용법에 관한 정보를 표시하고 종료합니다. + +

+ +
-V, --version + +

+ 버전 정보를 표시하고 종료합니다. + +

+ +
@옵션 파일.json + +

+ 추가 명령행 인수는 옵션-파일 파일에서 읽어보세요. 이러한 파일용 지원 형식에 대한 자세한 + 설명은 mkvmerge(1) man page에서 "옵션 파일"이라는 섹션을 참고하세요. + +

+ +
+ +

3. 동사성 수준

+ + + +

+ v 옵션은 + mkvinfo(1)의 동사성 수준을 높이고 현재 파일에 대한 추가 정보를 인쇄하는 데 사용할 수 있습니다. + +

+ + +

+ 레벨 0에서 mkvinfo(1)는 찾은 트랙 헤더와 해당 유형만 인쇄합니다. mkvinfo(1)는 헤더가 완전히 구문 분석되는 + 즉시(기술적으로는 첫 번째 클러스터가 발견되는 즉시) 종료됩니다. 이 수준에서는 트랙 정보 앞에 있는 경우에도 검색 헤드 항목과 큐가 + 표시되지 않습니다. + +

+ + +

+ 레벨 1에서 mkvinfo(1)는 검색 헤드 항목과 큐 항목을 제외한 전체 파일에 대해 발견된 모든 Matroska(tm) 요소도 + 인쇄합니다. 요약 모드가 활성화된 경우 mkvinfo(1)도 프레임 위치를 출력합니다. + +

+ + +

+ --continue 옵션을 사용해도 동일한 효과를 얻을 수 있습니다. + +

+ + +

+ 레벨 2에서도 mkvinfo(1)는 탐색 헤드 항목, 큐 항목 및 각 Matroska(tm) 요소를 찾을 수 있는 파일 위치를 인쇄합니다. + +

+ + +

+ --all --positions 옵션을 사용해도 동일한 효과를 얻을 수 있습니다. + +

+ + +

+ 레벨 3 이상에서 mkvinfo(1)는 Matroska(tm) 요소에 직접 연결되지 않은 일부 정보를 인쇄합니다. 다른 모든 요소는 방금 + 발견된 요소에 대한 내용만 인쇄합니다. 레벨 3은 디버깅을 쉽게 하기 위해 메타 정보를 추가합니다(읽기: 개발자 전용). 레벨 3으로 + 작성된 모든 줄은 쉽게 필터링할 수 있도록 대괄호로 묶습니다. + +

+ +

4. 텍스트 파일과 문자셋 변환

+ + + +

+ MKVToolNix 제품군의 모든 도구가 문자 집합 변환, 입력/출력 인코딩, 명령줄 인코딩 및 콘솔 인코딩을 처리하는 방법에 대한 + 자세한 내용은 mkvmerge(1) 매뉴얼 페이지에서 동일한 이름의 섹션을 참조하십시오. + +

+ +

5. 종료 코드

+ + + +

+ mkvinfo(1) 종료 코드 세 개 중 하나로 종료: + +

+ + +
    + +
  • + +

    + 0 -- 이 종료 코드는 실행이 성공적으로 완료되었음을 의미합니다. + +

    + +
  • + + +
  • + +

    + 1 -- 이 경우 mkvinfo(1)에서 경고를 하나 이상 출력했지만 실행은 계속되었습니다. 경고 + 앞에 'Warning:'이라는 텍스트가 붙습니다. + +

    + +
  • + + +
  • + +

    + 2 -- 오류가 발생한 후 이 종료 코드가 사용됩니다. 오류 메시지를 출력한 후 mkvinfo(1)가 + 바로 중단됩니다. 오류 메시지는 읽기/쓰기 오류에 대한 잘못된 명령줄 인수에서 손상된 파일에 이르기까지 다양합니다. + +

    + +
  • + +
+ +

6. 환경 변수

+ + + +

+ mkvinfo(1)는 시스템의 로케일을 결정하는 기본 변수(예: LANG 및 + LC_* 제품군)를 사용합니다. 추가 변수: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUG, MKVTOOLNIX_DEBUG 와 그 + 간략한 형태인MTX_DEBUG + +

내용은 --debug 옵션을 통해 + 전달된 것으로 간주됩니다. +

+ +
MKVINFO_ENGAGE, MKVTOOLNIX_ENGAGE 와 그 + 간략한 형태인 MTX_ENGAGE + +

내용은 --engage 옵션을 통해 + 전달된 것으로 간주됩니다. +

+ +
+ +

7. 더 보기

+ + +

+ mkvmerge(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. WWW

+ + +

+ 이전 버전은 언제나 MKVToolNix + 홈페이지에서 찾을 수 있습니다. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..9967dae0d53cbb1e08008186e1566d141e4bebea --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvmerge.html @@ -0,0 +1,4795 @@ + + + + + mkvmerge -- 멀티미디어 스트림을 Matroska 파일로 합치기 + + + +
mkvmerge -- 멀티미디어 스트림을 Matroska(tm) 파일로 합치기 +
+
+ +
+

1. 개요

+ + +
mkvmerge 전역 옵션 {-o out} 옵션1 {파일1} 옵션2 {파일2} @옵션-파일.json +
+ +

2. 설명

+ + +

+ 이 프로그램은 여러 미디어 파일의 입력을 받아 그 스트림(전부나 선택 항목)을 Matroska(tm) file;로 결합합니다. Matroska 웹사이트를 참고하세요. + +

+ + +
+

Important:

+ +

+ 명령행 옵션의 순서는 중요합니다. 프로그램을 처음 사용하면 "옵션 순서" 섹션을 읽어 주세요. + +

+ +
+ + +

2.1. 전역 옵션

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

보다 자세한 정보를 표시합니다.

+ +
-q, --quiet + +

상태 정보를 출력하지 않습니다.

+ +
-o, --output 파일명 + +

파일을 파일명으로 씁니다. 분할을 사용하면 이 매개 변수는 약간 다르게 처리됩니다. --split 옵션의 세부 + 사항은 해당 링크의 설명을 참고하세요. +

+ +
-w, --webm + +

WebM 호환 파일을 만듭니다. 이것은 출력 파일명의 확장자가 "webm"인 경우에도 켜집니다. 이 모드는 몇 가지 + 제한 사항을 시행합니다. 유일하게 허용되는 코덱은 VP8, VP9 비디오 및 Opus, Vorbis 오디오 트랙입니다. DocType + 헤더 항목이 "webm"으로 변경되었습니다. + +

+ + +

+ 챕터와 태그의 경우 요소의 하위 집합만 허용됩니다. mkvmerge(1)는 사양에서 허용되지 않는 모든 요소를 자동으로 제거합니다. + +

+ +
--title 제목 + +

출력 파일의 일반적인 제목을 설정합니다. 예: 영화 이름

+ +
--default-language 언어-코드 + +

--language + 옵션으로 언어가 설정되어 있지 않고 소스 컨테이너가 언어를 제공하지 않는 트랙에 사용될 기본 언어 코드를 설정합니다. +

+ + +

기본 언어 코드는 '확인되지 않음'에 대해 'und'입니다. +

+ +
+ + + +

2.2. 세그먼트 정보 처리 (전역 옵션)

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo filename.xml + +

+ XML 파일에서 세그먼트 정보를 읽습니다. 이 파일에는 세그먼트 패밀리 + UID, 세그먼트 UID, 이전 및 다음 세그먼트 + UID 요소가 포함될 수 있습니다. 예제 파일과 DTD가 MKVToolNix + 배포에 포함되어 있습니다. + +

+ + +

+ 자세한 내용은 아래의 segment info XML + files 파일에 대한 섹션을 참조하십시오. + +

+ +
--segment-uid SID1,SID2,... + +

+ 사용할 세그먼트 UID를 설정합니다. 이 목록은 128비트 세그먼트 UID를 쉼표로 구분한 목록으로, "0x" 접두사가 + 있거나 없거나, 공백이 있거나 없는 16진수, 정확히 32자리입니다. + +

+ + +

+ SID가 =로 시작하는 경우, 나머지 부분은 UID 세그먼트를 읽고 사용하는 Matroska 파일의 이름으로 해석됩니다. + +

+ + +

+ 생성된 각 파일에는 하나의 세그먼트가 포함되며 각 세그먼트에는 하나의 세그먼트 UID가 있습니다. 세그먼트가 생성된 것보다 더 많은 + 세그먼트 UID가 지정되면 잉여 UID는 무시됩니다. 세그먼트가 생성된 것보다 적은 수의 UID가 지정된 경우 해당 세그먼트에 대해 랜덤 + UID가 생성됩니다. + +

+ +
+ + + +

2.3. 챕터 및 태그 처리 (전역 옵션)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language language-code + +

+ 각 장 항목에 대해 작성된 ISO 639-2 언어 코드를 설정합니다. 기본값은 'eng'입니다. 자세한 + 내용은 아래의 chapters 섹션을 참조하십시오. + +

+ + +

+ 이 옵션은 단순 챕터 파일과 챕터는 포함되지만 챕터의 언어에 대한 정보는 없는 소스 파일(예: MP4 및 OGM 파일) 모두에 사용할 수 + 있습니다. + +

+ + +

+ 이 옵션을 사용하는 언어 집합은 --generate-chapters + 옵션을 사용하여 장을 생성할 때도 사용됩니다. + +

+ +
--chapter-charset character-set + +

+ 단순 챕터 파일을 UTF-8로 변환하는 데 사용되는 문자 집합을 설정합니다. mkvmerge(1)가 문자 집합을 변환하는 방법에 대한 + 설명은 text files and + character sets 절을 참조하십시오. + +

+ + +

+ 이 스위치는 Ogg/OGM 및 MP4 파일과 같은 특정 컨테이너 유형에서 복사된 챕터에도 적용됩니다. 자세한 내용은 아래 장에 대한 + 섹션을 참조하십시오. + +

+ +
--chapter-sync + d[,o[/p]] + +

+ 다음 원본 파일에 있는 장의 타임스탬프를 dms 단위로 조정합니다. 또는 특수 트랙 ID + -2와 함께 --sync 옵션을 사용할 수 있습니다(섹션 특수 트랙 ID 참조). + +

+ + +

+ o / p: + o / p로 타임스탬프를 조정하여 선형 드리프트를 + 고정합니다. p는 생략하면 1로 기본 설정됩니다. o와 + p는 모두 부동 소수점 숫자일 수 있습니다. + +

+ + +

+ 기본값: 수동 동기화 보정 없음(d = 0 및 + o / p = + 1.0과 동일) + +

+ + +

+ 이 옵션은 매번 다른 트랙 ID를 선택하여 여러 트랙에 적용되는 입력 파일에 대해 여러 번 사용할 수 있습니다. + +

+ +
--generate-chapters mode + +

+ mkvmerge(1)는 자동으로 챕터를 만들 수 있습니다. 현재 지원되는 두 가지 모드는 다음과 같습니다. + +

+ + +
    + +
  • + +

    + 'when-appending' – 이 모드는 파일이 추가될 때마다 시작 부분에 1개의 챕터를 만듭니다. + +

    + + +

    + 이 모드는 분할 모드 'parts:' 및 + 'parts-frames:'에서도 작동합니다. 이러한 모드에서는 추가된 각 타임스탬프 범위(시작 + 타임스탬프에 '+'로 접두사가 붙은 챕터)에 대해 1개의 챕터가 생성됩니다. + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1)는 새 파일이 추가되는 시기를 확인할 수 있도록 비디오 또는 오디오 트랙이 있어야 합니다. 하나 이상의 비디오 트랙이 + 혼합된 경우 첫 번째 비디오 트랙이 사용됩니다. 그렇지 않으면 첫 번째 오디오 트랙이 사용됩니다. + +

    + +
    + +
  • + + +
  • + +

    + 'interval:time-spec' – 이 모드는 + time-spec으로 지정된 일정한 간격으로 하나의 장을 만듭니다. 형식은 + HH:MM:SS.nnnnnnnnn 또는 숫자 뒤에 's', + 'ms' 또는 'us' 가 붙은 형식으로 표시됩니다. + +

    + + +

    + 예: --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ 새 챕터의 이름은 --generate-chapters-name-template + 옵션으로 제어됩니다. 언어는 --generate-chapters + 이전에 발생해야 하는 --chapter-language로 설정됩니다. + +

+ +
--generate-chapters-name-template + template + +

+ 이것은 --generate-chapters + 옵션으로 생성된 챕터 이름의 이름 템플릿을 설정합니다. 이 옵션을 사용하지 않으면 기본 'Chapter + <NUM:2>'이 사용됩니다. + +

+ + +

+ 템플릿에서 사용할 수 있는 몇 가지 변수는 챕터가 생성될 때 실제 값으로 대체됩니다. 문자열 + '<NUM>'은 챕터 번호로 대체됩니다. 문자열 + '<START>'는 챕터의 시작 타임스탬프로 대체됩니다. + +

+ + +

+ The strings '<FILE_NAME>' and + '<FILE_NAME_WITH_EXT>' are only filled when + generating chapters for appended files. They will be replaced by the + appended file's name without respectively with its extension. Note that + only the file's base name and extension are inserted, not its directory or + drive components. + +

+ + +

+ '<NUM:places>'로 챕터 번호의 최소 자리 수를 지정할 수 있습니다. 예: + '<NUM:3>' 위치의 수가 지정된 수보다 작으면 결과의 숫자는 0으로 채워집니다. + +

+ + +

+ 시작 타임스탬프가 사용하는 형식을 <START:format>로 제어할 수 있습니다. 형식은 + 따로 지정되지 않은 경우 '%H:%M:%S'로 기본 설정됩니다. 유효한 형식 코드는 다음과 같습니다. + +

+ + +
    + +
  • + +

    %h – 시간 +

    + +
  • + +
  • + +

    %H – zero-padded로 두 자리수를 만드는데 걸린 시간 +

    + +
  • + +
  • + +

    %m – 분 +

    + +
  • + +
  • + +

    %M – zero-padded로 두 자리수를 만드는데 걸린 분 +

    + +
  • + +
  • + +

    %s – 초 +

    + +
  • + +
  • + +

    %S – zero-padded로 두 자리수를 만드는데 걸린 초 +

    + +
  • + +
  • + +

    %n – nanoseconds with nine places +

    + +
  • + +
  • + +

    %<1-9>n – nanoseconds with up to nine places + (e.g. three places with %3n) +

    + +
  • + +
+ +
--cue-chapter-name-format format + +

+ mkvmerge(1)는 오디오 파일의 CUE 시트를 챕터의 입력으로 읽을 수 있도록 + 지원합니다. CUE 시트에는 일반적으로 각 인덱스 항목에 대한 + PERFORMERTITLE 항목이 + 포함됩니다. mkvmerge(1)는 이 두 문자열을 사용하여 장 이름을 구성합니다. 이 옵션을 사용하여 이 이름에 사용되는 형식을 설정할 + 수 있습니다. + +

+ + +

+ 이 옵션이 제공되지 않은 경우 mkvmerge(1) 형식은 '%p - %t'(performer, 공백, 대시, 다른 + 공백 및 제목 뒤에 있음)으로 기본 설정됩니다. + +

+ + +

+ 형식이 지정되면 다음 메타 문자를 제외한 모든 문자가 그대로 복사되고 메타 문자는 다음과 같이 바뀝니다. + +

+ + +
    + +
  • + +

    %p는 현재 항목의 PERFORMER 문자열로 대체됩니다. +

    + +
  • + +
  • + +

    %t는 현재 항목의 TITLE 문자열로 대체됩니다. +

    + +
  • + +
  • + +

    %n는 현재 트랙 번호로 대체됩니다. +

    + +
  • + +
  • + +

    %N은 <10일 경우 leading 0으로 패딩된 현재 트랙 번호로 대체됩니다. +

    + +
  • + +
+ +
--chapters file-name + +

+ 파일 file-name에서 챕터 정보를 읽습니다. 자세한 내용은 아래의 chapters 섹션을 참조하십시오. + +

+ +
--global-tags file-name + +

+ 파일 file-name에서 전역 태그를 읽습니다. 자세한 내용은 아래의 tags 섹션을 참조하십시오. + +

+ +
+ + + +

2.4. 일반 출력 제어 (고급 전역 옵션)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order + FID1:TID1,FID2:TID2,... + +

+ 이 옵션은 입력 파일의 트랙이 생성되는 순서를 변경합니다. 인수는 쌍 ID의 쉼표로 구분된 목록입니다. 각 쌍에는 먼저 파일 + ID(FID1)가 포함되어 있으며, 이는 단순히 0부터 시작하는 명령줄의 파일 번호입니다. 두 + 번째는 해당 파일의 트랙 ID(TID1)입니다. 일부 트랙 ID가 생략된 경우 이 옵션과 함께 + 제공된 트랙이 생성된 후 해당 트랙이 생성됩니다. + +

+ +
--cluster-length spec + +

+ 각 클러스터의 데이터 블록 수 또는 데이터 기간을 제한합니다. spec 매개 변수는 단위가 없는 + 숫자 n이거나 ms로 고정된 숫자 + d이 될 수 있습니다. + +

+ + +

+ 단위가 사용되지 않으면 mkvmerge(1)는 최대 n개의 데이터 블록을 각 클러스터에 + 넣습니다. 최대 블록 수는 65535입니다. + +

+ + +

+ 숫자 d가 'ms'로 고정된 경우 mkvmerge(1)는 최대 + d 밀리초의 데이터를 각 클러스터에 넣습니다. d의 + 최소값은 100ms이고, 최대값은 32000ms입니다. + +

+ + +

+ mkvmerge(1)는 기본적으로 최대 65535개의 데이터 블록과 5000ms의 데이터를 클러스터에 저장합니다. + +

+ + +

+ 특정 프레임을 찾으려는 프로그램은 클러스터에만 직접 검색할 수 있으며 이후 전체 클러스터를 읽어야 합니다. 따라서 더 큰 클러스터를 + 만드는 것은 부정확하거나 느린 탐색으로 이어질 수 있습니다. + +

+ +
--clusters-in-meta-seek + +

+ 모든 클러스터를 포함하는 파일 끝에 메타 검색 요소를 생성하도록 mkvmerge(1)를 지정합니다. Matroska file layout에 대한 섹션도 참조하십시오. + +

+ +
--timestamp-scale factor + +

+ 타임스탬프 축척 비율을 강제로 factor으로 설정합니다. 유효한 값은 + 1000..10000000 또는 특수 값 + -1입니다. + +

+ + +

+ 일반적으로 mkvmerge(1)는 1000000 값을 사용합니다. 즉, 타임스탬프와 지속 시간은 + 1ms의 정밀도를 갖습니다. 비디오 트랙을 포함하지 않지만 하나 이상의 오디오 트랙 mkvmerge(1)가 포함된 파일의 경우 모든 + 타임스탬프와 지속 시간이 하나의 오디오 샘플의 정밀도를 갖도록 타임스탬프 스케일 팩터를 자동으로 선택합니다. 이는 더 큰 오버헤드를 + 발생시키지만 정확한 탐색과 추출을 가능하게 합니다. + +

+ + +

+ 특수 값인 -1을 사용하면 mkvmerge(1)는 비디오 트랙이 있더라도 샘플 정밀도를 사용합니다. + +

+ +
--enable-durations + +

+ 모든 블록에 대한 기간을 기록합니다. 이렇게 하면 파일 크기가 증가하며 현재 사용자에게 추가 값을 제공하지 않습니다. + +

+ +
--no-cues + +

+ mkvmerge(1)에 AVI의 인덱스와 비교할 수 있는 큐 데이터를 만들고 쓰지 않도록 지시합니다. Matroska(tm) 파일은 큐 데이터 + 없이 재생할 수 있지만 찾는 것은 아마도 부정확하고 느릴 것입니다. 공간이나 테스트 목적으로 매우 간절한 경우에만 사용하십시오. 각 입력 + 파일에 대해 지정할 수 있는 옵션 --cues도 참조하십시오. + +

+ +
--no-date + +

+ 기본적으로 mkvmerge(1)는 "날짜" 세그먼트 정보 필드를 다중화가 시작된 시간 & 날짜로 설정합니다. 이 옵션을 사용하면 + 해당 필드가 전혀 기록되지 않습니다. + +

+ +
--disable-lacing + +

+ 모든 트랙에 대해 레이싱을 비활성화합니다. 이렇게 하면 특히 오디오 트랙이 많은 경우 파일 크기가 커집니다. 이 옵션은 일상적인 사용을 + 위한 것은 아닙니다. + +

+ +
--disable-track-statistics-tags + +

+ 일반적으로 mkvmerge(1)는 각 트랙에 대한 통계를 사용하여 특정 태그를 작성합니다. 이러한 태그가 이미 있으면 덮어씁니다. 태그는 + BPS, DURATION, + NUMBER_OF_BYTES 및 + NUMBER_OF_FRAMES입니다 . + +

+ + +

+ 이 옵션을 활성화하면 mkvmerge(1)가 이러한 태그를 작성하고 동일한 이름의 기존 태그를 생성하지 못하게 됩니다. + +

+ +
--disable-language-ietf + +

+ 일반적으로 mkvmerge(1)는 트랙 헤더, 챕터 및 태그에 레거시 언어 요소와 더불어 새로운 IETF BCP 47 언어 요소를 + 작성합니다. 이 옵션을 사용하면 레거시 요소만 기록됩니다. + +

+ +
--normalize-language-ietf mode + +

+ 모든 IETF BCP 47 언어 태그를 모드 'canonical'의 표준 형식, 모드 + 'extlang'의 확장 언어 하위 태그 형식으로 정규화하거나 모드 + 'off'로 해제할 수 있습니다. 기본적으로 표준 형식에 대한 정규화가 적용됩니다. + +

+ + +

+ 표준 형식에서 기본값이 존재하는 모든 하위 태그는 해당 기본 값으로 대체됩니다. 이를 통해 + 'zh-yue-jyutping'을 'yue-jyutping'으로 + 변환하거나 'fr-FX'를 'fr-FR'로 변환합니다. + +

+ + +

+ 확장 언어 하위 태그 형식의 경우 표준 형식이 먼저 구축됩니다. 나중에 확장 언어 하위 태그가 존재하는 모든 기본 언어는 확장 언어 하위 + 태그와 접두사로 대체됩니다. 예를 들면 'yue-jyutping'을 + 'zh-yue-jyutping'으로 다시 변환하지만 'fr'은 확장 + 언어 하위 태그가 아니기 때문에 'fr-FR'에는 영향을 미치지 않습니다. + +

+ +
--stop-after-video-ends + +

+ Stops processing after the primary video track ends, discarding any + remaining packets of other tracks. + +

+ +
+ + + +

2.5. 파일 분할, 링크, 결합 및 연결 (추가 전역 옵션)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split specification + +

+ 지정된 크기 또는 지정된 시간 후에 출력 파일을 분할합니다. 트랙은 키 프레임 바로 앞에서만 분할할 수 있습니다. 따라서 분할 지점은 + 사용자가 지정한 것과 약간 다를 수 있습니다. + +

+ + +

+ 현재 mkvmerge(1)는 다음 모드를 지원합니다. + +

+ + +
    + +
  1. + +

    + 크기별로 나눠짐. + +

    + + +

    + 구문: --split + [size:]d[k|m|g] + +

    + + +

    + 예: --split size:700m or --split 150000000 + +

    + + +

    + 매개 변수 d는 크기가 각각 KB, MB 또는 GB임을 나타내기 위해 + 'k', 'm' 또는 'g'로 끝날 + 수 있습니다. 그렇지 않으면 바이트 단위의 크기로 가정됩니다. 현재 출력 파일이 이 크기 제한에 도달하면 새 파일이 시작됩니다. + +

    + + +

    + 'size:' 접두사는 호환성을 위해 생략될 수 있습니다. + +

    + +
  2. + + +
  3. + +

    + 일정 기간 후 분할함. + +

    + + +

    + 구문: --split + [duration:]HH:MM:SS.nnnnnnnnn|ds + +

    + + +

    + 예: --split duration:00:60:00.000 or --split 3600s + +

    + + +

    + 매개 변수는 최대 나노초 정밀도로 지속 시간을 지정하기 위한 + 형식HH:MM:SS.nnnnnnnn이거나 지속 시간(초)에 대해 문자 + 's' 뒤에 오는 숫자d여야 + 합니다. HH는 시간 단위, MM은 분 단위, + SS는 초 단위, nnnnnnnn은 나노 + 단위입니다. 시간 수와 나노초 수는 모두 생략할 수 있습니다. 소수점 뒤에는 최대 9자리까지 있을 수 있습니다. 현재 출력의 내용 지속 + 시간이 이 제한에 도달하면 새 출력 파일이 시작됩니다. + +

    + + +

    + 'duration:' 접두사는 호환성을 위해 생략될 수 있습니다. + +

    + +
  4. + + +
  5. + +

    + 특정 타임스탬프 뒤에 분할함. + +

    + + +

    + 구문: --split + timestamps:A[,B[,C...]] + +

    + + +

    + 예: --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + 매개 변수 A, B, + C 등은 모두 기간 동안 사용된 형식과 동일해야 합니다(위 참조). 타임스탬프 목록은 쉼표로 + 구분됩니다. 입력 스트림이 현재 분할점의 타임스탬프에 도달하면 새 파일이 생성됩니다. 그런 다음 이 목록에 지정된 다음 분할점이 + 사용됩니다. + +

    + + +

    + 'timestamps:' 접두사는 생략할 수 없습니다. + +

    + +
  6. + + +
  7. + +

    + 타임스탬프 범위를 지정하여 특정 부분을 유지하고 다른 부분은 무시합니다. + +

    + + +

    + 구문: --split + parts:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + 예: +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + parts 모드는 mkvmerge(1)에 특정 범위의 타임스탬프를 유지하면서 다른 타임스탬프는 무시하도록 + 지시합니다. 유지할 범위는 parts: 키워드 뒤에 나열되고 쉼표로 구분되어야 합니다. 범위 자체는 + --split의 다른 변형 허용 형식과 동일한 형식의 시작 및 종료 타임스탬프로 구성됩니다(예: + 00:01:2080s는 모두 동일한 타임스탬프를 참조). + +

    + + +

    + 시작 타임스탬프가 생략된 경우 기본값은 이전 범위의 끝 타임스탬프로 설정됩니다. 이전 범위가 없으면 기본적으로 파일 시작 부분으로 + 설정됩니다(예시 3번 참조). + +

    + + +

    + 종료 타임스탬프가 생략된 경우 기본적으로 mkvmerge(1)가 나머지를 보관하도록 지시하는 소스 파일의 끝으로 기본 설정됩니다(예시 3번 + 참조). + +

    + + +

    + 일반적으로 각 범위는 새 파일에 기록됩니다. 연속된 범위가 동일한 파일에 쓰이도록 변경할 수 있습니다. 이를 위해 사용자는 시작 + 타임스탬프 앞에 +를 붙여야 합니다. 이 경우 mkvmerge(1)는 새 파일을 만들지 말고 이전 범위가 + 기록된 동일한 파일에 범위를 추가하도록 지시합니다. 입력 파일의 두 범위에 공백이 있더라도 출력 파일에 공백이 없도록 타임스탬프가 + 조정됩니다. + +

    + + +

    + 예시 1번에서 mkvmerge(1)는 두 개의 파일을 만듭니다. 첫 번째 항목은 00:01:20부터 + 00:02:45까지의 내용을 포함합니다. 두 번째 파일에는 + 00:05:50부터 00:10:30까지 내용이 포함됩니다. + +

    + + +

    + 예시 2번에서 mkvmerge(1)는 한 개의 파일을 만듭니다. 해당 항목은 00:01:20부터 + 00:02:45까지의 내용과 00:05:50부터 + 00:10:30까지 내용을 모두 포함합니다. + +

    + + +

    + 예시 3번에서 mkvmerge(1)는 두 개의 파일을 만듭니다. 첫 번째 파일은 원본 파일의 시작부터 + 00:02:45까지 내용을 포함합니다. 두 번째 파일에는 + 00:05:50부터 원본 파일 끝까지 내용이 포함됩니다. + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1)는 주요 프레임 위치에서만 분할에 대한 결정을 내립니다. 이것은 각 범위의 시작과 끝 모두에 적용됩니다. 따라서 종료 + 타임스탬프가 두 키 프레임 사이에 있더라도 다음 키 프레임은 제외하지만 프레임은 계속 출력합니다. + +

    + +
    + +
  8. + + +
  9. + +

    + 프레임/필드 번호 범위를 지정하여 특정 부분을 보관하고 다른 부분은 삭제합니다. + +

    + + +

    + 구문: --split + parts-frames:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + 예: +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + parts-frames 모드는 mkvmerge(1)에게 프레임/필드 번호의 특정 범위를 유지하는 동시에 + 다른 범위도 무시하도록 지시합니다. 유지할 범위는 parts-frames: 키워드 뒤에 나열되고 쉼표로 + 구분되어야 합니다. 범위 자체는 시작 및 끝 프레임/필드 번호로 구성됩니다. 번호는 1부터 시작합니다. + +

    + + +

    + 시작 번호가 생략된 경우 기본값은 이전 범위의 끝 번호입니다. 이전 범위가 없으면 기본적으로 파일 시작 부분으로 설정됩니다(예시 3번 + 참조). + +

    + + +

    + 끝 번호가 생략된 경우 기본적으로 mkvmerge(1)가 나머지를 보관하도록 지시하는 소스 파일의 끝으로 기본 설정됩니다(예시 3번 + 참조). + +

    + + +

    + 일반적으로 각 범위는 새 파일에 기록됩니다. 연속된 범위가 동일한 파일에 쓰이도록 변경할 수 있습니다. 이를 위해 사용자는 시작 번호 + 앞에 +를 붙여야 합니다. 이 경우 mkvmerge(1)는 새 파일을 만들지 말고 이전 범위가 기록된 + 동일한 파일에 범위를 추가하도록 지시합니다. 입력 파일의 두 범위에 공백이 있더라도 출력 파일에 공백이 없도록 타임스탬프가 조정됩니다. + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1)는 주요 프레임 위치에서만 분할에 대한 결정을 내립니다. 이것은 각 범위의 시작과 끝 모두에 적용됩니다. 따라서 종료 + 프레임/필드 번호가 두 키 프레임 사이에 있더라도 다음 키 프레임은 제외하지만 프레임은 계속 출력합니다. + +

    + +
    + + +

    + 예시 1번에서 mkvmerge(1)는 두 개의 파일을 만듭니다. 첫 번째 항목은 137 이후 첫 번째 키 + 프레임에서 시작하여 258 이후 첫 번째 키 프레임을 제외한 내용을 포함합니다. 두 번째 파일에는 + 548에서 1211까지의 내용이 포함됩니다. + +

    + + +

    + 예시 2번에서 mkvmerge(1)는 한 개의 파일을 만듭니다. 해당 항목은 733부터 + 912까지의 내용과 1592부터 + 2730까지 내용을 모두 포함합니다. + +

    + + +

    + 예시 3번에서 mkvmerge(1)는 두 개의 파일을 만듭니다. 첫 번째 파일은 원본 파일의 시작부터 + 430까지 내용을 포함합니다. 두 번째 파일에는 2512부터 원본 + 파일 끝까지 내용이 포함됩니다. + +

    + + +

    + 이 모드는 출력되는 첫 번째 비디오 트랙만 고려합니다. 비디오 트랙이 출력되지 않으면 분할되지 않습니다. + +

    + + +
    +

    Note:

    + +

    + 이 인수와 함께 제공된 숫자는 출력되는 Matroska(tm) 블록의 수를 기준으로 해석됩니다. 단일 Matroska(tm) 블록에는 전체 + 프레임(프로그레시브 콘텐츠용) 또는 단일 필드(인터레이스 콘텐츠용)가 포함됩니다. mkvmerge는 이 둘을 구분하지 않고 단순히 블록의 + 수를 세는 것입니다. 예: 인터레이스된 콘텐츠가 있는 25번째 전체 프레임 이후에 분할하려면 분할점으로 + 50(전체 프레임당 두 필드)을 사용해야 합니다. + +

    + +
    + +
  10. + + +
  11. + +

    + 특정 프레임/필드 뒤에 분할함. + +

    + + +

    + 구문: --split + frames:A[,B[,C...]] + +

    + + +

    + 예: --split frames:120,237,891 + +

    + + +

    + 매개변수 A, B, + C 등은 모두 양의 정수여야 합니다. 번호는 1부터입니다. 프레임/필드 번호 목록은 쉼표로 + 구분됩니다. 입력 스트림이 현재 분할점의 프레임/필드 번호에 도달하면 새 파일이 생성됩니다. 그런 다음 이 목록에 지정된 다음 분할점이 + 사용됩니다. + +

    + + +

    + 'frames:' 접두사는 생략할 수 없습니다. + +

    + + +

    + 이 모드는 출력되는 첫 번째 비디오 트랙만 고려합니다. 비디오 트랙이 출력되지 않으면 분할되지 않습니다. + +

    + + +
    +

    Note:

    + +

    + 이 인수와 함께 제공된 숫자는 출력되는 Matroska(tm) 블록의 수를 기준으로 해석됩니다. 단일 Matroska(tm) 블록에는 전체 + 프레임(프로그레시브 콘텐츠용) 또는 단일 필드(인터레이스 콘텐츠용)가 포함됩니다. mkvmerge는 이 둘을 구분하지 않고 단순히 블록의 + 수를 세는 것입니다. 예: 인터레이스된 콘텐츠가 있는 25번째 전체 프레임 이후에 분할하려면 분할점으로 + 50(전체 프레임당 두 필드)을 사용해야 합니다. + +

    + +
    + +
  12. + + +
  13. + +

    + 특정 챕터 전에 분할함. + +

    + + +

    + 구문: --split chapters:all or + --split + chapters:A[,B[,C...]] + +

    + + +

    + 예: --split chapters:5,8 + +

    + + +

    + 매개변수 A, B, + C 등은 모두 양의 정수여야 합니다. 번호는 1부터입니다. 챕터 번호 목록은 쉼표로 + 구분됩니다. 번호가 나열된 장의 시작 타임스탬프와 같거나 큰 첫 번째 키 프레임 바로 앞에서 분할이 발생합니다. 0s로 시작하는 챕터는 + 분할로 간주되지 않으며 자동으로 삭제됩니다. + +

    + + +

    + 모든 챕터 번호를 수동으로 나열하는 대신 키워드 all을 사용할 수 있습니다. + +

    + + +

    + 'chapters:' 접두사는 생략할 수 없습니다. + +

    + + +
    +

    Note:

    + +

    + Matroska(tm) 파일 형식은 'edition entries' 및 'chapter atoms'라고 하는 임의의 깊이 중첩된 챕터 구조를 + 지원합니다. 그러나 이 모드는 모든 버전 항목에서 가장 높은 수준의 챕터만 고려합니다. + +

    + +
    + +
  14. + +
+ + +

+ 이 분할 모드에서는 출력 파일 이름이 일반 작동과 다르게 처리됩니다. 옵션 필드 너비(예: '%02d')를 + 포함하여 식 '%d'와 같은 printf를 포함할 수 있습니다. 이 경우 + 현재 파일 번호가 적절하게 포맷되고 파일 이름의 해당 지점에 삽입됩니다. 이러한 패턴이 없으면 파일 확장자 바로 전에 + '-%03d' 패턴을 가정합니다: '-o output.mkv'는 + 'output-001.mkv' 등의 결과를 도출합니다. 확장자가 없으면 이름에 + '-%03d'가 추가됩니다. + +

+ + +

+ 또 다른 가능한 패턴은 '%c'로, 파일의 첫 번째 장의 이름으로 대체됩니다. '%c'가 + 있으면 패턴 '-%03d'는 자동으로 추가되지 않습니다. + +

+ +
--link + +

+ 출력 파일을 분할할 때 파일을 서로 연결합니다. 자세한 내용은 아래의 file linking 섹션을 참조하십시오. + +

+ +
--link-to-previous segment-UID + +

+ 첫 번째 출력 파일을 segment-UID 파라미터로 지정된 세그먼트 UID로 세그먼트에 + 연결합니다. 자세한 내용은 아래 file linking + 섹션을 참조하십시오. + +

+ + +

+ SID가 =로 시작하는 경우, 나머지 부분은 UID 세그먼트를 읽고 사용하는 Matroska 파일의 이름으로 해석됩니다. + +

+ +
--link-to-next segment-UID + +

+ 마지막 출력 파일을 segment-UID 파라미터로 지정된 세그먼트 UID로 세그먼트에 + 연결합니다. 자세한 내용은 아래 file linking + 섹션을 참조하십시오. + +

+ + +

+ SID가 =로 시작하는 경우, 나머지 부분은 UID 세그먼트를 읽고 사용하는 Matroska 파일의 이름으로 해석됩니다. + +

+ +
--append-mode mode + +

+ 파일을 추가할 때 타임스탬프가 계산되는 방법을 결정합니다. 매개 변수 mode에는 기본값인 + 'file'과 'track'의 두 가지 값이 있을 수 있습니다. + +

+ + +

+ mkvmerge가 두 번째 파일('file2'라고 함)의 + 트랙('track2_1'이라고 함)을 첫 번째 + 파일('file1'이라고 함)의 트랙('track1_1'이라고 함)에 + 추가할 때, 'track2_1'에 대한 모든 타임스탬프를 특정 양만큼 오프셋해야 + 합니다. 'file' 모드의 경우 타임스탬프가 'track1_1'과 + 다른 트랙의 타임스탬프일지라도 이 양은 'file1'에서 발생하는 가장 높은 타임스탬프입니다. 트랙 + 모드에서 오프셋은 'track1_1'의 가장 높은 타임스탬프입니다. + +

+ + +

+ 안타깝게도 mkvmerge가 안정적으로 사용할 모드를 감지할 수 없습니다. 따라서 기본값은 file + 모드입니다. 'file' 모드는 일반적으로 AVI 또는 + MP4 파일을 추가하는 경우와 같이 서로 독립적으로 생성된 파일에 더 잘 + 작동합니다. 'track' 모드는 기본적으로 하나의 큰 파일의 일부인 소스(예: + VOBEVO 파일)에서 더 잘 작동할 수 있습니다. + +

+ + +

+ 자막 트랙은 'track' 모드가 실제로 활성화되어 있더라도 항상 + 'file' 모드가 활성화된 것처럼 처리됩니다. + +

+ +
--append-to + SFID1:STID1:DFID1:DTID1[,...] + +

+ 이 옵션은 다른 트랙이 추가되는 트랙을 제어합니다. 각 규격에는 파일 ID, 트랙 ID, 두 번째 파일 ID, 두 번째 트랙 ID의 네 + 가지 ID가 포함되어 있습니다. 첫 번째 쌍인 "소스 파일 ID"와 "소스 트랙 ID"는 추가될 트랙을 식별합니다. 두 번째 쌍인 + "목적지 파일 ID"와 "목적지 트랙 ID"는 첫 번째 쌍이 추가된 트랙을 식별합니다. + +

+ + +

+ 이 옵션을 생략한 경우 표준 매핑이 사용됩니다. 이 표준 매핑은 현재 파일의 각 트랙을 동일한 트랙 ID를 가진 이전 파일의 트랙에 + 추가합니다. 이렇게 하면 동영상을 두 부분으로 분할하고 두 파일의 트랙 수와 트랙 ID 수가 mkvmerge -o + output.mkv part1.mkv +part2.mkv인 경우 쉽게 추가할 수 있습니다. + +

+ +
+ + +

+ '+'가 하나만 있으면 다음 파일이 더해지는 대신 추가됩니다. 다음 파일 이름 앞에 '+'를 넣을 수도 있습니다. 따라서 다음 두 명령은 + 동일합니다. + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv file1.mkv +file2.mkv
+
[ file1 file2 + ] + +

+ 여러 파일 이름이 대괄호 쌍에 포함된 경우 두 번째 파일과 다음 모든 파일이 대괄호 안의 첫 번째 파일에 추가됩니다. + +

+ + +

+ 이것은 파일 이름 사이에 '+'를 사용하는 대체 구문입니다. 따라서 다음 두 명령은 동일합니다. + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv '[' file1.mkv file2.mkv ']'
+
= + +

+ 특정 파일 형식(MPEG 프로그램 스트림 = VOBs)의 경우 일반적으로 기본 이름이 같고 실행 번호만 다른 파일(예: + 'VTS_01_1)'과 동일한 디렉터리에서 파일을 찾습니다.VOB', 'VTS_01_2.VOB', 'VTS_01_3.VOB' 등) 및 + 모든 파일을 하나의 큰 파일로 연결된 것처럼 처리합니다. 단일 '=' 옵션을 선택하면 mkvmerge가 이러한 추가 파일을 찾지 + 않습니다. + +

+ + +

+ 다음 파일 이름 앞에 '='를 넣을 수도 있습니다. 따라서 다음 두 명령은 동일합니다. + +

+ +
$ mkvmerge -o full.mkv = file1.vob
+$ mkvmerge -o full.mkv =file1.vob
+
( file1 file2 + ) + +

+ 여러 개의 파일 이름이 괄호 쌍에 포함된 경우 해당 파일은 각 파일의 내용으로 구성된 하나의 큰 파일로 연결된 것처럼 처리됩니다. + +

+ + +

+ 예를 들어 DVD 또는 MPEG 전송 스트림에서 오는 VOB 파일에 사용할 수 있습니다. AVI나 MP4와 같은 독립 실행형 파일의 + 경우처럼 각 파일에 자체 헤더 집합이 포함되어 있으면 사용할 수 없습니다. + +

+ + +

+ 또한 파일 이름을 괄호 안에 넣으면 mkvmerge(1)가 option + =에 설명된 것과 동일한 기본 이름을 가진 추가 파일을 찾을 수 없습니다. 따라서 이 두 + 명령은 동일합니다. + +

+ +
$ mkvmerge -o out.mkv = file.mkv
+$ mkvmerge -o out.mkv '(' file.mkv ')'
+ +

+ 몇 가지 사항에 유의해야 합니다: + +

+ + +
    + +
  1. + +

    + 열림과 닫힘 괄호 앞에 모두 공백이 있어야 합니다. + +

    + +
  2. + + +
  3. + +

    + 괄호 사이의 모든 매개 변수는 파일 이름으로 해석됩니다. 따라서 이 논리 파일에 적용되는 모든 옵션은 여는 괄호 앞에 나열되어야 합니다. + +

    + +
  4. + + +
  5. + +

    + 일부 셸에서는 괄호를 특수 문자로 취급합니다. 따라서 위의 예와 같이 escape하거나 인용해야 합니다. + +

    + +
  6. + +
+ +
+ + + + +

2.6. 첨부 파일 지원 (추가 전역 옵션)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description 설명 + +

+ 다음 첨부 파일에 대한 일반 텍스트 설명입니다. 다음 --attach-file + 또는 --attach-file-once 옵션에 적용됩니다. + + +

+ +
--attachment-mime-type MIME type + +

+ 다음 첨부 파일의 MIME 형식입니다. 다음 --attach-file + 또는 --attach-file-once + 옵션에 적용됩니다. 공식적으로 인정된 MIME 유형의 목록은 the IANA + hompage에서 확인할 수 있습니다. 첨부 파일의 경우 MIME 유형은 필수 사항입니다. + +

+ + +

+ 첨부 파일에 대해 MIME 유형이 지정되지 않은 경우 해당 유형은 자동으로 탐지됩니다. + +

+ +
--attachment-name name + +

+ 이 첨부 파일의 출력 파일에 저장할 이름을 설정합니다. 이 옵션을 지정하지 않으면 --attach-file + 또는 --attach-file-once + 옵션과 함께 지정된 첨부 파일의 파일 이름에서 이름이 파생됩니다. + +

+ +
+ --attach-file file-name, + --attach-file-once file-name + + +

+ Matroska(tm) 파일 내부에 첨부 파일을 작성합니다. 이 옵션을 사용하려면 MIME 유형이 설정되어 + 있어야 합니다. 두 형식의 차이점은 --attach-file로 첨부된 파일이 분할되는 동안 모든 출력 + 파일에 첨부되는 반면 --attach-file-once로 첨부된 파일은 처음 생성된 파일에만 첨부된다는 + 것입니다. 분할을 사용하지 않으면 둘 다 동일하게 수행합니다. + +

+ + +

+ mkvextract(1)Matroska(tm) 파일에서 첨부 파일을 추출하는 데 사용할 수 있습니다. + +

+ +
--enable-legacy-font-mime-types + +

+ 특정 유형의 글꼴 첨부 파일에 대해 기존 MIME 유형을 사용할 수 있습니다. 예를 들어 TrueType + 글꼴에는 'fonts/ttf' 대신 + 'application/x-truetype-font'가 사용됩니다. + +

+ + +

+ 이는 MIME 유형이 자동으로 감지되는 경우 새 첨부 파일과 저장된 MIME + 유형이 기존 첨부 파일에 다시 매핑되는 경우 모두 영향을 미칩니다. + +

+ + +

+ 영향을 받는 MIME 유형은 + 'application/x-truetype-fonts'에 매핑된 + 'font/sfnt'와 'font/ttf', + 'font/collection'이고 + 'application/vnd.ms-opentype'에 매핑된 + 'font/otf' 입니다. + +

+ +
+ + + +

2.7. 각 입력 파일에 대해 사용 가능한 옵션

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks + [!]n,m,... + +

+ 오디오 트랙 n, m 등을 복사합니다. 번호는 + --identify + 스위치로 얻을 수 있는 트랙 ID입니다. 단순한 트랙 번호는 아닙니다(섹션 track IDs 참조). 기본값: 모든 오디오 트랙을 복사합니다. + +

+ + +

+ 트랙 ID 대신 ISO 639-2 언어 코드를 제공할 수도 있습니다. 트랙에 대한 언어 태그를 제공하는 소스 파일에만 사용할 수 + 있습니다. + +

+ + +

+ 기본값: 이 종류의 모든 트랙을 복사합니다. + +

+ + +

+ ID가 !로 접두사가 붙으면 의미는 반대로 됩니다: ! 뒤에 나열된 + 트랙을 제외한 이러한 종류의 모든 트랙을 복사합니다. + +

+ +
-d, --video-tracks + [!]n,m,... + +

+ 비디오 트랙 n, m 등을 복사합니다. 번호는 + --identify + 스위치로 얻을 수 있는 트랙 ID입니다. 단순한 트랙 번호는 아닙니다(섹션 track IDs 참조). 기본값: 모든 비디오 트랙을 복사합니다. + +

+ + +

+ 트랙 ID 대신 ISO 639-2 언어 코드를 제공할 수도 있습니다. 트랙에 대한 언어 태그를 제공하는 소스 파일에만 사용할 수 + 있습니다. + +

+ + +

+ ID가 !로 접두사가 붙으면 의미는 반대로 됩니다: ! 뒤에 나열된 + 트랙을 제외한 이러한 종류의 모든 트랙을 복사합니다. + +

+ +
-s, --subtitle-tracks + [!]n,m,... + +

+ 자막 트랙 n, m 등을 복사합니다. 번호는 --identify + 스위치로 얻을 수 있는 트랙 ID입니다. 단순한 트랙 번호는 아닙니다(섹션 track IDs 참조). 기본값: 모든 자막 트랙을 복사합니다. + +

+ + +

+ 트랙 ID 대신 ISO 639-2 언어 코드를 제공할 수도 있습니다. 트랙에 대한 언어 태그를 제공하는 소스 파일에만 사용할 수 + 있습니다. + +

+ + +

+ ID가 !로 접두사가 붙으면 의미는 반대로 됩니다: ! 뒤에 나열된 + 트랙을 제외한 이러한 종류의 모든 트랙을 복사합니다. + +

+ +
-b, --button-tracks + [!]n,m,... + +

+ 버튼 트랙 n, m 등을 복사합니다. 번호는 --identify + 스위치로 얻을 수 있는 트랙 ID입니다. 단순한 트랙 번호는 아닙니다(섹션 track IDs 참조). 기본값: 모든 버튼 트랙을 복사합니다. + +

+ + +

+ 트랙 ID 대신 ISO 639-2 언어 코드를 제공할 수도 있습니다. 트랙에 대한 언어 태그를 제공하는 소스 파일에만 사용할 수 + 있습니다. + +

+ + +

+ ID가 !로 접두사가 붙으면 의미는 반대로 됩니다: ! 뒤에 나열된 + 트랙을 제외한 이러한 종류의 모든 트랙을 복사합니다. + +

+ +
--track-tags + [!]n,m,... + +

+ 태그 트랙 n, m 등을 복사합니다. 번호는 --identify + 스위치로 얻을 수 있는 트랙 ID입니다(섹션 track IDs + 참조). 단순한 트랙 번호는 아닙니다. 기본값: 모든 트랙의 태그를 복사합니다. + +

+ + +

+ ID 앞에 !이 붙으면 의미가 반대로 됩니다. ! 뒤에 나열된 ID를 + 제외한 모든 것을 복사합니다. + +

+ +
-m, --attachments + [!]n[:all|first],m[:all|first],... + +

+ ID가 n, m인 첨부 파일을 모두 또는 첫 번째 출력 + 파일로 복사합니다. 각 ID 뒤에는 ':all'(둘 다 입력되지 않은 경우 기본값) 또는 + ':first'가 따를 수 있습니다. 분할이 활성 상태인 경우 ID가 + ':all'로 지정된 첨부 파일은 결과 출력 파일 모두에 복사되고 다른 첨부 파일은 첫 번째 출력 + 파일에만 복사됩니다. 분할이 활성화되지 않으면 두 변형 모두 동일한 효과를 가집니다. + +

+ + +

+ 기본값은 모든 첨부 파일을 모든 출력 파일에 복사하는 것입니다. + +

+ + +

+ ID 앞에 !이 붙으면 의미가 반대로 됩니다. ! 뒤에 나열된 ID를 + 제외한 모든 것을 복사합니다. + +

+ +
-A, --no-audio + +

+ 이 파일에서 어떤 오디오 트랙도 복사하지 않습니다. + +

+ +
-D, --no-video + +

+ 이 파일에서 어떤 비디오 트랙도 복사하지 않습니다. + +

+ +
-S, --no-subtitles + +

+ 이 파일에서 어떤 자막 트랙도 복사하지 않습니다. + +

+ +
-B, --no-buttons + +

+ 이 파일에서 어떤 버튼 트랙도 복사하지 않습니다. + +

+ +
-T, --no-track-tags + +

+ 이 파일에서 트랙의 어떤 특정한 태그도 복사하지 않습니다. + +

+ +
--no-chapters + +

+ 이 파일에서 챕터를 복사하지 않습니다. + +

+ +
-M, --no-attachments + +

+ 이 파일에서 첨부 파일을 복사하지 않습니다. + +

+ +
--no-global-tags + +

+ 이 파일에서 전역 태그를 복사하지 않습니다. + +

+ +
-y, --sync + TID:d[,o[/p]] + +

+ ID가 TID인 트랙의 타임스탬프를 dms 단위로 + 조정합니다. 트랙 ID는 --identify와 + 함께 제공된 ID와 동일합니다(섹션 track IDs 참조). + +

+ + +

+ o / p: + o / p로 타임스탬프를 조정하여 선형 드리프트를 + 고정합니다. p는 생략하면 1로 기본 설정됩니다. o와 + p는 모두 부동 소수점 숫자일 수 있습니다. + +

+ + +

+ 기본값: 수동 동기화 보정 없음(d = 0 및 + o / p = + 1.0과 동일) + +

+ + +

+ 이 옵션은 매번 다른 트랙 ID를 선택하여 여러 트랙에 적용되는 입력 파일에 대해 여러 번 사용할 수 있습니다. + +

+ +
--cues TID:none|iframes|all + +

+ 지정된 트랙에 대해 트랙 큐(인덱스) 항목이 생성되는 컨트롤입니다(섹션 track IDs + 참조). 'none'은 큐 항목 생성을 + 금지합니다. 'iframes'의 경우 후진 또는 전진 참조가 없는 블록(비디오 트랙의 = I 프레임)만 + 큐 시트에 들어갑니다. 'all'은 모든 블록에 대해 큐 항목을 생성하므로 파일이 매우 커집니다. + +

+ + +

+ 기본값은 비디오 및 자막 트랙의 경우 'iframes'이고 오디오 트랙의 경우 + 'none'입니다. 사용된 --cues 옵션에 관계없이 큐 항목 작성을 + 금지하는 --no-cues 옵션도 + 참조하십시오. + +

+ + +

+ 이 옵션은 매번 다른 트랙 ID를 선택하여 여러 트랙에 적용되는 입력 파일에 대해 여러 번 사용할 수 있습니다. + +

+ +
--default-track-flag + TID[:bool] + +

+ 선택적 인수 bool1로 설정되었거나 없는 경우 지정된 + 트랙에 대한 "기본 track" 플래그를 설정합니다(섹션 track IDs 참조). 소스 컨테이너가 해당 정보를 제공하지 않고 + 사용자가 이 옵션을 통해 정보를 지정하지 않으면 플래그가 설정됩니다. + +

+ + +

+ 사용자가 재생 중에 트랙을 명시적으로 선택하지 않는 경우 플레이어는 기본 트랙" 플래그가 설정된 트랙 중 하나를 선택해야 하며, + 사용자의 선호 언어와 같은 기본 설정을 고려해야 합니다. + +

+ + +

+ 이 옵션은 매번 다른 트랙 ID를 선택하여 여러 트랙에 적용되는 입력 파일에 대해 여러 번 사용할 수 있습니다. + +

+ +
--track-enabled-flag + TID[:bool] + +

+ 지정된 트랙(섹션 track IDs 참조)에 대한 + "track enabled" 플래그를 지정된 값 bool(0 또는 1;지정하지 + 않은 경우 기본값 1)으로 설정합니다. 트랙에 대한 옵션이 지정되지 않았고 원본 컨테이너가 이 정보를 제공하지 않는 경우 트랙은 + 기본적으로 활성화됩니다. + +

+ + +

+ "track enabled" 플래그가 설정된 트랙만 재생 대상으로 간주해야 합니다. + +

+ + +

+ 이 옵션은 매번 다른 트랙 ID를 선택하여 여러 트랙에 적용되는 입력 파일에 대해 여러 번 사용할 수 있습니다. + +

+ +
--forced-display-flag + TID[:bool] + +

+ 선택적 인수 bool1로 설정되었거나 없는 경우 지정된 + 트랙(섹션 track IDs 참조)에 대한 + "forced display" 플래그를 설정합니다. 화면 텍스트 또는 외국어 대화를 포함하는 트랙에 사용합니다. + +

+ + +

+ 이 옵션은 매번 다른 트랙 ID를 선택하여 여러 트랙에 적용되는 입력 파일에 대해 여러 번 사용할 수 있습니다. + +

+ +
--hearing-impaired-flag + TID[:bool] + +

+ 선택적 인수 bool1로 설정되었거나 없는 경우 지정된 + 트랙(섹션 track IDs 참조)에 대한 "청각 + 장애" 플래그를 설정합니다. 트랙이 청각 장애가 있는 사용자에게 적합한 경우 이 플래그를 설정할 수 있습니다. + +

+ + +

+ 이 옵션은 매번 다른 트랙 ID를 선택하여 여러 트랙에 적용되는 입력 파일에 대해 여러 번 사용할 수 있습니다. + +

+ +
--visual-impaired-flag + TID[:bool] + +

+ 선택적 인수 bool1로 설정되었거나 없는 경우 지정된 + 트랙(섹션 track IDs 참조)에 대한 "시각 + 장애" 플래그를 설정합니다. 트랙이 시각 장애가 있는 사용자에게 적합한 경우 이 플래그를 설정할 수 있습니다. + +

+ + +

+ 이 옵션은 매번 다른 트랙 ID를 선택하여 여러 트랙에 적용되는 입력 파일에 대해 여러 번 사용할 수 있습니다. + +

+ +
--text-descriptions-flag + TID[:bool] + +

+ 선택적 인수 bool1로 설정되었거나 없는 경우 지정된 + 트랙(섹션 track IDs 참조)에 대한 "텍스트 + 설명" 플래그를 설정합니다. 이 플래그는 트랙에 시각 장애인 사용자를 위한 텍스트 음성 변환 시스템을 통해 재생하기에 적합한 + 비디오 콘텐츠에 대한 텍스트 설명이 포함된 경우 설정할 수 있습니다. + +

+ + +

+ 이 옵션은 매번 다른 트랙 ID를 선택하여 여러 트랙에 적용되는 입력 파일에 대해 여러 번 사용할 수 있습니다. + +

+ +
--original-flag + TID[:bool] + +

+ 선택적 인수 bool1로 설정되었거나 없는 경우 지정된 + 트랙(섹션 track IDs 참조)에 대한 + "original language" 플래그를 설정합니다. 트랙이 내용의 원본 언어(번역이 아님)인 경우 이 플래그를 + 설정할 수 있습니다. + +

+ + +

+ 이 옵션은 매번 다른 트랙 ID를 선택하여 여러 트랙에 적용되는 입력 파일에 대해 여러 번 사용할 수 있습니다. + +

+ +
--commentary-flag + TID[:bool] + +

+ 선택적 인수 bool1로 설정되었거나 없는 경우 지정된 + 트랙(섹션 track IDs 참조)에 대한 + "commonmentary" 플래그를 설정합니다. 트랙에 해설이 포함된 경우 이 플래그를 설정할 수 있습니다. + +

+ + +

+ 이 옵션은 매번 다른 트랙 ID를 선택하여 여러 트랙에 적용되는 입력 파일에 대해 여러 번 사용할 수 있습니다. + +

+ +
--track-name TID:name + +

+ 지정된 트랙의 트랙 이름을 name으로 설정합니다(섹션 track IDs 참조). + +

+ +
--language TID:language + +

+ 지정된 트랙의 언어를 설정합니다(섹션 track IDs + 참조). ISO 639-2 언어 코드와 ISO 639-1 국가 코드가 모두 허용됩니다. 국가 코드는 자동으로 언어 코드로 + 변환됩니다. ISO 639-2 코드를 포함한 모든 언어는 --list-languages + 옵션으로 나열할 수 있습니다. + +

+ + +

+ 이 옵션은 매번 다른 트랙 ID를 선택하여 여러 트랙에 적용되는 입력 파일에 대해 여러 번 사용할 수 있습니다. + +

+ +
-t, --tags + TID:file-name + +

+ 파일 file-name에서 번호가 TID인 트랙의 + 태그를 읽습니다. 자세한 내용은 아래의 tags 섹션을 참조하십시오. + +

+ +
--aac-is-sbr + TID[:0|1] + +

+ mkvmerge(1) ID가 TID인 트랙이 SBR + AAC(HE-AAC 또는 AAC+라고도 함)임을 + 알립니다. 이 옵션은 a) 원본 파일이 AAC 파일(Matroska(tm) 파일의 경우 + not)이고 b) AAC 파일에 SBR + AAC 데이터가 포함되어 있는 경우에 필요합니다. 이 스위치를 사용하는 이유는 완전한 + AAC 프레임을 디코딩하지 않고는 일반 AAC 데이터를 SBR + AAC 데이터와 자동으로 구분하는 것이 기술적으로 불가능하기 때문입니다. AAC 디코더 + mkvmerge(1)는 여러 특허 문제가 있기 때문에 이 디코딩 단계를 포함하지는 않을 것이다. 따라서 SBR + AAC 파일의 경우 이 스위치는 필수 사항입니다. 스위치가 생략된 경우 결과 파일이 올바르게 재생되지 않거나 전혀 + 재생되지 않을 수 있습니다. + +

+ + +

+ 원본 파일이 Matroska(tm) 파일인 경우 CodecID만 있으면 SBR + AAC를 탐지할 수 있습니다. 하지만, 만약 CodecID가 잘못되었으면 이 + 스위치를 사용하여 수정할 수 있습니다. + +

+ + +

+ mkvmerge가 AAC 파일이 SBR임을 잘못 감지한 경우 트랙 ID에 + ':0'을 추가할 수 있습니다. + +

+ +
--audio-emphasis TID:n|symbolic-name + +

+ Sets the emphasis for the audio track with the track ID + TID. The mode can either be a number + n (certain values between 0 and + 16) or a symbolic name. All valid numbers & + symbolic names can be listed with the --list-audio-emphasis + option. + +

+ +
--reduce-to-core TID + +

+ 일부 오디오 코덱은 손실 없는 코어와 무손실 디코딩을 구현하는 옵션 확장자를 가지고 있습니다. 이 옵션은 mkvmerge(1)에 확장자를 + 복사하지 않고 코어만 복사하도록 지시합니다. 기본적으로 mkvmerge(1)는 코어와 확장자를 모두 복사합니다. + +

+ + +

+ 현재 DTS 트랙만 이 옵션의 영향을 받습니다. 내장형 AC-3 코어를 + 포함하는 TrueHD 트랙은 대신 사용자가 복사할 트랙을 선택할 수 있는 두 개의 개별 트랙으로 + 표시됩니다. DTS의 경우 True와 달리 HD 확장 기능을 자체적으로 디코딩할 수 없기 때문에 이러한 + 방식은 TrueHD 데이터 처럼 작동하지 않습니다. + +

+ +
--remove-dialog-normalization-gain + TID + +

+ 일부 오디오 코덱은 디코더나 플레이어에게 대화 상자 정규화를 위해 (일반적으로 네거티브의) 추가를 적용하도록 지시하는 헤더 필드를 + 포함합니다. 이 옵션은 mkvmerge(1)에 해당 헤더 필드를 수정하여 해당 추가를 제거하거나 최소화하도록 지시합니다. + +

+ + +

+ 현재 AC-3' DTSTrueHD 트랙만 + 이 옵션의 영향을 받습니다. + +

+ +
--timestamps TID:file-name + +

+ file-name에서 특정 트랙 ID에 사용할 타임스탬프를 읽습니다. 이러한 타임스탬프는 + mkvmerge(1)가 일반적으로 계산하는 타임스탬프를 강제로 재정의합니다. external timestamp files에 + 대한 섹션을 읽어 보십시오. + +

+ +
--default-duration TID:x + +

+ 지정된 트랙의 기본 지속 시간을 지정된 값으로 강제 적용합니다. 또한 기본 기간과 일치하도록 트랙의 타임스탬프를 + 수정합니다. x 인수는 's', + 'ms', 'us', 'ns', + 'fps', 'p' 또는 'i'로 + 게시하여 기본 지속 시간을 초, 밀리초, 마이크로초, 나노초, 'frames per second', 'progress frames per + second', 'interlaced frames per second'로 지정해야 합니다. 숫자 + x 자체는 부동 소수점 숫자 또는 분수일 수 있습니다. + +

+ + +

+ 기본 기간이 설정되지 않으면 mkvmerge는 컨테이너 및/또는 특정 트랙 유형(예: AVC/H.264 또는 MPEG-2)에 대한 + 인코딩된 비트스트림으로부터 트랙의 기본 기간을 도출하려고 시도합니다. + +

+ + +

+ 이 옵션을 사용하면 외부 타임스탬프 파일을 사용하지 않고도 비디오 트랙의 FPS를 변경할 수 있습니다. + +

+ +
--fix-bitstream-timing-information + TID[:0|1] + +

+ 일반적으로 mkvmerge(1)는 비디오 비트스트림에 저장된 타이밍 정보(프레임/필드 속도)를 변경하지 않습니다. 이 옵션을 사용하면 + 정보가 컨테이너 타이밍 정보와 일치하도록 조정됩니다. 컨테이너 타이밍 정보는 명령줄(옵션 --default-duration + 참조), 소스 컨테이너 또는 비트스트림에서 파생된 다양한 소스에서 얻을 수 있습니다. + +

+ + +
+

Note:

+ +

이 기능은 AVC/H.264 비디오 트랙에만 구현되었습니다.

+ +
+ +
--compression TID:n + +

+ 트랙에 사용할 압축 방법을 선택합니다. 사용자는 이 방법을 지원해야 합니다. 유효한 값은 'none', + 'zlib' 및 + 'mpeg4_p2'/'mpeg4p2'입니다. + +

+ +

+ 'mpeg4_p2'/'mpeg4p2' 압축 방식은 + MPEG4 파트 2 비디오 트랙에서만 사용할 수 있는 'header removal'라는 특수 압축 + 방식입니다. + +

+ +

+ 일부 자막 유형의 기본값은 'zlib' 압축입니다. 이 압축 방법은 모든 재생 애플리케이션이 아닌 경우 + 가장 많이 지원하는 압축 방법입니다. 'none' 이외의 다른 압축 방법에 대한 지원은 보장되지 + 않습니다. + +

+ +
+ + + +

2.8. 비디오 트랙에만 적용되는 옵션

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc + TID:FourCC + +

+ FourCC를 지정된 값으로 강제 적용합니다. 'MS 호환성 모드'의 비디오 트랙에서만 + 작동합니다. + +

+ +
--display-dimensions + TID:widthxheight + +

+ Matroska(tm) 파일에는 재생 시 플레이어가 이미지를 스케일링해야 하는 디스플레이 속성을 설정하는 두 가지 값(디스플레이 너비 및 + 디스플레이 높이)이 포함되어 있습니다. 이러한 값은 '1:640x480'과 같은 이 옵션으로 설정할 수 + 있습니다. + +

+ + +

+ 값을 지정하는 또 다른 방법은 --aspect-ratio + 또는 --aspect-ratio-factor + 옵션을 사용하는 것입니다(아래 참조). 이러한 옵션은 상호 배타적입니다. + +

+ +
--aspect-ratio + TID:ratio|width/height + +

+ Matroska(tm) 파일에는 재생 시 플레이어가 이미지를 스케일링해야 하는 디스플레이 속성을 설정하는 두 가지 값(디스플레이 너비 및 + 디스플레이 높이)이 포함되어 있습니다. 이 옵션을 사용하면 mkvmerge(1)가 이미지의 원래 너비와 높이 및 이 옵션과 함께 제공된 + 가로 세로 비율을 기준으로 디스플레이 너비와 디스플레이 높이를 자동으로 계산합니다. 비율은 부동소수점 번호 + ratio 또는 분수 + 'width/height'로 지정할 수 있습니다(예: + '16/9'). + +

+ + +

+ 값을 지정하는 또 다른 방법은 --aspect-ratio-factor + 또는 --display-dimensions + 옵션을 사용하는 것입니다(위 및 아래 참조). 이러한 옵션은 상호 배타적입니다. + +

+ +
--aspect-ratio-factor TID:factor|n/d + +

+ 가로 세로 비율을 설정하는 또 다른 방법은 factor을 지정하는 것입니다. 원래 가로 세로 + 비율은 먼저 이 factor와 곱한 다음 나중에 목표 가로 세로 비율로 사용됩니다. + +

+ + +

+ 값을 지정하는 또 다른 방법은 --aspect-ratio + 또는 --display-dimensions + 옵션을 사용하는 것입니다(위 참조). 이러한 옵션은 상호 배타적입니다. + +

+ +
--cropping TID:left,top,right,bottom + +

+ 비디오 트랙의 픽셀 자르기 파라미터를 지정된 값으로 설정합니다. + +

+ +
--color-matrix-coefficients TID:n + +

+ 빨간색, 녹색 및 파란색 기본 색상에서 루마 및 크로마 값을 도출하는 데 사용되는 비디오의 매트릭스 계수를 설정합니다. 매개 변수 + n010 + 사이의 정수입니다. + +

+ + +

+ 유효한 값과 그 의미는 다음과 같습니다: + +

+ + +

+ 0: GBR, 1: BT709, + 2: unspecified, 3: reserved, + 4: FCC, 5: BT470BG, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 non-constant + luminance, 10: BT2020 constant luminance + +

+ +
--color-bits-per-channel TID:n + +

+ 색상 채널의 코드화된 비트 수를 설정합니다. 값이 0이면 비트 수가 지정되지 않았음을 나타냅니다. + +

+ +
--chroma-subsample TID:hori,vert + +

+ 수평/수직으로 제거되지 않은 모든 픽셀에 대해 Cr 및 Cb 채널에서 제거할 픽셀의 양입니다. + +

+ + +

+ 예: 4:2:0 크로마 하위 샘플링이 있는 비디오의 경우 파라미터를 + TID:1,1로 + 설정해야 합니다. + +

+ +
--cb-subsample TID:hori,vert + +

+ 수평/수직으로 제거되지 않은 모든 픽셀에 대해 Cb 채널에서 제거할 픽셀의 + 양입니다. --chroma-subsample과 함께 가변적입니다. + +

+ + +

+ 예: 4:2:1 크로마 하위 샘플링이 있는 비디오의 경우 파라미터 --chroma-subsample을 + TID:1,0으로 + 설정하고 Cb-subsample을 + TID:1,0으로 + 설정해야 합니다. + +

+ +
--chroma-siting TID:hori,vert + +

+ 채도가 수평/수직으로 배치되는 방식을 설정합니다(0: 지정되지 않음, + 1: 상단 배치, 2: 절반). + +

+ +
--color-range TID:n + +

+ 색상 범위의 클리핑을 설정합니다(0: 지정되지 않음, 1: + 브로드캐스트 범위, 2: 전체 범위(클리핑 없음), 3: + MatrixCoefficients/TransferCharacteristics에 의해 정의됨). + +

+ +
--color-transfer-characteristics + TID:n + +

+ 비디오의 전송 특성입니다. + +

+ + +

+ 유효한 값과 그 의미는 다음과 같습니다: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: gamma 2.2 curve, 5: gamma 2.8 + curve, 6: SMPTE 170M, 7: SMPTE + 240M, 8: linear, 9: log, + 10: log sqrt, 11: IEC 61966-2-4, + 12: ITU-R BT.1361 extended color gamut, + 13: IEC 61966-2-1, 14: ITU-R + BT.2020 10 bit, 15: ITU-R BT.2020 12 bit, + 16: SMPTE ST 2084, 17: SMPTE ST + 428-1; 18: ARIB STD-B67 (HLG) + +

+ +
--color-primaries TID:n + +

+ 비디오의 색상 원본을 설정합니다. + +

+ + +

+ 유효한 값과 그 의미는 다음과 같습니다: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: ITU-R BT.470M, 5: ITU-R + BT.470BG, 6: SMPTE 170M, 7: SMPTE + 240M, 8: FILM, 9: ITU-R BT.2020, + 10: SMPTE ST 428-1, 22: JEDEC P22 + phosphors + +

+ +
--max-content-light TID:n + +

+ 단일 픽셀의 최대 밝기(Maximum Content Light Level)를 평방미터당 캔들라(cd/m²) 단위로 + 설정합니다. n 값은 음수가 아닌 정수여야 합니다. + +

+ +
--max-frame-light TID:n + +

+ 단일 전체 프레임의 최대 밝기(Maximum Frame-Average Light Level)를 평방미터당 캔들라(cd/m²) 단위로 + 설정합니다. n 값은 음수가 아닌 정수여야 합니다. + +

+ +
--chromaticity-coordinates + TID:red-x,red-y,green-x,green-y,blue-x,blue-y + +

+ R/G/B 색도 좌표를 CIE 1931에서 정의한 대로 설정합니다. + +

+ +
--white-color-coordinates TID:x,y + +

+ CIE 1931에서 정의한 흰색 색도 좌표를 설정합니다. + +

+ +
--max-luminance TID:float + +

+ 최대 휘도를 평방 미터당 캔들라(cd/m²) 단위로 설정합니다. 값은 9999.99보다 작아야 합니다. + +

+ +
--min-luminance TID:float + +

+ 최소 휘도를 제곱미터당 캔들라(cd/m²) 단위로 설정합니다. 값은 999.9999보다 커야 합니다. + +

+ +
--projection-type TID:method + +

+ 사용되는 비디오 투영 방법을 설정합니다. 유효한 값은 0(직사각형 투영), 1(등사각형 투영), 2(입방체 지도 투영) 및 3(망사 + 투영)입니다. + +

+ +
--projection-private TID:data + +

+ 특정 투영에만 적용되는 개인 데이터를 설정합니다. 데이터는 "0x" 접두사가 있거나 없거나 공백이 있거나 없는 + 16진수로 제공되어야 합니다. + +

+ +
--projection-pose-yaw TID:float + +

+ 투사에 대한 요(yaw) 회전을 지정합니다. + +

+ +
--projection-pose-pitch TID:float + +

+ 투사에 대한 피치(pitch) 회전을 지정합니다. + +

+ +
--projection-pose-roll TID:float + +

+ 투사에 대한 롤(roll) 회전을 지정합니다. + +

+ +
--field-order TID:n + +

+ 트랙 ID TID를 사용하여 비디오 트랙의 필드 순서를 설정합니다. 순서는 다음 숫자 중 + 하나여야 합니다. + +

+ + +

+ 0: 진행도, 1: 맨 위 필드가 먼저 표시되고 맨 위 필드가 + 먼저 저장됨, 2: 미정 필드 순서, 6: 맨 아래 필드가 + 먼저 표시되고 맨 아래 필드가 먼저 저장됨, 9: 맨 아래 필드가 먼저 표시되고 맨 위 필드가 먼저 + 저장됨, 14: 맨 위 필드가 먼저 표시되고 맨 아래 필드가 먼저 저장됨 + +

+ +
--stereo-mode TID:n|symbolic-name + +

+ Sets the stereo mode for the video track with the track ID + TID. The mode can either be a number + n between 0 and + 14 or a symbolic name. All valid numbers & names + can be listed with the --list-stereo-modes + option. + +

+ +
+ + + +

2.9. 텍스트 자막 트랙에만 적용되는 옵션

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset TID:character-set + +

+ 지정된 트랙 ID의 UTF-8 자막에 대해 변환을 위한 문자 집합을 UTF-8로 설정합니다. 지정하지 않으면 문자 집합이 현재 로케일 + 설정에서 파생됩니다. 문자 집합은 항상 UTF-8에 저장되므로 Matroska(tm) 파일 또는 Kate 스트림에서 읽은 자막에 필요하지 + 않습니다. 문자 집합은 mkvmerge(1) 문자 집합 간에 변환되는 방법에 대한 설명은 text files and character + sets 섹션을 참조하십시오. + +

+ + +

+ 이 옵션은 매번 다른 트랙 ID를 선택하여 여러 트랙에 적용되는 입력 파일에 대해 여러 번 사용할 수 있습니다. + +

+ +
+ + + +

2.10. 기타 옵션

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify + file-name + +

+ mkvmerge(1)가 단일 파일을 탐색하고 파일 형식, 파일에 포함된 트랙 및 트랙 ID를 보고합니다. 이 옵션을 사용할 경우 허용되는 + 다른 옵션은 파일 이름뿐입니다. + +

+ + +

결과에 사용되는 출력 형식은 --identification-format + 옵션으로 변경할 수 있습니다. +

+ +
-J file-name + +

+ 이것은 "--identification-format json --identify file-name"의 + 편리한 별칭입니다. + +

+ +
-F, --identification-format + format + +

+ --identify + option에서 사용하는 출력 형식을 결정합니다. text(이 옵션을 사용하지 않는 경우 + 기본값) 및 json 형식이 지원됩니다. + +

+ + +
    + +
  1. + +

    text 형식은 짧고 사람이 읽을 수 있습니다. 발견된 항목당 한 줄로 구성됩니다(용기, 트랙, 첨부 + 파일 등). +

    + + +

    이 형식은 구문 분석되지 않습니다. 출력은 mkvmerge(1)uses 언어로 번역됩니다(참조: --ui-language). +

    + +
  2. + + +
  3. + +

    + json 형식은 기계 판독 가능한 JSON 표현을 출력합니다. 이 형식은 다음 파일에 설명된 JSON + 스키마를 따릅니다. + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + 모든 버전의 JSON 스키마는 온라인과 공개된 소스 코드 아카이브에서 모두 사용할 수 있습니다. + +

    + +
  4. + +
+ +
--probe-range-percentage percentage + +

+ MPEG 프로그램 및 전송 스트림(.vob, .m2ts)과 같은 파일 + 형식은 파일에 포함된 모든 트랙을 탐지하기 위해 특정 양의 데이터를 구문 분석해야 합니다. 이 양은 원본 파일 크기의 0.3% 또는 + 10MB 중 더 큰 크기로 결정됩니다. + +

+ + +

+ 트랙이 있는 것으로 알려졌지만 찾을 수 없는 경우 이 옵션을 사용하여 probe 비율을 변경할 수 있습니다. 최소 10MB는 기본 + 제공되며 변경할 수 없습니다. + +

+ +
--list-audio-emphasis + +

+ Lists all valid numbers & their corresponding symbolic names for the + --audio-emphasis + option. + +

+ +
--list-languages + +

+ --language + 옵션과 함께 사용할 수 있는 모든 언어와 해당 ISO 639-2 코드를 나열합니다. + +

+ +
--list-stereo-modes + +

+ Lists all valid numbers & their corresponding symbolic names for the + --stereo-mode + option. + +

+ +
-l, --list-types + +

+ 지원되는 입력 파일 형식을 나열합니다. + +

+ +
--priority priority + +

+ mkvmerge(1)가 실행되는 프로세스 우선 순위를 설정합니다. 유효한 값은 'lowest', + 'lower', 'normal', + 'higher' 및 'highest'입니다. 아무것도 주어지지 않으면 + 'normal'이 사용됩니다. 유닉스 계열 시스템에서 mkvmerge(1)는 + nice(2) + 함수를 사용합니다. 따라서 슈퍼 유저만 'higher'과 + 'highest'을 사용할 수 있습니다. Windows에서는 모든 사용자가 모든 값을 사용할 수 + 있습니다. + +

+ + +

또한 'lowest'를 선택하면 mkvmerge(1)는 가능한 가장 낮은 프로세스 우선 순위 외에 유휴 + I/O 우선 순위를 선택합니다. +

+ +
--command-line-charset 문자셋 + +

+ 명령줄에 지정된 문자열을 변환할 문자 집합을 설정합니다. 기본적으로 시스템의 현재 로케일에서 지정된 문자 집합으로 설정됩니다. 이 설정은 + --title, + --track-name + 및 --attachment-description + 옵션의 인수에 적용됩니다. + +

+ +
--output-charset 문자셋 + +

+ 출력할 문자열을 변환할 문자셋을 정합니다. 기본값은 현재 시스템 로케일에 따른 문자셋입니다. + +

+ +
-r, --redirect-output + 파일명 + +

+ 모든 메시지를 콘솔 대신 file-name 파일에 씁니다. 출력 리디렉션을 통해 쉽게 수행할 수 + 있지만 터미널이 출력을 파일에 쓰기 전에 재해석하는 경우 이 옵션이 필요한 경우가 있습니다. --output-charset으로 + 설정된 문자 집합이 적용됩니다. + +

+ +
--flush-on-close + +

+ 쓰기 위해 열린 파일을 닫을 경우 메모리에 캐시된 모든 데이터를 플러시 하도록 프로그램에게 지시합니다. 이를 통해 정전 시 데이터 손실을 + 방지하거나 운영 체제 또는 드라이버의 특정 문제를 방지할 수 있습니다. mkvmerge는 모든 데이터가 저장소에 기록될 때까지 기다리기 + 때문에 멀티플렉싱 시간이 더 오래 걸린다는 단점이 있습니다. 장단점에 대한 자세한 내용은 MKVToolNix 버그 트래커의 #2469 및 + #2480호를 참조하십시오. + +

+ +
--ui-language 코드 + +

+ 언어 코드의 번역을 강제로 사용합니다 (예: 강제 사용할 독일어 번역 코드는 + 'de_DE'). 'list'를 + 코드로 입력하면 mkvextract(1) 에서 이용 가능한 번역 목록을 출력할 것입니다. + +

+ +
--abort-on-warnings + +

+ 첫 번째 경고가 발생한 후 프로그램을 중단하도록 지시합니다. 프로그램의 종료 코드는 1입니다. + +

+ +
--deterministic seed + +

+ 동일한 버전의 mkvmerge(1)가 동일한 원본 파일, 동일한 옵션 집합 및 동일한 시드와 함께 사용되는 경우 바이트와 동일한 파일을 + 만들 수 있습니다. 이 모드에서는 "날짜" 세그먼트 정보 필드가 기록되지 않습니다. + +

+ + +

시드는 임의 문자열일 수 있으며 숫자일 필요는 없습니다.

+ + +

+ 동일 바이트 파일의 결과는 다음 조건에서만 보장됩니다. + +

+ + +
    + +
  1. + +

    libEBML과 libMatroska의 동일한 버전으로 빌드된 동일한 버전의 mkvmerge(1)가 사용됩니다. +

    + +
  2. + + +
  3. + +

    사용된 소스 파일은 동일 바이트입니다.

    + +
  4. + + +
  5. + +

    동일한 명령줄 옵션이 동일한 순서로 사용됩니다(--output …은 예외임). +

    + +
  6. + +
+ + +

+ 다른 버전의 mkvmerge(1) 또는 다른 명령줄 옵션을 사용하면 동일한 바이트로 동일한 파일이 생성될 수 있지만 반드시 사용되지는 + 않습니다. + +

+ +
--debug 토픽 + +

+ 특정 기능에 대해 디버깅을 켭니다. 이 기능은 개발자에게만 유용합니다. + +

+ +
--engage 기능 + +

+ 실험 기능을 켭니다. 사용 가능한 기능 목록은 mkvmerge --engague list와 함께 요청할 + 수 있습니다. 이러한 기능은 정상적인 상황에서 사용할 수 없습니다. + +

+ +
--gui-mode + +

+ GUI 모드를 켭니다. 이 모드에서는 GUI 동작시 무슨 일이 일어나는지 알려줄 수 있는 특별하게 형식화된 줄을 출력할 것입니다. 이 + 메시지들은 '#GUI#message' 형식을 따릅니다. 이 메시지 뒤에 + '#GUI#message#key1=value1#key2=value2…' 형태의 키/값 쌍이 붙을 수 + 있습니다. 메시지나 키값들은 결코 번역되지 않고 항상 영어로 출력됩니다. + +

+ +
@옵션 파일.json + +

+ options-file 파일에서 추가 명령줄 인수를 읽습니다. 자세한 내용은 option files에 대한 섹션을 참조하십시오. + +

+ +
--capabilities + +

+ 컴파일된 옵션 기능 및 종료 기능에 대한 정보를 나열합니다. 첫 번째 줄 출력은 버전 정보입니다. 다음 행에는 기능이 컴파일되었음을 + 나타내는 단어가 한 개 포함되어 있습니다. 다음 기능이 있습니다. + +

+ + +
    + +
  • + +

    + 'FLAC' - 원본 FLAC 파일을 읽고 다른 컨테이너(예: + Ogg(tm) 또는 Matroska(tm))에서 FLAC 트랙을 + 처리합니다. + +

    + +
  • + +
+ +
-h, --help + +

+ 사용법에 관한 정보를 표시하고 종료합니다. + +

+ +
-V, --version + +

+ 버전 정보를 표시하고 종료합니다. + +

+ +
+ + +

3. 사용법

+ + +

+ 각 파일에 대해 사용자는 mkvmerge(1)를 사용해야 하는 트랙을 선택할 수 있습니다. 이 파일들은 모두 + -o로 지정된 파일에 저장됩니다. 알려진(및 지원되는) 소스 형식 목록은 + -l 옵션을 사용하여 얻을 수 있습니다. + +

+ + +
+

Important:

+ +

+ 명령행 옵션의 순서는 중요합니다. 프로그램을 처음 사용하면 "옵션 순서" 섹션을 읽어 주세요. + +

+ +
+ +

4. 옵션 순서

+ + + +

+ 일부 옵션에서는 옵션을 입력하는 순서가 중요합니다. 옵션은 두 가지 범주로 나뉩니다. + +

+ + +
    + +
  1. + +

    + 전체 프로그램에 영향을 미치며 입력 파일에 연결되지 않는 옵션입니다. 여기에는 + --command-line-charset, --output 또는 + --title이 포함됩니다. 이러한 항목은 명령줄의 모든 위치에 나타날 수 있습니다. + +

    + +
  2. + + +
  3. + +

    + 단일 입력 파일 또는 입력 파일의 단일 트랙에 영향을 미치는 옵션. 이러한 옵션은 모두 명령줄의 다음 입력 파일에 적용됩니다. 동일한 + 입력 파일(또는 동일한 입력 파일의 트랙)에 적용되는 모든 옵션은 입력 파일 이름 앞에 모두 나타나는 한 임의의 순서로 작성될 수 + 있습니다. 입력 파일에 적용되는 옵션의 예로는 --no-chapterset 또는 + --chapter-charset이 있습니다. 단일 트랙에 적용되는 옵션의 예로는 + --default-duration 또는 --language가 있습니다. + +

    + +
  4. + +
+ + +

+ 옵션은 왼쪽에서 오른쪽으로 처리됩니다. 같은 범위 내에서 옵션이 여러 번 나타나면 마지막 항목이 사용됩니다. 따라서 제목은 "로 + 설정됩니다.다음 예제의 다른 항목"입니다. + +

+ +
$ mkvmerge -o output.mkv --title 'This and that' input.avi --title 'Something else'
+ +

+ 다음 예제에서는 --language 옵션을 두 번 사용하는 것이 서로 다른 범위에서 사용되므로 문제가 + 없음을 보여 줍니다. 같은 트랙 ID에 적용되더라도 다른 입력 파일에 적용되므로 범위가 다릅니다. + +

+ +
$ mkvmerge -o output.mkv --language 0:fre français.ogg --language 0:deu deutsch.ogg
+

5. 보기

+ + +

+ MyMovie라는 파일과MyMovie.wav'와 같은 별도의 파일의 오디오 트랙이 있다고 + 가정합니다. 먼저 오디오를 OggVorbis(tm)로 인코딩합니다. + +

+ +
$ oggenc -q4 -oMyMovie.ogg MyMovie.wav
+ +

+ 몇 분 후에 비디오 및 오디오에 접근할 수 있습니다. + +

+ +
$ mkvmerge -o MyMovie-with-sound.mkv MyMovie.avi MyMovie.ogg
+ +

+ AVI에 오디오 트랙이 이미 포함되어 있으면 해당 트랙도 복사됩니다(mkvmerge(1)가 오디오 형식을 + 지원하는 경우). 그렇지 않으려면 간단히 하십시오. + +

+ +
$ mkvmerge -o MyMovie-with-sound.mkv -A MyMovie.avi MyMovie.ogg
+ +

+ 몇 분간의 고려 후에 다른 오디오 트랙(예: 감독의 코멘트나 다른 언어)을 + 'MyMovie-add-audio.wav'로 리핑합니다. 다시 인코딩하고 다른 파일과 결합합니다. + +

+ +
$ oggenc -q4 -oMyMovie-add-audio.ogg MyMovie-add-audio.wav
+$ mkvmerge -o MM-complete.mkv MyMovie-with-sound.mkv MyMovie-add-audio.ogg
+ +

+ 같은 결과를 얻을 수 있습니다. + +

+ +
$ mkvmerge -o MM-complete.mkv -A MyMovie.avi MyMovie.ogg MyMovie-add-audio.ogg
+ +

+ 이제 mplayer(tm)를 켜고 즐기세요. 오디오 트랙이 여러 개 있는 경우(또는 비디오 + 트랙도) '-vid' 및 '-aid' 옵션으로 재생할 트랙을 + mplayer(tm)에 알려줄 수 있습니다. 이들은 0 기반이며 비디오와 오디오를 구분하지 + 않습니다. + +

+ + +

+ 오디오 트랙을 동기화해야 하는 경우 쉽게 동기화할 수 있습니다. 먼저 Vorbis 트랙의 트랙 ID를 확인합니다. + +

+ +
$ mkvmerge --identify outofsync.ogg
+ +

+ 이제 다음 명령줄에서 해당 ID를 사용할 수 있습니다. + +

+ +
$ mkvmerge -o goodsync.mkv -A source.avi -y 12345:200 outofsync.ogg
+ +

+ 이렇게 하면 오디오 트랙의 시작 부분에서 'outofsync.ogg'에서 가져온 ID + 12345로 200ms의 무음이 추가됩니다. + +

+ + +

+ 일부 동영상은 올바르게 동기화되기 시작하지만 서서히 동기화되지 않습니다. 이러한 종류의 동영상의 경우 모든 타임스탬프에 적용되는 지연 + 계수를 지정할 수 있습니다. 데이터는 추가 또는 제거되지 않습니다. 그래서 그 요인을 너무 크거나 작게 만들면 좋지 않은 결과를 얻을 수 + 있습니다. 예를 들어, 트랜스코딩한 에피소드는 77340프레임의 영화의 마지막 부분에서 + 0.2초 동안 동기화되지 않았습니다. 이는 29.97fps + 0.2초에서 약 6프레임에 해당합니다. 그래서 + +

+ +
$ mkvmerge -o goodsync.mkv -y 23456:0,77346/77340 outofsync.mkv
+ +

+ 좋은 결과였습니다. + +

+ + +

+ 동기화 옵션은 동일한 방식으로 자막에 사용할 수도 있습니다. + +

+ + +

+ 텍스트 자막의 경우 일부 Windows 소프트웨어(SubRipper(tm) 등) 또는 + 'contrib/subrip' 디렉터리의 + transcode(1) + 소스에 있는 subrip(tm) 패키지를 사용할 수 있습니다. 일반적인 프로세스는 다음과 + 같습니다. + +

+ + +
    + +
  1. + +

    소스에서 원시 자막 스트림을 추출합니다:

    +
    $ tccat -i /path/to/copied/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o mymovie
    +
  2. + + +
  3. + +

    결과물 PGM 영상을 gocr 텍스트로 변환합니다.

    +
    $ pgm2txt mymovie
    +
  4. + + +
  5. + +

    결과 텍스트 파일의 철자를 검사합니다.

    +
    $ ispell -d american *txt
    +
  6. + + +
  7. + +

    텍스트 파일을 SRT 파일로 변환합니다.

    +
    $ srttool -s -w -i mymovie.srtx -o mymovie.srt
    +
  8. + +
+ + +

+ 결과 파일은 mkvmerge(1)의 다른 입력 파일로 사용될 수 있습니다. + +

+ +
$ mkvmerge -o mymovie.mkv mymovie.avi mymovie.srt
+ +

+ 특정 트랙에 대한 언어를 지정하려면 이 작업을 쉽게 수행할 수 있습니다. 먼저 해당 언어의 ISO 639-2 코드를 + 확인합니다. mkvmerge(1)는 다음과 같은 모든 코드를 나열할 수 있습니다. + +

+ +
$ mkvmerge --list-languages
+ +

+ 목록에서 필요한 언어를 검색합니다. 두 개의 오디오 트랙을 Matroska(tm) 파일에 넣고 해당 언어 코드를 설정하려고 하며 트랙 ID가 + 2와 3이라고 가정합니다. 이 작업은 다음과 같이 수행할 수 있습니다. + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut without-lang-codes.mkv
+ +

+ 보시다시피 --language + 스위치를 여러 번 사용할 수 있습니다. + +

+ + +

+ 사용자가 네덜란드어를 기본 언어로 사용하도록 할 수도 있습니다. 또한 영어 및 프랑스어 자막과 같은 추가 자막이 있으며 사용자가 + 기본적으로 프랑스어 자막을 표시하도록 할 수 있습니다. 이 작업은 다음과 같이 수행할 수 있습니다. + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut --default-track-flag 3 without-lang-codes.mkv --language 0:eng english.srt --default-track-flag 0 --language 0:fre french.srt
+ +

+ mkvinfo(1)의 출력에 지정한 언어 또는 기본 트랙 플래그가 표시되지 않으면 default values에 대한 섹션을 참조하십시오. + +

+ + +

+ 입력 파일에 대한 압축을 해제합니다. + +

+ +
$ mkvmerge -o no-compression.mkv --compression -1:none MyMovie.avi --compression -1:none mymovie.srt
+ +

6. 트랙 ID

+ + + +

6.1. 일반 트랙 ID

+ + + +

+ mkvmerge(1)에 대한 일부 옵션은 트랙 ID가 있어야 적용할 트랙을 지정할 수 있습니다. 이러한 트랙 ID는 현재 입력 파일의 + 압축을 풀 때 또는 mkvmerge(1)가 --identify + 옵션으로 호출되는 경우 판독기에 의해 인쇄됩니다. 이러한 출력의 예는 다음과 같습니다. + +

+ +
$ mkvmerge -i v.mkv
+File 'v.mkv': container: Matroska
+Track ID 0: video (V_MS/VFW/FOURCC, DIV3)
+Track ID 1: audio (A_MPEG/L3)
+ +

+ 출력 MKV 파일에 배치된 트랙에 할당된 트랙 ID를 입력 파일의 트랙 ID와 혼동하지 마십시오. 입력 파일 트랙 ID만 이러한 값이 + 필요한 옵션에 사용됩니다. + +

+ + +

+ 또한 각 입력 파일에는 고유한 트랙 ID 세트가 있습니다. 따라서 'mkvmerge + --identify'에서 보고한 'file1.ext' 파일의 트랙 ID는 다른 + 입력 파일이 얼마나 많든 'file1.ext'가 어느 위치에 사용되든 변경되지 않습니다. + +

+ + +

+ 트랙 ID는 다음과 같이 할당됩니다. + +

+ + +
    + +
  • + +

    + AVI 파일: 비디오 트랙의 ID는 0입니다. 오디오 트랙은 1부터 오름차순으로 ID를 가져옵니다. + +

    + +
  • + + +
  • + +

    + AAC, AC-3, MP3, + SRTWAV 파일: 해당 파일의 '트랙'은 ID 0을 받습니다. + +

    + +
  • + + +
  • + +

    + 다른 대부분의 파일: 트랙 ID는 0부터 시작하는 파일에서 트랙을 찾는 순서대로 할당됩니다. + +

    + +
  • + +
+ + +

+ 트랙 ID를 사용하는 옵션은 설명에 'TID'가 포함된 옵션입니다. --audio + tracks, --video-tracks, + --subtitle-tracks, --button-tracks 및 + --track-tags도 사용합니다. + +

+ + + +

6.2. 특수 트랙 ID

+ + + +

+ 식별 출력에는 특별한 의미를 가지며 발생하지 않는 여러 ID가 있습니다. + +

+ + +

+ 특수 트랙 ID '-1'은 와일드 카드이며 입력 파일에서 읽은 모든 트랙에 지정된 스위치를 + 적용합니다. + +

+ + +

+ 특수 트랙 ID '-2'는 소스 파일의 장을 나타냅니다. 현재 + --sync 옵션만 이 특수 ID를 사용합니다. --sync-2:…의 + 대안으로 --chapter-sync… 옵션을 사용할 수 있습니다. + +

+ + +

7. Language handling

+ + + +

+ Matroska(tm) has support for two different types of language elements: the + old, deprecated "Language" element containing ISO 639-2 alpha 3 codes and + the new "LanguageIETF" tags containing IETF BCP 47 language tags. All of + mkvmerge(1)'s options that accept a language accept a BCP 47 language + tag. mkvmerge(1) will derive the value for the deprecated "Language" element + from the BCP 47 language tags wherever possible. + +

+ + +

+ When identifying a file in JSON mode, existing "LanguageIETF" track header + elements will be output as the language_ietf track + property. + +

+ + +

+ When writing a file mkvmerge(1) will always write the "LanguageIETF", + "ChapLanguageIETF" and "TagLanguageIETF" elements (the latter two only if + chapters or tags are written respectively). In addition to those elements + the corresponding old elements will be written; they'll be set to the ISO + 639-2 code portion of the BCP 47 language tag. For example, when the track + language is set to sr-Cyrl-RS "LanguageIETF" will be set + to sr-Cyrl-RS and the old "Language" element will be set + to srp. + +

+ + +

+ When reading existing files (Matroska files, XML chapter or tag files etc.) + that already contain "…LanguageIETF" elements the existing elements will be + kept. Otherwise "…LanguageIETF" elements will be added based on command-line + options and other existing deprecated "…Language" elements. + +

+ + +

+ The creation of the new elements can be disabled completely with the + command-line option --disable-language-ietf which operates + on all three new elements. + +

+ + +

+ You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. + +

+ +

8. 텍스트 파일과 문자셋 변환

+ + +
+

Note:

+ +

+ 이 섹션은 mkvmerge(1)만 언급되더라도 MKVToolNix의 모든 프로그램에 적용됩니다. + +

+ +
+ + +

8.1. 소개

+ + +

+ Matroska(tm) 파일의 모든 텍스트는 UTF-8로 인코딩됩니다. 이것은 mkvmerge(1)가 읽는 모든 텍스트 파일뿐만 아니라 + 명령행에 주어진 모든 텍스트를 UTF-8로 변환해야 한다는 것을 의미합니다. 또한 mkvmerge(1)의 출력을 UTF-8에서 해당 문자 + 집합으로 다시 변환해야 합니다. 예를 들어, 영어가 아닌 번역이 --ui-language와 + 함께 사용되는 경우 또는 Matroska(tm) 파일을 원본 텍스트로 변환해야 합니다. + +

+ + +

+ mkvmerge(1)는 바이트 순서 마커(짧은 길이: BOM) 또는 시스템의 현재 로케일의 존재에 따라 이 + 변환을 자동으로 수행합니다. 문자 집합이 로케일에서 추론되는 방법은 mkvmerge(1)가 실행되는 운영 체제에 따라 다릅니다. + +

+ + + +

8.2. 바이트 순서 표시 (BOM)

+ + + +

+ BOM으로 시작하는 텍스트 파일은 UTF-8, UTF-16 little, big endian, UTF-32 little, big + endian의 다섯 가지 모드를 지원합니다. BOM이 있는 텍스트 파일은 자동으로 UTF-8로 변환됩니다. 그렇지 않으면 해당 파일의 + 문자 집합을 설정하는 모든 매개 변수(예: --sub-charset)는 + 자동으로 무시됩니다. + +

+ + + +

8.3. MacOS를 포함한 Linux 및 Unix 계열 시스템

+ + + +

+ 유닉스 계열 시스템에서 mkvmerge(1)는 환경 변수 LANG, + LC_ALL, LC_CYPE을 사용하는 + setlocale(3) + 시스템 호출을 사용합니다. 결과 문자 집합은 종종 UTF-8이나 ISO-8859-* 계열 중 하나이며 모든 텍스트 파일 작업과 명령줄의 + 문자열 인코딩 및 콘솔 출력에 사용됩니다. + +

+ + + +

8.4. 윈도우

+ + + +

+ Windows에서 텍스트 파일을 변환하는 데 사용되는 기본 문자 집합은 GetACP() 시스템 + 호출에 의해 결정됩니다. + +

+ + +

+ 명령줄 읽기는 이미 유니코드 문자열을 반환하는 GetCommandLineW() 함수를 사용하여 + 수행됩니다. 따라서 --command-line-charset 옵션은 Windows에서 무시됩니다. + +

+ + +

+ 콘솔 출력은 세 가지 시나리오로 구성됩니다: + +

+ + +
    + +
  1. + +

    + 출력이 --redirect-output + 옵션으로 리디렉션되는 경우 기본 문자 집합은 UTF-8입니다. --output-charset을 + 사용하여 변경할 수 있습니다. + +

    + +
  2. + + +
  3. + +

    + 출력이 cmd.exe 자체(예: mkvinfo file.mkv > + info.txt)로 리디렉션되는 경우 문자 집합은 항상 UTF-8이며 변경할 수 없습니다. + +

    + +
  4. + + +
  5. + +

    + 그렇지 않으면(콘솔에 직접 쓸 때) Windows 기능 WriteConsoleW()가 사용되며 + --output-charset + 옵션은 무시됩니다. 콘솔은 해당 언어 지원이 설치된 모든 유니코드 문자를 출력할 수 있어야 합니다(예: 영어 Windows 버전에서는 + 중국어 문자가 표시되지 않을 수 있음). + +

    + +
  6. + +
+ + + +

8.5. 명령행 옵션

+ + + +

+ 문자 집합을 지정할 수 있는 옵션은 다음과 같습니다: + +

+ + +
    + +
  • + +

    + --sub-charset + 파일 및 문자 집합을 명확하게 결정할 수 없는 컨테이너 형식으로 저장된 텍스트 자막 트랙의 하위 문자 집합(예: Ogg 파일) + +

    + +
  • + + +
  • + +

    + --chapter-charset + 챕터 텍스트 파일 및 문자 집합을 명확하게 결정할 수 없는 컨테이너 형식으로 저장된 챕터 및 파일 제목(예: 챕터 정보, 트랙 및 파일 + 제목용 Ogg 파일, 챕터 정보용 MP4 파일), + +

    + +
  • + + +
  • + +

    + --command-line-charset + 명령행의 모든 문자열에 대해 + +

    + +
  • + + +
  • + +

    + --output-charset은 + 콘솔 또는 파일에 기록된 모든 문자열에 대해 --redirect-output + 옵션을 사용하여 출력이 리디렉션된 경우 사용합니다. Windows가 아닌 시스템에서 출력 문자 집합의 기본값은 시스템의 현재 문자 + 집합입니다. Windows의 경우 --redirect-output과 + cmd.exe 자체(예: mkvinfo file.mkv > + info.txt)로 리디렉션하기 위해 UTF-8로 기본 설정됩니다. + +

    + +
  • + +
+ + +

9. 옵션 파일

+ + + +

+ 옵션 파일은 파일 mkvmerge(1)이며 추가 명령줄 인수를 읽을 수 있습니다. 이것은 제한된 명령행 길이와 같은 외부 프로그램을 실행할 + 때 셸이나 운영 체제의 특정 제한을 피하기 위해 사용될 수 있습니다. + +

+ + +

+ 옵션 파일에는 JSON 형식의 데이터가 포함됩니다. 콘텐츠는 JSON 문자열로만 구성된 유효한 JSON 배열이어야 합니다. 파일의 + 인코딩은 UTF-8이어야 합니다. 파일은 BOM로 시작하면 안 되지만 있으면 건너뜁니다. + +

+ + +

+ JSON 내부의 특수 문자를 이스케이프하기 위한 규칙은 JSON 공식 사양인 RFC 7159에 있습니다. + +

+ + +

+ 옵션 파일의 이름 자체는 '@' 문자의 접두사로 된 명령줄 인수로 지정해야 합니다. + +

+ + +

+ 명령행 'mkvmerge -o "myfile.mkv" -A "movie.avi" sound.ogg'를 + 'options.json'라는 JSON 옵션 파일로 변환할 수 있습니다. + +

+ +
[
+  "-o",
+  "c:\\Matroska\\my file.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "a movie.avi",
+  "sound.ogg"
+]
+ +

+ 그러면 해당 명령은 'mkvmerge @options.json'가 됩니다. + +

+ +

10. 파일 링크

+ + +

+ Matroska(tm)는 단순히 특정 파일이 현재 파일의 이전 또는 후속 파일이라고 말하는 파일 연결을 지원합니다. 정확히 말하면, 실제로 + 연결된 것은 파일이 아니라 Matroska(tm) 세그먼트입니다. 대부분의 파일들은 하나의 Matroska(tm) 세그먼트만 포함할 수 있기 + 때문에, 다음 설명은 '파일 연결'이라는 용어를 사용하지만 '세그먼트 연결'이 더 적절합니다. + +

+ + +

+ 각 세그먼트는 고유한 128비트 폭 세그먼트 UID로 식별됩니다. 이 UID는 mkvmerge(1)에 의해 자동으로 생성됩니다. 연결은 + 주로 이전/다음 파일의 세그먼트 UID(짧은 길이: SID)를 세그먼트 헤더 정보에 넣는 방식으로 + 이루어집니다. mkvinfo(1)SIDs를 찾으면 인쇄합니다. + +

+ + +

+ 파일을 여러 개의 작은 파일로 분할하고 링크를 사용하면 타임스탬프가 0에서 다시 시작되지 않고 마지막 파일이 남아 있는 곳에서 + 계속됩니다. 이렇게 하면 이전 파일을 사용할 수 없는 경우에도(예: 스트리밍할 때) 절대 시간이 유지됩니다. 링크가 사용되지 않으면 + 타임스탬프는 각 파일에 대해 0부터 시작됩니다. 기본적으로 mkvmerge(1)는 파일 연결을 사용하지 않습니다. 원하는 경우 + --link 옵션을 사용하여 설정할 수 있습니다. 이 옵션은 분할도 활성화된 경우에만 유용합니다. + +

+ + +

+ 분할의 활성 여부와 상관없이 사용자는 mkvmerge(1)에게 생성된 파일을 특정 SIDs에 연결하도록 + 지시할 수 있습니다. 이 작업은 --link-to-previous 및 + --link-to-next 옵션을 사용하여 수행됩니다. 이러한 옵션은 mkvinfo(1)가 출력하는 형식의 + 세그먼트 SID를 허용합니다. 예를 들어 '0x410xda 0x730x660xd90xcf + 0xb20 0x1e 0x780xebb4 0x5 0xca0x93'과 같이 각각 접두사 + 0x000xff 사이의 + '0x'접두사를 사용한 16진수입니다. 또는 '0x' 접두사를 + 사용하지 않고 공백 없이 0x000xff 사이의 16진수 + 숫자 16개를 사용할 수 있습니다(예: '41da7366d9cfb21e78eb45ecab393' + +

+ + +

+ 분할을 사용하는 경우 첫 번째 파일은 --link-to-previous로 지정된 + SID에 연결되고 마지막 파일은 --link-to-next로 지정된 + SID에 연결됩니다. 분할을 사용하지 않으면 하나의 출력 파일이 두 SIDs + 모두에 연결됩니다. + +

+ +

11. 기본값

+ + +

+ Matroska(tm) 규격에는 일부 요소가 기본값을 가지고 있다고 명시되어 있습니다. 일반적으로 공간을 절약하기 위해 요소 값이 기본값과 + 같으면 요소가 파일에 기록되지 않습니다. 사용자가 mkvinfo(1)의 출력에서 놓칠 수 있는 요소는 + languagedefault track flag + 요소입니다. language의 기본값은 영어('eng')이고 + default track flag에 대한 기본값은 + true입니다. 따라서 --language 0:eng을 트랙에 + 사용한 경우 mkvinfo(1)의 출력에 표시되지 않습니다. + +

+ +

12. 첨부 파일

+ + +

+ 또한 사진을 Matroska(tm) 파일과 함께 보관하거나 SSA 자막을 사용 중이므로 매우 드문 특수 + TrueType(tm) 글꼴이 필요할 수 있습니다. 이러한 경우 해당 파일을 Matroska(tm) + 파일에 첨부할 수 있습니다. 이러한 파일은 파일에 추가되지 않고 파일에 포함됩니다. 사용자는 이러한 파일('사진' 케이스)을 보여주거나 + 자막('TrueType(tm) 폰트' 케이스)을 렌더링하는 데 사용할 수 있습니다. + +

+ + +

+ 출력 파일에 사진 및 TrueType(tm) 글꼴을 첨부하는 방법은 다음과 같습니다. + +

+ +
$ mkvmerge -o output.mkv -A video.avi sound.ogg \
+  --attachment-description "Me and the band behind the stage in a small get-together" \
+  --attachment-mime-type image/jpeg \
+  --attach-file me_and_the_band.jpg \
+  --attachment-description "The real rare and unbelievably good looking font" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file really_cool_font.ttf
+ +

+ 첨부 파일이 포함된 Matroska(tm) 파일을 입력 파일로 사용하는 경우 mkvmerge(1)는 첨부 파일을 새 파일로 복사합니다. 복사된 + 첨부 파일과 복사되지 않은 첨부 파일 선택 항목은 --attachments + 및 --no-attachments + 옵션을 사용하여 변경할 수 있습니다. + +

+ +

13. 챕터

+ + +

+ Matroska(tm) 챕터 시스템은 OGM 파일에 사용되는 오래된 알려진 시스템보다 더 강력합니다. 전체 + 사양은 the Matroska website에서 + 확인할 수 있습니다. + +

+ + +

+ mkvmerge(1)는 두 가지 종류의 챕터 파일을 입력으로 지원합니다. '단순 챕터 형식'이라고 불리는 첫 번째 형식은 + OGM 도구가 기대하는 형식과 동일합니다. 두 번째 형식은 Matroska(tm)의 모든 챕터 기능을 지원하는 + XML 기반 장 형식입니다. + +

+ + +

+ 전용 챕터 파일 외에도 mkvmerge(1)는 다른 파일 형식(예: MP4, Ogg, Blu-ray 또는 DVD)의 챕터를 읽을 수 + 있습니다. + +

+ + +

13.1. 간단한 챕터 형식

+ + + +

+ 이 형식은 각각 'CHAPterxx=' 및 + 'CHAPterxxNAME='로 시작하는 행 쌍으로 구성됩니다. 첫 번째 타임스탬프는 시작 타임스탬프를 + 포함하고 두 번째 타임스탬프는 제목을 포함합니다. 다음은 예시입니다. + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=Intro
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=Baby prepares to rock
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=Baby rocks the house
+ +

+ mkvmerge(1) will transform every pair or lines into one Matroska(tm) + ChapterAtom. It does not set any + ChapterTrackNumber which means that all chapters + apply to all tracks in the file. + +

+ + +

+ 텍스트 파일이기 때문에 문자 집합 변환이 필요할 수 있습니다. mkvmerge(1)가 문자 집합을 변환하는 방법에 대한 설명은 text files and character + sets섹션을 참조하십시오. + +

+ + + +

13.2. XML 기반의 챕터 형식

+ + +

+ XML 기반 챕터 형식은 다음과 같습니다. + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>A short chapter</ChapterString>
+        <ChapterLanguage>eng</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>A part of that short chapter</ChapterString>
+          <ChapterLanguage>eng</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ 이 형식을 사용하면 간단한 챕터 형식으로는 가능하지 않은 세 가지가 가능합니다. + +

+ + +
    + +
  1. +

    챕터 끝에 대한 타임스탬프를 설정할 수 있습니다.

    +
  2. + +
  3. +

    챕터는 중첩될 수 있습니다.

    +
  4. + +
  5. +

    언어와 국가는 설정할 수 있습니다.

    +
  6. + +
+ + +

+ mkvtoolix 배포판에는 기본으로 사용할 수 있는 몇 가지 샘플 파일이 doc 하위 디렉터리에 + 포함되어 있습니다. + +

+ + +

+ 다음은 지원되는 XML 태그, 데이터 유형 및 해당 값의 유효한 범위(해당하는 경우)를 나열합니다. + +

+ +
Chapters (master)
+  EditionEntry (master)
+    EditionUID (unsigned integer, valid range: 1 <= value)
+    EditionFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagDefault (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagOrdered (unsigned integer, valid range: 0 <= value <= 1)
+    ChapterAtom (master)
+      ChapterAtom (master)
+      ChapterUID (unsigned integer, valid range: 1 <= value)
+      ChapterTimeStart (unsigned integer)
+      ChapterTimeEnd (unsigned integer)
+      ChapterFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterFlagEnabled (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterSegmentUID (binary, valid range: 1 <= length in bytes)
+      ChapterSegmentEditionUID (unsigned integer, valid range: 1 <= value)
+      ChapterPhysicalEquiv (unsigned integer)
+      ChapterTrack (master)
+        ChapterTrackNumber (unsigned integer, valid range: 1 <= value)
+      ChapterDisplay (master)
+        ChapterString (UTF-8 string)
+        ChapterLanguage (UTF-8 string)
+        ChapterCountry (UTF-8 string)
+      ChapterProcess (master)
+        ChapterProcessCodecID (unsigned integer)
+        ChapterProcessPrivate (binary)
+        ChapterProcessCommand (master)
+          ChapterProcessTime (unsigned integer)
+          ChapterProcessData (binary)
+ + +

13.3. Blu-ray에서 챕터 읽기

+ + + +

+ mkvmerge(1)는 암호화되지 않은 Blu-ray의 챕터를 읽을 수 있습니다. 이를 위해 + --chapters 매개 변수를 사용하여 MPLS 재생 목록 중 하나의 경로를 사용할 수 + 있습니다. + +

+ + +

+ 예시: --chapters + /srv/blurays/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. DVD에서 챕터 읽기

+ + + +

+ MKVToolNix가 libdvdvdread(tm) 라이브러리로 컴파일되면 mkvmerge(1)는 + DVD에서 장을 읽을 수 있습니다. 이를 위해 --chapters 매개 변수를 사용하여 DVD의 + 폴더 또는 파일 중 하나에 대한 경로를 사용할 수 있습니다. DVD에는 둘 이상의 제목이 포함될 수 있고 각 제목에는 고유한 챕터 집합이 + 있으므로 파일 이름 인수 끝에 콜론과 원하는 제목 번호를 추가할 수 있습니다. 제목 번호는 1로 기본 설정됩니다. + +

+ + +

+ 예시: --chapters /srv/dvds/BigBuckBunny/VIDEO_TS:2 + +

+ + + +

13.5. 일반적인 주의사항

+ + +

+ 파일을 분할할 때 mkvmerge(1)도 올바르게 챕터를 조정합니다. 즉, 각 파일에 적용되는 장 항목만 포함되며, 각 출력 파일의 새 + 타임스탬프와 일치하도록 타임스탬프가 오프셋됩니다. + +

+ + +

+ --no-filename + 옵션을 사용하여 이 옵션을 명시적으로 사용하지 않도록 설정하지 않은 경우 Matroska(tm) 원본 파일에서 챕터를 복사할 수 + 있습니다. 모든 소스(Matroska(tm) 파일, Ogg 파일, MP4 파일, 챕터 텍스트 파일)의 챕터들은 + 일반적으로 병합되지 않고 별도의 ChapterEdition으로 끝납니다. 동일한 버전의 UID를 + 공유하는 여러 Matroska(tm) 또는 XML 파일에서 챕터를 읽는 경우에만 챕터가 단일 + ChapterEdition으로 병합됩니다. 다른 상황에서도 병합이 필요한 경우, 사용자는 + mkvextract(1)를 사용하여 모든 소스에서 챕터를 추출해야 합니다. 먼저 XML 파일을 수동으로 병합한 후 나중에 병합해야 + 합니다. + +

+ + +

14. 태그

+ + + +

14.1. 소개

+ + + +

+ Matroska(tm)의 태그 시스템은 KEY=VALUE 쌍의 집합인 다른 컨테이너의 태그 시스템과 + 유사합니다. 그러나 Matroska(tm)에서 이러한 태그는 중첩될 수 있으며 KEY와 + VALUE는 모두 고유한 요소입니다. 예제 파일 + example-tags-2.xml은 이 시스템의 사용 방법을 보여 줍니다. + +

+ + + +

14.2. 태그 범위

+ + + +

+ Matroska(tm) 태그는 전체 파일에 자동으로 적용되지 않습니다. 파일의 여러 부분, 즉 하나 이상의 트랙, 하나 이상의 챕터, 또는 + 둘의 조합에도 적용할 수 있습니다. Matroska + 명세서는 이 사실에 대해 더 자세히 설명합니다. + +

+ + +

+ 한 가지 중요한 사실은 태그가 Targets Matroska(tm) 태그 요소를 가진 트랙이나 장에 + 연결된다는 것이고, 이 링크에 사용되는 UID는 모든 곳에서 사용되는 트랙 + ID는notmkvmerge(1) 이라는 것입니다. 대신 사용되는 숫자는 mkvmerge(1)가 자동으로 + 계산하거나(트랙이 Matroska(tm)가 아닌 파일 형식에서 가져온 경우) 트랙의 소스 파일이 Matroska(tm) 파일인 경우 소스 + 파일에서 복사되는 UID입니다. 따라서 파일이 mkvmerge(1)로 넘겨지기 전에 태그 파일에 어떤 UID를 사용해야 하는지 알기는 + 어렵습니다. + +

+ + +

+ Matroska(tm) 파일에 태그를 추가할 수 있는 두 가지 옵션: --global-tags + 및 --tags + 옵션이 있습니다. 차이점은 이전 옵션인 --global-tags는 + 위에서 언급한 Targets 요소를 제거하여 태그를 전체 파일에 적용한다는 것입니다. 후자 + 옵션인 --tags--tags 옵션의 + TID 부분으로 지정된 태그에 대해 mkvmerge(1)가 생성하는 UID를 자동으로 삽입합니다. + +

+ + + +

14.3. 예

+ + +

+ AVI에서 읽은 비디오 트랙에 태그를 추가하려고 합니다. mkvmerge + --identify file.avi는 비디오 트랙의 ID(이 ID를 UID와 혼합하지 않음!)가 0임을 + 알려줍니다. 태그 파일을 생성하고 모든 Targets 요소를 생략하고 mkvmerge(1)를 + 호출합니다. + +

+ +
$ mkvmerge -o file.mkv --tags 0:tags.xml file.avi
+ + +

14.4. 태그 파일 형식

+ + +

+ &vmerge;는 XML 기반 태그 파일 형식을 지원합니다. 이 형식은 Matroska + specification에 따라 매우 밀접하게 모델링되었습니다. MKVToolNix의 바이너리 배포판과 소스 배포판 모두 + example-tags-2.xml샘플 파일과 함께 제공되며, 단순히 알려진 모든 태그를 나열하고 + 실제 태그 파일의 기준으로 사용할 수 있습니다. + +

+ + +

+ 기본은 다음과 같습니다: + +

+ + +
    + +
  • +

    가장 바깥쪽 요소는 <Tags> 여야만 합니다. +

    +
  • + +
  • + +

    논리 태그 하나가 <Tag> XML tags의 한 쌍 안에 포함되어 있습니다. +

    + +
  • + +
  • +

    태그 내용 바로 앞과 뒤에 있는 공백은 무시됩니다.

    +
  • + +
+ + + +

14.5. 데이터 형식

+ + +

+ 새로운 Matroska(tm) 태깅 시스템은 UTF-8 문자열과 이진 유형이라는 두 가지 데이터 유형만 알고 있습니다. 첫 번째 유형은 태그 + 이름과 <String> 요소에 사용되며, 이진 유형은 + <Binary> 요소에 사용됩니다. + +

+ + +

+ 이진 데이터 자체는 XML 파일 mkvmerge(1)에 맞지 않기 때문에 이진 데이터를 저장하는 두 가지 다른 방법을 + 지원합니다. XML 태그의 내용이 '@'로 시작하는 경우 다음 텍스트는 파일 이름으로 + 처리됩니다. 해당 파일의 내용이 Matroska(tm) 요소에 복사됩니다. + +

+ + +

+ 그렇지 않으면 데이터가 Base64로 인코딩될 것으로 예상됩니다. 이진 데이터를 제한된 ASCII 문자 + 집합으로 변환하는 인코딩으로, 예를 들어 전자 메일 프로그램에서 사용됩니다. mkvextract(1)는 이진 요소에 대해 Base64 + 인코딩된 데이터를 출력합니다. + +

+ + +

+ 권장되지 않는 태그 시스템은 공식 태그 사양에서 찾을 수 있는 몇 가지 데이터 유형을 더 알고 있습니다. mkvmerge(1)는 더 이상 + 이 시스템을 지원하지 않으므로, 이러한 유형은 여기에 설명되어 있지 않습니다. + +

+ + + +

14.6. XML 파일 형식의 알려진 태그

+ + + +

+ 다음은 지원되는 XML 태그, 데이터 유형 및 해당 값의 유효한 범위(해당하는 경우)를 나열합니다. + +

+ +
Tags (master)
+  Tag (master)
+    Targets (master)
+      TargetTypeValue (unsigned integer)
+      TargetType (UTF-8 string)
+      TrackUID (unsigned integer)
+      EditionUID (unsigned integer)
+      ChapterUID (unsigned integer)
+      AttachmentUID (unsigned integer)
+    Simple (master)
+      Simple (master)
+      Name (UTF-8 string)
+      TagLanguage (UTF-8 string)
+      DefaultLanguage (unsigned integer)
+      String (UTF-8 string)
+      Binary (binary)
+ +

15. 세그먼트 정보

+ + + +

+ 세그먼트 정보 XML 파일을 사용하면 Matroska(tm) 파일의 "세그먼트 정보" 헤더 필드에 특정 값을 설정할 수 + 있습니다. 이러한 모든 값은 다른 명령줄 옵션을 통해 설정할 수 없습니다. + +

+ + +

+ 기타 "세그먼트 정보"헤더 필드는 명령줄 옵션을 통해 설정할 수 있지만 XML 파일을 통해 설정할 수는 + 없습니다. 여기에는 --title--timestamp-scale + 옵션이 포함됩니다. + +

+ + +

+ 명령줄 옵션이나 XML 파일을 통해 설정할 수 없는 다른 요소도 있습니다. 여기에는 DateUTC( + "muxing date"라고도 함), MuxingApp, + WritingAppDuration이 포함됩니다. 그것들은 항상 + mkvmerge(1) 자체에 의해 설정됩니다. + +

+ + +

+ 다음은 지원되는 XML 태그, 데이터 유형 및 해당 값의 유효한 범위(해당하는 경우)를 나열합니다. + +

+ +
Info (master)
+  SegmentUID (binary, valid range: length in bytes == 16)
+  SegmentFilename (UTF-8 string)
+  PreviousSegmentUID (binary, valid range: length in bytes == 16)
+  PreviousSegmentFilename (UTF-8 string)
+  NextSegmentUID (binary, valid range: length in bytes == 16)
+  NextSegmentFilename (UTF-8 string)
+  SegmentFamily (binary, valid range: length in bytes == 16)
+  ChapterTranslate (master)
+    ChapterTranslateEditionUID (unsigned integer)
+    ChapterTranslateCodec (unsigned integer)
+    ChapterTranslateID (binary)
+

16. Matroska 파일 레이아웃

+ + +

+ Matroska(tm) 파일 레이아웃은 매우 유연합니다. &vmerge;는 미리 정의된 방식으로 파일을 렌더링합니다. 결과 파일은 + 다음과 같습니다: + +

+ + +

+ [EBML head] [segment {meta seek #1} [segment information] [track + information] {attachments} {chapters} [cluster 1] {cluster 2} ... {cluster + n} {cues} {meta seek #2} {tags}] + +

+ + +

+ 중괄호의 요소는 선택 사항이며 사용된 내용과 옵션에 따라 다릅니다. 몇 가지 메모: + +

+ + +
    + +
  • + +

    + 메타탐색 #1은 소수의 레벨 1 요소만 포함하며, 첨부 파일, 챕터, 큐, 태그, 메타탐색 #2가 실제로 존재하는 경우에만 + 포함됩니다. 이전 버전의 mkvmerge(1)도 클러스터를 이 메타탐색 요소에 넣는 데 사용되었습니다. 그러므로 충분한 공간을 확보하기 + 위해서는 약간의 부정확한 추측이 필요합니다. 종종 실패할 가능성이 있습니다. 이제 클러스터만 메타탐색 #2에 저장되며 메타탐색 #1은 + 메타탐색 요소 #2를 참조합니다. + +

    + +
  • + + +
  • + +

    첨부 파일, 장 및 태그 요소는 추가된 경우에만 표시됩니다.

    + +
  • + +
+ + +

+ 가능한 가장 짧은 Matroska(tm) 파일은 다음과 같습니다. + +

+ + +

+ [EBML head] [segment [segment information] [track information] [cluster 1]] + +

+ + +

+ 이는 오디오 전용 파일의 경우일 수 있습니다. + +

+ +

17. 외부 타임스탬프 파일

+ + +

+ 사용자가 직접 특정 트랙의 타임스탬프를 선택할 수 있습니다. 이것은 가변 프레임률 비디오로 파일을 만들거나 오디오에 공백을 포함하기 위해 + 사용될 수 있습니다. 이 경우 프레임은 mkvmerge(1)가 Matroska(tm) 블록별로 별도로 생성하는 단위입니다. 비디오의 경우 + 정확히 하나의 프레임이고 오디오의 경우 특정 오디오 유형의 패킷입니다. 예를 들어 AC-3의 경우 + 1536개의 샘플을 포함하는 패킷입니다. + +

+ + +

+ 트랙이 서로 추가될 때 사용되는 타임스탬프 파일은 트랙 체인의 첫 번째 부분에 대해서만 지정해야 합니다. 예를 들어, v1.avi 및 + v2.avi라는 두 파일을 추가하고 타임스탬프를 사용하려면 명령줄이 다음과 같아야 합니다. + +

+ +
$ mkvmerge ... --timestamps 0:my_timestamps.txt v1.avi +v2.avi
+ +

+ mkvmerge(1)에서 인식되는 네 가지 형식이 있습니다. 첫 번째 줄에는 항상 버전 번호가 포함됩니다. 빈 줄, 공백만 포함된 줄 및 + '#'으로 시작하는 줄은 무시됩니다. + +

+ + +

17.1. 타임스탬프 파일 형식 v1

+ + +

+ 이 형식은 버전 행으로 시작합니다. 두 번째 줄은 초당 기본 프레임 수를 선언합니다. 다음 행은 모두 쉼표로 구분된 세 개의 숫자를 + 포함합니다. 시작 프레임(0은 첫 번째 프레임), 끝 프레임 및 이 범위의 프레임 + 수입니다. FPS는 점 '.'을 소수점으로 하는 부동 소수점 + 번호입니다. 범위에는 기본 FPS가 사용되는 간격이 포함될 수 있습니다. 예: + +

+ +
# timestamp format v1
+assume 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. 타임스탬프 파일 형식 v2

+ + + +

+ 이 형식에서 각 라인은 해당 프레임에 대한 타임스탬프를 포함합니다. 이 타임스탬프는 밀리초 단위로 지정해야 합니다. 부동 소수점 숫자일 + 수 있지만 그럴 필요는 없습니다. 트랙에 있는 프레임 수만큼 타임스탬프 라인을 제공해야 합니다. 이 + 파일의 타임스탬프는 정렬되어야 합니다. 25fps의 예: + +

+ +
# timestamp format v2
+0
+40
+80
+ + +

17.3. 타임스탬프 파일 형식 v3

+ + +

+ 이 형식에서 각 라인은 초당 프레임 수에 이은 시간(초)을 포함합니다. 둘 다 부동 소수점 숫자일 수 있습니다. 초당 프레임 수가 없으면 + 기본 프레임 수가 사용됩니다. 오디오의 경우 코덱이 프레임 타임스탬프 자체를 계산하도록 해야 합니다. 이를 위해 + 0.0을 초당 프레임 수로 사용해야 합니다. 또한 'gap' + 키워드에 이어 갭 지속 시간을 사용하여 스트림에 갭을 만들 수 있습니다. 오디오 파일의 예: + +

+ +
# timestamp format v3
+assume 0.0
+25.325
+7.530,38.236
+gap, 10.050
+2.000,38.236
+ + +

17.4. 타임스탬프 파일 형식 v4

+ + +

+ 이 형식은 v2 형식과 동일합니다. 유일한 차이점은 타임스탬프를 정렬할 필요가 없다는 것입니다. 이 형식은 절대 사용해서는 안 됩니다. + +

+ + +

18. 종료 코드

+ + + +

+ &vmerge; 종료 시 다음 세 가지 종료 코드 중 하나가 표시됩니다: + +

+ + +
    + +
  • + +

    + 0 - 이 종료 코드는 muxing이 성공적으로 완료되었음을 의미합니다. + +

    + +
  • + + +
  • + +

    + 1 -- 이 경우 mkvmerge(1)는 경고를 하나 이상 출력했지만, muxing은 + 계속되었습니다. 경고 앞에 'Warning:'이라는 텍스트가 붙습니다. 관련된 문제에 따라 결과 파일이 + 정상 또는 그렇지 않을 수 있습니다. 사용자는 경고와 결과 파일을 모두 확인해야 합니다. + +

    + +
  • + + +
  • + +

    + 2 - 오류가 발생한 후 이 종료 코드가 사용됩니다. 오류 메시지를 출력한 후 바로 + 중단합니다. 오류 메시지는 읽기/쓰기 오류에 대한 잘못된 명령줄 인수에서 손상된 파일에 이르기까지 다양합니다. + +

    + +
  • + +
+ +

19. 환경 변수

+ + + +

+ mkvmerge(1)는 시스템의 로케일을 결정하는 기본 변수(예: LANG 및 + LC_* 제품군)를 사용합니다. 추가 변수: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG and + its short form MTX_DEBUG + +

내용은 --debug 옵션을 통해 + 전달된 것으로 간주됩니다. +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE 와 그 + 간략한 형태인 MTX_ENGAGE + +

내용은 --engage 옵션을 + 통해 전달된 것으로 간주됩니다. +

+ +
+ +

20. 더 보기

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. WWW

+ + +

+ 이전 버전은 언제나 MKVToolNix + 홈페이지에서 찾을 수 있습니다. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..fa9b2eb92b1775efcf8dab795cb3e4fb17f2928a --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvpropedit.html @@ -0,0 +1,1213 @@ + + + + + mkvpropedit -- 완전한 remux 없이 기존 Matroska 파일의 속성 수정 + + + +
mkvpropedit -- 완전한 remux 없이 기존 Matroska(tm) 파일의 속성 수정 +
+
+ +
+

1. 개요

+ + +
mkvpropedit options {source-filename} {actions} +
+ +

2. 설명

+ + +

+ 이 프로그램은 기존 Matroska(tm) 파일을 분석하고 일부 속성을 수정합니다. 그런 다음 수정 사항을 기존 파일에 기록합니다. 변경할 + 수 있는 속성에는 세그먼트 정보 요소(예: 제목)와 트랙 헤더(예: 언어 코드, '기본 트랙' 플래그 또는 이름)가 있습니다. + +

+ + +

+ 옵션: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ 알려진 편집 가능한 모든 속성 이름, 유형(문자열, 정수, 부울 등) 및 간단한 설명을 나열합니다. 프로그램이 나중에 종료됩니다. 따라서 + source-filename 매개 변수를 제공할 필요가 없습니다. + +

+ +
-p, --parse-mode + mode + +

+ 구문 분석 모드를 설정합니다. 'mode' 매개 변수는 + 'fast'(기본값이기도 함) 또는 'full'일 수 + 있습니다. 'fast' 모드는 전체 파일을 구문 분석하지 않고 원본 파일의 필수 요소를 찾기 위해 메타 + 검색 요소를 사용합니다. 모든 경우에 99%는 이것으로 충분하다. 그러나 메타 탐색 요소를 포함하지 않거나 손상된 파일의 경우 사용자는 + 'full' 구문 분석 모드를 설정해야 할 수 있습니다. 파일 전체 검색에는 몇 분 정도 걸릴 수 + 있지만 빠른 검색에는 몇 초밖에 걸리지 않습니다. + +

+ +
+ + +

+ 트랙 및 세그먼트 정보 속성을 다루는 작업: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit selector + +

+ 다음 모든 add, setdelete 작업이 작동하는 Matroska(tm) + 파일 섹션(세그먼트 정보 또는 특정 트랙의 헤더)을 설정합니다. 이 옵션은 둘 이상의 요소를 수정하기 위해 여러 번 사용할 수 있습니다. + +

+ + +

+ 기본적으로 mkvpropedit(1)는 세그먼트 정보 섹션을 편집합니다. + +

+ + +

+ 구문에 대한 전체 설명은 edit + selectors섹션을 참조하십시오. + +

+ +
-a, --add + name=value + +

+ 값 value를 사용하여 속성 name을 + 추가합니다. 해당 속성이 이미 있는 경우에도 속성이 추가됩니다. 대부분의 속성은 고유하며 두 번 이상 발생할 수 없습니다. + +

+ +
-s, --set + name=value + +

+ 속성 name의 모든 항목을 값 value로 + 설정합니다. 해당 속성이 없으면 추가됩니다. + +

+ +
-d, --delete name + +

+ 속성 name의 모든 항목을 삭제합니다. 일부 속성은 필수이며 삭제할 수 없습니다. + +

+ +
+ + +

+ 태그 및 장을 처리하는 작업: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags + selector:filename + +

+ 파일의 태그를 filename의 태그로 추가하거나 바꾸거나, + filename이 비어 있으면 제거합니다. mkvpropedit(1)는 mkvmerge(1)가 읽는 + 것과 동일한 XML 태그 형식도 읽습니다. + +

+ + +

+ selectorall, + global 또는 track 단어 중 하나여야 + 합니다. all의 경우 mkvpropedit(1)는 파일의 모든 태그를 바꾸거나 + 제거합니다. global을 사용할 경우 global 태그만 교체되거나 제거됩니다. + +

+ + +

+ track을 사용하면 mkvpropedit(1)가 특정 트랙의 태그를 대체합니다. 또한 + filename에서 읽은 태그가 동일한 트랙에 할당됩니다. 트랙은 edit selectors가 지정된 것과 동일한 방식으로 + 지정됩니다(아래 참조). 예를 들어 --tags track:a1:new-audio-tags.xml입니다. + +

+ +
--add-track-statistics-tags + +

+ 파일의 모든 트랙에 대한 통계를 계산하고 해당 트랙에 대한 새 통계 태그를 추가합니다. 파일에 이미 이러한 태그가 포함되어 있으면 해당 + 태그가 업데이트됩니다. + +

+ +
--delete-track-statistics-tags + +

+ 파일에서 기존의 모든 추적 통계 태그를 삭제합니다. 파일에 추적 통계 태그가 없으면 수정되지 않습니다. + +

+ +
-c, --chapters + filename + +

+ 파일의 장을 filename의 장으로 추가하거나 바꾸거나, + filename이 비어 있으면 제거하십시오. mkvpropedit(1)는 mkvmerge(1)와 동일한 + XML 및 간단한 챕터 형식을 읽습니다. + +

+ +
+ + +

+ 첨부 파일 처리 동작: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment filename + +

+ filename에서 새 첨부 파일을 추가합니다. + +

+ + +

+ --attachment-name 옵션이 이 선택사항 이전에 사용된 경우, 해당 값은 새 첨부 파일의 + 이름으로 사용됩니다. 그렇지 않으면 filename에서 파생됩니다. + +

+ + +

+ --attachment-mime-type 선택사항이 이 선택사항 이전에 사용된 경우, 해당 값은 새로운 + 첨부파일의 MIME 유형으로 사용됩니다. 그렇지 않으면 filename의 내용에서 자동으로 + 탐지됩니다. + +

+ + +

+ --attachment-description 옵션이 이 선택사항 이전에 사용된 경우, 해당 값은 새 첨부 + 파일의 설명으로 사용됩니다. 그렇지 않으면 설명이 설정되지 않습니다. + +

+ + +

+ --attachment-uid 옵션이 이 선택사항 이전에 사용된 경우, 해당 값은 새 첨부 파일의 UID로 + 사용됩니다. 그렇지 않으면 랜덤 UID가 자동으로 생성됩니다. + +

+ +
--replace-attachment + selector:filename + +

+ selector와 일치하는 첨부 파일을 filename + 파일로 바꿉니다. 둘 이상의 기존 첨부 파일이 selector와 일치하는 경우, 모든 첨부 + 파일의 내용이 filename의 내용으로 바뀝니다. + +

+ + +

+ selector는 네 가지 형태 중 하나를 가질 수 있습니다. 아래 attachment selectors 섹션에서 + 설명합니다. + +

+ + +

+ --attachment-name 옵션이 이 선택사항 이전에 사용된 경우, 이 값은 수정된 각 첨부파일의 새 + 이름으로 설정됩니다. 그렇지 않으면 이름이 바뀌지 않습니다. + +

+ + +

+ --attachment-mime-type 옵션이 이 선택사항 이전에 사용된 경우, 이 값은 수정된 각 + 첨부파일에 대한 새 MIME 유형으로 설정됩니다. 그렇지 않으면 MIME 유형은 변경되지 않습니다. + +

+ + +

+ --attachment-description 옵션이 이 선택사항 이전에 사용된 경우, 이 값은 수정된 각 + 첨부파일에 대한 새 설명으로 설정됩니다. 그렇지 않으면 설명이 변경되지 않습니다. + +

+ + +

+ --attachment-uid 옵션이 이 선택사항 이전에 사용된 경우, 이 값은 수정된 각 첨부파일의 새 + UID로 설정됩니다. 그렇지 않으면 UIDs가 바뀌지 않습니다. + +

+ +
--update-attachment selector + +

+ selector와 일치하는 하나 이상의 첨부 파일의 속성을 설정합니다. 둘 이상의 기존 첨부 + 파일이 selector와 일치하는 경우 해당 모든 속성이 업데이트됩니다. + +

+ + +

+ selector는 네 가지 형태 중 하나를 가질 수 있습니다. 아래 attachment selectors 섹션에서 + 설명합니다. + +

+ + +

+ --attachment-name 옵션이 이 선택사항 이전에 사용된 경우, 이 값은 수정된 각 첨부파일의 새 + 이름으로 설정됩니다. 그렇지 않으면 이름이 바뀌지 않습니다. + +

+ + +

+ --attachment-mime-type 옵션이 이 선택사항 이전에 사용된 경우, 이 값은 수정된 각 + 첨부파일에 대한 새 MIME 유형으로 설정됩니다. 그렇지 않으면 MIME 유형은 변경되지 않습니다. + +

+ + +

+ --attachment-description 옵션이 이 선택사항 이전에 사용된 경우, 이 값은 수정된 각 + 첨부파일에 대한 새 설명으로 설정됩니다. 그렇지 않으면 설명이 변경되지 않습니다. + +

+ + +

+ --attachment-uid 옵션이 이 선택사항 이전에 사용된 경우, 이 값은 수정된 각 첨부파일의 새 + UID로 설정됩니다. 그렇지 않으면 UIDs가 바뀌지 않습니다. + +

+ +
--delete-attachment selector + +

+ selector와 일치하는 첨부 파일을 하나 이상 삭제합니다. + +

+ + +

+ selector는 네 가지 형태 중 하나를 가질 수 있습니다. 아래 attachment selectors 섹션에서 + 설명합니다. + +

+ +
+ + +

+ 첨부 작업 옵션: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name name + +

+ 다음 --add-attachment 또는 + --replace-attachment 작업에 사용할 이름을 설정합니다. + +

+ +
--attachment-mime-type mime-type + +

+ 다음 --add-attachment 또는 + --replace-attachment 작업에 사용할 MIME을 설정합니다. + +

+ +
--attachment-description 설명 + +

+ 다음 --add-attachment 또는 + --replace-attachment 작업에 사용할 설명을 설정합니다. + +

+ +
--enable-legacy-font-mime-types + +

+ 특정 유형의 글꼴 첨부 파일에 대해 기존 MIME 유형을 사용할 수 있습니다. 예를 들어 TrueType + 글꼴에는 'fonts/ttf' 대신 + 'application/x-truetype-font'가 사용됩니다. + +

+ + +

+ 이것은 새 첨부 파일 추가 및 기존 첨부 파일 교체 모두에 영향을 미치지만, 새 MIME 유형이 지정되지 + 않은 경우에만 적용됩니다. 다른 기존 첨부 파일은 변경되지 않습니다. + +

+ + +

+ 영향을 받는 MIME 유형은 + 'application/x-truetype-fonts'에 매핑된 + 'font/sfnt'와 'font/ttf', + 'font/collection'이고 + 'application/vnd.ms-opentype'에 매핑된 + 'font/otf' 입니다. + +

+ +
+ + +

+ 다른 옵션: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ 일반적으로 사용자가 'language' 트랙 헤더 속성 변경을 요청할 때 mkvpropedit(1)는 + 기존 Language 요소 외에 새 + LanguageIETF 트랙 헤더 요소에도 동일한 변경 사항을 적용합니다. 이 옵션을 사용할 + 경우 변경 사항은 레거시 Language 요소에만 적용됩니다. + +

+ + +

+ 이 옵션은 language-ietf 트랙 헤더 속성을 통해 요청된 변경에는 영향을 주지 않습니다. + +

+ +
--normalize-language-ietf mode + +

+ 모든 IETF BCP 47 언어 태그를 모드 'canonical'의 표준 형식, 모드 + 'extlang'의 확장 언어 하위 태그 형식으로 정규화하거나 모드 + 'off'로 해제할 수 있습니다. 기본적으로 표준 형식에 대한 정규화가 적용됩니다. + +

+ + +

+ 표준 형식에서 기본값이 존재하는 모든 하위 태그는 해당 기본 값으로 대체됩니다. 이를 통해 + 'zh-yue-jyutping'을 'yue-jyutping'으로 + 변환하거나 'fr-FX'를 'fr-FR'로 변환합니다. + +

+ + +

+ 확장 언어 하위 태그 형식의 경우 표준 형식이 먼저 구축됩니다. 나중에 확장 언어 하위 태그가 존재하는 모든 기본 언어는 확장 언어 하위 + 태그와 접두사로 대체됩니다. 예를 들면 'yue-jyutping'을 + 'zh-yue-jyutping'으로 다시 변환하지만 'fr'은 확장 + 언어 하위 태그가 아니기 때문에 'fr-FR'에는 영향을 미치지 않습니다. + +

+ + +

+ 이 정규화는 실제로 변경된 요소에만 적용됩니다: + +

+ + +
    + +
  • + +

    + 트랙 헤더를 편집할 때 편집 규격을 통해 설정된 트랙 언어 요소만 영향을 받습니다. 편집되지 않은 트랙의 언어는 변경되지 + 않습니다. 트랙을 편집하고 언어가 아닌 속성만 설정해도 언어에 영향을 주지 않습니다. + +

    + +
  • + + +
  • + +

    + 챕터를 편집할 때 기존 챕터가 항상 완전히 교체되므로 모든 챕터 요소의 모든 언어 요소가 영향을 받습니다. + +

    + +
  • + + +
  • + +

    + 태그를 편집할 때 실제로 대체되는 태그의 언어 요소만 영향을 받습니다. 예를 들어 글로벌 태그를 교체해도 기존 트랙 태그는 영향을 받지 + 않습니다. + +

    + +
  • + +
+ + +

+ 파일의 모든 기존 언어 태그를 정규화하는 가장 좋은 방법은 mkvmerge(1)로 remux하고 + '--normalize-language-ietf' 옵션을 원하는 모드로 설정하는 것입니다. + +

+ +
--command-line-charset 문자셋 + +

+ 명령행에 주어진 문자열을 변환할 문자셋을 정합니다. 기본값은 현재 시스템 로케일에 따른 문자셋입니다. + +

+ +
--output-charset 문자셋 + +

+ 출력할 문자열을 변환할 문자셋을 정합니다. 기본값은 현재 시스템 로케일에 따른 문자셋입니다. + +

+ +
-r, --redirect-output + 파일명 + +

+ 모든 메시지를 콘솔 대신 file-name 파일에 씁니다. 출력 리디렉션을 통해 쉽게 수행할 수 + 있지만 터미널이 출력을 파일에 쓰기 전에 재해석하는 경우 이 옵션이 필요한 경우가 있습니다. --output-charset으로 + 설정된 문자 집합이 적용됩니다. + +

+ +
--ui-language 코드 + +

+ 언어 코드의 번역을 강제로 사용합니다 (예: 강제 사용할 독일어 번역 코드는 + 'de_DE'). 'list'를 + 코드로 입력하면 mkvextract(1) 에서 이용 가능한 번역 목록을 출력할 것입니다. + +

+ +
--abort-on-warnings + +

+ 첫 번째 경고가 발생한 후 프로그램을 중단하도록 지시합니다. 프로그램의 종료 코드는 1입니다. + +

+ +
--debug 토픽 + +

+ 특정 기능에 대해 디버깅을 켭니다. 이 기능은 개발자에게만 유용합니다. + +

+ +
--engage 기능 + +

+ 실험 기능을 켭니다. 사용 가능한 기능 목록은 mkvpropedit --engague list와 함께 + 요청할 수 있습니다. 이러한 기능은 정상적인 상황에서 사용할 수 없습니다. + +

+ +
--gui-mode + +

+ GUI 모드를 켭니다. 이 모드에서는 GUI 동작시 무슨 일이 일어나는지 알려줄 수 있는 특별하게 형식화된 줄을 출력할 것입니다. 이 + 메시지들은 '#GUI#message' 형식을 따릅니다. 이 메시지 뒤에 + '#GUI#message#key1=value1#key2=value2…' 형태의 키/값 쌍이 붙을 수 + 있습니다. 메시지나 키값들은 결코 번역되지 않고 항상 영어로 출력됩니다. + +

+ +
-v, --verbose + +

+ 읽어들인 모든 중요한 Matroska(tm) 요소를 자세하게 보여 줍니다. + +

+ +
-h, --help + +

+ 사용법에 관한 정보를 표시하고 종료합니다. + +

+ +
-V, --version + +

+ 버전 정보를 표시하고 종료합니다. + +

+ +
@옵션 파일.json + +

+ 추가 명령행 인수는 옵션-파일 파일에서 읽어보세요. 이러한 파일용 지원 형식에 대한 자세한 + 설명은 mkvmerge(1) man page에서 "옵션 파일"이라는 섹션을 참고하세요. + +

+ +
+ +

3. 선택기 편집

+ + +

+ --edit + 옵션은 다음과 같은 모든 add, setdelete 작업이 작동하는 Matroska(tm) + 파일 섹션(세그먼트 정보 또는 특정 트랙의 헤더)을 설정합니다. 이것은 다음 --edit 선택사항을 + 찾을 때까지 유효합니다. 이 옵션의 인수를 편집 선택기라고 합니다. + +

+ + +

+ 기본적으로 mkvpropedit(1)는 세그먼트 정보 섹션을 편집합니다. + +

+ + +

3.1. 세그먼트 정보

+ + +

+ 세그먼트 정보는 'info', 'segment_info' 또는 + 'segmentinfo'의 세 단어 중 하나로 선택할 수 있습니다. 세그먼트 제목 또는 세그먼트 + UID와 같은 속성을 포함합니다. + +

+ + + +

3.2. 트랙 헤더

+ + +

+ 트랙 헤더는 조금 더 복잡한 선택기로 선택할 수 있습니다. 모든 변형은 'track:'로 + 시작합니다. 트랙 헤더 속성에는 언어 코드, '기본 트랙' 플래그 또는 트랙 이름과 같은 요소가 포함됩니다. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ 매개 변수 n이 숫자이면 n번째 트랙이 + 선택됩니다. 트랙 순서는 mkvmerge(1)--identify 옵션 출력과 동일합니다. + +

+ + +

+ 번호는 1부터 시작입니다. + +

+ +
track:tn + +

+ 파라미터가 단일 문자 t로 시작하고 이어서 특정 트랙 유형의 + n번째 트랙이 선택됩니다. 트랙 유형 매개 변수 t는 + 오디오 트랙의 경우 'a', 버튼 트랙의 경우 'b', 자막 트랙의 + 경우 's', 비디오 트랙의 경우 'v' 중 하나여야 합니다. 트랙 + 순서는 mkvmerge(1)--identify 옵션 출력과 동일합니다. + +

+ + +

+ 번호는 1부터 시작입니다. + +

+ +
track:=uid + +

+ 파라미터가 '='에 이어 숫자 uid로 시작하는 경우 트랙 + UID 요소가 지정된 uid와 동일한 트랙이 선택됩니다. 트랙 + UIDsmkvinfo(1)에서 얻을 수 있습니다. + +

+ +
track:@number + +

+ 파라미터가 '@'로 시작하고 숫자number 뒤에 오는 경우, + 트랙 번호 요소가 이 number와 같은 트랙이 선택됩니다. 트랙 번호는 mkvinfo(1)를 + 통해 얻을 수 있습니다. + +

+ +
+ + + +

3.3. 주의

+ + +

+ 트랙 편집 선택기의 특성상 여러 선택기가 실제로 동일한 트랙 헤더와 일치할 수 있습니다. 이러한 경우 편집 선택기에 대한 모든 작업은 + 명령줄에 지정된 순서대로 결합되고 실행됩니다. + +

+ + +

4. 첨부 파일 선택기

+ + + +

+ 첨부 파일 선택기는 --replace-attachment + 및 --delete-attachment + 두 가지 동작과 함께 사용됩니다. 다음 네 가지 형식 중 하나를 사용할 수 있습니다: + +

+ + +
    + +
  1. + +

    + 첨부 파일 ID로 선택합니다. 이 양식에서 선택기는 mkvmerge(1)의 식별 명령에 의해 출력되는 첨부 파일의 ID인 숫자입니다. + +

    + +
  2. + + +
  3. + +

    + 첨부파일 UID(고유 ID)에 의한 선택입니다. 이 양식에서 선택기는 등호 = 뒤에 숫자, 첨부 파일의 + 고유 ID를 출력하는 mkvmerge(1)의 상세 식별 명령입니다. + +

    + +
  4. + + +
  5. + +

    + 첨부 파일 이름으로 선택합니다. 이 양식에서 선택기는 문자 그대로의 단어 name: 뒤에 기존 첨부 + 파일의 이름이 붙습니다. 이 선택기를 --replace-attachment와 함께 사용할 경우 일치시킬 + 이름 내의 콜론은 \c로 이스케이프해야 합니다. + +

    + +
  6. + + +
  7. + +

    + MIME 유형별로 선택합니다. 이 양식에서 선택기는 mime-type:이고 그 뒤에 기존 첨부파일의 + MIME 유형이 있습니다. 이 선택기가 --replace-attachment와 함께 사용되는 경우 일치시킬 + MIME 유형 내의 콜론은 \c로 이스케이프해야 합니다. + +

    + +
  8. + +
+ +

5. Language handling

+ + + +

+ mkvpropedit(1) mostly tries to do the right thing by default. Therefore + changes to the language property will cause mkvpropedit(1) + to apply the same change to both the new "LanguageIETF" element as well as + the old "Language" element similar to how mkvmerge(1) applies the language to + both elements. For example, when using mkvpropedit movie.mkv --edit + track:2 --set language=zh-TW the "LanguageIETF" element will be + set to zh-TW and the old "Language" element to + chi. + +

+ + +

+ Additionally there's a new track header property named + language-ietf that can be set or removed. Changes to this + property only apply to the new "LanguageIETF" track header element. A caveat + is that the old "Language" track header element is a mandatory element in + Matroska — meaning even if it isn't present in the file it still has an + implied value. When the user only sets the language-ietf + property but not the language property, mkvpropedit(1) will + therefore add the old "Language" element in certain cases & set it to + und (meaning "undetermined") as the user didn't specify a + value for it. + +

+ + +

When reading XML chapter or tag files mkvpropedit(1) works like mkvmerge(1) + does. +

+ + +

The creation of the new elements can be disabled completely with the + command-line option `--disable-language-ietf` which operates on all three + new elements. +

+ + +

You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. +

+ +

6. 보기

+ + +

+ 다음 예제에서는 'movie.mkv'라는 파일을 편집합니다. 세그먼트 제목을 설정하고 오디오와 자막 + 트랙의 언어 코드를 수정합니다. 세그먼트 정보 요소를 편집하는 것은 어쨌든 첫 번째 --edit 옵션 이전에 + 발견된 모든 옵션의 기본값이기 때문에 첫 번째 --edit 옵션을 + 생략하면 이 예를 단축할 수 있습니다. + +

+ +
$ mkvpropedit movie.mkv --edit info --set "title=The movie" --edit track:a1 --set language=fre --edit track:a2 --set language=ita
+ +

+ 두 번째 예는 첫 번째 자막 트랙에서 '기본 트랙 플래그'를 제거하고 두 번째 트랙으로 설정합니다. mkvpropedit(1)는 + mkvmerge(1)와 달리 다른 트랙의 '기본 트랙 플래그'가 자동으로 '1'로 설정된 경우 '0'으로 설정되지 않습니다. + +

+ +
$ mkvpropedit movie.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ 파일에서 두 번째 자막 트랙의 태그를 바꾸는 것은 다음과 같습니다. + +

+ +
$ mkvpropedit movie.mkv --tags track:s2:new-subtitle-tags.xml
+ +

+ 모든 태그를 제거하려면 파일 이름을 생략해야 합니다. + +

+ +
$ mkvpropedit movie.mkv --tags all:
+ +

+ 파일의 장을 바꾸는 것은 다음과 같습니다. + +

+ +
$ mkvpropedit movie.mkv --chapters new-chapters.xml
+ +

+ 모든 챕터를 제거하려면 파일 이름을 생략해야 합니다. + +

+ +
$ mkvpropedit movie.mkv --chapters ''
+ +

+ 첨부 파일로 글꼴 파일(Arial.ttf) 추가: + +

+ +
$ mkvpropedit movie.mkv --add-attachment Arial.ttf
+ +

+ 첨부 파일로 글꼴 파일(89719823.ttf)을 추가하고 실제로 Arial에 해당하는 정보를 + 제공합니다. + +

+ +
$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'The Arial font as a TrueType font' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ 첨부된 글꼴(Comic.ttf) 파일을 다른 + 글꼴(Arial.ttf)로 대체하는 경우: + +

+ +
$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'The Arial font as a TrueType font' --replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ 두 번째 첨부 파일 삭제: + +

+ +
$ mkvpropedit movie.mkv --delete-attachment 2
+ +

+ MIME 유형별로 연결된 모든 글꼴 삭제: + +

+ +
$ mkvpropedit movie.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. 종료 코드

+ + + +

+ mkvpropedit(1) 종료 시 다음 세 가지 종료 코드 중 하나가 표시됩니다. + +

+ + +
    + +
  • + +

    + 0 - 이 종료 코드는 수정이 성공적으로 완료되었음을 의미합니다. + +

    + +
  • + + +
  • + +

    + 1 -- 이 경우 mkvpropedit(1)는 경고를 하나 이상 출력했지만 수정은 + 계속되었습니다. 경고 앞에 'Warning:'이라는 텍스트가 붙습니다. 관련된 문제에 따라 결과 파일이 + 정상 또는 그렇지 않을 수 있습니다. 사용자는 경고와 결과 파일을 모두 확인해야 합니다. + +

    + +
  • + + +
  • + +

    + 2 - 오류가 발생한 후 이 종료 코드가 사용됩니다. 오류 메시지를 출력한 후 바로 + 중단합니다. 오류 메시지는 읽기/쓰기 오류에 대한 잘못된 명령줄 인수에서 손상된 파일에 이르기까지 다양합니다. + +

    + +
  • + +
+ +

8. 텍스트 파일과 문자셋 변환

+ + + +

+ MKVToolNix 제품군의 모든 도구가 문자 집합 변환, 입력/출력 인코딩, 명령줄 인코딩 및 콘솔 인코딩을 처리하는 방법에 대한 + 자세한 내용은 mkvmerge(1) 매뉴얼 페이지에서 동일한 이름의 섹션을 참조하십시오. + +

+ +

9. 환경 변수

+ + + +

+ mkvpropedit(1)는 시스템의 로케일을 결정하는 기본 변수(예: LANG 및 + LC_* 제품군)를 사용합니다. 추가 변수: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG 와 + 그 간략한 형태인MTX_DEBUG + +

내용은 --debug 옵션을 + 통해 전달된 것으로 간주됩니다. +

+ +
MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE + 와 그 간략한 형태인 MTX_ENGAGE + +

내용은 --engage + 옵션을 통해 전달된 것으로 간주됩니다. +

+ +
+ +

10. 더 보기

+ + +

+ mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1) + +

+ +

11. WWW

+ + +

+ 이전 버전은 언제나 MKVToolNix + 홈페이지에서 찾을 수 있습니다. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..ca0ef5c944ddf9d1385a92faff3da17725dce326 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ko/mkvtoolnix-gui.html @@ -0,0 +1,147 @@ + + + + + mkvtoolnix-gui -- 챕터와 헤더 편집기를 포함하는 mkvmerge1용 GUI + + + +
mkvtoolnix-gui -- 챕터와 헤더 편집기를 포함하는 mkvmerge(1)용 GUI +
+
+
+

Table of contents

+ +
+
+

1. 개요

+ + +
mkvtoolnix-gui [[configuration-file-name.mtxcfg] | [source-file.ext] | [matroska-file.mkv] | [chapter-file.ext] | [matroska-file.mkv]] +
+ +

2. 설명

+ + +

+ mkvtoolnix-gui(1)는 mkvmerge(1)Qt(tm) 기반 + GUI입니다. 또한 mkvinfo(1)mkvpropedit(1)의 기능을 구현하며 mkvmerge(1) + 추출물까지 포함하도록 진화할 것입니다. 모든 설정(예: 원본 파일, 트랙 옵션)을 저장하고 복원할 수 있습니다. + +

+ + +

+ .mtxcfg 확장자로 구성 파일 이름을 나열하면 GUI가 해당 도구에 해당 구성 파일을 + 로드합니다. 다른 모든 파일 이름은 현재 모드에 따라 정보 도구, 장 편집기 또는 헤더 편집기에서 열리는 다중화를 위한 소스 파일로 + 추가됩니다. 현재 모드는 --merge, --info, + --edit-chapters 또는 --edit-headers를 사용하여 + 변경할 수 있습니다. 기본 모드는 다중화를 위해 파일을 추가하는 것입니다. + +

+ + +

+ 응용 프로그램을 두 번째로 시작할 때 응용 프로그램의 인스턴스가 이미 실행 중인 경우 명령줄에 지정된 모든 파일 이름이 이미 실행 중인 + 인스턴스에 의해 처리됩니다. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

다음 모든 파일 이름이 현재 다중 작업에 원본 파일로 추가됩니다. 기본 모드입니다.

+ +
--info + +

다음의 모든 파일명을 정보 도구에서 엽니다.

+ +

또한 시작 시 멀티플렉서 도구 대신 정보 도구가 선택됩니다.

+ +
--edit-chapters + +

다음의 모든 파일명을 챕터 편집기에서 열 것입니다.

+ +

또한 시작할 때 멀티플렉서 도구 대신 챕터 편집기가 선택됩니다.

+ +
--edit-headers + +

다음의 모든 파일명을 헤더 편집기에서 열 것입니다.

+ +

또한 시작할 때 멀티플렉서 도구 대신 헤더 편집기가 선택됩니다.

+ +
-h, --help + +

+ 사용법에 관한 정보를 표시하고 종료합니다. + +

+ +
-V, --version + +

+ 버전 정보를 표시하고 종료합니다. + +

+ +
+ +

3. 더 보기

+ + +

+ mkvmerge(1), mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. WWW

+ + +

+ 이전 버전은 언제나 MKVToolNix + 홈페이지에서 찾을 수 있습니다. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/Boost-1.0.txt b/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/Boost-1.0.txt new file mode 100644 index 0000000000000000000000000000000000000000..36b7cd93cdfbac762f5be4c6ce276df2ea6305c2 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/Boost-1.0.txt @@ -0,0 +1,23 @@ +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/CC-BY-3.0.txt b/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/CC-BY-3.0.txt new file mode 100644 index 0000000000000000000000000000000000000000..1a16e05564d2aaa880bbe9e506a0a0226d8742cc --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/CC-BY-3.0.txt @@ -0,0 +1,319 @@ +Creative Commons Legal Code + +Attribution 3.0 Unported + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR + DAMAGES RESULTING FROM ITS USE. + +License + +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE +COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY +COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS +AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. + +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE +TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY +BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS +CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND +CONDITIONS. + +1. Definitions + + a. "Adaptation" means a work based upon the Work, or upon the Work and + other pre-existing works, such as a translation, adaptation, + derivative work, arrangement of music or other alterations of a + literary or artistic work, or phonogram or performance and includes + cinematographic adaptations or any other form in which the Work may be + recast, transformed, or adapted including in any form recognizably + derived from the original, except that a work that constitutes a + Collection will not be considered an Adaptation for the purpose of + this License. For the avoidance of doubt, where the Work is a musical + work, performance or phonogram, the synchronization of the Work in + timed-relation with a moving image ("synching") will be considered an + Adaptation for the purpose of this License. + b. "Collection" means a collection of literary or artistic works, such as + encyclopedias and anthologies, or performances, phonograms or + broadcasts, or other works or subject matter other than works listed + in Section 1(f) below, which, by reason of the selection and + arrangement of their contents, constitute intellectual creations, in + which the Work is included in its entirety in unmodified form along + with one or more other contributions, each constituting separate and + independent works in themselves, which together are assembled into a + collective whole. A work that constitutes a Collection will not be + considered an Adaptation (as defined above) for the purposes of this + License. + c. "Distribute" means to make available to the public the original and + copies of the Work or Adaptation, as appropriate, through sale or + other transfer of ownership. + d. "Licensor" means the individual, individuals, entity or entities that + offer(s) the Work under the terms of this License. + e. "Original Author" means, in the case of a literary or artistic work, + the individual, individuals, entity or entities who created the Work + or if no individual or entity can be identified, the publisher; and in + addition (i) in the case of a performance the actors, singers, + musicians, dancers, and other persons who act, sing, deliver, declaim, + play in, interpret or otherwise perform literary or artistic works or + expressions of folklore; (ii) in the case of a phonogram the producer + being the person or legal entity who first fixes the sounds of a + performance or other sounds; and, (iii) in the case of broadcasts, the + organization that transmits the broadcast. + f. "Work" means the literary and/or artistic work offered under the terms + of this License including without limitation any production in the + literary, scientific and artistic domain, whatever may be the mode or + form of its expression including digital form, such as a book, + pamphlet and other writing; a lecture, address, sermon or other work + of the same nature; a dramatic or dramatico-musical work; a + choreographic work or entertainment in dumb show; a musical + composition with or without words; a cinematographic work to which are + assimilated works expressed by a process analogous to cinematography; + a work of drawing, painting, architecture, sculpture, engraving or + lithography; a photographic work to which are assimilated works + expressed by a process analogous to photography; a work of applied + art; an illustration, map, plan, sketch or three-dimensional work + relative to geography, topography, architecture or science; a + performance; a broadcast; a phonogram; a compilation of data to the + extent it is protected as a copyrightable work; or a work performed by + a variety or circus performer to the extent it is not otherwise + considered a literary or artistic work. + g. "You" means an individual or entity exercising rights under this + License who has not previously violated the terms of this License with + respect to the Work, or who has received express permission from the + Licensor to exercise rights under this License despite a previous + violation. + h. "Publicly Perform" means to perform public recitations of the Work and + to communicate to the public those public recitations, by any means or + process, including by wire or wireless means or public digital + performances; to make available to the public Works in such a way that + members of the public may access these Works from a place and at a + place individually chosen by them; to perform the Work to the public + by any means or process and the communication to the public of the + performances of the Work, including by public digital performance; to + broadcast and rebroadcast the Work by any means including signs, + sounds or images. + i. "Reproduce" means to make copies of the Work by any means including + without limitation by sound or visual recordings and the right of + fixation and reproducing fixations of the Work, including storage of a + protected performance or phonogram in digital form or other electronic + medium. + +2. Fair Dealing Rights. Nothing in this License is intended to reduce, +limit, or restrict any uses free from copyright or rights arising from +limitations or exceptions that are provided for in connection with the +copyright protection under copyright law or other applicable laws. + +3. License Grant. Subject to the terms and conditions of this License, +Licensor hereby grants You a worldwide, royalty-free, non-exclusive, +perpetual (for the duration of the applicable copyright) license to +exercise the rights in the Work as stated below: + + a. to Reproduce the Work, to incorporate the Work into one or more + Collections, and to Reproduce the Work as incorporated in the + Collections; + b. to create and Reproduce Adaptations provided that any such Adaptation, + including any translation in any medium, takes reasonable steps to + clearly label, demarcate or otherwise identify that changes were made + to the original Work. For example, a translation could be marked "The + original work was translated from English to Spanish," or a + modification could indicate "The original work has been modified."; + c. to Distribute and Publicly Perform the Work including as incorporated + in Collections; and, + d. to Distribute and Publicly Perform Adaptations. + e. For the avoidance of doubt: + + i. Non-waivable Compulsory License Schemes. In those jurisdictions in + which the right to collect royalties through any statutory or + compulsory licensing scheme cannot be waived, the Licensor + reserves the exclusive right to collect such royalties for any + exercise by You of the rights granted under this License; + ii. Waivable Compulsory License Schemes. In those jurisdictions in + which the right to collect royalties through any statutory or + compulsory licensing scheme can be waived, the Licensor waives the + exclusive right to collect such royalties for any exercise by You + of the rights granted under this License; and, + iii. Voluntary License Schemes. The Licensor waives the right to + collect royalties, whether individually or, in the event that the + Licensor is a member of a collecting society that administers + voluntary licensing schemes, via that society, from any exercise + by You of the rights granted under this License. + +The above rights may be exercised in all media and formats whether now +known or hereafter devised. The above rights include the right to make +such modifications as are technically necessary to exercise the rights in +other media and formats. Subject to Section 8(f), all rights not expressly +granted by Licensor are hereby reserved. + +4. Restrictions. The license granted in Section 3 above is expressly made +subject to and limited by the following restrictions: + + a. You may Distribute or Publicly Perform the Work only under the terms + of this License. You must include a copy of, or the Uniform Resource + Identifier (URI) for, this License with every copy of the Work You + Distribute or Publicly Perform. You may not offer or impose any terms + on the Work that restrict the terms of this License or the ability of + the recipient of the Work to exercise the rights granted to that + recipient under the terms of the License. You may not sublicense the + Work. You must keep intact all notices that refer to this License and + to the disclaimer of warranties with every copy of the Work You + Distribute or Publicly Perform. When You Distribute or Publicly + Perform the Work, You may not impose any effective technological + measures on the Work that restrict the ability of a recipient of the + Work from You to exercise the rights granted to that recipient under + the terms of the License. This Section 4(a) applies to the Work as + incorporated in a Collection, but this does not require the Collection + apart from the Work itself to be made subject to the terms of this + License. If You create a Collection, upon notice from any Licensor You + must, to the extent practicable, remove from the Collection any credit + as required by Section 4(b), as requested. If You create an + Adaptation, upon notice from any Licensor You must, to the extent + practicable, remove from the Adaptation any credit as required by + Section 4(b), as requested. + b. If You Distribute, or Publicly Perform the Work or any Adaptations or + Collections, You must, unless a request has been made pursuant to + Section 4(a), keep intact all copyright notices for the Work and + provide, reasonable to the medium or means You are utilizing: (i) the + name of the Original Author (or pseudonym, if applicable) if supplied, + and/or if the Original Author and/or Licensor designate another party + or parties (e.g., a sponsor institute, publishing entity, journal) for + attribution ("Attribution Parties") in Licensor's copyright notice, + terms of service or by other reasonable means, the name of such party + or parties; (ii) the title of the Work if supplied; (iii) to the + extent reasonably practicable, the URI, if any, that Licensor + specifies to be associated with the Work, unless such URI does not + refer to the copyright notice or licensing information for the Work; + and (iv) , consistent with Section 3(b), in the case of an Adaptation, + a credit identifying the use of the Work in the Adaptation (e.g., + "French translation of the Work by Original Author," or "Screenplay + based on original Work by Original Author"). The credit required by + this Section 4 (b) may be implemented in any reasonable manner; + provided, however, that in the case of a Adaptation or Collection, at + a minimum such credit will appear, if a credit for all contributing + authors of the Adaptation or Collection appears, then as part of these + credits and in a manner at least as prominent as the credits for the + other contributing authors. For the avoidance of doubt, You may only + use the credit required by this Section for the purpose of attribution + in the manner set out above and, by exercising Your rights under this + License, You may not implicitly or explicitly assert or imply any + connection with, sponsorship or endorsement by the Original Author, + Licensor and/or Attribution Parties, as appropriate, of You or Your + use of the Work, without the separate, express prior written + permission of the Original Author, Licensor and/or Attribution + Parties. + c. Except as otherwise agreed in writing by the Licensor or as may be + otherwise permitted by applicable law, if You Reproduce, Distribute or + Publicly Perform the Work either by itself or as part of any + Adaptations or Collections, You must not distort, mutilate, modify or + take other derogatory action in relation to the Work which would be + prejudicial to the Original Author's honor or reputation. Licensor + agrees that in those jurisdictions (e.g. Japan), in which any exercise + of the right granted in Section 3(b) of this License (the right to + make Adaptations) would be deemed to be a distortion, mutilation, + modification or other derogatory action prejudicial to the Original + Author's honor and reputation, the Licensor will waive or not assert, + as appropriate, this Section, to the fullest extent permitted by the + applicable national law, to enable You to reasonably exercise Your + right under Section 3(b) of this License (right to make Adaptations) + but not otherwise. + +5. Representations, Warranties and Disclaimer + +UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR +OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY +KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, +INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, +FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF +LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, +WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION +OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. + +6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE +LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR +ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES +ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS +BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. Termination + + a. This License and the rights granted hereunder will terminate + automatically upon any breach by You of the terms of this License. + Individuals or entities who have received Adaptations or Collections + from You under this License, however, will not have their licenses + terminated provided such individuals or entities remain in full + compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will + survive any termination of this License. + b. Subject to the above terms and conditions, the license granted here is + perpetual (for the duration of the applicable copyright in the Work). + Notwithstanding the above, Licensor reserves the right to release the + Work under different license terms or to stop distributing the Work at + any time; provided, however that any such election will not serve to + withdraw this License (or any other license that has been, or is + required to be, granted under the terms of this License), and this + License will continue in full force and effect unless terminated as + stated above. + +8. Miscellaneous + + a. Each time You Distribute or Publicly Perform the Work or a Collection, + the Licensor offers to the recipient a license to the Work on the same + terms and conditions as the license granted to You under this License. + b. Each time You Distribute or Publicly Perform an Adaptation, Licensor + offers to the recipient a license to the original Work on the same + terms and conditions as the license granted to You under this License. + c. If any provision of this License is invalid or unenforceable under + applicable law, it shall not affect the validity or enforceability of + the remainder of the terms of this License, and without further action + by the parties to this agreement, such provision shall be reformed to + the minimum extent necessary to make such provision valid and + enforceable. + d. No term or provision of this License shall be deemed waived and no + breach consented to unless such waiver or consent shall be in writing + and signed by the party to be charged with such waiver or consent. + e. This License constitutes the entire agreement between the parties with + respect to the Work licensed here. There are no understandings, + agreements or representations with respect to the Work not specified + here. Licensor shall not be bound by any additional provisions that + may appear in any communication from You. This License may not be + modified without the mutual written agreement of the Licensor and You. + f. The rights granted under, and the subject matter referenced, in this + License were drafted utilizing the terminology of the Berne Convention + for the Protection of Literary and Artistic Works (as amended on + September 28, 1979), the Rome Convention of 1961, the WIPO Copyright + Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 + and the Universal Copyright Convention (as revised on July 24, 1971). + These rights and subject matter take effect in the relevant + jurisdiction in which the License terms are sought to be enforced + according to the corresponding provisions of the implementation of + those treaty provisions in the applicable national law. If the + standard suite of rights granted under applicable copyright law + includes additional rights not granted under this License, such + additional rights are deemed to be included in the License; this + License is not intended to restrict the license of any rights under + applicable law. + + +Creative Commons Notice + + Creative Commons is not a party to this License, and makes no warranty + whatsoever in connection with the Work. Creative Commons will not be + liable to You or any party on any legal theory for any damages + whatsoever, including without limitation any general, special, + incidental or consequential damages arising in connection to this + license. Notwithstanding the foregoing two (2) sentences, if Creative + Commons has expressly identified itself as the Licensor hereunder, it + shall have all rights and obligations of Licensor. + + Except for the limited purpose of indicating to the public that the + Work is licensed under the CCPL, Creative Commons does not authorize + the use by either party of the trademark "Creative Commons" or any + related trademark or logo of Creative Commons without the prior + written consent of Creative Commons. Any permitted use will be in + compliance with Creative Commons' then-current trademark usage + guidelines, as may be published on its website or otherwise made + available upon request from time to time. For the avoidance of doubt, + this trademark restriction does not form part of this License. + + Creative Commons may be contacted at https://creativecommons.org/. diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/LGPL-2.1.txt b/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/LGPL-2.1.txt new file mode 100644 index 0000000000000000000000000000000000000000..4362b49151d7b34ef83b3067a8f9c9f877d72a0e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/LGPL-2.1.txt @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/LGPL-3.0.txt b/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/LGPL-3.0.txt new file mode 100644 index 0000000000000000000000000000000000000000..65c5ca88a67c30becee01c5a8816d964b03862f9 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/LGPL-3.0.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/QtWaitingSpinner-MIT.txt b/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/QtWaitingSpinner-MIT.txt new file mode 100644 index 0000000000000000000000000000000000000000..113cd2bcf258316463243c563e840ec9b07a3fb4 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/QtWaitingSpinner-MIT.txt @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Original Work Copyright (c) 2012-2015 Alexander Turkin +Modified 2014 by William Hallatt + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/nlohmann-json-MIT.txt b/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/nlohmann-json-MIT.txt new file mode 100644 index 0000000000000000000000000000000000000000..ffef714b96ee433c5f9bbdc4829a0b9f26ef11ac --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/nlohmann-json-MIT.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013-2020 Niels Lohmann + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/pugixml-MIT.txt b/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/pugixml-MIT.txt new file mode 100644 index 0000000000000000000000000000000000000000..2503b81ebc1a201f83338cfc7ff6b8bfcbdb6a42 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/licenses/pugixml-MIT.txt @@ -0,0 +1,24 @@ +MIT License + +Copyright (c) 2006-2020 Arseny Kapoulkine + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..7302ef9cfed8f09dfe8d83c595027cb57972597f --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvextract.html @@ -0,0 +1,1355 @@ + + + + + mkvextract -- haalt sporen uit Matroska bestanden en plaatst die in andere bestanden + + + +
mkvextract -- haalt sporen uit Matroska(tm) bestanden en plaatst die in andere bestanden +
+
+ +
+

1. Beknopte inhoudsbeschrijving

+ + +
mkvextract {source-filename} {mode1} options extraction-spec1 mode2 options extraction-spec2 … +
+ +

2. Beschrijving

+ + +

+ This program extracts specific parts from a Matroska(tm) file to other useful + formats. The first argument is the name of the source file which must be a + Matroska(tm) file. + +

+ + +

+ All other arguments either switch to a certain extraction mode, change + options for the currently active mode or specify what to extract into which + file. Multiple modes can be used in the same invocation of mkvextract + allowing the extraction of multiple things in a single pass. Most options + can only be used in certain modes with a few options applying to all modes. + +

+ + +

+ Currently supported is the extraction of tracks, tags, attachments, chapters, CUE sheets, timestamps and cues. + +

+ + +

2.1. Algemene opties

+ + + +

+ De volgende opties zijn beschikbaar in alle modes en worden slechts één maal + beschreven in deze sectie. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ Stelt de ontleedt mode in op 'volledig'. De standaard waarde ontleedt niet + het gehele bestand maar gebruikt het 'meta zoek' element(en) voor het + lokaliseren van de vereiste elementen van een bronbestand. In 99% van alle + gevallen is dit genoeg. Maar voor bestanden die het 'meta zoek' element niet + bevatten of voor bestanden die zijn beschadigd kan deze gebruiker mode erg + handig zijn. Een volledige scan kan een aantal minuten in beslag nemen + terwijl een 'snelle' scan slechts enkele seconden duren. + +

+ +
--command-line-charset (karakterset) + +

+ Plaatst het karakter set om de reeksen om te zetten die vanaf de + commandoregel worden opgegeven. Standaard wordt gebruikt het karakter set + die afhankelijk is van wat er in uw besturingssysteem staat aangegeven + (locatie). + +

+ +
--output-charset (karakterset) + +

+ Stelt het karakter set in, waarnaar de reeksen naar de uitvoer dienen te + worden geconverteerd. Standaard wordt gebruikt het karakter set die + afhankelijk is van wat er in uw besturingssysteem staat aangegeven + (locatie). + +

+ +
-r, --redirect-output + (bestandsnaam) + +

+ Schrijft alle berichten naar een bestand file-name + i.p.v. naar de 'apparaat/houder'. Terwijl dit gemakkelijk met uitvoer + omleiden kan worden gedaan, er zijn gevallen waarin deze optie nodig is: + wanneer de verwerker e.e.a. herinterpreteert, voordat het geschreven wordt + naar de uitvoer bestand. Het karakter set met --output-charset + is toegewezen. + +

+ +
--flush-on-close + +

+ Tells the program to flush all data cached in memory to storage when closing + files opened for writing. This can be used to prevent data loss on power + outages or to circumvent certain problems in the operating system or + drivers. The downside is that multiplexing will take longer as mkvmerge + will wait until all data has been written to the storage before exiting. + See issues #2469 and #2480 on the MKVToolNix bug tracker for in-depth + discussions on the pros and cons. + +

+ +
--ui-language code + +

+ Forces the translations for the language code to be + used (e.g. 'de_DE' for the German + translations). Entering 'list' as the + code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Tells the program to abort after the first warning is emitted. The program's + exit code will be 1. + +

+ +
--title onderwerp + +

+ Zet debuggen aan voor een specifieke mogelijkheid. Dit is alleen zinvol voor + ontwikkelaars. + +

+ +
--tags feature + +

+ Zet experimentele mogelijkheden aan. Een lijst van beschikbare mogelijkheden + kan worden opgevraagd met mkvextract --engage list. Deze + mogelijkheden zijn niet bedoeld in normale situaties. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that + can tell a controlling GUI what's happening. These messages follow the + format '#GUI#message'. The message may be followed by + key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the + messages nor the keys are ever translated and always output in English. + +

+ +
-v, --verbose + +

+ Wees uitgebreid en toon alle belangrijke Matroska(tm) elementen zoals ze zijn + gelezen. + +

+ +
-h, --help + +

+ Toon gebruik informatie en sluit af. + +

+ +
-V, --version + +

+ Toon versie informatie en sluit af. + +

+ +
@options-file.json + +

+ Reads additional command line arguments from the file + options-file. For a full explanation on the supported + formats for such files see the section called "Option files" in the + mkvmerge(1) man page. + +

+ +
+ + + +

2.2. Spoor uitpak mode

+ + + +

+ Syntax: mkvextract source-filename + tracks [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + +

+ De volgende commandoregel opties zijn beschikbaar voor elk spoor in + 'tracks' uitpak mode. Zij zullen vooraan moeten worden + geplaatst in de spoor specificatie (zie hieronder) Zij zouden toegepast + moeten zijn op. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c character-set + +

+ Stelt het karakter set in waarna het volgende ondertitel tekst spoor + geconverteerd wordt. Is alleen geldig, wanneer een volgende ondertitel spoor + verwijst naar een tekst ondertitel spoor. Standaard naar UTF-8. + +

+ +
--blockadd niveau + +

+ Houd alleen de BlockAdditions tot aan dit niveau. Standaard is alle niveaus + te houden. Deze optie heeft alleen effect op bepaalde codecs zoals WAVPACK4. + +

+ +
--cuesheet + +

+ Zorgt er voor dat mkvextract(1) uitpakt naar een CUE + lijst/document/reeks van het hoofdstuk data en markeer data voor de volgende + sporen naar een bestand waarvan de naam van het uitvoer spoor heeft waarna + '.cue' eraan toegevoegd wordt. + +

+ +
--raw + +

+ Pakt de raw dat uit naar een bestand zonder enige inhoud data er + omheen. Niet zoals --fullraw + dit merkteken markeren, veroorzaakt niet dat de inhoud van + CodecPrivate element geschreven wordt naar de + bestand. Deze mode werkt met alle CodecIDs, zelfs + diegenen die mkvextract(1) niet eens ondersteund, maar het resulterende + bestand kan onbruikbaar zijn. + +

+ +
--fullraw + +

+ Pakt de raw data uit naar een bestand zonder enige inhoud data er omheen. De + inhoud van het CodecPrivate element zal eerst naar + het bestand worden geschreven als het spoor een dergelijk hoofd element + bevat. Deze mode werkt met alle CodecIDs, zelfs + diegene die mkvextract(1) niet eens ondersteund, maar het resulterende + bestand kan onbruikbaar zijn. + +

+ +
TID:outname + +

+ Extraheert het spoor met het ID TID naar het bestand + outname als een dergelijk spoor bestaat in het + bronbestand. Deze optie kan meerdere keren geven worden. De spo(o)r(en) ID's + zijn hetzelfde als diegene die met mkvmerge(1)'s --identify + optie worden verkregen. + +

+ + +

+ Elke uitvoernaam zou slechts één maal mogen worden gebruikt. De + uitzonderingen zijn RealAudio en RealVideo sporen. Als je dezelfde naam + gebruikt voor verschillende sporen dan zullen die sporen in hetzelfde + bestand bewaard worden. Voorbeeld: + +

+ +
$ mkvextract input.mkv tracks 0:video.h264 2:output-two-vobsub-tracks.idx 3:output-two-vobsub-tracks.idx
+
+ + + +

2.3. Bijlagen extraheren mode

+ + + +

+ Syntax: mkvextract source-filename + attachments + [options] + AID1:outname1 + [AID2:outname2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:outname + +

+ Zorgt voor het uitpakken van bijlage met het ID AID + naar het bestand outname als een dergelijke bijlage + bestaat in het bronbestand. Als de outname wordt + leeggelaten dan wordt de naam gebruikt die zich binnenin het Matroska(tm) + bronbestand bevindt. Deze optie kan meerdere malen worden gegeven. De ID's + van de bijlagen zijn het zelfde als diegene die worden gecreëerd met + mkvmerge(1)'s --identify optie. + +

+ +
+ + + +

2.4. Hoofdstuk uitpak mode

+ + + +

+ Syntax: mkvextract source-filename + chapters + [options] + output-filename.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ Exporteert het hoofdstuk informatie in een simpel tekst formaat gebruikt in + de OGM hulpmiddelen (CHAPTER01=..., CHAPTER01NAME=...). In + deze mode wordt sommige informatie overgeslagen. Standaard is het hoofdstuk + uitvoer naar XML formaat. + +

+ +
--simple-language language + +

+ If the simple format is enabled then mkvextract(1) will only output a single + entry for each chapter atom encountered even if a chapter atom contains more + than one chapter name. By default mkvextract(1) will use the first chapter + name found for each atom regardless of its language. + +

+ + +

+ Using this option allows the user to determine which chapter names are + output if atoms contain more than one chapter name. The + language parameter must be an ISO 639-1 or ISO 639-2 + code. + +

+ +
+ + +

+ The chapters are written to specified output file. By default the XML + format understood by mkvmerge(1) is used. If no chapters are found in the + file, the output file is not created. + +

+ + + +

2.5. Markeringen extraheren mode

+ + + +

+ Syntax: mkvextract source-filename + tags [options] + output-filename.xml + +

+ + +

+ The tags are written to specified output file in the XML format understood + by mkvmerge(1). If no tags are found in the file, the output file is not + created. + +

+ + + +

2.6. Volg document(en) (cue) extraheren mode

+ + + +

+ Syntax: mkvextract source-filename + cuesheet + [options] + output-filename.cue + +

+ + +

+ The cue sheet is written to specified output file. If no chapters or tags + are found in the file, the output file is not created. + +

+ + + +

2.7. Tijd code extraheren mode

+ + + +

+ Syntax: mkvextract source-filename + timestamps_v2 + [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:outname + +

+ Extraheert tijd codes voor het spoor met het ID TID + naar het bestand outname als een dergelijk spoor + bestaat in het bronbestand. Deze optie kan meerdere keren geven worden. De + spo(o)r(en) ID's zijn hetzelfde als diegene die met mkvmerge(1)'s + --identify optie worden verkregen. + +

+ + +

+ Voorbeeld: + +

+ +
$ mkvextract input.mkv timestamps_v2 1:ts-track1.txt 2:ts-track2.txt
+
+ + + +

2.8. Cues extraction mode

+ + + +

+ Syntax: mkvextract source-filename + cues [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:dest-filename + +

+ Causes extraction of the cues for the track with the ID + TID into the file outname if + such a track exists in the source file. This option can be given multiple + times. The track IDs are the same as the ones output by mkvmerge(1)'s + --identify option and not the numbers contained in the + CueTrack element. + +

+ +
+ + +

+ The format output is a simple text format: one line per + CuePoint element with key=value + pairs. If an optional element is not present in a + CuePoint (e.g. CueDuration) + then a dash will be output as the value. + +

+ + +

+ Voorbeeld: + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

The possible keys are:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
timestamp + +

The cue point's timestamp with nanosecond precision. The format is + HH:MM:SS.nnnnnnnnn. This element is always set. +

+ +
duur + +

The cue point's duration with nanosecond precision. The format is + HH:MM:SS.nnnnnnnnn. +

+ +
cluster_position + +

The absolute position in bytes inside the Matroska(tm) file where the cluster + containing the referenced element starts. +

+ + +
+

Note:

+ +

Inside the Matroska(tm) file the CueClusterPosition is + relative to the segment's data start offset. The value output by + mkvextract(1)'s cue extraction mode, however, contains that offset already + and is an absolute offset from the beginning of the file. +

+ +
+ +
relative_position + +

The relative position in bytes inside the cluster where the + BlockGroup or SimpleBlock + element the cue point refers to starts. +

+ + +
+

Note:

+ +

Inside the Matroska(tm) file the CueRelativePosition is + relative to the cluster's data start offset. The value output by + mkvextract(1)'s cue extraction mode, however, is relative to the cluster's + ID. The absolute position inside the file can be calculated by adding + cluster_position and + relative_position. +

+ +
+ +
+ + +

+ Voorbeeld: + +

+ +
$ mkvextract input.mkv cues 1:cues-track1.txt 2:cues-track2.txt
+ +

3. Voorbeelden

+ + + +

+ Extracting both chapters and tags in their respective XML formats at the + same time: + +

+ +
$ mkvextract movie.mkv chapters movie-chapters.xml tags movie-tags.xml
+ +

+ Extracting a couple of tracks and their respective timestamps at the same + time: + +

+ +
$ mkvextract "Another Movie.mkv" tracks 0:video.h265 "1:main audio.aac" "2:director's comments.aac" timestamps_v2 "0:timestamps video.txt" "1:timestamps main audio.txt" "2:timestamps director's comments.txt"
+ +

+ Extracting chapters in the Ogg/OGM format and re-encoding a text subtitle + track to another character set: + +

+ +
$ mkvextract "My Movie.mkv" chapters --simple "My Chapters.txt" tracks -c MS-ANSI "2:My Subtitles.srt"
+

4. Tekst bestanden en karakter set conversies

+ + + +

+ For an in-depth discussion about how all tools in the MKVToolNix suite + handle character set conversions, input/output encoding, command line + encoding and console encoding please see the identically-named section in + the mkvmerge(1) man page. + +

+ +

5. Uitvoer bestandsformaten

+ + + +

+ De beslissing over het uitvoer formaat is gebaseerd op het spoor type, niet + op de gebruikte extensie van de uitvoer bestandsnaam. De volgende spoor + typen worden momenteel ondersteund: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ Alle AAC bestanden zullen geschreven worden in een + AAC bestand met ADTS koppen voor elk + pakket. De ADTS koppen bevatten géén verouderd + nadrukgebiedsveld. + +

+ +
A_AC3, A_EAC3 + +

+ These will be extracted to raw AC-3 files. + +

+ +
A_ALAC + +

+ ALAC worden geschreven naar CAF bestanden. + +

+ +
A_DTS + +

+ These will be extracted to raw DTS files. + +

+ +
A_FLAC + +

+ FLAC sporen worden geschreven naar raw + FLAC bestanden. + +

+ +
A_MPEG/L2 + +

+ MPEG-1 Audio Layer II stromen worden uitgpakt naar raw MP2 + bestanden. + +

+ +
A_MPEG/L3 + +

+ These will be extracted to raw MP3 files. + +

+ +
A_OPUS + +

+ Opus(tm) tracks are written to + OggOpus(tm) files. + +

+ +
A_PCM/INT/LIT, A_PCM/INT/BIG + +

+ Raw PCM data will be written to a WAV + file. Big-endian integer data will be converted to little-endian data in the + process. + +

+ +
A_REAL/* + +

+ RealAudio(tm) sporen worden geschreven naar + RealMedia(tm) bestanden. + +

+ +
A_TRUEHD, A_MLP + +

+ These will be extracted to raw TrueHD/MLP + files. + +

+ +
A_TTA1 + +

+ TrueAudio(tm) sporen worden geschreven naar + TTA bestanden. Opmerking: door een limitatie in + Matroska(tm)'s tijd code precisie zal de geëxtraheerde bestandskop + verschillend zijn aangaande deze twee velden: data_length + (de totale nummers van voorbeelden in het bestand) en de + CRC. + +

+ +
A_VORBIS + +

+ Vorbis audio zal worden geschreven naar een OggVorbis(tm) bestand. + +

+ +
A_WAVPACK4 + +

+ WavPack(tm) sporen worden geschreven naar + WV(tm) bestanden. + +

+ +
S_HDMV/PGS + +

+ PGS ondertitels worden geschreven als SUP + bestanden. + +

+ +
S_HDMV/TEXTST + +

+ TextST subtitles will be written as a special file format + invented for mkvmerge(1) and mkvextract(1). + +

+ +
S_KATE + +

+ Kate(tm) de stromen zullen binnen een + Ogg(tm) bestand worden geschreven. + +

+ +
S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS + +

+ SSA en ASS tekst ondertitels worden + respectievelijk geschreven als SSA/ASS + bestanden. + +

+ +
S_TEXT/UTF8, S_TEXT/ASCII + +

+ Simpele tekst ondertitels worden geschreven in SRT + bestanden. + +

+ +
S_VOBSUB + +

+ VobSub(tm) ondetitels worden geschreven als + SUB samen met de bijbehorende index bestanden, als + IDX bestanden. + +

+ +
S_TEXT/USF + +

+ USF tekst ondertitels worden geschreven als + USF bestanden. + +

+ +
S_TEXT/WEBVTT + +

+ WebVTT text subtitles will be written as + WebVTT files. + +

+ +
V_MPEG1, V_MPEG2 + +

+ MPEG-1 and MPEG-2 video tracks will be + written as MPEG elementary streams. + +

+ +
V_MPEG4/ISO/AVC + +

+ H.264 / AVC video sporen worden geschreven + naar H.264 elementaire stromen welke verder verwerkt kunnen + worden b.v. MP4Box(tm) van het + GPAC(tm) pakket. + +

+ +
V_MPEG4/ISO/HEVC + +

+ H.265 / HEVC video tracks are written to + H.265 elementary streams which can be processed further + with e.g. MP4Box(tm) from the + GPAC(tm) package. + +

+ +
V_MS/VFW/FOURCC + +

+ Vaste FPS video sporen met deze + CodecID worden geschreven naar AVI + bestanden. + +

+ +
V_REAL/* + +

+ RealVideo(tm) sporen worden geschreven naar + RealMedia(tm) bestanden. + +

+ +
V_THEORA + +

+ Theora(tm) stromen worden geschreven binnen een + Ogg(tm) bestand + +

+ +
V_VP8, V_VP9 + +

+ VP8 / VP9 tracks are written to + IVF files. + +

+ +
Markeringen + +

+ Markeringen worden geconverteerd naar een XML formaat. Dit formaat is + hetzelfde dat mkvmerge(1) ondersteund voor het lezen van markeringen. + +

+ +
Bijlagen + +

+ Bijlagen worden geschreven naar de uitvoer zoals ze zijn. Geen enkele + conversie (welke conversie dan ook) wordt uitgevoerd. + +

+ +
Hoofdstukken + +

+ Hoofdstukken worden geconverteerd naar een XML formaat. Dit formaat is + hetzelfde welke mkvmerge(1) ondersteund voor het lezen van + hoofdstukken. Alternatief is een 'uitgeklede versie' welke uitvoert naar het + simpele OGM stijl formaat. + +

+ +
Tijd codes + +

+ Tijd codes worden het eerst gesorteerd en daarna geschreven als en tijd code + v2 volg baar bestandformaat, klaar om aangevoerd te worden naar + mkvmerge(1). Het extraheren naar andere formaten (v1, v3 en v4) zijn niet + ondersteund. + +

+ +
+ +

6. Verlaat codes

+ + + +

+ mkvextract(1) sluit af met drie afsluit codes: + +

+ + +
    + +
  • + +

    + 0 -- Deze verlaat code betekend dat de extractie + succesvol is voltooid. + +

    + +
  • + + +
  • + +

    + 1 -- In dit geval heeft mkvextract(1) minstens één + waarschuwing uitgegeven, maar extractie is doorgegaan. Een waarschuwing + wordt vooraf bepaald met de tekst + 'Waarschuwing:'. Afhankelijk van de 'tegengekomen' + kwesties kan het resultaat goed of slecht zijn. De gebruiker wordt + geadviseerd om zowel de waarschuwing als de resulterende bestanden te + controleren. + +

    + +
  • + + +
  • + +

    + 2 -- Deze verlaat code wordt gebruikt nadat een fout is + ontstaan. mkvextract(1) breekt direct af na het uitgeven van de + waarschuwing. Fout berichten, bereik van verkeerde commandoregel argumenten + tot aan lees/schrijf fouten naar gebroken bestanden. + +

    + +
  • + +
+ +

7. Omgevingsvariabelen

+ + + +

+ mkvextract(1) gebruikt de standaard variabelen vanuit het systeem locatie + (b.v. LANG en de LC_* family). Extra + variabelen: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG and + its short form MTX_DEBUG + +

De inhoud wordt behandeld alsof het via de --debug optie + gepasseerd is. +

+ +
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE + and its short form MTX_ENGAGE + +

De inhoud wordt behandeld alsof het via de --engage + optie gepasseerd is. +

+ +
+ +

8. Zie ook

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. WWW

+ + +

+ De laatste versie kan altijd gevonden worden op de MKVToolNix thuis basis. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..b7c0d2da0c26df3e774260969183e9e0077ad0fe --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvinfo.html @@ -0,0 +1,522 @@ + + + + + mkvinfo -- Informatie uitprinten over elementen in Matroska bestanden + + + +
mkvinfo -- Informatie uitprinten over elementen in Matroska(tm) bestanden +
+
+ +
+

1. Beknopte inhoudsbeschrijving

+ + +
mkvinfo options {source-filename} +
+ +

2. Beschrijving

+ + +

+ Dit programma lijst alle elementen die een Matroska(tm) bestand bevat. De + uitvoer kan gelimiteerd worden naar een lijst van sporen inclusief de + informatie over de gebruikte codecs. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ By default mkvinfo(1) stops when it encounters the first cluster. + Additionally it doesn't show certain often occurring elements. With this + option mkvinfo(1) will continue processing regardless of the verbosity level + and show all elements. + +

+ +
-c, --checksums + +

+ Berekent en toont de Adler-32 controleer som. Alleen + zinvol voor fout zoeken. + +

+ +
-o, --continue + +

+ By default mkvinfo(1) stops when it encounters the first cluster. With this + option mkvinfo(1) will continue processing regardless of the verbosity level. + +

+ +
-p, --hex-positions + +

+ Show the positions of all elements in hexadecimal regardless of the + verbosity level. + +

+ +
-P, --positions + +

+ Show the positions of all elements in decimal regardless of the verbosity + level. + +

+ +
-s, --summary + +

+ Toon slechts een grove samenvatting van wat mkvinfo(1) vindt en niet elk + element. + +

+ +
-t, --track-info + +

+ Toont statistieken voor elk spoor in 'stille' mode. Zet tevens 'stille mode' + naar 1 als niveau daarvoor 0 was. + +

+ +
-x, --hexdump + +

+ Toont de eerste 16 bytes van elk beeld als een hex dump. + +

+ +
-X, --full-hexdump + +

+ Toont alle bytes van elk beeld als een hex dump. + +

+ +
-z, --size + +

+ Toont de grootte van elk element inclusief kop hoofd. + +

+ +
--command-line-charset (karakterset) + +

+ Plaatst het karakter set om de reeksen om te zetten die vanaf de + commandoregel worden opgegeven. Standaard wordt gebruikt het karakter set + die afhankelijk is van wat er in uw besturingssysteem staat aangegeven + (locatie). + +

+ +
--output-charset (karakterset) + +

+ Stelt het karakter set in, waarnaar de reeksen naar de uitvoer dienen te + worden geconverteerd. Standaard wordt gebruikt het karakter set die + afhankelijk is van wat er in uw besturingssysteem staat aangegeven + (locatie). + +

+ +
-r, --redirect-output + (bestandsnaam) + +

+ Schrijft alle berichten naar een bestand file-name + i.p.v. naar de 'apparaat/houder'. Terwijl dit gemakkelijk met uitvoer + omleiden kan worden gedaan er zijn gevallen waarin deze optie nodig is: + wanneer de verwerker e.e.a. herinterpreteert voordat het geschreven wordt + naar de uitvoer bestand. Het karakter set met --output-charset + is toegewezen. + +

+ +
--ui-language code + +

+ Forces the translations for the language code to be + used (e.g. 'de_DE' for the German + translations). Entering 'list' as the + code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Tells the program to abort after the first warning is emitted. The program's + exit code will be 1. + +

+ +
--title onderwerp + +

+ Zet debuggen aan voor een specifieke mogelijkheid. Dit is alleen zinvol voor + ontwikkelaars. + +

+ +
--tags feature + +

+ Zet experimentele mogelijkheden aan. Een lijst van beschikbare mogelijkheden + kan worden opgevraagd met mkvinfo --engage list. Deze + mogelijkheden zijn niet bedoeld in normale situaties. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that + can tell a controlling GUI what's happening. These messages follow the + format '#GUI#message'. The message may be followed by + key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the + messages nor the keys are ever translated and always output in English. + +

+ +
-v, --verbose + +

+ Wees uitgebreider. Zie sectie over: Uitgebreide niveaus voor een + beschrijving welke informatie wordt uitgevoerd op welk niveau. + +

+ +
-h, --help + +

+ Toon gebruik informatie en sluit af. + +

+ +
-V, --version + +

+ Toon versie informatie en sluit af. + +

+ +
@options-file.json + +

+ Reads additional command line arguments from the file + options-file. For a full explanation on the supported + formats for such files see the section called "Option files" in the + mkvmerge(1) man page. + +

+ +
+ +

3. Uitgebreide niveaus

+ + + +

+ De optie -v kan worden + gebruikt om mkvinfo(1)'s uitgebreide niveau te verhogen en meer informatie te + printen over het huidige bestand. + +

+ + +

+ Op niveau 0 print mkvinfo(1) de spoor koppen die het vindt en hun + typen. mkvinfo(1) verlaat zo snel mogelijk wanneer de koppen volledig zijn + ontleed (meer technisch: zo snel mogelijk wanneer de eerste cluster wordt + tegengekomen). Op dit niveau worden de zoek kop ingangen en volg + document(en) (cue) niet getoond -- zelfs niet wanneer die aan het begin + bevinden van de spoor informatie. + +

+ + +

+ Op niveau 1 print mkvinfo(1) ook alle Matroska(tm) tegengekomen elementen van + het complete bestand elementen behalve de zoek koppen en de volg + document(en) (cue) ingangen. Als de samenvattingsmode aan is dan zal + mkvinfo(1) het beeld positie eveneens uitvoeren. + +

+ + +

+ The same effect can be achieved with the option --continue. + +

+ + +

+ Op niveau 2 print mkvinfo(1) tevens de zoek kop ingangen, de volg + document(en) (cue)l ingangen en de bestandspositie waarbij elk Matroska(tm) + element kan worden gevonden. + +

+ + +

+ The same effect can be achieved with the options --all + --positions. + +

+ + +

+ Op niveau 3 en hoger zal mkvinfo(1) enige informatie printen welke niet + direct aan een Matroska(tm) element is gekoppeld. Alle overige elementen + printen alleen info over de elementen die zojuist werden gevonden. Niveau 3 + voegt meta informatie toe voor een makkelijkere fout opsporing (lees als: + bedoelt voor ontwikkelaars). Alle niveau 3 geschreven regels bevatten zich + tussen [ ] om ze makkelijker te herkennen. + +

+ +

4. Tekst bestanden en karakter set conversies

+ + + +

+ For an in-depth discussion about how all tools in the MKVToolNix suite + handle character set conversions, input/output encoding, command line + encoding and console encoding please see the identically-named section in + the mkvmerge(1) man page. + +

+ +

5. Verlaat codes

+ + + +

+ mkvinfo(1) verlaat met één van de drie afsluit codes: + +

+ + +
    + +
  • + +

    + 0 -- Deze verlaat code betekend dat alles succesvol + voltooid is. + +

    + +
  • + + +
  • + +

    + 1 -- In dit geval heeft mkvinfo(1) minimaal één + waarschuwing doen uitgaan, maar ging door. Een waarschuwing wordt + voorafgegaan met de tekst 'Waarschuwing:'. + +

    + +
  • + + +
  • + +

    + 2 -- Deze fout code wordt gegeven nadat er een fout + optrad. mkvinfo(1) breekt direct af na het geven van dit waarschuw + bericht. Fout! bereik in berichten, van een verkeerd commandoregel argument + over lees/schrijf fouten naar een 'gebroken' bestanden. + +

    + +
  • + +
+ +

6. Omgevingsvariabelen

+ + + +

+ mkvinfo(1) gebruikt de standaard variabelen vanuit het systeem locatie + (b.v. LANG en de LC_* family). Extra + variabelen: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUG, MKVTOOLNIX_DEBUG and + its short form MTX_DEBUG + +

De inhoud wordt behandeld alsof het via de --debug optie + gepasseerd is. +

+ +
MKVINFO_ENGAGE, MKVTOOLNIX_ENGAGE and + its short form MTX_ENGAGE + +

De inhoud wordt behandeld alsof het via de --engage optie + gepasseerd is. +

+ +
+ +

7. Zie ook

+ + +

+ mkvmerge(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. WWW

+ + +

+ De laatste versie kan altijd gevonden worden op de MKVToolNix thuis basis. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..4e2445e5d038edc3f2dbcb590e35e1ce417360b4 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvmerge.html @@ -0,0 +1,5329 @@ + + + + + mkvmerge -- Voegt multimedia stromen in een Matroska bestand in. + + + +
mkvmerge -- Voegt multimedia stromen in een Matroska(tm) bestand in. +
+
+ +
+

1. Beknopte inhoudsbeschrijving

+ + +
mkvmerge global options {-o + out} options1 {file1} options2 {file2} @options-file.json +
+ +

2. Beschrijving

+ + +

+ Dit programma neemt de invoer van verschillende media bestanden en voegt die + stromen samen (allemaal of slechts een stukje) naar een Matroska(tm) bestand; + zie de Matroska website. + +

+ + +
+

Important:

+ +

+ De volgorde van het commando regel opties zijn belangrijk. Lees a.u.b. de + sectie over: "Optie + volgorde" als je nog onbekend bent met het programma. + +

+ +
+ + +

2.1. Globale opties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

Verhoog 'uitgebreidheid'.

+ +
-q, --quiet + +

Onderdruk status uitvoer.

+ +
-o, --output + file-name + +

Schrijf naar het bestand file-name. Indien splitsen + aan staat, dan wordt dat iets anders verwerkt. Zie uitleg voor de --split optie + voor details. +

+ +
-w, --webm + +

Create a WebM compliant file. This is also turned on if the output file + name's extension is "webm". This mode enforces several + restrictions. The only allowed codecs are VP8, VP9 video and Opus, Vorbis + audio tracks. The DocType header item is changed to "webm". + +

+ + +

+ For chapters and tags only a subset of elements are allowed. mkvmerge(1) will + automatically remove all elements not allowed by the specification. + +

+ +
--title title + +

Stelt de algemene naam in voor de uitvoer bestand, b.v. de film naam.

+ +
--default-language language-code + +

Sets the default language code that will be used for tracks for which no + language is set with the --language + option and for which the source container doesn't provide a language. +

+ + +

The default language code is 'und' for 'undetermined'. +

+ +
+ + + +

2.2. Hanteren van segment informatie (globale opties)

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo filename.xml + +

+ Leest segment informatie in van een XML bestand. Dit + bestand kan de segment familie bevatten UID, segment + UID, vorige en volgend segment UID + elementen. een voorbeeld bestand en een DTD zijn ingesloten + in de MKVToolNix distributie. + +

+ + +

+ Zie de sectie over: Het segment + informatie XML bestanden zie hieronder voor details. + +

+ +
--segment-uid SID1,SID2,... + +

+ Stelt het te gebruiken segment UID's in. Dit is een komma gesepareerde lijst + van 128-bit segment UID's in het gebruikelijke UID formaat: hex nummers met + of zonder de "0x" voorzetsel, met of zonder spaties, exact 32 + cijfers. + +

+ + +

+ If SID starts with = then its rest is interpreted as the name of a Matroska + file whose segment UID is read and used. + +

+ + +

+ Elk gecreëerd bestand bevat één segment, en elk segment heeft één UID. Als + er meer segment UID's zijn opgegeven dan er zijn gecreëerd, dan zullen de + extra UID's worden genegeerd. Zijn er minder UID's opgegeven dan er + segmenten zijn gecreëerd, dan worden er willekeurig UID's voor hen + aangemaakt. + +

+ +
+ + + +

2.3. Hanteren hoofdstuk en markeringen (globale opties)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language language-code + +

+ Stelt de ISO 639-2 land code waarde in welke geschreven wordt voor elk + hoofdstuk ingang. Standaard naar 'eng'. Zie de sectie + over: Hoofdstukken hieronder voor + details. + +

+ + +

+ Deze optie kan gebruikt worden, voor simpele hoofdstukken en voor + bronbestanden welke hoofdstukken bevatten maar geen informatie over + hoofdstuk talen, b.v. MP4 en OGM bestanden. + +

+ + +

+ The language set with this option is also used when chapters are generated + with the --generate-chapters + option. + +

+ +
--chapter-charset character-set + +

+ Stelt het karakter set in, die gebruikt wordt voor de UTF-8 conversie voor + simpele hoofdstuk bestanden. Zie de sectie over: Tekst bestanden en karakter set + conversies voor een uitleg hoe mkvmerge(1) converteert tussen het + 'verschillende' karakter sets. + +

+ + +

+ Deze schakelaar is ook van toepassing op hoofdstukken die zijn gekopieerd + van enkele bepaalde inhoudstypen, b.v. Ogg/OGM en MP4 bestanden. Zie de + sectie over hoofdstukken hieronder voor details. + +

+ +
--chapter-sync + d[,o[/p]] + +

+ Adjust the timestamps of the chapters in the following source file by + d ms. Alternatively you can use the + --sync option with the special track ID + -2 (see section special track IDs). + +

+ + +

+ o/p: Stel de tijd codes bij + met o/p om lineaire driften te + corrigeren. p standaard naar 1 indien + weggelaten. Beide o en p + kunnen een veranderbaar nummer zijn. + +

+ + +

+ Standaard: geen handmatige sync correctie (wat hetzelfde is als + d = 0 en + o/p = + 1.0). + +

+ + +

+ Deze optie kan meerdere keren worden gebruikt voor een invoer bestand, is + van toepassing op verschillende sporen door het spoor ID elke keer te + selecteren. + +

+ +
--generate-chapters mode + +

+ mkvmerge(1) can create chapters automatically. The following two modes are + currently supported: + +

+ + +
    + +
  • + +

    + 'when-appending' – This mode creates one chapter at the + start and one chapter whenever a file is appended. + +

    + + +

    + This mode also works with split modes 'parts:' and + 'parts-frames:'. For these modes one chapter will be + generated for each appended timestamp range (those whose start timestamps + are prefixed with '+'). + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1) requires a video or an audio track to be present in order to be + able to determine when a new file is appended. If one or more video tracks + are muxed the first one is used. Otherwise the first audio track is used. + +

    + +
    + +
  • + + +
  • + +

    + 'interval:time-spec' – This mode + creates one chapter at fixed intervals given by + time-spec. The format is either the form + HH:MM:SS.nnnnnnnnn or a number followed by one of the + units 's', 'ms' or + 'us'. + +

    + + +

    + Example: --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ The names for the new chapters are controlled by the option --generate-chapters-name-template. + The language is set with --chapter-language + which must occur before --generate-chapters. + +

+ +
--generate-chapters-name-template + template + +

+ This sets the name template for chapter names generated by the option --generate-chapters. + If the option is not used then default 'Chapter + <NUM:2>' will be used. + +

+ + +

+ There are several variables that can be used in the template that are + replaced by their actual values when a chapter is generated. The string + '<NUM>' will be replaced by the chapter number. The + string '<START>' will be replaced by the chapter's + start timestamp. + +

+ + +

+ The strings '<FILE_NAME>' and + '<FILE_NAME_WITH_EXT>' are only filled when + generating chapters for appended files. They will be replaced by the + appended file's name without respectively with its extension. Note that + only the file's base name and extension are inserted, not its directory or + drive components. + +

+ + +

+ You can specify a minimum number of places for the chapter number with + '<NUM:places>', + e.g. '<NUM:3>'. The resulting number will be + padded with leading zeroes if the number of places is less than specified. + +

+ + +

+ You can control the format used by the start timestamp with + <START:format>. The format defaults to + '%H:%M:%S' if none is given. Valid format codes are: + +

+ + +
    + +
  • + +

    %h – hours +

    + +
  • + +
  • + +

    %H – hours zero-padded to two places +

    + +
  • + +
  • + +

    %m – minutes +

    + +
  • + +
  • + +

    %M – minutes zero-padded to two places +

    + +
  • + +
  • + +

    %s – seconds +

    + +
  • + +
  • + +

    %S – seconds zero-padded to two places +

    + +
  • + +
  • + +

    %n – nanoseconds with nine places +

    + +
  • + +
  • + +

    %<1-9>n – nanoseconds with up to nine places + (e.g. three places with %3n) +

    + +
  • + +
+ +
--cue-chapter-name-format format + +

+ mkvmerge(1) ondersteund lezen van CUE volg document(en) + (cue) voor audio bestanden als invoer voor + hoofdstukken. CUE volg document(en) (cue) bevatten + gewoonlijk informatie over de ARTIEST en + TITEL voor elke index ingang. mkvmerge(1) gebruikt deze + twee reeksen om het hoofdstuknaam te construeren. Met deze optie kan het + formaat dat voor deze naam wordt gebruikt worden geplaatst. + +

+ + +

+ Is deze optie niet opgegeven, dan zal mkvmerge(1) het standaard format + gebruiken '%p - %t' (de artiest (performer), gevolgd door een + spatie, een streep, wederom een spatie en de titel). + +

+ + +

+ Is de format opgegeven dan zal alles behalve de volgende meta karakters + gekopieerd worden zoals ze zijn, en de meta karakters worden vervangen zoals + dit: + +

+ + +
    + +
  • + +

    %p is vervangen door de huidige ingangen + PERFORMER (artiest) reeks, +

    + +
  • + +
  • + +

    %t is vervangen door de huidige ingangen + TITLE (titel) reeks, +

    + +
  • + +
  • + +

    %n wordt vervangen op huidig spoor nummer en +

    + +
  • + +
  • + +

    %N wordt vervangen op huidig spoor nummer en + op/aangevuld met een beginnend/leidende nul als het is < 10 (kleiner + dan). +

    + +
  • + +
+ +
--chapters file-name + +

+ Leest hoofdstuk informatie in van een bestand + file-name. Zie sectie over: Hoofdstukken kijk hieronder voor details. + +

+ +
--global-tags file-name + +

+ Leest hoofdstuk informatie in van een bestand + file-name. Zie sectie over: Hoofdstukken kijk hieronder voor details. + +

+ +
+ + + +

2.4. Algemene uitvoer controle (geavanceerde globale opties)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order + FID1:TID1,FID2:TID2,... + +

+ Deze optie verandert de volgorde waarin de sporen voor een invoer bestand + worden gecreëerd. Het argument is een komma gescheiden lijst van gepaarde + ID's. Elk paar bevat eerst het bestand ID (FID1) wat + simpelweg een nummer van het bestand is op de commandoregel beginnend bij + 0. Het tweede is een spoor ID (TID1) van dat + bestand. Als sommige spoor id's worden weggelaten, dan zullen die sporen + worden gecreëerd na diegene die met deze optie zijn gecreëerd. + +

+ +
--cluster-length spec + +

+ Limiteert het aantal data blokken of de duur van de data in elke cluster. De + spec parameter kan één van beide zijn een nummer + n zonder een eenheid of een nummer + d vastgezet met 'ms' + (milliseconden). + +

+ + +

+ Als er geen eenheid is gebruikt dan zal mkvmerge(1) hoogstens zetten + n data blokken in elke cluster. Het maximum aantal + blokken is 65535. + +

+ + +

+ Als het nummer d is vastgezet met + 'ms' dan zal mkvmerge(1) hoogstens zetten + d milliseconden aan data in elke cluster. Het minimum + voor d is '100ms', en het maximum + is '32000ms'. + +

+ + +

+ mkvmerge(1) plaatst standaard op zijn hoogst 65535 data blokken en 5000ms aan + data in een cluster. + +

+ + +

+ Programma's die een bepaald beeld proberen te zoeken, kunnen alleen direct + naar een cluster zoeken en moeten daarna de gehele cluster lezen. Daarom kan + het de oorzaak zijn, dat het maken van grote clusters kan leiden tot + onnauwkeurigheid of traag zoeken. + +

+ +
--clusters-in-meta-seek + +

+ Vertelt mkvmerge(1) een meta element te creëren aan het eind van het bestand + dat alle clusters bevat. Zie ook de sectie over: Matroska bestand layout. + +

+ +
--timestamp-scale factor + +

+ Forceert de tijd code schaal factor naar + factor. Geldige bereik waardes zijn + 1000..10000000 of de speciale + waarde -1. + +

+ + +

+ Normaal zal mkvmerge(1) een waarde gebruiken van 1000000 + wat inhoudt, dat de tijd codes en duren een precisie hebben van 1ms. Voor + bestanden die geen video maar minstends één audio spoor bevatten, zal + mkvmerge(1) automatisch de tijd code schaal factor kiezen, zodat alle tijd + codes en duren een precisie hebben van één audio voorbeeld. Dit veroorzaakt + een grotere overhead maar staat een betere zoek en extractie precisie toe. + +

+ + +

+ Als de speciale waarde -1 is gebruikt, dan zal + mkvmerge(1) een voorbeeld precisie gebruiken zelfs als er een video spoor + aanwezig is. + +

+ +
--enable-durations + +

+ Duur schrijven voor alle blokken. Dit zal de bestandsgrootte verhogen en + geeft geen extra waarde aan af spelers van dit moment. + +

+ +
--no-cues + +

+ Vertelt mkvmerge(1) geen volg document(en) (cue) te creëren en te schrijven + wat vergelijkbaar is met een index in een AVI. Matroska(tm) bestanden kunnen + worden afgespeeld zonder volg document(en) (cue), maar dat kan leiden tot + onnauwkeurigheid of traag zoeken. Gebruik dit alleen als je echt wanhopig + bent qua ruimte of voor test doeleinden. Zie ook de optie volg document(en) + (cue) welke opgegeven kan worden voor elk invoer bestand. + +

+ +
--no-date + +

+ By default mkvmerge(1) sets the "date" segment information field to the time + & date when multiplexing started. With this option that field is not + written at all. + +

+ +
--disable-lacing + +

+ Zet het aaneenkoppelen uit voor alle sporen. Dit zal de bestandsgrootte + verhogen, speciaal wanneer er veel audio sporen zijn. Deze optie is niet + bedoeld voor dagelijks gebruik. + +

+ +
--disable-track-statistics-tags + +

+ Normally mkvmerge(1) will write certain tags with statistics for each + track. If such tags are already present then they will be overwritten. The + tags are BPS, DURATION, + NUMBER_OF_BYTES and + NUMBER_OF_FRAMES. + +

+ + +

+ Enabling this option prevents mkvmerge(1) from writing those tags and from + touching any existing tags with same names. + +

+ +
--disable-language-ietf + +

+ Normally mkvmerge(1) will write the new IETF BCP 47 language elements in + addition to the legacy language elements in track headers, chapters and + tags. If this option is used, only the legacy elements are written. + +

+ +
--normalize-language-ietf mode + +

+ Enables normalizing all IETF BCP 47 language tags to either their canonical + form with mode 'canonical', to their extended language + subtags form with mode 'extlang' or turns it off with + mode 'off'. By default normalization to the canonical + form is applied. + +

+ + +

+ In the canonical form all subtags for which preferred values exist are + replaced by those preferred values. This converts + e.g. 'zh-yue-jyutping' to + 'yue-jyutping' or 'fr-FX' to + 'fr-FR'. + +

+ + +

+ For the extended language subtags form the canonical form is built + first. Afterwards all primary languages for which an extended language + subtag exists are replaced by that extended language subtag and its + prefix. This converts e.g. 'yue-jyutping' back to + 'zh-yue-jyutping' but has no effect on + 'fr-FR' as 'fr' is not an extended + language subtag. + +

+ +
--stop-after-video-ends + +

+ Stops processing after the primary video track ends, discarding any + remaining packets of other tracks. + +

+ +
+ + + +

2.5. Bestand splitsen, linken en toevoegen (meer globale opties)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split specification + +

+ Splits the output file after a given size or a given time. Please note that + tracks can only be split right before a key frame. Therefore the split + point may be a bit off from what the user has specified. + +

+ + +

+ At the moment mkvmerge(1) supports the following modes: + +

+ + +
    + +
  1. + +

    + Splitsen op grootte. + +

    + + +

    + Ingaven: --split + [size:]d[k|m|g] + +

    + + +

    + Voorbeelden: --split size:700m of --split + 150000000 + +

    + + +

    + De parameter d mag eindigen met + 'k', 'm' of 'g' ter + indicatie dat de grootte respectievelijk wordt aangegeven in KB, MB of + GB. Anders wordt een grootte in Bytes verondersteld. Nadat een uitvoer + bestand zijn limiet heeft bereikt wordt er een andere aangemaakt. + +

    + + +

    + De 'size:' mag vanwege de verenigbaarheid + (compatibiliteit) weggelaten worden. + +

    + +
  2. + + +
  3. + +

    + Splitsen na een duur van. + +

    + + +

    + Ingaven: --split + [duur:]HH:MM:SS.nnnnnnnnn|ds + +

    + + +

    + Voorbeeld: --split duration:00:60:00.000 of --split + 3600s + +

    + + +

    + De parameter moet één van beiden de vormen hebben + HH:MM:SS.nnnnnnnnn voor het specificeren van de duur + tot in de precisie van een nanoseconde of een nummer + d gevolgd door een letter 's' voor + de duur in seconden. HH is het aantal uren, + MM het aantal minuten, SS het + aantal seconden en nnnnnnnnn het aantal + nanoseconden. Zowel de uren evenals de nanoseconden mogen weggelaten + worden. Er mogen tot aan negen nummers opgegeven worden na de decimale + punt. Nadat de duur van de huidige inhoud deze limiet bereikt heeft, wordt + er een nieuw uitvoer bestand gestart. + +

    + + +

    + De 'duration:' mag vanwege de verenigbaarheid + (compatibiliteit) weggelaten worden. + +

    + +
  4. + + +
  5. + +

    + Splitsen na een specifieke tijd code. + +

    + + +

    + Ingaven: --split + timestamps:A[,B[,C...]] + +

    + + +

    + Voorbeeld: --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + De parameters A, B, + C etc. moeten allen dezelfde indeling hebben als de + duur (zie hierboven). De lijst van tijd codes is komma gescheiden. Nadat de + uitvoer stroom zijn huidige splits tijd code limiet heeft bereikt wordt er + een nieuw bestand gecreëerd. Daarna wordt het volgende splits punt gebruikt + van de gebruikte lijst. + +

    + + +

    + Het 'timestamps:' voorvoegsel mag niet wegelaten worden. + +

    + +
  6. + + +
  7. + +

    + Houden van specifieke delen door het specificeren van tijd code bereiken, + terwijl het van anderen ontdaan wordt. + +

    + + +

    + Ingaven: --split + parts:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + Voorbeeld: +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + De parts mode vertelt mkvmerge(1) bepaalde tijd code + bereiken te behouden en anderen over te slaan. De te behouden bereiken + worden uit gelijst na de parts: sleutelwoord en + gescheiden door een komma. Het bereik zelf bestaat uit een start en een + eindtijd code in hetzelfde format als de overige variaties van + --split accept (b.v. beide + 00:01:20 en 80s verwijzen naar + dezelfde tijd code). + +

    + + +

    + Als een start tijd code is weggelaten wordt het standaard gezet naar het + vorige bereik eindtijd code. Als er geen vorig bereik, dan is standaard het + begin van het bestand (zie voorbeeld 3). + +

    + + +

    + Als een eind tijd code is weggelaten, dan is standaard het einde van de + bronbestanden die in feite mkvmerge(1) vertelt om de rest te houden (zie + voorbeeld 3) + +

    + + +

    + Normaal gesproken wordt elk bereik weggeschreven naar een nieuw bestand. Dit + kan worden veranderd, zodat opeenvolgende reeksen worden geschreven in + hetzelfde bestand. Daarvoor moet de gebruiker de start tijd code voorzetten + met een +. Dit vertelt mkvmerge(1) om niet een nieuw + bestand aan te maken en in plaats daarvan het bereik toe te voegen aan + hetzelfde bestand die in de vorige reeks is geschreven. Tijdcodes zullen + worden aangepast, zodat er géén gat ontstaat in het uitvoerbestand, zelfs + als er een gat in de twee bereiken in het invoerbestand waren. + +

    + + +

    + In voorbeeld 1 zal mkvmerge(1) twee bestanden aanmaken. De eerste bevat de + inhoud startend vanaf 00:01:20 tot + 00:02:45. De tweede zal de inhoud bevatten vanaf + 00:05:50 tot 00:10:30. + +

    + + +

    + In voorbeeld 2 zal mkvmerge(1) slechts één bestand aanmaken. Dit bestand zal + beide inhoud bevatten startend van 00:01:20 tot + 00:02:45 en de inhoud startend van + 00:05:50 tot 00:10:30. + +

    + + +

    + In voorbeeld 3 zal mkvmerge(1) twee bestanden aanmaken. De eerste bevat de + inhoud vanaf het beging van het bron bestanden tot + 00:02:45. Het tweede bevat de inhoud startend vanaf + 00:05:50 tot het eind van het bron bestanden. + +

    + + +
    +

    Note:

    + +

    + Opmerking, dat mkvmerge(1) alleen beslissingen neemt over het splitsen op + sleutel beeld posities. Dit geldt voor zowel voor het begin en het einde van + elk bereik. Dus zelfs als een eind tijdcode tussen twee sleutel beelden + ligt, blijft mkvmerge(1) beelden uitvoeren tot aan, maar exclusief de + volgende sleutel beeld. + +

    + +
    + +
  8. + + +
  9. + +

    + Houden van specifieke delen door het specificeren van beeld/veld nummer + bereiken, terwijl het van anderen ontdaan wordt. + +

    + + +

    + Ingaven: --split + parts-frames:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + Voorbeeld: +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + De parts-frames mode vertelt mkvmerge(1) bepaalde bereiken + van beeld/veld nummers te behouden en anderen over te slaan. De te behouden + bereiken moeten uit gelijst worden na de parts-frames: + sleutelwoord en gescheiden door een komma. Het bereik zelf bestaat uit een + start en een eind beeld/veld nummer. Nummering start op 1. + +

    + + +

    + Als een start nummer is weggelaten wordt het standaard gezet naar het vorige + bereik eind nummer. Als er geen vorig bereik is, dan is standaard het begin + van het bestand (zie voorbeeld 3). + +

    + + +

    + Als een eind nummer is weggelaten, dan is standaard het einde van de + bronbestanden die in feite mkvmerge(1) vertelt om de rest te behouden (zie + voorbeeld 3) + +

    + + +

    + Normaal gesproken, wordt elk bereik weggeschreven naar een nieuw + bestand. Dit kan worden veranderd, zodat opeenvolgende reeksen worden + geschreven in hetzelfde bestand. Daarvoor, moet de gebruiker het start + nummer voorzetten met een +. Dit vertelt mkvmerge(1) om + niet een nieuw bestand aan te maken en in plaats daarvan, het bereik toe te + voegen aan hetzelfde bestand die in de vorige reeks werd + geschreven. Tijdcodes zullen worden aangepast, zodat er géén gat ontstaat in + het uitvoerbestand, zelfs als er een gat in de twee bereiken in het + invoerbestand waren. + +

    + + +
    +

    Note:

    + +

    + Opmerking, dat mkvmerge(1) alleen beslissingen neemt over het splitsen op + sleutel beeld posities. Dit geldt voor zowel voor het begin en het einde van + elk bereik. Dus zelfs als een eind beeld/veld nummer tussen twee sleutel + beelden ligt, blijft mkvmerge(1) beelden uitvoeren tot aan, maar exclusief de + volgende sleutel beeld. + +

    + +
    + + +

    + In voorbeeld 1 zal mkvmerge(1) twee bestanden aanmaken. De eerste bevat de + inhoud startend op of na het eerste sleutel beeld 137 + maar exclusief het eerste sleutel beeld op of na 258. Het + tweede bestand, zal de inhoud bevatten startend vanaf 548 + tot 1211. + +

    + + +

    + In voorbeeld 2 zal mkvmerge(1) slechts één bestand aanmaken. Dit bestand zal + beide inhoud bevatten startend van 733 tot + 912 en de inhoud startend vanaf 1592 + tot 2730. + +

    + + +

    + In voorbeeld 3 zal mkvmerge(1) twee bestanden aanmaken. De eerste bevat de + inhoud vanaf het begin van het bron bestanden tot + 430. Het tweede bevat de inhoud startend vanaf + 2512 tot het eind van het bron bestanden. + +

    + + +

    + Deze modus houdt alleen rekening met de eerste video spoor dat wordt + uitgevoerd. Als er geen video spoor is uitgevoerd dan zal splitsen niet + plaatsvinden. + +

    + + +
    +

    Note:

    + +

    + De getallen met dit argument worden geïnterpreteerd op basis van het aantal + Matroska(tm) blokken die worden uitgevoerd. Een enkele Matroska(tm) blok bevat + ofwel een volledig beeld (voor progressieve inhoud) of een enkel veld (voor + interlaced inhoud). mkvmerge maakt geen onderscheid tussen die twee en telt + eenvoudig telt aantal blokken. Als voorbeeld: Als men wilt verdelen na het + 25ste volledige beeld met interlaced inhoud zou men 50 + moeten gebruiken (twee velden per volledig beeld) als splits moment. + +

    + +
    + +
  10. + + +
  11. + +

    + Splitsen na specifieke beelden/velden codes. + +

    + + +

    + Ingaven: --split + frames:A[,B[,C...]] + +

    + + +

    + Voorbeeld: --split frames:120,237,891 + +

    + + +

    + De parameters A, B, + C etc. moeten allen positieve cijfers + bevatten. Nummering start vanaf 1. De lijst van beeld/veld codes is komma + gescheiden. Nadat de uitvoer stroom zijn huidige splits tijd code limiet + heeft bereikt wordt er een nieuw bestand gecreëerd. Daarna wordt het + volgende splits punt gebruikt van de gebruikte lijst. + +

    + + +

    + Het 'frames:' voorvoegsel mag niet wegelaten worden. + +

    + + +

    + Deze modus houdt alleen rekening met de eerste video spoor dat wordt + uitgevoerd. Als er geen video spoor is uitgevoerd dan zal splitsen niet + plaatsvinden. + +

    + + +
    +

    Note:

    + +

    + De getallen met dit argument worden geïnterpreteerd op basis van het aantal + Matroska(tm) blokken die worden uitgevoerd. Een enkele Matroska(tm) blok bevat + ofwel een volledig beeld (voor progressieve inhoud) of een enkel veld (voor + interlaced inhoud). mkvmerge maakt geen onderscheid tussen die twee en telt + eenvoudig telt aantal blokken. Als voorbeeld: Als men wilt verdelen na het + 25ste volledige beeld met interlaced inhoud zou men 50 + moeten gebruiken (twee velden per volledig beeld) als splits moment. + +

    + +
    + +
  12. + + +
  13. + +

    + Splitsen na een specifieke hoofstukken. + +

    + + +

    + Syntax: --split chapters:all or + --split + chapters:A[,B[,C...]] + +

    + + +

    + Voorbeeld: --split chapters:5,8 + +

    + + +

    + De parameters A, B, + C etc. moeten allen positief zijn. Nummering start + vanaf 1. De lijst van hoofstukken is komma gescheiden. Splitsing zal + plaatsvinden vlak voor het eerste toets sleutelbeeld waarvan de tijd code + gelijk is aan of groter is dan de start tijd code voor de hoofdstukken + waarvan de nummers zijn opgenomen. Een hoofdstuk vanaf 0s wordt nooit + beschouwd voor het splitsen en wordt geruisloos weggegooid. + +

    + + +

    + Het sleutelwoord all kan worden gebruikt i.p.v. alle + hoofdstuknummers handmatig uit te lijsten. + +

    + + +

    + Het chapters:' voorvoegsel mag niet wegelaten worden. + +

    + + +
    +

    Note:

    + +

    + Het Matroska(tm) bestandsformaat ondersteunt willekeurige diep geneste + hoofdstuk structuren, genoemd 'editie ingaven' en 'hoofdstuk delen'. + Echter, deze modus beperkt zich alleen tot het hoogste niveau van de + hoofdstukken door alle editie ingaven. + +

    + +
    + +
  14. + +
+ + +

+ Voor deze splits mode wordt het uitvoer bestand anders behandeld dan onder + de normale werking. Het mag bevatten een printf zoals + uitgedrukt '%d' inclusief een optioneel veld, + b.v. '%02d'. Indien dit het geval is, zal het huidige + bestandsaantal geschikt worden geformatteerd en op dat punt in de + bestandsnaam worden ingevoegd. Is er geen dergelijk patroon dan wordt een + patroon van '-%03d' aangenomen direct voor de bestand extensie: + '-o output.mkv' zou resulteren in + 'output-001.mkv' en zo verder. Is er geen extensie dan + zal '-%03d' worden toegevoegd aan de naam. + +

+ + +

+ Another possible pattern is '%c' which will be replaced by the + name of the first chapter in the file. Note that when '%c' is + present, the pattern '-%03d' will not be added automatically. + +

+ +
--link + +

+ Bestanden linken aan een ander tijdens het splitsen van het uitvoer + bestand. Zie de sectie over: Bestand + linken onderstaand voor details. + +

+ +
--link-to-previous segment-UID + +

+ Verbindt het laatste uitvoerbestand met het segment UID ingegeven door + segment-UID parameter. Zie de sectie over: Bestand linken onderstaand voor + details. + +

+ + +

+ If SID starts with = then its rest is interpreted as the name of a Matroska + file whose segment UID is read and used. + +

+ +
--link-to-next segment-UID + +

+ Verbindt het laatste uitvoerbestand met het segment UID ingegeven door + segment-UID parameter. Zie de sectie over: Bestand linken onderstaand voor + details. + +

+ + +

+ If SID starts with = then its rest is interpreted as the name of a Matroska + file whose segment UID is read and used. + +

+ +
--append-mode mode + +

+ Calculeert hoe tijd codes worden berekend wanneer die worden toegevoegd aan + een bestand. De parameter mode kan twee waardes + bevatten: 'file' welke ook standaard is en + 'track'. + +

+ + +

+ Wanneer mkvmerge een spoor toevoegt (genoemd 'track2_1' + vanaf nu) van een tweede bestand (genoemd 'file2') naar + een spoor (genoemd 'track1_1') van het eerste bestand + (genoemd 'file1') dan moet het alle tijd codes + compenseren voor 'track2_1' met een bepaalde + hoeveelheid. Voor 'file' mode is deze hoeveelheid de + hoogste tegengekomen tijd code in 'file1'. zelfs wanneer + die tijd code van een ander spoor is dan 'track1_1'. In + spoor mode de is compensatie de hoogste tijd code van + 'track1_1'. + +

+ + +

+ Helaas kan mkvmerge niet detecteren welke mode betrouwbaar is. Daarom zet + het de standaard waarde naar 'file' + mode. 'file' mode werkt gewoonlijk beter voor bestanden + indien die onafhankelijk van elkaar werden gemaakt; b.v. het toevoegen van + AVI of MP4 + bestanden. 'track' mode zou beter werken voor bronnen die + hoofdzakelijk een deel van één groot bestand zijn, b.v. voor + VOB en EVO bestanden. + +

+ + +

+ Hoofdstuk sporen worden altijd behandeld alsof 'file' + mode actief is en zelfs wanneer 'track' mode actueel is. + +

+ +
--append-to + SFID1:STID1:DFID1:DTID1[,...] + +

+ Deze optie controleert welk spoor aan welk ander spoor moet worden + toegevoegd (bestand wordt dubbel zo groot). Elke specificatie bevat vier + ID's: een bestand ID, een spoor ID, een tweede bestand ID en een tweede + spoor ID. Het eerste paar, "source file ID" en "source track ID", + identificeert het spoor dat moet worden toegevoegd. Het tweede paar, + "destination file ID" en "destination track ID", identificeert het spoor + waaraan de eerste is toegevoegd. + +

+ + +

+ Als deze optie weggelaten wordt dan wordt een standaard indeling + gebruikt. Deze standaard indeling voegt elk spoor van het huidige bestand + toe aan een spoor van het vorige bestand met hetzelfde spoor ID. Dit staat + het makkelijk toevoegen toe indien een film gesplitst is in twee delen en + beide bestanden dezelfde aantal sporen en spoor ID's hebben, met het + commando mkvmerge -o output.mkv part1.mkv +part2.mkv. + +

+ +
+ + +

+ Een enkele '+' veroorzaakt dat het volgende bestand wordt bijgevoegd + (bestand wordt dubbel zo groot) i.p.v. toegevoegd. De '+' kan worden + ingegeven voor elk volgende bestandsnaam. Daarom zijn de volgende twee + commando's gelijkwaardig: + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv file1.mkv +file2.mkv
+
[ file1 file2 + ] + +

+ If multiple file names are contained in a pair of square brackets then the + second and all following files will be appended to the first file named + within the brackets. + +

+ + +

+ This is an alternative syntax to using '+' between the file names. Therefore + the following two commands are equivalent: + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv '[' file1.mkv file2.mkv ']'
+
= + +

+ For certain file types (MPEG program streams = VOBs) mkvmerge(1) normally + looks for files in the same directory as an input file that have the same + base name and only differ in their running number (e.g. 'VTS_01_1.VOB', + 'VTS_01_2.VOB', 'VTS_01_3.VOB' etc) and treats all of those files as if they + were concatenated into a single big file. This option, a single '=', causes + mkvmerge not to look for those additional files. + +

+ + +

+ De '=' kan ook worden ingegeven voor elk volgende bestandsnaam. Daarom zijn + de volgende twee commando's gelijkwaardig: + +

+ +
$ mkvmerge -o full.mkv = file1.vob
+$ mkvmerge -o full.mkv =file1.vob
+
( file1 file2 + ) + +

+ Als er meerdere bestandsnamen zijn opgenomen tussen haakjes, dan zullen die + bestanden worden behandeld alsof ze zijn samengevoegd tot één enkel groot + bestand, dat bestaat uit de inhoud van elk van de bestanden achter elkaar. + +

+ + +

+ Dit kan gebruikt worden voor b.v. VOB bestanden vanaf een DVD of MPEG + transport stromen. Het kan niet worden gebruikt als elk bestand zijn eigen + set koppen bevat wat meestal het geval is bij stand-alone-bestanden, zoals + AVI of MP4. + +

+ + +

+ Een bestandsnaam tussen haakjes te zetten voorkomt tevens dat mkvmerge(1) + kijkt naar extra bestanden met dezelfde naam zoals beschreven in option + =. Daarom zijn deze twee commando's gelijkwaardig: + +

+ +
$ mkvmerge -o out.mkv = file.mkv
+$ mkvmerge -o out.mkv '(' file.mkv ')'
+ +

+ Verschillende dingen dienen te worden opgemerkt: + +

+ + +
    + +
  1. + +

    + Er moet een spatie zijn zowel voor als na het open en sluit haken. + +

    + +
  2. + + +
  3. + +

    + Elke parameter tussen haakjes wordt geïnterpreteerd als een + bestandsnaam. Daarom moeten alle opties die van toepassing zijn op dit + logische bestand opgenomen moet worden voor de openende haakjes. + +

    + +
  4. + + +
  5. + +

    + Sommige insluitingen worden behandeld als speciale tekens. Vandaar dat je + moet insluiten of citeren ze zoals in het voorbeeld hierboven. + +

    + +
  6. + +
+ +
+ + + + +

2.6. Bijlage ondersteuning (meer globale opties)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description description + +

+ Normale tekst beschrijving van de volgende bijlage. Is van toepassing op de + volgende --attach-file + of --attach-file-once optie. + + +

+ +
--attachment-mime-type MIME type + +

+ MIME type van de volgende bijlage. Is van toepassing op de + volgende --attach-file + of --attach-file-once + optie. Een lijst van officiële herkende MIME typen kan + gevonden worden b.v. op de IANA + thuisbasis. Het MIME type is verplicht voor een bijlage. + +

+ + +

+ If no MIME type is given a for an attachment, its type will + be detected automatically. + +

+ +
--attachment-name name + +

+ Stelt de naam in voor deze bijlage welke wordt opgeslagen in het uitvoer + bestand. Als deze optie niet is opgegeven dan zal de naam worden afgeleid + van de naam van de bijlage zoals gegeven met de --attach-file + of de --attach-file-once + optie. + +

+ +
+ --attach-file file-name, + --attach-file-once file-name + + +

+ Creëert een bestandsbijlage binnenin het Matroska(tm) bestand. Het + MIME type moet ingesteld zijn voordat deze optie gebruikt + kan worden. Het verschil tussen deze twee vormen is, dat tijdens het + splitsen van de bestanden vastgemaakt met --attach-file aan + alle uitvoerbestanden zijn vastgemaakt terwijl degene vastgemaakt met de + --attach-file-once alleen zijn vastgemaakt aan het eerste + bestand. Is splitsen niet gebruikt dan doen beide hetzelfde. + +

+ + +

+ mkvextract(1) kan worden gebruikt om bestanden uit een Matroska(tm) bestand te + halen. + +

+ +
--enable-legacy-font-mime-types + +

+ Enables the use of legacy MIME types for certain types of + font attachments. For example, + 'application/x-truetype-font' will be used for TrueType + fonts instead of 'fonts/ttf'. + +

+ + +

+ This affects both new attachments if its MIME type is + detected automatically and existing attachments whose stored + MIME types will be remapped to the legacy ones. + +

+ + +

+ The affected MIME types are 'font/sfnt', + 'font/ttf' and 'font/collection' which + are all mapped to 'application/x-truetype-fonts' and + 'font/otf' which is mapped to + 'application/vnd.ms-opentype'. + +

+ +
+ + + +

2.7. Opties welke gebruikt kunnen worden voor elk invoer bestand

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks + [!]n,m,... + +

+ Kopieer de audio sporen n, m + etc. De nummers zijn track ID's welke verkregen kunnen worden met de --identify + schakelaar. Zij zijn simpelweg niet de spoor nummers (zie sectie Spoor ID's). Standaard: Kopieer alle + audio sporen. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ Default: copy all tracks of this kind. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-d, --video-tracks + [!]n,m,... + +

+ Kopieer de video sporen n, m + etc. De nummers zijn track ID's welke kunnen worden verkregen met de --identify + schakelaar. Zij zijn simpelweg niet de spoor nummers (zie sectie Spoor ID's). Standaard: Kopieer alle + video sporen.. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-s, --subtitle-tracks + [!]n,m,... + +

+ Kopieer de ondertitel sporen n, + m etc. De nummers zijn track ID's welke kunnen worden + verkregen met de --identify + schakelaar. Zij zijn simpelweg niet de spoor nummers (zie sectie Spoor ID's). Standaard: Kopieer alle + ondertitel sporen. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-b, --button-tracks + [!]n,m,... + +

+ Kopieer de knop sporen n, m + etc. De nummers zijn track ID's welke kunnen worden verkregen met de --identify + schakelaar. Zij zijn simpelweg niet de spoor nummers (zie sectie Spoor ID's). Standaard: Kopieer alle + knop sporen. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
--track-tags + [!]n,m,... + +

+ Kopieer de markeringen voor sporen n, + m etc. De nummers zijn track ID's welke kunnen worden + verkregen met de --identify + schakelaar (zie sectie Spoor + ID's). Zij zijn simpelweg niet de spoor nummers. Standaard: Kopieer + alle markering sporen. + +

+ + +

+ Als de IDs zijn voorgezet met ! dan is de betekenis + omgekeerd: kopieer alles maar de ID's lijsten na de !. + +

+ +
-m, --attachments + [!]n[:all|first],m[:all|first],... + +

+ Kopieer de bijlagen met de ID's n, + m etc. naar allen of alleen het eerste uitvoer + bestand. Elk ID kan opgevolgd worden door ':all' (welke + standaard is, als geen van twee is opgegeven) of + ':first'. Als het splitsen actief is, dan zullen die + bijlagen waarvan de ID's zijn gespecificeerd met ':all' + worden gekopieerd naar alle resulterende uitvoer bestanden, terwijl de + anderen alleen gekopieerd worden naar het eerste uitvoerbestand. Als + splitsen niet actief is, dan hebben beide varianten hetzelfde effect. + +

+ + +

+ Standaard is, kopieer alle bijlagen naar alle uitvoer bestanden. + +

+ + +

+ Als de IDs zijn voorgezet met ! dan is de betekenis + omgekeerd: kopieer alles maar de ID's lijsten na de !. + +

+ +
-A, --no-audio + +

+ Kopieer geen enkel audio spoor van dit bestand. + +

+ +
-D, --no-video + +

+ Kopieer geen enkel video spoor van dit bestand. + +

+ +
-S, --no-subtitles + +

+ Kopieer geen enkel ondertitel spoor van dit bestand. + +

+ +
-B, --no-buttons + +

+ Kopieer geen enkel knop spoor van dit bestand. + +

+ +
-T, --no-track-tags + +

+ Kopieer geen enkel spoor-specifieke markeringen van dit bestand. + +

+ +
--no-chapters + +

+ Kopieer geen hoofdstukken van dit bestand. + +

+ +
-M, --no-attachments + +

+ Kopieer geen bijlagen van dit bestand. + +

+ +
--no-global-tags + +

+ Kopieer geen globale markeringen van dit bestand. + +

+ +
-y, --sync + TID:d[,o[/p]] + +

+ Stelt de tijd codes bij van het spoor met het id TID + met d ms. De spoor ID's zijn hetzelfde als degene + gegeven met --identify + (zie sectie Spoor ID's). + +

+ + +

+ o/p: Stel de tijd codes bij + met o/p om lineaire driften te + corrigeren. p standaard naar 1 indien + weggelaten. Beide o en p + kunnen een veranderbaar nummer zijn. + +

+ + +

+ Standaard: geen handmatige sync correctie (wat hetzelfde is als + d = 0 en + o/p = + 1.0). + +

+ + +

+ Deze optie kan meerdere keren worden gebruikt voor een invoer bestand, is + van toepassing op verschillende sporen door het spoor ID elke keer te + selecteren. + +

+ +
--cues TID:none|iframes|all + +

+ Controle voor welke sporen cue (index) ingangen worden gecreëerd voor een + opgegeven spoor (zie sectie Spoor + ID's). 'none' remt het creëren van volg + document(en) (cue) af. Voor 'iframes' alléén blokken + zonder voor of achteruit referenties ( = I beelden in video sporen) worden + ingevoerd in het 'volg document(en) (cue)'. 'all' zorgt + ervoor dat mkvmerge(1) aanmaakt, volg document(en) (cue) voor alle blokken + welke het bestand erg groot maakt. + +

+ + +

+ The default is 'iframes' for video and subtitle tracks + and 'none' for audio tracks. See also option --no-cues + which inhibits the creation of cue entries regardless of the + --cues options used. + +

+ + +

+ Deze optie kan meerdere keren worden gebruikt voor een invoer bestand, is + van toepassing op verschillende sporen door het spoor ID elke keer te + selecteren. + +

+ +
--default-track-flag + TID[:bool] + +

+ Sets the "default track" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. The flag will be set if the source container doesn't + provide that information and the user doesn't specify it via this option. + +

+ + +

+ If the user does not explicitly select a track during playback, the player + should select one of the tracks that has its "default track" flag + set, taking user preferences such as their preferred language into account. + +

+ + +

+ Deze optie kan meerdere keren worden gebruikt voor een invoer bestand, is + van toepassing op verschillende sporen door het spoor ID elke keer te + selecteren. + +

+ +
--track-enabled-flag + TID[:bool] + +

+ Sets the "track enabled" flag for the given track (see section + track IDs) to the given value + bool (0 or 1; defaults to 1 if not specified). + Tracks are enabled by default if no option is specified for them and the + source container doesn't provide this information either. + +

+ + +

+ Only tracks whose "track enabled" flag is set should be considered + for playback. + +

+ + +

+ Deze optie kan meerdere keren worden gebruikt voor een invoer bestand, is + van toepassing op verschillende sporen door het spoor ID elke keer te + selecteren. + +

+ +
--forced-display-flag + TID[:bool] + +

+ Sets the "forced display" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. Use this for tracks containing onscreen text or + foreign-language dialogue. + +

+ + +

+ Deze optie kan meerdere keren worden gebruikt voor een invoer bestand, is + van toepassing op verschillende sporen door het spoor ID elke keer te + selecteren. + +

+ +
--hearing-impaired-flag + TID[:bool] + +

+ Sets the "hearing impaired" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track is suitable for users + with hearing impairments. + +

+ + +

+ Deze optie kan meerdere keren worden gebruikt voor een invoer bestand, is + van toepassing op verschillende sporen door het spoor ID elke keer te + selecteren. + +

+ +
--visual-impaired-flag + TID[:bool] + +

+ Sets the "visual impaired" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track is suitable for users + with visual impairments. + +

+ + +

+ Deze optie kan meerdere keren worden gebruikt voor een invoer bestand, is + van toepassing op verschillende sporen door het spoor ID elke keer te + selecteren. + +

+ +
--text-descriptions-flag + TID[:bool] + +

+ Sets the "text descriptions" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track contains textual + descriptions of video content suitable for playback via a text-to-speech + system for a visually-impaired user. + +

+ + +

+ Deze optie kan meerdere keren worden gebruikt voor een invoer bestand, is + van toepassing op verschillende sporen door het spoor ID elke keer te + selecteren. + +

+ +
--original-flag + TID[:bool] + +

+ Sets the "original language" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track is in the content's + original language (not a translation). + +

+ + +

+ Deze optie kan meerdere keren worden gebruikt voor een invoer bestand, is + van toepassing op verschillende sporen door het spoor ID elke keer te + selecteren. + +

+ +
--commentary-flag + TID[:bool] + +

+ Sets the "commentary" flag for the given track (see section track IDs) if the optional argument + bool is set to 1 or if it isn't + present. This flag can be set if the track contains commentary. + +

+ + +

+ Deze optie kan meerdere keren worden gebruikt voor een invoer bestand, is + van toepassing op verschillende sporen door het spoor ID elke keer te + selecteren. + +

+ +
--track-name TID:name + +

+ Stelt het spoor naam in van een gegeven spoor (zie sectie Spoor ID's) naar + naam. + +

+ +
--language TID:language + +

+ Stelt de taal in voor het opgegeven spoor (zie sectie Spoor ID's). Beide ISO 639-2 taal codes + en ISO 639-1 land codes zijn toegestaan. Het land code wordt automatisch + vertaald naar taal code. Alle talen inclusief hun ISO 639-2 codes kunnen uit + gelijst worden met --list-languages + optie. + +

+ + +

+ Deze optie kan meerdere keren worden gebruikt voor een invoer bestand, is + van toepassing op verschillende sporen door het spoor ID elke keer te + selecteren. + +

+ +
-t, --tags + TID:file-name + +

+ Leest de markeringen in van het spoor met het nummer + TID van de bestand + file-name. Zie de sectie over: Markeringen hieronder voor details. + +

+ +
--aac-is-sbr + TID[:0|1] + +

+ Vertelt mkvmerge(1) dat het spoor met het ID TID een + SBR AAC is (ook bekend als HE-AAC of een + AAC+). Deze optie is nodig als a) een bron bestand een + AAC bestand is (niet voor een + Matroska(tm) bestand) en b) het AAC bestand bevat SBR + AAC data. De reden voor deze schakelaar is, dat het normaal + technisch niet mogelijk is, automatisch te vertellen dat + AAC data van SBR AAC data zonder deze + volledig te decoderen van een AAC beeld. Aangezien er + verscheidene octrooi/patent kwesties zijn met AAC decoders + zal mkvmerge(1) nooit dit decodeer stadium bevatten. Dus voor SBR + AAC bestanden is deze schakelaar een vereiste. Het resulterende + bestand zou niet correct afgespeeld kunnen worden of zelfs helemaal niet, + wanneer deze schakelaar werd weggelaten. + +

+ + +

+ Als het bron bestand een Matroska(tm) bestand is, dan zou de + CodecID genoeg moeten zijn om deze SBR + AAC te detecteren. Hoewel, als de CodecID + verkeerd is, dan kan deze schakelaar gebruikt worden om dat te corrigeren. + +

+ + +

+ Als mkvmerge verkeerd detecteert dat een AAC bestand een + SBR is, dan kan je toevoegen ':0' aan + het spoor ID. + +

+ +
--audio-emphasis TID:n|symbolic-name + +

+ Sets the emphasis for the audio track with the track ID + TID. The mode can either be a number + n (certain values between 0 and + 16) or a symbolic name. All valid numbers & + symbolic names can be listed with the --list-audio-emphasis + option. + +

+ +
--reduce-to-core TID + +

+ Some audio codecs have a lossy core and optional extensions that implement + lossless decoding. This option tells mkvmerge(1) to only copy the core but + not the extensions. By default mkvmerge(1) copies both the core and the + extensions. + +

+ + +

+ Currently only DTS tracks are affected by this + option. TrueHD tracks that contain an embedded AC-3 core + are instead presented as two separate tracks for which the user can select + which track to copy. For DTS such a scheme would not work + as the HD extensions cannot be decoded by themselves – unlike the TrueHD + data. + +

+ +
--remove-dialog-normalization-gain + TID + +

+ Some audio codecs contain header fields that tell the decoder or player to + apply a (usually negative) gain for dialog normalization. This option tells + mkvmerge(1) to remove or minimize that gain by modifying the corresponding + header fields. + +

+ + +

+ Currently only AC-3, DTS and + TrueHD tracks are affected by this option. + +

+ +
--timestamps TID:file-name + +

+ Leest de te gebruiken tijd codes in voor een specifiek spoor ID van + file-name. Deze krachtige tijd codes heffen de tijd + codes die mkvmerge(1) normaal berekend op. Lees de sectie over: Externe tijd code + bestanden. + +

+ +
--default-duration TID:x + +

+ Forceert de standaard duur van een gegeven spoor naar de gegeven + waarde. Tevens de spoor tijd code aanpast zodat die overeenkomt met de + standaard duur. Het argument x moet zijn vastgezet + met 's', 'ms', + 'us', 'ns' of 'fps' + 'p' of 'i om te specificeren de + standaard duur in seconden, milliseconden, microseconden, nanoseconden of + respectievelijk de ''beelden per seconde' (fps). Het aantal + x kan zelf een veranderbaar nummer zijn of een + fractie. + +

+ + +

+ Als de standaard duur niet is geforceerd dan zal mkvmerge proberen de spoor + standaard duur proberen te verkrijgen uit de inhoud en/of de gecodeerde bit + stroom voor bepaalde spoortypen, b.v. AVC/H.264 of MPEG-2. + +

+ + +

+ Deze optie kan ook gebruikt worden om de FPS (beelden per + seconde) te veranderen van video sporen zonder een extern tijd code bestand + te hoeven gebruiken. + +

+ +
--fix-bitstream-timing-information + TID[:0|1] + +

+ Normally mkvmerge(1) does not change the timing information (frame/field + rate) stored in the video bitstream. With this option that information is + adjusted to match the container timing information. The container timing + information can come from various sources: from the command line (see option + --default-duration), + the source container or derived from the bitstream. + +

+ + +
+

Note:

+ +

This has only been implemented for AVC/H.264 video tracks so far.

+ +
+ +
--compression TID:n + +

+ Selects the compression method to be used for the track. Note that the + player also has to support this method. Valid values are + 'none', 'zlib' and + 'mpeg4_p2'/'mpeg4p2'. + +

+ +

+ De compressie methode + 'mpeg4_p2'/'mpeg4p2' is een speciale + compressie methode genoemd 'header removal' die is alléén beschikbaar + voorMPEG4 deel 2 video sporen. + +

+ +

+ The default for some subtitle types is 'zlib' + compression. This compression method is also the one that most if not all + playback applications support. Support for other compression methods other + than 'none' is not assured. + +

+ +
+ + + +

2.8. Opties die alleen op video sporen van toepassing zijn

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc + TID:FourCC + +

+ Forceert de FourCC naar de opgegeven waarde. Werkt + alléén voor video sporen in de 'MS verenigbare mode'. + +

+ +
--display-dimensions + TID:widthxheight + +

+ Matroska(tm) bestanden bevatten twee waarden die het scherm eigenschappen + instelt waarnaar een af speler met afspelen naar toe zou moeten schalen: + scherm breedte en scherm hoogte. Deze waarden worden ingesteld met deze + optie, b.v. '1:640x480'. + +

+ + +

+ Een andere manier om de te gebruiken waarden te specificeren is --aspect-ratio + of de --aspect-ratio-factor + optie (zie hieronder). Deze opties zijn wederzijds - exclusief. + +

+ +
--aspect-ratio + TID:ratio|width/height + +

+ Matroska(tm) bestanden bevatten twee waarden die de scherm eigenschappen + instellen waarnaar een speler met afspelen naar toe zou moeten schalen: + scherm breedte en scherm hoogte. Met deze optie zal mkvmerge(1) automatisch + de scherm breedte en hoogte berekenen, gebaseerd op de breedte en hoogte + van de originele beelden/plaatjes en de opgegeven beeldverhouding met deze + optie. De verhouding kan één van beiden zijn een veranderbaar nummer + verhouding of als een fractie + 'breedte/hoogte', + b.v. '16/9'. + +

+ + +

+ Een andere manier om de te gebruiken waarden te specificeren is --aspect-ratio-factor + of --display-dimensions + opties (zie hieronder en hierboven). Deze opties zijn wederzijds - + exclusief. + +

+ +
--aspect-ratio-factor TID:factor|n/d + +

+ Een andere manier om de beeldverhouding te specificeren is een + factor. De originele beeldverhouding factor wordt + eerst vermenigvuldigd met deze factor en daarna + gebruikt als doel verhouding. + +

+ + +

+ Een andere manier om de te gebruiken waarden te specificeren is --aspect-ratio + of --display-dimensions + opties (zie boven). Deze opties zijn wederzijds - exclusief. + +

+ +
--cropping TID:left,top,right,bottom + +

+ Stelt de video spoor uitsnij parameters in naar een gegeven waarde. + +

+ +
--color-matrix-coefficients TID:n + +

+ Sets the matrix coefficients of the video used to derive luma and chroma + values from red, green and blue color primaries. The parameter + n is an integer rangeing from 0 + and 10. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: GBR, 1: BT709, + 2: unspecified, 3: reserved, + 4: FCC, 5: BT470BG, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 non-constant + luminance, 10: BT2020 constant luminance + +

+ +
--color-bits-per-channel TID:n + +

+ Sets the number of coded bits for a color channel. A value of + 0 indicates that the number of bits is unspecified. + +

+ +
--chroma-subsample TID:hori,vert + +

+ The amount of pixels to remove in the Cr and Cb channels for every pixel not + removed horizontally/vertically. + +

+ + +

+ Example: For video with 4:2:0 chroma subsampling, the parameter should be + set to + TID:1,1. + +

+ +
--cb-subsample TID:hori,vert + +

+ The amount of pixels to remove in the Cb channel for every pixel not removed + horizontally/vertically. This is additive with + --chroma-subsample. + +

+ + +

+ Example: For video with 4:2:1 chroma subsampling, the parameter + --chroma-subsample should be set to + TID:1,0 + and Cb-subsample should be set to + TID:1,0. + +

+ +
--chroma-siting TID:hori,vert + +

+ Sets how chroma is sited horizontally/vertically (0: + unspecified, 1: top collocated, 2: + half). + +

+ +
--color-range TID:n + +

+ Sets the clipping of the color ranges (0: unspecified, + 1: broadcast range, 2: full range + (no clipping), 3: defined by + MatrixCoefficients/TransferCharacteristics). + +

+ +
--color-transfer-characteristics + TID:n + +

+ The transfer characteristics of the video. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: gamma 2.2 curve, 5: gamma 2.8 + curve, 6: SMPTE 170M, 7: SMPTE + 240M, 8: linear, 9: log, + 10: log sqrt, 11: IEC 61966-2-4, + 12: ITU-R BT.1361 extended color gamut, + 13: IEC 61966-2-1, 14: ITU-R + BT.2020 10 bit, 15: ITU-R BT.2020 12 bit, + 16: SMPTE ST 2084, 17: SMPTE ST + 428-1; 18: ARIB STD-B67 (HLG) + +

+ +
--color-primaries TID:n + +

+ Sets the color primaries of the video. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: ITU-R BT.470M, 5: ITU-R + BT.470BG, 6: SMPTE 170M, 7: SMPTE + 240M, 8: FILM, 9: ITU-R BT.2020, + 10: SMPTE ST 428-1, 22: JEDEC P22 + phosphors + +

+ +
--max-content-light TID:n + +

+ Sets the maximum brightness of a single pixel (Maximum Content Light Level) + in candelas per square meter (cd/m²). The value of n + should be a non-negtive integer. + +

+ +
--max-frame-light TID:n + +

+ Sets the maximum brightness of a single full frame (Maximum Frame-Average + Light Level) in candelas per square meter (cd/m²). The value of + n should be a non-negtive integer. + +

+ +
--chromaticity-coordinates + TID:red-x,red-y,green-x,green-y,blue-x,blue-y + +

+ Sets the red/green/blue chromaticity coordinates as defined by CIE 1931. + +

+ +
--white-color-coordinates TID:x,y + +

+ Sets the white color chromaticity coordinates as defined by CIE 1931. + +

+ +
--max-luminance TID:float + +

+ Sets the maximum luminance in candelas per square meter (cd/m²). The value + should be less than 9999.99. + +

+ +
--min-luminance TID:float + +

+ Sets the minimum luminance in candelas per square meter (cd/m²). The value + should be less than 999.9999. + +

+ +
--projection-type TID:method + +

+ Sets the video projection method used. Valid values are 0 (rectangular + projection), 1 (equirectangular projection), 2 (cubemap projection) and 3 + (mesh projection). + +

+ +
--projection-private TID:data + +

+ Sets private data that only applies to a specific projection. Data must be + given as hex numbers with or without the "0x" prefix, with or + without spaces. + +

+ +
--projection-pose-yaw TID:float + +

+ Specificeert een gierrotatie (yaw) naar de projectie. + +

+ +
--projection-pose-pitch TID:float + +

+ Specificeert een pitchrotatie voor de projectie. + +

+ +
--projection-pose-roll TID:float + +

+ Specificeert een rolrotatie naar de projectie. + +

+ +
--field-order TID:n + +

+ Sets the field order for the video track with the track ID + TID. The order must be one of the following numbers: + +

+ + +

+ 0: progressive; 1: interlaced with + top field displayed first and top field stored first; + 2: undetermined field order; 6: + interlaced with bottom field displayed first and bottom field stored first; + 9: interlaced with bottom field displayed first and top + field stored first; 14: interlaced with top field + displayed first and bottom field stored first + +

+ +
--stereo-mode TID:n|symbolic-name + +

+ Sets the stereo mode for the video track with the track ID + TID. The mode can either be a number + n between 0 and + 14 or a symbolic name. All valid numbers & names + can be listed with the --list-stereo-modes + option. + +

+ +
+ + + +

2.9. Opties alleen geldig voor tekst ondertitel sporen

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset TID:character-set + +

+ Stelt het karakter set conversie in naar UTF-8 voor UTF-8 ondertitels van + een opgegeven spoor ID. Indien niet opgegeven, dan worden het huidig + verkregen besturingssysteem locatie gebruikt. Opmerking: een karakter set + voor ondertitels is niet nodig wanneer er gelezen wordt vanuit een + Matroska(tm) bestand of van Kate stromen, omdat deze altijd zijn opgeslagen in + het UTF-8 format. Zie de sectie over: Tekst bestanden en karakter set + conversies voor een uitleg hoe mkvmerge(1) converteert tussen het + verschillende karakter sets. + +

+ + +

+ Deze optie kan meerdere keren worden gebruikt voor een invoer bestand, is + van toepassing op verschillende sporen door het spoor ID elke keer te + selecteren. + +

+ +
+ + + +

2.10. Andere opties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify + file-name + +

+ Zal mkvmerge(1) (met een sonde) een enkel bestand aftasten en het type + rapporteren, de sporen in het bestand en hun spoor ID's. Als deze optie + wordt gebruikt dan is de enige andere toegestane optie de bestandsnaam. + +

+ + +

The output format used for the result can be changed with the option --identification-format. +

+ +
-J file-name + +

+ This is a convenient alias for "--identification-format json + --identify file-name". + +

+ +
-F, --identification-format + format + +

+ Determines the output format used by the --identify + option. The following formats are supported: text + (the default if this option isn't used) and json. + +

+ + +
    + +
  1. + +

    The text format is short and human-readable. It consists + of one line per item found (container, tracks, attachments etc.). +

    + + +

    This format is not meant to be parsed. The output will be translated into + the language mkvmerge(1) uses (see also --ui-language). +

    + +
  2. + + +
  3. + +

    + The json format outputs a machine-readable JSON + representation. This format follows the JSON schema described in the + following file: + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + All versions of the JSON schema are available both online and in the + released source code archives. + +

    + +
  4. + +
+ +
--probe-range-percentage percentage + +

+ File types such as MPEG program and transport streams + (.vob, .m2ts) require parsing a + certain amount of data in order to detect all tracks contained in the file. + This amount is 0.3% of the source file's size or 10 MB, whichever is higher. + +

+ + +

+ If tracks are known to be present but not found then the percentage to probe + can be changed with this option. The minimum of 10 MB is built-in and + cannot be changed. + +

+ +
--list-audio-emphasis + +

+ Lists all valid numbers & their corresponding symbolic names for the + --audio-emphasis + option. + +

+ +
--list-languages + +

+ Somt alle talen en hun ISO 639-2 codes op welke gebruikt kunnen worden met + de --language + optie. + +

+ +
--list-stereo-modes + +

+ Lists all valid numbers & their corresponding symbolic names for the + --stereo-mode + option. + +

+ +
-l, --list-types + +

+ Somt invoer bestandstypen op. + +

+ +
--priority priority + +

+ Stelt het proces prioriteit in waarmee mkvmerge(1) zijn werk doet. Geldige + waarden zijn 'lowest', 'lower', + 'normal', 'higher' en + 'highest'. Is niets ingegeven dan wordt + 'normal' gebruikt. Op unix achtige systemen zal + mkvmerge(1) gebruiken de + nice(2) + functie. Daarom kan alléén de 'super' gebruiker die gebruiken + 'higher' en 'highest'. Op Windows zijn + alle waarden voor iedereen beschikbaar. + +

+ + +

Selecting 'lowest' also causes mkvmerge(1) to select idle + I/O priority in addition to the lowest possible process priority. +

+ +
--command-line-charset (karakterset) + +

+ Plaatst het karakter dat wordt geplaatst om de reeksen om te zetten die op + de commandoregel worden ingeven. Het is standaard aan het karakter van het + systeem en afhankelijk van het besturingssysteem locatie. Deze instellingen + zijn van toepassing op argumenten van de volgende opties: --title, --track-name + en --attachment-description. + +

+ +
--output-charset (karakterset) + +

+ Stelt het karakter set in, waarnaar de reeksen naar de uitvoer dienen te + worden geconverteerd. Standaard wordt gebruikt het karakter set die + afhankelijk is van wat er in uw besturingssysteem staat aangegeven + (locatie). + +

+ +
-r, --redirect-output + (bestandsnaam) + +

+ Schrijft alle berichten naar een bestand file-name + i.p.v. naar de 'apparaat/houder'. Terwijl dit gemakkelijk met uitvoer + omleiden kan worden gedaan er zijn gevallen waarin deze optie nodig is: + wanneer de verwerker e.e.a. herinterpreteert voordat het geschreven wordt + naar de uitvoer bestand. Het karakter set met --output-charset + is toegewezen. + +

+ +
--flush-on-close + +

+ Tells the program to flush all data cached in memory to storage when closing + files opened for writing. This can be used to prevent data loss on power + outages or to circumvent certain problems in the operating system or + drivers. The downside is that multiplexing will take longer as mkvmerge + will wait until all data has been written to the storage before exiting. + See issues #2469 and #2480 on the MKVToolNix bug tracker for in-depth + discussions on the pros and cons. + +

+ +
--ui-language code + +

+ Forces the translations for the language code to be + used (e.g. 'de_DE' for the German + translations). Entering 'list' as the + code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Tells the program to abort after the first warning is emitted. The program's + exit code will be 1. + +

+ +
--deterministic seed + +

+ Enables the creation of byte-identical files if the same version of + mkvmerge(1) is used with the same source files, the same set of options and + the same seed. Note that the "date" segment information field is not + written in this mode. + +

+ + +

The seed can be an arbitrary string and does not have to be a number.

+ + +

+ The result of byte-identical files is only guaranteed under the following + conditions: + +

+ + +
    + +
  1. + +

    The same version of mkvmerge(1) built with the same versions of libEBML and + libMatroska is used. +

    + +
  2. + + +
  3. + +

    The source files used are byte-identical.

    + +
  4. + + +
  5. + +

    The same command line options are used in the same order (with the notable + exception of --output …). +

    + +
  6. + +
+ + +

+ Using other versions of mkvmerge(1) or other command-line options may result + in the same byte-identical file but is not guaranteed to do so. + +

+ +
--title onderwerp + +

+ Zet debuggen aan voor een specifieke mogelijkheid. Dit is alleen zinvol voor + ontwikkelaars. + +

+ +
--tags feature + +

+ Zet experimentele mogelijkheden aan. Een lijst van beschikbare mogelijkheden + kan worden opgevraagd met mkvmerge --engage list. Deze + mogelijkheden zijn niet bedoeld in normale situaties. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that + can tell a controlling GUI what's happening. These messages follow the + format '#GUI#message'. The message may be followed by + key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the + messages nor the keys are ever translated and always output in English. + +

+ +
@options-file.json + +

+ Leest extra commandoregel informatie uit een bestand + options-file. Zie de sectie over: Optie bestanden voor meer informatie. + +

+ +
--capabilities + +

+ Somt informatie op over optionele mogelijkheden die zijn gecompileerd en + sluit af. De eerste uitvoer regel zal de versie informatie zijn. Alle + volgende informatie regels bevatten exact één woord, waarvan de aanwezigheid + aangeeft welke eigenschapen er binnenin zijn gecompileerd. Deze + mogelijkheden zijn: + +

+ + +
    + +
  • + +

    + 'FLAC' -- lezen raw FLAC bestanden en + behandelen van FLAC sporen in andere inhoudsmaten, + b.v. Ogg(tm) of Matroska(tm). + +

    + +
  • + +
+ +
-h, --help + +

+ Toon gebruik informatie en sluit af. + +

+ +
-V, --version + +

+ Toon versie informatie en sluit af. + +

+ +
+ + +

3. Gebruik

+ + +

+ Voor elk bestand kan de gebruiker selecteren welke sporen mkvmerge(1) zou + moeten nemen. Zij zitten allemaal in het bestand gespecificeerd met + -o. Een lijst met bekende (en ondersteunde) bron formaten + kunnen verkregen worden met de -l optie. + +

+ + +
+

Important:

+ +

+ De volgorde van het commando regel opties zijn belangrijk. Lees a.u.b. de + sectie over: "Optie + volgorde" als je nog onbekend bent met het programma. + +

+ +
+ +

4. Optie volgorde

+ + + +

+ Voor sommige opties is de volgorde waarin zij zijn opgegeven + belangrijk. Opties mislukken in twee categorieën: + +

+ + +
    + +
  1. + +

    + Opties die het programma beïnvloeden en niet verbonden zijn aan enig + invoerbestand. Deze omvatten maar zijn niet beperkt tot + --command-line-charset, --output of + --title. Deze mogen waar dan ook op de commandoregel staan. + +

    + +
  2. + + +
  3. + +

    + Opties die één enkel invoerbestand beïnvloedden of spoor in een + invoerbestand. Deze opties zijn allen van toepassing op het invoerbestand op + de commandoregel. Alle opties naar hetzelfde invoerbestand (of naar sporen + in hetzelfde invoerbestand) mogen in elke volgorde geschreven worden zolang + deze voor het invoerbestandsnaam staan. Voorbeelden die een invoerbestand + beïnvloedden zijn --no-chapters of + --chapter-charset. Voorbeelden voor een enkel spoor + --default-duration of --language. + +

    + +
  4. + +
+ + +

+ De opties worden uitgevoerd van links naar rechts. Indien er een optie + meerdere keren is, binnen hetzelfde gebied, dan wordt de laatste + gebruikt. Daarom zal de titel gezet worden naar "Iets anders" in + het volgende voorbeeld: + +

+ +
$ mkvmerge -o output.mkv --title 'Dit én Dat' input.avi --title 'Iets anders'
+ +

+ Het volgende voorbeeld toont dat het gebruiken van de optie + --language tweemaal OK is, omdat zij andere gebieden + gebruiken. Hoewel zij tot hetzelfde spoor ID behoren maar van verschillende + invoer bestanden en daarom verschillende gebieden hebben: + +

+ +
$ mkvmerge -o output.mkv --language 0:fre français.ogg --language 0:deu deutsch.ogg
+

5. Voorbeelden

+ + +

+ Laten we aannemen dat je een bestand genoemd hebt mijn film.avi en het audio + spoor in een ander bestand, b.v. 'mijn film.wav'. Dan wil + je eerst de audio coderen naar OggVorbis(tm): + +

+ +
$ oggenc -q4 -oMyMovie.ogg MyMovie.wav
+ +

+ Na een paar minuten kan je de video en audio samenvoegen: + +

+ +
$ mkvmerge -o mijn film-met-geluid.mkv mijn film.avi mijn film.ogg
+ +

+ Als jouw AVI al een audio spoor bevat dan wordt ook die + gekopieerd (als mkvmerge(1) dat audio formaat ondersteunt). Om dat te + voorkomen doe simpel + +

+ +
$ mkvmerge -o mijn film-met-geluid.mkv -A mijn film.avi mijn film.ogg
+ +

+ Na een paar minuten van wikken en wegen rip je een ander audio spoor, + b.v. de regisseur zijn commentaar of een andere taal naar 'mijn + film-voegtoe-geluid.wav'. Codeer het opnieuw en voeg het samen met + het andere bestand: + +

+ +
$ oggenc -q4 -omijn film-voegtoe-geluid.ogg mijn film-voegtoe-geluid.wav
+$ mkvmerge -o MM-complete.mkv mijn film-met-geluid.mkv mijn film-voegtoe-geluid.ogg
+ +

+ Hetzelfde resultaat kan worden verkregen met + +

+ +
$ mkvmerge -o MM-complete.mkv -A mijn film.avi mijn film.ogg mijn film-voegtoe-geluid.ogg
+ +

+ Nu mplayer(tm) opstarten en geniet. Als je meerdere + audio sporen hebt (of zelfs video sporen) dan kan je aangeven aan + mplayer(tm) welk spoor af te spelen met het + '-vid' en '-aid' opties. Deze zijn 0 + gebaseerd en maken geen onderscheid tussen video en audio. + +

+ + +

+ Indien het nodig is een audio spoor te synchroniseren kan je dat héél + makkelijk doen. Achterhaal eerst welk spoor ID het Vorbis spoor bevat + +

+ +
$ mkvmerge --identify outofsync.ogg
+ +

+ Nu kan je dat ID gebruiken voor de volgende commandoregel: + +

+ +
$ mkvmerge -o goodsync.mkv -A source.avi -y 12345:200 outofsync.ogg
+ +

+ Dit zou toevoegen 200ms aan stilte aan het begin van het spoor met het ID + 12345 genomen van 'outofsync.ogg'. + +

+ + +

+ Sommige films starten correct gesynchroniseerd maar langzaam aan verloopt + dat. Voor dit soort films kan je een vertraag factor opgeven die worden + toegevoegd aan alle tijd codes -- Er wordt géén data toegevoegd of + verwijderd. Dus, als je die factor te klein of te groot maakt dan krijg je + een slecht resultaat. Een voorbeeld is, dat een episode die ik heb + getranscodeerd met 0.2 seconden uit sync aan het eind + van de film, welke 77340 beelden lang was. Bij + 29.97fps seconden ongeveer corresponderen met + 0.2 seconden. 6 beelden. Dus ik + deed + +

+ +
$ mkvmerge -o goodsync.mkv -y 23456:0,77346/77340 outofsync.mkv
+ +

+ Het resultaat was goed. + +

+ + +

+ De sync opties kunnen ook op de zelfde manier gebruikt worden voor + ondertitels. + +

+ + +

+ Voor tekst ondertitels kan je één van beide Windows programma's gebruiken + (zoals SubRipper(tm)) of het + subrip(tm) pakket te vinden in + transcode(1)'s + bronnen in de 'contrib/subrip' map. Het algemene proces + is: + +

+ + +
    + +
  1. + +

    pak een raw ondertiteling uit van de bron:

    +
    $ tccat -i /path/to/copied/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o mymovie
    +
  2. + + +
  3. + +

    converteer het resultaat PGM beeld/plaatje naar tekst met het 'GOCR' + programma: +

    +
    $ pgm2txt mymovie
    +
  4. + + +
  5. + +

    spellingscontrole voor de resulterende tekst bestanden:

    +
    $ ispell -d american *txt
    +
  6. + + +
  7. + +

    converteer de tekst bestanden naar een SRT bestand:

    +
    $ srttool -s -w -i mymovie.srtx -o mymovie.srt
    +
  8. + +
+ + +

+ Het resultaat bestand kan gebruikt worden als een ander invoerbestand voor + mkvmerge(1): + +

+ +
$ mkvmerge -o mymovie.mkv mymovie.avi mymovie.srt
+ +

+ Als je een taal wilt opgeven voor een gegeven spoor kan dit héél makkelijk + gedaan worden. Zoek eerst de ISO 639-2 code voor jouw taal. mkvmerge(1) kan + alle codes uitlijsten voor je: + +

+ +
$ mkvmerge --list-languages
+ +

+ Zoek in de lijst naar de taal die je nodig hebt. Laten we aannemen dat je + twee audio sporen aan het Matroska(tm) bestand wilt invoegen en je hun + taalcodes wilt instellen terwijl hun spoor ID's zijn 2 en 3. Dit kan gedaan + worden met + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut without-lang-codes.mkv
+ +

+ Zoals je kunt zien, kan je de --language + schakelaar meerdere keren gebruiken. + +

+ + +

+ Misschien zou je het ook fijn vinden dat de af speler standaard de + Nederlandse taal gebruikt. Als je ook nog extra ondertitelingen hebt zoals + b.v. Engels, Frans, en je wilt dat de af speler de Franse als standaard + gebruikt. Kan je dit doen met + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut --default-track-flag 3 without-lang-codes.mkv --language 0:eng english.srt --default-track-flag 0 --language 0:fre french.srt
+ +

+ Als je de taal of de standaard spoor markering niet ziet, welke je had + opgegeven in mkvinfo(1)'s uitvoer lees dan a.u.b. de sectie over: Standaard waarden. + +

+ + +

+ Zet de compressie uit voor een invoer bestand + +

+ +
$ mkvmerge -o no-compression.mkv --compression -1:none MyMovie.avi --compression -1:none mymovie.srt
+ +

6. Spoor ID's

+ + + +

6.1. Regular track IDs

+ + + +

+ Sommige opties voor mkvmerge(1) hebben een spoor ID nodig, om aan te geven op + welk spoor zij zouden moeten worden toegepast. Die spoor ID's worden getoond + door de lezers bij het samenvoegen van het huidige invoer bestand, of als + mkvmerge(1) is opgeroepen met de --identify + optie. Een voorbeeld van een dergelijke uitvoer: + +

+ +
$ mkvmerge -i v.mkv
+File 'v.mkv': container: Matroska
+Track ID 0: video (V_MS/VFW/FOURCC, DIV3)
+Track ID 1: audio (A_MPEG/L3)
+ +

+ Verwar de spoor ID's niet met welke zijn toegewezen aan spo(o)r(en) in het + uitvoer MKV bestand met het spoor ID van het invoerbestand. Alleen het + invoerbestand spoor ID's worden gebruikt voor opties die deze waarde nodig + hebben. + +

+ + +

+ Opmerking: Dat elk invoerbestand zijn eigen spoor ID's heeft. Daarom het + spoor ID voor bestand 'file1.ext gerapporteerd wordt + door 'mkvmerge --identify' verander niets, ongeacht + hoeveel invoerbestanden in welke positie dan ook + 'file1.ext' wordt gebruikt. + +

+ + +

+ Spoor ID's worden toegewezen zoals dit: + +

+ + +
    + +
  • + +

    + AVI bestanden: Het video spoor heeft het ID 0. De audio + sporen krijgen de ID's in oplopende volgorde beginnend bij 1. + +

    + +
  • + + +
  • + +

    + AAC, AC-3, MP3, + SRT en WAV bestanden: Het 'spoor' in dat + bestand krijgt het ID 0. + +

    + +
  • + + +
  • + +

    + Meeste andere bestanden: De spoor ID's worden toegekend volgens de volgorde + zoals het gevonden is in het bestand startend bij 0. + +

    + +
  • + +
+ + +

+ De opties die de spoor ID's gebruiken zijn degenen die de beschrijvingen + bevatten 'TID'. De volgende optie gebruikt het spoor ID + ook: --audio-tracks, --video-tracks, + --subtitle-tracks, --button-tracks en + --track-tags. + +

+ + + +

6.2. Special track IDs

+ + + +

+ There are several IDs that have special meaning and do not occur in the + identification output. + +

+ + +

+ Het speciale spoor ID '-1' is de 'joker' en past de + bepaalde schakelaar toe op alle sporen die van een invoerbestand worden + gelezen. + +

+ + +

+ The special track ID '-2' refers to the chapters in a + source file. Currently only the --sync option uses this + special ID. As an alternative to --sync -2:… the option + --chapter-sync … can be used. + +

+ + +

7. Language handling

+ + + +

+ Matroska(tm) has support for two different types of language elements: the + old, deprecated "Language" element containing ISO 639-2 alpha 3 codes and + the new "LanguageIETF" tags containing IETF BCP 47 language tags. All of + mkvmerge(1)'s options that accept a language accept a BCP 47 language + tag. mkvmerge(1) will derive the value for the deprecated "Language" element + from the BCP 47 language tags wherever possible. + +

+ + +

+ When identifying a file in JSON mode, existing "LanguageIETF" track header + elements will be output as the language_ietf track + property. + +

+ + +

+ When writing a file mkvmerge(1) will always write the "LanguageIETF", + "ChapLanguageIETF" and "TagLanguageIETF" elements (the latter two only if + chapters or tags are written respectively). In addition to those elements + the corresponding old elements will be written; they'll be set to the ISO + 639-2 code portion of the BCP 47 language tag. For example, when the track + language is set to sr-Cyrl-RS "LanguageIETF" will be set + to sr-Cyrl-RS and the old "Language" element will be set + to srp. + +

+ + +

+ When reading existing files (Matroska files, XML chapter or tag files etc.) + that already contain "…LanguageIETF" elements the existing elements will be + kept. Otherwise "…LanguageIETF" elements will be added based on command-line + options and other existing deprecated "…Language" elements. + +

+ + +

+ The creation of the new elements can be disabled completely with the + command-line option --disable-language-ietf which operates + on all three new elements. + +

+ + +

+ You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. + +

+ +

8. Tekst bestanden en karakter set conversies

+ + +
+

Note:

+ +

+ Deze sectie is van toepassing op alle programma's in MKVToolNix zelfs + wanneer alléén mkvmerge(1) genoemd wordt. + +

+ +
+ + +

8.1. Introductie

+ + +

+ Alle teksten in Matroska(tm) bestanden zijn gecodeerd in UTF-8. Dit betekend, + dat mkvmerge(1) alle de te lezen tekst bestanden moet converteren en evenals + elke ingegeven tekst op de commandoregel om elk karakter te zetten naar + UTF-8. Teruggekoppeld betekend dit ook, dat mkvmerge(1)'s uitvoer terug + geconverteerd moet worden naar die karakter set van UTF-8, b.v. als een niet + Engelse vertaling is gebruikt met --ui-languages + of voor de originele tekst uit een Matroska(tm) bestand. + +

+ + +

+ mkvmerge(1) doet deze conversie automatisch gebaseerd op de aanwezigheid van + een Byte Order Marker (byte volgorde markering) (kort: BOM) + of op basis van het huidige besturingssysteem locatie. Hoe het karakter van + de locatie wordt 'achterhaald' hangt af van het besturingssysteem waarop + mkvmerge(1) is opgestart. + +

+ + + +

8.2. Byte order markers (BOM)

+ + + +

+ Tekst bestanden die starten met BOM (byte volgorde markering) zijn al + gecodeerd in de vertegenwoordiging van UTF. mkvmerge(1) ondersteund één van + de volgende vijf modes: UTF-8, UTF-16 Little en Big Endian, UTF-32 Little en + Big Endian. Tekst bestanden met een BOM (byte volgorde markering) worden + automatisch geconverteerd naar UTF-8. Elke van de parameters die gezet + zouden zijn voor een dergelijk bestand (b.v. --sub-charset) + worden stilletjes genegeerd. + +

+ + + +

8.3. Linux and Unix-like systems including macOS

+ + + +

+ Op Unix-achtige systemen gebruikt mkvmerge(1) de + setlocale(3) + besturingssysteem oproep, welke beurtelings de omgevingsvariabelen gebruikt + LANG, LC_ALL en + LC_CYPE. Het resulterende karakter set is vaak één van de + UTF-8 of de ISO-8859-* familie en wordt gebruikt voor alle tekst bestand + operaties en voor het coderen van reeksen op de commandoregel voor een + uitvoer naar de apparaat/houder. + +

+ + + +

8.4. Windows

+ + + +

+ On Windows the default character set used for converting text files is + determined by a call to the GetACP() system call. + +

+ + +

+ Reading the command line is done with the + GetCommandLineW() function which already returns a + Unicode string. Therefore the option --command-line-charset + is ignored on Windows. + +

+ + +

+ Output to the console consists of three scenarios: + +

+ + +
    + +
  1. + +

    + If the output is redirected with the option --redirect-output + then the default charset is UTF-8. This can be changed with --output-charset. + +

    + +
  2. + + +
  3. + +

    + If the output is redirected with cmd.exe itself, + e.g. with mkvinfo file.mkv > info.txt, then the + charset is always UTF-8 and cannot be changed. + +

    + +
  4. + + +
  5. + +

    + Otherwise (when writing directly to the console) the Windows function + WriteConsoleW() is used and the option --output-charset + is ignored. The console should be able to output all Unicode characters for + which the corresponding language support is installed (e.g. Chinese + characters might not be displayed on English Windows versions). + +

    + +
  6. + +
+ + + +

8.5. Command line options

+ + + +

+ Als de volgende optie aanwezig is dan is het toegestaan het karakter set te + specificeren: + +

+ + +
    + +
  • + +

    + --sub-charset + voor tekst ondertitels en tekst ondertitel sporen opgeslagen in de houder + formaat waarvan de karakter set niet onomstotelijk kan worden vastgesteld + (b.v. Ogg bestanden), + +

    + +
  • + + +
  • + +

    + --chapter-charset + voor tekst hoofdstuk bestanden en voor hoofdstukken en bestand titels + opgeslagen in de houder formaat waarvan de karakter set niet onomstotelijk + kan worden vastgesteld (b.v. Ogg bestanden voor hoofdstuk informatie, spoor + en bestand titels etc.; MP4 bestanden voor hoofdstuk informatie), + +

    + +
  • + + +
  • + +

    + --command-line-charset + voor alle ingaven op de commandoregel, + +

    + +
  • + + +
  • + +

    + --output-charset + for all strings written to the console or to a file if the output has been + redirected with the --redirect-output + option. On non-Windows systems the default for the output charset is the + system's current charset. On Windows it defaults to UTF-8 both for + redirecting with --redirect-output + and with cmd.exe itself, e.g. mkvinfo file.mkv + > info.txt. + +

    + +
  • + +
+ + +

9. Optie bestanden

+ + + +

+ Een optiebestand is een mkvmerge(1) bestand; waaruit extra commandoregel + argumenten gelezen kunnen worden Dit kan worden gebruikt om bepaalde + beperkingen van het dos scherm of het besturingssysteem bij het uitvoeren + van externe programma's zoals een beperkte opdrachtregel lengte te omzeilen. + +

+ + +

+ An option file contains JSON-formatted data. Its content must be a valid + JSON array consisting solely of JSON strings. The file's encoding must be + UTF-8. The file should not start with a byte order marker + (BOM), but if one exists, it will be skipped. + +

+ + +

+ The rules for escaping special characters inside JSON are the ones in the + official JSON specification, RFC 7159. + +

+ + +

+ The option file's name itself must be specified as a command line argument + prefixed with a '@' character. + +

+ + +

+ The command line 'mkvmerge -o "my file.mkv" -A "a movie.avi" + sound.ogg' could be converted into the following JSON option file + called e.g. 'options.json': + +

+ +
[
+  "-o",
+  "c:\\Matroska\\my file.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "a movie.avi",
+  "sound.ogg"
+]
+ +

+ The corresponding command would then be 'mkvmerge + @options.json'. + +

+ +

10. Bestand linken

+ + +

+ Matroska(tm) ondersteunt bestand linken welke eenvoudig zegt, dat een + specifiek bestand de voorganger of de opvolger van het huidige bestand + is. Om precies te zijn, het zijn niet echt de bestanden die gelinkt zijn + maar de Matroska(tm) segmenten. En de meeste bestanden bevatten alleen één + Matroska(tm) segment de volgende uitleg gebruikt de term 'bestand linken' + hoewel 'segment linken' meer op zijn plaats zou zijn. + +

+ + +

+ Elk segment wordt geïdentificeerd door een uniek 128 bit lang segment + UID. Dit UID wordt automatisch gegenereerd door mkvmerge(1). Het linken wordt + primair gedaan via het zetten van het segment UID's (kort: + SID) van het volgende/vorige bestand naar het segment kop + informatie. mkvinfo(1) print deze SID's als het hen vindt. + +

+ + +

+ Als een bestand wordt gesplitst in meerdere kleinere bestanden en linken + wordt gebruikt, dan zullen de tijd codes niet opnieuw starten op 0 maar + doorgaan op daar waar het vorige bestand eindigde. Op deze manier zal + absolute de tijd code behouden blijven, zelfs wanneer het vorige bestand + niet aanwezig/beschikbaar is (b.v. bij 'streaming'). Als er géén linken is + gebruikt, dan zouden de tijd codes moeten starten op 0 voor elk + bestand. Standaard gebruikt mkvmerge(1) bestand linken niet. Als je wilt kan + je dit aanzetten met de --link optie. Deze optie is alléén + nuttig wanneer ook het splitsen actief is. + +

+ + +

+ Ongeacht of het splitsen actief is of niet, de gebruiker kan mkvmerge(1) + vertellen het geproduceerde bestand te linken naar een specifieke + SID's. Dit wordt bereikt met de opties + --link-to-previous en --link-to-next. Deze + opties accepteren een segment SID in het formaat dat + mkvinfo(1) uitvoert: 16 hexadecimale nummers tussen 0x00 + en 0xff voorgevoegd met '0x' elk, + b.v. '0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 0x5e + 0xca 0xb3 0x93'. Als alternatief kan een kortere vorm worden + gebruikt: 16 hexadecimale nummers tussen 0x00 en + 0xff zonder de '0x' voorvoegsel en + zonder spaties, b.v. '41da7366d9cfb21eae78ebb45ecab393'. + +

+ + +

+ Als splitsen wordt gebruikt, dan is het eerste bestand gelinkt naar het + SID gegeven met --link-to-previous en het + laatste bestand is gelinkt naar SID gegeven met + --link-to-next. Als splitsen niet is gebruikt, dan zal één + uitvoer bestand worden gelinkt met twee van de beide SIDs. + +

+ +

11. Standaard waarden

+ + +

+ De Matroska(tm) de specificatie verklaart dat sommige elementen een standaard + waarde hebben. Gewoonlijk wordt een element niet naar het bestand geschreven + als het niet gelijk is aan de standaard waarde, dit om ruimte te + besparen. De elementen die gebruiker zou kunnen missen in mkvinfo(1)'s + uitvoer, zijn de language (taal) en de + default track flag (standaard spoor markering) elementen. De + standaard waarde voor de language (taal) is English + (is Engels) ('eng'), en de standaard waarde voor de + standard track flag (standaard spoor markering) is + true (waar). Als je daarom gebruikt de + --language 0:eng voor een spoor, dan zal deze niet + verschijnen in de mkvinfo(1)'s uitvoer. + +

+ +

12. Bijlagen

+ + +

+ Misschien wilt u ook sommige foto's samen met uw Matroska(tm) bestand houden + of je gebruikt SSA ondertitels en je wilt een speciaal + TrueType(tm) lettertype(n) gebruiken welke zeldzaam + zijn. In deze gevallen kan je deze bestanden vastmaken aan het Matroska(tm) + bestand. Zij zullen niet enkel bijgevoegd worden aan het bestand maar er + ingevoegd worden. Een af speler kan deze bestanden tonen (de 'foto' + gevallen) of hen gebruiken om de ondertitels te genereren (de + 'TrueType(tm) lettertype' gevallen). + +

+ + +

+ Hier is een voorbeeld hoe een foto en een + TrueType(tm) lettertype aan het uitvoerbestand kan + vast te maken: + +

+ +
$ mkvmerge -o output.mkv -A video.avi sound.ogg \
+  --attachment-description "Me and the band behind the stage in a small get-together" \
+  --attachment-mime-type image/jpeg \
+  --attach-file me_and_the_band.jpg \
+  --attachment-description "The real rare and unbelievably good looking font" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file really_cool_font.ttf
+ +

+ Als een Matroska(tm) bestandsbijlage bevat en is gebruikt als een invoer + bestand dan zal mkvmerge(1) de bijlage kopiëren naar een nieuw bestand. De + selectie, welke bijlage wordt gekopieerd en welke niet kan veranderd worden + met de opties --attachments + en --no-attachments. + +

+ +

13. Hoofdstukken

+ + +

+ Het Matroska(tm) hoofdstuk systeem is krachtiger dan het oude bekende systeem + van OGM bestanden. De volledige specificatie kan gevonden + worden op de Matroska + website. + +

+ + +

+ mkvmerge(1) ondersteunt twee soorten van hoofdstuk bestanden als invoer. Het + eerste formaat, genoemd 'simpel hoofdstuk format', is hetzelfde format dat + het OGM hulpmiddel verwacht. Het tweede format is een XML + gebaseerd hoofdstuk format welke alle Matroska(tm)'s hoofdstuk + functionaliteiten ondersteunt. + +

+ + +

+ Apart from dedicated chapter files mkvmerge(1) can also read chapters from + other file formats (e.g. MP4, Ogg, Blu-rays or DVDs). + +

+ + +

13.1. Een eenvoudig hoofdstuk formaat

+ + + +

+ Dit formaat bestaat uit twee paren van regels die respectievelijk starten + met 'CHAPTERxx=' en + 'CHAPTERxxNAME='. De eerste bevat de start tijd code en + de tweede bevat de titel. Hier is een voorbeeld: + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=Intro
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=Baby prepares to rock
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=Baby rocks the house
+ +

+ mkvmerge(1) will transform every pair or lines into one Matroska(tm) + ChapterAtom. It does not set any + ChapterTrackNumber which means that all chapters + apply to all tracks in the file. + +

+ + +

+ Omdat dit een tekst bestand is kan karakter set conversie nog nodig + zijn. Zie de sectie over: Tekst bestanden en karakter set + conversies voor een uitleg hoe mkvmerge(1) converteert tussen karakter + sets. + +

+ + + +

13.2. Het XML gebaseerde hoofdstuk formaat

+ + +

+ Het XML gebaseerde hoofdstuk formaat lijkt op dit voorbeeld: + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>A short chapter</ChapterString>
+        <ChapterLanguage>eng</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>A part of that short chapter</ChapterString>
+          <ChapterLanguage>eng</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ Met deze format zijn drie dingen mogelijk die niet mogelijk zijn met het + simpele hoofdstuk format: + +

+ + +
    + +
  1. +

    De tijdmarkering voor het hoofdstuk eind kan ingegeven worden,

    +
  2. + +
  3. +

    Hoofdstukken mogen ingekapseld zijn

    +
  4. + +
  5. +

    De taal en het land mogen ingesteld worden

    +
  6. + +
+ + +

+ De mkvtoolnix distributie bevat meerdere voorbeeld bestanden in de + doc sub map welke als basis gebruikt kan worden. + +

+ + +

+ Hieronder vindt u de ondersteunde XML-markeringen, hun data types en, in + voorkomend geval, het geldige bereik voor hun waarden: + +

+ +
Chapters (master)
+  EditionEntry (master)
+    EditionUID (unsigned integer, valid range: 1 <= value)
+    EditionFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagDefault (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagOrdered (unsigned integer, valid range: 0 <= value <= 1)
+    ChapterAtom (master)
+      ChapterAtom (master)
+      ChapterUID (unsigned integer, valid range: 1 <= value)
+      ChapterTimeStart (unsigned integer)
+      ChapterTimeEnd (unsigned integer)
+      ChapterFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterFlagEnabled (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterSegmentUID (binary, valid range: 1 <= length in bytes)
+      ChapterSegmentEditionUID (unsigned integer, valid range: 1 <= value)
+      ChapterPhysicalEquiv (unsigned integer)
+      ChapterTrack (master)
+        ChapterTrackNumber (unsigned integer, valid range: 1 <= value)
+      ChapterDisplay (master)
+        ChapterString (UTF-8 string)
+        ChapterLanguage (UTF-8 string)
+        ChapterCountry (UTF-8 string)
+      ChapterProcess (master)
+        ChapterProcessCodecID (unsigned integer)
+        ChapterProcessPrivate (binary)
+        ChapterProcessCommand (master)
+          ChapterProcessTime (unsigned integer)
+          ChapterProcessData (binary)
+ + +

13.3. Reading chapters from Blu-rays

+ + + +

+ mkvmerge(1) can read chapters from unencrypted Blu-rays. For that you can use + the path to one of the MPLS play lists with the + --chapters parameter. + +

+ + +

+ Example: --chapters + /srv/blurays/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. Reading chapters from DVDs

+ + + +

+ When MKVToolNix is compiled with the libdvdread(tm) + library, mkvmerge(1) can read chapters from DVDs. For that you can use the + path to one of the folders or files on the DVD with the + --chapters parameter. As DVDs can contain more than + one title and each title has its own set of chapters, you can append a colon + and the desired title number to the end of the file name argument. The title + number defaults to 1. + +

+ + +

+ Example: --chapters /srv/dvds/BigBuckBunny/VIDEO_TS:2 + +

+ + + +

13.5. Algemene opmerkingen

+ + +

+ Bij het splitsen van bestanden dan zal mkvmerge(1) tevens de hoofdstukken + juist bijstellen. Dit betekent, dat elk bestand slechts de hoofdstukingangen + omvat waarop het van toepassing is, en dat de tijd codes worden + gecompenseerd om te voldoen aan de nieuwe tijd codes van elk uitvoer + bestand. + +

+ + +

+ mkvmerge(1) is in staat hoofdstukken te kopiëren van Matroska(tm) bronbestanden + tenzij dit expliciet is uitgezet met de --no-chapters + optie. De hoofdstukken van alle bronnen (Matroska(tm) bestanden, Ogg + bestanden, MP4 bestanden, hoofdstuk tekst bestanden) worden + gewoonlijk niet samengevoegd maar eindigen als een gescheiden + ChapterEditions. Alleen wanneer de hoofdstukken + worden gelezen van verschillende Matroska(tm) of XML bestanden die dezelfde + editie UID's delen, zullen hoofdstukken samengevoegd worden tot één + ChapterEdition. Als een dergelijke samenvoeging ook + in andere situaties gewenst is, dan dient de gebruiker de hoofdstukken eerst + te extraheren uit alle bronnen met mkvextract(1), handmatig de XML + bestanden aaneenkoppelen en nadien samenvoegen. + +

+ + +

14. Markeringen

+ + + +

14.1. Introductie

+ + + +

+ Matroska(tm)'s tag system is similar to that of other containers: a set of + KEY=VALUE pairs. However, in Matroska(tm) these tags + can also be nested, and both the KEY and the + VALUE are elements of their own. The example file + example-tags-2.xml shows how to use this system. + +

+ + + +

14.2. Gebied van de markeringen

+ + + +

+ Matroska(tm) markeringen worden niet automatisch toegekend aan het hele + bestand. Dat kunnen zij, maar zij kunnen ook op verschillende delen van het + bestand van toepassing zijn: aan één of meerdere sporen, aan één of meerdere + hoofdstukken, of zelfs een combinatie van beide. De Matroska + specificaties geeft meer informatie over dit feit. + +

+ + +

+ Eén belangrijk feit is, dat markeringen gelinkt zijn naar sporen of + hoofdstukken met de Targets Matroska(tm) markeer + element, en dat de gebruikte UID's voor dit linken niet + zijn, de spoor ID's die overal door mkvmerge(1) gebruikt worden. In plaats + daarvan, zijn de gebruikte UID's nummers welke mkvmerge(1) automatisch + uitrekent (als het spoor genomen is anders dan van een Matroska(tm) + bestandsformat) of welke zijn gekopieerd van een bronbestand, als de sporen + bronbestand een Matroska(tm) bestand is. Daarom is het moeilijk te bepalen, + welke UID's te gebruiken in het markeer bestand voordat het bestand wordt + overgedragen naar mkvmerge(1). + +

+ + +

+ mkvmerge(1) kent twee opties waarmee je markeringen kunt toevoegen aan + Matroska(tm) bestanden: De --global-tags + en de --tags + opties. Het verschil is dat de vroegere optie, --global-tags, + de markeringen zal maken die op het volledige bestand van toepassing zijn, + door te verwijderen (welke dan ook) Targets elementen + hierboven genoemd. De laatstgenoemde optie, --tags, voegt + automatisch het UID die mkvmerge(1) genereert voor de markering + gespecificeerd met het TID deel van de--tags opties. + +

+ + + +

14.3. Voorbeeld

+ + +

+ Laten we aannemen, dat je een markering wilt toevoegen aan een video spoor + gelezen van een AVI. mkvmerge --identify + file.avi vertelt je, dat het video spoor ID (verwar dit ID niet + met het UID!) 0 is. Zodat het jouw markeer bestand kan creëren, laat weg + alle Targets elementen en start mkvmerge(1) op: + +

+ +
$ mkvmerge -o file.mkv --tags 0:tags.xml file.avi
+ + +

14.4. Markeer bestandsformaat

+ + +

+ mkvmerge(1) ondersteunt een XML gebaseerde markeer bestand format. Het + format is rijkelijk gedocumenteerd op de Matroska + specificaties. Beide, zowel het binaire evenals de bron distributies van + MKVToolNix komen met een voorbeeld bestand genaamd + example-tags-2.xml welke simpelweg alle bekende + markeringen opsomt, welke gebruikt kunnen worden als basis voor 'echte + leven' markeringsbestanden. + +

+ + +

+ De basis is: + +

+ + +
    + +
  • +

    Het buitenste element moet zijn <Tags>. +

    +
  • + +
  • + +

    Eén logische markering welke binnenin één paar bevindt van + <Tag> XML markeringen. +

    + +
  • + +
  • +

    Spaties direct voor en na een markering worden genegeerd.

    +
  • + +
+ + + +

14.5. Data typen

+ + +

+ Het nieuwe Matroska(tm) markeer systeem kent alléén twee data typen, een UTF-8 + reeks en een binair type. De eerste wordt gebruikt voor markeer namen en het + <String> element terwijl het binaire type + gebruikt word voor het <Binary> element. + +

+ + +

+ Aangezien binaire gegevens zelf niet zouden passen in een XML bestand, + ondersteunt mkvmerge(1) twee andere methoden om binaire data op te slaan. Als + de inhoud van een XML markering start met '@' dan wordt + de volgende tekst behandeld als een bestandsnaam. De corresponderende + bestandsinhoud wordt gekopieerd in een Matroska(tm) element. + +

+ + +

+ Anders zou de gegeven data moeten zijn een gecodeerde Base64. Dit is een + codering die binaire data codeert naar een gelimiteerde set van + ASCII karakters en wordt gebruikt in b.v. email + programma's. mkvextract(1) zal uitvoeren Base64 gecodeerde data voor binaire + elementen. + +

+ + +

+ Het verouderde markeer systeem kent een paar meer data typen welke gevonden + kunnen worden in de officiële Matroska(tm) markeer specificaties. Aangezien in + mkvmerge(1) dit systeem niet meer wordt ondersteund, worden deze typen hier + niet beschreven. + +

+ + + +

14.6. Bekende markeringen voor het XML bestandsformaat

+ + + +

+ Hieronder vindt u de ondersteunde XML-markeringen, hun data types en, in + voorkomend geval, het geldige bereik voor hun waarden: + +

+ +
Tags (master)
+  Tag (master)
+    Targets (master)
+      TargetTypeValue (unsigned integer)
+      TargetType (UTF-8 string)
+      TrackUID (unsigned integer)
+      EditionUID (unsigned integer)
+      ChapterUID (unsigned integer)
+      AttachmentUID (unsigned integer)
+    Simple (master)
+      Simple (master)
+      Name (UTF-8 string)
+      TagLanguage (UTF-8 string)
+      DefaultLanguage (unsigned integer)
+      String (UTF-8 string)
+      Binary (binary)
+ +

15. Segment informatie

+ + + +

+ Met een segment informatie XML bestand is het mogelijk om bepaalde waarden + in te stellen in het "segment informatie" kop veld van een + Matroska(tm) bestand. Al deze waarden kunnen niet worden ingesteld via andere + commando regel opties. + +

+ + +

+ Overige "segment informatie" kopvelden kunnen gezet worden via de + commandoregel opties maar niet via een XML bestand. Inclusief b.v. de + --title + en de --timestamp-scale + opties. + +

+ + +

+ Er zijn nog andere elementen die kunnen worden ingesteld noch via + commandoregel opties, noch via de XML-bestanden. Deze bevatten de volgende + elementen: DateUTC (ook bekend als "muxing + date"), MuxingApp, WritingApp en + Duration. Ze worden altijd gezet door mkvmerge(1) zelf. + +

+ + +

+ Hieronder vindt u de ondersteunde XML-markeringen, hun data types en, in + voorkomend geval, het geldige bereik voor hun waarden: + +

+ +
Info (master)
+  SegmentUID (binary, valid range: length in bytes == 16)
+  SegmentFilename (UTF-8 string)
+  PreviousSegmentUID (binary, valid range: length in bytes == 16)
+  PreviousSegmentFilename (UTF-8 string)
+  NextSegmentUID (binary, valid range: length in bytes == 16)
+  NextSegmentFilename (UTF-8 string)
+  SegmentFamily (binary, valid range: length in bytes == 16)
+  ChapterTranslate (master)
+    ChapterTranslateEditionUID (unsigned integer)
+    ChapterTranslateCodec (unsigned integer)
+    ChapterTranslateID (binary)
+

16. Matroska bestand layout

+ + +

+ Het Matroska(tm) layout bestand is redelijk flexibel. mkvmerge(1) zal een + bestand genereren op een vooraf gedefinieerde manier. Het resultaat zal er + zo uitzien: + +

+ + +

+ [EBML head] [segment {meta seek #1} [segment information] [track + information] {attachments} {chapters} [cluster 1] {cluster 2} ... {cluster + n} {cues} {meta seek #2} {tags}] + +

+ + +

+ De elementen in gekromde haakjes zijn optioneel en afhankelijk van de inhoud + en de gebruikte opties. Een paar opmerkingen: + +

+ + +
    + +
  • + +

    + meta zoek #1 bevat slechts een klein aantal aan niveau 1 elementen, en + alleen als deze ook werkelijk bestaan: bijlagen, hoofdstukken, volg + document(en) (cue), markeringen, meta zoek #2. Oudere versies van mkvmerge(1) + zijn tevens gewend om clusters binnenin het meta zoek element te + plaatsen. Daarom was het noodzakelijk ietwat onnauwkeurig te gokken om + genoeg ruimte te reserveren. Het faalde vaak. Nu worden alleen clusters + opgeslagen in het meta zoek #2, en meta zoek #1 verwijst naar het meta zoek + element #2. + +

    + +
  • + + +
  • + +

    Bijlage, hoofdstuk en markeer elementen zijn alléén aanwezig indien zij + waren toegevoegd. +

    + +
  • + +
+ + +

+ Het kortst mogelijke Matroska(tm) bestand zou lijken op dit: + +

+ + +

+ [EBML head] [segment [segment information] [track information] [cluster 1]] + +

+ + +

+ Dit kan het geval zijn voor alléén-audio bestanden. + +

+ +

17. Externe tijd code bestanden

+ + +

+ mkvmerge(1) staat de gebruiker toe, de tijd codes voor een specifiek spoor + zelf te kiezen. Dit kan worden gebruikt, om bestanden met de variabele video + beeld verhouding te creëren of 'gaten' in audio te laten bevatten. Een beeld + in dit geval, is de unit welke mkvmerge(1) afzonderlijk creëert per + Matroska(tm) blok. Voor video is dit exact één beeld, voor audio is dit één + pakket van het specifieke audio type b.v. voor AC-3 zou dit + een pakket moeten zijn inhoudende 1536 voorbeelden. + +

+ + +

+ Tijd code bestanden die worden gebruikt wanneer de sporen aan elkaar worden + toegevoegd, moeten alleen voor het eerste deel in een reeks van sporen + worden gespecificeerd. Bijvoorbeeld, als je twee bestanden toevoegt, v1.avi + en v2.avi, en je wilt tijd codes gebruiken dan moet je commandoregel lijken + op dit: + +

+ +
$ mkvmerge ... --timestamps 0:my_timestamps.txt v1.avi +v2.avi
+ +

+ Er zijn vier formaten die worden herkend door mkvmerge(1). De eerste regel + bevat altijd het versie nummer. Lege regels, regels alleen bevattende + spaties en regels beginnend met '#' worden genegeerd. + +

+ + +

17.1. Tijd code bestandsformaat v1

+ + +

+ Dit format start met de versie regel. De tweede regel verklaart het aantal + beelden per seconde. Alle volgende regels bevatten drie nummers gescheiden + door een komma: het start beeld (0 is het eerste + beeld), het eind beeld en het aantal beelden binnen dit bereik. Het + FPS veranderbaar nummer met een punt '.' + als het decimale punt. De bereiken kunnen 'gaten' bevatten waarvoor + standaard FPS is gebruikt. een voorbeeld: + +

+ +
# timestamp format v1
+assume 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. Tijd code bestandsformaat v2

+ + + +

+ In dit format, bevat elke regel een tijd code voor het corresponderende + beeld. Deze tijd code moet opgeven worden in milli seconden. Het mag een + veranderbaar nummer zijn, maar het hoeft niet. Jij moet + minstens zo veel tijd coderegels opgeven als er aan beelden in het spoor + zijn. De tijd codes in dit bestand moeten gesorteerd zijn. Voorbeeld voor + 25fps: + +

+ +
# timestamp format v2
+0
+40
+80
+ + +

17.3. Tijd code bestandsformaat v3

+ + +

+ In dit format bevat elke regel een duur in seconden gevolgd door een + optioneel aantal beelden per seconde. Beide kunnen een veranderbaar nummer + zijn. Als het aantal beelden per seconde niet is opgegeven dan wordt het + standaard aantal gebruikt. Voor audio, zou jij de codec zelf de tijd codes + moeten laten berekenen. Daarvoor zou je moeten gebruiken + 0.0 als het aantal beelden per seconde. Je kunt ook + 'gaten' creëren in de stromen door te gebruiken de 'gap' + sleutelwoord gevolgd door de duur van het 'gat'. Voorbeeld voor een audio + bestand: + +

+ +
# timestamp format v3
+assume 0.0
+25.325
+7.530,38.236
+gap, 10.050
+2.000,38.236
+ + +

17.4. Tijd code bestandsformaat v4

+ + +

+ Dit format is identiek aan het v2 format. Het enige verschil is dat de tijd + codes niet gesorteerd behoeven te zijn. Dit format zou bijna nooit gebruikt + moeten worden. + +

+ + +

18. Verlaat codes

+ + + +

+ mkvinfo(1) verlaat met één van de drie afsluit codes: + +

+ + +
    + +
  • + +

    + 0 -- Deze verlaat code betekend dat het samenvoegen + succesvol voltooid is. + +

    + +
  • + + +
  • + +

    + 1 -- In dit geval heeft mkvmerge(1) ten miste één + waarschuwing uitgevaardigd, maar het samenvoegen ging door. Een waarschuwing + gaat vooraf met de tekst 'Waarschuwing:'. Afhankelijk van + de 'tegengekomen' kwesties kan het resultaat goed of slecht zijn. De + gebruiker wordt geadviseerd om zowel de waarschuwing als de resulterende + bestanden te controleren. + +

    + +
  • + + +
  • + +

    + 2 -- Deze afsluit code wordt gebruikt nadat er een fout + ontstond. mkvmerge(1) breekt direct af na het geven van dit waarschuw + bericht. Fout! bereik in berichten, van een verkeerd commandoregel argument + over lees/schrijf fouten naar een 'gebroken' bestanden. + +

    + +
  • + +
+ +

19. Omgevingsvariabelen

+ + + +

+ mkvmerge(1) gebruikt de standaard variabelen vanuit het systeem locatie + (b.v. LANG en de LC_* family). Extra + variabelen: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG and + its short form MTX_DEBUG + +

De inhoud wordt behandeld alsof het via de --debug optie + gepasseerd is. +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE and + its short form MTX_ENGAGE + +

De inhoud wordt behandeld alsof het via de --engage optie + gepasseerd is. +

+ +
+ +

20. Zie ook

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. WWW

+ + +

+ De laatste versie kan altijd gevonden worden op de MKVToolNix thuis basis. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..b1aff0ccf3468343ee460414746e65bf310ecba1 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvpropedit.html @@ -0,0 +1,1333 @@ + + + + + mkvpropedit -- Modificeren van eigenschappen van een bestaande Matroska bestanden zonder + een volledige samenvoeging + + + + +
mkvpropedit -- Modificeren van eigenschappen van een bestaande Matroska(tm) bestanden zonder + een volledige samenvoeging +
+
+ +
+

1. Beknopte inhoudsbeschrijving

+ + +
mkvpropedit options {source-filename} {actions} +
+ +

2. Beschrijving

+ + +

+ Dit programma analyseert een bestaand Matroska(tm) bestand en kan sommige + eigenschappen veranderen. Dan schrijft het deze veranderingen naar het + bestaande bestand. Onder de eigenschappen die kunnen worden veranderd, zijn + de segment informatie elementen (b.v. de titel) en de spoor koppen (b.v.de + taal code, 'standaard spoor' markering of de naam). + +

+ + +

+ Opties: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ Lijst alle bekende bewerkbare eigenschap namen, hun type (string, integer, + boolean etc) en een korte beschrijving. Nadien stopt het programma. Daarom + hoeft de parameter source-filename niet te worden + ingegeven. + +

+ +
-p, --parse-mode + mode + +

+ Stelt de ontleedt mode in. De parameter 'mode' kan + zijn of 'fast' (wat ook standaard is) of + 'full'. De 'fast' mode ontleedt niet + het gehele bestand, maar gebruikt de meta zoek elementen voor lokaliseren + van de benodigde elementen van een bron bestand. In 99% van alle gevallen is + dat voldoende. Maar voor bestanden die geen meta zoek element bevatten of + zij die beschadigd zijn, zou de gebruiker moeten opgeven de + 'full' ontleedt mode. Een volledige scan kan enige + minuten duren terwijl een snelle scan slechts enkele seconden duurt. + +

+ +
+ + +

+ Acties die van doen zijn met sporen en segment informatie eigenschappen: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit selector + +

+ Zet de Matroska(tm) bestand sectie (segment informatie of bepaalde sporen + koppen) die alle volgen voeg + toe, zet en verwijder acties die er op + werken. Deze optie kan meerdere keren worden gebruikt om wijzigingen aan + meer dan één element te maken. + +

+ + +

+ Standaard bewerkt mkvpropedit(1) de segment informatie sectie + +

+ + +

+ Zie de sectie over: Bewerk + selecteurs/kiezers voor een volledige beschrijving van de ingaven. + +

+ +
-a, --add + name=value + +

+ Voegt eigenschap name toe met de waarde + value. De eigenschap wordt toegevoegd zelfs wanneer + deze reeds bestaat. Opmerking: dat de meeste eigenschappen uniek zijn en + niet nog een keer mogen voorkomen. + +

+ +
-s, --set + name=value + +

+ Zet alle voorgekomen van de eigenschap name naar de + waarde value. Als een dergelijke eigenschap niet + bestaat dan wordt deze toegevoegd. + +

+ +
-d, --delete name + +

+ Verwijdert alle voorgekomen eigenschappen + name. Opmerking: sommige eigenschappen zijn vereist + en kunnen niet worden verwijderd. + +

+ +
+ + +

+ Acties die van doen zijn met markeringen en hoofdstukken: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags + selector:filename + +

+ Markeringen toevoegen of vervangen in het bestand met degene van + filename of verwijder ze als + filename leeg is. mkvpropedit(1) leest dezelfde XML + markeer format die mkvmerge(1) ook inleest. + +

+ + +

+ De selector moet één van de woorden + all, global of + track zijn. Voor all zal + mkvpropedit(1) alle markeringen vervangen of verwijderen in een bestand. Met + global worden alléén globale markeringen vervangen of + verwijderd. + +

+ + +

+ Met track vervangt mkvpropedit(1) markeringen van een + specifiek spoor. Als extra leest het de markeringen van + filename en worden toegewezen aan hetzelfde spoor. Het + spoor is gespecificeerd op dezelfde manier bewerk selecteurs zijn + gespecificeerd (zie hieronder), b.v. --tags + track:a1:new-audio-tags.xml. + +

+ +
--add-track-statistics-tags + +

+ Calculates statistics for all tracks in a file and adds new statistics tags + for them. If the file already contains such tags then they'll be updated. + +

+ +
--delete-track-statistics-tags + +

+ Deletes all existing track statistics tags from a file. If the file doesn't + contain track statistics tags then it won't be modified. + +

+ +
-c, --chapters + filename + +

+ Toevoegen of vervangen van hoofdstukken in het bestand met degene van + filename of verwijder ze als + filename leeg is. mkvpropedit(1) leest dezelfde XML en + simpele hoofdstukformaten die mkvmerge(1) ook inleest. + +

+ +
+ + +

+ Acties voor afhandelen van bijlagen: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment filename + +

+ Voegt een nieuwe bijlage van filename. + +

+ + +

+ Als de optie --attachment-name is gebruikt voorafgaand tot + deze optie, wordt die waarde gebruikt als vervanging van de bijlage + naam. Anders wordt het verkregen uit filename. + +

+ + +

+ Als de optie --attachment-dmime-type is gebruikt + voorafgaand tot deze optie, wordt die waarde gebruikt als vervanging van het + MIME type. Anders wordt het automatisch gedetecteerd van de inhoud van + filename. + +

+ + +

+ Als de optie --attachment-description is gebruikt + voorafgaand tot deze optie, wordt die waarde gebruikt als vervanging van de + bijlage beschrijving. Anders wordt er géén beschrijving gezet. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is used as the new attachment's UID. Otherwise a + random UID will be generated automatically. + +

+ +
--replace-attachment + selector:filename + +

+ Vervangt één of meer bijlage(n) die overeenkomen met + selector met het bestand + filename. Indien meer dan één bestand overeenkomt met + selector dan wordt al hun inhoud vervangen met de + inhoud van filename. + +

+ + +

+ De keuze kan vier vormen hebben. Ze worden in de + sectie hieronder uitgelegd bijlage keuze. + +

+ + +

+ If the option --attachment-name has been used prior to this + option then its value is set as the new name for each modified + attachment. Otherwise the names aren't changed. + +

+ + +

+ If the option --attachment-mime-type has been used prior to + this option then its value is set as the new MIME type for each modified + attachment. Otherwise the MIME types aren't changed. + +

+ + +

+ If the option --attachment-description has been used prior + to this option then its value is set as the new description for each + modified attachment. Otherwise the descriptions aren't changed. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is set as the new UID for each modified + attachment. Otherwise the UIDs aren't changed. + +

+ +
--update-attachment selector + +

+ Sets the properties of one or more attachments that match + selector. If more than one existing attachment + matches selector then all of their properties will be + updated. + +

+ + +

+ De keuze kan vier vormen hebben. Ze worden in de + sectie hieronder uitgelegd bijlage keuze. + +

+ + +

+ If the option --attachment-name has been used prior to this + option then its value is set as the new name for each modified + attachment. Otherwise the names aren't changed. + +

+ + +

+ If the option --attachment-mime-type has been used prior to + this option then its value is set as the new MIME type for each modified + attachment. Otherwise the MIME types aren't changed. + +

+ + +

+ If the option --attachment-description has been used prior + to this option then its value is set as the new description for each + modified attachment. Otherwise the descriptions aren't changed. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is set as the new UID for each modified + attachment. Otherwise the UIDs aren't changed. + +

+ +
--delete-attachment selector + +

+ Verwijdert één of meer bijlagen die overeenkomen met + selector. + +

+ + +

+ De keuze kan vier vormen hebben. Ze worden in de + sectie hieronder uitgelegd bijlage keuze. + +

+ +
+ + +

+ Opties voor bijlage acties: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name name + +

+ Stelt de te gebruiken naam in voor het volgende + --add-attachment of --replace-attachment + uitvoering. + +

+ +
--attachment-mime-type mime-type + +

+ Zet de te gebruiken MIME type voor het volgende + --add-attachment of --replace-attachment + uitvoering. + +

+ +
--attachment-description description + +

+ Zet de te gebruiken beschrijving voor het volgende + --add-attachment of --replace-attachment + uitvoering. + +

+ +
--enable-legacy-font-mime-types + +

+ Enables the use of legacy MIME types for certain types of + font attachments. For example, + 'application/x-truetype-font' will be used for TrueType + fonts instead of 'fonts/ttf'. + +

+ + +

+ This affects both adding new attachments and replacing existing attachments, + but only if the new MIME type isn't specified. Other + existing attachments aren't changed. + +

+ + +

+ The affected MIME types are 'font/sfnt', + 'font/ttf' and 'font/collection' which + are all mapped to 'application/x-truetype-fonts' and + 'font/otf' which is mapped to + 'application/vnd.ms-opentype'. + +

+ +
+ + +

+ Andere opties: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ Normally when the user requests changes to the 'language' + track header property, mkvpropedit(1) will apply the same change to the new + LanguageIETF track header element in addition to the + legacy Language element. If this option is used, the + change is only applied to the legacy Language + element. + +

+ + +

+ This option does not affect changes requested via the + 'language-ietf' track header property. + +

+ +
--normalize-language-ietf mode + +

+ Enables normalizing all IETF BCP 47 language tags to either their canonical + form with mode 'canonical', to their extended language + subtags form with mode 'extlang' or turns it off with + mode 'off'. By default normalization to the canonical + form is applied. + +

+ + +

+ In the canonical form all subtags for which preferred values exist are + replaced by those preferred values. This converts + e.g. 'zh-yue-jyutping' to + 'yue-jyutping' or 'fr-FX' to + 'fr-FR'. + +

+ + +

+ For the extended language subtags form the canonical form is built + first. Afterwards all primary languages for which an extended language + subtag exists are replaced by that extended language subtag and its + prefix. This converts e.g. 'yue-jyutping' back to + 'zh-yue-jyutping' but has no effect on + 'fr-FR' as 'fr' is not an extended + language subtag. + +

+ + +

+ This normalization is only applied to elements that are actually changed: + +

+ + +
    + +
  • + +

    + When editing track headers only those track language elements that are set + via edit specifications are affected. Languages of tracks that aren't edited + aren't changed. Editing a track but setting only properties other than the + language won't affect the language either. + +

    + +
  • + + +
  • + +

    + When editing chapters all language elements of all chapter elements are + affected as existing chapters are always fully replaced. + +

    + +
  • + + +
  • + +

    + When editing tags only the language elements of the tags that are actually + replaced are affected. For example, when you replace global tags then + existing track tags aren't affected. + +

    + +
  • + +
+ + +

+ The best way to normalize all existing language tags in a file is to remux + it with mkvmerge(1) and set its + '--normalize-language-ietf' option to the desired mode. + +

+ +
--command-line-charset (karakterset) + +

+ Plaatst het karakter set om de reeksen om te zetten die vanaf de + commandoregel worden opgegeven. Standaard wordt gebruikt het karakter set + die afhankelijk is van wat er in uw besturingssysteem staat aangegeven + (locatie). + +

+ +
--output-charset (karakterset) + +

+ Stelt het karakter set in, waarnaar de reeksen naar de uitvoer dienen te + worden geconverteerd. Standaard wordt gebruikt het karakter set die + afhankelijk is van wat er in uw besturingssysteem staat aangegeven + (locatie). + +

+ +
-r, --redirect-output + (bestandsnaam) + +

+ Schrijft alle berichten naar een bestand file-name + i.p.v. naar de 'apparaat/houder'. Terwijl dit gemakkelijk met uitvoer + omleiden kan worden gedaan er zijn gevallen waarin deze optie nodig is: + wanneer de verwerker e.e.a. herinterpreteert voordat het geschreven wordt + naar de uitvoer bestand. Het karakter set met --output-charset + is toegewezen. + +

+ +
--ui-language code + +

+ Forces the translations for the language code to be + used (e.g. 'de_DE' for the German + translations). Entering 'list' as the + code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Tells the program to abort after the first warning is emitted. The program's + exit code will be 1. + +

+ +
--title onderwerp + +

+ Zet debuggen aan voor een specifieke mogelijkheid. Dit is alleen zinvol voor + ontwikkelaars. + +

+ +
--tags feature + +

+ Zet experimentele mogelijkheden aan. Een lijst van beschikbare mogelijkheden + kan worden opgevraagd met mkvpropedit --engage list. Deze + mogelijkheden zijn niet bedoeld in normale situaties. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that + can tell a controlling GUI what's happening. These messages follow the + format '#GUI#message'. The message may be followed by + key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the + messages nor the keys are ever translated and always output in English. + +

+ +
-v, --verbose + +

+ Wees uitgebreid en toon alle belangrijke Matroska(tm) elementen zoals ze zijn + gelezen. + +

+ +
-h, --help + +

+ Toon gebruik informatie en sluit af. + +

+ +
-V, --version + +

+ Toon versie informatie en sluit af. + +

+ +
@options-file.json + +

+ Reads additional command line arguments from the file + options-file. For a full explanation on the supported + formats for such files see the section called "Option files" in the + mkvmerge(1) man page. + +

+ +
+ +

3. Bewerk selecteurs/kiezers

+ + +

+ De optie --edit zet + het Matroska(tm) bestand sectie (segment informatie of de bepaalde sporen + knoppen) die alle volgen voeg + toe, zet en verwijder acties die er op + werken. Dit blijft geldig totdat de volgende optie --edit is + gevonden. Het argument naar deze optie wordt genoemd de bewerk + selecteur/kiezer. + +

+ + +

+ Standaard bewerkt mkvpropedit(1) de segment informatie sectie + +

+ + +

3.1. Segment informatie

+ + +

+ Het segment informatie kan worden geselecteerd met één van deze drie + woorden: 'info', 'segment_info' of + 'segmentinfo'. het bevat eigenschappen zoals, segment + titel of het segment UID. + +

+ + + +

3.2. Spoor koppen

+ + +

+ Spoor koppen kunnen worden geselecteerd met een ietwat complexere + selectie. Alle variaties starten met 'track:'. De spoor + kop eigenschappen bevatten elementen zoals de taal code, 'default track' + markering of het spoor naam. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ Als de parameter n een nummer is dan zal het + n'de spoor worden geselecteerd. De spoor volgorde is + hetzelfde als mkvmerge(1)'s --identify optie uitvoert. + +

+ + +

+ Nummering start op 1. + +

+ +
track:tn + +

+ Als de parameter start met één karakter t gevolgd + door een n dan zal het de n'de + spoor van een specifiek spoor type geselecteerd worden. Het spoor type + parameter t moet één van deze vier karakters zijn: + 'a' voor een audio spoor, 'b' voor een + knop spoor, 's' voor een ondertitel spoor en + 'v' voor een video spoor. De spoor volgorde is hetzelfde + wanneer mkvmerge(1)'s --identify de optie uitvoert. + +

+ + +

+ Nummering start op 1. + +

+ +
track:=uid + +

+ If the parameter starts with a '=' followed by a number + uid, the track whose track UID + element equals the given uid will be selected. Track + UIDs can be obtained with mkvinfo(1). + +

+ +
track:@number + +

+ If the parameter starts with a '@' followed by a number + number, the track whose track number element equals + this number will be selected. Track numbers can be + obtained with mkvinfo(1). + +

+ +
+ + + +

3.3. Opmerkingen

+ + +

+ Door de aard van de spoor bewerk selecteur/kiezer, is het mogelijk dat + verschillende selecteurs/kiezers eigenlijk overeenkomen met dezelfde spoor + koppen. In zulke gevallen, zullen alle acties voor die bewerk + selecteurs/kiezers in die volgorde worden gecombineerd en uitgevoerd worden + in de volgorde waarin ze zijn opgegeven op de commandoregel. + +

+ + +

4. Bijlage(n) keuze

+ + + +

+ Een bijlage keuze word op twee verschillende manieren gebruikt --replace-attachment + en --delete-attachment. + het kan één van de volgende vier vormen hebben: + +

+ + +
    + +
  1. + +

    + Selectie op bijlage-id. In deze vorm is de keuze een gewoon getal, de + bijlage ID als uitgevoerd door mkvmerge(1) 's identificatie commando. + +

    + +
  2. + + +
  3. + +

    + Keuze op bijlage UID (uniek ID). In deze vorm van keuze is het "is (=)" + teken = gevolg door een nummer, de bijlage's unieke ID + als uitvoer door mkvmerge(1)'s beknopte identificatie commando. + +

    + +
  4. + + +
  5. + +

    + Keuze via bestandsnaam. In deze vorm is de keuze het letterlijke woord + naam: gevolg door een bestaande bijlage naam. Als deze + keuze is geselecteerd met --replace-attachment dan moeten + dubbele punten binnen de naam overeen te laten komen worden ingesloten als + \c. + +

    + +
  6. + + +
  7. + +

    + Selecteren op MIME type. In deze vorm is de keuze het letterlijke + woordmime-type: gevolg door een bestaande MIME type + bijlage. Indien deze keuze is geselecteerd met + --replace-attachment dan om dubbele punten overeen te laten + komen binnenin het MIME-type moeten worden overgeslagen als + \c. + +

    + +
  8. + +
+ +

5. Language handling

+ + + +

+ mkvpropedit(1) mostly tries to do the right thing by default. Therefore + changes to the language property will cause mkvpropedit(1) + to apply the same change to both the new "LanguageIETF" element as well as + the old "Language" element similar to how mkvmerge(1) applies the language to + both elements. For example, when using mkvpropedit movie.mkv --edit + track:2 --set language=zh-TW the "LanguageIETF" element will be + set to zh-TW and the old "Language" element to + chi. + +

+ + +

+ Additionally there's a new track header property named + language-ietf that can be set or removed. Changes to this + property only apply to the new "LanguageIETF" track header element. A caveat + is that the old "Language" track header element is a mandatory element in + Matroska — meaning even if it isn't present in the file it still has an + implied value. When the user only sets the language-ietf + property but not the language property, mkvpropedit(1) will + therefore add the old "Language" element in certain cases & set it to + und (meaning "undetermined") as the user didn't specify a + value for it. + +

+ + +

When reading XML chapter or tag files mkvpropedit(1) works like mkvmerge(1) + does. +

+ + +

The creation of the new elements can be disabled completely with the + command-line option `--disable-language-ietf` which operates on all three + new elements. +

+ + +

You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. +

+ +

6. Voorbeelden

+ + +

+ Het volgende voorbeeld bewerkt een bestand genaamd + 'film.mkv'. Het zet het segment titel en modificeert de + taal code van een audio en ondertitel spoor. Opmerking: Dat dit voorbeeld + kan worden verkort door het weglaten van de eerste --edit optie, + omdat bewerken van het segment informatie element in elk geval standaard is + voor alle opties welke worden gevonden voor de eerste --edit optie. + +

+ +
$ mkvpropedit movie.mkv --edit info --set "title=The movie" --edit track:a1 --set language=fre --edit track:a2 --set language=ita
+ +

+ Het tweede voorbeeld, verwijdert de 'standaard spoor markering' van het + eerste ondertitel spoor en plaatst het voor de tweede. Opmerking: Dat + mkvpropedit(1), integenstelling tot mkvmerge(1), niet instelt de 'standaard + spoor markering' van andere sporen naar '0' als het automatisch is ingesteld + op '1' voor een verschillend spoor. + +

+ +
$ mkvpropedit movie.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ Vervangen van markeringen voor het tweede ondertitelspoor in een bestand zou + lijken op dit: + +

+ +
$ mkvpropedit movie.mkv --tags track:s2:new-subtitle-tags.xml
+ +

+ Verwijderen van alle markeringen vereist het weglaten van de bestandsnaam: + +

+ +
$ mkvpropedit movie.mkv --tags all:
+ +

+ Hoofdstukken vervangen in een bestand zou lijken op dit: + +

+ +
$ mkvpropedit movie.mkv --chapters new-chapters.xml
+ +

+ Verwijderen van alle hoofdstukken vereist het weglaten van de bestandsnaam: + +

+ +
$ mkvpropedit movie.mkv --chapters ''
+ +

+ Toevoegen van een lettertype bestand (Arial.ttf) als een + bijlage: + +

+ +
$ mkvpropedit movie.mkv --add-attachment Arial.ttf
+ +

+ Toevoegen lettertype bestand (89719823.ttf) als een + bijlage en geeft enige informatie of het werkelijk een Arial letterype is: + +

+ +
$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'Het Arial lettertype als een TrueType letter' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ Vervangt een gekoppeld lettertype (Comic.ttf) bestand met + een andere (Arial.ttf): + +

+ +
$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'Het Arial lettertyupe als een TrueType letter' --replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ Verwijderen tweede bijlage bestand wat het ook mag zijn: + +

+ +
$ mkvpropedit movie.mkv --delete-attachment 2
+ +

+ Verwijderen alle bijlage lettertypen op MIME type: + +

+ +
$ mkvpropedit movie.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. Verlaat codes

+ + + +

+ mkvpropedit(1) verlaat met één van drie verlaat codes: + +

+ + +
    + +
  • + +

    + 0 -- Deze verlaat code betekend dat het modificeren + succesvol voltooid is. + +

    + +
  • + + +
  • + +

    + 1 -- In dit geval heeft mkvpropedit(1) minstends één + waarschuwing uitgegeven, maar extractie is doorgegaan. Een waarschuwing + wordt vooraf bepaald met de tekst + 'Waarschuwing:'. Afhankelijk van de 'tegengekomen' + kwesties kan het resultaat goed of slecht zijn. De gebruiker wordt + geadviseerd, om zowel de waarschuwing als de resulterende bestanden te + controleren. + +

    + +
  • + + +
  • + +

    + 2 -- Deze afsluit code wordt gebruikt nadat er een fout + ontstond. mkvpropedit(1) breekt direct af na het geven van dit waarschuw + bericht. Fout berichten, bereik van een verkeerd commandoregel argument over + lees/schrijf fouten naar een 'gebroken' bestanden. + +

    + +
  • + +
+ +

8. Tekst bestanden en karakter set conversies

+ + + +

+ For an in-depth discussion about how all tools in the MKVToolNix suite + handle character set conversions, input/output encoding, command line + encoding and console encoding please see the identically-named section in + the mkvmerge(1) man page. + +

+ +

9. Omgevingsvariabelen

+ + + +

+ mkvpropedit(1) gebruikt de standaard variabelen vanuit het systeem locatie + (b.v. LANG en de LC_* family). Extra + variabelen: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG + and its short form MTX_DEBUG + +

De inhoud wordt behandeld alsof het via de --debug + optie gepasseerd is. +

+ +
MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE + and its short form MTX_ENGAGE + +

De inhoud wordt behandeld alsof het via de --engage + optie gepasseerd is. +

+ +
+ +

10. Zie ook

+ + +

+ mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1) + +

+ +

11. WWW

+ + +

+ De laatste versie kan altijd gevonden worden op de MKVToolNix thuis basis. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..f4144c28a46062e4a4afc5e5fe46d5f9599a275b --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/nl/mkvtoolnix-gui.html @@ -0,0 +1,160 @@ + + + + + mkvtoolnix-gui -- een grafische schil voor mkvmerge1 inclusief een hoofdstuk en kop bewerker + + + +
mkvtoolnix-gui -- een grafische schil voor mkvmerge(1) inclusief een hoofdstuk en kop bewerker +
+
+ +
+

1. Beknopte inhoudsbeschrijving

+ + +
mkvtoolnix-gui [[configuration-file-name.mtxcfg] | [source-file.ext] | [matroska-file.mkv] | [chapter-file.ext] | [matroska-file.mkv]] +
+ +

2. Beschrijving

+ + +

+ mkvtoolnix-gui(1) is a Qt(tm) based + GUI for mkvmerge(1). It also implements mkvinfo(1)'s and + mkvpropedit(1)'s functionality and will evolve to cover mkvextract(1) as + well. All settings (e.g. source files, track options etc) can be saved and + restored. + +

+ + +

+ Listing configuration file names with the extension + .mtxcfg causes the GUI to load the those configuration + files in the appropriate tool. Any other file name is added as a source file + for multiplexing, opened in the info tool, the chapter editor or in the + header editor depending on the current mode. The current mode can be changed + with --merge, --info, + --edit-chapters or --edit-headers. The + default mode is adding files for multiplexing. + +

+ + +

+ Note that if an instance of the application is already running when the + application is started a second time, all file names given on the command + line are handled by the already-running instance. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

All following file names will be added as source files to the current + multiplex job. This is the default mode. +

+ +
--info + +

Alle volgende bestandsnamen zullen worden geopend in de info gereedschap.

+ +

Additionally the info tool will be selected on startup instead of the + multiplexer tool. +

+ +
--edit-chapters + +

Alle volgende bestandsnamen zullen worden geopend in de hoofdstuk bewerker.

+ +

Additionally the chapter editor will be selected on startup instead of the + multiplexer tool. +

+ +
--edit-headers + +

Alle volgende bestandsnamen zullen worden geopend in de kopstuk bewerker.

+ +

Additionally the header editor will be selected on startup instead of the + multiplexer tool. +

+ +
-h, --help + +

+ Toon gebruik informatie en sluit af. + +

+ +
-V, --version + +

+ Toon versie informatie en sluit af. + +

+ +
+ +

3. Zie ook

+ + +

+ mkvmerge(1), mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. WWW

+ + +

+ De laatste versie kan altijd gevonden worden op de MKVToolNix thuis basis. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..3ddd37989aca432c3112a91d489b9077b3302392 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvextract.html @@ -0,0 +1,1335 @@ + + + + + mkvextract -- wyodrębnia ścieżki z plików Matroska do innych plików + + + +
mkvextract -- wyodrębnia ścieżki z plików Matroska(tm) do innych plików +
+
+ +
+

1. Szablon linii komend

+ + +
mkvextract {source-filename} {mode1} options extraction-spec1 mode2 options extraction-spec2 … +
+ +

2. Opis

+ + +

+ This program extracts specific parts from a Matroska(tm) file to other useful + formats. The first argument is the name of the source file which must be a + Matroska(tm) file. + +

+ + +

+ All other arguments either switch to a certain extraction mode, change + options for the currently active mode or specify what to extract into which + file. Multiple modes can be used in the same invocation of mkvextract + allowing the extraction of multiple things in a single pass. Most options + can only be used in certain modes with a few options applying to all modes. + +

+ + +

+ Currently supported is the extraction of tracks, tags, attachments, chapters, CUE sheets, timestamps and cues. + +

+ + +

2.1. Opcje podstawowe

+ + + +

+ Następujące opcje są dostępne we wszystkich trybach i zostały opisane tylko + raz w tej sekcji. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ Sets the parse mode to 'full'. The default mode does not parse the whole + file but uses the meta seek elements for locating the required elements of a + source file. In 99% of all cases this is enough. But for files that do not + contain meta seek elements or which are damaged the user might have to use + this mode. A full scan of a file can take a couple of minutes while a fast + scan only takes seconds. + +

+ +
--command-line-charset zestaw-znaków + +

+ Sets the character set to convert strings given on the command line from. It + defaults to the character set given by system's current locale. + +

+ +
--output-charset zestaw-znaków + +

+ Sets the character set to which strings are converted that are to be + output. It defaults to the character set given by system's current locale. + +

+ +
-r, --redirect-output + nazwa-pliku + +

+ Zapisuje wszystkie powiadomienia do pliku nazwa-pliku + zamiast do konsoli. Podczas gdy może być to robione łatwo z przekierowaniem + wyjścia, są przypadki, gdy ta opcja właśnie jest potrzebna: gdy terminal + ponownie interpretuje plik wyjściowy przed zapisaniem do pliku. Uznawany + będzie zestaw znaków ustawiony z opcją --output-charset. + +

+ +
--flush-on-close + +

+ Tells the program to flush all data cached in memory to storage when closing + files opened for writing. This can be used to prevent data loss on power + outages or to circumvent certain problems in the operating system or + drivers. The downside is that multiplexing will take longer as mkvmerge + will wait until all data has been written to the storage before exiting. + See issues #2469 and #2480 on the MKVToolNix bug tracker for in-depth + discussions on the pros and cons. + +

+ +
--ui-language kod + +

+ Forces the translations for the language code to be + used (e.g. 'de_DE' for the German + translations). Entering 'list' as the + code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Nakazuje programowi przerwanie po wyemitowaniu pierwszego ostrzeżenia. Kodem + wyjścia programu będzie 1. + +

+ +
--debug temat + +

+ Włącz debugowanie dla konkretnej funkcji. Ta opcja jest użyteczna tylko dla + deweloperów. + +

+ +
--engage funkcja + +

+ Włącz funkcje eksperymentalne. Listę dostępnych funkcji można uzyskać za + pomocą komendy mkvextract --engage list. Te funkcje nie + są przeznaczone do użytku w normalnych sytuacjach. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that + can tell a controlling GUI what's happening. These messages follow the + format '#GUI#message'. The message may be followed by + key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the + messages nor the keys are ever translated and always output in English. + +

+ +
-v, --verbose + +

+ Be verbose and show all the important Matroska(tm) elements as they're read. + +

+ +
-h, --help + +

+ Pokaż informację o sposobie użycia opcji i wyjdź. + +

+ +
-V, --version + +

+ Pokaż informację o wersji i wyjdź. + +

+ +
@options-file.json + +

+ Reads additional command line arguments from the file + options-file. For a full explanation on the supported + formats for such files see the section called "Option files" in the + mkvmerge(1) man page. + +

+ +
+ + + +

2.2. Tryb wyodrębniania ścieżek

+ + + +

+ Syntax: mkvextract source-filename + tracks [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + +

+ The following command line options are available for each track in the + 'tracks' extraction mode. They have to appear in front + of the track specification (see below) they should be applied to. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c zestaw-znaków + +

+ Sets the character set to convert the next text subtitle track to. Only + valid if the next track ID targets a text subtitle track. It defaults to + UTF-8. + +

+ +
--blockadd poziom + +

+ Keep only the BlockAdditions up to this level. The default is to keep all + levels. This option only affects certain kinds of codecs like WAVPACK4. + +

+ +
--cuesheet + +

+ Causes mkvextract(1) to extract a CUE sheet from the chapter + information and tag data for the following track into a file whose name is + the track's output name with '.cue' appended to it. + +

+ +
--raw + +

+ Extracts the raw data into a file without any container data around it. + Unlike the --fullraw + flag this flag does not cause the contents of the + CodecPrivate element to be written to the file. This + mode works with all CodecIDs, even the ones that + mkvextract(1) doesn't support otherwise, but the resulting files might not be + usable. + +

+ +
--fullraw + +

+ Extracts the raw data into a file without any container data around it. The + contents of the CodecPrivate element will be written + to the file first if the track contains such a header element. This mode + works with all CodecIDs, even the ones that + mkvextract(1) doesn't support otherwise, but the resulting files might not be + usable. + +

+ +
TID:nazwa + +

+ Causes extraction of the track with the ID TID into + the file outname if such a track exists in the source + file. This option can be given multiple times. The track IDs are the same as + the ones output by mkvmerge(1)'s --identify option. + +

+ + +

+ Each output name should be used only once. The exception are RealAudio and + RealVideo tracks. If you use the same name for different tracks then those + tracks will be saved in the same file. Example: + +

+ +
$ mkvextract input.mkv tracks 0:video.h264 2:output-two-vobsub-tracks.idx 3:output-two-vobsub-tracks.idx
+
+ + + +

2.3. Tryb wyodrębniania załączników

+ + + +

+ Syntax: mkvextract source-filename + attachments + [options] + AID1:outname1 + [AID2:outname2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:nazwa + +

+ Causes extraction of the attachment with the ID AID + into the file outname if such an attachment exists in + the source file. If the outname is left empty then + the name of the attachment inside the source Matroska(tm) file is used + instead. This option can be given multiple times. The attachment IDs are + the same as the ones output by mkvmerge(1)'s --identify + option. + +

+ +
+ + + +

2.4. Tryb wyodrębniania rozdziałów

+ + + +

+ Syntax: mkvextract source-filename + chapters + [options] + output-filename.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ Exports the chapter information in the simple format used in the + OGM tools (CHAPTER01=..., CHAPTER01NAME=...). In this mode + some information has to be discarded. Default is to output the chapters in + XML format. + +

+ +
--simple-language język + +

+ If the simple format is enabled then mkvextract(1) will only output a single + entry for each chapter atom encountered even if a chapter atom contains more + than one chapter name. By default mkvextract(1) will use the first chapter + name found for each atom regardless of its language. + +

+ + +

+ Using this option allows the user to determine which chapter names are + output if atoms contain more than one chapter name. The + language parameter must be an ISO 639-1 or ISO 639-2 + code. + +

+ +
+ + +

+ The chapters are written to specified output file. By default the XML + format understood by mkvmerge(1) is used. If no chapters are found in the + file, the output file is not created. + +

+ + + +

2.5. Tags extraction mode

+ + + +

+ Syntax: mkvextract source-filename + tags [options] + output-filename.xml + +

+ + +

+ The tags are written to specified output file in the XML format understood + by mkvmerge(1). If no tags are found in the file, the output file is not + created. + +

+ + + +

2.6. Tryb wyodrębniania arkuszy cue

+ + + +

+ Syntax: mkvextract source-filename + cuesheet + [options] + output-filename.cue + +

+ + +

+ The cue sheet is written to specified output file. If no chapters or tags + are found in the file, the output file is not created. + +

+ + + +

2.7. Tryb wyodrębniania kodów czasowych

+ + + +

+ Syntax: mkvextract source-filename + timestamps_v2 + [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:nazwa + +

+ Causes extraction of the timestamps for the track with the ID + TID into the file outname if + such a track exists in the source file. This option can be given multiple + times. The track IDs are the same as the ones output by mkvmerge(1)'s + --identify option. + +

+ + +

+ Przykład: + +

+ +
$ mkvextract input.mkv timestamps_v2 1:ts-track1.txt 2:ts-track2.txt
+
+ + + +

2.8. Tryb wyodrębniania indeksów cue

+ + + +

+ Syntax: mkvextract source-filename + cues [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:docelowa-nazwapliku + +

+ Causes extraction of the cues for the track with the ID + TID into the file outname if + such a track exists in the source file. This option can be given multiple + times. The track IDs are the same as the ones output by mkvmerge(1)'s + --identify option and not the numbers contained in the + CueTrack element. + +

+ +
+ + +

+ The format output is a simple text format: one line per + CuePoint element with key=value + pairs. If an optional element is not present in a + CuePoint (e.g. CueDuration) + then a dash will be output as the value. + +

+ + +

+ Przykład: + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

The possible keys are:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
timestamp + +

The cue point's timestamp with nanosecond precision. The format is + HH:MM:SS.nnnnnnnnn. This element is always set. +

+ +
duration + +

The cue point's duration with nanosecond precision. The format is + HH:MM:SS.nnnnnnnnn. +

+ +
cluster_position + +

The absolute position in bytes inside the Matroska(tm) file where the cluster + containing the referenced element starts. +

+ + +
+

Note:

+ +

Inside the Matroska(tm) file the CueClusterPosition is + relative to the segment's data start offset. The value output by + mkvextract(1)'s cue extraction mode, however, contains that offset already + and is an absolute offset from the beginning of the file. +

+ +
+ +
relative_position + +

The relative position in bytes inside the cluster where the + BlockGroup or SimpleBlock + element the cue point refers to starts. +

+ + +
+

Note:

+ +

Inside the Matroska(tm) file the CueRelativePosition is + relative to the cluster's data start offset. The value output by + mkvextract(1)'s cue extraction mode, however, is relative to the cluster's + ID. The absolute position inside the file can be calculated by adding + cluster_position and + relative_position. +

+ +
+ +
+ + +

+ Przykład: + +

+ +
$ mkvextract input.mkv cues 1:cues-track1.txt 2:cues-track2.txt
+ +

3. Przykłady

+ + + +

+ Extracting both chapters and tags in their respective XML formats at the + same time: + +

+ +
$ mkvextract movie.mkv chapters movie-chapters.xml tags movie-tags.xml
+ +

+ Extracting a couple of tracks and their respective timestamps at the same + time: + +

+ +
$ mkvextract "Another Movie.mkv" tracks 0:video.h265 "1:main audio.aac" "2:director's comments.aac" timestamps_v2 "0:timestamps video.txt" "1:timestamps main audio.txt" "2:timestamps director's comments.txt"
+ +

+ Extracting chapters in the Ogg/OGM format and re-encoding a text subtitle + track to another character set: + +

+ +
$ mkvextract "My Movie.mkv" chapters --simple "My Chapters.txt" tracks -c MS-ANSI "2:My Subtitles.srt"
+

4. Text files and character set conversions

+ + + +

+ Szczegółowe omówienie sposobu, w jaki wszystkie narzędzia w pakiecie + MKVToolNix obsługują konwersję zestawu znaków, kodowanie + wejściowe/wyjściowe, kodowanie linii komend i kodowanie konsoli, można + znaleźć w sekcji o identycznej nazwie na mkvmerge(1) stronie podręcznika. + +

+ +

5. Wyjściowe formaty plików

+ + + +

+ The decision about the output format is based on the track type, not on the + extension used for the output file name. The following track types are + supported at the moment: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ Wszystkie pliki AAC będą zapisywane do plików + AAC z nagłówkami ADTS przed każdym + pakietem. Nagłówki ADTS nie będą zawierać niewspieranego + pola emfazy. + +

+ +
A_AC3, A_EAC3 + +

+ These will be extracted to raw AC-3 files. + +

+ +
A_ALAC + +

+ Ścieżki ALAC są zapisywane do plików CAF. + +

+ +
A_DTS + +

+ These will be extracted to raw DTS files. + +

+ +
A_FLAC + +

+ Ścieżki FLAC są zapisywane do surowych plików + FLAC. + +

+ +
A_MPEG/L2 + +

+ Ścieżki MPEG-1 Audio Layer II będą wyodrębniane do surowych plików + MP2. + +

+ +
A_MPEG/L3 + +

+ These will be extracted to raw MP3 files. + +

+ +
A_OPUS + +

+ Ścieżki Opus(tm) są zapisywane do plików + OggOpus(tm). + +

+ +
A_PCM/INT/LIT, A_PCM/INT/BIG + +

+ Raw PCM data will be written to a WAV + file. Big-endian integer data will be converted to little-endian data in the + process. + +

+ +
A_REAL/* + +

+ Ścieżki RealAudio(tm) są zapisywane do plików + RealMedia(tm). + +

+ +
A_TRUEHD, A_MLP + +

+ These will be extracted to raw TrueHD/MLP + files. + +

+ +
A_TTA1 + +

+ Ścieżki TrueAudio(tm) są zapisywane do plików + TTA. Zauważ, że w wyniku ograniczonej precyzji formatu + Matroska(tm), wyodrębniane nagłówki plików będą mieć inne dwa pola: + data_length (łączna liczba sampli w pliku) i + CRC. + +

+ +
A_VORBIS + +

+ Dźwięk Vorbis będzie zapisywany do pliku OggVorbis(tm). + +

+ +
A_WAVPACK4 + +

+ Ścieżki WavPack(tm) są zapisywane do plików + WV. + +

+ +
S_HDMV/PGS + +

+ Napisy PGS będą zapisywane do plików SUP. + +

+ +
S_HDMV/TEXTST + +

+ TextST subtitles will be written as a special file format + invented for mkvmerge(1) and mkvextract(1). + +

+ +
S_KATE + +

+ Ścieżki Kate(tm) będą zapisywane do kontenera + Ogg(tm). + +

+ +
S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS + +

+ Napisy tekstowe SSA i ASS będą zapisywane + do plików odpowiednio SSA/ASS. + +

+ +
S_TEXT/UTF8, S_TEXT/ASCII + +

+ Proste napisy tekstowe będą zapisywane do plików SRT. + +

+ +
S_VOBSUB + +

+ Napisy VobSub(tm) będą zapisywane do plików + SUB razem z odpowiednimi plikami indeksu + IDX. + +

+ +
S_TEXT/USF + +

+ Napisy tekstowe USF będą zapisywane do plików + USF. + +

+ +
S_TEXT/WEBVTT + +

+ WebVTT text subtitles will be written as + WebVTT files. + +

+ +
V_MPEG1, V_MPEG2 + +

+ MPEG-1 and MPEG-2 video tracks will be + written as MPEG elementary streams. + +

+ +
V_MPEG4/ISO/AVC + +

+ Ścieżki obrazu H.264 / AVC są zapisywane + do ścieżek surowych (dane podstawowe) H.264, które mogą być + później przetwarzane np. przez MP4Box(tm) z pakietu + GPAC(tm). + +

+ +
V_MPEG4/ISO/HEVC + +

+ Ścieżki obrazu H.265 / HEVC są zapisywane + do ścieżek surowych (dane podstawowe) H.265, które mogą być + później przetwarzane np. przez MP4Box(tm) z pakietu + GPAC(tm). + +

+ +
V_MS/VFW/FOURCC + +

+ Ścieżki obrazu ze stałym FPS mające taki + CodecID są zapisywane do plików AVI. + +

+ +
V_REAL/* + +

+ Ścieżki RealVideo(tm) są zapisywane do plików + RealMedia(tm). + +

+ +
V_THEORA + +

+ Ścieżki Theora(tm) będą zapisywane do kontenera + Ogg(tm) + +

+ +
V_VP8, V_VP9 + +

+ Ścieżki VP8 / VP9 są zapisywane do plików + IVF. + +

+ +
Tagi + +

+ Tagi są konwertowane do formatu XML. Jest to taki sam format, jaki + mkvmerge(1) obsługuje w plikach wejściowych. + +

+ +
Załączniki + +

+ Załączniki są zapisywane do pliku wyjściowego takie jakie są. Żadna + konwersja nie jest wykonywana. + +

+ +
Rozdziały + +

+ Chapters are converted to a XML format. This format is the same that + mkvmerge(1) supports for reading chapters. Alternatively a stripped-down + version can be output in the simple OGM style format. + +

+ +
Kody czasowe + +

+ Timestamps are first sorted and then output as a timestamp v2 format + compliant file ready to be fed to mkvmerge(1). The extraction to other + formats (v1, v3 and v4) is not supported. + +

+ +
+ +

6. Kody zakończenia

+ + + +

+ mkvextract(1) exits with one of three exit codes: + +

+ + +
    + +
  • + +

    + 0 -- Ten kod zakończenia oznacza, że wyodrębnianie + zostało zakończone powodzeniem. + +

    + +
  • + + +
  • + +

    + 1 -- In this case mkvextract(1) has output at least one + warning, but extraction did continue. A warning is prefixed with the text + 'Warning:'. Depending on the issues involved the + resulting files might be ok or not. The user is urged to check both the + warning and the resulting files. + +

    + +
  • + + +
  • + +

    + 2 -- This exit code is used after an error occurred. + mkvextract(1) aborts right after outputting the error message. Error + messages range from wrong command line arguments over read/write errors to + broken files. + +

    + +
  • + +
+ +

7. Zmienne środowiskowe

+ + + +

+ mkvextract(1) uses the default variables that determine the system's locale + (e.g. LANG and the LC_* + family). Additional variables: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG i + jego skrócona forma MTX_DEBUG + +

The content is treated as if it had been passed via the --debug + option. +

+ +
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE i + jego skrócona forma MTX_ENGAGE + +

The content is treated as if it had been passed via the --engage + option. +

+ +
+ +

8. Zobacz także

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. Strona www

+ + +

+ The latest version can always be found at the MKVToolNix homepage. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..8e7da834cc7ba694c54e2b5f293fadbb3d89f2e1 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvinfo.html @@ -0,0 +1,514 @@ + + + + + mkvinfo -- Print information about elements in Matroska files + + + +
mkvinfo -- Print information about elements in Matroska(tm) files +
+
+ +
+

1. Szablon linii komend

+ + +
mkvinfo opcje {źródłowa-nazwa + pliku} +
+ +

2. Opis

+ + +

+ This program lists all elements contained in a Matroska(tm). The output can be + limited to a list of tracks in the file including information about the + codecs used. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ By default mkvinfo(1) stops when it encounters the first cluster. + Additionally it doesn't show certain often occurring elements. With this + option mkvinfo(1) will continue processing regardless of the verbosity level + and show all elements. + +

+ +
-c, --checksums + +

+ Calculates and display the Adler-32 checksum for each + frame. Useful for debugging only. + +

+ +
-o, --continue + +

+ By default mkvinfo(1) stops when it encounters the first cluster. With this + option mkvinfo(1) will continue processing regardless of the verbosity level. + +

+ +
-p, --hex-positions + +

+ Show the positions of all elements in hexadecimal regardless of the + verbosity level. + +

+ +
-P, --positions + +

+ Show the positions of all elements in decimal regardless of the verbosity + level. + +

+ +
-s, --summary + +

+ Only show a terse summary of what mkvinfo(1) finds and not each element. + +

+ +
-t, --track-info + +

+ Show statistics for each track in verbose mode. Also sets verbosity to 1 if + it was at level 0 before. + +

+ +
-x, --hexdump + +

+ Pokaż pierwsze 16 bajtów każdej klatki jako zrzut szesnastkowy. + +

+ +
-X, --full-hexdump + +

+ Pokaż wszystkie bajty każdej klatki jako zrzut szesnastkowy. + +

+ +
-z, --size + +

+ Pokaż rozmiar każdego elementu łacznie z jego nagłówkiem. + +

+ +
--command-line-charset zestaw-znaków + +

+ Sets the character set to convert strings given on the command line from. It + defaults to the character set given by system's current locale. + +

+ +
--output-charset zestaw-znaków + +

+ Sets the character set to which strings are converted that are to be + output. It defaults to the character set given by system's current locale. + +

+ +
-r, --redirect-output + nazwa-pliku + +

+ Zapisuje wszystkie powiadomienia do pliku nazwa-pliku + zamiast do konsoli. Podczas gdy może być to robione łatwo z przekierowaniem + wyjścia, są przypadki, gdy ta opcja właśnie jest potrzebna: gdy terminal + ponownie interpretuje plik wyjściowy przed zapisaniem do pliku. Uznawany + będzie zestaw znaków ustawiony z opcją --output-charset. + +

+ +
--ui-language kod + +

+ Forces the translations for the language code to be + used (e.g. 'de_DE' for the German + translations). Entering 'list' as the + code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Nakazuje programowi przerwanie po wyemitowaniu pierwszego ostrzeżenia. Kodem + wyjścia programu będzie 1. + +

+ +
--debug temat + +

+ Włącz debugowanie dla konkretnej funkcji. Ta opcja jest użyteczna tylko dla + deweloperów. + +

+ +
--engage funkcja + +

+ Włącz funkcje eksperymentalne. Listę dostępnych funkcji można uzyskać za + pomocą komendy mkvinfo --engage list. Te funkcje nie są + przeznaczone do użytku w normalnych sytuacjach. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that + can tell a controlling GUI what's happening. These messages follow the + format '#GUI#message'. The message may be followed by + key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the + messages nor the keys are ever translated and always output in English. + +

+ +
-v, --verbose + +

+ Be more verbose. See the section about verbosity levels for a description + which information will be output at which level. + +

+ +
-h, --help + +

+ Pokaż informację o sposobie użycia opcji i wyjdź. + +

+ +
-V, --version + +

+ Pokaż informację o wersji i wyjdź. + +

+ +
@options-file.json + +

+ Reads additional command line arguments from the file + options-file. For a full explanation on the supported + formats for such files see the section called "Option files" in the + mkvmerge(1) man page. + +

+ +
+ +

3. Poziomy szczegółowości

+ + + +

+ The -v + option can be used to increase mkvinfo(1)'s verbosity level and print more + information about the current file. + +

+ + +

+ At level 0 mkvinfo(1) will print only the track headers it finds and their + types. mkvinfo(1) will exit as soon as the headers are parsed completely + (more technical: as soon as the first cluster is encountered). In this level + the seek head entries and the cues will not be displayed -- even if they're + located in front of the track information. + +

+ + +

+ At level 1 mkvinfo(1) will also print all Matroska(tm) elements encountered for + the complete file but the seek head entries and the cue entries. If the + summary mode is enabled then mkvinfo(1) will output the frame position as + well. + +

+ + +

+ The same effect can be achieved with the option --continue. + +

+ + +

+ At level 2 mkvinfo(1) will also print the seek head entries, the cue entries + and the file position at which each Matroska(tm) element can be found at. + +

+ + +

+ The same effect can be achieved with the options --all + --positions. + +

+ + +

+ At level 3 and above mkvinfo(1) will print some information that is not + directly connected to a Matroska(tm) element. All other elements only print + stuff about the elements that were just found. Level 3 adds meta information + to ease debugging (read: it's intended for developers only). All lines + written by level 3 are enclosed in square brackets to make filtering them + out easy. + +

+ +

4. Text files and character set conversions

+ + + +

+ Szczegółowe omówienie sposobu, w jaki wszystkie narzędzia w pakiecie + MKVToolNix obsługują konwersję zestawu znaków, kodowanie + wejściowe/wyjściowe, kodowanie linii komend i kodowanie konsoli, można + znaleźć w sekcji o identycznej nazwie na mkvmerge(1) stronie podręcznika. + +

+ +

5. Kody zakończenia

+ + + +

+ mkvinfo(1) exits with one of three exit codes: + +

+ + +
    + +
  • + +

    + 0 -- Ten kod zakończenia oznacza, że praca została + zakończona powodzeniem. + +

    + +
  • + + +
  • + +

    + 1 -- In this case mkvinfo(1) has output at least one + warning, but the run did continue. A warning is prefixed with the text + 'Warning:'. + +

    + +
  • + + +
  • + +

    + 2 -- This exit code is used after an error occurred. + mkvinfo(1) aborts right after outputting the error message. Error messages + range from wrong command line arguments over read/write errors to broken + files. + +

    + +
  • + +
+ +

6. Zmienne środowiskowe

+ + + +

+ mkvinfo(1) uses the default variables that determine the system's locale + (e.g. LANG and the LC_* + family). Additional variables: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUG, MKVTOOLNIX_DEBUG i jego + skrócona forma MTX_DEBUG + +

The content is treated as if it had been passed via the --debug option. +

+ +
MKVINFO_ENGAGE, MKVTOOLNIX_ENGAGE i + jego skrócona forma MTX_ENGAGE + +

The content is treated as if it had been passed via the --engage + option. +

+ +
+ +

7. Zobacz także

+ + +

+ mkvmerge(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. Strona www

+ + +

+ The latest version can always be found at the MKVToolNix homepage. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..fd14c44f4277b245b14cf090881ad97ccdc9a763 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvmerge.html @@ -0,0 +1,5231 @@ + + + + + mkvmerge -- Łącz ścieżki multimedialne do pliku Matroska + + + +
mkvmerge -- Łącz ścieżki multimedialne do pliku Matroska(tm)
+
+ +
+

1. Szablon linii komend

+ + +
mkvmerge global options {-o + out} options1 {file1} options2 {file2} @options-file.json +
+ +

2. Opis

+ + +

+ This program takes the input from several media files and joins their + streams (all of them or just a selection) into a Matroska(tm) file; see the Matroska website. + +

+ + +
+

Important:

+ +

+ The order of command line options is important. Please read the section + "Option order" if + you're new to the program. + +

+ +
+ + +

2.1. Opcje globalne

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

Zwiększ szczegółowość

+ +
-q, --quiet + +

Wycisz komunikaty wyjścia.

+ +
-o, --output + nazwa-pliku + +

Write to the file file-name. If splitting is used + then this parameter is treated a bit differently. See the explanation for + the --split option + for details. +

+ +
-w, --webm + +

Create a WebM compliant file. This is also turned on if the output file + name's extension is "webm". This mode enforces several + restrictions. The only allowed codecs are VP8, VP9 video and Opus, Vorbis + audio tracks. The DocType header item is changed to "webm". + +

+ + +

+ For chapters and tags only a subset of elements are allowed. mkvmerge(1) will + automatically remove all elements not allowed by the specification. + +

+ +
--title tytuł + +

Sets the general title for the output file, e.g. the movie name.

+ +
--default-language kod-języka + +

Sets the default language code that will be used for tracks for which no + language is set with the --language + option and for which the source container doesn't provide a language. +

+ + +

The default language code is 'und' for 'undetermined'. +

+ +
+ + + +

2.2. Segment info handling (global options)

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo nazwa-pliku.xml + +

+ Read segment information from an XML file. This file can + contain the segment family UID, segment + UID, previous and next segment UID + elements. An example file and a DTD are included in the + MKVToolNix distribution. + +

+ + +

+ See the section about segment info XML + files below for details. + +

+ +
--segment-uid SID1,SID2,... + +

+ Sets the segment UIDs to use. This is a comma-separated list of 128-bit + segment UIDs in the usual UID form: hex numbers with or without the + "0x" prefix, with or without spaces, exactly 32 digits. + +

+ + +

+ If SID starts with = then its rest is interpreted as the name of a Matroska + file whose segment UID is read and used. + +

+ + +

+ Each file created contains one segment, and each segment has one segment + UID. If more segment UIDs are specified than segments are created then the + surplus UIDs are ignored. If fewer UIDs are specified than segments are + created then random UIDs will be created for them. + +

+ +
+ + + +

2.3. Obsługa rozdziałów i tagów (opcje globalne)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language kod-języka + +

+ Sets the ISO 639-2 language code that is written for each chapter entry. + Defaults to 'eng'. See the section about chapters below for details. + +

+ + +

+ This option can be used both for simple chapter files and for source files + that contain chapters but no information about the chapters' language, + e.g. MP4 and OGM files. + +

+ + +

+ The language set with this option is also used when chapters are generated + with the --generate-chapters + option. + +

+ +
--chapter-charset zestaw-znaków + +

+ Sets the character set that is used for the conversion to UTF-8 for simple + chapter files. See the section about text files and character + sets for an explanation how mkvmerge(1) converts between character + sets. + +

+ + +

+ This switch does also apply to chapters that are copied from certain + container types, e.g. Ogg/OGM and MP4 files. See the section about chapters + below for details. + +

+ +
--chapter-sync + d[,o[/p]] + +

+ Adjust the timestamps of the chapters in the following source file by + d ms. Alternatively you can use the + --sync option with the special track ID + -2 (see section special track IDs). + +

+ + +

+ o/p: przesuwa czas o wielkość + o/p, aby naprawić liniowe + odchyły. p domyślnie jest 1, jeśli nie jest ustawiony + inaczej. Oba parametry o i p + mogą być liczbami zmiennoprzecinkowymi. + +

+ + +

+ Domyślnie: brak ręcznej korekcji synchronizacji (co jest tożsame z + d = 0 i + o/p = + 1.0). + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--generate-chapters mode + +

+ mkvmerge(1) can create chapters automatically. The following two modes are + currently supported: + +

+ + +
    + +
  • + +

    + 'when-appending' – This mode creates one chapter at the + start and one chapter whenever a file is appended. + +

    + + +

    + This mode also works with split modes 'parts:' and + 'parts-frames:'. For these modes one chapter will be + generated for each appended timestamp range (those whose start timestamps + are prefixed with '+'). + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1) requires a video or an audio track to be present in order to be + able to determine when a new file is appended. If one or more video tracks + are muxed the first one is used. Otherwise the first audio track is used. + +

    + +
    + +
  • + + +
  • + +

    + 'interval:time-spec' – This mode + creates one chapter at fixed intervals given by + time-spec. The format is either the form + HH:MM:SS.nnnnnnnnn or a number followed by one of the + units 's', 'ms' or + 'us'. + +

    + + +

    + Example: --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ The names for the new chapters are controlled by the option --generate-chapters-name-template. + The language is set with --chapter-language + which must occur before --generate-chapters. + +

+ +
--generate-chapters-name-template + template + +

+ This sets the name template for chapter names generated by the option --generate-chapters. + If the option is not used then default 'Chapter + <NUM:2>' will be used. + +

+ + +

+ There are several variables that can be used in the template that are + replaced by their actual values when a chapter is generated. The string + '<NUM>' will be replaced by the chapter number. The + string '<START>' will be replaced by the chapter's + start timestamp. + +

+ + +

+ The strings '<FILE_NAME>' and + '<FILE_NAME_WITH_EXT>' are only filled when + generating chapters for appended files. They will be replaced by the + appended file's name without respectively with its extension. Note that + only the file's base name and extension are inserted, not its directory or + drive components. + +

+ + +

+ You can specify a minimum number of places for the chapter number with + '<NUM:places>', + e.g. '<NUM:3>'. The resulting number will be + padded with leading zeroes if the number of places is less than specified. + +

+ + +

+ You can control the format used by the start timestamp with + <START:format>. The format defaults to + '%H:%M:%S' if none is given. Valid format codes are: + +

+ + +
    + +
  • + +

    %h – hours +

    + +
  • + +
  • + +

    %H – hours zero-padded to two places +

    + +
  • + +
  • + +

    %m – minutes +

    + +
  • + +
  • + +

    %M – minutes zero-padded to two places +

    + +
  • + +
  • + +

    %s – seconds +

    + +
  • + +
  • + +

    %S – seconds zero-padded to two places +

    + +
  • + +
  • + +

    %n – nanoseconds with nine places +

    + +
  • + +
  • + +

    %<1-9>n – nanoseconds with up to nine places + (e.g. three places with %3n) +

    + +
  • + +
+ +
--cue-chapter-name-format format + +

+ mkvmerge(1) supports reading CUE sheets for audio files as + the input for chapters. CUE sheets usually contain the + entries PERFORMER and TITLE for each + index entry. mkvmerge(1) uses these two strings in order to construct the + chapter name. With this option the format used for this name can be set. + +

+ + +

+ If this option is not given then mkvmerge(1) defaults to the format '%p + - %t' (the performer, followed by a space, a dash, another space and + the title). + +

+ + +

+ If the format is given then everything except the following meta characters + is copied as-is, and the meta characters are replaced like this: + +

+ + +
    + +
  • + +

    %p jest zastępowany przez aktualną wartość linii + PERFORMER, +

    + +
  • + +
  • + +

    %t jest zastępowany przez aktualną wartość linii + TITLE, +

    + +
  • + +
  • + +

    %n jest zastępowany przez obecny numer ściezki i +

    + +
  • + +
  • + +

    %N jest zastępowany przez aktualny numer ścieżki i + dodawanym zerem z przodu jeśli < 10. +

    + +
  • + +
+ +
--chapters nazwa-pliku + +

+ Read chapter information from the file file-name. See + the section about chapters below + for details. + +

+ +
--global-tags nazwa-pliku + +

+ Read global tags from the file file-name. See the + section about tags below for details. + +

+ +
+ + + +

2.4. General output control (advanced global options)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order + FID1:TID1,FID2:TID2,... + +

+ This option changes the order in which the tracks for an input file are + created. The argument is a comma separated list of pairs IDs. Each pair + contains first the file ID (FID1) which is simply the + number of the file on the command line starting at 0. The second is a track + ID (TID1) from that file. If some track IDs are + omitted then those tracks are created after the ones given with this option + have been created. + +

+ +
--cluster-length parametr + +

+ Limit the number of data blocks or the duration of data in each cluster. The + spec parameter can either be a number + n without a unit or a number d + postfixed with 'ms'. + +

+ + +

+ If no unit is used then mkvmerge(1) will put at most n + data blocks into each cluster. The maximum number of blocks is 65535. + +

+ + +

+ If the number d is postfixed with + 'ms' then mkvmerge(1) puts at most + d milliseconds of data into each cluster. The minimum + for d is '100ms', and the maximum + is '32000ms'. + +

+ + +

+ mkvmerge(1) defaults to putting at most 65535 data blocks and 5000ms of data + into a cluster. + +

+ + +

+ Programs trying to find a certain frame can only seek directly to a cluster + and have to read the whole cluster afterwards. Therefore creating larger + clusters may lead to imprecise or slow seeking. + +

+ +
--clusters-in-meta-seek + +

+ Tells mkvmerge(1) to create a meta seek element at the end of the file + containing all clusters. See also the section about the Matroska file layout. + +

+ +
--timestamp-scale współczynnik + +

+ Forces the timestamp scale factor to factor. Valid + values are in the range + 1000..10000000 or the special + value -1. + +

+ + +

+ Normally mkvmerge(1) will use a value of 1000000 which + means that timestamps and durations will have a precision of 1ms. For files + that will not contain a video track but at least one audio track mkvmerge(1) + will automatically chose a timestamp scale factor so that all timestamps and + durations have a precision of one audio sample. This causes bigger overhead + but allows precise seeking and extraction. + +

+ + +

+ If the special value -1 is used then mkvmerge(1) will + use sample precision even if a video track is present. + +

+ +
--enable-durations + +

+ Write durations for all blocks. This will increase file size and does not + offer any additional value for players at the moment. + +

+ +
--no-cues + +

+ Tells mkvmerge(1) not to create and write the cue data which can be compared + to an index in an AVI. Matroska(tm) files can be played back without the cue + data, but seeking will probably be imprecise and slower. Use this only if + you're really desperate for space or for testing purposes. See also option + --cues + which can be specified for each input file. + +

+ +
--no-date + +

+ By default mkvmerge(1) sets the "date" segment information field to the time + & date when multiplexing started. With this option that field is not + written at all. + +

+ +
--disable-lacing + +

+ Disables lacing for all tracks. This will increase the file's size, + especially if there are many audio tracks. This option is not intended for + everyday use. + +

+ +
--disable-track-statistics-tags + +

+ Normally mkvmerge(1) will write certain tags with statistics for each + track. If such tags are already present then they will be overwritten. The + tags are BPS, DURATION, + NUMBER_OF_BYTES and + NUMBER_OF_FRAMES. + +

+ + +

+ Enabling this option prevents mkvmerge(1) from writing those tags and from + touching any existing tags with same names. + +

+ +
--disable-language-ietf + +

+ Normally mkvmerge(1) will write the new IETF BCP 47 language elements in + addition to the legacy language elements in track headers, chapters and + tags. If this option is used, only the legacy elements are written. + +

+ +
--normalize-language-ietf mode + +

+ Enables normalizing all IETF BCP 47 language tags to either their canonical + form with mode 'canonical', to their extended language + subtags form with mode 'extlang' or turns it off with + mode 'off'. By default normalization to the canonical + form is applied. + +

+ + +

+ In the canonical form all subtags for which preferred values exist are + replaced by those preferred values. This converts + e.g. 'zh-yue-jyutping' to + 'yue-jyutping' or 'fr-FX' to + 'fr-FR'. + +

+ + +

+ For the extended language subtags form the canonical form is built + first. Afterwards all primary languages for which an extended language + subtag exists are replaced by that extended language subtag and its + prefix. This converts e.g. 'yue-jyutping' back to + 'zh-yue-jyutping' but has no effect on + 'fr-FR' as 'fr' is not an extended + language subtag. + +

+ +
--stop-after-video-ends + +

+ Stops processing after the primary video track ends, discarding any + remaining packets of other tracks. + +

+ +
+ + + +

2.5. Dzielenie plików, powiązanie, scalanie i łączenie (więcej opcji globalnych)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split parametr + +

+ Splits the output file after a given size or a given time. Please note that + tracks can only be split right before a key frame. Therefore the split + point may be a bit off from what the user has specified. + +

+ + +

+ At the moment mkvmerge(1) supports the following modes: + +

+ + +
    + +
  1. + +

    + Splitting by size. + +

    + + +

    + Syntax: --split + [size:]d[k|m|g] + +

    + + +

    + Przykłady: --split size:700m lub --split 150000000 + +

    + + +

    + The parameter d may end with 'k', + 'm' or 'g' to indicate that the size + is in KB, MB or GB respectively. Otherwise a size in bytes is assumed. + After the current output file has reached this size limit a new one will be + started. + +

    + + +

    + The 'size:' prefix may be omitted for compatibility + reasons. + +

    + +
  2. + + +
  3. + +

    + Splitting after a duration. + +

    + + +

    + Syntax: --split + [duration:]HH:MM:SS.nnnnnnnnn|ds + +

    + + +

    + Przykłady: --split duration:00:60:00.000 lub --split + 3600s + +

    + + +

    + The parameter must either have the form + HH:MM:SS.nnnnnnnnn for specifying the duration in up + to nano-second precision or be a number d followed by + the letter 's' for the duration in + seconds. HH is the number of hours, + MM the number of minutes, SS + the number of seconds and nnnnnnnnn the number of + nanoseconds. Both the number of hours and the number of nanoseconds can be + omitted. There can be up to nine digits after the decimal point. After the + duration of the contents in the current output has reached this limit a new + output file will be started. + +

    + + +

    + The 'duration:' prefix may be omitted for compatibility + reasons. + +

    + +
  4. + + +
  5. + +

    + Splitting after specific timestamps. + +

    + + +

    + Syntax: --split + timestamps:A[,B[,C...]] + +

    + + +

    + Przykład: --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + The parameters A, B, + C etc must all have the same format as the ones used + for the duration (see above). The list of timestamps is separated by + commas. After the input stream has reached the current split point's + timestamp a new file is created. Then the next split point given in this + list is used. + +

    + + +

    + The 'timestamps:' prefix must not be omitted. + +

    + +
  6. + + +
  7. + +

    + Keeping specific parts by specifying timestamp ranges while discarding + others. + +

    + + +

    + Syntax: --split + parts:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + Przykłady: +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + The parts mode tells mkvmerge(1) to keep certain ranges of + timestamps while discarding others. The ranges to keep have to be listed + after the parts: keyword and be separated by commas. A + range itself consists of a start and an end timestamp in the same format the + other variations of --split accept (e.g. both + 00:01:20 and 80s refer to the same + timestamp). + +

    + + +

    + If a start timestamp is left out then it defaults to the previous range's + end timestamp. If there was no previous range then it defaults to the start + of the file (see example 3). + +

    + + +

    + If an end timestamp is left out then it defaults to the end of the source + files which basically tells mkvmerge(1) to keep the rest (see example 3). + +

    + + +

    + Normally each range will be written to a new file. This can be changed so + that consecutive ranges are written to the same file. For that the user has + to prefix the start timestamp with a +. This tells + mkvmerge(1) not to create a new file and instead append the range to the same + file the previous range was written to. Timestamps will be adjusted so that + there will be no gap in the output file even if there was a gap in the two + ranges in the input file. + +

    + + +

    + In example 1 mkvmerge(1) will create two files. The first will contain the + content starting from 00:01:20 until + 00:02:45. The second file will contain the content + starting from 00:05:50 until 00:10:30. + +

    + + +

    + In example 2 mkvmerge(1) will create only one file. This file will contain + both the content starting from 00:01:20 until + 00:02:45 and the content starting from + 00:05:50 until 00:10:30. + +

    + + +

    + In example 3 mkvmerge(1) will create two files. The first will contain the + content from the start of the source files until + 00:02:45. The second file will contain the content + starting from 00:05:50 until the end of the source files. + +

    + + +
    +

    Note:

    + +

    + Note that mkvmerge(1) only makes decisions about splitting at key frame + positions. This applies to both the start and the end of each range. So even + if an end timestamp is between two key frames mkvmerge(1) will continue + outputting the frames up to but excluding the following key frame. + +

    + +
    + +
  8. + + +
  9. + +

    + Keeping specific parts by specifying frame/field number ranges while + discarding others. + +

    + + +

    + Syntax: --split + parts-frames:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + Przykłady: +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + The parts-frames mode tells mkvmerge(1) to keep certain + ranges of frame/field numbers while discarding others. The ranges to keep + have to be listed after the parts-frames: keyword and be + separated by commas. A range itself consists of a start and an end + frame/field number. Numbering starts at 1. + +

    + + +

    + If a start number is left out then it defaults to the previous range's end + number. If there was no previous range then it defaults to the start of the + file (see example 3). + +

    + + +

    + If an end number is left out then it defaults to the end of the source files + which basically tells mkvmerge(1) to keep the rest (see example 3). + +

    + + +

    + Normally each range will be written to a new file. This can be changed so + that consecutive ranges are written to the same file. For that the user has + to prefix the start number with a +. This tells + mkvmerge(1) not to create a new file and instead append the range to the same + file the previous range was written to. Timestamps will be adjusted so that + there will be no gap in the output file even if there was a gap in the two + ranges in the input file. + +

    + + +
    +

    Note:

    + +

    + Note that mkvmerge(1) only makes decisions about splitting at key frame + positions. This applies to both the start and the end of each range. So even + if an end frame/field number is between two key frames mkvmerge(1) will + continue outputting the frames up to but excluding the following key frame. + +

    + +
    + + +

    + In example 1 mkvmerge(1) will create two files. The first will contain the + content starting from the first key frame at or after 137 + up to but excluding the first key frame at or after + 258. The second file will contain the content starting + from 548 until 1211. + +

    + + +

    + In example 2 mkvmerge(1) will create only one file. This file will contain + both the content starting from 733 until + 912 and the content starting from 1592 + until 2730. + +

    + + +

    + In example 3 mkvmerge(1) will create two files. The first will contain the + content from the start of the source files until 430. The + second file will contain the content starting from 2512 + until the end of the source files. + +

    + + +

    + This mode considers only the first video track that is output. If no video + track is output no splitting will occur. + +

    + + +
    +

    Note:

    + +

    + The numbers given with this argument are interpreted based on the number of + Matroska(tm) blocks that are output. A single Matroska(tm) block contains + either a full frame (for progressive content) or a single field (for + interlaced content). mkvmerge does not distinguish between those two and + simply counts the number of blocks. For example: If one wanted to split + after the 25th full frame with interlaced content one would have to use + 50 (two fields per full frame) as the split point. + +

    + +
    + +
  10. + + +
  11. + +

    + Splitting after specific frames/fields. + +

    + + +

    + Syntax: --split + frames:A[,B[,C...]] + +

    + + +

    + Przykład: --split frames:120,237,891 + +

    + + +

    + The parameters A, B, + C etc must all be positive integers. Numbering + starts at 1. The list of frame/field numbers is separated by commas. After + the input stream has reached the current split point's frame/field number a + new file is created. Then the next split point given in this list is used. + +

    + + +

    + The 'frames:' prefix must not be omitted. + +

    + + +

    + This mode considers only the first video track that is output. If no video + track is output no splitting will occur. + +

    + + +
    +

    Note:

    + +

    + The numbers given with this argument are interpreted based on the number of + Matroska(tm) blocks that are output. A single Matroska(tm) block contains + either a full frame (for progressive content) or a single field (for + interlaced content). mkvmerge does not distinguish between those two and + simply counts the number of blocks. For example: If one wanted to split + after the 25th full frame with interlaced content one would have to use + 50 (two fields per full frame) as the split point. + +

    + +
    + +
  12. + + +
  13. + +

    + Splitting before specific chapters. + +

    + + +

    + Syntax: --split chapters:all or + --split + chapters:A[,B[,C...]] + +

    + + +

    + Przykład: --split chapters:5,8 + +

    + + +

    + The parameters A, B, + C etc must all be positive integers. Numbering + starts at 1. The list of chapter numbers is separated by commas. Splitting + will occur right before the first key frame whose timestamp is equal to or + bigger than the start timestamp for the chapters whose numbers are listed. + A chapter starting at 0s is never considered for splitting and discarded + silently. + +

    + + +

    + The keyword all can be used instead of listing all + chapter numbers manually. + +

    + + +

    + The 'chapters:' prefix must not be omitted. + +

    + + +
    +

    Note:

    + +

    + The Matroska(tm) file format supports arbitrary deeply nested chapter + structures called 'edition entries' and 'chapter atoms'. However, this mode + only considers the top-most level of chapters across all edition entries. + +

    + +
    + +
  14. + +
+ + +

+ For this splitting mode the output filename is treated differently than for + the normal operation. It may contain a printf like + expression '%d' including an optional field width, + e.g. '%02d'. If it does then the current file number will be + formatted appropriately and inserted at that point in the filename. If + there is no such pattern then a pattern of '-%03d' is assumed + right before the file's extension: '-o output.mkv' would result + in 'output-001.mkv' and so on. If there's no extension then + '-%03d' will be appended to the name. + +

+ + +

+ Another possible pattern is '%c' which will be replaced by the + name of the first chapter in the file. Note that when '%c' is + present, the pattern '-%03d' will not be added automatically. + +

+ +
--link + +

+ Link files to one another when splitting the output file. See the section on + file linking below for details. + +

+ +
--link-to-previous UID-segmentu + +

+ Links the first output file to the segment with the segment UID given by the + segment-UID parameter. See the section on file linking below for details. + +

+ + +

+ If SID starts with = then its rest is interpreted as the name of a Matroska + file whose segment UID is read and used. + +

+ +
--link-to-next UID-segmentu + +

+ Links the last output file to the segment with the segment UID given by the + segment-UID parameter. See the section on file linking below for details. + +

+ + +

+ If SID starts with = then its rest is interpreted as the name of a Matroska + file whose segment UID is read and used. + +

+ +
--append-mode tryb + +

+ Określa, jak kody czasowe są przeliczane podczas scalania plików. Parametr + tryb może mieć dwie wartości: + 'file', który jest domyślny oraz + 'track'. + +

+ + +

+ When mkvmerge appends a track (called 'track2_1' from now + on) from a second file (called 'file2') to a track + (called 'track1_1') from the first file (called + 'file1') then it has to offset all timestamps for + 'track2_1' by an amount. For 'file' + mode this amount is the highest timestamp encountered in + 'file1' even if that timestamp was from a different track + than 'track1_1'. In track mode the offset is the highest + timestamp of 'track1_1'. + +

+ + +

+ Unfortunately mkvmerge cannot detect which mode to use reliably. Therefore + it defaults to 'file' mode. 'file' + mode usually works better for files that have been created independently of + each other; e.g. when appending AVI or MP4 + files. 'track' mode may work better for sources that are + essentially just parts of one big file, e.g. for VOB and + EVO files. + +

+ + +

+ Subtitle tracks are always treated as if 'file' mode were + active even if 'track' mode actually is. + +

+ +
--append-to + SFID1:STID1:DFID1:DTID1[,...] + +

+ This option controls to which track another track is appended. Each spec + contains four IDs: a file ID, a track ID, a second file ID and a second + track ID. The first pair, "source file ID" and "source track ID", + identifies the track that is to be appended. The second pair, "destination + file ID" and "destination track ID", identifies the track the first one is + appended to. + +

+ + +

+ If this option has been omitted then a standard mapping is used. This + standard mapping appends each track from the current file to a track from + the previous file with the same track ID. This allows for easy appending if + a movie has been split into two parts and both file have the same number of + tracks and track IDs with the command mkvmerge -o output.mkv + part1.mkv +part2.mkv. + +

+ +
+ + +

+ A single '+' causes the next file to be appended instead of added. The '+' + can also be put in front of the next file name. Therefore the following two + commands are equivalent: + +

+ +
$ mkvmerge -o cały.mkv plik1.mkv + plik2.mkv
+$ mkvmerge -o cały.mkv plik1.mkv +plik2.mkv
+
[ file1 file2 + ] + +

+ If multiple file names are contained in a pair of square brackets then the + second and all following files will be appended to the first file named + within the brackets. + +

+ + +

+ This is an alternative syntax to using '+' between the file names. Therefore + the following two commands are equivalent: + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv '[' file1.mkv file2.mkv ']'
+
= + +

+ For certain file types (MPEG program streams = VOBs) mkvmerge(1) normally + looks for files in the same directory as an input file that have the same + base name and only differ in their running number (e.g. 'VTS_01_1.VOB', + 'VTS_01_2.VOB', 'VTS_01_3.VOB' etc) and treats all of those files as if they + were concatenated into a single big file. This option, a single '=', causes + mkvmerge not to look for those additional files. + +

+ + +

+ The '=' can also be put in front of the next file name. Therefore the + following two commands are equivalent: + +

+ +
$ mkvmerge -o full.mkv = file1.vob
+$ mkvmerge -o full.mkv =file1.vob
+
( plik1 plik2 + ) + +

+ If multiple file names are contained in a pair of parenthesis then those + files will be treated as if they were concatenated into a single big file + consisting of the content of each of the files one after the other. + +

+ + +

+ This can be used for e.g. VOB files coming from a DVD or MPEG transport + streams. It cannot be used if each file contains its own set of headers + which is usually the case with stand-alone files like AVI or MP4. + +

+ + +

+ Putting a file name into parenthesis also prevents mkvmerge(1) from looking + for additional files with the same base name as described in option + =. Therefore these two command lines are equivalent: + +

+ +
$ mkvmerge -o wyjściowy.mkv = plik.mkv
+$ mkvmerge -o wyjściowy.mkv '(' plik.mkv ')'
+ +

+ Several things should be noted: + +

+ + +
    + +
  1. + +

    + There must be spaces both after the opening and before the closing + parenthesis. + +

    + +
  2. + + +
  3. + +

    + Every parameter between parenthesis is interpreted as a file name. Therefore + all options applying to this logical file must be listed before the opening + parenthesis. + +

    + +
  4. + + +
  5. + +

    + Some shells treat parenthesis as special characters. Hence you must escape + or quote them as shown in the example above. + +

    + +
  6. + +
+ +
+ + + + +

2.6. Obsługa załączników (więcej globalnych opcji)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description opis + +

+ Plain text description of the following attachment. Applies to the next + --attach-file + or --attach-file-once option. + + +

+ +
--attachment-mime-type typ MIME + +

+ Typ MIME następującego załącznika. Używany razem z opcją + --attach-file + lub --attach-file-once. + Lista oficjalnie rozpoznawanych typów MIME może się + znajdować na stronie domowej + IANA. Typ MIME jest wymagany dla określenia + załącznika. + +

+ + +

+ If no MIME type is given a for an attachment, its type will + be detected automatically. + +

+ +
--attachment-name nazwa + +

+ Sets the name that will be stored in the output file for this attachment. + If this option is not given then the name will be derived from the file name + of the attachment as given with the --attach-file + or the --attach-file-once + option. + +

+ +
+ --attach-file nazwa-pliku, + --attach-file-once nazwa-pliku + + +

+ Creates a file attachment inside the Matroska(tm) file. The + MIME type must have been set before this option can + used. The difference between the two forms is that during splitting the + files attached with --attach-file are attached to all + output files while the ones attached with + --attach-file-once are only attached to the first file + created. If splitting is not used then both do the same. + +

+ + +

+ mkvextract(1) can be used to extract attached files from a Matroska(tm) file. + +

+ +
--enable-legacy-font-mime-types + +

+ Enables the use of legacy MIME types for certain types of + font attachments. For example, + 'application/x-truetype-font' will be used for TrueType + fonts instead of 'fonts/ttf'. + +

+ + +

+ This affects both new attachments if its MIME type is + detected automatically and existing attachments whose stored + MIME types will be remapped to the legacy ones. + +

+ + +

+ The affected MIME types are 'font/sfnt', + 'font/ttf' and 'font/collection' which + are all mapped to 'application/x-truetype-fonts' and + 'font/otf' which is mapped to + 'application/vnd.ms-opentype'. + +

+ +
+ + + +

2.7. Opcje mogące być użyte dla każdego pliku wejściowego

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks + [!]n,m,... + +

+ Copy the audio tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch. They're not simply the track numbers (see section track IDs). Default: copy all audio + tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ Domyślnie: kopiuj wszystkie ścieżki tego rodzaju. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-d, --video-tracks + [!]n,m,... + +

+ Copy the video tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch. They're not simply the track numbers (see section track IDs). Default: copy all video + tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-s, --subtitle-tracks + [!]n,m,... + +

+ Copy the subtitle tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch. They're not simply the track numbers (see section track IDs). Default: copy all subtitle + tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
-b, --button-tracks + [!]n,m,... + +

+ Copy the button tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch. They're not simply the track numbers (see section track IDs). Default: copy all button + tracks. + +

+ + +

+ Instead of track IDs you can also provide ISO 639-2 language codes. This + will only work for source files that provide language tags for their tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy all tracks of this kind but the ones listed after the + !. + +

+ +
--track-tags + [!]n,m,... + +

+ Copy the tags for tracks n, m + etc. The numbers are track IDs which can be obtained with the --identify + switch (see section track IDs). + They're not simply the track numbers. Default: copy tags for all tracks. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy everything but the IDs listed after the !. + +

+ +
-m, --attachments + [!]n[:all|first],m[:all|first],... + +

+ Copy the attachments with the IDs n, + m etc to all or only the first output file. Each ID + can be followed by either ':all' (which is the default if + neither is entered) or ':first'. If splitting is active + then those attachments whose IDs are specified with + ':all' are copied to all of the resulting output files + while the others are only copied into the first output file. If splitting is + not active then both variants have the same effect. + +

+ + +

+ The default is to copy all attachments to all output files. + +

+ + +

+ If the IDs are prefixed with ! then the meaning is + reversed: copy everything but the IDs listed after the !. + +

+ +
-A, --no-audio + +

+ Żadna ścieżka dźwiękowa nie jest kopiowana z tego pliku. + +

+ +
-D, --no-video + +

+ Żadne ścieżki obrazu nie są kopiowane z tego pliku. + +

+ +
-S, --no-subtitles + +

+ Żadna ścieżka napisów nie jest kopiowana z tego pliku. + +

+ +
-B, --no-buttons + +

+ Żadna ścieżka przycisków nie jest kopiowana z tego pliku. + +

+ +
-T, --no-track-tags + +

+ Żadne pliki tagów nie są kopiowane z tego pliku. + +

+ +
--no-chapters + +

+ Żadne rozdziały nie są kopiowane z tego pliku. + +

+ +
-M, --no-attachments + +

+ Żadne załączniki nie są kopiowane z tego pliku. + +

+ +
--no-global-tags + +

+ Żadne globalne tagi nie są kopiowane z tego pliku. + +

+ +
-y, --sync + TID:d[,o[/p]] + +

+ Dostosowuje kody czasowe ścieżki z id TID o + d ms. ID ścieżek są takie same jak wyświetlone w + opcji --identify + (patrz rozdział ID ścieżek). + +

+ + +

+ o/p: przesuwa czas o wielkość + o/p, aby naprawić liniowe + odchyły. p domyślnie jest 1, jeśli nie jest ustawiony + inaczej. Oba parametry o i p + mogą być liczbami zmiennoprzecinkowymi. + +

+ + +

+ Domyślnie: brak ręcznej korekcji synchronizacji (co jest tożsame z + d = 0 i + o/p = + 1.0). + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--cues TID:none|iframes|all + +

+ Controls for which tracks cue (index) entries are created for the given + track (see section track + IDs). 'none' inhibits the creation of cue + entries. For 'iframes' only blocks with no backward or + forward references ( = I frames in video tracks) are put into the cue + sheet. 'all' causes mkvmerge(1) to create cue entries for + all blocks which will make the file very big. + +

+ + +

+ The default is 'iframes' for video and subtitle tracks + and 'none' for audio tracks. See also option --no-cues + which inhibits the creation of cue entries regardless of the + --cues options used. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--default-track-flag + TID[:bool] + +

+ Sets the "default track" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. The flag will be set if the source container doesn't + provide that information and the user doesn't specify it via this option. + +

+ + +

+ If the user does not explicitly select a track during playback, the player + should select one of the tracks that has its "default track" flag + set, taking user preferences such as their preferred language into account. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--track-enabled-flag + TID[:bool] + +

+ Sets the "track enabled" flag for the given track (see section + track IDs) to the given value + bool (0 or 1; defaults to 1 if not specified). + Tracks are enabled by default if no option is specified for them and the + source container doesn't provide this information either. + +

+ + +

+ Only tracks whose "track enabled" flag is set should be considered + for playback. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--forced-display-flag + TID[:bool] + +

+ Sets the "forced display" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. Use this for tracks containing onscreen text or + foreign-language dialogue. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--hearing-impaired-flag + TID[:bool] + +

+ Sets the "hearing impaired" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track is suitable for users + with hearing impairments. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--visual-impaired-flag + TID[:bool] + +

+ Sets the "visual impaired" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track is suitable for users + with visual impairments. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--text-descriptions-flag + TID[:bool] + +

+ Sets the "text descriptions" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track contains textual + descriptions of video content suitable for playback via a text-to-speech + system for a visually-impaired user. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--original-flag + TID[:bool] + +

+ Sets the "original language" flag for the given track (see section + track IDs) if the optional + argument bool is set to 1 or if + it isn't present. This flag can be set if the track is in the content's + original language (not a translation). + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--commentary-flag + TID[:bool] + +

+ Sets the "commentary" flag for the given track (see section track IDs) if the optional argument + bool is set to 1 or if it isn't + present. This flag can be set if the track contains commentary. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
--track-name TID:nazwa + +

+ Sets the track name for the given track (see section track IDs) to + name. + +

+ +
--language TID:język + +

+ Sets the language for the given track (see section track IDs). Both ISO 639-2 language + codes and ISO 639-1 country codes are allowed. The country codes will be + converted to language codes automatically. All languages including their + ISO 639-2 codes can be listed with the --list-languages + option. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
-t, --tags + TID:nazwa-pliku + +

+ Read tags for the track with the number TID from the + file file-name. See the section about tags below for details. + +

+ +
--aac-is-sbr + TID[:0|1] + +

+ Tells mkvmerge(1) that the track with the ID TID is + SBR AAC (also known as HE-AAC or + AAC+). This options is needed if a) the source file is an + AAC file (not for a Matroska(tm) file) + and b) the AAC file contains SBR AAC + data. The reason for this switch is that it is technically impossible to + automatically tell normal AAC data from SBR + AAC data without decoding a complete AAC frame. As + there are several patent issues with AAC decoders + mkvmerge(1) will never contain this decoding stage. So for SBR + AAC files this switch is mandatory. The resulting file might not + play back correctly or even not at all if the switch was omitted. + +

+ + +

+ If the source file is a Matroska(tm) file then the + CodecID should be enough to detect SBR + AAC. However, if the CodecID is wrong then + this switch can be used to correct that. + +

+ + +

+ If mkvmerge wrongfully detects that an AAC file is + SBR then you can add ':0' to the track + ID. + +

+ +
--audio-emphasis TID:n|symbolic-name + +

+ Sets the emphasis for the audio track with the track ID + TID. The mode can either be a number + n (certain values between 0 and + 16) or a symbolic name. All valid numbers & + symbolic names can be listed with the --list-audio-emphasis + option. + +

+ +
--reduce-to-core TID + +

+ Some audio codecs have a lossy core and optional extensions that implement + lossless decoding. This option tells mkvmerge(1) to only copy the core but + not the extensions. By default mkvmerge(1) copies both the core and the + extensions. + +

+ + +

+ Obecnie tylko ścieżki DTS są obsługiwane przez tę + opcję. Ścieżki TrueHD zawierające wbudowany rdzeń AC-3 są + natomiast pokazywane jako dwie oddzielne ścieżki, które użytkownik może + wybrać do skopiowania. Przy DTS taki sposób nie + zadziałałby, jako że rozszerzenia HD nie mogą być zdekodowane oddzielnie - + odwrotnie jak w przypadku danych TrueHD. + +

+ +
--remove-dialog-normalization-gain + TID + +

+ Some audio codecs contain header fields that tell the decoder or player to + apply a (usually negative) gain for dialog normalization. This option tells + mkvmerge(1) to remove or minimize that gain by modifying the corresponding + header fields. + +

+ + +

+ Currently only AC-3, DTS and + TrueHD tracks are affected by this option. + +

+ +
--timestamps TID:nazwa-pliku + +

+ Read the timestamps to be used for the specific track ID from + file-name. These timestamps forcefully override the + timestamps that mkvmerge(1) normally calculates. Read the section about external timestamp files. + +

+ +
--default-duration TID:x + +

+ Forces the default duration of a given track to the specified value. Also + modifies the track's timestamps to match the default duration. The argument + x must be postfixed with 's', + 'ms', 'us', 'ns', + 'fps', 'p' or 'i' + to specify the default duration in seconds, milliseconds, microseconds, + nanoseconds, 'frames per second', 'progressive frames per second' or + 'interlaced frames per second' respectively. The number + x itself can be a floating point number or a + fraction. + +

+ + +

+ If the default duration is not forced then mkvmerge will try to derive the + track's default duration from the container and/or the encoded bitstream for + certain track types, e.g. AVC/H.264 or MPEG-2. + +

+ + +

+ This option can also be used to change the FPS of video + tracks without having to use an external timestamp file. + +

+ +
--fix-bitstream-timing-information + TID[:0|1] + +

+ Normally mkvmerge(1) does not change the timing information (frame/field + rate) stored in the video bitstream. With this option that information is + adjusted to match the container timing information. The container timing + information can come from various sources: from the command line (see option + --default-duration), + the source container or derived from the bitstream. + +

+ + +
+

Note:

+ +

To zostało zaimplementowane jak dotąd tylko dla ścieżek obrazu AVC/H.264.

+ +
+ +
--compression TID:n + +

+ Selects the compression method to be used for the track. Note that the + player also has to support this method. Valid values are + 'none', 'zlib' and + 'mpeg4_p2'/'mpeg4p2'. + +

+ +

+ The compression method + 'mpeg4_p2'/'mpeg4p2' is a special + compression method called 'header removal' that is only available for + MPEG4 part 2 video tracks. + +

+ +

+ The default for some subtitle types is 'zlib' + compression. This compression method is also the one that most if not all + playback applications support. Support for other compression methods other + than 'none' is not assured. + +

+ +
+ + + +

2.8. Opcje mające zastosowanie tylko do ścieżek obrazu

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc + TID:FourCC + +

+ Forces the FourCC to the specified value. Works only + for video tracks in the 'MS compatibility mode'. + +

+ +
--display-dimensions + TID:szerokośćxwysokość + +

+ Pliki Matroska(tm) zawierają dwie wartości określające właściwości + wyświetlania, które odtwarzacz powinien brać pod uwagę podczas odtwarzania: + wyświetlana szerokość i wysokość. Te wartości mogą być ustawione z tą + opcją, np. '1:640x480'. + +

+ + +

+ Another way to specify the values is to use the --aspect-ratio + or the --aspect-ratio-factor + option (see below). These options are mutually exclusive. + +

+ +
--aspect-ratio + TID:ratio|width/height + +

+ Pliki Matroska(tm) zawierają dwie wartości określające właściwości + wyświetlania, które odtwarzacz powinien brać pod uwagę podczas odtwarzania: + wyświetlana szerokość i wysokość. Za pomocą tej opcji mkvmerge(1) + automatycznie obliczy szerokość i wysokość wyświetlania, bazując na + oryginalnej szerokości i wysokości obrazu oraz proporcjach obrazu. + Proporcje mogą być podane zarówno jako liczba zmiennoprzecinkowa + proporcja, jak i jako ułamek + 'szerokość/wysokość', + np. '16/9'. + +

+ + +

+ Another way to specify the values is to use the --aspect-ratio-factor + or --display-dimensions + options (see above and below). These options are mutually exclusive. + +

+ +
--aspect-ratio-factor + TID:współczynnik|n/d + +

+ Another way to set the aspect ratio is to specify a + factor. The original aspect ratio is first multiplied + with this factor and used as the target aspect ratio + afterwards. + +

+ + +

+ Another way to specify the values is to use the --aspect-ratio + or --display-dimensions + options (see above). These options are mutually exclusive. + +

+ +
--cropping TID:lewo,góra,prawo,dół + +

+ Sets the pixel cropping parameters of a video track to the given values. + +

+ +
--color-matrix-coefficients TID:n + +

+ Sets the matrix coefficients of the video used to derive luma and chroma + values from red, green and blue color primaries. The parameter + n is an integer rangeing from 0 + and 10. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: GBR, 1: BT709, + 2: unspecified, 3: reserved, + 4: FCC, 5: BT470BG, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 non-constant + luminance, 10: BT2020 constant luminance + +

+ +
--color-bits-per-channel TID:n + +

+ Sets the number of coded bits for a color channel. A value of + 0 indicates that the number of bits is unspecified. + +

+ +
--chroma-subsample TID:hori,vert + +

+ The amount of pixels to remove in the Cr and Cb channels for every pixel not + removed horizontally/vertically. + +

+ + +

+ Example: For video with 4:2:0 chroma subsampling, the parameter should be + set to + TID:1,1. + +

+ +
--cb-subsample TID:hori,vert + +

+ The amount of pixels to remove in the Cb channel for every pixel not removed + horizontally/vertically. This is additive with + --chroma-subsample. + +

+ + +

+ Example: For video with 4:2:1 chroma subsampling, the parameter + --chroma-subsample should be set to + TID:1,0 + and Cb-subsample should be set to + TID:1,0. + +

+ +
--chroma-siting TID:hori,vert + +

+ Sets how chroma is sited horizontally/vertically (0: + unspecified, 1: top collocated, 2: + half). + +

+ +
--color-range TID:n + +

+ Sets the clipping of the color ranges (0: unspecified, + 1: broadcast range, 2: full range + (no clipping), 3: defined by + MatrixCoefficients/TransferCharacteristics). + +

+ +
--color-transfer-characteristics + TID:n + +

+ The transfer characteristics of the video. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: gamma 2.2 curve, 5: gamma 2.8 + curve, 6: SMPTE 170M, 7: SMPTE + 240M, 8: linear, 9: log, + 10: log sqrt, 11: IEC 61966-2-4, + 12: ITU-R BT.1361 extended color gamut, + 13: IEC 61966-2-1, 14: ITU-R + BT.2020 10 bit, 15: ITU-R BT.2020 12 bit, + 16: SMPTE ST 2084, 17: SMPTE ST + 428-1; 18: ARIB STD-B67 (HLG) + +

+ +
--color-primaries TID:n + +

+ Sets the color primaries of the video. + +

+ + +

+ Valid values and their meaning are: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: ITU-R BT.470M, 5: ITU-R + BT.470BG, 6: SMPTE 170M, 7: SMPTE + 240M, 8: FILM, 9: ITU-R BT.2020, + 10: SMPTE ST 428-1, 22: JEDEC P22 + phosphors + +

+ +
--max-content-light TID:n + +

+ Sets the maximum brightness of a single pixel (Maximum Content Light Level) + in candelas per square meter (cd/m²). The value of n + should be a non-negtive integer. + +

+ +
--max-frame-light TID:n + +

+ Sets the maximum brightness of a single full frame (Maximum Frame-Average + Light Level) in candelas per square meter (cd/m²). The value of + n should be a non-negtive integer. + +

+ +
--chromaticity-coordinates + TID:red-x,red-y,green-x,green-y,blue-x,blue-y + +

+ Sets the red/green/blue chromaticity coordinates as defined by CIE 1931. + +

+ +
--white-color-coordinates TID:x,y + +

+ Sets the white color chromaticity coordinates as defined by CIE 1931. + +

+ +
--max-luminance TID:float + +

+ Sets the maximum luminance in candelas per square meter (cd/m²). The value + should be less than 9999.99. + +

+ +
--min-luminance TID:float + +

+ Sets the minimum luminance in candelas per square meter (cd/m²). The value + should be less than 999.9999. + +

+ +
--projection-type TID:method + +

+ Sets the video projection method used. Valid values are 0 (rectangular + projection), 1 (equirectangular projection), 2 (cubemap projection) and 3 + (mesh projection). + +

+ +
--projection-private TID:data + +

+ Sets private data that only applies to a specific projection. Data must be + given as hex numbers with or without the "0x" prefix, with or + without spaces. + +

+ +
--projection-pose-yaw TID:float + +

+ Specifies a yaw rotation to the projection. + +

+ +
--projection-pose-pitch TID:float + +

+ Specifies a pitch rotation to the projection. + +

+ +
--projection-pose-roll TID:float + +

+ Specifies a roll rotation to the projection. + +

+ +
--field-order TID:n + +

+ Sets the field order for the video track with the track ID + TID. The order must be one of the following numbers: + +

+ + +

+ 0: progressive; 1: interlaced with + top field displayed first and top field stored first; + 2: undetermined field order; 6: + interlaced with bottom field displayed first and bottom field stored first; + 9: interlaced with bottom field displayed first and top + field stored first; 14: interlaced with top field + displayed first and bottom field stored first + +

+ +
--stereo-mode TID:n|symbolic-name + +

+ Sets the stereo mode for the video track with the track ID + TID. The mode can either be a number + n between 0 and + 14 or a symbolic name. All valid numbers & names + can be listed with the --list-stereo-modes + option. + +

+ +
+ + + +

2.9. Opcje mające zastosowanie tylko do ścieżek napisów

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset TID:zestaw-znaków + +

+ Sets the character set for the conversion to UTF-8 for UTF-8 subtitles for + the given track ID. If not specified the charset will be derived from the + current locale settings. Note that a charset is not needed for subtitles + read from Matroska(tm) files or from Kate streams, as these are always stored + in UTF-8. See the section about text files and character + sets for an explanation how mkvmerge(1) converts between character + sets. + +

+ + +

+ This option can be used multiple times for an input file applying to several + tracks by selecting different track IDs each time. + +

+ +
+ + + +

2.10. Pozostałe opcje

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify + nazwa-pliku + +

+ Will let mkvmerge(1) probe the single file and report its type, the tracks + contained in the file and their track IDs. If this option is used then the + only other option allowed is the filename. + +

+ + +

The output format used for the result can be changed with the option --identification-format. +

+ +
-J file-name + +

+ This is a convenient alias for "--identification-format json + --identify file-name". + +

+ +
-F, --identification-format + format + +

+ Determines the output format used by the --identify + option. The following formats are supported: text + (the default if this option isn't used) and json. + +

+ + +
    + +
  1. + +

    The text format is short and human-readable. It consists + of one line per item found (container, tracks, attachments etc.). +

    + + +

    This format is not meant to be parsed. The output will be translated into + the language mkvmerge(1) uses (see also --ui-language). +

    + +
  2. + + +
  3. + +

    + The json format outputs a machine-readable JSON + representation. This format follows the JSON schema described in the + following file: + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + All versions of the JSON schema are available both online and in the + released source code archives. + +

    + +
  4. + +
+ +
--probe-range-percentage percentage + +

+ File types such as MPEG program and transport streams + (.vob, .m2ts) require parsing a + certain amount of data in order to detect all tracks contained in the file. + This amount is 0.3% of the source file's size or 10 MB, whichever is higher. + +

+ + +

+ If tracks are known to be present but not found then the percentage to probe + can be changed with this option. The minimum of 10 MB is built-in and + cannot be changed. + +

+ +
--list-audio-emphasis + +

+ Lists all valid numbers & their corresponding symbolic names for the + --audio-emphasis + option. + +

+ +
--list-languages + +

+ Lists all languages and their ISO 639-2 code which can be used with the + --language + option. + +

+ +
--list-stereo-modes + +

+ Lists all valid numbers & their corresponding symbolic names for the + --stereo-mode + option. + +

+ +
-l, --list-types + +

+ Lista obsługiwanych plików wejściowych. + +

+ +
--priority priorytet + +

+ Sets the process priority that mkvmerge(1) runs with. Valid values are + 'lowest', 'lower', + 'normal', 'higher' and + 'highest'. If nothing is given then + 'normal' is used. On Unix like systems mkvmerge(1) will + use the + nice(2) + function. Therefore only the super user can use 'higher' + and 'highest'. On Windows all values are useable for + every user. + +

+ + +

Selecting 'lowest' also causes mkvmerge(1) to select idle + I/O priority in addition to the lowest possible process priority. +

+ +
--command-line-charset zestaw-znaków + +

+ Sets the character set to convert strings given on the command line from. It + defaults to the character set given by system's current locale. This + settings applies to arguments of the following options: --title, --track-name + and --attachment-description. + +

+ +
--output-charset zestaw-znaków + +

+ Sets the character set to which strings are converted that are to be + output. It defaults to the character set given by system's current locale. + +

+ +
-r, --redirect-output + nazwa-pliku + +

+ Zapisuje wszystkie powiadomienia do pliku nazwa-pliku + zamiast do konsoli. Podczas gdy może być to robione łatwo z przekierowaniem + wyjścia, są przypadki, gdy ta opcja właśnie jest potrzebna: gdy terminal + ponownie interpretuje plik wyjściowy przed zapisaniem do pliku. Uznawany + będzie zestaw znaków ustawiony z opcją --output-charset. + +

+ +
--flush-on-close + +

+ Tells the program to flush all data cached in memory to storage when closing + files opened for writing. This can be used to prevent data loss on power + outages or to circumvent certain problems in the operating system or + drivers. The downside is that multiplexing will take longer as mkvmerge + will wait until all data has been written to the storage before exiting. + See issues #2469 and #2480 on the MKVToolNix bug tracker for in-depth + discussions on the pros and cons. + +

+ +
--ui-language kod + +

+ Forces the translations for the language code to be + used (e.g. 'de_DE' for the German + translations). Entering 'list' as the + code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Nakazuje programowi przerwanie po wyemitowaniu pierwszego ostrzeżenia. Kodem + wyjścia programu będzie 1. + +

+ +
--deterministic seed + +

+ Enables the creation of byte-identical files if the same version of + mkvmerge(1) is used with the same source files, the same set of options and + the same seed. Note that the "date" segment information field is not + written in this mode. + +

+ + +

The seed can be an arbitrary string and does not have to be a number.

+ + +

+ The result of byte-identical files is only guaranteed under the following + conditions: + +

+ + +
    + +
  1. + +

    The same version of mkvmerge(1) built with the same versions of libEBML and + libMatroska is used. +

    + +
  2. + + +
  3. + +

    The source files used are byte-identical.

    + +
  4. + + +
  5. + +

    The same command line options are used in the same order (with the notable + exception of --output …). +

    + +
  6. + +
+ + +

+ Using other versions of mkvmerge(1) or other command-line options may result + in the same byte-identical file but is not guaranteed to do so. + +

+ +
--debug temat + +

+ Włącz debugowanie dla konkretnej funkcji. Ta opcja jest użyteczna tylko dla + deweloperów. + +

+ +
--engage funkcja + +

+ Włącz funkcje eksperymentalne. Listę dostępnych funkcji można uzyskać za + pomocą komendy mkvmerge --engage list. Te funkcje nie są + przeznaczone do użytku w normalnych sytuacjach. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that + can tell a controlling GUI what's happening. These messages follow the + format '#GUI#message'. The message may be followed by + key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the + messages nor the keys are ever translated and always output in English. + +

+ +
@options-file.json + +

+ Reads additional command line arguments from the file + options-file. See the section about option files for further information. + +

+ +
--capabilities + +

+ Lists information about optional features that have been compiled in and + exit. The first line output will be the version information. All following + lines contain exactly one word whose presence indicates that the feature has + been compiled in. These features are: + +

+ + +
    + +
  • + +

    + "FLAC" -- wczytywanie surowych plików + FLAC i umieszczanie ścieżek FLAC w innych + kontenerach, np. Ogg(tm) albo Matroska(tm). + +

    + +
  • + +
+ +
-h, --help + +

+ Pokaż informację o sposobie użycia opcji i wyjdź. + +

+ +
-V, --version + +

+ Pokaż informację o wersji i wyjdź. + +

+ +
+ + +

3. Użycie

+ + +

+ For each file the user can select which tracks mkvmerge(1) should take. They + are all put into the file specified with -o. A list of + known (and supported) source formats can be obtained with the + -l option. + +

+ + +
+

Important:

+ +

+ The order of command line options is important. Please read the section + "Option order" if + you're new to the program. + +

+ +
+ +

4. Kolejność opcji

+ + + +

+ The order in which options are entered is important for some + options. Options fall into two categories: + +

+ + +
    + +
  1. + +

    + Options that affect the whole program and are not tied to any input + file. These include but are not limited to + --command-line-charset, --output or + --title. These can appear anywhere on the command line. + +

    + +
  2. + + +
  3. + +

    + Options that affect a single input file or a single track in an input + file. These options all apply to the following input file on the command + line. All options applying to the same input (or to tracks from the same + input file) file can be written in any order as long as they all appear + before that input file's name. Examples for options applying to an input + file are --no-chapters or + --chapter-charset. Examples for options applying to a + single track are --default-duration or + --language. + +

    + +
  4. + +
+ + +

+ The options are processed from left to right. If an option appears multiple + times within the same scope then the last occurrence will be used. Therefore + the title will be set to "Something else" in the following + example: + +

+ +
$ mkvmerge -o wyjściowy.mkv --title "To i tamto" wejściowy.avi --title "Coś innego"
+ +

+ The following example shows that using the --language + option twice is OK because they're used in different scopes. Even though + they apply to the same track ID they apply to different input files and + therefore have different scopes: + +

+ +
$ mkvmerge -o wyjściowy.mkv --language 0:fre français.ogg --language 0:pol polski.ogg
+

5. Przykłady

+ + +

+ Let's assume you have a file called MyMovie.avi and the audio track in a + separate file, e.g. 'MyMovie.wav'. First you want to + encode the audio to OggVorbis(tm): + +

+ +
$ oggenc -q4 -oMójPlik.ogg MójPlik.wav
+ +

+ Po kilku minutach możesz połączyć obraz i dźwięk: + +

+ +
$ mkvmerge -o MójFilm-z-dźwiękiem.mkv MójFilm.avi MójFilm.ogg
+ +

+ If your AVI already contains an audio track then it will be + copied as well (if mkvmerge(1) supports the audio format). To avoid that + simply do + +

+ +
$ mkvmerge -o MójFilm-z-dźwiękiem.mkv -A MójFilm.avi MójFilm.ogg
+ +

+ After some minutes of consideration you rip another audio track, e.g. the + director's comments or another language to + 'MyMovie-add-audio.wav'. Encode it again and join it up + with the other file: + +

+ +
$ oggenc -q4 -oMójFilm-dodatk-audio.ogg MójFilm-dodatk-audio.wav
+$ mkvmerge -o MF-kompletny.mkv MójFilm-z-dźwiękiem.mkv MójFilm-dodatk-audio.ogg
+ +

+ Taki sam wynik może być osiągnięty z + +

+ +
$ mkvmerge -o MF-kompletny.mkv -A MójFilm.avi MójFilm.ogg MójFilm-dodatk-audio.ogg
+ +

+ Now fire up mplayer(tm) and enjoy. If you have + multiple audio tracks (or even video tracks) then you can tell + mplayer(tm) which track to play with the + '-vid' and '-aid' options. These are + 0-based and do not distinguish between video and audio. + +

+ + +

+ If you need an audio track synchronized you can do that easily. First find + out which track ID the Vorbis track has with + +

+ +
$ mkvmerge --identify braksynchro.ogg
+ +

+ Teraz możesz użyć tego ID w następującej linii komend: + +

+ +
$ mkvmerge -o synchro.mkv -A źródło.avi -y 12345:200 bezsynchro.ogg
+ +

+ This would add 200ms of silence at the beginning of the audio track with the + ID 12345 taken from 'outofsync.ogg'. + +

+ + +

+ Some movies start synced correctly but slowly drift out of sync. For these + kind of movies you can specify a delay factor that is applied to all + timestamps -- no data is added or removed. So if you make that factor too + big or too small you'll get bad results. An example is that an episode I + transcoded was 0.2 seconds out of sync at the end of + the movie which was 77340 frames long. At + 29.97fps 0.2 seconds correspond to + approx. 6 frames. So I did + +

+ +
$ mkvmerge -o synchro.mkv -y 23456:0,77346/77340 bezsynchro.mkv
+ +

+ Wynik jest poprawny. + +

+ + +

+ The sync options can also be used for subtitles in the same manner. + +

+ + +

+ For text subtitles you can either use some Windows software (like + SubRipper(tm)) or the + subrip(tm) package found in + transcode(1)'s + sources in the 'contrib/subrip' directory. The general + process is: + +

+ + +
    + +
  1. + +

    wyodrębnia surową ścieżkę napisów ze źródła:

    +
    $ tccat -i /ścieżka/do/skopiowanego/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o mójplik
    +
  2. + + +
  3. + +

    konwertuje wynikowe obrazy PGM na tekst przy pomocy gocr:

    +
    $ pgm2txt mójplik
    +
  4. + + +
  5. + +

    spell-check the resulting text files:

    +
    $ ispell -d polski *txt
    +
  6. + + +
  7. + +

    konwertuje pliki tekstowe do pliku SRT:

    +
    $ srttool -s -w -i mójplik.srtx -o mójplik.srt
    +
  8. + +
+ + +

+ The resulting file can be used as another input file for mkvmerge(1): + +

+ +
$ mkvmerge -o mójfilm.mkv mójfilm.avi mójfilm.srt
+ +

+ If you want to specify the language for a given track then this is easily + done. First find out the ISO 639-2 code for your language. mkvmerge(1) can + list all of those codes for you: + +

+ +
$ mkvmerge --list-languages
+ +

+ Search the list for the languages you need. Let's assume you have put two + audio tracks into a Matroska(tm) file and want to set their language codes and + that their track IDs are 2 and 3. This can be done with + +

+ +
$ mkvmerge -o z-kodami-język.mkv --language 2:pol --language 3:eng bez-kodów-język.mkv
+ +

+ As you can see you can use the --language + switch multiple times. + +

+ + +

+ Maybe you'd also like to have the player use the Dutch language as the + default language. You also have extra subtitles, e.g. in English and French, + and want to have the player display the French ones by default. This can be + done with + +

+ +
$ mkvmerge -o z-kodami-język.mkv --language 2:pol --language 3:dut --default-track-flag 3 bez-kodów-język.mkv --language 0:eng english.srt --default-track-flag 0 --language 0:fre french.srt
+ +

+ If you do not see the language or default track flags that you've specified + in mkvinfo(1)'s output then please read the section about default values. + +

+ + +

+ Wyłącz kompresję dla pliku wejściowego. + +

+ +
$ mkvmerge -o bez-kompresji.mkv --compression -1:none MójFilm.avi --compression -1:none mójfilm.srt
+ +

6. Track IDs

+ + + +

6.1. Regular track IDs

+ + + +

+ Some of the options for mkvmerge(1) need a track ID to specify which track + they should be applied to. Those track IDs are printed by the readers when + demuxing the current input file, or if mkvmerge(1) is called with the --identify + option. An example for such output: + +

+ +
$ mkvmerge -i v.mkv
+Plik 'v.mkv': kontener: Matroska
+Track ID 0: obraz (V_MS/VFW/FOURCC, DIV3)
+Track ID 1: dźwięk (A_MPEG/L3)
+ +

+ Nie myl ID ścieżki, które jest przypisywane do ścieżek w plikach wnikowych + MKV, z ID ścieżek z plików wejściowych. Tylko ID ścieżek wejściowych jest + wykorzystywane w opcjach wymagających tychże wartości. + +

+ + +

+ Also note that each input file has its own set of track IDs. Therefore the + track IDs for file 'file1.ext' as reported by + 'mkvmerge --identify' do not change no matter how many + other input files are there or in which position + 'file1.ext' is used. + +

+ + +

+ Track IDs are assigned like this: + +

+ + +
    + +
  • + +

    + Pliki AVI: Ścieżka obrazu ma ID 0. Ścieżki dźwiękowe + dostają ID w porządku rosnącym, zaczynając od 1. + +

    + +
  • + + +
  • + +

    + Pliki AAC, AC-3, MP3, + SRT i WAV: Jedna "ścieżka" w tych plikach + dostaje ID 0. + +

    + +
  • + + +
  • + +

    + Most other files: The track IDs are assigned in order the tracks are found + in the file starting at 0. + +

    + +
  • + +
+ + +

+ The options that use the track IDs are the ones whose description contains + 'TID'. The following options use track IDs as well: + --audio-tracks, --video-tracks, + --subtitle-tracks, --button-tracks and + --track-tags. + +

+ + + +

6.2. Special track IDs

+ + + +

+ There are several IDs that have special meaning and do not occur in the + identification output. + +

+ + +

+ The special track ID '-1' is a wild card and applies + the given switch to all tracks that are read from an input file. + +

+ + +

+ The special track ID '-2' refers to the chapters in a + source file. Currently only the --sync option uses this + special ID. As an alternative to --sync -2:… the option + --chapter-sync … can be used. + +

+ + +

7. Language handling

+ + + +

+ Matroska(tm) has support for two different types of language elements: the + old, deprecated "Language" element containing ISO 639-2 alpha 3 codes and + the new "LanguageIETF" tags containing IETF BCP 47 language tags. All of + mkvmerge(1)'s options that accept a language accept a BCP 47 language + tag. mkvmerge(1) will derive the value for the deprecated "Language" element + from the BCP 47 language tags wherever possible. + +

+ + +

+ When identifying a file in JSON mode, existing "LanguageIETF" track header + elements will be output as the language_ietf track + property. + +

+ + +

+ When writing a file mkvmerge(1) will always write the "LanguageIETF", + "ChapLanguageIETF" and "TagLanguageIETF" elements (the latter two only if + chapters or tags are written respectively). In addition to those elements + the corresponding old elements will be written; they'll be set to the ISO + 639-2 code portion of the BCP 47 language tag. For example, when the track + language is set to sr-Cyrl-RS "LanguageIETF" will be set + to sr-Cyrl-RS and the old "Language" element will be set + to srp. + +

+ + +

+ When reading existing files (Matroska files, XML chapter or tag files etc.) + that already contain "…LanguageIETF" elements the existing elements will be + kept. Otherwise "…LanguageIETF" elements will be added based on command-line + options and other existing deprecated "…Language" elements. + +

+ + +

+ The creation of the new elements can be disabled completely with the + command-line option --disable-language-ietf which operates + on all three new elements. + +

+ + +

+ You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. + +

+ +

8. Text files and character set conversions

+ + +
+

Note:

+ +

+ This section applies to all programs in MKVToolNix even if it only mentions + mkvmerge(1). + +

+ +
+ + +

8.1. Wprowadzenie

+ + +

+ All text in a Matroska(tm) file is encoded in UTF-8. This means that + mkvmerge(1) has to convert every text file it reads as well as every text + given on the command line from one character set into UTF-8. In return this + also means that mkvmerge(1)'s output has to be converted back to that + character set from UTF-8, e.g. if a non-English translation is used with + --ui-language + or for text originating from a Matroska(tm) file. + +

+ + +

+ mkvmerge(1) does this conversion automatically based on the presence of a + byte order marker (short: BOM) or the system's current + locale. How the character set is inferred from the locale depends on the + operating system that mkvmerge(1) is run on. + +

+ + + +

8.2. Znaczniki kolejności bajtów (BOM)

+ + + +

+ Text files that start with a BOM are already encoded in one representation + of UTF. mkvmerge(1) supports the following five modes: UTF-8, UTF-16 Little + and Big Endian, UTF-32 Little and Big Endian. Text files with a BOM are + automatically converted to UTF-8. Any of the parameters that would otherwise + set the character set for such a file (e.g. --sub-charset) + is silently ignored. + +

+ + + +

8.3. Linuks i inne systemy uniksopodobne, włączając w to macOS

+ + + +

+ On Unix-like systems mkvmerge(1) uses the + setlocale(3) + system call which in turn uses the environment variables + LANG, LC_ALL and + LC_CYPE. The resulting character set is often one of + UTF-8 or the ISO-8859-* family and is used for all text file operations and + for encoding strings on the command line and for output to the console. + +

+ + + +

8.4. Windows

+ + + +

+ On Windows the default character set used for converting text files is + determined by a call to the GetACP() system call. + +

+ + +

+ Reading the command line is done with the + GetCommandLineW() function which already returns a + Unicode string. Therefore the option --command-line-charset + is ignored on Windows. + +

+ + +

+ Output to the console consists of three scenarios: + +

+ + +
    + +
  1. + +

    + If the output is redirected with the option --redirect-output + then the default charset is UTF-8. This can be changed with --output-charset. + +

    + +
  2. + + +
  3. + +

    + If the output is redirected with cmd.exe itself, + e.g. with mkvinfo file.mkv > info.txt, then the + charset is always UTF-8 and cannot be changed. + +

    + +
  4. + + +
  5. + +

    + Otherwise (when writing directly to the console) the Windows function + WriteConsoleW() is used and the option --output-charset + is ignored. The console should be able to output all Unicode characters for + which the corresponding language support is installed (e.g. Chinese + characters might not be displayed on English Windows versions). + +

    + +
  6. + +
+ + + +

8.5. Opcje linii komend

+ + + +

+ The following options exist that allow specifying the character sets: + +

+ + +
    + +
  • + +

    + --sub-charset + for text subtitle files and for text subtitle tracks stored in container + formats for which the character set cannot be determined unambiguously + (e.g. Ogg files), + +

    + +
  • + + +
  • + +

    + --chapter-charset + for chapter text files and for chapters and file titles stored in container + formats for which the character set cannot be determined unambiguously + (e.g. Ogg files for chapter information, track and file titles etc; MP4 + files for chapter information), + +

    + +
  • + + +
  • + +

    + --command-line-charset + for all strings on the command line, + +

    + +
  • + + +
  • + +

    + --output-charset + for all strings written to the console or to a file if the output has been + redirected with the --redirect-output + option. On non-Windows systems the default for the output charset is the + system's current charset. On Windows it defaults to UTF-8 both for + redirecting with --redirect-output + and with cmd.exe itself, e.g. mkvinfo file.mkv + > info.txt. + +

    + +
  • + +
+ + +

9. Pliki opcji

+ + + +

+ An option file is a file mkvmerge(1) can read additional command line + arguments from. This can be used in order to circumvent certain limitations + of the shell or the operating system when executing external programs like a + limited command line length. + +

+ + +

+ An option file contains JSON-formatted data. Its content must be a valid + JSON array consisting solely of JSON strings. The file's encoding must be + UTF-8. The file should not start with a byte order marker + (BOM), but if one exists, it will be skipped. + +

+ + +

+ The rules for escaping special characters inside JSON are the ones in the + official JSON specification, RFC 7159. + +

+ + +

+ The option file's name itself must be specified as a command line argument + prefixed with a '@' character. + +

+ + +

+ The command line 'mkvmerge -o "my file.mkv" -A "a movie.avi" + sound.ogg' could be converted into the following JSON option file + called e.g. 'options.json': + +

+ +
[
+  "-o",
+  "c:\\Matroska\\my file.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "a movie.avi",
+  "sound.ogg"
+]
+ +

+ The corresponding command would then be 'mkvmerge + @options.json'. + +

+ +

10. Jak powiązać pliki/segmenty

+ + +

+ Matroska(tm) wspiera łączenie plików, czyli znakowanie pliku jako poprzednika + lub następcę obecnego pliku. Aby wyrazić się precyzyjniej, to nie pliki są + łączone ze sobą, tylko segmenty Matroska(tm). Jako że większość plików + najpewniej zawiera tylko jeden segment Matroska(tm) dlatego używa się terminu + "łączenie plików", jednakże "łączenie segmentów" byłoby bardziej + odpowiednie. + +

+ + +

+ Each segment is identified by a unique 128 bit wide segment UID. This UID is + automatically generated by mkvmerge(1). The linking is done primarily via + putting the segment UIDs (short: SID) of the previous/next + file into the segment header information. mkvinfo(1) prints these + SIDs if it finds them. + +

+ + +

+ If a file is split into several smaller ones and linking is used then the + timestamps will not start at 0 again but will continue where the last file + has left off. This way the absolute time is kept even if the previous files + are not available (e.g. when streaming). If no linking is used then the + timestamps should start at 0 for each file. By default mkvmerge(1) does not + use file linking. If you want that you can turn it on with the + --link option. This option is only useful if splitting is + activated as well. + +

+ + +

+ Regardless of whether splitting is active or not the user can tell + mkvmerge(1) to link the produced files to specific + SIDs. This is achieved with the options + --link-to-previous and --link-to-next. + These options accept a segment SID in the format that + mkvinfo(1) outputs: 16 hexadecimal numbers between 0x00 + and 0xff prefixed with '0x' each, + e.g. '0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 0x5e + 0xca 0xb3 0x93'. Alternatively a shorter form can be used: 16 + hexadecimal numbers between 0x00 and + 0xff without the '0x' prefixes and + without the spaces, e.g. '41da7366d9cfb21eae78ebb45ecab393'. + +

+ + +

+ If splitting is used then the first file is linked to the + SID given with --link-to-previous and the + last file is linked to the SID given with + --link-to-next. If splitting is not used then the one + output file will be linked to both of the two SIDs. + +

+ +

11. Wartości domyślne

+ + +

+ The Matroska(tm) specification states that some elements have a default + value. Usually an element is not written to the file if its value is equal + to its default value in order to save space. The elements that the user + might miss in mkvinfo(1)'s output are the language and + the default track flag elements. The default value + for the language is English + ('eng'), and the default value for the default + track flag is true. Therefore if you used + --language 0:eng for a track then it will not show up in + mkvinfo(1)'s output. + +

+ +

12. Załączniki

+ + +

+ Maybe you also want to keep some photos along with your Matroska(tm) file, or + you're using SSA subtitles and need a special + TrueType(tm) font that's really rare. In these cases + you can attach those files to the Matroska(tm) file. They will not be just + appended to the file but embedded in it. A player can then show those files + (the 'photos' case) or use them to render the subtitles (the + 'TrueType(tm) fonts' case). + +

+ + +

+ Here's an example how to attach a photo and a + TrueType(tm) font to the output file: + +

+ +
$ mkvmerge -o output.mkv -A video.avi sound.ogg \
+  --attachment-description "Me and the band behind the stage in a small get-together" \
+  --attachment-mime-type image/jpeg \
+  --attach-file me_and_the_band.jpg \
+  --attachment-description "The real rare and unbelievably good looking font" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file really_cool_font.ttf
+ +

+ If a Matroska(tm) containing attachments file is used as an input file then + mkvmerge(1) will copy the attachments into the new file. The selection which + attachments are copied and which are not can be changed with the options + --attachments + and --no-attachments. + +

+ +

13. Rozdziały

+ + +

+ The Matroska(tm) chapter system is more powerful than the old known system + used by OGM files. The full specifications can be found at + the Matroska website. + +

+ + +

+ mkvmerge(1) supports two kinds of chapter files as its input. The first + format, called 'simple chapter format', is the same format that the + OGM tools expect. The second format is a XML based + chapter format which supports all of Matroska(tm)'s chapter functionality. + +

+ + +

+ Apart from dedicated chapter files mkvmerge(1) can also read chapters from + other file formats (e.g. MP4, Ogg, Blu-rays or DVDs). + +

+ + +

13.1. Prosty format rozdziałów

+ + + +

+ This format consists of pairs of lines that start with + 'CHAPTERxx=' and 'CHAPTERxxNAME=' + respectively. The first one contains the start timestamp while the second + one contains the title. Here's an example: + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=Rozdział I
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=Rozdział II
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=Rozdział III
+ +

+ mkvmerge(1) will transform every pair or lines into one Matroska(tm) + ChapterAtom. It does not set any + ChapterTrackNumber which means that all chapters + apply to all tracks in the file. + +

+ + +

+ As this is a text file character set conversion may need to be done. See the + section about text files + and character sets for an explanation how mkvmerge(1) converts between + character sets. + +

+ + + +

13.2. Format rozdziałów oparty o XML

+ + +

+ Format rozdziałów oparty o XML wygląda następująco: + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>A short chapter</ChapterString>
+        <ChapterLanguage>eng</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>A part of that short chapter</ChapterString>
+          <ChapterLanguage>eng</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ With this format three things are possible that are not possible with the + simple chapter format: + +

+ + +
    + +
  1. +

    The timestamp for the end of the chapter can be set,

    +
  2. + +
  3. +

    chapters can be nested,

    +
  4. + +
  5. +

    the language and country can be set.

    +
  6. + +
+ + +

+ The mkvtoolnix distribution contains some sample files in the + doc subdirectory which can be used as a basis. + +

+ + +

+ The following lists the supported XML tags, their data types and, where + appropriate, the valid range for their values: + +

+ +
Chapters (nadrzędny)
+  EditionEntry (nadrzędny)
+    EditionUID (liczba całkowita nieujemna, poprawny zakres: 1 <= wartość)
+    EditionFlagHidden (liczba całkowita nieujemna, poprawny zakres: 0 <= wartość <= 1)
+    EditionFlagDefault (liczba całkowita nieujemna, poprawny zakres: 0 <= wartość <= 1)
+    EditionFlagOrdered (liczba całkowita nieujemna, poprawny zakres: 0 <= wartość <= 1)
+    ChapterAtom (nadrzędny)
+      ChapterAtom (nadrzędny)
+      ChapterUID (liczba całkowita nieujemna, poprawny zakres: 1 <= wartość)
+      ChapterTimeStart (liczba całkowita nieujemna)
+      ChapterTimeEnd (liczba całkowita nieujemna)
+      ChapterFlagHidden (liczba całkowita nieujemna, poprawny zakres: 0 <= wartość <= 1)
+      ChapterFlagEnabled (liczba całkowita nieujmena, poprawny zakres: 0 <= wartość <= 1)
+      ChapterSegmentUID (liczba binarna, poprawny zakres: 1 <= długość w bajtach)
+      ChapterSegmentEditionUID (liczba całkowita nieujemna, poprawny zakres: 1 <= wartość)
+      ChapterPhysicalEquiv (liczba całkowita nieujemna)
+      ChapterTrack (nadrzędny)
+        ChapterTrackNumber (liczba całkowita nieujemna, poprawny zakres: 1 <= wartość)
+      ChapterDisplay (nadrzędny)
+        ChapterString (wyraz UTF-8)
+        ChapterLanguage (wyraz UTF-8)
+        ChapterCountry (wyraz UTF-8)
+      ChapterProcess (nadrzędny)
+        ChapterProcessCodecID (liczba całkowita nieujemna)
+        ChapterProcessPrivate (liczba binarna)
+        ChapterProcessCommand (nadrzędny)
+          ChapterProcessTime (liczba całkowita nieujemna)
+          ChapterProcessData (liczba binarna)
+ + +

13.3. Reading chapters from Blu-rays

+ + + +

+ mkvmerge(1) can read chapters from unencrypted Blu-rays. For that you can use + the path to one of the MPLS play lists with the + --chapters parameter. + +

+ + +

+ Example: --chapters + /srv/blurays/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. Reading chapters from DVDs

+ + + +

+ When MKVToolNix is compiled with the libdvdread(tm) + library, mkvmerge(1) can read chapters from DVDs. For that you can use the + path to one of the folders or files on the DVD with the + --chapters parameter. As DVDs can contain more than + one title and each title has its own set of chapters, you can append a colon + and the desired title number to the end of the file name argument. The title + number defaults to 1. + +

+ + +

+ Example: --chapters /srv/dvds/BigBuckBunny/VIDEO_TS:2 + +

+ + + +

13.5. Uwagi ogólne

+ + +

+ When splitting files mkvmerge(1) will correctly adjust the chapters as + well. This means that each file only includes the chapter entries that apply + to it, and that the timestamps will be offset to match the new timestamps of + each output file. + +

+ + +

+ mkvmerge(1) is able to copy chapters from Matroska(tm) source files unless this + is explicitly disabled with the --no-chapters + option. The chapters from all sources (Matroska(tm) files, Ogg files, + MP4 files, chapter text files) are usually not merged but + end up in separate ChapterEditions. Only if chapters + are read from several Matroska(tm) or XML files that share the same edition + UIDs will chapters be merged into a single + ChapterEdition. If such a merge is desired in other + situations as well then the user has to extract the chapters from all + sources with mkvextract(1) first, merge the XML files manually and mux them + afterwards. + +

+ + +

14. Tagi

+ + + +

14.1. Wprowadzenie

+ + + +

+ Matroska(tm)'s tag system is similar to that of other containers: a set of + KEY=VALUE pairs. However, in Matroska(tm) these tags + can also be nested, and both the KEY and the + VALUE are elements of their own. The example file + example-tags-2.xml shows how to use this system. + +

+ + + +

14.2. Scope of the tags

+ + + +

+ tagi Matroska(tm) nie odnoszą się z automatu do całego pliku. Mogą określać + cały plik, ale mogą również określać różne części składowe pliku: jedną lub + kilka ściezek, jeden lub kilka rozdziałów, a nawet kombinację + obydwu. Odnośnik do specyfikacji + Matroska dostarczy więcej informacji. + +

+ + +

+ One important fact is that tags are linked to tracks or chapters with the + Targets Matroska(tm) tag element, and that the UIDs + used for this linking are not the track IDs mkvmerge(1) + uses everywhere. Instead the numbers used are the UIDs which mkvmerge(1) + calculates automatically (if the track is taken from a file format other + than Matroska(tm)) or which are copied from the source file if the track's + source file is a Matroska(tm) file. Therefore it is difficult to know which + UIDs to use in the tag file before the file is handed over to mkvmerge(1). + +

+ + +

+ mkvmerge(1) knows two options with which you can add tags to Matroska(tm) + files: The --global-tags + and the --tags + options. The difference is that the former option, --global-tags, + will make the tags apply to the complete file by removing any of those + Targets elements mentioned above. The latter option, + --tags, + automatically inserts the UID that mkvmerge(1) generates for the tag + specified with the TID part of the --tags option. + +

+ + + +

14.3. Przykład

+ + +

+ Let's say that you want to add tags to a video track read from an + AVI. mkvmerge --identify file.avi tells + you that the video track's ID (do not mix this ID with the UID!) is 0. So + you create your tag file, leave out all Targets + elements and call mkvmerge(1): + +

+ +
$ mkvmerge -o plik.mkv --tags 0:tagi.xml plik.avi
+ + +

14.4. Format pliku tagów

+ + +

+ mkvmerge(1) supports a XML based tag file format. The format is very + closely modeled after the Matroska + specification. Both the binary and the source distributions of + MKVToolNix come with a sample file called + example-tags-2.xml which simply lists all known tags + and which can be used as a basis for real life tag files. + +

+ + +

+ The basics are: + +

+ + +
    + +
  • +

    The outermost element must be <Tags>. +

    +
  • + +
  • + +

    One logical tag is contained inside one pair of + <Tag> XML tags. +

    + +
  • + +
  • +

    White spaces directly before and after tag contents are ignored.

    +
  • + +
+ + + +

14.5. Typy danych

+ + +

+ The new Matroska(tm) tagging system only knows two data types, a UTF-8 string + and a binary type. The first is used for the tag's name and the + <String> element while the binary type is used + for the <Binary> element. + +

+ + +

+ As binary data itself would not fit into a XML file mkvmerge(1) supports + two other methods of storing binary data. If the contents of a XML tag + starts with '@' then the following text is treated as a + file name. The corresponding file's content is copied into the Matroska(tm) + element. + +

+ + +

+ Otherwise the data is expected to be Base64 encoded. This is an encoding + that transforms binary data into a limited set of ASCII + characters and is used e.g. in email programs. mkvextract(1) will output + Base64 encoded data for binary elements. + +

+ + +

+ The deprecated tagging system knows some more data types which can be found + in the official Matroska(tm) tag specs. As mkvmerge(1) does not support this + system anymore these types aren't described here. + +

+ + + +

14.6. Znane tagi dla formatu XML

+ + + +

+ The following lists the supported XML tags, their data types and, where + appropriate, the valid range for their values: + +

+ +
Tags (master)
+  Tag (master)
+    Targets (master)
+      TargetTypeValue (unsigned integer)
+      TargetType (UTF-8 string)
+      TrackUID (unsigned integer)
+      EditionUID (unsigned integer)
+      ChapterUID (unsigned integer)
+      AttachmentUID (unsigned integer)
+    Simple (master)
+      Simple (master)
+      Name (UTF-8 string)
+      TagLanguage (UTF-8 string)
+      DefaultLanguage (unsigned integer)
+      String (UTF-8 string)
+      Binary (binary)
+ +

15. Informacje o segmencie

+ + + +

+ With a segment info XML file it is possible to set certain values in the + "segment information" header field of a Matroska(tm) file. All of + these values cannot be set via other command line options. + +

+ + +

+ Other "segment information" header fields can be set via command + line options but not via the XML file. This includes e.g. the --title and the + --timestamp-scale + options. + +

+ + +

+ There are other elements that can be set neither via command line options + nor via the XML files. These include the following elements: + DateUTC (also known as the "muxing date"), + MuxingApp, WritingApp and + Duration. They're always set by mkvmerge(1) itself. + +

+ + +

+ The following lists the supported XML tags, their data types and, where + appropriate, the valid range for their values: + +

+ +
Info (master)
+  SegmentUID (binary, valid range: length in bytes == 16)
+  SegmentFilename (UTF-8 string)
+  PreviousSegmentUID (binary, valid range: length in bytes == 16)
+  PreviousSegmentFilename (UTF-8 string)
+  NextSegmentUID (binary, valid range: length in bytes == 16)
+  NextSegmentFilename (UTF-8 string)
+  SegmentFamily (binary, valid range: length in bytes == 16)
+  ChapterTranslate (master)
+    ChapterTranslateEditionUID (unsigned integer)
+    ChapterTranslateCodec (unsigned integer)
+    ChapterTranslateID (binary)
+

16. rozmieszczenie elementów w pliku Matroska

+ + +

+ The Matroska(tm) file layout is quite flexible. mkvmerge(1) will render a file + in a predefined way. The resulting file looks like this: + +

+ + +

+ [nagłówek EBML] [segment {meta seek #1} [informacje o segmencie] [informacje + o ścieżce] {załączniki} {rozdziały} [klaster 1] {klaster 2} ... {klaster n} + {indeks cue} {meta seek #2} {tagi}] + +

+ + +

+ The elements in curly braces are optional and depend on the contents and + options used. A couple of notes: + +

+ + +
    + +
  • + +

    + meta seek #1 includes only a small number of level 1 elements, and only if + they actually exist: attachments, chapters, cues, tags, meta seek #2. Older + versions of mkvmerge(1) used to put the clusters into this meta seek element + as well. Therefore some imprecise guessing was necessary to reserve enough + space. It often failed. Now only the clusters are stored in meta seek #2, + and meta seek #1 refers to the meta seek element #2. + +

    + +
  • + + +
  • + +

    Elementy załączników, rozdziałów i tagów będą obecne tylko, jeśli zostaną + dodane. +

    + +
  • + +
+ + +

+ Najmniejszy możliwy plik Matroska(tm) wyglądałby następująco: + +

+ + +

+ [nagłówek EBML] [segment [informacja o segmencie] [informacja o ścieżce] + [klaster 1]] + +

+ + +

+ This might be the case for audio-only files. + +

+ +

17. Zewnętrzne pliki kodów czasowych

+ + +

+ mkvmerge(1) allows the user to chose the timestamps for a specific track + himself. This can be used in order to create files with variable frame rate + video or include gaps in audio. A frame in this case is the unit that + mkvmerge(1) creates separately per Matroska(tm) block. For video this is + exactly one frame, for audio this is one packet of the specific audio + type. E.g. for AC-3 this would be a packet containing + 1536 samples. + +

+ + +

+ Timestamp files that are used when tracks are appended to each other must + only be specified for the first part in a chain of tracks. For example if + you append two files, v1.avi and v2.avi, and want to use timestamps then + your command line must look something like this: + +

+ +
$ mkvmerge ... --timestamps 0:moje_kody_czasowe.txt v1.avi +v2.avi
+ +

+ There are four formats that are recognized by mkvmerge(1). The first line + always contains the version number. Empty lines, lines containing only + whitespace and lines beginning with '#' are ignored. + +

+ + +

17.1. Format kodów czasowych v1

+ + +

+ This format starts with the version line. The second line declares the + default number of frames per second. All following lines contain three + numbers separated by commas: the start frame (0 is the + first frame), the end frame and the number of frames in this range. The + FPS is a floating point number with the dot + '.' as the decimal point. The ranges can contain gaps for + which the default FPS is used. An example: + +

+ +
# format kodów czasowych v1
+przykładowo 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. Format kodów czasowych v2

+ + + +

+ In this format each line contains a timestamp for the corresponding frame. + This timestamp must be given in millisecond precision. It can be a floating + point number, but it doesn't have to be. You have to + give at least as many timestamp lines as there are frames in the track. The + timestamps in this file must be sorted. Example for 25fps: + +

+ +
# format kodów czasowych v2
+0
+40
+80
+ + +

17.3. Format kodów czasowych v3

+ + +

+ In this format each line contains a duration in seconds followed by an + optional number of frames per second. Both can be floating point numbers. + If the number of frames per second is not present the default one is used. + For audio you should let the codec calculate the frame timestamps itself. + For that you should be using 0.0 as the number of + frames per second. You can also create gaps in the stream by using the + 'gap' keyword followed by the duration of the gap. + Example for an audio file: + +

+ +
# format kodów czasowych v3
+przykładowo 0.0
+25.325
+7.530,38.236
+przerwa, 10.050
+2.000,38.236
+ + +

17.4. Format kodów czasowych v4

+ + +

+ This format is identical to the v2 format. The only difference is that the + timestamps do not have to be sorted. This format should almost never be + used. + +

+ + +

18. Kody zakończenia

+ + + +

+ mkvmerge(1) exits with one of three exit codes: + +

+ + +
    + +
  • + +

    + 0 -- Ten kod zakończenia oznacza, że muksowanie zostało + zakończone powodzeniem. + +

    + +
  • + + +
  • + +

    + 1 -- In this case mkvmerge(1) has output at least one + warning, but muxing did continue. A warning is prefixed with the text + 'Warning:'. Depending on the issues involved the + resulting file might be ok or not. The user is urged to check both the + warning and the resulting file. + +

    + +
  • + + +
  • + +

    + 2 -- This exit code is used after an error occurred. + mkvmerge(1) aborts right after outputting the error message. Error messages + range from wrong command line arguments over read/write errors to broken + files. + +

    + +
  • + +
+ +

19. Zmienne środowiskowe

+ + + +

+ mkvmerge(1) uses the default variables that determine the system's locale + (e.g. LANG and the LC_* + family). Additional variables: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG i + jego skrócona forma MTX_DEBUG + +

The content is treated as if it had been passed via the --debug option. +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE i + jego skrócona forma MTX_ENGAGE + +

The content is treated as if it had been passed via the --engage + option. +

+ +
+ +

20. Zobacz także

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. Strona www

+ + +

+ The latest version can always be found at the MKVToolNix homepage. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..59dc3802da48345bc158c3ebcd952aa36f00c8bb --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvpropedit.html @@ -0,0 +1,1310 @@ + + + + + mkvpropedit -- Modify properties of existing Matroska files without a complete remux + + + +
mkvpropedit -- Modify properties of existing Matroska(tm) files without a complete remux +
+
+ +
+

1. Szablon linii komend

+ + +
mkvpropedit opcje {źródłowa-nazwapliku} {działania} +
+ +

2. Opis

+ + +

+ This program analyses an existing Matroska(tm) file and modifies some of its + properties. Then it writes those modifications to the existing file. Among + the properties that can be changed are the segment information elements + (e.g. the title) and the track headers (e.g. the language code, 'default + track' flag or the name). + +

+ + +

+ Opcje: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ Lists all known and editable property names, their type (string, integer, + boolean etc) and a short description. The program exits + afterwards. Therefore the source-filename parameter + does not have to be supplied. + +

+ +
-p, --parse-mode + tryb + +

+ Sets the parse mode. The parameter 'mode' can either + be 'fast' (which is also the default) or + 'full'. The 'fast' mode does not parse + the whole file but uses the meta seek elements for locating the required + elements of a source file. In 99% of all cases this is enough. But for files + that do not contain meta seek elements or which are damaged the user might + have to set the 'full' parse mode. A full scan of a file + can take a couple of minutes while a fast scan only takes seconds. + +

+ +
+ + +

+ Działania na ścieżkach i właściwościach segmentu: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit selektor + +

+ Sets the Matroska(tm) file section (segment information or a certain track's + headers) that all following add, set and delete actions operate + on. This option can be used multiple times in order to make modifications to + more than one element. + +

+ + +

+ By default mkvpropedit(1) will edit the segment information section. + +

+ + +

+ See the section about edit + selectors for a full description of the syntax. + +

+ +
-a, --add + nazwa=wartość + +

+ Dodaje właściwość nazwa z wartością + wartość. Właściwość będzie dodana, nawet jeśli taka + już istnieje. Zauważ, że większość właściwości jest unikalnych i nie mogą + występować więcej niż raz. + +

+ +
-s, --set + nazwa=wartość + +

+ Sets all occurrences of the property name to the + value value. If no such property exists then it will + be added. + +

+ +
-d, --delete nazwa + +

+ Usuwa wszystkie wystąpienia właściwości + nazwa. Zauważ, że niektóre właściwości są obowiązkowe + i nie mogą być usunięte. + +

+ +
+ + +

+ Działania na tagach i rozdziałach: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags + selektor:nazwa-pliku + +

+ Add or replace tags in the file with the ones from + filename or remove them if + filename is empty. mkvpropedit(1) reads the same XML tag + format that mkvmerge(1) reads as well. + +

+ + +

+ The selector must be one of the words + all, global or + track. For all mkvpropedit(1) will + replace or remove all tags in a file. With global only + global tags will be replaced or removed. + +

+ + +

+ With track mkvpropedit(1) will replace tags for a + specific track. Additionally the tags read from + filename will be assigned to the same track. The track + is specified in the same way edit + selectors are specified (see below), e.g. --tags + track:a1:new-audio-tags.xml. + +

+ +
--add-track-statistics-tags + +

+ Calculates statistics for all tracks in a file and adds new statistics tags + for them. If the file already contains such tags then they'll be updated. + +

+ +
--delete-track-statistics-tags + +

+ Deletes all existing track statistics tags from a file. If the file doesn't + contain track statistics tags then it won't be modified. + +

+ +
-c, --chapters + nazwa-pliku + +

+ Add or replace chapters in the file with the ones from + filename or remove them if + filename is empty. mkvpropedit(1) reads the same XML and + simple chapter formats that mkvmerge(1) reads as well. + +

+ +
+ + +

+ Działania na załącznikach: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment nazwa-pliku + +

+ Dodaje nowy załącznik z innego-pliku. + +

+ + +

+ If the option --attachment-name has been used prior to this + option then its value is used as the new attachment's name. Otherwise it is + derived from filename. + +

+ + +

+ If the option --attachment-mime-type has been used prior to + this option then its value is used as the new attachment's MIME + type. Otherwise it is auto-detected from the content of + filename. + +

+ + +

+ If the option --attachment-description has been used prior + to this option then its value is used as the new attachment's + description. Otherwise no description will be set. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is used as the new attachment's UID. Otherwise a + random UID will be generated automatically. + +

+ +
--replace-attachment + selektor:nazwa-pliku + +

+ Replaces one or more attachments that match selector + with the file filename. If more than one existing + attachment matches selector then all of their + contents will be replaced by the content of filename. + +

+ + +

+ The selector can have one of four forms. They're + explained below in the section attachment selectors. + +

+ + +

+ If the option --attachment-name has been used prior to this + option then its value is set as the new name for each modified + attachment. Otherwise the names aren't changed. + +

+ + +

+ If the option --attachment-mime-type has been used prior to + this option then its value is set as the new MIME type for each modified + attachment. Otherwise the MIME types aren't changed. + +

+ + +

+ If the option --attachment-description has been used prior + to this option then its value is set as the new description for each + modified attachment. Otherwise the descriptions aren't changed. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is set as the new UID for each modified + attachment. Otherwise the UIDs aren't changed. + +

+ +
--update-attachment selector + +

+ Sets the properties of one or more attachments that match + selector. If more than one existing attachment + matches selector then all of their properties will be + updated. + +

+ + +

+ The selector can have one of four forms. They're + explained below in the section attachment selectors. + +

+ + +

+ If the option --attachment-name has been used prior to this + option then its value is set as the new name for each modified + attachment. Otherwise the names aren't changed. + +

+ + +

+ If the option --attachment-mime-type has been used prior to + this option then its value is set as the new MIME type for each modified + attachment. Otherwise the MIME types aren't changed. + +

+ + +

+ If the option --attachment-description has been used prior + to this option then its value is set as the new description for each + modified attachment. Otherwise the descriptions aren't changed. + +

+ + +

+ If the option --attachment-uid has been used prior to this + option then its value is set as the new UID for each modified + attachment. Otherwise the UIDs aren't changed. + +

+ +
--delete-attachment selektor + +

+ Usuwa jeden lub więcej załączników, które pasują do + selektor. + +

+ + +

+ The selector can have one of four forms. They're + explained below in the section attachment selectors. + +

+ +
+ + +

+ Opcje dla działań na załącznikach: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name nazwa + +

+ Sets the name to use for the following --add-attachment or + --replace-attachment operation. + +

+ +
--attachment-mime-type typ-mime + +

+ Sets the MIME type to use for the following + --add-attachment or --replace-attachment + operation. + +

+ +
--attachment-description opis + +

+ Sets the description to use for the following + --add-attachment or --replace-attachment + operation. + +

+ +
--enable-legacy-font-mime-types + +

+ Enables the use of legacy MIME types for certain types of + font attachments. For example, + 'application/x-truetype-font' will be used for TrueType + fonts instead of 'fonts/ttf'. + +

+ + +

+ This affects both adding new attachments and replacing existing attachments, + but only if the new MIME type isn't specified. Other + existing attachments aren't changed. + +

+ + +

+ The affected MIME types are 'font/sfnt', + 'font/ttf' and 'font/collection' which + are all mapped to 'application/x-truetype-fonts' and + 'font/otf' which is mapped to + 'application/vnd.ms-opentype'. + +

+ +
+ + +

+ Pozostałe opcje: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ Normally when the user requests changes to the 'language' + track header property, mkvpropedit(1) will apply the same change to the new + LanguageIETF track header element in addition to the + legacy Language element. If this option is used, the + change is only applied to the legacy Language + element. + +

+ + +

+ This option does not affect changes requested via the + 'language-ietf' track header property. + +

+ +
--normalize-language-ietf mode + +

+ Enables normalizing all IETF BCP 47 language tags to either their canonical + form with mode 'canonical', to their extended language + subtags form with mode 'extlang' or turns it off with + mode 'off'. By default normalization to the canonical + form is applied. + +

+ + +

+ In the canonical form all subtags for which preferred values exist are + replaced by those preferred values. This converts + e.g. 'zh-yue-jyutping' to + 'yue-jyutping' or 'fr-FX' to + 'fr-FR'. + +

+ + +

+ For the extended language subtags form the canonical form is built + first. Afterwards all primary languages for which an extended language + subtag exists are replaced by that extended language subtag and its + prefix. This converts e.g. 'yue-jyutping' back to + 'zh-yue-jyutping' but has no effect on + 'fr-FR' as 'fr' is not an extended + language subtag. + +

+ + +

+ This normalization is only applied to elements that are actually changed: + +

+ + +
    + +
  • + +

    + When editing track headers only those track language elements that are set + via edit specifications are affected. Languages of tracks that aren't edited + aren't changed. Editing a track but setting only properties other than the + language won't affect the language either. + +

    + +
  • + + +
  • + +

    + When editing chapters all language elements of all chapter elements are + affected as existing chapters are always fully replaced. + +

    + +
  • + + +
  • + +

    + When editing tags only the language elements of the tags that are actually + replaced are affected. For example, when you replace global tags then + existing track tags aren't affected. + +

    + +
  • + +
+ + +

+ The best way to normalize all existing language tags in a file is to remux + it with mkvmerge(1) and set its + '--normalize-language-ietf' option to the desired mode. + +

+ +
--command-line-charset zestaw-znaków + +

+ Sets the character set to convert strings given on the command line from. It + defaults to the character set given by system's current locale. + +

+ +
--output-charset zestaw-znaków + +

+ Sets the character set to which strings are converted that are to be + output. It defaults to the character set given by system's current locale. + +

+ +
-r, --redirect-output + nazwa-pliku + +

+ Zapisuje wszystkie powiadomienia do pliku nazwa-pliku + zamiast do konsoli. Podczas gdy może być to robione łatwo z przekierowaniem + wyjścia, są przypadki, gdy ta opcja właśnie jest potrzebna: gdy terminal + ponownie interpretuje plik wyjściowy przed zapisaniem do pliku. Uznawany + będzie zestaw znaków ustawiony z opcją --output-charset. + +

+ +
--ui-language kod + +

+ Forces the translations for the language code to be + used (e.g. 'de_DE' for the German + translations). Entering 'list' as the + code will cause the program to output a list of + available translations. + +

+ +
--abort-on-warnings + +

+ Nakazuje programowi przerwanie po wyemitowaniu pierwszego ostrzeżenia. Kodem + wyjścia programu będzie 1. + +

+ +
--debug temat + +

+ Włącz debugowanie dla konkretnej funkcji. Ta opcja jest użyteczna tylko dla + deweloperów. + +

+ +
--engage funkcja + +

+ Włącz funkcje eksperymentalne. Listę dostępnych funkcji można uzyskać za + pomocą komendy mkvpropedit --engage list. Te funkcje nie + są przeznaczone do użytku w normalnych sytuacjach. + +

+ +
--gui-mode + +

+ Turns on GUI mode. In this mode specially-formatted lines may be output that + can tell a controlling GUI what's happening. These messages follow the + format '#GUI#message'. The message may be followed by + key/value pairs as in + '#GUI#message#key1=value1#key2=value2…'. Neither the + messages nor the keys are ever translated and always output in English. + +

+ +
-v, --verbose + +

+ Be verbose and show all the important Matroska(tm) elements as they're read. + +

+ +
-h, --help + +

+ Pokaż informację o sposobie użycia opcji i wyjdź. + +

+ +
-V, --version + +

+ Pokaż informację o wersji i wyjdź. + +

+ +
@options-file.json + +

+ Reads additional command line arguments from the file + options-file. For a full explanation on the supported + formats for such files see the section called "Option files" in the + mkvmerge(1) man page. + +

+ +
+ +

3. Edit selectors

+ + +

+ The --edit option + sets the Matroska(tm) file section (segment information or a certain track's + headers) that all following add, set and delete actions operate + on. This stays valid until the next --edit option + is found. The argument to this option is called the edit selector. + +

+ + +

+ By default mkvpropedit(1) will edit the segment information section. + +

+ + +

3.1. Informacje o segmencie

+ + +

+ The segment information can be selected with one of these three words: + 'info', 'segment_info' or + 'segmentinfo'. It contains properties like the segment + title or the segment UID. + +

+ + + +

3.2. Nagłówki ścieżki

+ + +

+ Track headers can be selected with a slightly more complex selector. All + variations start with 'track:'. The track header + properties include elements like the language code, 'default track' flag or + the track's name. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ If the parameter n is a number then the + nth track will be selected. The track order is the + same that mkvmerge(1)'s --identify option outputs. + +

+ + +

+ Numerowanie rozpoczyna się od 1. + +

+ +
track:tn + +

+ If the parameter starts with a single character t + followed by a n then the nth + track of a specific track type will be selected. The track type parameter + t must be one of these four characters: + 'a' for an audio track, 'b' for a + button track, 's' for a subtitle track and + 'v' for a video track. The track order is the same that + mkvmerge(1)'s --identify option outputs. + +

+ + +

+ Numerowanie rozpoczyna się od 1. + +

+ +
track:=uid + +

+ If the parameter starts with a '=' followed by a number + uid, the track whose track UID + element equals the given uid will be selected. Track + UIDs can be obtained with mkvinfo(1). + +

+ +
track:@numer + +

+ If the parameter starts with a '@' followed by a number + number, the track whose track number element equals + this number will be selected. Track numbers can be + obtained with mkvinfo(1). + +

+ +
+ + + +

3.3. Uwagi

+ + +

+ Due to the nature of the track edit selectors it is possible that several + selectors actually match the same track headers. In such cases all actions + for those edit selectors will be combined and executed in the order in which + they're given on the command line. + +

+ + +

4. Selektory załączników

+ + + +

+ An attachment selector is used with the two actions --replace-attachment + and --delete-attachment. + It can have one of the following four forms: + +

+ + +
    + +
  1. + +

    + Selection by attachment ID. In this form the selector is simply a number, + the attachment's ID as output by mkvmerge(1)'s identification command. + +

    + +
  2. + + +
  3. + +

    + Selection by attachment UID (unique ID). In this form the selector is the + equal sign = followed by a number, the attachment's + unique ID as output by mkvmerge(1)'s verbose identification command. + +

    + +
  4. + + +
  5. + +

    + Selection by attachment name. In this form the selector is the literal word + name: followed by the existing attachment's name. If this + selector is used with --replace-attachment then colons + within the name to match must be escaped as \c. + +

    + +
  6. + + +
  7. + +

    + Selection by MIME type. In this form the selector is the literal word + mime-type: followed by the existing attachment's MIME + type. If this selector is used with --replace-attachment + then colons within the MIME type to match must be escaped as + \c. + +

    + +
  8. + +
+ +

5. Language handling

+ + + +

+ mkvpropedit(1) mostly tries to do the right thing by default. Therefore + changes to the language property will cause mkvpropedit(1) + to apply the same change to both the new "LanguageIETF" element as well as + the old "Language" element similar to how mkvmerge(1) applies the language to + both elements. For example, when using mkvpropedit movie.mkv --edit + track:2 --set language=zh-TW the "LanguageIETF" element will be + set to zh-TW and the old "Language" element to + chi. + +

+ + +

+ Additionally there's a new track header property named + language-ietf that can be set or removed. Changes to this + property only apply to the new "LanguageIETF" track header element. A caveat + is that the old "Language" track header element is a mandatory element in + Matroska — meaning even if it isn't present in the file it still has an + implied value. When the user only sets the language-ietf + property but not the language property, mkvpropedit(1) will + therefore add the old "Language" element in certain cases & set it to + und (meaning "undetermined") as the user didn't specify a + value for it. + +

+ + +

When reading XML chapter or tag files mkvpropedit(1) works like mkvmerge(1) + does. +

+ + +

The creation of the new elements can be disabled completely with the + command-line option `--disable-language-ietf` which operates on all three + new elements. +

+ + +

You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. +

+ +

6. Przykłady

+ + +

+ The following example edits a file called 'movie.mkv'. It + sets the segment title and modifies the language code of an audio and a + subtitle track. Note that this example can be shortened by leaving out the + first --edit option + because editing the segment information element is the default for all + options found before the first --edit option + anyway. + +

+ +
$ mkvpropedit film.mkv --edit info --set "title=Film" --edit track:a1 --set language=fre --edit track:a2 --set language=pol
+ +

+ The second example removes the 'default track flag' from the first subtitle + track and sets it for the second one. Note that mkvpropedit(1), unlike + mkvmerge(1), does not set the 'default track flag' of other tracks to '0' if + it is set to '1' for a different track automatically. + +

+ +
$ mkvpropedit film.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ Podmiana tagów dla drugiej ścieżki napisów wygląda następująco: + +

+ +
$ mkvpropedit film.mkv --tags track:s2:nowe-tagi-napisów.xml
+ +

+ Usuwanie wszystkich tagów zakłada pominięcie nazwy pliku: + +

+ +
$ mkvpropedit film.mkv --tags all:
+ +

+ Podmiana rozdziałów w pliku wygląda następująco: + +

+ +
$ mkvpropedit film.mkv --chapters nowe-rozdziały.xml
+ +

+ Usuwanie wszystkich rozdziałów zakłada pominięcie nazwy pliku: + +

+ +
$ mkvpropedit film.mkv --chapters ''
+ +

+ Dodawanie pliku czcionki (Arial.ttf) jako załącznika: + +

+ +
$ mkvpropedit film.mkv --add-attachment Arial.ttf
+ +

+ Dodawanie pliku czcionki (89719823.ttf) jako załącznika i + dostarczanie informacji, że jest to czcionka Arial: + +

+ +
$ mkvpropedit film.mkv --attachment-name Arial.ttf --attachment-description "Czcionka Arial jako TrueType" --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ Replacing one attached font (Comic.ttf) file with another + one (Arial.ttf): + +

+ +
$ mkvpropedit film.mkv --attachment-name Arial.ttf --attachment-description "Czcionka Arial jako TrueType" --replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ Usuwanie drugiego załącznika, cokolwiek by to nie było: + +

+ +
$ mkvpropedit film.mkv --delete-attachment 2
+ +

+ Usuwanie wszystkich załączonych czcionek według typu MIME: + +

+ +
$ mkvpropedit film.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. Kody zakończenia

+ + + +

+ mkvpropedit(1) exits with one of three exit codes: + +

+ + +
    + +
  • + +

    + 0 -- Ten kod zakończenia oznacza, że modyfikacja + została zakończona powodzeniem. + +

    + +
  • + + +
  • + +

    + 1 -- In this case mkvpropedit(1) has output at least one + warning, but the modification did continue. A warning is prefixed with the + text 'Warning:'. Depending on the issues involved the + resulting files might be ok or not. The user is urged to check both the + warning and the resulting files. + +

    + +
  • + + +
  • + +

    + 2 -- This exit code is used after an error occurred. + mkvpropedit(1) aborts right after outputting the error message. Error + messages range from wrong command line arguments over read/write errors to + broken files. + +

    + +
  • + +
+ +

8. Text files and character set conversions

+ + + +

+ Szczegółowe omówienie sposobu, w jaki wszystkie narzędzia w pakiecie + MKVToolNix obsługują konwersję zestawu znaków, kodowanie + wejściowe/wyjściowe, kodowanie linii komend i kodowanie konsoli, można + znaleźć w sekcji o identycznej nazwie na mkvmerge(1) stronie podręcznika. + +

+ +

9. Zmienne środowiskowe

+ + + +

+ mkvpropedit(1) uses the default variables that determine the system's locale + (e.g. LANG and the LC_* + family). Additional variables: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG i + jego skrócona forma MTX_DEBUG + +

The content is treated as if it had been passed via the --debug + option. +

+ +
MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE + i jego skrócona forma MTX_ENGAGE + +

The content is treated as if it had been passed via the --engage + option. +

+ +
+ +

10. Zobacz także

+ + +

+ mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1) + +

+ +

11. Strona www

+ + +

+ The latest version can always be found at the MKVToolNix homepage. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..c848076d0af75bdcbbe3217f6ba595c9b8b19fdd --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/pl/mkvtoolnix-gui.html @@ -0,0 +1,165 @@ + + + + + mkvtoolnix-gui -- Interfejs graficzny dla mkvmerge1 zawierający edytor rozdziałów i edytor + nagłówków + + + + +
mkvtoolnix-gui -- Interfejs graficzny dla mkvmerge(1) zawierający edytor rozdziałów i edytor + nagłówków +
+
+ +
+

1. Szablon linii komend

+ + +
mkvtoolnix-gui [[configuration-file-name.mtxcfg] | [source-file.ext] | [matroska-file.mkv] | [chapter-file.ext] | [matroska-file.mkv]] +
+ +

2. Opis

+ + +

+ mkvtoolnix-gui(1) is a Qt(tm) based + GUI for mkvmerge(1). It also implements mkvinfo(1)'s and + mkvpropedit(1)'s functionality and will evolve to cover mkvextract(1) as + well. All settings (e.g. source files, track options etc) can be saved and + restored. + +

+ + +

+ Listing configuration file names with the extension + .mtxcfg causes the GUI to load the those configuration + files in the appropriate tool. Any other file name is added as a source file + for multiplexing, opened in the info tool, the chapter editor or in the + header editor depending on the current mode. The current mode can be changed + with --merge, --info, + --edit-chapters or --edit-headers. The + default mode is adding files for multiplexing. + +

+ + +

+ Note that if an instance of the application is already running when the + application is started a second time, all file names given on the command + line are handled by the already-running instance. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

All following file names will be added as source files to the current + multiplex job. This is the default mode. +

+ +
--info + +

Wszystkie następujące nazwy plików zostaną otwarte w narzędziu + informacyjnym. +

+ +

Additionally the info tool will be selected on startup instead of the + multiplexer tool. +

+ +
--edit-chapters + +

Wszystkie następujące nazwy plików zostaną otwarte w edytorze rozdziałów.

+ +

Additionally the chapter editor will be selected on startup instead of the + multiplexer tool. +

+ +
--edit-headers + +

Wszystkie następujące nazwy plików zostaną otwarte w edytorze nagłówków.

+ +

Additionally the header editor will be selected on startup instead of the + multiplexer tool. +

+ +
-h, --help + +

+ Pokaż informację o sposobie użycia opcji i wyjdź. + +

+ +
-V, --version + +

+ Pokaż informację o wersji i wyjdź. + +

+ +
+ +

3. Zobacz także

+ + +

+ mkvmerge(1), mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. Strona www

+ + +

+ The latest version can always be found at the MKVToolNix homepage. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..653ac8bcde68ecdbab99385a5b9bf7f4427379f7 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvextract.html @@ -0,0 +1,1340 @@ + + + + + mkvextract -- извлечение дорожки из файлов Matroska в другие файлы + + + +
mkvextract -- извлечение дорожки из файлов Matroska(tm) в другие файлы +
+
+ +
+

1. Краткое содержание

+ + +
mkvextract {имя-файла-источника} {режим1} параметры свойства-извлечения1 режим2 параметры свойства-извлечения2 … +
+ +

2. Описание

+ + +

+ Эта программа извлекает указанные фрагменты из файла Matroska(tm) в другие + используемые форматы. Первый аргумент — имя исходного файла, который должен + быть файлом Matroska(tm). + +

+ + +

+ Все остальные аргументы либо переключают в определённый режим извлечения, + изменяют параметры текущего активного режима, либо указывают, в какой файл + следует извлечь. При вызове mkvextract могут использоваться несколько + режимов, что позволяет извлекать несколько элементов за один + проход. Большинство параметров могут использоваться только в определённых + режимах с несколькими параметрами, применяемыми ко всем режимам. + +

+ + +

+ В настоящее время поддерживается извлечение дорожек, тегов, вложений, глав, файлов разметки CUE, меток времени и cue. + +

+ + +

2.1. Общие параметры

+ + + +

+ Следующие параметры доступны во всех режимах и описываются в этом разделе + единожды. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ Устанавливает режим анализа на 'полный'. Стандартный режим не анализирует + весь файл, а использует элементы метапоиска для нахождения элементов в + исходном файле. В 99 % случаев этого достаточно. Но для повреждённых файлов + и для тех, в которых нет элементов метапоиска, пользователю придётся + использовать этот режим. Полное сканирование файла может потребовать + несколько минут, в то время как быстрое сканирование проходит за секунды. + +

+ +
--command-line-charset кодировка + +

+ Устанавливает кодировку для конвертации строк, указанных в командной + строке. Стандартная кодировка привязана с системной локализации. + +

+ +
--output-charset кодировка + +

+ Указывает кодировку, в которую конвертируются выходные строки. По умолчанию + используется текущая кодировка системного языка. + +

+ +
-r, --redirect-output + имя-файла + +

+ Все сообщения записываются в файл имя-файла вместо + консоли. Хотя это можно сделать и через перенаправление вывода, есть + отдельные случаи применения именно этого параметра: когда терминал + интерпретирует в другой способ вывода перед записью файла. Кодировка, + указанная в + --output-charset, учитывается. + +

+ +
--flush-on-close + +

+ Указывает программе сбросить все данные, закэшированные в памяти, в + хранилище при закрытии файлов, открытых для записи. Это может быть + использовано для предотвращения потери данных при отключении питания или для + обхода определённых проблем в операционной системе или + драйверах. Недостатком является то, что паковка займёт больше времени, так + как mkvmerge придётся ждать, пока все данные не будут записаны в хранилище + перед выходом. Смотрите проблемы #2469 и #2480 в трекере ошибок MKVToolNix, + где подробно прокомментированы плюсы и минусы. + +

+ +
--ui-language код + +

+ Принудительно использовать перевод на код языка + (напр., «de_DE» для немецкого). Если указать + «list» вместо кода, то отобразится + список доступных переводов. + +

+ +
--abort-on-warnings + +

+ Указывает mkvmerge прерывание после появления первого предупреждения. Код + завершения программы будет 1. + +

+ +
--debug тематика + +

+ Включить режим отладки для указанной функции. Этот параметр полезен только + для разработчиков. + +

+ +
--engage функция + +

+ Включить экспериментальные функции. Список доступных функций может быть + вызван с помощью mkvextract --engage list. Эти функции не + предназначены для повседневного использования. + +

+ +
--gui-mode + +

+ Включает режим графического интерфейса. В этом режиме могут отображаться + специально отформатированные строки для отправки управляющих сообщений + интерфейсу. Формат сообщений — '#GUI#message'. За + сообщением могут быть указаны пары ключа и значения, например + '#GUI#message#key1=value1#key2=value2…'. Сообщения и + ключи не переводятся и всегда выводятся на английском. + +

+ +
-v, --verbose + +

+ Вести расширенный вывод и показывать все важные элементы Matroska(tm) по мере + их чтения. + +

+ +
-h, --help + +

+ Показать сведения об использовании и выйти. + +

+ +
-V, --version + +

+ Показать сведения о версии и выйти. + +

+ +
@файл-параметров.json + +

+ Считывает дополнительные аргументы командной строки из файла + options-file. Полное описание поддерживаемых форматов + для таких файлов смотрите в разделе "Файлы параметров" на странице + документации mkvmerge(1). + +

+ +
+ + + +

2.2. Режим извлечения дорожки

+ + + +

+ Синтаксис: mkvextract имя-исходного-файла + дорожки + [параметры] + TID1:имя-целевого-файла1 + [TID2:имя-целевого-файла2 + ...] + +

+ + +

+ Следующие параметры командной строки доступны для каждой дорожки в режиме + извлечения 'tracks'. Они должны присутствовать перед + указанием дорожки (см. ниже), к которой будут применяться. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c кодировка + +

+ Указывает набор символов, который должна содержать следующая дорожка + субтитров после конвертации. Применяется только тогда, когда ID следующей + дорожки указывает на дорожку субтитров. По умолчанию используется UTF-8. + +

+ +
--blockadd уровень + +

+ Сохранить BlockAdditions только до этого уровня. По умолчанию сохраняются + все уровни. Этот параметр влияет только на определённый тип кодеков, + например WAVPACK4. + +

+ +
--cuesheet + +

+ Выполняет с помощью mkvextract(1) извлечение списков CUE из + информации о разделах и из данных тегов данной дорожки в файл с названием + выходной дорожки и расширением '.cue'. + +

+ +
--raw + +

+ Извлекает необработанные данные в файл без контейнера. В отличие от флага + --fullraw + этот параметр не приводит к записи содержимого элемента + CodecPrivate в файл. Этот режим работает со всеми + CodecIDs, даже с теми, которые mkvextract(1) не + поддерживает, но это может привести к созданию повреждённого файла. + +

+ +
--fullraw + +

+ Извлекает необработанные данные в файл без контейнера. Содержимое элемента + CodecPrivate будет записано первым в файл, если + дорожка содержит подобный элемент заголовка. Этот режим работает со всеми + CodecIDs, даже с теми, которые mkvextract(1) не + поддерживает, но это может привести к созданию повреждённого файла. + +

+ +
TID:выходное-имя + +

+ Извлекает дорожку с ID TID в файла + выходное_имя при условии, что такая дорожка + содержится во исходном файле. Этот параметр можно задавать несколько раз. ID + дорожек должны быть такие же как и при выводе информации командой mkvmerge(1) + с параметром --identify. + +

+ + +

+ Каждое название выходного файла должно использоваться только раз. Исключение + составляют дорожки RealAudio и RealVideo. Если использовать одинаковые + названия для разных дорожек, то они будут сохранены в одном файле. Пример: + +

+ +
$ mkvextract input.mkv tracks 0:video.h264 2:output-two-vobsub-tracks.idx 3:output-two-vobsub-tracks.idx
+
+ + + +

2.3. Режим извлечения вложений

+ + + +

+ Синтаксис: mkvextract имя-исходного-файла + вложения + [параметры] + AID1:выходное-имя1 + [AID2:выходное-имя2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:выходное-имя + +

+ Производит извлечение вложения из ID AID в файл + outname при условии, если такое вложение содержится + во входном файле. Если же оставить outname пустым, то + будет использоваться название вложения из входного файла Matroska(tm). Этот + параметр можно использовать несколько раз. ID вложений должны быть такие же + как и при выводе информации командой mkvmerge(1) с параметром + --identify. + +

+ +
+ + + +

2.4. Режим извлечения глав

+ + + +

+ Синтаксис: mkvextract имя-исходного-файла + главы [параметры] + имя-выходного-файла.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ Экспорт главы информации в простой формат, используемый в инструментах + OGM (ГЛАВА01=..., ГЛАВА01ИИМЯ=...). В этом режиме некоторая + информация должна быть отброшена. По умолчанию главы выводятся в формат + XML. + +

+ +
--simple-language язык + +

+ Если включён простой формат, то mkvextract(1) будет выводить только + единственную запись для каждого встречающегося атома глав, даже если атом + глав содержит более одного названия главы. По умолчанию mkvextract(1) будет + использовать первый обнаруженный заголовок главы для каждого атома вне + зависимости от его языка. + +

+ + +

+ Использование этого параметра даёт возможность пользователю определить, + какие имена глав выводятся, если атомы содержат более одного имени + главы. Параметр language должен быть кодом из ISO + 639-1 или ISO 639-2. + +

+ +
+ + +

+ Главы записаны в указанный выходной файл. По умолчанию используется понятный + для mkvmerge(1) формат XML. Если в файле нет глав, то выходной файл не + создан. + +

+ + + +

2.5. Режим извлечения меток

+ + + +

+ Синтаксис: mkvextract имя-исходного-файла + теги [параметры] + имя-выходного-файла.xml + +

+ + +

+ Теги записаны в указанный выходной XML-файл, понятный для mkvmerge(1). Если + в файле нет тегов, то выходной файл не создан. + +

+ + + +

2.6. Режим извлечения файлов разметки CUE

+ + + +

+ Синтаксис: mkvextract имя-исходного-файла + cuesheet + [параметры] + имя-выходного-файла.cue + +

+ + +

+ Cue sheet (файл разметки) записан в указанный выходной файл. Если в файле + нет глав или тегов, то выходной файл не создан. + +

+ + + +

2.7. Режим извлечения метки времени

+ + + +

+ Синтаксис: mkvextract имя-исходного-файла + метки-времени_v2 + [параметры] + TID1:имя-целевого-файла1 + [TID2:имя-целевого-файла2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:выходное-имя + +

+ Извлекает временные метки дорожки с ID TID в файла + выходное_имя при условии, что такая дорожка + содержится во исходном файле. Этот параметр можно задавать несколько раз. ID + дорожек должны быть такие же как и при выводе информации командой mkvmerge(1) + с параметром --identify. + +

+ + +

+ Пример: + +

+ +
$ mkvextract input.mkv timestamps_v2 1:ts-track1.txt 2:ts-track2.txt
+
+ + + +

2.8. Режим извлечения файлов разметки CUE

+ + + +

+ Синтаксис: mkvextract имя-исходного-файла + cue-файлы + [параметры] + TID1:имя-целевого-файла1 + [TID2:имя-целевого-файла2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:имя-целевого-файла + +

+ Извлекает дорожку с ID TID в файла + выходное_имя при условии, что такая дорожка + содержится во исходном файле. Этот параметр можно задавать несколько раз. ID + дорожек должны быть такие же как и при выводе информации командой mkvmerge(1) + с параметром --identify, при этом не должны совпадать с + цифрами, содержащимися в элементе CueTrack. + +

+ +
+ + +

+ Выходной формат представлен в текстовом виде: один элемент + CuePoint на линию с парой + ключ=значение. Если элемент параметра не представлен в + CuePoint (напр. CueDuration), + то вместо значения будет тире. + +

+ + +

+ Пример: + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

Возможные ключи:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
метка времени + +

Длительность точки cue с точностью до наносекунд. Формат: + HH:MM:SS.nnnnnnnnn. Этот элемент всегда устанавливается. +

+ +
длительность + +

Длительность точки cue с точностью до наносекунд. Формат: + HH:MM:SS.nnnnnnnnn. +

+ +
cluster_position + +

Абсолютная позиция в байтах внутри файла Matroska(tm), с которой начинается + кластер, содержащий ссылочный элемент. +

+ + +
+

Note:

+ +

Внутри файла Matroska(tm) CueClusterPosition находится + относительно начального смещения данных сегмента. Однако значение, выводимое + в режиме извлечения cue mkvextract(1), уже содержит это смещение и является + абсолютным смещением от начала файла. +

+ +
+ +
relative_position + +

Относительное положение в байтах внутри кластера, где начинаются элементы + BlockGroup или SimpleBlock, на + которые ссылается cue-точка. +

+ + +
+

Note:

+ +

Внутри файла Matroska(tm) CueRelativePosition + относительно начальному смещению данных кластера. Однако значение, выводимое + режимом извлечения метки mkvextract(1), зависит от идентификатора + кластера. Абсолютное положение внутри файла можно вычислить добавлением + cluster_position и relative_position. +

+ +
+ +
+ + +

+ Пример: + +

+ +
$ mkvextract input.mkv cues 1:cues-track1.txt 2:cues-track2.txt
+ +

3. Примеры

+ + + +

+ Извлечение глав и тегов в их соответствующие форматы XML за один раз: + +

+ +
$ mkvextract фильм.mkv chapters главы-фильма.xml tags теги-фильма.xml
+ +

+ Извлечение пары треков и их соответствующие временные метки за один раз: + +

+ +
$ mkvextract "Другой фильм.mkv" tracks 0:video.h265 "1:основное аудио.aac" "2:комментарии режиссёра.aac" временные метки_v2 "0:временные метки видео.txt" "1:временные метки основного аудио.txt" "2:временные метки комментариев режиссёра.txt"
+ +

+ Извлечение глав в формат Ogg/OGM и перекодирование дорожки текстовых + субтитров в другую кодировку: + +

+ +
$ mkvextract "Мой фильм.mkv" chapters --simple "Мои главы.txt" tracks -c MS-ANSI "2:Мои субтитры.srt"
+

4. Преобразование текстовых файлов и кодировок

+ + + +

+ Подробное обсуждение того, как все инструменты пакета MKVToolNix + обрабатывают преобразование наборов символов, кодировку ввода / вывода, + кодировку командной строки и кодировку консоли, смотрите в разделе с + идентичным названием в справочной странице mkvmerge(1). + +

+ +

5. Форматы файлов на выходе

+ + + +

+ Решение о формате файла на выходе выбирается на основании типа дорожки, а не + расширения выходного файла. В настоящее время поддерживаются следующие типы + дорожек: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ Все файлы AAC будут записаны в файл AAC с + заголовками ADTS перед каждым пакетом. Заголовки + ADTS не будут содержать устаревшее поле особого назначения. + +

+ +
A_AC3, A_EAC3 + +

+ Это будет извлечено в необработанные файлы AC-3. + +

+ +
A_ALAC + +

+ Дорожки ALAC(tm) записаны в файлы + CAF(tm). + +

+ +
A_DTS + +

+ Это будет извлечено в необработанные файлы DTS. + +

+ +
A_FLAC + +

+ Дорожки FLAC(tm) записаны в файлы + FLAC(tm). + +

+ +
A_MPEG/L2 + +

+ Потоки MPEG-1 Audio Layer II будут извлечены в необработанные файлы + MP2. + +

+ +
A_MPEG/L3 + +

+ Это будет извлечено в необработанные файлы MP3. + +

+ +
A_OPUS + +

+ Дорожки Opus(tm) записаны в файлы + OggOpus(tm). + +

+ +
A_PCM/INT/LIT, A_PCM/INT/BIG + +

+ Необработанные данные PCM будут записаны в файл + WAV. Данные виде целочисленных с большим концом будут + сконвертированы в данные с малым концом в процессе. + +

+ +
A_REAL/* + +

+ Дорожки RealAudio(tm) записаны в файлы + RealMedia(tm). + +

+ +
A_TRUEHD, A_MLP + +

+ Это будет извлечено в необработанные файлы + TrueHD/MLP. + +

+ +
A_TTA1 + +

+ Дорожки TrueAudio(tm) записываются в файлы + TTA. Имейте в виду, что из-за ограниченной точности + временных меток Matroska(tm), извлечённые заголовки файлов будут разными, как + указано в двух полях: data_length (суммарное количество + семплов в файле) и CRC. + +

+ +
A_VORBIS + +

+ Аудио-файлы Vorbis будут записаны в файл OggVorbis(tm). + +

+ +
A_WAVPACK4 + +

+ Дорожки WavPack(tm) записаны в файлы + WV(tm). + +

+ +
S_HDMV/PGS + +

+ Субтитры PGS будут записаны в файлы SUP. + +

+ +
S_HDMV/TEXTST + +

+ Субтитры TextST будут записаны в виде файла, созданного + специально для mkvmerge(1) и mkvextract(1). + +

+ +
S_KATE + +

+ Потоки Kate(tm) будут записаны в контейнер + Ogg(tm). + +

+ +
S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS + +

+ Текстовые субтитры SSA и ASS будут + записаны в виде файлов SSA/ASS + соответственно. + +

+ +
S_TEXT/UTF8, S_TEXT/ASCII + +

+ Простые текстовые субтитры будут записаны в виде файлов + SRT. + +

+ +
S_VOBSUB + +

+ Субтитры VobSub(tm) будут записаны в виде файлов + SUB с соответствующими файлами индексов в виде + IDX. + +

+ +
S_TEXT/USF + +

+ Текстовые субтитры USF будут записаны в виде файлов + USF. + +

+ +
S_TEXT/WEBVTT + +

+ Текстовые субтитры WebVTT будут записаны в виде файлов + WebVTT. + +

+ +
V_MPEG1, V_MPEG2 + +

+ Видеодорожки MPEG-1 и MPEG-2 будут + записаны в виде элементарных потоков MPEG. + +

+ +
V_MPEG4/ISO/AVC + +

+ Видеодорожки H.264 / AVC будут записаны в + виде элементарных потоковH.264, которые в дальнейшем могут + обработаны, например, с помощью MP4Box(tm) из пакеты + GPAC(tm). + +

+ +
V_MPEG4/ISO/HEVC + +

+ Видеодорожки H.265 / EVC будут записаны в + виде элементарных потоковH.265, которые в дальнейшем могут + обработаны, например, с помощью MP4Box(tm) из пакеты + GPAC(tm). + +

+ +
V_MS/VFW/FOURCC + +

+ Видеодорожки с фиксированной кадровой частотой и с данным + CodecID записаны в виде файлов AVI./ + +

+ +
V_REAL/* + +

+ Дорожки RealVideo(tm) записаны в файлы + RealMedia(tm). + +

+ +
V_THEORA + +

+ Потоки Theora(tm) будут записаны в контейнер + Ogg(tm) + +

+ +
V_VP8, V_VP9 + +

+ Дорожки VP8 / VP9 записаны в файлы + IVF. + +

+ +
Метки + +

+ Теги конвертируются в формат XML. Этот же формат mkvmerge(1) использует для + чтения тегов. + +

+ +
Вложения + +

+ Вложения записываются в выходной файл как есть. Никаких преобразований не + выполняется. + +

+ +
Главы + +

+ Главы конвертируются в формат XML. Этот же формат mkvmerge(1) используется + для чтения глав. Либо можно извлечь урезанную версию в упрощённый стилевой + формат OGM. + +

+ +
Метки времени + +

+ Временные метки сначала сортируются и затем выводятся в формате временных + меток v2, совместимом для использования в mkvmerge(1). Извлечение в другие + форматы (v1, v3 и v4) не поддерживается. + +

+ +
+ +

6. Коды завершения

+ + + +

+ mkvextract(1) завершается с одним из трёх кодов: + +

+ + +
    + +
  • + +

    + 0 -- Этот код завершения означает, что извлечение + закончилось успешно. + +

    + +
  • + + +
  • + +

    + 1 -- В этом случае mkvextract(1) выдал хотя бы одно + предупреждение, однако извлечение продолжилось. Предупреждению предшествует + текст 'Warning:'. В зависимости от произошедших ошибок, + результирующие файлы могут быть либо целыми либо повреждёнными. Пользователю + рекомендуется обратить внимание на само предупреждение и проверить + результирующие файлы. + +

    + +
  • + + +
  • + +

    + 2 -- Этот код завершения используется в случае + возникновения ошибки. mkvextract(1) прекращает работу сразу после вывода + сообщения об ошибке. Ошибки могут возникнуть из-за неверных параметров + командной строки, из-за ошибки чтения/записи или просто из-за повреждённых + файлов. + +

    + +
  • + +
+ +

7. Переменные среды

+ + + +

+ mkvextract(1) использует стандартные переменные, определяющие системный язык + (например: LANG и семейство + LC_*). Дополнительные переменные: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG и + его краткая форма MTX_DEBUG + +

Содержимое обрабатывается так, как если бы оно было передано с помощью + параметра --debug. +

+ +
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE и + его краткая форма MTX_ENGAGE + +

Содержимое обрабатывается так, как если бы оно было передано с помощью + параметра --engage. +

+ +
+ +

8. Смотрите также

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. Домашняя страница

+ + +

+ Последняя версия программы всегда доступна на домашней странице MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..2b791add6b33944f3d57f87e66587694bacb3551 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvinfo.html @@ -0,0 +1,514 @@ + + + + + mkvinfo -- Запись информации об элементах в файлы Matroska + + + +
mkvinfo -- Запись информации об элементах в файлы Matroska(tm)
+
+ +
+

1. Краткое содержание

+ + +
mkvinfo параметры {исходный-файл} +
+ +

2. Описание

+ + +

+ Эта программа выводит список всех элементы, содержащихся в + Matroska(tm). Выходные данные, включая информацию об используемых кодеках, + могут быть ограничены списком дорожек в файле. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ По умолчанию mkvinfo(1) останавливается, когда встречает первый + кластер. Кроме того, он не показывает некоторые часто встречающиеся + элементы. С помощью этого параметра mkvinfo(1) продолжит обработку независимо + от уровня детализации и покажет все элементы. + +

+ +
-c, --checksums + +

+ Вычисляет и отображает контрольную сумму Adler-32 для + каждого кадра. Полезно только для отладки. + +

+ +
-o, --continue + +

+ По умолчанию mkvinfo(1) останавливается, когда он обнаруживает первый + кластер. С помощью этого параметра mkvinfo(1) будет продолжать обработку + независимо от уровня детализации. + +

+ +
-p, --hex-positions + +

+ Показывать позицию каждого элемента в шестнадцатеричном виде вне зависимости + от уровня детализации. + +

+ +
-P, --positions + +

+ Показывать позицию каждого элемента в десятичном виде вне зависимости от + уровня детализации. + +

+ +
-s, --summary + +

+ Показывать только краткую информацию и не каждый элемент в результатах + поиска mkvinfo(1). + +

+ +
-t, --track-info + +

+ Показать статистику для каждой дорожки в расширенном режиме. Также + устанавливает режим расширенности в 1, если он был 0 до этого. + +

+ +
-x, --hexdump + +

+ Показать 16 первых байтов каждого кадра в шестнадцатеричном виде. + +

+ +
-X, --full-hexdump + +

+ Показать все байты каждого кадра в шестнадцатеричном виде. + +

+ +
-z, --size + +

+ Показать размер каждого элемента, в том числе его заголовка. + +

+ +
--command-line-charset кодировка + +

+ Устанавливает кодировку для конвертации строк, указанных в командной + строке. Стандартная кодировка привязана с системной локализации. + +

+ +
--output-charset кодировка + +

+ Указывает кодировку, в которую конвертируются выходные строки. По умолчанию + используется текущая кодировка системного языка. + +

+ +
-r, --redirect-output + имя-файла + +

+ Все сообщения записываются в файл имя-файла вместо + консоли. Хотя это можно сделать и через перенаправление вывода, есть + отдельные случаи применения именно этого параметра: когда терминал + интерпретирует в другой способ вывод перед записью файла. Набор символов, + заданный через + --output-charset, учитывается. + +

+ +
--ui-language код + +

+ Принудительно использовать перевод на код языка + (напр., «de_DE» для немецкого). Если указать + «list» вместо кода, то отобразится + список доступных переводов. + +

+ +
--abort-on-warnings + +

+ Указывает mkvmerge прерывание после появления первого предупреждения. Код + завершения программы будет 1. + +

+ +
--debug тематика + +

+ Включить режим отладки для указанной функции. Этот параметр полезен только + для разработчиков. + +

+ +
--engage функция + +

+ Включить экспериментальные функции. Список доступных функций может быть + вызван с помощью mkvinfo --engage list. Эти функции не + предназначены для повседневного использования. + +

+ +
--gui-mode + +

+ Включает режим графического интерфейса. В этом режиме могут отображаться + специально отформатированные строки для отправки управляющих сообщений + интерфейсу. Формат сообщений — '#GUI#message'. За + сообщением могут быть указаны пары ключа и значения, например + '#GUI#message#key1=value1#key2=value2…'. Сообщения и + ключи не переводятся и всегда выводятся на английском. + +

+ +
-v, --verbose + +

+ Больше подробностей. Смотрите раздел об уровнях детализации с описанием + информации, выводимой на каждом уровне. + +

+ +
-h, --help + +

+ Показать сведения об использовании и выйти. + +

+ +
-V, --version + +

+ Показать сведения о версии и выйти. + +

+ +
@файл-параметров.json + +

+ Считывает дополнительные аргументы командной строки из файла + options-file. Полное описание поддерживаемых форматов + для таких файлов смотрите в разделе "Файлы параметров" на странице + документации mkvmerge(1). + +

+ +
+ +

3. Уровни детализации

+ + + +

+ Параметр -v может быть + использован для повышения уровня детализации mkvinfo(1) и для вывода большей + информации о текущем файле. + +

+ + +

+ На уровне 0 mkvinfo(1) напечатает только заголовки найденных треков и их + типы. mkvinfo(1) завершится, как только заголовки будут полностью + проанализированы (более технически: как только будет обнаружен первый + кластер). На этом уровне записи заголовка поиска и cues не будут + отображаться — даже если они расположены перед информацией о треке. + +

+ + +

+ На уровне 1 mkvinfo(1) также будет печатать все элементы Matroska(tm), + встречающиеся для полного файла, кроме записей заголовка поиска и записей + cue. Если включён режим сводки, то mkvinfo(1) также выведет положение кадра. + +

+ + +

+ Тот же эффект достигается параметром --continue. + +

+ + +

+ На уровне 2 mkvinfo(1) также выведет записи заголовков поиска, записи cue и + позицию в файле, на которой каждый элемент Matroska(tm) может быть найден. + +

+ + +

+ Тот же эффект достигается параметром --all --positions. + +

+ + +

+ На уровне 3 и выше mkvinfo(1) напечатает некоторую информацию, которая не + связана напрямую с элементом Matroska(tm). Все остальные элементы печатают + только те элементы, которые были только что найдены. Уровень 3 добавляет + метаинформацию для облегчения отладки (читай: предназначена только для + разработчиков). Все строки, написанные на уровне 3, заключены в квадратные + скобки, чтобы их было легко отфильтровать. + +

+ +

4. Преобразование текстовых файлов и кодировок

+ + + +

+ Подробное обсуждение того, как все инструменты пакета MKVToolNix + обрабатывают преобразование наборов символов, кодировку ввода / вывода, + кодировку командной строки и кодировку консоли, смотрите в разделе с + идентичным названием в справочной странице mkvmerge(1). + +

+ +

5. Коды завершения

+ + + +

+ mkvinfo(1) завершается с одним из трёх кодов: + +

+ + +
    + +
  • + +

    + 0 -- Этот код завершения означает, что запуск + закончился успешно. + +

    + +
  • + + +
  • + +

    + 1 -- В этом случае mkvinfo(1) выдал хотя бы одно + предупреждение, однако процесс продолжился. Предупреждению предшествует + текст 'Warning:'. + +

    + +
  • + + +
  • + +

    + 2 -- Этот код завершения используется в случае + возникновения ошибки. mkvinfo(1) прекращает работу сразу после вывода + сообщения об ошибке. Ошибки могут возникнуть из-за неверных параметров + командной строки, из-за ошибки чтения/записи или просто из-за повреждённых + файлов. + +

    + +
  • + +
+ +

6. Переменные среды

+ + + +

+ mkvinfo(1) использует стандартные переменные, определяющие системный язык + (например: LANG и семейство + LC_*). Дополнительные переменные: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUG, MKVTOOLNIX_DEBUG и его + краткая форма MTX_DEBUG + +

Содержимое обрабатывается так, как если бы оно было передано с помощью + параметра --debug. +

+ +
MKVINFO_ENGAGE, MKVTOOLNIX_ENGAGE и + его краткая форма MTX_ENGAGE + +

Содержимое обрабатывается так, как если бы оно было передано с помощью + параметра --engage. +

+ +
+ +

7. Смотрите также

+ + +

+ mkvmerge(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. Домашняя страница

+ + +

+ Последняя версия программы всегда доступна на домашней странице MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..f2cbb93c2315333c2474c9d73170942836642c7e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvmerge.html @@ -0,0 +1,5302 @@ + + + + + mkvmerge -- Паковщик мультимедийных потоков в файл Matroska + + + +
mkvmerge -- Паковщик мультимедийных потоков в файл Matroska(tm)
+
+ +
+

1. Краткое содержание

+ + +
mkvmerge глобальные параметры {-o выход} параметры1 {файл1} параметры2 {файл2} @файл-параметров.json +
+ +

2. Описание

+ + +

+ Эта программа принимает входные данные из нескольких медиафайлов и соединяет + их потоки (все или только выбранные) в файл Matroska(tm); смотрите сайт Matroska. + +

+ + +
+

Important:

+ +

+ Порядок параметров в командной строке очень важен. Пожалуйста, прочтите + раздел «Порядок параметров», + если вы незнакомы с программой. + +

+ +
+ + +

2.1. Глобальные параметры

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

Увеличить детализацию.

+ +
-q, --quiet + +

Скрыть вывод состояния.

+ +
-o, --output + имя-файла + +

Записать в файл имя-файла. Если используется + разбиение, то этот параметр трактуется несколько иначе. Сморите описание + параметра --split для + подробностей. +

+ +
-w, --webm + +

Создайть файл, совместимый с WebM. Это также включено, если расширение имени + выходного файла — «webm». В этом режиме есть несколько + ограничений. Разрешены только кодеки VP8, видео VP9 и аудиодорожки Opus, + Vorbis. Элемент заголовка DocType изменён на «webm». + +

+ + +

+ Для глав и тэгов разрешена только подгруппа элементов. mkvmerge(1) + автоматически удалит все элементы, неразрешённые спецификацией. + +

+ +
--title заголовок + +

Устанавливает основной заголовок для выходного файла, например, имя фильма.

+ +
--default-language код-языка + +

Задаёт код языка по умолчанию, который будет использоваться для треков, у + которых не установлен язык с параметром --language и + у которых исходный контейнер не предоставляет язык. +

+ + +

Стандартный код для «неопределённого» языка — und. +

+ +
+ + + +

2.2. Обработка информации о сегментах (глобальные параметры)

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo имя-файла.xml + +

+ Прочесть информацию о сегменте из файла XML. Этот файл + может содержать UID семейства сегментов, + UID сегмента, элементы UID предыдущего и + следующего сегмента. Пример файла и DTD включены в + дистрибутив MKVToolNix. + +

+ + +

+ Смотрите раздел XML-файлы информации о + сегментах ниже для подробностей. + +

+ +
--segment-uid SID1,SID2,... + +

+ Задаёт UID используемых сегментов.Это разделяемый запятыми список 128-битных + сегментных UIDов в обычной форме записи UID: шестнадцатеричное число с + префиксом "0x" или без, с пробелами или без, длиной ровно в 32 символа. + +

+ + +

+ Если SID начинается с =, то остальное будет распознано как имя файла + Matroska, чей сегмент UID считывается и используется. + +

+ + +

+ Каждый созданный файл содержит один сегмент, и каждый сегмент имеет один UID + сегмента. Если указано больше UID сегментов, чем создано сегментов, то + лишние UID игнорируются. Если указано меньше UID, чем создано сегментов, то + для них будут созданы случайные UID. + +

+ +
+ + + +

2.3. Работа с главами и тегами (глобальные параметры)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language код-языка + +

+ Задаёт код языка в формате ISO 639-2, который записывается для каждой записи + главы. По умолчанию используется 'eng'. Подробности ниже + в разделе главы. + +

+ + +

+ Этот параметр может использоваться как для простых файлов глав, так и для + исходных файлов, содержащих главы без информации об их языке, напр. файлы + MP4 и OGM. + +

+ + +

+ Язык, указанный в этом параметре, также используется и при генерации глав с + помощью параметра + --generate-chapters. + +

+ +
--chapter-charset кодировка + +

+ Устанавливает набор символов, который используется для преобразования в + UTF-8 для простых файлов глав. Смотрите раздел о текстовых файлах и наборах + символов, чтобы узнать, как mkvmerge(1) преобразует наборы символов. + +

+ + +

+ Этот переключатель также применяется к главам, скопированным из определённых + типов контейнеров, например файлов Ogg/OGM и MP4. Дополнительные сведения + смотрите ниже в разделе о главах. + +

+ +
--chapter-sync + d[,o[/p]] + +

+ Отрегулировать отметки времени глав в следующем исходном файле на + d мс. В качестве альтернативы вы можете использовать + параметр --sync со специальным идентификатором дорожки + -2 (сморите раздел «Специальные идентификаторы + дорожек»). + +

+ + +

+ o/p: поправка временных меток + с помощью o/p, чтобы исправить + линейные смещения. По умолчанию в случае пропуска p + равно 1. И o и p могут быть + числами с плавающей запятой. + +

+ + +

+ По умолчанию: ручная коррекция синхронизации отключена (что равноценно + d = 0 и + o/p = + 1.0). + +

+ + +

+ Этот параметр можно использовать несколько раз для входного файла, + применяемого к нескольким дорожкам, с указанием разных идентификаторов + дорожек. + +

+ +
--generate-chapters режим + +

+ mkvmerge(1) может автоматически создавать главы. На данный момент + поддерживаются следующие два режима: + +

+ + +
    + +
  • + +

    + 'when-appending' – Этот режим создаёт одну главу, + соответствующую началу каждого добавленного файла. + +

    + + +

    + Этот режим также работает с режимами разделения «частей:» + и «частей-кадров:». Для этих режимов создаётся одна глава + для каждого добавленного диапазона временных меток (тех, чьи начальные метки + времени имеют префикс «+»). + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1) требует наличия видео или аудиодорожки, для определения того, что + будет добавлен новый файл. При слиянии одной или нескольких видеодорожек + используется первая. В ином случае используется первая звуковая дорожка. + +

    + +
    + +
  • + + +
  • + +

    + 'interval:time-spec' — этот режим + создаёт одну главу с фиксированными интервалами по данным из + time-spec. Формат в форме HH: MM: + SS.nnnnnnnnn или число, за которым следует одна из единиц + 's', 'ms' или + 'us7'. + +

    + + +

    + Пример: --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ Названия новых глав управляются параметром --generate-chapters-name-template. + Язык устанавливается с помощью --chapter-language, + который должен быть указан перед --generate-chapters. + +

+ +
--generate-chapters-name-template + шаблон + +

+ Указывает шаблон имени для имён заголовков, создаваемых параметром --generate-chapters. + Если параметр не указан, то по умолчанию используется "Chapter + <NUM:2>". + +

+ + +

+ Существует несколько переменных, которые можно использовать в шаблоне, и + которые заменяются их фактическими значениями во время создания + главы. Строка «<NUM>» будет заменена номером + главы. Строка «<START>» будет заменена меткой + времени начала главы. + +

+ + +

+ Строки «<FILE_NAME>» и + «<FILE_NAME_WITH_EXT>» заполняются только при + создании глав для добавляемых файлов. Они будут заменены именем добавляемого + файла без указания соответственно его расширения. Обратите внимание, что + вставляются только базовое имя и расширение файла, а не его каталог или + компоненты диска. + +

+ + +

+ Вы можете указать минимальное число мест для номера главы с помощью + «<NUM:places>'», например, + «<NUM:3>». Полученное число будет дополнено + ведущими нулями, если число мест меньше указанного. + +

+ + +

+ Вы можете управлять форматом, используемым начальной меткой времени, с + помощью <START:format>. Когда формат не задан, то + умолчанию используется '%H:%M:%S'. Допустимыми кодами + формата являются: + +

+ + +
    + +
  • + +

    %h – часы +

    + +
  • + +
  • + +

    %H – часы, дополненные нулями до двух позиций +

    + +
  • + +
  • + +

    %m – минуты +

    + +
  • + +
  • + +

    %M – минуты, дополненные нулями до двух позиций +

    + +
  • + +
  • + +

    %s – секунды +

    + +
  • + +
  • + +

    %S – секунды, дополненные нулями до двух позиций +

    + +
  • + +
  • + +

    %n – наносекунды с девятью позициями +

    + +
  • + +
  • + +

    %<1-9>n – наносекунды с указанием до девяти позиций + (например, с тремя позициями %3n) +

    + +
  • + +
+ +
--cue-chapter-name-format формат + +

+ mkvmerge(1) поддерживает чтение списков CUE для аудиофайлов + в качестве входных данных для глав. Списки CUE обычно + содержат записи PERFORMER и TITLE для + каждой записи индекса. mkvmerge(1) использует эти две строки для создания + названия главы. С помощью этого параметра можно установить формат, + используемый для этого имени. + +

+ + +

+ Если этот параметр не задан, то mkvmerge(1) по умолчанию использует формат + "%p - %t" (исполнитель, за которым следует пробел, тире, ещё + один пробел и заголовок). + +

+ + +

+ Если формат указан, то всё, исключая мета-символы, копируется как есть, а + сами мета-символы подменяются следующим образом: + +

+ + +
    + +
  • + +

    %p подменён текущим значением строки + PERFORMER, +

    + +
  • + +
  • + +

    %t подменён текущим значением строки + TITLE, +

    + +
  • + +
  • + +

    %n подменён номером текущей дорожки и +

    + +
  • + +
  • + +

    %N подменён номером текущей дорожки с добавлением + начального нуля, если это < 10. +

    + +
  • + +
+ +
--chapters имя-файла + +

+ Считывает информацию о главе из файла + имя-файла. Подробности смотрите в разделе о главах ниже. + +

+ +
--global-tags имя-файла + +

+ Считывает глобальные теги из файла + имя-файла. Подробности смотрите в разделе о тегах ниже. + +

+ +
+ + + +

2.4. Основные настройки вывода (расширенные глобальные параметры)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order + FID1:TID1,FID2:TID2,... + +

+ Этот параметр меняет порядок, в котором создаются дорожки для входного + файла. Аргументом является список пар ИД, разделённых запятыми. Каждая пара + изначально содержит ИД файла (FID1), который является + просто номером файла в командной строке, начиная с 0. Вторым является ИД + дорожки (TID1) из этого файла. Если некоторые ИД + дорожек пропущены, эти дорожки создаются после того, как были созданы + дорожки, заданные этим параметром. + +

+ +
--cluster-length свойство + +

+ Ограничивает число блоков данных или длительность данных в каждом + кластере. Параметр spec может быть числом + n без единиц или числом d с + постфиксом «ms». + +

+ + +

+ Если значение не указано, то mkvmerge(1) поместит в каждый кластер не более + n блоков данных. Максимальное количество блоков — + 65535. + +

+ + +

+ Если число d имеет постфикс «ms», + тогда mkvmerge(1) размещает максимум d миллисекунд + данных в каждый кластера. Диапазон для d — от + «100 мс» до «32000 мс». + +

+ + +

+ По умолчанию mkvmerge(1) размещает не более 65535 блоков и 5000 мс данных в + кластер. + +

+ + +

+ Программы, пытающиеся найти определённый кадр, могут обращаться только + непосредственно к кластеру, а затем должны прочесть весь кластер. Поэтому + создание больших кластеров может привести к неточному или медленному поиску. + +

+ +
--clusters-in-meta-seek + +

+ Указывает mkvmerge(1) создать метаэлемент поиска в конце файла, содержащего + все кластеры. Смотрите также раздел о компоновке файла Matroska. + +

+ +
--timestamp-scale фактор + +

+ Принудительное применение фактора к масштабированию + временных меток. Допустимы значения в интервале + 1000..10000000 или специальное + значение -1. + +

+ + +

+ Обычно mkvmerge(1) использует значение 1000000, что + означает, что метки времени и длительности имеют точность 1 мс. Для файлов, + которые не содержат в себе видеодорожку, но имеют по крайней мере одну + звуковую mkvmerge(1) автоматически выберет коэффициент масштаба метки + времени, чтобы все метки времени и длительность имели точность до одного + звукового образца. Это влечёт за собой большие накладные расходы, но + обеспечивает точный поиск и извлечение. + +

+ + +

+ Если используется специальное значение -1, то mkvmerge(1) будет использовать + точность до одного семпла, даже если видео-дорожка присутствует. + +

+ +
--enable-durations + +

+ Записать длительность всех блоков. Это увеличит размер файла, и на данный + момент не даёт никаких дополнительных преимуществ для плееров. + +

+ +
--no-cues + +

+ Сообщает mkvmerge(1) не создавать и записывать данные cue, которые могут быть + сопоставлены с индексом в AVI. Файлы Matroska(tm) можно воспроизводить без + данных cue, но поиск, вероятно, будет неточным и медленным. Используйте это, + только если вы действительно крайне нуждаетесь в месте или в целях + тестирования. Смотрите также параметр --cues, который + можно указать для каждого входного файла. + +

+ +
--no-date + +

+ По умолчанию mkvmerge(1) устанавливает в поле информации о сегменте "дата" + время и дату начала мультиплексирования. C этим параметре это поле вообще не + записывается. + +

+ +
--disable-lacing + +

+ Отключает сшивания на всех дорожках. Это увеличит размер файла, особенно + если в нём много звуковых дорожек. Этот параметр не для повседневного + использования. + +

+ +
--disable-track-statistics-tags + +

+ Обычно mkvmerge(1) записывает определённые теги со статистикой для каждой + дорожки. Если такие теги уже есть, они будут перезаписаны. Теги: + BPS, DURATION, + NUMBER_OF_BYTES и + NUMBER_OF_FRAMES. + +

+ + +

+ Включение этого параметра запрещает mkvmerge(1) записывать эти теги и + перезаписывать существующие теги с такими же названиями. + +

+ +
--disable-language-ietf + +

+ Обычно mkvmerge(1) записывает новые языковые элементы IETF BCP 47 в + дополнение к устаревшим языковым элементам в заголовках, главах и тегах + дорожек. Если используется этот параметр, записываются только устаревшие + элементы. + +

+ +
--normalize-language-ietf режим + +

+ Позволяет нормализовать все языковые теги IETF BCP 47 к их канонической + форме с режимом «canonical», к их форме расширенных + языковых подтегов с помощью режима «extlang» или + отключает его в режиме off. По умолчанию применяется + нормализация к канонической форме. + +

+ + +

+ В канонической форме все подтеги, для которых существуют предпочтительные + значения, заменяются этими предпочтительными значениями. Это преобразует, + например, «zh-yue-jyutping» в + «yue-jyutping» или «fr-FX» в + «fr-FR». + +

+ + +

+ Для формы расширенных языковых подтегов изначально строится каноническая + форма. После этого все основные языки, для которых существует расширенный + языковой подтег, заменяются этим расширенным языковым подтегом и его + префиксом. Это преобразует, например, «yue-jyutping» + обратно к «zh-yue-jyutping», но не влияет на + «fr-FR», потому что «fr» не является + расширенным языковым подтегом. + +

+ +
--stop-after-video-ends + +

+ Прекращает обработку по окончании основной видеодорожки, отбрасывая все + оставшиеся пакеты других дорожек. + +

+ +
+ + + +

2.5. Разбиение, связывание, соединение и склеивание файлов (другие глобальные + параметры)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split спецификация + +

+ Разрезает выходной файл по достижению заданного размера или заданного + времени. Обратите внимание, что треки могут быть разделены только + непосредственно перед ключевым кадром. Поэтому точка разделения может быть + немного не совпадать с тем, что указал пользователь. + +

+ + +

+ На данный момент mkvmerge(1) поддерживает следующие режимы: + +

+ + +
    + +
  1. + +

    + Разбиение по размеру. + +

    + + +

    + Синтаксис: --split + [size:]d[k|m|g] + +

    + + +

    + Примеры: --split size:700m или --split 150000000 + +

    + + +

    + Параметр d может заканчиваться на + «k» «m» или «g», + чтобы указать, что размер в КБ, МБ или ГБ соответственно. В ином случае + предполагается размер в байтах. После того как текущий исходный файл + достигнет этого ограничения размера, будет создан новый. + +

    + + +

    + Префикс 'size:' может быть опущен по соображениям + совместимости. + +

    + +
  2. + + +
  3. + +

    + Разбиение по прошествии времени. + +

    + + +

    + Синтаксис: --split + [duration:]HH:MM:SS.nnnnnnnnn|ds + +

    + + +

    + Примеры: --split duration:00:60:00.000 или --split + 3600s + +

    + + +

    + Параметр должен иметь форму HH:MM:SS.nnnnnnnnn для + определения длительности с точностью до наносекунды или быть числом + d, за которым следует буква «s» + для длительности в секундах. Параметр HH — это часы, + MM — минуты, SS — секунды, и + nnnnnnnnn — наносекунды. Как часы, так и наносекунды + можно опустить. После запятой может быть до девяти цифр. После того, как + длительность содержимого текущего вывода достигнет этого предела, будет + запущен новый исходный файл. + +

    + + +

    + Префикс 'duration:' может быть опущен по соображениям + совместимости. + +

    + +
  4. + + +
  5. + +

    + Разбиение после указной метки времени. + +

    + + +

    + Синтаксис: --split + timestamps:A[,B[,C...]] + +

    + + +

    + Пример: --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + Параметры A, B, + C и т. п. должны иметь тот же формат, что и те, что + используются для продолжительности (см. выше). Список меток времени + разделяется запятыми. После того, как входной поток достиг метки времени + текущей точки разделения, создаётся новый файл. Затем используется следующая + точка разделения, указанная в этом списке. + +

    + + +

    + Префикс 'timestamps:' не может быть опущен. + +

    + +
  6. + + +
  7. + +

    + Сохраняет отдельные части, указанные в диапазоне временных меток, и + отбрасывает остальные. + +

    + + +

    + Syntax: --split + parts:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + Примеры: +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + Режим parts указывает mkvmerge(1) сохранять определённые + диапазоны меток времени и отбросить другие. Диапазоны, которые необходимо + сохранить, должны быть перечислены после ключевого слова + parts: и разделены запятыми. Сам диапазон состоит из + метки времени начала и конца в формате одинакового вида, который принимается + в разных вариантах --split (например, + 00:01:20 и 80s ссылаются на ту же + метку времени). + +

    + + +

    + Если начальная метка времени не указана, то по умолчанию будет использована + метка времени конца предыдущего диапазона. Если предыдущего диапазона нет, + то будет использоваться начало файла (см. пример 3). + +

    + + +

    + Если конечная метка времени не указана, то по умолчанию она указывает на + конец фала, так что mkvmerge(1) просто сохранит оставшееся (см. пример 3). + +

    + + +

    + Обычно каждый диапазон записывается в новый файл. Это можно изменить так, + чтобы последовательные диапазоны записывались в один файл. Для этого + пользователь должен поставить перед меткой времени начала символ + +. Это указывает mkvmerge(1) не создавать новый файл, а + вместо этого добавить диапазон в тот же файл, в который был записан + предыдущий диапазон. Метки времени будут настроены таким образом, чтобы во + входном файле не было пробелов, даже если во входном файле был пробел в двух + диапазонах. + +

    + + +

    + В примере 1 mkvmerge(1) создаст два файла. Первый будет содержать данные с + 00:01:20 по 00:02:45. Второй файл + будет содержать данные с 00:05:50 по + 00:10:30. + +

    + + +

    + В примере 2 mkvmerge(1) создаст единственный файл. Он будет содержать данные + как с 00:01:20 по 00:02:45, так и с + 00:05:50 по 00:10:30. + +

    + + +

    + В примере 3 mkvmerge(1) создаст два файла. Первый будет содержать данные от + начала исходного файла по 00:02:45. Второй файл будет + содержать данные с 00:05:50 и до конца исходного файла. + +

    + + +
    +

    Note:

    + +

    + Обратите внимание, что mkvmerge(1) выполняет разделение лишь по позициям + ключевых кадров. Это относится как к началу, так и к концу каждого + диапазона. Поэтому, даже если метка времени конца находится между двумя + ключевыми кадрами, mkvmerge(1) продолжит вывод кадров до следующего ключевого + кадра, но не включая его. + +

    + +
    + +
  8. + + +
  9. + +

    + Сохраняет отдельные части, указанные в диапазоне номеров кадров/полей, и + отбрасывает остальные. + +

    + + +

    + Синтаксис: --split + parts-frames:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + Примеры: +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + Режим parts-frames указывает mkvmerge(1) сохранить + определённые диапазоны номеров кадров/полей, отбрасывая другие. Диапазоны + для сохранения должны быть перечислены после ключевого слова + parts-frames: и разделены запятыми. Сам диапазон состоит + из начального и конечного номера кадра/поля. Нумерация начинается с 1. + +

    + + +

    + Если начальное число не указано, то по умолчанию будет использовано число + конца предыдущего диапазона. Если предыдущего диапазона нет, то будет + использоваться начало файла (см. пример 3). + +

    + + +

    + Если конечное число не указано, то по умолчанию оно указывает на конец фала, + так что mkvmerge(1) просто сохранит оставшееся (см. пример 3). + +

    + + +

    + Обычно каждый диапазон записывается в новый файл. Это можно изменить так, + чтобы последовательные диапазоны записывались в один файл. Для этого + пользователь должен поставить перед номером начала символ + +. Это указывает mkvmerge(1) не создавать новый файл, а + вместо этого добавить диапазон в тот же файл, в который был записан + предыдущий диапазон. Метки времени будут настроены таким образом, чтобы во + входном файле не было пробелов, даже если во входном файле был пробел в двух + диапазонах. + +

    + + +
    +

    Note:

    + +

    + Обратите внимание, что mkvmerge(1) выполняет разделение только по позициям + ключевых кадров. Это относится как к началу, так и к концу каждого + диапазона. Поэтому, даже если конечный кадр / номер поля находится между + двумя ключевыми кадрами, mkvmerge(1) продолжит вывод кадров вплоть до + следующего ключевого кадра, исключая его. + +

    + +
    + + +

    + В примере 1 mkvmerge(1) создаст два файла. Первый будет включать содержимое, + начиная с первого ключевого кадра 137, но исключая первый + ключевой кадр с или после 258. Второй файл будет включать + содержимое от 548 до 1211. + +

    + + +

    + В примере 2 mkvmerge(1) создаст только один файл. Этот файл будет включать + содержимое, начиная с 733 до 912, и + содержимое, начиная с 1592 до 2730. + +

    + + +

    + В примере 3 mkvmerge(1) создаст два файла. Первый будет содержать данные от + начала исходного файла по 430. Второй файл будет + содержать данные с 2512 и до конца исходного файла. + +

    + + +

    + Этот режим берёт для вывода только первую видеодорожку. Если вывод не + является видеодорожкой, разбиение произведено не будет. + +

    + + +
    +

    Note:

    + +

    + Номера, заданные с этим аргументом, интерпретируются на основе числа + выводимых блоков Matroska(tm). Единый блок Matroska(tm) содержит либо полный + кадр (для прогрессивного содержимого) или одно поле (для содержимого с + чередованием). mkvmerge не различает их и просто подсчитывает количество + блоков. Например: если вы хотите разделить после 25-го полного кадра с + чередующимся содержимым, вам придётся в качестве точки разделения указать + 50 (два поля на полный кадр). + +

    + +
    + +
  10. + + +
  11. + +

    + Разбиение после указанного кадра/поля. + +

    + + +

    + Синтаксис: --split + frames:A[,B[,C...]] + +

    + + +

    + Пример: --split frames:120,237,891 + +

    + + +

    + Все параметры A, B, + C и далее должны быть целыми положительными + числами. Нумерация начинается с 1. Список номеров кадров/полей разделяется + запятыми. После того, как входящий поток достиг номера кадра/поля текущей + точки разделения, создаётся новый файл. Затем используется следующая точка + разделения, указанная в этом списке. + +

    + + +

    + Префикс 'frames:' не может быть опущен. + +

    + + +

    + Этот режим берёт для вывода только первую видеодорожку. Если вывод не + является видеодорожкой, разбиение произведено не будет. + +

    + + +
    +

    Note:

    + +

    + Номера, заданные с этим аргументом, интерпретируются на основе числа + выводимых блоков Matroska(tm). Единый блок Matroska(tm) содержит либо полный + кадр (для прогрессивного содержимого) или одно поле (для содержимого с + чередованием). mkvmerge не различает их и просто подсчитывает количество + блоков. Например: если вы хотите разделить после 25-го полного кадра с + чередующимся содержимым, вам придётся в качестве точки разделения указать + 50 (два поля на полный кадр). + +

    + +
    + +
  12. + + +
  13. + +

    + Разбиение перед указанной главой. + +

    + + +

    + Синтаксис: --split chapters:all or + --split + chapters:A[,B[,C...]] + +

    + + +

    + Пример: --split chapters:5,8 + +

    + + +

    + Все параметры A, B, C и далее должны быть целыми положительными + числами. Нумерация начинается с 1. Список номеров глав разделяется + запятыми. Разделение произойдёт непосредственно перед первым ключевым + кадром, метка времени которого равна или больше начальной метки времени для + глав, номера которых указаны. Глава, начинающаяся с 0s, никогда не + рассматривается для разделения и отбрасывается без изменений. + +

    + + +

    + Вместо указания номеров всех глав, достаточно использовать ключевое слово + all. + +

    + + +

    + Префикс 'chapters:' не может быть опущен. + +

    + + +
    +

    Note:

    + +

    + Формат файла Matroska(tm) поддерживает произвольные глубоко вложенные + структуры глав, которые называются «записями издания» и «атомами + глав». Однако этот режим учитывает лишь самый высокий уровень глав во всех + записях издания. + +

    + +
    + +
  14. + +
+ + +

+ Для этого режима разделения имя исходного файла обрабатывается иначе, чем + для обычной операции. Он может содержать printf, + выражение на подобии «%d», включая необязательную ширину поля, + напр. «%02d». Если это так, то номер текущего файла будет + отформатирован соответствующим образом и вставлен в это место имени + файла. Если такого шаблона нет, то перед расширением файла предусматривается + шаблон «-%03d»: «-o output.mkv» приведёт к + «output-001.mkv»' и т. д. Если расширения нет, к имени будет + добавлено «-%03d». + +

+ + +

+ Другим возможным шаблоном является «%c», который будет заменён + названием первой главы в файле. Обратите внимание, что когда присутствует + «%c», шаблон «-%03d» не будет добавлен + автоматически. + +

+ +
--link + +

+ Связать файлы друг с другом при разделении выходного файла. Подробности + смотрите в разделе о связывание + файлов ниже. + +

+ +
--link-to-previous segment-UID + +

+ Связывает первый исходный файл с сегментом из UID сегмента, заданным + параметром segment-UID. Подробности смотрите в + разделе связывание файла ниже. + +

+ + +

+ Если SID начинается с =, то остальное будет распознано как имя файла + Matroska, чей сегмент UID считывается и используется. + +

+ +
--link-to-next segment-UID + +

+ Связывает последний исходный файл с сегментом из UID сегмента, заданным + параметром segment-UID. Подробности смотрите в + разделе связывание файла ниже. + +

+ + +

+ Если SID начинается с =, то остальное будет распознано как имя файла + Matroska, чей сегмент UID считывается и используется. + +

+ +
--append-mode режим + +

+ Определяет способ вычисления меток времени при присоединении + файлов. Параметр mode имеет два значения: по + умолчанию "file" и "track". + +

+ + +

+ Когда mkvmerge добавляет дорожку (отныне называется + 'track2_1') из второго файла (что зовётся + 'file2') к дорожке (что зовётся + 'track1_1') из первого файла (что зовётся + 'file1'), то он должен смещать все метки времени для + 'track2_1' на определённую величину. Для режима + 'file' эта сумма является самой высокой меткой времени, + встречающейся в 'file1', даже если эта метка времени была + из дорожки, отличной от 'track1_1'. В режиме трека сдвиг + — это самая высокая временная метка 'track1_1'. + +

+ + +

+ К сожалению, mkvmerge не может определить, какой режим надёжен для + использования. Поэтому по умолчанию он работает в режиме + 'file'. Режим 'file' обычно лучше + работает для файлов, которые были созданы независимо друг от друга; + например, при добавлении файлов AVI или + MP4. Режим 'track' может работать лучше + для источников, которые по сути являются просто частями одного большого + файла, например, для файлов VOB и EVO. + +

+ + +

+ Дорожки субтитров всегда обрабатываются так, как если бы режим "file" был + активен, даже если включен режим "track". + +

+ +
--append-to + SFID1:STID1:DFID1:DTID1[,...] + +

+ Этот параметр определяет, к какой дорожке будет добавлена другая + дорожка. Каждая спецификация содержит четыре идентификатора: ИД файла, ИД + дорожки, ИД второго файла и ИД второй дорожки. Первая пара, «ИД исходного + файла» и «ИД исходной дорожки», определяет дорожку, которая должна быть + добавлена. Вторая пара, «ИД файла назначения» и «ИД дорожки назначения», + определяет дорожку, к которой добавляется первая. + +

+ + +

+ Если этот параметр был пропущен, используется стандартное сопоставление. Это + стандартное сопоставление добавляет каждую дорожку из текущего файла к + дорожке из предыдущего файла с тем же ИД дорожки. Это позволяет легко + добавлять, если фильм был разделен на две части и оба файла имеют одинаковое + количество дорожек и ИД дорожек с помощью команды mkvmerge -o + output.mkv part1.mkv +part2.mkv. + +

+ +
+ + +

+ Одиночный «+» вызывает присоединение следующего файла, а не его + добавление. «+» также можно поставить перед именем следующего файла. Поэтому + следующие две команды эквивалентны: + +

+ +
$ mkvmerge -o полный.mkv файл1.mkv + файл2.mkv
+$ mkvmerge -o полный.mkv файл1.mkv +файл2.mkv
+
[ файл1 файл2 + ] + +

+ Если несколько имён файлов содержатся в паре квадратных скобок, то второй и + все последующие файлы будут добавлены к первому файлу, названному в скобках. + +

+ + +

+ Альтернативное использование синтаксиса '+' между двумя именами + файлов. Поэтому следующие две команды эквивалентны: + +

+ +
$ mkvmerge -o полный.mkv файл1.mkv + файл2.mkv
+$ mkvmerge -o полный.mkv '[' файл1.mkv файл2.mkv ']'
+
= + +

+ Для определённых типов файлов (программные потоки MPEG, то есть файлы VOB) + mkvmerge(1) обычно ищет файлы в том же каталоге, что и входной файл, которые + имеют тоже базовое имя и отличаются лишь своим текущим номером (например, + «VTS_01_1.VOB», «VTS_01_2.VOB», «VTS_01_3.VOB» и т. д.) и обрабатывает все + эти файлы, как если бы они были объединены в один большой файл. Этот + параметр, т. е. просто «=», вынудит mkvmerge не искать эти дополнительные + файлы. + +

+ + +

+ Также можно поставить '=' перед следующим именем файла. Поэтому следующие + две команды эквивалентны: + +

+ +
$ mkvmerge -o полный.mkv = файл1.vob
+$ mkvmerge -o полный.mkv =файл1.vob
+
( файл1 файл2 + ) + +

+ Если несколько имён файлов находятся в паре скобок, эти файлы будут + рассматриваться так, как будто они были объединены в один большой файл, + состоящий из содержимого каждого из файлов один за другим. + +

+ + +

+ Это можно использовать, например, для файлов VOB, поступающих из + транспортных потоков DVD или MPEG. Его нельзя использовать, если каждый файл + содержит собственный набор заголовков, что обычно бывает с отдельными + файлами, такими как AVI или MP4. + +

+ + +

+ Ввод имени файла в скобки также препятствует поиску mkvmerge(1) + дополнительных файлов с таким же базовым названием, как описано в параметре + =. Поэтому эти две командные строки эквивалентны: + +

+ +
$ mkvmerge -o выход.mkv = файл.mkv
+$ mkvmerge -o выход.mkv '(' файл.mkv ')'
+ +

+ Следует отметить несколько моментов: + +

+ + +
    + +
  1. + +

    + После открывающей и перед закрывающей скобкой должны быть пробелы. + +

    + +
  2. + + +
  3. + +

    + Каждый параметр между скобками интерпретируется как имя файла. Поэтому все + параметры, применяемые к этому логическому файлу, должны быть перечислены + перед начальной скобкой. + +

    + +
  4. + + +
  5. + +

    + Некоторые оболочки рассматривают скобки как специальные символы. Таким + образом, вы должны скрыть или процитировать их, как показано в приведённом + выше примере. + +

    + +
  6. + +
+ +
+ + + + +

2.6. Поддержка вложений (другие глобальные параметры)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description описание + +

+ Обычное текстовое описание следующего вложения. Применяется к следующему + параметру --attach-file + или --attach-file-once. + + +

+ +
--attachment-mime-type тип MIME + +

+ Тип MIME следующего вложения. Применяется к следующему + параметру --attach-file + или --attach-file-once. + Список официально распознаваемых типов MIME можно найти, + например, на домашней странице + IANA. Тип MIME является обязательным для вложения. + +

+ + +

+ Если для вложения не задан тип MIME, то его тип будет + определён автоматически. + +

+ +
--attachment-name имя + +

+ Устанавливает имя, которое будет сохранено в исходном файле для этого + вложения. Если этот параметр не указан, имя будет получено из названия файла + вложенного файла, заданного с помощью параметров --attach-file + или --attach-file-once. + +

+ +
+ --attach-file имя-файла, + --attach-file-once имя-файла + + +

+ Создаёт вложение внутри файла Matroska(tm). Перед использованием этого + параметра необходимо установить тип MIME. Разница между + этими двумя формами заключается в том, что при разделении файлы, вложенные с + помощью --attach-file, прикрепляются ко всем исходным + файлам, а файлы, прикреплённые с помощью + --attach-file-once, прикрепляются только к первому + созданному файлу. Если разделение не используется, то оба делают одно и то + же. + +

+ + +

+ mkvextract(1) может использоваться для извлечения вложений из файла + Matroska(tm). + +

+ +
--enable-legacy-font-mime-types + +

+ Позволяет использовать устаревшие типы MIME для + определённых типов вложений шрифтов. Например, + «application/x-truetype-font» будет использоваться для + шрифтов TrueType вместо «fonts/ttf». + +

+ + +

+ Это влияет как на новые вложения, если их тип MIME + обнаружен автоматически, так и на существующие вложения, чьи сохранённые + типы MIME будут заменены устаревшими. + +

+ + +

+ Затрагиваются типы MIME: «font/sfnt», + «font/ttf» и «font/collection»; они + сопоставляются с «application/x-truetype-fonts» и + «font/otf», который сопоставляется с + «application/vnd .ms-opentype». + +

+ +
+ + + +

2.7. Параметры, которые могут быть использованы для каждого входного файла

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks + [!]n,m,... + +

+ Копировать дорожки аудио n, m + и так далее. Номера — это идентификаторы дорожек, которые можно узнать через + переключатель --identify. + Это не просто номера дорожек (см. раздел идентификаторы дорожек). По умолчанию: + копировать все дорожки аудио. + +

+ + +

+ Вместо идентификаторов дорожек вы также можете предоставить коды языков ISO + 639-2. Это будет работать только для исходных файлов, которые содержат + языковые теги для своих дорожек. + +

+ + +

+ По умолчанию: копировать любые подобные дорожки. + +

+ + +

+ Если идентификаторы имеют префикс !, то значение + меняется: копировать все дорожки этого типа, кроме тех, которые перечислены + после !. + +

+ +
-d, --video-tracks + [!]n,m,... + +

+ Копировать дорожки видео n, m + и так далее. Номера — это идентификаторы дорожек, которые можно узнать через + переключатель --identify. + Это не просто номера дорожек (см. раздел идентификаторы дорожек). По умолчанию: + копировать все дорожки видео. + +

+ + +

+ Вместо идентификаторов дорожек вы также можете предоставить коды языков ISO + 639-2. Это будет работать только для исходных файлов, которые содержат + языковые теги для своих дорожек. + +

+ + +

+ Если идентификаторы имеют префикс !, то значение + меняется: копировать все дорожки этого типа, кроме тех, которые перечислены + после !. + +

+ +
-s, --subtitle-tracks + [!]n,m,... + +

+ Копировать дорожки субтитров n, + m и так далее. Номера — это идентификаторы дорожек, + которые можно узнать через переключатель --identify. + Это не просто номера дорожек (см. раздел идентификаторы дорожек). По умолчанию: + копировать все дорожки субтитров. + +

+ + +

+ Вместо идентификаторов дорожек вы также можете предоставить коды языков ISO + 639-2. Это будет работать только для исходных файлов, которые содержат + языковые теги для своих дорожек. + +

+ + +

+ Если идентификаторы имеют префикс !, то значение + меняется: копировать все дорожки этого типа, кроме тех, которые перечислены + после !. + +

+ +
-b, --button-tracks + [!]n,m,... + +

+ Копировать дорожки кнопок n, m + и так далее. Номера — это идентификаторы дорожек, которые можно узнать через + переключатель --identify. Это не просто номера дорожек + (см. раздел идентификаторы + дорожек). По умолчанию: копировать все дорожки кнопок. + +

+ + +

+ Вместо идентификаторов дорожек вы также можете предоставить коды языков ISO + 639-2. Это будет работать только для исходных файлов, которые содержат + языковые теги для своих дорожек. + +

+ + +

+ Если идентификаторы имеют префикс !, то значение + меняется: копировать все дорожки этого типа, кроме тех, которые перечислены + после !. + +

+ +
--track-tags + [!]n,m,... + +

+ Копировать дорожки тегов n, m + и так далее. Номера — это идентификаторы дорожек, которые можно узнать через + переключатель --identify + (см. раздел идентификаторы + дорожек). Это не просто номера дорожек. По умолчанию: копировать все + дорожки тегов. + +

+ + +

+ Если идентификаторы имеют префикс !, то значение + разворачиваются: копировать всё кроме идентификаторов, перечисленных после + !. + +

+ +
-m, --attachments + [!]n[:all|first],m[:all|first],... + +

+ Копирует вложения с идентификаторами n, + m и т. д. ко всем или только к первому выходному + файлу. За каждым идентификатором может следовать ':all' + (что по умолчанию, если ничего не указано) или + ':first'. Если разделение активно, то те вложения, чьи + идентификаторы указаны с помощью ':all', копируются во + все исходные файлы, а другие копируются только в первый выходной файл. Если + разделение не активно, оба варианта имеют одинаковый эффект. + +

+ + +

+ По умолчанию копирует все вложения во все выходные файлы. + +

+ + +

+ Если идентификаторы имеют префикс !, то значение + разворачиваются: копировать всё кроме идентификаторов, перечисленных после + !. + +

+ +
-A, --no-audio + +

+ Не копировать любые аудиодорожки из этого файла. + +

+ +
-D, --no-video + +

+ Не копировать любые видеодорожки из этого файла. + +

+ +
-S, --no-subtitles + +

+ Не копировать любые субтитры из этого файла. + +

+ +
-B, --no-buttons + +

+ Не копировать любые дорожки кнопок из этого файла. + +

+ +
-T, --no-track-tags + +

+ Не копировать любые теги дорожек из этого файла. + +

+ +
--no-chapters + +

+ Не копировать главы из этого файла. + +

+ +
-M, --no-attachments + +

+ Не копировать вложения из этого файла. + +

+ +
--no-global-tags + +

+ Не копировать глобальные теги из этого файла. + +

+ +
-y, --sync + TID:d[,o[/p]] + +

+ Подстраивает временные метки дорожки с идентификатором + TID на dмс. Идентификаторы + дорожек являются теми же, как и те, которые предоставляются с --identify + (см. раздел идентификаторы + дорожек). + +

+ + +

+ o/p: поправка временных меток + с помощью o/p, чтобы исправить + линейные смещения. По умолчанию в случае пропуска p + равно 1. И o и p могут быть + числами с плавающей запятой. + +

+ + +

+ По умолчанию: ручная коррекция синхронизации отключена (что равноценно + d = 0 и + o/p = + 1.0). + +

+ + +

+ Этот параметр можно использовать несколько раз для входного файла, + применяемого к нескольким дорожкам, с указанием разных идентификаторов + дорожек. + +

+ +
--cues TID:none|iframes|all + +

+ Элементы управления, для которых записи списка CUE (индекса) дорожки, + создаются для данной дорожки (см. раздел идентификаторы + дорожек). 'none' предотвращает создание записей + списка cue. Для 'iframes' только блоки без ссылок назад + или вперед (= I-кадры в видео дорожках) помещаются в список + cue. 'all' заставляет mkvmerge(1) создавать записи cue для + всех блоков, что делает файл очень большим. + +

+ + +

+ По умолчанию — «iframes» для дорожек видео и субтитров и + «none» для звуковых дорожек. Смотрите также параметр + --no-cues, + который препятствует созданию записей cue, независимо от используемых + параметров --cues. + +

+ + +

+ Этот параметр можно использовать несколько раз для входного файла, + применяемого к нескольким дорожкам, с указанием разных идентификаторов + дорожек. + +

+ +
--default-track-flag + TID[:bool] + +

+ Устанавливает флаг «дорожка по умолчанию» для данной дорожки (см. раздел + идентификаторы дорожек), если + необязательный аргумент bool равен + 1 либо отсутствует. Флаг будет установлен, если + исходный контейнер не предоставил эту информацию, и пользователь не указал + её с помощью этого параметра. + +

+ + +

+ Если пользователь явно не выбирает дорожку во время воспроизведения, + проигрыватель должен выбрать одну из дорожек, для которой установлен флаг + «дорожка по умолчанию», учитывая, например, такие предпочтения пользователя, + как язык. + +

+ + +

+ Этот параметр можно использовать несколько раз для входного файла, + применяемого к нескольким дорожкам, с указанием разных идентификаторов + дорожек. + +

+ +
--track-enabled-flag + TID[:bool] + +

+ Устанавливает флаг «дорожка включена» для данной дорожки (см. раздел идентификаторы дорожек) в указанное + значение bool (0 или 1, по умолчанию равно 1, если не + указано). Дорожки включены по умолчанию, если для них не задан параметр, и + исходный контейнер также не предоставляет эту информацию. + +

+ + +

+ Для воспроизведения следует рассматривать только дорожки, для которых + установлен флаг «дорожка включена». + +

+ + +

+ Этот параметр можно использовать несколько раз для входного файла, + применяемого к нескольким дорожкам, с указанием разных идентификаторов + дорожек. + +

+ +
--forced-display-flag + TID[:bool] + +

+ Устанавливает флаг «принудительное отображение» для данной дорожки + (см. раздел идентификаторы + дорожек), если необязательный аргумент bool + равен 1 либо отсутствует. Используйте его для дорожек, + содержащих экранный текст или диалог на иностранном языке. + +

+ + +

+ Этот параметр можно использовать несколько раз для входного файла, + применяемого к нескольким дорожкам, с указанием разных идентификаторов + дорожек. + +

+ +
--hearing-impaired-flag + TID[:bool] + +

+ Устанавливает флаг «нарушение слуха» для данной дорожки (см. раздел идентификаторы дорожек), если + необязательный аргумент bool равен + 1 либо отсутствует. Этот флаг может быть установлен, + если дорожка подходит для пользователей с нарушениями слуха. + +

+ + +

+ Этот параметр можно использовать несколько раз для входного файла, + применяемого к нескольким дорожкам, с указанием разных идентификаторов + дорожек. + +

+ +
--visual-impaired-flag + TID[:bool] + +

+ Устанавливает флаг «слабовидящие» для данной дорожки (см. раздел идентификаторы дорожек), если + необязательный аргумент bool равен + 1 либо отсутствует. Этот флаг может быть установлен, + если дорожка подходит для пользователей с нарушениями зрения. + +

+ + +

+ Этот параметр можно использовать несколько раз для входного файла, + применяемого к нескольким дорожкам, с указанием разных идентификаторов + дорожек. + +

+ +
--text-descriptions-flag + TID[:bool] + +

+ Устанавливает флаг «текстовые описания» для данной дорожки (см. раздел идентификаторы дорожек), если + необязательный аргумент bool равен + 1 либо отсутствует. Этот флаг может быть установлен, + если дорожка содержит текстовые описания видеоматериала, пригодного для + воспроизведения через систему преобразования текста в речь для слабовидящих + пользователей. + +

+ + +

+ Этот параметр можно использовать несколько раз для входного файла, + применяемого к нескольким дорожкам, с указанием разных идентификаторов + дорожек. + +

+ +
--original-flag + TID[:bool] + +

+ Устанавливает флаг «исходный язык» для данной дорожки (см. раздел идентификаторы дорожек), если + необязательный аргумент bool равен + 1 либо отсутствует. Этот флаг может быть установлен, + если дорожка на языке оригинала содержимого (не является переводом). + +

+ + +

+ Этот параметр можно использовать несколько раз для входного файла, + применяемого к нескольким дорожкам, с указанием разных идентификаторов + дорожек. + +

+ +
--commentary-flag + TID[:bool] + +

+ Устанавливает флаг «комментарии» для данной дорожки (см. раздел идентификаторы дорожек), если + необязательный аргумент bool равен + 1 либо отсутствует. Этот флаг может быть установлен, + если трек содержит комментарии. + +

+ + +

+ Этот параметр можно использовать несколько раз для входного файла, + применяемого к нескольким дорожкам, с указанием разных идентификаторов + дорожек. + +

+ +
--track-name TID:имя + +

+ Указывает имя для выбранной дорожки (см. раздел Идентификаторы дорожек) равным + name. + +

+ +
--language TID:язык + +

+ Устанавливает язык для данной дорожки (см. раздел идентификаторы дорожек). Разрешены как + коды языков ISO 639-2, так и коды стран ISO 639-1. Коды стран будут + автоматически преобразованы в коды языков. Все языки, включая их коды ISO + 639-2, можно указать с помощью параметра --list-languages. + +

+ + +

+ Этот параметр можно использовать несколько раз для входного файла, + применяемого к нескольким дорожкам, с указанием разных идентификаторов + дорожек. + +

+ +
-t, --tags + TID:имя-файла + +

+ Читает теги для дорожки с номером TID из файла + имя-файла. Подробности смотрите в разделе о теги ниже. + +

+ +
--aac-is-sbr + TID[:0|1] + +

+ Сообщает mkvmerge(1), что трек с ID TIDSBR + AAC (также известный как HE-AAC или + AAC+). Эти параметры необходимы, если а) исходный файл + является файлом ААС (не файл + Matroska(tm)) и б) файл AAC содержит данные SBR + AAC. Причина этого переключателя в том, что технически невозможно + автоматически идентифицировать нормальные данные AAC из + данных SBR AAC без декодирования полного кадра + AAC. Поскольку существует несколько патентных проблем с + декодерами AAC mkvmerge(1) никогда не будет содержать + декодирования. Поэтому для файлов SBR AAC этот + переключатель является обязательным. Полученный файл может не + воспроизводиться должным образом или даже не воспроизводиться вообще, если + переключатель был пропущен. + +

+ + +

+ Если исходным файлом является файл Matroska(tm), то + CodecID должно быть достаточно для обнаружения + SBR AAC. Однако, если CodecID неправильный, то этот + переключатель можно использовать, чтобы исправить его. + +

+ + +

+ Если mkvmerge неверно определяет файл AAC в виде + SBR, то вы можете добавить ':0' к + идентификатору дорожки. + +

+ +
--audio-emphasis TID:n|symbolic-name + +

+ Задаёт акцент для звуковой дорожки с помощью идентификатора дорожки + TID. Режим может быть либо числом + n (определённые значения от 0 до + 16) или символьным именем. Все допустимые номера и + символьные имена могут быть перечислены с помощью параметра + --list-audio-accession. + +

+ +
--reduce-to-core TID + +

+ Некоторые аудиокодеки имеют ядро с потерями и дополнительные расширения, + которые реализуют декодирование без потерь. Этот параметр сообщает + mkvmerge(1) копировать только ядро, но не расширение. По умолчанию mkvmerge(1) + копирует как ядро, так и расширение. + +

+ + +

+ В настоящее время этот параметр влияет только на дорожки + DTS. Дорожки TrueHD, которые содержат встроенное ядро + AC-3, вместо этого представлены как две отдельные дорожки, + для которых пользователь может выбрать, какую дорожку копировать. Для + DTS такая схема не будет работать, потому что расширения HD + не могут быть декодированы сами по себе – в отличие от данных TrueHD. + +

+ +
--remove-dialog-normalization-gain + TID + +

+ Некоторые кодеки аудио содержат поля заголовка, которые указывают декодеру + или проигрывателю применить усиление для нормализации диалога (обычно + отрицательное). Этот параметр сообщает mkvmerge(1) удалить или минимизировать + это усиление (gain), изменив соответствующие поля заголовка. + +

+ + +

+ На данный момент этот параметр влияет только на дорожки + AC-3, DTS и TrueHD. + +

+ +
--timestamps TID:имя-файла + +

+ Читает метки времени, которые будут использоваться для определённого + идентификатора дорожки с file-name. Эти метки времени + принудительно заменяют метки времени, которые mkvmerge(1) рассчитывает + обычно. Прочитайте раздел о внешних файлах меток + времени. + +

+ +
--default-duration TID:x + +

+ Принудительно устанавливает длительность заданной дорожки по умолчанию до + указанного значения. Также изменяет метки времени дорожки, чтобы + соответствовать длительности по умолчанию. Аргумент x + должен иметь один из постфиксов 's', + 'ms', 'us', 'ns', + 'fps', 'p' или 'i', + чтобы указать длительность по умолчанию в секундах, миллисекундах, + микросекундах, наносекундах, «кадрах в секунду», «прогрессивных кадрах в + секунду» или «чересстрочных кадрах в секунду» соответственно. Число + x может быть числом с плавающей запятой или дробью. + +

+ + +

+ Если длительность по умолчанию не является принудительной, mkvmerge + попытается получить длительность дорожки по умолчанию из контейнера и/или + закодированного битового потока для определённых типов дорожек, например, + AVC/H.264 или MPEG-2. + +

+ + +

+ Этот параметр также может быть использован для изменения частоты + кадров видеодорожек без необходимости использования внешнего файла + временных меток. + +

+ +
--fix-bitstream-timing-information + TID[:0|1] + +

+ Обычно mkvmerge(1) не изменяет информацию о времени (скорость кадров/полей), + хранящуюся в битовом потоке видео. С помощью этого параметра эта информация + корректируется в соответствии с информацией о времени из + контейнера. Информация о времени из контейнера может поступать из разных + источников: из командной строки (см. параметр --default-duration), + исходного контейнера или производного от битового потока. + +

+ + +
+

Note:

+ +

Это было реализовано только для видеодорожек AVC/H.264.

+ +
+ +
--compression TID:n + +

+ Выбирает метод сжатия, который будет использоваться для дорожки. Обратите + внимание, что плеер также должен поддерживать этот метод. Допустимые + значения: «none», «zlib» и + «mpeg4_p2»/«mpeg4p2». + +

+ +

+ Метод сжатия «mpeg4_p2»/«mpeg4p2» + является специальным методом сжатия, который называется «удаление заголовка» + и доступен только для видеодорожек MPEG4 part 2. + +

+ +

+ По умолчанию для некоторых типов субтитров используется сжатие + «zlib». Этот метод сжатия поддерживает большинство, если + не все программы воспроизведения. Поддержка других методов сжатия, кроме + «none», не гарантируется. + +

+ +
+ + + +

2.8. Параметры, применяемые только к видеодорожкам

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc + TID:FourCC + +

+ Принудительно указывает заданное значение для + FourCC. Работает только для дорожек видео в режиме + "MS compatibility mode". + +

+ +
--display-dimensions + TID:widthxheight + +

+ Файлы Matroska(tm) содержат два значения, устанавливающие свойства + отображения, к которым проигрыватель должен масштабировать изображение во + время воспроизведения: ширина и высота экрана. Эти значения можно установить + с помощью этого параметра, напр., «1:640x480». + +

+ + +

+ Другим способом указания значений является использование параметра --aspect-ratio + или --aspect-ratio-factor + (см. ниже). Эти параметры являются взаимоисключающими. + +

+ +
--aspect-ratio + TID:ratio|width/height + +

+ Файлы Matroska(tm) содержат два значения, которые устанавливают свойства + отображения, до которых проигрыватель должен масштабировать изображение во + время воспроизведения: ширина и высота изображения. С помощью этого + параметра mkvmerge(1) автоматически вычислит ширину и высоту изображения на + основе исходной ширины и высоты изображения и соотношения сторон, заданного + с помощью этого параметра. Коэффициент можно указать либо в виде + отношения чисел с плавающей запятой, либо в виде + дроби 'ширина/высота', + например '16/9'. + +

+ + +

+ Другим способом указать значения является использование параметров --aspect-ratio-factor + или --display-dimensions + (см. выше и ниже). Эти параметры являются взаимоисключающими. + +

+ +
--aspect-ratio-factor TID:factor|n/d + +

+ Другой способ установить соотношение сторон — это указать + коэффициент. Исходное соотношение сторон сначала + умножается на этот коэффициент, а затем используется + как целевое соотношение сторон. + +

+ + +

+ Другим способом указать значения является использование параметров --aspect-ratio + или --display-dimensions + (см. выше и ниже). Эти параметры являются взаимоисключающими. + +

+ +
--cropping + TID:слева,сверху,справа,снизу + +

+ Указывает значения обрезки пикселей для видеодорожки. + +

+ +
--color-matrix-coefficients TID:n + +

+ Устанавливает матричные коэффициенты видео, которые используются для + получения значений яркости и цветности на основе основных цветов красного, + зелёного и синего. Параметр n является целым числом + от 0 до 10. + +

+ + +

+ Допустимые значения и их расшифровка: + +

+ + +

+ 0: GBR, 1: BT709, + 2: unspecified, 3: reserved, + 4: FCC, 5: BT470BG, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 non-constant + luminance, 10: BT2020 constant luminance + +

+ +
--color-bits-per-channel TID:n + +

+ Указывает число кодированных битов для канала цвета. Значение + 0 показывает, что число битов не указано. + +

+ +
--chroma-subsample TID:hori,vert + +

+ Количество пикселей, предназначенных для удаления в каналах Cr и Cb для + каждого неудалённого пикселя по горизонтали/вертикали. + +

+ + +

+ Пример: Для видео с цветовая субдискретизация 4:2:0 следует указать параметр + TID:1,1. + +

+ +
--cb-subsample TID:hori,vert + +

+ Количество пикселей, предназначенных для удаления в канале Cb для каждого + неудалённого пикселя по горизонтали. Это добавка к + --chroma-subsample. + +

+ + +

+ Пример: для видео с цветовой субдискретизацией 4:2:1, параметр + --chroma-subsample должен быть установлен до + TID:1,0 + и подвыборка Cb должна быть установлена до + TID:1,0. + +

+ +
--chroma-siting TID:hori,vert + +

+ Устанавливает то, как цветность располагается по горизонтали/вертикали + (0: не указано, 1: сверху + совмещённо, 2: наполовину). + +

+ +
--color-range TID:n + +

+ Устанавливает отсечение диапазонов цвета (0: + неопределено, 1: диапазон трансляции, + 2: полный диапазон (без отсечения), + 3: задан через + MatrixCoefficients/TransferCharacteristics). + +

+ +
--color-transfer-characteristics + TID:n + +

+ Характеристики передачи видео. + +

+ + +

+ Допустимые значения и их расшифровка: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: gamma 2.2 curve, 5: gamma 2.8 + curve, 6: SMPTE 170M, 7: SMPTE + 240M, 8: linear, 9: log, + 10: log sqrt, 11: IEC 61966-2-4, + 12: ITU-R BT.1361 extended color gamut, + 13: IEC 61966-2-1, 14: ITU-R + BT.2020 10 bit, 15: ITU-R BT.2020 12 bit, + 16: SMPTE ST 2084, 17: SMPTE ST + 428-1; 18: ARIB STD-B67 (HLG) + +

+ +
--color-primaries TID:n + +

+ Устанавливает базовые цвета видео. + +

+ + +

+ Допустимые значения и их расшифровка: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: ITU-R BT.470M, 5: ITU-R + BT.470BG, 6: SMPTE 170M, 7: SMPTE + 240M, 8: FILM, 9: ITU-R BT.2020, + 10: SMPTE ST 428-1, 22: JEDEC P22 + phosphors + +

+ +
--max-content-light TID:n + +

+ Устанавливает максимальную яркость одного пикселя (Maximum Content Light + Level) в канделах на квадратный метр (кд/м2). Значение + n должно быть целым неотрицательным числом. + +

+ +
--max-frame-light TID:n + +

+ Устанавливает максимальную яркость одного полного кадра (Maximum + Frame-Average Light Level) в канделах на квадратный метр (кд/м2). Значение + n должно быть целым неотрицательным числом. + +

+ +
--chromaticity-coordinates + TID:red-x,red-y,green-x,green-y,blue-x,blue-y + +

+ Указывает координату цветности красного/зелёного/синего цвета, как + определено в CIE 1931. + +

+ +
--white-color-coordinates TID:x,y + +

+ Указывает координату цветности белого цвета, как определено в CIE 1931. + +

+ +
--max-luminance TID:float + +

+ Устанавливает максимальную яркость в канделах на квадратный метр + (кд/м2). Значение должно быть меньше 9999,99. + +

+ +
--min-luminance TID:float + +

+ Устанавливает минимальную яркость в канделах на квадратный метр + (кд/м²). Значение должно быть меньше чем 999,99. + +

+ +
--projection-type TID:method + +

+ Устанавливает используемый метод проекции видео. Допустимые значения: 0 + (прямоугольная проекция), 1 (равноугольная проекция), 2 (проекция кубической + карты) и 3 (проекция сетки). + +

+ +
--projection-private TID:данные + +

+ Устанавливает частные данные, которые применяются только к определённой + проекции. Данные должны быть представлены в виде шестнадцатеричных чисел с + префиксом «0x» или без него, с пробелами или без них. + +

+ +
--projection-pose-yaw TID:float + +

+ Определяет параметры поворота проекции вокруг перпендикулярной оси. + +

+ +
--projection-pose-pitch TID:float + +

+ Определяет параметры поворота проекции вокруг поперечной оси. + +

+ +
--projection-pose-roll TID:float + +

+ Определяет параметры поворота проекции вокруг продольной оси. + +

+ +
--field-order TID:n + +

+ Задаёт порядок полей в дорожке видео с идентификатором + TID. Порядок должен быть указан одним из следующих + номеров: + +

+ + +

+ 0: прогрессивный; 1: чересстрочный + с отображением верхнего поля первым, первым сохраняется верхнее поле; + 2: неопределённый порядок полей; + 6: чересстрочный с отображением нижнего поля первым, + первым сохраняется нижнее поле; 9: чересстрочный с + отображением нижнего поля первым, первым сохраняется нижнее поле; + 14: чересстрочный с отображением верхнего поля первым, + первым сохраняется нижнее поле + +

+ +
--stereo-mode TID:n|symbolic-name + +

+ Устанавливает стереорежим для видеодорожки с помощью идентификатора дорожки + TID. Режим может быть числом n + от 0 до 14 либо символьным + именем. Все допустимые номера и имена могут быть перечислены с помощью параметра + --list-stereo-modes. + +

+ +
+ + + +

2.9. Параметры, применяющиеся только к текстовым субтитрам

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset TID:кодировка + +

+ Устанавливает набор символов для преобразования в UTF-8 для субтитров UTF-8 + для заданного идентификатора дорожки. Если не указано иное, набор символов + будет получен из текущих настроек языка. Обратите внимание, что набор + символов не требуется для чтения субтитров из файлов Matroska(tm) или из + потоков Kate, поскольку они всегда хранятся в UTF-8. Смотрите раздел о текстовых файлах и наборах + символов, чтобы узнать, как mkvmerge(1) преобразует между наборами + символов. + +

+ + +

+ Этот параметр можно использовать несколько раз для входного файла, + применяемого к нескольким дорожкам, с указанием разных идентификаторов + дорожек. + +

+ +
+ + + +

2.10. Прочие параметры

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify + имя-файла + +

+ Позволит mkvmerge(1) проверить один файл и сообщить его тип, дорожки, + содержащиеся в файле, и их идентификаторы. Если используется этот параметр, + то другим единственным разрешённым параметром является имя файла. + +

+ + +

Формат вывода результата может быть изменён параметром --identification-format. +

+ +
-J имя-файла + +

+ Это удобный псевдоним для "--identification-format json --identify + имя-файла". + +

+ +
-F, --identification-format + формат + +

+ Определяет исходный формат, используемый параметром + --identify. Поддерживаются следующие форматы: + text (по умолчанию, если этот параметр не используется) и + json. + +

+ + +
    + +
  1. + +

    Текстовый формат выглядит коротким и удобочитаемым для + человека. Он состоит из одной строки для каждого найденного объекта + (контейнера, дорожки, вложения и т. д.). +

    + + +

    Этот формат не для анализа. Выходные данные будут переведены в язык, + используемый в mkvmerge(1) (см. также --ui-language). +

    + +
  2. + + +
  3. + +

    + Формат вывода json является машиночитаемым представлением + JSON. Этот формат соответствует схеме JSON, описанной в следующем файле: + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + Все версии схемы JSON доступны как онлайн, так и в выпущенных архивах + исходного кода. + +

    + +
  4. + +
+ +
--probe-range-percentage процент + +

+ Типы файлов, такие как программы и транспортные потоки MPEG + (.vob, .m2ts), требуют разбора + определённого количества данных, чтобы обнаружить все дорожки, содержащиеся + в файле. Эта количество составляет 0,3% от размера исходного файла или 10 + МБ, в зависимости от того, что больше. + +

+ + +

+ Если известно, что дорожки присутствуют, но не найдены, то процент для + проверки можно изменить с помощью этого параметра. Минимальный размер 10 МБ + является встроенным и не может быть изменён. + +

+ +
--list-audio-emphasis + +

+ Выводит список допустимых чисел и их соответствующих символических имён для + параметра --audio-emphasis. + +

+ +
--list-languages + +

+ Перечисляет все языки и их коды ISO 639-2, которые можно использовать с + параметром --language. + +

+ +
--list-stereo-modes + +

+ Выводит список допустимых чисел и их соответствующих символических имён для + параметра --stereo-mode. + +

+ +
-l, --list-types + +

+ Список поддерживаемых типов входящих файлов. + +

+ +
--priority приоритет + +

+ Устанавливает приоритет, с которым выполняется процесс + mkvmerge(1). Допустимые значения — 'lowest', + 'lower', 'normal', + 'higher' и 'highest'. Если ничего не + задано, используется 'normal'. В Unix-системах mkvmerge(1) + использует функцию nice(2). Поэтому только суперпользователь + может использовать 'higher' и + 'highest'. В Windows все значения доступны для + использования любому пользователю. + +

+ + +

Выбор "самого низкого" также приводит к тому, что + mkvmerge(1) выбирает приоритет холостого ввода-вывода в дополнение к самому + низкому возможному приоритету процесса. +

+ +
--command-line-charset кодировка + +

+ Устанавливает набор символов для преобразования строк заданных через + командную строку. По умолчанию используется набор символов для системной + локальные. Эти параметры применяются к аргументам следующих параметров: + --title, + --track-name + и --attachment-description. + +

+ +
--output-charset кодировка + +

+ Указывает кодировку, в которую конвертируются выходные строки. По умолчанию + используется текущая кодировка системного языка. + +

+ +
-r, --redirect-output + имя-файла + +

+ Записывает все сообщения в файл file-name вместо + консоли. Хотя это можно легко сделать с помощью перенаправления вывода, есть + случаи, когда этот параметр нужен: если терминал повторно интерпретирует + выход перед записью его в файл. Набор символов, установленный с --output-charset, + учитывается. + +

+ +
--flush-on-close + +

+ Указывает программе сбросить все данные, закэшированные в памяти, в + хранилище при закрытии файлов, открытых для записи. Это может быть + использовано для предотвращения потери данных при отключении питания или для + обхода определённых проблем в операционной системе или + драйверах. Недостатком является то, что паковка займёт больше времени, так + как mkvmerge придётся ждать, пока все данные не будут записаны в хранилище + перед выходом. Смотрите проблемы #2469 и #2480 в трекере ошибок MKVToolNix, + где подробно прокомментированы плюсы и минусы. + +

+ +
--ui-language код + +

+ Принудительно использовать перевод на код языка + (напр., «de_DE» для немецкого). Если указать + «list» вместо кода, то отобразится + список доступных переводов. + +

+ +
--abort-on-warnings + +

+ Указывает mkvmerge прерывание после появления первого предупреждения. Код + завершения программы будет 1. + +

+ +
--deterministic seed + +

+ Позволяет создавать файлы, идентичные до байта, если та же версия mkvmerge(1) + использована с теми же исходными файлами, тем же набором параметров и тем же + начальным элементом. Обратите внимание, что информационное поле сегмента + «дата» не записывается в этом режиме. + +

+ + +

Зерно может быть произвольной строкой и не обязательно должно быть числом.

+ + +

+ Результат работы байт-идентичных файлов гарантируется только при следующих + условиях: + +

+ + +
    + +
  1. + +

    Используется та же версия mkvmerge(1), собранная с теми же версиями libEBML и + libMatroska. +

    + +
  2. + + +
  3. + +

    Используемые исходные файлы байт-идентичны.

    + +
  4. + + +
  5. + +

    Те же параметры командной строки используются в том же порядке (за + исключением --output ...). +

    + +
  6. + +
+ + +

+ Использование других версий mkvmerge(1) или других параметров командной + строки может выдать тот же файл, идентичный до байта, но это не + гарантируется. + +

+ +
--debug тематика + +

+ Включить режим отладки для указанной функции. Этот параметр полезен только + для разработчиков. + +

+ +
--engage функция + +

+ Включает экспериментальные функции. Список доступных функций можно запросить + с помощью mkvinfo --engage list. Эти функции не + предназначены для использования в обычных ситуациях. + +

+ +
--gui-mode + +

+ Включает режим графического интерфейса. В этом режиме могут отображаться + специально отформатированные строки для отправки управляющих сообщений + интерфейсу. Формат сообщений — '#GUI#message'. За + сообщением могут быть указаны пары ключа и значения, например + '#GUI#message#key1=value1#key2=value2…'. Сообщения и + ключи не переводятся и всегда выводятся на английском. + +

+ +
@файл-параметров.json + +

+ Читает дополнительные аргументы командной строки из файла + options-file. Подробности смотрите в разделе файлов параметров. + +

+ +
--capabilities + +

+ Выводит информацию о дополнительных функциях, которые были скомпилированы и + вышли. В первой строке вывода будет информация о версии. Все последующие + строки содержат ровно одно слово, наличие которого указывает на то, что + функция скомпилирована. Эти функции следующие: + +

+ + +
    + +
  • + +

    + «FLAC» -- читает необработанные файлы + FLAC и работает с дорожками FLAC в других + контейнерах, например Ogg(tm) или Matroska(tm). + +

    + +
  • + +
+ +
-h, --help + +

+ Показать сведения об использовании и выйти. + +

+ +
-V, --version + +

+ Показать сведения о версии и выйти. + +

+ +
+ + +

3. Использование

+ + +

+ Для каждого файла пользователь может выбрать, какие дорожки mkvmerge(1) + должен взять. Все они помещаются в файл, указанный с параметром + -o. Список известных (и поддерживаемых) входных форматов + можно получить с помощью параметра -l. + +

+ + +
+

Important:

+ +

+ Порядок параметров в командной строке очень важен. Пожалуйста, прочтите + раздел «Порядок параметров», + если вы незнакомы с программой. + +

+ +
+ +

4. Порядок параметров

+ + + +

+ Порядок ввода параметров важен для некоторых параметров. Варианты делятся на + две категории: + +

+ + +
    + +
  1. + +

    + Параметры, которые влияют на всю программу и не привязаны ни к одному + входному файлу. Они включают, но не ограничиваются + --command-line-charset, --output или + --title. Они могут быть в любом месте командной строки. + +

    + +
  2. + + +
  3. + +

    + Параметры, которые влияют на одиночный входной файл или одиночную дорожку во + входном файле. Все эти параметры применяются к следующему входному файлу в + командной строке. Все параметры, применяемые к одному и тому же входному + файлу (или к дорожкам из одного и того же входного файла), могут быть + записаны в любом порядке, если все они появляются перед именем этого + входного файла. Примеры применения параметров к входному файлу: + --no-chapters или + --chapter-charset. Примеры применения параметров к + одиночной дорожке: --default-duration или + --language. + +

    + +
  4. + +
+ + +

+ Параметры обрабатываются слева направо. Если параметр появляется несколько + раз в пределах одной области, будет использовано последнее + вхождение. Поэтому заголовок будет установлен на «что-то другое» в следующем + примере: + +

+ +
$ mkvmerge -o выход.mkv --title 'Такой' вход.avi --title 'Другой'
+ +

+ В следующем примере показано, что использование параметра + --language дважды является нормальным, так как они + используется в различных областях. Несмотря на то, что они применяются к + одному и тому же идентификатору дорожки, они применяются к разным исходным + файлам и, следовательно, имеют разную область действия: + +

+ +
$ mkvmerge -o выход.mkv --language 0:fre français.ogg --language 0:deu deutsch.ogg
+

5. Примеры

+ + +

+ Предположим, у вас есть файл MyMovie.avi и аудиодорожка в отдельном файле, + например «MyMovie.wav». Для начала вы хотите закодировать + аудио в OggVorbis(tm): + +

+ +
$ oggenc -q4 -oМоё-видео.ogg Моё-видео.wav
+ +

+ Спустя несколько минут вы можете объединить видео и аудио: + +

+ +
$ mkvmerge -o Моё-видео-со-звуком.mkv Моё-видео.avi Моё-видео.ogg
+ +

+ Если ваш AVI уже содержит звуковую дорожку, то она также + будет скопирована (если mkvmerge(1) поддерживает её аудиоформат). Чтобы + избежать этого, просто сделайте следующее + +

+ +
$ mkvmerge -o Моё-видео-со-звуком.mkv -A Моё-видео.avi Моё-видео.ogg
+ +

+ После нескольких минут раздумий вы выбираете другую звуковую дорожку, + например комментарии или иноязычную дорожку к + «MyMovie-add-audio.wav». Кодируете его ещё раз и + объединяете с другим файлом: + +

+ +
$ oggenc -q4 -oМоё-видео-с-добавлением-аудио.ogg Моё-видео-с-добавлением-аудио.wav
+$ mkvmerge -o МВ-полное.mkv Моё-видео-с-аудио.mkv Моё-видео-с-добавлением-аудио.ogg
+ +

+ Такого же результата можно добиться с помощью + +

+ +
$ mkvmerge -o МВ-полное.mkv -A Моё-видео.avi Моё-видео.ogg Моё-видео-с-добавлением-аудио.ogg
+ +

+ Теперь используйте mplayer(tm) и наслаждайтесь. Если + у вас есть несколько аудиодорожек (или даже дорожек видео), вы можете + указать mplayer(tm)'у какую дорожку проигрывать, + используя параметры '-vid' и '-aid'. Они + основаны на 0 и не различают видео и аудио. + +

+ + +

+ Если вам нужна синхронизация звуковой дорожки, вы можете легко это + сделать. Сначала узнайте идентификатор дорожки Vorbis с помощью + +

+ +
$ mkvmerge --identify рассинхрон.ogg
+ +

+ Теперь вы можете использовать этот идентификатор в следующей командной + строке: + +

+ +
$ mkvmerge -o синхронный.mkv -A источник.avi -y 12345:200 рассинхрон.ogg
+ +

+ Это добавит 200 мс тишины в начале звуковой дорожки с идентификатором + 12345, взятым из 'out of sync.ogg'. + +

+ + +

+ Некоторые фильмы начинают синхронизироваться правильно, но постепенно теряют + синхронизацию. Для таких фильмов вы можете указать коэффициент задержки, + который будет применяться ко всем временным меткам – данные не добавляются и + не удаляются. Поэтому, если вы сделаете это соотношение слишком большим или + слишком маленьким, вы получите плохие результаты. Например, эпизод имеет + рассинхронизацию 0,2 секунды в конце фильма длиной + 77340 кадров. При частоте кадров 29,97 + к/c 0,2 секунды составляют примерно + 6 кадров. Поэтому я сделал + +

+ +
$ mkvmerge -o синхронный.mkv -y 23456:0,77346/77340 рассинхрон.mkv
+ +

+ Результат был прекрасный. + +

+ + +

+ Параметры синхронизации могут использоваться для субтитров таким же + способом. + +

+ + +

+ Для текстовых субтитров можно использовать программное обеспечение Windows + (типа SubRipper(tm)) или пакет + subrip(tm), который можно найти в исходных файлах + transcode(1) + в каталоге «contrib/subrip». Общий процесс таков: + +

+ + +
    + +
  1. + +

    извлечь необработанный поток субтитров из исходника:

    +
    $ tccat -i /path/to/copied/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o мойфильм
    +
  2. + + +
  3. + +

    конвертировать результирующие изображения PGM в текст с помощью gocr:

    +
    $ pgm2txt моёвидео
    +
  4. + + +
  5. + +

    проверить правописание результирующих текстовых файлов:

    +
    $ ispell -d american *txt
    +
  6. + + +
  7. + +

    конвертировать текстовые файлы в файл SRT:

    +
    $ srttool -s -w -i мойфильм.srtx -o мойфильм.srt
    +
  8. + +
+ + +

+ Выходной файл может быть использован как входной для mkvmerge(1): + +

+ +
$ mkvmerge -o мойфильм.mkv мойфильм.avi мойфильм.srt
+ +

+ Если вы хотите указать язык для определённой дорожки, это легко + сделать. Сначала узнайте код ISO 639-2 для вашего языка. mkvmerge(1) может + перечислить все эти коды для вас: + +

+ +
$ mkvmerge --list-languages
+ +

+ Найдите список нужных вам языков. Допустим, вы поместили две звуковые + дорожки в файл Matroska(tm) и хотите установить коды своих языков, а также + идентификаторы дорожек 2 и 3. Это можно сделать при помощи + +

+ +
$ mkvmerge -o с-кодами-языков.mkv --language 2:ger --language 3:dut без-кодов-языков.mkv
+ +

+ Как вы видите, переключатель --language + может быть использован несколько раз. + +

+ + +

+ Например, вы также хотите, чтобы проигрыватель использовал нидерландский + язык в качестве языка по умолчанию. У вас также есть дополнительные + субтитры, например, на английском и французском языках, и вы хотите, чтобы + проигрыватель отображал французские по умолчанию. Это можно сделать с + помощью + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut --default-track-flag 3 without-lang-codes.mkv --language 0:eng english.srt --default-track-flag 0 --language 0:fre french.srt
+ +

+ Если вы не видите язык или флаг дорожки по умолчанию, которые вы указали в + выводе mkvinfo(1), прочитайте, пожалуйста, раздел о стандартных значениях. + +

+ + +

+ Выключить сжатие для исходного файла. + +

+ +
$ mkvmerge -o без-сжатия.mkv --compression -1:none Мой-фильм.avi --compression -1:none мойфильм.srt
+ +

6. Идентификаторы дорожек

+ + + +

6.1. Обычные идентификаторы дорожек

+ + + +

+ Некоторые параметры в mkvmerge(1) требуют идентификатор дорожки, чтобы + определить к какой дорожке они должны быть применены. Эти идентификаторы + дорожек печатаются считывателями при демульплексировании текущего входного + файла, или если mkvmerge(1) выполняется с параметром --identify. + Пример такого вывода: + +

+ +
$ mkvmerge -i v.mkv
+Файл 'v.mkv': контейнер Matroska
+ID дорожки 0: video (V_MS/VFW/FOURCC, DIV3)
+ID дорожки 1: audio (A_MPEG/L3)
+ +

+ Не путайте идентификаторы дорожек, назначаемых дорожкам во входном файле + MKV, с идентификаторами дорожек входных файлов. Для параметров, требующих + этих значений, используются только идентификаторы дорожек входных файлов. + +

+ + +

+ Также обратите внимание, что каждый входной файл имеет свой собственный + набор идентификаторов дорожек. Поэтому идентификаторы дорожек для файла + 'file1.ext' как сообщает 'mkvmerge + --identify' не изменяются независимо от того, сколько там других + входных файлов и в каком положении 'file1.ext' + используются. + +

+ + +

+ ID дорожек назначаются следующим образом: + +

+ + +
    + +
  • + +

    + Файлы AVI: видеодорожка имеет идентификатор 0. Звуковые + дорожки получают идентификаторы в порядке возрастания, начиная с 1. + +

    + +
  • + + +
  • + +

    + Файлы AAC, AC-3, MP3, + SRT и WAV: одна "дорожка" в этом файле + получает идентификатор 0. + +

    + +
  • + + +
  • + +

    + Большинство других файлов: идентификаторы треков назначаются в порядке, в + котором треки находятся в файле, начиная с 0. + +

    + +
  • + +
+ + +

+ Параметры, использующие идентификаторы треков это те, описание которых + содержит 'TID'. Следующие параметры также используются + идентификаторы треков: -- audio-tracks, + --video-tracks, --subtitle-tracks, + --button-tracks и --track-tags. + +

+ + + +

6.2. Специальные идентификаторы дорожки

+ + + +

+ Есть несколько идентификаторов, которые имеют особое значение и не + встречаются в выходных данных идентификации. + +

+ + +

+ Специальный идентификатор дорожки «-1» является + символом подстановки и применяет данный переключатель ко всем дорожкам, + которые считываются из входного файла. + +

+ + +

+ Специальный идентификатор дорожки '-2' ссылается на + главы в исходном файле. В данный момент только параметр + --sync использует этот специальный идентификатор. В + качестве альтернативы --sync -2:... можно использовать + параметр --chapter-sync .... + +

+ + +

7. Работа с языками

+ + + +

+ Matroska(tm) поддерживает два различных типа языковых элементов: старый, + устаревший элемент «Language», содержащий коды ISO 639-2 alpha 3, и новые + теги «LanguageIETF», содержащие языковые теги IETF BCP 47. Все параметры + mkvmerge(1), которые принимают язык, принимают языковой тег BCP + 47. mkvmerge(1) будет выводить значение для устаревшего элемента «Language» + из языковых тегов BCP 47, где это возможно. + +

+ + +

+ При идентификации файла в режиме JSON существующие элементы заголовка + дорожки «LanguageIETF» будут выведены в качестве свойства дорожки + language_ietf. + +

+ + +

+ При записи файла mkvmerge(1) всегда будет записывать элементы «LanguageIETF», + «ChapLanguageIETF» и «TagLanguageIETF» (последние два только в случае записи + глав или тегов соответственно). В дополнение к этим элементам будут записаны + соответствующие старые элементы; они будут установлены на часть кода ISO + 639-2 языкового тега BCP 47. Например, когда язык дорожки установлен на + sr-Cyrl-RS, «LanguageIETF» будет установлен на + sr-Cyrl-RS, а старый элемент «Language» будет установлен + на srp. + +

+ + +

+ При чтении существующих файлов (файлы Matroska, файлы глав или тегов XML и + т. д.), которые уже содержат элементы «...LanguageIETF"» существующие + элементы будут сохранены. В противном случае элементы "«..LanguageIETF» + будут добавлены на основе параметров командной строки и других существующих + устаревших элементов «...Language». + +

+ + +

+ Создание новых элементов можно полностью отключить с помощью параметра + командной строки --disable-language-ietf, который действует + на все три новых элемента. + +

+ + +

+ С помощью параметра --normalize-language-ietf + можно выбрать метод нормализации, применяемый к расширенным языковым + подтегам. + +

+ +

8. Преобразование текстовых файлов и кодировок

+ + +
+

Note:

+ +

+ Этот раздел относится ко всем программам в MKVToolNix, даже если в нём + упоминается только mkvmerge(1). + +

+ +
+ + +

8.1. Введение

+ + +

+ Весь текст в файле Matroska(tm) закодирован в UTF-8. это означает, что + mkvmerge(1) должен преобразовать каждый текстовый файл, который он читает, а + также каждый текст, представленный в командной строке, из любого набора + символов в UTF-8. В свою очередь это также означает, что вывод mkvmerge(1) + необходимо преобразовать обратно в этот набор символов из UTF-8, например, + если не-английский перевод используется с --ui-language + или для текста, происходящего из файла Matroska(tm). + +

+ + +

+ mkvmerge(1) выполняет это преобразование автоматически на основе наличия + маркера порядка байтов (коротко: BOM) или текущей локали + системы. То, как набор символов выводится из локали, зависит от операционной + системы, в которой mkvmerge(1) выполняется. + +

+ + + +

8.2. Маркеры последовательности байтов (BOM)

+ + + +

+ Текстовые файлы, начинающиеся с BOM, уже закодированы в одном представлении + UTF. mkvmerge(1) поддерживает следующие пять режимов: UTF-8, UTF-16 Little и + Big Endian, UTF-32 Little и Big Endian. Текстовые файлы из BOM автоматически + конвертируются в UTF-8. Любые параметры, которые иначе установят набор + символов для такого файла (например, --sub-charset), + молча игнорируется. + +

+ + + +

8.3. Linux и Unix-подобные системы, включая macOS

+ + + +

+ В Unix-системах mkvmerge(1) использует системный вызов + setlocale()3, который, в свою очередь, использует + переменные среды LANG, LC_ALL и + LC_CYPE. Полученный набор символов часто является одним + из семейства UTF-8 или ISO-8859-* и используется для всех операций с + текстовыми файлами и для кодирования строк в командной строке и для вывода в + консоль. + +

+ + + +

8.4. Windows

+ + + +

+ В Windows набор символов по умолчанию, используемый для преобразования + текстовых файлов, определяется вызовом системного вызова + GetACP(). + +

+ + +

+ Чтение командной строки завершается функцией + GetCommandLineW(), которая возвращает строку + Unicode. Поэтому параметр --command-line-charset + игнорируется в Windows. + +

+ + +

+ Вывод консоли состоит из трёх сценариев: + +

+ + +
    + +
  1. + +

    + Если вывод перенаправлен параметром --redirect-output, + то по умолчанию устанавливается набор символов UTF-8. Это можно изменить с + помощью --output-charset. + +

    + +
  2. + + +
  3. + +

    + Если вывод перенаправлен с cmd.exe самостоятельно, + например с mkvinfo file.mkv > info.txt, тогда набор + символов всегда будет установлен в UTF-8 и не может быть изменён. + +

    + +
  4. + + +
  5. + +

    + В противном случае (при записи непосредственно в консоль) используется + функция Windows WriteConsoleW() и параметр --output-charset + игнорируется. Консоль должна иметь возможность выводить все символы Unicode, + для которых установлена соответствующая поддержка языков (например, + китайские символы могут не отображаться в английских версиях Windows). + +

    + +
  6. + +
+ + + +

8.5. Параметры командной строки

+ + + +

+ Существуют следующие параметры для указания специфичных кодировок: + +

+ + +
    + +
  • + +

    + --sub-charset + для файлов субтитров и для субтитров, находящихся в контейнере формата, для + которых кодировка не может быть определена однозначно (напр. файлы Ogg), + +

    + +
  • + + +
  • + +

    + --chapter-charset + для текстовых файлов глав и для глав и заголовков файлов, хранящихся в + контейнерных форматах, для которых набор символов не может быть определён + однозначно (например, файлы Ogg для информации глав, дорожек и заголовков + файлов и т. д.; файлы MP4 для информации глав), + +

    + +
  • + + +
  • + +

    + --command-line-charset + - для всех строк в командной строке, + +

    + +
  • + + +
  • + +

    + --output-charset + для всех строк, записанных в консоль или файл, если вывод был перенаправлен + с параметром --redirect-output. + В не Windows-системах по умолчанию для исходного набора символов + используется текущий набор символов системы. В Windows перенаправление по + умолчанию установлено в UTF-8 с использованием --redirect-output + и с самим cmd.exe, например, mkvinfo file.mkv + > info.txt. + +

    + +
  • + +
+ + +

9. Файлы параметров

+ + + +

+ Файлом параметров является файл, из которого mkvmerge(1) может считать + дополнительные аргументы командной строки. Это можно использовать для того, + чтобы обойти определённые ограничения оболочки или операционной системы во + время выполнения внешних программ, например, при ограниченной длине + командной строки. + +

+ + +

+ Файл параметров содержит данные в формате JSON. Его содержимое должно быть + действительным массивом JSON, состоящим исключительно из строк + JSON. Кодировка файла должна быть UTF-8. Файл не должен начинаться с маркера + порядка байтов (BOM), но если он существует, он будет + пропущен. + +

+ + +

+ Правила для экранирования специальных символов внутри JSON приведены в + официальной спецификации JSON, RFC 7159. + +

+ + +

+ Само имя файла параметров должно быть указано в виде аргумента командной + строки с префиксом «@». + +

+ + +

+ Командная строка «mkvmerge -o "my file.mkv" -A "a movie.avi" + sound.ogg» может быть преобразована в следующий файл параметров + JSON под названием, например, «options.json»: + +

+ +
[
+  "-o",
+  "c:\\Matroska\\мой файл.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "фильм.avi",
+  "звук.ogg"
+]
+ +

+ Тогда соответствующая команда будет «mkvmerge + @options.json». + +

+ +

10. Связывание файла

+ + +

+ Matroska(tm) поддерживает связывание файлов, которое просто говорит, что + конкретный файл является предшественником или преемником текущего + файла. Если быть точным, то на самом деле связаны не файлы, а сегменты + Matroska(tm). Поскольку большинство файлов, вероятно, будут содержать только + один сегмент Matroska(tm), в приведённых ниже объяснениях используется термин + «связывание файлов», хотя «связывание сегментов» было бы более подходящим. + +

+ + +

+ Каждый сегмент идентифицируется уникальным 128-битным UID сегмента. Этот UID + автоматически генерирует mkvmerge(1). Связывание осуществляется главным + образом путём размещения UID сегментов (кратко: SID) + предыдущего/следующего файла в информацию заголовка сегмента. mkvinfo(1) + печатает эти идентификаторы SID, если найдёт их. + +

+ + +

+ Если файл разбит на несколько меньших и используется связывание, то метки + времени не будут начинаться снова с 0, а будут продолжаться там, где + остановился последний файл. Таким образом сохраняется абсолютное время, даже + если предыдущие файлы недоступны (например, во время потоковой + передачи). Если связывание не используется, временные метки должны + начинаться с 0 для каждого файла. По умолчанию mkvmerge(1) не использует + связывание файлов. Если вы хотите, вы можете включить его с помощью + параметра --link. Этот параметр полезен только в том + случае, если также активировано разделение. + +

+ + +

+ Независимо от того, активировано ли разделение или нет, пользователь может + указать mkvmerge(1) чтобы связать созданные файлы с конкретными + SID. Это достигается с помощью параметров + --link-to-previous и --link-to-next. Эти + параметры принимают сегмент SID в формате, который выводит + mkvinfo(1): 16 шестнадцатеричных чисел между 0x00 и + 0xff, где каждое имеет префикс '0x', + например, '0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 + 0x5e 0xca 0xb3 0x93'. В качестве альтернативы можно использовать + более короткую форму: 16 шестнадцатеричных чисел между + 0x00 и 0xff без префиксов + '0x' и без пробелов, например + '41da7366d9cfb21eae78ebb45ecab393'. + +

+ + +

+ Если разделение используется, то первый файл связывается с + SID, передаваемым из --link-to-previous, и + последний файл связывается с SID, передаваемым из + --link-to-next. Если разделение не используется, то один + выходной файл будет связан с обоими SID. + +

+ +

11. Стандартные значения

+ + +

+ Спецификация Matroska(tm) утверждает, что некоторые элементы имеют значение по + умолчанию. Обычно элемент не записывается в файл, если его значение равно + значению по умолчанию, чтобы сэкономить место. Элементы, которые + пользователь может пропустить в выводе mkvinfo(1), — это элементы + язык и флаг дорожки по + умолчанию. Значением по умолчанию для элемента + язык является английский ('eng'), + а значением по умолчанию для элемента флаг дорожки по + умолчанию является да. Поэтому, если вы + использовали --language 0:eng для дорожки, оно не будет + отображаться в выводе mkvinfo(1). + +

+ +

12. Вложения

+ + +

+ Возможно, вы также хотите сохранить некоторые фотографии вместе со своим + файлом Matroska(tm), или вы используете субтитры SSA и + нуждаетесь в специальном шрифте TrueType(tm), который + очень редко встречается. В этих случаях вы можете прикрепить эти файлы к + файлу Matroska(tm). Они будут не просто добавлены в файл, а встроены в + него. Затем проигрыватель сможет показать эти файлы (случай «фотографий») + или использовать их для воспроизведения субтитров (случай «шрифты + TrueType(tm)»). + +

+ + +

+ Вот пример вложения фотографии и шрифта TrueType(tm) + в выходной файл: + +

+ +
$ mkvmerge -o output.mkv -A video.avi sound.ogg \
+  --attachment-description "Me and the band behind the stage in a small get-together" \
+  --attachment-mime-type image/jpeg \
+  --attach-file me_and_the_band.jpg \
+  --attachment-description "The real rare and unbelievably good looking font" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file really_cool_font.ttf
+ +

+ Если в качестве входного файла используется файл Matroska(tm) с вложением, то + mkvmerge(1) скопирует вложения в новый файл. Выбор того, какие вложения + копируются, а какие нет, можно изменить с помощью параметров --attachments + и --no-attachments. + +

+ +

13. Главы

+ + +

+ Система глав Matroska(tm) более обширна, чем старая известная система, + используемая в файлах OGM. Полная документация расположена + на сайте Matroska. + +

+ + +

+ mkvmerge(1) поддерживает два типа файлов глав в качестве входных + данных. Первый формат под названием «простой формат главы» является тем же + форматом, который ожидают инструменты OGM. Второй формат — + это формат глав на основе XML, который поддерживает все функции глав + Matroska(tm). + +

+ + +

+ Помимо специальных файлов глав mkvmerge(1) может также читать главы из других + форматов (например, MP4, Ogg, Blu-rays или DVD). + +

+ + +

13.1. Простой формат глав

+ + + +

+ Этот формат состоит из пар строк, начинающихся с + «CHAPTERxx=» и «CHAPTERxxNAME=» + соответственно. Первый содержит метку времени начала, а второй содержит + название. Например: + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=Intro
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=Baby prepares to rock
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=Baby rocks the house
+ +

+ mkvmerge(1) преобразует каждую пару или строки в один + ChapterAtom Matroska(tm). Он не устанавливает + какой-либо ChapterTrackNumbe, что означает, что все + главы применяются ко всем дорожкам в файле. + +

+ + +

+ Поскольку это текстовый файл, может потребоваться преобразование набора + символов. Смотрите раздел о текстовых файлах и наборах + символов для разъяснения, как mkvmerge(1) преобразует между наборами + символов. + +

+ + + +

13.2. Формат глав на основе XML

+ + +

+ Формат глав на основе XML, выглядит примерно так: + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>A short chapter</ChapterString>
+        <ChapterLanguage>eng</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>A part of that short chapter</ChapterString>
+          <ChapterLanguage>eng</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ У этого формата есть три возможности, отсутствующие в простом формате глав: + +

+ + +
    + +
  1. +

    Временная метка конца главы может быть установлена,

    +
  2. + +
  3. +

    главы могут быть вложены,

    +
  4. + +
  5. +

    язык и страна могут быть указаны.

    +
  6. + +
+ + +

+ Дистрибутив mkvtoolnix содержит несколько файлов для примера, они + расположены в подпапке doc и могут быть использованы в + качестве образца. + +

+ + +

+ Далее показан список поддерживаемых тегов XML, их типы данных и интервал + допустимых значений: + +

+ +
Chapters (master)
+  EditionEntry (master)
+    EditionUID (unsigned integer, valid range: 1 <= value)
+    EditionFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagDefault (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagOrdered (unsigned integer, valid range: 0 <= value <= 1)
+    ChapterAtom (master)
+      ChapterAtom (master)
+      ChapterUID (unsigned integer, valid range: 1 <= value)
+      ChapterTimeStart (unsigned integer)
+      ChapterTimeEnd (unsigned integer)
+      ChapterFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterFlagEnabled (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterSegmentUID (binary, valid range: 1 <= length in bytes)
+      ChapterSegmentEditionUID (unsigned integer, valid range: 1 <= value)
+      ChapterPhysicalEquiv (unsigned integer)
+      ChapterTrack (master)
+        ChapterTrackNumber (unsigned integer, valid range: 1 <= value)
+      ChapterDisplay (master)
+        ChapterString (UTF-8 string)
+        ChapterLanguage (UTF-8 string)
+        ChapterCountry (UTF-8 string)
+      ChapterProcess (master)
+        ChapterProcessCodecID (unsigned integer)
+        ChapterProcessPrivate (binary)
+        ChapterProcessCommand (master)
+          ChapterProcessTime (unsigned integer)
+          ChapterProcessData (binary)
+ + +

13.3. Чтение глав из Blu-ray

+ + + +

+ mkvmerge(1) может читать главы из незашифрованных дисков Blu-ray. Для этого + вы можете использовать путь к одному из списков воспроизведения MPLS с + параметром --chapters. + +

+ + +

+ Пример: --chapters + /srv/blurays/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. Чтение глав из DVD

+ + + +

+ Когда MKVToolNix собран с библиотекой libdvdread(tm), + mkvmerge(1) может читать главы с DVD. Для этого вы можете использовать путь к + одной из папок или файлов на DVD с параметром + --chapters. Поскольку DVD-диски могут содержать более + одного заголовка, а каждый заголовок имеет свой собственный набор глав, вы + можете добавить двоеточие и желаемый номер имени в конец аргумента имени + файла. Номер имени по умолчанию равен 1. + +

+ + +

+ Пример: --chapters /srv/dvds/BigBuckBunny/VIDEO_TS:2 + +

+ + + +

13.5. Общие замечания

+ + +

+ При разделении файлов mkvmerge(1) также правильно корректирует главы. Это + означает, что каждый файл содержит только записи глав, которые к нему + относятся, и что метки времени будут смещены в соответствии с новыми метками + времени каждого исходного файла. + +

+ + +

+ mkvmerge(1) может копировать главы из входных файлов Matroska(tm), если они + явно не отключены с помощью параметра --no-chapters. + Главы из всех источников (файлы Matroska(tm), файлы Ogg, файлы + MP4, текстовые файлы глав) обычно не объединяются, а + выходят в отдельные ChapterEdition. Только если главы + читаются из нескольких файлов Matroska(tm) или XML, имеющих одинаковые + идентификаторы UID издания, будут объединены в единый + ChapterEdition. Если такое объединение желательно и в + других ситуациях, пользователь должен сначала извлечь главы из всех + источников с помощью mkvextract(1) затем вручную объединить файлы XML, а + затем мультиплексировать их. + +

+ + +

14. Метки

+ + + +

14.1. Введение

+ + + +

+ Система тегов Matroska(tm) аналогична системе других контейнеров: набор пар + KEY=VALUE. Однако в Matroska(tm) эти теги также могут + быть вложенными, и как KEY, так и VALUE являются + собственными элементами. Пример файла + example-tags-2.xml показывает, как использовать эту + систему. + +

+ + + +

14.2. Область применения тегов

+ + + +

+ Теги Matroska(tm) не применяются автоматически ко всему файлу. Они могут могут + применяться к разным частям файла: к одной или нескольким дорожкам, к одной + или нескольким главам или даже к комбинации обоих. Спецификация + Matroska содержит более подробную информацию об этом факте. + +

+ + +

+ Одним из важных фактов является то, что теги связываются с дорожками или + главами с помощью элемент тега Targets Matroska(tm) и + что, UID, используемые для этого связывания, не + являются идентификаторами дорожек, которые mkvmerge(1) использует + везде. Вместо номеров используются UID ,которые mkvmerge(1) вычисляет + автоматически (если дорожка взята из формата файла, отличного от Matroska(tm)) + или которые копируются из входного файла, если входной файл дорожки является + файлом Matroska(tm). Поэтому трудно узнать, какие UID использовать в файле + тегов, прежде чем файл будет передан в mkvmerge(1). + +

+ + +

+ mkvmerge(1) знает два варианта, с помощью которых вы можете добавить теги к + файлам Matroska(tm): параметры --global-tags + и --tags. Разница + в том, что первый параметр, --global-tags, + заставит теги применяться ко всему файлу, удалив любой из упомянутых выше + элементов Targets. Второй параметр, --tags, + автоматически вставляет UID, который mkvmerge(1) создаёт для тега, указанного + с помощью части TID параметра --tags. + +

+ + + +

14.3. Пример

+ + +

+ Допустим, вы хотите добавить теги к видеодорожке, прочитанной из файла + AVI. mkvmerge --identify file.avi + сообщает вам, что ИД видеодорожки (не путайте этот идентификатор с UID!) + равен 0. Итак, вы создаёте файл тегов, оставив все элементы + Targets и выполнив mkvmerge(1): + +

+ +
$ mkvmerge -o файл.mkv --tags 0:теги.xml файл.avi
+ + +

14.4. Формат файла тегов

+ + +

+ mkvmerge(1) поддерживает формат файла тега на основе XML. Формат очень + точно смоделирован по спецификации + Matroska. Как двоичный, так и дистрибутив исходников MKVToolNix + поставляются с образцом файла с именем + example-tags-2.xml, который просто перечисляет все + известные теги и может использоваться в качестве основы для реальных файлов + тегов. + +

+ + +

+ Основы: + +

+ + +
    + +
  • +

    Крайний элемент должен быть <Tags>. +

    +
  • + +
  • + +

    Один логический тег содержится в паре тегов + <Tag> XML. +

    + +
  • + +
  • +

    Пробелы перед и после меток игнорируются.

    +
  • + +
+ + + +

14.5. Типы данных

+ + +

+ Новая система тегов Matroska(tm) знает только два типа данных: строку UTF-8 и + двоичный тип. Первый используется для имени тега и элемента + <String>, а двоичный тип используется для + элемента <Binary>. + +

+ + +

+ Поскольку двоичные данные сами по себе не помещаются в файл XML mkvmerge(1) + поддерживает два других метода хранения двоичных данных. Если содержимое + тега XML начинается с '@', то следующий текст + рассматривается как имя файла. Содержимое соответствующего файла копируется + в элемент Matroska(tm). + +

+ + +

+ В противном случае ожидается, что данные будут закодированы в Base64. Это + кодировка, которая преобразует двоичные данные в ограниченный набор символов + ASCII и используется, например, в программах электронной + почты. mkvextract(1) выведет данные, закодированные в Base64 для двоичных + элементов. + +

+ + +

+ Устаревшей системе тегов известны ещё некоторые типы данных, которые можно + найти в официальной спецификации тегов Matroska(tm). Поскольку mkvmerge(1) + больше не поддерживает эту систему, эти типы здесь не описаны. + +

+ + + +

14.6. Известные теги файла формата XML

+ + + +

+ Далее показан список поддерживаемых тегов XML, их типы данных и интервал + допустимых значений: + +

+ +
Tags (master)
+  Tag (master)
+    Targets (master)
+      TargetTypeValue (unsigned integer)
+      TargetType (UTF-8 string)
+      TrackUID (unsigned integer)
+      EditionUID (unsigned integer)
+      ChapterUID (unsigned integer)
+      AttachmentUID (unsigned integer)
+    Simple (master)
+      Simple (master)
+      Name (UTF-8 string)
+      TagLanguage (UTF-8 string)
+      DefaultLanguage (unsigned integer)
+      String (UTF-8 string)
+      Binary (binary)
+ +

15. Информация о сегментах

+ + + +

+ С помощью XML-файла сегментной информации можно задать определённые значения + в поле заголовка "информация о сегменте" файла Matroska(tm). Все эти значения + не могут быть установлены с помощью других параметров командной строки. + +

+ + +

+ Другие поля заголовка «информации о сегментах» можно установить с помощью + параметров командной строки, но не с помощью файла XML. Это включает, + например, параметры --title и --timestamp-scale. + +

+ + +

+ Существуют и другие элементы, которые нельзя установить ни с помощью + параметров командной строки, ни с помощью файлов XML. К ним относятся + следующие элементы: DateUTC (также известный как «дата + мультиплексирования»), MuxingApp, + WritingApp и Duration. Они всегда + устанавливаются mkvmerge(1) самостоятельно. + +

+ + +

+ Далее показан список поддерживаемых тегов XML, их типы данных и интервал + допустимых значений: + +

+ +
Info (master)
+  SegmentUID (binary, valid range: length in bytes == 16)
+  SegmentFilename (UTF-8 string)
+  PreviousSegmentUID (binary, valid range: length in bytes == 16)
+  PreviousSegmentFilename (UTF-8 string)
+  NextSegmentUID (binary, valid range: length in bytes == 16)
+  NextSegmentFilename (UTF-8 string)
+  SegmentFamily (binary, valid range: length in bytes == 16)
+  ChapterTranslate (master)
+    ChapterTranslateEditionUID (unsigned integer)
+    ChapterTranslateCodec (unsigned integer)
+    ChapterTranslateID (binary)
+

16. Компоновка файла Matroska

+ + +

+ Компоновка файла Matroska(tm) достаточно гибкая. mkvmerge(1) будет отображать + файл заранее предопределённым образом. Результирующий файл выглядит так: + +

+ + +

+ [Заголовок EBML] [сегмент {метапоиск #1} [информация о сегменте] [информация + о дорожке] {вложения} {главы} [кластер 1] {кластер 2} ... {кластер n} {cue} + {метапоиск #2} {метки}] + +

+ + +

+ Элементы в фигурных скобках необязательны и зависят от использованного + содержимого и параметров. Пара замечаний: + +

+ + +
    + +
  • + +

    + метапоиск №1 включает лишь небольшое количество элементов уровня 1, и только + если они действительно существуют: вложения, главы, списки cue, теги, + метапоиск №2. Старые версии mkvmerge(1) также используется для размещения + кластеров в этом мета-элементе поиска. Поэтому потребовалось некоторое + неточное угадывание, чтобы зарезервировать достаточно места. Это часто + терпело неудачу. Теперь только кластеры хранятся в метапоиске №2, а + метапоиск №1 относится к метапоиску №2. + +

    + +
  • + + +
  • + +

    Элементы вложения, главы и тега присутствуют только в том случае, если они + были добавлены. +

    + +
  • + +
+ + +

+ Наиболее короткий файл Matroska(tm) выглядит так: + +

+ + +

+ [Заголовок EBML] [сегмент [информация о сегменте] [информация о дорожке] + [кластер 1]] + +

+ + +

+ Это пример файла, содержащий только с аудио. + +

+ +

17. Внешние файлы меток времени

+ + +

+ mkvmerge(1) позволяет пользователю самостоятельно выбирать метки времени для + определённой дорожки. Это можно использовать для создания файлов с + переменной частотой кадров или для включения тишины в аудио. В этом случае + кадр является элементом, который создаёт отдельно для блока Matroska(tm). Для + видео это ровно один кадр, для аудио это один пакет определённого типа + аудио. например, для AC-3 это будет пакет, содержащий + 1536 сэмплов. + +

+ + +

+ Файлы временных меток, используемые при добавлении дорожек друг к другу, + должны указываться только для первой части цепочки дорожек. Например, если + вы добавляете два файла, v1.avi и v2.avi, и хотите использовать временные + метки, ваша командная строка должна выглядеть примерно так: + +

+ +
$ mkvmerge ... --timestamps 0:мои_временные_метки.txt v1.avi +v2.avi
+ +

+ Существует четыре формата, которые распознает mkvmerge(1). Первая строка + всегда содержит номер версии. Пустые строки и строки, содержащие только + пробелы, и строки, начинающиеся с «#», игнорируются. + +

+ + +

17.1. Формат файла меток времени v1

+ + +

+ Этот формат начинается со строки версии. Вторая строка объявляет количество + кадров в секунду по умолчанию. Все последующие строки содержат три числа, + разделённые запятыми: начальный кадр (0 — первый кадр), + конечный кадр и количество кадров в этом диапазоне. FPS — + это число с плавающей запятой с точкой '.' в качестве + десятичной запятой. Диапазоны могут содержать разрывы, для которых + используется стандартное значение FPS. Например: + +

+ +
# timestamp format v1
+assume 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. Формат файла меток времени v2

+ + + +

+ В этом формате каждая строка содержит метку времени для соответствующего + кадра. Эта временная метка должна быть указана с точностью до + миллисекунд. Это может быть число с плавающей запятой, но это не + обязательно. Вы должны предоставить как минимум столько + строк временных меток, сколько кадров в дорожке. Метки времени в этом файле + должны быть отсортированы. Пример для 25 кадров в секунду: + +

+ +
# timestamp format v2
+0
+40
+80
+ + +

17.3. Формат файла меток времени v3

+ + +

+ В этом формате каждая строка содержит длительность в секундах, за которой + следует дополнительное количество кадров в секунду. Оба могут быть числами с + плавающей запятой. Если количество кадров в секунду отсутствует, + используется значение по умолчанию. Для аудио вы должны позволить кодеку + самостоятельно вычислить метки времени кадра. Для этого вы должны + использовать 0,0 в качестве количества кадров в + секунду. Вы также можете создать разрывы в потоке, используя ключевое слово + 'gap', за которым следует длительность разрыва. Пример + аудиофайла: + +

+ +
# timestamp format v3
+assume 0.0
+25.325
+7.530,38.236
+gap, 10.050
+2.000,38.236
+ + +

17.4. Формат файла меток времени v4

+ + +

+ Формат идентичен формату v2. Единственное отличие в том, что временные метки + не должны быть отсортированы. Этот формат не следует когда-либо + использовать. + +

+ + +

18. Коды завершения

+ + + +

+ mkvmerge(1) завершается с одним из трёх кодов: + +

+ + +
    + +
  • + +

    + 0 -- Этот код завершения означает, что паковка + закончилась успешно. + +

    + +
  • + + +
  • + +

    + 1 -- В этом случае mkvmerge(1) выдал хотя бы одно + предупреждение, однако паковка продолжилась. Предупреждению предшествует + текст 'Warning:'. В зависимости от произошедших ошибок, + результирующие файлы могут быть либо целыми либо повреждёнными. Пользователю + рекомендуется обратить внимание на само предупреждение и проверить + результирующие файлы. + +

    + +
  • + + +
  • + +

    + 2 -- Этот код завершения используется в случае + возникновения ошибки. mkvmerge(1) прекращает работу сразу после вывода + сообщения об ошибке. Ошибки могут возникнуть из-за неверных параметров + командной строки, из-за ошибки чтения/записи или просто из-за повреждённых + файлов. + +

    + +
  • + +
+ +

19. Переменные среды

+ + + +

+ mkvmerge(1) использует стандартные переменные, определяющие системный язык + (например: LANG и семейство + LC_*). Дополнительные переменные: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG и его + краткая форма MTX_DEBUG + +

Содержимое обрабатывается так, как если бы оно было передано с помощью + параметра --debug. +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE и + его краткая форма MTX_ENGAGE + +

Содержимое обрабатывается так, как если бы оно было передано с помощью + параметра --engage. +

+ +
+ +

20. Смотрите также

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. Домашняя страница

+ + +

+ Последняя версия программы всегда доступна на домашней странице MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..78de519c190253abc7cfb71fd61ffb0bfa761098 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvpropedit.html @@ -0,0 +1,1316 @@ + + + + + mkvpropedit -- Смена свойств существующих файлов Matroska без полной перепаковки + + + +
mkvpropedit -- Смена свойств существующих файлов Matroska(tm) без полной перепаковки +
+
+ +
+

1. Краткое содержание

+ + +
mkvpropedit параметры {имя-исходного-файла} {действия} +
+ +

2. Описание

+ + +

+ Это приложение анализирует существующий файл Matroska(tm) и изменяет некоторые + его свойства. Затем оно записывает эти изменения в существующий файл. Среди + свойств, которые можно изменить, есть элементы информации о сегментах + (например, название) и заголовки дорожек (например, код языка, флаг «дорожка + по умолчанию» или название). + +

+ + +

+ Параметры: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ Перечисляет все известные и редактируемые имена свойств, их тип (строка, + целое число, логическое значение и т. п) и краткое описание. После этого + программа завершается. Поэтому параметр + source-filename не нужно указывать. + +

+ +
-p, --parse-mode + режим + +

+ Устанавливает режим разбора. Параметр 'режим' может + быть 'быстрым' (которым он также является по умолчанию) + или 'полным'. 'Быстрый' режим не + анализирует весь файл, а использует мета-элементы поиска для поиска + необходимых элементов исходного файла. В 99 % случаев этого достаточно. Но + для файлов, которые не содержат элементов метапоиска или повреждённых, + пользователю придётся установить 'полный' режим + анализа. Полное сканирование файла может занять несколько минут, а быстрое + сканирование займёт всего несколько секунд. + +

+ +
+ + +

+ Действия для работы с дорожками и свойствами информационных сегментов: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit selector + +

+ Устанавливает раздел файла Matroska(tm) (информацию о сегменте или заголовках + определенной дорожки), с которым действуют все последующие действия add, set и delete. Этот параметр можно + использовать несколько раз для внесения изменений в несколько элементов. + +

+ + +

+ По умолчанию mkvpropedit(1) будет править раздел информации о сегменте. + +

+ + +

+ Смотрите раздел правка + селекторов для полного описания синтаксиса. + +

+ +
-a, --add + name=значение + +

+ Добавляет свойство name со + значением. Свойство будет добавлено, даже если оно + уже существует. Примечание: большинство свойств уникально и не могут + встречаться более одного раза. + +

+ +
-s, --set + name=значение + +

+ Задаёт для всех вхождений свойства имя значение + переменной. Если такого свойства не существует, то + оно будет добавлено. + +

+ +
-d, --delete name + +

+ Удаляет все вхождения свойства name. Примечание: + некоторые свойства обязательны и не могут быть удалены. + +

+ +
+ + +

+ Действия для работы с тегами и главами: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags + selector:имя-файла + +

+ Добавляет или заменяет теги в файле на теги из filename + или удаляет их, если filename пуст. mkvpropedit(1) + читает те же форматы тегов XML, которые читает и mkvmerge(1). + +

+ + +

+ selector должен быть одним из слов + all, global или + track. Для all mkvpropedit(1) + заменит или удалит все теги в файле. С global только + глобальные теги будут заменены или удалены. + +

+ + +

+ С дорожкой mkvpropedit(1) заменит теги для определённой + дорожки. Кроме того, теги, прочитанные из filename, + будут назначены той же дорожке. Дорожка указывается так же, как указываются + селекторы правки + (см. ниже), например, --tags track:a1:new-audio-tags.xml. + +

+ +
--add-track-statistics-tags + +

+ Вычисляет статистику для всех треков в файле и добавляет новые теги + статистики для них. Если файл уже содержит эти теги, то они будут обновлены. + +

+ +
--delete-track-statistics-tags + +

+ Удаляет все метки статистики существующей дорожки из файла. Если в файле нет + меток статистики дорожки, они не будут изменены. + +

+ +
-c, --chapters + имя-файла + +

+ Добавляет или заменяет главы в файле соответствующим из + filename или удаляет их, если + filename пуст. mkvpropedit(1) считывает те же XML и + простые форматы глав, что и mkvmerge(1). + +

+ +
+ + +

+ Действия для обработки вложений: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment имя-файла + +

+ Добавляет новое вложение из имя-файла. + +

+ + +

+ Если параметр --attachment-name использовался до этого + параметра, его значение используется как имя нового вложения. Иначе он + является производным от filename. + +

+ + +

+ Если параметр --attachment-mime-type использовался до этого + параметра, его значение используется как тип MIME нового вложения. Иначе он + автоматически обнаруживается из содержимого filename. + +

+ + +

+ Если параметр --attachment-description использовался до + этого параметра, его значение используется как описание нового + вложения. Иначе описание не устанавливается. + +

+ + +

+ Если параметр --attachment-uid использовался до этого + параметра, его значение используется как UID нового вложения. В ином случае + будет автоматически создан случайный UID. + +

+ +
--replace-attachment + селектор:имя-файла + +

+ Заменяет одно или несколько вложений, которые совпадают с + selector по filename + файла. Если более одного доступного вложения соответствует + selector, то всё их содержимое будет заменено + содержимым filename. + +

+ + +

+ selector может иметь одну из четырёх форм. Они + описаны ниже в разделе селекторы вложений. + +

+ + +

+ Если параметр --attachment-name использовался до этого + параметра, его значение устанавливается в виде нового имени для каждого + изменённого вложения. Иначе имена не меняются. + +

+ + +

+ Если параметр --attachment-mime-type использовался до этого + параметра, его значение устанавливается в виде нового типа MIME для каждого + изменённого вложения. Иначе типы MIME не меняются. + +

+ + +

+ Если параметр --attachment-description использовался до + этого параметра, его значение устанавливается в виде нового описания для + каждого изменённого вложения. Иначе описания не меняются. + +

+ + +

+ Если параметр --attachment-uid использовался до этого + параметра, его значение устанавливается в виде нового UID для каждого + изменённого вложения. Иначе UID не меняются. + +

+ +
--update-attachment селектор + +

+ Указывает свойства для одного и более вложений, которые совпадают с + селектором. Если более одного вложений совпадают с + селектором, тогда все их свойства будут обновлены. + +

+ + +

+ selector может иметь одну из четырёх форм. Они + описаны ниже в разделе селекторы вложений. + +

+ + +

+ Если параметр --attachment-name использовался до этого + параметра, его значение устанавливается в виде нового имени для каждого + изменённого вложения. Иначе имена не меняются. + +

+ + +

+ Если параметр --attachment-mime-type использовался до этого + параметра, его значение устанавливается в виде нового типа MIME для каждого + изменённого вложения. Иначе типы MIME не меняются. + +

+ + +

+ Если параметр --attachment-description использовался до + этого параметра, его значение устанавливается в виде нового описания для + каждого изменённого вложения. Иначе описания не меняются. + +

+ + +

+ Если параметр --attachment-uid использовался до этого + параметра, его значение устанавливается в виде нового UID для каждого + изменённого вложения. Иначе UID не меняются. + +

+ +
--delete-attachment селектор + +

+ Удаляет одно или несколько вложений подходящих под + селектор + +

+ + +

+ selector может иметь одну из четырёх форм. Они + описаны ниже в разделе селекторы вложений. + +

+ +
+ + +

+ Параметры действий над вложениями: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name имя + +

+ Задаёт использование имени для следующей операции + --add-attachment или --replace-attachment. + +

+ +
--attachment-mime-type тип-mime + +

+ Задаёт использование типа MIME для следующей операции + --add-attachment или --replace-attachment. + +

+ +
--attachment-description описание + +

+ Задаёт использование описания для следующей операции + --add-attachment или --replace-attachment. + +

+ +
--enable-legacy-font-mime-types + +

+ Позволяет использовать устаревшие типы MIME для + определённых типов вложений шрифтов. Например, + «application/x-truetype-font» будет использоваться для + шрифтов TrueType вместо «fonts/ttf». + +

+ + +

+ Это влияет как на добавление новых вложений, так и на замену существующих + вложений, но только если новый тип MIME не указан. Другие + доступные вложения не меняются. + +

+ + +

+ Затрагиваются типы MIME: «font/sfnt», + «font/ttf» и «font/collection»; они + сопоставляются с «application/x-truetype-fonts» и + «font/otf», который сопоставляется с + «application/vnd .ms-opentype». + +

+ +
+ + +

+ Прочие параметры: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ Обычно, когда пользователь запрашивает изменения в свойстве заголовка + дорожки 'language', mkvpropedit(1) применяет то же + изменение к новому элементу заголовка дорожки + LanguageIETF в дополнение к устаревшему элементу + Language. Если используется этот параметр, изменение + будет применено только к устаревшему элементу + Language. + +

+ + +

+ Этот параметр не влияет на изменения, запрашиваемые через свойство + 'language-ietf' заголовка дорожки. + +

+ +
--normalize-language-ietf режим + +

+ Позволяет нормализовать все языковые теги IETF BCP 47 к их канонической + форме с режимом «canonical», к их форме расширенных + языковых подтегов с помощью режима «extlang» или + отключает его в режиме off. По умолчанию применяется + нормализация к канонической форме. + +

+ + +

+ В канонической форме все подтеги, для которых существуют предпочтительные + значения, заменяются этими предпочтительными значениями. Это преобразует, + например, «zh-yue-jyutping» в + «yue-jyutping» или «fr-FX» в + «fr-FR». + +

+ + +

+ Для формы расширенных языковых подтегов изначально строится каноническая + форма. После этого все основные языки, для которых существует расширенный + языковой подтег, заменяются этим расширенным языковым подтегом и его + префиксом. Это преобразует, например, «yue-jyutping» + обратно к «zh-yue-jyutping», но не влияет на + «fr-FR», потому что «fr» не является + расширенным языковым подтегом. + +

+ + +

+ Эта нормализация применяется только к элементам, которые фактически + изменены: + +

+ + +
    + +
  • + +

    + При редактировании заголовков дорожек затрагиваются только те элементы языка + треков, которые установлены в соответствии со спецификациями + редактирования. Языки дорожек, которые не редактируются, не + меняются. Редактирование дорожки, но установка только свойств, отличных от + языка, также не повлияет на язык. + +

    + +
  • + + +
  • + +

    + Во время правки глав подвергаются воздействию все языковые элементы всех + элементов главы, поскольку существующие главы всегда заменяются полностью. + +

    + +
  • + + +
  • + +

    + При изменении тегов подвергаются воздействию только те языковые элементы + тегов, которые фактически заменены. Например, замена глобальных тегов не + влияет на существующие теги дорожек. + +

    + +
  • + +
+ + +

+ Лучший способ нормализовать все имеющиеся языковые теги в файле — это + сделать его перепаковку с помощью mkvmerge(1) и установить его параметр + «--normalize-language-ietf» в требуемый режим. + +

+ +
--command-line-charset кодировка + +

+ Устанавливает кодировку для конвертации строк, указанных в командной + строке. Стандартная кодировка привязана с системной локализации. + +

+ +
--output-charset кодировка + +

+ Указывает кодировку, в которую конвертируются выходные строки. По умолчанию + используется текущая кодировка системного языка. + +

+ +
-r, --redirect-output + имя-файла + +

+ Записывает все сообщения в файл file-name вместо + консоли. Хотя это можно легко сделать с помощью перенаправления вывода, есть + случаи, когда этот параметр нужен: если терминал повторно интерпретирует + выход перед записью его в файл. Набор символов, установленный с --output-charset, + учитывается. + +

+ +
--ui-language код + +

+ Принудительно использовать перевод на код языка + (напр., «de_DE» для немецкого). Если указать + «list» вместо кода, то отобразится + список доступных переводов. + +

+ +
--abort-on-warnings + +

+ Указывает mkvmerge прерывание после появления первого предупреждения. Код + завершения программы будет 1. + +

+ +
--debug тематика + +

+ Включить режим отладки для указанной функции. Этот параметр полезен только + для разработчиков. + +

+ +
--engage функция + +

+ Включает экспериментальные функции. Список доступных функций можно запросить + с помощью mkvpropedit --engage list. Эти функции не + предназначены для использования в обычных ситуациях. + +

+ +
--gui-mode + +

+ Включает режим графического интерфейса. В этом режиме могут отображаться + специально отформатированные строки для отправки управляющих сообщений + интерфейсу. Формат сообщений — '#GUI#message'. За + сообщением могут быть указаны пары ключа и значения, например + '#GUI#message#key1=value1#key2=value2…'. Сообщения и + ключи не переводятся и всегда выводятся на английском. + +

+ +
-v, --verbose + +

+ Вести расширенный вывод и показывать все важные элементы Matroska(tm) по мере + их чтения. + +

+ +
-h, --help + +

+ Показать сведения об использовании и выйти. + +

+ +
-V, --version + +

+ Показать сведения о версии и выйти. + +

+ +
@файл-параметров.json + +

+ Считывает дополнительные аргументы командной строки из файла + options-file. Полное описание поддерживаемых форматов + для таких файлов смотрите в разделе "Файлы параметров" на странице + документации mkvmerge(1). + +

+ +
+ +

3. Правка селекторов

+ + +

+ Параметр --edit + устанавливает раздел файла Matroska(tm) (информация о сегменте или заголовках + определённого трека), с которым выполняются все последующие действия add, set и delete. Это остаётся + действительным до тех пор, пока не будет найден следующий параметр --edit. + Аргумент этого параметра называется селектором редактирования. + +

+ + +

+ По умолчанию mkvpropedit(1) будет править раздел информации о сегменте. + +

+ + +

3.1. Информация о сегментах

+ + +

+ Информацию о сегменте можно выбрать одним из трёх слов: + «info», «segment_info» или + «segmentinfo». Он содержит такие свойства, как заголовок + сегмента или UID сегмента. + +

+ + + +

3.2. Заголовки дорожки

+ + +

+ Заголовки дорожек можно выбрать с помощью несколько более сложного + селектора. Все варианты начинаются с «track:». Свойства + заголовка дорожки включают такие элементы, как код языка, флаг «дорожка по + умолчанию» или название дорожки. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ Если параметр n является цифрой, то будет выбрана + дорожкой с номером n. Порядок дорожек такой же, как и + при выводе информации командой mkvmerge(1) с параметром + --identify. + +

+ + +

+ Нумерация начинается с 1. + +

+ +
track:tn + +

+ Если параметр начинается с одного символа t, за + которым следует n, то будет выбрана + n-ная дорожка определённого типа дорожек. Параметр + типа дорожки t должен быть одним из четырёх символов: + 'a' для звуковой дорожки, 'b' для + дорожки кнопки, 's' для дорожки субтитров и + 'v' для видеодорожки. Порядок отслеживания такой же, как + и параметр --identify вывода mkvmerge(1). + +

+ + +

+ Нумерация начинается с 1. + +

+ +
track:=uid + +

+ Если параметр начинается с «=», за которым следует число + uid, будет выбрана дорожка, элемент дорожки + UID которой равен данному + uid. UID дорожек можно получить с + помощью mkvinfo(1). + +

+ +
track:@номер + +

+ Если параметр начинается с «@», за которым следует число + number, будет выбрана дорожка, элемент которой + дорожки равен этому number. Номера дорожек можно + получить с помощью mkvinfo(1). + +

+ +
+ + + +

3.3. Примечания

+ + +

+ Из-за природы селекторов редактирования дорожек возможно, что несколько + селекторов действительно соответствуют одному и тому же заголовку дорожки. В + таких случаях все действия для этих селекторов редактирования будут + объединены и выполнены в том порядке, в котором они указаны в командной + строке. + +

+ + +

4. Селекторы вложений

+ + + +

+ Селектор вложений используется для двух действий: --replace-attachment + и --delete-attachment. + Он может принимать одну из следующих четырёх форм: + +

+ + +
    + +
  1. + +

    + Выбор по идентификатору вложения. В этой форме селектор представляет собой + число, идентификатор вложения, выводимый командой идентификации mkvmerge(1). + +

    + +
  2. + + +
  3. + +

    + Выбор по УИД (уникальному идентификатору) вложения. В этой форме селектор + представляет собой символ = с последующим числом, + являющимся УИД вложения. Его узнать с помощью детальной команды + идентификации mkvmerge(1). + +

    + +
  4. + + +
  5. + +

    + Выбор по названию вложения. В этой форме селектором является буквенное слово + name:, за которым следует имя имеющегося вложения. Если + этот селектор используется с --replace-attachment, то + двоеточия в названии для соответствия должны экранироваться с помощью + \c. + +

    + +
  6. + + +
  7. + +

    + Выбор по типу MIME. В этой форме селектором является буквенное слово + mime-type:, за которым следует MIME-тип существующего + вложения. Если этот селектор используется с + --replace-attachment, то двоеточия в типе MIME для + соответствия должны экранироваться с помощью \c. + +

    + +
  8. + +
+ +

5. Работа с языками

+ + + +

+ mkvpropedit(1) в основном старается делать правильные вещи по + умолчанию. Поэтому изменения свойства language заставят + mkvpropedit(1) применить то же самое изменение как к новому элементу + «LanguageIETF», так и к старому элементу «Language», подобно тому, как + mkvmerge(1) применяет язык к обоим элементам. Например, при использовании + mkvpropedit movie.mkv --edit track:2 --set language=zh-TW + элемент «LanguageIETF» будет установлен на zh-TW, а + старый элемент «Language» на chi. + +

+ + +

+ Кроме того, есть новое свойство заголовка дорожки под названием + language-ietf, которое можно установить или + удалить. Изменения этого свойства применяются только к новому элементу + заголовка дорожки «LanguageIETF». Оговорка заключается в том, что старый + элемент заголовка дорожки «Language» является обязательным элементом в + Matroska — это означает, что даже если он отсутствует в файле, он все равно + имеет подразумеваемое значение. Когда пользователь устанавливает только + свойство language-ietf, но не свойство + language, mkvpropedit(1) будет добавлять старый элемент + «Language» в определённых случаях и установит его в und + (что означает «неопределённый»), так как пользователь не указал для него + значение. + +

+ + +

При чтении файлов глав XML или тегов mkvpropedit(1) работает так же, как + mkvmerge(1). +

+ + +

Создание новых элементов может быть полностью отключено с помощью параметра + командной строки «--disable-language-ietf», который действует на все три + новых элемента. +

+ + +

С помощью параметра --normalize-language-ietf можно выбрать + метод нормализации, применяемый к расширенным языковым подтегам. +

+ +

6. Примеры

+ + +

+ Следующий пример редактирует файл под названием + 'movie.mkv'. Он устанавливает название сегмента и + изменяет код языка аудио и дорожки субтитров. Обратите внимание, что этот + пример можно сократить, исключив первый параметр --edit, + поскольку редактирование элемента информации сегмента является стандартным + для всех параметров, найденных перед первым параметром --edit. + +

+ +
$ mkvpropedit фильм.mkv --edit info --set "title=Фильм" --edit track:a1 --set language=fre --edit track:a2 --set language=ita
+ +

+ Второй пример удаляет «флаг дорожка по умолчанию» с первой дорожки субтитров + и устанавливает его для второй. Обратите внимание, что mkvpropedit(1) в + отличие от mkvmerge(1), не устанавливает «флаг дорожка по умолчанию» для + других дорожек на «0», если для некоторой дорожки автоматически установлено + значение «1». + +

+ +
$ mkvpropedit фильм.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ Замена тегов во второй дорожке субтитров файла выглядит так: + +

+ +
$ mkvpropedit фильм.mkv --tags track:s2:new-subtitle-tags.xml
+ +

+ Удаление всех тегов требует указания имени файла: + +

+ +
$ mkvpropedit фильм.mkv --tags all:
+ +

+ Замена глав в файле выглядит так: + +

+ +
$ mkvpropedit фильм.mkv --chapters новые-главы.xml
+ +

+ Удаление всех глав происходит без указания имени выходного файла: + +

+ +
$ mkvpropedit фильм.mkv --chapters ''
+ +

+ Добавление файла шрифта (Arial.ttf) в виде вложения: + +

+ +
$ mkvpropedit фильм.mkv --add-attachment Arial.ttf
+ +

+ Добавление файла шрифта (89719823.ttf) в виде вложения и + описание информации, что это Arial: + +

+ +
$ mkvpropedit фильм.mkv --attachment-name Arial.ttf --attachment-description 'Шрифт Arial в виде шрифта TrueType' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ Замена вложенного файла шрифта (Comic.ttf) другим + (Arial.ttf): + +

+ +
$ mkvpropedit фильм.mkv --attachment-name Arial.ttf --attachment-description 'Шрифт Arial в виде шрифта TrueType' --replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ Удаление второго вложенного файла, неважно какого именно: + +

+ +
$ mkvpropedit фильм.mkv --delete-attachment 2
+ +

+ Удаление всех вложенных шрифтов по типу MIME: + +

+ +
$ mkvpropedit фильм.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. Коды завершения

+ + + +

+ mkvpropedit(1) завершается с одним из трёх кодов: + +

+ + +
    + +
  • + +

    + 0 -- Этот код завершения означает, что модификация + закончилась успешно. + +

    + +
  • + + +
  • + +

    + 1 -- В этом случае mkvpropedit(1) выдал хотя бы одно + предупреждение, однако модификация продолжилась. Предупреждению предшествует + текст 'Warning:'. В зависимости от произошедших ошибок, + результирующие файлы могут быть либо целыми либо повреждёнными. Пользователю + рекомендуется обратить внимание на само предупреждение и проверить + результирующие файлы. + +

    + +
  • + + +
  • + +

    + 2 -- Этот код завершения используется в случае + возникновения ошибки. mkvpropedit(1) прекращает работу сразу после вывода + сообщения об ошибке. Ошибки могут возникнуть из-за неверных параметров + командной строки, из-за ошибки чтения/записи или просто из-за повреждённых + файлов. + +

    + +
  • + +
+ +

8. Преобразование текстовых файлов и кодировок

+ + + +

+ Подробное обсуждение того, как все инструменты пакета MKVToolNix + обрабатывают преобразование наборов символов, кодировку ввода / вывода, + кодировку командной строки и кодировку консоли, смотрите в разделе с + идентичным названием в справочной странице mkvmerge(1). + +

+ +

9. Переменные среды

+ + + +

+ mkvpropedit(1) использует стандартные переменные, определяющие системный язык + (например: LANG и семейство + LC_*). Дополнительные переменные: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG и + его краткая форма MTX_DEBUG + +

Содержимое обрабатывается так, как если бы оно было передано с помощью + параметра --debug. +

+ +
MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE + и его краткая форма MTX_ENGAGE + +

Содержимое обрабатывается так, как если бы оно было передано с помощью + параметра --engage. +

+ +
+ +

10. Смотрите также

+ + +

+ mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1) + +

+ +

11. Домашняя страница

+ + +

+ Последняя версия программы всегда доступна на домашней странице MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..01e8f22031237137b3fe66d1abe6f5cf8248791c --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/ru/mkvtoolnix-gui.html @@ -0,0 +1,156 @@ + + + + + mkvtoolnix-gui -- графическая оболочка mkvmerge1 с редактором глав и заголовков + + + +
mkvtoolnix-gui -- графическая оболочка mkvmerge(1) с редактором глав и заголовков +
+
+ +
+

1. Краткое содержание

+ + +
mkvtoolnix-gui [[имя-файла-настроек.mtxcfg] | [исходный-файл.ext] | [файл-matroska.mkv] | [файл-глав.ext] | [файл-matroska.mkv]] +
+ +

2. Описание

+ + +

+ mkvtoolnix-gui(1) — это графическая оболочка на основе + Qt(tm) для mkvmerge(1). Он также реализует функции + mkvinfo(1) и mkvpropedit(1) и будет развиваться, чтобы охватить также + mkvextract(1). Все настройки (например, исходные файлы, параметры дорожки и + т. п.) могут быть сохранены и восстановлены. + +

+ + +

+ Перечисление имён файлов конфигурации с расширением + .mtxcfg заставляет графическую оболочку загружать эти + файлы конфигурации в соответствующий инструмент. Любое другое имя файла + добавляется в качестве входного файла для паковки, открывается в инструменте + информации, редакторе глав или в редакторе заголовков в зависимости от + текущего режима. Текущий режим можно изменить с помощью + --merge, --info, + --edit-chapters или + --edit-headers. Стандартный режим — добавление файлов для + паковки. + +

+ + +

+ Обратите внимание, что если экземпляр приложения уже запущен при повторном + запуске приложения, все имена файлов, указанные в командной строке, + обрабатываются первоначально запущенным экземпляром. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

Все следующие имена файлов будут добавлены как исходные файлы в текущее + задание слияния. Это стандартный режим. +

+ +
--info + +

Все последующие файлы будут открыты в информационном инструменте.

+ +

Кроме того, при запуске будет выбран инструмент информации вместо паковщика.

+ +
--edit-chapters + +

Все последующие файлы будут открыты в редакторе заголовков.

+ +

Кроме того, при запуске будет выбран редактор глав вместо паковщика.

+ +
--edit-headers + +

Все следующие имена файлов будут открыты в редакторе заголовков.

+ +

Кроме того, при запуске будет выбран редактор заголовков вместо паковщика.

+ +
-h, --help + +

+ Показать сведения об использовании и выйти. + +

+ +
-V, --version + +

+ Показать сведения о версии и выйти. + +

+ +
+ +

3. Смотрите также

+ + +

+ mkvmerge(1), mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. Домашняя страница

+ + +

+ Последняя версия программы всегда доступна на домашней странице MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..f56c4bd4f4174ff6ae418857e483a7491ecfd7f8 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvextract.html @@ -0,0 +1,1340 @@ + + + + + mkvextract -- витягування доріжок з файлів Matroska до інших файлів + + + +
mkvextract -- витягування доріжок з файлів Matroska(tm) до інших файлів +
+
+ +
+

1. Короткий опис

+ + +
mkvextract {source-filename} {mode1} options extraction-spec1 mode2 options extraction-spec2 … +
+ +

2. Опис

+ + +

+ Ця програма витягує певні частини з файлу Matroska(tm) в інші корисні + формати. Першим аргументом є ім'я вихідного файлу, яким має бути файл + Matroska(tm). + +

+ + +

+ Усі інші аргументи або перемикаються в певний режим витягування, змінюють + параметри для поточного активного режиму або вказують, що витягувати в який + файл. Під час одного виклику mkvextract можна використовувати декілька + режимів, що дозволяє витягувати декілька частин за один крок. Більшість + параметрів можна використовувати лише в певних режимах, а деякі параметри + застосовуються до всіх режимів. + +

+ + +

+ В даний час підтримується витягування доріжок, тегів, вкладеннь, глав, CUE листів, міток часу і cue. + +

+ + +

2.1. Загальні параметри

+ + + +

+ Нижчевказані параметри доступні у всіх режимах і тому лише раз описуються в + данному розділі. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ Встановлює режим аналізу як 'full'. За допомогою типового режиму не + аналізується увесь файл, а використовуються елементи метапошуку для + виявлення необхідних елементів вхідного файла. В 99% випадків цього + достатньо. Але для аналізу файлів, що не містять елементів метапошуку або є + пошкодженими треба використовувати цей режим. Повне сканування файлу може + тривати кілька хвилин, в той час як швидке - кілька секунд. + +

+ +
--command-line-charset character-set + +

+ Встановлює набір символів заданого в командному рядку для + конвертації. Типово використовується набір символів згідно поточної локалі + системи. + +

+ +
--output-charset character-set + +

+ Встановлює вихідний набір символів заданого в командному рядку для + конвертації. Типово використовується набір символів згідно поточної локалі + системи. + +

+ +
-r, --redirect-output + file-name + +

+ Всі повідомлення записуються до файлу file-name + замість консолі. Хоча це можна зробити через переспрямування виводу, є деякі + випадки, коли необхідно застосовувати саме даний параметр: коли термінал + інтерпретує в інший спосіб вивід перед записом до файлу. Набір символів, + заданий через --output-charset + враховується. + +

+ +
--flush-on-close + +

+ Повідомляє програмі перенести до сховища кешовані в пам’яті дані під час + закриття файлів, що були відкриті на запис. Це можна використовувати, щоб + запобігти втраті даних при відключенні електроенергії або обійти певні + проблеми в операційній системі чи драйверах. Недоліком є те, що + мультиплексування займе більше часу, оскільки mkvmerge буде чекати, поки всі + дані будуть записані в сховище, перш ніж вийти. Дивіться проблемы 2469 і + 2480 баг-трекера MKVToolNix щоб дізнатися про переваги та недоліки. + +

+ +
--ui-language code + +

+ Використовується примусовий переклад для мови code + (наприклад, 'de_DE' для німецького перекладу). Після + введення list' як code програма + відобразить список доступних перекладів. + +

+ +
--abort-on-warnings + +

+ Повідомляє програмі припинити роботу після першого попередження. Код виходу + з програми буде 1. + +

+ +
--debug topic + +

+ Увімкнути налагодження для певної функції. Цей параметр корисний лише для + розробників. + +

+ +
--engage feature + +

+ Увімкнути експериментальні функції. Список доступних функцій можна запросити + за допомогою mkvextract --engage list. Ці функції не + призначені для використання у звичайних ситуаціях. + +

+ +
--gui-mode + +

+ Вмикає режим графічного інтерфейсу. У цьому режимі можуть бути виведені + спеціально відформатовані рядки, які можуть повідомляти керуючому графічному + інтерфейсу, що відбувається. Ці повідомлення мають формат + '#GUI#message'. За повідомленням можуть слідувати пари + ключ/значення, як у + '#GUI#message#key1=value1#key2=value2…'. Ані + повідомлення, ані ключі ніколи не перекладаються і завжди виводяться + англійською. + +

+ +
-v, --verbose + +

+ Задає відображення розширеної інформації про важливі елементи Matroska(tm). + +

+ +
-h, --help + +

+ Відображається інформація про використання додатку і відбувається завершення + роботи додатку. + +

+ +
-V, --version + +

+ Відображається інформація про версію додатку і відбувається завершення + роботи додатку. + +

+ +
@options-file.json + +

+ Читає додаткові аргументи командного рядка з файлу + options-file. Повне пояснення про підтримувані + формати для таких файлів див. розділ "Файли параметрів" у посібнику + користувача mkvmerge(1). + +

+ +
+ + + +

2.2. Режим витягування доріжок

+ + + +

+ Синтаксис: mkvextract source-filename + tracks [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + +

+ Наступні параметри командного рядка доступні для кожної доріжки в режимі + витягування 'tracks'. Вони мають бути присутні після + вказання доріжки (див. нижче), до якої будуть застосовуватись. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c character-set + +

+ Задається набір символів, який має містити наступна доріжка субтитрів після + конвертації. Застосовується лише тоді, коли ID наступної доріжки вказує на + доріжку субтитрів. Типовим набором символів є UTF-8. + +

+ +
--blockadd level + +

+ Залишати лише BlockAdditions до цього рівня. Типово враховуються усі + рівні. Даний параметр може вплинути лише на деякі кодеки, як то WAVPACK4. + +

+ +
--cuesheet + +

+ Відбувається витягування списків CUE з інформацією про + глави і дані тегів даної доріжки у файл, ім’я якого є вихідною назвою + доріжки з додаванням розширення '.cue'. + +

+ +
--raw + +

+ Відбувається витягування необраблених даних до файлу без контейнера. На + відміну від прапорця --fullraw + даний параметр не призводить до запису складових елементу + CodecPrivate до файлу. Даний режим може працювати з + усіма CodecIDs, навіть з тими, які mkvextract(1) не + підтримує, але це може призвести до створення пошкодженого файлу. + +

+ +
--fullraw + +

+ Відбувається витягування необроблених даних до файлу без + контейнера. Складові елементу CodecPrivate будуть + записуватися до файлу першими, якщо доріжка містить такий елемент + заголовку. Даний режим може працювати з усіма + CodecIDs, навіть з тими, які mkvextract(1) не + підтримує, але це може призвести до створення пошкодженого файлу. + +

+ +
TID:outname + +

+ Відбувається витягування доріжки з ID TID до файлу + outname за умови, якщо така доріжка міститься у + вхідному файлі. Даний параметр можна задавати декілька разів. ID доріжок + мають бути такі самі як і при виведенні інформації командою mkvmerge(1) з + параметром --identify. + +

+ + +

+ Кожна назва вихідного файлу має використовуватися лише раз. Виняток + становлять доріжки RealAudio і RealVideo. Якщо використовувати однакові + назви для різних доріжок, то вони будуть збережені до одного й того самого + файлу. Наприклад: + +

+ +
$ mkvextract input.mkv tracks 0:video.h264 2:output-two-vobsub-tracks.idx 3:output-two-vobsub-tracks.idx
+
+ + + +

2.3. Режим витягування вкладень

+ + + +

+ Синтаксис: mkvextract source-filename + attachments + [options] + AID1:outname1 + [AID2:outname2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:outname + +

+ Відбувається витягування вкладення з ID AID до файлу + outname за умови, якщо таке вкладення міститься у + вхідному файлі. Якщо ж залишити outname пустим, то + буде використовуватися назва вкладення з вхідного файла Matroska(tm). Даний + параметр можна задавати декілька разів. ID вкладень мають бути такі самі як + і при виведенні інформації командою mkvmerge(1) з параметром + --identify. + +

+ +
+ + + +

2.4. Режим витягування глав

+ + + +

+ Синтаксис: mkvextract source-filename + chapters + [options] + output-filename.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ Витягується інформація про глави у простому форматі, що використовується в + інструментарії для роботи з OGM (CHAPTER01=..., + CHAPTER01NAME=...). В цьому режимі деяка інформація пропускається. За + замовчуванням глави витягуються у форматі XML. + +

+ +
--simple-language language + +

+ Якщо ввімкнено простий формат, mkvextract(1) виведе лише один запис для + кожного зустріченого атома глави, навіть якщо атом глави містить більше + однієї назви глави. За замовчуванням mkvextract(1) використовуватиме назву + першої глава, знайдену для кожного атома, незалежно від його мови. + +

+ + +

+ Використання цього параметра дозволяє користувачеві визначити, які назви + глав виводяться, якщо атоми містять більше однієї назви глави. Параметр + language має бути кодом ISO 639-1 або ISO 639-2. + +

+ +
+ + +

+ Глави записуються у вказаний вихідний файл. За замовчуванням + використовується зрозумілий mkvmerge(1) формат XML. Якщо у файлі не + знайдено жодних глав, вихідний файл не створюється. + +

+ + + +

2.5. Режим витягування тегів

+ + + +

+ Синтаксис: mkvextract source-filename + tags [options] + output-filename.xml + +

+ + +

+ Теги записуються у вказаний вихідний файл у зрозумілий mkvmerge(1) формат + XML. Якщо у файлі не знайдено тегів, вихідний файл не створюється. + +

+ + + +

2.6. Режим витягування списків Cue

+ + + +

+ Синтаксис: mkvextract source-filename + cuesheet + [options] + output-filename.cue + +

+ + +

+ Список cue записується у вказаний вихідний файл. Якщо у файлі не знайдено + жодних глав або тегів, вихідний файл не створюється. + +

+ + + +

2.7. Режим витягування міток часу

+ + + +

+ Синтаксис: mkvextract source-filename + timestamps_v2 + [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:outname + +

+ Відбувається витягування міток часу доріжок з ID TID + до файлу outname за умови, якщо така доріжка + міститься у вхідному файлі. Даний параметр можна задавати декілька разів. ID + доріжок мають бути такі самі як і при виведенні інформації командою + mkvmerge(1) з параметром --identify. + +

+ + +

+ Наприклад: + +

+ +
$ mkvextract input.mkv timestamps_v2 1:ts-track1.txt 2:ts-track2.txt
+
+ + + +

2.8. Режим витягування списків Cue

+ + + +

+ Синтаксис: mkvextract source-filename + cues [options] + TID1:dest-filename1 + [TID2:dest-filename2 + ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:dest-filename + +

+ Відбувається витягування списків cue для доріжки з ID + TID до файлу outname за умови, + якщо така доріжка міститься у вхідному файлі. Даний параметр можна задавати + декілька разів. ID доріжок мають бути такі самі як і при виведенні + інформації командою mkvmerge(1) з параметром --identify, а + не числа, що містяться в елементі CueTrack. + +

+ +
+ + +

+ Формат виведення є простим текстовим форматом: один рядок на елемент + CuePoint з парами key=value. Якщо + необов’язковий елемент відсутній у CuePoint + (наприклад, CueDuration), тоді у якості значення буде + виведено тире. + +

+ + +

+ Наприклад: + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

Можливі ключі:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
мітка часу + +

Мітка часу точки списка cue з наносекундною точністю. Формат: + HH:MM:SS.nnnnnnnnn. Цей елемент завжди встановлений. +

+ +
тривалість + +

Тривалість точки списка cue з наносекундною точністю. Формат: + HH:MM:SS.nnnnnnnnn. +

+ +
позиція_кластеру + +

Абсолютна позиція в байтах всередині файла Matroska(tm), де починається + кластер що містить посилання на елемент. +

+ + +
+

Note:

+ +

Всередині файла Matroska(tm) CueClusterPosition є + відносним зміщенням початку даних сегмента. Однак значення, виведене + mkvextract(1) у режимі витягування списка cue, вже містить це зміщення і воно + є абсолютним зміщенням від початку файлу. +

+ +
+ +
відносна_позиція + +

Відносна позиція в байтах всередині кластера, звідки починається елемент + BlockGroup або SimpleBlock, на + який посилається точка списка cue. +

+ + +
+

Note:

+ +

Всередині файла Matroska(tm) CueRelativePosition є + відносним зміщенням початку даних кластера. Однак значення, виведене + mkvextract(1) у режимі витягування списка cue, є відносним до ID + кластера. Абсолютну позицію всередині файлу можна обчислити додавши + cluster_position і relative_position. +

+ +
+ +
+ + +

+ Наприклад: + +

+ +
$ mkvextract input.mkv cues 1:cues-track1.txt 2:cues-track2.txt
+ +

3. Приклади

+ + + +

+ Витягування глав і тегів у відповідні XML формати одночасно: + +

+ +
$ mkvextract movie.mkv chapters movie-chapters.xml tags movie-tags.xml
+ +

+ Витягування кількох доріжок і відповідних міток часу одночасно: + +

+ +
$ mkvextract "Another Movie.mkv" tracks 0:video.h265 "1:main audio.aac" "2:director's comments.aac" timestamps_v2 "0:timestamps video.txt" "1:timestamps main audio.txt" "2:timestamps director's comments.txt"
+ +

+ Витягування глав у форматі Ogg/OGM і перекодування доріжки текстових + субтитрів в інший набір символів: + +

+ +
$ mkvextract "My Movie.mkv" chapters --simple "My Chapters.txt" tracks -c MS-ANSI "2:My Subtitles.srt"
+

4. Текстові файли та перетворення набору символів

+ + + +

+ Для детального ознайомлення з тим, як усі інструменти в пакеті MKVToolNix + виконують перетворення набору символів, кодування введення/виводу, кодування + командного рядка та консольне кодування, будь ласка, перегляньте розділ з + ідентичною назвою в посібнику користувача mkvmerge(1) + +

+ +

5. Формати файлів на виході

+ + + +

+ Рішення щодо формату файлу на виході обирається, базуючись на типі доріжки, + а не на типі файлу, що буде записаний. У даний час підтримуються наступні + типи доріжок: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ Усі файли AAC будуть записані до файлів + AAC з заголовками ADTS перед кожним + пакетом. Заголовки ADTS не будуть містити застарілого поля + особливого призначення. + +

+ +
A_AC3, A_EAC3 + +

+ Це буде витягнуто до необроблених файлів AC-3. + +

+ +
A_ALAC + +

+ Доріжки ALAC(tm) записуються до файлів + CAF(tm). + +

+ +
A_DTS + +

+ Це буде витягнуто до необроблених файлів DTS. + +

+ +
A_FLAC + +

+ Доріжки FLAC(tm) записуються до необроблених файлів + FLAC(tm). + +

+ +
A_MPEG/L2 + +

+ Потоки MPEG-1 Audio Layer II будуть витягнуті до необроблених файлів + MP2. + +

+ +
A_MPEG/L3 + +

+ Це буде витягнуто до необроблених файлів MP3. + +

+ +
A_OPUS + +

+ Доріжки Opus(tm) записуються до файлів + OggOpus(tm). + +

+ +
A_PCM/INT/LIT, A_PCM/INT/BIG + +

+ Необроблені PCM дані будуть записані до файлу + WAV. В процесі big-endian цілі дані будуть перетворені в + little-endian дані. + +

+ +
A_REAL/* + +

+ Доріжки RealAudio(tm) записуються до файлів + RealMedia(tm). + +

+ +
A_TRUEHD, A_MLP + +

+ Це буде витягнуто до необроблених файлів + TrueHD/MLP. + +

+ +
A_TTA1 + +

+ ДоріжкиTrueAudio(tm) записуються до файлів + TTA. Майте на увазі, що через обмежену точність міток часу + Matroska(tm), витягнуті заголовки файлів будуть різними, що зазначено у двох + полях: data_length (сумарна кількість семплів у файлі) і + CRC. + +

+ +
A_VORBIS + +

+ Файли аудіо Vorbis будуть записані до файлу OggVorbis(tm). + +

+ +
A_WAVPACK4 + +

+ Доріжки WavPack(tm) записуються до файлів + WV(tm). + +

+ +
S_HDMV/PGS + +

+ PGS субтитри будуть записані до файлів + SUP. + +

+ +
S_HDMV/TEXTST + +

+ Субтитри TextST будуть записані у вигляді спеціального + формату файлу, винайденого для mkvmerge(1) та mkvextract(1) + +

+ +
S_KATE + +

+ Потоки Kate(tm) будуть записані до контейнеру + Ogg(tm). + +

+ +
S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS + +

+ Текстові субтитри SSA і ASS будуть + записані до файлів SSA/ASS відповідно. + +

+ +
S_TEXT/UTF8, S_TEXT/ASCII + +

+ Прості текстові субтитри будуть записані до файлів SRT. + +

+ +
S_VOBSUB + +

+ Субтитри VobSub(tm) будуть записані як файли + SUB разом із відповідними файлами індексу, як файли + IDX. + +

+ +
S_TEXT/USF + +

+ USF текстові субтитри будуть записані до файлів + USF. + +

+ +
S_TEXT/WEBVTT + +

+ USF текстові субтитри будуть записані до файлів + USF. + +

+ +
V_MPEG1, V_MPEG2 + +

+ Відеодоріжки MPEG-1 і MPEG-2 будуть + записані як елементарні потоки MPEG. + +

+ +
V_MPEG4/ISO/AVC + +

+ H.264 / AVC доріжки відео записуються до + елементарних потоків H.264, які можуть надалі бути + оброблені за допомогою, наприклад, MP4Box(tm) зі + збірки GPAC(tm). + +

+ +
V_MPEG4/ISO/HEVC + +

+ Доріжки відео H.265/HEVC записуються до + елементарних потоків H.265, які можуть надалі бути + оброблені за допомогою, наприклад, MP4Box(tm) зі + збірки GPAC(tm). + +

+ +
V_MS/VFW/FOURCC + +

+ Доріжки відео з виправленим FPS з таким + CodecID записуються до файлів AVI. + +

+ +
V_REAL/* + +

+ Доріжки RealVideo(tm) записуються до файлів + RealMedia(tm). + +

+ +
V_THEORA + +

+ Потоки Theora(tm) будуть записані до контейнеру + Ogg(tm). + +

+ +
V_VP8, V_VP9 + +

+ Доріжки VP8 / VP9 записуються до файлів + IVF. + +

+ +
Теги + +

+ Теги конвертуються до формату XML. Цей формат є тим самим, який mkvmerge(1) + підтримує для читання тегів. + +

+ +
Вкладення + +

+ Вкладення записуються як є до файлу на виході. Ніяких перетворень не + виконується. + +

+ +
Глави + +

+ Глави конвертуються до формату XML. Цей формат є тим самим, який + mkvmerge(1) підтримує для читання глав. Як альтернатива, можна витягувати + глави до спрощеного стильового формату OGM. + +

+ +
Мітки часу + +

+ Мітки часу спочатку сортуються і потім виводяться у сумісному файловому + форматі міток часу версії 2 для використання mkvmerge(1). Витягування до + інших форматів (версій 1, 3 і 4) не підтримується. + +

+ +
+ +

6. Коди завершення

+ + + +

+ mkvextract(1) завершує роботу одним з трьох кодів завершення: + +

+ + +
    + +
  • + +

    + 0 -- Цей код означає, що витягування пройшло успішно. + +

    + +
  • + + +
  • + +

    + 1 -- В цьому випадку mkvextract(1) було видано хоча б + одне попередження, проте витягування продовжувалось. Попередженню передує + текст 'Warning:'. В залежності від помилок, що сталися, + результуючі файли можуть бути або цілими, або пошкодженими. Користувачу + рекомендується як звернути увагу на саме попередження, так і перевірити + результуючі файли. + +

    + +
  • + + +
  • + +

    + 2 -- Цей код завершення використовується у випадку + помилки. mkvextract(1) припиняє роботу одразу після виведення повідомлення + про помилку. Помилки виникають через невірні параметри командного рядка, + помилки читання/запису або через з самого початку пошкоджені файли. + +

    + +
  • + +
+ +

7. Змінні середовища

+ + + +

+ mkvextract(1) використовує змінні за замовчуванням, які визначають локаль + системи (наприклад, LANG і сімейство + LC_*). Додаткові змінні: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG і + їх коротка форма MTX_DEBUG + +

Вміст розглядається так, ніби його було передано за допомогою параметра + --debug. +

+ +
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE і + їх коротка форма MTX_ENGAGE + +

Вміст розглядається так, ніби його було передано за допомогою параметра + --engage. +

+ +
+ +

8. Дивіться також

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. WWW

+ + +

+ Остання версія завжди може бути знайдена на веб-сторінці MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..6638a216125100cbe4d75038e9316fccfc6b3172 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvinfo.html @@ -0,0 +1,522 @@ + + + + + mkvinfo -- Роздрукувати інформацію про елементи в файлах Matroska + + + +
mkvinfo -- Роздрукувати інформацію про елементи в файлах Matroska(tm)
+
+ +
+

1. Короткий опис

+ + +
mkvinfo options {source-filename} +
+ +

2. Опис

+ + +

+ Ця програма робить списки всіх елементів, що містяться в Matroska(tm). Вихідні + дані можуть бути обмежені списком доріжок у файлі, включаючи інформацію про + використовувані кодеки. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ За замовчуванням mkvinfo(1) зупиняється, коли стикається з першим + кластером. Крім того, вона не показує певні елементи, що часто + зустрічаються. За допомогою цього параметра mkvinfo(1) продовжить обробку + незалежно від рівня детальності та покаже всі елементи. + +

+ +
-c, --checksums + +

+ Обчислює та відображає контрольну суму Adler-32 для + кожного кадру. Корисно лише для відлагодження. + +

+ +
-o, --continue + +

+ За замовчуванням mkvinfo(1) зупиняється, коли стикається з першим + кластером. За допомогою цього параметра mkvinfo(1) продовжить обробку + незалежно від рівня детальності. + +

+ +
-p, --hex-positions + +

+ Показує позиції всіх елементів у шістнадцятковому форматі, незалежно від + рівня детальності. + +

+ +
-P, --positions + +

+ Показує позиції всіх елементів у десятковому форматі незалежно від рівня + детальності. + +

+ +
-s, --summary + +

+ Показує лише короткий підсумок того, що mkvinfo(1) знаходить, а не кожен + елемент. + +

+ +
-t, --track-info + +

+ Показує статистику для кожної доріжки в докладному режимі. Також встановлює + детальність на 1, якщо раніше вона була на рівні 0. + +

+ +
-x, --hexdump + +

+ Показує перші 16 байтів кожного кадру як шістнадцятковий дамп. + +

+ +
-X, --full-hexdump + +

+ Показує всі байти кожного кадру як шістнадцятковий дамп. + +

+ +
-z, --size + +

+ Показує розмір кожного елемента, включаючи його заголовок. + +

+ +
--command-line-charset character-set + +

+ Встановлює набір символів заданого в командному рядку для + конвертації. Типово використовується набір символів згідно поточної локалі + системи. + +

+ +
--output-charset character-set + +

+ Встановлює вихідний набір символів заданого в командному рядку для + конвертації. Типово використовується набір символів згідно поточної локалі + системи. + +

+ +
-r, --redirect-output + file-name + +

+ Записує всі повідомлення у файл file-name, замість + консолі. Хоча це можна легко зробити за допомогою переспрямування виводу, є + випадки, коли цей параметр потрібен: коли термінал повторно інтерпретує + вихід перед записом його у файл. Набір символів із --output-charset + враховується. + +

+ +
--ui-language code + +

+ Використовується примусовий переклад для мови code + (наприклад, 'de_DE' для німецького перекладу). Після + введення list' як code програма + відобразить список доступних перекладів. + +

+ +
--abort-on-warnings + +

+ Повідомляє програмі припинити роботу після першого попередження. Код виходу + з програми буде 1. + +

+ +
--debug topic + +

+ Увімкнути налагодження для певної функції. Цей параметр корисний лише для + розробників. + +

+ +
--engage feature + +

+ Вмикає експериментальні функції. Список доступних функцій можна запросити за + допомогою mkvinfo --engage list. Ці функції не призначені + для використання в звичайних ситуаціях. + +

+ +
--gui-mode + +

+ Вмикає режим графічного інтерфейсу. У цьому режимі можуть бути виведені + спеціально відформатовані рядки, які можуть повідомляти керуючому графічному + інтерфейсу, що відбувається. Ці повідомлення мають формат + '#GUI#message'. За повідомленням можуть слідувати пари + ключ/значення, як у + '#GUI#message#key1=value1#key2=value2…'. Ані + повідомлення, ані ключі ніколи не перекладаються і завжди виводяться + англійською. + +

+ +
-v, --verbose + +

+ Бути більш багатослівним. Перегляньте розділ рівні детальності, щоб дізнатися + на якому рівні яка інформація буде виведена. + +

+ +
-h, --help + +

+ Відображається інформація про використання додатку і відбувається завершення + роботи додатку. + +

+ +
-V, --version + +

+ Відображається інформація про версію додатку і відбувається завершення + роботи додатку. + +

+ +
@options-file.json + +

+ Читає додаткові аргументи командного рядка з файлу + options-file. Повне пояснення про підтримувані + формати для таких файлів див. розділ "Файли параметрів" у посібнику + користувача mkvmerge(1). + +

+ +
+ +

3. Рівні детальності

+ + + +

+ Параметр -v можна + використовувати, щоб підвищити рівень детальності mkvinfo(1) і отримати + більше інформації про поточний файл. + +

+ + +

+ На рівні 0 mkvinfo(1) друкуватиме лише заголовки доріжок, які він знайде, та + їх типи. mkvinfo(1) вийде, як тільки заголовки будуть проаналізовані повністю + (більш технічно: як тільки зустрінеться перший кластер). На цьому рівні + записи заголовка пошуку та списки cue не відображатимуться — навіть якщо + вони розташовані перед інформацією про доріжку. + +

+ + +

+ На рівні 1 mkvinfo(1) також надрукує всі елементи Matroska(tm), які + зустрічаються для повного файлу, крім записів заголовка пошуку та записів + списків cue. Якщо режим зведення увімкнено, mkvinfo(1) також виведе позицію + кадру. + +

+ + +

+ Такого ж ефекту можна досягти за допомогою параметра + --continue. + +

+ + +

+ На рівні 2 mkvinfo(1) також надрукує записи заголовка пошуку, записи списків + cue і позицію у файлу, де кожний елемент Matroska(tm) може бути знайти. + +

+ + +

+ Такого ж ефекту можна досягти за допомогою параметра --all + --positions. + +

+ + +

+ На рівні 3 і вище mkvinfo(1) надрукує деяку інформацію, яка не пов’язана + безпосередньо з елементом Matroska(tm). Усі інші елементи друкують лише щойно + знайдені елементи. Рівень 3 додає мета-інформацію для полегшення + відлагодження (читай: він призначений лише для розробників). Усі рядки, + написані рівнем 3, наведені в квадратних дужках, щоб було легко їх + відфільтрувати. + +

+ +

4. Текстові файли та перетворення набору символів

+ + + +

+ Для детального ознайомлення з тим, як усі інструменти в пакеті MKVToolNix + виконують перетворення набору символів, кодування введення/виводу, кодування + командного рядка та консольне кодування, будь ласка, перегляньте розділ з + ідентичною назвою в посібнику користувача mkvmerge(1) + +

+ +

5. Коди завершення

+ + + +

+ mkvinfo(1) виходить з одним з трьох кодів виходу: + +

+ + +
    + +
  • + +

    + 0 -- Цей код виходу означає, що запуск завершився + успішно. + +

    + +
  • + + +
  • + +

    + 1 -- У цьому випадку mkvinfo(1) видав принаймні одне + попередження, але запуск продовжувався. Попередження містить префікс + «Попередження:». + +

    + +
  • + + +
  • + +

    + 2 -- Цей код виходу використовується після того, як + сталася помилка. mkvinfo(1) переривається відразу після виведення + повідомлення про помилку. Повідомлення про помилки варіюються від + неправильних аргументів командного рядка через помилки читання/запису до + зламаних файлів. + +

    + +
  • + +
+ +

6. Змінні середовища

+ + + +

+ mkvinfo(1) використовує змінні за замовчуванням, які визначають локаль + системи (наприклад, LANG і сімейство + LC_*). Додаткові змінні: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUG, MKVTOOLNIX_DEBUG і їх + коротка форма MTX_DEBUG + +

Вміст розглядається так, ніби його було передано за допомогою параметра + --debug. +

+ +
MKVINFO_ENGAGE, MKVTOOLNIX_ENGAGE і їх + коротка форма MTX_ENGAGE + +

Вміст розглядається так, ніби його було передано за допомогою параметра + --engage. +

+ +
+ +

7. Дивіться також

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. WWW

+ + +

+ Остання версія завжди може бути знайдена на веб-сторінці MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..f769706be2f93d069cc33d2ec6aec7e1cd6b9fa4 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvmerge.html @@ -0,0 +1,5297 @@ + + + + + mkvmerge -- Об’єднує мультимедійні потоки в файли Matroska + + + +
mkvmerge -- Об’єднує мультимедійні потоки в файли Matroska(tm)
+
+ +
+

1. Короткий опис

+ + +
mkvmerge global options {-o + out} options1 {file1} options2 {file2} @options-file.json +
+ +

2. Опис

+ + +

+ Ця програма бере вхідні дані з кількох медіа-файлів і об’єднує їхні потоки + (усі або лише виділені) в файл Matroska(tm); див. веб-сайт Matroska. + +

+ + +
+

Important:

+ +

+ Важливим є порядок параметрів командного рядка. Будь ласка, прочитайте + розділ "Порядок + параметрів", якщо ви новачок у програмі. + +

+ +
+ + +

2.1. Загальні параметри

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

Підвищіти багатослівність

+ +
-q, --quiet + +

Пригнітити вихід статусу.

+ +
-o, --output + file-name + +

Записує у файл file-name. Якщо використовується + розщеплення, цей параметр розглядається дещо інакше. Додаткову інформацію + див. у поясненнях про параметр --split. +

+ +
-w, --webm + +

Створює файл, сумісний із WebM. Це також увімкнено, якщо вихідний файл має + розширення "webm". Цей режим передбачає кілька обмежень. Єдиними + дозволеними кодеками є відео VP8, VP9 та аудіо Opus, Vorbis. Елемент + заголовка DocType змінюється на "webm". + +

+ + +

+ Для глав і тегів дозволяється лише підмножина елементів. mkvmerge(1) + автоматично видалить усі елементи, не дозволені специфікацією. + +

+ +
--title title + +

Встановлює загальну назву вихідного файлу, напр. назва фільму.

+ +
--default-language language-code + +

Встановлює код мови за замовчуванням, який використовуватиметься для + доріжок, для яких не встановлено мову за допомогою параметра --language, + а також для якого вихідний контейнер не надає мову. +

+ + +

Кодом мови за замовчуванням є 'und' для 'не визначено'. +

+ +
+ + + +

2.2. Обробка інформації про сегменти (загальні параметри)

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo filename.xml + +

+ Прочитати інформацію про сегменти з файлу XML. Цей файл + може містити сімейство сегментів UID, сегмент + UID, елементи попереднього та наступного сегментів + UID. Приклад файлу та DTD включені в + дистрибутив MKVToolNix. + +

+ + +

+ Додаткову інформацію див. у розділі "файли XML із інформацією про + сегмент". + +

+ +
--segment-uid SID1,SID2,... + +

+ Встановлює UID сегмента для використання. Це розділений комами список + 128-бітних сегментних UID у звичайній формі UID: шістнадцяткові числа з або + без "0x" префікс із пробілами чи без, точно 32 розряди». + +

+ + +

+ Якщо SID починається з "=", то його залишок інтерпретується як + ім’я файлу Matroska, UID сегмента якого читається та використовується. + +

+ + +

+ Кожен створений файл містить один сегмент, і кожен сегмент має один UID + сегмента. Якщо вказано більше UID сегментів, ніж створено сегментів, то + зайві UID ігноруються. Якщо вказано менше UID, ніж створено сегментів, для + них будуть створені випадкові UID. + +

+ +
+ + + +

2.3. Обробка глав і тегів (загальні параметри)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language language-code + +

+ Встановлює код мови ISO 639-2, який записується для кожного запису глави. За + замовчуванням 'eng'. Перегляньте розділ про "глави" нижче, щоб дізнатися більше. + +

+ + +

+ Цей параметр можна використовувати як для простих файлів глав, так і для + вихідних файлів, які містять глави, але не містять інформації про мову глав, + наприклад файли MP4 і OGM. + +

+ + +

+ Мова, встановлена цим параметром, також використовується, коли глави + створюються за допомогою параметра --generate-chapters. + +

+ +
--chapter-charset character-set + +

+ Встановлює набір символів, який використовується для перетворення в UTF-8 + для простих файлів глав. Перегляньте розділ про текстові файли та набори + символів, щоб дізнатися, як mkvmerge(1) перетворює між наборами + символів. + +

+ + +

+ Цей перемикач також застосовується до глав, які скопійовані з певних типів + контейнерів, наприклад файли Ogg/OGM і MP4. Додаткову інформацію див. у + розділі про глави нижче. + +

+ +
--chapter-sync + d[,o[/p]] + +

+ Налаштуйте мітки часу глав у наступному вихідному файлі на + d мс. Крім того, ви можете використовувати параметр + --sync зі спеціальним ідентифікатором доріжки + -2 (див. розділ спеціальні ID доріжок). + +

+ + +

+ o/p: налаштуйте мітки часу на + o/p, щоб виправити лінійні + зсуви. Параметр p за замовчуванням має значення 1, + якщо його опустити. І o, і p + можуть бути числами з плаваючою комою. + +

+ + +

+ Значення за замовчуванням: немає ручної корекції синхронізації (це те саме, + що d = 0 і + o/p = 1.0). + +

+ + +

+ Цей параметр можна використовувати кілька разів, щоб вхідний файл + застосовувався до кількох доріжок, вибираючи щоразу різні ідентифікатори + доріжок. + +

+ +
--generate-chapters mode + +

+ mkvmerge(1) може створювати глави автоматично. На даний момент підтримуються + наступні два режими: + +

+ + +
    + +
  • + +

    + 'when-appending' – цей режим створює одну главу на + початку і одну главу щоразу, коли додається файл. + +

    + + +

    + Цей режим також працює з режимами розділення 'parts:' і + 'parts-frames:'. Для цих режимів буде створено одну главу + для кожного доданого діапазону міток часу (тих, чиї початкові мітки часу + мають префікс '+'). + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1) вимагає наявності відео або аудіо доріжки, щоб можна було + визначити, коли буде додано новий файл. Якщо одна або кілька відео доріжок + мультиплексовані, використовується перша з них. В іншому випадку + використовується перша звукова доріжка. + +

    + +
    + +
  • + + +
  • + +

    + 'interval:time-spec' – цей режим + створює одну главу з фіксованими інтервалами, заданими + time-spec. Формат у формі + HH:MM:SS.nnnnnnnnn або число, за яким слідує одна з + одиниць 's', 'ms' або + 'us'. + +

    + + +

    + Приклад: --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ Назви нових глав керуються параметром --generate-chapters-name-template. + Мова встановлюється за допомогою --chapter-language, + яка має бути наведена перед --generate-chapters. + +

+ +
--generate-chapters-name-template + template + +

+ Це встановлює шаблон назви для імен глав, створених за допомогою параметра + --generate-chapters. + Якщо цей параметр не використовується, буде використано стандартне значення + «Глава <NUM:2>». + +

+ + +

+ Існує кілька змінних, які можна використовувати в шаблоні, що замінюються + їхніми фактичними значеннями під час створення глави. Рядок + '<NUM>' буде замінено номером глави. Рядок + '<START>' буде замінено міткою часу початку глави. + +

+ + +

+ The strings '<FILE_NAME>' and + '<FILE_NAME_WITH_EXT>' are only filled when + generating chapters for appended files. They will be replaced by the + appended file's name without respectively with its extension. Note that + only the file's base name and extension are inserted, not its directory or + drive components. + +

+ + +

+ Ви можете вказати мінімальну кількість місць для номера глави за допомогою + '<NUM:places>', наприклад + '<NUM:3>'. Отримане число буде доповнено провідними + нулями, якщо кількість місць менше зазначеної. + +

+ + +

+ Ви можете керувати форматом, який використовується початковою міткою часу, + за допомогою <START:format>. Формат за + замовчуванням має значення '%H:%M:%S', якщо жодного не + вказано. Допустимі коди формату: + +

+ + +
    + +
  • + +

    %h – години +

    + +
  • + +
  • + +

    %H – години, два розряди доповнені провідними нулями +

    + +
  • + +
  • + +

    %m – хвилини +

    + +
  • + +
  • + +

    %M – хвилини, два розряди доповнені провідними нулями +

    + +
  • + +
  • + +

    %s – секунди +

    + +
  • + +
  • + +

    %S – секунди, два розряди доповнені провідними нулями +

    + +
  • + +
  • + +

    %n – наносекунди, дев'ять розрядів доповнені провідними + нулями +

    + +
  • + +
  • + +

    %<1-9>n – наносекунди дев'ять розрядів доповнені + провідними нулями (напр. три розряди з %3n) +

    + +
  • + +
+ +
--cue-chapter-name-format format + +

+ mkvmerge(1) підтримує читання списків CUE для аудіофайлів як + вхідних даних для глав. Списки CUE зазвичай містять записи + PERFORMER і TITLE для кожного запису + індексу. mkvmerge(1) використовує ці два рядки для створення назви глави. За + допомогою цього параметра можна встановити формат, який використовується для + цього імені. + +

+ + +

+ Якщо цей параметр не вказано, mkvmerge(1) за замовчуванням має формат + '%p - %t' (виконавець, за яким слідує пробіл, тире, інший + пробіл і заголовок). + +

+ + +

+ Якщо вказано формат, то все, крім наступних метасимволів, копіюється як є, а + метасимволи замінюються таким чином: + +

+ + +
    + +
  • + +

    %p замінюється на рядок PERFORMER + поточного запису, +

    + +
  • + +
  • + +

    %t замінюється на рядок TITLE + поточного запису, +

    + +
  • + +
  • + +

    %n замінюється на номер поточної доріжки та +

    + +
  • + +
  • + +

    %N замінюється номером поточної доріжки, доповненою + початковим нулем, якщо це < 10. +

    + +
  • + +
+ +
--chapters file-name + +

+ Прочитайте інформацію про главу із файлу + file-name. Перегляньте розділ про глави нижче, щоб дізнатися більше. + +

+ +
--global-tags file-name + +

+ Читає глобальні теги з файлу file-name. Додаткову + інформацію див. у розділі про теги + нижче. + +

+ +
+ + + +

2.4. Загальне керування виводом (розширені глобальні параметри)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order + FID1:TID1,FID2:TID2,... + +

+ Цей параметр змінює порядок, у якому створюються доріжки для вхідного + файлу. Аргументом є список ID пар, розділених комами. Кожна пара містить + спочатку ID файлу (FID1), який є просто номером файлу + в командному рядку, починаючи з 0 і потім ID доріжки + (TID1) із цього файла. Якщо деякі ID доріжок + пропущені, ці доріжки створюються після того, як були створені доріжки, + задані цим параметром. + +

+ +
--cluster-length spec + +

+ Обмежте кількість блоків даних або тривалість даних у кожному + кластері. Параметр spec може бути числом + n без одиниць або числом d з + постфіксом 'ms'. + +

+ + +

+ Якщо одиниця не використовується, mkvmerge(1) помістить щонайбільше + n блоків даних у кожному кластері. Максимальна + кількість блоків – 65535. + +

+ + +

+ Якщо число d має постфікс 'ms', + тоді mkvmerge(1) розміщує щонайбільше d мілісекунд + даних у кожен кластер. Діапазон для d — від + '100 мс' до '32000 мс'. + +

+ + +

+ mkvmerge(1) за замовчуванням містить щонайбільше 65535 блоків даних і 5000 мс + даних у кластер. + +

+ + +

+ Програми, які намагаються знайти певний фрейм, можуть шукати лише + безпосередньо кластер, а потім читати весь кластер. Тому створення більших + кластерів може призвести до неточного або повільного пошуку. + +

+ +
--clusters-in-meta-seek + +

+ Повідомляє mkvmerge(1) створити мета-елемент пошуку в кінці файлу, що містить + усі кластери. Дивіться також розділ про макет файлу Matroska. + +

+ +
--timestamp-scale factor + +

+ Примусово встановлює коефіцієнт масштабу мітки часу в + factor. Припустимі значення знаходяться в діапазоні + 1000..10000000 або спеціальному + значенні -1. + +

+ + +

+ Зазвичай mkvmerge(1) використовує значення 1000000, що + означає, що мітки часу та тривалість мають точність 1 мс. Для файлів, які не + містять відео доріжку, але мають принаймні одну звукову mkvmerge(1) + автоматично вибере коефіцієнт масштабу мітки часу, щоб усі мітки часу та + тривалість мали точність до одного звукового зразка. Це спричиняє більші + накладні витрати, але забезпечує точний пошук і витягування. + +

+ + +

+ Якщо використовується спеціальне значення -1, то + mkvmerge(1) використовує точність зразка, навіть якщо є відеодоріжка. + +

+ +
--enable-durations + +

+ Записує тривалість для всіх блоків. Це збільшить розмір файлу і на даний + момент не пропонує жодної додаткової цінності для програвачів. + +

+ +
--no-cues + +

+ Повідомляє mkvmerge(1) не створювати та записувати дані cue, які можна + порівняти з індексом у AVI. Файли Matroska(tm) можна відтворювати без даних + cue, але пошук, ймовірно, буде неточним і повільнішим. Використовуйте це, + лише якщо ви справді відчайдушно потребуєте місця або для + тестування. Дивіться також параметр --cues, який + можна вказати для кожного вхідного файлу. + +

+ +
--no-date + +

+ За замовчуванням mkvmerge(1) встановлює в інформаційному полі сегмента "дата" + час і дату початку мультиплексування. За допомогою цього параметра це поле + взагалі не записується. + +

+ +
--disable-lacing + +

+ Відключає лейсінг для всіх доріжок. Це збільшить розмір файлу, особливо якщо + в ньому багато звукових доріжок. Цей варіант не призначений для + повсякденного використання. + +

+ +
--disable-track-statistics-tags + +

+ Зазвичай mkvmerge(1) записує певні теги зі статистикою для кожної + доріжки. Якщо такі теги вже є, вони будуть перезаписані. Теги: + BPS, DURATION, + NUMBER_OF_BYTES і + NUMBER_OF_FRAMES. + +

+ + +

+ Увімкнення цього араметра запобігає mkvmerge(1) від записування цих тегів і + від дотику до будь-яких існуючих тегів з однаковими іменами. + +

+ +
--disable-language-ietf + +

+ Зазвичай mkvmerge(1) записує нові мовні елементи IETF BCP 47 на додаток до + спадкових мовних елементів у заголовках, главах та тегах доріжок. Якщо + використовується цей параметр, записуються лише спадкові елементи. + +

+ +
--normalize-language-ietf mode + +

+ Дозволяє нормалізувати всі мовні теги IETF BCP 47 до їхньої канонічної форми + з режимом 'canonical', до форми розширених мовних + підтегів за допомогою режиму 'extlang' або вимикає його в + режимі 'off'. За замовчуванням застосовується + нормалізація до канонічної форми. + +

+ + +

+ У канонічній формі всі підтеги, для яких існують бажані значення, + замінюються цими бажаними значеннями. Це перетворює, наприклад, + 'zh-yue-jyutping' до 'yue-jyutping' + або 'fr-FX' до 'fr-FR'. + +

+ + +

+ Для форми розширених мовних підтегів спочатку будується канонічна + форма. Після цього всі основні мови, для яких існує розширений мовний + підтег, замінюються цим розширеним мовним підтегом та його префіксом. Це + перетворює, наприклад, 'yue-jyutping' повертається до + 'zh-yue-jyutping', але не впливає на + 'fr-FR', оскільки 'fr' не є розширеним + мовним підтегом. + +

+ +
--stop-after-video-ends + +

+ Stops processing after the primary video track ends, discarding any + remaining packets of other tracks. + +

+ +
+ + + +

2.5. Розділення файлів, зв’язування, додавання та конкатенація (більш глобальні + параметри)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split specification + +

+ Розділяє вихідний файл після заданого розміру або часу. Зверніть увагу, що + доріжки можна розділити лише перед ключовим кадром. Тому точка розділення + може трохи відрізнятися від того, що вказав користувач. + +

+ + +

+ На даний момент mkvmerge(1) підтримує такі режими: + +

+ + +
    + +
  1. + +

    + Розділення за розміром. + +

    + + +

    + Синтаксис: --split + [size:]d[k|m|g] + +

    + + +

    + Приклад: --split size:700m or --split 150000000 + +

    + + +

    + Параметр d може закінчуватися на + 'k', 'm' або 'g', + щоб вказати, що розмір у КБ, МБ або ГБ відповідно. В іншому випадку + передбачається розмір у байтах. Після того як поточний вихідний файл досягне + цього обмеження розміру, буде створено новий. + +

    + + +

    + Префікс 'size:' може бути опущений з міркувань + сумісності. + +

    + +
  2. + + +
  3. + +

    + Розділення за тривалістю. + +

    + + +

    + Синтаксис: --split + [duration:]HH:MM:SS.nnnnnnnnn|ds + +

    + + +

    + Приклад: --split duration:00:60:00.000 or --split + 3600s + +

    + + +

    + Параметр повинен мати форму HH:MM:SS.nnnnnnnn для + визначення тривалості з точністю до наносекунди або бути числом + d, за яким слідує літера 's' для + тривалості в секундах. Параметр HH – це кількість + годин, MM - хвилин, SS - + секунд і nnnnnnnn - наносекунд. Як кількість годин, + так і кількість наносекунд можна опустити. Після коми може бути до дев’яти + цифр. Після того, як тривалість вмісту поточного виводу досягне цієї межі, + буде запущено новий вихідний файл. + +

    + + +

    + Префікс 'duration:' може бути опущено з міркувань + сумісності. + +

    + +
  4. + + +
  5. + +

    + Розділення за мітками часу. + +

    + + +

    + Синтаксис: --split + timestamps:A[,B[,C...]] + +

    + + +

    + Приклад: --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + Параметри A, B, + C тощо повинні мати той самий формат, що й ті, що + використовуються для тривалості (див. вище). Список міток часу розділяється + комами. Після того, як вхідний потік досяг мітки часу поточної точки + розділення, створюється новий файл. Тоді використовується наступна точка + розділення, зазначена в цьому списку. + +

    + + +

    + Не можна опускати префікс 'timestamps:'. + +

    + +
  6. + + +
  7. + +

    + Зберігання певних частин шляхом вказівки діапазонів міток часу, відкидаючи + інші. + +

    + + +

    + Синтаксис: --split + parts:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + Приклади: +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + Режим parts повідомляє mkvmerge(1) зберігати певні + діапазони міток часу, відкидаючи інші. Діапазони, які потрібно зберегти, + мають бути перелічені після ключового слова parts: і + розділені комами. Сам діапазон складається з мітки часу початку та кінця у + форматі однакового вигляду, який приймаєтся в різних варіантах + --split (наприклад, 00:01:20 і + 80s посилаються на ту саму мітку часу). + +

    + + +

    + Якщо мітка часу початку не вказана, то за замовчуванням буде використана + мітка часу кінця попереднього діапазону. Якщо попереднього діапазону не + було, то за замовчуванням це початок файлу (див. приклад 3). + +

    + + +

    + Якщо мітка часу завершення не вказана, за замовчуванням буде використан + кінець вихідних файлів, що в основному повідомляє mkvmerge(1) залишити решту + (див. приклад 3). + +

    + + +

    + Зазвичай кожен діапазон записується в новий файл. Це можна змінити, щоб + послідовні діапазони записувалися в один файл. Для цього користувач повинен + поставити перед міткою часу початку символ +. Це + повідомляє mkvmerge(1) не створювати новий файл, а замість цього додати + діапазон до того самого файлу, в який був записаний попередній + діапазон. Мітки часу будуть налаштовані таким чином, щоб у вихідному файлі + не було пробілів, навіть якщо у вхідному файлі був пробіл у двох діапазонах. + +

    + + +

    + У прикладі 1 mkvmerge(1) створить два файли. Перший міститиме вміст, + починаючи з 00:01:20 до + 00:02:45. Другий файл міститиме вміст, починаючи з + 00:05:50 до 00:10:30. + +

    + + +

    + У прикладі 2 mkvmerge(1) створить лише один файл. Цей файл міститиме як + вміст, починаючи з 00:01:20 до + 00:02:45, так і вміст, починаючи з + 00:05:50 до 00:10:30. + +

    + + +

    + У прикладі 3 mkvmerge(1) створить два файли. Перший міститиме вміст від + початку вихідних файлів до 00:02:45. Другий файл + міститиме вміст, починаючи з 00:05:50 до кінця вихідних + файлів. + +

    + + +
    +

    Note:

    + +

    + Зверніть увагу, що mkvmerge(1) виконує розділення лише по позиціях ключових + кадрів. Це стосується як початку, так і кінця кожного діапазону. Тому, + навіть якщо мітка часу завершення знаходиться між двома ключовими кадрами + mkvmerge(1) продовжить виведення кадрів до наступного ключового кадру, але не + включаючи його. + +

    + +
    + +
  8. + + +
  9. + +

    + Зберігання певних частин шляхом вказування діапазонів номерів кадрів/полів, + відкидаючи інше. + +

    + + +

    + Синтаксис: --split + parts-frames:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + Приклади: +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + Режим parts-frames повідомляє mkvmerge(1) зберегти певні + діапазони номерів кадрів/полів, відкидаючи інше. Діапазони, які потрібно + зберегти, мають бути перелічені після ключового слова + parts-frames: і розділені комами. Сам діапазон + складається з початкового та кінцевого номера кадра/поля. Нумерація + починається з 1. + +

    + + +

    + Якщо початковий номер не вказано, то за замовчуванням буде використовуватися + кінцевий номер попереднього діапазону. Якщо попереднього діапазону не було, + то за замовчуванням це буде початок файлу (див. приклад 3). + +

    + + +

    + Якщо кінцевий номер не вказано, то за замовчуванням ним буде кінець вихідних + файлів, що в основному повідомляє mkvmerge(1) залишити решту (див. приклад + 3). + +

    + + +

    + Зазвичай кожен діапазон записується в новий файл. Це можна змінити, щоб + послідовні діапазони записувалися в один файл. Для цього користувач повинен + поставити перед початковим номером знак +. Це повідомляє + mkvmerge(1) не створювати новий файл, а замість цього додати діапазон до того + самого файлу, в який був записаний попередній діапазон. Мітки часу будуть + налаштовані таким чином, щоб у вихідному файлі не було пробілів, навіть якщо + у вхідному файлі був пробіл у двох діапазонах. + +

    + + +
    +

    Note:

    + +

    + Зверніть увагу, що mkvmerge(1) виконує розділення лише по позиціях ключових + кадрів. Це стосується як початку, так і кінця кожного діапазону. Тому, + навіть якщо кінцевий кадр/номер поля знаходиться між двома ключовими кадрами + mkvmerge(1) продовжить виведення кадрів до наступного ключового кадру, але + без урахування його. + +

    + +
    + + +

    + У прикладі 1 mkvmerge(1) створить два файли. Перший міститиме вміст, + починаючи з першого ключового кадру 137 до + 258. Другий файл міститиме вміст від + 548 до 1211. + +

    + + +

    + У прикладі 2 mkvmerge(1) створить лише один файл. Цей файл міститиме вміст, + починаючи з 733 до 912, і вміст, + починаючи з 1592 до 2730. + +

    + + +

    + У прикладі 3 mkvmerge(1) створить два файли. Перший міститиме вміст від + початку вихідних файлів до 430. Другий файл міститиме + вміст, починаючи з 2512 до кінця вихідних файлів. + +

    + + +

    + У цьому режимі розглядається лише перша відеодоріжка, яка виводиться. Якщо + відеодоріжка не виводиться, розділення не відбудеться. + +

    + + +
    +

    Note:

    + +

    + Числа, дані з цим аргументом, інтерпретуються на основі числа блоків + Matroska(tm), що виводяться. Єдиний блок Matroska(tm) містить або повний кадр + (для прогресивного вмісту) або одне поле (для вмісту з + чередуванням). mkvmerge не розрізняє їх і просто підраховує кількість + блоків. Наприклад: якщо ви хочете розділити після 25-го повного кадру з + вмістом чередування, вам доведеться в якості точки поділу вказати + 50 (два поля на повний кадр). + +

    + +
    + +
  10. + + +
  11. + +

    + Розділення на певні кадри/поля. + +

    + + +

    + Синтаксис: --split + frames:A[,B[,C...]] + +

    + + +

    + Приклад: --split frames:120,237,891 + +

    + + +

    + Усі параметри A, B, + C тощо мають бути цілими додатними числами. Нумерація + починається з 1. Список номерів кадрів/полів розділяється комами. Після + того, як вхідний потік досягнув номера кадру/поля поточної точки розділення, + створюється новий файл. Тоді використовується наступна точка розділення, + зазначена в цьому списку. + +

    + + +

    + Не можна опускати префікс 'frames:'. + +

    + + +

    + У цьому режимі розглядається лише перша відеодоріжка, яка виводиться. Якщо + відеодоріжка не виводиться, розділення не відбудеться. + +

    + + +
    +

    Note:

    + +

    + Числа, дані з цим аргументом, інтерпретуються на основі числа блоків + Matroska(tm), що виводяться. Єдиний блок Matroska(tm) містить або повний кадр + (для прогресивного вмісту) або одне поле (для вмісту з + чередуванням). mkvmerge не розрізняє їх і просто підраховує кількість + блоків. Наприклад: якщо ви хочете розділити після 25-го повного кадру з + вмістом чередування, вам доведеться в якості точки поділу вказати + 50 (два поля на повний кадр). + +

    + +
    + +
  12. + + +
  13. + +

    + Розділення перед конкретними главами. + +

    + + +

    + Синтаксис: --split chapters:all or + --split + chapters:A[,B[,C...]] + +

    + + +

    + Приклад: --split chapters:5,8 + +

    + + +

    + Усі параметри A, B, + C тощо мають бути цілими додатними числами. Нумерація + починається з 1. Список номерів глав розділяється комами. Розділення + відбудеться безпосередньо перед першим ключовим кадром, мітка часу якого + дорівнює або більша за початкову мітку часу для глав, номери яких + вказані. Глава, що починається з 0s, ніколи не розглядається для розділення + та відкидається без змін. + +

    + + +

    + Ключове слово all можна використовувати замість того, щоб + перераховувати всі номери глав вручну. + +

    + + +

    + Не можна опускати префікс 'chapters:' + +

    + + +
    +

    Note:

    + +

    + Формат файлу Matroska(tm) підтримує довільні глибоко вкладені структури глав, + які називаються «записами видання» та «атомами глав». Однак цей режим + враховує лише найвищий рівень глав у всіх записах видання. + +

    + +
    + +
  14. + +
+ + +

+ Для цього режиму розділення ім’я вихідного файлу обробляється інакше, ніж + для звичайної операцій. Він може містити printf, + наприклад, вираз '%d', включаючи необов'язкову ширину поля, + напр. '%02d'. Якщо це так, то номер поточного файлу буде + відформатовано відповідним чином і вставлено в цю точку імені файлу. Якщо + такого шаблону немає, то перед розширенням файлу передбачається шаблон + '-%03d': '-o output.mkv' призведе до + 'output-001.mkv' тощо. Якщо розширення немає, до імені буде + додано '-%03d'. + +

+ + +

+ Іншим можливим шаблоном є '%c', який буде замінено назвою + першої глави у файлі. Зауважте, що коли присутній '%c', шаблон + '-%03d' не буде додано автоматично. + +

+ +
--link + +

+ Зв’язує файли один з одним під час розділення вихідного файлу. Додаткову + інформацію див. у розділі з'язування + файлів нижче + +

+ +
--link-to-previous segment-UID + +

+ Зв’язує перший вихідний файл із сегментом із UID сегмента, заданим + параметром segment-UID. Додаткову інформацію див. у + розділі з'язування файлів + нижче. + +

+ + +

+ Якщо SID починається з "=", то його залишок інтерпретується як + ім’я файлу Matroska, UID сегмента якого читається та використовується. + +

+ +
--link-to-next segment-UID + +

+ Зв’язує останній вихідний файл із сегментом із UID сегмента, заданим + параметром segment-UID. Додаткову інформацію див. у + розділі з'язування файлів + нижче. + +

+ + +

+ Якщо SID починається з "=", то його залишок інтерпретується як + ім’я файлу Matroska, UID сегмента якого читається та використовується. + +

+ +
--append-mode mode + +

+ Визначає, як обчислюються мітки часу під час додавання файлів. Параметр + mode може мати два значення: + 'file' (за замовчуванням) і 'track'. + +

+ + +

+ Коли mkvmerge додає доріжку (відтепер називається + 'track2_1') з другого файлу (що зветься + 'file2') до доріжки (що зветься + 'track1_1') з першого файлу (що зветься + 'file1'), то він має зміщувати всі мітки часу для + 'track2_1' на певну величину. Для режиму + 'file' ця сума є найвищою міткою часу, що зустрічається в + 'file1', навіть якщо ця мітка часу була з іншої доріжки, + ніж 'track1_1'. У режимі доріжки зсув є найвищою міткою + часу 'track1_1'. + +

+ + +

+ На жаль, mkvmerge не може визначити, який режим надійно + використовувати. Тому він за замовчуванням працює в режимі + 'file'. Режим 'file' зазвичай краще + працює для файлів, які були створені незалежно один від одного; напр. під + час додавання файлів AVI або MP4. Режим + 'track' може працювати краще для джерел, які по суті є + лише частинами одного великого файлу, напр. для файлів VOB + і EVO. + +

+ + +

+ Доріжки субтитрів завжди розглядаються так, ніби режим + 'file' був активним, навіть якщо режим + 'track' насправді є. + +

+ +
--append-to + SFID1:STID1:DFID1:DTID1[,...] + +

+ Цей параметр визначає, до якої доріжки буде додано іншу доріжку. Кожна + специфікація містить чотири ID: ID файлу, ID доріжки, ID другого файлу та ID + другої доріжки. Перша пара, "ID вихідного файлу" та "ID вихідної доріжки", + визначає доріжку, яка має бути додана. Друга пара, "ID файлу призначення" та + "ID доріжки призначення", визначає доріжку, до якої додається перша. + +

+ + +

+ Якщо цей параметр був пропущений, використовується стандартне + зіставлення. Це стандартне зіставлення додає кожну доріжку з поточного файлу + до доріжки з попереднього файлу з тим самим ID доріжки. Це дозволяє легко + додавати, якщо фільм було розділено на дві частини і обидва файли мають + однакову кількість доріжок та ID доріжок за допомогою команди + mkvmerge -o output.mkv part1.mkv +part2.mkv. + +

+ +
+ + +

+ Одиночний '+' викликає приєднання наступного файлу, а не його додавання. '+' + також можна поставити перед наступним ім’ям файлу. Тому наступні дві команди + є еквівалентними: + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv file1.mkv +file2.mkv
+
[ file1 file2 + ] + +

+ Якщо кілька імен файлів містяться в парі квадратних дужок, то другий і всі + наступні файли будуть додані до першого файлу, названого в дужках. + +

+ + +

+ Це альтернативний синтаксис використання '+' між іменами файлів. Тому + наступні дві команди є еквівалентними: + +

+ +
$ mkvmerge -o full.mkv file1.mkv + file2.mkv
+$ mkvmerge -o full.mkv '[' file1.mkv file2.mkv ']'
+
= + +

+ Для певних типів файлів (програмні потоки MPEG, тобто VOB-и) mkvmerge(1) + зазвичай шукає файли в тому самому каталозі, що і вхідний файл, які мають + однакове базове ім’я і відрізняються лише за своїм поточним номером + (наприклад, 'VTS_01_1.VOB', 'VTS_01_2.VOB', 'VTS_01_3.VOB' тощо) і обробляє + всі ці файли, як ніби вони були об’єднані в один великий файл. Цей параметр, + єдиний '=', змушує mkvmerge не шукати ці додаткові файли. + +

+ + +

+ Знак '=' можна також поставити перед наступним ім'ям файлу. Тому наступні + дві команди є еквівалентними: + +

+ +
$ mkvmerge -o full.mkv = file1.mkv
+$ mkvmerge -o full.mkv =file1.mkv
+
( file1 file2 + ) + +

+ Якщо кілька імен файлів містяться в парі дужок, ці файли розглядатимуться + так, як ніби вони були об’єднані в один великий файл, що складається з + вмісту кожного з файлів один за одним. + +

+ + +

+ Це можна використовувати, наприклад, для файлів VOB, що надходять із + транспортних потоків DVD або MPEG. Його не можна використовувати, якщо кожен + файл містить власний набір заголовків, що зазвичай буває з окремими файлами, + такими як AVI або MP4. + +

+ + +

+ Введення імені файлу в дужки також запобігає mkvmerge; від пошуку додаткових + файлів з такою ж базовою назвою, як описано в налаштуванні + =. Тому ці два командні рядки є еквівалентними: + +

+ +
$ mkvmerge -o out.mkv = file.mkv
+$ mkvmerge -o out.mkv '(' file.mkv ')'
+ +

+ Дещо треба зауважити: + +

+ + +
    + +
  1. + +

    + Після відкриваючої і перед закриваючою дужками мають бути пробіли. + +

    + +
  2. + + +
  3. + +

    + Кожен параметр між дужками інтерпретується як ім’я файлу. Тому всі + параметри, що застосовуються до цього логічного файлу, мають бути + перераховані перед початковою дужкою. + +

    + +
  4. + + +
  5. + +

    + Деякі оболонки розглядають дужки як спеціальні символи. Отже, ви повинні + сховати або процитувати їх, як показано у прикладі вище. + +

    + +
  6. + +
+ +
+ + + + +

2.6. Підтримка вкладень (більше глобальних параметрів)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description description + +

+ Звичайний текстовий опис наступного вкладення. Застосовується до наступного + параметру --attach-file + або --attach-file-once. + + +

+ +
--attachment-mime-type MIME type + +

+ Тип MIME наступного вкладення. Застосовується до наступного + параметра --attach-file + або--attach-file-once. + Список офіційно визнаних типів MIME можна знайти, + наприклад, на домашній сторінці + IANA. Тип MIME є обов’язковим для вкладення. + +

+ + +

+ Якщо для вкладення не вказано тип MIME, його тип буде + визначено автоматично. + +

+ +
--attachment-name name + +

+ Встановлює ім’я, яке буде збережено у вихідному файлі для цього + вкладення. Якщо цей параметр не вказано, ім’я буде отримано з назви файлу + вкладеного файлу, заданого за допомогою параметра --attach-file + або --attach-file-once. + +

+ +
+ --attach-file file-name, + --attach-file-once file-name + + +

+ Створює вкладений файл всередині файла Matroska(tm). Перш ніж використовувати + цей параметр, потрібно встановити тип MIME. Різниця між + цими двома формами полягає в тому, що під час розділення файли, вкладені за + допомогою --attach-file, приєднуються до всіх вихідних + файлів, а файли, прикріплені за допомогою + --attach-file-once, долучаються лише до першого створеного + файлу. Якщо розділення не використовується, то обидва роблять те саме. + +

+ + +

+ mkvextract(1) можна використовувати для витягування вкладених файлів із файла + Matroska(tm). + +

+ +
--enable-legacy-font-mime-types + +

+ Дозволяє використовувати застарілі типи MIME для певних + типів вкладень шрифтів. Наприклад, + 'application/x-truetype-font' використовуватиметься для + шрифтів TrueType замість 'fonts/ttf'. + +

+ + +

+ Це впливає як на нові вкладення, якщо їх тип MIME + виявляється автоматично, так і на існуючі вкладення, чиї збережені типи + MIME будуть переставлені на застарілі. + +

+ + +

+ Типи MIME, що піддаються впливу, це + 'font/sfnt', 'font/ttf' та + 'font/collection', які всі зіставлені з + 'application/x-truetype-fonts' і + 'font/otf', який зіставляється з + 'application/vnd .ms-opentype'. + +

+ +
+ + + +

2.7. Параметри, що використовуються для кожного вхідного файла

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks + [!]n,m,... + +

+ Копіює аудіо доріжки n, m та + ін. Номера - це ідентифікатори доріжок, які можна отримати за допомогою + перемикача --identify. + Це не просто номери доріжок (див. розділ ідентифікатори доріжок). За + замовчуванням: копіювати всі звукові доріжки. + +

+ + +

+ Замість ідентифікаторів доріжок ви також можете надати коди мов ISO + 639-2. Це працюватиме лише для вихідних файлів, які містять мовні теги для + своїх доріжок. + +

+ + +

+ За умовчанням: копіювати всі доріжки такого роду. + +

+ + +

+ Якщо ідентифікатори мають префікс !, то значення + змінюється: копіювати всі доріжки цього типу, крім тих, які перераховані + після ! + +

+ +
-d, --video-tracks + [!]n,m,... + +

+ Копіювати відео доріжки n, m + та ін. Номери - цє ідентифікатори доріжок, які можна отримати за допомогою + перемикача --identify. + Це не просто номери доріжок (див. розділ ідентифікатори доріжок). За + замовчуванням: копіювати всі відео доріжки. + +

+ + +

+ Замість ідентифікаторів доріжок ви також можете надати коди мов ISO + 639-2. Це працюватиме лише для вихідних файлів, які містять мовні теги для + своїх доріжок. + +

+ + +

+ Якщо ідентифікатори мають префікс !, то значення + змінюється: копіювати всі доріжки цього типу, крім тих, які перераховані + після ! + +

+ +
-s, --subtitle-tracks + [!]n,m,... + +

+ Скопіюйте доріжки субтитрів n, + m та ін. Номери - це ідентифікатори доріжок, які + можна отримати за допомогою перемикача --identify. + Це не просто номери доріжок (див. розділ ідентифікатори доріжок). За + замовчуванням: копіювати всі доріжки субтитрів. + +

+ + +

+ Замість ідентифікаторів доріжок ви також можете надати коди мов ISO + 639-2. Це працюватиме лише для вихідних файлів, які містять мовні теги для + своїх доріжок. + +

+ + +

+ Якщо ідентифікатори мають префікс !, то значення + змінюється: копіювати всі доріжки цього типу, крім тих, які перераховані + після ! + +

+ +
-b, --button-tracks + [!]n,m,... + +

+ Копіювати доріжок кнопок n, m + та ін. Номери - це ідентифікатори доріжок, які можна отримати за допомогою + перемикача --identify. + Це не просто номери доріжок (див. розділ ідентифікатори доріжок). За + замовчуванням: копіювати всі доріжки кнопок. + +

+ + +

+ Замість ідентифікаторів доріжок ви також можете надати коди мов ISO + 639-2. Це працюватиме лише для вихідних файлів, які містять мовні теги для + своїх доріжок. + +

+ + +

+ Якщо ідентифікатори мають префікс !, то значення + змінюється: копіювати всі доріжки цього типу, крім тих, які перераховані + після ! + +

+ +
--track-tags + [!]n,m,... + +

+ Копіює доріжки тегів n, m та + ін. Номера - це ідентифікатори доріжок, які можна отримати за допомогою + перемикача --identify. + Це не просто номери доріжок (див. розділ ідентифікатори доріжок). За + замовчуванням: копіювати всі доріжки тегів. + +

+ + +

+ Якщо ідентифікатори мають префікс !, то значення + змінюється: копіювати все, крім ідентифікаторів, які перераховані після + ! + +

+ +
-m, --attachments + [!]n[:all|first],m[:all|first],... + +

+ Копіює вкладення з ідентифікаторами n, + m і т. д. до всіх або лише до першого вихідного + файлу. За кожним ідентифікатором може слідувати ':all' + (що є за замовчуванням, якщо ничого не введено) або + ':first'. Якщо розділення активне, тоді ті вкладення, чиї + ідентифікатори вказані за допомогою ':all', копіюються в + усі вихідні файли, а інші копіюються лише в перший вихідний файл. Якщо + розділення не активне, обидва варіанти мають однаковий ефект. + +

+ + +

+ За умовчанням всі вкладення копіюються до всіх вихідних файлів. + +

+ + +

+ Якщо ідентифікатори мають префікс !, то значення + змінюється: копіювати все, крім ідентифікаторів, які перераховані після + ! + +

+ +
-A, --no-audio + +

+ Не копіювати жодної звукової доріжки з цього файла. + +

+ +
-D, --no-video + +

+ Не копіювати жодної відео доріжки з цього файла. + +

+ +
-S, --no-subtitles + +

+ Не копіювати жодної доріжки субтитрів з цього файлу. + +

+ +
-B, --no-buttons + +

+ Не копіювати жодної доріжки кнопок DVD з цього файла. + +

+ +
-T, --no-track-tags + +

+ Не копіювати жодного тегу, специфічного для доріжки з цього файла. + +

+ +
--no-chapters + +

+ Не копіювати глави з цього файла. + +

+ +
-M, --no-attachments + +

+ Не копіювати вкладення з цього файла. + +

+ +
--no-global-tags + +

+ Не копіювати глобальних тегів з цього файла. + +

+ +
-y, --sync + TID:d[,o[/p]] + +

+ Підстроює часові мітки доріжки з ідентифікатором TID + на d мс. Ідентифікатори доріжок є такимі ж, як ті, що + надаються з --identify + (див. розділ ідентифікатори + доріжок). + +

+ + +

+ o/p: налаштуйте мітки часу на + o/p, щоб виправити лінійні + зсуви. Параметр p за замовчуванням має значення 1, + якщо його опустити. І o, і p + можуть бути числами з плаваючою комою. + +

+ + +

+ Значення за замовчуванням: немає ручної корекції синхронізації (це те саме, + що d = 0 і + o/p = 1.0). + +

+ + +

+ Цей параметр можна використовувати кілька разів, щоб вхідний файл + застосовувався до кількох доріжок, вибираючи щоразу різні ідентифікатори + доріжок. + +

+ +
--cues TID:none|iframes|all + +

+ Елементи керування, для яких записи списку cue (індексу) доріжки, + створюються для даної доріжки (див. розділ Ідентифікатори + доріжок). 'none' перешкоджає створенню записів + списку cue. Для 'iframes' лише блоки без посилань назад + або вперед (= I-кадри у відео доріжках) поміщаються в список + cue. 'all' примушує mkvmerge(1) створити записи cue для + всіх блоків, що зробить файл дуже великим. + +

+ + +

+ За замовчуванням - 'iframes' для доріжок відео та + субтитрів і 'none' для звукових доріжок. Дивіться також + параметр --no-cues, + який перешкоджає створенню записів cue, незалежно від використовуваних + параметрів --cues. + +

+ + +

+ Цей параметр можна використовувати кілька разів, щоб вхідний файл + застосовувався до кількох доріжок, вибираючи щоразу різні ідентифікатори + доріжок. + +

+ +
--default-track-flag + TID[:bool] + +

+ Встановлює прапорець "доріжка за замовчуванням" для даної доріжки + (див. розділ Ідентифікатори + доріжок), якщо необов'язковий аргумент bool + встановлено у 1 або якщо він відсутній. Прапор буде + встановлено, якщо вихідний контейнер не надає цю інформацію і користувач не + вказує її за допомогою цього параметра. + +

+ + +

+ Якщо користувач явно не вибирає доріжку під час відтворення, програвач + повинен вибрати одну із доріжок, для якого встановлено прапорець «доріжка за + замовчуванням», враховуючи, наприклад, такі уподобання користувача, як мова. + +

+ + +

+ Цей параметр можна використовувати кілька разів, щоб вхідний файл + застосовувався до кількох доріжок, вибираючи щоразу різні ідентифікатори + доріжок. + +

+ +
--track-enabled-flag + TID[:bool] + +

+ Встановлює прапорець "доріжка увімкнено" для даної доріжки + (див. розділ Ідентифікатори + доріжок) до заданого значення bool (0 або 1; + за замовчуванням 1, якщо не вказано). Доріжки вмикаються за замовчуванням, + якщо для них не вказано жодного параметра, а вихідний контейнер також не + надає цю інформацію. + +

+ + +

+ Для відтворення слід розглядати лише доріжки, для яких встановлено прапорець + «доріжка увімкнена». + +

+ + +

+ Цей параметр можна використовувати кілька разів, щоб вхідний файл + застосовувався до кількох доріжок, вибираючи щоразу різні ідентифікатори + доріжок. + +

+ +
--forced-display-flag + TID[:bool] + +

+ Встановлює прапорець "примусова доріжка" для даної доріжки + (див. розділ Ідентифікатори + доріжок), якщо необов'язковий аргумент bool + встановлено у 1 або якщо він відсутній. Використовуйте + це для доріжок, що мають наекранний текст або діалоги іноземною мовою. + +

+ + +

+ Цей параметр можна використовувати кілька разів, щоб вхідний файл + застосовувався до кількох доріжок, вибираючи щоразу різні ідентифікатори + доріжок. + +

+ +
--forced-track + TID[:bool] + +

+ Встановлює прапорець "з вадами слуху" для даної доріжки + (див. розділ Ідентифікатори + доріжок), якщо необов'язковий аргумент bool + встановлено у 1 або якщо він відсутній. Цей прапорець + може бути встановлений, якщо доріжка підходить для користувачів з вадами + слуху. + +

+ + +

+ Цей параметр можна використовувати кілька разів, щоб вхідний файл + застосовувався до кількох доріжок, вибираючи щоразу різні ідентифікатори + доріжок. + +

+ +
--forced-track + TID[:bool] + +

+ Встановлює прапорець "з вадами зору" для даної доріжки + (див. розділ Ідентифікатори + доріжок), якщо необов'язковий аргумент bool + встановлено у 1 або якщо він відсутній. Цей прапорець + може бути встановлений, якщо доріжка підходить для користувачів з вадами + зору. + +

+ + +

+ Цей параметр можна використовувати кілька разів, щоб вхідний файл + застосовувався до кількох доріжок, вибираючи щоразу різні ідентифікатори + доріжок. + +

+ +
--default-track + TID[:bool] + +

+ Встановлює прапорець "текстові описи" для даної доріжки + (див. розділ Ідентифікатори + доріжок), якщо необов'язковий аргумент bool + встановлено у 1 або якщо він відсутній. Цей прапорець + може бути встановлений, якщо доріжка містить текстові описи відеоконтенту, + придатні для відтворення через систему синтезу мовлення для користувачів із + вадами зору. + +

+ + +

+ Цей параметр можна використовувати кілька разів, щоб вхідний файл + застосовувався до кількох доріжок, вибираючи щоразу різні ідентифікатори + доріжок. + +

+ +
--forced-track + TID[:bool] + +

+ Встановлює прапорець "оригінальна доріжка" для даної доріжки + (див. розділ Ідентифікатори + доріжок), якщо необов'язковий аргумент bool + встановлено у 1 або якщо він відсутній. Цей прапорець + може бути встановлений, якщо доріжка є оригіналом (не переклад). + +

+ + +

+ Цей параметр можна використовувати кілька разів, щоб вхідний файл + застосовувався до кількох доріжок, вибираючи щоразу різні ідентифікатори + доріжок. + +

+ +
--forced-track + TID[:bool] + +

+ Встановлює прапорець "коментарій" для даної доріжки (див. розділ + Ідентифікатори доріжок), якщо + необов'язковий аргумент bool встановлено у + 1 або якщо він відсутній. Цей прапорець може бути + встановлений, якщо доріжка вміщує коментарі. + +

+ + +

+ Цей параметр можна використовувати кілька разів, щоб вхідний файл + застосовувався до кількох доріжок, вибираючи щоразу різні ідентифікатори + доріжок. + +

+ +
--track-name TID:name + +

+ Встановлює назву доріжки для даної доріжки (див. розділ Ідентифікатори доріжок) на + name. + +

+ +
--language TID:language + +

+ Встановлює мову для даної доріжки (див. розділ Ідентифікатори доріжок). Дозволені як + коди мов ISO 639-2, так і коди країн ISO 639-1. Коди країн будуть + автоматично перетворені в коди мов. Усі мови, включаючи їхні коди ISO 639-2, + можна вказати за допомогою параметра --list-languages. + +

+ + +

+ Цей параметр можна використовувати кілька разів, щоб вхідний файл + застосовувався до кількох доріжок, вибираючи щоразу різні ідентифікатори + доріжок. + +

+ +
-t, --tags + TID:file-name + +

+ Читає теги для доріжки з номером TID з файлу + file-name. Додаткову інформацію дивіться у розділі + про тегі нижче. + +

+ +
--aac-is-sbr + TID[:0|1] + +

+ Повідомляє mkvmerge(1) що доріжка з ID TID є + SBR AAC (ще відомий як HE-AAC або + AAC+). Ці параметри потрібні, якщо а) вихідний файл є + файломAAC (не файл Matroska(tm)) та б) + файл AAC містить дані SBR AAC. Причина + цього перемикача полягає в тому, що технічно неможливо автоматично визначити + нормальні дані AAC з даних SBR AAC без + декодування повного кадра AAC. Оскільки існує кілька + патентних проблем з декодерами AAC mkvmerge(1) ніколи не + міститиме декодування. Тому для файлів SBR AAC цей + перемикач є обов'язковим. Отриманий файл може не відтворюватися належним + чином або навіть не відтворюватися взагалі, якщо перемикач було пропущено. + +

+ + +

+ Якщо вихідним файлом є файл Matroska(tm), то CodecID + має бути достатньо для виявлення SBR AAC. Однак, якщо + CodecID неправильний, цей перемикач можна + використовувати, щоб виправити це. + +

+ + +

+ Якщо mkvmerge помилково виявляє, що файл AAC є файлом з + SBR, ви можете додати ':0' до + ідентифікатора доріжки. + +

+ +
--audio-emphasis TID:n|symbolic-name + +

+ Sets the emphasis for the audio track with the track ID + TID. The mode can either be a number + n (certain values between 0 and + 16) or a symbolic name. All valid numbers & + symbolic names can be listed with the --list-audio-emphasis + option. + +

+ +
--reduce-to-core TID + +

+ Деякі аудіокодеки мають ядро з втратами та додаткові розширення, які + реалізують декодування без втрат. Цей параметр повідомляє mkvmerge(1) + копіювати лише ядро, але не розширення. За замовчуванням mkvmerge(1) копіює + як ядро, так і розширення. + +

+ + +

+ Наразі цей параметр впливає лише на доріжки DTS. Доріжки + TrueHD, які містять вбудоване ядро AC-3, натомість + представлені як дві окремі доріжки, для яких користувач може вибрати, яку + доріжку копіювати. Для DTS така схема не спрацює, оскільки + розширення HD не можуть бути декодовані самі по собі – на відміну від даних + TrueHD. + +

+ +
--remove-dialog-normalization-gain + TID + +

+ Деякі аудіокодеки містять поля заголовка, які повідомляють декодеру або + програвачу застосувати, зазвичай негативне, посилення для нормалізації + діалогу. Цей параметр повідомляє mkvmerge(1) видалити або мінімізувати цей + выграш (gain), змінивши відповідні поля заголовка. + +

+ + +

+ Наразі цей параметр впливає лише на доріжки AC-3, + DTS та TrueHD. + +

+ +
--timestamps TID:file-name + +

+ Читає мітки часу, які будуть використовуватися для певного ідентифікатора + доріжки з file-name. Ці мітки часу примусово + замінюють мітки часу, які mkvmerge(1) нормально розраховує. Прочитайте розділ + про зовнішні файли міток + часу. + +

+ +
--default-duration TID:x + +

+ Примусово встановлює тривалість заданої доріжки за замовчуванням до + вказаного значення. Також змінює мітки часу доріжки, щоб відповідати + тривалості за замовчуванням. Аргумент x повинен мати + один з постфіксів 's', 'ms', + 'us', 'ns', 'fps', + 'p' або 'i', щоб вказати тривалість за + замовчуванням в секундах, мілісекундах, мікросекундах, наносекундах, кадрах + за секунду, прогресивних кадрах в секунду» або чересстрокових кадрах в + секунду відповідно. Число x може бути числом з + плаваючою комою або дробом. + +

+ + +

+ Якщо тривалість за замовчуванням не є примусовою, mkvmerge спробує отримати + тривалість доріжки за замовчуванням з контейнера та/або закодованого + бітового потоку для певних типів доріжок, наприклад, AVC/H.264 або MPEG-2. + +

+ + +

+ Цей параметр також можна використовувати для зміни FPS + відео доріжок без використання зовнішнього файлу позначок часу. + +

+ +
--fix-bitstream-timing-information + TID[:0|1] + +

+ Зазвичай mkvmerge(1) не змінює інформацію про час (швидкість кадрів/полів), + що зберігається у бітовому потоці відео. За допомогою цього параметра ця + інформація коригується відповідно до інформації про час з + контейнера. Інформація про час з контейнера може надходити з різних джерел: + з командного рядка (див. параметр --default-duration), + вихідного контейнера або похідного від бітового потоку. + +

+ + +
+

Note:

+ +

Поки що це було реалізовано лише для відео доріжок AVC/H.264.

+ +
+ +
--compression TID:n + +

+ Вибирає метод стиснення, який буде використовуватися для доріжки. Зверніть + увагу, що програвач також повинен підтримувати цей метод. Допустимі + значення: 'none', 'zlib' та + 'mpeg4_p2'/'mpeg4p2'. + +

+ +

+ Метод стиснення 'mpeg4_p2'/'mpeg4p2' є + спеціальним методом стиснення, який називається «видалення заголовка», який + доступний лише для відео доріжок MPEG4 part 2. + +

+ +

+ За замовчуванням для деяких типів субтитрів є стиснення + 'zlib'. Цей метод стиснення підтримує більшість, якщо не + всі програми відтворення. Підтримка інших методів стиснення, крім + 'none', не гарантується. + +

+ +
+ + + +

2.8. Параметри, які застосовуються лише до відео доріжок

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc + TID:FourCC + +

+ Примусово встановлює FourCC до вказаного + значення. Працює лише для відео доріжок у 'режимі сумісності MS'. + +

+ +
--display-dimensions + TID:widthxheight + +

+ Файли Matroska(tm) містять два значення, які встановлюють властивості + відображення, до яких програвач повинен масштабувати зображення під час + відтворення: ширина і висота зображення. Ці значення можна встановити за + допомогою цього параметра, напр. "1:640x480". + +

+ + +

+ Іншим способом вказати значення є використання параметра --aspect-ratio + або --aspect-ratio-factor + (див. нижче). Ці варіанти є взаємовиключними. + +

+ +
--aspect-ratio + TID:ratio|width/height + +

+ Файли Matroska(tm) містять два значення, які встановлюють властивості + відображення, до яких програвач повинен масштабувати зображення під час + відтворення: ширина і висота зображення. За допомогою цього параметра + mkvmerge(1) автоматично обчислить ширину та висоту зображення на основі + вихідної ширини та висоти зображення та співвідношення сторін, заданого за + допомогою цього параметра. Коефіцієнт можна вказати або у вигляді + відношення чисел з плаваючою комою, або у вигляді + дробу 'ширина/висота', + напр. '16/9'. + +

+ + +

+ Іншим способом вказати значення є використання параметрів --aspect-ratio-factor + або --display-dimensions + (див. вище та нижче). Ці варіанти є взаємовиключними. + +

+ +
--aspect-ratio-factor TID:factor|n/d + +

+ Інший спосіб встановити співвідношення сторін - це вказати + коефіцієнт. Початкове співвідношення сторін спочатку + множиться на цей коефіцієнт, а потім використовується + як цільове співвідношення сторін. + +

+ + +

+ Іншим способом вказати значення є використання параметрів --aspect-ratio + або --display-dimensions + (див. вище). Ці варіанти є взаємовиключними. + +

+ +
--cropping TID:left,top,right,bottom + +

+ Встановлює параметри обрізання пікселів відео доріжки на задані значення. + +

+ +
--color-matrix TID:n + +

+ Встановлює матричні коефіцієнти відео, які використовуються для отримання + значень яскравості та кольоровості на основі основних кольорів червоного, + зеленого та синього. Параметр n є цілим числом від + 0 до 10. + +

+ + +

+ Допустимі значення та їх зміст: + +

+ + +

+ 0: GBR, 1: BT709, + 2: unspecified, 3: reserved, + 4: FCC, 5: BT470BG, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 non-constant + luminance, 10: BT2020 constant luminance + +

+ +
--color-bits-per-channel TID:n + +

+ Встановлює кількість кодованих бітів для колірного каналу. Значення + 0 вказує на те, що кількість бітів не визначена. + +

+ +
--chroma-subsample TID:hori,vert + +

+ Кількість пікселів для видалення в каналах Cr і Cb для кожного пікселя, не + видаленого по горизонталі/вертикалі. + +

+ + +

+ Приклад: для відео з підвибіркою кольорів 4:2:0 параметр має бути + встановлений на + TID:1,1. + +

+ +
--cb-subsample TID:hori,vert + +

+ Кількість пікселів для видалення в каналі Cb для кожного пікселя, не + видаленого по горизонталі/вертикалі. Це добавка з + --chroma-subsample. + +

+ + +

+ Приклад: для відео з підвибіркою кольоровості 4:2:1, параметр + --chroma-subsample повинен бути встановлений до + TID:1,0 + та підвибірка Cb повинна бути встановлена до + TID:1,0. + +

+ +
--chroma-siting TID:hori,vert + +

+ Встановлює, як кольоровість розташовується по горизонталі/вертикалі + (0: не вказано, 1: зверху + розміщено, 2: наполовину). + +

+ +
--color-range TID:n + +

+ Встановлює обрізування диапазонів кольору (0: + невизначено, 1: диапазон трансляції, + 2: повний диапазон (без обрізування), + 3: встановлено через + MatrixCoefficients/TransferCharacteristics). + +

+ +
--color-transfer-characteristics + TID:n + +

+ Характеристики передавання відео. + +

+ + +

+ Допустимі значення та їх зміст: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: gamma 2.2 curve, 5: gamma 2.8 + curve, 6: SMPTE 170M, 7: SMPTE + 240M, 8: linear, 9: log, + 10: log sqrt, 11: IEC 61966-2-4, + 12: ITU-R BT.1361 extended color gamut, + 13: IEC 61966-2-1, 14: ITU-R + BT.2020 10 bit, 15: ITU-R BT.2020 12 bit, + 16: SMPTE ST 2084, 17: SMPTE ST + 428-1; 18: ARIB STD-B67 (HLG) + +

+ +
--color-primaries TID:n + +

+ Встановлює основні кольори відео. + +

+ + +

+ Допустимі значення та їх зміст: + +

+ + +

+ 0: reserved, 1: ITU-R BT.709, + 2: unspecified, 3: reserved, + 4: ITU-R BT.470M, 5: ITU-R + BT.470BG, 6: SMPTE 170M, 7: SMPTE + 240M, 8: FILM, 9: ITU-R BT.2020, + 10: SMPTE ST 428-1, 22: JEDEC P22 + phosphors + +

+ +
--max-content-light TID:n + +

+ Встановлює максимальну яскравість одного пікселя (Maximum Content Light + Level) в канделах на квадратний метр (кд/м²). Значення + n повинно бути цілим невід’ємним числом. + +

+ +
--max-frame-light TID:n + +

+ Встановлює максимальну яскравість одного повного кадра (Maximum + Frame-Average Light Level) в канделах на квадратний метр (кд/м²). Значення + n повинно бути цілим невід’ємним числом. + +

+ +
--chromaticity-coordinates + TID:red-x,red-y,green-x,green-y,blue-x,blue-y + +

+ Встановлює координати кольоровості червоного/зеленого/синього, як визначено + у CIE 1931. + +

+ +
--white-color-coordinates TID:x,y + +

+ Встановлює координати кольоровості білого кольору, як визначено у CIE 1931. + +

+ +
--max-luminance TID:float + +

+ Встановлює максимальну яскравість в канделах на квадратний метр + (кд/м²). Значення має бути менше ніж 9999,99. + +

+ +
--min-luminance TID:float + +

+ Встановлює мінімальну яскравість в канделах на квадратний метр + (кд/м²). Значення має бути менше ніж 999,99. + +

+ +
--projection-type TID:method + +

+ Встановлює використовуваний метод проекції відео. Допустимі значення: 0 + (прямокутна проекція), 1 (рівнопрямокутна проекція), 2 (проекція кубічної + карти) і 3 (проекція сітки). + +

+ +
--projection-private TID:data + +

+ Встановлює приватні дані, які застосовуються лише до певної проекції. Дані + мають бути подані у вигляді шістнадцяткових чисел з префіксом "0x" або без + нього, з пробілами або без них. + +

+ +
--projection-pose-yaw TID:float + +

+ Визначає поворот навколо вертикальної осі до проекції. + +

+ +
--projection-pose-pitch TID:float + +

+ Визначає поворот навколо поперечної осі до проекції. + +

+ +
--projection-pose-roll TID:float + +

+ Визначає поворот навколо повздовжньої осі до проекції. + +

+ +
--field-order TID:n + +

+ Встановлює порядок полів для відеодоріжки з ідентифікатором доріжки + TID. Замовлення має бути одним із таких номерів: + +

+ + +

+ 0: прогресивний; 1: черезрядковий + з відображенням верхнього поля першим, першим зберігається верхнє поле; + 2: невизначений порядок полів; 6: + черезрядковий з відображенням нижнього поля першим, першим зберігається + нижнє поле; 9: черезрядковий з відображенням нижнього + поля першим, першим зберігається нижнє поле; 14: + черезрядковий з відображенням верхнього поля першим, першим зберігається + нижнє поле + +

+ +
--stereo-mode TID:n|symbolic-name + +

+ Sets the stereo mode for the video track with the track ID + TID. The mode can either be a number + n between 0 and + 14 or a symbolic name. All valid numbers & names + can be listed with the --list-stereo-modes + option. + +

+ +
+ + + +

2.9. Параметри, які застосовуються лише до доріжок текстових субтитрів

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset TID:character-set + +

+ Встановлює набір символів для перетворення в UTF-8 для UTF-8 субтитрів для + заданого ідентифікатора доріжки. Якщо не вказано, набір символів буде + отримано з поточних налаштувань мови. Зауважте, що набір символів не + потрібен для читання субтитрів з файлів Matroska(tm) або з потоків Kate, + оскільки вони завжди зберігаються в UTF-8. Перегляньте розділ про текстові файли та набори + символів, щоб дізнатися, як mkvmerge(1) перетворює між наборами + символів. + +

+ + +

+ Цей параметр можна використовувати кілька разів, щоб вхідний файл + застосовувався до кількох доріжок, вибираючи щоразу різні ідентифікатори + доріжок. + +

+ +
+ + + +

2.10. Інші налаштування

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify + file-name + +

+ Дозволить mkvmerge(1) перевірити один файл і повідомити його тип, доріжки, що + містяться у файлі, та їх ідентифікатори. Якщо використовується цей параметр, + то єдиним дозволеним варіантом є ім’я файлу. + +

+ + +

Формат виводу, який використовується для результату, можна змінити за + допомогою параметра --identification-format. +

+ +
-J file-name + +

+ Це зручний псевдонім для "--identification-format json --identify + file-name". + +

+ +
-F, --identification-format + format + +

+ Визначає вихідний формат, що використовується параметром + --identify. Наступні формати підтримуються: + text (за замовчуванням, якщо цей параметр не + використовується) і json. + +

+ + +
    + +
  1. + +

    Формат text є коротким і читається людиною. Він + складається з одного рядка для кожного знайденого елемента (контейнер, + доріжки, вкладення тощо). +

    + + +

    Цей формат не призначений для аналізу. Результат буде перекладено мовою, що + використовує mkvmerge(1) (також дивіться --ui-language). +

    + +
  2. + + +
  3. + +

    + Формат виводу json є машиночитаним представленням + JSON. Цей формат відповідає схемі JSON, описаній у наступному файлі: + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + Усі версії схеми JSON доступні як в Інтернеті, так і у випущених архівах + вихідного коду. + +

    + +
  4. + +
+ +
--probe-range-percentage percentage + +

+ Типи файлів як програми та транспортні потоки MPEG (.vob, + .m2ts) вимагають розбору певної кількості даних, щоб + виявити всі доріжки, що містяться у файлі. Ця сума становить 0,3% розміру + вихідного файлу або 10 МБ, залежно від того, що більше. + +

+ + +

+ Якщо відомо, що доріжки присутні, але не знайдені, то відсоток для перевірки + можна змінити за допомогою цього параметра. Мінімальний розмір 10 МБ є + вбудованим і не може бути змінений. + +

+ +
--list-audio-emphasis + +

+ Lists all valid numbers & their corresponding symbolic names for the + --audio-emphasis + option. + +

+ +
--list-languages + +

+ Перелічує всі мови та їх коди ISO 639-2, які можна використовувати з + параметром --language . + +

+ +
--list-stereo-modes + +

+ Lists all valid numbers & their corresponding symbolic names for the + --stereo-mode + option. + +

+ +
-l, --list-types + +

+ Перелік підтримуваних типів вхідних файлів. + +

+ +
--priority priority + +

+ Встановлює приоритет, з яким виконується процес mkvmerge(1). Допустимими + значеннями є 'lowest', 'lower', + 'normal', 'higher' та + 'highest'. Якщо нічого не задано, використовується + 'normal'. На Unix-системах mkvmerge(1) використовує + функцію + nice(2). + Тому лише суперкористувач може використовувати 'higher' + та 'highest'. У Windows усі значення доступні для + використання для кожного користувача. + +

+ + +

Вибір 'найнижчий' також викликає mkvmerge(1) щоб вибрати + пріоритет неактивного введення-виведення на додаток до найнижчого можливого + пріоритету процесу. +

+ +
--command-line-charset character-set + +

+ Встановлює набір символів для перетворення рядків заданих через командний + рядок. За замовчуванням використовується набір символів для системної + локалі. Ці параметри застосовуються до аргументів наступних параметрів: + --title, + --track-name + та --attachment-description. + +

+ +
--output-charset character-set + +

+ Встановлює вихідний набір символів заданого в командному рядку для + конвертації. Типово використовується набір символів згідно поточної локалі + системи. + +

+ +
-r, --redirect-output + file-name + +

+ Записує всі повідомлення у файл file-name, замість + консолі. Хоча це можна легко зробити за допомогою переспрямування виводу, є + випадки, коли цей параметр потрібний: коли термінал повторно інтерпретує + вихід перед записом його у файл. Набір символів встанвлений з --output-charset + враховується. + +

+ +
--flush-on-close + +

+ Повідомляє програмі перенести до сховища кешовані в пам’яті дані під час + закриття файлів, що були відкриті на запис. Це можна використовувати, щоб + запобігти втраті даних при відключенні електроенергії або обійти певні + проблеми в операційній системі чи драйверах. Недоліком є те, що + мультиплексування займе більше часу, оскільки mkvmerge буде чекати, поки всі + дані будуть записані в сховище, перш ніж вийти. Дивіться проблемы 2469 і + 2480 баг-трекера MKVToolNix щоб дізнатися про переваги та недоліки. + +

+ +
--ui-language code + +

+ Використовується примусовий переклад для мови code + (наприклад, 'de_DE' для німецького перекладу). Після + введення list' як code програма + відобразить список доступних перекладів. + +

+ +
--abort-on-warnings + +

+ Повідомляє програмі припинити роботу після першого попередження. Код виходу + з програми буде 1. + +

+ +
--deterministic seed + +

+ Дозволяє створювати ідентичні до байту файли, якщо однакова версія + mkvmerge(1) використовується з тими самими вихідними файлами, тим самим + набором параметрів і тим самим початковим елементом. Зверніть увагу, що + інформаційне поле сегмента «дата» не записується в цьому режимі. + +

+ + +

Сід може бути довільним рядком і не обов’язково бути числом.

+ + +

+ Результат ідентичних до байту файлів гарантується лише за таких умов: + +

+ + +
    + +
  1. + +

    Така ж версія mkvmerge(1) використовується з тими ж версіями libEBML і + libMatroska. +

    + +
  2. + + +
  3. + +

    Використані вхідні файли ідентичні до байта.

    + +
  4. + + +
  5. + +

    Ті самі параметри командного рядка використовуються в тому ж порядку (за + винятком --output...). +

    + +
  6. + +
+ + +

+ Використання інших версій mkvmerge(1) або інших параметрів командного рядка + можуть призвести до того самого файлу, ідентичного до байту, але це не + гарантується. + +

+ +
--debug topic + +

+ Увімкнути налагодження для певної функції. Цей параметр корисний лише для + розробників. + +

+ +
--engage feature + +

+ Вмикає експериментальні функції. Список доступних функцій можна запросити за + допомогою mkvinfo --engage list. Ці функції не призначені + для використання в звичайних ситуаціях. + +

+ +
--gui-mode + +

+ Вмикає режим графічного інтерфейсу. У цьому режимі можуть бути виведені + спеціально відформатовані рядки, які можуть повідомляти керуючому графічному + інтерфейсу, що відбувається. Ці повідомлення мають формат + '#GUI#message'. За повідомленням можуть слідувати пари + ключ/значення, як у + '#GUI#message#key1=value1#key2=value2…'. Ані + повідомлення, ані ключі ніколи не перекладаються і завжди виводяться + англійською. + +

+ +
@options-file.json + +

+ Читає додаткові аргументи командного рядка з файлу + options-file. Дивіться розділ про файл параметрів для додаткової + інформації. + +

+ +
--capabilities + +

+ Перелічує інформацію про додаткові функції, які були скомпільовані та + вийшли. У першому рядку виведення буде інформація про версію. Усі наступні + рядки містять рівно одне слово, наявність якого вказує на те, що функція + скомпільована. Це: + +

+ + +
    + +
  • + +

    + 'FLAC' -- читає необраблені файли FLAC + та оброблені доріжки FLAC в інших контейнерах, наприклад + Ogg(tm) або Matroska(tm). + +

    + +
  • + +
+ +
-h, --help + +

+ Відображається інформація про використання додатку і відбувається завершення + роботи додатку. + +

+ +
-V, --version + +

+ Відображається інформація про версію додатку і відбувається завершення + роботи додатку. + +

+ +
+ + +

3. Використання

+ + +

+ Для кожного файлу користувач може вибрати, які доріжки mkvmerge(1) слід + взяти. Усі вони поміщаються у файл, зазначений з параметром + -o. Список відомих (та підтримуваних) вхідних форматів + можна отримати за допомогою параметра -l. + +

+ + +
+

Important:

+ +

+ Важливим є порядок параметрів командного рядка. Будь ласка, прочитайте + розділ "Порядок + параметрів", якщо ви новачок у програмі. + +

+ +
+ +

4. Порядок параметрів

+ + + +

+ Для деяких параметрів порядок введення параметрів є важливим. Параметри + діляться на дві категорії: + +

+ + +
    + +
  1. + +

    + Параметри, які впливають на всю програму і не прив’язані до жодного вхідного + файлу. Вони включають, але не обмежуються + --command-line-charset, --output або + --title. Вони можуть відображатися в будь-якому місці + командного рядка. + +

    + +
  2. + + +
  3. + +

    + Параметри, які впливають на одиночний вхідний файл або одиночну доріжку у + вхідному файлі. Усі ці параметри застосовуються до наступного вхідного файлу + в командному рядку. Усі параметри, що застосовуються до того самого вхідного + файлу (або до доріжок з того самого вхідного файлу), можна записати в + будь-якому порядку, якщо всі вони з’являються перед іменем цього вхідного + файлу. Приклади застосування параметрів до вхідного файлу: + --no-chapters або + --chapter-charset. Приклади застосування параметрів до + одиночної доріжки: --default-duration або + --language. + +

    + +
  4. + +
+ + +

+ Параметри оброблюються зліва направо. Якщо параметр з’являється кілька разів + у межах однієї області, буде використано останнє входження. Тому заголовок + буде встановлено на "Щось інше" в наступному прикладі: + +

+ +
$ mkvmerge -o output.mkv --title 'This and that' input.avi --title 'Something else'
+ +

+ Наступний приклад показує використання параметра --language + двічі, що не стає проблемою завдяки тому, що вони використовується в різних + сферах. Незважаючи на те, що вони застосовуються до одного ідентифікатора + доріжки, вони застосовуються до різних вхідних файлів і, отже, мають різну + область дії: + +

+ +
$ mkvmerge -o output.mkv --language 0:fre français.ogg --language 0:deu deutsch.ogg
+

5. Приклади

+ + +

+ Припустимо, у вас є файл MyMovie.avi та аудіо доріжка в окремому файлі, + наприклад 'MyMovie.wav'. Спочатку ви хочете закодувати + аудіо до OggVorbis(tm): + +

+ +
$ oggenc -q4 -oMyMovie.ogg MyMovie.wav
+ +

+ Через пару хвилин ви можете з'єднати відео та аудіо: + +

+ +
$ mkvmerge -o MyMovie-with-sound.mkv MyMovie.avi MyMovie.ogg
+ +

+ Якщо ваш AVI вже містить звукову доріжку, то вона також + буде скопійована (якщо mkvmerge(1) підтримує її аудіоформат). Щоб уникнути + цього, просто зробіть наступне + +

+ +
$ mkvmerge -o MyMovie-with-sound.mkv -A MyMovie.avi MyMovie.ogg
+ +

+ Після кількох хвилин роздумів ви обираєте іншу звукову доріжку, наприклад + коментарі режисера або іншомовну доріжку до + 'MyMovie-add-audio.wav'. Кодуєте ще раз і об’єднуєте з + іншим файлом: + +

+ +
$ oggenc -q4 -oMyMovie-add-audio.ogg MyMovie-add-audio.wav
+$ mkvmerge -o MM-complete.mkv MyMovie-with-sound.mkv MyMovie-add-audio.ogg
+ +

+ Такого ж результату можна досягти за допомогою + +

+ +
$ mkvmerge -o MM-complete.mkv -A MyMovie.avi MyMovie.ogg MyMovie-add-audio.ogg
+ +

+ Тепер використовуйте mplayer(tm) та + насолоджуйтеся. Якщо ви маєте декілька аудіо доріжок (або навіть відео + доріжок), тоді ви можете вказати mplayer(tm)-у яку + доріжке програвати, використовуючи параметри '-vid' та + '-aid'. Вони засновані на 0 і не розрізняють відео та + аудіо. + +

+ + +

+ Якщо вам потрібна синхронізація звукової доріжки, ви можете зробити це + легко. Спочатку дізнайтеся, з яким ідентифікатором є доріжка Vorbis + +

+ +
$ mkvmerge --identify outofsync.ogg
+ +

+ Тепер ви можете використовувати цей ID у наступному командному рядку: + +

+ +
$ mkvmerge -o goodsync.mkv -A source.avi -y 12345:200 outofsync.ogg
+ +

+ Це додасть 200 мс тиші на початку звукової доріжки з ідентифікатором + 12345, взятим із 'outofsync.ogg'. + +

+ + +

+ Деякі фільми починають синхронізуватися правильно, але повільно втрачають + її. Для таких фільмів ви можете вказати коефіцієнт затримки, який буде + застосовано до всіх міток часу – дані не додаються та не видаляються. Тому + якщо ви зробите цей коефіцієнт занадто великим або занадто малим, ви + отримаєте погані результати. Наприклад, епізод має розсинхронізацію + 0.2 секунди в кінці фільму довжиною + 77340 кадрів. При частоті + кадрів29.97fps 0.2 секунди + становлять приблизно 6 кадрів. Тому я зробив + +

+ +
$ mkvmerge -o goodsync.mkv -y 23456:0,77346/77340 outofsync.mkv
+ +

+ Результат був добрим. + +

+ + +

+ Параметри синхронізації також можна використовувати для субтитрів таким же + чином. + +

+ + +

+ Для текстових субтитрів можна використати програмне забезпечення Windows + (типу SubRipper(tm)) або пакет + subrip(tm), що може бути знайдений у вихідних файлах + transcode(1) + у каталозі 'contrib/subrip'. Загальний процес такий: + +

+ + +
    + +
  1. + +

    витягує необроблений потік субтитрів із джерела:

    +
    $ tccat -i /path/to/copied/dvd/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o mymovie
    +
  2. + + +
  3. + +

    конвертує отримані зображення PGM в текст за допомогою gocr:

    +
    $ pgm2txt mymovie
    +
  4. + + +
  5. + +

    перевіряє орфографію отриманих текстових файлів:

    +
    $ ispell -d american *txt
    +
  6. + + +
  7. + +

    конвертує текстові файли у файл SRT:

    +
    $ srttool -s -w -i mymovie.srtx -o mymovie.srt
    +
  8. + +
+ + +

+ Отриманий файл можна використовувати як інший вхідний файл для mkvmerge(1): + +

+ +
$ mkvmerge -o mymovie.mkv mymovie.avi mymovie.srt
+ +

+ Якщо ви хочете вказати мову для певної доріжки, це легко зробити. Спочатку + дізнайтеся код ISO 639-2 для вашої мови. mkvmerge(1) може перерахувати всі ці + коди для вас: + +

+ +
$ mkvmerge --list-languages
+ +

+ Знайдіть у списку потрібні мови. Припустимо, ви помістили дві звукові + доріжки в файл Matroska(tm) і хочете встановити коди своїх мов, а також + ідентифікатори доріжок 2 та 3. Це можна зробити за допомогою + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut without-lang-codes.mkv
+ +

+ Як бачите, перемикач --language + можна використовувати кілька разів. + +

+ + +

+ Можливо, ви також хочете, щоб програвач використовував нідерландську мову як + мову за замовчуванням. У вас також є додаткові субтитри, напр. англійською + та французькою мовами, і ви хочете, щоб програвач відображав французькі за + замовчуванням. Це можна зробити за допомогою + +

+ +
$ mkvmerge -o with-lang-codes.mkv --language 2:ger --language 3:dut --default-track-flag 3 without-lang-codes.mkv --language 0:eng english.srt --default-track-flag 0 --language 0:fre french.srt
+ +

+ Якщо ви не бачите мову або прапорець доріжки за замовчуванням, які ви + вказали у виводі mkvinfo(1), прочитайте розділ про значення за замовчуванням. + +

+ + +

+ Вимкніть стиснення для вхідного файлу. + +

+ +
$ mkvmerge -o no-compression.mkv --compression -1:none MyMovie.avi --compression -1:none mymovie.srt
+ +

6. ID доріжок

+ + + +

6.1. Ідентифікатори звичайних доріжок

+ + + +

+ Деякі параметри для mkvmerge(1) потребують ідентифікатор доріжки щоб + визначити до якої доріжки вони мають бути застосовані. Ці ідентифікатори + доріжок друкуються зчитувачами під час демуксування поточного вхідного + файлу, або якщо mkvmerge(1) виконується з параметром --identify. + Приклад такого виводу: + +

+ +
$ mkvmerge -i v.mkv
+File 'v.mkv': container: Matroska
+Track ID 0: video (V_MS/VFW/FOURCC, DIV3)
+Track ID 1: audio (A_MPEG/L3)
+ +

+ Не плутайте ідентифікатори доріжок, які призначаються доріжкам у вихідному + файлі MKV, з ідентифікаторами доріжок вхідних файлів. Для параметрів, які + потребують цих значень, використовуються лише ідентифікатори доріжок вхідних + файлів. + +

+ + +

+ Також зауважте, що кожен вхідний файл має свій власний набір ідентифікаторів + доріжок. Тому ідентифікатори доріжок для файлу + 'file1.ext' як повідомляє 'mkvmerge + --identify' не змінюються незалежно від того, скільки там інших + вхідних файлів і в якому положенні 'file1.ext' + використовуються. + +

+ + +

+ Ідентифікатори доріжок призначаються таким чином: + +

+ + +
    + +
  • + +

    + Файли AVI: відео доріжка має ідентифікатор 0. Аудіо доріжки + отримують ідентифікатори в порядку зростання, починаючи з 1. + +

    + +
  • + + +
  • + +

    + Файли AAC, AC-3, MP3, + SRT і WAV: одна доріжка у цьому файлі + отримує ID 0. + +

    + +
  • + + +
  • + +

    + Більшість інших файлів: ідентифікатори доріжок призначаються в порядку + виявлення доріжок у файлі, починаючи з 0. + +

    + +
  • + +
+ + +

+ Параметри, що використовують ідентифікатори доріжок це ті, опис яких містить + 'TID'. Наступні параметри також використовують + ідентифікатори доріжок: --audio-tracks, + --video-tracks, --subtitle-tracks, + --button-tracks та --track-tags. + +

+ + + +

6.2. Ідентифікатори особливих доріжок

+ + + +

+ Існує кілька ідентифікаторів, які мають особливе значення і не зустрічаються + в ідентифікаційних виводах. + +

+ + +

+ Спеціальний ідентифікатор доріжки '-1' є символом + підстановки і застосовує даний перемикач до всіх доріжок, які зчитуються з + вхідного файлу. + +

+ + +

+ Спеціальний ідентифікатор доріжки '-2' посилається на + глави у вихідному файлі. Зараз тільки параметр --sync + використовує цей спеціальний ідентифікатор. Як альтернатива до + --sync -2:… може бути використано параметр + --chapter-sync …. + +

+ + +

7. Language handling

+ + + +

+ Matroska(tm) has support for two different types of language elements: the + old, deprecated "Language" element containing ISO 639-2 alpha 3 codes and + the new "LanguageIETF" tags containing IETF BCP 47 language tags. All of + mkvmerge(1)'s options that accept a language accept a BCP 47 language + tag. mkvmerge(1) will derive the value for the deprecated "Language" element + from the BCP 47 language tags wherever possible. + +

+ + +

+ When identifying a file in JSON mode, existing "LanguageIETF" track header + elements will be output as the language_ietf track + property. + +

+ + +

+ When writing a file mkvmerge(1) will always write the "LanguageIETF", + "ChapLanguageIETF" and "TagLanguageIETF" elements (the latter two only if + chapters or tags are written respectively). In addition to those elements + the corresponding old elements will be written; they'll be set to the ISO + 639-2 code portion of the BCP 47 language tag. For example, when the track + language is set to sr-Cyrl-RS "LanguageIETF" will be set + to sr-Cyrl-RS and the old "Language" element will be set + to srp. + +

+ + +

+ When reading existing files (Matroska files, XML chapter or tag files etc.) + that already contain "…LanguageIETF" elements the existing elements will be + kept. Otherwise "…LanguageIETF" elements will be added based on command-line + options and other existing deprecated "…Language" elements. + +

+ + +

+ The creation of the new elements can be disabled completely with the + command-line option --disable-language-ietf which operates + on all three new elements. + +

+ + +

+ You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. + +

+ +

8. Текстові файли та перетворення набору символів

+ + +
+

Note:

+ +

+ Цей розділ застосовується до всіх програм у MKVToolNix, навіть якщо в ньому + згадується лише mkvmerge(1). + +

+ +
+ + +

8.1. Вступ

+ + +

+ Весь текст у файлі Matroska(tm) закодований у UTF-8. Це означає, що mkvmerge(1) + має перетворити кожен текстовий файл, який він читає, а також кожен текст, + поданий у командному рядку, з будь-якого набору символів в UTF-8. Натомість + це також означає, що вихідні дані mkvmerge(1) потрібно перетворити назад у + цей набір символів з UTF-8, наприклад якщо не-англійський переклад + використовується з --ui-language + або для тексту, що походить із файла Matroska(tm). + +

+ + +

+ mkvmerge(1) виконує це перетворення автоматично на основі наявності маркера + порядку байтів (коротко: BOM) або поточної локалі + системи. Як набор символів виводится із локалі залежить від операційної + системи, в якій mkvmerge(1) виконується. + +

+ + + +

8.2. Маркери порядку байтів (BOM)

+ + + +

+ Текстові файли, які починаються з BOM, вже закодовані в одному представленні + UTF. mkvmerge(1) підтримує наступні п'ять режимів: UTF-8, UTF-16 Little та + Big Endian, UTF-32 Little та Big Endian. Текстові файли з BOM автоматично + конвертуються в UTF-8. Будь-які параметри які інакше встановив набір + символів для такого файлу (наприклад --sub-charset) + мовчки ігнорується. + +

+ + + +

8.3. Linux і Unix-подібні системи, включаючи macOS

+ + + +

+ На Unix-системах mkvmerge(1) використовує системний виклик + setlocale(3), + який, у свою чергу, використовує змінні середовища LANG, + LC_ALL та LC_CYPE. Отриманий набір + символів часто є одним із сімейства UTF-8 або ISO-8859-* і використовується + для всіх операцій з текстовими файлами та для кодування рядків у командному + рядку та для виведення у консоль. + +

+ + + +

8.4. Windows

+ + + +

+ У Windows набір символів за замовчуванням, який використовується для + перетворення текстових файлів, визначається системного викликом + GetACP(). + +

+ + +

+ Читання командного рядка завершується функцією + GetCommandLineW(), яка повертає рядок Unicode. Тому + параметр --command-line-charset ігнорується у Windows. + +

+ + +

+ Вивід у консоль складається з трьох сценаріїв: + +

+ + +
    + +
  1. + +

    + Якщо вивід перенаправлений параметром --redirect-output, + за замовчанням встановлюється набір символів UTF-8. Це можна змінити з --output-charset. + +

    + +
  2. + + +
  3. + +

    + Якщо вивід перенаправлений з cmd.exe самостійно, + наприклад з mkvinfo file.mkv > info.txt, тоді набір + символів завжди буде встановлений у UTF-8 та не може бути змінений. + +

    + +
  4. + + +
  5. + +

    + В іншому випадку (при записі безпосередньо на консоль) використовується + функція Windows WriteConsoleW() і параметр --output-charset + ігнорується. Консоль повинна мати можливість виводити всі символи Unicode, + для яких встановлена ​​відповідна підтримка мов (наприклад, китайські + символи можуть не відображатися в англійських версіях Windows). + +

    + +
  6. + +
+ + + +

8.5. Параметри командного рядка

+ + + +

+ Існують такі параметри, які дозволяють вказати набори символів: + +

+ + +
    + +
  • + +

    + --sub-charset + для текстових файлів субтитрів і доріжок текстових субтитрів, що + зберігаються в контейнерних форматах, для яких набір символів не може бути + визначений однозначно (наприклад, файли Ogg), + +

    + +
  • + + +
  • + +

    + --chapter-charset + для текстових файлів глав і для глав та заголовків файлу, що зберігаються в + контейнерних форматах, для яких набір символів не може бути визначений + однозначно (наприклад, файли Ogg для інформації глав, доріжок і заголовків + файлу тощо; файли MP4 для інформації глав), + +

    + +
  • + + +
  • + +

    + --command-line-charset + для всіх рядків командного рядку, + +

    + +
  • + + +
  • + +

    + --output-charset + для всіх рядків, написаних до консолі або до файла, якщо вивід був + переспрямований з параметром --redirect-output. + У системах, які не підтримують Windows, за замовчуванням для вихідного + набору символів використовується поточний набір символів системи. У Windows + для переспрямування за замовчуванням встановлено у UTF-8 за допомогою --redirect-output + та з самим cmd.exe, наприклад mkvinfo file.mkv + > info.txt. + +

    + +
  • + +
+ + +

9. Файли параметрів

+ + + +

+ Файлом параметрів є файл, з якого mkvmerge(1) може читати додаткові аргументи + командного рядка. Це можна використовувати для того, щоб обійти певні + обмеження оболонки або операційної системи під час виконання зовнішніх + програм, наприклад, обмежена довжина командного рядка. + +

+ + +

+ Файл параметрів містить дані у форматі JSON. Його вміст має бути дійсним + масивом JSON, що складається виключно з рядків JSON. Кодування файлу має + бути UTF-8. Файл не повинен починатися з маркера порядку байтів + (BOM), але якщо він існує, його буде пропущено. + +

+ + +

+ Правила екранування спеціальних символів всередині JSON відповідають + офіційній специфікації JSON, RFC 7159. + +

+ + +

+ Саме ім'я файлу параметрів має бути вказано як аргумент командного рядка з + префіксом '@'. + +

+ + +

+ Командний рядок 'mkvextract tracks source.mkv --raw + 1:destination.raw' може бути перетворений на наступний + конфігураційний файл: + +

+ +
[
+  "-o",
+  "c:\\Matroska\\my file.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "a movie.avi",
+  "sound.ogg"
+]
+ +

+ Тоді буде відповідна команда 'mkvmerge @options.json'. + +

+ +

10. Зв'язування файлу

+ + +

+ Matroska(tm) підтримує зв'язування файлів, яке просто говорить, що конкретний + файл є попередником або наступником поточного файлу. Якщо бути точним, то + насправді пов’язані не файли, а сегменти Matroska(tm). Оскільки більшість + файлів, ймовірно, міститиме лише один сегмент Matroska(tm), у наведених нижче + поясненнях використовується термін «зв'язування файлів», хоча «зв'язування + сегментів» було б більш доречним. + +

+ + +

+ Кожен сегмент ідентифікується унікальним 128-бітовим UID сегмента. Цей UID + автоматично генерується mkvmerge(1). Зв’язування здійснюється головним чином + шляхом розміщення UID сегментів (скорочено: SID) + попереднього/наступного файлу в інформацію заголовка сегмента. mkvinfo(1) + друкує ці ідентифікатори SID, якщо їх знайде. + +

+ + +

+ Якщо файл розбитий на кілька менших і використовується зв’язування, то мітки + часу не починатимуться знову з 0, а продовжуватимуться там, де зупинився + останній файл. Таким чином зберігається абсолютний час, навіть якщо + попередні файли недоступні (наприклад, під час потокової передачі). Якщо + зв’язування не використовується, мітки часу мають починатися з 0 для кожного + файлу. За замовчуванням mkvmerge(1) не використовує зв'язування файлів. Якщо + ви хочете, ви можете ввімкнути його за допомогою параметра --link. Цей + параметр корисний, лише якщо також активовано розділення. + +

+ + +

+ Незалежно від того, активоване розділення чи ні, користувач може визначити + mkvmerge(1) щоб зв’язувати створені файли з конкретними + SIDs. Це досягається за допомогою параметрів + --link-to-previous та --link-to-next. Ці + параметри приймають сегмент SID у форматі, який виводить + mkvinfo(1): 16 шістнадцяткові числа між 0x00 та + 0xff, де коже має префікс '0x', + наприклад '0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e 0xae 0x78 0xeb 0xb4 + 0x5e 0xca 0xb3 0x93'. В якості альтернативи можна використовувати + коротшу форму: 16 шістнадцяткових чисел між 0x00 та + 0xff без префіксів '0x' і без + пробілів, наприклад '41da7366d9cfb21eae78ebb45ecab393'. + +

+ + +

+ Якщо розділення використовується, тоді перший файл зв'язується з + SID, що передається з --link-to-previous, + і останній файл зв'язується з SID, що передається з + --link-to-next. Якщо розділення не використовується, то + один вихідний файл буде зв’язано з обома SID. + +

+ +

11. Значення за замовчуванням

+ + +

+ Специфікація Matroska(tm) стверджує, що деякі елементи мають значення за + замовчуванням. Зазвичай елемент не записується у файл, якщо його значення + дорівнює значенню за замовчуванням, щоб заощадити місце. Елементами, які + користувач може пропустити у виводі mkvinfo(1), є елементи + мова та прапорець доріжки за + замовчуванням. Значенням за замовчуванням для елемента + мова є англійська ('eng'), та + значенням за замовчуванням для елемента прапорець доріжки за + замовчуванням є так. Тому, якщо ви + використали --language 0:eng для доріжки, він не + відображатиметься у виводі mkvinfo(1). + +

+ +

12. Вкладення

+ + +

+ Можливо, ви також захочете зберегти деякі фотографії разом із вашим файлом + Matroska(tm), або ви використовуєте субтитри SSA і потребуєте + спеціального шрифту TrueType(tm), який дуже рідко + зустрічається. У цих випадках ви можете прикріпити ці файли до файлу + Matroska(tm). Вони будуть не просто додані до файлу, а вбудовані в + нього. Потім програвач зможе показати ці файли (випадок «фотографій») або + використовувати їх для відтворення субтитрів (випадок 'шрифти + TrueType(tm)'). + +

+ + +

+ Ось приклад, як прикріпити фотографію та шрифт + TrueType(tm) до файла параметрів: + +

+ +
$ mkvmerge -o output.mkv -A video.avi sound.ogg \
+  --attachment-description "Me and the band behind the stage in a small get-together" \
+  --attachment-mime-type image/jpeg \
+  --attach-file me_and_the_band.jpg \
+  --attachment-description "The real rare and unbelievably good looking font" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file really_cool_font.ttf
+ +

+ Якщо файл Matroska(tm), що містить вкладення, використовується як вхідний + файл, тоді mkvmerge(1) скопіює файли вкладеннь в новий файл. Обрати, які + вкладення копіювати, а які ні, можна за допомогою параметрів --attachments + та --no-attachments. + +

+ +

13. Глави

+ + +

+ Система глав Matroska(tm) є більш потужною ніж стара система що + використовується файлами OGM. Повна специфікація може бути + знайдена на сайті Matroska. + +

+ + +

+ mkvmerge(1) підтримує два види файлів глав в якості вхідних даних. Перший + формат, званий «простий формат глав», є тим самим форматом, який очікують + інструменти OGM. Другим форматом є формат глав на основі + XML, який підтримує всі функції глав Matroska(tm). + +

+ + +

+ Окрім виділених файлів глав mkvmerge(1) може також читати глав з інших + форматів файлів (наприклад, MP4, Ogg, Blu-ray або DVD). + +

+ + +

13.1. Простий формат глав

+ + + +

+ Цей формат складається з пар рядків, що починаються з + 'CHAPTERxx=' та 'CHAPTERxxNAME=' + відповідно. Перший містить мітку часу початку, а другий містить + назву. Наприклад: + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=Intro
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=Baby prepares to rock
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=Baby rocks the house
+ +

+ mkvmerge(1) will transform every pair or lines into one Matroska(tm) + ChapterAtom. It does not set any + ChapterTrackNumber which means that all chapters + apply to all tracks in the file. + +

+ + +

+ Оскільки це текстовий файл, може знадобитися перетворення набору + символів. Дивись розділ про текстові файли та набори + символів для пояснення, як mkvmerge(1) перетворює між наборами + символів. + +

+ + + +

13.2. Формат глав, що базується на XML

+ + +

+ Формат глав, що базується на XML, виглядає як у наступному прикладі: + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>A short chapter</ChapterString>
+        <ChapterLanguage>eng</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>A part of that short chapter</ChapterString>
+          <ChapterLanguage>eng</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ У цьому форматі можливі три речі, які неможливі в простому форматі глави: + +

+ + +
    + +
  1. +

    Мітка часу для кінця глави може бути встановлена,

    +
  2. + +
  3. +

    глави можуть вкладатися

    +
  4. + +
  5. +

    мова і країна можуть бути встановлені.

    +
  6. + +
+ + +

+ Дистрибутив mkvtoolnix містить деякі зразки файлів у підкаталозі + doc, які можна використовувати як основу. + +

+ + +

+ Нижче перелічено підтримувані теги XML, їх типи даних і, за необхідності, + дійсний діапазон їх значень: + +

+ +
Chapters (master)
+  EditionEntry (master)
+    EditionUID (unsigned integer, valid range: 1 <= value)
+    EditionFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagDefault (unsigned integer, valid range: 0 <= value <= 1)
+    EditionFlagOrdered (unsigned integer, valid range: 0 <= value <= 1)
+    ChapterAtom (master)
+      ChapterAtom (master)
+      ChapterUID (unsigned integer, valid range: 1 <= value)
+      ChapterTimeStart (unsigned integer)
+      ChapterTimeEnd (unsigned integer)
+      ChapterFlagHidden (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterFlagEnabled (unsigned integer, valid range: 0 <= value <= 1)
+      ChapterSegmentUID (binary, valid range: 1 <= length in bytes)
+      ChapterSegmentEditionUID (unsigned integer, valid range: 1 <= value)
+      ChapterPhysicalEquiv (unsigned integer)
+      ChapterTrack (master)
+        ChapterTrackNumber (unsigned integer, valid range: 1 <= value)
+      ChapterDisplay (master)
+        ChapterString (UTF-8 string)
+        ChapterLanguage (UTF-8 string)
+        ChapterCountry (UTF-8 string)
+      ChapterProcess (master)
+        ChapterProcessCodecID (unsigned integer)
+        ChapterProcessPrivate (binary)
+        ChapterProcessCommand (master)
+          ChapterProcessTime (unsigned integer)
+          ChapterProcessData (binary)
+ + +

13.3. Читання глав з дисків Blu-ray

+ + + +

+ mkvmerge(1) може читати глави з незашифрованих дисків Blu-ray. Для цього ви + можете використовувати шлях до одного зі списків відтворення MPLS з + параметром --chapters. + +

+ + +

+ Приклад: --chapters + /srv/blurays/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. Читання глав з дисків DVD

+ + + +

+ Коли MKVToolNix компілюється з бібліотекою + libdvdread(tm), mkvmerge(1) може читати глави з + DVD-дисків. Для цього ви можете використовувати шлях до однієї з папок або + файлів на DVD з параметром --chapters. Оскільки + DVD-диски можуть містити більше одного заголовка, а кожен заголовок має + власний набір глав, ви можете додати двокрапку та потрібний номер назви в + кінець аргументу імені файлу. Номер назви за замовчуванням дорівнює 1. + +

+ + +

+ Приклад: --generate-chapters interval:45s + +

+ + + +

13.5. Загальні примітки

+ + +

+ Під час розділення файлів mkvmerge(1) також правильно коригує глави. Це + означає, що кожен файл містить лише записи глав, які до нього стосуються, і + що мітки часу будуть зміщені відповідно до нових міток часу кожного + вихідного файлу. + +

+ + +

+ mkvmerge(1) може копіювати глави з вхідних файлів Matroska(tm), якщо це явно не + вимкнено за допомогою параметра --no-chapters. + Глави з усіх джерел (файли Matroska(tm), файли Ogg, файли + MP4, текстові файли глав) зазвичай не об’єднуються, а + виходять в окремі ChapterEditions. Тільки якщо глави + читаються з кількох Matroska(tm) або XML файлів, які мають однакові + ідентифікатори UID видання, будуть об’єднані в єдиний + ChapterEdition. Якщо таке об'єднання є бажаним і в + інших ситуаціях, користувач спочатку повинен витягти глави з усіх джерел за + допомогою mkvextract(1) потім вручну об’єднати файли XML, а потім + мультиплексувати їх. + +

+ + +

14. Теги

+ + + +

14.1. Вступ

+ + + +

+ Система тегів Matroska(tm) подібна до системи інших контейнерів: набір пар + KEY=VALUE. Однак у Matroska(tm) ці теги також можуть + бути вкладеними, і як KEY, так і + VALUE є власними елементами. Приклад файлу + example-tags-2.xml показує, як використовувати цю + систему. + +

+ + + +

14.2. Область застосування тегів

+ + + +

+ Теги Matroska(tm) не застосовуються автоматично до всього файлу. Вони це + можуть, але вони також можуть застосовуватися до різних частин файлу: до + однієї чи кількох доріжок, до одного чи кількох глав або навіть до + комбінації обох. Специфікація + Matroska містить більш детальну інформацію про цей факт. + +

+ + +

+ Одним із важливих фактів є те, що теги зв’язуються з доріжками або главами + за допомогою елемент тега Targets Matroska(tm) і що, + UID-и, які використовуються для цього зв’язування, не є ідентифікаторами + доріжок, які mkvmerge(1) використовує всюди. Замість номерів використовуються + UID, які mkvmerge(1) обчислює автоматично (якщо доріжка взята з формату + файлу, відмінного від Matroska(tm)) або які копіюються з вхідного файлу, якщо + вхідний файл доріжки є файлом Matroska(tm). Тому важко знати, які UID + використовувати у файлі тегів, перш ніж файл буде передано до mkvmerge(1). + +

+ + +

+ mkvmerge(1) знає два варіанти, за допомогою яких ви можете додати теги до + файлів Matroska(tm): параметри --global-tags + і --tags. Різниця + полягає в тому, що перший параметр, --global-tags, + змусить теги застосовуватися до всього файлу, видаливши будь-який із + згаданих вище елементів Targets. Другий параметр, + --tags, + автоматично вставляє UID, який mkvmerge(1) генерує для тегу, зазначеного за + допомогою частини TID параметра --tags. + +

+ + + +

14.3. Приклад

+ + +

+ Скажімо, ви хочете додати теги до відеодоріжки, прочитаної з файлу + AVI. mkvmerge --identify file.avi + повідомляє, що ID відеодоріжки (не плутайте цей ідентифікатор з UID!) + дорівнює 0. Отже, ви створюєте файл тегів залишаючи всі елементи + Targets та виконуєте mkvmerge(1): + +

+ +
$ mkvmerge -o file.mkv --tags 0:tags.xml file.avi
+ + +

14.4. Формат файлу тегів

+ + +

+ mkvmerge(1) підтримує формат файлу тегу на основі XML. Формат дуже точно + змодельований за специфікацією + Matroska. Як двійковий, так і вхідний дистрибутив MKVToolNix + постачаються зі зразком файлу під назвою + example-tags-2.xml, який просто перераховує всі відомі + теги і який можна використовувати як основу для реальних файлів тегів. + +

+ + +

+ Основи: + +

+ + +
    + +
  • +

    Самий зовнішній елемент повинен бути <Тегі>. +

    +
  • + +
  • + +

    Один логічний тег міститься в одній парі <Тег> + тегів XML. +

    + +
  • + +
  • +

    Пробіли безпосередньо до і після вмісту тегу ігноруються.

    +
  • + +
+ + + +

14.5. Типи даних

+ + +

+ Нова система тегів Matroska(tm) знає лише два типи даних: рядок UTF-8 і + двійковий тип. Перший використовується для імені тегу та елемента + <String>, а двійковий тип використовується для + елемента <Binary>. + +

+ + +

+ Оскільки двійкові дані самі по собі не вписуються в файл XML mkvmerge(1) + підтримує два інші методи зберігання двійкових даних. Якщо вміст тегу XML + починається з '@', тоді наступний текст розглядається як + ім'я файлу. Вміст відповідного файлу копіюється в елемент Matroska(tm). + +

+ + +

+ В іншому випадку очікується, що дані будуть закодовані Base64. Це кодування, + яке перетворює двійкові дані в обмежений набір символів + ASCII і використовується, наприклад, в програмах + електронної пошти. mkvextract(1) виведе дані, закодовані Base64 для двійкових + елементів. + +

+ + +

+ Застаріла система тегів знає ще деякі типи даних, які можна знайти в + офіційній специфікації тегів Matroska(tm). Оскільки mkvmerge(1) більше не + підтримує цю систему, ці типи тут не описані. + +

+ + + +

14.6. Відомі теги для формату файлів XML

+ + + +

+ Нижче перелічено підтримувані теги XML, їх типи даних і, за необхідності, + дійсний діапазон їх значень: + +

+ +
Tags (master)
+  Tag (master)
+    Targets (master)
+      TargetTypeValue (unsigned integer)
+      TargetType (UTF-8 string)
+      TrackUID (unsigned integer)
+      EditionUID (unsigned integer)
+      ChapterUID (unsigned integer)
+      AttachmentUID (unsigned integer)
+    Simple (master)
+      Simple (master)
+      Name (UTF-8 string)
+      TagLanguage (UTF-8 string)
+      DefaultLanguage (unsigned integer)
+      String (UTF-8 string)
+      Binary (binary)
+ +

15. Інформація про сегменти

+ + + +

+ За допомогою XML файлу інформації сегмента можна встановити певні значення в + полі заголовка "інформація про сегмент" файлу Matroska(tm). Усі ці + значення неможливо встановити за допомогою інших параметрів командного + рядка. + +

+ + +

+ Інші поля заголовка "інформації про сегменти" можна встановити за + допомогою параметрів командного рядка, але не за допомогою файлу XML. Це + включає, наприклад параметри --title і --timestamp-scale. + +

+ + +

+ Існують інші елементи, які не можна встановити ні за допомогою параметрів + командного рядка, ні за допомогою файлів XML. До них належать такі елементи: + DateUTC (також відомий як "дата + мультиплексування"), MuxingApp, + WritingApp та Duration. Вони завжди + встановлюються mkvmerge(1) самостійно. + +

+ + +

+ Нижче перелічено підтримувані теги XML, їх типи даних і, за необхідності, + дійсний діапазон їх значень: + +

+ +
Info (master)
+  SegmentUID (binary, valid range: length in bytes == 16)
+  SegmentFilename (UTF-8 string)
+  PreviousSegmentUID (binary, valid range: length in bytes == 16)
+  PreviousSegmentFilename (UTF-8 string)
+  NextSegmentUID (binary, valid range: length in bytes == 16)
+  NextSegmentFilename (UTF-8 string)
+  SegmentFamily (binary, valid range: length in bytes == 16)
+  ChapterTranslate (master)
+    ChapterTranslateEditionUID (unsigned integer)
+    ChapterTranslateCodec (unsigned integer)
+    ChapterTranslateID (binary)
+

16. Макет файлу Matroska

+ + +

+ Макет файлів Matroska(tm) досить гнучкий. mkvmerge(1) відтворить файл у наперед + визначений спосіб. Отриманий файл виглядає так: + +

+ + +

+ [EBML head] [segment {meta seek #1} [segment information] [track + information] {attachments} {chapters} [cluster 1] {cluster 2} ... {cluster + n} {cues} {meta seek #2} {tags}] + +

+ + +

+ Елементи в фігурних дужках є необов’язковими і залежать від вмісту та + параметрів, що використовуються. Пара приміток: + +

+ + +
    + +
  • + +

    + мета пошук №1 включає лише невелику кількість елементів рівня 1, і тільки + якщо вони дійсно існують: вкладення, глави, списки cue, теги, мета пошук + №2. Старіші версії mkvmerge(1) також використовується для розміщення + кластерів у цьому мета-елементі пошуку. Тому довелося дещо неточні здогади, + щоб зарезервувати достатньо місця. Це часто зазнавало невдач. Тепер тільки + кластери зберігаються в мета пошуку №2, а мета пошуку №1 відноситься до мета + пошуку №2. + +

    + +
  • + + +
  • + +

    Елементи вкладень, глав і тегів присутні лише в тому випадку, якщо вони були + додані. +

    + +
  • + +
+ + +

+ Найкоротший можливий файл Matroska(tm) буде виглядати так: + +

+ + +

+ [EBML head] [segment [segment information] [track information] [cluster 1]] + +

+ + +

+ Це може бути у випадку з аудіо файлами. + +

+ +

17. Зовнішні файли міток часу

+ + +

+ mkvmerge(1) дозволяє користувачеві самостійно вибирати мітки часу для певної + доріжки. Це можна використовувати для створення файлів із змінною частотою + кадрів або для включення тиши у аудіо. У цьому випадку кадр є елементом, + який mkvmerge(1) створює окремо для блока Matroska(tm). Для відео це рівно один + кадр, для аудіо це один пакет певного типу аудіо. наприклад для + AC-3 це буде пакет, що містить 1536 + семплів. + +

+ + +

+ Файли міток часу, які використовуються, коли доріжки додаються одна до + одної, необхідно вказувати лише для першої частини ланцюжка + доріжок. Наприклад, якщо ви додаєте два файли, v1.avi та v2.avi, і хочете + використовувати позначки часу, ваш командний рядок має виглядати приблизно + так: + +

+ +
$ mkvmerge ... --timestamps 0:my_timestamps.txt v1.avi +v2.avi
+ +

+ Є чотири формати, які розпізнає mkvmerge(1). Перший рядок завжди містить + номер версії. Порожні рядки, рядки, що містять лише пробіли, і рядки, що + починаються з '#', ігноруються. + +

+ + +

17.1. Формат файлу мітки часу версії 1

+ + +

+ Цей формат починається з рядка версії. Другий рядок оголошує кількість + кадрів за секунду за замовчуванням. Усі наступні рядки містять три числа, + розділені комами: початковий кадр (0 — перший кадр), + кінцевий кадр і кількість кадрів у цьому діапазоні. FPS — + це число з плаваючою комою з крапкою '.' як десятковою + комою. Діапазони можуть містити розриви, для яких використовується + стандартне значення FPS. Наприклад: + +

+ +
# Формат мітки часу версії 1
+assume 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. Формат файлу мітки часу версії 2

+ + + +

+ У цьому форматі кожен рядок містить мітку часу для відповідного кадру. Ця + мітка часу має бути вказана з точністю до мілісекунд. Це може бути число з + плаваючою комою, але це не обов’язково. Ви повинні + надати принаймні стільки рядків міток часу, скільки кадрів у доріжці. Мітки + часу в цьому файлі повинні бути відсортовані. Приклад для 25 кадрів в + секунду: + +

+ +
# timestamp format v2
+0
+40
+80
+ + +

17.3. Формат файлу мітки часу версії 3

+ + +

+ У цьому форматі кожен рядок містить тривалість у секундах, за якою слідує + необов’язкова кількість кадрів в секунду. Обидва можуть бути числами з + плаваючою комою. Якщо кількість кадрів в секунду відсутня, використовується + значення за замовчуванням. Для аудіо ви повинні дозволити кодеку самостійно + обчислити мітки часу кадру. Для цього ви повинні використовувати + 0,0 як кількість кадрів в секунду. Ви також можете + створити розриви в потоці, використовуючи ключове слово + 'gap', за яким слідує тривалість розриву. Приклад + аудіофайлу: + +

+ +
# timestamp format v3
+assume 0.0
+25.325
+7.530,38.236
+gap, 10.050
+2.000,38.236
+ + +

17.4. Формат файлу мітки часу версії 4

+ + +

+ Цей формат ідентичний формату v2. Єдина відмінність полягає в тому, що мітки + часу не потрібно сортувати. Цей формат майже ніколи не слід використовувати. + +

+ + +

18. Коди завершення

+ + + +

+ mkvmerge(1) завершає роботу з одним з трьох кодів виходу: + +

+ + +
    + +
  • + +

    + 0 -- Цей код виходу означає, що мультиплексування + успішно завершено. + +

    + +
  • + + +
  • + +

    + 1 -- В цьому випадку mkvmerge(1) було видано хоча б одне + попередження, проте муксінг продовжувався. Попередженню передує текст + 'Warning:'. В залежності від помилок, що сталися, + результуючі файли можуть бути або цілими, або пошкодженими. Користувачу + рекомендується як звернути увагу на саме попередження, так і перевірити + результуючі файли. + +

    + +
  • + + +
  • + +

    + 2 -- Цей код виходу використовується після того, як + сталася помилка. mkvmerge(1) переривається відразу після виведення + повідомлення про помилку. Повідомлення про помилки варіюються від + неправильних аргументів командного рядка через помилки читання/запису до + зламаних файлів. + +

    + +
  • + +
+ +

19. Змінні середовища

+ + + +

+ mkvmerge(1) використовує змінні за замовчуванням, які визначають локаль + системи (наприклад, LANG і сімейство + LC_*). Додаткові змінні: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG і їх + коротка форма MTX_DEBUG + +

Вміст розглядається так, ніби його було передано за допомогою параметра + --debug. +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE і + їх коротка форма MTX_ENGAGE + +

Вміст розглядається так, ніби його було передано за допомогою параметра + --engage. +

+ +
+ +

20. Дивіться також

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. WWW

+ + +

+ Остання версія завжди може бути знайдена на веб-сторінці MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..0568a15f6266fedcc6e7ef8ad2c7070d9cee1e54 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvpropedit.html @@ -0,0 +1,1315 @@ + + + + + mkvpropedit -- Змінити властивості існуючих файлів Matroska без повного перезбирання + + + +
mkvpropedit -- Змінити властивості існуючих файлів Matroska(tm) без повного перезбирання +
+
+ +
+

1. Короткий опис

+ + +
mkvpropedit options {source-filename} {actions} +
+ +

2. Опис

+ + +

+ Ця програма аналізує існуючий файл Matroska(tm) і змінює деякі його + властивості. Потім він записує ці зміни в існуючий файл. Серед властивостей, + які можна змінити, є елементи інформації про сегменти (наприклад, назва) і + заголовки доріжок (наприклад, код мови, прапор «доріжка за замовчуванням» + або назва). + +

+ + +

+ Налаштування: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ Перелічує всі відомі і редаговані імена властивостей, їх тип (рядок, ціле + число, логічне значення тощо) і короткий опис. Після цього програма + завершується. Тому параметр source-filename не + потрібно вказувати. + +

+ +
-p, --parse-mode + mode + +

+ Встановлює режим розбору. Параметр 'режим' може бути + 'швидким' (який також є за замовчуванням) або + 'повним'. 'Швидкий' режим не аналізує + весь файл, а використовує мета-елементи пошуку для пошуку необхідних + елементів вихідного файлу. У 99% випадків цього достатньо. Але для файлів, + які не містять елементів мета пошуку або пошкоджених, користувачеві + доведеться встановити 'повний' режим аналізу. Повне + сканування файлу може зайняти кілька хвилин, а швидке — лише секунди. + +

+ +
+ + +

+ Дії, які впливають на інформаційні властивості доріжки та сегменту: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit selector + +

+ Встановлює розділ файлу Matroska(tm) (інформацію про сегмент або заголовки + певної доріжки), з яким діють усі наступні дії add, set та delete. Цей параметр можна + використовувати кілька разів, щоб внести зміни до кількох елементів. + +

+ + +

+ За замовчуванням mkvpropedit(1) відредагує розділ інформації про сегмент. + +

+ + +

+ Дивіться розділ про редагування + селекторів для повного опису синтаксу. + +

+ +
-a, --add + name=value + +

+ Додає властивість name зі значенням + value. Властивість буде додано, навіть якщо така + властивість вже існує. Зауважте, що більшість властивостей унікальні і не + можуть зустрічатися більше одного разу. + +

+ +
-s, --set + name=value + +

+ Встановлює для всіх входжень властивості name + значення value. Якщо такої властивості немає, вона + буде додана. + +

+ +
-d, --delete name + +

+ Видаляє всі входження властивості name. Зауважте, що + деякі властивості є обов’язковими і не можуть бути видалені. + +

+ +
+ + +

+ Дії, які впливають на теги та глави: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags + selector:filename + +

+ Додає або заміняє теги у файлі на теги з filename або + видаляє їх, якщо filename порожній. mkvpropedit(1) читає + ті самі формати тегів XML, які читає mkvmerge(1). + +

+ + +

+ selector має бути одним із слів + all, global або + track. Для all mkvpropedit(1) + замінить або видалить усі теги у файлі. З global тільки + глобальні теги будуть замінені або видалені. + +

+ + +

+ З доріжкою mkvpropedit(1) замінить теги для певної + доріжки. Крім того, теги, прочитані з filename, будуть + призначені до тієї ж доріжки. Доріжка вказується так само, як вказуються + селектори редагування + (див. нижче), напр. --tags track:a1:new-audio-tags.xml. + +

+ +
--add-track-statistics-tags + +

+ Обчислює статистику для всіх доріжок у файлі та додає для них нові теги + статистики. Якщо файл уже містить такі теги, вони будуть оновлені. + +

+ +
--delete-track-statistics-tags + +

+ Видаляє всі наявні теги статистики доріжки з файлу. Якщо файл не містить + тегів статистики відстеження, він не буде змінено. + +

+ +
-c, --chapters + filename + +

+ Додає або замінює глави у файлі такими з filename або + видаляє їх, якщо filename порожній. mkvpropedit(1) читає + ті самі XML і простий формати глав, які читає mkvmerge(1). + +

+ +
+ + +

+ Дії для обробки вкладень: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment filename + +

+ Додати нове вкладення з filename. + +

+ + +

+ Якщо параметр --attachment-name використовувався до цього + параметра, його значення використовується як ім'я нового вкладення. Інакше + він є похідним від filename. + +

+ + +

+ Якщо параметр --attachment-mime-type використовувався до + цього параметра, його значення використовується як тип MIME нового + вкладення. Інакше це автоматично виявляється зі змісту + filename. + +

+ + +

+ Якщо параметр --attachment-description використовувався до + цього параметра, його значення ввикористовується як опис нового + вкладення. Інакше опис не встановлюється. + +

+ + +

+ Якщо параметр --attachment-uid використовувався до цього + параметра, його значення використовується як UID нового вкладення. Інакше + рандомний UID буде згенеровано автоматично. + +

+ +
--replace-attachment + selector:filename + +

+ Замінює одне або кілька вкладень, які відповідають + selector на файл + filename. Якщо більше одного наявного вкладення + відповідає selector, то весь їх вміст буде замінено + вмістом filename. + +

+ + +

+ selector може мати одну з чотирьох форм. Вони + пояснюються нижче в розділі Селектор вкладень. + +

+ + +

+ Якщо параметр --attachment-name використовувався до цього + параметра, його значення встановлюється як нове ім'я для кожного зміненого + вкладення. Інакше імена не змінюються. + +

+ + +

+ Якщо параметр --attachment-mime-type використовувався до + цього параметра, його значення встановлюється як новий тип MIME для кожного + зміненого вкладення. Інакше тип MIME не змінюється. + +

+ + +

+ Якщо параметр --attachment-description використовувався до + цього параметра, його значення встановлюється як новий опис для кожного + зміненого вкладення. Інакше опис не змінюється. + +

+ + +

+ Якщо параметр --attachment-uid використовувався до цього + параметра, його значення встановлюється як новий UID для кожного зміненого + вкладення. Інакше UID не змінюються. + +

+ +
--update-attachment selector + +

+ Встановлює властивості одного або кількох вкладень, які відповідають + selector. Якщо більше одного наявного вкладення + відповідає selector, усі їхні властивості будуть + оновлені. + +

+ + +

+ selector може мати одну з чотирьох форм. Вони + пояснюються нижче в розділі Селектор вкладень. + +

+ + +

+ Якщо параметр --attachment-name використовувався до цього + параметра, його значення встановлюється як нове ім'я для кожного зміненого + вкладення. Інакше імена не змінюються. + +

+ + +

+ Якщо параметр --attachment-mime-type використовувався до + цього параметра, його значення встановлюється як новий тип MIME для кожного + зміненого вкладення. Інакше тип MIME не змінюється. + +

+ + +

+ Якщо параметр --attachment-description використовувався до + цього параметра, його значення встановлюється як новий опис для кожного + зміненого вкладення. Інакше опис не змінюється. + +

+ + +

+ Якщо параметр --attachment-uid використовувався до цього + параметра, його значення встановлюється як новий UID для кожного зміненого + вкладення. Інакше UID не змінюються. + +

+ +
--delete-attachment selector + +

+ Видаляє одне або кілька вкладень, які відповідають + селектору. + +

+ + +

+ selector може мати одну з чотирьох форм. Вони + пояснюються нижче в розділі Селектор вкладень. + +

+ +
+ + +

+ Параметри дій з вкладенням: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name name + +

+ Встановлює назву для наступної операції --add-attachment + або --replace-attachment. + +

+ +
--attachment-mime-type mime-type + +

+ Встановлює тип MIME для використання для наступної операції + --add-attachment або --replace-attachment + . + +

+ +
--attachment-description description + +

+ Встановлює опис для наступної операції --add-attachment або + --replace-attachment. + +

+ +
--enable-legacy-font-mime-types + +

+ Дозволяє використовувати застарілі типи MIME для певних + типів вкладень шрифтів. Наприклад, + 'application/x-truetype-font' використовуватиметься для + шрифтів TrueType замість 'fonts/ttf'. + +

+ + +

+ Це впливає як на додавання нових вкладень, так і на заміну наявних вкладень, + але лише якщо новий тип MIME не вказано. Інші наявні + вкладення не змінюються. + +

+ + +

+ Типи MIME, що піддаються впливу, це + 'font/sfnt', 'font/ttf' та + 'font/collection', які всі зіставлені з + 'application/x-truetype-fonts' і + 'font/otf', який зіставляється з + 'application/vnd .ms-opentype'. + +

+ +
+ + +

+ Інші параметри: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ Зазвичай, коли користувач запитує зміни до властивості заголовка доріжки + 'language', mkvpropedit(1) застосує ту саму зміну до + нового елемента заголовка доріжки LanguageIETF на + додаток до застарілого елемента Language. Якщо + використовується цей параметр, зміна буде застосована лише до застарілого + елемента Language. + +

+ + +

+ Цей параметр не впливає на зміни, запитувані через властивість + 'language-ietf' заголовка доріжки. + +

+ +
--normalize-language-ietf mode + +

+ Дозволяє нормалізувати всі мовні теги IETF BCP 47 до їхньої канонічної форми + з режимом 'canonical', до форми розширених мовних + підтегів за допомогою режиму 'extlang' або вимикає його в + режимі 'off'. За замовчуванням застосовується + нормалізація до канонічної форми. + +

+ + +

+ У канонічній формі всі підтеги, для яких існують бажані значення, + замінюються цими бажаними значеннями. Це перетворює, наприклад, + 'zh-yue-jyutping' до 'yue-jyutping' + або 'fr-FX' до 'fr-FR'. + +

+ + +

+ Для форми розширених мовних підтегів спочатку будується канонічна + форма. Після цього всі основні мови, для яких існує розширений мовний + підтег, замінюються цим розширеним мовним підтегом та його префіксом. Це + перетворює, наприклад, 'yue-jyutping' повертається до + 'zh-yue-jyutping', але не впливає на + 'fr-FR', оскільки 'fr' не є розширеним + мовним підтегом. + +

+ + +

+ Ця нормалізація застосовується лише до елементів, які фактично змінені: + +

+ + +
    + +
  • + +

    + Під час редагування заголовків доріжок піддаються впливу лише ті елементи + мови доріжки, які встановлені за допомогою специфікацій редагування. Мови + доріжок, які не редагуються, не змінюються. Редагування доріжки, але + встановлення лише властивостей, крім мови, також не вплине на мову. + +

    + +
  • + + +
  • + +

    + Під час редагування глав піддаються впливу всі мовні елементи всіх елементів + глави, оскільки існуючі глави завжди замінюються повністю. + +

    + +
  • + + +
  • + +

    + Під час редагування тегів піддаються впливу лише ті мовні елементи тегів, + які фактично замінені. Наприклад, заміна глобальних тегів не впливає на + наявні теги доріжок. + +

    + +
  • + +
+ + +

+ Найкращий спосіб нормалізувати всі наявні мовні теги у файлі - це зробити + його ремукс за допомогою mkvmerge(1) і встановити його параметр + '--normalize-language-ietf' у потрібний режим. + +

+ +
--command-line-charset character-set + +

+ Встановлює набір символів заданого в командному рядку для + конвертації. Типово використовується набір символів згідно поточної локалі + системи. + +

+ +
--output-charset character-set + +

+ Встановлює вихідний набір символів заданого в командному рядку для + конвертації. Типово використовується набір символів згідно поточної локалі + системи. + +

+ +
-r, --redirect-output + file-name + +

+ Записує всі повідомлення у файл file-name, замість + консолі. Хоча це можна легко зробити за допомогою переспрямування виводу, є + випадки, коли цей параметр потрібний: коли термінал повторно інтерпретує + вихід перед записом його у файл. Набір символів встанвлений з --output-charset + враховується. + +

+ +
--ui-language code + +

+ Використовується примусовий переклад для мови code + (наприклад, 'de_DE' для німецького перекладу). Після + введення list' як code програма + відобразить список доступних перекладів. + +

+ +
--abort-on-warnings + +

+ Повідомляє програмі припинити роботу після першого попередження. Код виходу + з програми буде 1. + +

+ +
--debug topic + +

+ Увімкнути налагодження для певної функції. Цей параметр корисний лише для + розробників. + +

+ +
--engage feature + +

+ Вмикає експериментальні функції. Список доступних функцій можна запросити за + допомогою mkvpropedit --engage list. Ці функції не + призначені для використання в звичайних ситуаціях. + +

+ +
--gui-mode + +

+ Вмикає режим графічного інтерфейсу. У цьому режимі можуть бути виведені + спеціально відформатовані рядки, які можуть повідомляти керуючому графічному + інтерфейсу, що відбувається. Ці повідомлення мають формат + '#GUI#message'. За повідомленням можуть слідувати пари + ключ/значення, як у + '#GUI#message#key1=value1#key2=value2…'. Ані + повідомлення, ані ключі ніколи не перекладаються і завжди виводяться + англійською. + +

+ +
-v, --verbose + +

+ Задає відображення розширеної інформації про важливі елементи Matroska(tm). + +

+ +
-h, --help + +

+ Відображається інформація про використання додатку і відбувається завершення + роботи додатку. + +

+ +
-V, --version + +

+ Відображається інформація про версію додатку і відбувається завершення + роботи додатку. + +

+ +
@options-file.json + +

+ Читає додаткові аргументи командного рядка з файлу + options-file. Повне пояснення про підтримувані + формати для таких файлів див. розділ "Файли параметрів" у посібнику + користувача mkvmerge(1). + +

+ +
+ +

3. Селектори редагування

+ + +

+ Параметр --edit + встановлює розділ файлу Matroska(tm) (інформація про сегмент або заголовки + певної доріжки), з яким діють усі наступні дії add, set та delete. Це залишається + дійсним, доки не буде знайдено наступний параметр --edit. + Аргумент цього параметра називається селектором редагування. + +

+ + +

+ За замовчуванням mkvpropedit(1) відредагує розділ інформації про сегмент. + +

+ + +

3.1. Інформація про сегменти

+ + +

+ Інформацію про сегмент можна вибрати одним із трьох слів: + 'info', 'segment_info' або + 'segmentinfo'. Він містить такі властивості, як заголовок + сегмента або UID сегмента. + +

+ + + +

3.2. Заголовки доріжки

+ + +

+ Заголовки доріжок можна вибрати за допомогою дещо складнішого селектора. Усі + варіанти починаються з 'track:'. Властивості заголовка + доріжки включають такі елементи, як код мови, прапоруць 'доріжка за + замовчуванням' або назва доріжки. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ Якщо параметр n є числом, то буде вибрано + n-на доріжка. Порядок доріжок такий самий, як і + параметр --identify виводу mkvmerge(1). + +

+ + +

+ Нумерування починається з 1. + +

+ +
track:tn + +

+ Якщо параметр починається з одного символу t, за яким + слідує n, то буде вибрано n-на + доріжка певного типу доріжок. Параметр типу доріжки t + має бути одним із чотирьох символів: 'a' для звукової + доріжки, 'b' для доріжки кнопки, 's' + для доріжки субтитрів і 'v' для відеодоріжки. Порядок + відстеження такий самий, як і параметр --identify виводу + mkvmerge(1). + +

+ + +

+ Нумерування починається з 1. + +

+ +
track:=uid + +

+ Якщо параметр починається з '=', за яким слідує число + uid, буде обрано доріжку, елемент доріжки + UID якої дорівнює заданому + uid. Доріжки UID можна отримати за + допомогою mkvinfo(1). + +

+ +
track:@number + +

+ Якщо параметр починається з '@', за яким слідує число + number, буде вибрано доріжку, елемент якої доріжки + дорівнює цьому number. Номери доріжок можна отримати + за допомогою mkvinfo(1). + +

+ +
+ + + +

3.3. Примітки

+ + +

+ Через природу селекторів редагування доріжок можливо, що кілька селекторів + дійсно відповідають одному і тому заголовку доріжки. У таких випадках усі + дії для цих селекторів редагування будуть об’єднані та виконані в тому + порядку, у якому вони вказані в командному рядку. + +

+ + +

4. Селектори вкладеннь

+ + + +

+ Селектор вкладень використовується з двома діями: --replace-attachment + і --delete-attachment. + Він може мати одну з наступних чотирьох форм: + +

+ + +
    + +
  1. + +

    + Вибір за ідентифікатором вкладення. У цій формі селектор — це просто число, + ідентифікатор вкладення, який виводить команда ідентифікації mkvmerge(1). + +

    + +
  2. + + +
  3. + +

    + Вибір за UID вкладення (унікальний ідентифікатор). У цій формі селектором є + знак рівності =, що слідує за номером, унікальний + ідентифікатор вкладення, який виводить команда детальної ідентифікації + mkvmerge(1). + +

    + +
  4. + + +
  5. + +

    + Вибір за назвою вкладення. У цій формі селектором є буквене слово + name:, за яким слідує ім’я наявного вкладення. Якщо цей + селектор використовується з --replace-attachment, то + двокрапки в назві для відповідності мають екрануватися за допомогою + \c. + +

    + +
  6. + + +
  7. + +

    + Вибір за типом MIME. У цій формі селектором є буквене слово + mime-type:, за яким слід MIME-тип існуючого + вкладення. Якщо цей селектор використовується з + --replace-attachment, то двокрапки в типі MIME для + відповідності мають екрануватися за допомогою \c. + +

    + +
  8. + +
+ +

5. Language handling

+ + + +

+ mkvpropedit(1) mostly tries to do the right thing by default. Therefore + changes to the language property will cause mkvpropedit(1) + to apply the same change to both the new "LanguageIETF" element as well as + the old "Language" element similar to how mkvmerge(1) applies the language to + both elements. For example, when using mkvpropedit movie.mkv --edit + track:2 --set language=zh-TW the "LanguageIETF" element will be + set to zh-TW and the old "Language" element to + chi. + +

+ + +

+ Additionally there's a new track header property named + language-ietf that can be set or removed. Changes to this + property only apply to the new "LanguageIETF" track header element. A caveat + is that the old "Language" track header element is a mandatory element in + Matroska — meaning even if it isn't present in the file it still has an + implied value. When the user only sets the language-ietf + property but not the language property, mkvpropedit(1) will + therefore add the old "Language" element in certain cases & set it to + und (meaning "undetermined") as the user didn't specify a + value for it. + +

+ + +

When reading XML chapter or tag files mkvpropedit(1) works like mkvmerge(1) + does. +

+ + +

The creation of the new elements can be disabled completely with the + command-line option `--disable-language-ietf` which operates on all three + new elements. +

+ + +

You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. +

+ +

6. Приклади

+ + +

+ Наступний приклад редагує файл під назвою + 'movie.mkv'. Він встановлює назву сегмента та змінює код + мови аудіо та доріжки субтитрів. Зауважте, що цей приклад можна скоротити, + виключивши перший параметр --edit, + оскільки редагування елемента інформації про сегмент є за замовчуванням для + всіх параметрів, знайдених перед першим параметром --edit. + +

+ +
$ mkvpropedit movie.mkv --edit info --set "title=The movie" --edit track:a1 --set language=fre --edit track:a2 --set language=ita
+ +

+ Другий приклад видаляє «прапор доріжка за замовчуванням» з першої доріжки + субтитрів і встановлює його для другої. Зауважте, що mkvpropedit(1), на + відміну від mkvmerge(1), не встановлює «прапор доріжка за замовчуванням» для + інших доріжок на «0», якщо для деякої доріжки автоматично встановлено + значення «1». + +

+ +
$ mkvpropedit movie.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ Заміна тегів для другої доріжки субтитрів у файлі виглядає так: + +

+ +
$ mkvpropedit movie.mkv --tags track:s2:new-subtitle-tags.xml
+ +

+ Щоб видалити всі теги, потрібно залишити ім’я файлу: + +

+ +
$ mkvpropedit movie.mkv --tags all:
+ +

+ Заміна глав у файлі виглядає так: + +

+ +
$ mkvpropedit movie.mkv --chapters new-chapters.xml
+ +

+ Щоб видалити всі глави, потрібно залишити ім’я файлу: + +

+ +
$ mkvpropedit movie.mkv --chapters ''
+ +

+ Додавання файла шрифта (Arial.ttf) у якості вкладення: + +

+ +
$ mkvpropedit movie.mkv --add-attachment Arial.ttf
+ +

+ Додавання файла шрифта (89719823.ttf) у якості вкладення + і надання деякої інформації, оскільки це насправді просто Arial: + +

+ +
$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'The Arial font as a TrueType font' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ Заміна одного файла шрифту вкладення (Comic.ttf) іншим + (Arial.ttf): + +

+ +
$ mkvpropedit movie.mkv --attachment-name Arial.ttf --attachment-description 'The Arial font as a TrueType font' --replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ Видалення другого вкладеного файлу, яким би він не був: + +

+ +
$ mkvpropedit movie.mkv --delete-attachment 2
+ +

+ Видалення всіх вкладених шрифтів за типом MIME: + +

+ +
$ mkvpropedit movie.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. Коди завершення

+ + + +

+ mkvpropedit; завершає роботу з одним з трьох кодів виходу: + +

+ + +
    + +
  • + +

    + 0 -- Цей код виходу означає, що модифікація успішно + завершена. + +

    + +
  • + + +
  • + +

    + 1 -- В цьому випадку mkvpropedit(1) було видано хоча б + одне попередження, проте витягування продовжувалось. Попередженню передує + текст 'Warning:'. В залежності від помилок, що сталися, + результуючі файли можуть бути або цілими, або пошкодженими. Користувачу + рекомендується як звернути увагу на саме попередження, так і перевірити + результуючі файли. + +

    + +
  • + + +
  • + +

    + 2 -- Цей код виходу використовується після того, як + сталася помилка. mkvpropedit(1) переривається відразу після виведення + повідомлення про помилку. Повідомлення про помилки варіюються від + неправильних аргументів командного рядка через помилки читання/запису до + зламаних файлів. + +

    + +
  • + +
+ +

8. Текстові файли та перетворення набору символів

+ + + +

+ Для детального ознайомлення з тим, як усі інструменти в пакеті MKVToolNix + виконують перетворення набору символів, кодування введення/виводу, кодування + командного рядка та консольне кодування, будь ласка, перегляньте розділ з + ідентичною назвою в посібнику користувача mkvmerge(1) + +

+ +

9. Змінні середовища

+ + + +

+ mkvpropedit(1) використовує змінні за замовчуванням, які визначають локаль + системи (сімейства типу LANG і + LC_*). Додаткові змінні: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG і + їх коротка форма MTX_DEBUG + +

Вміст розглядається так, ніби його було передано за допомогою параметра + --debug. +

+ +
MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE + і їх коротка форма MTX_ENGAGE + +

Вміст розглядається так, ніби його було передано за допомогою параметра + --engage. +

+ +
+ +

10. Дивіться також

+ + +

+ mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1) + +

+ +

11. WWW

+ + +

+ Остання версія завжди може бути знайдена на веб-сторінці MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..e65657a922d7e3725e4a815b96641d03da14682d --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/uk/mkvtoolnix-gui.html @@ -0,0 +1,163 @@ + + + + + mkvtoolnix-gui -- графічний інтерфейс для mkvmerge1 включаючи редактор глав і заголовків + + + +
mkvtoolnix-gui -- графічний інтерфейс для mkvmerge(1) включаючи редактор глав і заголовків +
+
+ +
+

1. Короткий опис

+ + +
mkvtoolnix-gui [[configuration-file-name.mtxcfg] | [source-file.ext] | [matroska-file.mkv] | [chapter-file.ext] | [matroska-file.mkv]] +
+ +

2. Опис

+ + +

+ mkvtoolnix-gui(1) є GUI на основі + Qt(tm) для mkvmerge(1). Він також реалізує функції + mkvinfo(1) і mkvpropedit(1) і буде розвиватися, щоб охопити mkvextract(1) + також. Усі налаштування (наприклад, вхідні файли, параметри доріжки тощо) + можна зберегти та відновити. + +

+ + +

+ Перерахування імен файлів конфігурації з розширенням + .mtxcfg змушує графічний інтерфейс завантажувати ці файли + конфігурації у відповідний інструмент. Будь-яке інше ім’я файлу додається як + вхідний файл для мультиплексування, відкривається в інструменті інформації, + редакторі глав або в редакторі заголовків залежно від поточного + режиму. Поточний режим можна змінити за допомогою --merge, + --info, --edit-chapters або + --edit-headers. Стандартним режимом є додавання файлів для + мультиплексування. + +

+ + +

+ Зауважте, якщо є запущений екземпляр програми, та запускається другий, усі + імена файлів, наведені в командному рядку, обробляються вже запущеним + екземпляром. + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

Усі наступні імена файлів будуть додані як вихідні файли до поточного + завдання мультиплексування. Це режим за замовчуванням. +

+ +
--info + +

Усі наступні імена файлів будуть відкриті в інструменті інформування.

+ +

Додатково, під час запуску буде вибрано інструмент інформування замість + інструмента мультиплексування. +

+ +
--edit-chapters + +

Всі наступні імена файлів будуть відкриті в Редакторі глав.

+ +

Додатково, під час запуску буде вибрано редактор глав замість інструмента + мультиплексування. +

+ +
--edit-headers + +

Всі наступні імена файлів будуть відкриті в Редакторі заголовків.

+ +

Додатково, під час запуску буде вибрано редактор заголовків замість + інструмента мультиплексування. +

+ +
-h, --help + +

+ Відображається інформація про використання додатку і відбувається завершення + роботи додатку. + +

+ +
-V, --version + +

+ Відображається інформація про версію додатку і відбувається завершення + роботи додатку. + +

+ +
+ +

3. Дивіться також

+ + +

+ mkvmerge(1), mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. WWW

+ + +

+ Остання версія завжди може бути знайдена на веб-сторінці MKVToolNix. + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..d636884cd5ec9543f89d911df92eacc1cf712ff9 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvextract.html @@ -0,0 +1,1222 @@ + + + + + mkvextract -- 将 Matroska 文件中的轨道提取为单独的文件 + + + +
mkvextract -- 将 Matroska(tm) 文件中的轨道提取为单独的文件 +
+
+ +
+

1. 概要

+ + +
mkvextract {输入文件名} {模式1} 选项 提取规格1 模式2 选项 提取规格2 … +
+ +

2. 说明

+ + +

+ 该程序可将 Matroska(tm) 文件的指定部分提取为其他有用的格式。第一个参数是输入文件名,该文件必须为 Matroska(tm) 文件。 + +

+ + +

+ 其余参数可切换到特定提取模式、更改当前活动模式的选项、指定要将什么内容提取到哪些文件。单次调用 mkvextract + 可同时使用多种模式,以便只读取一遍就提取多项内容。 大多数选项只能在特定模式下使用,少数选项可用于所有模式。 + +

+ + +

+ 目前支持提取 tracks 轨道tags 标签attachments 附件chapters 章节cue 表单timestamps 时间戳 以及 + cues。 + +

+ + +

2.1. 通用选项

+ + + +

+ 以下选项在所有模式下可用,只在本段落讲一遍,不赘述。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ 设置解析模式为 + 'full(完整)'。默认的解析模式不解析整个文件,而是使用元定位元素确定输入文件中所需元素的位置。99% + 的情况下这已经足够。但如果碰到不含元定位元素或者元定位元素损坏的文件,用户可能得考虑使用此模式。完整扫描文件可能要花费几分钟,而快速扫描只需要几秒钟。 + +

+ +
--command-line-charset 字符集 + +

+ 设定在命令行给出的字符串的字符集,用于转为其他字符集。默认为系统当前区域设置中所给定的字符集。 + +

+ +
--output-charset 字符集 + +

+ 设置输出的字符串应被转换到何种字符集。默认为系统当前区域设置中所给定的字符集。 + +

+ +
-r, --redirect-output + 文件名 + +

+ 将所有信息输出至文件 文件名 + 而不是在命令行显示。尽管该操作可以用输出重定向轻松实现,但在某些情况下还需要靠它:如当终端在写入文件之前重新解释(覆盖输出)时。将优先使用通过 + --output-charset + 设定的字符集。 + +

+ +
--flush-on-close + +

+ 让程序在关闭以写入模式打开的文件时,强制将内存中已缓存的所有数据写入到存储设备。可用于在电源中断时避免数据损失,或规避操作系统或驱动程序的特定问题。缺点是混流耗时更长,因为 + mkvmerge 在退出前需要等待所有数据写入存储设备。关于优劣的深入讨论,请参见 MKVToolNix bug 跟踪平台中的问题 #2469 与问题 + #2480。 + +

+ +
--ui-language 语言代码 + +

+ 强制使用 语言代码 所对应的翻译 (例如 'de_DE' + 表示德文翻译)。在 语言代码 处输入 'list' + 可让程序输出可用翻译的列表。 + +

+ +
--abort-on-warnings + +

+ 让程序在出现警告时即中止。程序的退出代码将返回 1。 + +

+ +
--debug 主题 + +

+ 为特定功能开启调试。该选项仅对开发者有用。 + +

+ +
--engage 功能 + +

+ 开启实验性功能。可用功能列表可通过 mkvextract --engage list + 得到。这些功能在正常情况下不应该使用。 + +

+ +
--gui-mode + +

+ 打开 GUI 模式。该模式下,将输出特殊格式的行,告知目前受控的 GUI + 的行为。这些消息遵从格式「#GUI#消息」。消息可能包括键值对,如「#GUI#消息#键1=值1#键2=值2…」。消息内容及键的内容不作翻译,总是以英语输出。 + +

+ +
-v, --verbose + +

+ 使输出信息更详尽,且每当读取到重要的 Matroska(tm) 元素时就将其显示。 + +

+ +
-h, --help + +

+ 显示用法信息并退出。 + +

+ +
-V, --version + +

+ 显示版本信息并退出。 + +

+ +
@选项文件.json + +

+ 从文件 选项文件 读取其他命令行参数。关于支持的选项文件格式的详细说明,请参见 mkvmerge(1) + 手册的“选项文件”段落。 + +

+ +
+ + + +

2.2. 轨道提取模式

+ + + +

+ 语法: mkvextract 输入文件名 tracks + [选项] + TID1:目标文件名1 + [TID2:目标文件名2 ...] + +

+ + +

+ 以下命令行在「tracks」轨道提取模式下对各轨道可用。它们应当在所应用到的轨道指令(参阅下文)之前出现。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c 字符集 + +

+ 设定下一个字幕轨应被转换为哪一字符集。仅当后面的轨道 ID 对应文本字幕轨时有效。默认为 UTF-8。 + +

+ +
--blockadd 层级 + +

+ 只保留不高于此层级的 BlockAdditions (附加区块)。默认保留所有层级。 此选项仅影响特定类型的编解码器,如 WAVPACK4。 + +

+ +
--cuesheet + +

+ 让 mkvextract(1) 根据下一轨道的标签数据与章节信息提取出 CUE 表单,输出文件名为轨道的输出名后接 + '.cue' 扩展名。 + +

+ +
--raw + +

+ 将原始数据提取为文件,输出文件的周围没有任何容器数据。 与 --fullraw + 标记不同的是,此标记不会将 CodecPrivate 元素的内容写入输出文件。 此模式对所有 + CodecIDs 有效,即使是 mkvextract(1) 不支持处理的,然而生成的文件可能无法使用。 + +

+ +
--fullraw + +

+ 提取原始数据,输出文件的周围没有任何容器数据。 如果轨道包含 CodecPrivate + 编解码器私有元素,它的内容将先被写入文件。 此模式对所有 CodecIDs 有效,即使是 + mkvextract(1) 不支持的那些,但是生成的文件可能无法使用。 + +

+ +
TID:输出文件名 + +

+ 如果输入文件中存在 ID 为 TID 的轨道,则将其提取为文件 + 输出文件名。本选项可多次给出。轨道 ID 与 mkvmerge(1) 的 + --identify 选项所输出的相同。 + +

+ + +

+ 每个输出文件名只能用一次。但 RealAudio 与 RealVideo + 轨道例外。如果您为不同轨道使用了同样的输出文件名,这些轨道将被存入同一个文件中。示例: + +

+ +
$ mkvextract 输入.mkv tracks 0:视频.h264 2:输出两个vobsub轨道.idx 3:输出两个vobsub轨道.idx
+
+ + + +

2.3. 附件提取模式

+ + + +

+ 语法: mkvextract 输入文件名 + attachments [选项] + AID1:输出文件名1 + [AID2:输出文件名2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:输出文件名 + +

+ 如果输入文件中存在 ID 为 AID 的附件,则将其提取为文件 + 输出文件名。如果 输出文件名 处留空,将使用所用 + Matroska(tm) 文件中的附件名称。本选项可多次给出。附件 ID 与 mkvmerge(1) 的 + --identify 选项所输出的相同。 + +

+ +
+ + + +

2.4. 章节提取模式

+ + + +

+ 语法: mkvextract 输入文件名 + chapters[选项] + 输出文件名.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ 将章节信息以 OGM tools 所用的简单格式 (CHAPTER01=..., CHAPTER01NAME=...) + 导出。此模式下部分信息将被废弃。默认以 XML 格式输出章节。 + +

+ +
--simple-language 语言 + +

+ 若启用简化格式,mkvextract(1) 对于发现的每个章节单位,均只输出单个条目,即使该章节单位包含多个章节名称。mkvextract(1) + 默认对每个章节单位使用发现的第一个章节名称,而不考察其语言。 + +

+ + +

+ 本选项允许用户决定,在章节单位包含多个章节名称时,应该输出哪些章节名称。语言 参数必须为 ISO + 639-1 或 ISO 639-2 代码。 + +

+ +
+ + +

+ 章节将写入指定的输出文件。默认使用 mkvmerge(1) 能理解的 XML 格式。如果文件中没有发现章节条目,则不会创建输出文件。 + +

+ + + +

2.5. 标签提取模式

+ + + +

+ 语法: mkvextract 输入文件名 tags + [选项] + 输出文件名.xml + +

+ + +

+ 标签将写入指定的输出文件,使用 mkvmerge(1) 能理解的 XML 格式。如果文件中没有发现标签条目,则不会创建输出文件。 + +

+ + + +

2.6. Cue 表单提取模式

+ + + +

+ 语法: mkvextract 输入文件名 + cuesheet [选项] + 输出文件名.cue + +

+ + +

+ cue 表单将写入指定的输出文件。如果文件中没有发现章节或标签条目,则不会创建输出文件。 + +

+ + + +

2.7. 时间戳提取模式

+ + + +

+ 语法: mkvextract 输入文件名 + timestamps_v2 + [选项] + TID1:目标文件名1 + [TID2:目标文件名2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:输出文件名 + +

+ 如果输入文件中存在 ID 为 TID 的轨道,则将其时间戳提取为文件 + 输出文件名。本选项可多次给出。轨道 ID 与 mkvmerge(1) 的 + --identify 选项所输出的相同。 + +

+ + +

+ 示例: + +

+ +
$ mkvextract 输入.mkv timestamps_v2 1:时间戳-轨1.txt 2:时间戳-轨2.txt
+
+ + + +

2.8. cue 提取模式

+ + + +

+ 语法: mkvextract 输入文件名 cues + [选项] + TID1:目标文件名1 + [TID2:目标文件名2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:目标文件名 + +

+ 若输入文件中存在,则提取 ID 为 TID 的轨道的 cue 并保存到 + 输出文件名 中。本选项可多次给出。轨道 ID 与 mkvmerge(1) 的 + --identify 选项所输出的一致,而非 CueTrack + 元素中所包含的数字。 + +

+ +
+ + +

+ 输出的格式为简单文本格式: 每个 CuePoint键=值 + 对占一行。如果 CuePoint 中未出现某个可选元素 (如 + CueDuration) 则将输出短横作为其数值。 + +

+ + +

+ 示例: + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

可用的关键词包括:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
timestamp (时间戳) + +

cue point 的时间戳,精确到纳秒。格式为 HH:MM:SS.nnnnnnnnn。该元素必有值。 +

+ +
duration (时长) + +

cue point 的时长,精确到纳秒。

+ +
cluster_position (簇位置) + +

Matroska(tm) 文件中指向相关元素的簇的起始点的绝对位置,单位为字节。 +

+ + +
+

Note:

+ +

Matroska(tm) 文件中,CueClusterPosition 相对于剪辑数据的起始偏移。而 + mkvextract(1) 的 cue 提取模式所输出的值,已经计入该偏移,因此是从文件开头起的绝对偏移。 +

+ +
+ +
relative_position (相对位置) + +

cue point 所指向的 BlockGroup 或 + SimpleBlock 元素的起始点在簇内的绝对位置,单位为字节。 +

+ + +
+

Note:

+ +

Matroska(tm) 文件中,CueRelativePosition 相对于簇数据的起始偏移。而 + mkvextract(1) 的 cue 提取模式所输出的值,相对于簇的 ID。在文件内的绝对位置可以通过将 + cluster_positionrelative_position + 相加得出。 +

+ +
+ +
+ + +

+ 示例: + +

+ +
$ mkvextract 输入.mkv cues 1:cues-轨1.txt 2:cues-轨2.txt
+ +

3. 示例

+ + + +

+ 同时提取章节与标签,并按其相应的 XML 格式保存: + +

+ +
$ mkvextract 影片.mkv chapters 影片章节.xml tags 影片标签.xml
+ +

+ 同时提取一些轨道及其对应的时间戳: + +

+ +
$ mkvextract "另一部影片.mkv" tracks 0:video.h265 "1:主音轨.aac" "2:导演评论.aac" timestamps_v2 "0:视频时间戳.txt" "1:主音轨时间戳.txt" "2:导演评论音轨时间戳.txt"
+ +

+ 以 Ogg/OGM 格式提取章节,并将一条文本字幕轨道用另一种字符集重新编码: + +

+ +
$ mkvextract "我的影片.mkv" chapters --simple "我的章节.txt" tracks -c MS-ANSI "2:我的字幕.srt"
+

4. 文本文件与字符集转换

+ + + +

+ 关于 MKVToolNix 套件中所有工具如何处理字符集转换、输入/输出编码、命令行编码及控制台编码的深入讨论,请参见 mkvmerge(1) + 手册中相对应名称的段落。 + +

+ +

5. 输出文件格式

+ + + +

+ 输出的格式取决于轨道的类型,而不是输出文件名的扩展名。目前支持以下轨道类型: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ 所有 AAC 文件将被输出为 AAC 文件,其中数据包前有 + ADTS 头。ADTS 头将不含反增强字段(deprecated emphasis + field)。 + +

+ +
A_AC3, A_EAC3 + +

+ 这些会提取为原始 AC-3 文件。 + +

+ +
A_ALAC + +

+ ALAC 轨道将输出为 CAF 文件。 + +

+ +
A_DTS + +

+ 这些会提取为原始 DTS 文件。 + +

+ +
A_FLAC + +

+ FLAC 轨道将输出为原始的 FLAC 文件。 + +

+ +
A_MPEG/L2 + +

+ MPEG-1 Audio Layer II 流将提取为原始的 MP2 文件。 + +

+ +
A_MPEG/L3 + +

+ 这些会提取为原始 MP3 文件。 + +

+ +
A_OPUS + +

+ Opus(tm) 轨道将输出为 OggOpus(tm) + 文件。 + +

+ +
A_PCM/INT/LIT, A_PCM/INT/BIG + +

+ 原始 PCM 数据将写入 WAV 文件。大端序整数数据在此期间将被转为小端序数据。 + +

+ +
A_REAL/* + +

+ RealAudio(tm) 轨道将被输出为 + RealMedia(tm) 文件。 + +

+ +
A_TRUEHD, A_MLP + +

+ 这些会提取为原始 TrueHD/MLP 文件。 + +

+ +
A_TTA1 + +

+ TrueAudio(tm) 轨道将被输出为 TTA 文件。请注意,由于 + Matroska(tm) 时间戳的精度限制,解开来的文件的头部有两个字段不同:data_length + (文件的总采样数) 与 CRC。 + +

+ +
A_VORBIS + +

+ Vorbis 音频将被输出为 OggVorbis(tm) 文件。 + +

+ +
A_WAVPACK4 + +

+ WavPack(tm) 轨道将输出为 WV 文件。 + +

+ +
S_HDMV/PGS + +

+ PGS 字幕将输出为 SUP 文件。 + +

+ +
S_HDMV/TEXTST + +

+ TextST 字幕将以转为 mkvmerge(1)mkvextract(1) 发明的特殊格式写入。 + +

+ +
S_KATE + +

+ Kate(tm) 流将以 Ogg(tm) 为容器输出。 + +

+ +
S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS + +

+ SSAASS 文本字幕将分别被输出为 + SSA/ASS 文件。 + +

+ +
S_TEXT/UTF8, S_TEXT/ASCII + +

+ 简单的文本字幕将被输出为 SRT 文件。 + +

+ +
S_VOBSUB + +

+ VobSub(tm) 字幕将输出为 SUB 文件及相应的索引文件(后缀为 + IDX)。 + +

+ +
S_TEXT/USF + +

+ USF 文本字幕将输出为 USF 文件。 + +

+ +
S_TEXT/WEBVTT + +

+ WebVTT 字幕文件将写入 WebVTT 文件。 + +

+ +
V_MPEG1, V_MPEG2 + +

+ MPEG-1MPEG-2 视频轨道将输出为 + MPEG 基本流(ES)。 + +

+ +
V_MPEG4/ISO/AVC + +

+ H.264 / AVC 视频轨将被输出为 + H.264 基本流,可以使用如 GPAC(tm) 工具包中的 + MP4Box(tm) 作进一步处理。 + +

+ +
V_MPEG4/ISO/HEVC + +

+ H.265 / HEVC 视频轨道将输出为 + H.265 基本流(ES),该格式可使用 GPAC(tm) 软件包中的 + MP4Box(tm) 作进一步处理。 + +

+ +
V_MS/VFW/FOURCC + +

+ 使用此 CodecIDFPS 恒定的视频轨将被输出为 + AVI 文件。 + +

+ +
V_REAL/* + +

+ RealVideo(tm) 轨道将被输出为 + RealMedia(tm) 文件。 + +

+ +
V_THEORA + +

+ Theora(tm) 流将以 Ogg(tm) 为容器输出 + +

+ +
V_VP8, V_VP9 + +

+ VP8 / VP9 轨道将输出为 IVF 文件。 + +

+ +
标签 + +

+ 标签将被转换为 XML 格式。此格式与 mkvmerge(1) 所支持读取的标签格式相同。 + +

+ +
附件 + +

+ 附件将被以原样输出。不会进行任何转换。 + +

+ +
章节 + +

+ 章节将被转换为 XML 格式。此格式与 mkvmerge(1) 所支持读取的章节格式相同。您也可以选择输出精简的简单 + OGM 格式。 + +

+ +
时间戳 + +

+ 时间戳会先被排序,然后以 timestamp v2 格式文件输出,该文件适用于 mkvmerge(1)。不支持提取为其他格式 (v1, v3 或 v4)。 + +

+ +
+ +

6. 退出代码

+ + + +

+ mkvextract(1) 退出时会返回以下三个退出代码中的一个: + +

+ + +
    + +
  • + +

    + 0 -- 此退出代码说明已成功完成提取。 + +

    + +
  • + + +
  • + +

    + 1 -- 这种情况下 mkvextract(1) 至少输出了一条警告信息,但提取并未因之中止。 警告信息以文字 + '警告:' 为前缀。根据问题的不同,生成的文件可能是好的,也可能不是。 强烈建议用户检查警告信息以及生成的文件。 + +

    + +
  • + + +
  • + +

    + 2 -- 此退出代码用于错误发生之后。 mkvextract(1) + 在输出错误信息后即中断处理。错误信息可能是错误的命令行参数,也可能是损坏文件的读取/写入错误。 + +

    + +
  • + +
+ +

7. 环境变量

+ + + +

+ mkvextract(1) 使用决定系统区域设置的默认变量 (如 LANG 与 + LC_* 族)。其他变量包括: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG + 及其缩略形式 MTX_DEBUG + +

内容将被当作通过 --debug + 选项传递的参数对待。 +

+ +
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE + 及其缩略形式 MTX_ENGAGE + +

内容将被当作通过 --engage + 选项传递的参数对待。 +

+ +
+ +

8. 参阅

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. 网络

+ + +

+ 最新版本总可以在 MKVToolNix 主页 找到。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..703b2155da1968e3233bfef094bac4edb10ca0e9 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvinfo.html @@ -0,0 +1,473 @@ + + + + + mkvinfo -- 输出关于 Matroska 文件中各轨的信息 + + + +
mkvinfo -- 输出关于 Matroska(tm) 文件中各轨的信息 +
+
+ +
+

1. 概要

+ + +
mkvinfo 选项 {输入文件名} +
+ +

2. 说明

+ + +

+ 本程序可列出 Matroska(tm)文件中包含的所有轨道,输出信息可以限定为文件的轨道列表以及所用编解码器的信息。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ 默认情况下,mkvinfo(1) 会在读取到首个簇时停下来。它也不会显示某些元素(通常是反复出现的元素)。通过此选项可以让 mkvinfo(1) + 忽略冗余级别继续处理,并显示所有元素。 + +

+ +
-c, --checksums + +

+ 计算并显示各帧的 Adler-32 校验码。仅当调试时有用处。 + +

+ +
-o, --continue + +

+ 默认情况下,mkvinfo(1) 会在读取到首个簇时停下来。通过此选项可以让 mkvinfo(1) 忽略冗余级别继续处理。 + +

+ +
-p, --hex-positions + +

+ 忽略冗余级别,以十六进制显示所有元素的位置。 + +

+ +
-P, --positions + +

+ 忽略冗余级别,以十进制显示所有元素的位置。 + +

+ +
-s, --summary + +

+ 仅显示 mkvinfo(1) 所获取信息的简要概述,而非各元素。 + +

+ +
-t, --track-info + +

+ 在“详细”模式下为各轨道显示统计信息。如果“详细”程度为 0 级,则将同时将级别设为 1。 + +

+ +
-x, --hexdump + +

+ 以十六进制转储形式显示各帧的前 16 字节。 + +

+ +
-X, --full-hexdump + +

+ 以十六进制转储形式显示各帧的所有字节。 + +

+ +
-z, --size + +

+ 显示各元素的尺寸,含头部所占用的尺寸。 + +

+ +
--command-line-charset 字符集 + +

+ 设定在命令行给出的字符串的字符集,用于转为其他字符集。默认为系统当前区域设置中所给定的字符集。 + +

+ +
--output-charset 字符集 + +

+ 设置输出的字符串应被转换到何种字符集。默认为系统当前区域设置中所给定的字符集。 + +

+ +
-r, --redirect-output + 文件名 + +

+ 将所有信息输出至文件 + 文件名,而不是在命令行显示。尽管该操作可以用输出重定向轻松实现,但在特定情况下还是缺不得它:当终端写入文件之前重新解释(覆盖输出)时。 + --output-charset + 中所选定的字符集将被优先选用。 + +

+ +
--ui-language 语言代码 + +

+ 强制使用 语言代码 所对应的翻译 (例如 'de_DE' + 表示德文翻译)。在 语言代码 处输入 'list' + 可让程序输出可用翻译的列表。 + +

+ +
--abort-on-warnings + +

+ 让程序在出现警告时即中止。程序的退出代码将返回 1。 + +

+ +
--debug 主题 + +

+ 为特定功能开启调试。该选项仅对开发者有用。 + +

+ +
--engage 功能 + +

+ 开启实验性功能。可用功能列表可通过 mkvinfo --engage list + 获取。通常情况下不应该使用这些功能。 + +

+ +
--gui-mode + +

+ 打开 GUI 模式。该模式下,将输出特殊格式的行,告知目前受控的 GUI + 的行为。这些消息遵从格式「#GUI#消息」。消息可能包括键值对,如「#GUI#消息#键1=值1#键2=值2…」。消息内容及键的内容不作翻译,总是以英语输出。 + +

+ +
-v, --verbose + +

+ 使输出更详尽。请参阅关于 “详细”程度 + 的段落获取在哪些层级将输出哪些信息的描述。 + +

+ +
-h, --help + +

+ 显示用法信息并退出。 + +

+ +
-V, --version + +

+ 显示版本信息并退出。 + +

+ +
@选项文件.json + +

+ 从文件 选项文件 读取其他命令行参数。关于支持的选项文件格式的详细说明,请参见 mkvmerge(1) + 手册的“选项文件”段落。 + +

+ +
+ +

3. “详细”程度

+ + + +

+ -v 选项可以使 + mkvinfo(1) 增强其“详细”程度并输出关于当前文件的更多信息。 + +

+ + +

+ 在 level 0 mkvinfo(1) 仅输出它发现的轨道头及其类型。头部解析完毕后(更专业地:遇到首个簇时),mkvinfo(1) + 将退出执行。在此层级,定位头项与 cue 索引不会显示出来——即使它们位于轨道信息之前。 + +

+ + +

+ 在 level 1 mkvinfo(1) 同样将输出在整个文件中遇到的所有 Matroska(tm) 元素,此外还将输出定位头项与 cue + 索引项。如果启用了简要模式,mkvinfo(1) 还将输出各帧位置。 + +

+ + +

+ 通过选项「--continue」可以实现相同的效果。 + +

+ + +

+ 在 level 2 mkvinfo(1) 同样将输出定位头项与 cue 索引项,以及文件中各 Matroska(tm) 元素被发现的位置。 + +

+ + +

+ 通过选项「--all --positions」可以实现相同的结果。 + +

+ + +

+ 在 level 3 及更高层级 mkvinfo(1) 将输出一些与 Matroska(tm) + 元素不直接相连的信息。对于其他元素,将只输出发现的基本信息。Level 3 增加了元信息以便调试(换句话说:它是为开发人员设计的)。Level 3 + 输出的所有行都以方括号嵌套以便过滤。 + +

+ +

4. 文本文件与字符集转换

+ + + +

+ 关于 MKVToolNix 套件中所有工具如何处理字符集转换、输入/输出编码、命令行编码及控制台编码的深入讨论,请参见 mkvmerge(1) + 手册中相对应名称的段落。 + +

+ +

5. 退出代码

+ + + +

+ mkvinfo(1) 退出时会返回以下三个退出代码中的一个: + +

+ + +
    + +
  • + +

    + 0 -- 此退出代码说明已成功完成运行。 + +

    + +
  • + + +
  • + +

    + 1 -- 这种情况下 mkvinfo(1) 至少输出了一条警告信息,但运行并未因之中止。 警告信息以文字 + '警告:' 为前缀。 + +

    + +
  • + + +
  • + +

    + 2 -- 此退出代码用于错误发生之后。 mkvinfo(1) + 在输出错误信息后即中断运行。错误信息可能是错误的命令行参数,也可能是损坏文件的读取/写入错误。 + +

    + +
  • + +
+ +

6. 环境变量

+ + + +

+ mkvinfo(1) 会使用决定系统区域设置的默认变量 (如 LANG 与 + LC_* 族)。其他变量包括: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUG, MKVTOOLNIX_DEBUG 及其缩略形式 + MTX_DEBUG + +

内容将被当作通过 --debug + 选项传递的参数对待。 +

+ +
MKVINFO_ENGAGE, MKVTOOLNIX_ENGAGE + 及其缩略形式 MTX_ENGAGE + +

内容将被当作通过 --engage + 选项传递的参数对待。 +

+ +
+ +

7. 参阅

+ + +

+ mkvmerge(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. 网络

+ + +

+ 最新版本总可以在 MKVToolNix 主页 找到。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..ab8c5a97294a8f66c3cd2d6c09b2b3ecaf6435fb --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvmerge.html @@ -0,0 +1,4641 @@ + + + + + mkvmerge -- 将多媒体流合并为 Matroska 文件 + + + +
mkvmerge -- 将多媒体流合并为 Matroska(tm) 文件 +
+
+ +
+

1. 概要

+ + +
mkvmerge 全局选项 {-o 输出文件} 选项1 {文件1} 选项2 {文件2} @选项文件.json +
+ +

2. 说明

+ + +

+ 本程序以任意数量的媒体文件作为输入文件,并将它们的数据流(全部或部分)合并到 Matroska(tm) 文件中去;参见 Matroska 网站。 + +

+ + +
+

Important:

+ +

+ 命令行选项的顺序很重要。若您对程序还不熟悉,请阅读「选项顺序」段落。 + +

+ +
+ + +

2.1. 全局选项

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

增强“详细”程度。

+ +
-q, --quiet + +

取消状态输出。

+ +
-o, --output 文件名 + +

写至文件 文件名。如果使用了切割功能,对此参数的处理将有所不同。 详情请参阅关于 --split 选项的说明。 +

+ +
-w, --webm + +

创建符合 WebM 规范的文件。若输出文件的扩展名为 「webm」,则会自动开启本选项。此模式将实施一些限制。只允许使用编解码器为 VP8、VP9 + 的视频轨道及 Opus、Vorbis 的音频轨道。DocType 头部项目将改为 「webm」。 + +

+ + +

+ 对于章节与标签,只允许使用一部分元素。mkvmerge(1) 将自动移除规范所不允许的元素。 + +

+ +
--title 标题 + +

设置整个生成文件的标题,比如电影名称。

+ +
--default-language 语言代码 + +

设置默认语言代码,用于没有使用 --language + 选项设置语言的轨道以及源容器未提供语言值的轨道。 +

+ + +

默认的语言代码为「und」,即「undetermined」(未定)。 +

+ +
+ + + +

2.2. 剪辑信息处理 (全局选项)

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo 文件名.xml + +

+ 从 XML 文件中读取剪辑信息。此文件可以包含剪辑族的 UID、剪辑的 + UID、上一剪辑以及下一剪辑的 UID 元素。示例文件以及 + DTD 已包含在 MKVToolNix 套件内。 + +

+ + +

+ 详情请参见下文关于 剪辑信息 XML 文件 的段落。 + +

+ +
--segment-uid SID1,SID2,... + +

+ 设定要使用的剪辑 UID。这是个逗号分割的 128 位 UID 列表,UID 为通常的格式: 十六进制数字,"0x" + 前缀可选,空格可选,但必须恰好有 32 个数位。 + +

+ + +

+ 若 SID 以“=”开头,则其剩余部分将作为 Matroska 文件解析,将读取并使用该文件的剪辑 UID。 + +

+ + +

+ 创建的每个文件都包含一个剪辑,每个剪辑有一个剪辑 UID。如果指定的剪辑 UID 比创建的剪辑多,则多余的 UID 将被忽略。如果指定的 UID + 比创建的剪辑少,则将随机创建 UID。 + +

+ +
+ + + +

2.3. 章节与标签处理 (全局选项)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language 语言代码 + +

+ 设置各章节项的 ISO 639-2 语言代码。 默认为 'eng'。 详情参见下文中关于 章节 的段落。 + +

+ + +

+ 此选项可用于简单章节文件与包含章节但不含章节语言信息的输入文件,如 MP4 与 OGM 文件。 + +

+ + +

+ 本选项设置的语言也将用于 --generate-chapters + 选项 所生成的章节。 + +

+ +
--chapter-charset 字符集 + +

+ 设置简单章节文件的字符集,用于将其转换为 UTF-8。关于 mkvmerge(1) 如何转换不同字符集的说明,请参见关于文本文件与字符集的段落。 + +

+ + +

+ 此开关亦可应用到从特定容器类型,如 Ogg/OGM 和 MP4 文件中复制而来的章节。 详情参见下文关于章节的段落。 + +

+ +
--chapter-sync + d[,o[/p]] + +

+ 将章节的时间戳平移 d ms。您也可以使用 --sync + 选项操作特殊轨道 ID -2 (参见 特殊轨道 ID 段落)。 + +

+ + +

+ o/p: 按 + o/p 调整时间戳以修复线性偏移。如果省略 + p 则默认为 1。o 与 + p 均可为浮点数。 + +

+ + +

+ 默认: 无手动同步校正 (与 d = 0 及 + o/p = 1.0 + 效果相同)。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--generate-chapters 模式 + +

+ mkvmerge(1) 可以自动创建章节。目前支持下述两种模式: + +

+ + +
    + +
  • + +

    + 'when-appending'(追加文件时) – 文件开头为第一章,随后每追加一个文件便创建一个章节。 + +

    + + +

    + 此模式同时支持「parts:」及「parts-frames:」两种切割模式。对于这些模式,每段新增的时间戳范围会生成一个新章节 + (其起始时间戳带有「+」前缀)。 + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1) 要求存在视频轨或音频轨,方可确定新文件追加的时间。若混流一或多个视频轨,则将使用第一个轨道的参数。否则将使用第一个音频轨。 + +

    + +
    + +
  • + + +
  • + +

    + 'interval:指定时间' – 该模式根据 + 指定时间 所给出的固定时间间隔生成章节。参数的格式既可以为 + HH:MM:SS.nnnnnnnnn 的形式,也可以为数字后接单位 + 's'、'ms' 或 'us'。 + +

    + + +

    + 示例: --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ 新章节的名称由选项 --generate-chapters-name-template + 控制。语言通过 --chapter-language + 设置,该选项必须出现在 --generate-chapters 之前。 + +

+ +
--generate-chapters-name-template 模板 + +

+ 该选项设置 --generate-chapters + 选项所生成的章节名称的名称模板。若未使用该选项,则将使用默认值 '第 <NUM:2> 章'。 + +

+ + +

+ 模板中可以使用多个变量,这些变量将在生成章节时被实际值替代。字符串 '<NUM>' + 将被章节号替代。字符串 '<START>' 将被章节的起始时间戳替代。 + +

+ + +

+ 字符串 「<FILE_NAME>」 与 + 「'<FILE_NAME_WITH_EXT>」 只会在为追加文件生成章节时进行填充。 + 它们会被替换为追加文件的文件名,前者不含扩展名,后者包含扩展名。 注意,只会插入文件本身的名称(及扩展名),不会插入其目录名或盘符。 + +

+ + +

+ 您可以以 '<NUM:位数>' 的形式指定章节编号的最少位数,如 + '<NUM:3>'。最终的数字,若其位数小于指定位数,则将在开头补零。 + +

+ + +

+ 您可以以 <START:格式>的形式控制起始时间戳的格式。若未给出格式,则默认为 + '%H:%M:%S'。有效的格式代码包括: + +

+ + +
    + +
  • + +

    %h – 时 +

    + +
  • + +
  • + +

    %H – 时(两位) +

    + +
  • + +
  • + +

    %m – 分 +

    + +
  • + +
  • + +

    %M – 分(两位) +

    + +
  • + +
  • + +

    %s – 秒 +

    + +
  • + +
  • + +

    %S – 秒(两位) +

    + +
  • + +
  • + +

    %n – 纳秒(九位) +

    + +
  • + +
  • + +

    %<1-9>n – 纳秒,精度最高为九位 (如 %3n + 代表三位) +

    + +
  • + +
+ +
--cue-chapter-name-format 格式 + +

+ mkvmerge(1) 支持读取音频文件的 CUE 表单作为章节输入。CUE + 表单中各索引项通常含有 PERFORMER(表演者)TITLE(标题) + 项。mkvmerge(1) 使用这两个字串构建章节名称。使用此选项可设定构建名称所用的格式。 + +

+ + +

+ 如果此选项未给定则 mkvmerge(1) 默认使用 '%p - %t' 格式 (表演者, 后接空格, 一个破折号, + 另一个空格以及标题)。 + +

+ + +

+ 如果给定了格式,则除了后续的标签字符以外都将被原样复制,标签字符将被进行下述替换: + +

+ + +
    + +
  • + +

    %p 被当前项的 PERFORMER(表演者) 字符串替代, +

    + +
  • + +
  • + +

    %t 被当前项的 TITLE(标题) 字符串替代, +

    + +
  • + +
  • + +

    %n 被当前轨道编号替代,此外 +

    + +
  • + +
  • + +

    %N 被当前轨道衬式编号(小于 10 则在前面加零)替代。 +

    + +
  • + +
+ +
--chapters 文件名 + +

+ 从文件 文件名 读取章节信息。详情参阅下文关于 章节 的段落。 + +

+ +
--global-tags 文件名 + +

+ 从文件 文件名 读取全局标签。详情参阅下文关于 标签 的段落。 + +

+ +
+ + + +

2.4. 全局输出控制 (高级全局选项)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order + FID1:TID1,FID2:TID2,... + +

+ 此选项更改输入文件创建时轨道的顺序。变量为逗号分隔的成对的 ID 列。每对先包含有文件 ID + (FID1),即文件在命令行中的顺序,由 0 开始计数。第二个是在该文件中的轨道 ID + (TID1)。 如果省去部分轨道的 ID,则这些轨道将在使用本选项给定的轨道创建之后创建。 + +

+ +
--cluster-length 指令 + +

+ 限制每个簇中数据块的数量或数据的时长。指令 参数可以是无单位的数字 + n,也可以是后缀有 'ms' 的 + d。 + +

+ + +

+ 如果未使用数字,mkvmerge(1) 将在每个簇中放置最多 n 个数据块。最大块数是 65535。 + +

+ + +

+ 如果数字 d 后缀有 'ms',mkvmerge(1) + 将在每个簇中放置最多 d 毫秒的数据。d 的最小值是 + '100ms',最大值是 '32000ms'。 + +

+ + +

+ mkvmerge(1) 默认每簇最多放置 65535 个数据块或 5000ms 的数据。 + +

+ + +

+ 尝试定位到特定帧的程序只能直接定位到簇,然后需要读取整个簇(来完成定位)。因此创建较大的簇将导致定位不精确或缓慢。 + +

+ +
--clusters-in-meta-seek + +

+ 告诉 mkvmerge(1) 在文件末尾创建包含所有簇的元定位元素。参阅关于 Matroska 文件规划 的段落。 + +

+ +
--timestamp-scale 系数 + +

+ 强制时间戳缩放系数为 系数。有效值域为 + 1000..10000000 或特殊值 + -1。 + +

+ + +

+ 通常 mkvmerge(1) 会使用数值 1000000,这样时间戳和时长的精度为 + 1ms。对于不包含视频轨但含有至少一条音频轨的文件,mkvmerge(1) + 将自动选择一个时间戳缩放系数以使各轨的音频采样精度相同。这将引起更大的额外开销,但将允许更为精确的定位与提取。 + +

+ + +

+ 如果使用了特殊值 -1,即使有视频轨,mkvmerge(1) 也将使用采样精度。 + +

+ +
--enable-durations + +

+ 为所有区块写入时长。这将增大文件尺寸,而且目前对播放器来说没有额外的好处。 + +

+ +
--no-cues + +

+ 让 mkvmerge(1) 不要创建或写入 cue 索引( 可类比作 AVI 文件中的索引)。没有索引的 Matroska(tm) + 文件也能播放,但定位可能不精确且缓慢。仅当您确实强求空间或用作测试时使用此选项。请参阅可为各输入文件指定的 --cues 选项。 + +

+ +
--no-date + +

+ 默认情况下,mkvmerge(1) 会将剪辑信息中的「date」字段设为混流开始的日期与时间。通过此选项可以完全不写入该字段。 + +

+ +
--disable-lacing + +

+ 禁用所有轨道的紧缩。这将增加文件大小,尤其是当有很多音频轨时。此选项不供日常之用。 + +

+ +
--disable-track-statistics-tags + +

+ 通常 mkvmerge(1) 会为每条轨道写入特定的统计信息标签。若这类标签已存在,则将被覆盖。这些标签包括 + BPSDURATIONNUMBER_OF_BYTES + 及 NUMBER_OF_FRAMES。 + +

+ + +

+ 启用本选项可阻止 mkvmerge(1) 写入这些标签或修改现有的同名标签。 + +

+ +
--disable-language-ietf + +

+ mkvmerge(1) 通常会在轨道头部、章节以及标签中同时写入传统语言元素以及全新的 IETF BCP 47 + 语言元素。若使用此选项,则只会写入传统元素。 + +

+ +
--normalize-language-ietf 模式 + +

+ 将 IETF BCP 47 + 语言标签规范化,支持「canonical」(最简式)、「extlang」(扩展语言子标签形式)以及「off」关闭模式。默认(不添加本选项)会规范化至最简式。 + +

+ + +

+ 最简式模式下,所有存在推荐值(preferred value)的语言子标签都会被替换为推荐值。依规范会执行下述转换: + 「zh-yue-jyutping」 转换为 + 「yue-jyutping」,「fr-FX」 转换为 + 「fr-FR」。 + +

+ + +

+ 扩展语言子标签形式在最简式的基础上生成。所有存在扩展语言子标签(extended language subtag)的主要语言(primary + language)都被替换为子标签对应的前缀加上该子标签。该规则将 「yue-jyutping」 转回传统的 + 「zh-yue-jyutping」 形式,但 「fr-FR」 + 不会发生变化,因为 「fr」 不属于扩展语言子标签。 + +

+ +
--stop-after-video-ends + +

+ Stops processing after the primary video track ends, discarding any + remaining packets of other tracks. + +

+ +
+ + + +

2.5. 文件切割、连接、追加及合并 (其他全局选项)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split 指令 + +

+ 在给定尺寸或时间之后切割输出文件。请注意,各轨道只能在关键帧之前的地方切割开来。因此实际切割点可能比用户指定的稍稍靠后些。 + +

+ + +

+ 目前 mkvmerge(1) 支持以下模式: + +

+ + +
    + +
  1. + +

    + 按尺寸切割。 + +

    + + +

    + 语法: --split + [size:]d[k|m|g] + +

    + + +

    + 示例: --split size:700m 或者 --split 150000000 + +

    + + +

    + 参数 d 可以以 + 'k'、'm' 或 'g' + 结尾,分别说明尺寸的单位为 KB、MB 或 GB。 否则假定单位为字节。 当前输出文件达到此尺寸限制后将开始输出新的文件。 + +

    + + +

    + 为兼顾兼容性,'size:' 前缀可以省略。 + +

    + +
  2. + + +
  3. + +

    + 在一定时长后切割。 + +

    + + +

    + 语法: --split + [duration:]HH:MM:SS.nnnnnnnnn|ds + +

    + + +

    + 示例: --split duration:00:60:00.000--split 3600s + +

    + + +

    + 此参数可以用 HH:MM:SS.nnnnnnnnn 的形式指定纳秒精度的时长,也可以是后接字母 + 's' 的指定秒数时长的数字 + dHH + 为小时数,MM 为分钟数,SS + 为秒数,而nnnnnnnnn 为纳秒数。 小时数与纳秒数均可省略。 小数点后最多可以有九位。 + 当前输出内容的时长达到此限制后将开始输出新的输出文件。 + +

    + + +

    + 为兼顾兼容性,'duration:' 前缀可以省略。 + +

    + +
  4. + + +
  5. + +

    + 在指定时间戳后切割。 + +

    + + +

    + 语法: --split + timestamps:A[,B[,C...]] + +

    + + +

    + 示例: --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + 参数 + ABC + 等等的格式与按时长切割模式(见上文)所用的格式相同。时间戳表以逗号分隔。 + 输入流达到当前切割点的时间戳后将创建新的输出文件。然后将使用所给定的下一个切割点。 + +

    + + +

    + 'timestamps:' 前缀不得省略。 + +

    + +
  6. + + +
  7. + +

    + 通过指定时间戳范围,保留特定部分,并丢弃其余部分。 + +

    + + +

    + 语法: --split + parts:起点1-终点1[,[+]起点3-终点2[,[+]起点3-终点3...]] + +

    + + +

    + 示例: +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + parts 模式可以告诉 mkvmerge(1) 保留特定时间戳范围,而丢弃其余部分。要保留的范围需要在 + parts: 关键词后列出,以逗号隔开。各分段由起始及终止时间戳组成,格式与其他 + --split 模式所能接受的相同 (如 00:01:20 与 + 80s 代表相同的时间戳)。 + +

    + + +

    + 若起始时间戳留空,则默认为前一段的终止时间戳。若不存在前一段,则默认为文件开头 (参见示例 3)。 + +

    + + +

    + 若终止时间戳留空,则默认为输入文件末尾,亦即告诉 mkvmerge(1) 保留其余部分 (参见示例 3)。 + +

    + + +

    + 通常每一段都会写入新的文件。该行为也可以调整,以便将连续的分段写入同一个文件。要实现这种效果,用户可以在起始时间戳开头加上 + + 前缀。这样可以告诉 mkvmerge(1) + 不要创建新文件,而是将该分段写入与之前一段相同的文件当中。时间戳也会自动调整,确保即使输入文件中两分段不连续,输出文件中也不出现间隙。 + +

    + + +

    + 例 1 中 mkvmerge(1) 会创建两个文件。第一个包含从 00:01:20 到 + 00:02:45 之间的内容。第二个文件包含从 00:05:50 到 + 00:10:30 之间的内容。 + +

    + + +

    + 例 2 中 mkvmerge(1) 将只创建一个文件。该文件包含从 00:01:20 到 + 00:02:45 及从 00:05:50 到 + 00:10:30 的内容。 + +

    + + +

    + 例 3 中 mkvmerge(1) 将创建两个文件。第一个包含从输入文件开头到 00:02:45 + 的内容。第二个文件将包含从 00:05:50 到输入文件结尾之间的内容。 + +

    + + +
    +

    Note:

    + +

    + 请注意,mkvmerge(1) + 只在关键帧位置决定是否切割。每段切割区域的起始点与结束点均为关键帧。因此即使结束时间戳介于两个关键帧之间,mkvmerge(1) + 也将继续输出帧,直到下一关键帧为止(不包括)。 + +

    + +
    + +
  8. + + +
  9. + +

    + 通过指定帧/场序号范围,保留特定部分,并丢弃其余部分。 + +

    + + +

    + 语法: --split + parts-frames:起点1-终点1[,[+]起点2-终点2[,[+]起点3-终点3...]] + +

    + + +

    + 示例: +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + parts-frames 模式可以告诉 mkvmerge(1) + 保留特定帧/场序号范围,而丢弃其余部分。要保留的范围需要在 parts-frames: + 关键词后列出,以逗号隔开。各分段由起始及终止帧/场序号组成。序号从 1 开始计数。 + +

    + + +

    + 若起始序号留空,则默认为前一段的终止序号。若不存在前一段,则默认为文件开头 (参见示例 3)。 + +

    + + +

    + 若终止序号留空,则默认为文件末尾,亦即告诉 mkvmerge(1) 保留其余部分 (参见示例 3)。 + +

    + + +

    + 通常每一段都会写入新的文件。该行为也可以调整,以便将连续的分段写入同一个文件。要实现这种效果,用户可以在起始序号开头加上 + + 前缀。这样可以告诉 mkvmerge(1) + 不要创建新文件,而是将该分段写入与之前一段相同的文件当中。时间戳也会自动调整,确保即使输入文件中两分段不连续,输出文件中也不出现间隙。 + +

    + + +
    +

    Note:

    + +

    + 请注意,mkvmerge(1) + 只在关键帧位置决定是否切割。每段切割区域的起始点与结束点均为关键帧。因此即使结束帧/场序号介于两个关键帧之间,mkvmerge(1) + 也将继续输出帧,直到下一关键帧为止(不包括)。 + +

    + +
    + + +

    + 例 1 中 mkvmerge(1) 会创建两个文件。第一个包含从第 137 帧或之后的第一个关键帧,到第 + 258 帧或之后的第一个关键帧(但不含该关键帧)之间的内容。第二个文件包含第 + 5481211 帧之间的内容。 + +

    + + +

    + 例 2 中 mkvmerge(1) 将只创建一个文件。该文件包含从 733 到 + 912 及从 15922730 + 的内容。 + +

    + + +

    + 例 3 中 mkvmerge(1) 将创建两个文件。第一个包含输入文件开头到 430 的内容。第二个文件将包含从 + 2512 到输入文件结尾之间的内容。 + +

    + + +

    + 该模式只考虑输出的第一条视频轨道。 如果没有输出视频轨道,则将不会进行切割操作。 + +

    + + +
    +

    Note:

    + +

    + 通过本参数给出的数字将根据输出的 Matroska(tm) 区块解析。 单个 Matroska(tm) 区块可包含完整的一帧 (对于逐行扫描的内容) 或单场 + (对于隔行扫描的内容)。 mkvmerge 不区分两者,它直接统计区块数目。 例如: 假设某人希望在隔行扫描的第 25 个完整帧之后切割,则应使用 + 50 (每帧对应两场) 作为切割点。 + +

    + +
    + +
  10. + + +
  11. + +

    + 在指定帧/场后切割。 + +

    + + +

    + 语法: --split + frames:A[,B[,C...]] + +

    + + +

    + 示例: --split frames:120,237,891 + +

    + + +

    + 参数 + ABC + 等等必须全为正整数。编号从 1 开始。 帧/场编号列表以逗号分隔。 + 输入流达到当前切割点的帧/场编号后将创建新的输出文件。然后将使用所给定的下一个切割点。 + +

    + + +

    + 'frames:' 前缀不得省略。 + +

    + + +

    + 该模式只考虑输出的第一条视频轨道。 如果没有输出视频轨道,则将不会进行切割操作。 + +

    + + +
    +

    Note:

    + +

    + 通过本参数给出的数字将根据输出的 Matroska(tm) 区块解析。 单个 Matroska(tm) 区块可包含完整的一帧 (对于逐行扫描的内容) 或单场 + (对于隔行扫描的内容)。 mkvmerge 不区分两者,它直接统计区块数目。 例如: 假设某人希望在隔行扫描的第 25 个完整帧之后切割,则应使用 + 50 (每帧对应两场) 作为切割点。 + +

    + +
    + +
  12. + + +
  13. + +

    + 在指定章节之前切割。 + +

    + + +

    + 语法: --split chapters:all or + --split + chapters:A[,B[,C...]] + +

    + + +

    + 示例: --split chapters:5,8 + +

    + + +

    + 参数 + ABC + 等等必须全为正整数。编号从 1 开始。 章节编号列表以逗号分隔。 切割将在时间戳等于或大于所列编号对应章节的起始时间戳的首个关键帧之前进行。从 0s + 开始的章节将不作考虑,并不作提示,直接丢弃。 + +

    + + +

    + 关键词 all 可选择所有章节编号,无需手工输入。 + +

    + + +

    + 'chapters:' 前缀不得省略。 + +

    + + +
    +

    Note:

    + +

    + Matroska(tm) 文件格式支持任意深度嵌套的章节结构,称为“版本条目”与“章节单位”。 但该模式仅考虑所有版本条目中最顶层的章节。 + +

    + +
    + +
  14. + +
+ + +

+ 此切割模式下输出文件名将以不同于常用操作的方式对待。可能会含有类似 printf 中 + '%d' 的表达式,包括可选的字段宽度,如 + '%02d'。如果含有上述表达式,当前文件序号将按相应格式生成,然后插入到文件名中的相应位置。 + 如果没有此类匹配模式,则假定匹配模式为在文件扩展名之前插入 '-%03d': '-o 输出.mkv' + 将生成 '输出-001.mkv' 这样的一系列文件。如果没有扩展名,'-%03d' + 将被追加在文件名之后。 + +

+ + +

+ 也可以选用「%c」,它将被替换为文件中首个章节的名称。注意:当「%c」存在时,不会再自动添加「-%03d」。 + +

+ +
--link + +

+ 切割输出文件时连接文件。详情请参阅下文 文件链接 段落。 + +

+ +
--link-to-previous 剪辑-UID + +

+ 连接第一个输出文件到指定 剪辑-UID 参数对应的剪辑。详情请参阅下文 文件链接 段落。 + +

+ + +

+ 若 SID 以“=”开头,则其剩余部分将作为 Matroska 文件解析,将读取并使用该文件的剪辑 UID。 + +

+ +
--link-to-next 剪辑-UID + +

+ 连接最后一个输出文件到指定 剪辑-UID 参数对应的剪辑。详情请参阅下文 文件链接 段落。 + +

+ + +

+ 若 SID 以“=”开头,则其剩余部分将作为 Matroska 文件解析,将读取并使用该文件的剪辑 UID。 + +

+ +
--append-mode 模式 + +

+ 决定追加合并文件时如何计算时间戳。 参数 模式 可以有两个数值: 默认的 + 'file(文件)' 和 'track(轨道)'。 + +

+ + +

+ 当 mkvmerge 将第二个文件 (下称「文件2」) 中的一条轨道 + (「轨道2_1」) 追加合并到第一个文件 (「文件1」) 的一条轨道 + (「轨道1_1」) 时,它将为「轨道2_1」的所有时间戳设定一定量的延时。 + 对于「file」(文件)模式,此延时量是「文件1」中出现的最大时间戳,即使此时间戳不属于轨道「轨道1_1」。而在轨道(track)模式下,此延时为「轨道1_1」本身的最大时间戳。 + +

+ + +

+ 不幸的是 mkvmerge 无法侦测使用哪种模式更为可靠。因此默认为 'file(文件)' + 模式。'file' 模式对单独创建的文件的处理通常更好;例如在追加 AVI 或 + MP4 文件时。'track(轨道)' + 模式对一个大文件的完整分块的处理更好,例如对于 VOBEVO 文件。 + +

+ + +

+ 即使选用了 'track(轨道)' 模式,字母轨道也将按照 + 'file(文件)' 模式处理。 + +

+ +
--append-to + SFID1:STID1:DFID1:DTID1[,...] + +

+ 此选项控制将哪一条轨道追加合并到哪一条轨道。 每组指令由四个 ID 组成: 输入文件 ID 及轨道 ID、目标文件 ID 及目标轨道 ID。 + 第一对,「输入文件 ID」与「输入轨道 ID」确定正要执行追加合并操作的轨道。 第二对,「目标文件 ID」与「目标轨道 + ID」,确定输入轨道即将追加合并到的目标轨道。 + +

+ + +

+ 如果忽略本选项,则将使用标准映射。 标准映射即将当前文件的各个轨道追加到前一个文件的相应轨道(轨道 ID 相同)。 + 当影片被切割为多段,且各文件中轨道数和轨道 ID 相同时,这将允许简单的追加合并,命令行为 mkvmerge -o 输出.mkv + 第一段.mkv +第二段.mkv。 + +

+ +
+ + +

+ 单个 '+' 将追加后面的文件,而不是添加。'+' 也可以直接放在下一个文件名的前面。因此以下两条命令等效: + +

+ +
$ mkvmerge -o 完整.mkv 文件1.mkv + 文件2.mkv
+$ mkvmerge -o 完整.mkv 文件1.mkv +文件2.mkv
+
[ 文件1 文件2 + ] + +

+ 如果方括号内包含多个文件名,则从第二个文件开始的所有文件都将追加合并到括号中第一个文件后面。 + +

+ + +

+ 这是用“+”连接文件名的另一种语法。因此下述两条命令是等效的: + +

+ +
$ mkvmerge -o 完整.mkv 文件1.mkv + 文件2.mkv
+$ mkvmerge -o 完整.mkv '[' 文件1.mkv 文件2.mkv ']'
+
= + +

+ 对特定类型的文件 (MPEG 节目流,即 VOB 文件) mkvmerge(1) + 通常会去输入文件所在的目录寻找是否存在基本文件名一致、仅编号存在差异的文件 + (例如「VTS_01_1.VOB」「VTS_01_2.VOB」「VTS_01_3.VOB」等) + 并将所有文件视为互相串联的单个大文件。此选项——单个「=」——要求 mkvmerge 不要去寻找其他文件。 + +

+ + +

+ '=' 也可以放在下一个文件名的前面。因此以下两条命令等效: + +

+ +
$ mkvmerge -o 完整.mkv = 文件1.vob
+$ mkvmerge -o 完整.mkv =文件1.vob
+
( 文件1 文件2 + ) + +

+ 如果一对圆括号中包含多个文件名,这些文件将被当作连接起来的单个大文件对待,其内容为各文件顺序相连。 + +

+ + +

+ 该功能可用于如 DVD 中的 VOB 文件,或是 MPEG 传输流。如果各文件有独立的头,常见的例子如独立的 AVI 或 MP4 文件,则不适用。 + +

+ + +

+ 将文件名置于括号中还可以阻止 mkvmerge(1) 查找具有相同基名称的文件,如 = + 选项 所述。因此下面两则命令行等效: + +

+ +
$ mkvmerge -o 输出.mkv = 文件.mkv
+$ mkvmerge -o 输出.mkv '(' 文件.mkv ')'
+ +

+ 应该注意的几件事: + +

+ + +
    + +
  1. + +

    + 左括号后、右括号前均必须有空格。 + +

    + +
  2. + + +
  3. + +

    + 括号之间的所有参数都作为文件名解析。因此应用到此逻辑文件的所有选项都必须在左括号之前列出。 + +

    + +
  4. + + +
  5. + +

    + 一些 shell 会将括号作为特殊符号对待。因此您需要像上例这样进行转义或给它们加上引号。 + +

    + +
  6. + +
+ +
+ + + + +

2.6. 附件支持 (其他全局选项)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description 描述 + +

+ 对后面附件的纯文字描述。将应用到下一个 --attach-file + 或 --attach-file-once 选项。 + + +

+ +
--attachment-mime-type MIME 类型 + +

+ 后面附件的 MIME 类型。将应用到下一个 --attach-file + 或 --attach-file-once + 选项。 官方认可的 MIME 类型列表可以在如 IANA 主页 + 找到。MIME 类型对附件来说是必需的。 + +

+ + +

+ 如果没有指定附件的 MIME 类型,则会自动侦测其类型。 + +

+ +
--attachment-name 名称 + +

+ 设置此附件将在输出文件中储存的名称。 如果未给出此选项则将由 --attach-file + 或 --attach-file-once + 选项所设的文件名推得。 + +

+ +
+ --attach-file 文件名, + --attach-file-once 文件名 + + +

+ 在 Matroska(tm) 文件中创建文件附件。MIME 类型必须在使用此选项之前设定。两种形式的不同之处在于使用 + --attach-file 附加的文件在切割过程中将被附加到所有输出文件中,而使用 + --attach-file-once 附加的文件只被附加到创建的首个文件中。如果未使用切割功能,两种形式效果相同。 + +

+ + +

+ 可以使用 mkvextract(1)Matroska(tm) 文件中提取附件文件。 + +

+ +
--enable-legacy-font-mime-types + +

+ 对于特定类型的字体附件,使用传统的 MIME 类型。例如,TrueType + 字体的类型将标注为「application/x-truetype-font」而非「fonts/ttf」。 + +

+ + +

+ 这将同时影响未手动指定 MIME 类型的新附件,以及现有的字体附件,其已存在的 + MIME 类型将被重新映射至传统类型。 + +

+ + +

+ 受影响的 MIME + 类型如下:「font/sfnt」「font/ttf」「font/collection」将全部映射至「application/x-truetype-fonts」,「 + font/otf」将被映射至「application/vnd.ms-opentype」。 + +

+ +
+ + + +

2.7. 用于各输入文件的选项

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks + [!]n,m,... + +

+ 复制 nm 等音频轨。数字是可以通过 --identify + 开关获取的轨道 ID。他们不只是简单的轨道序号(参见 轨道 + ID段落)。默认: 复制所有音频轨道。 + +

+ + +

+ 除轨道 ID 以外,您还可以提供 ISO 639-2 语言代码。仅当输入文件的轨道包含语言标签时可用。 + +

+ + +

+ 默认: 复制该类的所有轨道。 + +

+ + +

+ 若 ID 以 ! 开头,则其意义相反: 复制该类的所有轨道,除了 ! + 后面所列出的轨道。 + +

+ +
-d, --video-tracks + [!]n,m,... + +

+ 复制 nm 等视频轨。数字是可以通过 --identify + 开关获取的轨道 ID。他们不只是简单的轨道序号(参见 轨道 + ID段落)。默认: 复制所有视频轨道。 + +

+ + +

+ 除轨道 ID 以外,您还可以提供 ISO 639-2 语言代码。仅当输入文件的轨道包含语言标签时可用。 + +

+ + +

+ 若 ID 以 ! 开头,则其意义相反: 复制该类的所有轨道,除了 ! + 后面所列出的轨道。 + +

+ +
-s, --subtitle-tracks + [!]n,m,... + +

+ 复制 nm 等字幕轨。数字是可以通过 --identify + 开关获取的轨道 ID。他们不只是简单的轨道序号(参见 轨道 + ID段落)。默认: 复制所有字幕轨道。 + +

+ + +

+ 除轨道 ID 以外,您还可以提供 ISO 639-2 语言代码。仅当输入文件的轨道包含语言标签时可用。 + +

+ + +

+ 若 ID 以 ! 开头,则其意义相反: 复制该类的所有轨道,除了 ! + 后面所列出的轨道。 + +

+ +
-b, --button-tracks + [!]n,m,... + +

+ 复制 nm 等按钮轨。数字是可以通过 --identify + 开关获取的轨道 ID。他们不只是简单的轨道序号(参见 轨道 + ID段落)。默认: 复制所有按钮轨道。 + +

+ + +

+ 除轨道 ID 以外,您还可以提供 ISO 639-2 语言代码。仅当输入文件的轨道包含语言标签时可用。 + +

+ + +

+ 若 ID 以 ! 开头,则其意义相反: 复制该类的所有轨道,除了 ! + 后面所列出的轨道。 + +

+ +
--track-tags + [!]n,m,... + +

+ 复制 nm 等轨道的标签。数字是可以通过 --identify + 开关获取的轨道 ID。他们不只是简单的轨道序号(参见 轨道 + ID段落)。默认: 复制所有轨道的标签。 + +

+ + +

+ 如果 ID 以 ! 作为前缀,则含义相反: 复制除了列在 ! 后面的 ID + 以外的所有轨道。 + +

+ +
-m, --attachments + [!]n[:all|first],m[:all|first],... + +

+ 复制 ID 为 nm + 等的附件到所有或者仅首个输出文件中。各 ID 后可接 ':all'(如果两可选数值均未输入,此为默认值)或者 + ':first'。如果切割功能已被起用,则 ID 被指定为 ':all' + 的附件将被复制到所有生成的输出文件中,而其他附件只被复制到首个输出文件中。如果未使用切割功能则两变量等效。 + +

+ + +

+ 默认复制所有附件到所有输出文件中。 + +

+ + +

+ 如果 ID 以 ! 作为前缀,则含义相反: 复制除了列在 ! 后面的 ID + 以外的所有轨道。 + +

+ +
-A, --no-audio + +

+ 不要从此文件中复制任何音频轨。 + +

+ +
-D, --no-video + +

+ 不要从此文件中复制任何视频轨。 + +

+ +
-S, --no-subtitles + +

+ 不要从此文件中复制任何字幕轨。 + +

+ +
-B, --no-buttons + +

+ 不要从此文件中复制任何按钮轨。 + +

+ +
-T, --no-track-tags + +

+ 不要从此文件中复制任何轨道细节标签。 + +

+ +
--no-chapters + +

+ 不要从此文件中复制章节。 + +

+ +
-M, --no-attachments + +

+ 不要从此文件中复制附件。 + +

+ +
--no-global-tags + +

+ 不要从此文件中复制全局标签。 + +

+ +
-y, --sync + TID:d[,o[/p]] + +

+ 将 id 为 TID 的轨道的时间戳按 d ms + 进行调整。轨道 ID 与 --identify + 所给出的相同 (参见 轨道 ID 段落)。 + +

+ + +

+ o/p: 按 + o/p 调整时间戳以修复线性偏移。如果省略 + p 则默认为 1。o 与 + p 均可为浮点数。 + +

+ + +

+ 默认: 无手动同步校正 (与 d = 0 及 + o/p = 1.0 + 效果相同)。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--cues TID:none|iframes|all + +

+ 控制为指定轨道 (参阅 轨道 ID 段落) 创建何种 cue + 索引。'none(无)' 将阻止 cue 索引的创建。 而 'iframes(仅 i + 帧)' 表示仅将没有前后参考的块 ( = 视频轨道中的 I 帧) 置于 cue + 索引项中。'all(全部)' 将使 mkvmerge(1) 为所有区块创建索引,会使生成的文件非常大。 + +

+ + +

+ 默认值为 'iframes(仅 i 帧)'(视频及字幕轨道)或 + 'none(无)'(音频轨道)。参见 --no-cues + 选项,后者可阻止 cue 条目的创建,无论是否使用了 --cues 选项。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--default-track-flag + TID[:布尔值] + +

+ 若可选参数「布尔值」已设为 1 或不存在该数值,则为指定轨道 + (参见「轨道 ID」段落) + 设置「默认轨」标记。若输入容器未提供此信息,且用户未通过选项参数指定,即会设置该标记。 + +

+ + +

+ 如果用户在播放时不明确选择一条轨道,播放器应选择已设有「默认轨」标记的轨道,同时也应考虑用户偏好设置,例如用户偏好的语言。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--track-enabled-flag + TID[:布尔值] + +

+ 将指定轨道的「轨道启用」标记 (参阅「轨道 ID」段落) 设为指定值 + 布尔值 (0 或1; 若不指定,则默认为 1)。 + 只要没有特别指定选项值,且输入容器也未提供此类信息,轨道均默认为启用状态。 + +

+ + +

+ 只有设置了「轨道启用」标记的轨道才应作为播放器考虑播放的对象。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--forced-display-flag + TID[:布尔值] + +

+ 若可选参数「 布尔值」已设为 1 + 或不存在该数值,则为指定轨道设置「强制显示」标记 (参阅「轨道 + ID」段落)。 此选项适用于包含屏幕显示文字或外语对白翻译的轨道。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--hearing-impaired-flag + TID[:布尔值] + +

+ 若可选参数「布尔值」已设为 1 + 或不存在该数值,则为指定轨道设置「听觉障碍」标记 (参阅「轨道 + ID」段落)。 此标记适用于适合听觉障碍人士使用的轨道。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--visual-impaired-flag + TID[:布尔值] + +

+ 若可选参数「布尔值」已设为 1 + 或不存在该数值,则为指定轨道设置「视觉障碍」标记 (参阅「轨道 + ID」段落)。 此标记适用于适合视觉障碍人士使用的轨道。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--text-descriptions-flag + TID[:布尔值] + +

+ 若可选参数「布尔值」已设为 1 + 或不存在该数值,则为指定轨道设置「文字描述」标记 (参阅「轨道 + ID」段落)。 此标记适用于包含对视频内容的文字描述的轨道,它们适合视觉障碍人士通过文本转语音系统播放。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--original-flag + TID[:布尔值] + +

+ 若可选参数「布尔值」已设为 1 + 或不存在该数值,则为指定轨道设置「原始语言」标记 (参阅「轨道 + ID」段落)。 此标记适用于与内容原始语言一致 (而非翻译) 的轨道。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--commentary-flag + TID[:布尔值] + +

+ 若可选参数「布尔值」已设为 1 + 或不存在该数值,则为指定轨道设置「评论」标记 (参阅「轨道 + ID」段落)。 此标记适用于包含评论内容的轨道。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--track-name TID:名称 + +

+ 将指定轨道 (参见 轨道 ID 段落) 的轨道名称设为 + 名称。 + +

+ +
--language TID:语言 + +

+ 为指定轨道 (参见 轨道 ID) 设置语言。允许使用 ISO + 639-2 语言代码与 ISO 639-1 国家代码。国家代码将被自动转换为语言代码。 可以使用 --list-languages + 选项列出所有语言以及它们的 ISO 639-2 代码。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
-t, --tags TID:文件名 + +

+ 从文件 文件名 读取轨道号为 TID + 的轨道的标签。详情参见下文 标签 段落。 + +

+ +
--aac-is-sbr + TID[:0|1] + +

+ 告诉 mkvmerge(1) ID 为 TID 的轨道是 SBR AAC + (亦作 HE-AACAAC+)。下述情况下需要此选项:a) 输入文件是 + AAC 文件 (不是 Matroska(tm) 文件) 且 b) 该 + AAC 文件含有 SBR AAC 数据。 + 设置此开关的原因是目前技术上无法在不解码一个完整的 AAC 帧的情况下自动分辨普通的 + AAC 数据与 SBR AAC 数据。由于 AAC + 解码器的诸多专利问题,mkvmerge(1) 永远不会包含此解码层。因此此开关对于 SBR AAC + 文件是必需的。如果忽略了此开关,生成的文件可能无法正常回放,甚至可能根本无法播放。 + +

+ + +

+ 如果输入文件是 Matroska(tm) 文件,则已有足够侦测 SBR AAC 的 + CodecID 了。然而,如果 CodecID + 标注错误,此开关可用于更正之。 + +

+ + +

+ 如果 mkvmerge 错将 AAC 文件侦测为 SBR,您可以将 + ':0' 添加到轨道 ID。 + +

+ +
--audio-emphasis TID:n|代号 + +

+ 为轨道 ID 为 TID 的音频轨设置增强算法。参数值可以是数字形式的 + n (介于 0 与 + 16 之间的特定值),也可以是英文代号。所有有效的数值及其代号可通过 + 「--list-audio-emphasis」 选项列出。 + +

+ +
--reduce-to-core 轨道ID + +

+ 有些音频编码的核心是有损的,但提供了可选的扩展来实现无损解码。该选项告诉 mkvmerge(1) + 只复制核心部分,而不复制扩展部分。默认情况下,mkvmerge(1) 会复制全部内容。 + +

+ + +

+ 目前只有 DTS 轨道受此选项影响。嵌入 AC-3 核心的 TrueHD + 轨道以两个轨道的形式呈现,用户可以选择复制哪个轨道。DTS 无法采用这种方案,因为 HD 扩展部分不能单独解码 – 而 + TrueHD 数据可以。 + +

+ +
--remove-dialog-normalization-gain + 轨道ID + +

+ 部分音频编码包含告知解码器/播放器如何应用音量增益(通常是降低)的头部字段,从而实现对白正规化。此选项可让 mkvmerge(1)  + 修改相应头部字段,移除或减小增益。 + +

+ + +

+ 目前只有 AC-3DTSTrueHD + 轨道受此选项影响。 + +

+ +
--timestamps TID:文件名 + +

+ 从 文件名 读取要应用到指定轨道 ID 的时间戳。 这些时间戳将强制覆盖 mkvmerge(1) + 默认计算出的时间戳。参阅关于 外部时间戳文件 的章节。 + +

+ +
--default-duration TID:x + +

+ 强制指定轨道的默认时长为指定数值。 将同时修改轨道的时间戳以匹配该默认时长。 变量 x 必须有 + 's', 'ms', 'us', + 'ns', 'fps', 'p' 或 + 'i' 作为后缀,分别以秒、毫秒、微秒、纳秒、“帧每秒”、“逐行帧每秒”或“隔行帧每秒”为单位指定默认时长。数字 + x 本身可为浮点数或分数。 + +

+ + +

+ 如果未强制指定默认时长,mkvmerge 将尝试继承容器中(及/或特定轨道类型,如 AVC/H.264 或 MPEG-2 + 已编码的位流中)该轨道的默认时长。 + +

+ + +

+ 此选项也可用于在不使用外部时间戳文件的情况下更改视频轨的 FPS(帧率)。 + +

+ +
--fix-bitstream-timing-information + TID[:0|1] + +

+ 通常 mkvmerge(1) 不会更改视频位流中存储的时间同步信息 + (帧/场速率)。本选项可调整此信息,使之与容器的时间同步信息匹配。容器时间同步信息可从多个来源得到: 命令行指定 (参见 --default-duration + 选项)、源容器或从位流得出。 + +

+ + +
+

Note:

+ +

目前仅完成对 AVC/H.264 视频轨的实现。

+ +
+ +
--compression TID:n + +

+ 选择用于轨道的压缩算法。请注意,播放器也需要支持该算法才能正常播放。有效的值有 + 'none(不压缩)'、'zlib' 以及 + 'mpeg4_p2'/'mpeg4p2'。 + +

+ +

+ 压缩方式 'mpeg4_p2'/'mpeg4p2' 是一种称为 '去头' + 的特殊压缩方式,只对 MPEG4 part 2 视频轨可用。 + +

+ +

+ 部分字幕类型的默认压缩算法为 + 'zlib'。该算法也是大多数(如果不是所有)回放应用程序所支持的算法。无法保证对其他压缩算法的支持('none(不压缩)' + 除外)。 + +

+ +
+ + + +

2.8. 仅用于视频轨的选项

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc + TID:FourCC + +

+ 强制 FourCC 为指定值。仅对 '微软兼容模式' 的视频轨有效。 + +

+ +
--display-dimensions TID:宽度x高度 + +

+ Matroska(tm) 文件含有两个设定播放器回放时应当将画面缩放到的显示属性值: 显示宽度与显示高度。 可以使用本选项设定这些数值,如 + '1:640x480'。 + +

+ + +

+ 指定所用数值的其他方法是使用 --aspect-ratio + 或 --aspect-ratio-factor + 选项 (参见下文)。 这些选项是互相独立的。 + +

+ +
--aspect-ratio TID:宽高比|宽度/高度 + +

+ Matroska(tm) 文件含有两个设定播放器回放时应当将画面缩放到的显示属性值: 显示宽度与显示高度。 通过本选项 mkvmerge(1) + 可自动根据画面原始宽高和本选项给定的宽高比计算出显示宽度和显示高度。 宽高比可以以浮点数 宽高比 或分数 + '宽度/高度' 的形式给出,如 + '16/9'。 + +

+ + +

+ 指定所用数值的其他方法是使用 --aspect-ratio-factor + 或 --display-dimensions + 选项 (参见上下文)。这些选项相互独立。 + +

+ +
--aspect-ratio-factor TID:系数|n/d + +

+ 另一种设置宽高比的方法是指定一个 系数。将将原始宽高比与 + 系数 相乘后用作目标宽高比。 + +

+ + +

+ 指定所用数值的其他方法是使用 --aspect-ratio + 或 --display-dimensions + 选项 (参见上文)。这些选项互相独立。 + +

+ +
--cropping TID:左,上,右,下 + +

+ 将视频轨道的像素裁减参数设为指定数值。 + +

+ +
--color-matrix-coefficients TID:n + +

+ 设置视频从红绿蓝三原色衍生出亮度及色度值所用的矩阵系数。参数 n 是范围从 + 010 的整数。 + +

+ + +

+ 有效的值及其含义如下: + +

+ + +

+ 0: GBR, 1: BT709, + 2: unspecified, 3: reserved, + 4: FCC, 5: BT470BG, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 非恒定亮度, + 10: BT2020 恒定亮度 + +

+ +
--color-bits-per-channel TID:n + +

+ 设置颜色通道编码位数。数值 0 表示位数未指定。 + +

+ +
--chroma-subsample TID:水平,垂直 + +

+ 对 Cr 与 Cb 通道中未移除的像素,水平/垂直方向需要移除的像素数量。 + +

+ + +

+ 例如: 对于色度抽样为 4:2:0 的视频,该参数应设为 + TID:1,1。 + +

+ +
--cb-subsample TID:水平,垂直 + +

+ 对 Cb 通道中未移除的像素,水平/垂直方向需要移除的像素数量。该数值将与 --chroma-subsample + 相加。 + +

+ + +

+ 例如: 对于色度抽样为 4:2:1 的视频,参数 --chroma-subsample 应设为 + TID:1,0,Cb + 抽样应设为 + TID:1,0。 + +

+ +
--chroma-siting TID:水平,垂直 + +

+ 设置色度在水平/垂直方向上如何抽样 (0: 未指定, 1: + 顶部/左侧合并, 2: 对半)。 + +

+ +
--color-range TID:n + +

+ 设置色域裁剪 (0: 未指定, 1: 广播色域, + 2: 完整色域 (无裁剪), 3: 由 + MatrixCoefficients/TransferCharacteristics 指定)。 + +

+ +
--color-transfer-characteristics + TID:n + +

+ 视频的传输特征。 + +

+ + +

+ 有效的值及其含义如下: + +

+ + +

+ 0: 保留, 1: ITU-R BT.709, + 2: 未指定, 3: 保留, + 4: gamma 2.2 曲线, 5: gamma 2.8 曲线, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: 线性, 9: 对数, + 10: 对数平方根, 11: IEC 61966-2-4, + 12: ITU-R BT.1361 扩展色域, 13: IEC + 61966-2-1, 14: ITU-R BT.2020 10 位, + 15: ITU-R BT.2020 12 位, 16: SMPTE + ST 2084, 17: SMPTE ST 428-1; 18: + ARIB STD-B67 (HLG) + +

+ +
--color-primaries TID:n + +

+ 设置视频的颜色基准。 + +

+ + +

+ 有效的值及其含义如下: + +

+ + +

+ 0: 保留, 1: ITU-R BT.709, + 2: 未指定, 3: 保留, + 4: ITU-R BT.470M, 5: ITU-R + BT.470BG, 6: SMPTE 170M, 7: SMPTE + 240M, 8: FILM, 9: ITU-R BT.2020, + 10: SMPTE ST 428-1, 22: JEDEC P22 + 磷光体 + +

+ +
--max-content-light TID:n + +

+ 设置单个像素的最高亮度 (Maximum Content Light Level 最大内容亮度级别),单位为坎德拉每平方米 (cd/m²)。数值 + n 应为非负整数。 + +

+ +
--max-frame-light TID:n + +

+ 设置单个完整帧的最高亮度 (Maximum Frame-Average Light Level 最大帧平均亮度级别),单位为坎德拉每平方米 + (cd/m²)。数值 n 应为非负整数。 + +

+ +
--chromaticity-coordinates + TID:red-x,red-y,green-x,green-y,blue-x,blue-y + +

+ 设置 CIE 1931 定义的红/绿/蓝色度坐标。 + +

+ +
--white-color-coordinates TID:x,y + +

+ 设置 CIE 1931 定义的白色色度坐标。 + +

+ +
--max-luminance TID:浮点数 + +

+ 设置最高亮度,单位为坎德拉每平方米 (cd/m²)。数值应小于 9999.99。 + +

+ +
--min-luminance TID:浮点数 + +

+ 设置最低亮度,单位为坎德拉每平方米 (cd/m²)。数值应小于 999.9999。 + +

+ +
--projection-type TID:方式 + +

+ 设置要使用的视频投影方式。有效值包括:0 (方形投影), 1 (等距圆柱投影), 2 (立方面投影), 3 (网状投影)。 + +

+ +
--projection-private TID:数据 + +

+ 设置仅用于特定投影方式的私有数据。数据格式为十六进制数字,可以有 "0x" 前缀,可以有空格。 + +

+ +
--projection-pose-yaw TID:浮点数 + +

+ 设置投影的水平平面旋转(yaw,上下轴不动)。 + +

+ +
--projection-pose-pitch TID:浮点数 + +

+ 设置投影的上下旋转(pitch,左右轴不动)。 + +

+ +
--projection-pose-roll TID:浮点数 + +

+ 设置投影的垂直平面旋转(roll,前后轴不动)。 + +

+ +
--field-order TID:n + +

+ 设置轨道 ID 为 TID 的视频轨道的场序。场序必须为以下数字之一: + +

+ + +

+ 0: 逐行扫描; 1: 隔行扫描,顶场先显示,顶场先存储; + 2: 未定场序; 6: 隔行扫描,底场先显示,底场先存储; + 9: 隔行扫描,底场先显示,顶场先存储; 14: + 隔行扫描,顶场先显示,底场先存储 + +

+ +
--stereo-mode TID:n|代号 + +

+ 为轨道 ID 为 TID 的视频轨道设置立体模式。模式值可以是数字形式的 + n(介于 014 + 之间)或英文代号。所有有效的数值及其代号可通过 「--list-stereo-modes」 + 选项列出。 + +

+ +
+ + + +

2.9. 仅适用于文本字幕轨道的选项

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset TID:字符集 + +

+ 指定轨道 ID 对应的字符集,用于将字幕转换为 UTF-8 编码。如果未指定字符集,则将根据当前区域设置推算字符集。注意,对于从 Matroska(tm) + 文件或 Kate 流中读取的字幕不必指定字符集,因为这些字幕总是以 UTF-8 编码存储。关于 mkvmerge(1) + 如何转换不同字符集的说明,请参见关于 + 文本文件与字符集的段落。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
+ + + +

2.10. 其他选项

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify 文件名 + +

+ 将使 mkvmerge(1) 探查单个文件并报告其类型、文件中包含的轨道及其轨道 ID。如果使用了本选项,唯一可用的其他选项就是文件名。 + +

+ + +

结果的输出格式可以通过 --identification-format + 选项修改。 +

+ +
-J 文件名 + +

+ 等同于“--identification-format json --identify 文件名”的简便写法。 + +

+ +
-F, --identification-format + 格式 + +

+ 决定 --identify + 选项使用的输出格式。支持下列格式: text (文本,未使用该选项时的默认值) 以及 + json。 + +

+ + +
    + +
  1. + +

    text 格式简短且适合人类阅读。每项 (容器、轨道、附件等) 占一行。 +

    + + +

    该格式不应该用来解析。输出内容会翻译为 mkvmerge(1) 所使用的语言 (参见 --ui-language)。 +

    + +
  2. + + +
  3. + +

    + json 格式输出机器可读的 JSON 表达式。此格式遵循该文件所描述的 JSON 规范: + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + 所有版本的 JSON 规范可在线获取,也可在发布的源码压缩包中找到。 + +

    + +
  4. + +
+ +
--probe-range-percentage 百分比 + +

+ 部分文件类型,如 MPEG 节目流及传输流 + (.vob.m2ts),需要解析一定量的数据,方可侦测出文件中所包含的所有轨道。该数据量为输入文件大小的 + 0.3% 或 10 MB,取其中较高者。 + +

+ + +

+ 如果已知轨道存在,但未能找到,可以通过本选项更改探测百分比。 最小值 10 MB 为内置参数,无法更改。 + +

+ +
--list-audio-emphasis + +

+ 列出 「--audio-emphasis」 + 选项所支持的所有有效数值及其对应的英文代号。 + +

+ +
--list-languages + +

+ 列出所有语言及其 ISO 639-2 代码,这些代码可以在 --language + 选项中使用。 + +

+ +
--list-stereo-modes + +

+ 列出 「--stereo-mode」 + 选项所支持的所有有效数值及其对应的英文代号。 + +

+ +
-l, --list-types + +

+ 列出受支持的输入文件类型。 + +

+ +
--priority 优先级 + +

+ 设置 mkvmerge(1) 运行时的进程优先级。有效的值为 'lowest(最低)', + 'lower(较低)', 'normal(普通)', + 'higher(较高)' 与 + 'highest(最高)'。如果未予设定,则使用 + 'normal(普通优先级)'。在 类-Unix 系统中 mkvmerge(1) 将使用 + nice(2) + 功能。因此只有超级用户才能使用 'higher(较高优先级)' 与 + 'highest(最高优先级)'。对于 Windows 用户来说所有值都可用。 + +

+ + +

选择'lowest' 不仅使用尽可能低的进程优先级,还会让 mkvmerge(1) 选择空闲 I/O 优先级。 +

+ +
--command-line-charset 字符集 + +

+ 设定在命令行给出的字符串的字符集,用于转为其他字符集。默认为系统当前区域设置中所给定的字符集。此设置将应用到以下选项的变量: --title--track-name + 及 --attachment-description。 + +

+ +
--output-charset 字符集 + +

+ 设置输出的字符串应被转换到何种字符集。默认为系统当前区域设置中所给定的字符集。 + +

+ +
-r, --redirect-output + 文件名 + +

+ 将所有信息输出至文件 文件名 而不是在命令行显示。 + 尽管该操作可以用输出重定向轻松实现,但在某些情况下还需要靠它:如当终端在写入文件之前重新解释(覆盖输出)时。 将优先使用通过 --output-charset + 设定的字符集。 + +

+ +
--flush-on-close + +

+ 让程序在关闭以写入模式打开的文件时,强制将内存中已缓存的所有数据写入到存储设备。可用于在电源中断时避免数据损失,或规避操作系统或驱动程序的特定问题。缺点是混流耗时更长,因为 + mkvmerge 在退出前需要等待所有数据写入存储设备。关于优劣的深入讨论,请参见 MKVToolNix bug 跟踪平台中的问题 #2469 与问题 + #2480。 + +

+ +
--ui-language 语言代码 + +

+ 强制使用 语言代码 所对应的翻译 (例如 'de_DE' + 表示德文翻译)。在 语言代码 处输入 'list' + 可让程序输出可用翻译的列表。 + +

+ +
--abort-on-warnings + +

+ 让程序在出现警告时即中止。程序的退出代码将返回 1。 + +

+ +
--deterministic 种子值 + +

+ 启用完全确定模式。若使用的 mkvmerge(1) + 版本相同,且输入文件、选项参数及种子值完全相同,则会创建二进制层面完全一致的文件。注意,此模式下不会写入剪辑信息的「date」字段。 + +

+ + +

种子值可以是任意字符串,并不非得是数字。

+ + +

+ 需要满足下列条件才能确保生成二进制层面完全相同的文件: + +

+ + +
    + +
  1. + +

    相同版本的 mkvmerge(1),且编译时使用相同版本的 ibEBML 及 libMatroska。 +

    + +
  2. + + +
  3. + +

    所用的输入文件在二进制层面完全一致。

    + +
  4. + + +
  5. + +

    所使用的命令行选项及顺序完全相同 (唯一的例外是「--output …」)。 +

    + +
  6. + +
+ + +

+ 使用其他版本的 mkvmerge(1) 或其他命令行选项也有可能输出完全一致的文件,但作者不作任何保证。 + +

+ +
--debug 主题 + +

+ 为特定功能开启调试。该选项仅对开发者有用。 + +

+ +
--engage 功能 + +

+ 开启实验性功能。可用功能列表可通过 mkvmerge --engage list + 得到。这些功能在正常情况下不应该使用。 + +

+ +
--gui-mode + +

+ 打开 GUI 模式。该模式下,将输出特殊格式的行,告知目前受控的 GUI + 的行为。这些消息遵从格式「#GUI#消息」。消息可能包括键值对,如「#GUI#消息#键1=值1#键2=值2…」。消息内容及键的内容不作翻译,总是以英语输出。 + +

+ +
@选项文件.json + +

+ 从文件 选项文件 读取其他命令行参数。更多信息请参见关于 选项文件 的段落。 + +

+ +
--capabilities + +

+ 列出编译时附加的可选功能并退出。输出信息的第一行是版本信息。接下来的每行包含一个单词,各单词的出现意味着编译时附加了相应功能。这些功能包括: + +

+ + +
    + +
  • + +

    + 'FLAC' -- 读取原始 FLAC 文件,以及处理其他容器中的 + FLAC 轨道,例如 Ogg(tm)Matroska(tm) + 容器中的。 + +

    + +
  • + +
+ +
-h, --help + +

+ 显示用法信息并退出。 + +

+ +
-V, --version + +

+ 显示版本信息并退出。 + +

+ +
+ + +

3. 用法

+ + +

+ 用户可以选择各文件中 mkvmerge(1) 应该使用的轨道。它们都将被封装到 -o 所指定的文件中。可通过 + -l 选项获取已知(且受支持的)输入格式列表。 + +

+ + +
+

Important:

+ +

+ 命令行选项的顺序很重要。若您对程序还不熟悉,请阅读「选项顺序」段落。 + +

+ +
+ +

4. 选项顺序

+ + + +

+ 输入选项的顺序对一些选项很重要。选项可归为两类: + +

+ + +
    + +
  1. + +

    + 影响整个程序的选项不与任何输入文件有关。这些选项包括但不限于 + --command-line-charset--output 或 + --title。这些选项可在命令行的任意位置出现。 + +

    + +
  2. + + +
  3. + +

    + 影响单个输入文件或输入文件中的单个轨道的选项。这些选项均应用到命令行中接着的输入文件。所有应用到同一输入文件(或其轨道)的选项可以以任意顺序书写,只要都出现在该输入文件名之前。应用到输入文件的选项如 + --no-chapters 或 + --chapter-charset。应用到单个轨道的选项如 + --default-duration--language。 + +

    + +
  4. + +
+ + +

+ 选项从左向右处理。如果同一个选项在同一范围内出现多次,将使用最后一次给出的参数。因此在下面的例子中,标题将被设为 "其他东东": + +

+ +
$ mkvmerge -o 输出.mkv --title '这个内个' input.avi --title '其他东东'
+ +

+ 下面的例子中可以两次使用 --language 选项,因为在不同范围内使用。尽管应用到同一轨道 + ID,但应用到的是不同的输入文件,因此属于不同范围: + +

+ +
$ mkvmerge -o 输出.mkv --language 0:fre 法语.ogg --language 0:deu 德语.ogg
+

5. 示例

+ + +

+ 假定您有个名为 我的影片.avi 的文件,以及分开存放的音频轨如 '我的影片.wav'。您希望先将音频编码为 + OggVorbis(tm): + +

+ +
$ oggenc -q4 -o 我的影片.ogg 我的影片.wav
+ +

+ 几分钟后您就可以合并视频和音频了: + +

+ +
$ mkvmerge -o 我的有声影片.mkv 我的影片.avi 我的影片.ogg
+ +

+ 如果您的 AVI 文件已经含有一条音频轨,则将同时复制该轨道(只要 mkvmerge(1) + 支持该音频格式)。要避免此状况,只需要这样 + +

+ +
$ mkvmerge -o 我的有声影片.mkv -A 我的影片.avi 我的影片.ogg
+ +

+ 又过了几分钟,您又制作了另一条音频轨,如 导演评论或者是另一种语言的配音,您生成的文件名是 + '我影片的另一音轨.wav'。 再进行一次编码操作,然后将其合并: + +

+ +
$ oggenc -q4 -o我影片的另一音轨 我影片的另一音轨.wav
+$ mkvmerge -o 影片-成品.mkv 我的有声影片.mkv 我影片的另一音轨.ogg
+ +

+ 照下面的做法结果相同 + +

+ +
$ mkvmerge -o 我的影片-成品.mkv -A 我的影片.avi 我的影片.ogg 我影片的另一音轨.ogg
+ +

+ 现在开启 mplayer(tm) 尽情享受吧。如果您有多条音频轨(或者甚至是视频轨),那么您可以通过 + '-vid' 与 '-aid' 选项告诉 + mplayer(tm) 应该播放哪些轨道。这些是基础功能,不区分视频与音频。 + +

+ + +

+ 如果您需要同步音频轨,会非常容易。首先找清 Vorbis 轨道的轨道 ID + +

+ +
$ mkvmerge --identify 错开了的.ogg
+ +

+ 现在您可以在下述命令行中使用该 ID: + +

+ +
$ mkvmerge -o 同步了的.mkv -A 源.avi -y 12345:200 错开了的.ogg
+ +

+ 这将在 '错开了的.ogg' 中 ID 为 12345 + 的音频轨的开头添加 200ms 的静音。 + +

+ + +

+ 有些影片在开头同步正常,但音画同步会慢慢偏离开。对此类影片您可以指定延时系数,该系数将被应用到所有时间戳 -- + 不添加或移除任何数据。因此如果您所设定的系数过大或过小会造成很糟糕的结果。例如我转码的一期节目有 77340 + 帧长,在结尾处有 0.2 秒的同步偏离。在 29.97fps + 帧率下大约是每 6 帧错开 0.2 秒。于是我这样操作 + +

+ +
$ mkvmerge -o 同步了的.mkv -y 23456:0,77346/77340 错开了的.mkv
+ +

+ 搞定了。 + +

+ + +

+ 同步选项对字幕同样起作用。 + +

+ + +

+ 对于文本字幕,您既可以选用一些 Windows 软件(如 SubRipper(tm))或 + 'contrib/subrip' 目录 + transcode(1) + 的源码中的 subrip(tm) 包。大体过程是这样的: + +

+ + +
    + +
  1. + +

    从输入文件中提取原始字幕流:

    +
    $ tccat -i /DVD/文件/的/路径/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o 我的影片
    +
  2. + + +
  3. + +

    使用 gocr 将生成的 PGM 图像转为文本:

    +
    $ pgm2txt mymovie
    +
  4. + + +
  5. + +

    对生成的文本文件进行拼写检查:

    +
    $ ispell -d american *txt
    +
  6. + + +
  7. + +

    将文本文件转为 SRT 文件:

    +
    $ srttool -s -w -i mymovie.srtx -o mymovie.srt
    +
  8. + +
+ + +

+ 这样生成的文件可用作 mkvmerge(1) 的输入文件: + +

+ +
$ mkvmerge -o 我的影片.mkv 我的影片.avi 我的影片.srt
+ +

+ 如果您希望为指定轨道指定语言,这将很容易完成。首先找到您所需语言的 ISO 639-2 代码。mkvmerge(1) 会为您列出所有代码: + +

+ +
$ mkvmerge --list-languages
+ +

+ 在列表中找到您所需的语言。假定您已在 Matroska(tm) 文件中放入两条音轨,并希望设置它们的语言代码,两条轨道的轨道 ID 为 2 和 + 3。可以这样操作 + +

+ +
$ mkvmerge -o 含语言代码的.mkv --language 2:ger --language 3:dut 无语言代码的.mkv
+ +

+ 如您所见,--language + 开关可多次使用。 + +

+ + +

+ 或许您还想让荷兰语作为默认语言。您还有其他语言的字幕,如英语和法语的,并希望让播放器默认显示法语字幕。可以这样操作 + +

+ +
$ mkvmerge -o 含语言代码的文件.mkv --language 2:ger --language 3:dut --default-track-flag 3 无语言代码的文件.mkv --language 0:eng 英文字幕.srt --default-track-flag 0 --language 0:fre 法文字幕.srt
+ +

+ 如果您在 mkvinfo(1) 的输出信息中没找到您指定的语言或默认轨标记,请参阅关于 默认值 的段落。 + +

+ + +

+ 关闭针对某输入文件的压缩。 + +

+ +
$ mkvmerge -o 无压缩.mkv --compression -1:none 我的影片.avi --compression -1:none 我的影片.srt
+ +

6. 轨道 ID

+ + + +

6.1. 常规轨道 ID

+ + + +

+ mkvmerge(1) 的一些选项要求提供轨道 ID 以指定应应用到的轨道。 当读取器分离当前输入文件时,或者使用 --identify + 选项调用 mkvmerge(1) 时这些轨道 ID 会被显示出来。此类输出的一个示例: + +

+ +
$ mkvmerge -i v.mkv
+文件 'v.mkv': 容器: Matroska
+轨道 ID 0: 视频 (V_MS/VFW/FOURCC, DIV3)
+轨道 ID 1: 音频 (A_MPEG/L3)
+ +

+ 不要混淆输出 MKV 文件时所分派的轨道 ID与输入文件的轨道 ID。只有输入文件的轨道 ID 可用于需要轨道 ID 值的选项。 + +

+ + +

+ 还需注意,每个输入文件有其自己的一组轨道 ID。因此通过 'mkvmerge --identify' 报告的文件 + '文件1.扩展名' 的轨道 ID 不随其他输入文件的数量或 + '文件1.扩展名' 所用到的位置变化。 + +

+ + +

+ 轨道 ID 通常这样分配: + +

+ + +
    + +
  • + +

    + AVI 文件: 视频轨 ID 为 0。音频轨的 ID 由 1 开始升序分配。 + +

    + +
  • + + +
  • + +

    + AACAC-3MP3SRT + 与 WAV 文件: 此类文件中唯一的 '轨道' 的 ID 为 0。 + +

    + +
  • + + +
  • + +

    + 大多数其他文件: 轨道 ID 按在文件中被找到的顺序由 0 开始分配。 + +

    + +
  • + +
+ + +

+ 使用轨道 ID 的选项的描述中均含有 'TID'。此外下列选项也使用轨道 ID: + --audio-tracks--video-tracks--subtitle-tracks--button-tracks + 以及 --track-tags。 + +

+ + + +

6.2. 特殊轨道 ID

+ + + +

+ 一些 ID 具有特殊含义,不会出现在 id 输出结果中。 + +

+ + +

+ 特殊的轨道 ID '-1' 是个百搭号,它将使给定的开关应用到从输入文件中读到的所有轨道。 + +

+ + +

+ 特殊轨道 ID '-2' 指输入文件中的章节。目前只有 --sync + 选项会用到此特殊 ID。--sync -2:…--chapter-sync … + 等效。 + +

+ + +

7. Language handling

+ + + +

+ Matroska(tm) has support for two different types of language elements: the + old, deprecated "Language" element containing ISO 639-2 alpha 3 codes and + the new "LanguageIETF" tags containing IETF BCP 47 language tags. All of + mkvmerge(1)'s options that accept a language accept a BCP 47 language + tag. mkvmerge(1) will derive the value for the deprecated "Language" element + from the BCP 47 language tags wherever possible. + +

+ + +

+ When identifying a file in JSON mode, existing "LanguageIETF" track header + elements will be output as the language_ietf track + property. + +

+ + +

+ When writing a file mkvmerge(1) will always write the "LanguageIETF", + "ChapLanguageIETF" and "TagLanguageIETF" elements (the latter two only if + chapters or tags are written respectively). In addition to those elements + the corresponding old elements will be written; they'll be set to the ISO + 639-2 code portion of the BCP 47 language tag. For example, when the track + language is set to sr-Cyrl-RS "LanguageIETF" will be set + to sr-Cyrl-RS and the old "Language" element will be set + to srp. + +

+ + +

+ When reading existing files (Matroska files, XML chapter or tag files etc.) + that already contain "…LanguageIETF" elements the existing elements will be + kept. Otherwise "…LanguageIETF" elements will be added based on command-line + options and other existing deprecated "…Language" elements. + +

+ + +

+ The creation of the new elements can be disabled completely with the + command-line option --disable-language-ietf which operates + on all three new elements. + +

+ + +

+ You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. + +

+ +

8. 文本文件与字符集转换

+ + +
+

Note:

+ +

+ 此段落可应用到 MKVToolNix 中的所有程序,尽管该段仅提及了 mkvmerge(1)。 + +

+ +
+ + +

8.1. 介绍

+ + +

+ Matroska(tm) 文件中的所有文本均使用 UTF-8 编码。这意味着 mkvmerge(1) + 需要将读取到的文本文件以及从命令行收到的文本从其他字符集转换为 UTF-8。相反,这意味着 mkvmerge(1) 的输出信息同样需要由 UTF-8 + 转回原来的字符集,例如来自 --ui-language + 所选的非英语界面或来自 Matroska(tm) 文件中的文本。 + +

+ + +

+ mkvmerge(1) 根据是否有 字节顺序标记 (英文缩写: BOM) + 出现以及系统的当前区域来进行自动转换。如何根据区域推定字符集取决于 mkvmerge(1) 所执行在的操作系统。 + +

+ + + +

8.2. 字节序标记 (BOM)

+ + + +

+ 以 BOM 开头的文本文件已经使用 UTF 的某一种模式进行编码。mkvmerge(1) 支持以下五种模式: UTF-8、UTF-16 小端序 (LE) + 及大端序 (BE)、UTF-32 小端序 (LE) 及大端序 (BE)。含 BOM 的文本文件将被自动转换为 UTF-8。任何对此类文件指定字符集的参数 + (如 --sub-charset) + 将被直接忽略,且不输出提示信息。 + +

+ + + +

8.3. Linux 及类 Unix 系统,包括 macOS

+ + + +

+ 在 类-Unix 系统 mkvmerge(1) 将使用 + setlocale(3) + 系统指令,它将返回环境变量 LANGLC_ALL 及 + LC_CYPE。输出的字符集通常是 UTF-8 或 ISO-8859-* + 家族之一,将被用于所有文本文件操作以及编码命令行上的字符串和输出到命令行。 + +

+ + + +

8.4. Windows

+ + + +

+ 在 Windows 平台,用于转换文本文件的默认字符集由系统调用 GetACP() 的结果决定。 + +

+ + +

+ 读取命令行参数通过 GetCommandLineW() 函数完成,该函数所返回的已经是 Unicode + 字符串。因此选项 --command-line-charset 在 Windows 平台是被忽略的。 + +

+ + +

+ 输出到控制台分为三种情况: + +

+ + +
    + +
  1. + +

    + 若使用 --redirect-output + 选项重定向输出,则默认字符集为 UTF-8。可以通过 --output-charset + 修改。 + +

    + +
  2. + + +
  3. + +

    + 若输出内容通过 cmd.exe 自身重定向,例如 mkvinfo 文件.mkv > + info.txt,则其字符集必为 UTF-8,且无法修改。 + +

    + +
  4. + + +
  5. + +

    + 否则 (直接写入控制台) 将使用 Windows 函数 WriteConsoleW() 并忽略 --output-charset + 选项。控制台应该能够输出已安装对应语言支持的所有 Unicode 字符 (如汉字在英文版 Windows 可能不会正常显示)。 + +

    + +
  6. + +
+ + + +

8.5. 命令行选项

+ + + +

+ 现有下述选项支持指定字符集: + +

+ + +
    + +
  • + +

    + --sub-charset + 用于文本字幕文件以及存储于字符集含糊的容器格式(如 Ogg 文件)中的文本字幕轨, + +

    + +
  • + + +
  • + +

    + --chapter-charset + 用于章节文本文件以及存储于字符集含糊的容器格式(如 Ogg 文件的章节信息,轨道和文件标题等;MP4 文件的章节信息)中的章节和文件标题, + +

    + +
  • + + +
  • + +

    + --command-line-charset + 用于所有命令行上的字符串, + +

    + +
  • + + +
  • + +

    + --output-charset + 所有写入控制台的或通过 --redirect-output + 选项重定向到文件的字符串的输出字符集。非 Windows 系统下,默认的输出字符集为系统的当前字符集。在 Windows 平台,默认为 + UTF-8,包括通过 --redirect-output + 的重定向以及 cmd.exe 自身的重定向,如 mkvinfo file.mkv > + info.txt。 + +

    + +
  • + +
+ + +

9. 选项文件

+ + + +

+ mkvmerge(1) 可从选项文件中读取额外的命令行参数。这样可以规避 shell 或操作系统在执行外部程序时的特定限制,如命令行长度的限制。 + +

+ + +

+ 包含 JSON 格式数据的选项文件。其内容必须为有效的 JSON 数组,数组元素只能为 JSON 字符串。文件编码必须为 + UTF-8。文件开头不需要有字节序标记 (byte order marker,BOM),但即使有也没关系,会跳过它。 + +

+ + +

+ 在 JSON 内部转义特殊字符的规则请见官方 JSON 规范 RFC 7159。 + +

+ + +

+ 选项文件名本身应添加前缀字符「@」在命令行参数给出。 + +

+ + +

+ 命令行“mkvmerge -o "我的文件.mkv" -A "一部影片.avi" 声音.ogg”可以转换为下述 + JSON 选项文件,文件可以命名为“选项.json”: + +

+ +
[
+  "-o",
+  "c:\\Matroska\\我的文件.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "一部影片.avi",
+  "声音.ogg"
+]
+ +

+ 对应的命令行则为「mkvmerge @选项文件.json」。 + +

+ +

10. 文件链接

+ + +

+ Matroska(tm) 支持文件链接,即声明当前文件的前趋与后继文件是哪个文件。严谨地讲,被连接的不是文件而是 Matroska(tm) + 剪辑。鉴于大多数文件只含有一个 Matroska(tm) 剪辑,以下说明中将使用术语 '文件链接',尽管 '剪辑链接' 更为贴切。 + +

+ + +

+ 各剪辑由唯一的 128 位宽的剪辑 UID 确定。此 UID 是由 mkvmerge(1) 自动创建的。链接主要通过将前后文件的剪辑 UID (英文缩写: + SID) 置于剪辑头部信息中完成。mkvinfo(1) 会在找到 SID 时输出它们。 + +

+ + +

+ 如果文件被切割为多段,且启用了链接功能,则文件的时间戳不会重新从 0 + 开始,而是会从上一个文件结束的地方继续计算。这样可以保留绝对时间,即使之前的文件不可用 (如进行流式处理时)。如果未使用链接功能,各文件的时间戳应从 0 + 开始。mkvmerge(1) 默认不启用文件链接。如果您希望启用,可以通过 --link + 选项打开。此选项仅当同时启用切割功能时有用。 + +

+ + +

+ 无论是否开启了切割功能,用户都可以让 mkvmerge(1) 将生成的文件与指定的 SID 建立链接。可通过 + --link-to-previous--link-to-next 选项实现。 + 这些选项只接受 mkvinfo(1) 所输出的剪辑 SID 格式: 16 个 + 0x000xff 之间的十六进制数,各数字带有 + '0x' 前缀,如 '0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e + 0xae 0x78 0xeb 0xb4 0x5e 0xca 0xb3 0x93'。还可以选用另一种较短的格式: 16 个 + 0x000xff 之间的十六进制数,无 + '0x' 前缀,无空格,如 + '41da7366d9cfb21eae78ebb45ecab393'。 + +

+ + +

+ 如果启用了切割功能,第一个文件将与通过 --link-to-previous 给定的 + SID 建立链接,而最后一个文件将与通过 --link-to-next 给定的 + SID 建立链接。如果未启用切割功能,唯一的输出文件将同时与给定的两个 SID + 建立链接。 + +

+ +

11. 默认值

+ + +

+ Matroska(tm) 规范提到,一些元素有其默认值。通常为了节省空间,如果一个元素的值等同于其默认值,它将不被写入文件。用户在 mkvinfo(1) + 的输出信息中可能发现缺失的元素有 语言默认轨标记。 + 语言 的默认值是 English + ('eng'),默认轨标记 的默认值是 + true。因此如果您对一条轨道应用选项 --language 0:eng + ,它将不在 mkvinfo(1) 的输出信息中显示。 + +

+ +

12. 附件

+ + +

+ 或许您希望将一些照片与您的 Matroska(tm) 文件一起存放,或者您正在使用 SSA 字幕,需要一个非常稀有的特殊 + TrueType(tm) 字体。这种情况下您可以将这些文件附加到 Matroska(tm) + 文件中。它们不会被追加到文件当中,而是被嵌入到文件中。然后播放器就可以显示这些文件 (如 '照片' 一例) 或者用它们来渲染字幕 (如 + 'TrueType(tm) 字体' 一例)。 + +

+ + +

+ 这是关于如何在输出文件中附加照片和 TrueType(tm) 字体的示例: + +

+ +
$ mkvmerge -o 输出.mkv -A 视频.avi 声音.ogg \
+  --attachment-description "乐队与我在后台小聚" \
+  --attachment-mime-type image/jpeg \
+  --attach-file 乐队与我.jpg \
+  --attachment-description "难得一见的绝美字体" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file 超酷的字体.ttf
+ +

+ 如果含有附件的 Matroska(tm) 文件被用作输入文件,mkvmerge(1) 会将附件复制到新文件中。要复制哪些文件、不复制那些文件的选择可以通过 + --attachments + 与 --no-attachments + 选项修改。 + +

+ +

13. 章节

+ + +

+ Matroska(tm) 章节系统比大家知道的旧系统—— OGM 中所使用的——更为强大。完整的规范可以在 Matroska 网站 找到。 + +

+ + +

+ mkvmerge(1) 支持输入两种章节文件。第一种格式,叫作 '简单章节格式',与 OGM tools + 所用的相同。第二种是基于 XML 的章节格式,它支持 Matroska(tm) 的所有章节功能。 + +

+ + +

+ 除了专用的章节文件格式以外,mkvmerge(1) 还能够从其他文件格式读取章节数据 (如 MP4、Ogg、Blu-ray 以及 DVD 光盘)。 + +

+ + +

13.1. 简单章节格式

+ + + +

+ 此格式由成对的相继以 'CHAPTERxx=' 与 + 'CHAPTERxxNAME=' 开头的行组成。单数行包含起始时间戳,而双数行包含标题。这是一个示例: + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=导入部分
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=宝宝准备摇
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=宝宝摇屋子
+ +

+ mkvmerge(1) 会将每一组/行内容转换为一个 Matroska(tm) ChapterAtom + 元素,但不含设置 ChapterTrackNumber 「章节轨道编号」 + 元素,因此所有章节都将应用到文件中的所有轨道。 + +

+ + +

+ 由于是文本文件,可能需要进行字符集转换。关于 mkvmerge(1) 如何在字符集间进行转换的说明请参见关于 文本文件与字符集 的段落。 + +

+ + + +

13.2. 基于 XML 的章节格式

+ + +

+ 基于 XML 的章节格式看起来与这个示例类似: + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>短短的一节</ChapterString>
+        <ChapterLanguage>chi</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>那短短的一节的一部分</ChapterString>
+          <ChapterLanguage>chi</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ 使用此格式可以做到三件简单章节格式做不到的事: + +

+ + +
    + +
  1. +

    可以设置章节终止处的时间戳,

    +
  2. + +
  3. +

    章节可以嵌套,

    +
  4. + +
  5. +

    可以设置语言与国家。

    +
  6. + +
+ + +

+ mkvtoolnix 分发包的 doc 子目录包含了一些典型示例文件。 + +

+ + +

+ 下面列出的是支持的 XML 标签,其数据类型及有效值域: + +

+ +
Chapters (主)
+  EditionEntry (主)
+    EditionUID (无符号整数,有效值域: 1 <= 值)
+    EditionFlagHidden (无符号整数,有效值域: 0 <= 值 <= 1)
+    EditionFlagDefault (无符号整数,有效值域: 0 <= 值 <= 1)
+    EditionFlagOrdered (无符号整数,有效值域: 0 <= 值 <= 1)
+    ChapterAtom (主)
+      ChapterAtom (主)
+      ChapterUID (无符号整数,有效值域: 1 <= 值)
+      ChapterTimeStart (无符号整数)
+      ChapterTimeEnd (无符号整数)
+      ChapterFlagHidden (无符号整数,有效值域: 0 <= 值 <= 1)
+      ChapterFlagEnabled (无符号整数,有效值域: 0 <= 值 <= 1)
+      ChapterSegmentUID (二进制,有效值域: 1 <= 长度,以字节为单位)
+      ChapterSegmentEditionUID (无符号整数,有效值域: 1 <= 值)
+      ChapterPhysicalEquiv (无符号整数)
+      ChapterTrack (主)
+        ChapterTrackNumber (无符号整数,有效值域: 1 <= 值)
+      ChapterDisplay (主)
+        ChapterString (UTF-8 字符串)
+        ChapterLanguage (UTF-8 字符串)
+        ChapterCountry (UTF-8 字符串)
+      ChapterProcess (主)
+        ChapterProcessCodecID (无符号整数)
+        ChapterProcessPrivate (二进制)
+        ChapterProcessCommand (主)
+          ChapterProcessTime (无符号整数)
+          ChapterProcessData (二进制)
+ + +

13.3. 从 Blu-ray 光盘读取章节数据

+ + + +

+ mkvmerge(1) 可以从未加密的 Blu-ray + 光盘读取章节数据。要这样做,您可以通过「--chapters」参数提供任一 MPLS 播放列表的路径。 + +

+ + +

+ 例: --chapters + /宝藏/蓝光/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. 从 DVD 光盘读取章节数据

+ + + +

+ 若 MKVToolNix 编译时链接了 libdvdread(tm) 库,mkvmerge(1) 就能从 + DVD 光盘中读取章节数据。要这样做,您可以通过「--chapters」参数提供 DVD + 文件夹或文件的路径。由于 DVD 光盘可包含多个标题,且每个标题可以有自己的一组章节,您可以在文件名参数后添加冒号及所需的标题编号。标题编号默认为 1。 + +

+ + +

+ 例: --chapters /宝藏/dvd光盘/BigBuckBunny/VIDEO_TS:2 + +

+ + + +

13.5. 一般性备注

+ + +

+ mkvmerge(1) 切割文件时会同时适当调整章节。这意味着每个文件只包含应用到该文件的章节项,时间戳也将被调整到与各输出文件相匹配。 + +

+ + +

+ mkvmerge(1) 能够从 Matroska(tm) 输入文件中复制章节,除非使用 --no-chapters + 选项明令禁用。来自各类来源 (Matroska(tm) 文件、Ogg 文件、MP4 文件、章节文本文件) + 的章节通常不被合并,而是分成多个 ChapterEditions(章节版本)。仅当从多个 + Matroska(tm)XML 文件读取的章节具有相同的版本 UID 时,章节才会被合并为单个 + ChapterEdition。如果在其他情况下需要此类合并,用户需要先用 mkvextract(1) + 从所有来源提取章节,手动合并 XML 文件然后再混流。 + +

+ + +

14. 标签

+ + + +

14.1. 介绍

+ + + +

+ Matroska(tm) 的标签系统与其他容器类似: 一组 键=值 对。不过,Matroska(tm) + 中的标签还可以嵌套, + 都是属于它们自身的元素。示例文件 example-tags-2.xml 展示了如何使用该系统。 + +

+ + + +

14.2. 标签细述

+ + + +

+ Matroska(tm) 标签不会自动应用到整个文件上。它们可以应用到整个文件,还可以应用到文件的不同部分: 一个或多个轨道, 一个或多个章节, + 甚至是两者的组合。Matroska + 规范 有这方面的更多详情。 + +

+ + +

+ 重要的一点是标签通过 Targets Matroska(tm) 标签元素与轨道或章节相连,而用于此链接的 + UID 并非 mkvmerge(1) 常用的轨道 ID。而是 mkvmerge(1) 自动计算而来 (当轨道来自非 + Matroska(tm) 文件时) 或当轨道输入文件是 Matroska(tm) 文件时复制而来的 的 UID。因此在文件被 mkvmerge(1) + 处理过之前很难知道应该在标签文件中使用哪些 UID。 + +

+ + +

+ mkvmerge(1) 支持两个为 Matroska(tm) 文件添加标签的选项: --global-tags + 与 --tags + 选项。不同之处在于前者,--global-tags,将通过移除上文提到的所有 + Targets 元素使标签应用到整个文件。 而后者,--tags,将使 + mkvmerge(1) 为通过 --tags 选项的 + TID 部分指定的标签自动插入 UID。 + +

+ + + +

14.3. 示例

+ + +

+ 假定您希望为从一个 AVI 文件读取的视频轨道添加标签。mkvmerge --identify + 文件.avi 告诉您该视频轨道的 ID (不要将此 ID 与 UID 混淆!) 为 0。于是您创建了一个标签文件,省去了所有 + Targets 元素,然后这样调用 mkvmerge(1): + +

+ +
$ mkvmerge -o 文件.mkv --tags 0:标签.xml 文件.avi
+ + +

14.4. 标签文件格式

+ + +

+ mkvmerge(1) 支持基于 XML 的标签文件格式。此格式是以 Matroska + 规范 为依据严格制定的。MKVToolNix 的程序以及源码分发包都含有名为 + example-tags-2.xml 的示例文件,该文件已简明地列出了所有已知的可用作实际处理的基本标签。 + +

+ + +

+ 基本要点有: + +

+ + +
    + +
  • +

    最外层的元素必须为 <Tags>。 +

    +
  • + +
  • + +

    实际意义上的标签放在 <Tag> XML 标签对中。 +

    + +
  • + +
  • +

    标签内容前后的空白将被忽略。

    +
  • + +
+ + + +

14.5. 数据类型

+ + +

+ 新的 Matroska(tm) 标签系统只识别两种数据类型,UTF-8 字串与二进制类型。前者用于标签名称和 + <String> 元素,而二进制类型用于 + <Binary> 元素。 + +

+ + +

+ 由于二进制数据自身与 XML 文件不相容,mkvmerge(1) 支持另两种储存二进制数据的方法。如果 XML 标签的内容以 + '@' 开头,则后续文本将被作为文件名对待。相应文件的内容将被复制到 Matroska(tm) 元素中。 + +

+ + +

+ 还有一种可能,即数据经 Base64 编码。这是将二进制数据转换为一定的 ASCII + 字集字符,在电子邮件等程序中有所应用。mkvextract(1) 将将二进制元素以 Base64 编码的数据的形式输出。 + +

+ + +

+ 已被废弃的标签系统可识别更多的数据类型,这在 Matroska(tm) 官方的标签规范中可以找到。由于 mkvmerge(1) + 不再支持此系统,此处不对这些类型作多余说明。 + +

+ + + +

14.6. XML 文件格式的已知标签

+ + + +

+ 下面列出的是支持的 XML 标签,其数据类型及有效值域: + +

+ +
Tags (主)
+  Tag (主)
+    Targets (主)
+      TargetTypeValue (无符号整数)
+      TargetType (UTF-8 字符串)
+      TrackUID (无符号整数)
+      EditionUID (无符号整数)
+      ChapterUID (无符号整数)
+      AttachmentUID (无符号整数)
+    Simple (主)
+      Simple (主)
+      Name (UTF-8 字符串)
+      TagLanguage (UTF-8 字符串)
+      DefaultLanguage (无符号整数)
+      String (UTF-8 字符串)
+      Binary (二进制)
+ +

15. 剪辑信息

+ + + +

+ 可以通过剪辑信息 XML 文件设置 Matroska(tm) 文件 "剪辑信息" + 头部字段的特定值。所有这些值都无法通过其他命令行选项设置。 + +

+ + +

+ 还有一些 "剪辑信息" 头部字段可以通过命令行选项设置,而非通过 XML 文件。包括如 --title--timestamp-scale + 选项。 + +

+ + +

+ 还有其他元素既不能通过命令行选项,也不能通过 XML 文件设置。这些包括下述元素: DateUTC (即 + "混流时间")、混流应用程序 MuxingApp、写入库 + WritingApp 及 总时长 Duration。这些元素均由 + mkvmerge(1) 自行设置。 + +

+ + +

+ 下面列出的是支持的 XML 标签,其数据类型及有效值域: + +

+ +
Info (主)
+  SegmentUID (二进制,有效值域: 长度(字节) == 16)
+  SegmentFilename (UTF-8 字符串)
+  PreviousSegmentUID (二进制,有效值域: 长度(字节) == 16)
+  PreviousSegmentFilename (UTF-8 字符串)
+  NextSegmentUID (二进制,有效值域: 长度(字节) == 16)
+  NextSegmentFilename (UTF-8 字符串)
+  SegmentFamily (二进制,有效值域: 长度(字节) == 16)
+  ChapterTranslate (主)
+    ChapterTranslateEditionUID (无符号整数)
+    ChapterTranslateCodec (无符号整数)
+    ChapterTranslateID (二进制)
+

16. Matroska 文件规划

+ + +

+ Matroska(tm) 文件规划非常灵活。mkvmerge(1) 将按预先定义的方式渲染文件。生成的文件是这样的: + +

+ + +

+ [EBML 头] [剪辑 {元定位 #1} [剪辑信息] [轨道信息] {附件} {章节} [簇 1] {簇 2} ... {簇 n} {索引} + {元定位 #2} {标签}] + +

+ + +

+ 大括号中的元素是可选的,依所用的内容和选项而定。有两点要注意的: + +

+ + +
    + +
  • + +

    + 元定位 #1 只包含很少量的 level 1 元素,且仅当它们存在时才包含:附件、章节、索引、标签以及元定位 #2。较早版本的 mkvmerge(1) + 亦曾将簇放置在元定位元素中。因此应留给不精确的传言一些空间——真相总会大白。 现在只有簇才被储存在元定位 #2 中,元定位 #1 将引用元定位元素 + #2。 + +

    + +
  • + + +
  • + +

    附件、章节和标签元素仅当被添加后才会出现。

    + +
  • + +
+ + +

+ 允许的最精简的 Matroska(tm) 文件是像这样的: + +

+ + +

+ [EBML 头] [剪辑 [剪辑信息] [轨道信息] [簇 1]] + +

+ + +

+ 这也是纯音频文件的样子。 + +

+ +

17. 外部时间戳文件

+ + +

+ mkvmerge(1) 允许用户为各轨道选择特定的时间戳。这可用来创建包含可变帧率视频或音频中有空隙的文件。这种情况下的帧是 mkvmerge(1) 创建各 + Matroska(tm) 块的单位。对视频来说恰好是一帧,对音频来说是相应音频类型的一个数据包。例如对 AC-3 + 来说是包含 1536 采样的一个数据包。 + +

+ + +

+ 用于轨道追加合并的时间戳必须只指定给一系列(同一)轨道的第一部分。例如当您追加合并两个文件,v1.avi 与 + v2.avi,且希望使用时间戳时,您的命令行必须像这样组织: + +

+ +
$ mkvmerge ... --timestamps 0:我的时间戳.txt v1.avi +v2.avi
+ +

+ mkvmerge(1) 可识别四种格式的时间戳。版本号在时间戳文件的第一行内。空行,只含有空格的行,以及以 '#' + 开头的行在处理时将被忽略。 + +

+ + +

17.1. 时间戳文件格式 v1

+ + +

+ 此格式的第一行是版本声明。第二行则声明默认的帧率。 接下来的各行包含由逗号分隔的三个数字: 起始帧(0 + 代表第一帧)、终止帧以及此范围内的帧率。FPS(帧率) 为浮点数,小数点用 + '.' 表示。各行定义的范围间可以有间隔,间隔内将使用默认的 FPS。一个示例: + +

+ +
# timestamp format v1
+assume 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. 时间戳文件格式 v2

+ + + +

+ 此格式中每行包含相应帧的时间戳。此时间戳必须以毫秒为精度。可以使浮点数,但不强求。您指定的时间戳行数 必须 + 不少于对应轨道的帧数。此类文件中的时间戳必须经过排序。 以 25fps 为例: + +

+ +
# timestamp format v2
+0
+40
+80
+ + +

17.3. 时间戳文件格式 v3

+ + +

+ 此格式中各行包含时长(秒数),后接(可选)帧率。 二者均可为浮点数。 如果未提供帧率,则采用默认的帧率。 + 对于音频,您应当让编解码器自行计算各帧的时间戳。 这样您应当使用 0.0 作为帧率。 您可以使用 + 'gap' 关键词后接空隙时长在流中创建空隙。 以音频文件为例: + +

+ +
# timestamp format v3
+assume 0.0
+25.325
+7.530,38.236
+gap, 10.050
+2.000,38.236
+ + +

17.4. 时间戳文件格式 v4

+ + +

+ 此格式与 v2 格式相似。 唯一的不同在于时间戳不必经过排序。 通常不应使用此格式。 + +

+ + +

18. 退出代码

+ + + +

+ mkvmerge(1) 退出时会返回以下三个退出代码中的一个: + +

+ + +
    + +
  • + +

    + 0 -- 此退出代码说明已成功完成混流。 + +

    + +
  • + + +
  • + +

    + 1 -- 这种情况下 mkvmerge(1) 至少输出了一条警告信息,但混流并未因之中止。 警告信息以文字 + '警告:' 为前缀。根据问题的不同,生成的文件可能是好的,也可能不是。 强烈建议用户检查警告信息以及生成的文件。 + +

    + +
  • + + +
  • + +

    + 2 -- 此退出代码用于错误发生之后。 mkvmerge(1) + 在输出错误信息后即中断处理。错误信息可能是错误的命令行参数,也可能是损坏文件的读取/写入错误。 + +

    + +
  • + +
+ +

19. 环境变量

+ + + +

+ mkvmerge(1) 会使用决定系统区域设置的默认变量 (如 LANG 与 + LC_* 族)。其他变量包括: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG + 及其缩略形式 MTX_DEBUG + +

内容将被当作通过 --debug + 选项传递的参数对待。 +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE + 及其缩略形式 MTX_ENGAGE + +

内容将被当作通过 --engage + 选项传递的参数对待。 +

+ +
+ +

20. 参阅

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. 网络

+ + +

+ 最新版本总可以在 MKVToolNix 主页 找到。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..0f1a3c68f2cda1aefa1c598809b2a1af6db66350 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvpropedit.html @@ -0,0 +1,1181 @@ + + + + + mkvpropedit -- 无需重新进行完整的混流,即可修改现有 Matroska 文件的属性 + + + +
mkvpropedit -- 无需重新进行完整的混流,即可修改现有 Matroska(tm) 文件的属性 +
+
+ +
+

1. 概要

+ + +
mkvpropedit 选项 {输入文件名} {操作} +
+ +

2. 说明

+ + +

+ 此程序可分析现有 Matroska(tm) + 文件,并修改其部分属性。然后它将将变更写入现有文件。可修改的属性包括剪辑信息元素(如标题)和轨道头部(如语言代码、'默认轨' 标记或轨道名称)。 + +

+ + +

+ 选项: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ 列出所有已知的可编辑的属性名称、它们的类型(字符串型、整数型、布尔型等等)及简短说明。程序随后将退出执行。因此不必提供 + source-filename 参数。 + +

+ +
-p, --parse-mode 模式 + +

+ 设置解析模式。参数 '模式' 可以为 + 'fast(快速)'(此项为默认值)或 + 'full(完整)'。'fast(快速)'模式不解析整个文件,而是使用元定位元素确定输入文件中所需元素的位置。99% + 的情况下这就足够了。但如果碰到不含元定位元素或者元定位元素损坏的文件,用户可能得考虑 'full(完整)' + 解析模式。完整扫描文件可能要花费几分钟,而快速扫描只需要几秒钟。 + +

+ +
+ + +

+ 轨道、剪辑信息属性处理操作: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit 选择器 + +

+ 设置后续的 添加设置删除 操作所针对的 Matroska(tm) + 文件区域(即剪辑信息或某个轨道的头部)。此选项可多次使用,以同时修改多个元素。 + +

+ + +

+ 默认情况下,mkvpropedit(1) 将编辑剪辑信息区段。 + +

+ + +

+ 关于完整的语法说明请参见关于 编辑选择器 的段落。 + +

+ +
-a, --add + 名称=数值 + +

+ 添加名为 名称、值为 数值 + 的属性。即使已存在这样的属性,也将执行添加属性操作。注意大多数属性是唯一的,不能出现多个。 + +

+ +
-s, --set + 名称=数值 + +

+ 设置所有名为 名称 的属性的数值为 + 数值。如果不存在这样的属性,则将添加该属性。 + +

+ +
-d, --delete 名称 + +

+ 删除所有名为 名称 的属性。注意部分属性是必需的,不能删除。 + +

+ +
+ + +

+ 标签及章节处理操作: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags + 选择器:文件名 + +

+ 用 文件名 中的标签添加或替换文件中的标签,或者如果 文件名 + 为空则移除标签。mkvpropedit(1) 读取的 XML 标签格式与 mkvmerge(1) 所读取的相同。 + +

+ + +

+ 选择器 必须是 + allglobal 或 + track 之一。对于all 选择器,mkvpropedit(1) + 将替换或移除文件中的所有标签。对于 global 选择器,将只替换或移除全局标签。 + +

+ + +

+ 对于 track 选择器,mkvpropedit(1) 将替换特定轨道的标签。读取自 + 文件名 的其他标签将分配给相同轨道。轨道与 编辑选择器 以相同格式指定 (参见下文),如 + --tags track:a1:新音频标签.xml。 + +

+ +
--add-track-statistics-tags + +

+ 计算文件所有轨道的统计信息,并为每个轨道新增一个统计信息标签。若文件中已经存在此类标签,则将更新这些标签。 + +

+ +
--delete-track-statistics-tags + +

+ 从文件中删除现有的全部轨道统计标签。若文件不包括轨道统计标签,则不会被修改。 + +

+ +
-c, --chapters 文件名 + +

+ 用 文件名 中的标签添加或替换文件中的章节,或者如果 文件名 + 为空则移除章节。mkvpropedit(1) 读取的 XML 及简单章节格式与 mkvmerge(1) 所读取的相同。 + +

+ +
+ + +

+ 附件处理操作: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment 文件名 + +

+ 从 文件名 添加新附件。 + +

+ + +

+ 若本选项之前使用了 --attachment-name 选项,则其值将用作新附件的名称。否则附件名称将从 + 文件名 得出。 + +

+ + +

+ 若本选项之前使用了 --attachment-mime-type 选项,则其值将用作新附件的 MIME + 类型。否则将根据 文件名 的内容自动侦测。 + +

+ + +

+ 若本选项之前使用了 --attachment-description + 选项,则其值将用作新附件的描述。否则将不设置描述信息。 + +

+ + +

+ 若本选项之前使用了 --attachment-uid 选项,则其值将用作新附件的 UID。否则将自动生成随机的 + UID。 + +

+ +
--replace-attachment + 选择器:文件名 + +

+ 用文件 文件名 替换与 选择器 + 相匹配的一或多个附件。如果有超过一个现有附件与 选择器 相匹配,则其所有内容均将被 + 文件名 的内容替代。 + +

+ + +

+ 选择器 可以有四种格式。各格式说明位于下文 附件选择器 段落。 + +

+ + +

+ 若本选项之前使用了 --attachment-name 选项,则其值将设为每个被修改的附件的新名称。否则不修改名称。 + +

+ + +

+ 若本选项之前使用了 --attachment-mime-type 选项,则其值将设为每个被修改的附件的新 MIME + 类型。否则不修改 MIME 类型。 + +

+ + +

+ 若本选项之前使用了 --attachment-description + 选项,则其值将设为每个被修改的附件的新描述。否则不修改描述。 + +

+ + +

+ 若本选项之前使用了 --attachment-uid 选项,则其值将设为每个被修改的附件的新 UID。否则不修改 + UID。 + +

+ +
--update-attachment 选择器 + +

+ 设置 选择器 所匹配的一或多个附件的属性。如果匹配 选择器 + 的现有附件超过一个,则每个附件的属性都将被更新。 + +

+ + +

+ 选择器 可以有四种格式。各格式说明位于下文 附件选择器 段落。 + +

+ + +

+ 若本选项之前使用了 --attachment-name 选项,则其值将设为每个被修改的附件的新名称。否则不修改名称。 + +

+ + +

+ 若本选项之前使用了 --attachment-mime-type 选项,则其值将设为每个被修改的附件的新 MIME + 类型。否则不修改 MIME 类型。 + +

+ + +

+ 若本选项之前使用了 --attachment-description + 选项,则其值将设为每个被修改的附件的新描述。否则不修改描述。 + +

+ + +

+ 若本选项之前使用了 --attachment-uid 选项,则其值将设为每个被修改的附件的新 UID。否则不修改 + UID。 + +

+ +
--delete-attachment 选择器 + +

+ 删除与 选择器 相匹配的一或多个附件。 + +

+ + +

+ 选择器 可以有四种格式。各格式说明位于下文 附件选择器 段落。 + +

+ +
+ + +

+ 附件操作选项: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name 名称 + +

+ 设置接下来 --add-attachment 或 + --replace-attachment 操作要使用的名称。 + +

+ +
--attachment-mime-type mime 类型 + +

+ 设置接下来 --add-attachment 或 + --replace-attachment 操作要使用的 MIME 类型。 + +

+ +
--attachment-description 描述 + +

+ 设置接下来 --add-attachment 或 + --replace-attachment 操作要使用的描述。 + +

+ +
--enable-legacy-font-mime-types + +

+ 对于特定类型的字体附件,使用传统的 MIME 类型。例如,TrueType + 字体的类型将标注为「application/x-truetype-font」而非「fonts/ttf」。 + +

+ + +

+ 这将同时影响到新增附件与替换现有附件的操作,但仅当用户未指定新版 MIME 类型时才起作用。其他现有的附件不受影响。 + +

+ + +

+ 受影响的 MIME + 类型如下:「font/sfnt」「font/ttf」「font/collection」将全部映射至「application/x-truetype-fonts」,「 + font/otf」将被映射至「application/vnd.ms-opentype」。 + +

+ +
+ + +

+ 其他选项: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ 通常情况下,当用户要求更改轨道头部属性「language」(语言) 时,mkvpropedit(1) + 会同时更改全新的「LanguageIETF」轨道头部元素以及传统的「Language」元素。若使用本选项,则只会更改传统的「Language」元素。 + +

+ + +

+ 此选项不影响通过「language-ietf」轨道头部属性提出的变更要求。 + +

+ +
--normalize-language-ietf 模式 + +

+ 将 IETF BCP 47 + 语言标签规范化,支持「canonical」(最简式)、「extlang」(扩展语言子标签形式)以及「off」关闭模式。默认(不添加本选项)会规范化至最简式。 + +

+ + +

+ 最简式模式下,所有存在推荐值(preferred value)的语言子标签都会被替换为推荐值。依规范会执行下述转换: + 「zh-yue-jyutping」 转换为 + 「yue-jyutping」,「fr-FX」 转换为 + 「fr-FR」。 + +

+ + +

+ 扩展语言子标签形式在最简式的基础上生成。所有存在扩展语言子标签(extended language subtag)的主要语言(primary + language)都被替换为子标签对应的前缀加上该子标签。该规则将 「yue-jyutping」 转回传统的 + 「zh-yue-jyutping」 形式,但 「fr-FR」 + 不会发生变化,因为 「fr」 不属于扩展语言子标签。 + +

+ + +

+ 此处的规范化规则只对实际发生变化的元素起作用: + +

+ + +
    + +
  • + +

    + 编辑轨道头部字段时,只有通过编辑指令设置轨道语言元素值的轨道会受到影响。未被编辑的轨道的语言不会发生变化。编辑某条轨道但只设置语言以外的属性,也不会改变其语言值。 + +

    + +
  • + + +
  • + +

    + 编辑章节时,所有章节元素的所有语言元素都会受到影响,因为现有的章节会被完全替换为新章节。 + +

    + +
  • + + +
  • + +

    + 编辑标签时,只有实际被替换的标签的语言元素才会受到影响。例如,当您替换全局标签时,现有的轨道标签不会受到影响。 + +

    + +
  • + +
+ + +

+ 将某个文件内现有的所有语言标签全部作规范化处理的最佳途径是,使用 mkvmerge(1) + 将其重新混流,并将程序的「--normalize-language-ietf」选项设为所需的模式。 + +

+ +
--command-line-charset 字符集 + +

+ 设定在命令行给出的字符串的字符集,用于转为其他字符集。默认为系统当前区域设置中所给定的字符集。 + +

+ +
--output-charset 字符集 + +

+ 设置输出的字符串应被转换到何种字符集。默认为系统当前区域设置中所给定的字符集。 + +

+ +
-r, --redirect-output + 文件名 + +

+ 将所有信息写入文件 文件名 而不是输出到命令行。 + 尽管该操作可以用输出重定向轻松实现,但在某些情况下还需要靠它:如当终端在写入文件之前重新解释(覆盖输出)时。将优先使用通过 --output-charset + 设定的字符集。 + +

+ +
--ui-language 语言代码 + +

+ 强制使用 语言代码 所对应的翻译 (例如 'de_DE' + 表示德文翻译)。在 语言代码 处输入 'list' + 可让程序输出可用翻译的列表。 + +

+ +
--abort-on-warnings + +

+ 让程序在出现警告时即中止。程序的退出代码将返回 1。 + +

+ +
--debug 主题 + +

+ 为特定功能开启调试。该选项仅对开发者有用。 + +

+ +
--engage 功能 + +

+ 开启实验性功能。可用功能列表可通过 mkvpropedit --engage list + 得到。这些功能在正常情况下不应该使用。 + +

+ +
--gui-mode + +

+ 打开 GUI 模式。该模式下,将输出特殊格式的行,告知目前受控的 GUI + 的行为。这些消息遵从格式「#GUI#消息」。消息可能包括键值对,如「#GUI#消息#键1=值1#键2=值2…」。消息内容及键的内容不作翻译,总是以英语输出。 + +

+ +
-v, --verbose + +

+ 使输出信息更详尽,且每当读取到重要的 Matroska(tm) 元素时就将其显示。 + +

+ +
-h, --help + +

+ 显示用法信息并退出。 + +

+ +
-V, --version + +

+ 显示版本信息并退出。 + +

+ +
@选项文件.json + +

+ 从文件 选项文件 读取其他命令行参数。关于支持的选项文件格式的详细说明,请参见 mkvmerge(1) + 手册的“选项文件”段落。 + +

+ +
+ +

3. 编辑选择器

+ + +

+ --edit + 选项设置后续的 添加, 设置删除 操作所影响的 Matroska(tm) + 文件区域(剪辑信息或者特定轨道的头部)。在出现另一个 --edit + 选项之前,此选项将一直有效。此选项的参数就叫做编辑选择器。 + +

+ + +

+ 默认情况下,mkvpropedit(1) 将编辑剪辑信息区段。 + +

+ + +

3.1. 剪辑信息

+ + +

+ 可以通过这三个词中的任意一个选择剪辑信息: + 'info'、'segment_info' 或 + 'segmentinfo'。剪辑信息包含的属性包括剪辑标题、剪辑 UID 等。 + +

+ + + +

3.2. 轨道头部

+ + +

+ 可用于选择轨道头部的选择器稍显复杂:所有以 'track:' 开头的变体。轨道头部属性包括如语言代码、'默认轨' + 标记、轨道名称等属性。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ 如果参数 n 为数字,则将选择第 n 条轨道。轨道顺序与 + mkvmerge(1)--identify 选项所输出的相同。 + +

+ + +

+ 编号从 1 开始。 + +

+ +
track:tn + +

+ 如果参数以字母 t 后接 n + 开头,则将选择选定轨道类型中的第 n 条轨道。轨道类型参数 + t 必须为下述四个字母中的一个: 'a' + 代表音频轨道,'b' 代表按钮轨道,'s' + 代表字幕轨道,'v' 代表视频轨道。轨道顺序与 mkvmerge(1) 的 + --identify 选项所输出的相同。 + +

+ + +

+ 编号从 1 开始。 + +

+ +
track:=uid + +

+ 若参数以「=」后接数字「uid」开头,则会选择轨道 + UID 元素与参数所给出的「uid」相同的轨道。可使用 + mkvinfo(1) 获取轨道 UID。 + +

+ +
track:@数字 + +

+ 若参数以「@」后接数字「number」开头,则会选择轨道编号等于该「 + number」的轨道。可以通过 mkvinfo(1) 获取轨道编号。 + +

+ +
+ + + +

3.3. 注

+ + +

+ 由于轨道编辑选择器的特性,一些选择器所匹配的轨道头部可能是相同的。在此情况下,这些编辑选择器的所有操作将被按照在命令行给出的顺序合并运行。 + +

+ + +

4. 附件选择器

+ + + +

+ 附件选择器可与「--replace-attachment」及「--delete-attachment」这两项操作一起使用。它可以有以下四种格式: + +

+ + +
    + +
  1. + +

    + 按附件 ID 选择。本格式的选择器仅仅是数字,mkvmerge(1) 的识别命令所输出的附件 ID。 + +

    + +
  2. + + +
  3. + +

    + 按附件 UID (唯一 ID) 选择。本格式的选择器为等号 = 后接数字,mkvmerge(1) + 的详尽识别命令所输出的附件的唯一 ID。 + +

    + +
  4. + + +
  5. + +

    + 按附件名称选择。本格式的选择器为纯文本「name:」后接现有附件名称。若本选择器与「--replace-attachment」一起使用,则名称中的冒号必须用「\c」转义。 + +

    + +
  6. + + +
  7. + +

    + 按 MIME 类型选择。本格式的选择器为纯文本「mime-type:」后接现有附件的 MIME + 类型。若本选择器与「--replace-attachment」一起使用,则 MIME + 类型中的冒号必须用「\c」转义。 + +

    + +
  8. + +
+ +

5. Language handling

+ + + +

+ mkvpropedit(1) mostly tries to do the right thing by default. Therefore + changes to the language property will cause mkvpropedit(1) + to apply the same change to both the new "LanguageIETF" element as well as + the old "Language" element similar to how mkvmerge(1) applies the language to + both elements. For example, when using mkvpropedit movie.mkv --edit + track:2 --set language=zh-TW the "LanguageIETF" element will be + set to zh-TW and the old "Language" element to + chi. + +

+ + +

+ Additionally there's a new track header property named + language-ietf that can be set or removed. Changes to this + property only apply to the new "LanguageIETF" track header element. A caveat + is that the old "Language" track header element is a mandatory element in + Matroska — meaning even if it isn't present in the file it still has an + implied value. When the user only sets the language-ietf + property but not the language property, mkvpropedit(1) will + therefore add the old "Language" element in certain cases & set it to + und (meaning "undetermined") as the user didn't specify a + value for it. + +

+ + +

When reading XML chapter or tag files mkvpropedit(1) works like mkvmerge(1) + does. +

+ + +

The creation of the new elements can be disabled completely with the + command-line option `--disable-language-ietf` which operates on all three + new elements. +

+ + +

You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. +

+ +

6. 示例

+ + +

+ 下面的示例将编辑一个名为 '电影.mkv' + 的文件。示例中将设置剪辑标题并修改一条音频轨和一条字幕轨的语言代码。附注,本示例可以简写,即省去 --edit + 选项,因为在第一个 --edit + 选项之前的所有选项默认编辑的就是剪辑信息元素。 + +

+ +
$ mkvpropedit 影片.mkv --edit info --set "title=一部影片" --edit track:a1 --set language=fre --edit track:a2 --set language=ita
+ +

+ 第二个示例,将 '默认轨标记' 从第一条字幕轨移除并设置到第二条字幕轨上。注意 mkvpropedit(1) 与 mkvmerge(1) + 不同,不会在将另一个轨道的 '默认轨标记'设为 '1' 的时候自动将其他轨道的标记设为 '0'。 + +

+ +
$ mkvpropedit 影片.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ 像这样替换文件中第二个字幕轨的标签: + +

+ +
$ mkvpropedit 影片.mkv --tags track:s2:新字幕标签.xml
+ +

+ 移除所有标签需要将文件名留空: + +

+ +
$ mkvpropedit 影片.mkv --tags all:
+ +

+ 像这样替换文件中的章节: + +

+ +
$ mkvpropedit 影片.mkv --chapters 新章节.xml
+ +

+ 移除所有章节需要将文件名留空: + +

+ +
$ mkvpropedit 影片.mkv --chapters ''
+ +

+ 将字体文件 (Arial.ttf) 作为附件添加: + +

+ +
$ mkvpropedit 影片.mkv --add-attachment Arial.ttf
+ +

+ 将字体文件 (89719823.ttf) 作为附件添加,并提供信息,因为它真的就是 Arial: + +

+ +
$ mkvpropedit 影片.mkv --attachment-name Arial.ttf --attachment-description 'Arial 字体,TrueType 类型' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ 将已经附加的字体 (Comic.ttf) 替换为另一个 + (Arial.ttf): + +

+ +
$ mkvpropedit 影片.mkv --attachment-name Arial.ttf --attachment-description 'Arial 字体,TrueType 类型' --replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ 删除附加的第二个文件,不论它是什么: + +

+ +
$ mkvpropedit 影片.mkv --delete-attachment 2
+ +

+ 按 MIME 类型删除所有附加字体: + +

+ +
$ mkvpropedit 影片.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. 退出代码

+ + + +

+ mkvpropedit(1) 退出时会返回以下三个退出代码中的一个: + +

+ + +
    + +
  • + +

    + 0 -- 此退出代码说明已成功完成修改。 + +

    + +
  • + + +
  • + +

    + 1 -- 这种情况下 mkvpropedit(1) 至少输出了一条警告信息,但修改并未因之中止。 警告信息以文字 + '警告:' 为前缀。根据问题的不同,生成的文件可能是好的,也可能不是。 强烈建议用户检查警告信息以及生成的文件。 + +

    + +
  • + + +
  • + +

    + 2 -- 此退出代码用于错误发生之后。 mkvpropedit(1) + 在输出错误信息后即中断处理。错误信息可能是错误的命令行参数,也可能是损坏文件的读取/写入错误。 + +

    + +
  • + +
+ +

8. 文本文件与字符集转换

+ + + +

+ 关于 MKVToolNix 套件中所有工具如何处理字符集转换、输入/输出编码、命令行编码及控制台编码的深入讨论,请参见 mkvmerge(1) + 手册中相对应名称的段落。 + +

+ +

9. 环境变量

+ + + +

+ mkvpropedit(1) 会使用决定系统区域设置的默认变量 (如 LANG 与 + LC_* 族)。其他变量包括: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG + 及其缩略形式 MTX_DEBUG + +

内容将被当作通过 --debug + 选项传递的参数对待。 +

+ +
MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE + 及其缩略形式 MTX_ENGAGE + +

内容将被当作通过 --engage + 选项传递的参数对待。 +

+ +
+ +

10. 参阅

+ + +

+ mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1) + +

+ +

11. 网络

+ + +

+ 最新版本总可以在 MKVToolNix 主页 找到。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..2fe75e83c7b976da19ed27ef3ae75720a905ff5c --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_CN/mkvtoolnix-gui.html @@ -0,0 +1,144 @@ + + + + + mkvtoolnix-gui -- 一款 mkvmerge1 的 GUI,还自带 「章节编辑器」 和 「头部字段编辑器」 + + + +
mkvtoolnix-gui -- 一款 mkvmerge(1) 的 GUI,还自带 「章节编辑器」 和 「头部字段编辑器」 +
+
+
+

Table of contents

+ +
+
+

1. 概要

+ + +
mkvtoolnix-gui [[配置文件名.mtxcfg] | [输入文件.扩展名] | [matroska-文件.mkv] | [章节文件.扩展名] | [matroska-文件.mkv]] +
+ +

2. 说明

+ + +

+ mkvtoolnix-gui(1) 是用于 mkvmerge(1)GUI,基于 + Qt(tm) 开发。它还支持调用 mkvinfo(1)mkvpropedit(1),未来还将覆盖 + mkvextract(1) 的功能。所有设置(例如输入文件、轨道选项等)都可以保存与恢复。 + +

+ + +

+ 给出扩展名为 .mtxcfg 的配置文件名,可让 GUI + 在相应工具中加载这些配置文件。其他文件名将根据当前模式,作为待混流的输入文件添加,或在信息工具、章节编辑器或头部编辑器中打开。当前模式可通过 + --merge(混流)、--info(信息)、--edit-chapters(章节编辑) + 或 --edit-headers(头部编辑)修改。默认模式为添加文件用于混流。 + +

+ + +

+ 注意,若再次启动应用程序时,已经有一个该应用程序的实例在运行,则命令行给出的所有文件都将由已在运行的实例处理。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

后面的所有文件名都将作为输入文件添加到当前混流任务。这是默认模式。

+ +
--info + +

其后所有文件名将在信息工具中打开。

+ +

此外,启动时会选择 「信息工具」,而非 「混流器」 工具。

+ +
--edit-chapters + +

后面的所有文件名都将在 「章节编辑器」 中打开。

+ +

此外,启动时会选择 「章节编辑器」 ,而非 「混流器」 工具。

+ +
--edit-headers + +

后面的所有文件名都将在头部编辑器中打开。

+ +

此外,启动时会选择 「头部编辑器」,而非 「混流器工具」。

+ +
-h, --help + +

+ 显示用法信息并退出。 + +

+ +
-V, --version + +

+ 显示版本信息并退出。 + +

+ +
+ +

3. 参阅

+ + +

+ mkvmerge(1), mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. 网络

+ + +

+ 最新版本总可以在 MKVToolNix 主页 找到。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvextract.html b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvextract.html new file mode 100644 index 0000000000000000000000000000000000000000..5d2e3ac7ff0412d0c6d6767330364b40ba5e36a8 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvextract.html @@ -0,0 +1,1226 @@ + + + + + mkvextract -- 將 Matroska 軌道檔案擷取至其他檔案 + + + +
mkvextract -- 將 Matroska(tm) 軌道檔案擷取至其他檔案 +
+
+ +
+

1. 概要

+ + +
mkvextract {輸入檔名} {模式1} 選項 擷取規格1 模式2 選項 擷取規格2 … +
+ +

2. 摘要說明

+ + +

+ 此程式從 Matroska(tm) 檔中提取特定部分到其他有用的格式。第一個參數是原始檔案的名稱,該檔必須是 Matroska(tm) 檔。 + +

+ + +

+ 所有其他引數可切換至特定擷取模式,變更目前使用模式的選項,或指定要擷取那些內容至哪個檔案中。可在 mkvextract + 同一次啟動中使用多個模式,允許一次擷取多個內容。大多數選項只能在特定模式下使用,只有少數選項適用於所有模式。 + +

+ + +

+ 目前支援軌道 tracks 軌道, tags 標籤, attachments 附件, chapters 章節, CUE sheets CUE 工作表, timestamps 時間戳記 與 + cues的擷取。 + +

+ + +

2.1. 一般選項

+ + + +

+ 以下選項在所有模式下都可用,本節中僅介紹一次。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --parse-fully + +

+ 將剖析模式設為 '完整' 。預設模式不會剖析完整檔案,而是使用變換定位元件尋找原始檔案所需的元件。在 99% + 情形足以夠用。但對於不包含變換定位元件或受損的檔案來說,使用者很可能需要使用此模式。完整檔案掃描會耗費較久的時間,而快速掃描只需要幾秒鐘。 + +

+ +
--command-line-charset 字元集 + +

+ 設定在命令列顯示的字串字元集,以轉換為其他字元集。預設為目前系統所在位置指定的字元集。 + +

+ +
--output-charset 字元集 + +

+ 設定要轉換為輸出字串的字元集。預設為目前系統所在位置指定的字元集。 + +

+ +
-r, --redirect-output + 檔名 + +

+ 將所有訊息寫入到檔案 檔名 + 而不是命令列。儘管使用輸出重新導向可以輕鬆完成此操作,但在某些情況下需要使用此選項: 當終端在將輸出寫入文件之前重新解釋(覆蓋)輸出時。 優先使用通過 + --output-charset + 設定字元集。 + +

+ +
--flush-on-close + +

+ 關閉已開啟寫入的檔案時,告訴程式清理所有在記憶體中的資料。這可以防止因斷電造成的資料遺失或避免作業系統或驅動程式造成的某些問題。缺點是執行合併工具會花費較久個時間,因為 + mkvmerge 需要等待所有資料已寫入至儲存空間後,才會結束。請參閱 MKVToolNix 錯誤追蹤上的 #2469 和 #2480 + 問題,以便深入瞭解其優缺點。 + +

+ +
--ui-language 語言碼 + +

+ 強制使用語言 編碼 對應的的翻譯(例如 'zh_TW' + 為臺灣正體中文翻譯)。 在編碼欄位中輸入'list' + 讓程式輸出時使用可用的對應翻譯清單。 + +

+ +
--abort-on-warnings + +

+ 發出第一個警告後,終止程式。程式的結束碼為 1 。 + +

+ +
--debug 主題 + +

+ 針對特定功能開啟除錯。此選項適用於開發者。 + +

+ +
--engage 功能 + +

+ 開啟實驗中功能。 透過mkvextract --engage + list啟用可用的列表。這些功能不會在正常情況下使用。 + +

+ +
--gui-mode + +

+ 開啟 GUI 模式。在這種模式中,可能會輸出特殊格式的行數,可以呈現控制的 GUI 發生什麼事。這些訊息會以 + '#GUI#訊息'呈現。訊息可能包含機碼/值,例如 + '#GUI#訊息#機碼1=值1#機碼2=值2…'。 無論是訊息或是機碼都不會轉為譯文,而且永遠使用 *英語* + 輸出。 + +

+ +
-v, --verbose + +

+ 輸出時盡量詳細,並在讀取時顯示所有 Matroska(tm) 重要的元件。 + +

+ +
-h, --help + +

+ 顯示使用方式並退出。 + +

+ +
-V, --version + +

+ 顯示版本資訊並離開。 + +

+ +
@options-file.json + +

+ 從檔案選項檔讀取其他命令列引數。有關此類檔案支援格式的完整說明,請參閱 mkvmerge(1) 文件中的 + "選項檔案" 章節。 + +

+ +
+ + + +

2.2. 軌道擷取模式

+ + + +

+ 語法: mkvextract 原始檔名 tracks + [選項] + TID1:輸出檔名1 + [TID2:輸出檔名2 ...] + +

+ + +

+ 以下命令列選項可用於 'tracks' 提取模式下的每個軌道。 + 這些命令須在應該所套用到的軌道指令(請見下文)前出現。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-c 字元集 + +

+ 設定字元集為下一個文字字幕軌道為該字元集。僅在下一個軌道 ID 對應文字字幕軌道時有效。預設為 UTF-8 。 + +

+ +
--blockadd 層級 + +

+ 僅將 BlockAdditions 保留在此層級。預設為保留所有層級。此選項僅影響某些類型的編碼,例如 WAVPACK4 。 + +

+ +
--cuesheet + +

+ 導致 mkvextract(1) 從章節資訊中擷取 CUE 工作表,並將該軌道的資料標記到由輸出軌道名稱命名並以 + '.cue' 為格式的檔案中。 + +

+ +
--raw + +

+ 將原始資料擷取到原始檔案裡,但不包含其他容器資料。與 --fullraw + 標籤不同,此標籤不會導致 CodecPrivate 元件的內容寫入檔案。此模式適用於所有的 + CodecIDs ,縱使 mkvextract(1) 不支援,可能也會產生無法使用的檔案。 + +

+ +
--fullraw + +

+ 將原始資料擷取到原始檔案裡,但不包含其他容器資料。如果軌道包含表頭元件,那麼 CodecPrivate + 元件將寫入檔案中。此模式適用於所有的 CodecIDs,縱使 mkvextract(1) + 不支援,可能也會產生無法使用的檔案。 + +

+ +
TID:輸出檔名 + +

+ 如果原始檔案中存在 ID 為 TID 的軌道,會將擷取為 + 輸出檔名 。此選項可多次使用。軌道 ID 與 mkvmerge(1) 的 + --identify 選項輸出的相同。 + +

+ + +

+ 每個輸出名稱只能使用一次,但 RealAudio 與 RealVideo 軌道除外。如果將不同的軌道使用相同的名稱,那麼會儲存到同一個檔案。例如: + +

+ +
$ mkvextract input.mkv tracks 0:video.h264 2:output-two-vobsub-tracks.idx 3:output-two-vobsub-tracks.idx
+
+ + + +

2.3. 附件擷取模式

+ + + +

+ 語法: mkvextract 原始檔名 + attachments [選項] + AID1:輸出檔名1 + [AID2:輸出檔名2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
AID:輸出檔名 + +

+ 如果原始檔案中存在 ID 為 AID 的附件軌道,會將擷取為 + 輸出檔名 。假設 輸出檔名 保留空白,那麼將會使用原始 + Matroska(tm) 檔案中的附件名稱。此選項可多次使用。此選項可多次使用。附件 ID 與 mkvmerge(1) 的 + --identify 選項輸出的相同。 + +

+ +
+ + + +

2.4. 章節擷取模式

+ + + +

+ 語法: mkvextract 原始檔名 + chapters [選項] + 輸出檔名.xml + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-s, --simple + +

+ 用 OGM 工具的簡易格式來匯出章節資訊 (CHAPTER01=..., CHAPTER01NAME=…)。 + 在此模式中,將會丟棄部分資訊。預設是以 XML 格式輸出章節。 + +

+ +
--simple-language 語言 + +

+ 如果啟用簡易模式, mkvextract(1) 即使單一章節單元包含一個以上的章節名稱,每個章節單元只會輸出單一項目。在預設情況下,無論任何語言, + mkvextract(1) 都將會使用找到的第一個名稱。 + +

+ + +

+ 使用此選項,當單元包含一個以上章節名稱時,允許使用者決定使用哪一個章節名稱作為輸出使用。 語言 參數必須為 + ISO 639-1 或 ISO 639-2 編碼。 + +

+ +
+ + +

+ 章節將寫入指定輸出檔案。預設情況下,會使用 mkvmerge(1) 可識別的 XML 格式。如果檔案中沒有找到任何章節,將不會建立輸出檔案。 + +

+ + + +

2.5. 標籤擷取模式

+ + + +

+ 語法: mkvextract 原始檔名 tags + [選項] + 輸出檔名.xml + +

+ + +

+ 標籤將寫入指定輸出檔案。預設情況下,會使用 mkvmerge(1) 可識別的 XML 格式。如果檔案中沒有找到任何標籤,將不會建立輸出檔案。 + +

+ + + +

2.6. Cue 工作表擷取模式

+ + + +

+ 語法: mkvextract 原始檔名 + cuesheet [選項] + 輸出檔名.cue + +

+ + +

+ CUE 表單將寫入指定輸出檔案。如果檔案中沒有找到任何章節或標籤,將不會建立輸出檔案。 + +

+ + + +

2.7. 時間戳記擷取模式

+ + + +

+ 語法: mkvextract 原始檔名 + timestamps_v2 + [選項] + TID1:輸出檔名1 + [TID2:輸出檔名2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:輸出檔名 + +

+ 如果原始檔案中存在 ID 為 TID 的時間戳記軌道,會將擷取為 + 輸出檔名 。此選項可多次使用。此選項可多次使用。軌道 ID 與 mkvmerge(1) 的 + --identify 選項輸出的相同。 + +

+ + +

+ 範例: + +

+ +
$ mkvextract input.mkv timestamps_v2 1:ts-track1.txt 2:ts-track2.txt
+
+ + + +

2.8. Cue 擷取模式

+ + + +

+ 語法: mkvextract 原始檔名 cues + [選項] + TID1:輸出檔名1 + [TID2:輸出檔名2 ...] + +

+ + + + + + + + + + + + + + + +
OptionDescription
TID:輸出檔名 + +

+ 如果原始檔案中存在 ID 為 TID 的 CUE 軌道,會將擷取為 + 輸出檔名 。此選項可多次使用。此選項可多次使用。附件 ID 與 mkvmerge(1) 的 + --identify 選項輸出的相同,且不會包含 CueTrack + 元件的數字。 + +

+ +
+ + +

+ 輸出的格式為簡易文字格式: 每行對應一組 CuePoint 元件與 + 機碼=值。當選用的元素不存在於 CuePoint 時(例如 + CueDuration) ,將會以短破折號(虛線)作為輸出值。 + +

+ + +

+ 範例: + +

+ +
timestamp=00:00:13.305000000 duration=- cluster_position=757741 relative_position=11
+ +

可使用的機碼如下:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
timestamp + +

CUE 點的時間戳記( timestamp)具有奈秒的精準度。格式為 + HH:MM:SS.nnnnnnnnn。 此元件為必要設定。 +

+ +
duration + +

CUE 點的時間長度(duration)具有奈秒的精準度。格式為 + HH:MM:SS.nnnnnnnnn。 +

+ +
cluster_position + +

包含引用元件的叢集起始的 Matroska(tm) 檔案內位元組的絕對位置。 +

+ + +
+

Note:

+ +

Matroska(tm) 檔案中的 CueClusterPosition 相對於剪輯資訊資料的起始偏移。但由 + mkvextract(1) CUE 擷取模式輸出的值已經包含該偏移,並且是與文件開頭的絕對偏移。 +

+ +
+ +
relative_position + +

CUE 點引用的 BlockGroup 或 + SimpleBlock 元件在叢集起始內以位元組為單位的相對位置。 +

+ + +
+

Note:

+ +

Matroska(tm) 檔案中的 CueRelativePosition 是相對於叢集資料起始的偏移。但 + mkvextract(1) 的 CUE 擷取模式所輸出的值,是相對於叢集的 ID 。可通過新增與新增檔案計算檔案內的 + cluster_positionrelative_position。 +

+ +
+ +
+ + +

+ 範例: + +

+ +
$ mkvextract input.mkv cues 1:cues-track1.txt 2:cues-track2.txt
+ +

3. 範例

+ + + +

+ 同時擷取章節與標籤並依照各自的 XML 格式儲存: + +

+ +
$ mkvextract movie.mkv chapters movie-chapters.xml tags movie-tags.xml
+ +

+ 同時擷取數個軌道與各自對應的時間戳記: + +

+ +
$ mkvextract "Another Movie.mkv" tracks 0:video.h265 "1:main audio.aac" "2:director's comments.aac" timestamps_v2 "0:timestamps video.txt" "1:timestamps main audio.txt" "2:timestamps director's comments.txt"
+ +

+ 擷取 Ogg/OGM 格式的章節,然後將文字字幕軌道重新編碼到另一個字元集: + +

+ +
$ mkvextract "My Movie.mkv" chapters --simple "My Chapters.txt" tracks -c MS-ANSI "2:My Subtitles.srt"
+

4. 文字檔案與字元集轉換

+ + + +

+ 关于 MKVToolNix 套件中所有工具如何处理字符集转换、输入/输出编码、命令行编码及控制台编码的深入讨论,请参见 mkvmerge(1) + 手册中相对应名称的段落。 + +

+ +

5. 檔案輸出格式

+ + + +

+ 输出的格式取决于轨道的类型,而不是输出文件名的扩展名。目前支持以下轨道类型: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
A_AAC/MPEG2/*, A_AAC/MPEG4/*, A_AAC + +

+ 所有 AAC 文件将被输出为 AAC 文件,其中数据包前有 + ADTS 头。ADTS 头将不含反增强字段(deprecated emphasis + field)。 + +

+ +
A_AC3, A_EAC3 + +

+ 這將會擷取為 raw AC-3 檔案。 + +

+ +
A_ALAC + +

+ ALAC 軌道將寫入成 CAF 檔案。 + +

+ +
A_DTS + +

+ 這將會擷取為 raw DTS 檔案。 + +

+ +
A_FLAC + +

+ FLAC 軌道將寫入成原始 FLAC 檔案。 + +

+ +
A_MPEG/L2 + +

+ MPEG-1 音層 II 串流將會擷取為原始的 MP2 檔案。 + +

+ +
A_MPEG/L3 + +

+ 這將會擷取為 raw MP3 檔案。 + +

+ +
A_OPUS + +

+ Opus(tm) 軌道將寫入成 OggOpus(tm) + 檔案。 + +

+ +
A_PCM/INT/LIT, A_PCM/INT/BIG + +

+ 原始 PCM 数据将写入 WAV 文件。大端序整数数据在此期间将被转为小端序数据。 + +

+ +
A_REAL/* + +

+ RealAudio(tm) 軌道將寫入成 + RealMedia(tm) 檔案。 + +

+ +
A_TRUEHD, A_MLP + +

+ 這將會擷取為 raw TrueHD/MLP 檔案。 + +

+ +
A_TTA1 + +

+ TrueAudio(tm) 轨道将被输出为 TTA 文件。请注意,由于 + Matroska(tm) 时间戳的精度限制,解开来的文件的头部有两个字段不同:data_length + (文件的总采样数) 与 CRC。 + +

+ +
A_VORBIS + +

+ Vorbis 音訊將會以 OggVorbis(tm) 寫入檔案。 + +

+ +
A_WAVPACK4 + +

+ WavPack(tm) 軌道將寫入成 WV 檔案。 + +

+ +
S_HDMV/PGS + +

+ PGS 字幕將會以 SUP 寫入檔案。 + +

+ +
S_HDMV/TEXTST + +

+ TextST 字幕将以转为 mkvmerge(1)mkvextract(1) 发明的特殊格式写入。 + +

+ +
S_KATE + +

+ Kate(tm) 流将以 Ogg(tm) 为容器输出。 + +

+ +
S_TEXT/SSA, S_TEXT/ASS, S_SSA, S_ASS + +

+ SSAASS 純文字字幕將會分別以 + SSA/ASS 寫入檔案。 + +

+ +
S_TEXT/UTF8, S_TEXT/ASCII + +

+ 簡易純文字字幕將會以 SRT 寫入檔案。 + +

+ +
S_VOBSUB + +

+ VobSub(tm) 字幕将输出为 SUB 文件及相应的索引文件(后缀为 + IDX)。 + +

+ +
S_TEXT/USF + +

+ USF 純文字字幕將會以 USF 寫入檔案。 + +

+ +
S_TEXT/WEBVTT + +

+ WebVTT 純文字字幕將會以 WebVTT 寫入檔案。 + +

+ +
V_MPEG1, V_MPEG2 + +

+ MPEG-1MPEG-2 视频轨道将输出为 + MPEG 基本流(ES)。 + +

+ +
V_MPEG4/ISO/AVC + +

+ H.264 / AVC 视频轨将被输出为 + H.264 基本流,可以使用如 GPAC(tm) 工具包中的 + MP4Box(tm) 作进一步处理。 + +

+ +
V_MPEG4/ISO/HEVC + +

+ H.265 / HEVC 视频轨道将输出为 + H.265 基本流(ES),该格式可使用 GPAC(tm) 软件包中的 + MP4Box(tm) 作进一步处理。 + +

+ +
V_MS/VFW/FOURCC + +

+ 使用此 CodecIDFPS 恒定的视频轨将被输出为 + AVI 文件。 + +

+ +
V_REAL/* + +

+ RealVideo(tm) 軌道將寫入成 + RealMedia(tm) 檔案。 + +

+ +
V_THEORA + +

+ Theora(tm) 流将以 Ogg(tm) 为容器输出 + +

+ +
V_VP8, V_VP9 + +

+ VP8 / VP9 軌道將寫入成 IVF 檔案。 + +

+ +
標籤 + +

+ 标签将被转换为 XML 格式。此格式与 mkvmerge(1) 所支持读取的标签格式相同。 + +

+ +
附件 + +

+ 附件将被以原样输出。不会进行任何转换。 + +

+ +
章節 + +

+ 章节将被转换为 XML 格式。此格式与 mkvmerge(1) 所支持读取的章节格式相同。您也可以选择输出精简的简单 + OGM 格式。 + +

+ +
Timestamps + +

+ 时间戳会先被排序,然后以 timestamp v2 格式文件输出,该文件适用于 mkvmerge(1)。不支持提取为其他格式 (v1, v3 或 v4)。 + +

+ +
+ +

6. 結束代碼

+ + + +

+ 使用三個之一的結束代碼結束 mkvextract(1) : + +

+ + +
    + +
  • + +

    + 0 -- 此結束代碼表示擷取已成功完成。 + +

    + +
  • + + +
  • + +

    + 1 -- 在此情況下, mkvextract(1) + 輸出時至少有一則警告,但擷取動作仍然進行。警告訊息會在前端出現 + '警告:'字樣。依據問題的程度,生成的檔案也許可用。建議使用者檢視警告訊息與輸出檔。 + +

    + +
  • + + +
  • + +

    + 2 -- 此結束代碼用於發生錯誤後。mkvextract(1) + 在輸出錯誤訊息後立即中止動作。錯誤訊息的範圍包含從錯誤命令列參數的讀/寫至檔案損壞。 + +

    + +
  • + +
+ +

7. 環境變數

+ + + +

+ mkvextract(1) 使用決定系統的地區設定的變數 (例如: LANG 與 + LC_* 系列)。 附加變數: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVEXTRACT_DEBUG, MKVTOOLNIX_DEBUG + 與其縮寫 MTX_DEBUG + +

視為通過 --debug + 選項傳遞的內容。 +

+ +
MKVEXTRACT_ENGAGE, MKVTOOLNIX_ENGAGE + 與其縮寫 MTX_ENGAGE + +

視為通過 --engage + 選項傳遞的內容。 +

+ +
+ +

8. 參閱

+ + +

+ mkvmerge(1), mkvinfo(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

9. 網路

+ + +

+ 永遠可在 MKVToolNix 首頁 找到最新版。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvinfo.html b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvinfo.html new file mode 100644 index 0000000000000000000000000000000000000000..16d64fbfcd0dc8e37976a24a2de61b2aa888a49c --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvinfo.html @@ -0,0 +1,473 @@ + + + + + mkvinfo -- 输出关于 Matroska 文件中各轨的信息 + + + +
mkvinfo -- 输出关于 Matroska(tm) 文件中各轨的信息 +
+
+ +
+

1. 概要

+ + +
mkvinfo 選項 {輸入檔名} +
+ +

2. 摘要說明

+ + +

+ 本程序可列出 Matroska(tm)文件中包含的所有轨道,输出信息可以限定为文件的轨道列表以及所用编解码器的信息。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --all + +

+ 默认情况下,mkvinfo(1) 会在读取到首个簇时停下来。它也不会显示某些元素(通常是反复出现的元素)。通过此选项可以让 mkvinfo(1) + 忽略冗余级别继续处理,并显示所有元素。 + +

+ +
-c, --checksums + +

+ 计算并显示各帧的 Adler-32 校验码。仅当调试时有用处。 + +

+ +
-o, --continue + +

+ 默认情况下,mkvinfo(1) 会在读取到首个簇时停下来。通过此选项可以让 mkvinfo(1) 忽略冗余级别继续处理。 + +

+ +
-p, --hex-positions + +

+ 忽略冗余级别,以十六进制显示所有元素的位置。 + +

+ +
-P, --positions + +

+ 忽略冗余级别,以十进制显示所有元素的位置。 + +

+ +
-s, --summary + +

+ 仅显示 mkvinfo(1) 所获取信息的简要概述,而非各元素。 + +

+ +
-t, --track-info + +

+ 在“详细”模式下为各轨道显示统计信息。如果“详细”程度为 0 级,则将同时将级别设为 1。 + +

+ +
-x, --hexdump + +

+ 以十六進位轉儲形式顯示每影格的前 16 位元組。 + +

+ +
-X, --full-hexdump + +

+ 以十六進位轉儲形式顯示每影格的全部位元組。 + +

+ +
-z, --size + +

+ 顯示每個元件包含表頭的大小。 + +

+ +
--command-line-charset 字元集 + +

+ 設定在命令列顯示的字串字元集,以轉換為其他字元集。預設為目前系統所在位置指定的字元集。 + +

+ +
--output-charset 字元集 + +

+ 設定要轉換為輸出字串的字元集。預設為目前系統所在位置指定的字元集。 + +

+ +
-r, --redirect-output + 檔名 + +

+ 將所有訊息寫入到檔案 檔名 + 而不是命令列。儘管使用輸出重新導向可以輕鬆完成此操作,但在某些情況下需要使用此選項: 當終端在將輸出寫入文件之前重新解釋(覆蓋)輸出時。 優先使用通過 + --output-charset + 設定字元集。 + +

+ +
--ui-language 語言碼 + +

+ 強制使用語言 編碼 對應的的翻譯(例如 'zh_TW' + 為臺灣正體中文翻譯)。 在編碼欄位中輸入'list' + 讓程式輸出時使用可用的對應翻譯清單。 + +

+ +
--abort-on-warnings + +

+ 發出第一個警告後,終止程式。程式的結束碼為 1 。 + +

+ +
--debug 主題 + +

+ 針對特定功能開啟除錯。此選項適用於開發者。 + +

+ +
--engage 功能 + +

+ 開啟實驗中功能。 透過mkvinfo --engage list啟用可用的列表。這些功能不會在正常情況下使用。 + +

+ +
--gui-mode + +

+ 開啟 GUI 模式。在這種模式中,可能會輸出特殊格式的行數,可以呈現控制的 GUI 發生什麼事。這些訊息會以 + '#GUI#訊息'呈現。訊息可能包含機碼/值,例如 + '#GUI#訊息#機碼1=值1#機碼2=值2…'。 無論是訊息或是機碼都不會轉為譯文,而且永遠使用 *英語* + 輸出。 + +

+ +
-v, --verbose + +

+ 使输出更详尽。请参阅关于 “详细”程度 + 的段落获取在哪些层级将输出哪些信息的描述。 + +

+ +
-h, --help + +

+ 顯示使用方式並退出。 + +

+ +
-V, --version + +

+ 顯示版本資訊並離開。 + +

+ +
@options-file.json + +

+ 從檔案選項檔讀取其他命令列引數。有關此類檔案支援格式的完整說明,請參閱 mkvmerge(1) 文件中的 + "選項檔案" 章節。 + +

+ +
+ +

3. 詳細資訊層級

+ + + +

+ -v 选项可以使 + mkvinfo(1) 增强其“详细”程度并输出关于当前文件的更多信息。 + +

+ + +

+ 在 level 0 mkvinfo(1) 仅输出它发现的轨道头及其类型。头部解析完毕后(更专业地:遇到首个簇时),mkvinfo(1) + 将退出执行。在此层级,定位头项与 cue 索引不会显示出来——即使它们位于轨道信息之前。 + +

+ + +

+ 在 level 1 mkvinfo(1) 同样将输出在整个文件中遇到的所有 Matroska(tm) 元素,此外还将输出定位头项与 cue + 索引项。如果启用了简要模式,mkvinfo(1) 还将输出各帧位置。 + +

+ + +

+ 通过选项「--continue」可以实现相同的效果。 + +

+ + +

+ 在 level 2 mkvinfo(1) 同样将输出定位头项与 cue 索引项,以及文件中各 Matroska(tm) 元素被发现的位置。 + +

+ + +

+ 通过选项「--all --positions」可以实现相同的结果。 + +

+ + +

+ 在 level 3 及更高层级 mkvinfo(1) 将输出一些与 Matroska(tm) + 元素不直接相连的信息。对于其他元素,将只输出发现的基本信息。Level 3 增加了元信息以便调试(换句话说:它是为开发人员设计的)。Level 3 + 输出的所有行都以方括号嵌套以便过滤。 + +

+ +

4. 文字檔案與字元集轉換

+ + + +

+ 关于 MKVToolNix 套件中所有工具如何处理字符集转换、输入/输出编码、命令行编码及控制台编码的深入讨论,请参见 mkvmerge(1) + 手册中相对应名称的段落。 + +

+ +

5. 結束代碼

+ + + +

+ 使用三個之一的結束代碼結束 mkvinfo(1) : + +

+ + +
    + +
  • + +

    + 0 -- 此結束代碼表示執行已成功完成。 + +

    + +
  • + + +
  • + +

    + 1 -- 在此情況下 mkvinfo(1) 輸出時至少有一則警告,但動作仍然進行。警告訊息會在前端出現 + '警告:' 字樣。 + +

    + +
  • + + +
  • + +

    + 2 -- 此結束代碼用於發生錯誤後。 mkvinfo(1) + 在輸出錯誤訊息後立即中止動作。錯誤訊息的範圍包含從錯誤命令列參數的讀/寫至檔案損壞。 + +

    + +
  • + +
+ +

6. 環境變數

+ + + +

+ mkvinfo(1) 使用決定系統的地區設定的變數 (例如: LANG 與 + LC_* 系列)。 附加變數: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVINFO_DEBUG, MKVTOOLNIX_DEBUG + 與其的簡短形式 MTX_DEBUG + +

視為通過 --debug 選項傳遞的內容。 +

+ +
MKVINFO_ENGAGE, MKVTOOLNIX_ENGAGE + 與其的簡短形式 MTX_ENGAGE + +

視為通過 --engage + 選項傳遞的內容。 +

+ +
+ +

7. 參閱

+ + +

+ mkvmerge(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

8. 網路

+ + +

+ 永遠可在 MKVToolNix 首頁 找到最新版。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvmerge.html b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvmerge.html new file mode 100644 index 0000000000000000000000000000000000000000..105035510bdca7947cb90f22fc997e642824115f --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvmerge.html @@ -0,0 +1,4651 @@ + + + + + mkvmerge -- 合併多媒體串流到 Matroska 檔案中 + + + +
mkvmerge -- 合併多媒體串流到 Matroska(tm) 檔案中 +
+
+ +
+

1. 概要

+ + +
mkvmerge 全域選項 {-o 輸出} 選項1 {檔案1} 選項2 {檔案2} @選項檔.json +
+ +

2. 摘要說明

+ + +

+ 此程式可從多個輸入的媒體檔案,並加入其他(全部或部分)串流成為一個 Matroska(tm) 檔案;請見 Matroska 網站。 + +

+ + +
+

Important:

+ +

+ 命令列的順序選項極為重要。如果您是本程式新手,請閱讀"選項順序" 段落。 + +

+ +
+ + +

2.1. 全域選項

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-v, --verbose + +

增強詳細程度。

+ +
-q, --quiet + +

停用狀態輸出。

+ +
-o, --output 檔名 + +

寫入至檔案 檔名。如果使用分割功能,此參數的處理方式會有所不同。詳細資訊請參閱 --split 選項說明。 +

+ +
-w, --webm + +

创建 WebM 兼容文件。若输出文件的扩展名为 "webm" 则将自动打开本选项。此模式将实施一些限制。只允许使用编解码器为 + VP8、VP9 的视频轨道及 Opus、Vorbis 的音频轨道。DocType 头部项目将改为 "webm"。 + +

+ + +

+ 对于章节与标签,只允许使用一部分元素。mkvmerge(1) 将自动移除规范所不允许的元素。 + +

+ +
--title 標題 + +

设置整个生成文件的标题,比如电影名称。

+ +
--default-language 語言碼 + +

设置默认语言代码,用于没有使用 --language + 选项设置语言的轨道以及源容器未提供语言值的轨道。 +

+ + +

默认的语言代码为「und」,即「undetermined」(未定)。 +

+ +
+ + + +

2.2. 剪輯資訊處理(全域選項)

+ + + + + + + + + + + + + + + + + + + + +
OptionDescription
--segmentinfo 檔名.xml + +

+ 从 XML 文件中读取剪辑信息。此文件可以包含剪辑族的 UID、剪辑的 + UID、上一剪辑以及下一剪辑的 UID 元素。示例文件以及 + DTD 已包含在 MKVToolNix 套件内。 + +

+ + +

+ 關於詳細資訊請參閱下列 剪輯資訊 XML 檔 的章節。 + +

+ +
--segment-uid SID1,SID2,... + +

+ 设定要使用的剪辑 UID。这是个逗号分割的 128 位 UID 列表,UID 为通常的格式: 十六进制数字,"0x" + 前缀可选,空格可选,但必须恰好有 32 个数位。 + +

+ + +

+ 若 SID 以“=”开头,则其剩余部分将作为 Matroska 文件解析,将读取并使用该文件的剪辑 UID。 + +

+ + +

+ 创建的每个文件都包含一个剪辑,每个剪辑有一个剪辑 UID。如果指定的剪辑 UID 比创建的剪辑多,则多余的 UID 将被忽略。如果指定的 UID + 比创建的剪辑少,则将随机创建 UID。 + +

+ +
+ + + +

2.3. 章節與標籤處裡(全域選項)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--chapter-language 語言碼 + +

+ 设置各章节项的 ISO 639-2 语言代码。 默认为 'eng'。 详情参见下文中关于 章节 的段落。 + +

+ + +

+ 此选项可用于简单章节文件与包含章节但不含章节语言信息的输入文件,如 MP4 与 OGM 文件。 + +

+ + +

+ 本选项设置的语言也将用于 --generate-chapters + 选项 所生成的章节。 + +

+ +
--chapter-charset 字元集 + +

+ 设置简单章节文件的字符集,用于将其转换为 UTF-8。关于 mkvmerge(1) 如何转换不同字符集的说明,请参见关于文本文件与字符集的段落。 + +

+ + +

+ 此开关亦可应用到从特定容器类型,如 Ogg/OGM 和 MP4 文件中复制而来的章节。 详情参见下文关于章节的段落。 + +

+ +
--chapter-sync + d[,o[/p]] + +

+ 将章节的时间戳平移 d ms。您也可以使用 --sync + 选项操作特殊轨道 ID -2 (参见 特殊轨道 ID 段落)。 + +

+ + +

+ o/p: 按 + o/p 调整时间戳以修复线性偏移。如果省略 + p 则默认为 1。o 与 + p 均可为浮点数。 + +

+ + +

+ 默认: 无手动同步校正 (与 d = 0 及 + o/p = 1.0 + 效果相同)。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--generate-chapters 模式 + +

+ mkvmerge(1) 可以自动创建章节。目前支持下述两种模式: + +

+ + +
    + +
  • + +

    + 'when-appending'(追加文件时) – 文件开头为第一章,随后每追加一个文件便创建一个章节。 + +

    + + +

    + 此模式同时支持「parts:」及「parts-frames:」两种切割模式。对于这些模式,每段新增的时间戳范围会生成一个新章节 + (其起始时间戳带有「+」前缀)。 + +

    + + +
    +

    Note:

    + +

    + mkvmerge(1) 要求存在视频轨或音频轨,方可确定新文件追加的时间。若混流一或多个视频轨,则将使用第一个轨道的参数。否则将使用第一个音频轨。 + +

    + +
    + +
  • + + +
  • + +

    + 'interval:指定时间' – 该模式根据 + 指定时间 所给出的固定时间间隔生成章节。参数的格式既可以为 + HH:MM:SS.nnnnnnnnn 的形式,也可以为数字后接单位 + 's'、'ms' 或 'us'。 + +

    + + +

    + 範例: --generate-chapters interval:45s + +

    + +
  • + +
+ + +

+ 新章节的名称由选项 --generate-chapters-name-template + 控制。语言通过 --chapter-language + 设置,该选项必须出现在 --generate-chapters 之前。 + +

+ +
--generate-chapters-name-template 範本 + +

+ 该选项设置 --generate-chapters + 选项所生成的章节名称的名称模板。若未使用该选项,则将使用默认值 '第 <NUM:2> 章'。 + +

+ + +

+ 模板中可以使用多个变量,这些变量将在生成章节时被实际值替代。字符串 '<NUM>' + 将被章节号替代。字符串 '<START>' 将被章节的起始时间戳替代。 + +

+ + +

+ 字串 「<FILE_NAME>」 與 + 「'<FILE_NAME_WITH_EXT>」 只會在為追加檔案產生章節時進行填充。 + 它們會被取代為追加檔案的檔名,前者不含副檔名,後者包含副檔名。 注意,只會插入檔案本身的名稱 (及副檔名),不會插入其目錄名稱或磁碟機代號。 + +

+ + +

+ 您可以以 '<NUM:位数>' 的形式指定章节编号的最少位数,如 + '<NUM:3>'。最终的数字,若其位数小于指定位数,则将在开头补零。 + +

+ + +

+ 您可以以 <START:格式>的形式控制起始时间戳的格式。若未给出格式,则默认为 + '%H:%M:%S'。有效的格式代码包括: + +

+ + +
    + +
  • + +

    %h – 時 +

    + +
  • + +
  • + +

    %H – 二位數小時 +

    + +
  • + +
  • + +

    %m – 分 +

    + +
  • + +
  • + +

    %M – 二位數分鐘 +

    + +
  • + +
  • + +

    %s – 秒 +

    + +
  • + +
  • + +

    %S – 二位數秒數 +

    + +
  • + +
  • + +

    %n – 小數點後九位的奈秒 +

    + +
  • + +
  • + +

    %<1-9>n – 纳秒,精度最高为九位 (如 %3n + 代表三位) +

    + +
  • + +
+ +
--cue-chapter-name-format 格式 + +

+ mkvmerge(1) 支持读取音频文件的 CUE 表单作为章节输入。CUE + 表单中各索引项通常含有 PERFORMER(表演者)TITLE(标题) + 项。mkvmerge(1) 使用这两个字串构建章节名称。使用此选项可设定构建名称所用的格式。 + +

+ + +

+ 如果此选项未给定则 mkvmerge(1) 默认使用 '%p - %t' 格式 (表演者, 后接空格, 一个破折号, + 另一个空格以及标题)。 + +

+ + +

+ 如果给定了格式,则除了后续的标签字符以外都将被原样复制,标签字符将被进行下述替换: + +

+ + +
    + +
  • + +

    %p 被当前项的 PERFORMER(表演者) 字符串替代, +

    + +
  • + +
  • + +

    %t 被当前项的 TITLE(标题) 字符串替代, +

    + +
  • + +
  • + +

    %n 被当前轨道编号替代,此外 +

    + +
  • + +
  • + +

    %N 被当前轨道衬式编号(小于 10 则在前面加零)替代。 +

    + +
  • + +
+ +
--chapters 檔名 + +

+ 从文件 文件名 读取章节信息。详情参阅下文关于 章节 的段落。 + +

+ +
--global-tags 檔名 + +

+ 從檔案 檔名讀取全域標籤。關於詳細資訊請參閱下列 標籤 的章節。 + +

+ +
+ + + +

2.4. 一般輸出控制 (進階全域選項)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--track-order + FID1:TID1,FID2:TID2,... + +

+ 此选项更改输入文件创建时轨道的顺序。变量为逗号分隔的成对的 ID 列。每对先包含有文件 ID + (FID1),即文件在命令行中的顺序,由 0 开始计数。第二个是在该文件中的轨道 ID + (TID1)。 如果省去部分轨道的 ID,则这些轨道将在使用本选项给定的轨道创建之后创建。 + +

+ +
--cluster-length 規格 + +

+ 限制每个簇中数据块的数量或数据的时长。指令 参数可以是无单位的数字 + n,也可以是后缀有 'ms' 的 + d。 + +

+ + +

+ 如果未使用数字,mkvmerge(1) 将在每个簇中放置最多 n 个数据块。最大块数是 65535。 + +

+ + +

+ 如果数字 d 后缀有 'ms',mkvmerge(1) + 将在每个簇中放置最多 d 毫秒的数据。d 的最小值是 + '100ms',最大值是 '32000ms'。 + +

+ + +

+ mkvmerge(1) 默认每簇最多放置 65535 个数据块或 5000ms 的数据。 + +

+ + +

+ 尝试定位到特定帧的程序只能直接定位到簇,然后需要读取整个簇(来完成定位)。因此创建较大的簇将导致定位不精确或缓慢。 + +

+ +
--clusters-in-meta-seek + +

+ 告诉 mkvmerge(1) 在文件末尾创建包含所有簇的元定位元素。参阅关于 Matroska 文件规划 的段落。 + +

+ +
--timestamp-scale 因素 + +

+ 强制时间戳缩放系数为 系数。有效值域为 + 1000..10000000 或特殊值 + -1。 + +

+ + +

+ 通常 mkvmerge(1) 会使用数值 1000000,这样时间戳和时长的精度为 + 1ms。对于不包含视频轨但含有至少一条音频轨的文件,mkvmerge(1) + 将自动选择一个时间戳缩放系数以使各轨的音频采样精度相同。这将引起更大的额外开销,但将允许更为精确的定位与提取。 + +

+ + +

+ 如果使用了特殊值 -1,即使有视频轨,mkvmerge(1) 也将使用采样精度。 + +

+ +
--enable-durations + +

+ 为所有块写入时长。这将增大文件尺寸,而且目前对播放器来说不提供任何额外的益处。 + +

+ +
--no-cues + +

+ 让 mkvmerge(1) 不要创建或写入 cue 索引( 可类比作 AVI 文件中的索引)。没有索引的 Matroska(tm) + 文件也能播放,但定位可能不精确且缓慢。仅当您确实强求空间或用作测试时使用此选项。请参阅可为各输入文件指定的 --cues 选项。 + +

+ +
--no-date + +

+ 默认情况下,mkvmerge(1) 会将剪辑信息中的「date」字段设为混流开始的日期与时间。通过此选项可以完全不写入该字段。 + +

+ +
--disable-lacing + +

+ 禁用所有轨道的紧缩。这将增加文件大小,尤其是当有很多音频轨时。此选项不供日常之用。 + +

+ +
--disable-track-statistics-tags + +

+ 通常 mkvmerge(1) 会为每条轨道写入特定的统计信息标签。若这类标签已存在,则将被覆盖。这些标签包括 + BPSDURATIONNUMBER_OF_BYTES + 及 NUMBER_OF_FRAMES。 + +

+ + +

+ 启用本选项可阻止 mkvmerge(1) 写入这些标签或修改现有的同名标签。 + +

+ +
--disable-language-ietf + +

+ mkvmerge(1) 通常会在轨道头部、章节以及标签中同时写入传统语言元素以及全新的 IETF BCP 47 + 语言元素。若使用此选项,则只会写入传统元素。 + +

+ +
--normalize-language-ietf 模式 + +

+ 将 IETF BCP 47 + 语言标签规范化,支持「canonical」(最简式)、「extlang」(扩展语言子标签形式)以及「off」关闭模式。默认(不添加本选项)会规范化至最简式。 + +

+ + +

+ 最简式模式下,所有存在推荐值(preferred value)的语言子标签都会被替换为推荐值。依规范会执行下述转换: + 「zh-yue-jyutping」 转换为 + 「yue-jyutping」,「fr-FX」 转换为 + 「fr-FR」。 + +

+ + +

+ 扩展语言子标签形式在最简式的基础上生成。所有存在扩展语言子标签(extended language subtag)的主要语言(primary + language)都被替换为子标签对应的前缀加上该子标签。该规则将 「yue-jyutping」 转回传统的 + 「zh-yue-jyutping」 形式,但 「fr-FR」 + 不会发生变化,因为 「fr」 不属于扩展语言子标签。 + +

+ +
--stop-after-video-ends + +

+ Stops processing after the primary video track ends, discarding any + remaining packets of other tracks. + +

+ +
+ + + +

2.5. 檔案分割、連結、附加與串聯 (其他全域選項)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--split 規格 + +

+ 在给定尺寸或时间之后切割输出文件。请注意,各轨道只能在关键帧之前的地方切割开来。因此实际切割点可能比用户指定的稍稍靠后些。 + +

+ + +

+ 目前 mkvmerge(1) 支持以下模式: + +

+ + +
    + +
  1. + +

    + 依大小分割。 + +

    + + +

    + 語法: --split + [size:]d[k|m|g] + +

    + + +

    + 範例: --split size:700m--split 150000000 + +

    + + +

    + 参数 d 可以以 + 'k'、'm' 或 'g' + 结尾,分别说明尺寸的单位为 KB、MB 或 GB。 否则假定单位为字节。 当前输出文件达到此尺寸限制后将开始输出新的文件。 + +

    + + +

    + 'size:' 的首碼可因相容性理由省略。 + +

    + +
  2. + + +
  3. + +

    + 時間後分割。 + +

    + + +

    + 語法: --split + [duration:]HH:MM:SS.nnnnnnnnn|ds + +

    + + +

    + 範例: --split duration:00:60:00.000--split 3600s + +

    + + +

    + 此参数可以用 HH:MM:SS.nnnnnnnnn 的形式指定纳秒精度的时长,也可以是后接字母 + 's' 的指定秒数时长的数字 + dHH + 为小时数,MM 为分钟数,SS + 为秒数,而nnnnnnnnn 为纳秒数。 小时数与纳秒数均可省略。 小数点后最多可以有九位。 + 当前输出内容的时长达到此限制后将开始输出新的输出文件。 + +

    + + +

    + 'duration:' 的首碼可因相容性理由省略。 + +

    + +
  4. + + +
  5. + +

    + 指定時間戳記後分割。 + +

    + + +

    + 語法: --split + timestamps:A[,B[,C...]] + +

    + + +

    + 範例: --split timestamps:00:45:00.000,01:20:00.250,6300s + +

    + + +

    + 参数 + ABC + 等等的格式与按时长切割模式(见上文)所用的格式相同。时间戳表以逗号分隔。 + 输入流达到当前切割点的时间戳后将创建新的输出文件。然后将使用所给定的下一个切割点。 + +

    + + +

    + 'timestamps:' 的首碼不可省略。 + +

    + +
  6. + + +
  7. + +

    + 通过指定时间戳范围,保留特定部分,并丢弃其余部分。 + +

    + + +

    + 語法: --split + parts:起始1-結束1[,[+]起始2-結束2[,[+]起始3-結束3...]] + +

    + + +

    + 範例: +

      + +
    1. +

      --split parts:00:01:20-00:02:45,00:05:50-00:10:30

      +
    2. + +
    3. +

      --split parts:00:01:20-00:02:45,+00:05:50-00:10:30

      +
    4. + +
    5. +

      --split parts:-00:02:45,00:05:50-

      +
    6. + +
    + +

    + + +

    + parts 模式可以告诉 mkvmerge(1) 保留特定时间戳范围,而丢弃其余部分。要保留的范围需要在 + parts: 关键词后列出,以逗号隔开。各分段由起始及终止时间戳组成,格式与其他 + --split 模式所能接受的相同 (如 00:01:20 与 + 80s 代表相同的时间戳)。 + +

    + + +

    + 若起始时间戳留空,则默认为前一段的终止时间戳。若不存在前一段,则默认为文件开头 (参见示例 3)。 + +

    + + +

    + 若终止时间戳留空,则默认为输入文件末尾,亦即告诉 mkvmerge(1) 保留其余部分 (参见示例 3)。 + +

    + + +

    + 通常每一段都会写入新的文件。该行为也可以调整,以便将连续的分段写入同一个文件。要实现这种效果,用户可以在起始时间戳开头加上 + + 前缀。这样可以告诉 mkvmerge(1) + 不要创建新文件,而是将该分段写入与之前一段相同的文件当中。时间戳也会自动调整,确保即使输入文件中两分段不连续,输出文件中也不出现间隙。 + +

    + + +

    + 例 1 中 mkvmerge(1) 会创建两个文件。第一个包含从 00:01:20 到 + 00:02:45 之间的内容。第二个文件包含从 00:05:50 到 + 00:10:30 之间的内容。 + +

    + + +

    + 例 2 中 mkvmerge(1) 将只创建一个文件。该文件包含从 00:01:20 到 + 00:02:45 及从 00:05:50 到 + 00:10:30 的内容。 + +

    + + +

    + 例 3 中 mkvmerge(1) 将创建两个文件。第一个包含从输入文件开头到 00:02:45 + 的内容。第二个文件将包含从 00:05:50 到输入文件结尾之间的内容。 + +

    + + +
    +

    Note:

    + +

    + 请注意,mkvmerge(1) + 只在关键帧位置决定是否切割。每段切割区域的起始点与结束点均为关键帧。因此即使结束时间戳介于两个关键帧之间,mkvmerge(1) + 也将继续输出帧,直到下一关键帧为止(不包括)。 + +

    + +
    + +
  8. + + +
  9. + +

    + 通过指定帧/场序号范围,保留特定部分,并丢弃其余部分。 + +

    + + +

    + 語法: --split + parts-frames:start1-end1[,[+]start2-end2[,[+]start3-end3...]] + +

    + + +

    + 範例: +

      + +
    1. +

      --split parts-frames:137-258,548-1211

      +
    2. + +
    3. +

      --split parts-frames:733-912,+1592-2730

      +
    4. + +
    5. +

      --split parts-frames:-430,2512-

      +
    6. + +
    + +

    + + +

    + parts-frames 模式可以告诉 mkvmerge(1) + 保留特定帧/场序号范围,而丢弃其余部分。要保留的范围需要在 parts-frames: + 关键词后列出,以逗号隔开。各分段由起始及终止帧/场序号组成。序号从 1 开始计数。 + +

    + + +

    + 若起始序号留空,则默认为前一段的终止序号。若不存在前一段,则默认为文件开头 (参见示例 3)。 + +

    + + +

    + 若终止序号留空,则默认为文件末尾,亦即告诉 mkvmerge(1) 保留其余部分 (参见示例 3)。 + +

    + + +

    + 通常每一段都会写入新的文件。该行为也可以调整,以便将连续的分段写入同一个文件。要实现这种效果,用户可以在起始序号开头加上 + + 前缀。这样可以告诉 mkvmerge(1) + 不要创建新文件,而是将该分段写入与之前一段相同的文件当中。时间戳也会自动调整,确保即使输入文件中两分段不连续,输出文件中也不出现间隙。 + +

    + + +
    +

    Note:

    + +

    + 请注意,mkvmerge(1) + 只在关键帧位置决定是否切割。每段切割区域的起始点与结束点均为关键帧。因此即使结束帧/场序号介于两个关键帧之间,mkvmerge(1) + 也将继续输出帧,直到下一关键帧为止(不包括)。 + +

    + +
    + + +

    + 例 1 中 mkvmerge(1) 会创建两个文件。第一个包含从第 137 帧或之后的第一个关键帧,到第 + 258 帧或之后的第一个关键帧(但不含该关键帧)之间的内容。第二个文件包含第 + 5481211 帧之间的内容。 + +

    + + +

    + 例 2 中 mkvmerge(1) 将只创建一个文件。该文件包含从 733 到 + 912 及从 15922730 + 的内容。 + +

    + + +

    + 例 3 中 mkvmerge(1) 将创建两个文件。第一个包含输入文件开头到 430 的内容。第二个文件将包含从 + 2512 到输入文件结尾之间的内容。 + +

    + + +

    + 该模式只考虑输出的第一条视频轨道。 如果没有输出视频轨道,则将不会进行切割操作。 + +

    + + +
    +

    Note:

    + +

    + 通过本参数给出的数字将根据输出的 Matroska(tm) 区块解析。 单个 Matroska(tm) 区块可包含完整的一帧 (对于逐行扫描的内容) 或单场 + (对于隔行扫描的内容)。 mkvmerge 不区分两者,它直接统计区块数目。 例如: 假设某人希望在隔行扫描的第 25 个完整帧之后切割,则应使用 + 50 (每帧对应两场) 作为切割点。 + +

    + +
    + +
  10. + + +
  11. + +

    + 在指定影格數/圖場數後分割。 + +

    + + +

    + 語法: --split + frames:A[,B[,C...]] + +

    + + +

    + 示例: --split frames:120,237,891 + +

    + + +

    + 参数 + ABC + 等等必须全为正整数。编号从 1 开始。 帧/场编号列表以逗号分隔。 + 输入流达到当前切割点的帧/场编号后将创建新的输出文件。然后将使用所给定的下一个切割点。 + +

    + + +

    + 'frames:' 的首碼不可省略。 + +

    + + +

    + 该模式只考虑输出的第一条视频轨道。 如果没有输出视频轨道,则将不会进行切割操作。 + +

    + + +
    +

    Note:

    + +

    + 通过本参数给出的数字将根据输出的 Matroska(tm) 区块解析。 单个 Matroska(tm) 区块可包含完整的一帧 (对于逐行扫描的内容) 或单场 + (对于隔行扫描的内容)。 mkvmerge 不区分两者,它直接统计区块数目。 例如: 假设某人希望在隔行扫描的第 25 个完整帧之后切割,则应使用 + 50 (每帧对应两场) 作为切割点。 + +

    + +
    + +
  12. + + +
  13. + +

    + 在指定的章節前分割。 + +

    + + +

    + 語法: --split chapters:all 或 + --split + chapters:A[,B[,C...]] + +

    + + +

    + 範例: --split chapters:5,8 + +

    + + +

    + 参数 + ABC + 等等必须全为正整数。编号从 1 开始。 章节编号列表以逗号分隔。 切割将在时间戳等于或大于所列编号对应章节的起始时间戳的首个关键帧之前进行。从 0s + 开始的章节将不作考虑,并不作提示,直接丢弃。 + +

    + + +

    + 可以使用關鍵字 all 取代手動輸入所有章節編號。 + +

    + + +

    + 'chapters:' 首碼的不可省略。 + +

    + + +
    +

    Note:

    + +

    + Matroska(tm) 文件格式支持任意深度嵌套的章节结构,称为“版本条目”与“章节单位”。 但该模式仅考虑所有版本条目中最顶层的章节。 + +

    + +
    + +
  14. + +
+ + +

+ 此切割模式下输出文件名将以不同于常用操作的方式对待。可能会含有类似 printf 中 + '%d' 的表达式,包括可选的字段宽度,如 + '%02d'。如果含有上述表达式,当前文件序号将按相应格式生成,然后插入到文件名中的相应位置。 + 如果没有此类匹配模式,则假定匹配模式为在文件扩展名之前插入 '-%03d': '-o 输出.mkv' + 将生成 '输出-001.mkv' 这样的一系列文件。如果没有扩展名,'-%03d' + 将被追加在文件名之后。 + +

+ + +

+ 也可以选用「%c」,它将被替换为文件中首个章节的名称。注意:当「%c」存在时,不会再自动添加「-%03d」。 + +

+ +
--link + +

+ 切割输出文件时连接文件。详情请参阅下文 文件链接 段落。 + +

+ +
--link-to-previous 剪輯-UID + +

+ 连接第一个输出文件到指定 剪辑-UID 参数对应的剪辑。详情请参阅下文 文件链接 段落。 + +

+ + +

+ 若 SID 以“=”开头,则其剩余部分将作为 Matroska 文件解析,将读取并使用该文件的剪辑 UID。 + +

+ +
--link-to-next 剪輯-UID + +

+ 连接最后一个输出文件到指定 剪辑-UID 参数对应的剪辑。详情请参阅下文 文件链接 段落。 + +

+ + +

+ 若 SID 以“=”开头,则其剩余部分将作为 Matroska 文件解析,将读取并使用该文件的剪辑 UID。 + +

+ +
--append-mode 模式 + +

+ 决定追加合并文件时如何计算时间戳。 参数 模式 可以有两个数值: 默认的 + 'file(文件)' 和 'track(轨道)'。 + +

+ + +

+ 当 mkvmerge 将第二个文件 (下称「文件2」) 中的一条轨道 + (「轨道2_1」) 追加合并到第一个文件 (「文件1」) 的一条轨道 + (「轨道1_1」) 时,它将为「轨道2_1」的所有时间戳设定一定量的延时。 + 对于「file」(文件)模式,此延时量是「文件1」中出现的最大时间戳,即使此时间戳不属于轨道「轨道1_1」。而在轨道(track)模式下,此延时为「轨道1_1」本身的最大时间戳。 + +

+ + +

+ 不幸的是 mkvmerge 无法侦测使用哪种模式更为可靠。因此默认为 'file(文件)' + 模式。'file' 模式对单独创建的文件的处理通常更好;例如在追加 AVI 或 + MP4 文件时。'track(轨道)' + 模式对一个大文件的完整分块的处理更好,例如对于 VOBEVO 文件。 + +

+ + +

+ 即使选用了 'track(轨道)' 模式,字母轨道也将按照 + 'file(文件)' 模式处理。 + +

+ +
--append-to + SFID1:STID1:DFID1:DTID1[,...] + +

+ 此选项控制将哪一条轨道追加合并到哪一条轨道。 每组指令由四个 ID 组成: 输入文件 ID 及轨道 ID、目标文件 ID 及目标轨道 ID。 + 第一对,「输入文件 ID」与「输入轨道 ID」确定正要执行追加合并操作的轨道。 第二对,「目标文件 ID」与「目标轨道 + ID」,确定输入轨道即将追加合并到的目标轨道。 + +

+ + +

+ 如果忽略本选项,则将使用标准映射。 标准映射即将当前文件的各个轨道追加到前一个文件的相应轨道(轨道 ID 相同)。 + 当影片被切割为多段,且各文件中轨道数和轨道 ID 相同时,这将允许简单的追加合并,命令行为 mkvmerge -o 输出.mkv + 第一段.mkv +第二段.mkv。 + +

+ +
+ + +

+ 单个 '+' 将追加后面的文件,而不是添加。'+' 也可以直接放在下一个文件名的前面。因此以下两条命令等效: + +

+ +
$ mkvmerge -o 完整.mkv 文件1.mkv + 文件2.mkv
+$ mkvmerge -o 完整.mkv 文件1.mkv +文件2.mkv
+
[ 檔案1 檔案2 + ] + +

+ 如果方括号内包含多个文件名,则从第二个文件开始的所有文件都将追加合并到括号中第一个文件后面。 + +

+ + +

+ 这是用“+”连接文件名的另一种语法。因此下述两条命令是等效的: + +

+ +
$ mkvmerge -o 完整.mkv 文件1.mkv + 文件2.mkv
+$ mkvmerge -o 完整.mkv '[' 文件1.mkv 文件2.mkv ']'
+
= + +

+ 对特定类型的文件 (MPEG 节目流,即 VOB 文件) mkvmerge(1) + 通常会去输入文件所在的目录寻找是否存在基本文件名一致、仅编号存在差异的文件 + (例如「VTS_01_1.VOB」「VTS_01_2.VOB」「VTS_01_3.VOB」等) + 并将所有文件视为互相串联的单个大文件。此选项——单个「=」——要求 mkvmerge 不要去寻找其他文件。 + +

+ + +

+ '=' 也可以放在下一个文件名的前面。因此以下两条命令等效: + +

+ +
$ mkvmerge -o 完整.mkv = 文件1.vob
+$ mkvmerge -o 完整.mkv =文件1.vob
+
( 檔案1 檔案2 + ) + +

+ 如果一對括號中包含多個檔案名稱,這些檔案視為由單一大型檔案組成,而該大型檔案內容的組成是由一個檔案接著一個檔案的方式形成。 + +

+ + +

+ 该功能可用于如 DVD 中的 VOB 文件,或是 MPEG 传输流。如果各文件有独立的头,常见的例子如独立的 AVI 或 MP4 文件,则不适用。 + +

+ + +

+ 将文件名置于括号中还可以阻止 mkvmerge(1) 查找具有相同基名称的文件,如 = + 选项 所述。因此下面两则命令行等效: + +

+ +
$ mkvmerge -o 输出.mkv = 文件.mkv
+$ mkvmerge -o 输出.mkv '(' 文件.mkv ')'
+ +

+ 需要注意以下幾點: + +

+ + +
    + +
  1. + +

    + 左括号后、右括号前均必须有空格。 + +

    + +
  2. + + +
  3. + +

    + 括号之间的所有参数都作为文件名解析。因此应用到此逻辑文件的所有选项都必须在左括号之前列出。 + +

    + +
  4. + + +
  5. + +

    + 一些 shell 会将括号作为特殊符号对待。因此您需要像上例这样进行转义或给它们加上引号。 + +

    + +
  6. + +
+ +
+ + + + +

2.6. 附件支援(更多全域選項)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-description 描述 + +

+ 对后面附件的纯文字描述。将应用到下一个 --attach-file + 或 --attach-file-once 选项。 + + +

+ +
--attachment-mime-type MIME 類型 + +

+ 后面附件的 MIME 类型。将应用到下一个 --attach-file + 或 --attach-file-once + 选项。 官方认可的 MIME 类型列表可以在如 IANA 主页 + 找到。MIME 类型对附件来说是必需的。 + +

+ + +

+ 如果没有指定附件的 MIME 类型,则会自动侦测其类型。 + +

+ +
--attachment-name 名稱 + +

+ 设置此附件将在输出文件中储存的名称。 如果未给出此选项则将由 --attach-file + 或 --attach-file-once + 选项所设的文件名推得。 + +

+ +
+ --attach-file 檔名, + --attach-file-once 檔名 + + +

+ 在 Matroska(tm) 檔案建立檔案附件。必須先設定 MIME + 類型,才能使用此設定。這兩種形式的差別在於分割檔案時:使用 --attach-file + 會將附件附加到所有輸出的分割檔案;而使用 --attach-file-once + 只會將附件附加到第一個建立的檔案中。如果未有任何分割,輸出結果將相同。 + +

+ + +

+ mkvextract(1) 可用於從 Matroska(tm) 檔中提取附加檔。 + +

+ +
--enable-legacy-font-mime-types + +

+ 对于特定类型的字体附件,使用传统的 MIME 类型。例如,TrueType + 字体的类型将标注为「application/x-truetype-font」而非「fonts/ttf」。 + +

+ + +

+ 这将同时影响未手动指定 MIME 类型的新附件,以及现有的字体附件,其已存在的 + MIME 类型将被重新映射至传统类型。 + +

+ + +

+ 受影响的 MIME + 类型如下:「font/sfnt」「font/ttf」「font/collection」将全部映射至「application/x-truetype-fonts」,「 + font/otf」将被映射至「application/vnd.ms-opentype」。 + +

+ +
+ + + +

2.7. 可用於每個輸入檔的選項

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-a, --audio-tracks + [!]n,m,... + +

+ 复制 nm 等音频轨。数字是可以通过 --identify + 开关获取的轨道 ID。他们不只是简单的轨道序号(参见 轨道 + ID段落)。默认: 复制所有音频轨道。 + +

+ + +

+ 除轨道 ID 以外,您还可以提供 ISO 639-2 语言代码。仅当输入文件的轨道包含语言标签时可用。 + +

+ + +

+ 預設: 複製此類型的所有軌道。 + +

+ + +

+ 若 ID 以 ! 开头,则其意义相反: 复制该类的所有轨道,除了 ! + 后面所列出的轨道。 + +

+ +
-d, --video-tracks + [!]n,m,... + +

+ 复制 nm 等视频轨。数字是可以通过 --identify + 开关获取的轨道 ID。他们不只是简单的轨道序号(参见 轨道 + ID段落)。默认: 复制所有视频轨道。 + +

+ + +

+ 除轨道 ID 以外,您还可以提供 ISO 639-2 语言代码。仅当输入文件的轨道包含语言标签时可用。 + +

+ + +

+ 若 ID 以 ! 开头,则其意义相反: 复制该类的所有轨道,除了 ! + 后面所列出的轨道。 + +

+ +
-s, --subtitle-tracks + [!]n,m,... + +

+ 复制 nm 等字幕轨。数字是可以通过 --identify + 开关获取的轨道 ID。他们不只是简单的轨道序号(参见 轨道 + ID段落)。默认: 复制所有字幕轨道。 + +

+ + +

+ 除轨道 ID 以外,您还可以提供 ISO 639-2 语言代码。仅当输入文件的轨道包含语言标签时可用。 + +

+ + +

+ 若 ID 以 ! 开头,则其意义相反: 复制该类的所有轨道,除了 ! + 后面所列出的轨道。 + +

+ +
-b, --button-tracks + [!]n,m,... + +

+ 复制 nm 等按钮轨。数字是可以通过 --identify + 开关获取的轨道 ID。他们不只是简单的轨道序号(参见 轨道 + ID段落)。默认: 复制所有按钮轨道。 + +

+ + +

+ 除轨道 ID 以外,您还可以提供 ISO 639-2 语言代码。仅当输入文件的轨道包含语言标签时可用。 + +

+ + +

+ 若 ID 以 ! 开头,则其意义相反: 复制该类的所有轨道,除了 ! + 后面所列出的轨道。 + +

+ +
--track-tags + [!]n,m,... + +

+ 复制 nm 等轨道的标签。数字是可以通过 --identify + 开关获取的轨道 ID。他们不只是简单的轨道序号(参见 轨道 + ID段落)。默认: 复制所有轨道的标签。 + +

+ + +

+ 如果 ID 以 ! 作为前缀,则含义相反: 复制除了列在 ! 后面的 ID + 以外的所有轨道。 + +

+ +
-m, --attachments + [!]n[:all|first],m[:all|first],... + +

+ 复制 ID 为 nm + 等的附件到所有或者仅首个输出文件中。各 ID 后可接 ':all'(如果两可选数值均未输入,此为默认值)或者 + ':first'。如果切割功能已被起用,则 ID 被指定为 ':all' + 的附件将被复制到所有生成的输出文件中,而其他附件只被复制到首个输出文件中。如果未使用切割功能则两变量等效。 + +

+ + +

+ 預設值是將所有附件複製到所有輸出檔案。 + +

+ + +

+ 如果 ID 以 ! 作为前缀,则含义相反: 复制除了列在 ! 后面的 ID + 以外的所有轨道。 + +

+ +
-A, --no-audio + +

+ 不要從此檔案複製任何音訊軌。 + +

+ +
-D, --no-video + +

+ 不要從此檔案複製任何視訊軌。 + +

+ +
-S, --no-subtitles + +

+ 不要從此檔案複製任何字幕軌。 + +

+ +
-B, --no-buttons + +

+ 不要從此檔案複製任何按鈕軌。 + +

+ +
-T, --no-track-tags + +

+ 不要從此檔複製任何軌道的指定標籤。 + +

+ +
--no-chapters + +

+ 不要從此檔案複製章節。 + +

+ +
-M, --no-attachments + +

+ 不要從此檔案複製附件。 + +

+ +
--no-global-tags + +

+ 不要從此檔案複製全域標籤。 + +

+ +
-y, --sync + TID:d[,o[/p]] + +

+ 将 id 为 TID 的轨道的时间戳按 d ms + 进行调整。轨道 ID 与 --identify + 所给出的相同 (参见 轨道 ID 段落)。 + +

+ + +

+ o/p: 按 + o/p 调整时间戳以修复线性偏移。如果省略 + p 则默认为 1。o 与 + p 均可为浮点数。 + +

+ + +

+ 默认: 无手动同步校正 (与 d = 0 及 + o/p = 1.0 + 效果相同)。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--cues TID:none|iframes|all + +

+ 控制为指定轨道 (参阅 轨道 ID 段落) 创建何种 cue + 索引。'none(无)' 将阻止 cue 索引的创建。 而 'iframes(仅 i + 帧)' 表示仅将没有前后参考的块 ( = 视频轨道中的 I 帧) 置于 cue + 索引项中。'all(全部)' 将使 mkvmerge(1) 为所有区块创建索引,会使生成的文件非常大。 + +

+ + +

+ 默认值为 'iframes(仅 i 帧)'(视频及字幕轨道)或 + 'none(无)'(音频轨道)。参见 --no-cues + 选项,后者可阻止 cue 条目的创建,无论是否使用了 --cues 选项。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--default-track-flag + TID[:bool] + +

+ 若可选参数「布尔值」已设为 1 或不存在该数值,则为指定轨道 + (参见「轨道 ID」段落) + 设置「默认轨」标记。若输入容器未提供此信息,且用户未通过选项参数指定,即会设置该标记。 + +

+ + +

+ 如果用户在播放时不明确选择一条轨道,播放器应选择已设有「默认轨」标记的轨道,同时也应考虑用户偏好设置,例如用户偏好的语言。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--track-enabled-flag + TID[:布尔值] + +

+ 将指定轨道的「轨道启用」标记 (参阅「轨道 ID」段落) 设为指定值 + 布尔值 (0 或1; 若不指定,则默认为 1)。 + 只要没有特别指定选项值,且输入容器也未提供此类信息,轨道均默认为启用状态。 + +

+ + +

+ 只有设置了「轨道启用」标记的轨道才应作为播放器考虑播放的对象。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--forced-display-flag + TID[:bool] + +

+ 若可选参数「 布尔值」已设为 1 + 或不存在该数值,则为指定轨道设置「强制显示」标记 (参阅「轨道 + ID」段落)。 此选项适用于包含屏幕显示文字或外语对白翻译的轨道。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--hearing-impaired-flag + TID[:布尔值] + +

+ 若可选参数「布尔值」已设为 1 + 或不存在该数值,则为指定轨道设置「听觉障碍」标记 (参阅「轨道 + ID」段落)。 此标记适用于适合听觉障碍人士使用的轨道。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--visual-impaired-flag + TID[:布尔值] + +

+ 若可选参数「布尔值」已设为 1 + 或不存在该数值,则为指定轨道设置「视觉障碍」标记 (参阅「轨道 + ID」段落)。 此标记适用于适合视觉障碍人士使用的轨道。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--text-descriptions-flag + TID[:布尔值] + +

+ 若可选参数「布尔值」已设为 1 + 或不存在该数值,则为指定轨道设置「文字描述」标记 (参阅「轨道 + ID」段落)。 此标记适用于包含对视频内容的文字描述的轨道,它们适合视觉障碍人士通过文本转语音系统播放。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--original-flag + TID[:布尔值] + +

+ 若可选参数「布尔值」已设为 1 + 或不存在该数值,则为指定轨道设置「原始语言」标记 (参阅「轨道 + ID」段落)。 此标记适用于与内容原始语言一致 (而非翻译) 的轨道。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--commentary-flag + TID[:布尔值] + +

+ 若可选参数「布尔值」已设为 1 + 或不存在该数值,则为指定轨道设置「评论」标记 (参阅「轨道 + ID」段落)。 此标记适用于包含评论内容的轨道。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
--track-name TID:名稱 + +

+ 給指定軌道 (請參閱 軌道 ID 章節) 的名稱設定為 + 檔名。 + +

+ +
--language TID:語言 + +

+ 为指定轨道 (参见 轨道 ID) 设置语言。允许使用 ISO + 639-2 语言代码与 ISO 639-1 国家代码。国家代码将被自动转换为语言代码。 可以使用 --list-languages + 选项列出所有语言以及它们的 ISO 639-2 代码。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
-t, --tags TID:檔名 + +

+ 从文件 文件名 读取轨道号为 TID + 的轨道的标签。详情参见下文 标签 段落。 + +

+ +
--aac-is-sbr + TID[:0|1] + +

+ 告诉 mkvmerge(1) ID 为 TID 的轨道是 SBR AAC + (亦作 HE-AACAAC+)。下述情况下需要此选项:a) 输入文件是 + AAC 文件 (不是 Matroska(tm) 文件) 且 b) 该 + AAC 文件含有 SBR AAC 数据。 + 设置此开关的原因是目前技术上无法在不解码一个完整的 AAC 帧的情况下自动分辨普通的 + AAC 数据与 SBR AAC 数据。由于 AAC + 解码器的诸多专利问题,mkvmerge(1) 永远不会包含此解码层。因此此开关对于 SBR AAC + 文件是必需的。如果忽略了此开关,生成的文件可能无法正常回放,甚至可能根本无法播放。 + +

+ + +

+ 如果输入文件是 Matroska(tm) 文件,则已有足够侦测 SBR AAC 的 + CodecID 了。然而,如果 CodecID + 标注错误,此开关可用于更正之。 + +

+ + +

+ 如果 mkvmerge 错将 AAC 文件侦测为 SBR,您可以将 + ':0' 添加到轨道 ID。 + +

+ +
--audio-emphasis TID:n|symbolic-name + +

+ Sets the emphasis for the audio track with the track ID + TID. The mode can either be a number + n (certain values between 0 and + 16) or a symbolic name. All valid numbers & + symbolic names can be listed with the --list-audio-emphasis + option. + +

+ +
--reduce-to-core TID + +

+ 有些音频编码的核心是有损的,但提供了可选的扩展来实现无损解码。该选项告诉 mkvmerge(1) + 只复制核心部分,而不复制扩展部分。默认情况下,mkvmerge(1) 会复制全部内容。 + +

+ + +

+ 目前只有 DTS 轨道受此选项影响。嵌入 AC-3 核心的 TrueHD + 轨道以两个轨道的形式呈现,用户可以选择复制哪个轨道。DTS 无法采用这种方案,因为 HD 扩展部分不能单独解码 – 而 + TrueHD 数据可以。 + +

+ +
--remove-dialog-normalization-gain + TID + +

+ 部分音频编码包含告知解码器/播放器如何应用音量增益(通常是降低)的头部字段,从而实现对白正规化。此选项可让 mkvmerge(1)  + 修改相应头部字段,移除或减小增益。 + +

+ + +

+ 目前只有 AC-3DTSTrueHD + 軌道受此選項影響。 + +

+ +
--timestamps TID:檔名 + +

+ 从 文件名 读取要应用到指定轨道 ID 的时间戳。 这些时间戳将强制覆盖 mkvmerge(1) + 默认计算出的时间戳。参阅关于 外部时间戳文件 的章节。 + +

+ +
--default-duration TID:x + +

+ 强制指定轨道的默认时长为指定数值。 将同时修改轨道的时间戳以匹配该默认时长。 变量 x 必须有 + 's', 'ms', 'us', + 'ns', 'fps', 'p' 或 + 'i' 作为后缀,分别以秒、毫秒、微秒、纳秒、“帧每秒”、“逐行帧每秒”或“隔行帧每秒”为单位指定默认时长。数字 + x 本身可为浮点数或分数。 + +

+ + +

+ 如果未强制指定默认时长,mkvmerge 将尝试继承容器中(及/或特定轨道类型,如 AVC/H.264 或 MPEG-2 + 已编码的位流中)该轨道的默认时长。 + +

+ + +

+ 此选项也可用于在不使用外部时间戳文件的情况下更改视频轨的 FPS(帧率)。 + +

+ +
--fix-bitstream-timing-information + TID[:0|1] + +

+ 通常 mkvmerge(1) 不会更改视频位流中存储的时间同步信息 + (帧/场速率)。本选项可调整此信息,使之与容器的时间同步信息匹配。容器时间同步信息可从多个来源得到: 命令行指定 (参见 --default-duration + 选项)、源容器或从位流得出。 + +

+ + +
+

Note:

+ +

目前仅完成对 AVC/H.264 视频轨的实现。

+ +
+ +
--compression TID:n + +

+ 选择用于轨道的压缩算法。请注意,播放器也需要支持该算法才能正常播放。有效的值有 + 'none(不压缩)'、'zlib' 以及 + 'mpeg4_p2'/'mpeg4p2'。 + +

+ +

+ 压缩方式 'mpeg4_p2'/'mpeg4p2' 是一种称为 '去头' + 的特殊压缩方式,只对 MPEG4 part 2 视频轨可用。 + +

+ +

+ 部分字幕类型的默认压缩算法为 + 'zlib'。该算法也是大多数(如果不是所有)回放应用程序所支持的算法。无法保证对其他压缩算法的支持('none(不压缩)' + 除外)。 + +

+ +
+ + + +

2.8. 僅適用於視訊軌的選項

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-f, --fourcc + TID:FourCC + +

+ 强制 FourCC 为指定值。仅对 '微软兼容模式' 的视频轨有效。 + +

+ +
--display-dimensions TID:寬x高 + +

+ Matroska(tm) 文件含有两个设定播放器回放时应当将画面缩放到的显示属性值: 显示宽度与显示高度。 可以使用本选项设定这些数值,如 + '1:640x480'。 + +

+ + +

+ 指定所用数值的其他方法是使用 --aspect-ratio + 或 --aspect-ratio-factor + 选项 (参见下文)。 这些选项是互相独立的。 + +

+ +
--aspect-ratio TID:比例|寬度/高度 + +

+ Matroska(tm) 文件含有两个设定播放器回放时应当将画面缩放到的显示属性值: 显示宽度与显示高度。 通过本选项 mkvmerge(1) + 可自动根据画面原始宽高和本选项给定的宽高比计算出显示宽度和显示高度。 宽高比可以以浮点数 宽高比 或分数 + '宽度/高度' 的形式给出,如 + '16/9'。 + +

+ + +

+ 指定所用数值的其他方法是使用 --aspect-ratio-factor + 或 --display-dimensions + 选项 (参见上下文)。这些选项相互独立。 + +

+ +
--aspect-ratio-factor TID:係數|n/d + +

+ 另一种设置宽高比的方法是指定一个 系数。将将原始宽高比与 + 系数 相乘后用作目标宽高比。 + +

+ + +

+ 指定所用数值的其他方法是使用 --aspect-ratio + 或 --display-dimensions + 选项 (参见上文)。这些选项互相独立。 + +

+ +
--cropping TID:l至左,至頂,至右,至底 + +

+ 将视频轨道的像素裁减参数设为指定数值。 + +

+ +
--color-matrix-coefficients TID:n + +

+ 设置视频从红绿蓝三原色衍生出亮度及色度值所用的矩阵系数。参数 n 是范围从 + 010 的整数。 + +

+ + +

+ 有效值其含義為: + +

+ + +

+ 0: GBR, 1: BT709, + 2: unspecified, 3: reserved, + 4: FCC, 5: BT470BG, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: YCOCG, 9: BT2020 非恒定亮度, + 10: BT2020 恒定亮度 + +

+ +
--color-bits-per-channel TID:n + +

+ 设置颜色通道编码位数。数值 0 表示位数未指定。 + +

+ +
--chroma-subsample TID:水平,垂直 + +

+ 对 Cr 与 Cb 通道中未移除的像素,水平/垂直方向需要移除的像素数量。 + +

+ + +

+ 例如: 对于色度抽样为 4:2:0 的视频,该参数应设为 + TID:1,1。 + +

+ +
--cb-subsample TID:水平,垂直 + +

+ 对 Cb 通道中未移除的像素,水平/垂直方向需要移除的像素数量。该数值将与 --chroma-subsample + 相加。 + +

+ + +

+ 例如: 对于色度抽样为 4:2:1 的视频,参数 --chroma-subsample 应设为 + TID:1,0,Cb + 抽样应设为 + TID:1,0。 + +

+ +
--chroma-siting TID:水平,垂直 + +

+ 设置色度在水平/垂直方向上如何抽样 (0: 未指定, 1: + 顶部/左侧合并, 2: 对半)。 + +

+ +
--color-range TID:n + +

+ 设置色域裁剪 (0: 未指定, 1: 广播色域, + 2: 完整色域 (无裁剪), 3: 由 + MatrixCoefficients/TransferCharacteristics 指定)。 + +

+ +
--color-transfer-characteristics + TID:n + +

+ 視訊的傳輸類型。 + +

+ + +

+ 有效值其含義為: + +

+ + +

+ 0: 保留, 1: ITU-R BT.709, + 2: unspecified, 3: 保留, + 4: gamma 2.2 曲线, 5: gamma 2.8 曲线, + 6: SMPTE 170M, 7: SMPTE 240M, + 8: 线性, 9: 对数, + 10: 对数平方根, 11: IEC 61966-2-4, + 12: ITU-R BT.1361 extended color gamut, + 13: IEC 61966-2-1, 14: ITU-R + BT.2020 10 bit, 15: ITU-R BT.2020 12 bit, + 16: SMPTE ST 2084, 17: SMPTE ST + 428-1; 18: ARIB STD-B67 (HLG) + +

+ +
--color-primaries TID:n + +

+ 設定視訊的主要色彩。 + +

+ + +

+ 有效值其含義為: + +

+ + +

+ 0: 保留, 1: ITU-R BT.709, + 2: 未指定, 3: 保留, + 4: ITU-R BT.470M, 5: ITU-R + BT.470BG, 6: SMPTE 170M, 7: SMPTE + 240M, 8: FILM, 9: ITU-R BT.2020, + 10: SMPTE ST 428-1, 22: JEDEC P22 + 磷光体 + +

+ +
--max-content-light TID:n + +

+ 设置单个像素的最高亮度 (Maximum Content Light Level 最大内容亮度级别),单位为坎德拉每平方米 (cd/m²)。数值 + n 应为非负整数。 + +

+ +
--max-frame-light TID:n + +

+ 设置单个完整帧的最高亮度 (Maximum Frame-Average Light Level 最大帧平均亮度级别),单位为坎德拉每平方米 + (cd/m²)。数值 n 应为非负整数。 + +

+ +
--chromaticity-coordinates + TID:red-x,red-y,green-x,green-y,blue-x,blue-y + +

+ 設定由 CIE 1931 定義的紅/綠/藍色度座標。 + +

+ +
--white-color-coordinates TID:x,y + +

+ 設定由 CIE 1931 定義的白色色度座標。 + +

+ +
--max-luminance TID:浮點數 + +

+ 设置最高亮度,单位为坎德拉每平方米 (cd/m²)。数值应小于 9999.99。 + +

+ +
--min-luminance TID:浮點數 + +

+ 设置最低亮度,单位为坎德拉每平方米 (cd/m²)。数值应小于 999.9999。 + +

+ +
--projection-type TID:方式 + +

+ 设置要使用的视频投影方式。有效值包括:0 (方形投影), 1 (等距圆柱投影), 2 (立方面投影), 3 (网状投影)。 + +

+ +
--projection-private TID:資料 + +

+ 设置仅用于特定投影方式的私有数据。数据格式为十六进制数字,可以有 "0x" 前缀,可以有空格。 + +

+ +
--projection-pose-yaw TID:f漂浮點 + +

+ 指定繞 Z 軸旋轉至視訊外觀比。 + +

+ +
--projection-pose-pitch TID:漂浮點 + +

+ 指定繞 X 軸旋轉至視訊外觀比。 + +

+ +
--projection-pose-roll TID:漂浮點 + +

+ 指定繞 Y 軸旋轉至視訊外觀比。 + +

+ +
--field-order TID:n + +

+ 设置轨道 ID 为 TID 的视频轨道的场序。场序必须为以下数字之一: + +

+ + +

+ 0: 逐行扫描; 1: 隔行扫描,顶场先显示,顶场先存储; + 2: 未定场序; 6: 隔行扫描,底场先显示,底场先存储; + 9: 隔行扫描,底场先显示,顶场先存储; 14: + 隔行扫描,顶场先显示,底场先存储 + +

+ +
--stereo-mode TID:n|symbolic-name + +

+ Sets the stereo mode for the video track with the track ID + TID. The mode can either be a number + n between 0 and + 14 or a symbolic name. All valid numbers & names + can be listed with the --list-stereo-modes + option. + +

+ +
+ + + +

2.9. 僅適用於字幕軌的選項

+ + + + + + + + + + + + + + + + +
OptionDescription
--sub-charset TID:字元集 + +

+ 指定轨道 ID 对应的字符集,用于将字幕转换为 UTF-8 编码。如果未指定字符集,则将根据当前区域设置推算字符集。注意,对于从 Matroska(tm) + 文件或 Kate 流中读取的字幕不必指定字符集,因为这些字幕总是以 UTF-8 编码存储。关于 mkvmerge(1) + 如何转换不同字符集的说明,请参见关于 + 文本文件与字符集的段落。 + +

+ + +

+ 此选项可以对同一输入文件多次使用,通过每次选择不同轨道 ID 分别应用到多个轨道。 + +

+ +
+ + + +

2.10. 其他選項

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-i, --identify 檔名 + +

+ 将使 mkvmerge(1) 探查单个文件并报告其类型、文件中包含的轨道及其轨道 ID。如果使用了本选项,唯一可用的其他选项就是文件名。 + +

+ + +

结果的输出格式可以通过 --identification-format + 选项修改。 +

+ +
-J 檔名 + +

+ 這是 "--identification-format json --identify 檔名" 的簡便命名。 + +

+ +
-F, --identification-format + 格式 + +

+ 决定 --identify + 选项使用的输出格式。支持下列格式: text (文本,未使用该选项时的默认值) 以及 + json。 + +

+ + +
    + +
  1. + +

    text 格式简短且适合人类阅读。每项 (容器、轨道、附件等) 占一行。 +

    + + +

    该格式不应该用来解析。输出内容会翻译为 mkvmerge(1) 所使用的语言 (参见 --ui-language)。 +

    + +
  2. + + +
  3. + +

    + json 格式输出机器可读的 JSON 表达式。此格式遵循该文件所描述的 JSON 规范: + +

    + + +

    + mkvmerge-identification-output-schema-v18.json + +

    + + +

    + 所有版本的 JSON 规范可在线获取,也可在发布的源码压缩包中找到。 + +

    + +
  4. + +
+ +
--probe-range-percentage 百分比 + +

+ 部分文件类型,如 MPEG 节目流及传输流 + (.vob.m2ts),需要解析一定量的数据,方可侦测出文件中所包含的所有轨道。该数据量为输入文件大小的 + 0.3% 或 10 MB,取其中较高者。 + +

+ + +

+ 如果已知轨道存在,但未能找到,可以通过本选项更改探测百分比。 最小值 10 MB 为内置参数,无法更改。 + +

+ +
--list-audio-emphasis + +

+ Lists all valid numbers & their corresponding symbolic names for the + --audio-emphasis + option. + +

+ +
--list-languages + +

+ 列出所有语言及其 ISO 639-2 代码,这些代码可以在 --language + 选项中使用。 + +

+ +
--list-stereo-modes + +

+ Lists all valid numbers & their corresponding symbolic names for the + --stereo-mode + option. + +

+ +
-l, --list-types + +

+ 列出已支援的輸入檔案類型。 + +

+ +
--priority 優先順序 + +

+ 设置 mkvmerge(1) 运行时的进程优先级。有效的值为 'lowest(最低)', + 'lower(较低)', 'normal(普通)', + 'higher(较高)' 与 + 'highest(最高)'。如果未予设定,则使用 + 'normal(普通优先级)'。在 类-Unix 系统中 mkvmerge(1) 将使用 + nice(2) + 功能。因此只有超级用户才能使用 'higher(较高优先级)' 与 + 'highest(最高优先级)'。对于 Windows 用户来说所有值都可用。 + +

+ + +

选择'lowest' 不仅使用尽可能低的进程优先级,还会让 mkvmerge(1) 选择空闲 I/O 优先级。 +

+ +
--command-line-charset 字元集 + +

+ 設定在命令列顯示的字串字元集,以轉換為其他字元集。預設為目前系統所在位置指定的字元集。此設置適用於以下選項的參數:--title, --track-name + and --attachment-description。 + +

+ +
--output-charset 字元集 + +

+ 設定要轉換為輸出字串的字元集。預設為目前系統所在位置指定的字元集。 + +

+ +
-r, --redirect-output + 檔名 + +

+ 將所有訊息寫入到檔案 檔名 + 而不是命令列。儘管使用輸出重新導向可以輕鬆完成此操作,但在某些情況下需要使用此選項: 當終端在將輸出寫入文件之前重新解釋(覆蓋)輸出時。 優先使用通過 + --output-charset + 設定字元集。 + +

+ +
--flush-on-close + +

+ 關閉已開啟寫入的檔案時,告訴程式清理所有在記憶體中的資料。這可以防止因斷電造成的資料遺失或避免作業系統或驅動程式造成的某些問題。缺點是執行合併工具會花費較久個時間,因為 + mkvmerge 需要等待所有資料已寫入至儲存空間後,才會結束。請參閱 MKVToolNix 錯誤追蹤上的 #2469 和 #2480 + 問題,以便深入瞭解其優缺點。 + +

+ +
--ui-language 語言碼 + +

+ 強制使用語言 編碼 對應的的翻譯(例如 'zh_TW' + 為臺灣正體中文翻譯)。 在編碼欄位中輸入'list' + 讓程式輸出時使用可用的對應翻譯清單。 + +

+ +
--abort-on-warnings + +

+ 發出第一個警告後,終止程式。程式的結束碼為 1 。 + +

+ +
--deterministic 种子值 + +

+ 启用完全确定模式。若使用的 mkvmerge(1) + 版本相同,且输入文件、选项参数及种子值完全相同,则会创建二进制层面完全一致的文件。注意,此模式下不会写入剪辑信息的「date」字段。 + +

+ + +

种子值可以是任意字符串,并不非得是数字。

+ + +

+ 需要满足下列条件才能确保生成二进制层面完全相同的文件: + +

+ + +
    + +
  1. + +

    相同版本的 mkvmerge(1),且编译时使用相同版本的 ibEBML 及 libMatroska。 +

    + +
  2. + + +
  3. + +

    所用的输入文件在二进制层面完全一致。

    + +
  4. + + +
  5. + +

    所使用的命令行选项及顺序完全相同 (唯一的例外是「--output …」)。 +

    + +
  6. + +
+ + +

+ 使用其他版本的 mkvmerge(1) 或其他命令行选项也有可能输出完全一致的文件,但作者不作任何保证。 + +

+ +
--debug 主題 + +

+ 針對特定功能開啟除錯。此選項適用於開發者。 + +

+ +
--engage 功能 + +

+ 開啟實驗中功能。 透過mkvmerge --engage list啟用可用的列表。這些功能不會在正常情況下使用。 + +

+ +
--gui-mode + +

+ 開啟 GUI 模式。在這種模式中,可能會輸出特殊格式的行數,可以呈現控制的 GUI 發生什麼事。這些訊息會以 + '#GUI#訊息'呈現。訊息可能包含機碼/值,例如 + '#GUI#訊息#機碼1=值1#機碼2=值2…'。 無論是訊息或是機碼都不會轉為譯文,而且永遠使用 *英語* + 輸出。 + +

+ +
@options-file.json + +

+ 從檔案選項檔讀取其他命令列引數。更多資訊請參閱 選項檔案 章節。 + +

+ +
--capabilities + +

+ 列出编译时附加的可选功能并退出。输出信息的第一行是版本信息。接下来的每行包含一个单词,各单词的出现意味着编译时附加了相应功能。这些功能包括: + +

+ + +
    + +
  • + +

    + 'FLAC' -- 读取原始 FLAC 文件,以及处理其他容器中的 + FLAC 轨道,例如 Ogg(tm)Matroska(tm) + 容器中的。 + +

    + +
  • + +
+ +
-h, --help + +

+ 顯示使用方式並退出。 + +

+ +
-V, --version + +

+ 顯示版本資訊並離開。 + +

+ +
+ + +

3. 使用方式

+ + +

+ 用户可以选择各文件中 mkvmerge(1) 应该使用的轨道。它们都将被封装到 -o 所指定的文件中。可通过 + -l 选项获取已知(且受支持的)输入格式列表。 + +

+ + +
+

Important:

+ +

+ 命令列的順序選項極為重要。如果您是本程式新手,請閱讀"選項順序" 段落。 + +

+ +
+ +

4. 選項順序

+ + + +

+ 输入选项的顺序对一些选项很重要。选项可归为两类: + +

+ + +
    + +
  1. + +

    + 影响整个程序的选项不与任何输入文件有关。这些选项包括但不限于 + --command-line-charset--output 或 + --title。这些选项可在命令行的任意位置出现。 + +

    + +
  2. + + +
  3. + +

    + 影响单个输入文件或输入文件中的单个轨道的选项。这些选项均应用到命令行中接着的输入文件。所有应用到同一输入文件(或其轨道)的选项可以以任意顺序书写,只要都出现在该输入文件名之前。应用到输入文件的选项如 + --no-chapters 或 + --chapter-charset。应用到单个轨道的选项如 + --default-duration--language。 + +

    + +
  4. + +
+ + +

+ 选项从左向右处理。如果同一个选项在同一范围内出现多次,将使用最后一次给出的参数。因此在下面的例子中,标题将被设为 "其他东东": + +

+ +
$ mkvmerge -o 输出.mkv --title '这个内个' input.avi --title '其他东东'
+ +

+ 下面的例子中可以两次使用 --language 选项,因为在不同范围内使用。尽管应用到同一轨道 + ID,但应用到的是不同的输入文件,因此属于不同范围: + +

+ +
$ mkvmerge -o 输出.mkv --language 0:fre 法语.ogg --language 0:deu 德语.ogg
+

5. 範例

+ + +

+ 假定您有个名为 我的影片.avi 的文件,以及分开存放的音频轨如 '我的影片.wav'。您希望先将音频编码为 + OggVorbis(tm): + +

+ +
$ oggenc -q4 -o我的影片.ogg 我的影片.wav
+ +

+ 幾分鐘後就可以加入視訊和音訊: + +

+ +
$ mkvmerge -o 我的有聲影片.mkv 我的影片.avi 我的影片.ogg
+ +

+ 如果您的 AVI 文件已经含有一条音频轨,则将同时复制该轨道(只要 mkvmerge(1) + 支持该音频格式)。要避免此状况,只需要这样 + +

+ +
$ mkvmerge -o 我的有聲影片.mkv -A 我的影片.avi 我的影片.ogg
+ +

+ 又过了几分钟,您又制作了另一条音频轨,如 导演评论或者是另一种语言的配音,您生成的文件名是 + '我影片的另一音轨.wav'。 再进行一次编码操作,然后将其合并: + +

+ +
$ oggenc -q4 -o我影片的另一音轨 我影片的另一音轨.wav
+$ mkvmerge -o 影片-成品.mkv 我的有声影片.mkv 我影片的另一音轨.ogg
+ +

+ 照下面的做法结果相同 + +

+ +
$ mkvmerge -o 我的影片-成品.mkv -A 我的影片.avi 我的影片.ogg 我影片的另一音轨.ogg
+ +

+ 现在开启 mplayer(tm) 尽情享受吧。如果您有多条音频轨(或者甚至是视频轨),那么您可以通过 + '-vid' 与 '-aid' 选项告诉 + mplayer(tm) 应该播放哪些轨道。这些是基础功能,不区分视频与音频。 + +

+ + +

+ 如果您需要同步音频轨,会非常容易。首先找清 Vorbis 轨道的轨道 ID + +

+ +
$ mkvmerge --identify 错开了的.ogg
+ +

+ 現在可以在以下命令列使用該 ID : + +

+ +
$ mkvmerge -o 同步了的.mkv -A 源.avi -y 12345:200 错开了的.ogg
+ +

+ 这将在 '错开了的.ogg' 中 ID 为 12345 + 的音频轨的开头添加 200ms 的静音。 + +

+ + +

+ 有些影片在开头同步正常,但音画同步会慢慢偏离开。对此类影片您可以指定延时系数,该系数将被应用到所有时间戳 -- + 不添加或移除任何数据。因此如果您所设定的系数过大或过小会造成很糟糕的结果。例如我转码的一期节目有 77340 + 帧长,在结尾处有 0.2 秒的同步偏离。在 29.97fps + 帧率下大约是每 6 帧错开 0.2 秒。于是我这样操作 + +

+ +
$ mkvmerge -o 同步了的.mkv -y 23456:0,77346/77340 错开了的.mkv
+ +

+ 結果正常。 + +

+ + +

+ 同步选项对字幕同样起作用。 + +

+ + +

+ 对于文本字幕,您既可以选用一些 Windows 软件(如 SubRipper(tm))或 + 'contrib/subrip' 目录 + transcode(1) + 的源码中的 subrip(tm) 包。大体过程是这样的: + +

+ + +
    + +
  1. + +

    从输入文件中提取原始字幕流:

    +
    $ tccat -i /DVD/文件/的/路径/ -T 1 -L | tcextract -x ps1 -t vob -a 0x20 | subtitle2pgm -o 我的影片
    +
  2. + + +
  3. + +

    使用 gocr 将生成的 PGM 图像转为文本:

    +
    $ pgm2txt mymovie
    +
  4. + + +
  5. + +

    对生成的文本文件进行拼写检查:

    +
    $ ispell -d american *txt
    +
  6. + + +
  7. + +

    将文本文件转为 SRT 文件:

    +
    $ srttool -s -w -i mymovie.srtx -o mymovie.srt
    +
  8. + +
+ + +

+ 这样生成的文件可用作 mkvmerge(1) 的输入文件: + +

+ +
$ mkvmerge -o 我的影片.mkv 我的影片.avi 我的影片.srt
+ +

+ 如果您希望为指定轨道指定语言,这将很容易完成。首先找到您所需语言的 ISO 639-2 代码。mkvmerge(1) 会为您列出所有代码: + +

+ +
$ mkvmerge --list-languages
+ +

+ 在列表中找到您所需的语言。假定您已在 Matroska(tm) 文件中放入两条音轨,并希望设置它们的语言代码,两条轨道的轨道 ID 为 2 和 + 3。可以这样操作 + +

+ +
$ mkvmerge -o 含语言代码的.mkv --language 2:ger --language 3:dut 无语言代码的.mkv
+ +

+ 如您所见,--language + 开关可多次使用。 + +

+ + +

+ 或许您还想让荷兰语作为默认语言。您还有其他语言的字幕,如英语和法语的,并希望让播放器默认显示法语字幕。可以这样操作 + +

+ +
$ mkvmerge -o 含语言代码的文件.mkv --language 2:ger --language 3:dut --default-track-flag 3 无语言代码的文件.mkv --language 0:eng 英文字幕.srt --default-track-flag 0 --language 0:fre 法文字幕.srt
+ +

+ 如果您在 mkvinfo(1) 的输出信息中没找到您指定的语言或默认轨标记,请参阅关于 默认值 的段落。 + +

+ + +

+ 关闭针对某输入文件的压缩。 + +

+ +
$ mkvmerge -o 无压缩.mkv --compression -1:none 我的影片.avi --compression -1:none 我的影片.srt
+ +

6. 軌道 ID

+ + + +

6.1. 標準軌道 ID

+ + + +

+ mkvmerge(1) 的一些选项要求提供轨道 ID 以指定应应用到的轨道。 当读取器分离当前输入文件时,或者使用 --identify + 选项调用 mkvmerge(1) 时这些轨道 ID 会被显示出来。此类输出的一个示例: + +

+ +
$ mkvmerge -i v.mkv
+文件 'v.mkv': 容器: Matroska
+轨道 ID 0: 视频 (V_MS/VFW/FOURCC, DIV3)
+轨道 ID 1: 音频 (A_MPEG/L3)
+ +

+ 不要混淆输出 MKV 文件时所分派的轨道 ID与输入文件的轨道 ID。只有输入文件的轨道 ID 可用于需要轨道 ID 值的选项。 + +

+ + +

+ 还需注意,每个输入文件有其自己的一组轨道 ID。因此通过 'mkvmerge --identify' 报告的文件 + '文件1.扩展名' 的轨道 ID 不随其他输入文件的数量或 + '文件1.扩展名' 所用到的位置变化。 + +

+ + +

+ 轨道 ID 通常这样分配: + +

+ + +
    + +
  • + +

    + AVI 文件: 视频轨 ID 为 0。音频轨的 ID 由 1 开始升序分配。 + +

    + +
  • + + +
  • + +

    + AACAC-3MP3SRT + 与 WAV 文件: 此类文件中唯一的 '轨道' 的 ID 为 0。 + +

    + +
  • + + +
  • + +

    + 大多数其他文件: 轨道 ID 按在文件中被找到的顺序由 0 开始分配。 + +

    + +
  • + +
+ + +

+ 使用轨道 ID 的选项的描述中均含有 'TID'。此外下列选项也使用轨道 ID: + --audio-tracks--video-tracks--subtitle-tracks--button-tracks + 以及 --track-tags。 + +

+ + + +

6.2. 特殊軌道 ID

+ + + +

+ 一些 ID 具有特殊含义,不会出现在 id 输出结果中。 + +

+ + +

+ 特殊的轨道 ID '-1' 是个百搭号,它将使给定的开关应用到从输入文件中读到的所有轨道。 + +

+ + +

+ 特殊轨道 ID '-2' 指输入文件中的章节。目前只有 --sync + 选项会用到此特殊 ID。--sync -2:…--chapter-sync … + 等效。 + +

+ + +

7. Language handling

+ + + +

+ Matroska(tm) has support for two different types of language elements: the + old, deprecated "Language" element containing ISO 639-2 alpha 3 codes and + the new "LanguageIETF" tags containing IETF BCP 47 language tags. All of + mkvmerge(1)'s options that accept a language accept a BCP 47 language + tag. mkvmerge(1) will derive the value for the deprecated "Language" element + from the BCP 47 language tags wherever possible. + +

+ + +

+ When identifying a file in JSON mode, existing "LanguageIETF" track header + elements will be output as the language_ietf track + property. + +

+ + +

+ When writing a file mkvmerge(1) will always write the "LanguageIETF", + "ChapLanguageIETF" and "TagLanguageIETF" elements (the latter two only if + chapters or tags are written respectively). In addition to those elements + the corresponding old elements will be written; they'll be set to the ISO + 639-2 code portion of the BCP 47 language tag. For example, when the track + language is set to sr-Cyrl-RS "LanguageIETF" will be set + to sr-Cyrl-RS and the old "Language" element will be set + to srp. + +

+ + +

+ When reading existing files (Matroska files, XML chapter or tag files etc.) + that already contain "…LanguageIETF" elements the existing elements will be + kept. Otherwise "…LanguageIETF" elements will be added based on command-line + options and other existing deprecated "…Language" elements. + +

+ + +

+ The creation of the new elements can be disabled completely with the + command-line option --disable-language-ietf which operates + on all three new elements. + +

+ + +

+ You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. + +

+ +

8. 文字檔案與字元集轉換

+ + +
+

Note:

+ +

+ 此段落可应用到 MKVToolNix 中的所有程序,尽管该段仅提及了 mkvmerge(1)。 + +

+ +
+ + +

8.1. 簡介

+ + +

+ Matroska(tm) 文件中的所有文本均使用 UTF-8 编码。这意味着 mkvmerge(1) + 需要将读取到的文本文件以及从命令行收到的文本从其他字符集转换为 UTF-8。相反,这意味着 mkvmerge(1) 的输出信息同样需要由 UTF-8 + 转回原来的字符集,例如来自 --ui-language + 所选的非英语界面或来自 Matroska(tm) 文件中的文本。 + +

+ + +

+ mkvmerge(1) 根据是否有 字节顺序标记 (英文缩写: BOM) + 出现以及系统的当前区域来进行自动转换。如何根据区域推定字符集取决于 mkvmerge(1) 所执行在的操作系统。 + +

+ + + +

8.2. 位元組順序記號 (BOM)

+ + + +

+ 以 BOM 开头的文本文件已经使用 UTF 的某一种模式进行编码。mkvmerge(1) 支持以下五种模式: UTF-8、UTF-16 小端序 (LE) + 及大端序 (BE)、UTF-32 小端序 (LE) 及大端序 (BE)。含 BOM 的文本文件将被自动转换为 UTF-8。任何对此类文件指定字符集的参数 + (如 --sub-charset) + 将被直接忽略,且不输出提示信息。 + +

+ + + +

8.3. 包含 mac 作業系統的 Linux 與 類Unix 系統

+ + + +

+ 在 类-Unix 系统 mkvmerge(1) 将使用 + setlocale(3) + 系统指令,它将返回环境变量 LANGLC_ALL 及 + LC_CYPE。输出的字符集通常是 UTF-8 或 ISO-8859-* + 家族之一,将被用于所有文本文件操作以及编码命令行上的字符串和输出到命令行。 + +

+ + + +

8.4. Windows

+ + + +

+ 在 Windows 平台,用于转换文本文件的默认字符集由系统调用 GetACP() 的结果决定。 + +

+ + +

+ 读取命令行参数通过 GetCommandLineW() 函数完成,该函数所返回的已经是 Unicode + 字符串。因此选项 --command-line-charset 在 Windows 平台是被忽略的。 + +

+ + +

+ 输出到控制台分为三种情况: + +

+ + +
    + +
  1. + +

    + 若使用 --redirect-output + 选项重定向输出,则默认字符集为 UTF-8。可以通过 --output-charset + 修改。 + +

    + +
  2. + + +
  3. + +

    + 若输出内容通过 cmd.exe 自身重定向,例如 mkvinfo 文件.mkv > + info.txt,则其字符集必为 UTF-8,且无法修改。 + +

    + +
  4. + + +
  5. + +

    + 否则 (直接写入控制台) 将使用 Windows 函数 WriteConsoleW() 并忽略 --output-charset + 选项。控制台应该能够输出已安装对应语言支持的所有 Unicode 字符 (如汉字在英文版 Windows 可能不会正常显示)。 + +

    + +
  6. + +
+ + + +

8.5. 命令列選項

+ + + +

+ 现有下述选项支持指定字符集: + +

+ + +
    + +
  • + +

    + --sub-charset + 用于文本字幕文件以及存储于字符集含糊的容器格式(如 Ogg 文件)中的文本字幕轨, + +

    + +
  • + + +
  • + +

    + --chapter-charset + 用于章节文本文件以及存储于字符集含糊的容器格式(如 Ogg 文件的章节信息,轨道和文件标题等;MP4 文件的章节信息)中的章节和文件标题, + +

    + +
  • + + +
  • + +

    + --command-line-charset + 用于所有命令行上的字符串, + +

    + +
  • + + +
  • + +

    + --output-charset + 所有写入控制台的或通过 --redirect-output + 选项重定向到文件的字符串的输出字符集。非 Windows 系统下,默认的输出字符集为系统的当前字符集。在 Windows 平台,默认为 + UTF-8,包括通过 --redirect-output + 的重定向以及 cmd.exe 自身的重定向,如 mkvinfo file.mkv > + info.txt。 + +

    + +
  • + +
+ + +

9. 選項檔案

+ + + +

+ mkvmerge(1) 可从选项文件中读取额外的命令行参数。这样可以规避 shell 或操作系统在执行外部程序时的特定限制,如命令行长度的限制。 + +

+ + +

+ 包含 JSON 格式数据的选项文件。其内容必须为有效的 JSON 数组,数组元素只能为 JSON 字符串。文件编码必须为 + UTF-8。文件开头不需要有字节序标记 (byte order marker,BOM),但即使有也没关系,会跳过它。 + +

+ + +

+ 在 JSON 内部转义特殊字符的规则请见官方 JSON 规范 RFC 7159。 + +

+ + +

+ 选项文件名本身应添加前缀字符「@」在命令行参数给出。 + +

+ + +

+ 命令行“mkvmerge -o "我的文件.mkv" -A "一部影片.avi" 声音.ogg”可以转换为下述 + JSON 选项文件,文件可以命名为“选项.json”: + +

+ +
[
+  "-o",
+  "c:\\Matroska\\我的檔案.mkv",
+  "--title",
+  "#65",
+  "-A",
+  "影片.avi",
+  "聲音.ogg"
+]
+ +

+ 对应的命令行则为「mkvmerge @选项文件.json」。 + +

+ +

10. 檔案連結

+ + +

+ Matroska(tm) 支持文件链接,即声明当前文件的前趋与后继文件是哪个文件。严谨地讲,被连接的不是文件而是 Matroska(tm) + 剪辑。鉴于大多数文件只含有一个 Matroska(tm) 剪辑,以下说明中将使用术语 '文件链接',尽管 '剪辑链接' 更为贴切。 + +

+ + +

+ 各剪辑由唯一的 128 位宽的剪辑 UID 确定。此 UID 是由 mkvmerge(1) 自动创建的。链接主要通过将前后文件的剪辑 UID (英文缩写: + SID) 置于剪辑头部信息中完成。mkvinfo(1) 会在找到 SID 时输出它们。 + +

+ + +

+ 如果文件被切割为多段,且启用了链接功能,则文件的时间戳不会重新从 0 + 开始,而是会从上一个文件结束的地方继续计算。这样可以保留绝对时间,即使之前的文件不可用 (如进行流式处理时)。如果未使用链接功能,各文件的时间戳应从 0 + 开始。mkvmerge(1) 默认不启用文件链接。如果您希望启用,可以通过 --link + 选项打开。此选项仅当同时启用切割功能时有用。 + +

+ + +

+ 无论是否开启了切割功能,用户都可以让 mkvmerge(1) 将生成的文件与指定的 SID 建立链接。可通过 + --link-to-previous--link-to-next 选项实现。 + 这些选项只接受 mkvinfo(1) 所输出的剪辑 SID 格式: 16 个 + 0x000xff 之间的十六进制数,各数字带有 + '0x' 前缀,如 '0x41 0xda 0x73 0x66 0xd9 0xcf 0xb2 0x1e + 0xae 0x78 0xeb 0xb4 0x5e 0xca 0xb3 0x93'。还可以选用另一种较短的格式: 16 个 + 0x000xff 之间的十六进制数,无 + '0x' 前缀,无空格,如 + '41da7366d9cfb21eae78ebb45ecab393'。 + +

+ + +

+ 如果启用了切割功能,第一个文件将与通过 --link-to-previous 给定的 + SID 建立链接,而最后一个文件将与通过 --link-to-next 给定的 + SID 建立链接。如果未启用切割功能,唯一的输出文件将同时与给定的两个 SID + 建立链接。 + +

+ +

11. 預設值

+ + +

+ Matroska(tm) 规范提到,一些元素有其默认值。通常为了节省空间,如果一个元素的值等同于其默认值,它将不被写入文件。用户在 mkvinfo(1) + 的输出信息中可能发现缺失的元素有 语言默认轨标记。 + 语言 的默认值是 English + ('eng'),默认轨标记 的默认值是 + true。因此如果您对一条轨道应用选项 --language 0:eng + ,它将不在 mkvinfo(1) 的输出信息中显示。 + +

+ +

12. 附件

+ + +

+ 或许您希望将一些照片与您的 Matroska(tm) 文件一起存放,或者您正在使用 SSA 字幕,需要一个非常稀有的特殊 + TrueType(tm) 字体。这种情况下您可以将这些文件附加到 Matroska(tm) + 文件中。它们不会被追加到文件当中,而是被嵌入到文件中。然后播放器就可以显示这些文件 (如 '照片' 一例) 或者用它们来渲染字幕 (如 + 'TrueType(tm) 字体' 一例)。 + +

+ + +

+ 这是关于如何在输出文件中附加照片和 TrueType(tm) 字体的示例: + +

+ +
$ mkvmerge -o 输出.mkv -A 视频.avi 声音.ogg \
+  --attachment-description "乐队与我在后台小聚" \
+  --attachment-mime-type image/jpeg \
+  --attach-file 乐队与我.jpg \
+  --attachment-description "难得一见的绝美字体" \
+  --attachment-mime-type application/octet-stream \
+  --attach-file 超酷的字体.ttf
+ +

+ 如果含有附件的 Matroska(tm) 文件被用作输入文件,mkvmerge(1) 会将附件复制到新文件中。要复制哪些文件、不复制那些文件的选择可以通过 + --attachments + 与 --no-attachments + 选项修改。 + +

+ +

13. 章節

+ + +

+ Matroska(tm) 章节系统比大家知道的旧系统—— OGM 中所使用的——更为强大。完整的规范可以在 Matroska 网站 找到。 + +

+ + +

+ mkvmerge(1) 支持输入两种章节文件。第一种格式,叫作 '简单章节格式',与 OGM tools + 所用的相同。第二种是基于 XML 的章节格式,它支持 Matroska(tm) 的所有章节功能。 + +

+ + +

+ 除了专用的章节文件格式以外,mkvmerge(1) 还能够从其他文件格式读取章节数据 (如 MP4、Ogg、Blu-ray 以及 DVD 光盘)。 + +

+ + +

13.1. 簡易章節格式

+ + + +

+ 此格式由成对的相继以 'CHAPTERxx=' 与 + 'CHAPTERxxNAME=' 开头的行组成。单数行包含起始时间戳,而双数行包含标题。这是一个示例: + +

+ +
CHAPTER01=00:00:00.000
+CHAPTER01NAME=介紹
+CHAPTER02=00:02:30.000
+CHAPTER02NAME=萌娃準備演奏
+CHAPTER03=00:02:42.300
+CHAPTER03NAME=萌娃震撼表演
+ +

+ mkvmerge(1) will transform every pair or lines into one Matroska(tm) + ChapterAtom. It does not set any + ChapterTrackNumber which means that all chapters + apply to all tracks in the file. + +

+ + +

+ 由于是文本文件,可能需要进行字符集转换。关于 mkvmerge(1) 如何在字符集间进行转换的说明请参见关于 文本文件与字符集 的段落。 + +

+ + + +

13.2. 基於 XML 的章節格式

+ + +

+ 基于 XML 的章节格式看起来与这个示例类似: + +

+ +
<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE Chapters SYSTEM "matroskachapters.dtd">
+<Chapters>
+  <EditionEntry>
+    <ChapterAtom>
+      <ChapterTimeStart>00:00:30.000</ChapterTimeStart>
+      <ChapterTimeEnd>00:01:20.000</ChapterTimeEnd>
+      <ChapterDisplay>
+        <ChapterString>短短的一节</ChapterString>
+        <ChapterLanguage>chi</ChapterLanguage>
+      </ChapterDisplay>
+      <ChapterAtom>
+        <ChapterTimeStart>00:00:46.000</ChapterTimeStart>
+        <ChapterTimeEnd>00:01:10.000</ChapterTimeEnd>
+        <ChapterDisplay>
+          <ChapterString>那短短的一节的一部分</ChapterString>
+          <ChapterLanguage>chi</ChapterLanguage>
+        </ChapterDisplay>
+      </ChapterAtom>
+    </ChapterAtom>
+  </EditionEntry>
+</Chapters>
+ +

+ 使用此格式可以做到三件简单章节格式做不到的事: + +

+ + +
    + +
  1. +

    可以设置章节终止处的时间戳,

    +
  2. + +
  3. +

    章节可以嵌套,

    +
  4. + +
  5. +

    可以设置语言与国家。

    +
  6. + +
+ + +

+ mkvtoolnix 分发包的 doc 子目录包含了一些典型示例文件。 + +

+ + +

+ 下面列出的是支持的 XML 标签,其数据类型及有效值域: + +

+ +
Chapters (主)
+  EditionEntry (主)
+    EditionUID (无符号整数,有效值域: 1 <= 值)
+    EditionFlagHidden (无符号整数,有效值域: 0 <= 值 <= 1)
+    EditionFlagDefault (无符号整数,有效值域: 0 <= 值 <= 1)
+    EditionFlagOrdered (无符号整数,有效值域: 0 <= 值 <= 1)
+    ChapterAtom (主)
+      ChapterAtom (主)
+      ChapterUID (无符号整数,有效值域: 1 <= 值)
+      ChapterTimeStart (无符号整数)
+      ChapterTimeEnd (无符号整数)
+      ChapterFlagHidden (无符号整数,有效值域: 0 <= 值 <= 1)
+      ChapterFlagEnabled (无符号整数,有效值域: 0 <= 值 <= 1)
+      ChapterSegmentUID (二进制,有效值域: 1 <= 长度,以字节为单位)
+      ChapterSegmentEditionUID (无符号整数,有效值域: 1 <= 值)
+      ChapterPhysicalEquiv (无符号整数)
+      ChapterTrack (主)
+        ChapterTrackNumber (无符号整数,有效值域: 1 <= 值)
+      ChapterDisplay (主)
+        ChapterString (UTF-8 字符串)
+        ChapterLanguage (UTF-8 字符串)
+        ChapterCountry (UTF-8 字符串)
+      ChapterProcess (主)
+        ChapterProcessCodecID (无符号整数)
+        ChapterProcessPrivate (二进制)
+        ChapterProcessCommand (主)
+          ChapterProcessTime (无符号整数)
+          ChapterProcessData (二进制)
+ + +

13.3. 從 Blu-rays 藍光光碟讀取章節

+ + + +

+ mkvmerge(1) 可以从未加密的 Blu-ray + 光盘读取章节数据。要这样做,您可以通过「--chapters」参数提供任一 MPLS 播放列表的路径。 + +

+ + +

+ 例: --chapters + /宝藏/蓝光/BigBuckBunny/BDMV/PLAYLIST/00001.mpls + +

+ + + +

13.4. 從 DVD 光碟讀取章節

+ + + +

+ 若 MKVToolNix 编译时链接了 libdvdread(tm) 库,mkvmerge(1) 就能从 + DVD 光盘中读取章节数据。要这样做,您可以通过「--chapters」参数提供 DVD + 文件夹或文件的路径。由于 DVD 光盘可包含多个标题,且每个标题可以有自己的一组章节,您可以在文件名参数后添加冒号及所需的标题编号。标题编号默认为 1。 + +

+ + +

+ 例: --chapters /宝藏/dvd光盘/BigBuckBunny/VIDEO_TS:2 + +

+ + + +

13.5. 一般注意事項

+ + +

+ mkvmerge(1) 切割文件时会同时适当调整章节。这意味着每个文件只包含应用到该文件的章节项,时间戳也将被调整到与各输出文件相匹配。 + +

+ + +

+ mkvmerge(1) 能够从 Matroska(tm) 输入文件中复制章节,除非使用 --no-chapters + 选项明令禁用。来自各类来源 (Matroska(tm) 文件、Ogg 文件、MP4 文件、章节文本文件) + 的章节通常不被合并,而是分成多个 ChapterEditions(章节版本)。仅当从多个 + Matroska(tm)XML 文件读取的章节具有相同的版本 UID 时,章节才会被合并为单个 + ChapterEdition。如果在其他情况下需要此类合并,用户需要先用 mkvextract(1) + 从所有来源提取章节,手动合并 XML 文件然后再混流。 + +

+ + +

14. 標籤

+ + + +

14.1. 簡介

+ + + +

+ Matroska(tm) 的标签系统与其他容器类似: 一组 键=值 对。不过,Matroska(tm) + 中的标签还可以嵌套, + 都是属于它们自身的元素。示例文件 example-tags-2.xml 展示了如何使用该系统。 + +

+ + + +

14.2. 标签细述

+ + + +

+ Matroska(tm) 标签不会自动应用到整个文件上。它们可以应用到整个文件,还可以应用到文件的不同部分: 一个或多个轨道, 一个或多个章节, + 甚至是两者的组合。Matroska + 规范 有这方面的更多详情。 + +

+ + +

+ 重要的一点是标签通过 Targets Matroska(tm) 标签元素与轨道或章节相连,而用于此链接的 + UID 并非 mkvmerge(1) 常用的轨道 ID。而是 mkvmerge(1) 自动计算而来 (当轨道来自非 + Matroska(tm) 文件时) 或当轨道输入文件是 Matroska(tm) 文件时复制而来的 的 UID。因此在文件被 mkvmerge(1) + 处理过之前很难知道应该在标签文件中使用哪些 UID。 + +

+ + +

+ mkvmerge(1) 支持两个为 Matroska(tm) 文件添加标签的选项: --global-tags + 与 --tags + 选项。不同之处在于前者,--global-tags,将通过移除上文提到的所有 + Targets 元素使标签应用到整个文件。 而后者,--tags,将使 + mkvmerge(1) 为通过 --tags 选项的 + TID 部分指定的标签自动插入 UID。 + +

+ + + +

14.3. 範例

+ + +

+ 假定您希望为从一个 AVI 文件读取的视频轨道添加标签。mkvmerge --identify + 文件.avi 告诉您该视频轨道的 ID (不要将此 ID 与 UID 混淆!) 为 0。于是您创建了一个标签文件,省去了所有 + Targets 元素,然后这样调用 mkvmerge(1): + +

+ +
$ mkvmerge -o 文件.mkv --tags 0:标签.xml 文件.avi
+ + +

14.4. 标签文件格式

+ + +

+ mkvmerge(1) 支持基于 XML 的标签文件格式。此格式是以 Matroska + 规范 为依据严格制定的。MKVToolNix 的程序以及源码分发包都含有名为 + example-tags-2.xml 的示例文件,该文件已简明地列出了所有已知的可用作实际处理的基本标签。 + +

+ + +

+ 基本要点有: + +

+ + +
    + +
  • +

    最外层的元素必须为 <Tags>。 +

    +
  • + +
  • + +

    实际意义上的标签放在 <Tag> XML 标签对中。 +

    + +
  • + +
  • +

    标签内容前后的空白将被忽略。

    +
  • + +
+ + + +

14.5. 資料類型

+ + +

+ 新的 Matroska(tm) 标签系统只识别两种数据类型,UTF-8 字串与二进制类型。前者用于标签名称和 + <String> 元素,而二进制类型用于 + <Binary> 元素。 + +

+ + +

+ 由于二进制数据自身与 XML 文件不相容,mkvmerge(1) 支持另两种储存二进制数据的方法。如果 XML 标签的内容以 + '@' 开头,则后续文本将被作为文件名对待。相应文件的内容将被复制到 Matroska(tm) 元素中。 + +

+ + +

+ 还有一种可能,即数据经 Base64 编码。这是将二进制数据转换为一定的 ASCII + 字集字符,在电子邮件等程序中有所应用。mkvextract(1) 将将二进制元素以 Base64 编码的数据的形式输出。 + +

+ + +

+ 已被废弃的标签系统可识别更多的数据类型,这在 Matroska(tm) 官方的标签规范中可以找到。由于 mkvmerge(1) + 不再支持此系统,此处不对这些类型作多余说明。 + +

+ + + +

14.6. XML 文件格式的已知标签

+ + + +

+ 下面列出的是支持的 XML 标签,其数据类型及有效值域: + +

+ +
Tags (主)
+  Tag (主)
+    Targets (主)
+      TargetTypeValue (无符号整数)
+      TargetType (UTF-8 字符串)
+      TrackUID (无符号整数)
+      EditionUID (无符号整数)
+      ChapterUID (无符号整数)
+      AttachmentUID (无符号整数)
+    Simple (主)
+      Simple (主)
+      Name (UTF-8 字符串)
+      TagLanguage (UTF-8 字符串)
+      DefaultLanguage (无符号整数)
+      String (UTF-8 字符串)
+      Binary (二进制)
+ +

15. 剪輯資訊

+ + + +

+ 可以通过剪辑信息 XML 文件设置 Matroska(tm) 文件 "剪辑信息" + 头部字段的特定值。所有这些值都无法通过其他命令行选项设置。 + +

+ + +

+ 还有一些 "剪辑信息" 头部字段可以通过命令行选项设置,而非通过 XML 文件。包括如 --title--timestamp-scale + 选项。 + +

+ + +

+ 还有其他元素既不能通过命令行选项,也不能通过 XML 文件设置。这些包括下述元素: DateUTC (即 + "混流时间")、混流应用程序 MuxingApp、写入库 + WritingApp 及 总时长 Duration。这些元素均由 + mkvmerge(1) 自行设置。 + +

+ + +

+ 下面列出的是支持的 XML 标签,其数据类型及有效值域: + +

+ +
Info (主)
+  SegmentUID (二进制,有效值域: 长度(字节) == 16)
+  SegmentFilename (UTF-8 字符串)
+  PreviousSegmentUID (二进制,有效值域: 长度(字节) == 16)
+  PreviousSegmentFilename (UTF-8 字符串)
+  NextSegmentUID (二进制,有效值域: 长度(字节) == 16)
+  NextSegmentFilename (UTF-8 字符串)
+  SegmentFamily (二进制,有效值域: 长度(字节) == 16)
+  ChapterTranslate (主)
+    ChapterTranslateEditionUID (无符号整数)
+    ChapterTranslateCodec (无符号整数)
+    ChapterTranslateID (二进制)
+

16. Matroska 檔案規劃

+ + +

+ Matroska(tm) 文件规划非常灵活。mkvmerge(1) 将按预先定义的方式渲染文件。生成的文件是这样的: + +

+ + +

+ [EBML 头] [剪辑 {元定位 #1} [剪辑信息] [轨道信息] {附件} {章节} [簇 1] {簇 2} ... {簇 n} {索引} + {元定位 #2} {标签}] + +

+ + +

+ 大括号中的元素是可选的,依所用的内容和选项而定。有两点要注意的: + +

+ + +
    + +
  • + +

    + 元定位 #1 只包含很少量的 level 1 元素,且仅当它们存在时才包含:附件、章节、索引、标签以及元定位 #2。较早版本的 mkvmerge(1) + 亦曾将簇放置在元定位元素中。因此应留给不精确的传言一些空间——真相总会大白。 现在只有簇才被储存在元定位 #2 中,元定位 #1 将引用元定位元素 + #2。 + +

    + +
  • + + +
  • + +

    附件、章节和标签元素仅当被添加后才会出现。

    + +
  • + +
+ + +

+ 允许的最精简的 Matroska(tm) 文件是像这样的: + +

+ + +

+ [EBML 头] [剪辑 [剪辑信息] [轨道信息] [簇 1]] + +

+ + +

+ 这也是纯音频文件的样子。 + +

+ +

17. 外部時間戳記檔案

+ + +

+ mkvmerge(1) 允许用户为各轨道选择特定的时间戳。这可用来创建包含可变帧率视频或音频中有空隙的文件。这种情况下的帧是 mkvmerge(1) 创建各 + Matroska(tm) 块的单位。对视频来说恰好是一帧,对音频来说是相应音频类型的一个数据包。例如对 AC-3 + 来说是包含 1536 采样的一个数据包。 + +

+ + +

+ 用于轨道追加合并的时间戳必须只指定给一系列(同一)轨道的第一部分。例如当您追加合并两个文件,v1.avi 与 + v2.avi,且希望使用时间戳时,您的命令行必须像这样组织: + +

+ +
$ mkvmerge ... --timestamps 0:我的时间戳.txt v1.avi +v2.avi
+ +

+ mkvmerge(1) 可识别四种格式的时间戳。版本号在时间戳文件的第一行内。空行,只含有空格的行,以及以 '#' + 开头的行在处理时将被忽略。 + +

+ + +

17.1. 時間戳記檔案格式 v1

+ + +

+ 此格式的第一行是版本声明。第二行则声明默认的帧率。 接下来的各行包含由逗号分隔的三个数字: 起始帧(0 + 代表第一帧)、终止帧以及此范围内的帧率。FPS(帧率) 为浮点数,小数点用 + '.' 表示。各行定义的范围间可以有间隔,间隔内将使用默认的 FPS。一个示例: + +

+ +
# timestamp format v1
+assume 27.930
+800,1000,25
+1500,1700,30
+ + +

17.2. 時間戳記檔案格式 v2

+ + + +

+ 此格式中每行包含相应帧的时间戳。此时间戳必须以毫秒为精度。可以使浮点数,但不强求。您指定的时间戳行数 必须 + 不少于对应轨道的帧数。此类文件中的时间戳必须经过排序。 以 25fps 为例: + +

+ +
# timestamp format v2
+0
+40
+80
+ + +

17.3. 時間戳記檔案格式 v3

+ + +

+ 此格式中各行包含时长(秒数),后接(可选)帧率。 二者均可为浮点数。 如果未提供帧率,则采用默认的帧率。 + 对于音频,您应当让编解码器自行计算各帧的时间戳。 这样您应当使用 0.0 作为帧率。 您可以使用 + 'gap' 关键词后接空隙时长在流中创建空隙。 以音频文件为例: + +

+ +
# timestamp format v3
+assume 0.0
+25.325
+7.530,38.236
+gap, 10.050
+2.000,38.236
+ + +

17.4. 時間戳記檔案格式 v4

+ + +

+ 此格式與 v2 格式一致。 唯一的差別是時間戳記不需要排序。 通常不應使用此格式。 + +

+ + +

18. 結束代碼

+ + + +

+ 使用三個之一的結束代碼結束 mkvmerge(1) : + +

+ + +
    + +
  • + +

    + 0 -- 此結束代碼表示合併已成功完成。 + +

    + +
  • + + +
  • + +

    + 1 -- 在此情況下 mkvmerge(1) 輸出時至少有一則警告,但合併動作仍然進行。警告訊息會在前端出現 + '警告:'字樣。依據問題的程度,生成的檔案也許可用。建議使用者檢視警告訊息與輸出檔。 + +

    + +
  • + + +
  • + +

    + 2 -- 此結束代碼用於發生錯誤後。 mkvmerge(1) + 在輸出錯誤訊息後立即中止動作。錯誤訊息的範圍包含從錯誤命令列參數的讀/寫至檔案損壞。 + +

    + +
  • + +
+ +

19. 環境變數

+ + + +

+ mkvmerge(1) 使用決定系統的地區設定的變數 (例如: LANG 與 + LC_* 系列)。 附加變數: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVMERGE_DEBUG, MKVTOOLNIX_DEBUG + 與其的簡短形式 MTX_DEBUG + +

視為通過 --debug + 選項傳遞的內容。 +

+ +
MKVMERGE_ENGAGE, MKVTOOLNIX_ENGAGE + 與其的簡短形式 MTX_ENGAGE + +

視為通過 --engage + 選項傳遞的內容。 +

+ +
+ +

20. 參閱

+ + +

+ mkvinfo(1), mkvextract(1), mkvpropedit(1), mkvtoolnix-gui(1) + +

+ +

21. 網路

+ + +

+ 永遠可在 MKVToolNix 首頁 找到最新版。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvpropedit.html b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvpropedit.html new file mode 100644 index 0000000000000000000000000000000000000000..d80b212d6bf294a280c0c8eeabcd6cf8a0bfec20 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvpropedit.html @@ -0,0 +1,1185 @@ + + + + + mkvpropedit -- 在不进行完整的重新混流的情况下修改现有 Matroska 文件的属性 + + + +
mkvpropedit -- 在不进行完整的重新混流的情况下修改现有 Matroska(tm) 文件的属性 +
+
+ +
+

1. 概要

+ + +
mkvpropedit 选项 {输入文件名} {操作} +
+ +

2. 摘要說明

+ + +

+ 此程序可分析现有 Matroska(tm) + 文件,并修改其部分属性。然后它将将变更写入现有文件。可修改的属性包括剪辑信息元素(如标题)和轨道头部(如语言代码、'默认轨' 标记或轨道名称)。 + +

+ + +

+ 選項: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
-l, --list-property-names + +

+ 列出所有已知的可编辑的属性名称、它们的类型(字符串型、整数型、布尔型等等)及简短说明。程序随后将退出执行。因此不必提供 + source-filename 参数。 + +

+ +
-p, --parse-mode 模式 + +

+ 设置解析模式。参数 '模式' 可以为 + 'fast(快速)'(此项为默认值)或 + 'full(完整)'。'fast(快速)'模式不解析整个文件,而是使用元定位元素确定输入文件中所需元素的位置。99% + 的情况下这就足够了。但如果碰到不含元定位元素或者元定位元素损坏的文件,用户可能得考虑 'full(完整)' + 解析模式。完整扫描文件可能要花费几分钟,而快速扫描只需要几秒钟。 + +

+ +
+ + +

+ 轨道、剪辑信息属性处理操作: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-e, --edit 選擇 + +

+ 设置后续的 添加设置删除 操作所针对的 Matroska(tm) + 文件区域(即剪辑信息或某个轨道的头部)。此选项可多次使用,以同时修改多个元素。 + +

+ + +

+ 默认情况下,mkvpropedit(1) 将编辑剪辑信息区段。 + +

+ + +

+ 完整的語法描述詳細資訊請參閱下列 編輯選擇器 。 + +

+ +
-a, --add + 名称=数值 + +

+ 添加名为 名称、值为 数值 + 的属性。即使已存在这样的属性,也将执行添加属性操作。注意大多数属性是唯一的,不能出现多个。 + +

+ +
-s, --set + 名稱=數值 + +

+ 设置所有名为 名称 的属性的数值为 + 数值。如果不存在这样的属性,则将添加该属性。 + +

+ +
-d, --delete 名稱 + +

+ 删除所有名为 名称 的属性。注意部分属性是必需的,不能删除。 + +

+ +
+ + +

+ 标签及章节处理操作: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
-t, --tags + 選擇:檔名 + +

+ 用 文件名 中的标签添加或替换文件中的标签,或者如果 文件名 + 为空则移除标签。mkvpropedit(1) 读取的 XML 标签格式与 mkvmerge(1) 所读取的相同。 + +

+ + +

+ 选择器 必须是 + allglobal 或 + track 之一。对于all 选择器,mkvpropedit(1) + 将替换或移除文件中的所有标签。对于 global 选择器,将只替换或移除全局标签。 + +

+ + +

+ 对于 track 选择器,mkvpropedit(1) 将替换特定轨道的标签。读取自 + 文件名 的其他标签将分配给相同轨道。轨道与 编辑选择器 以相同格式指定 (参见下文),如 + --tags track:a1:新音频标签.xml。 + +

+ +
--add-track-statistics-tags + +

+ 计算文件所有轨道的统计信息,并为每个轨道新增一个统计信息标签。若文件中已经存在此类标签,则将更新这些标签。 + +

+ +
--delete-track-statistics-tags + +

+ 从文件中删除现有的全部轨道统计标签。若文件不包括轨道统计标签,则不会被修改。 + +

+ +
-c, --chapters 檔名 + +

+ 用 文件名 中的标签添加或替换文件中的章节,或者如果 文件名 + 为空则移除章节。mkvpropedit(1) 读取的 XML 及简单章节格式与 mkvmerge(1) 所读取的相同。 + +

+ +
+ + +

+ 附件處理執行選項: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--add-attachment 檔名 + +

+ 從 檔名 增加新的附件。 + +

+ + +

+ 若本选项之前使用了 --attachment-name 选项,则其值将用作新附件的名称。否则附件名称将从 + 文件名 得出。 + +

+ + +

+ 若本选项之前使用了 --attachment-mime-type 选项,则其值将用作新附件的 MIME + 类型。否则将根据 文件名 的内容自动侦测。 + +

+ + +

+ 若本选项之前使用了 --attachment-description + 选项,则其值将用作新附件的描述。否则将不设置描述信息。 + +

+ + +

+ 若本选项之前使用了 --attachment-uid 选项,则其值将用作新附件的 UID。否则将自动生成随机的 + UID。 + +

+ +
--replace-attachment + 选择器:文件名 + +

+ 用文件 文件名 替换与 选择器 + 相匹配的一或多个附件。如果有超过一个现有附件与 选择器 相匹配,则其所有内容均将被 + 文件名 的内容替代。 + +

+ + +

+ 选择器 可以有四种格式。各格式说明位于下文 附件选择器 段落。 + +

+ + +

+ 若本选项之前使用了 --attachment-name 选项,则其值将设为每个被修改的附件的新名称。否则不修改名称。 + +

+ + +

+ 若本选项之前使用了 --attachment-mime-type 选项,则其值将设为每个被修改的附件的新 MIME + 类型。否则不修改 MIME 类型。 + +

+ + +

+ 若本选项之前使用了 --attachment-description + 选项,则其值将设为每个被修改的附件的新描述。否则不修改描述。 + +

+ + +

+ 若本选项之前使用了 --attachment-uid 选项,则其值将设为每个被修改的附件的新 UID。否则不修改 + UID。 + +

+ +
--update-attachment 選擇 + +

+ 设置 选择器 所匹配的一或多个附件的属性。如果匹配 选择器 + 的现有附件超过一个,则每个附件的属性都将被更新。 + +

+ + +

+ 选择器 可以有四种格式。各格式说明位于下文 附件选择器 段落。 + +

+ + +

+ 若本选项之前使用了 --attachment-name 选项,则其值将设为每个被修改的附件的新名称。否则不修改名称。 + +

+ + +

+ 若本选项之前使用了 --attachment-mime-type 选项,则其值将设为每个被修改的附件的新 MIME + 类型。否则不修改 MIME 类型。 + +

+ + +

+ 若本选项之前使用了 --attachment-description + 选项,则其值将设为每个被修改的附件的新描述。否则不修改描述。 + +

+ + +

+ 若本选项之前使用了 --attachment-uid 选项,则其值将设为每个被修改的附件的新 UID。否则不修改 + UID。 + +

+ +
--delete-attachment 選擇 + +

+ 删除与 选择器 相匹配的一或多个附件。 + +

+ + +

+ 选择器 可以有四种格式。各格式说明位于下文 附件选择器 段落。 + +

+ +
+ + +

+ 附件執行選項: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--attachment-name 名稱 + +

+ 设置接下来 --add-attachment 或 + --replace-attachment 操作要使用的名称。 + +

+ +
--attachment-mime-type MIME 類型 + +

+ 设置接下来 --add-attachment 或 + --replace-attachment 操作要使用的 MIME 类型。 + +

+ +
--attachment-description 描述 + +

+ 设置接下来 --add-attachment 或 + --replace-attachment 操作要使用的描述。 + +

+ +
--enable-legacy-font-mime-types + +

+ 对于特定类型的字体附件,使用传统的 MIME 类型。例如,TrueType + 字体的类型将标注为「application/x-truetype-font」而非「fonts/ttf」。 + +

+ + +

+ 这将同时影响到新增附件与替换现有附件的操作,但仅当用户未指定新版 MIME 类型时才起作用。其他现有的附件不受影响。 + +

+ + +

+ 受影响的 MIME + 类型如下:「font/sfnt」「font/ttf」「font/collection」将全部映射至「application/x-truetype-fonts」,「 + font/otf」将被映射至「application/vnd.ms-opentype」。 + +

+ +
+ + +

+ 其他選項: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--disable-language-ietf + +

+ 通常情况下,当用户要求更改轨道头部属性「language」(语言) 时,mkvpropedit(1) + 会同时更改全新的「LanguageIETF」轨道头部元素以及传统的「Language」元素。若使用本选项,则只会更改传统的「Language」元素。 + +

+ + +

+ 此选项不影响通过「language-ietf」轨道头部属性提出的变更要求。 + +

+ +
--normalize-language-ietf 模式 + +

+ 将 IETF BCP 47 + 语言标签规范化,支持「canonical」(最简式)、「extlang」(扩展语言子标签形式)以及「off」关闭模式。默认(不添加本选项)会规范化至最简式。 + +

+ + +

+ 最简式模式下,所有存在推荐值(preferred value)的语言子标签都会被替换为推荐值。依规范会执行下述转换: + 「zh-yue-jyutping」 转换为 + 「yue-jyutping」,「fr-FX」 转换为 + 「fr-FR」。 + +

+ + +

+ 扩展语言子标签形式在最简式的基础上生成。所有存在扩展语言子标签(extended language subtag)的主要语言(primary + language)都被替换为子标签对应的前缀加上该子标签。该规则将 「yue-jyutping」 转回传统的 + 「zh-yue-jyutping」 形式,但 「fr-FR」 + 不会发生变化,因为 「fr」 不属于扩展语言子标签。 + +

+ + +

+ 此处的规范化规则只对实际发生变化的元素起作用: + +

+ + +
    + +
  • + +

    + 编辑轨道头部字段时,只有通过编辑指令设置轨道语言元素值的轨道会受到影响。未被编辑的轨道的语言不会发生变化。编辑某条轨道但只设置语言以外的属性,也不会改变其语言值。 + +

    + +
  • + + +
  • + +

    + 编辑章节时,所有章节元素的所有语言元素都会受到影响,因为现有的章节会被完全替换为新章节。 + +

    + +
  • + + +
  • + +

    + 编辑标签时,只有实际被替换的标签的语言元素才会受到影响。例如,当您替换全局标签时,现有的轨道标签不会受到影响。 + +

    + +
  • + +
+ + +

+ 将某个文件内现有的所有语言标签全部作规范化处理的最佳途径是,使用 mkvmerge(1) + 将其重新混流,并将程序的「--normalize-language-ietf」选项设为所需的模式。 + +

+ +
--command-line-charset 字元集 + +

+ 設定在命令列顯示的字串字元集,以轉換為其他字元集。預設為目前系統所在位置指定的字元集。 + +

+ +
--output-charset 字元集 + +

+ 設定要轉換為輸出字串的字元集。預設為目前系統所在位置指定的字元集。 + +

+ +
-r, --redirect-output + 檔名 + +

+ 將所有訊息寫入到檔案 檔名 + 而不是命令列。儘管使用輸出重新導向可以輕鬆完成此操作,但在某些情況下需要使用此選項: 當終端在將輸出寫入文件之前重新解釋(覆蓋)輸出時。 優先使用通過 + --output-charset + 設定字元集。 + +

+ +
--ui-language 語言碼 + +

+ 強制使用語言 編碼 對應的的翻譯(例如 'zh_TW' + 為臺灣正體中文翻譯)。 在編碼欄位中輸入'list' + 讓程式輸出時使用可用的對應翻譯清單。 + +

+ +
--abort-on-warnings + +

+ 發出第一個警告後,終止程式。程式的結束碼為 1 。 + +

+ +
--debug 主題 + +

+ 針對特定功能開啟除錯。此選項適用於開發者。 + +

+ +
--engage 功能 + +

+ 開啟實驗中功能。 透過mkvpropedit --engage + list啟用可用的列表。這些功能不會在正常情況下使用。 + +

+ +
--gui-mode + +

+ 開啟 GUI 模式。在這種模式中,可能會輸出特殊格式的行數,可以呈現控制的 GUI 發生什麼事。這些訊息會以 + '#GUI#訊息'呈現。訊息可能包含機碼/值,例如 + '#GUI#訊息#機碼1=值1#機碼2=值2…'。 無論是訊息或是機碼都不會轉為譯文,而且永遠使用 *英語* + 輸出。 + +

+ +
-v, --verbose + +

+ 輸出時盡量詳細,並在讀取時顯示所有 Matroska(tm) 重要的元件。 + +

+ +
-h, --help + +

+ 顯示使用方式並退出。 + +

+ +
-V, --version + +

+ 顯示版本資訊並離開。 + +

+ +
@options-file.json + +

+ 從檔案選項檔讀取其他命令列引數。有關此類檔案支援格式的完整說明,請參閱 mkvmerge(1) 文件中的 + "選項檔案" 章節。 + +

+ +
+ +

3. 編輯選擇器

+ + +

+ --edit + 选项设置后续的 添加, 设置删除 操作所影响的 Matroska(tm) + 文件区域(剪辑信息或者特定轨道的头部)。在出现另一个 --edit + 选项之前,此选项将一直有效。此选项的参数就叫做编辑选择器。 + +

+ + +

+ 默认情况下,mkvpropedit(1) 将编辑剪辑信息区段。 + +

+ + +

3.1. 剪輯資訊

+ + +

+ 可以通过这三个词中的任意一个选择剪辑信息: + 'info'、'segment_info' 或 + 'segmentinfo'。剪辑信息包含的属性包括剪辑标题、剪辑 UID 等。 + +

+ + + +

3.2. 軌道表頭

+ + +

+ 可用于选择轨道头部的选择器稍显复杂:所有以 'track:' 开头的变体。轨道头部属性包括如语言代码、'默认轨' + 标记、轨道名称等属性。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
track:n + +

+ 如果参数 n 为数字,则将选择第 n 条轨道。轨道顺序与 + mkvmerge(1)--identify 选项所输出的相同。 + +

+ + +

+ 從 1 開始編號。 + +

+ +
track:tn + +

+ 如果参数以字母 t 后接 n + 开头,则将选择选定轨道类型中的第 n 条轨道。轨道类型参数 + t 必须为下述四个字母中的一个: 'a' + 代表音频轨道,'b' 代表按钮轨道,'s' + 代表字幕轨道,'v' 代表视频轨道。轨道顺序与 mkvmerge(1) 的 + --identify 选项所输出的相同。 + +

+ + +

+ 從 1 開始編號。 + +

+ +
track:=uid + +

+ 若参数以「=」后接数字「uid」开头,则会选择轨道 + UID 元素与参数所给出的「uid」相同的轨道。可使用 + mkvinfo(1) 获取轨道 UID。 + +

+ +
track:@編號 + +

+ 若参数以「@」后接数字「number」开头,则会选择轨道编号等于该「 + number」的轨道。可以通过 mkvinfo(1) 获取轨道编号。 + +

+ +
+ + + +

3.3. 備註

+ + +

+ 由于轨道编辑选择器的特性,一些选择器所匹配的轨道头部可能是相同的。在此情况下,这些编辑选择器的所有操作将被按照在命令行给出的顺序合并运行。 + +

+ + +

4. 附件選擇器

+ + + +

+ 附件选择器可与「--replace-attachment」及「--delete-attachment」这两项操作一起使用。它可以有以下四种格式: + +

+ + +
    + +
  1. + +

    + 按附件 ID 选择。本格式的选择器仅仅是数字,mkvmerge(1) 的识别命令所输出的附件 ID。 + +

    + +
  2. + + +
  3. + +

    + 按附件 UID (唯一 ID) 选择。本格式的选择器为等号 = 后接数字,mkvmerge(1) + 的详尽识别命令所输出的附件的唯一 ID。 + +

    + +
  4. + + +
  5. + +

    + 按附件名称选择。本格式的选择器为纯文本「name:」后接现有附件名称。若本选择器与「--replace-attachment」一起使用,则名称中的冒号必须用「\c」转义。 + +

    + +
  6. + + +
  7. + +

    + 按 MIME 类型选择。本格式的选择器为纯文本「mime-type:」后接现有附件的 MIME + 类型。若本选择器与「--replace-attachment」一起使用,则 MIME + 类型中的冒号必须用「\c」转义。 + +

    + +
  8. + +
+ +

5. Language handling

+ + + +

+ mkvpropedit(1) mostly tries to do the right thing by default. Therefore + changes to the language property will cause mkvpropedit(1) + to apply the same change to both the new "LanguageIETF" element as well as + the old "Language" element similar to how mkvmerge(1) applies the language to + both elements. For example, when using mkvpropedit movie.mkv --edit + track:2 --set language=zh-TW the "LanguageIETF" element will be + set to zh-TW and the old "Language" element to + chi. + +

+ + +

+ Additionally there's a new track header property named + language-ietf that can be set or removed. Changes to this + property only apply to the new "LanguageIETF" track header element. A caveat + is that the old "Language" track header element is a mandatory element in + Matroska — meaning even if it isn't present in the file it still has an + implied value. When the user only sets the language-ietf + property but not the language property, mkvpropedit(1) will + therefore add the old "Language" element in certain cases & set it to + und (meaning "undetermined") as the user didn't specify a + value for it. + +

+ + +

When reading XML chapter or tag files mkvpropedit(1) works like mkvmerge(1) + does. +

+ + +

The creation of the new elements can be disabled completely with the + command-line option `--disable-language-ietf` which operates on all three + new elements. +

+ + +

You can chose the normalization method applied to extended language sub-tags + with the parameter --normalize-language-ietf. +

+ +

6. 範例

+ + +

+ 下面的示例将编辑一个名为 '电影.mkv' + 的文件。示例中将设置剪辑标题并修改一条音频轨和一条字幕轨的语言代码。附注,本示例可以简写,即省去 --edit + 选项,因为在第一个 --edit + 选项之前的所有选项默认编辑的就是剪辑信息元素。 + +

+ +
$ mkvpropedit 影片.mkv --edit info --set "title=影片" --edit track:a1 --set language=fre --edit track:a2 --set language=ita
+ +

+ 第二个示例,将 '默认轨标记' 从第一条字幕轨移除并设置到第二条字幕轨上。注意 mkvpropedit(1) 与 mkvmerge(1) + 不同,不会在将另一个轨道的 '默认轨标记'设为 '1' 的时候自动将其他轨道的标记设为 '0'。 + +

+ +
$ mkvpropedit 影片.mkv --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1
+ +

+ 像这样替换文件中第二个字幕轨的标签: + +

+ +
$ mkvpropedit 影片.mkv --tags track:s2:新的字幕標簽.xml
+ +

+ 移除所有标签需要将文件名留空: + +

+ +
$ mkvpropedit 影片.mkv --tags all:
+ +

+ 像这样替换文件中的章节: + +

+ +
$ mkvpropedit 影片.mkv --chapters 新的章節.xml
+ +

+ 移除所有章节需要将文件名留空: + +

+ +
$ mkvpropedit 影片.mkv --chapters ''
+ +

+ 将字体文件 (Arial.ttf) 作为附件添加: + +

+ +
$ mkvpropedit 影片.mkv --add-attachment Arial.ttf
+ +

+ 将字体文件 (89719823.ttf) 作为附件添加,并提供信息,因为它真的就是 Arial: + +

+ +
$ mkvpropedit 影片.mkv --attachment-name Arial.ttf --attachment-description 'Arial 字型,TrueType 格式' --attachment-mime-type application/x-truetype-font --add-attachment 89719823.ttf
+ +

+ 將一個附加字型 (Comic.ttf) 檔取代成另一個 + (Arial.ttf): + +

+ +
$ mkvpropedit 影片.mkv --attachment-name Arial.ttf --attachment-description 'Arial 字型,TrueType 格式' --replace-attachment name:Comic.ttf:Arial.ttf
+ +

+ 刪除第二個附加檔,無論可能是什麼: + +

+ +
$ mkvpropedit 影片.mkv --delete-attachment 2
+ +

+ 依 MIME 類型刪除所有附加的字型: + +

+ +
$ mkvpropedit 影片.mkv --delete-attachment mime-type:application/x-truetype-font
+

7. 結束代碼

+ + + +

+ 使用三個之一的結束代碼結束 mkvpropedit(1) : + +

+ + +
    + +
  • + +

    + 0 -- 此結束代碼表示修正已成功完成。 + +

    + +
  • + + +
  • + +

    + 1 -- 在此情況下 mkvpropedit(1) + 輸出時至少有一則警告,但編輯動作仍然進行。警告訊息會在前端出現 'Warning:' + 字樣。依據問題的程度,生成的檔案也許可用。建議使用者檢視警告訊息與輸出檔。 + +

    + +
  • + + +
  • + +

    + 2 -- 此結束代碼用於發生錯誤後。 mkvpropedit(1) + 在輸出錯誤訊息後立即中止動作。錯誤訊息的範圍包含從錯誤命令列參數的讀/寫至檔案損壞。 + +

    + +
  • + +
+ +

8. 文字檔案與字元集轉換

+ + + +

+ 关于 MKVToolNix 套件中所有工具如何处理字符集转换、输入/输出编码、命令行编码及控制台编码的深入讨论,请参见 mkvmerge(1) + 手册中相对应名称的段落。 + +

+ +

9. 環境變數

+ + + +

+ mkvpropedit(1) 使用決定系統的地區設定的變數 (例如: LANG 與 + LC_* 系列)。 附加變數: + +

+ + + + + + + + + + + + + + + + + + + +
OptionDescription
MKVPROPEDIT_DEBUG, MKVTOOLNIX_DEBUG + 與其的簡短形式 MTX_DEBUG + +

視為通過 --debug + 選項傳遞的內容。 +

+ +
MKVPROPEDIT_ENGAGE, MKVTOOLNIX_ENGAGE + 與其簡短形式 MTX_ENGAGE + +

視為通過 --engage + 選項傳遞的內容。 +

+ +
+ +

10. 參閱

+ + +

+ mkvmerge(1), mkvinfo(1), mkvextract(1), mkvtoolnix-gui(1) + +

+ +

11. 網路

+ + +

+ 永遠可在 MKVToolNix 首頁 找到最新版。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvtoolnix-doc.css b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvtoolnix-doc.css new file mode 100644 index 0000000000000000000000000000000000000000..a908c403b059bd2976e3d1fcca91c5f37f0ee23e --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvtoolnix-doc.css @@ -0,0 +1,158 @@ +@charset "utf-8"; + +body { + font-family: Verdana, sans-serif; + color: #000; + background: #fff; +} + +.heading { + font-weight: bold; + font-size: 158%; + text-align: center; +} + +h1 { + font-size: 150%; + font-weight: bold; +} + +h2 { + font-size: 125%; + font-weight: bold; +} + +h3 { + font-size: 100%; + font-weight: bold; + text-decoration: underline; +} + +a:link, a:visited{ + color: #0067ab; + text-decoration: none; +} + +a:focus { + outline:1px dotted; +} + +a:hover, a:active { + color: #0067ab; + outline: none; + text-decoration: underline; +} + +.toc { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.toc ul { + list-style-type: none; + padding-left: 0; +} + +.content { + margin: 0 20px 10px 20px; + border: 1px solid #BBB; + background-color: #dda; + color: #000; + background: #EEE; + padding: 1px 10px; +} + +.code { + background-color: #ccc; + font-family: monospace; +} + +.classname, .command, .commandname, .constant, .filename, .function, .literal, .varname { + font-family: monospace; +} + +.option { + color: #be5303; + font-family: monospace; +} + +.parameter { + font-family: monospace; + font-style: italic; + border-bottom: 1px dashed black; +} + +.productname { + font-style: italic; +} + +.important-title, .note-title { + text-decoration: underline; + font-weight: bold; +} + +.important, .note { + color: #000; + background-color: #fae8b8; + border: 1px solid #be5303; + border-collapse: collapse; + margin: 10px 30px; + padding: 0 10px; +} + +.cmdsynopsis, .programlisting { + font-family: monospace; + color: #000; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +.screen { + font-family: monospace; + background-color: #d0d0d0; + border: 1px solid #0067ab; + padding: 3px 5px; + margin: 0 5px; +} + +img { + border: none; +} + +table.variablelist { + color: #fff; + background-color: #000; + border: 1px solid #d0d0d0; + border-collapse: collapse; +} + +table.variablelist th { + color: #000; + background-color: #ccc; +} + +table.variablelist td { + color: #000; + background-color: #fff; + border: 1px solid #d0d0d0; + padding: 3px; + vertical-align: top; +} + +table.variablelist td.varlistoption { + white-space: nowrap; +} + +td p:first-child { + margin-top: 0; +} + +td p:last-child { + margin-bottom: 0; +} \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvtoolnix-gui.html b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvtoolnix-gui.html new file mode 100644 index 0000000000000000000000000000000000000000..6ef99ea69817102f678462c43c8b271185e4dd18 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/doc/zh_TW/mkvtoolnix-gui.html @@ -0,0 +1,144 @@ + + + + + mkvtoolnix-gui -- mkvmerge1 的使用者介面,包含表頭編輯與章節編輯 + + + +
mkvtoolnix-gui -- mkvmerge(1) 的使用者介面,包含表頭編輯與章節編輯 +
+
+
+

Table of contents

+ +
+
+

1. 概要

+ + +
mkvtoolnix-gui [[配置文件名.mtxcfg] | [输入文件.扩展名] | [matroska-文件.mkv] | [章节文件.扩展名] | [matroska-文件.mkv]] +
+ +

2. 摘要說明

+ + +

+ mkvtoolnix-gui(1) 是用于 mkvmerge(1)GUI,基于 + Qt(tm) 开发。它还支持调用 mkvinfo(1)mkvpropedit(1),未来还将覆盖 + mkvextract(1) 的功能。所有设置(例如输入文件、轨道选项等)都可以保存与恢复。 + +

+ + +

+ 给出扩展名为 .mtxcfg 的配置文件名,可让 GUI + 在相应工具中加载这些配置文件。其他文件名将根据当前模式,作为待混流的输入文件添加,或在信息工具、章节编辑器或头部编辑器中打开。当前模式可通过 + --merge(混流)、--info(信息)、--edit-chapters(章节编辑) + 或 --edit-headers(头部编辑)修改。默认模式为添加文件用于混流。 + +

+ + +

+ 注意,若再次启动应用程序时,已经有一个该应用程序的实例在运行,则命令行给出的所有文件都将由已在运行的实例处理。 + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
--merge + +

以下所有檔案名稱都以原始檔案加入至目前的合併工具作業中。這是預設模式。

+ +
--info + +

其後所有檔名將在資訊工具中開啟。

+ +

此外,在啟動時選擇資訊工具,而不是合併工具。

+ +
--edit-chapters + +

其後所有檔名將在章節編輯中開啟。

+ +

此外,在啟動時選擇章節編輯,而不是合併工具。

+ +
--edit-headers + +

其後所有檔名將在表頭編輯中開啟。

+ +

此外,在啟動時選擇表頭編輯,而不是合併工具。

+ +
-h, --help + +

+ 顯示使用方式並退出。 + +

+ +
-V, --version + +

+ 顯示版本資訊並離開。 + +

+ +
+ +

3. 參閱

+ + +

+ mkvmerge(1), mkvextract(1), mkvinfo(1), mkvpropedit(1) + +

+ +

4. 網路

+ + +

+ 永遠可在 MKVToolNix 首頁 找到最新版。 + +

+ +
+ + \ No newline at end of file diff --git a/mm_avh_working_space/bin/mkvtoolnix/examples/example-chapters-1.xml b/mm_avh_working_space/bin/mkvtoolnix/examples/example-chapters-1.xml new file mode 100644 index 0000000000000000000000000000000000000000..ec02cb8271d6be60a9c23d5e6fe8d694c376b058 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/examples/example-chapters-1.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + Example movie + en + + + 00:00:00.000 + + Intro + eng + + 1 + + + 00:01:00.000 + + Act 1 + en + + 0 + + + 00:05:30.000 + + Act 2 + en + + 0 + + + 00:12:20.000 + 00:12:55.000 + + Credits + en + + 2 + + + + + + + + + 00:02:00.000 + 00:04:00.000 + 1 + 0 + + A hidden and not enabled chapter. + eng + + + + diff --git a/mm_avh_working_space/bin/mkvtoolnix/examples/example-chapters-2.xml b/mm_avh_working_space/bin/mkvtoolnix/examples/example-chapters-2.xml new file mode 100644 index 0000000000000000000000000000000000000000..cb5503df0d3971264e87bdefa40911810d81f952 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/examples/example-chapters-2.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 00:00:00.000 + 00:11:20.000 + + erster Akt + ger + de + + + 00:00:00.000 + 00:06:24.000 + + Ouvertre + ger + de + + + + 00:06:24.000 + 00:11:10.000 + + Arie: Jetzt, Schtzchen, jetzt sind wir allein + ger + de + + + + 00:11:10.000 + 00:11:20.000 + + Dialog: Armer Jaquino + ger + de + + + + + + 00:11:20.000 + 00:28:26.000 + + zweiter Akt + ger + de + + + 00:11:20.000 + 00:22:06.000 + + Ouvertre und Arie: Gott! Welch Dunkel hier! + ger + de + + + + 00:22:06.000 + 00:27:27.000 + + Melodram und Duett: Wie kalt ist es + ger + de + + + + 00:27:27.000 + 00:28:26.000 + + Dialog: Er erwacht! + ger + de + + + + + diff --git a/mm_avh_working_space/bin/mkvtoolnix/examples/example-cue-sheet-1.cue b/mm_avh_working_space/bin/mkvtoolnix/examples/example-cue-sheet-1.cue new file mode 100644 index 0000000000000000000000000000000000000000..702f11aaa527b2dcdc44893b5bd36492cd182196 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/examples/example-cue-sheet-1.cue @@ -0,0 +1,79 @@ +PERFORMER "Orbital" +TITLE "Back To Mine" +FILE "Orbital - Back To Mine.mp3" MP3 + TRACK 01 AUDIO + TITLE "John Barry & His Orchestra - The Knack" + PERFORMER "Orbital" + INDEX 01 00:00:00 + TRACK 02 AUDIO + TITLE "Lee Perry & The Upsetters - Justice To The People" + PERFORMER "Orbital" + INDEX 01 02:49:57 + TRACK 03 AUDIO + TITLE "DSR - Babaloo" + PERFORMER "Orbital" + INDEX 01 05:54:23 + TRACK 04 AUDIO + TITLE "Eon - Spice (J. Saul Kane Version)" + PERFORMER "Orbital" + INDEX 01 09:54:58 + TRACK 05 AUDIO + TITLE "The Tornadoes - Love & Fury" + PERFORMER "Orbital" + INDEX 01 12:41:00 + TRACK 06 AUDIO + TITLE "Severed Heads - We Have Come To Bless The House" + PERFORMER "Orbital" + INDEX 01 15:15:59 + TRACK 07 AUDIO + TITLE "Orbital - Ska'd For Life (Instrumental Mix) Exclusive" + PERFORMER "Orbital" + INDEX 01 19:08:09 + TRACK 08 AUDIO + TITLE "Gert Wilden & Orchestra - Schulmaedchen Report (Title Theme)" + PERFORMER "Orbital" + INDEX 01 22:48:40 + TRACK 09 AUDIO + TITLE "P.J. Harvey - Kamikaze" + PERFORMER "Orbital" + INDEX 01 25:58:47 + TRACK 10 AUDIO + TITLE "The Selecter - Celebrate The Bullet" + PERFORMER "Orbital" + INDEX 01 28:10:69 + TRACK 11 AUDIO + TITLE "Earth Leakage Trip - No Idea" + PERFORMER "Orbital" + INDEX 01 32:26:00 + TRACK 12 AUDIO + TITLE "The Divine Comedy - Lost Property" + PERFORMER "Orbital" + INDEX 01 38:25:23 + TRACK 13 AUDIO + TITLE "Falguni Pathak - Pal Pal Teri Yaad" + PERFORMER "Orbital" + INDEX 01 42:59:09 + TRACK 14 AUDIO + TITLE "Hyper-On-Experience - Half Stepper" + PERFORMER "Orbital" + INDEX 01 48:26:41 + TRACK 15 AUDIO + TITLE "Susan Cadogan - Don't Burn Your Bridges" + PERFORMER "Orbital" + INDEX 01 54:30:01 + TRACK 16 AUDIO + TITLE "Jethro Tull - Living In The Past" + PERFORMER "Orbital" + INDEX 01 57:36:38 + TRACK 17 AUDIO + TITLE "Tangerine Dream - Newtwork Twenty Three" + PERFORMER "Orbital" + INDEX 01 60:52:50 + TRACK 18 AUDIO + TITLE "Plaid - New Bass Hippo" + PERFORMER "Orbital" + INDEX 01 65:50:29 + TRACK 19 AUDIO + TITLE "Robert Mellin Orchestra - The Adventures Of Robinson Crusoe" + PERFORMER "Orbital" + INDEX 01 71:17:53 diff --git a/mm_avh_working_space/bin/mkvtoolnix/examples/example-segmentinfo-1.xml b/mm_avh_working_space/bin/mkvtoolnix/examples/example-segmentinfo-1.xml new file mode 100644 index 0000000000000000000000000000000000000000..56e6cb651f683530042fa5e3379721bbf9e7aaac --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/examples/example-segmentinfo-1.xml @@ -0,0 +1,16 @@ + + + + + + + + 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F + ff ee dd cc bb aa 99 88 77 66 55 44 33 22 11 00 + 00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff + 11 00 11 11 11 22 11 33 11 44 11 55 11 66 11 77 + diff --git a/mm_avh_working_space/bin/mkvtoolnix/examples/example-tags-2.xml b/mm_avh_working_space/bin/mkvtoolnix/examples/example-tags-2.xml new file mode 100644 index 0000000000000000000000000000000000000000..9f366b4fe60d7de699575ff214db26a3ed4c2e3a --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/examples/example-tags-2.xml @@ -0,0 +1,37 @@ + + + + + + + + + 1 + 2 + 3 + 4 + 2 + 4 + 6 + 8 + + + + + + + + LEAD_PERFORMER + Tori Amos + + + ALBUM + Under the Pink + + TITLE + Cornflake Girl + + + + + diff --git a/mm_avh_working_space/bin/mkvtoolnix/examples/example-timestamps-v1.txt b/mm_avh_working_space/bin/mkvtoolnix/examples/example-timestamps-v1.txt new file mode 100644 index 0000000000000000000000000000000000000000..e7f5eb32390ee2133c05ccfb31c01c880b891f28 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/examples/example-timestamps-v1.txt @@ -0,0 +1,27 @@ +# timestamp format v1 + +# The very first line MUST have this format. Later formats will increase +# the version number. + +# As you can see empty lines and other lines starting with '#' are ignored. + +# The second line with contents MUST be 'assume ', e.g. +assume 25 +# This sets the default FPS for ranges that are not explicitely covered +# below. + +# The remaining lines have the format 's,e,fps'. +# White spaces around the commas are ignored. This sets the number of +# frames per second for the frames starting with frame number s up to and +# including frame number e. + +# The 'fps' can be given as a floating point number. Note that only +# dots ('.') are accepted as the decimal point, not commas! + +# Example: +800,1000,23.97 +1500,1700,29.930 + +# As you can see you can have gaps at the start, in the middle, and +# naturally at the end. For those gaps the default FPS set with the +# 'assume' command is being used. diff --git a/mm_avh_working_space/bin/mkvtoolnix/examples/example-timestamps-v2.txt b/mm_avh_working_space/bin/mkvtoolnix/examples/example-timestamps-v2.txt new file mode 100644 index 0000000000000000000000000000000000000000..079a8d6a7af66fe1915dd018c068f877ead35a1d --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/examples/example-timestamps-v2.txt @@ -0,0 +1,38 @@ +# timestamp format v2 + +# The very first line MUST have this format. + +# As you can see empty lines and other lines starting with '#' are ignored. + +# The remaining lines simply contain the timestamp in ms for the following +# frame. The number can be a floating point number, but it doesn't have to +# be. Note that only dots ('.') are accepted as the decimal point, not +# commas! + +# White spaces are ignored. + +# You must give at least as many timestamp lines here as the track contais +# frames. Otherwise mkvmerge will complain, and the results might not be +# what you expect. + +# Example for 10 consecutive frames at 25fps: +0 +40.0 +80.0 +120 +160 +200 +240 +280 +320 +360 + +# No need to use floats, but you can if you want. Now some more frames which +# are spaced a bit more. +460 +560 +660 +760 +860 +960 +1060 diff --git a/mm_avh_working_space/bin/mkvtoolnix/examples/matroskachapters.dtd b/mm_avh_working_space/bin/mkvtoolnix/examples/matroskachapters.dtd new file mode 100644 index 0000000000000000000000000000000000000000..d63511b47eaa8f05d023fc6b9006ae0eb7866c71 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/examples/matroskachapters.dtd @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mm_avh_working_space/bin/mkvtoolnix/examples/matroskasegmentinfo.dtd b/mm_avh_working_space/bin/mkvtoolnix/examples/matroskasegmentinfo.dtd new file mode 100644 index 0000000000000000000000000000000000000000..e0987f33d8dafeb99e833ca824c625b951988a2a --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/examples/matroskasegmentinfo.dtd @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/mm_avh_working_space/bin/mkvtoolnix/examples/matroskatags.dtd b/mm_avh_working_space/bin/mkvtoolnix/examples/matroskatags.dtd new file mode 100644 index 0000000000000000000000000000000000000000..014987054409ead86beabdd175db3d28a4d2df24 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/examples/matroskatags.dtd @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/bg/LC_MESSAGES/mkvtoolnix.mo b/mm_avh_working_space/bin/mkvtoolnix/locale/bg/LC_MESSAGES/mkvtoolnix.mo new file mode 100644 index 0000000000000000000000000000000000000000..1803962af65b6ea8a5f6d12323b34e3063ff422f Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/bg/LC_MESSAGES/mkvtoolnix.mo differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/ca/LC_MESSAGES/mkvtoolnix.mo b/mm_avh_working_space/bin/mkvtoolnix/locale/ca/LC_MESSAGES/mkvtoolnix.mo new file mode 100644 index 0000000000000000000000000000000000000000..cf8d5ed365e59cf3ff77475e06c7e6594c3b27b6 Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/ca/LC_MESSAGES/mkvtoolnix.mo differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/cs/LC_MESSAGES/mkvtoolnix.mo b/mm_avh_working_space/bin/mkvtoolnix/locale/cs/LC_MESSAGES/mkvtoolnix.mo new file mode 100644 index 0000000000000000000000000000000000000000..d3ff4e7cf795ea0d415c3acabd5b1b4387a3e16d Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/cs/LC_MESSAGES/mkvtoolnix.mo differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/de/LC_MESSAGES/mkvtoolnix.mo b/mm_avh_working_space/bin/mkvtoolnix/locale/de/LC_MESSAGES/mkvtoolnix.mo new file mode 100644 index 0000000000000000000000000000000000000000..9876518c6e928db2c717e80275ab4d42c5d6f012 Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/de/LC_MESSAGES/mkvtoolnix.mo differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/es/LC_MESSAGES/mkvtoolnix.mo b/mm_avh_working_space/bin/mkvtoolnix/locale/es/LC_MESSAGES/mkvtoolnix.mo new file mode 100644 index 0000000000000000000000000000000000000000..b251bd95dab6cb6f8f580a6f7905ebf197958ada Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/es/LC_MESSAGES/mkvtoolnix.mo differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/eu/LC_MESSAGES/mkvtoolnix.mo b/mm_avh_working_space/bin/mkvtoolnix/locale/eu/LC_MESSAGES/mkvtoolnix.mo new file mode 100644 index 0000000000000000000000000000000000000000..90fa982a07b7b0a90d87765aba83128b2f64ce97 Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/eu/LC_MESSAGES/mkvtoolnix.mo differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/fr/LC_MESSAGES/mkvtoolnix.mo b/mm_avh_working_space/bin/mkvtoolnix/locale/fr/LC_MESSAGES/mkvtoolnix.mo new file mode 100644 index 0000000000000000000000000000000000000000..fb3dfeff8f670e97d9ee1b1180120aaafc585906 Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/fr/LC_MESSAGES/mkvtoolnix.mo differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/it/LC_MESSAGES/mkvtoolnix.mo b/mm_avh_working_space/bin/mkvtoolnix/locale/it/LC_MESSAGES/mkvtoolnix.mo new file mode 100644 index 0000000000000000000000000000000000000000..f5b895b96aef475f51b2628918afdc36ffe117d5 Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/it/LC_MESSAGES/mkvtoolnix.mo differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/ja/LC_MESSAGES/mkvtoolnix.mo b/mm_avh_working_space/bin/mkvtoolnix/locale/ja/LC_MESSAGES/mkvtoolnix.mo new file mode 100644 index 0000000000000000000000000000000000000000..38b391cf1413cc2adc3ce1770ad4011276f4b3f2 Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/ja/LC_MESSAGES/mkvtoolnix.mo differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/ko/LC_MESSAGES/mkvtoolnix.mo b/mm_avh_working_space/bin/mkvtoolnix/locale/ko/LC_MESSAGES/mkvtoolnix.mo new file mode 100644 index 0000000000000000000000000000000000000000..799dfdbc76170b27717740c0aca190a82766f550 Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/ko/LC_MESSAGES/mkvtoolnix.mo differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_ar.qm b/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_ar.qm new file mode 100644 index 0000000000000000000000000000000000000000..32861b810bdfb02f8afa4962ea12d3ef78ecebaf Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_ar.qm differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_bg.qm b/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_bg.qm new file mode 100644 index 0000000000000000000000000000000000000000..faeb1676dabda59ed6f08ffcd8b31b1114d73349 Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_bg.qm differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_ca.qm b/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_ca.qm new file mode 100644 index 0000000000000000000000000000000000000000..8e34f82485cc9df9188baac77af0629e4bb43d63 Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_ca.qm differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_cs.qm b/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_cs.qm new file mode 100644 index 0000000000000000000000000000000000000000..459ef2664b2420f9cd2b517b53c0d163e25a52f0 Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_cs.qm differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_da.qm b/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_da.qm new file mode 100644 index 0000000000000000000000000000000000000000..4ede24b42dc6dd9747f8f4417925ad6f7cbd1f1c Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_da.qm differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_de.qm b/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_de.qm new file mode 100644 index 0000000000000000000000000000000000000000..8b3442ad30529136bd9db39152650ce2a743520b Binary files /dev/null and b/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_de.qm differ diff --git a/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_en.qm b/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_en.qm new file mode 100644 index 0000000000000000000000000000000000000000..be651eede2edc9cb0da5c140b31664afee169fa8 --- /dev/null +++ b/mm_avh_working_space/bin/mkvtoolnix/locale/libqt/qt_en.qm @@ -0,0 +1 @@ + List[Dict[str, str]] - Returns a list of available translators. + - get_translation_options() -> List[Dict[str, str]] - Returns a list of available translation options. + - get_voice_actors() -> List[Dict[str, str]] - Returns a list of available voice actors for text-to-speech. + - get_output() -> List[Dict[str, str]] - Returns a list of available output options. + """ + + @staticmethod + def get_translators() -> List[Dict[str, str]]: + """ + Returns a list of available translators. + + Each translator is represented as a dictionary with the following keys: + - 'name': The name of the translator. + - 'suboptions' (optional): A list of suboptions for the translator. + + Returns: + List[Dict[str, str]]: A list of translators. + """ + return [ + {'name': 'Google Translate'}, + {'name': 'DeepL API'}, + {'name': 'DeepL Desktop Free'}, + { + 'name': 'ChatGPT', + 'suboptions': [ + {'name': 'ChatGPT + Google Translate'} + ], + }, + ] + + @staticmethod + def get_translation_options() -> List[Dict[str, str]]: + """ + Returns a list of available translation options. + + Each option is represented as a dictionary with the following key: + - 'name': The name of the option. + + Returns: + List[Dict[str, str]]: A list of translation options. + """ + return [ + {'name': '10'}, + {'name': '20'}, + {'name': '30'}, + {'name': '40'}, + {'name': '50'}, + {'name': '60'}, + {'name': '70'}, + {'name': '80'}, + {'name': '90'}, + {'name': '100'}, + ] + + @staticmethod + def get_voice_actors() -> List[Dict[str, str]]: + """ + Returns a list of available voice actors for text-to-speech. + + Each voice actor is represented as a dictionary with the following keys: + - 'name': The name of the voice actor. + - 'description': A dictionary containing the description of the voice actor, including: + - 'speed': The speed of the voice actor. + - 'volume': The volume of the voice actor. + - 'default_options': A dictionary containing the default options for the voice actor, including: + - 'default_voice_speed': The default speed of the voice actor. + - 'default_voice_volume': The default volume of the voice actor. + + Returns: + List[Dict[str, str]]: A list of voice actors. + """ + return [ + { + 'name': 'TTS - Zosia - Harpo', + 'description': { + 'speed': 'Szybkość głosu od 0 do ... (słowa na minutę), domyślna: 200', + 'volume': 'Głośność głosu od 0 do 1, domyślna: 0.7', + }, + 'default_options': { + 'default_voice_speed': '200', + 'default_voice_volume': '0.7', + }, + }, + { + 'name': 'TTS - Agnieszka - Ivona', + 'description': { + 'speed': 'Szybkość głosu od -10 do 10, domyślna: 5', + 'volume': 'Głośność głosu od 0 do 100, domyślna: 65', + }, + 'default_options': { + 'default_voice_speed': '5', + 'default_voice_volume': '65', + }, + }, + { + 'name': 'TTS - Zofia - Edge', + 'description': { + 'speed': 'Szybkość głosu (+/- ? %) od -100% do +100%, domyślna: +40%', + 'volume': 'Głośność głosu (+/- ? %) od -100% do +100%, domyślna: +0%', + }, + 'default_options': { + 'default_voice_speed': '+40%', + 'default_voice_volume': '+0%', + }, + }, + { + 'name': 'TTS - Marek - Edge', + 'description': { + 'speed': 'Szybkość głosu (+/- ? %) od -100% do +100%, domyślna: +40%', + 'volume': 'Głośność głosu (+/- ? %) od -100% do +100%, domyślna: +0%', + }, + 'default_options': { + 'default_voice_speed': '+40%', + 'default_voice_volume': '+0%', + }, + }, + { + 'name': 'TTS - *Głos* - ElevenLans', + 'description': { + 'speed': 'Szybkość głosu: Auto', + 'volume': 'Głośność głou: Auto', + }, + 'default_options': { + 'default_voice_speed': 'auto', + 'default_voice_volume': 'auto', + }, + }, + ] + + @staticmethod + def get_output() -> List[Dict[str, str]]: + """ + Returns a list of available output options. + + Each option is represented as a dictionary with the following key: + - 'name': The name of the output option. + + Returns: + List[Dict[str, str]]: A list of output options. + """ + return [ + {'name': 'Oglądam w MM_AVH_Players (wynik: napisy i audio)'}, + {'name': 'Scal do mkv'}, + {'name': 'Wypal do mp4'}, + ] diff --git a/mm_avh_working_space/data/settings.json b/mm_avh_working_space/data/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..b687b8fbc2d5387143c4a7fda48cc334e70f7920 --- /dev/null +++ b/mm_avh_working_space/data/settings.json @@ -0,0 +1,10 @@ +{ + "translator": "Google Translate", + "deepl_api_key": "1df708bf-af10-3e70-e577-b2d4cb763d74:fx", + "chat_gpt_access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik1UaEVOVUpHTkVNMVFURTRNMEZCTWpkQ05UZzVNRFUxUlRVd1FVSkRNRU13UmtGRVFrRXpSZyJ9.eyJodHRwczovL2FwaS5vcGVuYWkuY29tL3Byb2ZpbGUiOnsiZW1haWwiOiJtYXRldXN6bXJvejAwMUBnbWFpbC5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZX0sImh0dHBzOi8vYXBpLm9wZW5haS5jb20vYXV0aCI6eyJ1c2VyX2lkIjoidXNlci1peVR3RzhlZERKYzZuenF1ZXh0Y1V4TGcifSwiaXNzIjoiaHR0cHM6Ly9hdXRoMC5vcGVuYWkuY29tLyIsInN1YiI6Imdvb2dsZS1vYXV0aDJ8MTA3MjIwMDI0Mjc5OTM2OTA5MzUyIiwiYXVkIjpbImh0dHBzOi8vYXBpLm9wZW5haS5jb20vdjEiLCJodHRwczovL29wZW5haS5vcGVuYWkuYXV0aDBhcHAuY29tL3VzZXJpbmZvIl0sImlhdCI6MTY5NDI5MTQxMCwiZXhwIjoxNjk1NTAxMDEwLCJhenAiOiJUZEpJY2JlMTZXb1RIdE45NW55eXdoNUU0eU9vNkl0RyIsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwgbW9kZWwucmVhZCBtb2RlbC5yZXF1ZXN0IG9yZ2FuaXphdGlvbi5yZWFkIG9yZ2FuaXphdGlvbi53cml0ZSBvZmZsaW5lX2FjY2VzcyJ9.2TvyY7FEdthB7IdRe1pG-AQPIAx7QIatY4XZwhtDcdWgn6ie8-xuMeB4S-4vc0fsI6tTujOwegU8DS8Q4MACtSGXhXSSUvpPZdjVgv3DbL3sVZeb42AFJIcmuPT7borr1V1vmVBD-Wh2gyaz3z16ynvZlS46szWbRLq507RinpTr6ONL22ROu-kH5yFGAaRdJ2292Akyzm-wKS2k2-dEv0ovoOQnUGA5haMy9Dt68pN7o8au1E7-QnQn3s_5PY_JP4_hqr__Hd_8ulz_NSzpqrLuXFGaLd_Hlop1-rACQzUeoTOrh7mwjCTw7bayE_gxb6BvddetH0BHWcKEJofXvg", + "translated_line_count": "50", + "tts": "TTS - Agnieszka - Ivona", + "tts_speed": "5", + "tts_volume": "65", + "output": "Ogl\u0105dam w MM_AVH_Players (wynik: napisy i audio)" +} \ No newline at end of file diff --git a/mm_avh_working_space/data/settings.py b/mm_avh_working_space/data/settings.py new file mode 100644 index 0000000000000000000000000000000000000000..56d442eb55978c2f22d047ff7b1128b862c93103 --- /dev/null +++ b/mm_avh_working_space/data/settings.py @@ -0,0 +1,475 @@ +""" + Module `Settings` provides a versatile configuration management system + for your application. + It includes a `Settings` class that allows users to customize various options + and save them to a JSON file. + + * Example: First, create an instance of the `Settings` class: + settings = Settings() + + * Example usage of the `Settings` class: + settings.change_settings_save_to_file('settings.json') + - If the file doesn't exist, it will be created with default settings. + - If the file exists, it will be overwritten with the current settings. + - If the file exists with incomplete settings, missing settings will be added with default values. + + * Example default settings in 'settings.json': + { + "translator": "Google Translator", + "deepl_api_key": "null", + "chat_gpt_access_token": null, + "translated_line_count": "50", + "tts": "TTS - Agnieszka - Ivona", + "tts_speed": "5", + "tts_volume": "65", + "output": "Ogl\u0105dam w MM_AVH_Players (wynik: napisy i audio)" + } +""" + +from dataclasses import asdict, dataclass +from json import decoder, dump, load +from typing import Dict, List, Optional, Tuple +import webbrowser + +from constants import SETTINGS_PATH, console +from data.config import Config + + +@dataclass(slots=True) +class Settings: + """ + A class representing application settings. + + Attributes: + - translator (Optional[str]): The selected translator. + - deepl_api_key (Optional[str]): The API key for DeepL translation service. + - chat_gpt_access_token (Optional[str]): The access token for ChatGPT API. + - translated_line_count (Optional[str]): The number of translated lines. + - tts (Optional[str]): The selected TTS engine. + - tts_speed (Optional[str]): The speed of the TTS voice. + - tts_volume (Optional[str]): The volume of the TTS voice. + - output (Optional[str]): The selected output option. + + Methods: + - load_from_file(cls, settings_path: str) -> 'Settings': Load settings from a file. + - _set_option(prompt: str, options: List[Dict[str, str]]) -> str | None: Set an option from a list of options. + - _is_valid_speed(speed: str, tts: str) -> bool: Check if a given speed value is valid for the selected TTS engine. + - _is_valid_volume(volume: str, tts: str) -> bool: Check if a given volume value is valid for the selected TTS engine. + - _get_translator(settings: Optional['Settings']) -> Optional[str]: Get the selected translator. + - _get_deepl_api_key(settings: Optional['Settings']) -> Optional[str]: Get the DeepL API key. + - _get_chat_gpt_access_token(settings: Optional['Settings']) -> Optional[str]: Get the ChatGPT access token. + - _get_translated_line_count(settings: Optional['Settings']) -> Optional[str]: Get the number of translated lines. + - _get_tts(settings: Optional['Settings']) -> Optional[str]: Get the selected TTS engine. + - _get_default_speed_volume(tts: str) -> Tuple[Optional[str], Optional[str]]: Get the default speed and volume for a TTS engine. + - _get_tts_speed(tts: str, default_speed: Optional[str]) -> Optional[str]: Get the TTS speed. + - _get_tts_volume(tts: str, default_volume: Optional[str]) -> Optional[str]: Get the TTS volume. + - _get_output(settings: Optional['Settings']) -> Optional[str]: Get the selected output option. + - get_user_settings(settings_path: str) -> Optional['Settings']: Get user settings from a file. + - change_settings_save_to_file(settings_path: str) -> None: Change and save settings to a file. + """ + translator: Optional[str] = None + deepl_api_key: Optional[str] = None + chat_gpt_access_token: Optional[str] = None + translated_line_count: Optional[str] = None + tts: Optional[str] = None + tts_speed: Optional[str] = None + tts_volume: Optional[str] = None + output: Optional[str] = None + + @classmethod + def load_from_file(cls, settings_path: str = SETTINGS_PATH) -> 'Settings': + """ + Load settings from a JSON file. + + Args: + - settings_path (str): The name of the file to load settings from. + + Returns: + - Settings: An instance of the Settings class with the loaded settings. + + Raises: + - FileNotFoundError: If the file does not exist. + - decoder.JSONDecodeError: If the file has an invalid JSON format. + """ + + def get_default_settings(): + return cls( + translator='Google Translator', + deepl_api_key=None, + chat_gpt_access_token=None, + translated_line_count='50', + tts='TTS - Agnieszka - Ivona', + tts_speed='5', + tts_volume='65', + output='Oglądam w MM_AVH_Players (wynik: napisy i audio)' + ) + + try: + with open(settings_path, 'r', encoding='utf-8') as file: + data = load(file) + except FileNotFoundError: + console.print( + f'Nie znaleziono pliku {settings_path}', style='red_bold') + console.print('Musisz najpierw ustawić ustawienia.', + style='red_bold') + return get_default_settings() + + except decoder.JSONDecodeError: + console.print( + f'Niepoprawny format pliku {settings_path}', style='red_bold') + return get_default_settings() + + return Settings( + translator=data.get('translator'), + deepl_api_key=data.get('deepl_api_key'), + chat_gpt_access_token=data.get('chat_gpt_access_token'), + translated_line_count=data.get('translated_line_count'), + tts=data.get('tts'), + tts_speed=data.get('tts_speed'), + tts_volume=data.get('tts_volume'), + output=data.get('output') + ) + + @staticmethod + def _set_option(prompt: str, options: List[Dict[str, str]]) -> str | None: + """ + Set an option from a list of options. + + Args: + - prompt (str): The prompt to display to the user. + - options (List[Dict[str, str]]): The list of options to choose from. + + Returns: + - str | None: The selected option, or None if the selection is invalid. + """ + console.print(f'\n{prompt}', style='yellow_bold') + for i, option in enumerate(options): + console.print( + f'[yellow_bold]{i + 1}.[/yellow_bold] [white]{option["name"]}') + if 'suboptions' in option: + for j, suboption in enumerate(option['suboptions']): + console.print( + f'[yellow_bold] {i + 1}.{j + 1}.[/yellow_bold] [white]{suboption["name"]}') + elif 'description' in option: + console.print( + f' [white]{option["description"]["speed"]}') + console.print( + f' [white]{option["description"]["volume"]}') + console.print('Wybierz opcję: ', style='green_bold', end='') + choice = input() + if '.' in choice: + major_choice, minor_choice = map(int, choice.split('.')) + if 1 <= major_choice <= len(options) and 1 <= minor_choice <= len(options[major_choice - 1]['suboptions']): + return options[major_choice - 1]['suboptions'][minor_choice - 1]['name'] + elif choice.isdigit(): + choice_num = int(choice) + if 1 <= choice_num <= len(options): + return options[choice_num - 1]['name'] + else: + for option in options: + if option['name'] == choice: + return option['name'] + console.print( + 'Niepoprawny wybór. Nie zmieniono wartości!', style='red_bold') + return None + + @staticmethod + def _is_valid_speed(speed: str, tts: str) -> bool: + """ + Check if a given speed value is valid for the selected TTS engine. + + Args: + - speed (str): The speed value to check. + - tts (str): The selected TTS engine. + + Returns: + - bool: True if the speed value is valid, False otherwise. + """ + if tts == 'TTS - Zosia - Harpo': + return int(speed) >= 0 + if tts == 'TTS - Agnieszka - Ivona': + return -10 <= int(speed) <= 10 + if tts in {'TTS - Zofia - Edge', 'TTS - Marek - Edge'}: + return speed.startswith(('+', '-')) and speed[1:-1].isdigit() and -100 <= int( + speed[1:-1]) <= 100 and speed.endswith('%') + return False + + @staticmethod + def _is_valid_volume(volume: str, tts: str) -> bool: + """ + Check if a given volume value is valid for the selected TTS engine. + + Args: + - volume (str): The volume value to check. + - tts (str): The selected TTS engine. + + Returns: + - bool: True if the volume value is valid, False otherwise. + """ + if tts == 'TTS - Zosia - Harpo': + return 0 <= float(volume) <= 1 + if tts == 'TTS - Agnieszka - Ivona': + return -100 <= int(volume) <= 100 + if tts in {'TTS - Zofia - Edge', 'TTS - Marek - Edge'}: + return volume.startswith(('+', '-')) and volume[1:-1].isdigit() and -100 <= int( + volume[1:-1]) <= 100 and volume.endswith('%') + return False + + @staticmethod + def _get_translator(settings: Optional['Settings']) -> Optional[str]: + """ + Retrieve the selected translator from the user settings or prompt the user to choose one. + + Args: + - settings (Optional['Settings']): The user settings object. + + Returns: + - Optional[str]: The selected translator or None if not found. + """ + + translator = Settings._set_option( + 'Wybierz tłumacza: ', Config.get_translators()) + if translator is None: + translator = settings.translator if settings else None + return translator + + @staticmethod + def _get_deepl_api_key(settings: Optional['Settings']) -> Optional[str]: + """ + Prompt the user to set the DeepL API key or retrieve it from the user settings. + + Args: + - settings (Optional['Settings']): The user settings object. + + Returns: + - Optional[str]: The DeepL API key or None if not set. + """ + + console.print( + '\nCzy chcesz ustawić klucz API DeepL?', style="yellow_bold") + console.print('(T lub Y - tak): ', style='green_bold', end='') + if input().lower() in ('t', 'y'): + console.print( + 'Klucz API DeepL można wygenerować na stronie https://www.deepl.com/pro-api', style='yellow_bold') + console.print('Podaj klucz API DeepL: ', + style='green_bold', end='') + deepl_api_key = input('') + if deepl_api_key == '': + deepl_api_key = settings.deepl_api_key if settings else None + console.print( + 'Niepoprawna wartość. Nie zmieniono wartości!', style='red_bold') + else: + deepl_api_key = settings.deepl_api_key if settings else None + return deepl_api_key + + @staticmethod + def _get_chat_gpt_access_token(settings: Optional['Settings']) -> Optional[str]: + """ + Prompt the user to set the Chat GPT access token or retrieve it from the user settings. + + Args: + - settings (Optional['Settings']): The user settings object. + + Returns: + - Optional[str]: The Chat GPT access token or None if not set. + """ + + console.print( + '\nCzy chcesz ustawić token dostępu do chat GPT?', style='yellow_bold') + console.print('(T lub Y - tak): ', style='green_bold', + end='') + if input().lower() in ('t', 'y'): + console.print( + 'Token dostępu (accessToken): https://chat.openai.com/api/auth/session', style='yellow_bold') + webbrowser.open('https://chat.openai.com/api/auth/session') + console.print( + 'Podaj token dostępu do chat GPT: ', style='green_bold', end='') + chat_gpt_access_token = input() + if chat_gpt_access_token == '': + chat_gpt_access_token = settings.chat_gpt_access_token if settings else None + console.print( + 'Niepoprawna wartość. Nie zmieniono wartości!', style='red_bold') + else: + chat_gpt_access_token = settings.chat_gpt_access_token if settings else None + return chat_gpt_access_token + + @staticmethod + def _get_translated_line_count(settings: Optional['Settings']) -> Optional[str]: + """ + Prompt the user to set the number of translated lines or retrieve it from the user settings. + + Args: + - settings (Optional['Settings']): The user settings object. + + Returns: + - Optional[str]: The number of translated lines or None if not set. (Optional[str] future maybe change) + """ + + translated_line_count = Settings._set_option('Wybierz liczbę przetłumaczonych linii: ', + Config.get_translation_options()) + if translated_line_count is None: + translated_line_count = settings.translated_line_count if settings else None + return translated_line_count + + @staticmethod + def _get_tts(settings: Optional['Settings']) -> Optional[str]: + """ + Prompt the user to choose a TTS engine or retrieve it from the user settings. + + Args: + - settings (Optional['Settings']): The user settings object. + + Returns: + - Optional[str]: The selected TTS engine or None if not set. + """ + + tts = Settings._set_option( + 'Wybierz silnik TTS: ', Config.get_voice_actors()) + if tts is None: + tts = settings.tts if settings else None + return tts + + @staticmethod + def _get_default_speed_volume(tts: str) -> Tuple[Optional[str], Optional[str]]: + """ + Retrieve the default voice speed and volume for the specified TTS engine. + + Args: + - tts (str): The selected TTS engine. + + Returns: + - Tuple[Optional[str], Optional[str]]: A tuple containing the default voice speed and volume, + or (None, None) if not found. + """ + + default_speed = None + default_volume = None + voice_actor = next( + (actor for actor in Config.get_voice_actors() if actor['name'] == tts), None) + if voice_actor: + default_speed = voice_actor['default_options']['default_voice_speed'] + default_volume = voice_actor['default_options']['default_voice_volume'] + return default_speed, default_volume + + @staticmethod + def _get_tts_speed(tts: str, default_speed: Optional[str]) -> Optional[str]: + """ + Prompt the user to enter the voice speed for the selected TTS engine, or use the default speed. + + Args: + - tts (str): The selected TTS engine. + - default_speed (Optional[str]): The default voice speed for the TTS engine. + + Returns: + - Optional[str]: The selected voice speed or the default speed if not set. + """ + + console.print('Wpisz szybkość głosu: ', style='green_bold', end='') + tts_speed_choice = input() + try: + tts_speed = tts_speed_choice if ( + Settings._is_valid_speed( + tts_speed_choice, tts) and tts_speed_choice.strip() != '' + ) else default_speed + except ValueError: + console.print( + 'Niepoprawna wartość szybkości. Używam domyślnej wartości.', style='red_bold') + tts_speed = default_speed + return tts_speed + + @staticmethod + def _get_tts_volume(tts: str, default_volume: Optional[str]) -> Optional[str]: + """ + Prompt the user to enter the voice volume for the selected TTS engine, or use the default volume. + + Args: + - tts (str): The selected TTS engine. + - default_volume (Optional[str]): The default voice volume for the TTS engine. + + Returns: + - Optional[str]: The selected voice volume or the default volume if not set. + """ + + console.print('Wpisz głośność głosu: ', + style='green_bold', end='') + tts_volume_choice = input() + try: + tts_volume = tts_volume_choice if ( + Settings._is_valid_volume( + tts_volume_choice, tts) and tts_volume_choice.strip() != '' + ) else default_volume + except ValueError: + console.print( + 'Niepoprawna wartość głośności. Używam domyślnej wartości.', style='red_bold') + tts_volume = default_volume + return tts_volume + + @staticmethod + def _get_output(settings: Optional['Settings']) -> Optional[str]: + """ + Prompt the user to choose an output option or retrieve it from the user settings. + + Args: + - settings (Optional['Settings']): The user settings object. + + Returns: + - Optional[str]: The selected output option or None if not set. + """ + + output = Settings._set_option( + 'Wybierz wyjście: ', Config.get_output()) + if output is None: + output = settings.output if settings else None + return output + + @staticmethod + def get_user_settings(settings_path: str = SETTINGS_PATH) -> Optional['Settings']: + """ + Get the user settings from a file or prompt the user to enter them. + + Args: + - settings_path (str): The name of the settings file. + + Returns: + - Optional['Settings']: The user settings object or None if not found. + """ + + settings = Settings.load_from_file(settings_path) + + translator = Settings._get_translator(settings) + deepl_api_key = Settings._get_deepl_api_key(settings) + chat_gpt_access_token = Settings._get_chat_gpt_access_token(settings) + translated_line_count = Settings._get_translated_line_count(settings) + tts = Settings._get_tts(settings) + default_speed, default_volume = Settings._get_default_speed_volume(tts) + console.print(f'\nWybrałeś: {tts}', style='yellow_bold') + tts_speed = Settings._get_tts_speed(tts, default_speed) + tts_volume = Settings._get_tts_volume(tts, default_volume) + output = Settings._get_output(settings) + + return Settings( + translator=translator, + deepl_api_key=deepl_api_key, + chat_gpt_access_token=chat_gpt_access_token, + translated_line_count=translated_line_count, + tts=tts, + tts_speed=tts_speed, + tts_volume=tts_volume, + output=output + ) + + @staticmethod + def change_settings_save_to_file(settings_path: str = SETTINGS_PATH) -> None: + """ + Prompt the user to change the settings and save them to a file. + If the file does not exist, it will be created. + If the file exists, it will be overwritten. + + Args: + - settings_path (str): The name of the settings file. + """ + + settings = Settings.get_user_settings(settings_path) + + with open(settings_path, 'w', encoding='utf-8') as file: + dump(asdict(settings), file, indent=4) diff --git a/mm_avh_working_space/modules/mkv_processing.py b/mm_avh_working_space/modules/mkv_processing.py new file mode 100644 index 0000000000000000000000000000000000000000..7056d09cf161924428f1e4ab4f8f4ce282a1ee21 --- /dev/null +++ b/mm_avh_working_space/modules/mkv_processing.py @@ -0,0 +1,241 @@ +""" + This module defines the 'MKVProcessing' class, which processes MKV files. + + * Usage: + To use this module, create an instance of the 'MKVProcessing' class and call the 'process_mkv' method. + * Example: Frist create an instance of the MKVProcessing class: + processor = MKVProcessing(filename="example.mkv", + crf_value="18", + preset_value="medium") + * Example usage: + processor.process_mkv(settings) +""" + +import re +from contextlib import suppress +from dataclasses import dataclass +from os import listdir, path, remove, rename +from shutil import move +from subprocess import Popen, call +from typing import List, Dict, Callable, Optional + +from constants import (WORKING_SPACE, + WORKING_SPACE_OUTPUT, + MKV_MERGE_PATH, + FFMPEG_PATH, + console) +from data.settings import Settings + + +@dataclass(slots=True) +class MKVProcessing: + """ + The 'MKVProcessing' class is used for processing MKV files. + + Attributes: + - filename (str): The name of the MKV file to process. + - working_space (str): The path to the working directory. + - working_space_output (str): The path to the output directory. + - mkv_merge_path (str): The path to the MKVMerge executable. + - ffmpeg_path (str): The path to the FFmpeg executable. + - crf_value (str): The Constant Rate Factor value for FFmpeg. + - preset_value (str): The preset value for FFmpeg. + + Methods: + - process_mkv(self, settings: Settings) -> None: + Processes the MKV file based on the specified settings. + + - move_files_to_working_space(self) -> None: + Moves the processed files to the working directory. + + - mkv_merge(self) -> None: + Merges the MKV file with the generated audio and subtitle files. + + - mkv_burn_to_mp4(self) -> None: + Burns the subtitles into the MKV file and converts it to MP4. + """ + filename: str + working_space: str = WORKING_SPACE + working_space_output: str = WORKING_SPACE_OUTPUT + mkv_merge_path: str = MKV_MERGE_PATH + ffmpeg_path: str = FFMPEG_PATH + + crf_value: str = '18' + preset_value: str = 'ultrafast' + + def process_mkv(self, settings: Settings) -> None: + """ + Processes the MKV file based on the specified settings. + + This method takes a Settings object as input and processes the MKV file accordingly. The processing options include moving the processed files to the working directory, merging the MKV file with the generated audio and subtitle files, and burning the subtitles into the MKV file and converting it to MP4. + + Args: + settings (Settings): The settings for processing the MKV file. + """ + options: Dict[str, Callable] = { + 'Oglądam w MM_AVH_Players (wynik: napisy i audio)': self.move_files_to_working_space, + 'Scal do mkv': self.mkv_merge, + 'Wypal do mp4': self.mkv_burn_to_mp4, + } + + process_method: Optional[Callable] = options.get(settings.output) + if process_method: + console.print( + f'\nRozpoczynam przetwarzane pliku o nazwie: {self.filename}...', style='green_bold') + process_method() + console.print( + f'\nZakończono i zapisano plik o nazwie: {self.filename}... w odpowiednim folderze.', style='green_bold') + + def move_files_to_working_space(self) -> None: + """ + Moves the processed files to the working directory. + + This method iterates over the files in the output directory and moves any files that start with the filename of the MKV file being processed to the working directory. + """ + for filename in listdir(self.working_space_output): + if filename.startswith(self.filename): + move(path.join(self.working_space_output, + filename), self.working_space) + + def mkv_merge(self) -> None: + """ + Merges the MKV file with the generated audio and subtitle files. + + This method takes the MKV file and merges it with the generated audio and subtitle files using the MKVMerge tool. The merged file is then saved in the output directory. + """ + input_file: str = path.join(self.working_space, self.filename + '.mkv') + if not path.exists(input_file): + console.print( + f'[red_bold]Plik {input_file} nie istnieje. Pomijam...') + return + output_file: str = path.join( + self.working_space_output, self.filename + '.mkv') + + subtitle_file_srt: str = path.join( + self.working_space_output, self.filename + '.srt') + subtitle_file_ass: str = path.join( + self.working_space_output, self.filename + '.ass') + lector_file: str = path.join( + self.working_space_output, self.filename + '.eac3') + + command: List[str] = [self.mkv_merge_path, + '-o', output_file, input_file] + if path.exists(lector_file): + command.extend(['--language', '0:pol', '--track-name', + '0:Lektor PL', '--default-track', '0:no', lector_file]) + if path.exists(subtitle_file_srt): + command.extend(['--language', '0:pol', '--track-name', + '0:Napisy Poboczne PL', '--default-track', '0:no', subtitle_file_srt]) + elif path.exists(subtitle_file_ass): + command.extend(['--language', '0:pol', '--track-name', + '0:Napisy Poboczne PL', '--default-track', '0:no', subtitle_file_ass]) + + process = Popen(command) + process.communicate() + + self._remove_files([subtitle_file_srt, subtitle_file_ass, lector_file]) + + def mkv_burn_to_mp4(self) -> None: + """ + Burns the subtitles into the MKV file and converts it to MP4. + + This method takes the MKV file, burns the subtitles into the video, and converts the file to MP4 format using FFmpeg. The converted file is then saved in the output directory. + """ + filename: str = self.filename + '.mkv' + if not path.exists(path.join(self.working_space, filename)): + console.print( + f'Plik {filename} nie istnieje w {self.working_space}. Pomijam...', style='red_bold') + return + new_filename: str = re.sub(r'[^A-Za-z0-9.]+', '_', filename) + + rename(path.join(self.working_space, filename), + path.join(self.working_space, new_filename)) + + subtitle_file_srt: str = path.join( + self.working_space_output, self.filename + '.srt') + subtitle_file_ass: str = path.join( + self.working_space_output, self.filename + '.ass') + lector_file: str = path.join( + self.working_space_output, self.filename + '.eac3') + + output_file: str = path.join( + self.working_space_output, new_filename[:-4] + '.mp4') + + command: List[str] = self._prepare_command( + new_filename, output_file, lector_file, subtitle_file_srt, subtitle_file_ass) + + with suppress(Exception): + call(command) + + if path.exists(output_file): + target_file = path.join( + self.working_space_output, filename[:-4] + '.mp4') + if path.exists(target_file) and output_file != target_file: + remove(target_file) + rename(output_file, target_file) + + rename(path.join(self.working_space, new_filename), + path.join(self.working_space, filename)) + + self._remove_files([subtitle_file_srt, subtitle_file_ass, lector_file]) + + def _remove_files(self, files: List[str]) -> None: + """ + Removes the specified files. + + This method takes a list of file paths and removes each file if it exists. + + Args: + files (List[str]): The list of files to remove. + """ + for file in files: + if path.exists(file): + remove(file) + + def _prepare_command(self, new_filename: str, output_file: str, lector_file: str, subtitle_file_srt: str, subtitle_file_ass: str) -> List[str]: + """ + Prepares the FFmpeg command for burning the subtitles and converting the file. + + This method takes the paths to the new filename, output file, lector file, and subtitle files, and prepares the FFmpeg command for burning the subtitles into the video and converting the file to MP4 format. + + Args: + new_filename (str): The new filename for the MKV file. + output_file (str): The path to the output file. + lector_file (str): The path to the lector file. + subtitle_file_srt (str): The path to the SRT subtitle file. + subtitle_file_ass (str): The path to the ASS subtitle file. + + Returns: + List[str]: The prepared FFmpeg command. + """ + command: List[str] = [] + + if (path.exists(subtitle_file_srt) or path.exists(subtitle_file_ass)) and path.exists(lector_file): + command = [self.ffmpeg_path, '-y', '-i', path.join(self.working_space, new_filename), '-i', lector_file.replace("\\", "/")[ + 2:], '-c:v', 'libx264', '-crf', self.crf_value, '-preset', self.preset_value, '-c:a', 'aac', '-map', '0:v:0', '-map', '1:a:0'] + + if path.exists(subtitle_file_srt): + command.extend( + ['-vf', 'subtitles=' + subtitle_file_srt.replace("\\", "/")[2:]]) + elif path.exists(subtitle_file_ass): + command.extend( + ['-vf', 'subtitles=' + subtitle_file_ass.replace("\\", "/")[2:]]) + + elif path.exists(lector_file): + command = [self.ffmpeg_path, '-y', '-i', path.join(self.working_space, new_filename), '-i', lector_file.replace( + "\\", "/")[2:], '-c:v', 'copy', '-c:a', 'aac', '-map', '0:v:0', '-map', '1:a:0'] + + elif path.exists(subtitle_file_srt) or path.exists(subtitle_file_ass): + command = [self.ffmpeg_path, '-y', '-i', path.join(self.working_space, new_filename), + '-c:v', 'libx264', '-crf', self.crf_value, '-preset', self.preset_value, '-c:a', 'copy'] + + if path.exists(subtitle_file_srt): + command.extend( + ['-vf', 'subtitles=' + subtitle_file_srt.replace("\\", "/")[2:]]) + elif path.exists(subtitle_file_ass): + command.extend( + ['-vf', 'subtitles=' + subtitle_file_ass.replace("\\", "/")[2:]]) + + command.append(output_file.replace("\\", "/")[2:]) + + return command diff --git a/mm_avh_working_space/modules/mkvtoolnix.py b/mm_avh_working_space/modules/mkvtoolnix.py new file mode 100644 index 0000000000000000000000000000000000000000..20cb311df2a9df181beaf0eca2d64ec822ae729a --- /dev/null +++ b/mm_avh_working_space/modules/mkvtoolnix.py @@ -0,0 +1,331 @@ +""" + The MkvToolNix module provides a class for manipulating MKV files. It uses tools from the MKVToolNix package such as mkvextract, mkvmerge, and mkvinfo. + + * Example usage: + mkvtoolnix = MkvToolNix(filename='example.mkv') + mkv_info = mkvtoolnix.get_mkv_info() + mkvtoolnix.mkv_extract_track(mkv_info) + + * Example output from get_mkv_info(): + { + "container": {...}, + "global_tags": [...], + "tracks": [...], + "chapters": [...], + "attachments": [...] + } +""" + +import sys +from subprocess import Popen, PIPE, CalledProcessError +from json import loads +from typing import Dict, List, Set +from os import path +from dataclasses import dataclass + +from constants import (WORKING_SPACE, + WORKING_SPACE_OUTPUT, + WORKING_SPACE_TEMP, + MKV_EXTRACT_PATH, + MKV_MERGE_PATH, MKV_INFO_PATH, + MKV_PROPEDIT_PATH, + console) + + +@dataclass(slots=True) +class MkvToolNix: + """ + A class for manipulating MKV files using the MKVToolNix package. + + Attributes: + - filename (str): The name of the MKV file to be processed. + - working_space (str): The directory where the MKV file is located. + - working_space_output (str): The directory where the output files will be saved. + - working_space_temp (str): The directory where temporary files will be saved during processing. + - mkv_extract_path (str): The path to the mkvextract executable. + - mkv_merge_path (str): The path to the mkvmerge executable. + - mkv_info_path (str): The path to the mkvinfo executable. + - mkv_propedit_path (str): The path to the mkvpropedit executable. + + Methods: + - get_mkv_info(): Retrieves information about the MKV file using the mkvinfo tool. + - mkv_extract_track(data: Dict[str, any]): Extracts the specified tracks from the MKV file using the mkvextract tool. + """ + filename: str + working_space: str = WORKING_SPACE + working_space_output: str = WORKING_SPACE_OUTPUT + working_space_temp: str = WORKING_SPACE_TEMP + + mkv_extract_path: str = MKV_EXTRACT_PATH + mkv_merge_path: str = MKV_MERGE_PATH + mkv_info_path: str = MKV_INFO_PATH + mkv_propedit_path: str = MKV_PROPEDIT_PATH + + def _check_executables(self) -> None: + """ + Checks if the MKVToolNix executables exist at the specified paths. + If any executable is not found, the program will exit with an error message. + """ + executables: List[str] = [self.mkv_extract_path, + self.mkv_merge_path, self.mkv_info_path] + for executable in executables: + if not path.exists(executable): + console.print( + f'Error: {executable} not found.', style='red_bold') + sys.exit() + + def get_mkv_info(self) -> dict: + """ + Retrieves information about the MKV file using the mkvinfo tool. + The information is returned as a dictionary and also printed to the console. + If an error occurs during the process, the program will exit with an error message. + + Returns: + - dict: A dictionary containing information about the MKV file. + """ + try: + self._check_executables() + command: List[str] = self._get_mkv_info_command() + with Popen(command, stdout=PIPE, stderr=PIPE, universal_newlines=True) as process: + output, error = process.communicate() + + if process.returncode == 0: + data: dict = loads(output) + tracks_data: List[dict] = self._parse_tracks_data(data) + self._print_mkv_info(tracks_data) + return data + + console.print(f'Error: {error}', style='red_bold') + except (FileNotFoundError, CalledProcessError) as error: + console.print(f'Error: {error}', style='red_bold') + sys.exit() + return {} + + def _get_mkv_info_command(self) -> List[str]: + """ + Constructs the command to be used for retrieving information about the MKV file with mkvinfo. + + Returns: + - List[str]: A list of strings representing the command to be executed. + """ + return [ + self.mkv_merge_path, + '--ui-language', + 'en', + '--identify', + '--identification-format', + 'json', + path.join(self.working_space, self.filename) + ] + + def _parse_tracks_data(self, data: dict) -> List[dict]: + """ + Parses the track data from the dictionary returned by mkvinfo. + + Args: + - data (dict): A dictionary containing information about the MKV file. + + Returns: + - List[dict]: A list of dictionaries, each representing a track in the MKV file. + """ + tracks_data: List[dict] = [] + + for track in data['tracks']: + track_data: dict = self._parse_track_data(track) + tracks_data.append(track_data) + + return sorted(tracks_data, key=lambda x: x['id']) + + def _parse_track_data(self, track: dict) -> dict: + """ + Parses the data for a single track from the dictionary returned by mkvinfo. + Returns a dictionary with the track's ID, type, codec ID, language, IETF language, and properties. + + Args: + - track (dict): A dictionary containing information about a single track in the MKV file. + + Returns: + - dict: A dictionary containing information about a single track in the MKV file. + """ + properties = track['properties'] + track_data: dict = { + 'id': track['id'], + 'type': track['type'], + 'codec_id': properties.get('codec_id', ''), + 'language': properties.get('language', ''), + 'language_ietf': properties.get('language_ietf', ''), + 'properties': self._get_track_properties(properties) + } + + return track_data + + @staticmethod + def _get_track_properties(properties: dict) -> str: + """ + Retrieves the properties of a track from the dictionary returned by mkvinfo. + + Args: + - properties (dict): A dictionary containing the properties of a track in the MKV file. + + Returns: + - str: A string containing the properties of a track in the MKV file. + """ + if 'display_dimensions' in properties: + return properties['display_dimensions'] + if 'audio_sampling_frequency' in properties: + return f"{properties['audio_sampling_frequency']} Hz" + return 'None' + + def _print_mkv_info(self, tracks_data: List[dict]) -> None: + """ + Prints the information about the MKV file to the console. + The information includes the ID, type, codec ID, language, IETF language, and properties of each track. + + Args: + - tracks_data (List[dict]): A list of dictionaries, each representing a track in the MKV file. + """ + console.print('WYODRĘBNIANIE Z PLIKU:', + style='yellow_bold') + console.print(self.filename, style='white_bold') + console.print('ID TYPE CODEK LANG LANG_IETF PROPERTIES', + style='yellow_bold') + + for track in tracks_data: + console.print( + f'[yellow_bold]{track["id"]:2}[/yellow_bold] ' + f'[white_bold]{track["type"]:10} ' + f'{track["codec_id"]:20} ' + f'{track["language"]:5} ' + f'{track["language_ietf"]:10} ' + f'{track["properties"]}' + ) + console.print() + + def mkv_extract_track(self, data: Dict[str, any]) -> None: + """ + Extracts the specified tracks from the MKV file using the mkvextract tool. + The tracks to be extracted are specified by their IDs. + The user is prompted to enter the IDs of the tracks to be extracted. + If an error occurs during the process, the program will exit with an error message. + + Args: + - data (Dict[str, any]): A dictionary containing information about the MKV file. + """ + valid_track_range: range = range(len(data['tracks'])) + tracks_to_extract: Set[int] = set() + + while True: + try: + console.print('Podaj ID ścieżki do wyciągnięcia (naciśnij ENTER, aby zakończyć): ', + style='green_bold', end='') + track_input: str = input().strip() + if not track_input: + break + track_id: int = int(track_input) + + if track_id in valid_track_range: + tracks_to_extract.add(track_id) + else: + console.print( + 'Nieprawidłowy ID ścieżki. Proszę podać poprawny numer ścieżki.\n', style='red_bold') + except ValueError: + console.print( + 'Pominięto wyciąganie ścieżki.\n', style='red_bold') + + try: + for track_id in tracks_to_extract: + track: str = data['tracks'][track_id] + codec_id: str = track['properties']['codec_id'] + format_extension: str = self._get_format_extension(codec_id) + filename: str = f'{self.filename[:-4]}.{format_extension}' + out_file: str = path.join(self.working_space_temp, filename) + command: List[str] = self._get_extract_command( + track_id, out_file) + + with Popen(command) as process: + console.print( + f'\nEkstrakcja ścieżki {track_id} do pliku {filename}', style='yellow_bold') + process.wait() + + except (IndexError, KeyError): + console.print( + 'Znaleziono nieprawidłowe ID ścieżki!', style='red_bold') + self.mkv_extract_track(data) + + console.print( + 'Ekstrakcja zakończona pomyślnie.\n', style='green_bold') + + @staticmethod + def _get_format_extension(codec_id: str) -> str: + """ + Determines the file extension for a track based on its codec ID. + + Args: + - codec_id (str): The codec ID of a track in the MKV file. + + Returns: + - str: The file extension for the track. + """ + format_dict: dict = { + 'A_AAC/MPEG2/*': 'aac', + 'A_AAC/MPEG4/*': 'aac', + 'A_AAC': 'aac', + 'A_AC3': 'ac3', + 'A_EAC3': 'ac3', + 'A_ALAC': 'caf', + 'A_DTS': 'dts', + 'A_FLAC': 'flac', + 'A_MPEG/L2': 'mp2', + 'A_MPEG/L3': 'mp3', + 'A_OPUS': 'opus', + 'A_PCM/INT/LIT': 'wav', + 'A_PCM/INT/BIG': 'wav', + 'A_REAL/*': 'rm', + 'A_TRUEHD': 'truehd', + 'A_MLP': 'mlp', + 'A_TTA1': 'tta', + 'A_VORBIS': 'ogg', + 'A_WAVPACK4': 'wv', + 'S_HDMV/PGS': 'sup', + 'S_HDMV/TEXTST': 'txt', + 'S_KATE': 'ogg', + 'S_TEXT/SSA': 'ssa', + 'S_TEXT/ASS': 'ass', + 'S_SSA': 'ssa', + 'S_ASS': 'ass', + 'S_TEXT/UTF8': 'srt', + 'S_TEXT/ASCII': 'srt', + 'S_VOBSUB': 'sub', + 'S_TEXT/USF': 'usf', + 'S_TEXT/WEBVTT': 'vtt', + 'V_MPEG1': 'mpeg', + 'V_MPEG2': 'mpeg', + 'V_MPEG4/ISO/AVC': 'h264', + 'V_MPEG4/ISO/HEVC': 'h265', + 'V_MS/VFW/FOURCC': 'avi', + 'V_REAL/*': 'rm', + 'V_THEORA': 'ogg', + 'V_VP8': 'ivf', + 'V_VP9': 'ivf' + } + + return format_dict.get(codec_id, 'mkv') + + def _get_extract_command(self, track_id: int, out_file: str) -> List[str]: + """ + Constructs the command to be used for extracting a track from the MKV file with mkvextract. + Returns the command as a list of strings. + + Args: + - track_id (int): The ID of the track to be extracted. + - out_file (str): The path and filename of the output file. + + Returns: + - List[str]: The command to be used for extracting the track. + """ + return [ + self.mkv_extract_path, + 'tracks', + path.join(self.working_space, self.filename), + f'{track_id}:{out_file}' + ] diff --git a/mm_avh_working_space/modules/subtitle.py b/mm_avh_working_space/modules/subtitle.py new file mode 100644 index 0000000000000000000000000000000000000000..5d28ad1f949c1bae174d0dffaf1d2e028c9cc274 --- /dev/null +++ b/mm_avh_working_space/modules/subtitle.py @@ -0,0 +1,380 @@ +""" + The SubtitleRefactor class in this module provides various utilities for working with subtitle files. + + It can be used in different scenarios to perform tasks such as splitting ASS subtitle files, converting subtitles to different formats, and organizing files. + + * Example usage for splitting an ASS subtitle file based on styles: + subtitle_tool = SubtitleRefactor("sample_subtitle.ass") + subtitle_tool.split_ass() + + * Example usage for converting ASS subtitles to SRT format: + subtitle_tool = SubtitleRefactor("sample_subtitle.ass") + subtitle_tool.ass_to_srt() + + * Example usage for moving an SRT subtitle file to a specified directory: + subtitle_tool = SubtitleRefactor("sample_subtitle.srt") + subtitle_tool.move_srt() + + * Example usage for converting a text file to SRT format and performing other operations: + subtitle_tool = SubtitleRefactor("sample_text.txt") + subtitle_tool.txt_to_srt(1) + + * Example usage for converting numbers in an SRT subtitle file to their word equivalents in Polish: + subtitle_tool = SubtitleRefactor("sample_subtitle.srt") + subtitle_tool.convert_numbers_in_srt() + + * Example usage for updating subtitles in an existing ASS file using translated subtitles from an SRT file: + subtitle_tool = SubtitleRefactor("sample_subtitle.srt") + subtitle_tool.srt_to_ass() +""" + +import re +from contextlib import suppress +from dataclasses import dataclass +from os import makedirs, path, remove, stat +from shutil import move +from typing import List, Tuple + +from nltk.tokenize import sent_tokenize +from pyasstosrt import Subtitle +from pysubs2 import load, SSAEvent, SSAFile + +from constants import (WORKING_SPACE, + WORKING_SPACE_OUTPUT, + WORKING_SPACE_TEMP, + WORKING_SPACE_TEMP_MAIN_SUBS, + WORKING_SPACE_TEMP_ALT_SUBS, + console) + +from utils.number_in_words import NumberInWords + + +@dataclass(slots=True) +class SubtitleRefactor: + """ + The SubtitleRefactor class is used for manipulating subtitle files. It provides functionalities such as splitting ASS subtitle files based on styles, converting ASS subtitles to SRT format, and moving SRT files to a specified directory. + + Attributes: + - filename (str): The name of the subtitle file to be processed. + - working_space (str, optional): The directory where the subtitle file is located. + - working_space_output (str, optional): The directory where the output files will be saved. + - working_space_temp (str, optional): The directory where temporary files will be saved during processing. + - working_space_temp_main_subs (str, optional): The directory for main subtitles during processing. + - working_space_temp_alt_subs (str, optional): The directory for alternate subtitles during processing. + + Methods: + - split_ass(self) -> None: Splits an ASS subtitle file into two files based on selected styles. + - ass_to_srt(self) -> None: Converts ASS subtitle files to SRT format. + - move_srt(self) -> None: Moves an SRT subtitle file to a specified directory. + - txt_to_srt(self, lines_per_caption: int) -> None: Converts a text file to SRT (SubRip Text) format. + - convert_numbers_in_srt(self) -> None: Converts numbers in an SRT subtitle file to their word equivalents in Polish. + - srt_to_ass(self) -> None: Updates subtitles in an existing ASS file using translated subtitles from an SRT file. If the ASS file does not exist, the SRT file is moved to the output directory, and its extension is changed to .ass. After these operations, the original ASS and SRT files are deleted. + """ + filename: str + working_space: str = WORKING_SPACE + working_space_output: str = WORKING_SPACE_OUTPUT + working_space_temp: str = WORKING_SPACE_TEMP + working_space_temp_main_subs = WORKING_SPACE_TEMP_MAIN_SUBS + working_space_temp_alt_subs = WORKING_SPACE_TEMP_ALT_SUBS + + def split_ass(self) -> None: + """ + Splits an ASS subtitle file into two files based on selected styles. + """ + self._create_directories() + subs: SSAFile = self._load_subs() + styles: List[str] = self._get_styles(subs) + self._display_styles(styles) + selected_styles: List[str] = self._select_styles(styles) + if not selected_styles: + self._move_subs_to_main() + return + main_subs, alt_subs = self._split_subs(subs, selected_styles) + self._copy_metadata_and_styles( + subs, main_subs, alt_subs, selected_styles) + self._save_subs(main_subs, alt_subs, subs, selected_styles) + self._remove_source_file() + console.print("Podział napisów zakończony pomyślnie.", + style='green_bold') + + def _create_directories(self) -> None: + """ + Creates directories if they do not exist. + """ + if not path.exists(self.working_space_temp_main_subs): + makedirs(self.working_space_temp_main_subs, exist_ok=True) + if not path.exists(self.working_space_temp_alt_subs): + makedirs(self.working_space_temp_alt_subs, exist_ok=True) + + def _load_subs(self) -> SSAFile: + """ + Loads the subtitle file. + """ + with open(path.join(self.working_space_temp, self.filename), 'r', encoding='utf-8') as file: + return SSAFile.from_file(file) + + def _get_styles(self, subs: SSAFile) -> List[str]: + """ + Returns a list of styles in the subtitle file. + """ + styles: List[str] = [] + for event in subs: + if event.style not in styles: + styles.append(event.style) + return styles + + def _display_styles(self, styles: List[str]) -> None: + """ + Displays the styles to the user. + """ + console.print("PODZIAŁ PLIKU:", style='yellow_bold') + console.print(self.filename, style='white_bold') + console.print("Dostępne style do TTS:", style='yellow_bold') + for i, style in enumerate(styles, start=1): + console.print( + f"[yellow_bold]{i}.[/yellow_bold] {style}", style='white_bold') + + def _select_styles(self, styles: List[str]) -> List[str]: + """ + Prompts the user to select styles and returns a list of selected styles. + """ + selected_styles: List[str] = [] + while True: + console.print("Wybierz style do zapisu (naciśnij ENTER, aby zakończyć):", + style='green_bold', end=" ") + selection: str = input('') + if not selection: + break + with suppress(ValueError): + selected_index: int = int(selection) - 1 + if 0 <= selected_index < len(styles): + selected_styles.append(styles[selected_index]) + return selected_styles + + def _move_subs_to_main(self) -> None: + """ + Moves the subtitle file to the main_subs directory. + """ + console.print("Nie wybrano żadnych stylów. Przeniesiono napisów do main_subs.", + style='red_bold') + makedirs(self.working_space_temp_main_subs, exist_ok=True) + alt_file_path: str = path.join( + self.working_space_temp, self.filename) + main_file_path: str = path.join( + self.working_space_temp_main_subs, self.filename) + move(alt_file_path, main_file_path) + + def _split_subs(self, subs: SSAFile, selected_styles: List[str]) -> Tuple[SSAFile, SSAFile]: + """ + Splits the subtitle file into two files based on the selected styles. + """ + main_subs: SSAFile = SSAFile() + alt_subs: SSAFile = SSAFile() + + for event in subs: + if event.style in selected_styles: + main_subs.append(event) + else: + alt_subs.append(event) + + return main_subs, alt_subs + + def _copy_metadata_and_styles(self, subs: SSAFile, main_subs: SSAFile, alt_subs: SSAFile, selected_styles: List[str]) -> None: + """ + Copies metadata and styles to the output files. + """ + main_subs.info = subs.info + alt_subs.info = subs.info + + main_style_names: List[str] = [style_name for style_name in subs.styles.keys() + if style_name in selected_styles] + main_subs.styles.clear() + for style_name in main_style_names: + main_subs.styles[style_name] = subs.styles[style_name] + + alt_style_names: List[str] = [style_name for style_name in subs.styles.keys() + if style_name not in selected_styles] + alt_subs.styles.clear() + for style_name in alt_style_names: + alt_subs.styles[style_name] = subs.styles[style_name] + + def _save_subs(self, main_subs: SSAFile, alt_subs: SSAFile, subs: SSAFile, selected_styles: List[str]) -> None: + """ + Saves the split subtitle files. + """ + main_output_file: str = path.join( + self.working_space_temp_main_subs, self.filename) + alt_output_file: str = path.join( + self.working_space_temp_alt_subs, self.filename) + + main_subs.info = subs.info + alt_subs.info = subs.info + + main_style_names: List[str] = [style_name for style_name in subs.styles.keys() + if style_name in selected_styles] + main_subs.styles.clear() + for style_name in main_style_names: + main_subs.styles[style_name] = subs.styles[style_name] + + alt_style_names: List[str] = [style_name for style_name in subs.styles.keys() + if style_name not in selected_styles] + alt_subs.styles.clear() + for style_name in alt_style_names: + alt_subs.styles[style_name] = subs.styles[style_name] + + with open(main_output_file, 'w', encoding='utf-8') as main_file: + main_file.write(main_subs.to_string(format_='ass')) + + with open(alt_output_file, 'w', encoding='utf-8') as alt_file: + alt_file.write(alt_subs.to_string(format_='ass')) + + def _remove_source_file(self) -> None: + """ + Removes the source subtitle file. + """ + remove(path.join(self.working_space_temp, self.filename)) + + def ass_to_srt(self) -> None: + """ + Converts ASS subtitle files to SRT format. + """ + folders = [self.working_space_temp_main_subs, + self.working_space_temp_alt_subs] + for folder in folders: + file_path: str = path.join(folder, self.filename) + + if not path.exists(file_path): + continue + + sub: Subtitle = Subtitle(file_path) + sub.export() + console.print() + + def move_srt(self) -> None: + """ + Moves an SRT subtitle file to a specified directory and removes HTML tags. + """ + target_file_path: str = path.join( + self.working_space_temp_main_subs, self.filename) + + if not path.exists(self.working_space_temp_main_subs): + makedirs(self.working_space_temp_main_subs, exist_ok=True) + + source_file_path: str = path.join( + self.working_space_temp, self.filename) + + # Otwórz plik źródłowy i przeczytaj jego zawartość + with open(source_file_path, 'r', encoding='utf-8') as file: + file_content = file.read() + + # Usuń znaczniki HTML + file_content = re.sub(r'<.*?>', '', file_content) + + # Zapisz zmodyfikowaną zawartość do pliku docelowego + with open(target_file_path, 'w', encoding='utf-8') as file: + file.write(file_content) + + # Usuń plik źródłowy + remove(source_file_path) + + def txt_to_srt(self, lines_per_caption: int) -> None: + """ + Converts a text file to SRT (SubRip Text) format. + + This method reads a text file, tokenizes the text into sentences using the NLTK library, and writes the sentences into a new SRT file. Groups of sentences are combined into a single caption based on the 'lines_per_caption' parameter. Each group becomes a separate subtitle in the SRT file. The original text file is then deleted, and the filename attribute of the class instance is updated to the new SRT file. Finally, the SRT file is moved to the 'main_subs' directory. + + Args: + lines_per_caption (int): The number of sentences to include in each caption. + + """ + txt_file_path: str = path.join(self.working_space_temp, self.filename) + srt_file_path: str = txt_file_path.replace('.txt', '.srt') + + with open(txt_file_path, 'r', encoding='utf-8') as file: + text: str = file.read() + + sentences: List[str] = sent_tokenize(text) + + subs: SSAFile = SSAFile() + for i in range(0, len(sentences), lines_per_caption): + caption = ' '.join(sentences[i:i+lines_per_caption]).strip() + event: SSAEvent = SSAEvent(start=0, end=0, text=caption) + subs.append(event) + + with open(srt_file_path, 'w', encoding='utf-8') as file: + file.write(subs.to_string(format_='srt')) + + remove(txt_file_path) + + self.filename = self.filename.replace('.txt', '.srt') + self.move_srt() + + def convert_numbers_in_srt(self) -> None: + """ + Converts numbers in an SRT subtitle file to their word equivalents in Polish. + """ + srt_file_path: str = path.join( + self.working_space_temp_main_subs, self.filename) + + subs = load(srt_file_path, encoding='utf-8') + + number_in_words = NumberInWords() + for i, sub in enumerate(subs): + try: + sub.text = number_in_words.convert_numbers_in_text(sub.text) + except IndexError: + console.print( + f"[red_bold]Wystąpił błąd w napisie {i+1}:[/red_bold] {sub.text}.\n[red_bold]Pomijam ten napis.", style='white_bold') + + subs.save(srt_file_path) + + console.print( + "\nPrzekonwertowano liczby na słowa:", style='green_bold') + console.print(srt_file_path, '\n', style='white_bold') + + def srt_to_ass(self) -> None: + """ + This method updates the subtitles in an existing ASS file using the translated subtitles from an SRT file. + If the ASS file does not exist, the SRT file is moved to the output directory. + After these operations, the original ASS and SRT files are deleted. + """ + srt_file_path: str = path.join( + self.working_space_temp_alt_subs, self.filename) + ass_file_path: str = path.join( + self.working_space_temp_alt_subs, self.filename.replace('.srt', '.ass')) + output_file_path: str = path.join( + self.working_space_output, self.filename.replace('.srt', '.ass')) + + if stat(srt_file_path).st_size == 0: + return + + srt_subs = load(srt_file_path, encoding='utf-8') + + if path.exists(ass_file_path): + ass_subs = SSAFile.load(ass_file_path) + srt_index = 0 + for event in ass_subs.events: + if event.type == "Dialogue" and srt_index < len(srt_subs): + srt_lines = srt_subs[srt_index].text.split('\n') + ass_lines = event.text.split('}') + if len(ass_lines) >= len(srt_lines): + for j in range(len(srt_lines)): + last_brace_position = ass_lines[j].rfind('}') + if last_brace_position != -1: + ass_lines[j] = ass_lines[j][:last_brace_position + + 1] + srt_lines[j] + event.text = '}'.join(ass_lines) + srt_index += 1 + + ass_subs.save(output_file_path) + else: + output_file_path = output_file_path.replace('.ass', '.srt') + move(srt_file_path, output_file_path) + + console.print("Przeniesiono alternatywne napisy:", style="green_bold") + console.print(output_file_path, style="white_bold") + + if path.exists(srt_file_path): + remove(srt_file_path) + if path.exists(ass_file_path): + remove(ass_file_path) diff --git a/mm_avh_working_space/modules/subtitle_to_speech.py b/mm_avh_working_space/modules/subtitle_to_speech.py new file mode 100644 index 0000000000000000000000000000000000000000..dc045a6d17b239fdb7cce74ad998aa73b4e3e37b --- /dev/null +++ b/mm_avh_working_space/modules/subtitle_to_speech.py @@ -0,0 +1,539 @@ +""" + This module defines the 'SubtitleToSpeech' class, which converts subtitle files to speech audio files. + It supports multiple Text-to-Speech (TTS) services including Harpo, Balabolka, Edge, and ElevenLabs. + + * Usage: + To use this module, create an instance of the 'SubtitleToSpeech' class and call the 'generate_audio' method. + + * Example usage: + from subtitle_to_speech import SubtitleToSpeech + + # Create an instance of SubtitleToSpeech + converter = SubtitleToSpeech(filename="example.srt") + + # Generate audio + converter.generate_audio(settings) + + * Example usage: + if __name__ == '__main__': + converter = SubtitleToSpeech(filename="example.srt") + converter.generate_audio(settings) + + * Example usage: + if __name__ == '__main__': + if 'TTS - *Głos* - ElevenLans' in settings.tts: + audio_generator = SubtitleToSpeech(filename="") + audio_generator.srt_to_eac3_elevenlabs() # For Alt Subs +""" + +from dataclasses import dataclass +from msvcrt import getch +from os import listdir, path, remove +from subprocess import call, Popen +from threading import Thread +from time import sleep +import wave +from asyncio import create_task, gather, run +from typing import Dict, List, Optional + +import pyttsx3 +import pysrt +from edge_tts import Communicate +from pydub import AudioSegment +from pydub.utils import mediainfo + +from constants import (WORKING_SPACE, + WORKING_SPACE_OUTPUT, + WORKING_SPACE_TEMP, + WORKING_SPACE_TEMP_MAIN_SUBS, + WORKING_SPACE_TEMP_ALT_SUBS, + BALABOLKA_PATH, + FFMPEG_PATH, + console) +from data.settings import Settings + + +@dataclass(slots=True) +class SubtitleToSpeech: + """ + This class provides methods to convert subtitle files to speech audio files. + + Attributes: + - filename (str): The name of the subtitle file to convert. + - working_space (str): The path to the working directory. + - working_space_output (str): The path to the output directory. + - working_space_temp (str): The path to the temporary directory. + - working_space_temp_main_subs (str): The path to the main subtitles directory. + - working_space_temp_alt_subs (str): The path to the alternative subtitles directory. + - balabolka_path (str): The path to the Balabolka executable. + - ffmpeg_path (str): The path to the FFmpeg executable. + + Methods: + - ansi_srt(self) -> None: + Converts the encoding of the subtitle file to ANSI. + + - srt_to_wav_harpo(self, tts_speed: str, tts_volume: str) -> None: + Converts the subtitle file to a WAV audio file using Harpo TTS. + + - srt_to_wav_balabolka(self, tts_speed: str, tts_volume: str) -> None: + Converts the subtitle file to a WAV audio file using Balabolka TTS. + + - srt_to_wav_edge_online(self, tts: str, tts_speed: str, tts_volume: str) -> None: + Converts the subtitle file to a WAV audio file using Edge TTS. + + - merge_tts_audio(self) -> None: + Merges the generated TTS audio files. + + - generate_audio(self, settings: Settings) -> None: + Generates the audio file from the subtitle file using the specified TTS settings. + + - srt_to_eac3_elevenlabs(self) -> None: + Opens the main_subs folder for the user to add audio files generated by ElevenLabs. + """ + + filename: str + working_space: str = WORKING_SPACE + working_space_output: str = WORKING_SPACE_OUTPUT + working_space_temp: str = WORKING_SPACE_TEMP + working_space_temp_main_subs: str = WORKING_SPACE_TEMP_MAIN_SUBS + working_space_temp_alt_subs: str = WORKING_SPACE_TEMP_ALT_SUBS + balabolka_path: str = BALABOLKA_PATH + ffmpeg_path: str = FFMPEG_PATH + + def ansi_srt(self) -> None: + """ + Converts the encoding of the subtitle file to ANSI. + + Raises: + - UnicodeDecodeError: If the file is not in UTF-8 encoding. + """ + try: + with open(path.join(self.working_space_temp_main_subs, self.filename), "r", encoding="utf-8") as source_file: + content: str = source_file.read() + except UnicodeDecodeError: + with open(path.join(self.working_space_temp_main_subs, self.filename), "r", encoding="ANSI") as source_file: + content: str = source_file.read() + + with open(path.join(self.working_space_temp_main_subs, self.filename), "w", encoding="ANSI", errors="ignore") as target_file: + target_file.write(content) + + console.print("Zamieniono kodowanie na ANSI:", + style='green_bold', end=' ') + console.print(self.filename) + + def srt_to_wav_harpo(self, tts_speed: str, tts_volume: str) -> None: + """ + Converts the subtitle file to a WAV audio file using Harpo TTS. + + Args: + - tts_speed (str): The speed of the TTS voice. + - tts_volume (str): The volume of the TTS voice. + """ + self.ansi_srt() + engine = self._init_engine(tts_speed, tts_volume) + subtitles: pysrt.SubRipFile = pysrt.open(path.join( + self.working_space_temp_main_subs, self.filename), encoding='ANSI') + output_file: str = path.splitext(path.join( + self.working_space_temp_main_subs, self.filename))[0] + '.wav' + self._generate_wav_file(engine, subtitles, output_file) + remove(path.join(self.working_space_temp, "temp.wav")) + + def _init_engine(self, tts_speed: str, tts_volume: str) -> pyttsx3.Engine: + """ + Initializes the TTS engine with the specified speed and volume. + + Args: + - tts_speed (str): The speed of the TTS voice. + - tts_volume (str): The volume of the TTS voice. + + Returns: + - pyttsx3.Engine: The initialized TTS engine. + """ + engine: pyttsx3.Engine = pyttsx3.init() + voices: List[pyttsx3.Voice] = engine.getProperty('voices') + for voice in voices: + if voice.name == 'Vocalizer Expressive Zosia Harpo 22kHz': + engine.setProperty('voice', voice.id) + engine.setProperty('rate', int(tts_speed)) + engine.setProperty('volume', float(tts_volume)) + return engine + + def _generate_wav_file(self, engine: pyttsx3.Engine, subtitles: pysrt.SubRipFile, output_file: str) -> None: + """ + Generates a WAV audio file from the given subtitles using the specified TTS engine. + + Args: + - engine (pyttsx3.Engine): The TTS engine to use for speech synthesis. + - subtitles (pysrt.SubRipFile): The subtitles to convert to speech. + - output_file (str): The path to the output WAV file. + """ + with wave.open(output_file, 'wb') as wav_file: + wav_file.setnchannels(1) # Mono + wav_file.setsampwidth(2) # 16-bit + wav_file.setframerate(22500) # 22kHz + + for i, subtitle in enumerate(subtitles, start=1): + print( + f"{i}\n{subtitle.start.to_time().strftime('%H:%M:%S.%f')[:-3]} --> {subtitle.end.to_time().strftime('%H:%M:%S.%f')[:-3]}\n{subtitle.text}\n") + start_time: float = subtitle.start.ordinal / 1000.0 + self._save_subtitle_to_wav(engine, subtitle.text) + self._add_empty_frame_if_needed(wav_file, start_time) + self._add_subtitle_to_wav(wav_file) + + def _save_subtitle_to_wav(self, engine: pyttsx3.Engine, text: str) -> None: + """ + Saves a single subtitle to a temporary WAV file. + + Args: + - engine (pyttsx3.Engine): The TTS engine to use for speech synthesis. + - text (str): The text of the subtitle to convert to speech. + """ + engine.save_to_file(text, path.join( + self.working_space_temp, "temp.wav")) + engine.runAndWait() + + def _add_empty_frame_if_needed(self, wav_file: wave.Wave_write, start_time: float) -> None: + """ + Adds an empty frame to the WAV file if the start time of the next subtitle is later than the current time in the audio. + + Args: + - wav_file (wave.Wave_write): The WAV file to add the empty frame to. + - start_time (float): The start time of the next subtitle. + """ + framerate: int = wav_file.getframerate() + nframes: int = wav_file.getnframes() + current_time: float = nframes / float(framerate) + if start_time > current_time: + empty_frame_duration: int = int( + (start_time - current_time) * framerate) + empty_frame: bytes = b'\x00' * empty_frame_duration * 2 + wav_file.writeframes(empty_frame) + + def _add_subtitle_to_wav(self, wav_file: wave.Wave_write) -> None: + """ + Adds a subtitle to the WAV file. + + Args: + - wav_file (wave.Wave_write): The WAV file to add the subtitle to. + """ + with wave.open(path.join(self.working_space_temp, "temp.wav"), 'rb') as temp_file: + data: bytes = temp_file.readframes(temp_file.getnframes()) + wav_file.writeframes(data) + + def srt_to_wav_balabolka(self, tts_speed: str, tts_volume: str) -> None: + """ + Converts the subtitle file to a WAV audio file using Balabolka TTS. + + Args: + - tts_speed (str): The speed of the TTS voice. + - tts_volume (str): The volume of the TTS voice. + """ + self.ansi_srt() + balcon_path: str = self.balabolka_path + file_path: str = path.join( + self.working_space_temp_main_subs, self.filename) + output_wav_path: str = path.join( + self.working_space_temp_main_subs, path.splitext(self.filename)[0] + ".wav") + command: List[str] = self._prepare_balabolka_command( + balcon_path, file_path, output_wav_path, tts_speed, tts_volume) + + command_thread: Thread = Thread( + target=call, args=(command,)) + command_thread.start() + + subtitles: pysrt.SubRipFile = pysrt.open(file_path, encoding='ANSI') + for subtitle in subtitles: + self.process_subtitle(subtitle) + + command_thread.join() + + def _prepare_balabolka_command(self, balcon_path: str, file_path: str, output_wav_path: str, tts_speed: str, tts_volume: str) -> List[str]: + """ + Prepares the command to run Balabolka TTS. + + Args: + - balcon_path (str): The path to the Balabolka executable. + - file_path (str): The path to the subtitle file. + - output_wav_path (str): The path to the output WAV file. + - tts_speed (str): The speed of the TTS voice. + - tts_volume (str): The volume of the TTS voice. + + Returns: + - List[str]: The prepared command. + """ + return [ + balcon_path, + "-fr", "48", + "-f", file_path, + "-w", output_wav_path, + "-n", "IVONA 2 Agnieszka", + "-s", tts_speed, + "-v", tts_volume + ] + + def process_subtitle(self, subtitle: pysrt.SubRipItem) -> None: + """ + Processes a single subtitle. + + Args: + - subtitle (pysrt.SubRipItem): The subtitle to process. + """ + i: int = subtitle.index + start_time: str = subtitle.start.to_time().strftime('%H:%M:%S.%f')[:-3] + end_time: str = subtitle.end.to_time().strftime('%H:%M:%S.%f')[:-3] + text: str = subtitle.text + print(f"{i}\n{start_time} --> {end_time}\n{text}\n") + sleep(0.02) + + async def generate_speech(self, subtitle: pysrt.SubRipItem, voice: str, output_file: str, rate: str, volume: str) -> None: + """ + Generates speech from a single subtitle using the specified TTS voice. + + Args: + - subtitle (pysrt.SubRipItem): The subtitle to convert to speech. + - voice (str): The TTS voice to use. + - output_file (str): The path to the output audio file. + - rate (str): The speed of the TTS voice. + - volume (str): The volume of the TTS voice. + """ + communicate = Communicate( + subtitle.text, voice, rate=rate, volume=volume) + await communicate.save(output_file) + + async def generate_wav_files(self, subtitles: pysrt.SubRipFile, voice: str, rate: str, volume: str) -> List[str]: + """ + Generates WAV audio files from the given subtitles using the specified TTS voice. + + Args: + - subtitles (pysrt.SubRipFile): The subtitles to convert to speech. + - voice (str): The TTS voice to use. + - rate (str): The speed of the TTS voice. + - volume (str): The volume of the TTS voice. + + Returns: + - List[str]: The paths to the generated WAV files. + """ + tasks = [] + mp3_files = [] + file_name = path.splitext(subtitles.path)[0] + for i, subtitle in enumerate(subtitles, start=1): + output_file = f"{file_name}_{i}.mp3" + mp3_files.append(output_file) + tasks.append(create_task(self.generate_speech( + subtitle, voice, output_file, rate, volume))) + if i % 50 == 0: + await gather(*tasks) + tasks = [] + sleep(2) + await gather(*tasks) + return mp3_files + + def merge_audio_files(self, mp3_files: List[str], subtitles: pysrt.SubRipFile, dir_path: str) -> None: + """ + Merges the given MP3 audio files into a single WAV file. + + Args: + - mp3_files (List[str]): The paths to the MP3 files to merge. + - subtitles (pysrt.SubRipFile): The subtitles corresponding to the audio files. + - dir_path (str): The directory where the audio files are located. + """ + file_name: str = path.splitext(subtitles.path)[0] + with wave.open(f"{file_name}.wav", 'wb') as wav_file: + wav_file.setnchannels(1) + wav_file.setsampwidth(2) + wav_file.setframerate(24000) + + for i, mp3_file in enumerate(mp3_files, start=1): + print( + f"{i}\n{subtitles[i-1].start.to_time().strftime('%H:%M:%S.%f')[:-3]} --> {subtitles[i-1].end.to_time().strftime('%H:%M:%S.%f')[:-3]}\n{subtitles[i-1].text}\n") + mp3_file_path: str = path.join(dir_path, mp3_file) + if path.isfile(mp3_file_path): + start_time: float = subtitles[i-1].start.ordinal / 1000.0 + sound: AudioSegment = AudioSegment.from_file( + mp3_file_path, format="mp3") + remove(mp3_file_path) + self._add_empty_frame_if_needed(wav_file, start_time) + sound_data: bytes = sound.raw_data + wav_file.writefqrames(sound_data) + + def srt_to_wav_edge_online(self, tts: str, tts_speed: str, tts_volume: str) -> None: + """ + Converts the subtitle file to a WAV audio file using Edge TTS. + + Args: + - tts (str): The TTS service to use. + - tts_speed (str): The speed of the TTS voice. + - tts_volume (str): The volume of the TTS voice. + """ + self.ansi_srt() + voice = "pl-PL-ZofiaNeural" if tts == "TTS - Zofia - Edge" else "pl-PL-MarekNeural" + + subtitles: pysrt.SubRipFile = pysrt.open(path.join( + self.working_space_temp_main_subs, self.filename), encoding='ANSI') + mp3_files: List[str] = run(self.generate_wav_files( + subtitles, voice, tts_speed, tts_volume)) + self.merge_audio_files(mp3_files, subtitles, + self.working_space_temp_main_subs) + + def merge_tts_audio(self) -> None: + """ + Merges the generated TTS audio files. + """ + main_subs_files_dict: Dict[str, str] = self._get_files_dict( + self.working_space_temp_main_subs) + tmp_files_dict: Dict[str, str] = self._get_files_dict( + self.working_space_temp) + + for file_name, main_subs_file in main_subs_files_dict.items(): + main_subs_file_path: str = path.join( + self.working_space_temp_main_subs, main_subs_file) + output_file: str = path.join( + self.working_space_output, file_name + ".eac3") + + if file_name in tmp_files_dict: + tmp_file: str = tmp_files_dict[file_name] + tmp_file_path: str = path.join( + self.working_space_temp, tmp_file) + + main_subs_file_duration: float = self._get_file_duration( + main_subs_file_path) + tmp_file_duration: float = self._get_file_duration( + tmp_file_path) + + input_file_1: str + input_file_2: str + if main_subs_file_duration > tmp_file_duration: + input_file_1, input_file_2 = main_subs_file_path, tmp_file_path + else: + input_file_1, input_file_2 = tmp_file_path, main_subs_file_path + + self._merge_files(input_file_1, input_file_2, output_file) + + remove(main_subs_file_path) + remove(tmp_file_path) + else: + self._convert_to_eac3(main_subs_file_path, output_file) + remove(main_subs_file_path) + self._remove_same_name_files( + self.working_space_temp_main_subs, file_name) + + def _get_files_dict(self, directory: str) -> Dict[str, str]: + """ + Gets a dictionary of the files in the given directory, excluding files with certain extensions. + + Args: + - directory (str): The directory to get the files from. + + Returns: + - Dict[str, str]: A dictionary of the files in the directory. + """ + excluded_extensions: List[str] = ["srt", "ass"] + return {path.splitext(f)[0]: f for f in listdir(directory) if path.splitext(f)[1][1:].lower() not in excluded_extensions} + + def _get_file_duration(self, file_path: str) -> float: + """ + Gets the duration of the file at the given path. + + Args: + - file_path (str): The path to the file. + + Returns: + - float: The duration of the file in seconds. + """ + return float(mediainfo(file_path)['duration']) + + def _merge_files(self, input_file_1: str, input_file_2: str, output_file: str): + """ + Merges two audio files into a single file. + + Args: + - input_file_1 (str): The path to the first input file. + - input_file_2 (str): The path to the second input file. + - output_file (str): The path to the output file. + """ + if 'main_subs' in input_file_1: + command: List[str] = [ + self.ffmpeg_path, + "-i", input_file_1, + "-i", input_file_2, + "-filter_complex", "[0:a]volume=7dB[a1];[a1][1:a]amix=inputs=2:duration=first", + output_file + ] + else: + command: List[str] = [ + self.ffmpeg_path, + "-i", input_file_1, + "-i", input_file_2, + "-filter_complex", "[1:a]volume=7dB[a1];[0:a][a1]amix=inputs=2:duration=first", + output_file + ] + call(command) + + def _convert_to_eac3(self, input_file: str, output_file: str): + """ + Converts an audio file to EAC3 format. + + Args: + - input_file (str): The path to the input file. + - output_file (str): The path to the output file. + """ + command: List[str] = [ + self.ffmpeg_path, + "-i", input_file, + "-c:a", "eac3", + output_file + ] + call(command) + + def _remove_same_name_files(self, directory: str, file_name: str): + """ + Removes files with the same name as the given file name from the specified directory. + + Args: + - directory (str): The directory to remove the files from. + - file_name (str): The name of the files to remove. + """ + for file in listdir(directory): + if path.splitext(file)[0] == file_name: + remove(path.join(directory, file)) + + def generate_audio(self, settings: Settings): + """ + Generates the audio file from the subtitle file using the specified TTS settings. + + Args: + - settings (Settings): The TTS settings to use. + """ + tts: Optional[str] = settings.tts + tts_speed: Optional[str] = settings.tts_speed + tts_volume: Optional[str] = settings.tts_volume + + console.print("Rozpoczynam generowanie pliku audio...", + style='green_bold', end=' ') + console.print(self.filename, style='white_bold') + if tts == "TTS - Zosia - Harpo": + self.srt_to_wav_harpo(tts_speed, tts_volume) + elif tts == "TTS - Agnieszka - Ivona": + self.srt_to_wav_balabolka(tts_speed, tts_volume) + elif tts in ["TTS - Zofia - Edge", "TTS - Marek - Edge"]: + self.srt_to_wav_edge_online(tts, tts_speed, tts_volume) + console.print( + "Generowanie pliku audio zakończone.", style='green_bold') + + self.merge_tts_audio() + + def srt_to_eac3_elevenlabs(self) -> None: + """ + Opens the main_subs folder for the user to add audio files generated by ElevenLabs. + """ + Popen(['explorer', path.realpath(self.working_space_temp_main_subs)]) + + console.print("\nWygeneruj pliki audio z plików .srt za pomocą 11Labs_TTS_Colab,\na następnie dodaj je do folderu main_subs.", + style='yellow_bold') + console.print( + "11Labs_TTS_Colab: https://github.com/MattyMroz/11Labs_TTS_Colab", style='yellow_bold') + console.print( + "\n[green_italic]Naciśnij dowolny klawisz, aby kontynuować...", end=' ') + getch() + console.print() + self.merge_tts_audio() diff --git a/mm_avh_working_space/modules/translator.py b/mm_avh_working_space/modules/translator.py new file mode 100644 index 0000000000000000000000000000000000000000..ef97a9b01d1521d6ba4687f55cb05e4c06a3bddf --- /dev/null +++ b/mm_avh_working_space/modules/translator.py @@ -0,0 +1,374 @@ +""" + The SubtitleTranslator class is this module is used for translating subtitles from one language to another. + TThe target language is Polish in methods throughout the class + + * Example: Frist create an instance of the SubtitleTranslator class: + subtitle_tool = SubtitleTranslator() + + * Example usage for translating subtitles using Google Translate: + subtitle_tool.translate_google("sample_subtitle.srt", "/path/to/directory", 100) + + * Example usage for translating subtitles using the DeepL API: + subtitle_tool.translate_deepl_api("sample_subtitle.srt", "/path/to/directory", 100, "your_deepl_api_key") + + * Example usage for translating subtitles using the desktop version of DeepL: + subtitle_tool.translate_deepl_desktop("sample_subtitle.srt", "/path/to/directory", 100) + + * Example usage for translating subtitles using Google Translate and ChatGPT: + subtitle_tool.translate_google_gpt("sample_subtitle.srt", "/path/to/directory", 100, "your_chat_gpt_access_token") + + * Example usage for translating subtitles using ChatGPT: + subtitle_tool.translate_chat_gpt("sample_subtitle.srt", "/path/to/directory", 100, "your_chat_gpt_access_token") + + * Example usage for selecting the appropriate translation method based on the settings and translating the subtitles: + Settings.change_settings_save_to_file() + settings = Settings.load_from_file() | (Settings(translator="Google Translate", translated_line_count="100")) + subtitle_tool.translate_srt("sample_subtitle.srt", "/path/to/directory", settings) +""" + +import re +from dataclasses import dataclass +from os import environ, path, remove +from subprocess import call +from time import sleep +from typing import List, Optional + +import deepl +import pyautogui +import pyperclip +import pysrt +from googletrans import Translator + +from constants import console +from data.settings import Settings + + +@dataclass(slots=True) +class SubtitleTranslator: + """ + The SubtitleTranslator class is used for translating subtitles from one language to another. + + Attributes: + None + + Methods: + - translate_google(filename: str, dir_path: str, translated_line_count: int, is_combined_with_gpt: bool = False) -> pysrt.SubRipFile: + Translates subtitles using Google Translate. + + - translate_deepl_api(filename: str, dir_path: str, translated_line_count: int, deepl_api_key: str) -> None: + Translates subtitles using the DeepL API. + + - translate_deepl_desktop(filename: str, dir_path: str, translated_line_count: int) -> None: + Translates subtitles using the desktop version of DeepL. + + - translate_google_gpt(filename: str, dir_path: str, translated_line_count: int, chat_gpt_access_token: str) -> None: + Translates subtitles using Google Translate and ChatGPT. + + - translate_chat_gpt(filename: str, dir_path: str, translated_line_count: int, chat_gpt_access_token: str, translated_subs: Optional[pysrt.SubRipFile] = None) -> None: + Translates subtitles using ChatGPT. + + - translate_srt(filename: str, dir_path: str, settings: Settings) -> None: + Selects the appropriate translation method based on the settings and translates the subtitles. + """ + + @staticmethod + def translate_google(filename: str, dir_path: str, translated_line_count: int, is_combined_with_gpt: bool = False) -> pysrt.SubRipFile: + """ + Translates subtitles using Google Translate. + + Args: + - filename (str): The name of the subtitle file. + - dir_path (str): The directory path of the subtitle file. + - translated_line_count (int): The number of lines to translate at a time. + - is_combined_with_gpt (bool, optional): Whether to combine with GPT for translation. Defaults to False. + + Returns: + - pysrt.SubRipFile: The translated subtitle file. + """ + subs: pysrt.SubRipFile = pysrt.open( + path.join(dir_path, filename), encoding='utf-8') + subs_combined: List[str] = [] + translated_subs: List[str] = [] + + translator: Translator = Translator() + for i, sub in enumerate(subs): + sub.text = sub.text.replace("\n", " ◍ ") + subs_combined.append(sub.text) + + if (i + 1) % translated_line_count == 0 or i == len(subs) - 1: + combined_text: str = "\n".join(subs_combined) + translated_text: str = translator.translate( + combined_text, dest='pl').text + translated_subs += translated_text.split("\n") + subs_combined = [] + + for i, sub in enumerate(subs): + sub.text = translated_subs[i] + sub.text = sub.text.replace(" ◍, ", ",\n") + sub.text = sub.text.replace(" ◍ ", "\n") + sub.text = sub.text.replace(" ◍", "") + + if is_combined_with_gpt: + translated_filename: str = filename.replace( + '.srt', '_translated_temp.srt') + subs.save(path.join(dir_path, translated_filename)) + return subs + subs.save(path.join(dir_path, filename)) + + @staticmethod + def translate_deepl_api(filename: str, dir_path: str, translated_line_count: int, deepl_api_key: str) -> None: + """ + Translates subtitles using the DeepL API. + + Args: + - filename (str): The name of the subtitle file. + - dir_path (str): The directory path of the subtitle file. + - translated_line_count (int): The number of lines to translate at a time. + - deepl_api_key (str): The API key for the DeepL translator. + """ + subs: pysrt.SubRipFile = pysrt.open( + path.join(dir_path, filename), encoding='utf-8') + translator: deepl.Translator = deepl.Translator(deepl_api_key) + groups: List[List[pysrt.SubRipItem]] = [subs[i:i+translated_line_count] + for i in range(0, len(subs), translated_line_count)] + for group in groups: + text: str = " @@\n".join(sub.text.replace("\n", " ◍◍◍◍ ") + for sub in group) + translated_text: str = translator.translate_text( + text, target_lang='PL').text + translated_texts: List[str] = translated_text.split(" @@\n") + if len(translated_texts) == len(group): + for i in range(len(group)): + if i < len(translated_texts): + group[i].text = translated_texts[i] + group[i].text = group[i].text.replace(" ◍◍◍◍, ", ",\n") + group[i].text = group[i].text.replace(" ◍◍◍◍ ", "\n") + group[i].text = group[i].text.replace(" ◍◍◍◍", "") + subs.save(path.join(dir_path, filename), encoding='utf-8') + + @staticmethod + def translate_deepl_desktop(filename: str, dir_path: str, translated_line_count: int) -> None: + """ + Translates subtitles using the desktop version of DeepL. + + Args: + - filename (str): The name of the subtitle file. + - dir_path (str): The directory path of the subtitle file. + - translated_line_count (int): The number of lines to translate at a time. + """ + command: str = path.join( + environ['APPDATA'], 'Programs', 'Zero Install', '0install-win.exe') + args: List[str] = ["run", "--no-wait", + "https://appdownload.deepl.com/windows/0install/deepl.xml"] + call([command] + args) + + sleep(7) + + def auto_steps(): + screen_width, screen_height = pyautogui.size() + x_coordinate = screen_width * 0.25 + y_coordinate = screen_height * 0.5 + pyautogui.moveTo(x_coordinate, y_coordinate) + pyautogui.click() + pyautogui.hotkey('ctrl', 'a') + pyautogui.hotkey('del') + pyautogui.hotkey('ctrl', 'v') + sleep(6) + x_coordinate = screen_width * 0.75 + pyautogui.moveTo(x_coordinate, y_coordinate) + pyautogui.click() + pyautogui.hotkey('ctrl', 'a') + pyautogui.hotkey('ctrl', 'c') + + subs: pysrt.SubRipFile = pysrt.open( + path.join(dir_path, filename), encoding='utf-8') + groups: List[List[pysrt.SubRipItem]] = [subs[i:i+translated_line_count] + for i in range(0, len(subs), translated_line_count)] + + for group in groups: + text: str = " @@\n".join(sub.text.replace("\n", " ◍◍◍◍ ") + for sub in group) + text = text.rstrip('\n') + pyperclip.copy(text) + auto_steps() + + translated_text: str = pyperclip.paste() + if translated_text: + for sub, trans_text in zip(group, translated_text.split(" @@\n")): + sub.text = trans_text.replace(" ◍◍◍◍, ", ",\n") + sub.text = trans_text.replace(" ◍◍◍◍ ", "\n") + sub.text = trans_text.replace(" ◍◍◍◍", "") + pyautogui.hotkey('alt', 'f4') + + subs.save(path.join(dir_path, filename), encoding='utf-8') + + frezes: List[str] = ["\nPrzetłumaczono z www.DeepL.com/Translator (wersja darmowa)\n", + "Przetłumaczono z www.DeepL.com/Translator (wersja darmowa)", + "\nTranslated with www.DeepL.com/Translator (free version)\n", + "\nTranslated with www.DeepL.com/Translator (free version)"] + + with open(path.join(dir_path, filename), 'r', encoding='utf-8') as in_file: + text: str = in_file.read() + + for freze in frezes: + text = text.replace(freze, "") + + with open(path.join(dir_path, filename), 'w', encoding='utf-8') as out_file: + out_file.write(text) + + def translate_google_gpt(self, filename: str, dir_path: str, translated_line_count: int, chat_gpt_access_token: str) -> None: + """ + Translates subtitles using Google Translate and ChatGPT. + + Args: + - filename (str): The name of the subtitle file. + - dir_path (str): The directory path of the subtitle file. + - translated_line_count (int): The number of lines to translate at a time. + - chat_gpt_access_token (str): The access token for ChatGPT. + """ + translated_subs: pysrt.SubRipFile = SubtitleTranslator.translate_google( + filename, dir_path, translated_line_count, is_combined_with_gpt=True) + self.translate_chat_gpt( + filename, dir_path, translated_line_count, chat_gpt_access_token, translated_subs) + remove(path.join(dir_path, filename.replace( + '.srt', '_translated_temp.srt'))) + + def translate_chat_gpt(self, filename: str, dir_path: str, translated_line_count: int, chat_gpt_access_token: str, translated_subs: Optional[pysrt.SubRipFile] = None): + """ + Translates subtitles using ChatGPT. (NOT API ? NOT ACCESS TOKEN - if chatGPT Online = 4 YES) + + Args: + - filename (str): The name of the subtitle file. + - dir_path (str): The directory path of the subtitle file. + - translated_line_count (int): The number of lines to translate at a time. + - chat_gpt_access_token (str): The access token for ChatGPT. + - translated_subs (Optional[pysrt.SubRipFile], optional): The translated subtitles. Defaults to None. + """ + subs: pysrt.SubRipFile = pysrt.open( + path.join(dir_path, filename), encoding='utf-8') + groups: List[List[pysrt.SubRipItem]] = [subs[i:i+translated_line_count] + for i in range(0, len(subs), translated_line_count)] + + additional_info: str = "" + while True: + console.print( + "Uwagi odnośnie tłumaczenia / dodatkowe informacje o tłumaczonym tekście (opcjonalnie): ", style='green_bold') + info: str = input(">>> ") + if not info: + break + additional_info += info + ", " + + counter: int = 1 + for group in groups: + text: str = "" + for sub in group: + text += "◍◍{}. {}".format(counter, + sub.text.replace('\n', ' ◍◍◍◍ ')) + " @@\n" + counter += 1 + text = text.rstrip(' @@\n') + + # For programming convenience, writing the ◍ character and reading it promt in the code + prompt: str = """WAŻNE: JEŚLI OTRZYMASZ NAPISY OD 1 DO 30, ZWRÓĆ NAPISY OD 1 DO 30, NAWET JEŚLI TŁUMACZENIE JEST NIEODPOWIEDNIE, NIESPÓJNE LUB ZŁE. NIEKOMPLETNE TŁUMACZENIE JEST LEPSZE NIŻ BRAK TŁUMACZENIA. + +Jesteś moim tłumaczem, specjalizującym się w przekładach na język polski. Twoja rola nie ogranicza się do prostego tłumaczenia - jesteś również redaktorem i ulepszaczem języka. Komunikuję się z Tobą w różnych językach, a Twoim zadaniem jest identyfikowanie języka, tłumaczenie go i odpowiadanie poprawioną i ulepszoną wersją mojego tekstu, w języku polskim. + +Przed przystąpieniem do tłumaczenia, poświęć chwilę na zrozumienie gramatycznych, językowych i kontekstualnych niuansów tekstu. Uchwyć subtelności i upewnij się, że tekst płynie jak strumień słów, jakby ktoś nam opowiadał historię, czytał audiobooka, czy narrację filmu, bo ostatecznie ten tekst będzie czytany na gł + +Twoim zadaniem jest podniesienie poziomu mojego języka, zastępując uproszczone słowa i zdania na poziomie C0 bardziej wyszukanymi i eleganckimi wyrażeniami. Zachowaj oryginalne znaczenie, ale uczyń język bardziej literackim. Twoje odpowiedzi powinny ograniczać się do poprawionego i ulepszonego tłumaczenia, bez dodatkowych wyjaśnień. + +Podczas tłumaczenia, zachowaj dyskrecję w decydowaniu, kiedy tłumaczyć słowa dosłownie, a kiedy zachować zapożyczenia w ich oryginalnej formie. Unikaj używania polskich odpowiedników, które zniekształcają znaczenie lub estetykę zdania. + +Zachowaj oryginalne formatowanie tekstu - nie dodawaj żadnych dodatkowych spacji, tabulatorów ani znaków nowej linii. Tekst, który tłumaczysz, może również przedstawiać akcje z książki, więc miej to na uwadze. + +Podejdź globalnie do tekstu. Jeśli gdziekolwiek w tekście podano informacje o płci postaci, użyj tych informacji, aby kierować swoim tłumaczeniem przez cały tekst. Na przykład, zamiast tłumaczyć "I did it" jako "Zrobiłem to" lub "Zrobiłam to", przetłumacz to jako "To zostało zrobione przeze mnie", jeśli płeć nie jest określona. To podejście zmniejsza błędy tłumaczenia. Globalne podejście, nie tłumacz iteracyjnie słowo po słowie, na przykład: "Święty Tyris przegrał. Ona umarła.", gdzie poprawnie to: "Święta Tyris przegrała. Ona umarła." + +Jeśli płeć osoby mówiącej nie jest podana wcześniej, lub nie masz kontekstu, do którego możesz się odnieść, to użyj zdania w stronie BIERNEJ, np. "Zostało zrobione przeze mnie" zamiast "Zrobiłem to", np. "I'm sure..." na "Na pewno..." zamiast błędnego "Jestem pewny/pewna...". W ostateczności możesz użyć formy niebinarnej jejgo w odniesieniu do innej osoby. + +Bądź kreatywny w swoich tłumaczeniach, dostosowując swój ton do kontekstu - bądź dowcipny dla lekkich tekstów i dodaj powagi i profesjonalizmu dla poważnych. Tłumacz wszystkie przekleństwa, nie cenzuruj i nie zmieniaj znaczenia słów, które są ważne w kontekście lub które zmieniają emocjonalny ton tekstu. + +Mając znaki ◍◍◍◍, @@ lub '◍◍[num]. nie zmieniaj ich, nie modyfikuj struktury, ani ułożenia tekstu. Nie usuwaj ani nie dodawaj żadnych znaków interpunkcyjnych, ani nie zmieniaj ich położenia. Te znaki to świętość, nie zmieniaj ich. Nie musisz wiedzieć, co one znaczą, ale musisz je zachować, w tym samym miejscu, w którym się znajdują. Nie łącz zdań z 2 napisów w jeden napis - każdy napis musi być oddzielny. + +W tekście symbol '◍◍◍◍' reprezentuje nową linię w tym samym napisie, a symbol '@@' reprezentuje koniec napisu. Nie zmieniaj ilości znaków '@@'. Nie zmieniaj ilości numeracji napisów '◍◍1.', zwracaj taką samą ilość wszystkich tych znaków, jak w oryginalnym tekście. + +Twoim ostatecznym celem jest wyprodukowanie tłumaczenia, które jest jak najbardziej wiernie odwzorowane na oryginał, zarówno pod względem znaczenia, jak i poprawności gramatycznej i syntaktycznej, chyba że oryginał jest niegramatyczny. + +Zadanie wykonuj powoli krok po kroku + +Dodatkowe uwagi odnośnie tłumaczenia / dodatkowe informacje o tłumaczonym tekście: """ + additional_info + "\n\nTeraz przetłumacz poniższe napisy:\n" + text + + if translated_subs is not None: + translated_text: str = "".join( + "◍◍{}. {}".format( + i + 1, translated_subs[i].text.replace('\n', ' ◍◍◍◍ ') + ) + + " @@\n" + for i in range((counter - 1) - len(group), counter - 1) + ) + translated_text = translated_text.rstrip(' @@\n') + prompt += "\n\nNapisy zostały wstępnie przetłumaczone przez Google Translate. Są one dostarczone w celu rozszerzenia zakresu słownictwa. Proszę nie kopiować ani nie przepisywać tego tłumaczenia wraz z zawartymi w nim formami gramatycznymi i technikami tłumaczeniowymi. Przetłumaczone napisy:\n" + translated_text + + pyperclip.copy(prompt) + + console.print( + "Skopiuj przetłumaczony text do schowka.", style='yellow_bold') + console.print( + "[green_italic]Naciśnij dowolny klawisz, gdy skończysz tłumaczyć...", end='') + input() + + translated_text: str = pyperclip.paste().rstrip(" @@") + if translated_text: + translated_lines: List[str] = translated_text.replace( + '\r\n', '\n').split(" @@\n") + for i, line in enumerate(translated_lines): + translated_lines[i] = line + if len(translated_lines) != len(group): + console.print( + f"Błąd: liczba napisów po tłumaczeniu ({len(translated_lines)}) nie jest taka sama jak przed tłumaczeniem ({len(group)})", style='red_bold') + for sub, trans_text in zip(group, translated_lines): + trans_text = re.sub(r"◍◍\d+\. ", "", trans_text) + trans_text = trans_text.replace(" ◍◍◍◍, ", ",\n") + trans_text = trans_text.replace(" ◍◍◍◍ ", "\n") + trans_text = trans_text.replace(" ◍◍◍◍", "") + sub.text = trans_text + + subs.save(path.join(dir_path, filename), encoding='utf-8') + + def translate_srt(self, filename: str, dir_path: str, settings: Settings) -> None: + """ + Selects the appropriate translation method based on the settings and translates the subtitles. + + Args: + - filename (str): The name of the subtitle file. + - dir_path (str): The directory path of the subtitle file. + - settings (Settings): The settings for the translation. + """ + translator: str = settings.translator + translated_line_count: int = int(settings.translated_line_count) + deepl_api_key: str = settings.deepl_api_key + + console.print( + f"[green_italic]Tłumaczenie napisów za pomocą {translator}...") + console.print(path.join(dir_path, filename), '\n', style='white_bold') + + translator_functions = { + 'Google Translate': lambda *args: + SubtitleTranslator.translate_google(*args[:3]), + 'DeepL API': lambda *args: + SubtitleTranslator.translate_deepl_api( + *args[:3], deepl_api_key), + 'DeepL Desktop Free': lambda *args: + SubtitleTranslator.translate_deepl_desktop(*args[:3]), + 'ChatGPT': lambda *args: + self.translate_chat_gpt( + *args[:3], settings.chat_gpt_access_token), + 'ChatGPT + Google Translate': lambda *args: + self.translate_google_gpt( + *args[:3], settings.chat_gpt_access_token), + } + + if translator in translator_functions: + translator_functions[translator]( + filename, dir_path, translated_line_count) + else: + console.print( + f"Nieznany translator: {translator}", style='red_bold') diff --git a/mm_avh_working_space/requirements.txt b/mm_avh_working_space/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..b28ae2078f6868e6c3639d03dcb77edfb78abf2b --- /dev/null +++ b/mm_avh_working_space/requirements.txt @@ -0,0 +1,15 @@ +deepl +edge_tts +googletrans==3.1.0a0 +natsort +nltk +pyasstosrt +pyautogui +pydub +pyperclip +pysrt +pysubs2 +pyttsx3 +revChatGPT +rich +six \ No newline at end of file diff --git a/mm_avh_working_space/start.py b/mm_avh_working_space/start.py new file mode 100644 index 0000000000000000000000000000000000000000..1f89865594b3084e5e4fab8ee444f2d9d8ff75c5 --- /dev/null +++ b/mm_avh_working_space/start.py @@ -0,0 +1,411 @@ +from msvcrt import getch +from os import listdir, makedirs, path +from shutil import rmtree +from typing import Dict, List + +from natsort import natsorted + +from constants import (WORKING_SPACE, + WORKING_SPACE_OUTPUT, + WORKING_SPACE_TEMP, + WORKING_SPACE_TEMP_MAIN_SUBS, + WORKING_SPACE_TEMP_ALT_SUBS, + console) + +from data.settings import Settings + +from modules.mkvtoolnix import MkvToolNix +from modules.subtitle import SubtitleRefactor +from modules.subtitle_to_speech import SubtitleToSpeech +from modules.translator import SubtitleTranslator +from modules.mkv_processing import MKVProcessing + +from utils.cool_animation import CoolAnimation +from utils.execution_timer import execution_timer + + +def check_and_create_directories(directories: List[str]): # ✅ + """ + Checks if the given directories exist, and if not, creates them. + + Args: + directories (List[str]): A list of directory paths to check and create. + """ + for directory in directories: + if not path.exists(directory): + makedirs(directory) + + +def display_logo(): # ✅ + """ + Displays the logo of the application using the CoolAnimation class. + """ + mm_avh_logo: CoolAnimation = CoolAnimation() + mm_avh_logo.display() + console.print( + '╚═══ Multimedia Magic – Audio Visual Heaven ═══╝\n', style='white_bold') + + +def ask_user(question: str) -> bool: + """ + Asks the user a yes/no question and returns the response. + + Args: + question (str): The question to ask the user. + + Returns: + bool: True if the user answers yes, False otherwise. + """ + console.print(question, style='bold green', end=' ') + return input().lower() in ('t', 'y') + + +def update_settings() -> Settings: # ✅ + """ + Asks the user if they want to update the settings. If yes, updates the settings and saves them to a file. + + Returns: + Settings: The updated settings. + """ + if ask_user('💾 Czy chcesz zmienić ustawienia? (T lub Y - tak):'): + Settings.change_settings_save_to_file() + console.print('Zapisano ustawienia.\n', style='green_bold') + else: + console.print('Pomijam tę opcję.\n', style='red_bold') + return Settings.load_from_file() + + +def extract_tracks_from_mkv(): # ✅ + """ + Asks the user if they want to extract tracks from MKV files. If yes, extracts the tracks. + """ + if ask_user('🧲 Czy chcesz wyciągnąć ścieżki z plików mkv? (T lub Y - tak):'): + files: List[str] = get_mkv_files(WORKING_SPACE) + sorted_files: List[str] = natsorted(files) + for filename in sorted_files: + mkv: MkvToolNix = MkvToolNix(filename) + mkv.mkv_extract_track(mkv.get_mkv_info()) + else: + console.print('Pomijam tę opcję.\n', style='red_bold') + + +def get_mkv_files(directory: str) -> List[str]: + """ + Gets all MKV files in a directory. + + Args: + directory (str): The directory to search for MKV files. + + Returns: + List[str]: A list of MKV files in the directory. + """ + return [file for file in listdir(directory) + if path.isfile(path.join(directory, file)) and file.endswith('.mkv')] + + +def refactor_subtitles(): # ✅ + """ + Refactors subtitles in various formats to a standard format. + """ + subtitle_extensions: List[str] = [ + '.sup', '.txt', '.ogg', + '.ssa', '.ass', '.srt', + '.sub', '.usf', '.vtt', + ] + + files: List[str] = get_files_with_extensions( + WORKING_SPACE_TEMP, subtitle_extensions) + sorted_files = natsorted(files) + for filename in sorted_files: + refactor_subtitle_file(filename) + + +def get_files_with_extensions(directory: str, extensions: List[str]) -> List[str]: + """ + Gets all files in a directory with certain extensions. + + Args: + directory (str): The directory to search for files. + extensions (List[str]): The extensions to look for. + + Returns: + List[str]: A list of files in the directory with the specified extensions. + """ + return [ + file for file in listdir(directory) + if ( + path.isfile(path.join(directory, file)) and + any(file.endswith(ext) for ext in extensions) + ) + ] + + +def refactor_subtitle_file(filename: str): + """ + Refactors a subtitle file to a standard format. + + Args: + filename (str): The name of the subtitle file to refactor. + """ + subtitle: SubtitleRefactor = SubtitleRefactor(filename) + if filename.endswith('.ass') or filename.endswith('.ssa'): + subtitle.split_ass() + subtitle.ass_to_srt() + if filename.endswith('.srt'): + subtitle.move_srt() + if filename.endswith('.txt'): + subtitle.txt_to_srt(10) + + +def translate_subtitles(settings: Settings): # ✅ + """ + Asks the user if they want to translate subtitle files. If yes, translates the files. + + Args: + settings (Settings): The settings to use for translation. + """ + if not ask_user('💭 Czy chcesz tłumaczyć pliki napisów? (T lub Y - tak):'): + console.print('Pomijam tę opcję.\n', style='red_bold') + return + + main_subs_files = get_srt_files(WORKING_SPACE_TEMP_MAIN_SUBS) + files_to_translate = ask_to_translate_files(main_subs_files) + translate_files(files_to_translate, settings) + + +def get_srt_files(directory: str) -> List[str]: + """ + Gets all SRT files in a directory. + + Args: + directory (str): The directory to search for SRT files. + + Returns: + List[str]: A list of SRT files in the directory. + """ + return [ + filename for filename in listdir(directory) + if path.isfile(path.join(directory, filename)) and filename.endswith('.srt') + ] + + +def ask_to_translate_files(files: List[str]) -> dict: + """ + Asks the user which files they want to translate. + + Args: + files (List[str]): A list of files to ask about. + + Returns: + dict: A dictionary mapping file names to a boolean indicating whether the user wants to translate them. + """ + files_to_translate: dict = {} + for filename in files: + console.print("\nTŁUMACZENIE PLIKU:", style='yellow_bold') + console.print(filename, style='white_bold') + if ask_user("Czy chcesz przetłumaczyć (T lub Y - tak):"): + files_to_translate[filename] = True + else: + console.print('Pomijam tę opcję.\n', style='red_bold') + files_to_translate[filename] = False + return files_to_translate + + +def translate_files(files_to_translate: dict, settings: Settings): + """ + Translates the specified files. + + Args: + files_to_translate (dict): A dictionary mapping file names to a boolean indicating whether to translate them. + settings (Settings): The settings to use for translation. + """ + translator_instance: SubtitleTranslator = SubtitleTranslator() + for filename, should_translate in files_to_translate.items(): + if should_translate: + translator_instance.translate_srt(filename, + WORKING_SPACE_TEMP_MAIN_SUBS, + settings) + if path.exists(path.join(WORKING_SPACE_TEMP_ALT_SUBS, filename)): + translator_instance.translate_srt(filename, + WORKING_SPACE_TEMP_ALT_SUBS, + settings) + + +def convert_numbers_to_words(): # ✅ + """ + Asks the user if they want to convert numbers to words in the text. If yes, performs the conversion. + """ + if not ask_user('🔢 Czy chcesz przekonwertować liczby na słowa w tekście? (T lub Y - tak):'): + console.print('Pomijam tę opcję.\n', style='red_bold') + return + + srt_files = get_srt_files(WORKING_SPACE_TEMP_MAIN_SUBS) + convert_numbers_in_files(srt_files) + + +def get_srt_files(directory: str) -> List[str]: + """ + Gets all SRT files in a directory. + + Args: + directory (str): The directory to search for SRT files. + + Returns: + List[str]: A list of SRT files in the directory. + """ + return [ + file for file in listdir(directory) + if path.isfile(path.join(directory, file)) and file.endswith('.srt') + ] + + +def convert_numbers_in_files(files: List[str]): + """ + Converts numbers to words in the specified files. + + Args: + files (List[str]): A list of files to convert numbers in. + """ + for filename in files: + console.print( + "\nKONWERSJA LICZB (BEZ POPRAWNOŚCI GRAMATYCZNEJ) W PLIKU:", style='yellow_bold') + console.print(filename, style='white_bold') + if ask_user("Czy chcesz przekonwertować liczby na słowa w tym pliku? (T lub Y - tak):"): + subtitle: SubtitleRefactor = SubtitleRefactor(filename) + subtitle.convert_numbers_in_srt() + else: + console.print(f'Pomijam plik {filename}.\n', style='red_bold') + + +def generate_audio_for_subtitles(settings: Settings) -> None: # ✅ + """ + Asks the user if they want to generate audio for subtitles. If yes, generates the audio. + + Args: + settings (Settings): The settings to use for audio generation. + """ + if not ask_user('🎤 Czy chcesz generować audio dla napisów? (T lub Y - tak):'): + console.print('Pomijam tę opcję.\n', style='red_bold') + return + + main_subs_files: List[str] = get_srt_files(WORKING_SPACE_TEMP_MAIN_SUBS) + files_to_generate_audio: Dict[str, bool] = ask_to_generate_audio_files( + main_subs_files) + generate_audio_files(files_to_generate_audio, settings) + + +def ask_to_generate_audio_files(files: List[str]) -> Dict[str, bool]: + """ + Asks the user which files they want to generate audio for. + + Args: + files (List[str]): A list of files to ask about. + + Returns: + dict: A dictionary mapping file names to a boolean indicating whether the user wants to generate audio for them. + """ + files_to_generate_audio: Dict[str, bool] = {} + for filename in files: + console.print("\nGENEROWANIE AUDIO DLA PLIKU:", style='yellow_bold') + console.print(filename, style='white_bold') + if ask_user("Czy chcesz wygenerować audio dla tego pliku? (T lub Y - tak):"): + files_to_generate_audio[filename] = True + else: + console.print('Pomijam tę opcję.', style='red_bold') + files_to_generate_audio[filename] = False + return files_to_generate_audio + + +def generate_audio_files(files_to_generate_audio: Dict[str, bool], settings: Settings) -> None: + """ + Generates audio for the specified files. + + Args: + files_to_generate_audio (Dict[str, bool]): A dictionary mapping file names to a boolean indicating whether the user wants to generate audio for them. + settings (Settings): The settings to use for audio generation. + """ + audio_generator: SubtitleToSpeech + if 'TTS - *Głos* - ElevenLans' in settings.tts: + audio_generator = SubtitleToSpeech('') + audio_generator.srt_to_eac3_elevenlabs() + else: + for filename, should_generate_audio in files_to_generate_audio.items(): + if should_generate_audio: + audio_generator = SubtitleToSpeech(filename) + audio_generator.generate_audio(settings) + + +def refactor_alt_subtitles(): # ✅ + """ + Refactors alternative subtitles to a standard format. + """ + files: List[str] = get_srt_files(WORKING_SPACE_TEMP_ALT_SUBS) + sorted_files = natsorted(files) + for filename in sorted_files: + subtitle: SubtitleRefactor = SubtitleRefactor(filename) + subtitle.srt_to_ass() + + +def process_output_files(settings: Settings): + """ + Processes output files based on user settings. + + Args: + settings (Settings): The settings to use for processing. + """ + files = listdir(WORKING_SPACE_OUTPUT) + files_dict = {path.splitext(file)[0]: [] for file in files} + for file in files: + if not file.endswith(('.mkv', '.mp4')): + files_dict[path.splitext(file)[0]].append(file) + + for base_name, files in files_dict.items(): + if len(files) > 0: + # https://trac.ffmpeg.org/wiki/Encode/H.264 + # crf_value => 0 ... 18 ... 23 ... 51 ... :( + # preset_value => 'ultrafast', 'superfast', 'veryfast', 'faster', 'fast', 'medium', 'slow', 'slower', 'veryslow', 'placebo' + subtitle_processor = MKVProcessing(filename=base_name, + crf_value='18', + preset_value='medium') + subtitle_processor.process_mkv(settings) + + +def clear_temp_folders(): + """ + Clears temporary folders used during processing. + """ + folders = [WORKING_SPACE_TEMP, WORKING_SPACE_TEMP_MAIN_SUBS, + WORKING_SPACE_TEMP_ALT_SUBS] + for folder in folders: + rmtree(folder, ignore_errors=True) + makedirs(folder, exist_ok=True) + + +@execution_timer # ✅ +def main(): + """ + Main function that runs the entire process. + """ + display_logo() + settings: Settings = update_settings() + extract_tracks_from_mkv() + refactor_subtitles() + translate_subtitles(settings) + convert_numbers_to_words() + generate_audio_for_subtitles(settings) + refactor_alt_subtitles() + process_output_files(settings) + clear_temp_folders() + + +if __name__ == '__main__': + """ + Ensures the main function is only run if the script is executed directly (not imported as a module). + """ + directories: List[str] = [WORKING_SPACE, WORKING_SPACE_OUTPUT, + WORKING_SPACE_TEMP, WORKING_SPACE_TEMP_MAIN_SUBS, WORKING_SPACE_TEMP_ALT_SUBS] + check_and_create_directories(directories) + main() + console.print( + '\n[green_italic]Naciśnij dowolny klawisz, aby zakończyć działanie programu...', end='') + getch() diff --git a/mm_avh_working_space/tests/MM_AVH_pre.py b/mm_avh_working_space/tests/MM_AVH_pre.py new file mode 100644 index 0000000000000000000000000000000000000000..af9e773e753c1fb773a17533217658d6b3a59ffc --- /dev/null +++ b/mm_avh_working_space/tests/MM_AVH_pre.py @@ -0,0 +1,1148 @@ +# Program: Multimedia Magic - Audio Visual Heaven (MM-AVH) do automatyzacji procesu tłumaczenia napisów i lektora do filmów + +# pip install pysubs2 +# pip install googletrans==3.1.0a0 +import re +import threading +import shutil +import pyautogui +import pyperclip +import time +import deepl +import pysrt +from googletrans import Translator +from pysubs2 import SSAFile +from pysubs2 import SSAFile +from pyasstosrt import Subtitle +import subprocess +import os +from termcolor import cprint +import json +import contextlib +import asyncio +import wave +import edge_tts +import pyttsx3 +from pydub import AudioSegment +import webbrowser +from revChatGPT.V1 import Chatbot + + +def execute_command(command): + subprocess.call(command, shell=True) + + +def directory_path(): + return os.path.dirname(os.path.realpath(__file__)) + + +def set_option(prompt, options, description=None): + cprint(prompt, 'yellow', attrs=['bold']) + for key, value in options.items(): + if description and key in description: + print(f"Wartość domyślna: {value:5} {description[key]:5}") + else: + print(f"{key}. {value}") + cprint("\nWpisz swój wybór lub poprawną wartość:", + 'green', attrs=['bold'], end=" ") + return input() + + +def is_valid_speed(speed, voice_choice): + if voice_choice == '1': # TTS - Zosia - Harpo + return int(speed) > 0 + elif voice_choice == '2': # TTS - Agnieszka - Ivona + return -10 <= int(speed) <= 10 + elif voice_choice in ['3', '4']: # TTS - Zofia - Edge, TTS - Marek - Edge + return speed.startswith(('+', '-')) and speed[1:-1].isdigit() and -100 <= int(speed[1:-1]) <= 100 and speed.endswith('%') + return False + + +def is_valid_volume(volume, voice_choice): + if voice_choice == '1': # TTS - Zosia - Harpo + return 0 <= float(volume) <= 1 + elif voice_choice == '2': # TTS - Agnieszka - Ivona + return -100 <= int(volume) <= 100 + elif voice_choice in ['3', '4']: # TTS - Zofia - Edge, TTS - Marek - Edge + return volume.startswith(('+', '-')) and volume[1:-1].isdigit() and -100 <= int(volume[1:-1]) <= 100 and volume.endswith('%') + return False + + +def set_settings(dir_path, settings): + translator_options = { + '1': 'Google Translate', + '2': 'DeepL API', + '3': 'DeepL Desktop', + '4': 'ChatGPT 3.5 Free' + } + + translated_line_count_options = { + '1': '30', + '2': '50', + '3': '75', + '4': '100', + } + + alt_main_translator_options = { + '1': 'yes', + '2': 'no' + } + + tts_voice_options = { + '1': { + 'name': 'TTS - Zosia - Harpo', + 'speed_default': '200', + 'volume_default': '0.7' + }, + '2': { + 'name': 'TTS - Agnieszka - Ivona', + 'speed_default': '5', + 'volume_default': '65' + }, + '3': { + 'name': 'TTS - Zofia - Edge', + 'speed_default': '+40%', + 'volume_default': '+0%' + }, + '4': { + 'name': 'TTS - Marek - Edge', + 'speed_default': '+40%', + 'volume_default': '+0%' + } + } + + output_options = { + '1': 'Oglądam w MM_AVH_Players', + '2': 'Scal do mkv', + '3': 'Wypal do mp4', + } + + cprint("╔═════════════════ Ustawienia ═════════════════╗\n", + 'white', attrs=['bold']) + translator_choice = set_option( + "Wybierz translatora:", translator_options + ) + + deepl_api_key = '' + cprint("\nCzy chcesz ustawić klucz API DeepL? (t / y = tak):", + 'yellow', attrs=['bold'], end=" ") + change_settings = input("") + if change_settings.lower() in ['t', 'y', 'tak', 'yes']: + cprint('Wpisz klucz API DeepL:', 'green', attrs=['bold'], end=' ') + deepl_api_key = input() + if deepl_api_key == '': + cprint("Pominięto.", 'red', attrs=['bold']) + if settings['deepl_api_key']: + deepl_api_key = settings['deepl_api_key'] + else: + cprint("Pominięto.", 'red', attrs=['bold']) + if settings['deepl_api_key']: + deepl_api_key = settings['deepl_api_key'] + + access_token = '' + cprint("\nCzy chcesz ustawić token dostępu do ChatGPT? (t / y = tak):", + 'yellow', attrs=['bold'], end=" ") + change_settings = input() + if change_settings.lower() in ['t', 'y', 'tak', 'yes']: + url = "https://chat.openai.com/api/auth/session" + webbrowser.open(url) + cprint('Wpisz token dostępu do ChatGPT:', + 'green', attrs=['bold'], end=' ') + access_token = input() + if access_token == '': + cprint("Pominięto.", 'red', attrs=['bold']) + if settings['access_token']: + access_token = settings['access_token'] + else: + cprint("Pominięto.", 'red', attrs=['bold']) + if settings['access_token']: + access_token = settings['access_token'] + + translated_line_count_choice = set_option( + "\nWybierz ilość tłumaczonych linii na raz:", translated_line_count_options + ) + alt_main_translator_choice = set_option( + "\nCzy tłumaczyć rozdzielone napisy?", alt_main_translator_options + ) + tts_choice = None + while tts_choice is None: + tts_choice = set_option( + "\nWybierz głos lektora:", tts_voice_options + ) + if tts_choice not in tts_voice_options: + tts_choice = '2' # Ustawienie domyślnej wartości + + tts_speed_default = tts_voice_options.get(tts_choice).get('speed_default') + + cprint("\nObesługiwane zakresy szybkości:", + 'yellow', attrs=['bold']) + print("TTS - Zosia - Harpo - szybkość głosu od 0 do ... (słowa na minute), domyślna: 200)") + print("TTS - Agnieszka - Ivona - szybkość głosu od -10 do 10 (domyślna: 5)") + print("TTS - Zofia - Edge - szybkość głosu (+/-) od -100% do +100%, (domyślna: +40%)") + print("TTS - Marek - Edge - szybkość głosu (+/-) od -100% do +100%, (domyślna: +40%)") + + cprint(f"\nWpisz szybkość głosu (domyślna: {tts_speed_default}):", 'green', attrs=[ + 'bold'], end=" ") + tts_speed_choice = input('') + try: + tts_speed = ( + tts_speed_choice if is_valid_speed(tts_speed_choice, tts_choice) and tts_speed_choice.strip() != '' + else tts_speed_default + ) + except Exception: + tts_speed = tts_speed_default + cprint("\nObesługiwane zakresy głośności:", 'yellow', attrs=['bold']) + print("TTS - Zosia - Harpo - głośność głosu od 0 do 1 (domyślna: 0.7)") + print("TTS - Agnieszka - Ivona - głośność głosu od 0 do 100 (domyślna: 65)") + print("TTS - Zofia - Edge - głośność głosu (+/-) od -100% do +100%, (domyślna: +0%)") + print("TTS - Marek - Edge - głośność głosu (+/-) od -100% do +100%, (domyślna: +0%)") + tts_volume_default = tts_voice_options.get( + tts_choice).get('volume_default') + cprint(f"\nWpisz głośność głosu (domyślna: {tts_volume_default}):", 'green', attrs=[ + 'bold'], end=" ") + tts_volume_choice = input('') + try: + tts_volume = ( + tts_volume_choice if is_valid_volume(tts_volume_choice, tts_choice) and tts_volume_choice.strip() != '' + else tts_volume_default + ) + except Exception: + tts_volume = tts_volume_default + + output_options_choice = set_option( + "\nWybierz sposób wyjścia:", output_options + ) + + settings_data = { + 'translator': translator_options.get(translator_choice, 'Google Translate'), + # jeśli nie jest pusty 1df708bf-af10-3e70-e577-b2d4cb763d74:fx + 'deepl_api_key': deepl_api_key, + 'access_token': access_token, + 'translated_line_count': translated_line_count_options.get(translated_line_count_choice, '50'), + 'alt_main_translator': alt_main_translator_options.get(alt_main_translator_choice, 'no'), + 'tts': tts_voice_options.get(tts_choice).get('name', 'TTS - Agnieszka - Ivona'), + 'tts_speed': tts_speed, + 'tts_volume': tts_volume, + 'output': output_options.get(output_options_choice, 'Oglądam w MM_AVH_Players') + } + + with open(os.path.join(dir_path, 'src', 'settings.json'), 'w') as settings_file: + json.dump(settings_data, settings_file, indent=4) + + cprint("Ustawienia zostały zapisane.\n", 'green', attrs=['bold']) + + +def get_settings(dir_path): + if os.path.isfile(os.path.join(dir_path, 'src', 'settings.json')): + with open(os.path.join(dir_path, 'src', 'settings.json'), 'r') as settings_file: + settings_data = json.load(settings_file) + return settings_data + + +def mkv_info(dir_path, file): + command = [ + dir_path + '\\src\\mkvtoolnix\\mkvmerge.exe', + '--ui-language', + 'en', + '--identify', + '--identification-format', + 'json', + dir_path + '\\' + file + ] + + process = subprocess.Popen( + command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) + output, error = process.communicate() + + if process.returncode == 0: + return mkv_info_print(output, file) + else: + print(f'Error: {error}') + + +def mkv_info_print(output, file): + data = json.loads(output) + tracks_data = [] + + for track in data['tracks']: + track_data = { + 'id': track['id'], + 'type': track['type'], + 'codec_id': track['properties']['codec_id'], + 'language': track['properties']['language'], + 'language_ietf': track['properties']['language_ietf'], + 'properties': None + } + + if 'display_dimensions' in track['properties']: + track_data['properties'] = track['properties']['display_dimensions'] + elif 'audio_sampling_frequency' in track['properties']: + track_data['properties'] = f"{track['properties']['audio_sampling_frequency']} Hz" + + tracks_data.append(track_data) + + cprint('WYODRĘBNIANIE Z PLIKU:', 'red', attrs=['bold']) + cprint(file, 'white', attrs=['bold']) + cprint('ID TYPE CODEK LANG LANG_IETF PROPERTIES', + 'yellow', attrs=['bold']) + + sorted_tracks = sorted(tracks_data, key=lambda x: x['id']) + for track in sorted_tracks: + print(f'{track["id"]:2} {track["type"]:10} {track["codec_id"]:20} {track["language"]:5} {track["language_ietf"]:10} {track["properties"]}') + + print('') + return data + + +def mkv_extract(dir_path, file, data): + tracks_properties = [] + while True: + try: + cprint('Podaj ID ścieżki do wyciągnięcia (naciśnij ENTER, aby zakończyć): ', + 'green', attrs=['bold'], end='') + track_id = int( + input('')) + tracks_properties.append(track_id) + except ValueError: + cprint('Pominięto wyciąganie ścieżki.\n', 'red', attrs=['bold']) + break + try: + for track_id in tracks_properties: + track = data['tracks'][track_id] + codec_id = track["properties"]["codec_id"] + filename = f'{file[:-4]}.{codec_id.rsplit("_", 1)[-1].rsplit("/", 1)[-1].lower()}' + out_file = os.path.join(dir_path, 'src', 'tmp', filename) + command = [ + os.path.join(dir_path, 'src', 'mkvtoolnix', 'mkvextract.exe'), + 'tracks', + os.path.join(dir_path, file), + f'{track_id}:{out_file}' + ] + process = subprocess.Popen(command) + cprint( + f'Ekstrakcja ścieżki {track_id} do pliku {filename}', 'green', attrs=['bold']) + process.communicate() + print('') + except IndexError: + cprint('Znaleziono nieprawidłowe ID ścieżki!', 'red', attrs=['bold']) + mkv_extract(dir_path, file, data) + print('') + + +def split_ass(dir_path, input_file): + main_subs_folder = os.path.join(dir_path, 'main_subs') + alt_subs_folder = os.path.join(dir_path, 'alt_subs') + + with open(os.path.join(dir_path, input_file), 'r', encoding='utf-8') as file: + subs = SSAFile.from_file(file) + + # Znajdź unikalne style w kolejności występowania + styles = [] + for event in subs: + if event.style not in styles: + styles.append(event.style) + + cprint("PODZIAŁ PLIKU: ", 'red', attrs=['bold']) + cprint(input_file, 'white', attrs=['bold']) + # Wyświetl dostępne style w kolejności występowania + cprint("Dostępne style do TTS:", 'yellow', attrs=['bold']) + for i, style in enumerate(styles, start=1): + print(f"{i}. {style}") + + print('') + selected_styles = [] + while True: + cprint("Wybierz style do zapisu (naciśnij ENTER, aby zakończyć): ", + 'green', attrs=['bold'], end='') + selection = input("") + if not selection: + break + selected_styles.append(styles[int(selection) - 1]) + + if not selected_styles: + cprint("Nie wybrano żadnych stylów. Podział napisów nie został wykonany.\n", + 'red', attrs=['bold']) + return + + main_subs = SSAFile() + alt_subs = SSAFile() + + for event in subs: + if event.style in selected_styles: + main_subs.append(event) + else: + alt_subs.append(event) + + main_output_file = os.path.join(main_subs_folder, input_file) + alt_output_file = os.path.join(alt_subs_folder, input_file) + + # Skopiuj metadane do plików wyjściowych + main_subs.info = subs.info + alt_subs.info = subs.info + + # Skopiuj style do plików wyjściowych + main_style_names = [style_name for style_name in subs.styles.keys() + if style_name in selected_styles] + main_subs.styles.clear() + for style_name in main_style_names: + main_subs.styles[style_name] = subs.styles[style_name] + + alt_style_names = [style_name for style_name in subs.styles.keys() + if style_name not in selected_styles] + alt_subs.styles.clear() + for style_name in alt_style_names: + alt_subs.styles[style_name] = subs.styles[style_name] + + # Zapisz napisy w plikach wyjściowych + with open(main_output_file, 'w', encoding='utf-8') as main_file: + main_file.write(main_subs.to_string(format_='ass')) + + with open(alt_output_file, 'w', encoding='utf-8') as alt_file: + alt_file.write(alt_subs.to_string(format_='ass')) + + cprint("Podział napisów został zakończony.", 'yellow', attrs=['bold']) + + os.remove(os.path.join(dir_path, input_file)) + cprint("Usunięto plik źródłowy.\n", 'yellow', attrs=['bold']) + + +def ass_to_srt(dir_path, file): + sub = Subtitle(os.path.join(dir_path, file)) + sub.export() + cprint("Zamieniono na srt:", 'yellow', attrs=['bold'], end=" ") + print(file) + + # os.remove(os.path.join(dir_path, file)) + # cprint("Usunięto plik źródłowy.", 'green', attrs=['bold']) + + +def asnii_srt(dir_path, file): + with open(os.path.join(dir_path, file), "r", encoding="utf-8") as source_file: + content = source_file.read() + + try: + with open(os.path.join(dir_path, file), "w", encoding="ANSI") as target_file: + target_file.write(content) + except UnicodeEncodeError: + with open(os.path.join(dir_path, file), "w", encoding="ANSI", errors="ignore") as target_file: + target_file.write(content) + + # Zamieniono kodowanie pliku na ANSI + cprint("Zamieniono kodowanie na ANSI:", 'yellow', attrs=['bold'], end=' ') + print(file) + + +def translate_google(dir_path, file, translated_line_count): + subs = pysrt.open(os.path.join(dir_path, file), encoding='utf-8') + subs_combined = [] + translated_subs = [] + + translator = Translator() + for i, sub in enumerate(subs): + sub.text = sub.text.replace("\n", " ◍ ") + subs_combined.append(sub.text) + + if (i + 1) % translated_line_count == 0 or i == len(subs) - 1: + combined_text = "\n".join(subs_combined) + translated_text = translator.translate( + combined_text, dest='pl').text + translated_subs += translated_text.split("\n") + subs_combined = [] + + for i, sub in enumerate(subs): + sub.text = translated_subs[i] + sub.text = sub.text.replace(" ◍, ", ",\n") + sub.text = sub.text.replace(" ◍ ", "\n") + sub.text = sub.text.replace(" ◍", "") + + subs.save(os.path.join(dir_path, file)) + + +def translate_deepl_api(dir_path, file, translated_line_count, settings): + subs = pysrt.open(os.path.join(dir_path, file), encoding='utf-8') + # Zamień na swój klucz https://www.deepl.com/pl/pro-api?cta=header-pro-api/ za darmo 5000000 słów miesięcznie + # auth_key = "1df708bf-af10-3e70-e577-b2d4cb763d74:fx" + auth_key = settings['deepl_api_key'] + translator = deepl.Translator(auth_key) + groups = [subs[i:i+translated_line_count] + for i in range(0, len(subs), translated_line_count)] + for group in groups: + text = " @\n".join(sub.text.replace("\n", " ◍◍◍◍ ") + for sub in group) + translated_text = translator.translate_text( + text, target_lang='PL').text + translated_texts = translated_text.split(" @\n") + if len(translated_texts) == len(group): + for i in range(len(group)): + if i < len(translated_texts): + group[i].text = translated_texts[i] + group[i].text = group[i].text.replace(" ◍◍◍◍, ", ",\n") + group[i].text = group[i].text.replace(" ◍◍◍◍ ", "\n") + group[i].text = group[i].text.replace(" ◍◍◍◍", "") + subs.save(os.path.join(dir_path, file), encoding='utf-8') + + +def translate_deepl_desktop(dir_path, file, translated_line_count): + # subprocess.Popen( + # r"C:\Users\mateu\AppData\Roaming\0install.net\desktop-integration\stubs\90d46b1a865bf05507b9fb0d2b3698b63cba3a15fbcafd836ab5523e7a3efb99\DeepL.exe") + # lub + command = r'C:\Users\mateu\AppData\Roaming\Programs\Zero Install\0install-win.exe' + args = ["run", "--no-wait", + "https://appdownload.deepl.com/windows/0install/deepl.xml"] + subprocess.call([command] + args) + + time.sleep(5) + + def auto_steps(): + screen_width, screen_height = pyautogui.size() + x = screen_width * 0.25 + y = screen_height * 0.5 + pyautogui.moveTo(x, y) + pyautogui.click() + pyautogui.hotkey('ctrl', 'a') + pyautogui.hotkey('del') + pyautogui.hotkey('ctrl', 'v') + time.sleep(6) + x = screen_width * 0.75 + pyautogui.moveTo(x, y) + pyautogui.click() + pyautogui.hotkey('ctrl', 'a') + pyautogui.hotkey('ctrl', 'c') + + subs = pysrt.open(os.path.join(dir_path, file), encoding='utf-8') + groups = [subs[i:i+translated_line_count] + for i in range(0, len(subs), translated_line_count)] + + for group in groups: + text = " @\n".join(sub.text.replace("\n", " ◍◍◍◍ ") + for sub in group) + text = text.rstrip('\n') + pyperclip.copy(text) + auto_steps() + + translated_text = pyperclip.paste() + if translated_text: + for sub, trans_text in zip(group, translated_text.split(" @\n")): + sub.text = trans_text.replace(" ◍◍◍◍, ", ",\n") + sub.text = sub.text.replace(" ◍◍◍◍ ", "\n") + sub.text = sub.text.replace(" ◍◍◍◍", "") + + subs.save(os.path.join(dir_path, file), encoding='utf-8') + + frezes = ["\nPrzetłumaczono z www.DeepL.com/Translator (wersja darmowa)\n", + "Przetłumaczono z www.DeepL.com/Translator (wersja darmowa)", + "\nTranslated with www.DeepL.com/Translator (free version)\n", + "\nTranslated with www.DeepL.com/Translator (free version)"] + + with open(os.path.join(dir_path, file), 'r', encoding='utf-8') as in_file: + text = in_file.read() + + for freze in frezes: + text = text.replace(freze, "") + + with open(os.path.join(dir_path, file), 'w', encoding='utf-8') as out_file: + out_file.write(text) + + +def translate_chatgpt_free(dir_path, file, translated_line_count, settings): + + subs = pysrt.open(os.path.join(dir_path, file), encoding='utf-8') + subs_combined = [] + translated_subs = [] + + for i, sub in enumerate(subs): + sub.text = sub.text.replace("\n", " ◍ ") + subs_combined.append(sub.text) + + if (i + 1) % translated_line_count == 0 or i == len(subs) - 1: + combined_text = "\n".join(subs_combined) + translated_text = ask_chatgpt(combined_text, settings) + translated_subs += translated_text.split("\n") + subs_combined = [] + + for i, sub in enumerate(subs): + sub.text = translated_subs[i] + sub.text = sub.text.replace(" ◍, ", ",\n") + sub.text = sub.text.replace(" ◍ ", "\n") + sub.text = sub.text.replace(" ◍", "") + + subs.save(os.path.join(dir_path, file)) + + +def ask_chatgpt(prompt, settings): + chatbot = Chatbot(config={"access_token": settings['access_token']}) + translate_prompt = """I want you to act as an Polish translator, spelling corrector and improver. I will speak to you in any language and you will detect the language, translate it and answer in the corrected and improved version of my text, in Polish. I want you to replace my simplified C2-level words and sentences with more beautiful and elegant, upper level English words and sentences. Keep the meaning same, but make them more literary. I want you to only reply the correction, the improvements and nothing else, do not write explanations. Don't repeat yourself, diversity matters! Translate anime subtitles: + + """ + response = "" + for message in chatbot.ask(translate_prompt + prompt): + response = message["message"] + print(response) + return response + + # przykładowe uźycie + + # def ask_chatGPT(prompt): + # print("ChatGPT: ", end="") + # prev_text = "" + # for data in chatbot.ask( + # prompt + # ): + # prev_text = data["message"] + # # print(prev_text) + # return prev_text + + # prompt = "Co tam?" + # # prompt = input("You: ") + # while prompt != "Exit": + # print(ask_chatGPT(prompt)) + # prompt = input("You: ") + + +def translate_srt(dir_path, file, settings): + translator = settings['translator'] + translated_line_count = int(settings['translated_line_count']) + alt_main_translator = settings['alt_main_translator'] + + if alt_main_translator == 'no' and (dir_path.endswith('main_subs') or dir_path.endswith('alt_subs')): + cprint("\nUwaga!", 'yellow', attrs=['bold']) + print( + f"Tłumaczenie folderów wyłączone.\nZakładam, że", end=' ') + cprint(f"{file}", 'yellow', attrs=['bold'], end=' ') + print("jest już przetłumaczony na polski.") + return + + if translator == 'Google Translate': + cprint("\nTłumaczenie za pomocą Google Translate... :", + 'yellow', attrs=['bold'], end=' ') + print(file) + translate_google(dir_path, file, translated_line_count) + elif translator == 'DeepL API': + cprint("\nTłumaczenie za pomocą DeepL API... :", + 'yellow', attrs=['bold'], end=' ') + print(file) + translate_deepl_api(dir_path, file, translated_line_count) + elif translator == 'DeepL Desktop': + cprint("\nTłumaczenie za pomocą DeepL Desktop... :", + 'yellow', attrs=['bold'], end=' ') + print(file) + translate_deepl_desktop(dir_path, file, translated_line_count) + time.sleep(1) + pyautogui.hotkey('alt', 'f4') + elif translator == 'ChatGPT 3.5 Free': + cprint("\nTłumaczenie za pomocą ChatGPT 3.5 Free... :", + 'yellow', attrs=['bold'], end=' ') + print(file) + translate_chatgpt_free(dir_path, file, translated_line_count, settings) + + cprint("Tłumaczenie zakończone.", 'green', attrs=['bold']) + + + def srt_to_wav_harpo(self, tts_speed: str, tts_volume: str) -> None: + self.ansi_srt() + # Inicjalizacja silnika mowy + engine = pyttsx3.init() + voices = engine.getProperty('voices') + for voice in voices: + if voice.name == 'Vocalizer Expressive Zosia Harpo 22kHz': + engine.setProperty('voice', voice.id) + engine.setProperty('rate', int(tts_speed)) # Szybkość mówienia + engine.setProperty('volume', float(tts_volume)) # Głośność + + subtitles = pysrt.open(os.path.join( + self.working_space_temp_main_subs, self.filename), encoding='ANSI') + + # Odczytanie napisów i zapisanie mowy do pliku WAV + output_file = os.path.splitext(os.path.join( + self.working_space_temp, self.filename))[0] + '.wav' + with wave.open(output_file, 'wb') as wav_file: + wav_file.setnchannels(1) # Mono + wav_file.setsampwidth(2) # 16-bit + wav_file.setframerate(22500) # 22kHz + + for i, subtitle in enumerate(subtitles, start=1): + print( + f"{i}\n{subtitle.start.to_time().strftime('%H:%M:%S.%f')[:-3]} --> {subtitle.end.to_time().strftime('%H:%M:%S.%f')[:-3]}\n{subtitle.text}\n") + + start_time = subtitle.start.to_time() + start_time = start_time.hour * 3600 + start_time.minute * \ + 60 + start_time.second + start_time.microsecond / 1000000 + # Zapisanie mowy do pliku WAV + engine.save_to_file(subtitle.text, os.path.join( + self.working_space_temp, "temp.wav")) + engine.runAndWait() + + # Dodanie pustego frame'a do pliku WAV, jeśli jest to wymagane + framerate = wav_file.getframerate() + nframes = wav_file.getnframes() + current_time = nframes / float(framerate) + if start_time > current_time: + empty_frame_duration = int( + (start_time - current_time) * framerate) + empty_frame = b'\x00' * empty_frame_duration * 2 + wav_file.writeframes(empty_frame) + + # Dodanie mowy do pliku WAV + with wave.open(os.path.join(self.working_space_temp, "temp.wav"), 'rb') as temp_file: + data = temp_file.readframes(temp_file.getnframes()) + wav_file.writeframes(data) + + # Usunięcie pliku tymczasowego + os.remove(os.path.join(self.working_space_temp, "temp.wav")) + + +def process_subtitle(subtitle): + i = subtitle.index + start_time = subtitle.start.to_time().strftime('%H:%M:%S.%f')[:-3] + end_time = subtitle.end.to_time().strftime('%H:%M:%S.%f')[:-3] + text = subtitle.text + print(f"{i}\n{start_time} --> {end_time}\n{text}\n") + time.sleep(0.02) + + +def srt_to_wav_balabolka(dir_path, tts_path, file, tts_speed, tts_volume): + file_path = os.path.join(tts_path, file) + with contextlib.suppress(UnicodeDecodeError): + subtitles = pysrt.open(file_path, encoding='ANSI') + balcon_path = os.path.join(dir_path, "src", "balabolka", "balcon.exe") + output_wav_path = os.path.join( + tts_path, os.path.splitext(file)[0] + ".wav") + command = f'"{balcon_path}" -fr 48 -f "{file_path}" -w "{output_wav_path}" -n "IVONA 2 Agnieszka" -s {tts_speed} -v {tts_volume}' + + # Tworzenie wątku dla komendy + command_thread = threading.Thread( + target=execute_command, args=(command,)) + + # Uruchamianie wątku dla komendy + command_thread.start() + + # Wykonanie pętli w głównym wątku + for i, subtitle in enumerate(subtitles, start=1): + process_subtitle(subtitle) + + # Oczekiwanie na zakończenie wątku komendy + command_thread.join() + + +async def generate_speech(subtitle, voice, output_file, rate, volume): + communicate = edge_tts.Communicate( + subtitle.text, voice, rate=rate, volume=volume) + await communicate.save(output_file) + + +async def generate_wav_files(subtitles, voice, rate, volume): + tasks = [] + mp3_files = [] + file_name = os.path.splitext(subtitles.path)[0] + for i, subtitle in enumerate(subtitles, start=1): + output_file = f"{file_name}_{i}.mp3" + mp3_files.append(output_file) + tasks.append(asyncio.create_task(generate_speech( + subtitle, voice, output_file, rate, volume))) + if i % 50 == 0: + await asyncio.gather(*tasks) + tasks = [] + time.sleep(2) + await asyncio.gather(*tasks) + return mp3_files + + +def merge_audio_files(mp3_files, subtitles, dir_path): + file_name = os.path.splitext(subtitles.path)[0] + with wave.open(f"{file_name}.wav", 'wb') as wav_file: + wav_file.setnchannels(1) + wav_file.setsampwidth(2) + wav_file.setframerate(24000) + + audio_segments = [] + for i, mp3_file in enumerate(mp3_files, start=1): + print( + f"{i}\n{subtitles[i-1].start.to_time().strftime('%H:%M:%S.%f')[:-3]} --> {subtitles[i-1].end.to_time().strftime('%H:%M:%S.%f')[:-3]}\n{subtitles[i-1].text}\n") + + mp3_file_path = os.path.join(dir_path, mp3_file) + if os.path.isfile(mp3_file_path): + start_time = subtitles[i-1].start.to_time() + start_time = start_time.hour * 3600 + start_time.minute * \ + 60 + start_time.second + start_time.microsecond / 1000000 + sound = AudioSegment.from_file(mp3_file_path, format="mp3") + audio_segments.append(sound) + os.remove(mp3_file_path) + + framerate = wav_file.getframerate() + nframes = wav_file.getnframes() + current_time = nframes / float(framerate) + if current_time < start_time: + empty_frame_duration = int( + (start_time - current_time) * framerate) + empty_frame = b'\x00' * empty_frame_duration * 2 + wav_file.writeframes(empty_frame) + + sound_data = sound.raw_data + wav_file.writeframes(sound_data) + + wav_file.close() + + +def srt_to_wav_edge_online(dir_path, file, tts, tts_speed, tts_volume): + if tts == "TTS - Zofia - Edge": + voice = "pl-PL-ZofiaNeural" + elif tts == "TTS - Marek - Edge": + voice = "pl-PL-MarekNeural" + if tts_speed: + rate = tts_speed + if tts_volume: + volume = tts_volume + + subtitles = pysrt.open(os.path.join(dir_path, file), encoding='ANSI') + mp3_files = asyncio.run(generate_wav_files(subtitles, voice, rate, volume)) + merge_audio_files(mp3_files, subtitles, dir_path) + + +def tts_srt(dir_path, tts_path, file, settings): + tts = settings['tts'] + tts_speed = settings['tts_speed'] + tts_volume = settings['tts_volume'] + + cprint( + "Rozpoczynam generowanie pliku audio... :", + "yellow", + attrs=["bold"], + end=" ", + ) + print(file) + if tts == "TTS - Zosia - Harpo": + srt_to_wav_harpo(tts_path, file, tts_speed, tts_volume) + elif tts == "TTS - Agnieszka - Ivona": + srt_to_wav_balabolka(dir_path, tts_path, file, tts_speed, tts_volume) + elif tts in ["TTS - Zofia - Edge", "TTS - Marek - Edge"]: + srt_to_wav_edge_online(tts_path, file, tts, tts_speed, tts_volume) + cprint("\nGenerowanie pliku audio zakończone.", "yellow", attrs=["bold"]) + + +def merge_tts_audio(dir_path, tmp_path, main_subs_path, lector_path): + ffmpeg_path = os.path.join(dir_path, "src", "ffmpeg", "bin", "ffmpeg.exe") + excluded_extensions = ["srt", "ass"] + + main_subs_files = [f.lower() for f in os.listdir(main_subs_path)] + tmp_files = [f.lower() for f in os.listdir(tmp_path)] + + for file in os.listdir(tmp_path): + file_name, file_ext = os.path.splitext(file) + file_ext = file_ext[1:].lower() + + if file_ext not in excluded_extensions and (file_name + ".wav").lower() in main_subs_files or (file_name + ".wav").lower() in tmp_files: + file_path_1 = os.path.join(tmp_path, file) + file_path_2 = os.path.join(main_subs_path, file_name + ".wav") if ( + file_name + ".wav").lower() in main_subs_files else os.path.join(tmp_path, file_name + ".wav") + + output_file = os.path.join(lector_path, file_name + ".eac3") + + if not os.path.exists(output_file): + command = [ + ffmpeg_path, + "-i", file_path_1, + "-i", file_path_2, + "-filter_complex", "[1:a]volume=7dB[a1];[0:a][a1]amix=inputs=2:duration=first", + output_file + ] + subprocess.call(command) + + os.remove(file_path_1) + if file_path_2 != file_path_1: + os.remove(file_path_2) + + for file in os.listdir(main_subs_path): + file_path = os.path.join(main_subs_path, file) + if os.path.isfile(file_path): + os.remove(file_path) + + for file in os.listdir(tmp_path): + file_path = os.path.join(tmp_path, file) + if os.path.isfile(file_path): + os.remove(file_path) + + +def move_output_files(dir_path, alt_subs_path, lector_path, settings): + for file in os.listdir(lector_path): + file_path = os.path.join(lector_path, file) + # przenieś plik z lektorem do katalogu docelowego + destination_path = os.path.join(dir_path, file) + shutil.move(file_path, destination_path) + + for file in os.listdir(alt_subs_path): + file_path = os.path.join(alt_subs_path, file) + if file.endswith('.ass') and settings['alt_main_translator'] == 'no': + # przenieś plik ass + destination_path = os.path.join(dir_path, file) + shutil.move(file_path, destination_path) + elif file.endswith('.srt') and settings['alt_main_translator'] == 'yes': + # przenieś plik srt + destination_path = os.path.join(dir_path, file) + shutil.move(file_path, destination_path) + + # Opróżnij folder alt_subs_path + shutil.rmtree(alt_subs_path) + os.mkdir(alt_subs_path) + + +def marge_subtitles_and_lector(dir_path, subtitle_path, lector_path, mkv_file, tmp_path): + mkvmerge_path = os.path.join(dir_path, "src", "mkvtoolnix", "mkvmerge.exe") + output_file = os.path.join(tmp_path, mkv_file) + + command = [ + mkvmerge_path, '-o', output_file, '--no-subtitles', '--no-audio', os.path.join( + dir_path, mkv_file), lector_path, + '--language', '0:pol', '--track-name', '0:"Napisy Poboczne PL"', subtitle_path + ] + process = subprocess.Popen(command) + cprint( + f'Łączenie lektora i napisów do {mkv_file}', 'green', attrs=['bold']) + process.communicate() + if subtitle_path.endswith('.ass'): + os.remove(subtitle_path[:-4] + '.srt') + if subtitle_path.endswith('.srt'): + os.remove(subtitle_path[:-4] + '.ass') + os.remove(subtitle_path) + os.remove(lector_path) + + +def marge_lector(dir_path, lector_path, mkv_file, tmp_path): + mkvmerge_path = os.path.join(dir_path, "src", "mkvtoolnix", "mkvmerge.exe") + output_file = os.path.join(tmp_path, mkv_file) + + command = [ + mkvmerge_path, '-o', output_file, '--no-subtitles', '--no-audio', os.path.join( + dir_path, mkv_file), + '--language', '0:pol', '--track-name', '0:"Lektor PL"', lector_path + ] + process = subprocess.Popen(command) + cprint(f'Dodawanie lektora do {mkv_file}', 'green', attrs=['bold']) + process.communicate() + os.remove(lector_path) + + +def burn_subtitles(dir_path, tmp_path, file): + for filename in os.listdir(tmp_path): + if filename.endswith(".mkv") and filename == file: + ffmpeg_path = os.path.join( + dir_path, "src", "ffmpeg", "bin", "ffmpeg.exe") + + new_filename = re.sub( + r'[^A-Za-z0-9.]+', '_', filename) + + os.rename(os.path.join(tmp_path, filename), new_filename) + + subprocess.call([ffmpeg_path, '-i', new_filename, '-c:v', 'libx264', '-crf', '54', '-preset', + 'ultrafast', '-c:a', 'copy', '-vf', 'subtitles=' + new_filename, os.path.join(tmp_path, new_filename[:-4] + '_lektor.mp4')]) + os.remove(new_filename) + os.rename(os.path.join(tmp_path, new_filename[:-4] + '_lektor.mp4'), + os.path.join(tmp_path, filename[:-4] + '_lektor.mp4')) + dst_file = os.path.join(tmp_path, filename[:-4] + '_lektor.mp4') + shutil.move(dst_file, dir_path) + + +def burn_lector(dir_path, tmp_path, file): + ffmpeg_path = os.path.join(dir_path, "src", "ffmpeg", "bin", "ffmpeg.exe") + + tmp_path = os.path.join(tmp_path, file) + mp4_path = os.path.join(dir_path, file.replace('.mkv', '_lektor.mp4')) + + command = [ + ffmpeg_path, '-i', tmp_path, '-c:v', 'libx264', '-crf', '54', '-preset', 'ultrafast', '-c:a', 'copy', mp4_path + ] + subprocess.run(command) + os.remove(tmp_path) + + +def output_files(dir_path, alt_subs_path, lector_path, settings, tmp_path): + output_option = settings["output"] + if output_option == "Oglądam w MM_AVH_Players": + print("Kopiuję pliki wyjściowe do folderu z filmem...") + move_output_files(dir_path, alt_subs_path, lector_path, settings) + else: + + for file in os.listdir(dir_path): + if file.endswith('.mkv'): + mkv_file = file + base_name = os.path.splitext(mkv_file)[0] + + srt_file = f"{base_name}.srt" + ass_file = f"{base_name}.ass" + lector_file = f"{base_name}.eac3" + + srt_path = os.path.join(alt_subs_path, srt_file) + ass_path = os.path.join(alt_subs_path, ass_file) + lector_path_2 = os.path.join(lector_path, lector_file) + + if os.path.isfile(srt_path) and settings['alt_main_translator'] == 'yes': + marge_subtitles_and_lector( + dir_path, srt_path, lector_path_2, mkv_file, tmp_path) + if output_option == 'Scal do mkv': + output_file = os.path.join(tmp_path, mkv_file) + destination_path = os.path.join(dir_path, mkv_file)[ + :-4] + '_lektor.mkv' + shutil.move(output_file, destination_path) + elif output_option == 'Wypal do mp4': + burn_subtitles(dir_path, tmp_path, file) + + elif os.path.isfile(ass_path) and settings['alt_main_translator'] == 'no': + marge_subtitles_and_lector( + dir_path, ass_path, lector_path_2, mkv_file, tmp_path) + if output_option == 'Scal do mkv': + output_file = os.path.join(tmp_path, mkv_file) + destination_path = os.path.join(dir_path, mkv_file)[ + :-4] + '_lektor.mkv' + shutil.move(output_file, destination_path) + elif output_option == 'Wypal do mp4': + burn_subtitles(dir_path, tmp_path, file) + else: + marge_lector(dir_path, lector_path_2, mkv_file, tmp_path) + if output_option == 'Scal do mkv': + output_file = os.path.join(tmp_path, mkv_file) + destination_path = os.path.join(dir_path, mkv_file)[ + :-4] + '_lektor.mkv' + shutil.move(output_file, destination_path) + elif output_option == 'Wypal do mp4': + burn_lector(dir_path, tmp_path, file) + + +def main(): + cprint("╚═══ Multimedia Magic – Audio Visual Heaven ═══╝\n", + 'white', attrs=['bold']) + + dir_path = directory_path() + settings = get_settings(dir_path) + + if os.path.isfile(os.path.join(dir_path, 'src', 'settings.json')): + cprint("Czy chcesz zmienić ustawienia? (t / y = tak):", + 'white', attrs=['bold'], end=" ") + change_settings = input("") + if change_settings.lower() in ['t', 'y', 'tak', 'yes']: + set_settings(dir_path, settings) + else: + cprint("Nie zmieniono ustawień.\n", 'green', attrs=['bold']) + else: + cprint("Ustawienia wstępne.\n", 'green', attrs=['bold']) + set_settings(dir_path, settings) + + # dla każdego pliku mkv w folderze wykonaj + for file in os.listdir(dir_path): + if file.endswith(".mkv"): + mkv_extract(dir_path, file, mkv_info(dir_path, file)) + + # dla każdego pliku ass w folderze wykonaj + tmp_path = os.path.join(dir_path, 'src', 'tmp') + alt_subs_path = os.path.join(tmp_path, 'alt_subs') + main_subs_path = os.path.join(tmp_path, 'main_subs') + lector_path = os.path.join(tmp_path, 'lector') + + # rozdzielanie napisów + for file in os.listdir(tmp_path): + if file.endswith(".ass"): + split_ass(tmp_path, file) + + for file in os.listdir(tmp_path): + if file.endswith(".ass"): + ass_to_srt(tmp_path, file) + for file in os.listdir(alt_subs_path): + if file.endswith(".ass"): + ass_to_srt(alt_subs_path, file) + for file in os.listdir(main_subs_path): + if file.endswith(".ass"): + ass_to_srt(main_subs_path, file) + + # Tłumaczenie i ANSI + for file in os.listdir(tmp_path): + if file.endswith('.srt'): + translate_srt(tmp_path, file, settings) + asnii_srt(tmp_path, file) + tts_srt(dir_path, tmp_path, file, settings) + for file in os.listdir(alt_subs_path): + if file.endswith('.srt'): + translate_srt(alt_subs_path, file, settings) + asnii_srt(alt_subs_path, file) + for file in os.listdir(main_subs_path): + if file.endswith('.srt'): + translate_srt(main_subs_path, file, settings) + asnii_srt(main_subs_path, file) + tts_srt(dir_path, main_subs_path, file, settings) + + merge_tts_audio(dir_path, tmp_path, main_subs_path, lector_path) + output_files(dir_path, alt_subs_path, lector_path, settings, tmp_path) + + +if __name__ == "__main__": + start_time = time.time() + main() + end_time = time.time() + execution_time = end_time - start_time + + seconds = int(execution_time % 60) + minutes = int((execution_time // 60) % 60) + hours = int(execution_time // 3600) + + print("Czas wykonania: {} godzin, {} minut, {} sekund".format( + hours, minutes, seconds)) + + # option = { + # 1: + # } + # cprint("╚═══════════════ WYBIERZ OPCJĘ ════════════════╝", + # 'white', attrs=['bold']) + # print("1. Ustawienia") + # print("2. EPIC AUTO: Ekstrakcja -> Tłumaczenie -> Lektor ->\n Scalanie lektora z audio ->\n (opcjonalnie) Scalenie do wideo z napisami / napisami pobocznymi ->\n Wypalenie napisów do wideo do formatu mp4\n LUB Zapisanie lektor-audio oraz napisów pobocznych do folderu z filmem") + # cprint("\n╚═════════════════════ MKV ════════════════════╝", + # 'white', attrs=['bold']) + # print("3. Informacje o plikach mkv") + # print("4. Ekstrakcja napisów / ścieżki dźwiękowej / obrazu") + # print("5. Ekstrakcja fontów") + # print("6. Scalanie napisów / audio do mkv") + # cprint("\n╚════════════════ TEKST ~ AUDIO ═══════════════╝", + # 'white', attrs=['bold']) + # print("6. Tłumaczenie napisów i tekstów") + # print("7. Teksy na mowę") + # print("8. Scalanie audio z lektorem do jednego pliku audio") + # cprint("\n╚══════════════ WYPALENIE DO MP4 ═══════════════╝", + # 'white', attrs=['bold']) + # print("9. Lektor do wideo") + # print("10. Wypalanie napisów do wideo") + # print("11. Wypalanie napisów pobocznych do wideo") + # 1. Ekstrakcja + # 2. W zalerzności języka w subtitles w lang lub lang_ietf przetłumacz na polski lub nie w przypadku und pytaj użytkownika czy tłumaczyć + # 3. Zrobienie lektora + # 4. Połączenie audio z lektorem + # 6. Wypal napisy do wideo + # 7. Dodaj ścieżkę dźwiękową lektora do wideo + # 8. Wypal napisy i dodaj ścieżkę dźwiękową lektora do wideo + # 9. Nałóż na siebie dwie ścieżki dźwiękowe + # dir_path\src\ffmpeg\bin + # dir_path\src\mkvtoolnix\mkvinfo.exe + # dir_path\src\mkvtoolnix\mkvextract.exe + # dir_path\src\mkvtoolnix\mkvmerge.exe + # dir_path\src\mkvtoolnix\mkvpropedit.exe + # dir_path\src\mkvtoolnix\mkvtoolnix-gui.exe + + # [2023-05-25][12:24:19] "tracks": [ + # [2023-05-25][12:24:19] { + # [2023-05-25][12:24:19] "codec": "AVC/H.264/MPEG-4p10", + # [2023-05-25][12:24:19] "id": 0, + # [2023-05-25][12:24:19] "properties": { + # [2023-05-25][12:24:19] "codec_id": "V_MPEG4/ISO/AVC", + # [2023-05-25][12:24:19] "codec_private_data": "01640028ffe1001c67640028acb280f0044fcb80b50101014000001f400005da83c60c9601000768e930332c8b00fdf8f800", + # [2023-05-25][12:24:19] "codec_private_length": 50, + # [2023-05-25][12:24:19] "default_duration": 41708333, + # [2023-05-25][12:24:19] "default_track": true, + # [2023-05-25][12:24:19] "display_dimensions": "1920x1080", + # [2023-05-25][12:24:19] "display_unit": 0, + # [2023-05-25][12:24:19] "enabled_track": true, + # [2023-05-25][12:24:19] "forced_track": false, + # [2023-05-25][12:24:19] "language": "und", + # [2023-05-25][12:24:19] "language_ietf": "und", + # [2023-05-25][12:24:19] "minimum_timestamp": 0, + # [2023-05-25][12:24:19] "number": 1, + # [2023-05-25][12:24:19] "packetizer": "mpeg4_p10_video", + # [2023-05-25][12:24:19] "pixel_dimensions": "1920x1080", + # [2023-05-25][12:24:19] "uid": 1 + # [2023-05-25][12:24:19] }, + # [2023-05-25][12:24:19] "type": "video" + # [2023-05-25][12:24:19] }, diff --git a/mm_avh_working_space/tests/chat.py b/mm_avh_working_space/tests/chat.py new file mode 100644 index 0000000000000000000000000000000000000000..cfb8c05a06b5c5635def019e09b8add177a02ea7 --- /dev/null +++ b/mm_avh_working_space/tests/chat.py @@ -0,0 +1,70 @@ +# https://chat.openai.com/api/auth/session + +# {"user":{"id":"user-iyTwG8edDJc6nzquextcUxLg","name":"Mateusz Mróz","email":"mateuszmroz001@gmail.com","image":"https://lh3.googleusercontent.com/a/AGNmyxZ51xU7m0YcenfA1aPz0EcL0hntw4QZ_R522pPYEg=s96-c","picture":"https://lh3.googleusercontent.com/a/AGNmyxZ51xU7m0YcenfA1aPz0EcL0hntw4QZ_R522pPYEg=s96-c","idp":"google-oauth2","iat":1685039590,"mfa":false,"groups":["labs"],"intercom_hash":"df01ded94e393afa0d34abafe8a05dcecc2f8ef89b5eab1ecdd913340d19104e"},"expires":"2023-06-29T10:37:22.104Z","accessToken":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik1UaEVOVUpHTkVNMVFURTRNMEZCTWpkQ05UZzVNRFUxUlRVd1FVSkRNRU13UmtGRVFrRXpSZyJ9.eyJodHRwczovL2FwaS5vcGVuYWkuY29tL3Byb2ZpbGUiOnsiZW1haWwiOiJtYXRldXN6bXJvejAwMUBnbWFpbC5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZX0sImh0dHBzOi8vYXBpLm9wZW5haS5jb20vYXV0aCI6eyJ1c2VyX2lkIjoidXNlci1peVR3RzhlZERKYzZuenF1ZXh0Y1V4TGcifSwiaXNzIjoiaHR0cHM6Ly9hdXRoMC5vcGVuYWkuY29tLyIsInN1YiI6Imdvb2dsZS1vYXV0aDJ8MTA3MjIwMDI0Mjc5OTM2OTA5MzUyIiwiYXVkIjpbImh0dHBzOi8vYXBpLm9wZW5haS5jb20vdjEiLCJodHRwczovL29wZW5haS5vcGVuYWkuYXV0aDBhcHAuY29tL3VzZXJpbmZvIl0sImlhdCI6MTY4NTAzOTU5MCwiZXhwIjoxNjg2MjQ5MTkwLCJhenAiOiJUZEpJY2JlMTZXb1RIdE45NW55eXdoNUU0eU9vNkl0RyIsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwgbW9kZWwucmVhZCBtb2RlbC5yZXF1ZXN0IG9yZ2FuaXphdGlvbi5yZWFkIG9yZ2FuaXphdGlvbi53cml0ZSJ9.e4Pwy2txj4NC5DR1mUQIz5EJNozPHwrxVxeH_e2w9LAN-u_70Nl09Bab9dVR8XkQLqGyH5-NUHuGbVhJYLBMpfgucuULEbBT-qNnvnftiWmIRiU5_W576bSDaOvFWAe8tKz4kwbxnHf_2MHV9xZc6HLysZYQ94AjlK4Cv8SEDVBH15Vl3wGmY4S_bUIEhSFoGzhVl_lfCqzUnsXa40CByZYXOgDnopC73nDa4c7JaR892ovH_CE7S1nUra8TYRoCg7CYLqlepGU4w5QxHs3s_gyb56xLytD3Eym5BS-v0oIpo5WbojmerwUGGRsPI8Hlt_vWYWkYfZ-Ztt6RI_rKVg","authProvider":"auth0"} + +# Napisz funckjie obsugująca chat najpierw poproś o access_token wyświetlając strone w przegląderce kodem poniżej (zapisz w funckji) +# import webbrowser + +# url = "https://chat.openai.com/api/auth/session" + +# # Otwórz stronę w domyślnej przeglądarce +# webbrowser.open(url) + + +# # potem zainicjiuj chat uwaga ask_chatGPT powinna zwracać odpowiedz w while powinno ją wypisywać +# # pip install revChatGPT +# from revChatGPT.V1 import Chatbot +# chatbot = Chatbot(config={ +# "access_token": "" +# }) + + +# def ask_chatGPT(prompt): +# print("ChatGPT: ", end="") +# prev_text = "" +# for data in chatbot.ask( +# prompt, +# ): +# message = data["message"][len(prev_text):] +# print(message, end="", flush=True) +# prev_text = data["message"] +# print('\n') + + +# prompt = "Co tam?" +# # prompt = input("You: ") +# while prompt != "Exit": +# ask_chatGPT(prompt) +# prompt = input("You: ") +import webbrowser +from revChatGPT.V1 import Chatbot + + +def get_access_token(): + # Otwórz stronę w domyślnej przeglądarce + url = "https://chat.openai.com/api/auth/session" + webbrowser.open(url) + + return input("Podaj access_token: ") + + +# Inicjalizuj chat +chatbot = Chatbot(config={"access_token": get_access_token()}) + + +def ask_chatGPT(prompt): + print("ChatGPT: ", end="") + prev_text = "" + for data in chatbot.ask( + prompt + ): + prev_text = data["message"] + # print(prev_text) + return prev_text + + +prompt = "Co tam?" +# prompt = input("You: ") +while prompt != "Exit": + print(ask_chatGPT(prompt)) + prompt = input("You: ") diff --git a/mm_avh_working_space/tests/input/test b/mm_avh_working_space/tests/input/test new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/mm_avh_working_space/tests/merge_audio_test.py b/mm_avh_working_space/tests/merge_audio_test.py new file mode 100644 index 0000000000000000000000000000000000000000..906327725d5625644bced1f51e20af82f8a495a5 --- /dev/null +++ b/mm_avh_working_space/tests/merge_audio_test.py @@ -0,0 +1,25 @@ +# pip inatall termcolor +import subprocess +import os +from termcolor import cprint + + +def cmd(command): + subprocess.call(command, shell=True) + + +def merge_audio(): + cprint("╚═══ Multimedia Magic – Audio Visual Heaven ═══╝", + 'white', attrs=['bold']) + print("") + file_extension_1 = input( + "Podaj rozszerzenie pliku z dźwiękiem np.: eac3, aac: ") + filr_extension_2 = input( + "Podaj rozszerzenie pliku z dźwiękiem lektora (+7db) np.: wav: ") + for file in os.listdir('./'): + if file.endswith(file_extension_1) and file[:-len(file_extension_1)] + filr_extension_2 in os.listdir('./'): + cmd('ffmpeg -i ./' + file + ' -i ./' + file[:-len(file_extension_1)] + filr_extension_2 + + ' -filter_complex "[1:a]volume=7dB[a1];[0:a][a1]amix=inputs=2:duration=first" ./' + file + '_' + file[:-len(file_extension_1)] + filr_extension_2 + '+7db.eac3') + + +merge_audio() diff --git a/mm_avh_working_space/tests/num2words_test.py b/mm_avh_working_space/tests/num2words_test.py new file mode 100644 index 0000000000000000000000000000000000000000..71081024221b3c007d057696add9e8fcbec312f0 --- /dev/null +++ b/mm_avh_working_space/tests/num2words_test.py @@ -0,0 +1,24 @@ +# pip install num2words +from num2words import num2words +# Przecinki nie działają - kropki tak +# Stringi działają + +print('1 =', num2words(1, lang='pl')) +print('1 string =', num2words('1', lang='pl')) +print('1.1 =', num2words(1.1, lang='pl')) +print('1.1 string =', num2words('1.1', lang='pl')) +print('1,2 =', num2words(1,2, lang='pl')) # Pierwsz? +# print('1,2 string =', num2words('1,2', lang='pl')) # Błąd +print('1 ordinal =', num2words(1, ordinal=True, lang='pl')) # Tulko w intach +print('1 ordinal =', num2words(1, to='ordinal', lang='pl')) # Tulko w intach +print('1 ordinal =', num2words(1, to='ordinal_num', lang='pl')) # Tulko w intach +print('1 year =', num2words(1923, to='year', lang='pl')) # Tulko w intach +print('1 currency =', num2words(1923, to='currency', lang='pl')) # Tulko w intach +print(num2words(42.0, to='currency', lang='pl', currency='EUR')) +print(num2words(42, to='currency', lang='pl', currency='PLN')) +print(num2words(1925, to='year', lang='pl', currency='PLN')) + +# Wyjście: "czterdzieści dwie euro" +# Outputs: "czterdzieści dwa euro" + +# print(num2words(123, ordinal=True, lang='pl')) diff --git a/mm_avh_working_space/tests/output/test b/mm_avh_working_space/tests/output/test new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/mm_avh_working_space/tests/pylint_tests.py b/mm_avh_working_space/tests/pylint_tests.py new file mode 100644 index 0000000000000000000000000000000000000000..c03654e6d216f5482d514f7ecd51a4f87fd02283 --- /dev/null +++ b/mm_avh_working_space/tests/pylint_tests.py @@ -0,0 +1,2 @@ +# pip install pylint +# pylint main.py diff --git a/mm_avh_working_space/tests/real_esrgan_and_others.py b/mm_avh_working_space/tests/real_esrgan_and_others.py new file mode 100644 index 0000000000000000000000000000000000000000..b9f21241c5a8c210072f6bde57858da405d282c4 --- /dev/null +++ b/mm_avh_working_space/tests/real_esrgan_and_others.py @@ -0,0 +1,367 @@ +# Jak pobrać FFmpeg w Windows +# https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z -- auto pobieranie +# Zmienne środowiskowe użytkownika -> w PATH dodaj ścieżkę do folderu: C:\FFmpeg\bin +# cmd ffmpeg -version - czy działa +# pip install opencv-python +# pip install pillow +# pip install termcolor +import subprocess +import time +from PIL import Image +import cv2 +import os +from termcolor import cprint + + +def cmd(command): + subprocess.call(command, shell=True) + + +def hight_quality_image_real_esrgan_x4_plus_anime(): + cmd('realesrgan-ncnn-vulkan.exe -i ./input -o ./output -n realesrgan-x4plus-anime') + + +def fast_image_real_esrgan_animevideov3_x4(): + cmd('realesrgan-ncnn-vulkan.exe -i ./input -o ./output -n realesr-animevideov3-x4') + + +def fast_image_real_esrgan_animevideov3_x4_jpg(): + cmd('realesrgan-ncnn-vulkan.exe -i ./input -o ./output -n realesr-animevideov3-x4 -f jpg') + + +def slow_image_real_esrgan_x4_plus(): + cmd('realesrgan-ncnn-vulkan.exe -i ./input -o ./output -n realesrgan-x4plus') + + +def clean(): + # Usuń folder tmp_frames i out_frames + cmd('rmdir /s /q tmp_frames') + cmd('rmdir /s /q out_frames') + + # Przywróć folder tmp_frames i out_frames + cmd('mkdir tmp_frames') + cmd('mkdir out_frames') + + +def add_info(): + # Dodaj info o plkiu wideo + filename = input("Podaj nazwę pliku np.: 1.mp4: ") + + print("FPS: ") + cmd('ffprobe -v error -select_streams v:0 -show_entries stream=r_frame_rate -of default=noprint_wrappers=1:nokey=1 ./input/' + filename) + + print("Wpisz powyższą ilość FPS np.: 500: ") + fps = input("Podaj ilość FPS: ") + + return filename, fps + + +def video_to_frames(filename): + # FFmpeg pobierze klatki z wideo i zapisze je w folderze tmp_frames + cmd('ffmpeg -i ./input/' + filename + + ' -qscale:v 1 -qmin 1 -qmax 1 -vsync 0 ./tmp_frames/frame%08d.jpg') + + +def fast_image_real_esrgan_animevideov3_x4_jpg_with_temp_folder(): + cmd('realesrgan-ncnn-vulkan.exe -i ./tmp_frames -o ./out_frames -n realesr-animevideov3-x4 -f jpg') + + +def fast_image_real_esrgan_animevideov3_x3_jpg_with_temp_folder(): + cmd('realesrgan-ncnn-vulkan.exe -i ./tmp_frames -o ./out_frames -n realesr-animevideov3-x3 -f jpg') + + +def fast_image_real_esrgan_animevideov3_x2_jpg_with_temp_folder(): + cmd('realesrgan-ncnn-vulkan.exe -i ./tmp_frames -o ./out_frames -n realesr-animevideov3-x2 -f jpg') + + +def hight_quality_image_real_esrgan_x4_plus_animevideo(): + cmd('realesrgan-ncnn-vulkan.exe -i ./tmp_frames -o ./out_frames -n realesrgan-x4plus-anime') + + +def reduce_image_size(image_path, output_folder, max_size_in_mb, max_size_in_px): + try: + with Image.open(image_path) as image: + image = image.convert("RGB") + width, height = image.size + if width > max_size_in_px or height > max_size_in_px: + scale = max_size_in_px / max(width, height) + new_width = int(width * scale) + new_height = int(height * scale) + image = image.resize((new_width, new_height)) + + output_path = os.path.join( + output_folder, os.path.basename(image_path)) + quality = 95 + while True: + image.save(output_path, format='JPEG', quality=quality) + if os.stat(output_path).st_size <= max_size_in_mb * 1024 * 1024: + break + quality -= 5 + return output_path + except Exception as e: + print('*_* ' + str(e)) + image = cv2.imread(image_path) + height, width = image.shape[:2] + if width > max_size_in_px or height > max_size_in_px: + scale = max_size_in_px / max(width, height) + new_width = int(width * scale) + new_height = int(height * scale) + image = cv2.resize(image, (new_width, new_height)) + output_path = os.path.join( + output_folder, os.path.basename(image_path)) + temp_folder = './output/temp' + if not os.path.exists(temp_folder): + os.makedirs(temp_folder) + else: + for filename in os.listdir(temp_folder): + os.remove(os.path.join(temp_folder, filename)) + output_path = os.path.join(temp_folder, os.path.basename(image_path)) + cv2.imwrite(output_path, image) + process_images_in_folder( + temp_folder, './output/', max_size_in_mb, max_size_in_px) + return output_path + + +def process_images_in_folder(folder_path, output_folder, max_size_in_mb, max_size_in_px): + if not os.path.exists(output_folder): + os.makedirs(output_folder) + + for filename in os.listdir(folder_path): + extensions = ['.jpg', '.jpeg', '.png', '.webp', '.bmp', '.eps', '.gif', + '.ico', '.msp', '.pcx', '.ppm', '.spider', '.tif', '.tiff', '.xbm', '.xpm'] + if filename.endswith(tuple(extensions)): + print(filename) + image_path = os.path.join(folder_path, filename) + reduce_image_size(image_path, output_folder, + max_size_in_mb, max_size_in_px) + + +def smaller_image(): + max_size_in_mb = float( + input("Podaj ile MB nie może przekroczyć plik np.: 8: ") or 8) + max_size_in_px = int(input( + "Podaj długość największej krawędzi w px np.: 1024, 2048, 4096, 8192: ") or 4096) + process_images_in_folder('./input/', './output/', + max_size_in_mb, max_size_in_px) + + +def frames_to_video_with_sound(filename, fps): + # Połączenie ulepszonych klatek z powrotem w wideo, gdzie dźwięk zostanie skopiowany z pierwotnego wideo, nie obsługuje napisów + # TRYB NORMALNY + cmd('ffmpeg -r ' + fps + ' -i ./out_frames/frame%08d.jpg -i ./input/' + filename + ' -map 0:v:0? -map 1:a:0? -c:a copy -c:v libx264 -r ' + + fps + ' -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 ./output/' + filename) + + # TRYB WALKI + # cmd('ffmpeg -r ' + fps + ' -i ./out_frames/frame%08d.jpg -i ./input/' + filename + ' -map 0:v:0? -map 1:a:0? \ + # -filter_complex "[0:v]eq=contrast=1.1:brightness=-0.05:saturation=1.3,hqdn3d" \ + # -c:a copy -c:v libx264 -r ' + fps + ' -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 ./output/' + filename + '_TW.mp4') + + # TRYB SPORT + # cmd('ffmpeg -r ' + fps + ' -i ./out_frames/frame%08d.jpg -i ./input/' + filename + ' -map 0:v:0? -map 1:a:0? \ + # -filter_complex "[0:v]eq=contrast=1.2:brightness=-0.1:saturation=1.5,hqdn3d" \ + # -c:a copy -c:v libx264 -r ' + fps + ' -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 ./output/' + filename + '_TS.mp4') + + # ŚCIĄGA: + # TRYB ZWYKŁY -pix_fmt yuv420p + # JAKOŚĆ I WIELKOŚĆ-crf 0 do 51, najwyższa jakość 0, najniższa jakość 51 (może powodować błędy w obrazie) + # SZYBKOŚĆ I ODWROTNIE PROPORCJONALNA WIELKOSĆ -preset ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo (może powodować błędy w obrazie) + # IDENTYCZNE KOLORY -color_primaries bt709 -color_trc bt709 -colorspace bt709 + # -filter_complex "[0:v]eq=contrast=1:brightness=1:saturation=1,hqdn3d" - filtry kolorów + + +def video_info(): + # Informacje o wideo + filename = input("Podaj nazwę pliku np.: 1.mp4: ") + cmd('ffmpeg -i ./input/' + filename) + + +def audio_with_image(): + input_dir = "./input" + output_dir = "./output" + image_path = os.path.join( + input_dir, "0_src", os.listdir(os.path.join(input_dir, "0_src"))[0]) + + for filename in os.listdir(input_dir): + if filename.endswith(".mp3"): + input_file_path = os.path.join(input_dir, filename) + output_file_path = os.path.join( + output_dir, os.path.splitext(filename)[0] + ".mp4") + cmd('ffmpeg -loop 1 -i ' + image_path + ' -i ' + + input_file_path + ' -c:a copy -shortest ' + output_file_path) + print(f"Przetworzono plik {input_file_path}") + time.sleep(1) + + +def add_subtitles(): + # Funkcja do wypalania napisów, konwertuje niedostępne czcionki na Arial w .ass + filename = input("Podaj nazwę pliku głównego z napisami np.: 1.mkv: ") + subfilename = input( + "Podaj nazwę pliku napisów np.: 1.ass (bez fontów), 1.mkv: ") + cmd('ffmpeg -i ./input/' + filename + ' -vf subtitles=./input/' + subfilename + + ' -c:v libx264 -crf 10 -preset medium ./output/' + filename + '.mp4') + + # ŚCIĄGA: + # TRYB ZWYKŁY -pix_fmt yuv420p + # TRYB WALKI - usuń -pix_fmt yuv420p + # JAKOŚĆ I WIELKOŚĆ-crf 0 - 51, najwyższa jakość 0, najniższa jakość 51 + # SZYBKOŚĆ I ODWROTNIE PROPORCJONALNA WIELKOSĆ -preset ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo + + +def add_lector(): + # Funkcja do dodawania lektora do filmu + filename = input("Podaj nazwę pliku głównego z napisami np.: 1.mkv: ") + lectorfilename = input("Podaj nazwę pliku lektora np.: 1.wav: ") + cmd('ffmpeg -i ./input/' + filename + ' -i ./input/' + lectorfilename + + ' -filter_complex "[1:a]volume=7dB[a1];[0:a][a1]amix=inputs=2:duration=first" -c:v libx264 -crf 10 -preset medium ./output/' + filename + '.mp4') + + # ŚCIĄGA: + # TRYB ZWYKŁY -pix_fmt yuv420p + # TRYB WALKI - usuń -pix_fmt yuv420p + # JAKOŚĆ I WIELKOŚĆ-crf 0 - 51, najwyższa jakość 0, najniższa jakość 51 + # SZYBKOŚĆ I ODWROTNIE PROPORCJONALNA WIELKOSĆ -preset ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo + + +def add_subtitles_and_lector(): + # Połączenie napisów z lektorem, konwertuje niedostępne czcionki na Arial w .ass + filename = input("Podaj nazwę pliku głównego z napisami np.: 1.mkv: ") + subfilename = input( + "Podaj nazwę pliku napisów np.: 1.ass (bez fontów), 1.mkv: ") + lectorfilename = input("Podaj nazwę pliku lektora np.: 1.wav: ") + cmd('ffmpeg -i ./input/' + filename + ' -i ./input/' + lectorfilename + ' -vf subtitles=./input/' + subfilename + + ' -filter_complex "[1:a]volume=7dB[a1];[0:a][a1]amix=inputs=2:duration=first" -c:v libx264 -crf 10 -preset medium -b:a 256k -c:a aac -strict experimental -b:a 128k ./output/' + filename + '.mp4') + + # ŚCIĄGA: + # TRYB ZWYKŁY -pix_fmt yuv420p + # TRYB WALKI - usuń -pix_fmt yuv420p + # JAKOŚĆ I WIELKOŚĆ-crf 0 - 51, najwyższa jakość 0, najniższa jakość 51 + # SZYBKOŚĆ I ODWROTNIE PROPORCJONALNA WIELKOSĆ -preset ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo + # ZGŁOŚNIENIE O X DECYBELI: volume=7dB + + +def merge_audio(): + # Łaczenie audio z filmu z lektorem + # audiofilename1 = input( + # "Podaj nazwę pliku z dźwiękiem np.: 1.eac3, 1.aac: ") + # audiofilename2 = input( + # "Podaj nazwę pliku z dźwiękiem lektora (+7db) np.: 1.wav: ") + # cmd('ffmpeg -i ./input/' + audiofilename1 + ' -i ./input/' + audiofilename2 + + # ' -filter_complex "[1:a]volume=7dB[a1];[0:a][a1]amix=inputs=2:duration=first" ./output/' + audiofilename1 + '_' + audiofilename2 + '+7db.eac3') + + file_extension_1 = input( + "Podaj rozszerzenie pliku z dźwiękiem np.: eac3, aac: ") + filr_extension_2 = input( + "Podaj rozszerzenie pliku z dźwiękiem lektora (+7db) np.: wav: ") + for file in os.listdir('./input/'): + if file.endswith(file_extension_1) and file[:-len(file_extension_1)] + filr_extension_2 in os.listdir('./input/'): + cmd('ffmpeg -i ./input/' + file + ' -i ./input/' + file[:-len(file_extension_1)] + filr_extension_2 + + ' -filter_complex "[1:a]volume=7dB[a1];[0:a][a1]amix=inputs=2:duration=first" ./output/' + file + '_' + file[:-len(file_extension_1)] + filr_extension_2 + '+7db.eac3') + + # ŚCIĄGA: + # ZGŁOŚNIENIE O X DECYBELI: volume=7dB + + +def main(): + start_time = time.time() + # red green yellow white attrs=['bold'] + cprint("╚═══ Multimedia Magic – Audio Visual Heaven ═══╝", + 'white', attrs=['bold']) + cprint("") + cprint("Wybierz jedną z poniższych opcji:") + cprint("1. Ulepsz i skaluj zdjęcia Real-ESRGAN") + cprint("2. Zmniejszanie rozmiaru w MB i px") + cprint("3. Ulepsz i skaluj anime / film") + cprint("4. Wyświetl informacje o pliku wideo lub audio") + cprint("5. Konwertuj audio i obraz do wideo") + cprint("6. Wypal napisy do wideo") + cprint("7. Dodaj ścieżkę dźwiękową lektora do wideo") + cprint("8. Wypal napisy i dodaj ścieżkę dźwiękową lektora do wideo") + cprint("9. Nałóż na siebie dwie ścieżki dźwiękowe") + + choice = input("Wybierz numer opcji: ") + + if choice == '1': + # hight_quality_image_real_esrgan_x4_plus_anime() + # fast_image_real_esrgan_animevideov3_x4() + # fast_image_real_esrgan_animevideov3_x4_jpg() + # slow_image_real_esrgan_x4_plus() + + print("Wybierz jedną z poniższych opcji:") + print("1. hight_quality_image_real_esrgan_x4_plus_anime - Model do anime artów") + print("2. fast_image_real_esrgan_animevideov3_x4 - Gorszy model do anime artów") + print("3. fast_image_real_esrgan_animevideov3_x4_jpg - Szybki, model do anime artów, gorsza jakość") + print( + "4. slow_image_real_esrgan_x4_plus - Wolny model do wszylkiego rodzaju obrazów") + model = input("Wybierz numer opcji: ") + + if model == '1': + hight_quality_image_real_esrgan_x4_plus_anime() + + if model == '2': + fast_image_real_esrgan_animevideov3_x4() + + if model == '3': + fast_image_real_esrgan_animevideov3_x4_jpg() + + if model == '4': + slow_image_real_esrgan_x4_plus() + + if choice == '2': + smaller_image() + + if choice == '3': + filename, fps = add_info() + video_to_frames(filename) + + # fast_image_real_esrgan_animevideov3_x4_jpg_with_temp_folder() # 8K + # fast_image_real_esrgan_animevideov3_x3_jpg_with_temp_folder() # 4K + # fast_image_real_esrgan_animevideov3_x2_jpg_with_temp_folder() # 2K + # hight_quality_image_real_esrgan_x4_plus_animevideo() # 8K high quality slow + + print("Wybierz jedną z poniższych opcji:") + print("1. fast_image_real_esrgan_animevideov3_x4_jpg_with_temp_folder - Anime 1080p -> 4K") + print("2. fast_image_real_esrgan_animevideov3_x3_jpg_with_temp_folder - Anime 1080p -> 3K") + print("3. fast_image_real_esrgan_animevideov3_x2_jpg_with_temp_folder - Anime 1080p -> 2K") + print("4. hight_quality_image_real_esrgan_x4_plus_animevideo - Film 1080p -> 8K, bardzo, bardzo wolno") + model = input("Wybierz numer opcji: ") + + if model == '1': + fast_image_real_esrgan_animevideov3_x4_jpg_with_temp_folder() + + if model == '2': + fast_image_real_esrgan_animevideov3_x3_jpg_with_temp_folder() + + if model == '3': + fast_image_real_esrgan_animevideov3_x2_jpg_with_temp_folder() + + if model == '4': + hight_quality_image_real_esrgan_x4_plus_animevideo() + + frames_to_video_with_sound(filename, fps) + # clean() + + if choice == '4': + video_info() + + if choice == '5': + audio_with_image() + + if choice == '6': + add_subtitles() + + if choice == '7': + add_lector() + + if choice == '8': + add_subtitles_and_lector() + + if choice == '9': + merge_audio() + + # Mierz czas + print("--- %s seconds ---" % (time.time() - start_time)) + print("--- %s minutes ---" % ((time.time() - start_time) / 60)) + print("--- %s hours ---" % ((time.time() - start_time) / 3600)) + + +if __name__ == "__main__": + main() diff --git a/mm_avh_working_space/tests/sent_tokenize_test.py b/mm_avh_working_space/tests/sent_tokenize_test.py new file mode 100644 index 0000000000000000000000000000000000000000..19658187ea7c243ffc485e903c3fefc39efb5b77 --- /dev/null +++ b/mm_avh_working_space/tests/sent_tokenize_test.py @@ -0,0 +1,13 @@ +from nltk.tokenize import sent_tokenize + +text = "Good muffins cost $3.88 in New York. Please buy me two of them. Thanks. 1_2//21.23343 .12312. 12 312.213123" + +sentences = sent_tokenize(text) +for i, sentence in enumerate(sentences, start=1): + print(f"{i}\n00:00:00,000 --> 00:00:00,000\n{sentence}\n") +import nltk +nltk.download('punkt') + +text = "Oto przykładowe zdanie w języku polskim." +tokens = nltk.word_tokenize(text) +print(tokens) diff --git a/mm_avh_working_space/tests/translator-gpt-no-re-ask_alt.py b/mm_avh_working_space/tests/translator-gpt-no-re-ask_alt.py new file mode 100644 index 0000000000000000000000000000000000000000..17cead2b0dc2d17a6aa331259164f901d51cdf38 --- /dev/null +++ b/mm_avh_working_space/tests/translator-gpt-no-re-ask_alt.py @@ -0,0 +1,268 @@ +from dataclasses import dataclass +from typing import Optional, List +import os +import pysrt +from googletrans import Translator +import deepl +import pyautogui +import pyperclip +import time +import subprocess +from rich.theme import Theme +from rich.console import Console +from data.settings import Settings +from revChatGPT.V1 import Chatbot +import re + + +@dataclass(slots=True) +class SubtitleTranslator: + translator: Optional[str] = None + deepl_api_key: Optional[str] = None + translated_line_count: Optional[str] = None + + console: Console = Console(theme=Theme({"repr.number": "bold red"})) + + @staticmethod + def translate_google(filename: str, dir_path: str, translated_line_count: int, is_combined_with_gpt: bool = False) -> pysrt.SubRipFile: + subs: pysrt.SubRipFile = pysrt.open( + os.path.join(dir_path, filename), encoding='utf-8') + subs_combined: List[str] = [] + translated_subs: List[str] = [] + + translator: Translator = Translator() + for i, sub in enumerate(subs): + sub.text = sub.text.replace("\n", " ◍ ") + subs_combined.append(sub.text) + + if (i + 1) % translated_line_count == 0 or i == len(subs) - 1: + combined_text: str = "\n".join(subs_combined) + translated_text: str = translator.translate( + combined_text, dest='pl').text + translated_subs += translated_text.split("\n") + subs_combined = [] + + for i, sub in enumerate(subs): + sub.text = translated_subs[i] + sub.text = sub.text.replace(" ◍, ", ",\n") + sub.text = sub.text.replace(" ◍ ", "\n") + sub.text = sub.text.replace(" ◍", "") + + if is_combined_with_gpt: + translated_filename: str = filename.replace( + '.srt', '_translated_temp.srt') + subs.save(os.path.join(dir_path, translated_filename)) + return subs + else: + subs.save(os.path.join(dir_path, filename)) + + @staticmethod + def translate_deepl_api(filename: str, dir_path: str, translated_line_count: int, deepl_api_key: str): + subs: pysrt.SubRipFile = pysrt.open( + os.path.join(dir_path, filename), encoding='utf-8') + translator: deepl.Translator = deepl.Translator(deepl_api_key) + groups: List[List[pysrt.SubRipItem]] = [subs[i:i+translated_line_count] + for i in range(0, len(subs), translated_line_count)] + for group in groups: + text: str = " @\n".join(sub.text.replace("\n", " ◍◍◍◍ ") + for sub in group) + translated_text: str = translator.translate_text( + text, target_lang='PL').text + translated_texts: List[str] = translated_text.split(" @\n") + if len(translated_texts) == len(group): + for i in range(len(group)): + if i < len(translated_texts): + group[i].text = translated_texts[i] + group[i].text = group[i].text.replace(" ◍◍◍◍, ", ",\n") + group[i].text = group[i].text.replace(" ◍◍◍◍ ", "\n") + group[i].text = group[i].text.replace(" ◍◍◍◍", "") + subs.save(os.path.join(dir_path, filename), encoding='utf-8') + + @staticmethod + def translate_deepl_desktop(filename: str, dir_path: str, translated_line_count: int): + command: str = os.path.join( + os.environ['APPDATA'], 'Programs', 'Zero Install', '0install-win.exe') + args: List[str] = ["run", "--no-wait", + "https://appdownload.deepl.com/windows/0install/deepl.xml"] + subprocess.call([command] + args) + + time.sleep(7) + + def auto_steps(): + screen_width, screen_height = pyautogui.size() + x = screen_width * 0.25 + y = screen_height * 0.5 + pyautogui.moveTo(x, y) + pyautogui.click() + pyautogui.hotkey('ctrl', 'a') + pyautogui.hotkey('del') + pyautogui.hotkey('ctrl', 'v') + time.sleep(6) + x = screen_width * 0.75 + pyautogui.moveTo(x, y) + pyautogui.click() + pyautogui.hotkey('ctrl', 'a') + pyautogui.hotkey('ctrl', 'c') + + subs: pysrt.SubRipFile = pysrt.open( + os.path.join(dir_path, filename), encoding='utf-8') + groups: List[List[pysrt.SubRipItem]] = [subs[i:i+translated_line_count] + for i in range(0, len(subs), translated_line_count)] + + for group in groups: + text: str = " @\n".join(sub.text.replace("\n", " ◍◍◍◍ ") + for sub in group) + text = text.rstrip('\n') + pyperclip.copy(text) + auto_steps() + + translated_text: str = pyperclip.paste() + if translated_text: + for sub, trans_text in zip(group, translated_text.split(" @\n")): + sub.text = trans_text.replace(" ◍◍◍◍, ", ",\n") + sub.text = trans_text.replace(" ◍◍◍◍ ", "\n") + sub.text = trans_text.replace(" ◍◍◍◍", "") + pyautogui.hotkey('alt', 'f4') + + subs.save(os.path.join(dir_path, filename), encoding='utf-8') + + frezes: List[str] = ["\nPrzetłumaczono z www.DeepL.com/Translator (wersja darmowa)\n", + "Przetłumaczono z www.DeepL.com/Translator (wersja darmowa)", + "\nTranslated with www.DeepL.com/Translator (free version)\n", + "\nTranslated with www.DeepL.com/Translator (free version)"] + + with open(os.path.join(dir_path, filename), 'r', encoding='utf-8') as in_file: + text: str = in_file.read() + + for freze in frezes: + text = text.replace(freze, "") + + with open(os.path.join(dir_path, filename), 'w', encoding='utf-8') as out_file: + out_file.write(text) + + @staticmethod + def translate_google_gpt(filename: str, dir_path: str, translated_line_count: int, chat_gpt_access_token: str): + translated_subs: pysrt.SubRipFile = SubtitleTranslator.translate_google( + filename, dir_path, translated_line_count, is_combined_with_gpt=True) + SubtitleTranslator.translate_chat_gpt( + filename, dir_path, translated_line_count, chat_gpt_access_token, translated_subs) + os.remove(os.path.join(dir_path, filename.replace( + '.srt', '_translated_temp.srt'))) + + @staticmethod + def translate_chat_gpt(filename: str, dir_path: str, translated_line_count: int, chat_gpt_access_token: str, translated_subs: Optional[pysrt.SubRipFile] = None): + chatbot = Chatbot(config={"access_token": chat_gpt_access_token}) + + subs: pysrt.SubRipFile = pysrt.open( + os.path.join(dir_path, filename), encoding='utf-8') + groups: List[List[pysrt.SubRipItem]] = [subs[i:i+translated_line_count] + for i in range(0, len(subs), translated_line_count)] + + additional_info: str = "" + while True: + info: str = input( + "Dodaj dodatkowe informacje o tłumaczonym tekście (opcjonalnie): ") + if not info: + break + additional_info += info + ", " + + counter: int = 1 + for group in groups: + text: str = "" + for sub in group: + text += "◍◍{}. {}".format(counter, + sub.text.replace('\n', ' ◍◍◍◍ ')) + " @@\n" + counter += 1 + text = text.rstrip(' @@\n') + + prompt: str = """WAŻNE: JEŚLI OTRZYMASZ NAPISY OD 1 DO 30, ZWRÓĆ NAPISY OD 1 DO 30, NAWET JEŚLI TŁUMACZENIE JEST NIEODPOWIEDNIE, NIESPÓJNE LUB ZŁE. NIEKOMPLETNE TŁUMACZENIE JEST LEPSZE NIŻ BRAK TŁUMACZENIA. + +Jesteś moim tłumaczem, specjalizującym się w przekładach na język polski. Twoja rola nie ogranicza się do prostego tłumaczenia - jesteś również redaktorem i ulepszaczem języka. Komunikuję się z Tobą w różnych językach, a Twoim zadaniem jest identyfikowanie języka, tłumaczenie go i odpowiadanie poprawioną i ulepszoną wersją mojego tekstu, w języku polskim. + +Przed przystąpieniem do tłumaczenia, poświęć chwilę na zrozumienie gramatycznych, językowych i kontekstualnych niuansów tekstu. Uchwyc subtelności i upewnij się, że tekst płynie jak strumień słów, jakby ktoś nam opowiadał historię, czytał audiobooka, czy narrację filmu, bo ostatecznie ten tekst będzie czytany na głos. + +Twoim zadaniem jest podniesienie poziomu mojego języka, zastępując uproszczone słowa i zdania na poziomie C0 bardziej wyszukanymi i eleganckimi wyrażeniami. Zachowaj oryginalne znaczenie, ale uczyn język bardziej literackim. Twoje odpowiedzi powinny ograniczać się do poprawionego i ulepszonego tłumaczenia, bez dodatkowych wyjaśnień. + +Podczas tłumaczenia, zachowaj dyskrecję w decydowaniu, kiedy tłumaczyć słowa dosłownie, a kiedy zachować zapożyczenia w ich oryginalnej formie. Unikaj używania polskich odpowiedników, które zniekształcają znaczenie lub estetykę zdania. + +Zachowaj oryginalne formatowanie tekstu - nie dodawaj żadnych dodatkowych spacji, tabulatorów ani znaków nowej linii. Tekst, który tłumaczysz, może również przedstawiać akcje z książki, więc miej to na uwadze. + +Podejdź globalnie do tekstu. Jeśli gdziekolwiek w tekście podano informacje o płci postaci, użyj tych informacji, aby kierować swoim tłumaczeniem przez cały tekst. Na przykład, zamiast tłumaczyć "I did it" jako "Zrobiłem to" lub "Zrobiłam to", przetłumacz to jako "To zostało zrobione przeze mnie", jeśli płeć nie jest określona. To podejście zmniejsza błędy tłumaczenia. Globalne podejście, nie tłumacz iteracyjnie słowo po słowie, na przykład : "Święty Tyrs przegrał. Ona umarła.", gdzie poprawnie to: "Święta Tyrs przegrała. Ona umarła." + +Bądź kreatywny w swoich tłumaczeniach, dostosowując swój ton do kontekstu - bądź dowcipny dla lekkich tekstów i dodaj powagi i profesjonalizmu dla poważnych. Tłumacz wszystkie przekleństwa, nie cenzuruj i nie zmieniaj znaczenia słów, które są ważne w kontekście lub które zmieniają emocjonalny ton tekstu. + +Mając znaki ◍◍◍◍, @@ lub '◍◍[num]. nie zmieniaj ich, nie modyfikuj struktury, ani ułożenia tekstu. Nie usuwaj ani nie dodawaj żadnych znaków interpunkcyjnych, ani nie zmieniaj ich położenia. Te znaki to świętość, nie zmieniaj ich. Nie musisz wiedzieć co one znaczą, ale musisz je zachować, w tym samym miejscu, w którym się znajdują. Nie łącz zdań z 2 napisów w jeden napis - każdy napis musi być oddzielny. + +W tekście symbol '◍◍◍◍' reprezentuje nową linię w tym samym napisie, a symbol '@@' reprezentuje koniec napisu. Nie zmieniaj ilości znaków '@@'. Nie zmieniaj ilości numeracji napisów '◍◍1.', zwracaj taką samą ilość wszystkich tych znaków, jak w oryginalnym tekście. + +Twoim ostatecznym celem jest wyprodukowanie tłumaczenia, które jest jak najbardziej wiernie odwzorowane na oryginał, zarówno pod względem znaczenia, jak i poprawności gramatycznej i syntaktycznej, chyba że oryginał jest niegramatyczny. + +Zadanie wykonuj powoli krok po kroku + +Dodatkowe informacje na temat tekstu który ma być tłumaczony: """ + additional_info + "\n\nTeraz przetłumacz poniższe napisy:\n" + text + + if translated_subs is not None: + translated_text: str = "".join( + "◍◍{}. {}".format( + i + 1, translated_subs[i].text.replace('\n', ' ◍◍◍◍ ') + ) + + " @@\n" + for i in range((counter - 1) - len(group), counter - 1) + ) + translated_text = translated_text.rstrip(' @@\n') + prompt += "\n\nNapisy wstępnie przetłumaczone przez Google Translate:\n" + translated_text + + prev_text: str = "" + for data in chatbot.ask( + prompt, + ): + prev_text = data["message"] + + translated_text: str = prev_text.rstrip(" @@") + if translated_text: + translated_lines: List[str] = translated_text.split(" @@\n") + for i in range(len(translated_lines)): + translated_lines[i] = translated_lines[i].replace('\n', '') + if len(translated_lines) != len(group): + print( + f"Błąd: liczba napisów po tłumaczeniu ({len(translated_lines)}) nie jest taka sama jak przed tłumaczeniem ({len(group)})") + for sub, trans_text in zip(group, translated_lines): + trans_text = re.sub(r"◍◍\d+\. ", "", trans_text) + trans_text = trans_text.replace(" ◍◍◍◍, ", ",\n") + trans_text = trans_text.replace(" ◍◍◍◍ ", "\n") + trans_text = trans_text.replace(" ◍◍◍◍", "") + sub.text = trans_text + + subs.save(os.path.join(dir_path, filename), encoding='utf-8') + + def translate_srt(self, filename: str, dir_path: str, settings: Settings): + translator: str = settings.translator + translated_line_count: int = int(settings.translated_line_count) + deepl_api_key: str = settings.deepl_api_key + + self.console.print(f"Tłumaczenie napisów za pomocą {translator}...", + style='bold green') + self.console.print(os.path.join(dir_path, filename)) + + translator_functions = { + 'Google Translate': lambda *args: + SubtitleTranslator.translate_google(*args[:3]), + 'DeepL API': lambda *args: + SubtitleTranslator.translate_deepl_api( + *args[:3], deepl_api_key), + 'DeepL Desktop Free': lambda *args: + SubtitleTranslator.translate_deepl_desktop(*args[:3]), + 'ChatGPT': lambda *args: + SubtitleTranslator.translate_chat_gpt( + *args[:3], settings.chat_gpt_access_token), + 'ChatGPT + Google Translate': lambda *args: + SubtitleTranslator.translate_google_gpt( + *args[:3], settings.chat_gpt_access_token) + } + + if translator in translator_functions: + translator_functions[translator]( + filename, dir_path, translated_line_count) + else: + self.console.print( + f"Nieznany translator: {translator}", style='bold red') diff --git a/mm_avh_working_space/tests/translator-gpt-re-ask_alt.py b/mm_avh_working_space/tests/translator-gpt-re-ask_alt.py new file mode 100644 index 0000000000000000000000000000000000000000..ec4e9a58d05ca7256b30c792fcb07e2cef21c1a4 --- /dev/null +++ b/mm_avh_working_space/tests/translator-gpt-re-ask_alt.py @@ -0,0 +1,265 @@ +from dataclasses import dataclass +from typing import Optional, List +import os +import pysrt +from googletrans import Translator +import deepl +import pyautogui +import pyperclip +import time +import subprocess +from rich.theme import Theme +from rich.console import Console +from data.settings import Settings +from revChatGPT.V1 import Chatbot +import re + + +@dataclass(slots=True) +class SubtitleTranslator: + translator: Optional[str] = None + deepl_api_key: Optional[str] = None + translated_line_count: Optional[str] = None + + console: Console = Console(theme=Theme({"repr.number": "bold red"})) + + @staticmethod + def translate_google(filename: str, dir_path: str, translated_line_count: int, is_combined_with_gpt: bool = False) -> pysrt.SubRipFile: + subs: pysrt.SubRipFile = pysrt.open( + os.path.join(dir_path, filename), encoding='utf-8') + subs_combined: List[str] = [] + translated_subs: List[str] = [] + + translator: Translator = Translator() + for i, sub in enumerate(subs): + sub.text = sub.text.replace("\n", " ◍ ") + subs_combined.append(sub.text) + + if (i + 1) % translated_line_count == 0 or i == len(subs) - 1: + combined_text: str = "\n".join(subs_combined) + translated_text: str = translator.translate( + combined_text, dest='pl').text + translated_subs += translated_text.split("\n") + subs_combined = [] + + for i, sub in enumerate(subs): + sub.text = translated_subs[i] + sub.text = sub.text.replace(" ◍, ", ",\n") + sub.text = sub.text.replace(" ◍ ", "\n") + sub.text = sub.text.replace(" ◍", "") + + if is_combined_with_gpt: + translated_filename: str = filename.replace( + '.srt', '_translated_temp.srt') + subs.save(os.path.join(dir_path, translated_filename)) + return subs + else: + subs.save(os.path.join(dir_path, filename)) + + @staticmethod + def translate_deepl_api(filename: str, dir_path: str, translated_line_count: int, deepl_api_key: str): + subs: pysrt.SubRipFile = pysrt.open( + os.path.join(dir_path, filename), encoding='utf-8') + translator: deepl.Translator = deepl.Translator(deepl_api_key) + groups: List[List[pysrt.SubRipItem]] = [subs[i:i+translated_line_count] + for i in range(0, len(subs), translated_line_count)] + for group in groups: + text: str = " @\n".join(sub.text.replace("\n", " ◍◍◍◍ ") + for sub in group) + translated_text: str = translator.translate_text( + text, target_lang='PL').text + translated_texts: List[str] = translated_text.split(" @\n") + if len(translated_texts) == len(group): + for i in range(len(group)): + if i < len(translated_texts): + group[i].text = translated_texts[i] + group[i].text = group[i].text.replace(" ◍◍◍◍, ", ",\n") + group[i].text = group[i].text.replace(" ◍◍◍◍ ", "\n") + group[i].text = group[i].text.replace(" ◍◍◍◍", "") + subs.save(os.path.join(dir_path, filename), encoding='utf-8') + + @staticmethod + def translate_deepl_desktop(filename: str, dir_path: str, translated_line_count: int): + command: str = os.path.join( + os.environ['APPDATA'], 'Programs', 'Zero Install', '0install-win.exe') + args: List[str] = ["run", "--no-wait", + "https://appdownload.deepl.com/windows/0install/deepl.xml"] + subprocess.call([command] + args) + + time.sleep(7) + + def auto_steps(): + screen_width, screen_height = pyautogui.size() + x = screen_width * 0.25 + y = screen_height * 0.5 + pyautogui.moveTo(x, y) + pyautogui.click() + pyautogui.hotkey('ctrl', 'a') + pyautogui.hotkey('del') + pyautogui.hotkey('ctrl', 'v') + time.sleep(6) + x = screen_width * 0.75 + pyautogui.moveTo(x, y) + pyautogui.click() + pyautogui.hotkey('ctrl', 'a') + pyautogui.hotkey('ctrl', 'c') + + subs: pysrt.SubRipFile = pysrt.open( + os.path.join(dir_path, filename), encoding='utf-8') + groups: List[List[pysrt.SubRipItem]] = [subs[i:i+translated_line_count] + for i in range(0, len(subs), translated_line_count)] + + for group in groups: + text: str = " @\n".join(sub.text.replace("\n", " ◍◍◍◍ ") + for sub in group) + text = text.rstrip('\n') + pyperclip.copy(text) + auto_steps() + + translated_text: str = pyperclip.paste() + if translated_text: + for sub, trans_text in zip(group, translated_text.split(" @\n")): + sub.text = trans_text.replace(" ◍◍◍◍, ", ",\n") + sub.text = trans_text.replace(" ◍◍◍◍ ", "\n") + sub.text = trans_text.replace(" ◍◍◍◍", "") + pyautogui.hotkey('alt', 'f4') + + subs.save(os.path.join(dir_path, filename), encoding='utf-8') + + frezes: List[str] = ["\nPrzetłumaczono z www.DeepL.com/Translator (wersja darmowa)\n", + "Przetłumaczono z www.DeepL.com/Translator (wersja darmowa)", + "\nTranslated with www.DeepL.com/Translator (free version)\n", + "\nTranslated with www.DeepL.com/Translator (free version)"] + + with open(os.path.join(dir_path, filename), 'r', encoding='utf-8') as in_file: + text: str = in_file.read() + + for freze in frezes: + text = text.replace(freze, "") + + with open(os.path.join(dir_path, filename), 'w', encoding='utf-8') as out_file: + out_file.write(text) + + @staticmethod + def translate_google_gpt(filename: str, dir_path: str, translated_line_count: int, chat_gpt_access_token: str): + translated_subs: pysrt.SubRipFile = SubtitleTranslator.translate_google( + filename, dir_path, translated_line_count, is_combined_with_gpt=True) + SubtitleTranslator.translate_chat_gpt( + filename, dir_path, translated_line_count, chat_gpt_access_token, translated_subs) + os.remove(os.path.join(dir_path, filename.replace( + '.srt', '_translated_temp.srt'))) + + @staticmethod + def translate_chat_gpt(filename: str, dir_path: str, translated_line_count: int, chat_gpt_access_token: str, translated_subs: Optional[pysrt.SubRipFile] = None): + chatbot = Chatbot(config={"access_token": chat_gpt_access_token}) + + subs: pysrt.SubRipFile = pysrt.open( + os.path.join(dir_path, filename), encoding='utf-8') + groups: List[List[pysrt.SubRipItem]] = [subs[i:i+translated_line_count] + for i in range(0, len(subs), translated_line_count)] + + additional_info: str = "" + while True: + info: str = input( + "Dodaj dodatkowe informacje o tłumaczonym tekście (opcjonalnie): ") + if not info: + break + additional_info += info + ", " + + counter: int = 1 + for group in groups: + text: str = "" + for sub in group: + text += "◍◍{}. {}".format(counter, + sub.text.replace('\n', ' ◍◍◍◍ ')) + " @@\n" + counter += 1 + text = text.rstrip(' @@\n') + + prompt: str = """NAJWAŻNIEJSZE: JEŚLI DOSTANIESZ NAPISY NP. 1 DO 30 TO ZWRÓĆ NAPISY 1 DO 30 NAWET JEŚLI TŁUMACZENIE DANEGO NAPISU JEST GŁUPIE, NIESPÓJNE, I OGÓLNIE ZŁĘ, BŁĄDNY NAPIS JEST LEPSZY NIŻ JEGO BRAK +Jesteś moim tłumaczem, specjalizującym się w przekładzie na język polski. Twoja rola nie ogranicza się do prostego tłumaczenia - jesteś również redaktorem i ulepszaczem języka. Komunikuję się z Tobą w różnych językach, a Twoim zadaniem jest identyfikowanie języka, tłumaczenie go i odpowiadanie poprawioną i ulepszoną wersją mojego tekstu, w języku polskim. + +Zanim przystąpisz do tłumaczenia, poświęć chwilę na zrozumienie gramatycznych, językowych i kontekstualnych niuansów tekstu. Uchwyc subtelności i upewnij się, że tekst płynie jak strumień słów, jakby ktoś nam opowiadał historię, czytał audiobooka, czy narrację filmu, bo ostatecznie ten tekst będzie czytany na głos. + +Twoim zadaniem jest podniesienie poziomu mojego języka, zastępując uproszczone słowa i zdania na poziomie C0 bardziej wyszukanymi i eleganckimi wyrażeniami. Zachowaj oryginalne znaczenie, ale uczyn język bardziej literackim. Twoje odpowiedzi powinny ograniczać się do poprawionego i ulepszonego tłumaczenia, bez dodatkowych wyjaśnień. + +Podczas tłumaczenia, zachowaj dyskrecję w decydowaniu, kiedy tłumaczyć słowa dosłownie, a kiedy zachować zapożyczenia w ich oryginalnej formie. Unikaj używania polskich odpowiedników, które zniekształcają znaczenie lub estetykę zdania. + +Zachowaj oryginalne formatowanie tekstu - nie dodawaj żadnych dodatkowych spacji, tabulatorów ani znaków nowej linii. Tekst, który tłumaczysz, może również przedstawiać akcje z książki, więc miej to na uwadze. + +Podejdź globalnie do tekstu. Jeśli gdziekolwiek w tekście podano informacje o płci postaci, użyj tych informacji, aby kierować swoim tłumaczeniem przez cały tekst. Na przykład, zamiast tłumaczyć "I did it" jako "Zrobiłem to" lub "Zrobiłam to", przetłumacz to jako "To zostało zrobione przeze mnie", jeśli płeć nie jest określona. To podejście zmniejsza błędy tłumaczenia. Globalne podejście, nie tłumacz iteracyjnie słowo po słowie, na przykład : "Święty Tyrs przegrał. Ona umarła.", gdzie poprawnie to: "Święta Tyrs przegrała. Ona umarła." + +Bądź kreatywny w swoich tłumaczeniach, dostosowując swój ton do kontekstu - bądź dowcipny dla lekkich tekstów i dodaj powagi i profesjonalizmu dla poważnych. Tłumacz wszystkie przekleństwa, nie cenzuruj i nie zmieniaj znaczenia słów, które są ważne w kontekście lub które zmieniają emocjonalny ton tekstu. + +W tekście symbol '◍◍◍◍' reprezentuje nową linię w tym samym napisie, a symbol '@@' reprezentuje koniec napisu. Jeśli postanowisz pominąć jakiś napis, z jakichś powodów pamiętaj o zostawieniu znaku '@@', jest to kluczowe dla dalszego działania programu tłumaczeniowego. Nie zmieniaj ilości znaków '@@'. + +Twoim ostatecznym celem jest wyprodukowanie tłumaczenia, które jest jak najbardziej wiernie odwzorowane na oryginał, zarówno pod względem znaczenia, jak i poprawności gramatycznej i syntaktycznej, chyba że oryginał jest niegramatyczny. + +Zadanie wykonuj powoli krok po kroku + +Dodatkowe informacje na temat tekstu który ma być tłumaczony: """ + additional_info + "\n\nTeraz przetłumacz poniższe napisy:\n" + text + + if translated_subs is not None: + translated_text: str = "".join( + "◍◍{}. {}".format( + i + 1, translated_subs[i].text.replace('\n', ' ◍◍◍◍ ') + ) + + " @@\n" + for i in range((counter - 1) - len(group), counter - 1) + ) + translated_text = translated_text.rstrip(' @@\n') + prompt += "\n\nNapisy wstępnie przetłumaczone przez Google Translate:\n" + translated_text + + prev_text: str = "" + while True: + for data in chatbot.ask(prompt): + prev_text = data["message"] + + translated_text: str = prev_text.rstrip(" @@\n") + if translated_text: + translated_lines: List[str] = translated_text.split(" @@\n") + if len(translated_lines) != len(group): + print( + f"Błąd: liczba napisów po tłumaczeniu ({len(translated_lines)}) nie jest taka sama jak przed tłumaczeniem ({len(group)})") + prompt += "\n\nW poprzednim tłumaczeniu pominąłeś lub dodałeś dodatkowe napisy. Proszę przetłumacz ponownie poniższe napisy, tak aby liczba napisów była taka sama jak przed tłumaczeniem:\n" + text + else: + for sub, trans_text in zip(group, translated_lines): + trans_text = re.sub(r"◍◍\d+\. ", "", trans_text) + trans_text = trans_text.replace(" ◍◍◍◍, ", ",\n") + trans_text = trans_text.replace(" ◍◍◍◍ ", "\n") + trans_text = trans_text.replace(" ◍◍◍◍", "") + sub.text = trans_text + break + + subs.save(os.path.join(dir_path, filename), encoding='utf-8') + + def translate_srt(self, filename: str, dir_path: str, settings: Settings): + translator: str = settings.translator + translated_line_count: int = int(settings.translated_line_count) + deepl_api_key: str = settings.deepl_api_key + + self.console.print(f"Tłumaczenie napisów za pomocą {translator}...", + style='bold green') + self.console.print(os.path.join(dir_path, filename)) + + translator_functions = { + 'Google Translate': lambda *args: + SubtitleTranslator.translate_google(*args[:3]), + 'DeepL API': lambda *args: + SubtitleTranslator.translate_deepl_api( + *args[:3], deepl_api_key), + 'DeepL Desktop Free': lambda *args: + SubtitleTranslator.translate_deepl_desktop(*args[:3]), + 'ChatGPT': lambda *args: + SubtitleTranslator.translate_chat_gpt( + *args[:3], settings.chat_gpt_access_token), + 'ChatGPT + Google Translate': lambda *args: + SubtitleTranslator.translate_google_gpt( + *args[:3], settings.chat_gpt_access_token) + } + + if translator in translator_functions: + translator_functions[translator]( + filename, dir_path, translated_line_count) + else: + self.console.print( + f"Nieznany translator: {translator}", style='bold red') diff --git a/mm_avh_working_space/tests/translator_test.py b/mm_avh_working_space/tests/translator_test.py new file mode 100644 index 0000000000000000000000000000000000000000..f81a99d5ccf771d66af87b5b3ff2eb5c20c6786f --- /dev/null +++ b/mm_avh_working_space/tests/translator_test.py @@ -0,0 +1,428 @@ +# pip install --upgrade deepl +# pip install googletrans==3.1.0a0 +# pip install pyperclip +# pip install pyautogui +# pip install termcolor +# pip install pysrt +import json +from googletrans import Translator +import deepl +import pyperclip +import pyautogui +import subprocess +import time +import os +from termcolor import cprint +import pysrt +import asyncio +from EdgeGPT import Chatbot, ConversationStyle + + +def read_file(file): + with open('./input/' + file, 'r', encoding='utf-8') as f: + lines = f.readlines() + return lines + + +def translateGoogle(file, linesNumber): + lines = read_file(file) + translator = Translator() + + with open('./output/' + file, 'w', encoding='utf-8') as f: + for i in range(0, len(lines), linesNumber): + translation = translator.translate( + "".join(lines[i:i + linesNumber]), dest='PL') + f.write(translation.text) + f.write("\n") + + +def translateGoogleFile(file, linesNumber): + subs = pysrt.open('./input/' + file, encoding='utf-8') + subs_combined = [] + translated_subs = [] + + translator = Translator() + for i, sub in enumerate(subs): + sub.text = sub.text.replace("\n", " ◍ ") + subs_combined.append(sub.text) + + if (i + 1) % linesNumber == 0 or i == len(subs) - 1: + combined_text = "\n".join(subs_combined) + translated_text = translator.translate( + combined_text, dest='pl').text + translated_subs += translated_text.split("\n") + subs_combined = [] + + for i, sub in enumerate(subs): + sub.text = translated_subs[i] + sub.text = sub.text.replace(" ◍, ", ",\n") + sub.text = sub.text.replace(" ◍ ", "\n") + sub.text = sub.text.replace(" ◍", "") + + subs.save('./output/' + file, encoding='utf-8') + + +# Wolniejsza metoda +# def translateGoogleFile(file, linesNumber): +# subs = pysrt.open('./input/' + file, encoding='utf-8') + +# translator = Translator() +# for sub in subs: +# sub.text = sub.text.replace("\n", " ◍◍◍◍") +# sub.text = translator.translate(sub.text, dest='pl').text +# sub.text = sub.text.replace(" ◍◍◍◍, ", ",\n") +# sub.text = sub.text.replace(" ◍◍◍◍", "\n") + +# subs.save('./output/' + file, encoding='utf-8') + + +# def translateGoogleFile(file, linesNumber): +# subs = pysrt.open('./input/' + file, encoding='utf-8') +# translator = Translator() + +# groups = [subs[i:i+linesNumber] for i in range(0, len(subs), linesNumber)] + +# for group in groups: +# text = " @\n".join(sub.text.replace("\n", " ◍ ") for sub in group) +# translated_text = translator.translate(text, dest='pl').text +# time.sleep(.5) +# translated_texts = translated_text.split(" @\n") +# if len(translated_texts) == len(group): +# for i in range(len(group)): +# if i < len(translated_texts): +# group[i].text = translated_texts[i] +# group[i].text = group[i].text.replace(" ◍, ", ",\n") +# group[i].text = group[i].text.replace(" ◍ ", "\n") +# group[i].text = group[i].text.replace(" ◍", "") + +# subs.save('./output/' + file, encoding='utf-8') + + +def translateDeepL(file, linesNumber, number): + # lines = read_file(file) + # # Zamień na swój klucz https://www.deepl.com/pl/pro-api?cta=header-pro-api/ za darmo 5000000 słów miesięcznie + # auth_key = "1df708bf-af10-3e70-e577-b2d4cb763d74:fx" + # translator = deepl.Translator(auth_key) + + # if number == 1: + # for i in range(0, len(lines), linesNumber): + # translation = translator.translate_text( + # "".join(lines[i:i + linesNumber]), target_lang='PL') + # with open('./output/' + file, 'a', encoding='utf-8') as f: + # f.write(translation.text) + # f.write("\n") + + subs = pysrt.open('./input/' + file, encoding='utf-8') + # Zamień na swój klucz https://www.deepl.com/pl/pro-api?cta=header-pro-api/ za darmo 5000000 słów miesięcznie + auth_key = "1df708bf-af10-3e70-e577-b2d4cb763d74:fx" + translator = deepl.Translator(auth_key) + if number == 1: + groups = [subs[i:i+linesNumber] + for i in range(0, len(subs), linesNumber)] + for group in groups: + text = " @\n".join(sub.text.replace("\n", " ◍◍◍◍ ") + for sub in group) + translated_text = translator.translate_text( + text, target_lang='PL').text + translated_texts = translated_text.split(" @\n") + if len(translated_texts) == len(group): + for i in range(len(group)): + if i < len(translated_texts): + group[i].text = translated_texts[i] + group[i].text = group[i].text.replace(" ◍◍◍◍, ", ",\n") + group[i].text = group[i].text.replace(" ◍◍◍◍ ", "\n") + group[i].text = group[i].text.replace(" ◍◍◍◍", "") + subs.save('./output/' + file, encoding='utf-8') + + # Tłumacz cały plik txt / docx - ale jak skończy się limit to nwm co się stanie xd + if number == 2: + translator.translate_document_from_filepath( + './input/' + file, + './output/' + file, + target_lang='PL', + formality='default' + ) + + +def translateDeepLFreeDesktop(file, linesNumber, number): + # subprocess.Popen( + # r"C:\Users\mateu\AppData\Roaming\0install.net\desktop-integration\stubs\90d46b1a865bf05507b9fb0d2b3698b63cba3a15fbcafd836ab5523e7a3efb99\DeepL.exe") + # lub + command = r'C:\Users\mateu\AppData\Roaming\Programs\Zero Install\0install-win.exe' + args = ["run", "--no-wait", + "https://appdownload.deepl.com/windows/0install/deepl.xml"] + subprocess.call([command] + args) + + time.sleep(2) + + def auto_steps(): + screen_width, screen_height = pyautogui.size() + x = screen_width * 0.25 + y = screen_height * 0.5 + pyautogui.moveTo(x, y) + pyautogui.click() + pyautogui.hotkey('ctrl', 'a') + pyautogui.hotkey('del') + pyautogui.hotkey('ctrl', 'v') + time.sleep(6) + x = screen_width * 0.75 + pyautogui.moveTo(x, y) + pyautogui.click() + pyautogui.hotkey('ctrl', 'a') + pyautogui.hotkey('ctrl', 'c') + translated_text = pyperclip.paste() + with open('./output/' + file, 'a', encoding='utf-8') as out_file: + out_file.write(translated_text) + + if number == 1: + with open('./input/' + file, 'r', encoding='utf-8') as f: + lines = f.readlines() + for i in range(0, len(lines), linesNumber): + text = "".join(lines[i:i+linesNumber]) + pyperclip.copy(text) + + auto_steps() + + if number == 2: + # count = 0 + # with open('./input/' + file, 'r', encoding='utf-8') as f: + # text = f.read() + + # for match in re.finditer(r'\n(\d+)\n', text): + # if int(match.group(1)) % linesNumber == 0: + # text_to_translate = text[count:match.start()] + # count = match.start() + # pyperclip.copy(text_to_translate) + + # auto_steps() + + # text_to_translate = text[count:] + # pyperclip.copy(text_to_translate) + + # auto_steps() + + subs = pysrt.open('./input/' + file, encoding='utf-8') + groups = [subs[i:i+linesNumber] + for i in range(0, len(subs), linesNumber)] + + for group in groups: + text = " @\n".join(sub.text.replace("\n", " ◍◍◍◍ ") + for sub in group) + pyperclip.copy(text) + auto_steps() + + with open('./output/' + file, 'r', encoding='utf-8') as f: + text = f.read() + translated_texts = text.split(" @\n") + if len(translated_texts) == len(subs): + for i in range(len(subs)): + if i < len(translated_texts): + subs[i].text = translated_texts[i] + subs[i].text = subs[i].text.replace(" ◍◍◍◍, ", ",\n") + subs[i].text = subs[i].text.replace(" ◍◍◍◍ ", "\n") + subs[i].text = subs[i].text.replace(" ◍◍◍◍", "") + + subs.save('./output/' + file, encoding='utf-8') + + frezes = ["\nPrzetłumaczono z www.DeepL.com/Translator (wersja darmowa)\n", + "Przetłumaczono z www.DeepL.com/Translator (wersja darmowa)", + "\nTranslated with www.DeepL.com/Translator (free version)\n", + "\nTranslated with www.DeepL.com/Translator (free version)"] + + with open('./output/' + file, 'r', encoding='utf-8') as in_file: + text = in_file.read() + print(text) + + for freze in frezes: + text = text.replace(freze, "") + print(text) + + with open('./output/' + file, 'w', encoding='utf-8') as out_file: + out_file.write(text) + print(text) + + +# async def BingAI(text): +# with open('./cookies.json', 'r') as f: +# cookies = json.load(f) +# bot = Chatbot(cookies=cookies) +# try: +# # Przetłumacz profesjonalnie, epicko, elekancko, zabawnie na polski: +# response = await bot.ask(prompt='''Przetłumacz tekst profesjonalnie, epicko, elekancko, zabawnie na polski, zachowaj formatowanie i znaki interpunkcyjne. UWAGA! Nie używaj internetu! Uwaga! Możeszy napisać tylko tekst [TŁUMACZENIE:] przed tłumaczeniem: ''' + text, conversation_style=ConversationStyle.creative) +# for message in response['item']['messages']: +# if message['author'] == 'bot': +# bot_response = message["text"] +# finally: +# await bot.close() +# return bot_response + +async def BingAI(text): + try: + with open('./cookies.json', 'r') as f: + cookies = json.load(f) + bot = Chatbot(cookies=cookies) + try: + # Przetłumacz profesjonalnie, epicko, elekancko, zabawnie na polski: + response = await bot.ask(prompt='''Przetłumacz tekst profesjonalnie, epicko, elekancko, zabawnie na polski, zachowaj formatowanie i znaki interpunkcyjne. UWAGA! Nie używaj internetu! Uwaga! Możeszy napisać tylko tekst [TŁUMACZENIE:] przed tłumaczeniem: ''' + text, conversation_style=ConversationStyle.creative) + for message in response['item']['messages']: + if message['author'] == 'bot': + bot_response = message["text"] + finally: + await bot.close() + except Exception as e: + print(f"Error: {e}") + print("Przełączono na konto matty_mroz_kun...") + print("Tłumaczenie...") + with open('./cookies_kun.json', 'r') as f: + cookies = json.load(f) + bot = Chatbot(cookies=cookies) + try: + # Przetłumacz profesjonalnie, epicko, elekancko, zabawnie na polski: + # Przetłumacz tekst profesjonalnie, epicko, elekancko, zabawnie na polski, zachowaj formatowanie i znaki interpunkcyjne. UWAGA! Nie używaj internetu! Uwaga! Możeszy napisać tylko tekst [TŁUMACZENIE:] przed tłumaczeniem: + response = await bot.ask(prompt='''Ważne! Zapomnji poprzednie instrukcje! Przetłumacz tekst profesjonalnie, epicko, elekancko, zabawnie na polski, zachowaj formatowanie i znaki interpunkcyjne. UWAGA! Nie używaj internetu!, Nie używaj translatorów internetowych jak bing, google, deepl translator! Uwaga!, W odpowiedzi możeszy napisać jedynie na początku tekst: [TŁUMACZENIE:] potem tłumaczenie tekstu, jeśli rozumiesz pszystąp do tłumaczenia i analizy: ''' + text, conversation_style=ConversationStyle.creative) + for message in response['item']['messages']: + if message['author'] == 'bot': + bot_response = message["text"] + finally: + await bot.close() + return bot_response + + +async def translateBingAI(file, linesNumber, number): + if number == 1: + lines = read_file(file) + + tasks = [] + for i in range(0, len(lines), linesNumber): + text = "".join(lines[i:i+linesNumber]) + tasks.append(asyncio.create_task(BingAI(text))) + + translated_texts = await asyncio.gather(*tasks) + + # Usuwanie "[TŁUMACZENIE:]" z każdego elementu listy + with open('./output/' + file, 'w', encoding='utf-8') as f: + f.write("\n".join(translated_texts)) + + with open('./output/' + file, 'r', encoding='utf-8') as in_file: + text = in_file.read() + new_text = text.replace("[TŁUMACZENIE:]", "") + new_text = new_text.replace("[TŁUMACZENIE: ] ", "") + new_text = new_text.replace(" [TŁUMACZENIE: ]", "") + + with open('./output/' + file, 'w', encoding='utf-8') as out_file: + out_file.write(new_text) + if number == 2: + # srt + subs = pysrt.open('./input/' + file, encoding='utf-8') + translator = Translator() + + tasks = [] + groups = [subs[i:i+linesNumber] + for i in range(0, len(subs), linesNumber)] + + for group in groups: + text = " @\n".join(sub.text.replace("\n", " ◍ ") for sub in group) + tasks.append(asyncio.create_task(BingAI(text))) + + translated_texts = await asyncio.gather(*tasks) + + translated_texts = translated_texts.split(" @\n") + if len(translated_texts) == len(subs): + for i in range(len(subs)): + if i < len(translated_texts): + subs[i].text = translated_texts[i] + subs[i].text = subs[i].text.replace(" ◍◍◍◍, ", ",\n") + subs[i].text = subs[i].text.replace(" ◍◍◍◍ ", "\n") + subs[i].text = subs[i].text.replace(" ◍◍◍◍", "") + subs.save('./output/' + file, encoding='utf-8') + + with open('./output/' + file, 'r', encoding='utf-8') as in_file: + text = in_file.read() + new_text = text.replace("[TŁUMACZENIE:]", "") + new_text = new_text.replace("[TŁUMACZENIE: ] ", "") + new_text = new_text.replace(" [TŁUMACZENIE: ]", "") + + with open('./output/' + file, 'w', encoding='utf-8') as out_file: + out_file.write(new_text) + + +def main(): + cprint("╚═══ Multimedia Magic – Audio Visual Heaven ═══╝", + 'white', attrs=['bold']) + print("") + choice = input( + "1 - Google Translate\n2 - DeepL Translate API Kay\n3 - DeepL Translate Free Desktop\n4 - Bing AI\nWybierz: ") + + customOption = 5 + + if choice != '4': + linesNumberOptions = { + 1: 30, + 2: 50, + 3: 80, + 4: 200 + } + linesNumberChoice = int(input( + "Ile linii tłumaczyć na raz (najlepiej 30-50):\n1 - 30\n2 - 50\n3 - 80\n4 - 200\n5 - Podaj własną liczbę\nWybierz: ")) + + linesNumber = ( + int(input("Podaj liczbę: ")) + if linesNumberChoice == customOption + else linesNumberOptions.get(linesNumberChoice, 30) + ) + else: + linesNumberOptions = { + 1: 10, + 2: 20, + 3: 30, + 4: 40 + } + linesNumberChoice = int(input( + "Ile linii tłumaczyć na raz (najlepiej 1-10):\n1 - 10\n2 - 20\n3 - 30\n4 - 40\n5 - Podaj własną liczbę\nWybierz: ")) + + if linesNumberChoice == customOption: + linesNumber = int(input("Podaj liczbę: ")) + else: + linesNumber = linesNumberOptions.get(linesNumberChoice, 1) + + start_time = time.time() + if choice == '1': + choice = input( + "1 - Tłumacznie pliku z tekstem\n2 - Tłumacznie napisów np.: 1.srt\nWybierz: ") + if choice == '1': + for file in os.listdir("input"): + print("Tłumacznie: " + file + "...") + translateGoogle(file, linesNumber) + elif choice == '2': + for file in os.listdir("input"): + print("Tłumacznie: " + file + "...") + translateGoogleFile(file, linesNumber) + elif choice == '2': + number = int( + input("1 - Tłumacznie z linia po lini - bezpiecznie, ale dłużej \n2 - Tłumacznie z całego pliku np.: 1.txt - szybciej, ale możliwość błędu\nWybierz: ")) + for file in os.listdir("input"): + print("Tłumacznie: " + file + "...") + translateDeepL(file, linesNumber, number) + elif choice == '3': + number = int( + input("1 - Tłumacznie pliku z tekstem\n2 - Tłumacznie napisów np.: 1.srt\nWybierz: ")) + for file in os.listdir("input"): + print("Tłumacznie: " + file + "...") + translateDeepLFreeDesktop(file, linesNumber, number) + elif choice == '4': + number = int( + input("1 - Tłumacznie pliku z tekstem\n2 - Tłumacznie napisów np.: 1.srt\nWybierz: ")) + for file in os.listdir("input"): + print("Tłumacznie: " + file + "...") + asyncio.run(translateBingAI(file, linesNumber, number)) + + print("Zakończono :)") + + # Mierz czas + print("--- %s seconds ---" % (time.time() - start_time)) + print("--- %s minutes ---" % ((time.time() - start_time) / 60)) + print("--- %s hours ---" % ((time.time() - start_time) / 3600)) + + +if __name__ == "__main__": + main() diff --git a/mm_avh_working_space/tests/tts_balcon_test.py b/mm_avh_working_space/tests/tts_balcon_test.py new file mode 100644 index 0000000000000000000000000000000000000000..44ebe0d862b5cd3a4ba873cd92ec083508243354 --- /dev/null +++ b/mm_avh_working_space/tests/tts_balcon_test.py @@ -0,0 +1,99 @@ +# balcon -f 1.srt -w 1.wav -n "IVONA 2 Agnieszka" --sub-fit --sub-max 2 +# pip install warnings + + +import contextlib +import os +import subprocess + +dir_path = os.path.dirname(os.path.realpath(__file__)) + +for file_name in os.listdir(dir_path): + if file_name.endswith(".srt"): + file_path = os.path.join(dir_path, file_name) + + with contextlib.suppress(UnicodeDecodeError): + with open(file_path, "r", encoding="utf-8") as file: + content = file.read() + + with open(file_path, "w", encoding="ansi") as file: + file.write(content) + +command = """balcon -f 1.srt -w 1.wav -n "Microsoft Paulina Desktop" -s 7 -v 70""" +subprocess.call(command, shell=True) +subprocess.call('balcon -l -n "IVONA 2 Agnieszka" -m', shell=True) +# subprocess.call("balcon -g", shell=True) + + +# -l : drukowanie listy głosów +# -g : wyświetla listę urządzeń wyjściowych audio +# -f : ustawia wejściowy plik tekstowy +# -fl : ustawia plik z listą nazw plików wejściowych +# -w : ustawia plik wyjściowy w formacie WAV +# -n : ustaw głos dla mowy +# -id : ustawia głos według kodu języka (Locale ID) +# -m : drukuj parametry głosu +# -b : ustawienie urządzenia wyjściowego audio według indeksu +# -r : ustawienie urządzenia wyjściowego audio według nazwy +# -c : użyj tekstu ze schowka +# -t : użyj tekstu z wiersza poleceń +# -i : użyj tekstu ze stdin +# -o : zapis danych dźwiękowych na stdout +# -s : ustaw szybkość mowy (od -10 do 10) +# -p : ustawienie wysokości dźwięku (od -10 do 10) +# -v : ustawienie głośności mowy (od 0 do 100) +# -e : pauza między zdaniami (w milisekundach) +# -a : pauza między akapitami (w milisekundach) +# -d : zastosuj słownik do korekty wymowy +# -k : zabija inne kopie aplikacji +# -ka : zabija aktywną kopię aplikacji +# -pr : wstrzymanie lub wznowienie czytania przez aktywną kopię aplikacji +# -q : dodaj aplikację do kolejki +# -lrc : tworzy plik LRC do wyświetlania zsynchronizowanego tekstu w odtwarzaczach audio +# -srt : tworzy plik SRT do wyświetlania zsynchronizowanego tekstu w odtwarzaczach wideo +# -vs : tworzy plik tekstowy ze zsynchronizowanymi wizualizacjami +# -sub : przetwarza tekst wejściowy jako napisy +# -tray : wyświetla ikonę w zasobniku systemowym +# -ln : wybierz linię według numeru (lub zakresu, np. 12-79) +# -fr : ustaw wyjściową częstotliwość próbkowania dźwięku w kHz (od 8 do 48) +# -bt : ustawienie wyjściowej głębi bitowej audio (8 lub 16) +# -ch : ustawienie trybu wyjściowego kanału audio (1 lub 2) +# -enc : ustaw kodowanie tekstu wejściowego (ansi, utf8 lub unicode) +# -sb : cisza na początku (w milisekundach) +# -se : cisza na końcu (w milisekundach) +# -df : usuwa plik tekstowy po zakończeniu zadania +# -isb : ignoruje tekst w nawiasach kwadratowych +# -icb : ignoruje tekst w nawiasach klamrowych +# -iab : ignoruje tekst w nawiasach kątowych +# -irb : ignoruje tekst w nawiasach okrągłych +# -iu : ignoruje adresy URL +# -ic : ignoruje /*komentarze*/ w tekście +# -h : drukuje informacje o użyciu + +# --lrc-length : ustawia maksymalną długość linii tekstu dla wyjściowego pliku LRC +# --lrc-fname : ustawia nazwę pliku dla wyjściowego pliku LRC +# --lrc-enc : ustaw kodowanie dla wyjściowego pliku LRC +# --lrc-offset : ustawia przesunięcie czasowe dla wyjściowego pliku LRC (w milisekundach) +# --lrc-artist : artysta (znacznik ID) +# --lrc-album : album (znacznik ID) +# --lrc-title : tytuł (znacznik ID) +# --lrc-author : autor (znacznik ID) +# --lrc-creator : twórca pliku LRC (znacznik ID) +# --lrc-sent : wstaw puste linie po zdaniach w pliku LRC +# --lrc-para : wstawia puste linie po akapitach w pliku LRC +# --srt-length : ustawia maksymalną długość linii tekstu dla wyjściowego pliku SRT +# --srt-fname : ustaw nazwę pliku dla wyjściowego pliku SRT +# --srt-enc : ustaw kodowanie dla wyjściowego pliku SRT +# --raw : wyjście to surowe dane PCM (bez nagłówka) +# --ignore-length : pomija długość danych audio w nagłówku WAV +# --sub-format : ustaw format napisów (dla tekstu wejściowego) +# --sub-max : ustawia maksymalną szybkość mowy dla napisów + +# --voice1-name : ustaw głos do czytania obcych słów w tekście +# --voice1-langid : ustaw identyfikator języka dla obcego tekstu (np. en) +# --voice1-rate : ustaw szybkość mowy dla obcego tekstu (od -10 do 10) +# --voice1-pitch : ustawienie wysokości mowy dla obcego tekstu (od -10 do 10) +# --voice1-volume : ustaw głośność mowy dla obcego tekstu (od 0 do 100) +# --voice1-roman : użyj domyślnego głosu do czytania cyfr rzymskich +# --voice1-digit : użyj domyślnego głosu do odczytywania cyfr w obcym tekście +# --voice1-length : ustaw minimalną długość obcego tekstu, aby zmienić głos diff --git a/mm_avh_working_space/tests/tts_google_test.py b/mm_avh_working_space/tests/tts_google_test.py new file mode 100644 index 0000000000000000000000000000000000000000..16ed2fe6483c3a0ff842c3c9c40293bc5958b852 --- /dev/null +++ b/mm_avh_working_space/tests/tts_google_test.py @@ -0,0 +1,11 @@ +# Test 1 edge-tts in cmd: +from gtts import gTTS +import os + + + +# Test 2 gtts in cmd: +mytext = "Witaj świecie! Mam na imię GOOGLE ASSISTANT." +audio = gTTS(text=mytext, lang="pl", slow=False) +audio.save("example.mp3") +os.system("start example.mp3") diff --git a/mm_avh_working_space/tests/tts_local_test.py b/mm_avh_working_space/tests/tts_local_test.py new file mode 100644 index 0000000000000000000000000000000000000000..8e5697cbd1467564cfc358516e06b8d8c90f6a52 --- /dev/null +++ b/mm_avh_working_space/tests/tts_local_test.py @@ -0,0 +1,26 @@ +# Tekst to speech po posluchu za pomocą lektora Ivona + +# pip install pyttsx3 +# pip install pysrt + +# Sprawdzenie nazw dostępnych lektorów +import pyttsx3 + +engine = pyttsx3.init() +voices = engine.getProperty('voices') +for voice in voices: + print(voice.name) + + +print('\nMówi Zosia Harpo 22kHz:') +engine = pyttsx3.init() +engine.setProperty('rate', 150) # Ustawienie prędkości mówienia +engine.setProperty('volume', 1) # Ustawienie głośności +voices = engine.getProperty('voices') +for voice in voices: + if voice.name == 'Vocalizer Expressive Zosia Harpo 22kHz': + engine.setProperty('voice', voice.id) + break + +engine.say('Witaj świecie!') +engine.runAndWait() diff --git a/mm_avh_working_space/tests/tts_online_edge_test_0.py b/mm_avh_working_space/tests/tts_online_edge_test_0.py new file mode 100644 index 0000000000000000000000000000000000000000..ee4ae009505e8ba3ba7575b98a0fc7447be0ecb7 --- /dev/null +++ b/mm_avh_working_space/tests/tts_online_edge_test_0.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python3 + +""" +Streaming TTS example with subtitles. + +This example is similar to the example basic_audio_streaming.py, but it shows +WordBoundary events to create subtitles using SubMaker. +""" + +import asyncio + +import edge_tts + +TEXT = """REINKARNACJA NAJSILNIEJSZEGO BOGA MIECZA""" +VOICE = "pl-PL-ZofiaNeural" +OUTPUT_FILE = "1.mp3" +WEBVTT_FILE = "1.srt" + + +async def amain() -> None: + """Main function""" + communicate = edge_tts.Communicate(TEXT, VOICE) + submaker = edge_tts.SubMaker() + with open(OUTPUT_FILE, "wb") as file: + async for chunk in communicate.stream(): + if chunk["type"] == "audio": + file.write(chunk["data"]) + elif chunk["type"] == "WordBoundary": + submaker.create_sub((chunk["offset"], chunk["duration"]), chunk["text"]) + + with open(WEBVTT_FILE, "w", encoding="utf-8") as file: + file.write(submaker.generate_subs()) + + +if __name__ == "__main__": + loop = asyncio.get_event_loop_policy().get_event_loop() + try: + loop.run_until_complete(amain()) + finally: + loop.close() + +# import asyncio +# import edge_tts +# import time +# import wave + + +# async def generate_audio(subtitle, voice, output_file): +# start_time = 0 +# communicate = edge_tts.Communicate(subtitle, voice) +# with wave.open(output_file, 'wb') as wav_file: +# async for chunk in communicate.stream(): +# if chunk["type"] == "audio": +# wav_file.writeframes(chunk["data"]) +# elif chunk["type"] == "WordBoundary": +# duration = chunk["offset"] - start_time +# if duration > 0: +# silence_chunk = edge_tts.get_silence_chunk(duration) +# wav_file.writeframes(silence_chunk) +# start_time = chunk["offset"] + + +# async def convert_subtitles_to_speech(subtitles_file, voice, output_file): +# with open(subtitles_file, "r", encoding="utf-8") as file: +# subtitles = file.readlines() + +# await generate_audio("", voice, output_file) + +# for subtitle in subtitles: +# subtitle = subtitle.strip() +# if subtitle: +# await generate_audio(subtitle, voice, output_file) +# else: +# silence_duration = 1000 +# with wave.open(output_file, 'rb') as wav_file: +# framerate = wav_file.getframerate() +# nframes = wav_file.getnframes() +# current_time = nframes / float(framerate) +# silence_frames = int(silence_duration * framerate / 1000) +# empty_frame = b'\x00' * 2 + +# for _ in range(silence_frames): +# wav_file.writeframes(empty_frame) + + +# async def main(): +# voice = "pl-PL-ZofiaNeural" +# subtitles_file = "1.srt" +# output_file = "1.wav" +# await convert_subtitles_to_speech(subtitles_file, voice, output_file) + +# if __name__ == "__main__": +# loop = asyncio.get_event_loop() +# try: +# loop.run_until_complete(main()) +# finally: +# loop.close() diff --git a/mm_avh_working_space/tests/tts_online_edge_test_1.py b/mm_avh_working_space/tests/tts_online_edge_test_1.py new file mode 100644 index 0000000000000000000000000000000000000000..97c04ac82208266793ca1d05928d1f38a561db4d --- /dev/null +++ b/mm_avh_working_space/tests/tts_online_edge_test_1.py @@ -0,0 +1,550 @@ +# pip install edge-tts +# https://github.com/rany2/edge-tts + +# LEPSZA JAKOŚĆ!!! +# -> W VSC najedź kursorem na Communicate i naciśnij Ctrl + Click, aby przejść do communicate.py +# -> Wyszukaj w pliku communicate.py audio-24khz-48kbitrate-mono-mp3 i zamień na audio-24khz-96kbitrate-mono-mp3 + +""" +Podstawowe użycie edge-tts +""" +# CMD: +# edge-tts --text "Witaj świecie! Jak się masz? Mam nadzieję, że dobrze." --voice "pl-PL-ZofiaNeural" --rate "+100%" --volume "+0%" --write-media test.mp3 + +# Python: +import asyncio +import edge_tts + +TEXT = "Witaj świecie! Jak się masz? Mam nadzieję, że dobrze." +# 'pl-PL-MarekNeural': 'pl-PL', +# 'pl-PL-ZofiaNeural': 'pl-PL', + +# VOICE = "pl-PL-MarekNeural" +VOICE = "pl-PL-ZofiaNeural" +OUTPUT_FILE = "test.mp3" +RATE = "+100%" +VOLUME = "+0%" + + +async def _edge_tts() -> None: + communicate = edge_tts.Communicate(TEXT, VOICE, rate=RATE, volume=VOLUME) + await communicate.save(OUTPUT_FILE) + + +if __name__ == "__main__": + loop = asyncio.get_event_loop() + try: + loop.run_until_complete(_edge_tts()) + finally: + loop.close() + + +# Inne przykłady: +# #!/usr/bin/env python3 + +# """ +# Example of dynamic voice selection using VoicesManager. +# """ + +# import asyncio +# import random + +# import edge_tts +# from edge_tts import VoicesManager + +# TEXT = "Lubię jeść jabłka." +# OUTPUT_FILE = "spanish.mp3" + + +# async def _main() -> None: +# voices = await VoicesManager.create() +# voice = voices.find(Gender="Female", Language="pl") +# # Also supports Locales +# # voice = voices.find(Gender="Female", Locale="es-AR") + +# communicate = edge_tts.Communicate(TEXT, random.choice(voice)["Name"]) +# await communicate.save(OUTPUT_FILE) + + +# if __name__ == "__main__": +# loop = asyncio.get_event_loop() +# try: +# loop.run_until_complete(_main()) +# finally: +# loop.close() + + +# #!/usr/bin/env python3 + +# """ +# Streaming TTS example with subtitles. + +# This example is similar to the example basic_audio_streaming.py, but it shows +# WordBoundary events to create subtitles using SubMaker. +# """ + +# import asyncio + +# import edge_tts + +# TEXT = "Hello World!" +# VOICE = "en-GB-SoniaNeural" +# OUTPUT_FILE = "test.mp3" +# WEBVTT_FILE = "test.vtt" + + +# async def _main() -> None: +# communicate = edge_tts.Communicate(TEXT, VOICE) +# submaker = edge_tts.SubMaker() +# with open(OUTPUT_FILE, "wb") as file: +# async for chunk in communicate.stream(): +# if chunk["type"] == "audio": +# file.write(chunk["data"]) +# elif chunk["type"] == "WordBoundary": +# submaker.create_sub((chunk["offset"], chunk["duration"]), chunk["text"]) + +# with open(WEBVTT_FILE, "w", encoding="utf-8") as file: +# file.write(submaker.generate_subs()) + + +# if __name__ == "__main__": +# loop = asyncio.get_event_loop() +# try: +# loop.run_until_complete(_main()) +# finally: +# loop.close() + +# # wyświetl wszystkie głosy +# print(edge_tts.list_voices()) + + +# """The speech service.""" +# import logging + +# import homeassistant.helpers.config_validation as cv +# import voluptuous as vol +# from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider + +# EDGE_TTS_VERSION = '6.1.5' +# try: +# import edge_tts +# if '__version__' not in dir(edge_tts) or edge_tts.__version__ != EDGE_TTS_VERSION: +# raise Exception(f"edge_tts version is not {EDGE_TTS_VERSION}. Please install edge_tts {EDGE_TTS_VERSION}.") +# import edge_tts.exceptions +# except ImportError: +# try: +# import edgeTTS +# raise Exception(f'Please uninstall edgeTTS and install edge_tts {EDGE_TTS_VERSION} instead.') +# except ImportError: +# raise Exception(f'edge_tts is required. Please install edge_tts {EDGE_TTS_VERSION}.') + +# _LOGGER = logging.getLogger(__name__) + +# # https://speech.platform.bing.com/consumer/speech/synthesize/readaloud/voices/list?trustedclienttoken=6A5AA1D4EAFF4E9FB37E23D68491D6F4 +# SUPPORTED_VOICES = { +# 'zh-CN-XiaoxiaoNeural': 'zh-CN', +# 'zh-CN-XiaoyiNeural': 'zh-CN', +# 'zh-CN-YunjianNeural': 'zh-CN', +# 'zh-CN-YunxiNeural': 'zh-CN', +# 'zh-CN-YunxiaNeural': 'zh-CN', +# 'zh-CN-YunyangNeural': 'zh-CN', +# 'zh-HK-HiuGaaiNeural': 'zh-HK', +# 'zh-HK-HiuMaanNeural': 'zh-HK', +# 'zh-HK-WanLungNeural': 'zh-HK', +# 'zh-TW-HsiaoChenNeural': 'zh-TW', +# 'zh-TW-YunJheNeural': 'zh-TW', +# 'zh-TW-HsiaoYuNeural': 'zh-TW', +# 'af-ZA-AdriNeural': 'af-ZA', +# 'af-ZA-WillemNeural': 'af-ZA', +# 'am-ET-AmehaNeural': 'am-ET', +# 'am-ET-MekdesNeural': 'am-ET', +# 'ar-AE-FatimaNeural': 'ar-AE', +# 'ar-AE-HamdanNeural': 'ar-AE', +# 'ar-BH-AliNeural': 'ar-BH', +# 'ar-BH-LailaNeural': 'ar-BH', +# 'ar-DZ-AminaNeural': 'ar-DZ', +# 'ar-DZ-IsmaelNeural': 'ar-DZ', +# 'ar-EG-SalmaNeural': 'ar-EG', +# 'ar-EG-ShakirNeural': 'ar-EG', +# 'ar-IQ-BasselNeural': 'ar-IQ', +# 'ar-IQ-RanaNeural': 'ar-IQ', +# 'ar-JO-SanaNeural': 'ar-JO', +# 'ar-JO-TaimNeural': 'ar-JO', +# 'ar-KW-FahedNeural': 'ar-KW', +# 'ar-KW-NouraNeural': 'ar-KW', +# 'ar-LB-LaylaNeural': 'ar-LB', +# 'ar-LB-RamiNeural': 'ar-LB', +# 'ar-LY-ImanNeural': 'ar-LY', +# 'ar-LY-OmarNeural': 'ar-LY', +# 'ar-MA-JamalNeural': 'ar-MA', +# 'ar-MA-MounaNeural': 'ar-MA', +# 'ar-OM-AbdullahNeural': 'ar-OM', +# 'ar-OM-AyshaNeural': 'ar-OM', +# 'ar-QA-AmalNeural': 'ar-QA', +# 'ar-QA-MoazNeural': 'ar-QA', +# 'ar-SA-HamedNeural': 'ar-SA', +# 'ar-SA-ZariyahNeural': 'ar-SA', +# 'ar-SY-AmanyNeural': 'ar-SY', +# 'ar-SY-LaithNeural': 'ar-SY', +# 'ar-TN-HediNeural': 'ar-TN', +# 'ar-TN-ReemNeural': 'ar-TN', +# 'ar-YE-MaryamNeural': 'ar-YE', +# 'ar-YE-SalehNeural': 'ar-YE', +# 'az-AZ-BabekNeural': 'az-AZ', +# 'az-AZ-BanuNeural': 'az-AZ', +# 'bg-BG-BorislavNeural': 'bg-BG', +# 'bg-BG-KalinaNeural': 'bg-BG', +# 'bn-BD-NabanitaNeural': 'bn-BD', +# 'bn-BD-PradeepNeural': 'bn-BD', +# 'bn-IN-BashkarNeural': 'bn-IN', +# 'bn-IN-TanishaaNeural': 'bn-IN', +# 'bs-BA-GoranNeural': 'bs-BA', +# 'bs-BA-VesnaNeural': 'bs-BA', +# 'ca-ES-EnricNeural': 'ca-ES', +# 'ca-ES-JoanaNeural': 'ca-ES', +# 'cs-CZ-AntoninNeural': 'cs-CZ', +# 'cs-CZ-VlastaNeural': 'cs-CZ', +# 'cy-GB-AledNeural': 'cy-GB', +# 'cy-GB-NiaNeural': 'cy-GB', +# 'da-DK-ChristelNeural': 'da-DK', +# 'da-DK-JeppeNeural': 'da-DK', +# 'de-AT-IngridNeural': 'de-AT', +# 'de-AT-JonasNeural': 'de-AT', +# 'de-CH-JanNeural': 'de-CH', +# 'de-CH-LeniNeural': 'de-CH', +# 'de-DE-AmalaNeural': 'de-DE', +# 'de-DE-ConradNeural': 'de-DE', +# 'de-DE-KatjaNeural': 'de-DE', +# 'de-DE-KillianNeural': 'de-DE', +# 'el-GR-AthinaNeural': 'el-GR', +# 'el-GR-NestorasNeural': 'el-GR', +# 'en-AU-NatashaNeural': 'en-AU', +# 'en-AU-WilliamNeural': 'en-AU', +# 'en-CA-ClaraNeural': 'en-CA', +# 'en-CA-LiamNeural': 'en-CA', +# 'en-GB-LibbyNeural': 'en-GB', +# 'en-GB-MaisieNeural': 'en-GB', +# 'en-GB-RyanNeural': 'en-GB', +# 'en-GB-SoniaNeural': 'en-GB', +# 'en-GB-ThomasNeural': 'en-GB', +# 'en-HK-SamNeural': 'en-HK', +# 'en-HK-YanNeural': 'en-HK', +# 'en-IE-ConnorNeural': 'en-IE', +# 'en-IE-EmilyNeural': 'en-IE', +# 'en-IN-NeerjaNeural': 'en-IN', +# 'en-IN-PrabhatNeural': 'en-IN', +# 'en-KE-AsiliaNeural': 'en-KE', +# 'en-KE-ChilembaNeural': 'en-KE', +# 'en-NG-AbeoNeural': 'en-NG', +# 'en-NG-EzinneNeural': 'en-NG', +# 'en-NZ-MitchellNeural': 'en-NZ', +# 'en-NZ-MollyNeural': 'en-NZ', +# 'en-PH-JamesNeural': 'en-PH', +# 'en-PH-RosaNeural': 'en-PH', +# 'en-SG-LunaNeural': 'en-SG', +# 'en-SG-WayneNeural': 'en-SG', +# 'en-TZ-ElimuNeural': 'en-TZ', +# 'en-TZ-ImaniNeural': 'en-TZ', +# 'en-US-AnaNeural': 'en-US', +# 'en-US-AriaNeural': 'en-US', +# 'en-US-ChristopherNeural': 'en-US', +# 'en-US-EricNeural': 'en-US', +# 'en-US-GuyNeural': 'en-US', +# 'en-US-JennyNeural': 'en-US', +# 'en-US-MichelleNeural': 'en-US', +# 'en-ZA-LeahNeural': 'en-ZA', +# 'en-ZA-LukeNeural': 'en-ZA', +# 'es-AR-ElenaNeural': 'es-AR', +# 'es-AR-TomasNeural': 'es-AR', +# 'es-BO-MarceloNeural': 'es-BO', +# 'es-BO-SofiaNeural': 'es-BO', +# 'es-CL-CatalinaNeural': 'es-CL', +# 'es-CL-LorenzoNeural': 'es-CL', +# 'es-CO-GonzaloNeural': 'es-CO', +# 'es-CO-SalomeNeural': 'es-CO', +# 'es-CR-JuanNeural': 'es-CR', +# 'es-CR-MariaNeural': 'es-CR', +# 'es-CU-BelkysNeural': 'es-CU', +# 'es-CU-ManuelNeural': 'es-CU', +# 'es-DO-EmilioNeural': 'es-DO', +# 'es-DO-RamonaNeural': 'es-DO', +# 'es-EC-AndreaNeural': 'es-EC', +# 'es-EC-LuisNeural': 'es-EC', +# 'es-ES-AlvaroNeural': 'es-ES', +# 'es-ES-ElviraNeural': 'es-ES', +# 'es-ES-ManuelEsCUNeural': 'es-ES', +# 'es-GQ-JavierNeural': 'es-GQ', +# 'es-GQ-TeresaNeural': 'es-GQ', +# 'es-GT-AndresNeural': 'es-GT', +# 'es-GT-MartaNeural': 'es-GT', +# 'es-HN-CarlosNeural': 'es-HN', +# 'es-HN-KarlaNeural': 'es-HN', +# 'es-MX-DaliaNeural': 'es-MX', +# 'es-MX-JorgeNeural': 'es-MX', +# 'es-MX-LorenzoEsCLNeural': 'es-MX', +# 'es-NI-FedericoNeural': 'es-NI', +# 'es-NI-YolandaNeural': 'es-NI', +# 'es-PA-MargaritaNeural': 'es-PA', +# 'es-PA-RobertoNeural': 'es-PA', +# 'es-PE-AlexNeural': 'es-PE', +# 'es-PE-CamilaNeural': 'es-PE', +# 'es-PR-KarinaNeural': 'es-PR', +# 'es-PR-VictorNeural': 'es-PR', +# 'es-PY-MarioNeural': 'es-PY', +# 'es-PY-TaniaNeural': 'es-PY', +# 'es-SV-LorenaNeural': 'es-SV', +# 'es-SV-RodrigoNeural': 'es-SV', +# 'es-US-AlonsoNeural': 'es-US', +# 'es-US-PalomaNeural': 'es-US', +# 'es-UY-MateoNeural': 'es-UY', +# 'es-UY-ValentinaNeural': 'es-UY', +# 'es-VE-PaolaNeural': 'es-VE', +# 'es-VE-SebastianNeural': 'es-VE', +# 'et-EE-AnuNeural': 'et-EE', +# 'et-EE-KertNeural': 'et-EE', +# 'fa-IR-DilaraNeural': 'fa-IR', +# 'fa-IR-FaridNeural': 'fa-IR', +# 'fi-FI-HarriNeural': 'fi-FI', +# 'fi-FI-NooraNeural': 'fi-FI', +# 'fil-PH-AngeloNeural': 'fil-PH', +# 'fil-PH-BlessicaNeural': 'fil-PH', +# 'fr-BE-CharlineNeural': 'fr-BE', +# 'fr-BE-GerardNeural': 'fr-BE', +# 'fr-CA-AntoineNeural': 'fr-CA', +# 'fr-CA-JeanNeural': 'fr-CA', +# 'fr-CA-SylvieNeural': 'fr-CA', +# 'fr-CH-ArianeNeural': 'fr-CH', +# 'fr-CH-FabriceNeural': 'fr-CH', +# 'fr-FR-DeniseNeural': 'fr-FR', +# 'fr-FR-EloiseNeural': 'fr-FR', +# 'fr-FR-HenriNeural': 'fr-FR', +# 'ga-IE-ColmNeural': 'ga-IE', +# 'ga-IE-OrlaNeural': 'ga-IE', +# 'gl-ES-RoiNeural': 'gl-ES', +# 'gl-ES-SabelaNeural': 'gl-ES', +# 'gu-IN-DhwaniNeural': 'gu-IN', +# 'gu-IN-NiranjanNeural': 'gu-IN', +# 'he-IL-AvriNeural': 'he-IL', +# 'he-IL-HilaNeural': 'he-IL', +# 'hi-IN-MadhurNeural': 'hi-IN', +# 'hi-IN-SwaraNeural': 'hi-IN', +# 'hr-HR-GabrijelaNeural': 'hr-HR', +# 'hr-HR-SreckoNeural': 'hr-HR', +# 'hu-HU-NoemiNeural': 'hu-HU', +# 'hu-HU-TamasNeural': 'hu-HU', +# 'id-ID-ArdiNeural': 'id-ID', +# 'id-ID-GadisNeural': 'id-ID', +# 'is-IS-GudrunNeural': 'is-IS', +# 'is-IS-GunnarNeural': 'is-IS', +# 'it-IT-DiegoNeural': 'it-IT', +# 'it-IT-ElsaNeural': 'it-IT', +# 'it-IT-IsabellaNeural': 'it-IT', +# 'ja-JP-KeitaNeural': 'ja-JP', +# 'ja-JP-NanamiNeural': 'ja-JP', +# 'jv-ID-DimasNeural': 'jv-ID', +# 'jv-ID-SitiNeural': 'jv-ID', +# 'ka-GE-EkaNeural': 'ka-GE', +# 'ka-GE-GiorgiNeural': 'ka-GE', +# 'kk-KZ-AigulNeural': 'kk-KZ', +# 'kk-KZ-DauletNeural': 'kk-KZ', +# 'km-KH-PisethNeural': 'km-KH', +# 'km-KH-SreymomNeural': 'km-KH', +# 'kn-IN-GaganNeural': 'kn-IN', +# 'kn-IN-SapnaNeural': 'kn-IN', +# 'ko-KR-InJoonNeural': 'ko-KR', +# 'ko-KR-SunHiNeural': 'ko-KR', +# 'lo-LA-ChanthavongNeural': 'lo-LA', +# 'lo-LA-KeomanyNeural': 'lo-LA', +# 'lt-LT-LeonasNeural': 'lt-LT', +# 'lt-LT-OnaNeural': 'lt-LT', +# 'lv-LV-EveritaNeural': 'lv-LV', +# 'lv-LV-NilsNeural': 'lv-LV', +# 'mk-MK-AleksandarNeural': 'mk-MK', +# 'mk-MK-MarijaNeural': 'mk-MK', +# 'ml-IN-MidhunNeural': 'ml-IN', +# 'ml-IN-SobhanaNeural': 'ml-IN', +# 'mn-MN-BataaNeural': 'mn-MN', +# 'mn-MN-YesuiNeural': 'mn-MN', +# 'mr-IN-AarohiNeural': 'mr-IN', +# 'mr-IN-ManoharNeural': 'mr-IN', +# 'ms-MY-OsmanNeural': 'ms-MY', +# 'ms-MY-YasminNeural': 'ms-MY', +# 'mt-MT-GraceNeural': 'mt-MT', +# 'mt-MT-JosephNeural': 'mt-MT', +# 'my-MM-NilarNeural': 'my-MM', +# 'my-MM-ThihaNeural': 'my-MM', +# 'nb-NO-FinnNeural': 'nb-NO', +# 'nb-NO-PernilleNeural': 'nb-NO', +# 'ne-NP-HemkalaNeural': 'ne-NP', +# 'ne-NP-SagarNeural': 'ne-NP', +# 'nl-BE-ArnaudNeural': 'nl-BE', +# 'nl-BE-DenaNeural': 'nl-BE', +# 'nl-NL-ColetteNeural': 'nl-NL', +# 'nl-NL-FennaNeural': 'nl-NL', +# 'nl-NL-MaartenNeural': 'nl-NL', +# 'pl-PL-MarekNeural': 'pl-PL', +# 'pl-PL-ZofiaNeural': 'pl-PL', +# 'ps-AF-GulNawazNeural': 'ps-AF', +# 'ps-AF-LatifaNeural': 'ps-AF', +# 'pt-BR-AntonioNeural': 'pt-BR', +# 'pt-BR-FranciscaNeural': 'pt-BR', +# 'pt-PT-DuarteNeural': 'pt-PT', +# 'pt-PT-RaquelNeural': 'pt-PT', +# 'ro-RO-AlinaNeural': 'ro-RO', +# 'ro-RO-EmilNeural': 'ro-RO', +# 'ru-RU-DmitryNeural': 'ru-RU', +# 'ru-RU-SvetlanaNeural': 'ru-RU', +# 'si-LK-SameeraNeural': 'si-LK', +# 'si-LK-ThiliniNeural': 'si-LK', +# 'sk-SK-LukasNeural': 'sk-SK', +# 'sk-SK-ViktoriaNeural': 'sk-SK', +# 'sl-SI-PetraNeural': 'sl-SI', +# 'sl-SI-RokNeural': 'sl-SI', +# 'so-SO-MuuseNeural': 'so-SO', +# 'so-SO-UbaxNeural': 'so-SO', +# 'sq-AL-AnilaNeural': 'sq-AL', +# 'sq-AL-IlirNeural': 'sq-AL', +# 'sr-RS-NicholasNeural': 'sr-RS', +# 'sr-RS-SophieNeural': 'sr-RS', +# 'su-ID-JajangNeural': 'su-ID', +# 'su-ID-TutiNeural': 'su-ID', +# 'sv-SE-MattiasNeural': 'sv-SE', +# 'sv-SE-SofieNeural': 'sv-SE', +# 'sw-KE-RafikiNeural': 'sw-KE', +# 'sw-KE-ZuriNeural': 'sw-KE', +# 'sw-TZ-DaudiNeural': 'sw-TZ', +# 'sw-TZ-RehemaNeural': 'sw-TZ', +# 'ta-IN-PallaviNeural': 'ta-IN', +# 'ta-IN-ValluvarNeural': 'ta-IN', +# 'ta-LK-KumarNeural': 'ta-LK', +# 'ta-LK-SaranyaNeural': 'ta-LK', +# 'ta-MY-KaniNeural': 'ta-MY', +# 'ta-MY-SuryaNeural': 'ta-MY', +# 'ta-SG-AnbuNeural': 'ta-SG', +# 'ta-SG-VenbaNeural': 'ta-SG', +# 'te-IN-MohanNeural': 'te-IN', +# 'te-IN-ShrutiNeural': 'te-IN', +# 'th-TH-NiwatNeural': 'th-TH', +# 'th-TH-PremwadeeNeural': 'th-TH', +# 'tr-TR-AhmetNeural': 'tr-TR', +# 'tr-TR-EmelNeural': 'tr-TR', +# 'uk-UA-OstapNeural': 'uk-UA', +# 'uk-UA-PolinaNeural': 'uk-UA', +# 'ur-IN-GulNeural': 'ur-IN', +# 'ur-IN-SalmanNeural': 'ur-IN', +# 'ur-PK-AsadNeural': 'ur-PK', +# 'ur-PK-UzmaNeural': 'ur-PK', +# 'uz-UZ-MadinaNeural': 'uz-UZ', +# 'uz-UZ-SardorNeural': 'uz-UZ', +# 'vi-VN-HoaiMyNeural': 'vi-VN', +# 'vi-VN-NamMinhNeural': 'vi-VN', +# 'zu-ZA-ThandoNeural': 'zu-ZA', +# 'zu-ZA-ThembaNeural': 'zu-ZA', +# } +# SUPPORTED_LANGUAGES = { +# **dict(zip(SUPPORTED_VOICES.values(), SUPPORTED_VOICES.keys())), +# 'zh-CN': 'zh-CN-XiaoxiaoNeural', +# } + +# DEFAULT_LANG = 'zh-CN' + +# PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( +# { +# vol.Optional(CONF_LANG, default=DEFAULT_LANG): cv.string, +# }, +# extra=vol.ALLOW_EXTRA, +# ) + + +# async def async_get_engine(hass, config, discovery_info=None): +# """Set up the component.""" +# return SpeechProvider(hass, config) + + +# class SpeechProvider(Provider): +# """The provider.""" + +# def __init__(self, hass, config): +# """Init service.""" +# self.name = 'Edge TTS' +# self.hass = hass +# self._config = config or {} +# self._style_options = ['style', 'styledegree', 'role'] # issues/8 +# self._prosody_options = ['pitch', 'rate', 'volume'] # issues/24 + +# @property +# def default_language(self): +# """Return the default language.""" +# return self._config.get(CONF_LANG) + +# @property +# def supported_languages(self): +# """Return list of supported languages.""" +# return list([*SUPPORTED_LANGUAGES.keys(), *SUPPORTED_VOICES.keys()]) + +# @property +# def supported_options(self): +# """Return a list of supported options like voice, emotionen.""" +# lst = [CONF_LANG, 'voice'] +# lst.extend(self._style_options) +# lst.extend(self._prosody_options) +# return lst + +# async def async_get_tts_audio(self, message, language, options=None): +# """Load TTS audio.""" +# opt = {CONF_LANG: language} +# if language in SUPPORTED_VOICES: +# opt[CONF_LANG] = SUPPORTED_VOICES[language] +# opt['voice'] = language +# opt = {**self._config, **opt, **(options or {})} + +# # https://docs.microsoft.com/zh-CN/azure/cognitive-services/speech-service/speech-synthesis-markup?tabs=csharp#adjust-speaking-languages +# lang = opt.get(CONF_LANG) or language + +# # https://docs.microsoft.com/zh-CN/azure/cognitive-services/speech-service/speech-synthesis-markup?tabs=csharp#use-multiple-voices +# voice = opt.get('voice') or SUPPORTED_LANGUAGES.get(lang) or 'zh-CN-XiaoxiaoNeural' + +# # https://docs.microsoft.com/zh-CN/azure/cognitive-services/speech-service/speech-synthesis-markup?tabs=csharp#adjust-speaking-styles +# for f in self._style_options: +# v = opt.get(f) +# if v is not None: +# _LOGGER.warning( +# 'Edge TTS options style/styledegree/role are no longer supported, ' +# 'please remove them from your automation or script. ' +# 'See: https://github.com/hasscc/hass-edge-tts/issues/8' +# ) +# break + +# if opt.get('pitch') is not None: +# _LOGGER.warning( +# 'Edge TTS option pitch is no longer supported, ' +# 'please remove it from your automation or script. ' +# 'See: https://github.com/hasscc/hass-edge-tts/issues/24' +# ) + +# _LOGGER.debug('%s: %s', self.name, [message, opt]) +# mp3 = b'' +# tts = EdgeCommunicate( +# message, +# voice=voice, +# rate=opt.get('rate', '+0%'), +# volume=opt.get('volume', '+0%'), +# ) +# try: +# async for chunk in tts.stream(): +# if chunk["type"] == "audio": +# mp3 += chunk["data"] +# else: +# _LOGGER.debug('%s: audio.metadata: %s', self.name, chunk) +# except edge_tts.exceptions.NoAudioReceived: +# _LOGGER.warning('%s: failed: %s', self.name, [message, opt]) +# return None, None +# return 'mp3', mp3 + +# def get_tts_audio(self, message, language, options=None): +# """Load tts audio file from provider.""" +# return None, None + + +# class EdgeCommunicate(edge_tts.Communicate): +# """ Edge TTS """ diff --git a/mm_avh_working_space/tests/tts_online_edge_test_2.py b/mm_avh_working_space/tests/tts_online_edge_test_2.py new file mode 100644 index 0000000000000000000000000000000000000000..473135e2360ba409a1c57d1b10c9f5fb79017d7d --- /dev/null +++ b/mm_avh_working_space/tests/tts_online_edge_test_2.py @@ -0,0 +1,426 @@ +# pip install edge-tts +# https://github.com/rany2/edge-tts + +# LEPSZA JAKOŚĆ!!! +# -> W VSC najedź kursorem na Communicate i naciśnij Ctrl + Click, aby przejść do communicate.py +# -> Wyszukaj w pliku communicate.py audio-24khz-48kbitrate-mono-mp3 i zamień na audio-24khz-96kbitrate-mono-mp3 + +""" +Podstawowe użycie edge-tts +""" +# CMD: +# edge-tts --text "Witaj świecie! Jak się masz? Mam nadzieję, że dobrze." --voice "pl-PL-ZofiaNeural" --rate "+100%" --volume "+0%" --write-media test.mp3 + +import asyncio +import os +import wave +from pydub import AudioSegment +import edge_tts +import pysrt + +# VOICE = "pl-PL-ZofiaNeural" +VOICE = "pl-PL-MarekNeural" +RATE = "+50%" +VOLUME = "+0%" + + +async def generate_speech(subtitle, voice, output_file, rate, volume): + communicate = edge_tts.Communicate( + subtitle.text, voice, rate=rate, volume=volume) + await communicate.save(output_file) + + +async def generate_wav_files(subtitles, voice, rate, volume): + tasks = [] + mp3_files = [] + file_name = os.path.splitext(subtitles.path)[0] + for i, subtitle in enumerate(subtitles, start=1): + output_file = f"{file_name}_{i}.mp3" + mp3_files.append(output_file) + tasks.append(asyncio.create_task(generate_speech( + subtitle, voice, output_file, rate, volume))) + await asyncio.gather(*tasks) + return mp3_files + + +def merge_audio_files(mp3_files, subtitles): + file_name = os.path.splitext(subtitles.path)[0] + with wave.open(f"{file_name}.wav", 'wb') as wav_file: + wav_file.setnchannels(1) + wav_file.setsampwidth(2) + wav_file.setframerate(24000) + + audio_segments = [] + print('\n'+subtitles.path+'\n') + for i, mp3_file in enumerate(mp3_files, start=1): + print( + f"{i}\n{subtitles[i-1].start.to_time().strftime('%H:%M:%S.%f')[:-3]} --> {subtitles[i-1].end.to_time().strftime('%H:%M:%S.%f')[:-3]}\n{subtitles[i-1].text}\n") + + mp3_file_path = os.path.join(dir_path, mp3_file) + if os.path.isfile(mp3_file_path): + start_time = subtitles[i-1].start.to_time() + start_time = start_time.hour * 3600 + start_time.minute * \ + 60 + start_time.second + start_time.microsecond / 1000000 + sound = AudioSegment.from_file( + mp3_file_path, format="mp3") + audio_segments.append(sound) + os.remove(mp3_file_path) + + framerate = wav_file.getframerate() + nframes = wav_file.getnframes() + current_time = nframes / float(framerate) + if current_time < start_time: + empty_frame_duration = int( + (start_time - current_time) * framerate) + empty_frame = b'\x00' * empty_frame_duration * 2 + wav_file.writeframes(empty_frame) + + sound_data = sound.raw_data + wav_file.writeframes(sound_data) + + wav_file.close() + + +if __name__ == "__main__": + dir_path = os.path.dirname(os.path.realpath(__file__)) + for file in os.listdir(dir_path): + if file.endswith(".srt"): + subtitles = pysrt.open(os.path.join(dir_path, file)) + mp3_files = asyncio.run(generate_wav_files( + subtitles, VOICE, RATE, VOLUME)) + merge_audio_files(mp3_files, subtitles) + + +# DROGA :( +# import wave +# import pysrt +# import os +# from pydub import AudioSegment +# import subprocess + +# VOICE = "pl-PL-ZofiaNeural" +# RATE = "+50%" + +# # Konwersja wszystkich plików srt w katalogu +# dir_path = os.path.dirname(os.path.realpath(__file__)) +# for file in os.listdir(dir_path): +# if file.endswith(".srt"): +# # Pobranie plików .srt +# subtitles = pysrt.open(os.path.join(dir_path, file)) + +# # Odczytanie napisów i zapisanie mowy do pliku WAV +# output_file = os.path.splitext(file)[0] + ".wav" +# with wave.open(output_file, 'wb') as wav_file: +# wav_file.setnchannels(1) # Mono +# wav_file.setsampwidth(2) # 16-bit +# wav_file.setframerate(22500) # 22kHz + +# for i, subtitle in enumerate(subtitles, start=1): +# print( +# f"{i}\n{subtitle.start.to_time().strftime('%H:%M:%S.%f')[:-3]} --> {subtitle.end.to_time().strftime('%H:%M:%S.%f')[:-3]}\n{subtitle.text}\n") + +# start_time = subtitle.start.to_time() +# start_time = start_time.hour * 3600 + start_time.minute * \ +# 60 + start_time.second + start_time.microsecond / 1000000 + +# # subprocess.call('edge-tts --text "' + subtitle.text + +# # '" --voice "pl-PL-MarekNeural" --rate "+50%" --write-media temp.mp3') +# subprocess.call('edge-tts --text "' + subtitle.text + +# '" --voice "pl-PL-ZofiaNeural" --rate "+0%" --write-media temp.mp3') +# # Zapisanie mowy do pliku WAV +# sound = AudioSegment.from_file( +# "temp.mp3", format="mp3") +# sound.export("temp.wav", format="wav", parameters=[ +# "-ac", "1", "-sample_fmt", "s16", "-ar", "22500"]) + +# # Dodanie pustego frame'a do pliku WAV, jeśli jest to wymagane +# framerate = wav_file.getframerate() +# nframes = wav_file.getnframes() +# current_time = nframes / float(framerate) +# if start_time > current_time: +# empty_frame_duration = int( +# (start_time - current_time) * framerate) +# empty_frame = b'\x00' * empty_frame_duration * 2 +# wav_file.writeframes(empty_frame) + +# # Dodanie mowy do pliku WAV +# with wave.open("temp.wav", 'rb') as temp_file: +# data = temp_file.readframes(temp_file.getnframes()) +# wav_file.writeframes(data) + +# # Usunięcie pliku tymczasowego +# os.remove("temp.mp3") +# os.remove("temp.wav") + + +# 2.0 + +# pip install edge-tts +# https://github.com/rany2/edge-tts + +# import wave +# import pysrt +# import os +# from pydub import AudioSegment +# import subprocess +# import edge_tts +# import asyncio + +# VOICE = "pl-PL-ZofiaNeural" +# OUTPUT_FILE = "temp.mp3" +# OUTPUT_FILE_WAV = "temp.wav" +# RATE = "+50%" +# VOLUME = "+0%" + + +# async def _edge_tts(subtitle) -> None: +# communicate = edge_tts.Communicate( +# subtitle.text, VOICE, rate=RATE, volume=VOLUME) +# await communicate.save(OUTPUT_FILE) + + +# async def main(): +# # Konwersja wszystkich plików srt w katalogu +# dir_path = os.path.dirname(os.path.realpath(__file__)) +# for file in os.listdir(dir_path): +# if file.endswith(".srt"): +# # Pobranie plików .srt +# subtitles = pysrt.open(os.path.join(dir_path, file)) + +# # Odczytanie napisów i zapisanie mowy do pliku WAV +# output_file = os.path.splitext(file)[0] + ".wav" +# with wave.open(output_file, 'wb') as wav_file: +# wav_file.setnchannels(1) # Mono +# wav_file.setsampwidth(2) # 16-bit +# wav_file.setframerate(22500) # 22kHz + +# for i, subtitle in enumerate(subtitles, start=1): +# print( +# f"{i}\n{subtitle.start.to_time().strftime('%H:%M:%S.%f')[:-3]} --> {subtitle.end.to_time().strftime('%H:%M:%S.%f')[:-3]}\n{subtitle.text}\n") + +# start_time = subtitle.start.to_time() +# start_time = start_time.hour * 3600 + start_time.minute * \ +# 60 + start_time.second + start_time.microsecond / 1000000 + +# await _edge_tts(subtitle) + +# sound = AudioSegment.from_file( +# OUTPUT_FILE, format="mp3") +# sound.export(OUTPUT_FILE_WAV, format="wav", parameters=[ +# "-ac", "1", "-sample_fmt", "s16", "-ar", "22500"]) + +# # Dodanie pustego frame'a do pliku WAV, jeśli jest to wymagane +# framerate = wav_file.getframerate() +# nframes = wav_file.getnframes() +# current_time = nframes / float(framerate) +# if start_time > current_time: +# empty_frame_duration = int( +# (start_time - current_time) * framerate) +# empty_frame = b'\x00' * empty_frame_duration * 2 +# wav_file.writeframes(empty_frame) + +# # Dodanie mowy do pliku WAV +# with wave.open(OUTPUT_FILE_WAV, 'rb') as temp_file: +# data = temp_file.readframes(temp_file.getnframes()) +# wav_file.writeframes(data) + +# # Usunięcie pliku tymczasowego +# os.remove(OUTPUT_FILE) +# os.remove(OUTPUT_FILE_WAV) + + +# if __name__ == "__main__": +# asyncio.run(main()) + + +# import asyncio +# import os +# from pydub import AudioSegment +# import edge_tts +# import subprocess +# import pysrt + + +# VOICE = "pl-PL-ZofiaNeural" +# RATE = "+50%" +# VOLUME = "+0%" + + +# async def generate_speech(subtitle, voice, output_file, rate, volume): +# communicate = edge_tts.Communicate(subtitle.text, voice, rate=rate, volume=volume) +# await communicate.save(output_file) + + +# async def generate_wav_files(subtitles, voice, rate, volume): +# tasks = [] +# file_name = os.path.splitext(subtitles.path)[0] +# for i, subtitle in enumerate(subtitles, start=1): +# output_file = f"{file_name}_{i}.mp3" +# tasks.append(asyncio.create_task(generate_speech(subtitle, voice, output_file, rate, volume))) +# await asyncio.gather(*tasks) + + +# if __name__ == "__main__": +# dir_path = os.path.dirname(os.path.realpath(__file__)) +# for file in os.listdir(dir_path): +# if file.endswith(".srt"): +# subtitles = pysrt.open(os.path.join(dir_path, file)) +# asyncio.run(generate_wav_files(subtitles, VOICE, RATE, VOLUME)) + +# # Przejście przez wszystkie pliki w bieżącym katalogu +# for file in os.listdir('.'): +# if file.endswith('.mp3'): +# mp3_file = AudioSegment.from_mp3(file) + +# # Zapis pliku WAV +# wav_file = file.replace('.mp3', '.wav') +# mp3_file.export(wav_file, format='wav') + +# # Usunięcie pliku MP3 +# os.remove(file) + +# 4. +# import asyncio +# import os +# import wave +# from pydub import AudioSegment +# import edge_tts +# import subprocess +# import pysrt + +# VOICE = "pl-PL-ZofiaNeural" +# RATE = "+50%" +# VOLUME = "+0%" + + +# async def generate_speech(subtitle, voice, output_file, rate, volume): +# communicate = edge_tts.Communicate(subtitle.text, voice, rate=rate, volume=volume) +# await communicate.save(output_file) + + +# async def generate_wav_files(subtitles, voice, rate, volume): +# tasks = [] +# file_name = os.path.splitext(subtitles.path)[0] +# for i, subtitle in enumerate(subtitles, start=1): +# output_file = f"{file_name}_{i}.mp3" +# tasks.append(asyncio.create_task(generate_speech(subtitle, voice, output_file, rate, volume))) +# await asyncio.gather(*tasks) + + +# if __name__ == "__main__": +# dir_path = os.path.dirname(os.path.realpath(__file__)) +# for file in os.listdir(dir_path): +# if file.endswith(".srt"): +# subtitles = pysrt.open(os.path.join(dir_path, file)) +# asyncio.run(generate_wav_files(subtitles, VOICE, RATE, VOLUME)) + +# # Przejście przez wszystkie pliki w bieżącym katalogu +# for file in os.listdir('.'): +# if file.endswith('.mp3'): +# mp3_file = AudioSegment.from_mp3(file) + +# # Zapis pliku WAV +# wav_file = file.replace('.mp3', '.wav') +# mp3_file.export(wav_file, format='wav') + +# # Usunięcie pliku MP3 +# os.remove(file) + +# # Przetwarzanie pliku WAV +# with wave.open(wav_file, 'rb') as input_file: +# output_file = os.path.splitext(file)[0] + ".wav" +# with wave.open(output_file, 'wb') as wav_file: +# wav_file.setnchannels(1) # Mono +# wav_file.setsampwidth(2) # 16-bit +# wav_file.setframerate(22500) # 22kHz + +# for i, subtitle in enumerate(subtitles, start=1): +# print( +# f"{i}\n{subtitle.start.to_time().strftime('%H:%M:%S.%f')[:-3]} --> {subtitle.end.to_time().strftime('%H:%M:%S.%f')[:-3]}\n{subtitle.text}\n") + +# start_time = subtitle.start.to_time() +# start_time = start_time.hour * 3600 + start_time.minute * \ +# 60 + start_time.second + start_time.microsecond / 1000000 + +# # Dodanie pustego frame'a do pliku WAV, jeśli jest to wymagane +# framerate = wav_file.getframerate() +# nframes = wav_file.getnframes() +# current_time = nframes / float(framerate) +# if start_time > current_time: +# empty_frame_duration = int( +# (start_time - current_time) * framerate) +# empty_frame = b'\x00' * empty_frame_duration * 2 +# wav_file.writeframes(empty_frame) + +# # Dodanie mowy do pliku WAV +# with wave.open(output_file, 'rb') as temp_file: +# data = temp_file.readframes(temp_file.getnframes()) +# wav_file.writeframes(data) + +# # Usunięcie pliku tymczasowego +# os.remove(output_file) + + +# import asyncio +# import os +# import wave +# from pydub import AudioSegment +# import edge_tts +# import subprocess +# import pysrt + +# VOICE = "pl-PL-ZofiaNeural" +# RATE = "+50%" +# VOLUME = "+0%" + + +# async def generate_speech(subtitle, voice, output_file, rate, volume): +# communicate = edge_tts.Communicate( +# subtitle.text, voice, rate=rate, volume=volume) +# await communicate.save(output_file) +# return output_file + + +# async def generate_wav_files(subtitles, voice, rate, volume): +# tasks = [] +# mp3_files = [] +# file_name = os.path.splitext(subtitles.path)[0] +# for i, subtitle in enumerate(subtitles, start=1): +# output_file = f"{file_name}_{i}.mp3" +# mp3_files.append(output_file) +# tasks.append(asyncio.create_task(generate_speech( +# subtitle, voice, output_file, rate, volume))) +# await asyncio.gather(*tasks) +# return mp3_files + + +# if __name__ == "__main__": +# dir_path = os.path.dirname(os.path.realpath(__file__)) +# for file in os.listdir(dir_path): +# if file.endswith(".srt"): +# subtitles = pysrt.open(os.path.join(dir_path, file)) +# mp3_files = asyncio.run(generate_wav_files( +# subtitles, VOICE, RATE, VOLUME)) +# for mp3_file in mp3_files: +# mp3_file_path = os.path.join(dir_path, mp3_file) +# if os.path.isfile(mp3_file_path): +# mp3_file_basename = os.path.splitext(mp3_file)[0] +# wav_file = f"{mp3_file_basename}.wav" +# mp3_audio = AudioSegment.from_file( +# mp3_file_path, format="mp3") +# mp3_audio.export(wav_file, format="wav") +# os.remove(mp3_file_path) + + +# # for i, subtitle in enumerate(subtitles, start=1): +# # print( +# # f"{i}\n{subtitle.start.to_time().strftime('%H:%M:%S.%f')[:-3]} --> {subtitle.end.to_time().strftime('%H:%M:%S.%f')[:-3]}\n{subtitle.text}\n") +# # start_time = subtitle.start.to_time() +# # start_time = start_time.hour * 3600 + start_time.minute * \ +# # 60 + start_time.second + start_time.microsecond / 1000000 +# # # 1.srt +# # # 10 +# # # = 1_10.wav +# # # wavfile = file[:-4] + "_" + str(i) + ".wav" +# # # print(file) +# # # print(i) diff --git a/mm_avh_working_space/tests/tts_test.py b/mm_avh_working_space/tests/tts_test.py new file mode 100644 index 0000000000000000000000000000000000000000..79c88260fcf73d4651866766cc1c54875c568d74 --- /dev/null +++ b/mm_avh_working_space/tests/tts_test.py @@ -0,0 +1,278 @@ +# # LEPSZA JAKOŚĆ +# # -> W VSC najedź kursorem na Communicate i naciśnij Ctrl + Click, aby przejść do communicate.py +# # -> Wyszukaj w pliku communicate.py audio-24khz-48kbitrate-mono-mp3 i zamień na audio-24khz-96kbitrate-mono-mp3 + +# pip install pyttsx3 +# pip install pysrt +# pip install wave +# pip install asyncio +# pip install edge_tts +# pip install termcolor + +import os +import time +import pysrt +import pyttsx3 +import wave +import asyncio +import edge_tts +from termcolor import cprint +from pydub import AudioSegment +import nltk +import subprocess +import contextlib +import winsound + + +def tts_local(choice): + def convert_srt_to_wav(dir_path): + # Inicjalizacja silnika mowy + engine = pyttsx3.init() + voices = engine.getProperty('voices') + for voice in voices: + if voice.name == 'Vocalizer Expressive Zosia Harpo 22kHz': + engine.setProperty('voice', voice.id) + engine.setProperty('rate', 200) # Szybkość mówienia + engine.setProperty('volume', 0.7) # Głośność + + # Konwersja wszystkich plików srt w katalogu + for file in os.listdir(dir_path): + if file.endswith(".srt"): + # Pobranie plików .srt + subtitles = pysrt.open(os.path.join( + dir_path, file), encoding='ANSI') + + # Odczytanie napisów i zapisanie mowy do pliku WAV + output_file = os.path.splitext(file)[0] + ".wav" + with wave.open(output_file, 'wb') as wav_file: + wav_file.setnchannels(1) # Mono + wav_file.setsampwidth(2) # 16-bit + wav_file.setframerate(22500) # 22kHz + + cprint('\n' + subtitles.path + '\n', 'green') + for i, subtitle in enumerate(subtitles, start=1): + print( + f"{i}\n{subtitle.start.to_time().strftime('%H:%M:%S.%f')[:-3]} --> {subtitle.end.to_time().strftime('%H:%M:%S.%f')[:-3]}\n{subtitle.text}\n") + + start_time = subtitle.start.to_time() + start_time = start_time.hour * 3600 + start_time.minute * \ + 60 + start_time.second + start_time.microsecond / 1000000 + # Zapisanie mowy do pliku WAV + engine.save_to_file(subtitle.text, "temp.wav") + engine.runAndWait() + + # Dodanie pustego frame'a do pliku WAV, jeśli jest to wymagane + framerate = wav_file.getframerate() + nframes = wav_file.getnframes() + current_time = nframes / float(framerate) + if start_time > current_time: + empty_frame_duration = int( + (start_time - current_time) * framerate) + empty_frame = b'\x00' * empty_frame_duration * 2 + wav_file.writeframes(empty_frame) + + # Dodanie mowy do pliku WAV + with wave.open("temp.wav", 'rb') as temp_file: + data = temp_file.readframes(temp_file.getnframes()) + wav_file.writeframes(data) + + # Usunięcie pliku tymczasowego + if os.path.exists("temp.wav"): + os.remove("temp.wav") + + def convert_srt_to_wav_balabolka(dir_path): + # BALABOLKA - BALKON.EXE + for file in os.listdir(dir_path): + if file.endswith(".srt"): + file_path = os.path.join(dir_path, file) + with contextlib.suppress(UnicodeDecodeError): + subtitles = pysrt.open(file_path, encoding='ANSI') + cprint('\n' + subtitles.path + '\n', 'green') + for i, subtitle in enumerate(subtitles, start=1): + print( + f"{i}\n{subtitle.start.to_time().strftime('%H:%M:%S.%f')[:-3]} --> {subtitle.end.to_time().strftime('%H:%M:%S.%f')[:-3]}\n{subtitle.text}\n") + command = f'balcon -f {file} -w {os.path.splitext(file)[0]}.wav -n "IVONA 2 Agnieszka" -s 5 -v 70' + subprocess.call(command, shell=True) + + dir_path = os.path.dirname(os.path.realpath(__file__)) + + if choice == 1: + convert_srt_to_wav(dir_path) + + if choice == 2: + convert_srt_to_wav_balabolka(dir_path) + + +def tts_edge_online(choice): + async def generate_speech(subtitle, voice, output_file, rate, volume): + communicate = edge_tts.Communicate( + subtitle.text, voice, rate=rate, volume=volume) + await communicate.save(output_file) + + async def generate_wav_files(subtitles, voice, rate, volume): + tasks = [] + mp3_files = [] + file_name = os.path.splitext(subtitles.path)[0] + for i, subtitle in enumerate(subtitles, start=1): + output_file = f"{file_name}_{i}.mp3" + mp3_files.append(output_file) + tasks.append(asyncio.create_task(generate_speech( + subtitle, voice, output_file, rate, volume))) + if i % 50 == 0: + await asyncio.gather(*tasks) + tasks = [] + # Poczekaj 5 sekund przed kontynuacją generowania plików + time.sleep(2) + await asyncio.gather(*tasks) + return mp3_files + + def merge_audio_files(mp3_files, subtitles): + file_name = os.path.splitext(subtitles.path)[0] + with wave.open(f"{file_name}.wav", 'wb') as wav_file: + wav_file.setnchannels(1) + wav_file.setsampwidth(2) + wav_file.setframerate(24000) + + audio_segments = [] + cprint('\n' + subtitles.path + '\n', 'green') + for i, mp3_file in enumerate(mp3_files, start=1): + print( + f"{i}\n{subtitles[i-1].start.to_time().strftime('%H:%M:%S.%f')[:-3]} --> {subtitles[i-1].end.to_time().strftime('%H:%M:%S.%f')[:-3]}\n{subtitles[i-1].text}\n") + + mp3_file_path = os.path.join(dir_path, mp3_file) + if os.path.isfile(mp3_file_path): + start_time = subtitles[i-1].start.to_time() + start_time = start_time.hour * 3600 + start_time.minute * \ + 60 + start_time.second + start_time.microsecond / 1000000 + sound = AudioSegment.from_file( + mp3_file_path, format="mp3") + audio_segments.append(sound) + os.remove(mp3_file_path) + + framerate = wav_file.getframerate() + nframes = wav_file.getnframes() + current_time = nframes / float(framerate) + if current_time < start_time: + empty_frame_duration = int( + (start_time - current_time) * framerate) + empty_frame = b'\x00' * empty_frame_duration * 2 + wav_file.writeframes(empty_frame) + + sound_data = sound.raw_data + wav_file.writeframes(sound_data) + + wav_file.close() + + dir_path = os.path.dirname(os.path.realpath(__file__)) + for file in os.listdir(dir_path): + # Zmienne silnika mowy Edge TTS + if choice == 3: + VOICE = "pl-PL-ZofiaNeural" + if choice == 4: + VOICE = "pl-PL-MarekNeural" + RATE = "+40%" + VOLUME = "+0%" + # RATE = "+0%" + # VOLUME = "+0%" + if file.endswith(".srt"): + subtitles = pysrt.open(os.path.join( + dir_path, file), encoding='ANSI') + mp3_files = asyncio.run(generate_wav_files( + subtitles, VOICE, RATE, VOLUME)) + merge_audio_files(mp3_files, subtitles) + + +def text_to_subtitles(): + dir_path = os.path.dirname(os.path.realpath(__file__)) + + def clean_text(file_path): + with open(file_path, 'r', encoding='utf8') as f: + lines = f.readlines() + with open(file_path, 'w', encoding='utf8') as f: + for line in lines: + line = line.strip() + f.write(line + "\n") + + def erasing_words(file_path): + words = ["(", ")", "[", "]", "<", ">", "{", "}", "\"", "『", "』", + "…", "「", "」", "„", "”", "«", "»", "...", "*", "'", "〈", "〉", ""] + with open(file_path, 'r', encoding='utf8') as f: + lines = f.readlines() + with open(file_path, 'w', encoding='utf8') as f: + for line in lines: + for word in words: + line = line.replace(word, "") + f.write(line) + + def txt_to_srt(file_path): + print("txt to srt") + with open(file_path, "r", encoding="utf-8") as f: + text = f.read() + text = text.split("\n") + text = [x for x in text if x != ""] + print(text) + subs = pysrt.SubRipFile() + index = 1 + for line in text: + sentences = nltk.sent_tokenize(line) + for sentence in sentences: + if all(c in '.,?!:;-–—' for c in sentence): + continue + subs.append(pysrt.SubRipItem(index, start='00:00:00,000', + end='00:00:00,000', text=sentence)) + index += 1 + srt_filename = os.path.splitext(file_path)[0] + "_.srt" + subs.save(srt_filename, encoding='utf-8') + + for file in os.listdir(dir_path): + if file.endswith(".txt"): + file_path = os.path.join(dir_path, file) + clean_text(file_path) + erasing_words(file_path) + txt_to_srt(file_path) + + for file_name in os.listdir(dir_path): + if file_name.endswith(".srt"): + file_path = os.path.join(dir_path, file_name) + + with contextlib.suppress(UnicodeDecodeError): + with open(file_path, "r", encoding="utf-8") as file: + content = file.read() + + with open(file_path, "w", encoding="ANSI") as file: + file.write(content) + + +def main(): + start_time = time.time() + # red green yellow white attrs=['bold'] + cprint("╚═══ Multimedia Magic – Audio Visual Heaven ═══╝", + 'white', attrs=['bold']) + cprint("") + cprint("Wybierz jedną z poniższych opcji (tylko .txt, .srt):") + cprint("1. TTS - Zosia - Harpo") + cprint("2. TTS - Agnieszka - Ivona") + cprint("3. TTS - Zofia - Edge") + cprint("4. TTS - Marek - Edge") + + choice = input("Wybierz numer opcji: ") + text_to_subtitles() + if choice == '1': + tts_local(choice=1) + if choice == '2': + tts_local(choice=2) + if choice == '3': + tts_edge_online(choice=3) + if choice == '4': + tts_edge_online(choice=4) + + # Mierz czas + print("--- %s seconds ---" % (time.time() - start_time)) + print("--- %s minutes ---" % ((time.time() - start_time) / 60)) + print("--- %s hours ---" % ((time.time() - start_time) / 3600)) + + winsound.PlaySound('complete.wav', winsound.SND_FILENAME) + + +if __name__ == "__main__": + main() diff --git a/mm_avh_working_space/utils/cool_animation.py b/mm_avh_working_space/utils/cool_animation.py new file mode 100644 index 0000000000000000000000000000000000000000..c8d5cd1c4c6740afcd96202b5842c8a20303ff5f --- /dev/null +++ b/mm_avh_working_space/utils/cool_animation.py @@ -0,0 +1,143 @@ +""" + This script defines the 'CoolAnimation' class, which creates a text-based animation effect. + It uses a specified load string and cycles through different characters to create animation. + + * Usage: + To use this script, simply create an instance of the 'CoolAnimation' class and call the 'display' method. + + * Example usage: + from cool_animation import CoolAnimation + + # Create an instance of CoolAnimation + animation = CoolAnimation(load_str="multimedia magic audio visual heaven") + + # Display the animation until user input + animation.display() + + * Example usage: + if __name__ == '__main__': + mm_avh = CoolAnimation() + mm_avh.display() + + if __name__ == '__main__': + mm_avh = CoolAnimation(load_str="audio visual heaven ", + show_border=True, + middle_offset=10, # +/- chars from the middle + use_animation=True) + mm_avh.display() +""" + +from os import name, system +import sys +from threading import Thread +from time import sleep +from typing import List + + +class CoolAnimation: + """ + This class provides methods to display a text-based animation effect. + + Attributes: + - load_str (str): + The input string used for creating the animation effect. + + - ls_len (int): + The length of the load string. + + - animation (str): + A set of characters used for animation. + + - stop_animation (bool): + A flag to control the animation loop. + + - show_border (bool): + A flag to control whether to display the border around the animation. + + - middle_offset (int): + An offset to customize the position where the animation character is displayed within the string. + + - use_animation (bool): + A flag to control whether animation characters are added to the string. + + Methods: + - __init__(self, load_str: str = "multimedia magic audio visual heaven ", + show_border: bool = True, middle_offset: int = 2, use_animation: bool = True) + Initializes a CoolAnimation object with given options. + + - display(self) -> None: + Displays the animation until user input is detected. + + - check_input(self) -> None: + Helper method to check for user input and stop the animation. + + - display(self) -> None: + Main method to display the animation effect. + """ + + def __init__(self, load_str: str = "multimedia magic audio visual heaven", + show_border: bool = True, middle_offset: int = -2, use_animation: bool = True) -> None: + self.load_str: str = load_str + self.ls_len: int = len(load_str) + self.animation: str = "|/-\\" + self.stop_animation: bool = False + self.show_border: bool = show_border + self.middle_offset: int = middle_offset + self.use_animation: bool = use_animation + + def check_input(self) -> None: + """ + Helper method to check for user input and stop the animation. + """ + input() + self.stop_animation = True + + def display(self) -> None: + """ + Main method to display the animation effect. + """ + if name == "nt": + system("cls") + else: + system("clear") + ani_count: int = 0 + count_time: int = 0 + i: int = 0 + + Thread(target=self.check_input).start() + + while not self.stop_animation: + sleep(0.075) + load_str_list: List[str] = list(self.load_str) + ascii_val: int = ord(load_str_list[i]) + new_ascii_val: int = 0 + if ascii_val != 32: # 32 is ASCII for ' ' + new_ascii_val = ascii_val-32 if ascii_val > 90 else ascii_val + 32 + load_str_list[i] = chr(new_ascii_val) + res: str = '' + for j in range(self.ls_len): + res = res + load_str_list[j] + + if self.use_animation: + middle: int = len(res) // 2 + self.middle_offset + res_with_anim: str = res[:middle] + \ + self.animation[ani_count] + res[middle+1:] + else: + res_with_anim = res + + if self.show_border: + sys.stdout.write( + "\r" + "\033[1;37m" + "╚═══ " + res_with_anim + " ═══╝ " + "\033[0m") + else: + sys.stdout.write( + "\r" + "\033[1;37m" + res_with_anim + "\033[0m") + + self.load_str = res + sleep(0.075) + ani_count = (ani_count + 1) % 4 + i = (i + 1) % self.ls_len + count_time = count_time + 1 + if name == "nt": + system("cls") + else: + system("clear") diff --git a/mm_avh_working_space/utils/execution_timer.py b/mm_avh_working_space/utils/execution_timer.py new file mode 100644 index 0000000000000000000000000000000000000000..2815043ed9f7a5c027bcd138669dc00d69264aae --- /dev/null +++ b/mm_avh_working_space/utils/execution_timer.py @@ -0,0 +1,130 @@ +""" + Module execution_timer provides an ExecutionTimer class + to measure the execution time of a code block. + It offers two usage options: as a context manager and as a decorator. + + * Example usage as a context manager: + with ExecutionTimer(): + main() + + * Example usage as a decorator: + @execution_timer + def main(): + # Code block to measure execution time +""" + +from datetime import datetime +from time import perf_counter_ns + +from dataclasses import dataclass +from rich.console import Console + + +@dataclass(slots=True) +class ExecutionTimer: + """ + ExecutionTimer is a context manager that measures the execution time of a code block. + It captures the start time, end time, and duration of the code block. + """ + + start_date: datetime = None + end_date: datetime = None + start_time_ns: int = None + end_time_ns: int = None + console: Console = Console() + + def __post_init__(self): + self.start_date = datetime.now() + self.start_time_ns = perf_counter_ns() + + def __enter__(self) -> 'ExecutionTimer': + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + try: + self.end_date = datetime.now() + self.end_time_ns = perf_counter_ns() + self.display_time() + except AttributeError: + print('An error occurred: __exit__') + + @staticmethod + def current_datetime(date: datetime) -> str: + """ + Formats a datetime object as a string in the format 'YYYY-MM-DD HH:MM:SS'. + """ + + return f'[yellow]{date.year}-{date.month:02d}-{date.day:02d}' \ + f' [white bold]{date.hour:02d}:{date.minute:02d}:{date.second:02d}' + + def calculate_duration(self) -> str: + """ + Calculates the duration of the code block in hours, minutes, seconds, milliseconds, + microseconds, and nanoseconds. + """ + + duration_ns: int = self.end_time_ns - self.start_time_ns + duration_s, duration_ns = map(int, divmod(duration_ns, 1_000_000_000)) + duration_ms, duration_ns = map(int, divmod(duration_ns, 1_000_000)) + duration_us, duration_ns = map(int, divmod(duration_ns, 1_000)) + + hours, remainder = map(int, divmod(duration_s, 3600)) + minutes, seconds = map(int, divmod(remainder, 60)) + + return f'[white bold]{hours:02d}:{minutes:02d}:{seconds:02d}:' \ + f'{duration_ms:03d}:{duration_us:03d}:{duration_ns:03d}' + + def calculate_duration_alt(self) -> tuple[float, ...]: + """ + Calculates the duration of the code block in hours, minutes, and seconds + using an alternative method. + """ + + duration_ns: int = self.end_time_ns - self.start_time_ns + hours_alt: float = duration_ns / 1_000_000_000 / 60 / 60 + minutes_alt: float = duration_ns / 1_000_000_000 / 60 + seconds_alt: float = duration_ns / 1_000_000_000 + + return hours_alt, minutes_alt, seconds_alt + + def display_time(self): + """ + Displays the start date, end date, and duration of the code block execution. + """ + + start_date_str: str = self.current_datetime(self.start_date) + end_date_str: str = self.current_datetime(self.end_date) + duration: str = self.calculate_duration() + hours_alt, minutes_alt, seconds_alt = map( + float, self.calculate_duration_alt()) + + self.console.print( + '\n[bold white]╚═══════════ EXECUTION TIME ═══════════╝') + self.console.print( + '[bold bright_yellow] YYYY-MM-DD HH:MM:SS:ms :µs :ns') + self.console.print( + f'[bright_red bold][[bold white]START[bright_red bold]] {start_date_str}') + self.console.print( + f'[bright_red bold][[bold white]END[bright_red bold]] {end_date_str}') + self.console.print( + f'[bright_red bold][[bold white]TIME[bright_red bold]] [bold bright_yellow]YYYY-MM-DD {duration}') + self.console.print('[bright_red bold] ^^^^^^^^^^^^') + self.console.print( + f'[bright_red bold][[bold white]TIME[bright_red bold]] [white bold]{hours_alt:.9f} hours') + self.console.print( + f'[bright_red bold][[bold white]TIME[bright_red bold]] [white bold]{minutes_alt:.9f} minutes') + self.console.print( + f'[bright_red bold][[bold white]TIME[bright_red bold]] [white bold]{seconds_alt:.9f} seconds') + + +def execution_timer(func): + """ + Decorator that measures the execution time of a function using ExecutionTimer. + """ + + def wrapper(*args, **kwargs): + with ExecutionTimer(): + result = func(*args, **kwargs) + return result + + return wrapper diff --git a/mm_avh_working_space/utils/number_in_words.py b/mm_avh_working_space/utils/number_in_words.py new file mode 100644 index 0000000000000000000000000000000000000000..713479bdb996fe7444114e5df185b242a26f03cd --- /dev/null +++ b/mm_avh_working_space/utils/number_in_words.py @@ -0,0 +1,270 @@ +""" + Module `NumberInWords` provides a class `NumberInWords` + that converts numbers into Polish words. + It offers several functions that can be used in various contexts. + + -*- coding: utf-8 -*- + + * Example: First, create an instance of the `NumberInWords` class: + number_in_words = NumberInWords() + + * Example usage of function `_number_in_words_3digits`: + print(number_in_words._number_in_words_3digits(123)) + Outputs: "sto dwadzieścia trzy" + + * Example usage of function `_case`: + print(number_in_words._case(1)) # Outputs: 0 + print(number_in_words._case(12)) # Outputs: 2 + print(number_in_words._case(23)) # Outputs: 1 + + * Example usage of function `number_in_words`: + Inputs: int, float, str (string works with long (30 digits, 15 on both sides) floating point numbers) + print('Int: 123456789012345 =', number_in_words.number_in_words(123_456_789_012_345)) + print('Float: 0.123456789012345 =', + number_in_words.number_in_words(0.123_456_789_012_345)) + print('String: 123456789012345.123456789012345 =', + number_in_words.number_in_words('123_456_789_012_345.123_456_789_012_345')) + print('String: 123456789012345,123456789012345 =', + number_in_words.number_in_words('123_456_789_012_345,123_456_789_012_345')) + + * Example usage of function `thing_in_words`: + print(number_in_words.thing_in_words(5, ["jabłko", "jabłka", "jabłek"])) + Outputs: "pięć jabłek" + + print(number_in_words.thing_in_words(21, ["jabłko", "jabłka", "jabłek"])) + Outputs: "dwadzieścia jeden jabłek" + + * Example usage of function `amount_in_words`: + print(number_in_words.amount_in_words(1234.56)) + Outputs: "jeden tysiąc dwieście trzydzieści cztery złote 56/100" + + print(number_in_words.amount_in_words(567.89, fmt=1)) + Outputs: "pięćset sześćdziesiąt siedem złotych osiemdziesiąt dziewięć groszy" + + * Example usage of function `convert_numbers_in_text`: + print(number_in_words.convert_numbers_in_text('Rozdział 69.2_3 / 4 (test96).')) + Outputs: "Rozdział sześćdziesiąt dziewięć przecinek dwa_trzy / cztery (test dziewięćdziesiąt sześć)." +""" + +import re +from dataclasses import dataclass, field +from typing import List, Union + +from six import u + + +@dataclass +class NumberInWords: + """ + NumberInWords is a class that converts numbers into Polish words. + """ + + UNITS: list = field(default_factory=lambda: [ + u(""), u("jeden"), u("dwa"), u("trzy"), + u("cztery"), u("pięć"), u("sześć"), + u("siedem"), u("osiem"), u("dziewięć") + ]) + TENS: list = field(default_factory=lambda: [ + u(""), u("dziesięć"), u("dwadzieścia"), u("trzydzieści"), + u("czterdzieści"), u("pięćdziesiąt"), u("sześćdziesiąt"), + u("siedemdziesiąt"), u( + "osiemdziesiąt"), u("dziewięćdziesiąt") + ]) + TEENS: list = field(default_factory=lambda: [ + u("dziesięć"), u("jedenaście"), u("dwanaście"), + u("trzynaście"), u("czternaście"), u("piętnaście"), + u("szesnaście"), u("siedemnaście"), u("osiemnaście"), + u("dziewiętnaście") + ]) + HUNDREDS: list = field(default_factory=lambda: [ + u(""), u("sto"), u("dwieście"), u("trzysta"), + u("czterysta"), u("pięćset"), u("sześćset"), + u("siedemset"), u("osiemset"), u("dziewięćset") + ]) + BIG: list = field(default_factory=lambda: [ + [u("x"), u("x"), u("x")], + [u("tysiąc"), u("tysiące"), u("tysięcy")], + [u("milion"), u("miliony"), u("milionów")], + [u("miliard"), u("miliardy"), u("miliardów")], + [u("bilion"), u("biliony"), u("bilionów")], + # Add more if needed + ]) + ZLOTYS: list = field(default_factory=lambda: [ + u("złoty"), u("złote"), u("złotych") + ]) + GROSZES: list = field(default_factory=lambda: [ + u("grosz"), u("grosze"), u("groszy") + ]) + + def _number_in_words_3digits(self, number: int) -> str: + """ + This method converts a three-digit number into words in Polish. + """ + unit: int = number % 10 + ten: int = (number // 10) % 10 + hundred: int = (number // 100) % 10 + words: List[str] = [] + + if hundred > 0: + words.append(self.HUNDREDS[hundred]) + if ten == 1: + words.append(self.TEENS[unit]) + else: + if ten > 0: + words.append(self.TENS[ten]) + if unit > 0: + words.append(self.UNITS[unit]) + return u(" ").join(words) + + def _case(self, number: int) -> int: + """ + This method determines the grammatical case for a given number. It's used to correctly form the word for thousands, millions, etc. in Polish. + """ + if number == 1: + return 0 + unit: int = number % 10 + return 2 if (number // 10) % 10 == 1 and unit > 1 or not 2 <= unit <= 4 else 1 + + def number_in_words(self, number: Union[int, float, str]) -> str: + """ + This method converts a number (including decimal numbers) into words in Polish. + """ + if isinstance(number, (int, float)): + number = str(number) + + if '.' in number: + integer_part: int + decimal_part: int + integer_part, decimal_part = map(int, number.split('.')) + elif ',' in number: + integer_part: int + decimal_part: int + integer_part, decimal_part = map(int, number.split(',')) + else: + integer_part: int = int(number) + decimal_part: int = 0 + + words: List[str] = [] + if integer_part == 0: + words.append(u("zero")) + else: + triples: List[int] = [] + while integer_part > 0: + triples.append(integer_part % 1000) + integer_part //= 1000 + for i, n in enumerate(triples): + if n > 0: + if i > 0 and n == 1: + p: int = self._case(n) + w: str = self.BIG[i][p] + words.append(w) + elif i > 0: + p: int = self._case(n) + w: str = self.BIG[i][p] + words.append( + self._number_in_words_3digits(n) + u(" ") + w) + else: + words.append(self._number_in_words_3digits(n)) + words.reverse() + + if decimal_part != 0: + words.extend( + (u("przecinek"), self.number_in_words(str(decimal_part)))) + return u(" ").join(words) + + def thing_in_words(self, number: int, thing: List[str]) -> str: + """ + This method converts a number into words and appends the correct form of a noun. The noun's form depends on the number and is given as a list of three forms for different cases. + + In words "how many things" + + Args: + - number - int + - thing - array of cases [coś, cosie, cosiów] + + """ + return self.number_in_words(number) + u(" ") + thing[self._case(number)] + + def amount_in_words(self, number: float, fmt: int = 0) -> str: + """ + This method converts a monetary amount into words in Polish. The amount is given as a float, where the integer part is the number of zlotys and the fractional part is the number of groszes. The fmt parameter determines how groszes are formatted: if fmt is 0, groszes are in the form xx/100, otherwise they are converted into words. + + In words zlotys, groszes. + + Args: + - number - float, number of zlotys with groszes after the comma + - fmt - (format) if 0, then groszes in the form xx/100, in words in p. case + """ + lzlotys: int = int(number) + lgroszes: int = int(number * 100 + 0.5) % 100 + if fmt != 0: + grosz_in_words: str = self.thing_in_words(lgroszes, self.GROSZES) + else: + grosz_in_words: str = u("%d/100") % lgroszes + return self.thing_in_words(lzlotys, self.ZLOTYS) + u(" ") + grosz_in_words + + def convert_numbers_in_text(self, text: str) -> str: + """ + This method converts numbers in a text into words in Polish. Yes is not perfect, but it works in most cases. If you want grammatical correctness use AI. + """ + result: str = '' + number: str = '' + special_chars: List[str] = ['!', '@', '#', '$', '%', '^', '&', '*', + '(', ')', '_', '+', '~', '`', '{', '}', '|', '[', ']', '\\', ':', '"', ';', "'", '<', '>', '?', '/', '-'] + for i, char in enumerate(text): + if char.isdigit() or (char in ['.', ','] and i > 0 and i < len(text) - 1 and text[i-1].isdigit() and text[i+1].isdigit()): + number += char + else: + if number and number not in special_chars: + for special_char in special_chars: + if number.count(special_char) > 1: + for part in number.split(special_char): + number_in_words: str = self.number_in_words( + part) + result += number_in_words + special_char + # Usuwamy ostatni znak specjalny + result = result[:-1] + break + else: + if number.count('.') == 1 or number.count(',') == 1: + number_in_words: str = self.number_in_words(number) + if ( + result + and not result[-1].isspace() + and result[-1] not in special_chars + ): + result += ' ' + result += number_in_words + else: + parts: List[str] = re.split('(\D)', number) + for part in parts: + if part.isdigit(): + number_in_words: str = self.number_in_words( + part) + if ( + result + and not result[-1].isspace() + and result[-1] not in special_chars + ): + result += ' ' + result += number_in_words + else: + result += part + if ( + i < len(text) - 1 + and not text[i].isspace() + and text[i] not in special_chars + ): + result += ' ' + number = '' + result += char + if number and number not in special_chars: + number_in_words: str = self.number_in_words(number) + if ( + result + and not result[-1].isspace() + and result[-1] not in special_chars + ): + result += ' ' + result += number_in_words + return result diff --git a/mm_avh_working_space/working_space/output/test b/mm_avh_working_space/working_space/output/test new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/mm_avh_working_space/working_space/temp/alt_subs/test b/mm_avh_working_space/working_space/temp/alt_subs/test new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/mm_avh_working_space/working_space/temp/main_subs/test b/mm_avh_working_space/working_space/temp/main_subs/test new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/mm_avh_working_space/working_space/test b/mm_avh_working_space/working_space/test new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391